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")));
61 me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Waypoints")));
63 me.TD(me, 1, 3, e = makeXonoticCheckBox_T(1, "cl_hidewaypoints", _("Display waypoint markers for objectives on the map"),
64 _("Show various gametype specific waypoints")));
67 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Alpha:")));
68 setDependent(e, "cl_hidewaypoints", 0, 0);
69 me.TD(me, 1, 2, e = makeXonoticSlider_T(0.1, 1, 0.05, "g_waypointsprite_alpha",
70 _("Control transparency of the waypoints")));
71 setDependent(e, "cl_hidewaypoints", 0, 0);
74 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Fontsize:")));
75 setDependent(e, "cl_hidewaypoints", 0, 0);
76 me.TD(me, 1, 2, e = makeXonoticSlider(5, 16, 1, "g_waypointsprite_fontsize"));
77 setDependent(e, "cl_hidewaypoints", 0, 0);
80 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Edge offset:")));
81 setDependent(e, "cl_hidewaypoints", 0, 0);
82 me.TD(me, 1, 2, e = makeXonoticSlider_T(0, 0.3, 0.01, "g_waypointsprite_edgeoffset_bottom", "-"));
83 makeMulti(e, "g_waypointsprite_edgeoffset_top g_waypointsprite_edgeoffset_left g_waypointsprite_edgeoffset_right");
84 setDependent(e, "cl_hidewaypoints", 0, 0);
89 me.TD(me, 1, 2.8, e = makeXonoticCheckBoxEx(0.25, 1, "g_waypointsprite_crosshairfadealpha", _("Fade when near the crosshair")));
90 setDependent(e, "cl_hidewaypoints", 0, 0);
93 me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "g_waypointsprite_text", _("Display names instead of icons")));
94 setDependent(e, "cl_hidewaypoints", 0, 0);
98 me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Damage")));
100 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Overlay:")));
101 me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.05, "hud_damage"));
103 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Factor:")));
104 setDependent(e, "hud_damage", 0.001, 100);
105 me.TD(me, 1, 2, e = makeXonoticSlider(0.025, 0.1, 0.025, "hud_damage_factor"));
106 setDependent(e, "hud_damage", 0.001, 100);
108 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Fade rate:")));
109 setDependent(e, "hud_damage", 0.001, 100);
110 me.TD(me, 1, 2, e = makeXonoticSlider(0.25, 1, 0.05, "hud_damage_fade_rate"));
111 setDependent(e, "hud_damage", 0.001, 100);
115 me.gotoRC(me, 0, 3.2); me.setFirstColumn(me, me.currentColumn);
116 me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Player Names")));
118 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_shownames", _("Show names above players")));
122 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Alpha:")));
123 setDependent(e, "hud_shownames", 1, 1);
124 me.TD(me, 1, 2, e = makeXonoticSlider(0.1, 1, 0.05, "hud_shownames_alpha"));
125 setDependent(e, "hud_shownames", 1, 1);
128 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Fontsize:")));
129 setDependent(e, "hud_shownames", 1, 1);
130 me.TD(me, 1, 2, e = makeXonoticSlider(5, 16, 1, "hud_shownames_fontsize"));
131 setDependent(e, "hud_shownames", 1, 1);
134 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Max distance:")));
135 setDependent(e, "hud_shownames", 1, 1);
136 me.TD(me, 1, 2, e = makeXonoticSlider(2000, 10000, 500, "hud_shownames_maxdistance"));
137 setDependent(e, "hud_shownames", 1, 1);
140 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Decolorize:")));
141 setDependent(e, "hud_shownames", 1, 1);
142 me.TD(me, 1, 2, e = makeXonoticTextSlider("hud_shownames_decolorize"));
143 e.addValue(e, _("Never"), "0");
144 e.addValue(e, _("Teamplay"), "1");
145 e.addValue(e, _("Always"), "2");
146 e.configureXonoticTextSliderValues(e);
147 setDependent(e, "hud_shownames", 1, 1);
152 me.TD(me, 1, 2.8, e = makeXonoticCheckBoxEx(25, 0, "hud_shownames_crosshairdistance", _("Only when near crosshair")));
153 setDependent(e, "hud_shownames", 1, 1);
156 me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "hud_shownames_status", _("Display health and armor")));
157 setDependent(e, "hud_shownames", 1, 1);
161 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Damage overlay:")));
162 me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.05, "hud_damage"));
164 me.TD(me, 1, 3, e = makeXonoticCheckBox_T(0, "hud_dynamic_follow", _("Dynamic HUD"),
165 _("HUD moves around following player's movement")));
167 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_dynamic_shake", _("Shake the HUD when hurt")));
171 me.TD(me, 1, 2, e = makeXonoticButton(_("Enter HUD editor"), '0 0 0'));
172 e.onClick = HUDSetup_Check_Gamestatus;
173 e.onClickEntity = me;
174 // TODO: show hud config name with text here