]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/xonotic/slider.qc
Merge branch 'drjaska/silent-respawn' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / slider.qc
index fc4228cf98b0503b55f013a15df217d1909978f5..d0a1cfb759e32371d4d12e3135384f285e0c9c69 100644 (file)
@@ -20,7 +20,7 @@ void XonoticSlider_configureXonoticSlider(entity me, float theValueMin, float th
 
        me.configureSliderVisuals(me, me.fontSize, me.align, me.valueSpace, me.image);
 
-       me.cvarName = (theCvar) ? theCvar : string_null;
+       me.controlledCvar = (theCvar) ? theCvar : string_null;
        if(theCvar)
                // Prevent flickering of the slider button by initialising the
                // slider out of bounds to hide the button before loading the cvar
@@ -48,17 +48,17 @@ void XonoticSlider_setValue_noAnim(entity me, float val)
 }
 void XonoticSlider_loadCvars(entity me)
 {
-       if (!me.cvarName)
+       if (!me.controlledCvar)
                return;
 
-       me.setValue_noAnim(me, cvar(me.cvarName));
+       me.setValue_noAnim(me, cvar(me.controlledCvar));
 }
 void XonoticSlider_saveCvars(entity me)
 {
-       if (!me.cvarName)
+       if (!me.controlledCvar)
                return;
 
-       cvar_set(me.cvarName, ftos(me.value));
+       cvar_set(me.controlledCvar, ftos_mindecimals(me.value));
 
-       CheckSendCvars(me, me.cvarName);
+       CheckSendCvars(me, me.controlledCvar);
 }