From b90d95fd758dfe263b271196355b9c7c58dc308b Mon Sep 17 00:00:00 2001 From: Grinch_ Date: Tue, 27 Jul 2021 01:11:19 +0600 Subject: [PATCH] Added save anywhere option --- src/Game.cpp | 16 ++++++++++++++++ src/MenuInfo.h | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/Game.cpp b/src/Game.cpp index 70178b5..a7625fb 100644 --- a/src/Game.cpp +++ b/src/Game.cpp @@ -5,6 +5,7 @@ #include "Util.h" #include "CIplStore.h" +static bool bSaveGameFlag = false; // Thanks to aap void Game::RealTimeClock() @@ -43,6 +44,14 @@ Game::Game() m_RandomCheats::m_EnabledCheats[std::stoi(element.key())][1] = "true"; } + Events::drawMenuBackgroundEvent += []() + { + if (bSaveGameFlag) + { + FrontEndMenuManager.m_nCurrentMenuPage = MENUPAGE_GAME_SAVE; + bSaveGameFlag = false; + } + }; Events::processScriptsEvent += [] { uint timer = CTimer::m_snTimeInMilliseconds; @@ -301,6 +310,13 @@ void Game::Draw() CPlayerPed* pPlayer = FindPlayerPed(); int hplayer = CPools::GetPedRef(pPlayer); + if (ImGui::Button("Save game (might cause game bugs)",Ui::GetSize())) + { + FrontEndMenuManager.m_bActivateMenuNextFrame = true; + bSaveGameFlag = true; + } + ImGui::Spacing(); + if (ImGui::BeginTabBar("Game", ImGuiTabBarFlags_NoTooltip + ImGuiTabBarFlags_FittingPolicyScroll)) { if (ImGui::BeginTabItem("Checkboxes")) diff --git a/src/MenuInfo.h b/src/MenuInfo.h index eac3d80..1762363 100644 --- a/src/MenuInfo.h +++ b/src/MenuInfo.h @@ -2,5 +2,5 @@ #define MENU_NAME "Cheat Menu" #define MENU_VERSION_NUMBER "2.8" #define MENU_VERSION MENU_VERSION_NUMBER"-beta" -#define BUILD_NUMBER "20210717" +#define BUILD_NUMBER "20210727" #define MENU_TITLE MENU_NAME " v" MENU_VERSION "(" BUILD_NUMBER ")"