Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
ui_buffs.qc
Go to the documentation of this file.
1#include "ui_buffs.qh"
2
3#include "buffs.qh"
4
7
9{
11 me.configureDialog(me);
12 return me;
13}
14
16{
17 entity e;
18
19 me.TR(me);
20 me.TD(me, 1, 4 * 0.25, e = makeXonoticRadioButton(1, me.message, "0", _("Disable")));
22 me.TD(me, 1, 4 * 0.5, e = makeXonoticRadioButton(1, me.message, "-1", _("Enable only if placed by mapper")));
24 me.TD(me, 1, 4 * 0.25, e = makeXonoticRadioButton(1, me.message, "1", _("Enable")));
26
27 me.TR(me);
28 me.TD(me, 1, 4, e = makeXonoticTextLabel(0, _("Allow maps to spawn:")));
29 int cols = 3;
30 int c = 0;
31 FOREACH(StatusEffects, it.instanceOfBuff,
32 {
33 if (c % cols == 0)
34 {
35 me.TR(me);
36 me.TDempty(me, 0.2);
37 }
38 ++c;
39 me.TD(me, 1, (4 - 0.2) / cols, e = makeXonoticCheckBox(0, strzone(strcat("g_buffs_", it.netname)), strzone(it.m_name)));
40 });
41 me.TR(me);
42 me.TDempty(me, 0.2);
43 me.TD(me, 1, 4 - 0.2, e = makeXonoticCheckBox(0, "g_buffs_replace_available", _("Replace unavailable buffs with others")));
44
45 me.TR(me);
46 me.TR(me);
47 me.TD(me, 1, 4, e = makeXonoticCheckBox(0, "g_buffs_drop", _("Allow dropping")));
48 me.TR(me);
49 me.TR(me);
50 me.TD(me, 1, 4, e = makeXonoticCheckBox(0, "g_buffs_replace_powerups", _("Replace powerups with buffs")));
51 setDependent(e, me.message, 1, 1);
52}
53
56
58{
59 return sprintf(_("Enable buff pickups (random bonuses like %s and %s) on the maps that support them."), COLORED_NAME(BUFF_MEDIC), COLORED_NAME(BUFF_RESISTANCE));
60}
62{
63 bool can_enable = true;
64 if (is_already_enabled)
65 return can_enable && cvar(me.message);
66 return can_enable;
67}
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
virtual void canEnable()
Definition ui_buffs.qc:61
#define COLORED_NAME(this)
Definition color.qh:189
#define FOREACH(list, cond, body)
Definition iter.qh:19
void setDependent(entity e, string theCvarName, float theCvarMin, float theCvarMax)
Definition util.qc:180
float cvar(string name)
string strzone(string s)
void Mutators_add_RadioButton(entity me, entity e)
Definition mutatortab.qc:41
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))
#define NEW(cname,...)
Definition oo.qh:120
#define METHOD(cname, name, prototype)
Definition oo.qh:274
entity makeXonoticTextLabel(float theAlign, string theText)
Definition textlabel.qc:3
void XonoticMutatorBuffsTab_fill(entity me)
Definition ui_buffs.qc:15
entity makeXonoticMutatorBuffsTab()
Definition ui_buffs.qc:8
entity makeXonoticCheckBox(float isInverted, string theCvar, string theText)
Definition checkbox.qc:28
entity makeXonoticRadioButton(float theGroup, string theCvar, string theValue, string theText)
Definition radiobutton.qc:9