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))
18 ATTRIB(XonoticCheckBoxString, sendCvars, float, 0)
20 ATTRIB(XonoticCheckBoxString, alpha, float, SKINALPHA_TEXT)
21 ATTRIB(XonoticCheckBoxString, disabledAlpha, float, SKINALPHA_DISABLED)
22 ENDCLASS(XonoticCheckBoxString)
23 entity makeXonoticCheckBoxString(string, string, string, string);
27 entity makeXonoticCheckBoxString(string theYesValue, string theNoValue, string theCvar, string theText)
30 me = spawnXonoticCheckBoxString();
31 me.configureXonoticCheckBoxString(me, theYesValue, theNoValue, theCvar, theText);
34 void XonoticCheckBoxString_configureXonoticCheckBoxString(entity me, string theYesValue, string theNoValue, string theCvar, string theText)
36 me.yesString = theYesValue;
37 me.noString = theNoValue;
41 me.cvarName = theCvar;
42 me.tooltip = getZonedTooltipForIdentifier(theCvar);
45 me.configureCheckBox(me, theText, me.fontSize, me.image);
47 void XonoticCheckBoxString_setChecked(entity me, float foo)
49 me.checked = !me.checked;
52 void XonoticCheckBoxString_loadCvars(entity me)
57 if(cvar_string(me.cvarName) == me.yesString)
60 void XonoticCheckBoxString_saveCvars(entity me)
66 cvar_set(me.cvarName, me.yesString);
68 cvar_set(me.cvarName, me.noString);
70 CheckSendCvars(me, me.cvarName);