diff --git a/src/Components/Modules/Menus.cpp b/src/Components/Modules/Menus.cpp index ae04d35c..122a35d6 100644 --- a/src/Components/Modules/Menus.cpp +++ b/src/Components/Modules/Menus.cpp @@ -768,6 +768,11 @@ namespace Components Menus::Menus() { + if (ZoneBuilder::IsEnabled()) + { + Game::Menu_Setup(Game::uiContext); + } + if (Dedicated::IsEnabled()) return; // Ensure everything is zero'ed @@ -870,6 +875,7 @@ namespace Components Menus::~Menus() { + // In your dreams! Menus::FreeEverything(); } } diff --git a/src/Components/Modules/Vote.cpp b/src/Components/Modules/Vote.cpp index 3a74336b..ccf01c45 100644 --- a/src/Components/Modules/Vote.cpp +++ b/src/Components/Modules/Vote.cpp @@ -316,11 +316,16 @@ namespace Components Vote::Vote() { // Replicate g_allowVote - Utils::Hook::Set(0x5E3A4F, Game::DVAR_INTERNAL | Game::DVAR_CODINFO); + Utils::Hook::Set(0x5E3A4F, Game::DVAR_INTERNAL | Game::DVAR_CODINFO); ClientCommand::Add("callvote", Cmd_CallVote_f); ClientCommand::Add("vote", Cmd_Vote_f); + Menus::Add("ui_mp/scriptmenus/callvote.menu"); + Menus::Add("ui_mp/scriptmenus/kickplayer.menu"); + Menus::Add("ui_mp/scriptmenus/changegametype.menu"); + Menus::Add("ui_mp/scriptmenus/changemap.menu"); + UIScript::Add("voteKick", []([[maybe_unused]] const UIScript::Token& token, [[maybe_unused]] const Game::uiInfo_s* info) { if (info->playerIndex >= 0 && info->playerIndex < Game::sharedUiInfo->playerCount) diff --git a/src/Game/Functions.cpp b/src/Game/Functions.cpp index f776c2a6..9162125c 100644 --- a/src/Game/Functions.cpp +++ b/src/Game/Functions.cpp @@ -83,6 +83,7 @@ namespace Game Menus_MenuIsInStack_t Menus_MenuIsInStack = Menus_MenuIsInStack_t(0x47ACB0); Menu_HandleKey_t Menu_HandleKey = Menu_HandleKey_t(0x4C4A00); Menu_GetFocused_t Menu_GetFocused = Menu_GetFocused_t(0x4AFF10); + Menu_Setup_t Menu_Setup = Menu_Setup_t(0x415AD0); MSG_Init_t MSG_Init = MSG_Init_t(0x45FCA0); MSG_ReadBit_t MSG_ReadBit = MSG_ReadBit_t(0x476D20); diff --git a/src/Game/Functions.hpp b/src/Game/Functions.hpp index cd1c7c30..2998bae5 100644 --- a/src/Game/Functions.hpp +++ b/src/Game/Functions.hpp @@ -173,7 +173,7 @@ namespace Game typedef int(*Menus_OpenByName_t)(UiContext* dc, const char* p); extern Menus_OpenByName_t Menus_OpenByName; - typedef menuDef_t *(*Menus_FindByName_t)(UiContext* dc, const char* name); + typedef menuDef_t*(*Menus_FindByName_t)(UiContext* dc, const char* name); extern Menus_FindByName_t Menus_FindByName; typedef bool(*Menu_IsVisible_t)(UiContext* dc, menuDef_t* menu); @@ -182,11 +182,14 @@ namespace Game typedef bool(*Menus_MenuIsInStack_t)(UiContext* dc, menuDef_t* menu); extern Menus_MenuIsInStack_t Menus_MenuIsInStack; + typedef void(*Menu_HandleKey_t)(UiContext* ctx, menuDef_t* menu, Game::keyNum_t key, int down); + extern Menu_HandleKey_t Menu_HandleKey; + typedef menuDef_t*(*Menu_GetFocused_t)(UiContext* ctx); extern Menu_GetFocused_t Menu_GetFocused; - typedef void(*Menu_HandleKey_t)(UiContext* ctx, menuDef_t* menu, Game::keyNum_t key, int down); - extern Menu_HandleKey_t Menu_HandleKey; + typedef void(*Menu_Setup_t)(UiContext* dc); + extern Menu_Setup_t Menu_Setup; typedef bool(*UI_KeyEvent_t)(int clientNum, int key, int down); extern UI_KeyEvent_t UI_KeyEvent;