From 75588ea04a1abfddb97d511b38841491046704c9 Mon Sep 17 00:00:00 2001 From: Juhu <5894800-Juhu_@users.noreply.gitlab.com> Date: Fri, 2 Apr 2021 20:04:52 +0200 Subject: [PATCH] Revert "Add patch from Juhu/compass branch: "Add compass panel, somewhat a CGaz compass clone"" This reverts commit 1e505f722046be5a3a0242267b951ca2abee81f6. --- _hud_common.cfg | 15 -- _hud_descriptions.cfg | 9 - hud_luma.cfg | 9 - hud_luminos.cfg | 9 - hud_luminos_minimal.cfg | 9 - hud_luminos_minimal_xhair.cfg | 9 - hud_luminos_old.cfg | 9 - hud_nexuiz.cfg | 9 - qcsrc/client/hud/hud.qh | 1 - qcsrc/client/hud/panel/_mod.inc | 1 - qcsrc/client/hud/panel/_mod.qh | 1 - qcsrc/client/hud/panel/compass.qc | 158 ------------------ qcsrc/client/hud/panel/compass.qh | 19 --- qcsrc/client/mutators/events.qh | 3 - qcsrc/common/gamemodes/gamemode/cts/cl_cts.qc | 5 - .../common/gamemodes/gamemode/race/cl_race.qc | 5 - qcsrc/menu/xonotic/_mod.inc | 1 - qcsrc/menu/xonotic/_mod.qh | 1 - qcsrc/menu/xonotic/dialog_hudpanel_compass.qc | 107 ------------ qcsrc/menu/xonotic/dialog_hudpanel_compass.qh | 13 -- qcsrc/menu/xonotic/mainwindow.qc | 5 - 21 files changed, 398 deletions(-) delete mode 100644 qcsrc/client/hud/panel/compass.qc delete mode 100644 qcsrc/client/hud/panel/compass.qh delete mode 100644 qcsrc/menu/xonotic/dialog_hudpanel_compass.qc delete mode 100644 qcsrc/menu/xonotic/dialog_hudpanel_compass.qh diff --git a/_hud_common.cfg b/_hud_common.cfg index 0cfb19c9c..ca6e7fb02 100644 --- a/_hud_common.cfg +++ b/_hud_common.cfg @@ -49,7 +49,6 @@ seta hud_panel_scoreboard_accuracy 1 "show weapon accuracy stats panel in the sc 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" @@ -70,7 +69,6 @@ seta hud_panel_centerprint_dynamichud 1 "apply the dynamic hud effects to t 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" @@ -189,19 +187,6 @@ seta hud_panel_strafehud_timeout_turn "0.1" "time (in seconds) after releasing t 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 ${* ?}" diff --git a/_hud_descriptions.cfg b/_hud_descriptions.cfg index a4a6cd8ba..02d2d5a0f 100644 --- a/_hud_descriptions.cfg +++ b/_hud_descriptions.cfg @@ -389,12 +389,3 @@ seta hud_panel_strafehud_bg_color_team "" "override panel color with team color 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" diff --git a/hud_luma.cfg b/hud_luma.cfg index 2186ced22..9ad2425a7 100644 --- a/hud_luma.cfg +++ b/hud_luma.cfg @@ -391,13 +391,4 @@ seta hud_panel_strafehud_bg_alpha "0.7" 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 diff --git a/hud_luminos.cfg b/hud_luminos.cfg index 328cc5069..c642ac38f 100644 --- a/hud_luminos.cfg +++ b/hud_luminos.cfg @@ -391,13 +391,4 @@ seta hud_panel_strafehud_bg_alpha "" 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 diff --git a/hud_luminos_minimal.cfg b/hud_luminos_minimal.cfg index a170e2c9f..d15dd868a 100644 --- a/hud_luminos_minimal.cfg +++ b/hud_luminos_minimal.cfg @@ -391,13 +391,4 @@ seta hud_panel_strafehud_bg_alpha "" 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 diff --git a/hud_luminos_minimal_xhair.cfg b/hud_luminos_minimal_xhair.cfg index a38895c65..11c57ee48 100644 --- a/hud_luminos_minimal_xhair.cfg +++ b/hud_luminos_minimal_xhair.cfg @@ -391,13 +391,4 @@ seta hud_panel_strafehud_bg_alpha "" 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 diff --git a/hud_luminos_old.cfg b/hud_luminos_old.cfg index 675e5bd5b..42a79015c 100644 --- a/hud_luminos_old.cfg +++ b/hud_luminos_old.cfg @@ -391,13 +391,4 @@ seta hud_panel_strafehud_bg_alpha "" 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 diff --git a/hud_nexuiz.cfg b/hud_nexuiz.cfg index a12289522..9200283c3 100644 --- a/hud_nexuiz.cfg +++ b/hud_nexuiz.cfg @@ -391,13 +391,4 @@ seta hud_panel_strafehud_bg_alpha "" 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 diff --git a/qcsrc/client/hud/hud.qh b/qcsrc/client/hud/hud.qh index b7c3b488d..14e1af0a0 100644 --- a/qcsrc/client/hud/hud.qh +++ b/qcsrc/client/hud/hud.qh @@ -274,7 +274,6 @@ REGISTER_HUD_PANEL(ITEMSTIME, HUD_ItemsTime, PANEL_CONFIG_MAIN | PANE 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: diff --git a/qcsrc/client/hud/panel/_mod.inc b/qcsrc/client/hud/panel/_mod.inc index 17082e0ad..68e368ed1 100644 --- a/qcsrc/client/hud/panel/_mod.inc +++ b/qcsrc/client/hud/panel/_mod.inc @@ -2,7 +2,6 @@ #include #include #include -#include #include #include #include diff --git a/qcsrc/client/hud/panel/_mod.qh b/qcsrc/client/hud/panel/_mod.qh index 62e925c75..1b45f0cd0 100644 --- a/qcsrc/client/hud/panel/_mod.qh +++ b/qcsrc/client/hud/panel/_mod.qh @@ -2,7 +2,6 @@ #include #include #include -#include #include #include #include diff --git a/qcsrc/client/hud/panel/compass.qc b/qcsrc/client/hud/panel/compass.qc deleted file mode 100644 index 14a5ab999..000000000 --- a/qcsrc/client/hud/panel/compass.qc +++ /dev/null @@ -1,158 +0,0 @@ -// Author: Juhu - -#include "compass.qh" - -#include -#include -#include - -// 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(); -} - diff --git a/qcsrc/client/hud/panel/compass.qh b/qcsrc/client/hud/panel/compass.qh deleted file mode 100644 index 16489664d..000000000 --- a/qcsrc/client/hud/panel/compass.qh +++ /dev/null @@ -1,19 +0,0 @@ -#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); diff --git a/qcsrc/client/mutators/events.qh b/qcsrc/client/mutators/events.qh index 55f468f19..6f6f34399 100644 --- a/qcsrc/client/mutators/events.qh +++ b/qcsrc/client/mutators/events.qh @@ -124,9 +124,6 @@ MUTATOR_HOOKABLE(HUD_Physics_showoptional, EV_NO_ARGS); /** 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); diff --git a/qcsrc/common/gamemodes/gamemode/cts/cl_cts.qc b/qcsrc/common/gamemodes/gamemode/cts/cl_cts.qc index 458c457ed..ce095bf20 100644 --- a/qcsrc/common/gamemodes/gamemode/cts/cl_cts.qc +++ b/qcsrc/common/gamemodes/gamemode/cts/cl_cts.qc @@ -14,11 +14,6 @@ MUTATOR_HOOKFUNCTION(cl_cts, HUD_StrafeHUD_showoptional) 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 diff --git a/qcsrc/common/gamemodes/gamemode/race/cl_race.qc b/qcsrc/common/gamemodes/gamemode/race/cl_race.qc index 49a355fa8..4311ce777 100644 --- a/qcsrc/common/gamemodes/gamemode/race/cl_race.qc +++ b/qcsrc/common/gamemodes/gamemode/race/cl_race.qc @@ -161,11 +161,6 @@ MUTATOR_HOOKFUNCTION(cl_race, HUD_StrafeHUD_showoptional) 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 diff --git a/qcsrc/menu/xonotic/_mod.inc b/qcsrc/menu/xonotic/_mod.inc index c4773bacf..0f9a960c9 100644 --- a/qcsrc/menu/xonotic/_mod.inc +++ b/qcsrc/menu/xonotic/_mod.inc @@ -24,7 +24,6 @@ #include #include #include -#include #include #include #include diff --git a/qcsrc/menu/xonotic/_mod.qh b/qcsrc/menu/xonotic/_mod.qh index 99226f816..2bb4ccead 100644 --- a/qcsrc/menu/xonotic/_mod.qh +++ b/qcsrc/menu/xonotic/_mod.qh @@ -24,7 +24,6 @@ #include #include #include -#include #include #include #include diff --git a/qcsrc/menu/xonotic/dialog_hudpanel_compass.qc b/qcsrc/menu/xonotic/dialog_hudpanel_compass.qc deleted file mode 100644 index d4500db6f..000000000 --- a/qcsrc/menu/xonotic/dialog_hudpanel_compass.qc +++ /dev/null @@ -1,107 +0,0 @@ -#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")); -} diff --git a/qcsrc/menu/xonotic/dialog_hudpanel_compass.qh b/qcsrc/menu/xonotic/dialog_hudpanel_compass.qh deleted file mode 100644 index e879fe634..000000000 --- a/qcsrc/menu/xonotic/dialog_hudpanel_compass.qh +++ /dev/null @@ -1,13 +0,0 @@ -#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) diff --git a/qcsrc/menu/xonotic/mainwindow.qc b/qcsrc/menu/xonotic/mainwindow.qc index 4d3ce09ca..89a61fb0d 100644 --- a/qcsrc/menu/xonotic/mainwindow.qc +++ b/qcsrc/menu/xonotic/mainwindow.qc @@ -26,7 +26,6 @@ #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" @@ -196,10 +195,6 @@ void MainWindow_configureMainWindow(entity me) 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); -- 2.39.2