]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/xonotic/checkbox.qc
Restore white tos text
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / checkbox.qc
index b863518981b7b9fb5023e881fc695754e7d7cfcb..1065c5d6d1a5ff9b2900f7a82182fb7efe1720ce 100644 (file)
@@ -2,28 +2,28 @@
 
 entity makeXonoticCheckBox_T(float isInverted, string theCvar, string theText, string theTooltip)
 {
-       float y, n;
+       float m, n;
        if(isInverted > 1)
        {
                n = isInverted - 1;
-               y = -n;
+               m = -n;
        }
        else if(isInverted < -1)
        {
                n = isInverted + 1;
-               y = -n;
+               m = -n;
        }
        else if(isInverted == 1)
        {
                n = 1;
-               y = 0;
+               m = 0;
        }
        else
        {
                n = 0;
-               y = 1;
+               m = 1;
        }
-       return makeXonoticCheckBoxEx_T(y, n, theCvar, theText, theTooltip);
+       return makeXonoticCheckBoxEx_T(m, n, theCvar, theText, theTooltip);
 }
 entity makeXonoticCheckBox(float isInverted, string theCvar, string theText)
 {
@@ -47,7 +47,7 @@ void XonoticCheckBox_configureXonoticCheckBox(entity me, float theYesValue, floa
        me.yesValue = theYesValue;
        me.noValue = theNoValue;
        me.checked = 0;
-       me.cvarName = (theCvar) ? theCvar : string_null;
+       me.controlledCvar = (theCvar) ? theCvar : string_null;
        me.loadCvars(me);
        setZonedTooltip(me, theTooltip, theCvar);
        me.configureCheckBox(me, theText, me.fontSize, me.image);
@@ -66,22 +66,22 @@ void XonoticCheckBox_loadCvars(entity me)
 {
        float m, d;
 
-       if (!me.cvarName)
+       if (!me.controlledCvar)
                return;
 
        m = (me.yesValue + me.noValue) * 0.5;
-       d = (cvar(me.cvarName) - m) / (me.yesValue - m);
+       d = (cvar(me.controlledCvar) - m) / (me.yesValue - m);
        me.checked = (d > 0);
 }
 void XonoticCheckBox_saveCvars(entity me)
 {
-       if (!me.cvarName)
+       if (!me.controlledCvar)
                return;
 
        if(me.checked)
-               cvar_set(me.cvarName, ftos_mindecimals(me.yesValue));
+               cvar_set(me.controlledCvar, ftos_mindecimals(me.yesValue));
        else
-               cvar_set(me.cvarName, ftos_mindecimals(me.noValue));
+               cvar_set(me.controlledCvar, ftos_mindecimals(me.noValue));
 
-       CheckSendCvars(me, me.cvarName);
+       CheckSendCvars(me, me.controlledCvar);
 }