]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/xonotic/slider.qc
Don't play any animation when loading the initial value of a slider since the animati...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / slider.qc
index d63fe1c336c8ae2d2577803b67bd12cbfe59b5cb..d1e4f7e07876b656b27335b33d36c329f47c4783 100644 (file)
@@ -1,7 +1,9 @@
-#ifdef INTERFACE
-CLASS(XonoticSlider) EXTENDS(Slider)
-       METHOD(XonoticSlider, configureXonoticSlider, void(entity, float, float, float, string))
-       METHOD(XonoticSlider, setValue, void(entity, float))
+#ifndef SLIDER_H
+#define SLIDER_H
+#include "../item/slider.qc"
+CLASS(XonoticSlider, Slider)
+       METHOD(XonoticSlider, configureXonoticSlider, void(entity, float, float, float, string));
+       METHOD(XonoticSlider, setValue, void(entity, float));
        ATTRIB(XonoticSlider, fontSize, float, SKINFONTSIZE_NORMAL)
        ATTRIB(XonoticSlider, valueSpace, float, SKINWIDTH_SLIDERTEXT)
        ATTRIB(XonoticSlider, image, string, SKINGFX_SLIDER)
@@ -14,8 +16,8 @@ CLASS(XonoticSlider) EXTENDS(Slider)
        ATTRIB(XonoticSlider, color2, vector, SKINCOLOR_SLIDER_S)
 
        ATTRIB(XonoticSlider, cvarName, string, string_null)
-       METHOD(XonoticSlider, loadCvars, void(entity))
-       METHOD(XonoticSlider, saveCvars, void(entity))
+       METHOD(XonoticSlider, loadCvars, void(entity));
+       METHOD(XonoticSlider, saveCvars, void(entity));
        ATTRIB(XonoticSlider, sendCvars, float, 0)
 
        ATTRIB(XonoticSlider, alpha, float, SKINALPHA_TEXT)
@@ -28,7 +30,7 @@ entity makeXonoticSlider(float, float, float, string);
 entity makeXonoticSlider(float theValueMin, float theValueMax, float theValueStep, string theCvar)
 {
        entity me;
-       me = spawnXonoticSlider();
+       me = NEW(XonoticSlider);
        me.configureXonoticSlider(me, theValueMin, theValueMax, theValueStep, theCvar);
        return me;
 }
@@ -66,7 +68,7 @@ void XonoticSlider_loadCvars(entity me)
        if (!me.cvarName)
                return;
 
-       me.setValue( me, cvar(me.cvarName) );
+       me.setValue_noAnim(me, cvar(me.cvarName));
 }
 void XonoticSlider_saveCvars(entity me)
 {