mirror of
https://github.com/nillerusr/source-engine.git
synced 2026-08-07 17:29:36 +00:00
gameui: add console button to main menu
This commit is contained in:
@@ -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() )
|
||||
|
||||
Reference in New Issue
Block a user