1 #ifndef SLIDER_SBFADETIME_H
2 #define SLIDER_SBFADETIME_H
3 #include "textslider.qc"
4 CLASS(XonoticScoreboardFadeTimeSlider, XonoticTextSlider)
5 METHOD(XonoticScoreboardFadeTimeSlider, configureXonoticScoreboardFadeTimeSlider, void(entity))
6 METHOD(XonoticScoreboardFadeTimeSlider, loadCvars, void(entity))
7 METHOD(XonoticScoreboardFadeTimeSlider, saveCvars, void(entity))
8 ENDCLASS(XonoticScoreboardFadeTimeSlider)
9 entity makeXonoticScoreboardFadeTimeSlider();
13 entity makeXonoticScoreboardFadeTimeSlider()
16 me = NEW(XonoticScoreboardFadeTimeSlider);
17 me.configureXonoticScoreboardFadeTimeSlider(me);
20 void XonoticScoreboardFadeTimeSlider_configureXonoticScoreboardFadeTimeSlider(entity me)
22 me.configureXonoticTextSlider(me, "scoreboard_fadeinspeed");
23 me.addValue(me, ZCTX(_("PART^Slow")), "5 2.5");
24 me.addValue(me, ZCTX(_("PART^Normal")), "10 5");
25 me.addValue(me, ZCTX(_("PART^Fast")), "15 7.5");
26 me.addValue(me, ZCTX(_("PART^Instant")), "0 0");
27 me.configureXonoticTextSliderValues(me);
29 void XonoticScoreboardFadeTimeSlider_loadCvars(entity me)
31 me.setValueFromIdentifier(me, sprintf("%s %s",
32 cvar_string("scoreboard_fadeinspeed"),
33 cvar_string("scoreboard_fadeoutspeed")
36 void XonoticScoreboardFadeTimeSlider_saveCvars(entity me)
38 if(me.value >= 0 || me.value < me.nValues)
40 tokenize_console(me.getIdentifier(me));
41 cvar_set("scoreboard_fadeinspeed", argv(0));
42 cvar_set("scoreboard_fadeoutspeed", argv(1));