1 #ifndef CHECKBOX_STRING_H
2 #define CHECKBOX_STRING_H
3 CLASS(XonoticCheckBoxString, CheckBox)
4 METHOD(XonoticCheckBoxString, configureXonoticCheckBoxString, void(entity, string, string, string, string))
5 METHOD(XonoticCheckBoxString, setChecked, void(entity, float))
6 ATTRIB(XonoticCheckBoxString, fontSize, float, SKINFONTSIZE_NORMAL)
7 ATTRIB(XonoticCheckBoxString, image, string, SKINGFX_CHECKBOX)
8 ATTRIB(XonoticCheckBoxString, yesString, string, string_null)
9 ATTRIB(XonoticCheckBoxString, noString, string, string_null)
11 ATTRIB(XonoticCheckBoxString, color, vector, SKINCOLOR_CHECKBOX_N)
12 ATTRIB(XonoticCheckBoxString, colorC, vector, SKINCOLOR_CHECKBOX_C)
13 ATTRIB(XonoticCheckBoxString, colorF, vector, SKINCOLOR_CHECKBOX_F)
14 ATTRIB(XonoticCheckBoxString, colorD, vector, SKINCOLOR_CHECKBOX_D)
16 ATTRIB(XonoticCheckBoxString, cvarName, string, string_null)
17 METHOD(XonoticCheckBoxString, loadCvars, void(entity))
18 METHOD(XonoticCheckBoxString, saveCvars, void(entity))
19 ATTRIB(XonoticCheckBoxString, sendCvars, float, 0)
21 ATTRIB(XonoticCheckBoxString, alpha, float, SKINALPHA_TEXT)
22 ATTRIB(XonoticCheckBoxString, disabledAlpha, float, SKINALPHA_DISABLED)
23 ENDCLASS(XonoticCheckBoxString)
24 entity makeXonoticCheckBoxString(string, string, string, string);
28 entity makeXonoticCheckBoxString(string theYesValue, string theNoValue, string theCvar, string theText)
31 me = NEW(XonoticCheckBoxString);
32 me.configureXonoticCheckBoxString(me, theYesValue, theNoValue, theCvar, theText);
35 void XonoticCheckBoxString_configureXonoticCheckBoxString(entity me, string theYesValue, string theNoValue, string theCvar, string theText)
37 me.yesString = theYesValue;
38 me.noString = theNoValue;
42 me.cvarName = theCvar;
43 me.tooltip = getZonedTooltipForIdentifier(theCvar);
46 me.configureCheckBox(me, theText, me.fontSize, me.image);
48 void XonoticCheckBoxString_setChecked(entity me, float foo)
50 me.checked = !me.checked;
53 void XonoticCheckBoxString_loadCvars(entity me)
58 if(cvar_string(me.cvarName) == me.yesString)
61 void XonoticCheckBoxString_saveCvars(entity me)
67 cvar_set(me.cvarName, me.yesString);
69 cvar_set(me.cvarName, me.noString);
71 CheckSendCvars(me, me.cvarName);