1 #include "checkbox_string.qh"
3 entity makeXonoticCheckBoxString(string theYesValue, string theNoValue, string theCvar, string theText)
6 me = NEW(XonoticCheckBoxString);
7 me.configureXonoticCheckBoxString(me, theYesValue, theNoValue, theCvar, theText);
10 void XonoticCheckBoxString_configureXonoticCheckBoxString(entity me, string theYesValue, string theNoValue, string theCvar, string theText)
12 me.yesString = theYesValue;
13 me.noString = theNoValue;
15 me.controlledCvar = (theCvar) ? theCvar : string_null;
17 me.configureCheckBox(me, theText, me.fontSize, me.image);
19 void XonoticCheckBoxString_setChecked(entity me, float foo)
21 me.checked = !me.checked;
24 void XonoticCheckBoxString_loadCvars(entity me)
26 if (!me.controlledCvar)
29 if(cvar_string(me.controlledCvar) == me.yesString)
32 void XonoticCheckBoxString_saveCvars(entity me)
34 if (!me.controlledCvar)
38 cvar_set(me.controlledCvar, me.yesString);
40 cvar_set(me.controlledCvar, me.noString);
42 CheckSendCvars(me, me.controlledCvar);