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{
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}
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)