From 279e8a33c08691c016e1d4fa10942528cc2d8f28 Mon Sep 17 00:00:00 2001 From: Grinch_ Date: Mon, 5 Sep 2022 00:36:46 +0600 Subject: [PATCH] Some more fixes --- src/cheatmenu.cpp | 2 +- src/defines.h | 1 - src/dllmain.cpp | 4 ++-- src/interface/ipage.cpp | 11 ++++------- src/interface/ipage.h | 2 +- src/pages/menu.cpp | 2 +- src/pages/player.cpp | 2 +- src/pages/welcome.h | 2 +- 8 files changed, 11 insertions(+), 15 deletions(-) diff --git a/src/cheatmenu.cpp b/src/cheatmenu.cpp index 23451a0..02400ac 100644 --- a/src/cheatmenu.cpp +++ b/src/cheatmenu.cpp @@ -135,7 +135,7 @@ CheatMenuMgr::CheatMenuMgr() return; } - Log::Print("Starting " MENU_TITLE " (" BUILD_NUMBER ")\nAuthor: Grinch_\nDiscord: " + Log::Print("Starting " MENU_TITLE " (" __DATE__ ")\nAuthor: Grinch_\nDiscord: " DISCORD_INVITE "\nMore Info: " GITHUB_LINK); // date time diff --git a/src/defines.h b/src/defines.h index 4005d02..90e23ca 100644 --- a/src/defines.h +++ b/src/defines.h @@ -10,7 +10,6 @@ #define MENU_NAME "Cheat Menu" #define MENU_VERSION_NUMBER "3.3" #define MENU_VERSION MENU_VERSION_NUMBER"-beta" -#define BUILD_NUMBER "20220825" #define MENU_TITLE MENU_NAME " v" MENU_VERSION #ifdef GTASA diff --git a/src/dllmain.cpp b/src/dllmain.cpp index 8d05f63..ad3cbdb 100644 --- a/src/dllmain.cpp +++ b/src/dllmain.cpp @@ -2,11 +2,11 @@ #include "utils/updater.h" #include "utils/rpc.h" -LONG WINAPI CrashHandler(PEXCEPTION_POINTERS pExceptionInfo) +LONG WINAPI CrashHandler(PEXCEPTION_POINTERS pInfo) { Log::Print(""); Log::Print("Game crashed. Unhandled exception at {} (0x{:x})", - pExceptionInfo->ExceptionRecord->ExceptionAddress, pExceptionInfo->ExceptionRecord->ExceptionCode); + pInfo->ExceptionRecord->ExceptionAddress, pInfo->ExceptionRecord->ExceptionCode); return EXCEPTION_CONTINUE_SEARCH; } diff --git a/src/interface/ipage.cpp b/src/interface/ipage.cpp index ba9ed68..8cb0293 100644 --- a/src/interface/ipage.cpp +++ b/src/interface/ipage.cpp @@ -7,15 +7,12 @@ void PageHandler::AddPage(PagePtr page, size_t index) { - static size_t size = static_cast(ePageID::None); - if (index <= size) + static size_t size = static_cast(ePageID::COUNT); + if (m_PageList.size() < size) { - if (m_PageList.size() < size) - { - m_PageList.resize(size); - } - m_PageList[index] = page; + m_PageList.resize(size); } + m_PageList[index] = page; } void PageHandler::SetCurrentPage(PagePtr page) diff --git a/src/interface/ipage.h b/src/interface/ipage.h index ccbb867..0f5ae8d 100644 --- a/src/interface/ipage.h +++ b/src/interface/ipage.h @@ -15,10 +15,10 @@ enum class ePageID Menu, // Pages without headers - None, Anniversary, Update, Welcome, + COUNT, }; /* diff --git a/src/pages/menu.cpp b/src/pages/menu.cpp index dd0c4e6..9ec4c0a 100644 --- a/src/pages/menu.cpp +++ b/src/pages/menu.cpp @@ -324,7 +324,7 @@ void MenuPage::Draw() ImGui::NextColumn(); ImGui::Text("ImGui: %s", ImGui::GetVersion()); - ImGui::Text("%s: %s",TEXT("Menu.Build"), BUILD_NUMBER); + ImGui::Text("%s: %s",TEXT("Menu.Build"), __DATE__); ImGui::Columns(1); diff --git a/src/pages/player.cpp b/src/pages/player.cpp index 17fabc0..8dddb79 100644 --- a/src/pages/player.cpp +++ b/src/pages/player.cpp @@ -591,7 +591,7 @@ void PlayerPage::Draw() state = BY_GAME(pPlayer->m_nPhysicalFlags.bMeleeProof, pPlayer->m_nFlags.bMeleeProof, pPlayer->m_nFlags.bMeleeProof); - if (Widget::Checkbox(TEXT("Player.MeleeProof"), &state, nullptr, m_bGodMode)) + if (Widget::Checkbox(TEXT("Vehicle.MeleeProof"), &state, nullptr, m_bGodMode)) { BY_GAME(pPlayer->m_nPhysicalFlags.bMeleeProof, pPlayer->m_nFlags.bMeleeProof, pPlayer->m_nFlags.bMeleeProof) = state; diff --git a/src/pages/welcome.h b/src/pages/welcome.h index 1d60a9f..0f3383e 100644 --- a/src/pages/welcome.h +++ b/src/pages/welcome.h @@ -8,7 +8,7 @@ private: friend class IFeature; WelcomePage() : IPage(ePageID::Welcome, "Welcome", false) { - Events::initGameEvent += [this]() + Events::initGameEvent.after += [this]() { ePageID pageID = static_cast(gConfig.Get("Window.CurrentPage", static_cast(ePageID::Welcome))); PagePtr ptr = PageHandler::FindPagePtr(pageID);