Xonotic
weaponarenacheckbox.qc
Go to the documentation of this file.
1 #include "weaponarenacheckbox.qh"
2 
3 entity makeXonoticWeaponarenaCheckBox(string theWeapon, string theText)
4 {
5  entity me;
7  me.configureXonoticWeaponarenaCheckBox(me, theWeapon, theText);
8  return me;
9 }
11 {
12  me.netname = theWeapon;
13  me.checked = false;
14  me.loadCvars(me);
15  me.configureCheckBox(me, theText, me.fontSize, me.image);
16 }
18 {
19  me.checked = !me.checked;
20  me.saveCvars(me);
21 }
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 }
34 
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 }
void XonoticWeaponarenaCheckBox_loadCvars(entity me)
#define NEW(cname,...)
Definition: oo.qh:105
entity makeXonoticWeaponarenaCheckBox(string theWeapon, string theText)
entity() spawn
void XonoticWeaponarenaCheckBox_saveCvars(entity me)
void XonoticWeaponarenaCheckBox_configureXonoticWeaponarenaCheckBox(entity me, string theWeapon, string theText)
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"))
void XonoticWeaponarenaCheckBox_setChecked(entity me, float foo)
#define tokenize_console
Definition: dpextensions.qh:24