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

Go to the source code of this file.

Functions

entity makeXonoticMutatorNadesTab ()
void XonoticMutatorNadesTab_fill (entity me)

Function Documentation

◆ makeXonoticMutatorNadesTab()

entity makeXonoticMutatorNadesTab ( )

Definition at line 10 of file ui_nades.qc.

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

References entity(), and NEW.

◆ XonoticMutatorNadesTab_fill()

void XonoticMutatorNadesTab_fill ( entity me)

Definition at line 17 of file ui_nades.qc.

18{
19 entity e;
20
22
23 me.TR(me);
24 me.TD(me, 1, 2, e = makeXonoticCheckBox_T(0, "g_nades_bonus", _("Enable bonus nades"),
25 _("Gives players a bonus grenade when they reach a certain score or have Strength")));
26 me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Max bonus nades:")));
27 setDependentNOT(e, "g_nades_bonus", 0);
28 me.TD(me, 1, 0.8, e = makeXonoticSlider(1, 10, 1, "g_nades_bonus_max"));
29 e.setValueSpace(e, e.valueSpace * 1.2);
30 setDependentNOT(e, "g_nades_bonus", 0);
31 me.TR(me);
32 me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "g_nades_client_select", _("Allow client selection")));
33 me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "g_nades_bonus_client_select", _("For bonus nades")));
34 setDependentNOT(e, "g_nades_bonus", 0);
35 me.TR(me);
36 me.TD(me, 1, 2, e = makeXonoticTextLabel(0, _("Refire time:")));
37 me.TD(me, 1, 2, e = makeXonoticSlider(1, 20, 1, "g_nades_nade_refire"));
38 e.formatString = "s";
39 e.setValueSpace(e, e.valueSpace * 1.2);
40
41 me.TR(me);
42 me.TD(me, 1, 4, e = makeXonoticTextLabel(0, _("Nade types:")));
43 me.TR(me);
44 me.TDempty(me, 4 / 2 - 0.2 * 3);
45 me.TD(me, 1, 0.2, e = makeXonoticTextLabel(0, "1"));
46 e.marginLeft = 0.4; // improve text alignment with icons
47 setDependent(e, "g_nades_client_select", 0, 0);
48 me.TD(me, 1, 0.2, e = makeXonoticTextLabel(0, "2"));
49 e.marginLeft = 0.4;
50 setDependentNOT(e, "g_nades_bonus", 0);
51 setDependentAND(e, "g_nades_bonus_client_select", 0, 0);
52 me.TD(me, 1, 0.2, e = makeXonoticTextLabel(0, "3"));
53 e.marginLeft = 0.4;
54 setDependent(e, "g_nades_client_select", 1, 1);
55 setDependentOR(e, "g_nades_bonus_client_select", 1, 1);
56 me.TDempty(me, 4 / 2 - 0.2 * 3);
57 me.TD(me, 1, 0.2, e = makeXonoticTextLabel(0, "1"));
58 e.marginLeft = 0.4;
59 setDependent(e, "g_nades_client_select", 0, 0);
60 me.TD(me, 1, 0.2, e = makeXonoticTextLabel(0, "2"));
61 e.marginLeft = 0.4;
62 setDependentNOT(e, "g_nades_bonus", 0);
63 setDependentAND(e, "g_nades_bonus_client_select", 0, 0);
64 me.TD(me, 1, 0.2, e = makeXonoticTextLabel(0, "3"));
65 e.marginLeft = 0.4;
66 setDependent(e, "g_nades_client_select", 1, 1);
67 setDependentOR(e, "g_nades_bonus_client_select", 1, 1);
68 int c = 0;
69 string name;
70 FOREACH(Nades, it != NADE_TYPE_Null,
71 {
72 if (c % 2 == 0)
73 me.TR(me);
74 ++c;
75 me.TD(me, 1, 4 / 2 - 0.2 * 3, e = makeXonoticTextLabel(0, strzone(it.m_name)));
76 e.align = 1;
77 e.marginRight = 0.5;
78 name = strzone(it.netname);
79 // XONRELEASE TODO v0.9.0 post-release: remove ID-selection from cl_nade_type in favor of netname-selection, and update the description
80 me.TD(me, 1, 0.2, e = makeXonoticRadioButton(1, "g_nades_nade_type", name, ""));
81 setDependent(e, "g_nades_client_select", 0, 0);
82 me.TD(me, 1, 0.2, e = makeXonoticRadioButton(2, "g_nades_bonus_type", name, ""));
83 setDependentNOT(e, "g_nades_bonus", 0);
84 setDependentAND(e, "g_nades_bonus_client_select", 0, 0);
85 if (it == NADE_TYPE_NORMAL)
86 me.TDempty(me, 0.2);
87 else
88 {
89 me.TD(me, 1, 0.2, e = makeXonoticCheckBox(0, strzone(strcat("g_nades_", it.netname)), ""));
90 setDependent(e, "g_nades_client_select", 1, 1);
91 setDependentOR(e, "g_nades_bonus_client_select", 1, 1);
92 }
93 });
94 if (c % 2 == 0)
95 me.TR(me);
96 me.TD(me, 1, 4 / 2 - 0.2 * 3, e = makeXonoticTextLabel(0, _("Random"))); // put random nade at end of list
97 e.align = 1;
98 e.marginRight = 0.5;
99 me.TD(me, 1, 0.2, e = makeXonoticRadioButton(1, "g_nades_nade_type", "0", ""));
100 setDependent(e, "g_nades_client_select", 0, 0);
101 me.TD(me, 1, 0.2, e = makeXonoticRadioButton(2, "g_nades_bonus_type", "0", ""));
102 setDependentNOT(e, "g_nades_bonus", 0);
103 setDependentAND(e, "g_nades_bonus_client_select", 0, 0);
104
105 me.TR(me);
106 me.TDempty(me, 0.2);
107 me.TD(me, 1, 4 - 0.2, e = makeXonoticTextLabel(0, strzone(strcat("1. ", _("Normal nade type, if client selection is disabled")))));
108 setDependent(e, "g_nades_client_select", 0, 0);
109 me.TR(me);
110 me.TDempty(me, 0.2);
111 me.TD(me, 1, 4 - 0.2, e = makeXonoticTextLabel(0, strzone(strcat("2. ", _("Bonus nade type, if client selection is disabled")))));
112 setDependentNOT(e, "g_nades_bonus", 0);
113 setDependentAND(e, "g_nades_bonus_client_select", 0, 0);
114 me.TR(me);
115 me.TDempty(me, 0.2);
116 me.TD(me, 1, 4 - 0.2, e = makeXonoticTextLabel(0, strzone(strcat("3. ", _("Allow client selection")))));
117 setDependent(e, "g_nades_client_select", 1, 1);
118 setDependentOR(e, "g_nades_bonus_client_select", 1, 1);
119}
#define FOREACH(list, cond, body)
Definition iter.qh:19
void setDependentAND(entity e, string theCvarName, float theCvarMin, float theCvarMax)
Definition util.qc:213
void setDependentOR(entity e, string theCvarName, float theCvarMin, float theCvarMax)
Definition util.qc:231
void setDependentNOT(entity e, string theCvarName, float theCvarValue)
Definition util.qc:192
void setDependent(entity e, string theCvarName, float theCvarMin, float theCvarMax)
Definition util.qc:180
string name
Definition menu.qh:30
string strzone(string s)
entity Mutators_main_checkbox(entity me)
Definition mutatortab.qc:25
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))
entity makeXonoticTextLabel(float theAlign, string theText)
Definition textlabel.qc:3
entity makeXonoticCheckBox_T(float isInverted, string theCvar, string theText, string theTooltip)
Definition checkbox.qc:3
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
entity makeXonoticSlider(float theValueMin, float theValueMax, float theValueStep, string theCvar)
Definition slider.qc:9

References entity(), FOREACH, makeXonoticCheckBox(), makeXonoticCheckBox_T(), makeXonoticRadioButton(), makeXonoticSlider(), makeXonoticTextLabel(), Mutators_main_checkbox(), name, setDependent(), setDependentAND(), setDependentNOT(), setDependentOR(), strcat(), and strzone().