Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
ui_vampire.qc
Go to the documentation of this file.
1
#include "
ui_vampire.qh
"
2
3
#include <
menu/xonotic/checkbox.qh
>
4
#include <
menu/xonotic/slider.qh
>
5
#include <
menu/xonotic/textlabel.qh
>
6
7
entity
makeXonoticMutatorVampireTab
()
8
{
9
entity
me =
NEW
(
XonoticMutatorVampireTab
);
10
me.configureDialog(me);
11
return
me;
12
}
13
14
void
XonoticMutatorVampireTab_fill
(
entity
me)
15
{
16
entity
e;
17
18
Mutators_main_checkbox
(me);
19
20
me.TR(me);
21
me.TD(me, 1, 1.5, e =
makeXonoticTextLabel
(0, _(
"Factor:"
)));
22
me.TD(me, 1, 2.5, e =
makeXonoticSlider_T
(0.05, 1, 0.05,
"g_vampire_factor"
,
23
_(
"Fraction of the damage dealt to be stolen as health"
)));
24
e.formatString = _(
"%sx"
);
25
me.TR(me);
26
me.TD(me, 1, 4, e =
makeXonoticCheckBox
(0,
"g_vampire_use_total_damage"
, _(
"Consider both health and armor"
)));
27
}
28
29
METHOD
(
XonoticMutatorVampireTab
, describe,
string
(
XonoticMutatorVampireTab
me))
30
{
31
return
_(
"All damage dealt to your enemies is added to your own health."
);
32
}
33
METHOD
(
XonoticMutatorVampireTab
,
canEnable
,
bool
(
XonoticMutatorVampireTab
me,
bool
is_already_enabled))
34
{
35
bool
can_enable = !
cvar
(
"g_instagib"
);
36
if
(is_already_enabled)
37
return
can_enable &&
cvar
(me.
message
);
38
return
can_enable;
39
}
entity
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
XonoticMutatorVampireTab
Definition
ui_vampire.qh:4
XonoticMutatorVampireTab::canEnable
virtual void canEnable()
Definition
ui_vampire.qc:33
XonoticMutatorVampireTab::message
string message
Definition
ui_vampire.qh:7
cvar
float cvar(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
makeXonoticMutatorVampireTab
entity makeXonoticMutatorVampireTab()
Definition
ui_vampire.qc:7
XonoticMutatorVampireTab_fill
void XonoticMutatorVampireTab_fill(entity me)
Definition
ui_vampire.qc:14
ui_vampire.qh
makeXonoticCheckBox
entity makeXonoticCheckBox(float isInverted, string theCvar, string theText)
Definition
checkbox.qc:28
checkbox.qh
makeXonoticSlider_T
entity makeXonoticSlider_T(float theValueMin, float theValueMax, float theValueStep, string theCvar, string theTooltip)
Definition
slider.qc:3
slider.qh
common
mutators
mutator
vampire
ui_vampire.qc
Generated on
for Xonotic QuakeC by
1.16.1