]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add patch from Juhu/strafehud-fixes branch: "strafehud: rework the switch indicator...
authorJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Mon, 22 Mar 2021 14:11:13 +0000 (15:11 +0100)
committerJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Mon, 22 Mar 2021 14:11:13 +0000 (15:11 +0100)
_hud_common.cfg
qcsrc/client/hud/panel/strafehud.qc
qcsrc/client/hud/panel/strafehud.qh

index 42fcb1be5d7111344cf7ec5ab8a77beb5283a03a..e243f01cd7ae622975c77d4fb48bc3127b0b1453 100644 (file)
@@ -156,11 +156,9 @@ seta hud_panel_strafehud_angle_overturn_color "1 0 1" "color of the indicator sh
 seta hud_panel_strafehud_angle_arrow "1" "set the angle indicators arrow style: 0 = none, 1 = top, 2 = bottom, 3 = both"
 seta hud_panel_strafehud_angle_arrow_height "0.5" "height of the arrow (relative to the panel height)"
 seta hud_panel_strafehud_angle_arrow_width "0.03" "width of the arrow (relative to the panel width)"
-seta hud_panel_strafehud_switch_minspeed "-1" "minimum speed in qu/s at which switch indicators which are used to aid changing strafe direction will be shown (uses physics maxspeed + antiflicker speed if negative)"
-seta hud_panel_strafehud_switch_active_color "0 1 0" "color of the switch indicator on the current side"
-seta hud_panel_strafehud_switch_active_alpha "1" "opacity of the switch indicator on the current side"
-seta hud_panel_strafehud_switch_inactive_color "1 1 0" "color of the switch indicator on the opposite side"
-seta hud_panel_strafehud_switch_inactive_alpha "1" "opacity of the switch indicator on the opposite side"
+seta hud_panel_strafehud_switch_minspeed "-1" "minimum speed in qu/s at which switch indicators which are used to aid changing strafe direction will be shown (set to -1 for dynamic minspeed)"
+seta hud_panel_strafehud_switch_color "1 1 0" "color of the switch indicator"
+seta hud_panel_strafehud_switch_alpha "1" "opacity of the switch indicator"
 seta hud_panel_strafehud_switch_width "0.0075" "width of the strafe angle indicators (relative to the strafe bar width)"
 seta hud_panel_strafehud_direction_color "0 0.5 1" "color of the direction caps which indicate the direction the player is currently strafing towards"
 seta hud_panel_strafehud_direction_alpha "1" "opacity of the direction caps which indicate the direction the player is currently strafing towards"
index 9bcaf56e5e462e9c1dd91402a61ba511d863c8a2..d47427281228aac8570b6b14c8cebfb3fd6c71ce 100644 (file)
@@ -590,15 +590,11 @@ void HUD_StrafeHUD()
 
             if(speed >= minspeed) // only draw indicators if minspeed is reached
             {
-                // draw best angles for acceleration
+                // draw the switch indicator(s)
                 float offset = !odd_angles ? bestangle_offset : odd_bestangle_offset;
                 float switch_offset = !odd_angles ? switch_bestangle_offset : switch_odd_bestangle_offset;
-                // both indicators are inactive if no direction can be determined
-                vector switch_color = direction != 0 ? autocvar_hud_panel_strafehud_switch_active_color : autocvar_hud_panel_strafehud_switch_inactive_color;
-                float switch_alpha = direction != 0 ? autocvar_hud_panel_strafehud_switch_active_alpha : autocvar_hud_panel_strafehud_switch_inactive_alpha;
-                // draw the switch indicators
-                HUD_Panel_DrawStrafeHUD(switch_offset, bestangle_width, autocvar_hud_panel_strafehud_switch_inactive_color, autocvar_hud_panel_strafehud_switch_inactive_alpha * panel_fg_alpha, 0, 0);
-                HUD_Panel_DrawStrafeHUD(offset, bestangle_width, switch_color, switch_alpha * panel_fg_alpha, 0, 0);
+                HUD_Panel_DrawStrafeHUD(switch_offset, bestangle_width, autocvar_hud_panel_strafehud_switch_color, autocvar_hud_panel_strafehud_switch_alpha * panel_fg_alpha, 0, 0);
+                if(direction == 0) HUD_Panel_DrawStrafeHUD(offset, bestangle_width, autocvar_hud_panel_strafehud_switch_color, autocvar_hud_panel_strafehud_switch_alpha * panel_fg_alpha, 0, 0);
             }
         }
 
index edaa61e9659b5b0ace89018549622ee40e575942..754d12147426c44605d55e464ece43e2db53bc05 100644 (file)
@@ -27,10 +27,8 @@ AUTOCVAR_SAVE(hud_panel_strafehud_angle_arrow, int, 1, "set the angle indicators
 AUTOCVAR_SAVE(hud_panel_strafehud_angle_arrow_height, float, 0.5, "height of the arrow (relative to the panel height)");
 AUTOCVAR_SAVE(hud_panel_strafehud_angle_arrow_width, float, 0.03, "width of the arrow (relative to the panel width)");
 AUTOCVAR_SAVE(hud_panel_strafehud_switch_minspeed, float, -1, "minimum speed in qu/s at which switch indicators which are used to aid changing strafe direction will be shown (uses physics maxspeed + antiflicker speed if negative)");
-AUTOCVAR_SAVE(hud_panel_strafehud_switch_active_color, vector, '0 1 0', "color of the switch indicator on the current side");
-AUTOCVAR_SAVE(hud_panel_strafehud_switch_active_alpha, float, 1, "opacity of the switch indicator on the current side");
-AUTOCVAR_SAVE(hud_panel_strafehud_switch_inactive_color, vector, '1 1 0', "color of the switch indicator on the opposite side");
-AUTOCVAR_SAVE(hud_panel_strafehud_switch_inactive_alpha, float, 1, "opacity of the switch indicator on the opposite side");
+AUTOCVAR_SAVE(hud_panel_strafehud_switch_color, vector, '1 1 0', "color of the switch indicator");
+AUTOCVAR_SAVE(hud_panel_strafehud_switch_alpha, float, 1, "opacity of the switch indicator");
 AUTOCVAR_SAVE(hud_panel_strafehud_switch_width, float, 0.0075, "width of the strafe angle indicators (relative to the strafe bar width)");
 AUTOCVAR_SAVE(hud_panel_strafehud_direction_color, vector, '0 0.5 1', "color of the direction caps which indicate the direction the player is currently strafing towards");
 AUTOCVAR_SAVE(hud_panel_strafehud_direction_alpha, float, 1, "opacity of the direction caps which indicate the direction the player is currently strafing towards");