Xonotic
checkbox_string.qc File Reference
#include "checkbox_string.qh"
+ Include dependency graph for checkbox_string.qc:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

entity makeXonoticCheckBoxString (string theYesValue, string theNoValue, string theCvar, string theText)
 
void XonoticCheckBoxString_configureXonoticCheckBoxString (entity me, string theYesValue, string theNoValue, string theCvar, string theText)
 
void XonoticCheckBoxString_loadCvars (entity me)
 
void XonoticCheckBoxString_saveCvars (entity me)
 
void XonoticCheckBoxString_setChecked (entity me, float foo)
 

Function Documentation

◆ makeXonoticCheckBoxString()

entity makeXonoticCheckBoxString ( string  theYesValue,
string  theNoValue,
string  theCvar,
string  theText 
)

Definition at line 3 of file checkbox_string.qc.

References entity(), and NEW.

Referenced by GameType_GetIcon().

4 {
5  entity me;
7  me.configureXonoticCheckBoxString(me, theYesValue, theNoValue, theCvar, theText);
8  return me;
9 }
#define NEW(cname,...)
Definition: oo.qh:105
entity() spawn
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ XonoticCheckBoxString_configureXonoticCheckBoxString()

void XonoticCheckBoxString_configureXonoticCheckBoxString ( entity  me,
string  theYesValue,
string  theNoValue,
string  theCvar,
string  theText 
)

Definition at line 10 of file checkbox_string.qc.

References string_null.

11 {
12  me.yesString = theYesValue;
13  me.noString = theNoValue;
14  me.checked = 0;
15  me.controlledCvar = (theCvar) ? theCvar : string_null;
16  me.loadCvars(me);
17  me.configureCheckBox(me, theText, me.fontSize, me.image);
18 }
string string_null
Definition: nil.qh:9

◆ XonoticCheckBoxString_loadCvars()

void XonoticCheckBoxString_loadCvars ( entity  me)

Definition at line 24 of file checkbox_string.qc.

References cvar_string().

25 {
26  if (!me.controlledCvar)
27  return;
28 
29  if(cvar_string(me.controlledCvar) == me.yesString)
30  me.checked = 1;
31 }
+ Here is the call graph for this function:

◆ XonoticCheckBoxString_saveCvars()

void XonoticCheckBoxString_saveCvars ( entity  me)

Definition at line 32 of file checkbox_string.qc.

References CheckSendCvars(), and cvar_set().

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 }
+ Here is the call graph for this function:

◆ XonoticCheckBoxString_setChecked()

void XonoticCheckBoxString_setChecked ( entity  me,
float  foo 
)

Definition at line 19 of file checkbox_string.qc.

20 {
21  me.checked = !me.checked;
22  me.saveCvars(me);
23 }