seta hud_panel_strafehud_vangle "0" "set to \"1\" to enable the vertical angle indicator"
seta hud_panel_strafehud_vangle_color "0.75 0.75 0.75" "color of the vertical angle text"
seta hud_panel_strafehud_vangle_size "1" "size of the vertical angle text (relative to the panel height)"
+seta hud_panel_strafehud_strafeefficiency "0" "set to \"1\" to enable the strafe efficiency indicator"
+seta hud_panel_strafehud_strafeefficiency_size "1" "size of the strafe efficiency text (relative to the panel height)"
seta hud_panel_strafehud_projection "0" "strafehud projection mode, \"0\" = linear, \"1\" = perspective, \"2\" = panoramic"
// hud panel aliases
}
// draw the actual strafe angle
+ float strafe_ratio = 0;
if(!immobile)
{
float moveangle = fabs(angle + wishangle);
- float strafe_ratio = 0;
// player is overturning
if(moveangle >= 90)
}
}
+ // strafe efficiency
+ {
+ if(autocvar_hud_panel_strafehud_strafeefficiency)
+ {
+ float strafeeff_height = autocvar_hud_panel_strafehud_strafeefficiency_size * panel_size.y;
+ string strafeeff_text = strcat(ftos_decimals(strafe_ratio * 100, 2), "%");
+ vector strafeeff_color = '1 1 1' - (strafe_ratio > 0 ? '1 0 1' : '0 1 1') * fabs(strafe_ratio);
+
+ bool was_drawn = StrafeHUD_drawTextIndicator(
+ strafeeff_text, strafeeff_height,
+ strafeeff_color, 1,
+ time, text_offset_top, STRAFEHUD_TEXT_TOP);
+
+ if(was_drawn)
+ text_offset_top += strafeeff_height;
+ }
+ }
+
// show height achieved by a single jump
// FIXME: checking z position differences is unreliable (warpzones, teleporter, kill, etc) but using velocity to calculate jump height would be
// inaccurate in hud code (possibly different tick rate than physics, doesn't run when hud isn't drawn, rounding errors)
bool autocvar_hud_panel_strafehud_vangle = false;
vector autocvar_hud_panel_strafehud_vangle_color = '0.75 0.75 0.75';
float autocvar_hud_panel_strafehud_vangle_size = 1;
+bool autocvar_hud_panel_strafehud_strafeefficiency = false;
+float autocvar_hud_panel_strafehud_strafeefficiency_size = 1;
int autocvar_hud_panel_strafehud_projection = 0;
void HUD_Panel_DrawStrafeHUD(float, float, float, vector, float, int, int, bool, float);