3 Copyright (C) 2020 Elias Fleckenstein <eliasfleckenstein@web.de>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation; either version 2.1 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 #include "client/client.h"
23 #include "irrlichttypes_extrabloated.h"
24 #include "script/scripting_client.h"
28 #define CHEAT_MENU_GET_SCRIPTPTR \
29 ClientScripting *script = m_client->getScript(); \
30 if (!script || !script->m_cheats_loaded) \
33 enum CheatMenuEntryType
35 CHEAT_MENU_ENTRY_TYPE_HEAD,
36 CHEAT_MENU_ENTRY_TYPE_CATEGORY,
37 CHEAT_MENU_ENTRY_TYPE_ENTRY,
43 CheatMenu(Client *client);
45 ClientScripting *getScript() { return m_client->getScript(); }
47 void draw(video::IVideoDriver *driver, bool show_debug);
49 void drawHUD(video::IVideoDriver *driver, double dtime);
51 void drawEntry(video::IVideoDriver *driver, std::string name, int number,
52 bool selected, bool active,
53 CheatMenuEntryType entry_type = CHEAT_MENU_ENTRY_TYPE_ENTRY);
62 bool m_cheat_layer = false;
63 int m_selected_cheat = 0;
64 int m_selected_category = 0;
66 int m_head_height = 50;
67 int m_entry_height = 40;
68 int m_entry_width = 200;
71 video::SColor m_bg_color = video::SColor(192, 255, 145, 88);
72 video::SColor m_active_bg_color = video::SColor(192, 255, 87, 53);
73 video::SColor m_font_color = video::SColor(255, 0, 0, 0);
74 video::SColor m_selected_font_color = video::SColor(255, 255, 252, 88);
76 FontMode fontStringToEnum(std::string str);
80 gui::IGUIFont *m_font = nullptr;
83 float m_rainbow_offset = 0.0;