1 #include "checkbox_string.qh"
2 #ifndef CHECKBOX_STRING_H
3 #define CHECKBOX_STRING_H
4 #include "../item/checkbox.qc"
5 CLASS(XonoticCheckBoxString, CheckBox)
6 METHOD(XonoticCheckBoxString, configureXonoticCheckBoxString, void(entity, string, string, string, string));
7 METHOD(XonoticCheckBoxString, setChecked, void(entity, float));
8 ATTRIB(XonoticCheckBoxString, fontSize, float, SKINFONTSIZE_NORMAL)
9 ATTRIB(XonoticCheckBoxString, image, string, SKINGFX_CHECKBOX)
10 ATTRIB(XonoticCheckBoxString, yesString, string, string_null)
11 ATTRIB(XonoticCheckBoxString, noString, string, string_null)
13 ATTRIB(XonoticCheckBoxString, color, vector, SKINCOLOR_CHECKBOX_N)
14 ATTRIB(XonoticCheckBoxString, colorC, vector, SKINCOLOR_CHECKBOX_C)
15 ATTRIB(XonoticCheckBoxString, colorF, vector, SKINCOLOR_CHECKBOX_F)
16 ATTRIB(XonoticCheckBoxString, colorD, vector, SKINCOLOR_CHECKBOX_D)
18 ATTRIB(XonoticCheckBoxString, cvarName, string, string_null)
19 METHOD(XonoticCheckBoxString, loadCvars, void(entity));
20 METHOD(XonoticCheckBoxString, saveCvars, void(entity));
21 ATTRIB(XonoticCheckBoxString, sendCvars, float, 0)
23 ATTRIB(XonoticCheckBoxString, alpha, float, SKINALPHA_TEXT)
24 ATTRIB(XonoticCheckBoxString, disabledAlpha, float, SKINALPHA_DISABLED)
25 ENDCLASS(XonoticCheckBoxString)
26 entity makeXonoticCheckBoxString(string, string, string, string);
30 entity makeXonoticCheckBoxString(string theYesValue, string theNoValue, string theCvar, string theText)
33 me = NEW(XonoticCheckBoxString);
34 me.configureXonoticCheckBoxString(me, theYesValue, theNoValue, theCvar, theText);
37 void XonoticCheckBoxString_configureXonoticCheckBoxString(entity me, string theYesValue, string theNoValue, string theCvar, string theText)
39 me.yesString = theYesValue;
40 me.noString = theNoValue;
42 me.cvarName = (theCvar) ? theCvar : string_null;
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);
69 CheckSendCvars(me, me.cvarName);