]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
strafehud: improve angle indicator style cvar usage
authorJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Mon, 22 Mar 2021 13:21:44 +0000 (14:21 +0100)
committerJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Mon, 22 Mar 2021 13:25:47 +0000 (14:25 +0100)
_hud_common.cfg
qcsrc/client/hud/panel/strafehud.qc
qcsrc/client/hud/panel/strafehud.qh

index 2d833ea6938cbb0bde5e51f16e4e59c541345a02..42fcb1be5d7111344cf7ec5ab8a77beb5283a03a 100644 (file)
@@ -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)"
index 30f1adc28b0b73c62e7027ad136a609e23f0d1cc..1538a9541a8fcdd7233ea12253079554a487a1d2 100644 (file)
@@ -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:
             }
 
index bd827253180e533674ecc555a71351d3b16e15c0..31005dc6337d4ba04640d07c7a999865c70ff01c 100644 (file)
@@ -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;