Properly and efficiently use split utility headers
[oweals/minetest.git] / src / guiKeyChangeMenu.h
1 /*
2  Minetest-c55
3  Copyright (C) 2010-11 celeron55, Perttu Ahola <celeron55@gmail.com>
4  Copyright (C) 2011 Ciaran Gultnieks <ciaran@ciarang.com>
5  Copyright (C) 2011 teddydestodes <derkomtur@schattengang.net>
6
7  This program is free software; you can redistribute it and/or modify
8  it under the terms of the GNU Lesser General Public License as published by
9  the Free Software Foundation; either version 2.1 of the License, or
10  (at your option) any later version.
11
12  This program 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 Lesser General Public License for more details.
16
17  You should have received a copy of the GNU Lesser General Public License along
18  with this program; if not, write to the Free Software Foundation, Inc.,
19  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20  */
21
22 #ifndef GUIKEYCHANGEMENU_HEADER
23 #define GUIKEYCHANGEMENU_HEADER
24
25 #include "common_irrlicht.h"
26 #include "modalMenu.h"
27 #include "client.h"
28 #include "gettext.h"
29 #include "keycode.h"
30 #include <string>
31
32 class GUIKeyChangeMenu: public GUIModalMenu
33 {
34 public:
35         GUIKeyChangeMenu(gui::IGUIEnvironment* env, gui::IGUIElement* parent,
36                         s32 id, IMenuManager *menumgr);
37         ~GUIKeyChangeMenu();
38
39         void removeChildren();
40         /*
41          Remove and re-add (or reposition) stuff
42          */
43         void regenerateGui(v2u32 screensize);
44
45         void drawMenu();
46
47         bool acceptInput();
48
49         bool OnEvent(const SEvent& event);
50
51 private:
52
53         void init_keys();
54
55         bool resetMenu();
56
57         gui::IGUIButton *forward;
58         gui::IGUIButton *backward;
59         gui::IGUIButton *left;
60         gui::IGUIButton *right;
61         gui::IGUIButton *use;
62         gui::IGUIButton *sneak;
63         gui::IGUIButton *jump;
64         gui::IGUIButton *dropbtn;
65         gui::IGUIButton *inventory;
66         gui::IGUIButton *fly;
67         gui::IGUIButton *fast;
68         gui::IGUIButton *range;
69         gui::IGUIButton *dump;
70         gui::IGUIButton *chat;
71         gui::IGUIButton *cmd;
72         gui::IGUIButton *console;
73
74         s32 activeKey;
75         KeyPress key_forward;
76         KeyPress key_backward;
77         KeyPress key_left;
78         KeyPress key_right;
79         KeyPress key_use;
80         KeyPress key_sneak;
81         KeyPress key_jump;
82         KeyPress key_drop;
83         KeyPress key_inventory;
84         KeyPress key_fly;
85         KeyPress key_fast;
86         KeyPress key_range;
87         KeyPress key_chat;
88         KeyPress key_cmd;
89         KeyPress key_console;
90         KeyPress key_dump;
91 };
92
93 #endif
94