From: terencehill Date: Fri, 9 Oct 2015 16:23:26 +0000 (+0200) Subject: Fix sliders not setting cvars when dragged X-Git-Tag: xonotic-v0.8.2~1812^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=df522218671a331e45ef5599107ea988ea7cd07d;p=xonotic%2Fxonotic-data.pk3dir.git Fix sliders not setting cvars when dragged --- diff --git a/qcsrc/menu/xonotic/slider.qc b/qcsrc/menu/xonotic/slider.qc index 7ecd7a9d0..2b0bd6ce0 100644 --- a/qcsrc/menu/xonotic/slider.qc +++ b/qcsrc/menu/xonotic/slider.qc @@ -4,6 +4,7 @@ CLASS(XonoticSlider, Slider) METHOD(XonoticSlider, configureXonoticSlider, void(entity, float, float, float, string, string)); METHOD(XonoticSlider, setValue, void(entity, float)); + METHOD(XonoticSlider, setValue_noAnim, void(entity, float)); ATTRIB(XonoticSlider, fontSize, float, SKINFONTSIZE_NORMAL) ATTRIB(XonoticSlider, valueSpace, float, SKINWIDTH_SLIDERTEXT) ATTRIB(XonoticSlider, image, string, SKINGFX_SLIDER) @@ -66,6 +67,14 @@ void XonoticSlider_setValue(entity me, float val) me.saveCvars(me); } } +void XonoticSlider_setValue_noAnim(entity me, float val) +{ + if(val != me.value) + { + SUPER(XonoticSlider).setValue_noAnim(me, val); + me.saveCvars(me); + } +} void XonoticSlider_loadCvars(entity me) { if (!me.cvarName) diff --git a/qcsrc/menu/xonotic/textslider.qc b/qcsrc/menu/xonotic/textslider.qc index 8c4682ee0..c21b07734 100644 --- a/qcsrc/menu/xonotic/textslider.qc +++ b/qcsrc/menu/xonotic/textslider.qc @@ -4,6 +4,7 @@ CLASS(XonoticTextSlider, TextSlider) METHOD(XonoticTextSlider, configureXonoticTextSlider, void(entity, string, string)); METHOD(XonoticTextSlider, setValue, void(entity, float)); + METHOD(XonoticTextSlider, setValue_noAnim, void(entity, float)); METHOD(XonoticTextSlider, configureXonoticTextSliderValues, void(entity)); ATTRIB(XonoticTextSlider, fontSize, float, SKINFONTSIZE_NORMAL) ATTRIB(XonoticTextSlider, valueSpace, float, SKINWIDTH_SLIDERTEXT) @@ -55,6 +56,14 @@ void XonoticTextSlider_setValue(entity me, float val) me.saveCvars(me); } } +void XonoticTextSlider_setValue_noAnim(entity me, float val) +{ + if(val != me.value) + { + SUPER(XonoticTextSlider).setValue_noAnim(me, val); + me.saveCvars(me); + } +} void XonoticTextSlider_loadCvars(entity me) { if (!me.cvarName)