2 CLASS(XonoticCheckBoxString) EXTENDS(CheckBox)
3 METHOD(XonoticCheckBoxString, configureXonoticCheckBoxString, void(entity, string, string, string, string))
4 METHOD(XonoticCheckBoxString, setChecked, void(entity, float))
5 ATTRIB(XonoticCheckBoxString, fontSize, float, SKINFONTSIZE_NORMAL)
6 ATTRIB(XonoticCheckBoxString, image, string, SKINGFX_CHECKBOX)
7 ATTRIB(XonoticCheckBoxString, yesString, string, string_null)
8 ATTRIB(XonoticCheckBoxString, noString, string, string_null)
10 ATTRIB(XonoticCheckBoxString, color, vector, SKINCOLOR_CHECKBOX_N)
11 ATTRIB(XonoticCheckBoxString, colorC, vector, SKINCOLOR_CHECKBOX_C)
12 ATTRIB(XonoticCheckBoxString, colorF, vector, SKINCOLOR_CHECKBOX_F)
13 ATTRIB(XonoticCheckBoxString, colorD, vector, SKINCOLOR_CHECKBOX_D)
15 ATTRIB(XonoticCheckBoxString, cvarName, string, string_null)
16 METHOD(XonoticCheckBoxString, loadCvars, void(entity))
17 METHOD(XonoticCheckBoxString, saveCvars, void(entity))
19 ATTRIB(XonoticCheckBoxString, alpha, float, SKINALPHA_TEXT)
20 ATTRIB(XonoticCheckBoxString, disabledAlpha, float, SKINALPHA_DISABLED)
21 ENDCLASS(XonoticCheckBoxString)
22 entity makeXonoticCheckBoxString(string, string, string, string);
26 entity makeXonoticCheckBoxString(string theYesValue, string theNoValue, string theCvar, string theText)
29 me = spawnXonoticCheckBoxString();
30 me.configureXonoticCheckBoxString(me, theYesValue, theNoValue, theCvar, theText);
33 void XonoticCheckBoxString_configureXonoticCheckBoxString(entity me, string theYesValue, string theNoValue, string theCvar, string theText)
35 me.yesString = theYesValue;
36 me.noString = theNoValue;
40 me.cvarName = theCvar;
41 me.tooltip = getZonedTooltipForIdentifier(theCvar);
44 me.configureCheckBox(me, theText, me.fontSize, me.image);
46 void XonoticCheckBoxString_setChecked(entity me, float foo)
48 me.checked = !me.checked;
51 void XonoticCheckBoxString_loadCvars(entity me)
56 if(cvar_string(me.cvarName) == me.yesString)
59 void XonoticCheckBoxString_saveCvars(entity me)
65 cvar_set(me.cvarName, me.yesString);
67 cvar_set(me.cvarName, me.noString);