MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / lstModsClick

Method lstModsClick

src/Menu/OptionsModsState.cpp:100–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98}
99
100void 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}

Callers

nothing calls this directly

Calls 2

getSelectedRowMethod · 0.80
setCellTextMethod · 0.80

Tested by

no test coverage detected