]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
strafehud: draw direction caps after slick detector so that the slick indicators...
authorJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Sat, 27 Mar 2021 08:15:38 +0000 (09:15 +0100)
committerJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Sat, 27 Mar 2021 08:15:38 +0000 (09:15 +0100)
qcsrc/client/hud/panel/strafehud.qc

index 64ff1c7a538f95a6d15779d7b166d3c2ec3498ab..619731987142da0c5f3a6a604d167ff7c9c9d970 100644 (file)
@@ -604,24 +604,6 @@ void HUD_StrafeHUD()
             // draw neutral zone
             HUD_Panel_DrawStrafeHUD(neutral_offset, neutral_width, autocvar_hud_panel_strafehud_bar_neutral_color, autocvar_hud_panel_strafehud_bar_neutral_alpha * panel_fg_alpha, autocvar_hud_panel_strafehud_style, 0);
 
-            if(direction != 0 && direction_size_vertical.x > 0 && autocvar_hud_panel_strafehud_direction_alpha * panel_fg_alpha > 0)
-            {
-                bool indicator_direction = direction < 0;
-                // invert left/right when strafing backwards or when strafing towards the opposite side indicated by the direction variable
-                // if both conditions are true then it's inverted twice hence not inverted at all
-                if(!fwd != odd_angles)
-                {
-                    indicator_direction = !indicator_direction;
-                }
-                // draw the direction indicator caps at the sides of the hud
-                // vertical line
-                if(direction_size_vertical.y > 0) drawfill(panel_pos - eY * direction_size_horizontal.y + eX * (indicator_direction ? -direction_size_vertical.x : panel_size.x), direction_size_vertical, autocvar_hud_panel_strafehud_direction_color, autocvar_hud_panel_strafehud_direction_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
-                // top horizontal line
-                drawfill(panel_pos + eX * (indicator_direction ? 0 : panel_size.x - direction_size_horizontal.x) - eY * direction_size_horizontal.y, direction_size_horizontal, autocvar_hud_panel_strafehud_direction_color, autocvar_hud_panel_strafehud_direction_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
-                // bottom horizontal line
-                drawfill(panel_pos + eX * (indicator_direction ? 0 : panel_size.x - direction_size_horizontal.x) + eY * panel_size.y, direction_size_horizontal, autocvar_hud_panel_strafehud_direction_color, autocvar_hud_panel_strafehud_direction_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
-            }
-
             if(speed >= minspeed && bestangle_width > 0) // only draw indicators if minspeed is reached
             {
                 // draw the switch indicator(s)
@@ -704,6 +686,24 @@ void HUD_StrafeHUD()
             }
         }
 
+        if(direction != 0 && direction_size_vertical.x > 0 && autocvar_hud_panel_strafehud_direction_alpha * panel_fg_alpha > 0)
+        {
+            bool indicator_direction = direction < 0;
+            // invert left/right when strafing backwards or when strafing towards the opposite side indicated by the direction variable
+            // if both conditions are true then it's inverted twice hence not inverted at all
+            if(!fwd != odd_angles)
+            {
+                indicator_direction = !indicator_direction;
+            }
+            // draw the direction indicator caps at the sides of the hud
+            // vertical line
+            if(direction_size_vertical.y > 0) drawfill(panel_pos - eY * direction_size_horizontal.y + eX * (indicator_direction ? -direction_size_vertical.x : panel_size.x), direction_size_vertical, autocvar_hud_panel_strafehud_direction_color, autocvar_hud_panel_strafehud_direction_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+            // top horizontal line
+            drawfill(panel_pos + eX * (indicator_direction ? 0 : panel_size.x - direction_size_horizontal.x) - eY * direction_size_horizontal.y, direction_size_horizontal, autocvar_hud_panel_strafehud_direction_color, autocvar_hud_panel_strafehud_direction_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+            // bottom horizontal line
+            drawfill(panel_pos + eX * (indicator_direction ? 0 : panel_size.x - direction_size_horizontal.x) + eY * panel_size.y, direction_size_horizontal, autocvar_hud_panel_strafehud_direction_color, autocvar_hud_panel_strafehud_direction_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+        }
+
         if(speed < ((movespeed - maxaccel) + antiflicker_speed) && !immobile)
         {
             bestangle_anywhere = true; // moving forward should suffice to gain speed