From 131c40c914c01835f7f5e5c94e3e8d8a7a1d90d9 Mon Sep 17 00:00:00 2001 From: Juhu <5894800-Juhu_@users.noreply.gitlab.com> Date: Mon, 22 Mar 2021 14:21:44 +0100 Subject: [PATCH] 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 30f1adc28..1538a9541 100644 --- a/qcsrc/client/hud/panel/strafehud.qc +++ b/qcsrc/client/hud/panel/strafehud.qc @@ -702,19 +702,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 bd8272531..31005dc63 100644 --- a/qcsrc/client/hud/panel/strafehud.qh +++ b/qcsrc/client/hud/panel/strafehud.qh @@ -15,7 +15,7 @@ vector autocvar_hud_panel_strafehud_bar_accel_color = '0 1 0'; float autocvar_hud_panel_strafehud_bar_accel_alpha = 0.3; vector autocvar_hud_panel_strafehud_bar_overturn_color = '1 0 1'; float autocvar_hud_panel_strafehud_bar_overturn_alpha = 0.3; -int autocvar_hud_panel_strafehud_angle_style = 2; +int autocvar_hud_panel_strafehud_angle_style = 0; int autocvar_hud_panel_strafehud_angle_dashes = 4; float autocvar_hud_panel_strafehud_angle_alpha = 0.8; float autocvar_hud_panel_strafehud_angle_height = 1; -- 2.39.2