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

Method addSettings

src/Menu/OptionsAdvancedState.cpp:137–155  ·  view source on GitHub ↗

* Adds a bunch of settings to the list. * @param settings List of settings. */

Source from the content-addressed store, hash-verified

135 * @param settings List of settings.
136 */
137void OptionsAdvancedState::addSettings(const std::vector<OptionInfo> &settings)
138{
139 for (std::vector<OptionInfo>::const_iterator i = settings.begin(); i != settings.end(); ++i)
140 {
141 std::wstring name = tr(i->description());
142 std::wstring value;
143 if (i->type() == OPTION_BOOL)
144 {
145 value = *i->asBool() ? tr("STR_YES") : tr("STR_NO");
146 }
147 else if (i->type() == OPTION_INT)
148 {
149 std::wostringstream ss;
150 ss << *i->asInt();
151 value = ss.str();
152 }
153 _lstOptions->addRow(2, name.c_str(), value.c_str());
154 }
155}
156
157/**
158 * Gets the currently selected setting.

Callers

nothing calls this directly

Calls 5

descriptionMethod · 0.80
typeMethod · 0.80
asBoolMethod · 0.80
asIntMethod · 0.80
addRowMethod · 0.80

Tested by

no test coverage detected