From a9f8117173e30c8020e99ec5172bb8c5bbb0a232 Mon Sep 17 00:00:00 2001 From: black Date: Sat, 10 Dec 2005 14:54:00 +0000 Subject: [PATCH] Add support for scmenu_directmenu (former menu_directmenu). Add support for Nex_Action_ConsoleCmd. git-svn-id: svn://svn.icculus.org/nexuiz/trunk@645 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- data/menuqc/custom/player/color.qc | 2 +- data/menuqc/custom/util.qm | 19 +++++++++++++++++++ data/menuqc/system/isframe.qc | 8 ++++---- data/menuqc/todo | 2 +- 4 files changed, 25 insertions(+), 6 deletions(-) diff --git a/data/menuqc/custom/player/color.qc b/data/menuqc/custom/player/color.qc index 9c95d4aa1..9d51d5d00 100644 --- a/data/menuqc/custom/player/color.qc +++ b/data/menuqc/custom/player/color.qc @@ -21,7 +21,7 @@ void( string pValue ) _IDNC_SendSyncCmd = { lShirt = (lCombined & 0xF0) / 16; cmd( "color ", ftos( lPants ), " ", ftos( lShirt ), "\n" ); - print( "%color ", ftos( lPants ), " ", ftos( lShirt ), "\n" ); + //print( "%color ", ftos( lPants ), " ", ftos( lShirt ), "\n" ); }; void() _IDNC_Sync = diff --git a/data/menuqc/custom/util.qm b/data/menuqc/custom/util.qm index 296cdba2f..845ac5f4e 100644 --- a/data/menuqc/custom/util.qm +++ b/data/menuqc/custom/util.qm @@ -27,3 +27,22 @@ void() Nex_Action_PlaySoundOnce = } Menu_DeleteAfterToggle( self ); }; + +// execute a console cmd on action +void() Nex_Action_ConsoleCmd_Destroy = +{ + String_EntityFree( self, syncCmd ); +}; + +void() Nex_Action_ConsoleCmd_Action = +{ + cmd( self.syncCmd ); +} + +void() Nex_Action_ConsoleCmd = +{ + String_EntityZone( self, syncCmd ); + + self.destroy = Nex_Action_ConsoleCmd_Destroy; + self.action = Nex_Action_ConsoleCmd_Action; +}; diff --git a/data/menuqc/system/isframe.qc b/data/menuqc/system/isframe.qc index 097504a29..f58759a3e 100644 --- a/data/menuqc/system/isframe.qc +++ b/data/menuqc/system/isframe.qc @@ -250,10 +250,10 @@ void() Menu_PerformReinit = Menu_KeyHook = Util_NullFunction; // choose which menu to display - // AK 05: added support for menu_directmenu - if( cvar_string( "menu_directmenu" ) != "" ) { - Menu_ActiveWindow = findstring( null_entity, name, cvar_string( "menu_directmenu" ) ); - cvar_set( "menu_directmenu", "" ); + // AK 05: added support for scmenu_directmenu + if( cvar_string( "scmenu_directmenu" ) != "" ) { + Menu_ActiveWindow = findstring( null_entity, name, cvar_string( "scmenu_directmenu" ) ); + cvar_set( "scmenu_directmenu", "" ); } else if( MENU_ALLOWINGAME && ( gamestatus & GAME_CONNECTED ) ) Menu_ActiveWindow = findstring( null_entity, name, MENU_INGAME_NAME ); else diff --git a/data/menuqc/todo b/data/menuqc/todo index 664a54231..a4960e17e 100644 --- a/data/menuqc/todo +++ b/data/menuqc/todo @@ -1,7 +1,7 @@ // Todo list -Clean up the Nex_ custom mess a bit --Notify Spike that the "effectless statement" warning has a off-by-one bug +*-Notify Spike that the "effectless statement" warning has a off-by-one bug *-Rename Item_Composition and make it not embedded by default *-Add support for a MOUSECLIP flag which will make the menu not pass any mouse events to the items under it *-Move the normal key function somewhere else perhaps?? -- 2.39.2