call numberical_menu.cfg if unknown menu is shown

This commit is contained in:
a1batross 2016-03-16 20:42:31 +03:00
parent d6e067029c
commit c02670e736
2 changed files with 20 additions and 2 deletions

View File

@ -196,6 +196,16 @@ int CHudMenu :: MsgFunc_ShowMenu( const char *pszName, int iSize, void *pbuf )
ShowVGUIMenu(MENU_RADIOC);
return 1;
}
else
{
// we just show touch screen numbers
ShowVGUIMenu(MENU_NUMERICAL_MENU);
}
}
else
{
// we just show touch screen numbers
ShowVGUIMenu(MENU_NUMERICAL_MENU);
}
if ( !m_fWaitingForMore ) // this is the start of a new menu
@ -310,12 +320,12 @@ void CHudMenu::ShowVGUIMenu( int menuType )
else szCmd = "exec touch/buy_submachinegun_ct.cfg";
break;
case MENU_BUY_MACHINEGUN:
if( g_PlayerExtraInfo[gHUD.m_Scoreboard.m_iPlayerNum].teamnumber == 1 )
if( g_PlayerExtraInfo[gHUD.m_Scoreboard.m_iPlayerNum].teamnumber == TEAM_TERRORIST )
szCmd = "exec touch/buy_machinegun_t.cfg";
else szCmd = "exec touch/buy_machinegun_ct.cfg";
break;
case MENU_BUY_ITEM:
if( g_PlayerExtraInfo[gHUD.m_Scoreboard.m_iPlayerNum].teamnumber == 1 )
if( g_PlayerExtraInfo[gHUD.m_Scoreboard.m_iPlayerNum].teamnumber == TEAM_TERRORIST )
szCmd = "exec touch/buy_item_t.cfg";
else szCmd = "exec touch/buy_item_ct.cfg";
break;
@ -331,6 +341,9 @@ void CHudMenu::ShowVGUIMenu( int menuType )
case MENU_RADIOSELECTOR:
szCmd = "exec touch/radioselector.cfg";
break;
case MENU_NUMERICAL_MENU:
szCmd = "exec touch/numerical_menu.cfg";
break;
default:
szCmd = "touch_removebutton _menu_*"; // back to the default touch page
m_fMenuDisplayed = 0;
@ -346,8 +359,12 @@ void CHudMenu::UserCmd_ShowVGUIMenu()
if( gEngfuncs.Cmd_Argc() != 1 )
{
ConsolePrint("usage: showvguimenu <menuType>\n");
return;
}
if( gEngfuncs.pfnGetCvarFloat("touch_enable") == 0.0f )
return;
if( gEngfuncs.pfnGetCvarFloat("_vgui_menus") == 0.0f )
return;

View File

@ -91,6 +91,7 @@
#define MENU_RADIOB 36
#define MENU_RADIOC 37
#define MENU_RADIOSELECTOR 38
#define MENU_NUMERICAL_MENU -1
// -- cs16client extension end -- //