Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
weaponarenacheckbox.qc
Go to the documentation of this file.
2
3entity makeXonoticWeaponarenaCheckBox(string theWeapon, string theText)
4{
6 me.configureXonoticWeaponarenaCheckBox(me, theWeapon, theText);
7 return me;
8}
10{
11 me.netname = theWeapon;
12 me.checked = false;
13 me.loadCvars(me);
14 me.configureCheckBox(me, theText, me.fontSize, me.image);
15}
17{
18 me.checked = !me.checked;
19 me.saveCvars(me);
20}
22{
23 int n = tokenize_console(cvar_string("menu_weaponarena"));
24 for (int i = 0; i < n; ++i)
25 {
26 if(argv(i) == me.netname)
27 {
28 me.checked = true;
29 break;
30 }
31 }
32}
33
35{
36 if(me.checked)
37 localcmd(strcat("\nmenu_cmd addtolist menu_weaponarena ", me.netname, "\n"));
38 else
39 localcmd(strcat("\nmenu_cmd removefromlist menu_weaponarena ", me.netname, "\n"));
40 localcmd("\ng_weaponarena \"$menu_weaponarena\"\n");
41}
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
#define tokenize_console
void localcmd(string command,...)
const string cvar_string(string name)
string argv(float n)
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))
#define NEW(cname,...)
Definition oo.qh:117
void XonoticWeaponarenaCheckBox_setChecked(entity me, bool foo)
void XonoticWeaponarenaCheckBox_configureXonoticWeaponarenaCheckBox(entity me, string theWeapon, string theText)
void XonoticWeaponarenaCheckBox_loadCvars(entity me)
entity makeXonoticWeaponarenaCheckBox(string theWeapon, string theText)
void XonoticWeaponarenaCheckBox_saveCvars(entity me)