aboutsummaryrefslogtreecommitdiff
path: root/src/gui/cheatMenu.h
diff options
context:
space:
mode:
authorElias Fleckenstein <54945686+EliasFleckenstein03@users.noreply.github.com>2020-11-04 14:40:09 +0100
committerGitHub <noreply@github.com>2020-11-04 14:40:09 +0100
commitfba7dc2168954ff73f80d8e749d11bd2f55e6fbd (patch)
tree08182e80b69d5352f81c6827d3caa4efe13e6f14 /src/gui/cheatMenu.h
parenta7dc1135e94bde5f8c3385d54388563eaffe7553 (diff)
parentfc8c8f01ca15912b1db176fec473bcfb0333032f (diff)
downloaddragonfireclient-fba7dc2168954ff73f80d8e749d11bd2f55e6fbd.tar.xz
Merge pull request #8 from realOneplustwo/master
Improved Cheat Menu
Diffstat (limited to 'src/gui/cheatMenu.h')
-rw-r--r--src/gui/cheatMenu.h37
1 files changed, 23 insertions, 14 deletions
diff --git a/src/gui/cheatMenu.h b/src/gui/cheatMenu.h
index f67cdea5a..bedd7e048 100644
--- a/src/gui/cheatMenu.h
+++ b/src/gui/cheatMenu.h
@@ -19,7 +19,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#pragma once
+#include "client/client.h"
#include "irrlichttypes_extrabloated.h"
+#include "script/scripting_client.h"
+#include <cstddef>
#include <string>
#define CHEAT_MENU_GET_SCRIPTPTR \
@@ -27,27 +30,31 @@ with this program; if not, write to the Free Software Foundation, Inc.,
if (!script || !script->m_cheats_loaded) \
return;
-class Client;
-
-typedef enum
+enum CheatMenuEntryType
{
CHEAT_MENU_ENTRY_TYPE_HEAD,
CHEAT_MENU_ENTRY_TYPE_CATEGORY,
CHEAT_MENU_ENTRY_TYPE_ENTRY,
-} CheatMenuEntryType;
+};
class CheatMenu
{
public:
CheatMenu(Client *client);
+ ClientScripting *getScript()
+ {
+ return m_client->getScript();
+ }
+
void draw(video::IVideoDriver *driver, bool show_debug);
void drawHUD(video::IVideoDriver *driver, double dtime);
- void drawEntry(video::IVideoDriver *driver, std::string name, int number,
- bool selected, bool active,
- CheatMenuEntryType entry_type = CHEAT_MENU_ENTRY_TYPE_ENTRY);
+ void drawEntry(video::IVideoDriver *driver, std::string name,
+ std::size_t column_align_index, std::size_t cheat_entry_index,
+ bool is_selected, bool is_enabled,
+ CheatMenuEntryType entry_type = CHEAT_MENU_ENTRY_TYPE_ENTRY);
void selectUp();
void selectDown();
@@ -60,15 +67,17 @@ private:
int m_selected_cheat = 0;
int m_selected_category = 0;
- int m_head_height = 50;
- int m_entry_height = 40;
- int m_entry_width = 200;
+ int m_head_height = 20;
+ int m_entry_height = 20;
+ int m_entry_width = 150;
int m_gap = 3;
- video::SColor m_bg_color = video::SColor(192, 255, 145, 88);
- video::SColor m_active_bg_color = video::SColor(192, 255, 87, 53);
- video::SColor m_font_color = video::SColor(255, 0, 0, 0);
- video::SColor m_selected_font_color = video::SColor(255, 255, 252, 88);
+ video::SColor m_bg_color = video::SColor(173, 45, 45, 68);
+ video::SColor m_active_bg_color = video::SColor(210, 0, 0, 0);
+ video::SColor m_font_color = video::SColor(195, 255, 255, 255);
+ video::SColor m_selected_font_color = video::SColor(235, 255, 255, 255);
+
+ FontMode fontStringToEnum(std::string str);
Client *m_client;