From c02670e7369a5a3ba6973c07d7e99b317123c901 Mon Sep 17 00:00:00 2001 From: a1batross Date: Wed, 16 Mar 2016 20:42:31 +0300 Subject: [PATCH] call numberical_menu.cfg if unknown menu is shown --- cl_dll/hud/menu.cpp | 21 +++++++++++++++++++-- dlls/cdll_dll.h | 1 + 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/cl_dll/hud/menu.cpp b/cl_dll/hud/menu.cpp index 6dfb07c..f165ebd 100644 --- a/cl_dll/hud/menu.cpp +++ b/cl_dll/hud/menu.cpp @@ -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 \n"); + return; } + if( gEngfuncs.pfnGetCvarFloat("touch_enable") == 0.0f ) + return; + if( gEngfuncs.pfnGetCvarFloat("_vgui_menus") == 0.0f ) return; diff --git a/dlls/cdll_dll.h b/dlls/cdll_dll.h index 74573c4..aa79a1f 100644 --- a/dlls/cdll_dll.h +++ b/dlls/cdll_dll.h @@ -91,6 +91,7 @@ #define MENU_RADIOB 36 #define MENU_RADIOC 37 #define MENU_RADIOSELECTOR 38 +#define MENU_NUMERICAL_MENU -1 // -- cs16client extension end -- //