27 HUD_Write_Cvar(
"hud_panel_physics_acceleration_progressbar_scale");
28 HUD_Write_Cvar(
"hud_panel_physics_acceleration_progressbar_nonlinear");
74 float accel_progressbar_scale = 0;
89 speed2d =
floor(max_speed * 0.65 + 0.5);
94 speed2d =
floor(
vlen(
vec2(strafevelocity)) * conversion_factor + 0.5);
128 vector speed_offset =
'0 0 0', accel_offset =
'0 0 0';
146 int speed_baralign, accel_baralign;
148 accel_baralign = speed_baralign = 1;
150 accel_baralign = speed_baralign = 2;
164 vector tmp_offset =
'0 0 0', tmp_size =
'0 0 0';
165 float speed_size = 0.75;
166 int text_bits =
BITS(0);
187 bool onground = real_onground && !jumpheld;
192 && ((all_slick && real_onground) || real_onslick)
199 vector speed_text_color =
'1 1 1';
207 float accel_pixels_drawn = accel / accel_max * accel_progressbar_scale *
panel_size.x;
211 if (accel_pixels_drawn > 1)
213 else if (accel_pixels_drawn < -1)
219 float jump_speed_f = 0;
241 jump_speed_f = time_frac > 1 ? 0 :
cos(time_frac *
M_PI_2);
248 float top_speed_f = 0;
271 top_speed_f = time_frac > 1 ? 0 :
cos(time_frac *
M_PI_2);
282 vector peak_size =
'0 0 0';
283 if (speed_baralign == 0)
285 else if (speed_baralign == 1)
291 if (speed_baralign == 2)
307 const int acc_decimals = 2;
327 tmp_offset.x = speed_baralign ?
panel_size.x * (1 - speed_size) : 0;
328 tmp_offset.y = (
panel_size.y - tmp_size.y) * 0.5;
346 float f = accel / accel_max;
350 if (accel_progressbar_scale)
354 if (accel_baralign == 1)
356 else if (accel_baralign == 2 || accel_baralign == 3)
357 tmp_offset.x = (
panel_size.x - tmp_size.x) * 0.5;
365 tmp_offset =
'0 0 0';
379 tmp_offset.y = (
panel_size.y - tmp_size.y) * 0.5;
384 tmp_offset.x = speed_baralign ? 0 :
panel_size.x * speed_size;
385 float top_speed_y = 0, jump_speed_y = 0, main_text_size;
388 if ((text_bits &
BIT(2)) && text_bits !=
BITS(3))
390 if (text_bits ==
BIT(2))
392 main_text_size = 1 - 0.8;
393 tmp_offset.y =
panel_size.y * main_text_size * 0.5;
397 main_text_size = 0.6;
399 top_speed_y =
panel_size.y * (1 - main_text_size);
400 jump_speed_y = top_speed_y;
402 tmp_size.y =
panel_size.y * (1 - main_text_size) * text_scale;
403 tmp_offset.y += (
panel_size.y * (1 - main_text_size) - tmp_size.y) * 0.5;
406 else if (text_bits ==
BIT(0) || text_bits ==
BIT(1))
408 main_text_size = 0.8;
409 top_speed_y =
panel_size.y * (1 - main_text_size) * 0.5;
410 jump_speed_y = top_speed_y;
414 main_text_size = 0.5;
415 top_speed_y =
panel_size.y * (1 - main_text_size);
420 tmp_size.y =
panel_size.y * main_text_size * text_scale;
421 if ((text_bits &
BIT(1)) && jump_speed_f > 0)
423 jump_speed_y += (
panel_size.y * main_text_size - tmp_size.y) * 0.5;
424 tmp_offset.y = jump_speed_y;
428 if ((text_bits &
BIT(0)) && top_speed_f > 0)
430 top_speed_y += (
panel_size.y * main_text_size - tmp_size.y) * 0.5;
431 tmp_offset.y = top_speed_y;
#define MUTATOR_CALLHOOK(id,...)
#define BIT(n)
Only ever assign into the first 24 bits in QC (so max is BIT(23)).
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
void drawstring_aspect(vector pos, string text, vector sz, vector color, float theAlpha, float drawflag)
#define draw_beginBoldFont()
#define drawfill(position, size, rgb, alpha, flag)
#define draw_endBoldFont()
float physics_update_time
void HUD_Physics_Export(int fh)
bool autocvar_hud_panel_physics_acceleration_vertical
int autocvar_hud_panel_physics_acceleration_progressbar_mode
bool autocvar_hud_panel_physics
const int PHYSICS_BARALIGN_CENTER
float autocvar_hud_panel_physics_acceleration_max
bool autocvar_hud_panel_physics_speed_colored
bool autocvar_hud_panel_physics_acceleration_progressbar_nonlinear
float autocvar_hud_panel_physics_update_interval
const int PHYSICS_TEXT_SPEED
float autocvar_hud_panel_physics_text_scale
int autocvar_hud_panel_physics_force_layout
float autocvar_hud_panel_physics_speed_max
const int PHYSICS_LAYOUT_HORIZONTAL
const int PHYSICS_TEXT_BOTH
float autocvar_hud_panel_physics_acceleration_max_slick
bool autocvar_hud_panel_physics_dynamichud
int autocvar_hud_panel_physics_progressbar
const int PHYSICS_BARALIGN_RIGHT
vector autocvar_hud_progressbar_acceleration_neg_color
const int PHYSICS_PROGRESSBAR_SPEED
float autocvar_hud_panel_physics_acceleration_movingaverage
const int PHYSICS_LAYOUT_VERTICAL
int autocvar_hud_panel_physics_text
bool autocvar_hud_panel_physics_speed_vertical
bool autocvar_hud_panel_physics_jumpspeed
vector autocvar_hud_progressbar_speed_color
const int PHYSICS_BARALIGN_ONLY_LEFT
const int PHYSICS_BARALIGN_ONLY_RIGHT
const int PHYSICS_TEXT_ACCEL
const int PHYSICS_PROGRESSBAR_ACCEL
float autocvar_hud_panel_physics_topspeed_time
bool autocvar_hud_panel_physics_topspeed
float autocvar_hud_panel_physics_acceleration_progressbar_scale
const int PHYSICS_PROGRESSBAR_BOTH
vector autocvar_hud_progressbar_acceleration_color
bool autocvar_hud_panel_physics_flip
bool autocvar_hud_panel_physics_speed_unit_show
int autocvar_hud_panel_physics_baralign
float autocvar_hud_panel_physics_jumpspeed_time
entity StrafeHUD_GetStrafeplayer(bool is_local)
bool StrafeHUD_DetermineOnSlick(entity e)
bool StrafeHUD_DetermineJumpHeld(entity e, int keys, bool is_local)
bool StrafeHUD_DetermineOnGround(entity e, bool is_local)
string GetSpeedUnit(int speed_unit)
float GetSpeedUnitFactor(int speed_unit)
int spectatee_status
the -1 disables HUD panels before CSQC receives necessary data
#define PHYS_SLICKACCELERATE(s)
#define PHYS_ACCELERATE(s)
const float DRAWFLAG_NORMAL
void HUD_Panel_DrawProgressBar(vector theOrigin, vector theSize, string pic, float length_ratio, bool vertical, float baralign, vector theColor, float theAlpha, int drawflag)
void HUD_Panel_LoadCvars()
float autocvar_hud_progressbar_alpha
int autocvar_hud_speed_unit
#define HUD_Panel_DrawBg()
#define HUD_Write_Cvar(cvar)
bool autocvar__hud_configure
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))
ERASEABLE string ftos_decimals(float number, int decimals)
converts a number to a string with the indicated number of decimals