float autocvar_hud_panel_notify_time;
float autocvar_hud_panel_physics;
float autocvar_hud_panel_physics_acceleration_progressbar_mode;
+float autocvar_hud_panel_physics_acceleration_progressbar_scale;
+float autocvar_hud_panel_physics_acceleration_progressbar_nonlinear;
float autocvar_hud_panel_physics_acceleration_max;
float autocvar_hud_panel_physics_progressbar;
float autocvar_hud_panel_physics_acceleration_vertical;
float autocvar_hud_panel_physics_speed_unit_show;
float autocvar_hud_panel_physics_speed_vertical;
float autocvar_hud_panel_physics_text;
+float autocvar_hud_panel_physics_text_scale;
float autocvar_hud_panel_physics_topspeed;
float autocvar_hud_panel_physics_topspeed_time;
float autocvar_hud_panel_powerups;
panel_size -= '2 2 0' * panel_bg_padding;
}
+ float acceleration_progressbar_scale;
+ if(autocvar_hud_panel_physics_progressbar && autocvar_hud_panel_physics_acceleration_progressbar_scale > 1)
+ acceleration_progressbar_scale = autocvar_hud_panel_physics_acceleration_progressbar_scale;
+
+ float text_scale;
+ if (autocvar_hud_panel_physics_text_scale <= 0)
+ text_scale = 1;
+ else
+ text_scale = min(autocvar_hud_panel_physics_text_scale, 1);
+
//compute speed
float speed, conversion_factor;
string unit;
//compute layout
float panel_ar = panel_size_x/panel_size_y;
vector speed_offset, acceleration_offset;
- if (panel_ar >= 5)
+ if (panel_ar >= 5 && !acceleration_progressbar_scale)
{
panel_size_x *= 0.5;
if (autocvar_hud_panel_physics_flip)
if (autocvar_hud_panel_physics_text == 1 || autocvar_hud_panel_physics_text == 2)
{
tmp_size_x = panel_size_x * 0.75;
- tmp_size_y = panel_size_y;
+ tmp_size_y = panel_size_y * text_scale;
if (speed_baralign)
tmp_offset_x = panel_size_x - tmp_size_x;
//else
//tmp_offset_x = 0;
+ tmp_offset_y = (panel_size_y - tmp_size_y) / 2;
drawstring_aspect(panel_pos + speed_offset + tmp_offset, ftos(speed), tmp_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
//draw speed unit
{
//tmp_offset_y = 0;
tmp_size_x = panel_size_x * (1 - 0.75);
- tmp_size_y = panel_size_y * 0.4;
+ tmp_size_y = panel_size_y * 0.4 * text_scale;
+ tmp_offset_y = (panel_size_y * 0.4 - tmp_size_y) / 2;
drawstring_aspect(panel_pos + speed_offset + tmp_offset, unit, tmp_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
}
}
//top speed
tmp_offset_y = panel_size_y * 0.4;
tmp_size_x = panel_size_x * (1 - 0.75);
- tmp_size_y = panel_size_y - tmp_offset_y;
+ tmp_size_y = (panel_size_y - tmp_offset_y) * text_scale;
+ tmp_offset_y += (panel_size_y - tmp_offset_y - tmp_size_y) / 2;
drawstring_aspect(panel_pos + speed_offset + tmp_offset, ftos(top_speed), tmp_size, '1 0 0', f * panel_fg_alpha, DRAWFLAG_NORMAL);
}
else
HUD_Panel_GetProgressBarColor(acceleration_neg);
else
HUD_Panel_GetProgressBarColor(acceleration);
- HUD_Panel_DrawProgressBar(panel_pos + acceleration_offset, panel_size, "accelbar", acceleration/autocvar_hud_panel_physics_acceleration_max, 0, acceleration_baralign, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+
+ f = acceleration/autocvar_hud_panel_physics_acceleration_max;
+ if (autocvar_hud_panel_physics_acceleration_progressbar_nonlinear)
+ f = sqrt(f);
+
+ if (acceleration_progressbar_scale) // allow progressbar to go out of panel bounds
+ {
+ tmp_size = acceleration_progressbar_scale * panel_size_x * eX + panel_size_y * eY;
+
+ if (acceleration_baralign == 1)
+ tmp_offset_x = panel_size_x - tmp_size_x;
+ else if (acceleration_baralign == 2 || acceleration_baralign == 3)
+ tmp_offset_x = (panel_size_x - tmp_size_x) / 2;
+ else
+ tmp_offset_x = 0;
+ tmp_offset_y = 0;
+ }
+ else
+ {
+ tmp_size = panel_size;
+ tmp_offset = '0 0 0';
+ }
+
+ HUD_Panel_DrawProgressBar(panel_pos + acceleration_offset + tmp_offset, tmp_size, "accelbar", f, 0, acceleration_baralign, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
}
+ tmp_size_x = panel_size_x;
+ tmp_size_y = panel_size_y * text_scale;
+ tmp_offset_x = 0;
+ tmp_offset_y = (panel_size_y - tmp_size_y) / 2;
if (autocvar_hud_panel_physics_text == 1 || autocvar_hud_panel_physics_text == 3)
- drawstring_aspect(panel_pos + acceleration_offset, strcat(ftos_decimals(acceleration, 2), "g"), panel_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+ drawstring_aspect(panel_pos + acceleration_offset + tmp_offset, strcat(ftos_decimals(acceleration, 2), "g"), tmp_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
}
// CenterPrint (#16)