]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add ability for makeMulti inverse cvars (for r_water_hideplayer switching)
authorSamual Lenks <samual@xonotic.org>
Fri, 27 Dec 2013 04:01:54 +0000 (23:01 -0500)
committerSamual Lenks <samual@xonotic.org>
Fri, 27 Dec 2013 04:01:54 +0000 (23:01 -0500)
qcsrc/menu/xonotic/dialog_multiplayer_playersetup_view.c
qcsrc/menu/xonotic/util.qc

index b2b440a1c45673b0dbe7cc1aef5c62cb874f4858..3012835e93b7c1dc405c2c5a4dee7964027026d0 100644 (file)
@@ -73,7 +73,7 @@ void XonoticViewDialog_fill(entity me)
 
        me.gotoRC(me, 0, 3.2); me.setFirstColumn(me, me.currentColumn);
                me.TD(me, 1, 3, e = makeXonoticRadioButton(1, "chase_active", "0", _("1st person perspective")));
-               makeMulti(e, "crosshair_hittest_showimpact");
+               makeMulti(e, "crosshair_hittest_showimpact !r_water_hideplayer");
        me.TR(me);
                me.TDempty(me, 0.2);
                me.TD(me, 1, 2.8, e = makeXonoticCheckBoxEx(0.05, 0, "cl_bobfall", _("Smooth the view when landing from a jump")));
@@ -94,7 +94,7 @@ void XonoticViewDialog_fill(entity me)
        me.TR(me);
        me.TR(me);
                me.TD(me, 1, 3, e = makeXonoticRadioButton(1, "chase_active", "1", _("3rd person perspective")));
-               makeMulti(e, "crosshair_hittest_showimpact");
+               makeMulti(e, "crosshair_hittest_showimpact !r_water_hideplayer");
        me.TR(me);
                me.TDempty(me, 0.2);
                me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Back distance")));
index 34f67397eb0bef09944f2cc1627facd0cfb668c9..28987529a639edd2a5743311229c3e081446bdc2 100644 (file)
@@ -87,7 +87,12 @@ void saveCvarsMulti(entity me)
 
        n = tokenize_console(me.cvarNames_Multi);
        for(i = 0; i < n; ++i)
-               cvar_set(argv(i), s);
+       {
+               if(substring(argv(i), 0, 1) == "!")
+                       cvar_set(substring(argv(i), 1, strlen(argv(i))), ftos(!stof(s)));
+               else
+                       cvar_set(argv(i), s);
+       }
 }
 void makeMulti(entity e, string otherCvars)
 {