From: Juhu <5894800-Juhu_@users.noreply.gitlab.com> Date: Sat, 27 Mar 2021 08:15:38 +0000 (+0100) Subject: strafehud: draw direction caps after slick detector so that the slick indicators... X-Git-Tag: xonotic-v0.8.6~136^2~44 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b521c022a4292c1796d16daf99f206f29241f11c;p=xonotic%2Fxonotic-data.pk3dir.git strafehud: draw direction caps after slick detector so that the slick indicators don't cover up the direction caps --- diff --git a/qcsrc/client/hud/panel/strafehud.qc b/qcsrc/client/hud/panel/strafehud.qc index 64ff1c7a5..619731987 100644 --- a/qcsrc/client/hud/panel/strafehud.qc +++ b/qcsrc/client/hud/panel/strafehud.qc @@ -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