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{
6 me.configureXonoticCheckBoxString(me, theYesValue, theNoValue, theCvar, theText);
7 return me;
8}
9void XonoticCheckBoxString_configureXonoticCheckBoxString(entity me, string theYesValue, string theNoValue, string theCvar, string theText)
10{
11 me.yesString = theYesValue;
12 me.noString = theNoValue;
13 me.checked = false;
14 me.controlledCvar = (theCvar) ? theCvar : string_null;
15 me.loadCvars(me);
16 me.configureCheckBox(me, theText, me.fontSize, me.image);
17}
19{
20 me.checked = !me.checked;
21 me.saveCvars(me);
22}
24{
25 if (!me.controlledCvar)
26 return;
27
28 if(cvar_string(me.controlledCvar) == me.yesString)
29 me.checked = true;
30}
32{
33 if (!me.controlledCvar)
34 return;
35
36 if(me.checked)
37 cvar_set(me.controlledCvar, me.yesString);
38 else
39 cvar_set(me.controlledCvar, me.noString);
40
41 CheckSendCvars(me, me.controlledCvar);
42}
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