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

Go to the source code of this file.

Functions

entity makeXonoticWeaponarenaCheckBox (string theWeapon, string theText)
 
void XonoticWeaponarenaCheckBox_configureXonoticWeaponarenaCheckBox (entity me, string theWeapon, string theText)
 
void XonoticWeaponarenaCheckBox_loadCvars (entity me)
 
void XonoticWeaponarenaCheckBox_saveCvars (entity me)
 
void XonoticWeaponarenaCheckBox_setChecked (entity me, float foo)
 

Function Documentation

◆ makeXonoticWeaponarenaCheckBox()

entity makeXonoticWeaponarenaCheckBox ( string  theWeapon,
string  theText 
)

Definition at line 3 of file weaponarenacheckbox.qc.

References entity(), and NEW.

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

◆ XonoticWeaponarenaCheckBox_configureXonoticWeaponarenaCheckBox()

void XonoticWeaponarenaCheckBox_configureXonoticWeaponarenaCheckBox ( entity  me,
string  theWeapon,
string  theText 
)

Definition at line 10 of file weaponarenacheckbox.qc.

11 {
12  me.netname = theWeapon;
13  me.checked = false;
14  me.loadCvars(me);
15  me.configureCheckBox(me, theText, me.fontSize, me.image);
16 }

◆ XonoticWeaponarenaCheckBox_loadCvars()

void XonoticWeaponarenaCheckBox_loadCvars ( entity  me)

Definition at line 22 of file weaponarenacheckbox.qc.

References argv(), cvar_string(), and tokenize_console.

23 {
24  int n = tokenize_console(cvar_string("menu_weaponarena"));
25  for (int i = 0; i < n; i++)
26  {
27  if(argv(i) == me.netname)
28  {
29  me.checked = true;
30  break;
31  }
32  }
33 }
#define tokenize_console
Definition: dpextensions.qh:24
+ Here is the call graph for this function:

◆ XonoticWeaponarenaCheckBox_saveCvars()

void XonoticWeaponarenaCheckBox_saveCvars ( entity  me)

Definition at line 35 of file weaponarenacheckbox.qc.

References localcmd, and strcat().

36 {
37  if(me.checked)
38  localcmd(strcat("\nmenu_cmd addtolist menu_weaponarena ", me.netname, "\n"));
39  else
40  localcmd(strcat("\nmenu_cmd removefromlist menu_weaponarena ", me.netname, "\n"));
41  localcmd("\ng_weaponarena \"$menu_weaponarena\"\n");
42 }
spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 f1 s1 strcat(_("Level %s: "), "^BG%s\3\, _("^BGPress ^F2%s^BG to enter the game"))
+ Here is the call graph for this function:

◆ XonoticWeaponarenaCheckBox_setChecked()

void XonoticWeaponarenaCheckBox_setChecked ( entity  me,
float  foo 
)

Definition at line 17 of file weaponarenacheckbox.qc.

18 {
19  me.checked = !me.checked;
20  me.saveCvars(me);
21 }