]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/xonotic/slider.qc
take3: format 903 files
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / slider.qc
index c8e057a641416aa922a9760b6cbaafa3072b881e..e369291db006fe52aa19fdb61e46dd8538ad873b 100644 (file)
@@ -15,48 +15,50 @@ void XonoticSlider_configureXonoticSlider(entity me, float theValueMin, float th
 {
        float vp;
        vp = theValueStep * 10;
-       while(fabs(vp) < fabs(theValueMax - theValueMin) / 40)
+       while (fabs(vp) < fabs(theValueMax - theValueMin) / 40) {
                vp *= 10;
+       }
 
        me.configureSliderVisuals(me, me.fontSize, me.align, me.valueSpace, me.image);
 
        me.cvarName = (theCvar) ? theCvar : string_null;
-       if(theCvar)
+       if (theCvar) {
                // Prevent flickering of the slider button by initialising the
                // slider out of bounds to hide the button before loading the cvar
-               me.configureSliderValues(me, theValueMin, theValueMin-theValueStep, theValueMax, theValueStep, theValueStep, vp);
-       else
+               me.configureSliderValues(me, theValueMin, theValueMin - theValueStep, theValueMax, theValueStep, theValueStep, vp);
+       } else {
                me.configureSliderValues(me, theValueMin, theValueMin, theValueMax, theValueStep, theValueStep, vp);
+       }
        me.loadCvars(me);
        setZonedTooltip(me, theTooltip, theCvar);
 }
 void XonoticSlider_setValue(entity me, float val)
 {
-       if(val != me.value)
-       {
-               SUPER(XonoticSlider).setValue( me, val );
+       if (val != me.value) {
+               SUPER(XonoticSlider).setValue(me, val);
                me.saveCvars(me);
        }
 }
 void XonoticSlider_setValue_noAnim(entity me, float val)
 {
-       if(val != me.value)
-       {
+       if (val != me.value) {
                SUPER(XonoticSlider).setValue_noAnim(me, val);
                me.saveCvars(me);
        }
 }
 void XonoticSlider_loadCvars(entity me)
 {
-       if (!me.cvarName)
+       if (!me.cvarName) {
                return;
+       }
 
        me.setValue_noAnim(me, cvar(me.cvarName));
 }
 void XonoticSlider_saveCvars(entity me)
 {
-       if (!me.cvarName)
+       if (!me.cvarName) {
                return;
+       }
 
        cvar_set(me.cvarName, ftos_mindecimals(me.value));