SuperTuxKart
options_screen_input.hpp
1 // SuperTuxKart - a fun racing game with go-kart
2 // Copyright (C) 2009-2015 Marianne Gagnon
3 //
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License
6 // as published by the Free Software Foundation; either version 3
7 // of the License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 
18 
19 #ifndef __HEADER_OPTIONS_SCREEN_INPUT_HPP__
20 #define __HEADER_OPTIONS_SCREEN_INPUT_HPP__
21 
22 #include <string>
23 #include "guiengine/screen.hpp"
24 
25 namespace GUIEngine { class Widget; }
26 class DeviceConfig;
27 namespace irr { namespace gui { class STKModifiedSpriteBank; } namespace video { class IVideoDriver; } }
28 
29 
30 struct Input;
31 
36 class OptionsScreenInput : public GUIEngine::Screen, public GUIEngine::ScreenSingleton<OptionsScreenInput>
37 {
38  size_t m_gamepad_count;
40 
41  void updateInputButtons(DeviceConfig* config);
42  void buildDeviceList();
43 
44  irr::gui::STKModifiedSpriteBank* m_icon_bank;
45 
46  std::map<std::string, float> m_highlights;
47 
48 public:
49  friend class GUIEngine::ScreenSingleton<OptionsScreenInput>;
50 
52  virtual void loadedFromFile();
53 
55  virtual void eventCallback(GUIEngine::Widget* widget, const std::string& name, const int playerID);
56 
58  virtual void unloaded();
59 
61  virtual void init();
62 
67  void rebuildDeviceList();
68 
70  virtual void filterInput(Input::InputType type,
71  int deviceID,
72  int btnID,
73  int axisDir,
74  int value);
75 
77  virtual void onUpdate(float dt);
78 };
79 
80 #endif
Contains all GUI engine related classes and functions.
Definition: abstract_state_manager.hpp:31
contains the key bindings information related to one input device
Definition: device_config.hpp:41
Definition: three_d_animation.hpp:32
Definition: input.hpp:34
Input options screen.
Definition: options_screen_input.hpp:36
Represents a single GUI screen.
Definition: screen.hpp:96
Declares a class to be a singleton.
Definition: screen.hpp:58
The nearly-abstract base of all widgets (not fully abstract since a bare Widget can be created for th...
Definition: widget.hpp:142