1 #include "dialog_settings_game_hud.qh"
3 #include "../item/modalcontroller.qh"
4 #include "mainwindow.qh"
5 #include "textlabel.qh"
7 #include "slider_sbfadetime.qh"
11 void HUDSetup_Check_Gamestatus(entity me, entity btn)
13 if(!(gamestatus & (GAME_CONNECTED | GAME_ISSERVER))) // we're not in a match, ask the player if they want to start one anyway
15 DialogOpenButton_Click(me, main.hudconfirmDialog);
17 else // already in a match, lets just cut to the point and open up the hud editor directly
19 HUDSetup_Start(me, btn);
22 void XonoticGameHUDSettingsTab_showNotify(entity me)
26 entity makeXonoticGameHUDSettingsTab()
29 me = NEW(XonoticGameHUDSettingsTab);
30 me.configureDialog(me);
34 void XonoticGameHUDSettingsTab_fill(entity me)
39 // threshold: hud_damage_pain_threshold_lower_health
43 me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Scoreboard")));
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"));
48 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Fading speed:")));
49 me.TD(me, 1, 2, e = makeXonoticScoreboardFadeTimeSlider());
51 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_scoreboard_table_highlight", _("Enable rows / columns highlighting")));
55 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_scoreboard_respawntime_decimals", _("Show decimals in respawn countdown")));
57 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_scoreboard_accuracy", _("Show accuracy underneath scoreboard")));
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);
68 me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Waypoints")));
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")));
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);
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);
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);
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);
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);
105 me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Damage")));
107 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Overlay:")));
108 me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.05, "hud_damage"));
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);
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);
122 me.gotoRC(me, 0, 3.2); me.setFirstColumn(me, me.currentColumn);
123 me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Player Names")));
125 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_shownames", _("Show names above players")));
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);
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);
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);
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);
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);
163 me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "hud_shownames_status", _("Display health and armor")));
164 setDependent(e, "hud_shownames", 1, 1);
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"));
171 me.TD(me, 1, 3, e = makeXonoticCheckBox_T(0, "hud_dynamic_follow", _("Dynamic HUD"),
172 _("HUD moves around following player's movement")));
174 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_dynamic_shake", _("Shake the HUD when hurt")));
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