2020-12-02 16:19:16 -05:00
|
|
|
#pragma once
|
2022-02-21 03:33:57 -05:00
|
|
|
#include "pch.h"
|
2021-08-01 21:41:48 -04:00
|
|
|
|
2022-06-12 14:01:43 -04:00
|
|
|
/*
|
|
|
|
* Main CheatMenu Class
|
|
|
|
* Handles rendering, resizing, page handling etc.
|
|
|
|
*/
|
2022-02-21 03:33:57 -05:00
|
|
|
class CheatMenu
|
2020-12-02 16:19:16 -05:00
|
|
|
{
|
|
|
|
private:
|
2022-01-20 02:04:45 -05:00
|
|
|
enum class eMenuPages
|
|
|
|
{
|
|
|
|
ANIMATION, ANNIVERSARY, GAME, MENU, NONE, PED, PLAYER, TELEPORT, UPDATE, VEHICLE, VISUAL, WEAPON, WELCOME
|
|
|
|
};
|
|
|
|
struct HeaderData
|
|
|
|
{
|
|
|
|
std::string name;
|
|
|
|
void *pFunc;
|
|
|
|
eMenuPages page;
|
|
|
|
bool skipHeader = false;
|
|
|
|
};
|
|
|
|
|
2022-06-12 14:01:43 -04:00
|
|
|
static inline eMenuPages m_nMenuPage = eMenuPages::WELCOME; // current visible menu page
|
2021-10-24 18:08:00 -04:00
|
|
|
static inline bool m_bShowMenu = false;
|
|
|
|
static inline ImVec2 m_fMenuSize = ImVec2(screen::GetScreenWidth() / 4, screen::GetScreenHeight() / 1.2);
|
2022-06-12 14:01:43 -04:00
|
|
|
static inline bool m_bSizeChangedExternal = false; // Was menu size change requested
|
2022-02-13 00:29:58 -05:00
|
|
|
static inline std::vector<HeaderData> m_headerList;
|
2021-10-21 18:23:02 -04:00
|
|
|
|
2022-06-12 14:01:43 -04:00
|
|
|
// Applies imgui theme to the menu
|
2021-10-24 18:08:00 -04:00
|
|
|
static void ApplyStyle();
|
2022-06-12 14:01:43 -04:00
|
|
|
|
|
|
|
// Draws the window ui each frame
|
|
|
|
// Also handles drawing overlay & command window
|
2021-10-24 18:08:00 -04:00
|
|
|
static void DrawWindow();
|
2022-06-12 14:01:43 -04:00
|
|
|
|
2022-01-20 02:04:45 -05:00
|
|
|
static void ShowAnniversaryPage();
|
|
|
|
static void ShowUpdatePage();
|
|
|
|
static void ShowWelcomePage();
|
2022-06-12 14:01:43 -04:00
|
|
|
|
|
|
|
// Does all the processing required to handle menu pages
|
2022-01-28 08:10:56 -05:00
|
|
|
static void ProcessPages();
|
2022-01-20 02:04:45 -05:00
|
|
|
|
2020-12-02 16:19:16 -05:00
|
|
|
public:
|
2022-02-21 03:33:57 -05:00
|
|
|
CheatMenu() = delete;
|
|
|
|
CheatMenu(const CheatMenu&) = delete;
|
2021-12-16 15:17:49 -05:00
|
|
|
|
2022-02-21 03:33:57 -05:00
|
|
|
static void Init();
|
2022-03-09 17:23:08 -05:00
|
|
|
static bool IsMenuShown();
|
2021-12-16 15:17:49 -05:00
|
|
|
static void ResetMenuSize();
|
2022-06-12 14:01:43 -04:00
|
|
|
|
|
|
|
// Generates menu headers
|
|
|
|
// Needs to be called after language change or adding new headers
|
2022-02-22 02:44:33 -05:00
|
|
|
static void GenHeaderList();
|
2020-12-02 16:19:16 -05:00
|
|
|
};
|