Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
dialog_settings_game_hud.qc
Go to the documentation of this file.
2
4#include "mainwindow.qh"
5#include "textlabel.qh"
6#include "slider.qh"
8#include "mixedslider.qh"
9#include "checkbox.qh"
10#include "button.qh"
11
13{
14 if(!(gamestatus & (GAME_CONNECTED | GAME_ISSERVER))) // we're not in a match, ask the player if they want to start one anyway
15 {
16 DialogOpenButton_Click(me, main.hudconfirmDialog);
17 }
18 else // already in a match, lets just cut to the point and open up the hud editor directly
19 {
20 HUDSetup_Start(me, btn);
21 }
22}
28{
29 entity me;
31 me.configureDialog(me);
32 return me;
33}
34
36{
37 entity e;
38
39 // todo:
40 // threshold: hud_damage_pain_threshold_lower_health
41 // scoreboard_alpha*
42
43 me.TR(me);
44 me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Scoreboard")));
45 me.TR(me);
46 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Opacity:")));
47 me.TD(me, 1, 2, e = makeXonoticSlider(0.1, 1, 0.1, "hud_panel_scoreboard_bg_alpha"));
48 e.formatString = "%";
49 me.TR(me);
50 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Fading speed:")));
51 me.TD(me, 1, 2, e = makeXonoticScoreboardFadeTimeSlider());
52 me.TR(me);
53 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_scoreboard_table_highlight", _("Enable rows / columns highlighting")));
54 me.TR(me);
55 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_scoreboard_accuracy", _("Show accuracy underneath scoreboard")));
56 me.TR(me);
57 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Show team sizes:")));
58 me.TD(me, 1, 2, e = makeXonoticMixedSlider_T("hud_panel_scoreboard_team_size_position", _("Team size position: Off=do not show; Left=on the left side of the scoreboard and move team scores to the right; Right=on the right of the scoreboard")));
59 e.addText(e, _("Left"), 1);
60 e.addText(e, _("Off"), 0);
61 e.addText(e, _("Right"), 2);
62 e.configureXonoticMixedSliderValues(e);
63
64 me.TR(me);
65 me.TR(me);
66 me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Waypoints")));
67 me.TR(me);
68 me.TD(me, 1, 3, e = makeXonoticCheckBox_T(1, "cl_hidewaypoints", _("Display waypoint markers for objectives on the map"),
69 _("Show various gametype specific waypoints")));
70 me.TR(me);
71 me.TDempty(me, 0.2);
72 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Opacity:")));
73 setDependent(e, "cl_hidewaypoints", 0, 0);
74 me.TD(me, 1, 2, e = makeXonoticSlider_T(0.1, 1, 0.1, "g_waypointsprite_alpha", "-"));
75 e.formatString = "%";
76 setDependent(e, "cl_hidewaypoints", 0, 0);
77 me.TR(me);
78 me.TDempty(me, 0.2);
79 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Font size:")));
80 setDependentNOT(e, "g_waypointsprite_alpha", 0);
81 setDependentAND(e, "cl_hidewaypoints", 0, 0);
82 me.TD(me, 1, 2, e = makeXonoticSlider(5, 16, 1, "g_waypointsprite_fontsize"));
83 setDependentNOT(e, "g_waypointsprite_alpha", 0);
84 setDependentAND(e, "cl_hidewaypoints", 0, 0);
85 me.TR(me);
86 me.TDempty(me, 0.2);
87 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Edge offset:")));
88 setDependentNOT(e, "g_waypointsprite_alpha", 0);
89 setDependentAND(e, "cl_hidewaypoints", 0, 0);
90 me.TD(me, 1, 2, e = makeXonoticSlider_T(0, 0.3, 0.01, "g_waypointsprite_edgeoffset_bottom", "-"));
91 makeMulti(e, "g_waypointsprite_edgeoffset_top g_waypointsprite_edgeoffset_left g_waypointsprite_edgeoffset_right");
92 setDependentNOT(e, "g_waypointsprite_alpha", 0);
93 setDependentAND(e, "cl_hidewaypoints", 0, 0);
94
95 me.TR(me);
96 me.TDempty(me, 0.2);
97 me.TD(me, 1, 2.8, e = makeXonoticCheckBoxEx(0.25, 1, "g_waypointsprite_crosshairfadealpha", _("Fade when near the crosshair")));
98 setDependentNOT(e, "g_waypointsprite_alpha", 0);
99 setDependentAND(e, "cl_hidewaypoints", 0, 0);
100 me.TR(me);
101 me.TDempty(me, 0.2);
102 me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "g_waypointsprite_text", _("Display names instead of icons")));
103 setDependentNOT(e, "g_waypointsprite_alpha", 0);
104 setDependentAND(e, "cl_hidewaypoints", 0, 0);
105
106 #if 0
107 me.TR(me);
108 me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Damage")));
109 me.TR(me);
110 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Overlay:")));
111 me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.05, "hud_damage"));
112 me.TR(me);
113 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Factor:")));
114 setDependentNOT(e, "hud_damage", 0);
115 me.TD(me, 1, 2, e = makeXonoticSlider(0.025, 0.1, 0.025, "hud_damage_factor"));
116 setDependentNOT(e, "hud_damage", 0);
117 me.TR(me);
118 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Fade rate:")));
119 setDependentNOT(e, "hud_damage", 0);
120 me.TD(me, 1, 2, e = makeXonoticSlider(0.25, 1, 0.05, "hud_damage_fade_rate"));
121 setDependentNOT(e, "hud_damage", 0);
122 me.TR(me);
123 #endif
124
125 me.gotoRC(me, 0, 3); me.setFirstColumn(me, me.currentColumn);
126 me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Player Names")));
127 me.TR(me);
128 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_shownames", _("Show names above players")));
129
130 me.TR(me);
131 me.TDempty(me, 0.2);
132 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Opacity:")));
133 setDependent(e, "hud_shownames", 1, 1);
134 me.TD(me, 1, 2, e = makeXonoticSlider(0.1, 1, 0.1, "hud_shownames_alpha"));
135 e.formatString = "%";
136 setDependent(e, "hud_shownames", 1, 1);
137 me.TR(me);
138 me.TDempty(me, 0.2);
139 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Font size:")));
140 setDependentNOT(e, "hud_shownames_alpha", 0);
141 setDependentAND(e, "hud_shownames", 1, 1);
142 me.TD(me, 1, 2, e = makeXonoticSlider(5, 16, 1, "hud_shownames_fontsize"));
143 setDependentNOT(e, "hud_shownames_alpha", 0);
144 setDependentAND(e, "hud_shownames", 1, 1);
145 me.TR(me);
146 me.TDempty(me, 0.2);
147 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Max distance:")));
148 setDependentNOT(e, "hud_shownames_alpha", 0);
149 setDependentAND(e, "hud_shownames", 1, 1);
150 me.TD(me, 1, 2, e = makeXonoticSlider(2000, 10000, 500, "hud_shownames_maxdistance"));
151 e.formatString = _("%s qu");
152 setDependentNOT(e, "hud_shownames_alpha", 0);
153 setDependentAND(e, "hud_shownames", 1, 1);
154 me.TR(me);
155 me.TDempty(me, 0.2);
156 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Decolorize:")));
157 setDependentNOT(e, "hud_shownames_alpha", 0);
158 setDependentAND(e, "hud_shownames", 1, 1);
159 me.TD(me, 1, 2, e = makeXonoticMixedSlider("hud_shownames_decolorize"));
160 e.addText(e, _("Never"), 0);
161 e.addText(e, _("Teamplay"), 1);
162 e.addText(e, _("Always"), 2);
163 e.configureXonoticMixedSliderValues(e);
164 setDependentNOT(e, "hud_shownames_alpha", 0);
165 setDependentAND(e, "hud_shownames", 1, 1);
166
167 me.TR(me);
168 //me.TR(me);
169 me.TDempty(me, 0.2);
170 me.TD(me, 1, 2.8, e = makeXonoticCheckBoxEx(25, 0, "hud_shownames_crosshairdistance", _("Only when near crosshair")));
171 setDependentNOT(e, "hud_shownames_alpha", 0);
172 setDependentAND(e, "hud_shownames", 1, 1);
173 me.TR(me);
174 me.TDempty(me, 0.2);
175 me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "hud_shownames_status", _("Display health and armor")));
176 setDependentNOT(e, "hud_shownames_alpha", 0);
177 setDependentAND(e, "hud_shownames", 1, 1);
178
179 me.TR(me);
180 me.TR(me);
181 me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Other")));
182 me.TR(me);
183 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Speed unit:")));
184 me.TD(me, 1, 2, e = makeXonoticMixedSlider("hud_speed_unit"));
185 e.addText(e, _("qu/s"), 1);
186 e.addText(e, _("m/s"), 2);
187 e.addText(e, _("km/h"), 3);
188 e.addText(e, _("mph"), 4);
189 e.addText(e, _("knots"), 5);
190 e.configureXonoticMixedSliderValues(e);
191 me.TR(me);
192 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Damage overlay:")));
193 me.TD(me, 1, 2, e = makeXonoticMixedSlider("hud_damage"));
194 e.formatString = "%";
195 e.addText(e, _("Disable"), 0);
196 e.addRange(e, 0.05, 1, 0.05);
197 e.configureXonoticMixedSliderValues(e);
198 me.TR(me);
199 me.TD(me, 1, 1.2, e = makeXonoticCheckBox_T(0, "hud_dynamic_follow", _("Dynamic HUD"),
200 _("HUD moves around following player's movement")));
201 me.TD(me, 1, 1.8, e = makeXonoticCheckBox(0, "hud_dynamic_shake", _("Shake the HUD when hurt")));
202
203 me.gotoRC(me, me.rows - 1, 0); me.setFirstColumn(me, me.currentColumn);
204 me.TD(me, 1, me.columns, e = makeXonoticButton(_("Enter HUD editor"), '0 0 0'));
205 e.onClick = HUDSetup_Check_Gamestatus;
206 e.onClickEntity = me;
207 // TODO: show hud config name with text here
208}
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
void XonoticGameHUDSettingsTab_showNotify(entity me)
void XonoticGameHUDSettingsTab_fill(entity me)
void HUDSetup_Check_Gamestatus(entity me, entity btn)
entity makeXonoticGameHUDSettingsTab()
void HUDSetup_Start(entity me, entity btn)
#define main
Definition _all.inc:202
entity makeXonoticButton(string theText, vector theColor)
Definition button.qc:10
void loadAllCvars(entity root)
Definition util.qc:53
void setDependentAND(entity e, string theCvarName, float theCvarMin, float theCvarMax)
Definition util.qc:213
void makeMulti(entity e, string otherCvars)
Definition util.qc:92
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
const int GAME_ISSERVER
Definition menu.qh:11
const int GAME_CONNECTED
Definition menu.qh:12
int gamestatus
Definition menu.qh:16
void DialogOpenButton_Click(entity button, entity tab)
#define NEW(cname,...)
Definition oo.qh:117
entity makeXonoticScoreboardFadeTimeSlider()
entity makeXonoticTextLabel(float theAlign, string theText)
Definition textlabel.qc:3
entity makeXonoticHeaderLabel(string theText)
Definition textlabel.qc:10
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 makeXonoticCheckBoxEx(float theYesValue, float theNoValue, string theCvar, string theText)
Definition checkbox.qc:40
entity makeXonoticMixedSlider(string theCvar)
entity makeXonoticMixedSlider_T(string theCvar, string theTooltip)
Definition mixedslider.qc:3
entity makeXonoticSlider_T(float theValueMin, float theValueMax, float theValueStep, string theCvar, string theTooltip)
Definition slider.qc:3
entity makeXonoticSlider(float theValueMin, float theValueMax, float theValueStep, string theCvar)
Definition slider.qc:10