gameui: add console button to main menu

This commit is contained in:
nillerusr
2022-02-05 22:33:45 +03:00
parent 74b7a6d151
commit c36cfccdf0
7 changed files with 24 additions and 17 deletions
+8 -1
View File
@@ -657,7 +657,7 @@ bool g_bIsCreatingNewGameMenuForPreFetching = false;
// Purpose: Constructor
//-----------------------------------------------------------------------------
CBasePanel::CBasePanel() : Panel(NULL, "BaseGameUIPanel")
{
{
g_pBasePanel = this;
m_bLevelLoading = false;
m_eBackgroundState = BACKGROUND_INITIAL;
@@ -863,6 +863,7 @@ CBasePanel::~CBasePanel()
static const char *g_rgValidCommands[] =
{
"OpenGameMenu",
"OpenConsole",
"OpenPlayerListDialog",
"OpenNewGameDialog",
"OpenLoadGameDialog",
@@ -1477,6 +1478,8 @@ CGameMenu *CBasePanel::RecursiveLoadGameMenu(KeyValues *datafile)
{
CGameMenu *menu = new CGameMenu(this, datafile->GetName());
menu->AddMenuItem("Console", "CONSOLE", "OpenConsole", this);
// loop through all the data adding items to the menu
for (KeyValues *dat = datafile->GetFirstSubKey(); dat != NULL; dat = dat->GetNextKey())
{
@@ -1899,6 +1902,10 @@ void CBasePanel::RunMenuCommand(const char *command)
{
OnOpenNewGameDialog();
}
else if ( !Q_stricmp( command, "OpenConsole" ) )
{
GameConsole().Activate();
}
else if ( !Q_stricmp( command, "OpenLoadGameDialog" ) )
{
if ( !GameUI().IsConsoleUI() )