Correct reloadmenus command.

This commit is contained in:
momo5502
2015-12-24 12:30:52 +01:00
parent 85f0ebdc5d
commit 375014b55b
3 changed files with 34 additions and 1 deletions

View File

@ -397,8 +397,23 @@ namespace Components
Command::Add("reloadmenus", [] (Command::Params params)
{
if (Game::CL_IsCgameInitialized())
{
Logger::Print("Realoading menus in-game is not allowed!\n");
return;
}
// Close all menus
Game::Menus_CloseAll(0x62E2858);
// Free custom menus
Menus::FreeEverything();
// TODO: Refresh ui context?
// Reinitialize ui context
((void(*)())0x401700)();
// Reopen main menu
Game::Menus_OpenByName(0x62E2858, "main_text");
});
}