2 CLASS(XonoticDecibelsSlider) EXTENDS(XonoticSlider)
3 METHOD(XonoticDecibelsSlider, loadCvars, void(entity))
4 METHOD(XonoticDecibelsSlider, saveCvars, void(entity))
5 METHOD(XonoticDecibelsSlider, valueToText, string(entity, float))
6 ENDCLASS(XonoticDecibelsSlider)
7 entity makeXonoticDecibelsSlider(float, float, float, string);
12 entity makeXonoticDecibelsSlider(float theValueMin, float theValueMax, float theValueStep, string theCvar)
15 me = spawnXonoticDecibelsSlider();
16 me.configureXonoticSlider(me, theValueMin, theValueMax, theValueStep, theCvar);
19 void loadCvarsXonoticDecibelsSlider(entity me)
26 v = cvar(me.cvarName);
32 me.value = 0.1 * floor(0.5 + 10.0 * log10(cvar(me.cvarName)) * 10);
34 void saveCvarsXonoticDecibelsSlider(entity me)
40 cvar_set(me.cvarName, "1");
42 cvar_set(me.cvarName, "0");
44 cvar_set(me.cvarName, ftos(pow(10, me.value / 10)));
47 string valueToTextXonoticDecibelsSlider(entity me, float v)
53 return strcat(valueToTextSlider(me, v), " dB");