From: Samual Lenks Date: Fri, 27 Dec 2013 04:01:54 +0000 (-0500) Subject: Add ability for makeMulti inverse cvars (for r_water_hideplayer switching) X-Git-Tag: xonotic-v0.8.0~246^2~2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=fec2951146f0bfbeda2dccfaee92b0960d9d515d;p=xonotic%2Fxonotic-data.pk3dir.git Add ability for makeMulti inverse cvars (for r_water_hideplayer switching) --- diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_view.c b/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_view.c index b2b440a1c..3012835e9 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_view.c +++ b/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_view.c @@ -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"))); diff --git a/qcsrc/menu/xonotic/util.qc b/qcsrc/menu/xonotic/util.qc index 34f67397e..28987529a 100644 --- a/qcsrc/menu/xonotic/util.qc +++ b/qcsrc/menu/xonotic/util.qc @@ -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) {