]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/gui/cheatMenu.h
Merge branch 'master' of https://github.com/minetest/minetest
[dragonfireclient.git] / src / gui / cheatMenu.h
index 3c4bec471601a4e09afc25a9f87d9184ec9818e1..b15858a48999012f8f743647fbff88fbe3845f96 100644 (file)
@@ -19,30 +19,35 @@ 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                                                        \
+#define CHEAT_MENU_GET_SCRIPTPTR                                                         \
        ClientScripting *script = m_client->getScript();                                 \
-       if (! script || ! script->m_cheats_loaded)                                         \
+       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);
@@ -68,8 +73,12 @@ class CheatMenu
        video::SColor m_font_color = video::SColor(255, 0, 0, 0);
        video::SColor m_selected_font_color = video::SColor(255, 255, 252, 88);
 
+       FontMode fontStringToEnum(std::string str);
+
        Client *m_client;
 
        gui::IGUIFont *m_font = nullptr;
        v2u32 m_fontsize;
+
+       float m_rainbow_offset = 0.0;
 };