Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
checkbox_string.qc
Go to the documentation of this file.
1#include "checkbox_string.qh"
2
3entity makeXonoticCheckBoxString(string theYesValue, string theNoValue, string theCvar, string theText)
4{
5 entity me;
7 me.configureXonoticCheckBoxString(me, theYesValue, theNoValue, theCvar, theText);
8 return me;
9}
10void XonoticCheckBoxString_configureXonoticCheckBoxString(entity me, string theYesValue, string theNoValue, string theCvar, string theText)
11{
12 me.yesString = theYesValue;
13 me.noString = theNoValue;
14 me.checked = false;
15 me.controlledCvar = (theCvar) ? theCvar : string_null;
16 me.loadCvars(me);
17 me.configureCheckBox(me, theText, me.fontSize, me.image);
18}
20{
21 me.checked = !me.checked;
22 me.saveCvars(me);
23}
25{
26 if (!me.controlledCvar)
27 return;
28
29 if(cvar_string(me.controlledCvar) == me.yesString)
30 me.checked = true;
31}
33{
34 if (!me.controlledCvar)
35 return;
36
37 if(me.checked)
38 cvar_set(me.controlledCvar, me.yesString);
39 else
40 cvar_set(me.controlledCvar, me.noString);
41
42 CheckSendCvars(me, me.controlledCvar);
43}
void XonoticCheckBoxString_configureXonoticCheckBoxString(entity me, string theYesValue, string theNoValue, string theCvar, string theText)
void XonoticCheckBoxString_loadCvars(entity me)
void XonoticCheckBoxString_setChecked(entity me, bool foo)
void XonoticCheckBoxString_saveCvars(entity me)
entity makeXonoticCheckBoxString(string theYesValue, string theNoValue, string theCvar, string theText)
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
void CheckSendCvars(entity me, string cvarnamestring)
Definition util.qc:825
void cvar_set(string name, string value)
const string cvar_string(string name)
string string_null
Definition nil.qh:9
#define NEW(cname,...)
Definition oo.qh:117