]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
strafehud: remove direction (fwd/bkwd) timeout, it's not useful
authorJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Mon, 22 Mar 2021 15:57:35 +0000 (16:57 +0100)
committerJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Mon, 22 Mar 2021 15:57:35 +0000 (16:57 +0100)
_hud_common.cfg
qcsrc/client/hud/panel/strafehud.qc
qcsrc/client/hud/panel/strafehud.qh

index a144d154605fe5e868ee4b0305c2cb290c4ce68b..009cd5c85a796fba2136c0cb69fb440d7a09f3fa 100644 (file)
@@ -179,7 +179,6 @@ seta hud_panel_strafehud_jumpheight_size "1.5" "size of the jump height text (re
 seta hud_panel_strafehud_timeout_air "0.1" "time (in seconds) after take off before changing to air strafe physics when not jumping (visually more consistent hud while on slick downwards ramps)"
 seta hud_panel_strafehud_timeout_ground "0.03333333" "time (in seconds) after landing before changing to non-air strafe physics (visually more consistent hud while strafe turning when touching the floor after every hop)"
 seta hud_panel_strafehud_timeout_turn "0.1" "time (in seconds) after releasing the strafe keys before changing mode (visually more consistent hud while switching between left/right strafe turning)"
-seta hud_panel_strafehud_timeout_direction "0.5" "time (in seconds) it takes until direction changes (forward or backward movement) are applied (set to zero if you intend to sideways strafe)"
 seta hud_panel_strafehud_antiflicker_angle "0.01" "how many degrees from 0° to 180° the hud ignores if it could cause visual disturbances otherwise (and to counter rounding errors)"
 seta hud_panel_strafehud_antiflicker_speed "0.0001" "how many qu/s the hud ignores if it could cause visual disturbances otherwise (and to counter rounding errors)"
 
index 61383a4e8fe279dfcec21bef20d60c669b3c1a0b..6441ffff92d2f1ce77fd42435db023ace5a828ec 100644 (file)
@@ -33,9 +33,6 @@ bool turn = false;
 float turnangle;
 float turnspeed;
 bool fwd = true;
-bool state_fwd = true;
-bool state_fwd_prev = true;
-float state_fwd_time = 0;
 float starttime = 0;
 float startspeed = -1;
 float jumptime = 0;
@@ -361,15 +358,15 @@ void HUD_StrafeHUD()
                 {
                     if(keys_fwd > 0)
                     {
-                        state_fwd = true;
+                        fwd = true;
                     }
                     else if(keys_fwd < 0)
                     {
-                        state_fwd = false;
+                        fwd = false;
                     }
                     else
                     {
-                        state_fwd = fabs(angle) <= 90;
+                        fwd = fabs(angle) <= 90;
                     }
                 }
                 // otherwise determine by examining the strafe angle
@@ -377,25 +374,14 @@ void HUD_StrafeHUD()
                 {
                     if(wishangle < 0) // detect direction using wishangle since the direction is not yet set
                     {
-                        state_fwd = angle <= -wishangle;
+                        fwd = angle <= -wishangle;
                     }
                     else
                     {
-                        state_fwd = angle >= -wishangle;
+                        fwd = angle >= -wishangle;
                     }
                 }
 
-                if(state_fwd_prev != state_fwd)
-                {
-                    state_fwd_time = time;
-                }
-                state_fwd_prev = state_fwd;
-
-                if((time - state_fwd_time) >= autocvar_hud_panel_strafehud_timeout_direction || speed < movespeed || ((fabs(wishangle) == 90) && mode == 0)) // timeout when changing between forwards and backwards movement
-                {
-                    fwd = state_fwd;
-                }
-
                 // shift the strafe angle by 180° when strafing backwards
                 if(!fwd)
                 {
index dcde312d776e8b778dda566d4f1b924a880c5584..07424da574124c04e2aac4bda312ad35a2f51e53 100644 (file)
@@ -49,7 +49,6 @@ float autocvar_hud_panel_strafehud_jumpheight_size = 1.5;
 float autocvar_hud_panel_strafehud_timeout_air = 0.1;
 float autocvar_hud_panel_strafehud_timeout_ground = 0.03333333;
 float autocvar_hud_panel_strafehud_timeout_turn = 0.1;
-float autocvar_hud_panel_strafehud_timeout_direction = 0.5;
 float autocvar_hud_panel_strafehud_antiflicker_angle = 0.01;
 float autocvar_hud_panel_strafehud_antiflicker_speed = 0.0001;