]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/menu/xonotic/dialog_settings_game_hud.qc
0fb475563a8f2e643e7b5444cb44eb96b2d8b731
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / dialog_settings_game_hud.qc
1 #include "dialog_settings_game_hud.qh"
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
11 void HUDSetup_Check_Gamestatus(entity me, entity btn)
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 }
22 void XonoticGameHUDSettingsTab_showNotify(entity me)
23 {
24         loadAllCvars(me);
25 }
26 entity makeXonoticGameHUDSettingsTab()
27 {
28         entity me;
29         me = NEW(XonoticGameHUDSettingsTab);
30         me.configureDialog(me);
31         return me;
32 }
33
34 void XonoticGameHUDSettingsTab_fill(entity me)
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
53         me.TR(me);
54         //me.TR(me);
55                 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_scoreboard_respawntime_decimals", _("Show decimals in respawn countdown")));
56         me.TR(me);
57                 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_scoreboard_accuracy", _("Show accuracy underneath scoreboard")));
58         me.TR(me);
59                 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Show team sizes:")));
60                 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")));
61                         e.addValue(e, _("Left"), "1");
62                         e.addValue(e, _("Off"), "0");
63                         e.addValue(e, _("Right"), "2");
64                         e.configureXonoticTextSliderValues(e);
65
66         //me.TR(me);
67         me.TR(me);
68                 me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Waypoints")));
69         me.TR(me);
70                 me.TD(me, 1, 3, e = makeXonoticCheckBox_T(1, "cl_hidewaypoints", _("Display waypoint markers for objectives on the map"),
71                         _("Show various gametype specific waypoints")));
72         me.TR(me);
73                 me.TDempty(me, 0.2);
74                 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Alpha:")));
75                         setDependent(e, "cl_hidewaypoints", 0, 0);
76                 me.TD(me, 1, 2, e = makeXonoticSlider_T(0.1, 1, 0.05, "g_waypointsprite_alpha",
77                         _("Control transparency of the waypoints")));
78                         setDependent(e, "cl_hidewaypoints", 0, 0);
79         me.TR(me);
80                 me.TDempty(me, 0.2);
81                 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Fontsize:")));
82                         setDependent(e, "cl_hidewaypoints", 0, 0);
83                 me.TD(me, 1, 2, e = makeXonoticSlider(5, 16, 1, "g_waypointsprite_fontsize"));
84                         setDependent(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                         setDependent(e, "cl_hidewaypoints", 0, 0);
89                 me.TD(me, 1, 2, e = makeXonoticSlider_T(0, 0.3, 0.01, "g_waypointsprite_edgeoffset_bottom", "-"));
90                         makeMulti(e, "g_waypointsprite_edgeoffset_top g_waypointsprite_edgeoffset_left g_waypointsprite_edgeoffset_right");
91                         setDependent(e, "cl_hidewaypoints", 0, 0);
92
93         me.TR(me);
94         //me.TR(me);
95                 me.TDempty(me, 0.2);
96                 me.TD(me, 1, 2.8, e = makeXonoticCheckBoxEx(0.25, 1, "g_waypointsprite_crosshairfadealpha", _("Fade when near the crosshair")));
97                         setDependent(e, "cl_hidewaypoints", 0, 0);
98         me.TR(me);
99                 me.TDempty(me, 0.2);
100                 me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "g_waypointsprite_text", _("Display names instead of icons")));
101                         setDependent(e, "cl_hidewaypoints", 0, 0);
102
103         #if 0
104         me.TR(me);
105                 me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Damage")));
106         me.TR(me);
107                 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Overlay:")));
108                 me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.05, "hud_damage"));
109         me.TR(me);
110                 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Factor:")));
111                         setDependent(e, "hud_damage", 0.001, 100);
112                 me.TD(me, 1, 2, e = makeXonoticSlider(0.025, 0.1, 0.025, "hud_damage_factor"));
113                         setDependent(e, "hud_damage", 0.001, 100);
114         me.TR(me);
115                 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Fade rate:")));
116                         setDependent(e, "hud_damage", 0.001, 100);
117                 me.TD(me, 1, 2, e = makeXonoticSlider(0.25, 1, 0.05, "hud_damage_fade_rate"));
118                         setDependent(e, "hud_damage", 0.001, 100);
119         me.TR(me);
120         #endif
121
122         me.gotoRC(me, 0, 3.2); me.setFirstColumn(me, me.currentColumn);
123                 me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Player Names")));
124         me.TR(me);
125                 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_shownames", _("Show names above players")));
126
127         me.TR(me);
128                 me.TDempty(me, 0.2);
129                 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Alpha:")));
130                         setDependent(e, "hud_shownames", 1, 1);
131                 me.TD(me, 1, 2, e = makeXonoticSlider(0.1, 1, 0.05, "hud_shownames_alpha"));
132                         setDependent(e, "hud_shownames", 1, 1);
133         me.TR(me);
134                 me.TDempty(me, 0.2);
135                 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Fontsize:")));
136                         setDependent(e, "hud_shownames", 1, 1);
137                 me.TD(me, 1, 2, e = makeXonoticSlider(5, 16, 1, "hud_shownames_fontsize"));
138                         setDependent(e, "hud_shownames", 1, 1);
139         me.TR(me);
140                 me.TDempty(me, 0.2);
141                 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Max distance:")));
142                         setDependent(e, "hud_shownames", 1, 1);
143                 me.TD(me, 1, 2, e = makeXonoticSlider(2000, 10000, 500, "hud_shownames_maxdistance"));
144                         setDependent(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, _("Decolorize:")));
148                         setDependent(e, "hud_shownames", 1, 1);
149                 me.TD(me, 1, 2, e = makeXonoticTextSlider("hud_shownames_decolorize"));
150                         e.addValue(e, _("Never"), "0");
151                         e.addValue(e, _("Teamplay"), "1");
152                         e.addValue(e, _("Always"), "2");
153                         e.configureXonoticTextSliderValues(e);
154                         setDependent(e, "hud_shownames", 1, 1);
155
156         me.TR(me);
157         //me.TR(me);
158                 me.TDempty(me, 0.2);
159                 me.TD(me, 1, 2.8, e = makeXonoticCheckBoxEx(25, 0, "hud_shownames_crosshairdistance", _("Only when near crosshair")));
160                         setDependent(e, "hud_shownames", 1, 1);
161         me.TR(me);
162                 me.TDempty(me, 0.2);
163                 me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "hud_shownames_status", _("Display health and armor")));
164                         setDependent(e, "hud_shownames", 1, 1);
165
166         me.TR(me);
167         me.TR(me);
168                 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Damage overlay:")));
169                 me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.05, "hud_damage"));
170         me.TR(me);
171                 me.TD(me, 1, 3, e = makeXonoticCheckBox_T(0, "hud_dynamic_follow", _("Dynamic HUD"),
172                         _("HUD moves around following player's movement")));
173         me.TR(me);
174                 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_dynamic_shake", _("Shake the HUD when hurt")));
175         me.TR(me);
176         me.TR(me);
177                 me.TDempty(me, 0.5);
178                 me.TD(me, 1, 2, e = makeXonoticButton(_("Enter HUD editor"), '0 0 0'));
179                         e.onClick = HUDSetup_Check_Gamestatus;
180                         e.onClickEntity = me;
181                 // TODO: show hud config name with text here
182 }