From 2763ff5c06acb964099bca55ffaaa33688b72933 Mon Sep 17 00:00:00 2001 From: Juhu <5894800-Juhu_@users.noreply.gitlab.com> Date: Mon, 22 Mar 2021 14:28:39 +0100 Subject: [PATCH] Add patch from Juhu/strafehud-fixes branch: "strafehud: improve angle indicator style cvar usage" --- _hud_common.cfg | 2 +- qcsrc/client/hud/panel/strafehud.qc | 8 ++++---- qcsrc/client/hud/panel/strafehud.qh | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/_hud_common.cfg b/_hud_common.cfg index 2d833ea69..42fcb1be5 100644 --- a/_hud_common.cfg +++ b/_hud_common.cfg @@ -145,7 +145,7 @@ seta hud_panel_strafehud_bar_accel_color "0 1 0" "color of the strafe meter acce seta hud_panel_strafehud_bar_accel_alpha "0.3" "opacity of the strafe meter acceleration zone" seta hud_panel_strafehud_bar_overturn_color "1 0 1" "color of the strafe meter overturn zone" seta hud_panel_strafehud_bar_overturn_alpha "0.3" "opacity of the strafe meter overturn zone" -seta hud_panel_strafehud_angle_style "2" "set the angle indicator style: 0 = solid line, 1 = dashed line, 2 = none" +seta hud_panel_strafehud_angle_style "0" "set the angle indicator style: 0 = none, 1 = solid line, 2 = dashed line" seta hud_panel_strafehud_angle_dashes "4" "determines the amount of dashes if the angle indicator uses a dashed line" seta hud_panel_strafehud_angle_alpha "0.8" "opacity of the indicator showing the player's current angle" seta hud_panel_strafehud_angle_height "1" "height of the indicator showing the player's current angle (relative to the panel height)" diff --git a/qcsrc/client/hud/panel/strafehud.qc b/qcsrc/client/hud/panel/strafehud.qc index fb68f38d0..9bcaf56e5 100644 --- a/qcsrc/client/hud/panel/strafehud.qc +++ b/qcsrc/client/hud/panel/strafehud.qc @@ -712,19 +712,19 @@ void HUD_StrafeHUD() { switch(autocvar_hud_panel_strafehud_angle_style) { - case 0: + case 1: drawfill(panel_pos - eY * ((currentangle_size.y - panel_size.y) / 2) + eX * (currentangle_offset - currentangle_size.x/2), currentangle_size, currentangle_color, autocvar_hud_panel_strafehud_angle_alpha * panel_fg_alpha, DRAWFLAG_NORMAL); break; - case 1: + case 2: vector line_size = currentangle_size; - line_size.y = currentangle_size.y / (bound(2, autocvar_hud_panel_strafehud_angle_dashes, 100)*2-1); + line_size.y = currentangle_size.y / (bound(2, autocvar_hud_panel_strafehud_angle_dashes, currentangle_size.y)*2-1); for(float i = 0; i < currentangle_size.y; i += line_size.y*2) { if(i + line_size.y*2 >= currentangle_size.y) line_size.y = currentangle_size.y - i; drawfill(panel_pos - eY * ((currentangle_size.y - panel_size.y) / 2 - i) + eX * (currentangle_offset - line_size.x/2), line_size, currentangle_color, autocvar_hud_panel_strafehud_angle_alpha * panel_fg_alpha, DRAWFLAG_NORMAL); } break; - case 2: + case 0: default: } diff --git a/qcsrc/client/hud/panel/strafehud.qh b/qcsrc/client/hud/panel/strafehud.qh index 4fa3af339..edaa61e96 100644 --- a/qcsrc/client/hud/panel/strafehud.qh +++ b/qcsrc/client/hud/panel/strafehud.qh @@ -15,7 +15,7 @@ AUTOCVAR_SAVE(hud_panel_strafehud_bar_accel_color, vector, '0 1 0', "color of th AUTOCVAR_SAVE(hud_panel_strafehud_bar_accel_alpha, float, 0.3, "opacity of the strafe meter acceleration zone"); AUTOCVAR_SAVE(hud_panel_strafehud_bar_overturn_color, vector, '1 0 1', "color of the strafe meter overturn zone"); AUTOCVAR_SAVE(hud_panel_strafehud_bar_overturn_alpha, float, 0.3, "opacity of the strafe meter overturn zone"); -AUTOCVAR_SAVE(hud_panel_strafehud_angle_style, int, 2, "set the angle indicator style: 0 = solid line, 1 = dashed line, 2 = none"); +AUTOCVAR_SAVE(hud_panel_strafehud_angle_style, int, 0, "set the angle indicator style: 0 = none, 1 = solid line, 2 = dashed line"); AUTOCVAR_SAVE(hud_panel_strafehud_angle_dashes, int, 4, "determines the amount of dashes if the angle indicator uses a dashed line"); AUTOCVAR_SAVE(hud_panel_strafehud_angle_alpha, float, 0.8, "opacity of the indicator showing the player's current angle"); AUTOCVAR_SAVE(hud_panel_strafehud_angle_height, float, 1, "height of the indicator showing the player's current angle (relative to the panel height)"); -- 2.39.2