seta hud_panel_scoreboard_ctf_leaderboard 1 "show a capture time rankings leaderboard in the scoreboard if allowed by the server"
seta hud_panel_scoreboard_itemstats 1 "show item stats panel in the scoreboard"
seta hud_panel_strafehud 3 "enable this panel, 1 = show if not observing, 2 = show always, 3 = show only in race/cts if not observing"
+seta hud_panel_compass 0 "enable this panel, 1 = show if not observing, 2 = show always, 3 = show only in race/cts if not observing"
seta hud_panel_weapons_dynamichud 1 "apply the dynamic hud effects to this panel"
seta hud_panel_ammo_dynamichud 1 "apply the dynamic hud effects to this panel"
seta hud_panel_itemstime_dynamichud 1 "apply the dynamic hud effects to this panel"
seta hud_panel_scoreboard_dynamichud 0 "apply the dynamic hud effects to this panel"
seta hud_panel_strafehud_dynamichud 1 "apply the dynamic hud effects to this panel"
+seta hud_panel_compass_dynamichud 1 "apply the dynamic hud effects to this panel"
seta hud_panel_weapons_ammo_full_shells 60 "show 100% of the status bar at this ammo count"
seta hud_panel_weapons_ammo_full_nails 320 "show 100% of the status bar at this ammo count"
seta hud_panel_strafehud_antiflicker_angle "0.01" "how many degrees from 0° to 180° the hud ignores if it could cause visual disturbances otherwise (and to counter rounding errors)"
seta hud_panel_strafehud_antiflicker_speed "0.0001" "how many qu/s the hud ignores if it could cause visual disturbances otherwise (and to counter rounding errors)"
+seta hud_panel_compass_north_color "1 0.5 0" "color of the north compass quarter"
+seta hud_panel_compass_east_color "0.25 0.75 0" "color of the east compass quarter"
+seta hud_panel_compass_south_color "0.75 0.25 1" "color of the south compass quarter"
+seta hud_panel_compass_west_color "0.25 1 0.75" "color of the west compass quarter"
+seta hud_panel_compass_quarter_alpha "0.8" "opacity of the compass quarters"
+seta hud_panel_compass_arrow_color "1 1 1" "color of the velocity direction arrow"
+seta hud_panel_compass_arrow_snap_color "1 0 0" "color of the arrow if the velocity direction snaps to a 90° angle"
+seta hud_panel_compass_arrow_alpha "1" "opacity of the velocity arrow"
+seta hud_panel_compass_arrow_size "0.5" "size of the velocity arrow relative to the panel height"
+seta hud_panel_compass_line_color "1 1 1" "color of the orienting lines"
+seta hud_panel_compass_line_alpha "1" "opacity of the orienting lines"
+seta hud_panel_compass_line_size "0.2" "size of the orienting lines relative to the panel height"
+
// hud panel aliases
alias quickmenu "cl_cmd hud quickmenu ${* ?}"
seta hud_panel_strafehud_bg_alpha "" "if set to something else than \"\" = override default panel background alpha"
seta hud_panel_strafehud_bg_border "" "if set to something else than \"\" = override default size of border around the background"
seta hud_panel_strafehud_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
+
+seta hud_panel_compass_pos "" "position of this base of the panel"
+seta hud_panel_compass_size "" "size of this panel"
+seta hud_panel_compass_bg "" "if set to something else than \"\" = override default background"
+seta hud_panel_compass_bg_color "" "if set to something else than \"\" = override default panel background color"
+seta hud_panel_compass_bg_color_team "" "override panel color with team color in team based games"
+seta hud_panel_compass_bg_alpha "" "if set to something else than \"\" = override default panel background alpha"
+seta hud_panel_compass_bg_border "" "if set to something else than \"\" = override default size of border around the background"
+seta hud_panel_compass_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
seta hud_panel_strafehud_bg_border ""
seta hud_panel_strafehud_bg_padding ""
+seta hud_panel_compass_pos "0.290000 0.530000"
+seta hud_panel_compass_size "0.420000 0.030000"
+seta hud_panel_compass_bg "0"
+seta hud_panel_compass_bg_color ""
+seta hud_panel_compass_bg_color_team ""
+seta hud_panel_compass_bg_alpha "0.7"
+seta hud_panel_compass_bg_border ""
+seta hud_panel_compass_bg_padding ""
+
menu_sync
seta hud_panel_strafehud_bg_border ""
seta hud_panel_strafehud_bg_padding ""
+seta hud_panel_compass_pos "0.300000 0.530000"
+seta hud_panel_compass_size "0.400000 0.030000"
+seta hud_panel_compass_bg ""
+seta hud_panel_compass_bg_color ""
+seta hud_panel_compass_bg_color_team ""
+seta hud_panel_compass_bg_alpha ""
+seta hud_panel_compass_bg_border ""
+seta hud_panel_compass_bg_padding ""
+
menu_sync
seta hud_panel_strafehud_bg_border ""
seta hud_panel_strafehud_bg_padding ""
+seta hud_panel_compass_pos "0.350000 0.525000"
+seta hud_panel_compass_size "0.300000 0.027500"
+seta hud_panel_compass_bg ""
+seta hud_panel_compass_bg_color ""
+seta hud_panel_compass_bg_color_team ""
+seta hud_panel_compass_bg_alpha ""
+seta hud_panel_compass_bg_border ""
+seta hud_panel_compass_bg_padding ""
+
menu_sync
seta hud_panel_strafehud_bg_border ""
seta hud_panel_strafehud_bg_padding ""
+seta hud_panel_compass_pos "0.300000 0.675000"
+seta hud_panel_compass_size "0.400000 0.017500"
+seta hud_panel_compass_bg ""
+seta hud_panel_compass_bg_color ""
+seta hud_panel_compass_bg_color_team ""
+seta hud_panel_compass_bg_alpha ""
+seta hud_panel_compass_bg_border ""
+seta hud_panel_compass_bg_padding ""
+
menu_sync
seta hud_panel_strafehud_bg_border ""
seta hud_panel_strafehud_bg_padding ""
+seta hud_panel_compass_pos "0.320000 0.715000"
+seta hud_panel_compass_size "0.360000 0.025000"
+seta hud_panel_compass_bg ""
+seta hud_panel_compass_bg_color ""
+seta hud_panel_compass_bg_color_team ""
+seta hud_panel_compass_bg_alpha ""
+seta hud_panel_compass_bg_border ""
+seta hud_panel_compass_bg_padding ""
+
menu_sync
seta hud_panel_strafehud_bg_border ""
seta hud_panel_strafehud_bg_padding ""
+seta hud_panel_compass_pos "0.330000 0.530000"
+seta hud_panel_compass_size "0.340000 0.030000"
+seta hud_panel_compass_bg "0"
+seta hud_panel_compass_bg_color ""
+seta hud_panel_compass_bg_color_team ""
+seta hud_panel_compass_bg_alpha ""
+seta hud_panel_compass_bg_border ""
+seta hud_panel_compass_bg_padding ""
+
menu_sync
REGISTER_HUD_PANEL(QUICKMENU, HUD_QuickMenu, PANEL_CONFIG_MAIN , PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME ) // QUICKMENU
REGISTER_HUD_PANEL(SCOREBOARD, Scoreboard_Draw, PANEL_CONFIG_NO , PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME | PANEL_SHOW_MAPVOTE | PANEL_SHOW_WITH_SB) // SCOREBOARD
REGISTER_HUD_PANEL(STRAFEHUD, HUD_StrafeHUD, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // STRAFEHUD
+REGISTER_HUD_PANEL(COMPASS, HUD_Compass, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // COMPASS
// always add new panels to the end of list
// Because calling lots of functions in QC apparently cuts fps in half on many machines:
#include <client/hud/panel/ammo.qc>
#include <client/hud/panel/centerprint.qc>
#include <client/hud/panel/chat.qc>
+#include <client/hud/panel/compass.qc>
#include <client/hud/panel/engineinfo.qc>
#include <client/hud/panel/healtharmor.qc>
#include <client/hud/panel/infomessages.qc>
#include <client/hud/panel/ammo.qh>
#include <client/hud/panel/centerprint.qh>
#include <client/hud/panel/chat.qh>
+#include <client/hud/panel/compass.qh>
#include <client/hud/panel/engineinfo.qh>
#include <client/hud/panel/healtharmor.qh>
#include <client/hud/panel/infomessages.qh>
--- /dev/null
+// Author: Juhu
+
+#include "compass.qh"
+
+#include <client/draw.qh>
+#include <common/physics/player.qh>
+#include <lib/csqcmodel/cl_player.qh>
+
+// Compass (#26)
+
+void HUD_Compass_Export(int fh)
+{
+ // allow saving cvars that aesthetically change the panel into hud skin files
+}
+
+// provide basic panel cvars to old clients
+// TODO remove them after a future release (0.8.2+)
+noref string autocvar_hud_panel_compass_pos = "0.290000 0.530000";
+noref string autocvar_hud_panel_compass_size = "0.420000 0.030000";
+noref string autocvar_hud_panel_compass_bg = "0";
+noref string autocvar_hud_panel_compass_bg_color = "";
+noref string autocvar_hud_panel_compass_bg_color_team = "";
+noref string autocvar_hud_panel_compass_bg_alpha = "0.7";
+noref string autocvar_hud_panel_compass_bg_border = "";
+noref string autocvar_hud_panel_compass_bg_padding = "";
+
+void HUD_Compass()
+{
+ // generic hud routines
+ if(!autocvar__hud_configure)
+ {
+ if(!autocvar_hud_panel_compass ||
+ (spectatee_status == -1 && (autocvar_hud_panel_compass == 1 || autocvar_hud_panel_compass == 3)) ||
+ (autocvar_hud_panel_compass == 3 && !MUTATOR_CALLHOOK(HUD_Compass_showoptional))) return;
+ }
+
+ HUD_Panel_LoadCvars();
+
+ if(autocvar_hud_panel_compass_dynamichud)
+ {
+ HUD_Scale_Enable();
+ }
+ else
+ {
+ HUD_Scale_Disable();
+ }
+
+ HUD_Panel_DrawBg();
+
+ if(panel_bg_padding)
+ {
+ panel_pos += '1 1 0' * panel_bg_padding;
+ panel_size -= '2 2 0' * panel_bg_padding;
+ }
+
+ // draw compass
+ if(csqcplayer)
+ {
+ // get the world axis
+ float angle = !autocvar__hud_configure ? PHYS_INPUT_ANGLES(csqcplayer).y : 0;
+ float move_angle = !autocvar__hud_configure ? vectoangles(csqcplayer.velocity).y : 0;
+ float speed = !autocvar__hud_configure ? vlen(vec2(csqcplayer.velocity)) : 320;
+ vector line_size = panel_size;
+ line_size.x = line_size.y = autocvar_hud_panel_compass_line_size * panel_size.y;
+ if(angle < 0)
+ angle += 360;
+
+ // make the compass move opposite to the rotation direction
+ if(!autocvar_v_flipped)
+ {
+ angle = 360 - angle;
+ move_angle = 360 - move_angle;
+ }
+
+ // get the size of one quarter of the compass
+ vector quarter_size = panel_size;
+ quarter_size.x /= 4;
+
+ // calculate how much the compass quarters differ from their 90° alignment
+ float alignment_offset = angle % 90 / 90 * quarter_size.x;
+
+ // draw the four compass quarters
+ for(int i = 0; i < 4; ++i){
+ float offset = quarter_size.x*i;
+ vector color;
+
+ // calculate an angle to determine which compass quarter to draw next
+ float draw_angle = angle + 90*i;
+ if(draw_angle >= 360)
+ draw_angle -= 360;
+
+ // chooses the color for each compass quarter
+ if(draw_angle < 90)
+ color = !autocvar_v_flipped ? autocvar_hud_panel_compass_south_color : autocvar_hud_panel_compass_east_color;
+ else if(draw_angle < 180)
+ color = !autocvar_v_flipped ? autocvar_hud_panel_compass_west_color : autocvar_hud_panel_compass_north_color;
+ else if(draw_angle < 270)
+ color = !autocvar_v_flipped ? autocvar_hud_panel_compass_north_color : autocvar_hud_panel_compass_west_color;
+ else
+ color = !autocvar_v_flipped ? autocvar_hud_panel_compass_east_color : autocvar_hud_panel_compass_south_color;
+
+ // if the compass quarter doesn't wrap around just draw it all at once
+ if(offset - alignment_offset >= 0)
+ {
+ // draw the compass quarter
+ drawfill(panel_pos + eX * (offset - alignment_offset), quarter_size, color, autocvar_hud_panel_compass_quarter_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+ // draw the orienting lines
+ drawfill(panel_pos + eX * (offset - alignment_offset + quarter_size.x/2 - line_size.x/2) + eY * (panel_size.y - line_size.y), line_size, autocvar_hud_panel_compass_line_color, autocvar_hud_panel_compass_line_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+ }
+ // if it does wrap around draw each part seperately on both ends of the hud panel
+ else
+ {
+ // draw the compass quarter
+ drawfill(panel_pos, quarter_size - eX * alignment_offset, color, autocvar_hud_panel_compass_quarter_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+ drawfill(panel_pos + eX * (panel_size.x - alignment_offset), quarter_size - eX * (quarter_size.x - alignment_offset), color, autocvar_hud_panel_compass_quarter_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+ // draw the orienting lines
+ if(angle % 90 <= 45)
+ drawfill(panel_pos + eX * (quarter_size.x/2 - alignment_offset - line_size.x/2) + eY * (panel_size.y - line_size.y), line_size, autocvar_hud_panel_compass_line_color, autocvar_hud_panel_compass_line_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+ if(angle % 90 >= 45)
+ drawfill(panel_pos + eX * (panel_size.x - alignment_offset + quarter_size.x/2 - line_size.x/2) + eY * (panel_size.y - line_size.y), line_size, autocvar_hud_panel_compass_line_color, autocvar_hud_panel_compass_line_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+ }
+ }
+
+ // if the player is moving show the velocity direction relative to the view direction
+ if(speed > 0)
+ {
+ bool bkwd = false;
+ float offset_angle = move_angle - angle;
+
+ // wrap around overflows
+ if(offset_angle <= -180)
+ offset_angle += 360;
+ if(offset_angle > 180)
+ offset_angle -= 360;
+
+ // shift the arrow by 180 degrees and flip it if looking backwards
+ if(fabs(offset_angle) > 90)
+ {
+ bkwd = true;
+ offset_angle += 180;
+ if(offset_angle > 180)
+ offset_angle -= 360;
+ }
+ Compass_drawArrow(panel_pos + eX * (offset_angle / 360 * panel_size.x + panel_size.x/2) + eY * (panel_size.y), autocvar_hud_panel_compass_arrow_size * panel_size.y, (!autocvar__hud_configure && move_angle % 90 == 0 ? autocvar_hud_panel_compass_arrow_snap_color : autocvar_hud_panel_compass_arrow_color), autocvar_hud_panel_compass_arrow_alpha, bkwd);
+ }
+ }
+}
+
+// draw an arrow (inspired by drawspritearrow() in common/mutators/mutator/waypoints/waypointsprites.qc)
+void Compass_drawArrow(vector origin, float size, vector color, float alpha, bool flipped)
+{
+ R_BeginPolygon("", DRAWFLAG_NORMAL, true);
+ R_PolygonVertex(origin + (flipped ? size*eY : '0 0 0') , '0 0 0', color, alpha);
+ R_PolygonVertex(origin + (flipped ? '0 0 0' : size*eY) - size*eX, '0 0 0', color, alpha);
+ R_PolygonVertex(origin + (flipped ? '0 0 0' : size*eY) + size*eX, '0 0 0', color, alpha);
+ R_EndPolygon();
+}
+
--- /dev/null
+#pragma once
+#include "../panel.qh"
+
+int autocvar_hud_panel_compass = 0;
+bool autocvar_hud_panel_compass_dynamichud = true;
+vector autocvar_hud_panel_compass_north_color = '1 0.5 0';
+vector autocvar_hud_panel_compass_east_color = '0.25 0.75 0';
+vector autocvar_hud_panel_compass_south_color = '0.75 0.25 1';
+vector autocvar_hud_panel_compass_west_color = '0.25 1 0.75';
+float autocvar_hud_panel_compass_quarter_alpha = 0.8;
+vector autocvar_hud_panel_compass_arrow_color = '1 1 1';
+vector autocvar_hud_panel_compass_arrow_snap_color = '1 0 0';
+float autocvar_hud_panel_compass_arrow_alpha = 1;
+float autocvar_hud_panel_compass_arrow_size = 0.5;
+vector autocvar_hud_panel_compass_line_color = '1 1 1';
+float autocvar_hud_panel_compass_line_alpha = 1;
+float autocvar_hud_panel_compass_line_size = 0.2;
+
+void Compass_drawArrow(vector, float, vector, float, bool);
/** return true to show the strafehud when optional mode is enabled */
MUTATOR_HOOKABLE(HUD_StrafeHUD_showoptional, EV_NO_ARGS);
+/** return true to show the compass HUD panel when optional mode is enabled */
+MUTATOR_HOOKABLE(HUD_Compass_showoptional, EV_NO_ARGS);
+
/** return true to hide the score HUD panel */
MUTATOR_HOOKABLE(HUD_Score_show, EV_NO_ARGS);
return ISGAMETYPE(CTS); // show the optional strafehud
}
+MUTATOR_HOOKFUNCTION(cl_cts, HUD_Compass_showoptional)
+{
+ return ISGAMETYPE(CTS); // show the optional compass
+}
+
MUTATOR_HOOKFUNCTION(cl_cts, HUD_Score_show)
{
return spectatee_status == -1 && ISGAMETYPE(CTS); // hide the score panel while observing
return ISGAMETYPE(RACE); // show the optional strafehud
}
+MUTATOR_HOOKFUNCTION(cl_race, HUD_Compass_showoptional)
+{
+ return ISGAMETYPE(RACE); // show the optional compass
+}
+
MUTATOR_HOOKFUNCTION(cl_race, HUD_Score_show)
{
return spectatee_status == -1 && ISGAMETYPE(RACE); // hide the score panel while observing
#include <menu/xonotic/dialog_hudpanel_ammo.qc>
#include <menu/xonotic/dialog_hudpanel_centerprint.qc>
#include <menu/xonotic/dialog_hudpanel_chat.qc>
+#include <menu/xonotic/dialog_hudpanel_compass.qc>
#include <menu/xonotic/dialog_hudpanel_engineinfo.qc>
#include <menu/xonotic/dialog_hudpanel_healtharmor.qc>
#include <menu/xonotic/dialog_hudpanel_infomessages.qc>
#include <menu/xonotic/dialog_hudpanel_ammo.qh>
#include <menu/xonotic/dialog_hudpanel_centerprint.qh>
#include <menu/xonotic/dialog_hudpanel_chat.qh>
+#include <menu/xonotic/dialog_hudpanel_compass.qh>
#include <menu/xonotic/dialog_hudpanel_engineinfo.qh>
#include <menu/xonotic/dialog_hudpanel_healtharmor.qh>
#include <menu/xonotic/dialog_hudpanel_infomessages.qh>
--- /dev/null
+#include "dialog_hudpanel_compass.qh"
+
+#include "colorpicker_string.qh"
+#include "button.qh"
+#include "slider.qh"
+#include "textlabel.qh"
+#include "textslider.qh"
+
+void Compass_CenterPanel(entity btn, entity me)
+{
+ vector size = stov(str_cvar("hud_panel_compass_size"));
+ vector pos = stov(str_cvar("hud_panel_compass_pos"));
+ pos.x = 0.5 - size.x / 2;
+ cvar_set("hud_panel_compass_pos", strcat(ftos(pos.x), " ", ftos(pos.y)));
+}
+
+void Compass_ColorReset(entity btn, entity me)
+{
+ cvar_set("hud_panel_compass_north_color", cvar_defstring("hud_panel_compass_north_color"));
+ cvar_set("hud_panel_compass_east_color", cvar_defstring("hud_panel_compass_east_color"));
+ cvar_set("hud_panel_compass_south_color", cvar_defstring("hud_panel_compass_south_color"));
+ cvar_set("hud_panel_compass_west_color", cvar_defstring("hud_panel_compass_west_color"));
+ cvar_set("hud_panel_compass_arrow_color", cvar_defstring("hud_panel_compass_arrow_color"));
+ cvar_set("hud_panel_compass_arrow_snap_color", cvar_defstring("hud_panel_compass_arrow_snap_color"));
+ cvar_set("hud_panel_compass_line_color", cvar_defstring("hud_panel_compass_line_color"));
+}
+
+void XonoticHUDCompassDialog_fill(entity me)
+{
+ entity e;
+ string panelname = "compass";
+
+ me.TR(me);
+ me.TD(me, 1, 4, e = makeXonoticTextSlider("hud_panel_compass"));
+ e.addValue(e, _("Disable"), "0");
+ e.addValue(e, _("Enable"), "1");
+ e.addValue(e, _("Enable even observing"), "2");
+ e.addValue(e, _("Enable only in Race/CTS"), "3");
+ e.configureXonoticTextSliderValues(e);
+
+ dialog_hudpanel_main_settings(me, panelname);
+ me.TR(me);
+
+ me.TD(me, 1, 1.9, e = makeXonoticButton(_("Center panel"), '0 0 0'));
+ e.onClick = Compass_CenterPanel;
+ e.onClickEntity = me;
+ me.TDempty(me, 0.2);
+ me.TD(me, 1, 1.9, e = makeXonoticButton(_("Reset colors"), '0 0 0'));
+ e.onClick = Compass_ColorReset;
+ e.onClickEntity = me;
+ me.TR(me);
+
+ me.TD(me, 1, 0.9, e = makeXonoticTextLabel(0, _("North:")));
+ me.TDempty(me, 0.2);
+ me.TD(me, 1, 0.9, e = makeXonoticTextLabel(0, _("South:")));
+ me.TDempty(me, 0.2);
+ me.TD(me, 1, 0.9, e = makeXonoticTextLabel(0, _("West:")));
+ me.TDempty(me, 0.2);
+ me.TD(me, 1, 0.9, e = makeXonoticTextLabel(0, _("East:")));
+ me.TR(me);
+ me.TD(me, 2, 0.9, e = makeXonoticColorpickerString("hud_panel_compass_north_color", "hud_panel_compass_north_color"));
+ me.TDempty(me, 0.2);
+ me.TD(me, 2, 0.9, e = makeXonoticColorpickerString("hud_panel_compass_south_color", "hud_panel_compass_south_color"));
+ me.TDempty(me, 0.2);
+ me.TD(me, 2, 0.9, e = makeXonoticColorpickerString("hud_panel_compass_west_color", "hud_panel_compass_west_color"));
+ me.TDempty(me, 0.2);
+ me.TD(me, 2, 0.9, e = makeXonoticColorpickerString("hud_panel_compass_east_color", "hud_panel_compass_east_color"));
+ me.TR(me);
+ me.TR(me);
+ me.TD(me, 1, 4, e = makeXonoticTextLabel(0, _("Transparency:")));
+ me.TR(me);
+ me.TD(me, 1, 4, e = makeXonoticSlider(0, 1, 0.1, "hud_panel_compass_quarter_alpha"));
+ me.TR(me);
+
+ me.TD(me, 1, 4, e = makeXonoticTextLabel(0, _("Arrow:")));
+ me.TR(me);
+ me.TD(me, 1, 1.9, e = makeXonoticTextLabel(0, _("Normal:")));
+ me.TDempty(me, 0.2);
+ me.TD(me, 1, 1.9, e = makeXonoticTextLabel(0, _("Snap:")));
+ me.TR(me);
+ me.TD(me, 2, 1.9, e = makeXonoticColorpickerString("hud_panel_compass_arrow_color", "hud_panel_compass_arrow_color"));
+ me.TDempty(me, 0.2);
+ me.TD(me, 2, 1.9, e = makeXonoticColorpickerString("hud_panel_compass_arrow_snap_color", "hud_panel_compass_arrow_snap_color"));
+ me.TR(me);
+ me.TR(me);
+ me.TD(me, 1, 1.9, e = makeXonoticTextLabel(0, _("Transparency:")));
+ me.TDempty(me, 0.2);
+ me.TD(me, 1, 1.9, e = makeXonoticTextLabel(0, _("Size:")));
+ me.TR(me);
+ me.TD(me, 1, 1.9, e = makeXonoticSlider(0, 1, 0.1, "hud_panel_compass_arrow_alpha"));
+ me.TDempty(me, 0.2);
+ me.TD(me, 1, 1.9, e = makeXonoticSlider(0.1, 0.75, 0.05, "hud_panel_compass_arrow_size"));
+ me.TR(me);
+
+ me.TD(me, 1, 4, e = makeXonoticTextLabel(0, _("Orienting lines:")));
+ me.TR(me);
+ me.TD(me, 2, 4, e = makeXonoticColorpickerString("hud_panel_compass_line_color", "hud_panel_compass_line_color"));
+ me.TR(me);
+ me.TR(me);
+ me.TD(me, 1, 1.9, e = makeXonoticTextLabel(0, _("Transparency:")));
+ me.TDempty(me, 0.2);
+ me.TD(me, 1, 1.9, e = makeXonoticTextLabel(0, _("Size:")));
+ me.TR(me);
+ me.TD(me, 1, 1.9, e = makeXonoticSlider(0, 1, 0.1, "hud_panel_compass_line_alpha"));
+ me.TDempty(me, 0.2);
+ me.TD(me, 1, 1.9, e = makeXonoticSlider(0.1, 0.75, 0.05, "hud_panel_compass_line_size"));
+}
--- /dev/null
+#pragma once
+
+#include "rootdialog.qh"
+CLASS(XonoticHUDCompassDialog, XonoticRootDialog)
+ METHOD(XonoticHUDCompassDialog, fill, void(entity));
+ ATTRIB(XonoticHUDCompassDialog, title, string, _("Compass Panel"));
+ ATTRIB(XonoticHUDCompassDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT);
+ ATTRIB(XonoticHUDCompassDialog, intendedWidth, float, 0.4);
+ ATTRIB(XonoticHUDCompassDialog, rows, float, 26.5);
+ ATTRIB(XonoticHUDCompassDialog, columns, float, 4);
+ ATTRIB(XonoticHUDCompassDialog, name, string, "HUDcompass");
+ ATTRIB(XonoticHUDCompassDialog, requiresConnection, float, true);
+ENDCLASS(XonoticHUDCompassDialog)
#include "dialog_hudpanel_itemstime.qh"
#include "dialog_hudpanel_quickmenu.qh"
#include "dialog_hudpanel_strafehud.qh"
+#include "dialog_hudpanel_compass.qh"
#include "dialog_settings_input_userbind.qh"
#include "dialog_settings_bindings_reset.qh"
i.configureDialog(i);
me.addItemRightCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+ i = NEW(XonoticHUDCompassDialog);
+ i.configureDialog(i);
+ me.addItemRightCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+
// dialogs used by settings
me.userbindEditDialog = i = NEW(XonoticUserbindEditDialog);
i.configureDialog(i);