seta _hud_panel_strafehud_demo "0" "strafehud changes angle during configure"
seta hud_panel_strafehud_mode "0" "strafehud mode which controls whether the strafehud is centered at 0 = view angle, 1 = velocity angle"
seta hud_panel_strafehud_range "90" "the angle range up to 360 degrees displayed on the strafehud, -1 = current fov, 0 = dynamic (chooses the minimum range required to still see the whole area needed for accelerating)"
-seta hud_panel_strafehud_range_sidestrafe "-1" "the angle range up to 360 degrees displayed on the strafehud when side strafing, 0 = dynamic (chooses the minimum range required to still see the whole area needed for accelerating), -1 = same as the normal range"
+seta hud_panel_strafehud_range_sidestrafe "-2" "the angle range up to 360 degrees displayed on the strafehud when side strafing, 0 = dynamic (chooses the minimum range required to still see the whole area needed for accelerating), -1 = current fov, -2 = same as the normal range"
seta hud_panel_strafehud_style "2" "0 = no styling, 1 = progress bar style for the strafe bar, 2 = gradient for the strafe bar, 3 = fast gradient for the strafe bar (requires linear projection mode)"
seta hud_panel_strafehud_unit_show "1" "show units"
seta hud_panel_strafehud_onground_mode "2" "handling of landing at speeds where friction is higher than optimal acceleration, 0 = fill the whole hud with overturn, 1 = show zones regardless, 2 = show the zones as if airborne (useful for quake2 and quake3 physics)"
bool autocvar_hud_panel_strafehud_dynamichud = true;
int autocvar_hud_panel_strafehud_mode = 0;
float autocvar_hud_panel_strafehud_range = 90;
-float autocvar_hud_panel_strafehud_range_sidestrafe = -1;
+float autocvar_hud_panel_strafehud_range_sidestrafe = -2;
int autocvar_hud_panel_strafehud_style = 2;
bool autocvar_hud_panel_strafehud_unit_show = true;
int autocvar_hud_panel_strafehud_onground_mode = 2;
float range_side = autocvar_hud_panel_strafehud_range_sidestrafe;
float range_used;
- if(isnan(range_normal) || isnan(range_side)) return 0;
-
- if(range_normal == 0)
- range_normal = autocvar__hud_configure ? 90 : range_minangle; // use minimum angle required if dynamically setting hud angle
- else if(range_normal < 0)
- {
- float hfov = getproperty(VF_FOVX);
- if(isnan(hfov)) hfov = 0;
-
+ float hfov = getproperty(VF_FOVX);
+ if(isnan(range_normal) || isnan(range_side) || isnan(hfov)) return 360;
+
+ // negative values enable different behaviour
+ // no exact matching so that all negative values are caught
+ if(range_normal == 0) // range = 0, use minimum angle required if dynamically setting hud angle
+ range_normal = autocvar__hud_configure ? 90 : range_minangle;
+ else if(range_normal < 0) // range = -1, use the current field of view
range_normal = hfov;
- }
- if(range_side == -1) // use the normal range
+
+ if(range_side < -1) // range = -2, use the normal range
range_used = range_normal;
else
{
- if(range_side == 0)
+ if(range_side == 0) // range = 0, use minimum angle required if dynamically setting hud angle
range_side = autocvar__hud_configure ? 90 : range_minangle;
+ else if(range_side < 0) // range = -1, use the current field of view
+ range_side = hfov;
+
range_used = GeomLerp(range_normal, strafity, range_side);
}
float hudangle = bound(0, fabs(range_used), 360); // limit HUD range to 360 degrees, higher values don't make sense