Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
ui_nix.qc
Go to the documentation of this file.
1
#include "
ui_nix.qh
"
2
3
#include <
menu/xonotic/checkbox.qh
>
4
#include <
menu/xonotic/textlabel.qh
>
5
6
entity
makeXonoticMutatorNIXTab
()
7
{
8
entity
me =
NEW
(
XonoticMutatorNIXTab
);
9
me.configureDialog(me);
10
return
me;
11
}
12
13
void
MutatorNIX_CheckBox_saveCvars
(
entity
me)
14
{
15
XonoticCheckBox_saveCvars
(me);
16
if
(
cvar
(
"g_nix"
))
17
{
18
if
(
cvar_string
(
"g_weaponarena"
) !=
"0"
)
19
cvar_set
(
"g_weaponarena"
,
"0"
);
// weaponarena can't be enabled if NIX is, or at least we pretend it can't
20
if
(
cvar
(
"g_melee_only"
))
21
cvar_set
(
"g_melee_only"
,
"0"
);
22
}
23
}
24
25
void
XonoticMutatorNIXTab_fill
(
entity
me)
26
{
27
entity
e =
Mutators_main_checkbox
(me);
28
e.saveCvars =
MutatorNIX_CheckBox_saveCvars
;
29
30
me.TR(me);
31
me.TD(me, 1, 4, e =
makeXonoticCheckBox_T
(0,
"g_nix_with_blaster"
, _(
"With Blaster"
),
32
_(
"Always carry the Blaster as an additional weapon in NIX"
)));
33
me.TR(me);
34
me.TD(me, 1, 4, e =
makeXonoticTextLabel
(0, _(
"Allow maps to spawn:"
)));
35
me.TR(me);
36
me.TDempty(me, 0.2);
37
me.TD(me, 1, (4 - 0.2) * 0.6, e =
makeXonoticCheckBox
(0,
"g_nix_with_healtharmor"
, _(
"Health and armor"
)));
38
me.TD(me, 1, (4 - 0.2) * 0.4, e =
makeXonoticCheckBox
(0,
"g_nix_with_powerups"
, _(
"Powerups"
)));
39
}
40
41
METHOD
(
XonoticMutatorNIXTab
, describe,
string
(
XonoticMutatorNIXTab
me))
42
{
43
return
MENU_NIX_DESCRIPTION
;
44
}
45
METHOD
(
XonoticMutatorNIXTab
,
canEnable
,
bool
(
XonoticMutatorNIXTab
me,
bool
is_already_enabled))
46
{
47
bool
can_enable = (!
cvar
(
"g_instagib"
) && !
cvar
(
"g_overkill"
) && !
cvar
(
"g_melee_only"
));
48
if
(is_already_enabled)
49
return
can_enable &&
cvar
(me.
message
);
50
return
can_enable;
51
}
entity
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
XonoticMutatorNIXTab
Definition
ui_nix.qh:7
XonoticMutatorNIXTab::canEnable
virtual void canEnable()
Definition
ui_nix.qc:45
XonoticMutatorNIXTab::message
string message
Definition
ui_nix.qh:10
cvar_set
void cvar_set(string name, string value)
cvar
float cvar(string name)
cvar_string
const string cvar_string(string name)
Mutators_main_checkbox
entity Mutators_main_checkbox(entity me)
Definition
mutatortab.qc:25
NEW
#define NEW(cname,...)
Definition
oo.qh:120
METHOD
#define METHOD(cname, name, prototype)
Definition
oo.qh:274
makeXonoticTextLabel
entity makeXonoticTextLabel(float theAlign, string theText)
Definition
textlabel.qc:3
textlabel.qh
MutatorNIX_CheckBox_saveCvars
void MutatorNIX_CheckBox_saveCvars(entity me)
Definition
ui_nix.qc:13
XonoticMutatorNIXTab_fill
void XonoticMutatorNIXTab_fill(entity me)
Definition
ui_nix.qc:25
makeXonoticMutatorNIXTab
entity makeXonoticMutatorNIXTab()
Definition
ui_nix.qc:6
ui_nix.qh
MENU_NIX_DESCRIPTION
const string MENU_NIX_DESCRIPTION
Definition
ui_nix.qh:4
makeXonoticCheckBox_T
entity makeXonoticCheckBox_T(float isInverted, string theCvar, string theText, string theTooltip)
Definition
checkbox.qc:3
makeXonoticCheckBox
entity makeXonoticCheckBox(float isInverted, string theCvar, string theText)
Definition
checkbox.qc:28
XonoticCheckBox_saveCvars
void XonoticCheckBox_saveCvars(entity me)
Definition
checkbox.qc:73
checkbox.qh
common
mutators
mutator
nix
ui_nix.qc
Generated on
for Xonotic QuakeC by
1.16.1