2 CLASS(NexuizCheckBox) EXTENDS(CheckBox)
3 METHOD(NexuizCheckBox, configureNexuizCheckBox, void(entity, float, string, string))
4 METHOD(NexuizCheckBox, setChecked, void(entity, float))
5 ATTRIB(NexuizCheckBox, fontSize, float, SKINFONTSIZE_NORMAL)
6 ATTRIB(NexuizCheckBox, image, string, SKINGFX_CHECKBOX)
7 ATTRIB(NexuizCheckBox, inverted, float, 0)
9 ATTRIB(NexuizCheckBox, color, vector, SKINCOLOR_CHECKBOX_N)
10 ATTRIB(NexuizCheckBox, colorC, vector, SKINCOLOR_CHECKBOX_C)
11 ATTRIB(NexuizCheckBox, colorF, vector, SKINCOLOR_CHECKBOX_F)
12 ATTRIB(NexuizCheckBox, colorD, vector, SKINCOLOR_CHECKBOX_D)
14 ATTRIB(NexuizCheckBox, cvarName, string, string_null)
15 METHOD(NexuizCheckBox, loadCvars, void(entity))
16 METHOD(NexuizCheckBox, saveCvars, void(entity))
18 ATTRIB(NexuizCheckBox, disabledAlpha, float, SKINALPHA_DISABLED)
19 ENDCLASS(NexuizCheckBox)
20 entity makeNexuizCheckBox(float, string, string);
24 entity makeNexuizCheckBox(float isInverted, string theCvar, string theText)
27 me = spawnNexuizCheckBox();
28 me.configureNexuizCheckBox(me, isInverted, theCvar, theText);
31 void configureNexuizCheckBoxNexuizCheckBox(entity me, float isInverted, string theCvar, string theText)
33 me.inverted = isInverted;
37 me.cvarName = theCvar;
40 me.configureCheckBox(me, theText, me.fontSize, me.image);
42 void setCheckedNexuizCheckBox(entity me, float val)
50 void loadCvarsNexuizCheckBox(entity me)
52 me.checked = me.inverted - !!cvar(me.cvarName);
54 void saveCvarsNexuizCheckBox(entity me)
56 cvar_set(me.cvarName, ftos(fabs(me.inverted - me.checked)));