| 98 | } |
| 99 | |
| 100 | void OptionsModsState::lstModsClick(Action *action) |
| 101 | { |
| 102 | std::string selectedMod = _mods[_lstMods->getSelectedRow()]; |
| 103 | std::vector<std::string>::iterator i = std::find(Options::rulesets.begin(), Options::rulesets.end(), selectedMod); |
| 104 | bool modEnabled = (i != Options::rulesets.end()); |
| 105 | if (modEnabled) |
| 106 | { |
| 107 | _lstMods->setCellText(_lstMods->getSelectedRow(), 1, tr("STR_NO").c_str()); |
| 108 | Options::rulesets.erase(i); |
| 109 | } |
| 110 | else |
| 111 | { |
| 112 | _lstMods->setCellText(_lstMods->getSelectedRow(), 1, tr("STR_YES").c_str()); |
| 113 | Options::rulesets.push_back(selectedMod); |
| 114 | } |
| 115 | Options::reload = true; |
| 116 | } |
| 117 | |
| 118 | } |
nothing calls this directly
no test coverage detected