Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
ui_instagib.qc
Go to the documentation of this file.
1
#include "
ui_instagib.qh
"
2
3
#include <
menu/xonotic/checkbox.qh
>
4
#include <
menu/xonotic/slider.qh
>
5
#include <
menu/xonotic/textlabel.qh
>
6
7
entity
makeXonoticMutatorInstaGibTab
()
8
{
9
entity
me =
NEW
(
XonoticMutatorInstaGibTab
);
10
me.configureDialog(me);
11
return
me;
12
}
13
14
void
MutatorInstaGib_CheckBox_saveCvars
(
entity
me)
15
{
16
XonoticCheckBox_saveCvars
(me);
17
if
(
cvar
(
"g_instagib"
))
18
{
19
if
(
cvar_string
(
"g_weaponarena"
) !=
"0"
)
20
cvar_set
(
"g_weaponarena"
,
"0"
);
// weaponarena can't be enabled if InstaGib is
21
if
(
cvar
(
"g_melee_only"
))
22
cvar_set
(
"g_melee_only"
,
"0"
);
23
if
(
cvar
(
"g_overkill"
))
24
cvar_set
(
"g_overkill"
,
"0"
);
25
if
(
cvar
(
"g_nix"
))
26
cvar_set
(
"g_nix"
,
"0"
);
27
}
28
}
29
30
void
XonoticMutatorInstaGibTab_fill
(
entity
me)
31
{
32
entity
e =
Mutators_main_checkbox
(me);
33
e.saveCvars =
MutatorInstaGib_CheckBox_saveCvars
;
34
35
me.TR(me);
36
me.TD(me, 1, 2, e =
makeXonoticTextLabel
(0, _(
"Starting ammo:"
)));
37
me.TD(me, 1, 2, e =
makeXonoticSlider
(1, 30, 1,
"g_instagib_ammo_start"
));
38
me.TR(me);
39
me.TD(me, 1, 2, e =
makeXonoticTextLabel
(0, _(
"Ammo from weapons and cells:"
)));
40
me.TD(me, 1, 2, e =
makeXonoticSlider
(0, 20, 1,
"g_instagib_ammo_drop"
));
41
42
me.TR(me);
43
me.TR(me);
44
me.TD(me, 1, 2, e =
makeXonoticTextLabel
(0, _(
"Extra lives per pickup:"
)));
45
setDependentNOT
(e,
"g_powerups"
, 0);
46
me.TD(me, 1, 2, e =
makeXonoticSlider_T
(1, 3, 1,
"g_instagib_extralives"
,
47
_(
"How many extra lives to reward a player when they pick up the Extra life"
)));
48
setDependentNOT
(e,
"g_powerups"
, 0);
49
50
me.TR(me);
51
me.TR(me);
52
me.TD(me, 1, 4, e =
makeXonoticCheckBox
(0,
"g_instagib_blaster_keepdamage"
, _(
"Keep Blaster damage"
)));
53
setDependent
(e,
"g_rm"
, 0, 0);
54
me.TR(me);
55
me.TD(me, 1, 4, e =
makeXonoticCheckBox
(0,
"g_instagib_blaster_keepforce"
, _(
"Keep Blaster force"
)));
56
setDependent
(e,
"g_rm"
, 0, 0);
57
58
me.TR(me);
59
me.TR(me);
60
me.TD(me, 1, 4, e =
makeXonoticCheckBox
(0,
"g_instagib_allow_jetpacks"
, _(
"Allow Jetpacks and Fuel regenerators"
)));
61
setDependentNOT
(e,
"g_powerups"
, 0);
62
63
me.TR(me);
64
me.TR(me);
65
me.TD(me, 1, 4, e =
makeXonoticCheckBox_T
(0,
"g_rm"
, _(
"Enable Rocketminsta"
),
66
_(
"The primary fire also explodes on impact, and the secondary fire shoots laser prongs"
)));
67
}
68
69
#include <
common/weapons/weapon/vaporizer.qh
>
70
71
METHOD
(
XonoticMutatorInstaGibTab
, describe,
string
(
XonoticMutatorInstaGibTab
me))
72
{
73
return
sprintf(
MENU_INSTAGIB_DESCRIPTION
,
COLORED_NAME
(WEP_VAPORIZER));
74
}
75
METHOD
(
XonoticMutatorInstaGibTab
,
canEnable
,
bool
(
XonoticMutatorInstaGibTab
me,
bool
is_already_enabled))
76
{
77
bool
can_enable =
true
;
78
if
(is_already_enabled)
79
return
can_enable &&
cvar
(me.
message
);
80
return
can_enable;
81
}
entity
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
XonoticMutatorInstaGibTab
Definition
ui_instagib.qh:7
XonoticMutatorInstaGibTab::message
string message
Definition
ui_instagib.qh:10
XonoticMutatorInstaGibTab::canEnable
virtual void canEnable()
Definition
ui_instagib.qc:75
COLORED_NAME
#define COLORED_NAME(this)
Definition
color.qh:189
setDependentNOT
void setDependentNOT(entity e, string theCvarName, float theCvarValue)
Definition
util.qc:192
setDependent
void setDependent(entity e, string theCvarName, float theCvarMin, float theCvarMax)
Definition
util.qc:180
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
makeXonoticMutatorInstaGibTab
entity makeXonoticMutatorInstaGibTab()
Definition
ui_instagib.qc:7
MutatorInstaGib_CheckBox_saveCvars
void MutatorInstaGib_CheckBox_saveCvars(entity me)
Definition
ui_instagib.qc:14
XonoticMutatorInstaGibTab_fill
void XonoticMutatorInstaGibTab_fill(entity me)
Definition
ui_instagib.qc:30
ui_instagib.qh
MENU_INSTAGIB_DESCRIPTION
const string MENU_INSTAGIB_DESCRIPTION
Definition
ui_instagib.qh:4
vaporizer.qh
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
makeXonoticSlider_T
entity makeXonoticSlider_T(float theValueMin, float theValueMax, float theValueStep, string theCvar, string theTooltip)
Definition
slider.qc:3
makeXonoticSlider
entity makeXonoticSlider(float theValueMin, float theValueMax, float theValueStep, string theCvar)
Definition
slider.qc:9
slider.qh
common
mutators
mutator
instagib
ui_instagib.qc
Generated on
for Xonotic QuakeC by
1.16.1