r3336 - in trunk/data: . qcsrc/menu qcsrc/menu/nexuiz

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Wed Feb 6 02:38:18 EST 2008


Author: div0
Date: 2008-02-06 02:38:18 -0500 (Wed, 06 Feb 2008)
New Revision: 3336

Modified:
   trunk/data/default.cfg
   trunk/data/qcsrc/menu/mbuiltin.qh
   trunk/data/qcsrc/menu/nexuiz/dialog_settings_input.c
   trunk/data/qcsrc/menu/nexuiz/dialog_settings_video.c
Log:
DP_QC_CVAR_TYPE, fixes some bugs with menu controls appearing wrong (joystick)


Modified: trunk/data/default.cfg
===================================================================
--- trunk/data/default.cfg	2008-02-05 21:39:11 UTC (rev 3335)
+++ trunk/data/default.cfg	2008-02-06 07:38:18 UTC (rev 3336)
@@ -217,6 +217,7 @@
 set g_minstagib_speed_moverate 1.25
 set g_rocketarena 0
 set g_vampire 0
+set g_shocknex 0
 set g_laserguided_missile 0
 set g_midair 0
 set g_midair_shieldtime 0.3
@@ -492,13 +493,6 @@
 sv_sound_watersplash ""
 sv_clmovement_waitforinput 4
 
-// disable joysticks
-// set them to "" first so this won't override the default value to 0 to make sure the menu can detect whether joystick is supported
-set joystick ""
-set joystick 0
-set joy_enable ""
-set joy_enable 0
-
 // startmap_dm is used when running with the -listen or -dedicated commandline options
 alias startmap_sp "set _sv_init 1; map aggressor"
 alias startmap_dm "set _sv_init 1; map aggressor"
@@ -914,7 +908,6 @@
 
 // these non-saved engine cvars shall be savedG
 seta cl_port $cl_port
-seta joy_enable $joy_enable
 seta r_showsurfaces $r_showsurfaces
 seta r_ambient $r_ambient
 seta skill $skill

Modified: trunk/data/qcsrc/menu/mbuiltin.qh
===================================================================
--- trunk/data/qcsrc/menu/mbuiltin.qh	2008-02-05 21:39:11 UTC (rev 3335)
+++ trunk/data/qcsrc/menu/mbuiltin.qh	2008-02-06 07:38:18 UTC (rev 3336)
@@ -281,6 +281,14 @@
 //When caseinsensitive is set, the CRC is calculated of the lower cased string.
 float(float caseinsensitive, string s, ...) crc16 = #494;
 
+//DP_QC_CVAR_TYPE
+float(string name) cvar_type = #495;
+float CVAR_TYPEFLAG_EXISTS = 1;
+float CVAR_TYPEFLAG_SAVED = 2;
+float CVAR_TYPEFLAG_PRIVATE = 4;
+float CVAR_TYPEFLAG_ENGINE = 8;
+float CVAR_TYPEFLAG_HASDESCRIPTION = 16;
+
 #ifdef FIXEDFOPEN
 float 	fopen( string filename, float mode ) =
 {

Modified: trunk/data/qcsrc/menu/nexuiz/dialog_settings_input.c
===================================================================
--- trunk/data/qcsrc/menu/nexuiz/dialog_settings_input.c	2008-02-05 21:39:11 UTC (rev 3335)
+++ trunk/data/qcsrc/menu/nexuiz/dialog_settings_input.c	2008-02-06 07:38:18 UTC (rev 3336)
@@ -50,18 +50,18 @@
 	me.TR(me);
 		me.TD(me, 1, 3, e = makeNexuizCheckBox(1.022, "m_pitch", "Invert mouse"));
 	me.TR(me);
-		if(cvar_defstring("joy_enable") != "")
+		if(cvar_type("joy_enable") & CVAR_TYPEFLAG_ENGINE)
 			me.TD(me, 1, 3, e = makeNexuizCheckBox(0, "joy_enable", "Use joystick input"));
-		else if(cvar_defstring("joystick") != "")
+		else if(cvar_type("joystick") & CVAR_TYPEFLAG_ENGINE)
 			me.TD(me, 1, 3, e = makeNexuizCheckBox(0, "joystick", "Use joystick input"));
 	me.TR(me);
 		me.TD(me, 1, 3, e = makeNexuizCheckBox(0, "cl_movement", "Client-side movement prediction"));
 	me.TR(me);
 		me.TD(me, 1, 3, e = makeNexuizCheckBox(0, "con_closeontoggleconsole", "\"enter console\" also closes"));
 	me.TR(me);
-		if(cvar_defstring("vid_dgamouse") != "")
+		if(cvar_type("vid_dgamouse") & CVAR_TYPEFLAG_ENGINE)
 			me.TD(me, 1, 3, e = makeNexuizCheckBox(0, "vid_dgamouse", "Turn off OS mouse acceleration"));
-		else if(cvar_defstring("apple_mouse_noaccel") != "")
+		else if(cvar_type("apple_mouse_noaccel") & CVAR_TYPEFLAG_ENGINE)
 			me.TD(me, 1, 3, e = makeNexuizCheckBox(0, "apple_mouse_noaccel", "Turn off OS mouse acceleration"));
 }
 #endif

Modified: trunk/data/qcsrc/menu/nexuiz/dialog_settings_video.c
===================================================================
--- trunk/data/qcsrc/menu/nexuiz/dialog_settings_video.c	2008-02-05 21:39:11 UTC (rev 3335)
+++ trunk/data/qcsrc/menu/nexuiz/dialog_settings_video.c	2008-02-06 07:38:18 UTC (rev 3336)
@@ -54,7 +54,7 @@
 			e.configureNexuizTextSliderValues(e);
 
 	me.TR(me);
-		if(cvar_defstring("apple_multithreadedgl") != "") // FIXME can this check against string_null too?
+		if(cvar_type("apple_multithreadedgl") & CVAR_TYPEFLAG_ENGINE)
 			me.TD(me, 1, 3, e = makeNexuizCheckBox(1, "apple_multithreadedgl", "Disable multithreaded OpenGL"));
 
 	me.TR(me);




More information about the nexuiz-commits mailing list