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