From: Juhu <5894800-Juhu_@users.noreply.gitlab.com> Date: Sun, 6 Oct 2024 12:23:34 +0000 (+0200) Subject: strafehud: renamed indicator line related cvars, more consistent now that arrows... X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=5791b98da05920373a9db72bd6462c9cc23f8d33;p=xonotic%2Fxonotic-data.pk3dir.git strafehud: renamed indicator line related cvars, more consistent now that arrows can also be configured the line style and dashes cvar are now merged into a single cvar --- diff --git a/_hud_common.cfg b/_hud_common.cfg index a26769440..903dae8d9 100644 --- a/_hud_common.cfg +++ b/_hud_common.cfg @@ -182,15 +182,14 @@ seta hud_panel_strafehud_bar_accel_color "0 1 0" "color of the strafe meter acce seta hud_panel_strafehud_bar_accel_alpha "0.5" "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.5" "opacity of the strafe meter overturn zone" -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)" -seta hud_panel_strafehud_angle_width "0.001" "width of the indicator showing the player's current angle (relative to the panel width)" seta hud_panel_strafehud_angle_preaccel_color "0 1 1" "color of the indicator showing the player's current angle if it is within the pre-acceleration zone" seta hud_panel_strafehud_angle_neutral_color "1 1 0" "color of the indicator showing the player's current angle if it is within the neutral zone" seta hud_panel_strafehud_angle_accel_color "0 1 1" "color of the indicator showing the player's current angle if it is within the acceleration zone" seta hud_panel_strafehud_angle_overturn_color "1 0 1" "color of the indicator showing the player's current angle if it is within the overturn zone" +seta hud_panel_strafehud_angle_line "0" "defines the number of dashes of the angle indicator's line: set to 0 to disable or 1 for a solid line" +seta hud_panel_strafehud_angle_line_width "0.001" "width of the indicator's line showing the player's current angle (relative to the panel width)" +seta hud_panel_strafehud_angle_line_height "1" "height of the indicator's line showing the player's current angle (relative to the panel height)" seta hud_panel_strafehud_angle_arrow "1" "set the angle indicator's arrow style: 0 = none, 1 = top, 2 = bottom, 3 = both" seta hud_panel_strafehud_angle_arrow_size "0.5" "size of the arrow (relative to the panel height)" seta hud_panel_strafehud_bestangle "1" "set to 1 to enable a ghost angle indicator showing the best angle to gain maximum acceleration, 2 = only when side strafing" diff --git a/qcsrc/client/hud/panel/strafehud.qc b/qcsrc/client/hud/panel/strafehud.qc index 45a8fb319..f27d399bb 100644 --- a/qcsrc/client/hud/panel/strafehud.qc +++ b/qcsrc/client/hud/panel/strafehud.qc @@ -594,26 +594,11 @@ void HUD_StrafeHUD() // current angle size calculation vector currentangle_size; - currentangle_size.x = max(panel_size.x * min(autocvar_hud_panel_strafehud_angle_width, 10), 1); - currentangle_size.y = max(panel_size.y * min(autocvar_hud_panel_strafehud_angle_height, 10), 1); + currentangle_size.x = max(panel_size.x * min(autocvar_hud_panel_strafehud_angle_line_width, 10), 1); + currentangle_size.y = max(panel_size.y * min(autocvar_hud_panel_strafehud_angle_line_height, 10), 1); currentangle_size.z = 0; - float num_dashes = nearbyint(autocvar_hud_panel_strafehud_angle_dashes); - - // adjust angle indicator line depending on style - switch(autocvar_hud_panel_strafehud_angle_style) - { - case STRAFEHUD_INDICATOR_DASHED: - break; - case STRAFEHUD_INDICATOR_SOLID: - num_dashes = 1; - break; - case STRAFEHUD_INDICATOR_NONE: - default: - num_dashes = 0; - break; - } - + float num_dashes = nearbyint(autocvar_hud_panel_strafehud_angle_line); bool has_top_arrow = autocvar_hud_panel_strafehud_angle_arrow == 1 || autocvar_hud_panel_strafehud_angle_arrow >= 3; bool has_bottom_arrow = autocvar_hud_panel_strafehud_angle_arrow >= 2; diff --git a/qcsrc/client/hud/panel/strafehud.qh b/qcsrc/client/hud/panel/strafehud.qh index bfc25ad79..59fe90dc4 100644 --- a/qcsrc/client/hud/panel/strafehud.qh +++ b/qcsrc/client/hud/panel/strafehud.qh @@ -24,15 +24,14 @@ vector autocvar_hud_panel_strafehud_bar_accel_color = '0 1 0'; float autocvar_hud_panel_strafehud_bar_accel_alpha = 0.5; vector autocvar_hud_panel_strafehud_bar_overturn_color = '1 0 1'; float autocvar_hud_panel_strafehud_bar_overturn_alpha = 0.5; -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; -float autocvar_hud_panel_strafehud_angle_width = 0.001; vector autocvar_hud_panel_strafehud_angle_preaccel_color = '0 1 1'; vector autocvar_hud_panel_strafehud_angle_neutral_color = '1 1 0'; vector autocvar_hud_panel_strafehud_angle_accel_color = '0 1 1'; vector autocvar_hud_panel_strafehud_angle_overturn_color = '1 0 1'; +int autocvar_hud_panel_strafehud_angle_line = 0; +float autocvar_hud_panel_strafehud_angle_line_width = 0.001; +float autocvar_hud_panel_strafehud_angle_line_height = 1; int autocvar_hud_panel_strafehud_angle_arrow = 1; float autocvar_hud_panel_strafehud_angle_arrow_size = 0.5; int autocvar_hud_panel_strafehud_bestangle = 1; @@ -129,10 +128,6 @@ const int STRAFEHUD_GRADIENT_LEFT = 1; const int STRAFEHUD_GRADIENT_RIGHT = 2; const int STRAFEHUD_GRADIENT_BOTH = 3; -const int STRAFEHUD_INDICATOR_NONE = 0; -const int STRAFEHUD_INDICATOR_SOLID = 1; -const int STRAFEHUD_INDICATOR_DASHED = 2; - const int STRAFEHUD_PROJECTION_LINEAR = 0; const int STRAFEHUD_PROJECTION_PERSPECTIVE = 1; const int STRAFEHUD_PROJECTION_PANORAMIC = 2;