OpenXcom  1.0
Open-source clone of the original X-Com
OptionsControlsState.h
1 #pragma once
2 /*
3  * Copyright 2010-2016 OpenXcom Developers.
4  *
5  * This file is part of OpenXcom.
6  *
7  * OpenXcom is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * OpenXcom is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with OpenXcom. If not, see <http://www.gnu.org/licenses/>.
19  */
20 #include <string>
21 #include <vector>
22 #include "../Engine/OptionInfo.h"
23 #include "OptionsBaseState.h"
24 
25 namespace OpenXcom
26 {
27 
28 class TextList;
29 
35 {
36 private:
37  TextList *_lstControls;
38  std::vector<OptionInfo> _controlsGeneral, _controlsGeo, _controlsBattle;
39  int _selected;
40  OptionInfo *_selKey;
41  Uint8 _colorGroup, _colorSel, _colorNormal;
42 
43  void addControls(const std::vector<OptionInfo> &keys);
44  OptionInfo *getControl(size_t sel);
45  std::string ucWords(std::string str);
46 public:
48  OptionsControlsState(OptionsOrigin origin);
52  void init();
54  void lstControlsClick(Action *action);
56  void lstControlsKeyPress(Action *action);
57 };
58 
59 }
Container for all the information associated with a given user action, like mouse clicks...
Definition: Action.h:32
Helper class that ties metadata to particular options to help in serializing and stuff.
Definition: OptionInfo.h:35
List of Text&#39;s split into columns.
Definition: TextList.h:40
~OptionsControlsState()
Cleans up the Controls state.
Definition: OptionsControlsState.cpp:93
OptionsControlsState(OptionsOrigin origin)
Creates the Controls state.
Definition: OptionsControlsState.cpp:35
void lstControlsKeyPress(Action *action)
Handler for pressing a key in the Controls list.
Definition: OptionsControlsState.cpp:229
void lstControlsClick(Action *action)
Handler for clicking the Controls list.
Definition: OptionsControlsState.cpp:187
Controls screen which allows the user to customize the various key shortcuts in the game...
Definition: OptionsControlsState.h:34
void init()
Fills controls list.
Definition: OptionsControlsState.cpp:100
Definition: BaseInfoState.cpp:40
Options base state for common stuff across Options windows.
Definition: OptionsBaseState.h:41