seta hud_panel_strafehud_switch "1" "set to \"1\" to enable the strafe angle indicator showing the angle to move to when changing side"
seta hud_panel_strafehud_switch_minspeed "-1" "minimum speed in qu/s at which angle indicator(s) 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 strafe angle indicators for changing strafe direction"
-seta hud_panel_strafehud_switch_alpha "1" "opacity of the strafe angle indicators for changing strafe direction"
-seta hud_panel_strafehud_switch_width "0.003" "width of the strafe angle indicators for changing strafe direction (relative to the strafe bar width)"
+seta hud_panel_strafehud_switch_alpha "0.5" "opacity of the strafe angle indicators for changing strafe direction"
seta hud_panel_strafehud_direction "0" "set to \"1\" to enable the direction caps to see in which direction you are currently strafing"
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"
{
bool angle_indicator_visible = false;
+ // minimum speed for change indicators
+ float minspeed = autocvar_hud_panel_strafehud_switch_minspeed;
+ if(minspeed < 0)
+ minspeed = bestspeed + frictionspeed;
+
+ // only draw change indicators if minspeed is reached
+ if(autocvar_hud_panel_strafehud_switch && speed >= minspeed)
+ {
+ // draw the change indicator(s)
+ float current_changeangle = opposite_direction ? opposite_changeangle : changeangle;
+ float opposite_changeangle = opposite_direction ? opposite_bestangle : bestangle;
+
+ StrafeHUD_DrawAngleIndicator(
+ current_changeangle, currentangle_size, arrow_size, num_dashes,
+ has_top_arrow, has_bottom_arrow, autocvar_hud_panel_strafehud_switch_color,
+ autocvar_hud_panel_strafehud_switch_alpha, hudangle);
+
+ if(direction == STRAFEHUD_DIRECTION_NONE)
+ {
+ StrafeHUD_DrawAngleIndicator(
+ opposite_changeangle, currentangle_size, arrow_size, num_dashes,
+ has_top_arrow, has_bottom_arrow, autocvar_hud_panel_strafehud_switch_color,
+ autocvar_hud_panel_strafehud_switch_alpha, hudangle);
+ }
+
+ if(autocvar_hud_panel_strafehud_switch_alpha > 0)
+ angle_indicator_visible = true;
+ }
+
if(autocvar_hud_panel_strafehud_bestangle && direction != STRAFEHUD_DIRECTION_NONE)
{
float ghostangle = opposite_direction ? opposite_bestangle : bestangle;
bool autocvar_hud_panel_strafehud_switch = true;
float autocvar_hud_panel_strafehud_switch_minspeed = -1;
vector autocvar_hud_panel_strafehud_switch_color = '1 1 0';
-float autocvar_hud_panel_strafehud_switch_alpha = 1;
-float autocvar_hud_panel_strafehud_switch_width = 0.003;
+float autocvar_hud_panel_strafehud_switch_alpha = 0.5;
bool autocvar_hud_panel_strafehud_direction = false;
vector autocvar_hud_panel_strafehud_direction_color = '0 0.5 1';
float autocvar_hud_panel_strafehud_direction_alpha = 1;
autocvar_hud_panel_strafehud_bar_neutral_alpha * panel_fg_alpha,
autocvar_hud_panel_strafehud_style, STRAFEHUD_GRADIENT_NONE,
true, hudangle);
-
- float minspeed = autocvar_hud_panel_strafehud_switch_minspeed;
- if(minspeed < 0)
- minspeed = bestspeed + frictionspeed;
-
- // only draw indicators if minspeed is reached
- if(autocvar_hud_panel_strafehud_switch && speed >= minspeed && autocvar_hud_panel_strafehud_switch_alpha > 0)
- {
- // draw the change indicator(s)
- float offsetangle = opposite_direction ? opposite_changeangle : changeangle;
- float opposite_offsetangle = opposite_direction ? opposite_bestangle : bestangle;
-
- float bestangle_width = max(panel_size.x * autocvar_hud_panel_strafehud_switch_width, 1);
- bestangle_width = StrafeHUD_widthToAngle(bestangle_width, hudangle);
-
- // remove change indicator width from offset
- if(direction == STRAFEHUD_DIRECTION_LEFT)
- {
- if(!opposite_direction)
- opposite_offsetangle -= bestangle_width;
- else
- offsetangle -= bestangle_width;
- }
- else
- {
- if(!opposite_direction)
- offsetangle -= bestangle_width;
- else
- opposite_offsetangle -= bestangle_width;
- }
-
- StrafeHUD_drawStrafeHUD(
- offsetangle, bestangle_width,
- autocvar_hud_panel_strafehud_switch_color,
- autocvar_hud_panel_strafehud_switch_alpha * panel_fg_alpha,
- STRAFEHUD_STYLE_DRAWFILL, STRAFEHUD_GRADIENT_NONE,
- false, hudangle);
-
- if(direction == STRAFEHUD_DIRECTION_NONE)
- StrafeHUD_drawStrafeHUD(
- opposite_offsetangle, bestangle_width,
- autocvar_hud_panel_strafehud_switch_color,
- autocvar_hud_panel_strafehud_switch_alpha * panel_fg_alpha,
- STRAFEHUD_STYLE_DRAWFILL, STRAFEHUD_GRADIENT_NONE,
- false, hudangle);
- }
}
}
return StrafeHUD_angleToWidth(angle, range) + panel_size.x / 2;
}
-float StrafeHUD_widthToAngle(float offset, float range)
-{
- return offset / panel_size.x * range;
-}
-
float StrafeHUD_project(float ratio, float range, bool reverse)
{
range *= DEG2RAD / 2;
float StrafeHUD_projectWidth(float, float, float);
float StrafeHUD_angleToWidth(float, float);
float StrafeHUD_angleToOffset(float, float);
-float StrafeHUD_widthToAngle(float, float);
float DetectWaterLevel(entity);
float DetectFrameTime();
float DetectWishAngle(vector, int, bool);