Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
ui_powerups.qc File Reference
Include dependency graph for ui_powerups.qc:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

entity makeXonoticMutatorPowerupsTab ()
void MutatorPowerupsReplace_CheckBox_saveCvars (entity me)
void XonoticMutatorPowerupsTab_fill (entity me)

Function Documentation

◆ makeXonoticMutatorPowerupsTab()

entity makeXonoticMutatorPowerupsTab ( )

Definition at line 9 of file ui_powerups.qc.

10{
12 me.configureDialog(me);
13 return me;
14}
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
#define NEW(cname,...)
Definition oo.qh:120

References entity(), and NEW.

◆ MutatorPowerupsReplace_CheckBox_saveCvars()

void MutatorPowerupsReplace_CheckBox_saveCvars ( entity me)

Definition at line 16 of file ui_powerups.qc.

17{
19 entity e;
20 for (int i = 0; i < me.parent.toggleableItemsCount; ++i) // reload cvars for the RadioButtons
21 {
22 e = me.parent.(toggleableItems[i]);
23 e.loadCvars(e);
24 }
25}
void XonoticCheckBox_saveCvars(entity me)
Definition checkbox.qc:73

References entity(), and XonoticCheckBox_saveCvars().

◆ XonoticMutatorPowerupsTab_fill()

void XonoticMutatorPowerupsTab_fill ( entity me)

Definition at line 27 of file ui_powerups.qc.

28{
29 entity e;
30
31 me.TR(me);
32 me.TD(me, 1, 4 * 0.3, e = makeXonoticRadioButton(1, me.message, "0", _("Disable")));
34 me.TD(me, 1, 4 * 0.4, e = makeXonoticRadioButton(1, me.message, "-1", _("Dependent on gametype")));
36 me.TD(me, 1, 4 * 0.3, e = makeXonoticRadioButton(1, me.message, "1", _("Always enable")));
38
39 me.TR(me);
40 me.TD(me, 1, 4, e = makeXonoticTextLabel(0, _("Allow maps to spawn:")));
41 string name;
42 int cols = 3;
43 int c = 0;
44 FOREACH(Items, it.instanceOfPowerup && it.netname != "extralife",
45 {
46 if (c % cols == 0)
47 {
48 me.TR(me);
49 me.TDempty(me, 0.2);
50 }
51 ++c;
52 switch (it.netname) // TODO: rename the cvars, or change the .netname
53 {
54 case "fuel_regen":
55 name = "fuelregen";
56 break;
57 case "invincible":
58 name = "shield";
59 break;
60 default:
61 name = it.netname;
62 break;
63 }
64 me.TD(me, 1, (4 - 0.2) / cols, e = makeXonoticCheckBox(0, strzone(strcat("g_powerups_", name)), strzone(it.m_name)));
65 });
66
67 me.TR(me);
68 me.TR(me);
69 me.TD(me, 1, 4, e = makeXonoticTextLabel(0, _("Drop on death")));
70 me.TR(me);
71 me.TDempty(me, 0.2);
72 me.TD(me, 1, (4 - 0.2) / 3, e = makeXonoticRadioButton(2, "g_powerups_drop_ondeath", "0", _("Disabled")));
73 me.TD(me, 1, (4 - 0.2) / 3, e = makeXonoticRadioButton(2, "g_powerups_drop_ondeath", "1", _("Timer continues")));
74 me.TD(me, 1, (4 - 0.2) / 3, e = makeXonoticRadioButton(2, "g_powerups_drop_ondeath", "2", _("Timer pauses")));
75 me.TR(me);
76 me.TD(me, 1, 4, e = makeXonoticTextLabel(0, _("Allow dropping")));
77 me.TR(me);
78 me.TDempty(me, 0.2);
79 me.TD(me, 1, (4 - 0.2) / 3, e = makeXonoticRadioButton(3, "g_powerups_drop", "0", _("Disabled")));
80 me.TD(me, 1, (4 - 0.2) / 3, e = makeXonoticRadioButton(3, "g_powerups_drop", "1", _("Timer continues")));
81 me.TD(me, 1, (4 - 0.2) / 3, e = makeXonoticRadioButton(3, "g_powerups_drop", "2", _("Timer pauses")));
82
83 me.TR(me);
84 me.TR(me);
85 me.TD(me, 1, 4, e = makeXonoticCheckBox(0, "g_buffs_replace_powerups", _("Replace powerups with buffs")));
87 setDependent(e, "g_buffs", 1, 1);
88}
#define FOREACH(list, cond, body)
Definition iter.qh:19
void setDependent(entity e, string theCvarName, float theCvarMin, float theCvarMax)
Definition util.qc:180
string name
Definition menu.qh:30
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."))
entity makeXonoticTextLabel(float theAlign, string theText)
Definition textlabel.qc:3
void MutatorPowerupsReplace_CheckBox_saveCvars(entity me)
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

References entity(), FOREACH, makeXonoticCheckBox(), makeXonoticRadioButton(), makeXonoticTextLabel(), Mutators_add_RadioButton(), name, strcat(), and strzone().