From d6c8cb751a817498d388eb32d6b5f54ce15f9281 Mon Sep 17 00:00:00 2001 From: div0 Date: Mon, 7 May 2007 09:36:42 +0000 Subject: [PATCH] support for menu_cmd sync to reload all cvar objects - and using that in the video settings cfgs git-svn-id: svn://svn.icculus.org/nexuiz/trunk@2510 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- data/high.cfg | 2 ++ data/low.cfg | 2 ++ data/med.cfg | 2 ++ data/normal.cfg | 2 ++ data/omg.cfg | 2 ++ data/qcsrc/menu/gamecommand.qc | 26 ++++++++++++++++++++++++++ data/qcsrc/menu/system/events.qc | 10 ---------- data/ultimate.cfg | 2 ++ data/ultra.cfg | 2 ++ 9 files changed, 40 insertions(+), 10 deletions(-) diff --git a/data/high.cfg b/data/high.cfg index 1103ef5d8..85f183089 100644 --- a/data/high.cfg +++ b/data/high.cfg @@ -34,3 +34,5 @@ r_shadow_realtime_world_shadows 1 r_sky 1 r_depthfirst 1 r_showsurfaces 0 + +menu_cmd sync diff --git a/data/low.cfg b/data/low.cfg index 87fb160d2..7c88f25ab 100644 --- a/data/low.cfg +++ b/data/low.cfg @@ -34,3 +34,5 @@ r_shadow_realtime_world_shadows 0 r_sky 1 r_depthfirst 0 r_showsurfaces 0 + +menu_cmd sync diff --git a/data/med.cfg b/data/med.cfg index dd1a57bb9..29c3ef9e2 100644 --- a/data/med.cfg +++ b/data/med.cfg @@ -34,3 +34,5 @@ r_shadow_realtime_world_shadows 0 r_sky 1 r_depthfirst 0 r_showsurfaces 0 + +menu_cmd sync diff --git a/data/normal.cfg b/data/normal.cfg index 07ab39802..688d5b1c4 100644 --- a/data/normal.cfg +++ b/data/normal.cfg @@ -34,3 +34,5 @@ r_shadow_realtime_world_shadows 0 r_sky 1 r_depthfirst 1 r_showsurfaces 0 + +menu_cmd sync diff --git a/data/omg.cfg b/data/omg.cfg index ed065948a..b90c9f32e 100644 --- a/data/omg.cfg +++ b/data/omg.cfg @@ -34,3 +34,5 @@ r_shadow_realtime_world_shadows 0 r_sky 1 r_depthfirst 0 r_showsurfaces 1 + +menu_cmd sync diff --git a/data/qcsrc/menu/gamecommand.qc b/data/qcsrc/menu/gamecommand.qc index d397e4e83..e2f6d4714 100644 --- a/data/qcsrc/menu/gamecommand.qc +++ b/data/qcsrc/menu/gamecommand.qc @@ -12,6 +12,8 @@ void GameCommand(string command) if(argv(0) == "help" || argc == 0) { print("Usage: menu_cmd COMMAND..., where possible commands are:\n"); + print(" sync - reloads all cvars on the current menu page\n"); + print(" directmenu ITEM - select a menu item as main item\n"); GameCommand_Generic("help"); return; } @@ -19,5 +21,29 @@ void GameCommand(string command) if(GameCommand_Generic(command)) return; + if(argv(0) == "sync") + { + for(self = null_entity; (self = nextent(self)); ) + Raise_DataEvent(self, ITEM_DATA_SYNC); + /* + for(self = null_entity; (self = findstring(self, type, "Item_Data_Cvar")); ) + Raise_DataEvent(self, ITEM_DATA_SYNC); + for(self = null_entity; (self = findstring(self, type, "Item_Data_ServerCvar")); ) + Raise_DataEvent(self, ITEM_DATA_SYNC); + */ + return; + } + + if(argv(0) == "directmenu") if(argc == 2) + { + entity newitem; + newitem = findstring(null_entity, name, argv(1)); + if(newitem) + Menu_ActiveWindow = newitem; + else + print(argv(1), " not found.\n"); + return; + } + print("Invalid command. For a list of supported commands, try menu_cmd help.\n"); } diff --git a/data/qcsrc/menu/system/events.qc b/data/qcsrc/menu/system/events.qc index ddd178dd6..f19f36d89 100644 --- a/data/qcsrc/menu/system/events.qc +++ b/data/qcsrc/menu/system/events.qc @@ -376,16 +376,6 @@ void() Menu_Frame = Menu_CollectGarbage( false ); - - if(cvar_string("scmenu_campaign_goto") != "") { // debug code for the campaign - float level; - level = cvar("scmenu_campaign_goto"); - cvar_set( "scmenu_campaign_goto", "" ); - Campaign_JumpLevel(level); - } else if(cvar_string("scmenu_campaign_dump") != "") { - cvar_set( "scmenu_campaign_dump", "" ); - Campaign_DumpLevels(); - } } void() Menu_Draw = diff --git a/data/ultimate.cfg b/data/ultimate.cfg index 2b4ee9c8c..8eefcfff3 100644 --- a/data/ultimate.cfg +++ b/data/ultimate.cfg @@ -34,3 +34,5 @@ r_shadow_realtime_world_shadows 1 r_sky 1 r_depthfirst 2 r_showsurfaces 0 + +menu_cmd sync diff --git a/data/ultra.cfg b/data/ultra.cfg index a0f9aebdd..bf77b13ec 100644 --- a/data/ultra.cfg +++ b/data/ultra.cfg @@ -34,3 +34,5 @@ r_shadow_realtime_world_shadows 1 r_sky 1 r_depthfirst 2 r_showsurfaces 0 + +menu_cmd sync -- 2.39.2