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

Method addControls

src/Menu/OptionsControlsState.cpp:152–163  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

150 * @param keys List of controls.
151 */
152void OptionsControlsState::addControls(const std::vector<OptionInfo> &keys)
153{
154 for (std::vector<OptionInfo>::const_iterator i = keys.begin(); i != keys.end(); ++i)
155 {
156 std::wstring name = tr(i->description());
157 SDLKey *key = i->asKey();
158 std::wstring keyName = Language::utf8ToWstr(ucWords(SDL_GetKeyName(*key)));
159 if (*key == SDLK_UNKNOWN)
160 keyName = L"";
161 _lstControls->addRow(2, name.c_str(), keyName.c_str());
162 }
163}
164
165/**
166 * Gets the currently selected control.

Callers

nothing calls this directly

Calls 3

descriptionMethod · 0.80
asKeyMethod · 0.80
addRowMethod · 0.80

Tested by

no test coverage detected