Xonotic
dialog_settings_game_hud.qc
Go to the documentation of this file.
2 
3 #include "../item/modalcontroller.qh"
4 #include "mainwindow.qh"
5 #include "textlabel.qh"
6 #include "slider.qh"
7 #include "slider_sbfadetime.qh"
8 #include "checkbox.qh"
9 #include "button.qh"
10 
12 {
13  if(!(gamestatus & (GAME_CONNECTED | GAME_ISSERVER))) // we're not in a match, ask the player if they want to start one anyway
14  {
15  DialogOpenButton_Click(me, main.hudconfirmDialog);
16  }
17  else // already in a match, lets just cut to the point and open up the hud editor directly
18  {
19  HUDSetup_Start(me, btn);
20  }
21 }
23 {
24  loadAllCvars(me);
25 }
27 {
28  entity me;
30  me.configureDialog(me);
31  return me;
32 }
33 
35 {
36  entity e;
37 
38  // todo:
39  // threshold: hud_damage_pain_threshold_lower_health
40  // scoreboard_alpha*
41 
42  me.TR(me);
43  me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Scoreboard")));
44  me.TR(me);
45  me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Alpha:")));
46  me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.05, "hud_panel_scoreboard_bg_alpha"));
47  me.TR(me);
48  me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Fading speed:")));
49  me.TD(me, 1, 2, e = makeXonoticScoreboardFadeTimeSlider());
50  me.TR(me);
51  me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_scoreboard_table_highlight", _("Enable rows / columns highlighting")));
52  me.TR(me);
53  me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_scoreboard_accuracy", _("Show accuracy underneath scoreboard")));
54  me.TR(me);
55  me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Show team sizes:")));
56  me.TD(me, 1, 2, e = makeXonoticTextSlider_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")));
57  e.addValue(e, _("Left"), "1");
58  e.addValue(e, _("Off"), "0");
59  e.addValue(e, _("Right"), "2");
60  e.configureXonoticTextSliderValues(e);
61 
62  me.TR(me);
63  me.TR(me);
64  me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Waypoints")));
65  me.TR(me);
66  me.TD(me, 1, 3, e = makeXonoticCheckBox_T(1, "cl_hidewaypoints", _("Display waypoint markers for objectives on the map"),
67  _("Show various gametype specific waypoints")));
68  me.TR(me);
69  me.TDempty(me, 0.2);
70  me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Alpha:")));
71  setDependent(e, "cl_hidewaypoints", 0, 0);
72  me.TD(me, 1, 2, e = makeXonoticSlider_T(0.1, 1, 0.05, "g_waypointsprite_alpha",
73  _("Control transparency of the waypoints")));
74  setDependent(e, "cl_hidewaypoints", 0, 0);
75  me.TR(me);
76  me.TDempty(me, 0.2);
77  me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Fontsize:")));
78  setDependent(e, "cl_hidewaypoints", 0, 0);
79  me.TD(me, 1, 2, e = makeXonoticSlider(5, 16, 1, "g_waypointsprite_fontsize"));
80  setDependent(e, "cl_hidewaypoints", 0, 0);
81  me.TR(me);
82  me.TDempty(me, 0.2);
83  me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Edge offset:")));
84  setDependent(e, "cl_hidewaypoints", 0, 0);
85  me.TD(me, 1, 2, e = makeXonoticSlider_T(0, 0.3, 0.01, "g_waypointsprite_edgeoffset_bottom", "-"));
86  makeMulti(e, "g_waypointsprite_edgeoffset_top g_waypointsprite_edgeoffset_left g_waypointsprite_edgeoffset_right");
87  setDependent(e, "cl_hidewaypoints", 0, 0);
88 
89  me.TR(me);
90  me.TDempty(me, 0.2);
91  me.TD(me, 1, 2.8, e = makeXonoticCheckBoxEx(0.25, 1, "g_waypointsprite_crosshairfadealpha", _("Fade when near the crosshair")));
92  setDependent(e, "cl_hidewaypoints", 0, 0);
93  me.TR(me);
94  me.TDempty(me, 0.2);
95  me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "g_waypointsprite_text", _("Display names instead of icons")));
96  setDependent(e, "cl_hidewaypoints", 0, 0);
97 
98  #if 0
99  me.TR(me);
100  me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Damage")));
101  me.TR(me);
102  me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Overlay:")));
103  me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.05, "hud_damage"));
104  me.TR(me);
105  me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Factor:")));
106  setDependent(e, "hud_damage", 0.001, 100);
107  me.TD(me, 1, 2, e = makeXonoticSlider(0.025, 0.1, 0.025, "hud_damage_factor"));
108  setDependent(e, "hud_damage", 0.001, 100);
109  me.TR(me);
110  me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Fade rate:")));
111  setDependent(e, "hud_damage", 0.001, 100);
112  me.TD(me, 1, 2, e = makeXonoticSlider(0.25, 1, 0.05, "hud_damage_fade_rate"));
113  setDependent(e, "hud_damage", 0.001, 100);
114  me.TR(me);
115  #endif
116 
117  me.gotoRC(me, 0, 3.2); me.setFirstColumn(me, me.currentColumn);
118  me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Player Names")));
119  me.TR(me);
120  me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_shownames", _("Show names above players")));
121 
122  me.TR(me);
123  me.TDempty(me, 0.2);
124  me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Alpha:")));
125  setDependent(e, "hud_shownames", 1, 1);
126  me.TD(me, 1, 2, e = makeXonoticSlider(0.1, 1, 0.05, "hud_shownames_alpha"));
127  setDependent(e, "hud_shownames", 1, 1);
128  me.TR(me);
129  me.TDempty(me, 0.2);
130  me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Fontsize:")));
131  setDependent(e, "hud_shownames", 1, 1);
132  me.TD(me, 1, 2, e = makeXonoticSlider(5, 16, 1, "hud_shownames_fontsize"));
133  setDependent(e, "hud_shownames", 1, 1);
134  me.TR(me);
135  me.TDempty(me, 0.2);
136  me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Max distance:")));
137  setDependent(e, "hud_shownames", 1, 1);
138  me.TD(me, 1, 2, e = makeXonoticSlider(2000, 10000, 500, "hud_shownames_maxdistance"));
139  setDependent(e, "hud_shownames", 1, 1);
140  me.TR(me);
141  me.TDempty(me, 0.2);
142  me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Decolorize:")));
143  setDependent(e, "hud_shownames", 1, 1);
144  me.TD(me, 1, 2, e = makeXonoticTextSlider("hud_shownames_decolorize"));
145  e.addValue(e, _("Never"), "0");
146  e.addValue(e, _("Teamplay"), "1");
147  e.addValue(e, _("Always"), "2");
148  e.configureXonoticTextSliderValues(e);
149  setDependent(e, "hud_shownames", 1, 1);
150 
151  me.TR(me);
152  //me.TR(me);
153  me.TDempty(me, 0.2);
154  me.TD(me, 1, 2.8, e = makeXonoticCheckBoxEx(25, 0, "hud_shownames_crosshairdistance", _("Only when near crosshair")));
155  setDependent(e, "hud_shownames", 1, 1);
156  me.TR(me);
157  me.TDempty(me, 0.2);
158  me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "hud_shownames_status", _("Display health and armor")));
159  setDependent(e, "hud_shownames", 1, 1);
160 
161  me.TR(me);
162  me.TR(me);
163  me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Damage overlay:")));
164  me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.05, "hud_damage"));
165  me.TR(me);
166  me.TD(me, 1, 3, e = makeXonoticCheckBox_T(0, "hud_dynamic_follow", _("Dynamic HUD"),
167  _("HUD moves around following player's movement")));
168  me.TR(me);
169  me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_dynamic_shake", _("Shake the HUD when hurt")));
170  me.TR(me);
171  me.TR(me);
172  me.TDempty(me, 0.5);
173  me.TD(me, 1, 2, e = makeXonoticButton(_("Enter HUD editor"), '0 0 0'));
174  e.onClick = HUDSetup_Check_Gamestatus;
175  e.onClickEntity = me;
176  // TODO: show hud config name with text here
177 }
#define NEW(cname,...)
Definition: oo.qh:105
entity makeXonoticCheckBoxEx(float theYesValue, float theNoValue, string theCvar, string theText)
Definition: checkbox.qc:40
entity makeXonoticHeaderLabel(string theText)
Definition: textlabel.qc:10
entity() spawn
void DialogOpenButton_Click(entity button, entity tab)
entity makeXonoticTextLabel(float theAlign, string theText)
Definition: textlabel.qc:3
void XonoticGameHUDSettingsTab_showNotify(entity me)
entity makeXonoticTextSlider_T(string theCvar, string theTooltip)
Definition: textslider.qc:3
void HUDSetup_Check_Gamestatus(entity me, entity btn)
void XonoticGameHUDSettingsTab_fill(entity me)
entity makeXonoticSlider(float theValueMin, float theValueMax, float theValueStep, string theCvar)
Definition: slider.qc:10
entity makeXonoticSlider_T(float theValueMin, float theValueMax, float theValueStep, string theCvar, string theTooltip)
Definition: slider.qc:3
entity makeXonoticCheckBox_T(float isInverted, string theCvar, string theText, string theTooltip)
Definition: checkbox.qc:3
void HUDSetup_Start(entity me, entity btn)
entity makeXonoticGameHUDSettingsTab()
entity makeXonoticTextSlider(string theCvar)
Definition: textslider.qc:10
entity makeXonoticScoreboardFadeTimeSlider()
entity makeXonoticCheckBox(float isInverted, string theCvar, string theText)
Definition: checkbox.qc:28