diff --git a/src/animation.cpp b/src/animation.cpp index f60bf50..2b350ea 100644 --- a/src/animation.cpp +++ b/src/animation.cpp @@ -245,7 +245,7 @@ Animation::Animation() #endif } -void Animation::Draw() +void Animation::ShowPage() { if (ImGui::BeginTabBar("Animation", ImGuiTabBarFlags_NoTooltip + ImGuiTabBarFlags_FittingPolicyScroll)) { diff --git a/src/animation.h b/src/animation.h index f402de9..e445458 100644 --- a/src/animation.h +++ b/src/animation.h @@ -48,5 +48,5 @@ private: public: Animation(); - static void Draw(); + static void ShowPage(); }; \ No newline at end of file diff --git a/src/cheatmenu.cpp b/src/cheatmenu.cpp index 6ffbf1e..30d6894 100644 --- a/src/cheatmenu.cpp +++ b/src/cheatmenu.cpp @@ -4,6 +4,8 @@ #include "ui.h" #include "updater.h" #include "d3dhook.h" +#include "../depend/imgui/imgui_internal.h" +#include "util.h" void CheatMenu::DrawWindow() { @@ -35,28 +37,13 @@ void CheatMenu::DrawWindow() ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(ImGui::GetWindowWidth() / 85, ImGui::GetWindowHeight() / 200)); - if (Updater::IsUpdateAvailable()) - { - ShowUpdateScreen(); - } - else - { - Ui::DrawHeaders(header); - - if (Ui::m_HeaderId == -1) - { - ShowWelcomeScreen(); - } - } + ProcessMenuPages(); if (m_bSizeChangedExternal) - { m_bSizeChangedExternal = false; - } else - { m_fMenuSize = ImGui::GetWindowSize(); - } + gConfig.SetValue("window.sizeX", m_fMenuSize.x); gConfig.SetValue("window.sizeY", m_fMenuSize.y); @@ -75,6 +62,108 @@ void CheatMenu::DrawWindow() DrawOverlay(); } +void CheatMenu::ProcessMenuPages() +{ + static void* pCallback; + ImVec2 size = Ui::GetSize(3, false); + ImGuiStyle &style = ImGui::GetStyle(); + + ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0, 0)); + ImGui::PushFont(FontMgr::GetFont("header")); + m_nMenuPage = Updater::IsUpdateAvailable() ? eMenuPages::UPDATE : m_nMenuPage; + + // Check once if it's anniversary day + static bool aniCheckDone; + if (!aniCheckDone) + { + SYSTEMTIME st; + GetSystemTime(&st); + + if (st.wMonth == 3 && st.wDay == 28) + { + /* + * We don't want to be annoying and + * show anniversary screen on every game start + */ + bool flag = gConfig.GetValue("window.anniversaryShown", false); + + if (!flag) + { + gConfig.SetValue("window.anniversaryShown", true); + m_nMenuPage = eMenuPages::ANNIVERSARY; + } + } + aniCheckDone = true; + } + + ImDrawList *pDrawList = ImGui::GetWindowDrawList(); + for (size_t i = 0; i < m_headerList.size(); ++i) + { + /* + * For Welcome & Update pages + * They don't need to add item in the header list + */ + if (m_headerList[i].skipHeader) + { + if (m_nMenuPage == m_headerList[i].page) + pCallback = m_headerList[i].pFunc; + + continue; + } + + const char* text = m_headerList[i].name.c_str(); + + ImVec4 color; + if (m_headerList[i].page == m_nMenuPage) + { + color = style.Colors[ImGuiCol_ButtonActive]; + pCallback = m_headerList[i].pFunc; + } + else + color = style.Colors[ImGuiCol_Button]; + + if (ImGui::InvisibleButton(text, size)) + { + m_nMenuPage = m_headerList[i].page; + size_t curPage = static_cast(m_headerList[i].page); + gConfig.SetValue("window.idnum", curPage); + pCallback = m_headerList[i].pFunc; + Updater::ResetUpdaterState(); + } + + if (ImGui::IsItemHovered()) + color = style.Colors[ImGuiCol_ButtonHovered]; + + /* + * Window rounding flags + * TODO: hardcoded atm + */ + ImDrawFlags flags = ImDrawFlags_RoundCornersNone; + if (i == 0) flags = ImDrawFlags_RoundCornersTopLeft; + if (i == 2) flags = ImDrawFlags_RoundCornersTopRight; + if (i == 6) flags = ImDrawFlags_RoundCornersBottomLeft; + if (i == 8) flags = ImDrawFlags_RoundCornersBottomRight; + + ImVec2 min = ImGui::GetItemRectMin(); + ImVec2 max = ImGui::GetItemRectMax(); + ImVec2 size = ImGui::CalcTextSize(text); + pDrawList->AddRectFilled(min, max, ImGui::GetColorU32(color), style.FrameRounding, flags); + ImGui::RenderTextClipped(min + style.FramePadding, max - style.FramePadding, text, NULL, &size, style.ButtonTextAlign); + + if (i % 3 != 2) + ImGui::SameLine(); + } + ImGui::PopFont(); + ImGui::PopStyleVar(); + ImGui::Dummy(ImVec2(0, 10)); + + if (pCallback != nullptr && ImGui::BeginChild("HEADERCONTENT")) + { + static_cast(pCallback)(); + ImGui::EndChild(); + } +} + CheatMenu::CheatMenu() { if (!D3dHook::InjectHook(DrawWindow)) @@ -85,7 +174,7 @@ CheatMenu::CheatMenu() ApplyStyle(); // Load menu settings - Ui::m_HeaderId = gConfig.GetValue("window.idnum", -1); + m_nMenuPage = (eMenuPages)gConfig.GetValue("window.idnum", (size_t)eMenuPages::WELCOME); m_fMenuSize.x = gConfig.GetValue("window.sizeX", screen::GetScreenWidth() / 4.0f); m_fMenuSize.y = gConfig.GetValue("window.sizeY", screen::GetScreenHeight() / 1.2f); srand(CTimer::m_snTimeInMilliseconds); @@ -128,9 +217,79 @@ CheatMenu::~CheatMenu() D3dHook::RemoveHook(); } -void CheatMenu::ShowWelcomeScreen() +/* +* YIKES YOU AREN"T SUPPOSED TO FIND THIS YOU KNOW!!! +* Probably a good easter egg for the upcoming anniversary ;) +*/ +void CheatMenu::ShowAnniversaryPage() +{ + Ui::CenterdText("Happy Anniversary!"); + ImGui::NewLine(); + + ImGui::TextWrapped("On this day, in 2019, the first public version of menu was released in MixMods Forum." +" It's been a blast working on it and I've learned a lot in the process.\n\nThanks to you and everyone who used or" +" contributed to the modification in any form or shape."); + + ImGui::NewLine(); + ImGui::TextWrapped("Feel free to star the GitHub repo or join the discord server and provide feedback, ideas, or suggestions."); + ImGui::NewLine(); + + if (ImGui::Button("Discord server", ImVec2(Ui::GetSize(2)))) + { + ShellExecute(nullptr, "open", DISCORD_INVITE, nullptr, nullptr, SW_SHOWNORMAL); + } + + ImGui::SameLine(); + + if (ImGui::Button("GitHub repo", ImVec2(Ui::GetSize(2)))) + { + ShellExecute(nullptr, "open", GITHUB_LINK, nullptr, nullptr, SW_SHOWNORMAL); + } + + ImGui::NewLine(); + + static bool showHistory = false; + ImGui::Checkbox("Show backstory", &showHistory); + + if (showHistory) + { + ImGui::BeginChild("BACKSTORY"); + ImGui::TextWrapped("I wanted to share the backstory behind the initial idea or plan behind the menu." +" This is gonna be long so feel free to skip it if you're not interested."); + ImGui::NewLine(); + + ImGui::TextWrapped("The original idea of the menu comes way back from 2016! The inspiration for the menu" +" is from the 'CheatMenu by UNRATED69'. I wanted something that had some more features and worked with SAxVCxLC." +" But there not being any other CheatMenu's back then, I wanted to make something myself but lacked the knowledge to do so."); + ImGui::NewLine(); + + ImGui::TextWrapped("In 2018, I finally got an opportunity to learn CLEO or GTA3Script after Junior released" +" his tutorial. I started from basics but it soon became apparent that due to the limitations of CLEO, creating menus were" +"really tedious."); + + ImGui::NewLine(); + ImGui::TextWrapped("Later that year I found Moonloader, which had ImGui support. Meaning I could make menus" +" without brainfucking myself (kudos to everyone who writes 100s of lines in CLEO). I recall starting working on" +" the menu in October/November that same year."); + + ImGui::NewLine(); + ImGui::TextWrapped("I had high hopes the mod would succeed and the menu was nowhere near the state I wanted" +" it to be. But over a hot conversation with KKJJ, I finally decided to add the absolute bare minimum of features and" +" see what happens. And to my surprise, it even surpassed all of my expectations and became my most popular mod to this day."); + + ImGui::NewLine(); + ImGui::TextWrapped("A part of me is already cringing telling the story but it is what it is. I've learned" +" a lot working on this mod and I'm grateful. If you made it through all this way, kudos, you're awesome."); + + ImGui::NewLine(); + ImGui::TextWrapped("Again, thanks to you and everyone who used or helped me along the way. Enjoy ;)"); + + ImGui::EndChild(); + } +} + +void CheatMenu::ShowWelcomePage() { - ImGui::BeginChild("WelcomeScreen"); ImGui::NewLine(); Ui::CenterdText("Welcome to Cheat Menu"); @@ -155,45 +314,33 @@ void CheatMenu::ShowWelcomeScreen() ImGui::TextWrapped("If you find bugs or have suggestions, you can let me know on discord :)"); ImGui::Dummy(ImVec2(0, 30)); Ui::CenterdText("Copyright Grinch_ 2019-2022. All rights reserved."); - ImGui::EndChild(); } -void CheatMenu::ShowUpdateScreen() +void CheatMenu::ShowUpdatePage() { - ImGui::BeginChild("UPdateScreen"); std::string ver = Updater::GetUpdateVersion(); ImGui::Dummy(ImVec2(0, 20)); - Ui::CenterdText("A new version of the mod is available."); + Ui::CenterdText("A new version of the menu is available."); Ui::CenterdText(std::string("Current version: ") + MENU_VERSION); Ui::CenterdText("Latest version: " + ver); ImGui::Dummy(ImVec2(0, 10)); - ImGui::TextWrapped("In order to keep using the menu, you need to update to the latest version." - " This is to ensure everything is using the most up-to-date version."); + ImGui::TextWrapped("It's highly recommanded to update to the latest version." + " Newer versions may contain new features and bug fixes."); ImGui::Dummy(ImVec2(0, 10)); - ImGui::TextWrapped("To know what changes are made or to download, click on the \"Download page\" button." + ImGui::TextWrapped("To know what changes are made or to download, click on the 'Download page' button." " Follow the instructions there. If you're still having issues, let me know on discord."); ImGui::Dummy(ImVec2(0, 5)); - if (ImGui::Button("Discord server", ImVec2(Ui::GetSize(3)))) - { + if (ImGui::Button("Discord server", ImVec2(Ui::GetSize(2)))) ShellExecute(NULL, "open", DISCORD_INVITE, NULL, NULL, SW_SHOWNORMAL); - } ImGui::SameLine(); - if (ImGui::Button("Download page", Ui::GetSize(3))) + if (ImGui::Button("Download page", Ui::GetSize(2))) { ShellExecute(NULL, "open", std::string("https://github.com/user-grinch/Cheat-Menu/releases/tag/" + ver).c_str(), NULL, NULL, SW_SHOWNORMAL); } - - ImGui::SameLine(); - - if (ImGui::Button("Hide page", Ui::GetSize(3))) - { - Updater::ResetUpdaterState(); - } - ImGui::EndChild(); } void CheatMenu::ApplyStyle() diff --git a/src/cheatmenu.h b/src/cheatmenu.h index 8f69e8f..44edd44 100644 --- a/src/cheatmenu.h +++ b/src/cheatmenu.h @@ -22,21 +22,45 @@ class CheatMenu : Animation, Game, Menu, Ped, Player, Teleport, Vehicle, Visual, Weapon { private: + 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; + }; + + static inline eMenuPages m_nMenuPage = eMenuPages::WELCOME; static inline bool m_bShowMenu = false; static inline ImVec2 m_fMenuSize = ImVec2(screen::GetScreenWidth() / 4, screen::GetScreenHeight() / 1.2); static inline bool m_bSizeChangedExternal = false; - static inline CallbackTable header - { - {"Teleport", &Teleport::Draw}, {"Player", &Player::Draw}, {"Ped", &Ped::Draw}, - {"Animation", &Animation::Draw}, {"Vehicle", &Vehicle::Draw}, {"Weapon", &Weapon::Draw}, - {"Game", &Game::Draw}, {"Visual", &Visual::Draw}, {"Menu", &Menu::Draw} - }; - static void ApplyStyle(); static void DrawWindow(); - static void ShowUpdateScreen(); - static void ShowWelcomeScreen(); + static void ShowAnniversaryPage(); + static void ShowUpdatePage(); + static void ShowWelcomePage(); + static void ProcessMenuPages(); + + static inline std::vector m_headerList + { + {"Teleport", &Teleport::ShowPage, eMenuPages::TELEPORT}, + {"Player", &Player::ShowPage, eMenuPages::PLAYER}, + {"Ped", &Ped::ShowPage, eMenuPages::PED}, + {"Animation", &Animation::ShowPage, eMenuPages::ANIMATION}, + {"Vehicle", &Vehicle::ShowPage, eMenuPages::VEHICLE}, + {"Weapon", &Weapon::ShowPage, eMenuPages::WEAPON}, + {"Game", &Game::ShowPage, eMenuPages::GAME}, + {"Visual", &Visual::ShowPage, eMenuPages::VISUAL}, + {"Menu", &Menu::ShowPage, eMenuPages::MENU}, + {"Welcome", &ShowWelcomePage, eMenuPages::WELCOME, true}, + {"Update", &ShowUpdatePage, eMenuPages::UPDATE, true}, + {"Anniversary", &ShowAnniversaryPage, eMenuPages::ANNIVERSARY, true} + }; public: CheatMenu(); diff --git a/src/dllmain.cpp b/src/dllmain.cpp index c76b436..2d1338f 100644 --- a/src/dllmain.cpp +++ b/src/dllmain.cpp @@ -63,12 +63,12 @@ void MenuThread(void* param) // Checking for updates once a day - time_t now = time(0); - struct tm tstruct = *localtime(&now); - if (gConfig.GetValue("config.update_date", 0) != tstruct.tm_mday) + SYSTEMTIME st; + GetSystemTime(&st); + if (gConfig.GetValue("config.update_date", 0) != st.wDay) { Updater::CheckUpdate(); - gConfig.SetValue("config.update_date", tstruct.tm_mday); + gConfig.SetValue("config.update_date", st.wDay); } while (true) diff --git a/src/game.cpp b/src/game.cpp index 623a01e..ddc9f13 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -400,9 +400,9 @@ void Game::ClearFreecamStuff() patch::Set(BY_GAME(0xBA676C, 0xA10AB6, NULL), m_Freecam::m_bRadarState); // radar #ifdef GTA3 - CPad::GetPad(0)->m_bDisablePlayerControls = false; + CPad::GetPad(0)->m_bDisablePlayerControls = false; #else - CPad::GetPad(0)->DisablePlayerControls = false; + CPad::GetPad(0)->DisablePlayerControls = false; #endif Command(m_Freecam::m_nPed); @@ -414,7 +414,7 @@ void Game::ClearFreecamStuff() Command(); } -void Game::Draw() +void Game::ShowPage() { ImGui::Spacing(); CPlayerPed* pPlayer = FindPlayerPed(); diff --git a/src/game.h b/src/game.h index a3ad87c..ae73f72 100644 --- a/src/game.h +++ b/src/game.h @@ -63,6 +63,6 @@ public: static inline bool m_bSyncTime; Game(); - static void Draw(); + static void ShowPage(); }; diff --git a/src/json.h b/src/json.h index 10c5fa6..cf430e2 100644 --- a/src/json.h +++ b/src/json.h @@ -75,7 +75,7 @@ public: Example: "Menu.Window.X" */ template - void SetValue(std::string&& key, T& val) + void SetValue(std::string&& key, const T& val) { std::stringstream ss(key); std::string line; @@ -100,7 +100,7 @@ public: } template <> - void SetValue(std::string&& key, std::string& val) + void SetValue(std::string&& key, const std::string& val) { std::stringstream ss(key); std::string line; diff --git a/src/menu.cpp b/src/menu.cpp index ef77850..256923f 100644 --- a/src/menu.cpp +++ b/src/menu.cpp @@ -348,7 +348,7 @@ void Menu::ProcessCommands() #endif } -void Menu::Draw() +void Menu::ShowPage() { ImGui::Spacing(); if (ImGui::Button("Reset config", ImVec2(Ui::GetSize(2)))) diff --git a/src/menu.h b/src/menu.h index 59548c8..5f46477 100644 --- a/src/menu.h +++ b/src/menu.h @@ -1,4 +1,5 @@ #pragma once +#include "pch.h" class Menu { @@ -45,7 +46,7 @@ public: }; Menu(); - static void Draw(); + static void ShowPage(); static void DrawOverlay(); static void DrawShortcutsWindow(); static void ProcessCommands(); diff --git a/src/pch.h b/src/pch.h index 132a938..afb786b 100644 --- a/src/pch.h +++ b/src/pch.h @@ -74,7 +74,6 @@ #include "resourcestore.h" #include "fontmgr.h" -using CallbackTable = std::vector>; using namespace plugin; enum eRenderer diff --git a/src/ped.cpp b/src/ped.cpp index 0c6a414..4d7e21f 100644 --- a/src/ped.cpp +++ b/src/ped.cpp @@ -166,7 +166,7 @@ void Ped::SpawnPed(std::string& cat, std::string& name, std::string& model) } } -void Ped::Draw() +void Ped::ShowPage() { if (ImGui::BeginTabBar("Ped", ImGuiTabBarFlags_NoTooltip + ImGuiTabBarFlags_FittingPolicyScroll)) { diff --git a/src/ped.h b/src/ped.h index d3a286f..08e68d6 100644 --- a/src/ped.h +++ b/src/ped.h @@ -59,5 +59,5 @@ public: Ped(); ~Ped(); - static void Draw(); + static void ShowPage(); }; diff --git a/src/player.cpp b/src/player.cpp index a2ba252..b489ff6 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -360,7 +360,7 @@ void Player::ChangePlayerModel(std::string& cat, std::string& key, std::string& } #endif -void Player::Draw() +void Player::ShowPage() { CPlayerPed* pPlayer = FindPlayerPed(); int hplayer = CPools::GetPedRef(pPlayer); diff --git a/src/player.h b/src/player.h index 44c6e17..35f61b2 100644 --- a/src/player.h +++ b/src/player.h @@ -53,5 +53,5 @@ private: public: Player(); - static void Draw(); + static void ShowPage(); }; diff --git a/src/teleport.cpp b/src/teleport.cpp index 746c572..dee69f6 100644 --- a/src/teleport.cpp +++ b/src/teleport.cpp @@ -188,7 +188,7 @@ void Teleport::RemoveTeleportEntry(std::string& category, std::string& key, std: } } -void Teleport::Draw() +void Teleport::ShowPage() { if (ImGui::BeginTabBar("Teleport", ImGuiTabBarFlags_NoTooltip + ImGuiTabBarFlags_FittingPolicyScroll)) { diff --git a/src/teleport.h b/src/teleport.h index 0d032d2..a9839f5 100644 --- a/src/teleport.h +++ b/src/teleport.h @@ -39,5 +39,5 @@ public: Teleport(); static void TeleportPlayer(bool get_marker = false, CVector pos = CVector(0, 0, 0), int interior_id = 0); - static void Draw(); + static void ShowPage(); }; diff --git a/src/ui.cpp b/src/ui.cpp index 05b1df9..7b77015 100644 --- a/src/ui.cpp +++ b/src/ui.cpp @@ -224,75 +224,6 @@ void Ui::CenterdText(const std::string& text) ImGui::Text(text.c_str()); } -void Ui::DrawHeaders(CallbackTable& data) -{ - static void* pCallback; - ImVec2 size = GetSize(3, false); - ImGuiStyle &style = ImGui::GetStyle(); - - ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0, 0)); - ImGui::PushFont(FontMgr::GetFont("header")); - - ImDrawList *pDrawList = ImGui::GetWindowDrawList(); - for (size_t i = 0; i < data.size(); ++i) - { - const char* btn_text = data[i].first.c_str(); - - ImVec4 color; - if (i == m_HeaderId) - { - color = style.Colors[ImGuiCol_ButtonActive]; - pCallback = data[i].second; - } - else - { - color = style.Colors[ImGuiCol_Button]; - } - - if (ImGui::InvisibleButton(btn_text, size)) - { - m_HeaderId = i; - gConfig.SetValue("window.idnum", m_HeaderId); - pCallback = data[i].second; - } - - if (ImGui::IsItemHovered()) - { - color = style.Colors[ImGuiCol_ButtonHovered]; - } - - // hardcoded - ImDrawFlags flags = ImDrawFlags_RoundCornersNone; - if (i == 0) flags = ImDrawFlags_RoundCornersTopLeft; - if (i == 2) flags = ImDrawFlags_RoundCornersTopRight; - if (i == 6) flags = ImDrawFlags_RoundCornersBottomLeft; - if (i == 8) flags = ImDrawFlags_RoundCornersBottomRight; - - ImVec2 min = ImGui::GetItemRectMin(); - ImVec2 max = ImGui::GetItemRectMax(); - ImVec2 size = ImGui::CalcTextSize(btn_text); - pDrawList->AddRectFilled(min, max, ImGui::GetColorU32(color), style.FrameRounding, flags); - ImGui::RenderTextClipped(min + style.FramePadding, max - style.FramePadding, btn_text, NULL, &size, style.ButtonTextAlign); - - if (i % 3 != 2) - { - ImGui::SameLine(); - } - } - ImGui::PopFont(); - ImGui::PopStyleVar(); - ImGui::Dummy(ImVec2(0, 10)); - - if (m_HeaderId != -1) - { - if (pCallback != nullptr && ImGui::BeginChild("TABSBAR")) - { - static_cast(pCallback)(); - ImGui::EndChild(); - } - } -} - void Ui::ShowTooltip(const char* text) { ImGui::SameLine(); diff --git a/src/ui.h b/src/ui.h index ad076fc..c8fb11d 100644 --- a/src/ui.h +++ b/src/ui.h @@ -48,7 +48,6 @@ public: const char* hint = nullptr); static bool CheckboxBitFlag(const char* label, uint flag, const char* hint = nullptr); static bool CheckboxWithHint(const char* label, bool* state, const char* hint = nullptr, bool is_disabled = false); - static void DrawHeaders(CallbackTable& data); static void DrawJSON(ResourceStore& data, std::function func_left_click, diff --git a/src/util.h b/src/util.h index 17d7a0c..6e62f76 100644 --- a/src/util.h +++ b/src/util.h @@ -19,7 +19,6 @@ public: static void ClearCharTasksVehCheck(CPed* ped); static int GetLargestGangInZone(); #endif - static void SetCarForwardSpeed(CVehicle *pVeh, float speed); static CPed* GetClosestPed(); static CVehicle* GetClosestVehicle(); diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 368ea5e..ee73361 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -558,7 +558,7 @@ int Vehicle::GetModelFromName(const char* name) } } -void Vehicle::Draw() +void Vehicle::ShowPage() { ImGui::Spacing(); CPlayerPed* pPlayer = FindPlayerPed(); diff --git a/src/vehicle.h b/src/vehicle.h index f313ec6..af0d65b 100644 --- a/src/vehicle.h +++ b/src/vehicle.h @@ -100,5 +100,5 @@ public: #endif static std::string GetNameFromModel(int model); static int GetModelFromName(const char* name); - static void Draw(); + static void ShowPage(); }; diff --git a/src/visual.cpp b/src/visual.cpp index 93c3682..92fa38e 100644 --- a/src/visual.cpp +++ b/src/visual.cpp @@ -346,7 +346,7 @@ bool Visual::TimeCycColorEdit4(const char* label, T* r, T* g, T* b, T* a, ImGuiC return rtn; } -void Visual::Draw() +void Visual::ShowPage() { if (ImGui::BeginTabBar("Visual", ImGuiTabBarFlags_NoTooltip + ImGuiTabBarFlags_FittingPolicyScroll)) { diff --git a/src/visual.h b/src/visual.h index 8cf7243..45e31e1 100644 --- a/src/visual.h +++ b/src/visual.h @@ -41,5 +41,5 @@ private: public: Visual(); - static void Draw(); + static void ShowPage(); }; \ No newline at end of file diff --git a/src/weapon.cpp b/src/weapon.cpp index ad4ab12..efe8567 100644 --- a/src/weapon.cpp +++ b/src/weapon.cpp @@ -225,7 +225,7 @@ void Weapon::GiveWeaponToPlayer(std::string& rootkey, std::string& name, std::st } #endif -void Weapon::Draw() +void Weapon::ShowPage() { CPlayerPed* pPlayer = FindPlayerPed(); uint hplayer = CPools::GetPedRef(pPlayer); diff --git a/src/weapon.h b/src/weapon.h index 81043cf..6c853d9 100644 --- a/src/weapon.h +++ b/src/weapon.h @@ -53,5 +53,5 @@ public: #endif Weapon(); - static void Draw(); + static void ShowPage(); };