]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
strafehud: make overturn area size a variable again to prepare for dynamic overturn...
authorJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Mon, 2 Sep 2024 17:33:10 +0000 (19:33 +0200)
committerJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Mon, 2 Sep 2024 17:39:31 +0000 (19:39 +0200)
qcsrc/client/hud/panel/strafehud/core.qc

index ebf0875a8ccb3ecd3d3157b2ade1b09b41480e3a..a5ea087a3092409d1f19bdd4d633904c785e104e 100644 (file)
@@ -54,7 +54,8 @@ void StrafeHUD_DrawStrafeMeter(
                accelzone_offsetangle = 90 - absolute_bestangle;
 
                float neutral_startangle;
-               float neutral_endangle = 180 - accelzone_offsetangle * 2 - preaccelzone_offsetangle * 2;
+               float overturn_offsetangle = 180;
+               float neutral_endangle = 360 - accelzone_offsetangle * 2 - preaccelzone_offsetangle * 2 - overturn_offsetangle;
 
                {
                        float current_offsetangle = 0;
@@ -65,7 +66,7 @@ void StrafeHUD_DrawStrafeMeter(
                        current_offsetangle += accelzone_offsetangle;
 
                        overturn_startangle = current_offsetangle;
-                       current_offsetangle += 180; // overturning area spans 180°
+                       current_offsetangle += overturn_offsetangle;
 
                        accelzone_left_startangle = current_offsetangle;
                        current_offsetangle += accelzone_offsetangle;
@@ -124,7 +125,7 @@ void StrafeHUD_DrawStrafeMeter(
                //   acceleration decreases at 90 degrees but speed loss happens a little bit after 90 degrees,
                //   however due to sv_airstopaccelerate that's hard to calculate
                HUD_Panel_drawStrafeHUD(
-                       overturn_startangle, 180, // overturning area spans 180°
+                       overturn_startangle, overturn_offsetangle,
                        autocvar_hud_panel_strafehud_bar_overturn_color,
                        autocvar_hud_panel_strafehud_bar_overturn_alpha * panel_fg_alpha,
                        autocvar_hud_panel_strafehud_style, STRAFEHUD_GRADIENT_BOTH,