2 CLASS(NexuizDecibelsSlider) EXTENDS(NexuizSlider)
3 METHOD(NexuizDecibelsSlider, loadCvars, void(entity))
4 METHOD(NexuizDecibelsSlider, saveCvars, void(entity))
5 METHOD(NexuizDecibelsSlider, valueToText, string(entity, float))
6 ENDCLASS(NexuizDecibelsSlider)
7 entity makeNexuizDecibelsSlider(float, float, float, string);
12 entity makeNexuizDecibelsSlider(float theValueMin, float theValueMax, float theValueStep, string theCvar)
15 me = spawnNexuizDecibelsSlider();
16 me.configureNexuizSlider(me, theValueMin, theValueMax, theValueStep, theCvar);
19 void loadCvarsNexuizDecibelsSlider(entity me)
26 v = cvar(me.cvarName);
32 me.value = 0.1 * floor(0.5 + 10.0 * log10(cvar(me.cvarName)) * 10);
34 void saveCvarsNexuizDecibelsSlider(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 valueToTextNexuizDecibelsSlider(entity me, float v)
53 return strcat(valueToTextSlider(me, v), " dB");