// update generic hud functions
HUD_Panel_UpdateCvars();
- draw_beginBoldFont();
-
// figure out weapon order (how the weapons are sorted) // TODO make this configurable
if(weaponorder_bypriority != autocvar_cl_weaponpriority || !weaponorder[0])
{
// might as well commit suicide now, no reason to live ;)
if (weapon_count == 0)
- {
- draw_endBoldFont();
return;
- }
vector old_panel_size = panel_size;
vector padded_panel_size = panel_size - '2 2 0' * panel_bg_padding;
HUD_Panel_DrawBg(1);
if(center.x == -1)
- {
- draw_endBoldFont();
return;
- }
if(panel_bg_padding)
{
}
}
}
-
- draw_endBoldFont();
}
// Ammo (#1)
}
HUD_Panel_UpdateCvars();
+
+ draw_beginBoldFont();
+
vector pos, mySize;
pos = panel_pos;
mySize = panel_size;
HUD_Panel_DrawProgressBar(pos, mySize, "progressbar", fuel/100, is_vertical, fuel_baralign, autocvar_hud_progressbar_fuel_color, panel_fg_alpha * 0.8, DRAWFLAG_NORMAL);
}
}
+
+ draw_endBoldFont();
}
// Notification area (#4)
vector distribution_color;
entity tm, pl, me;
- me = playerslots[player_localentnum - 1];
+ me = playerslots[current_player];
if((scores_flags[ps_primary] & SFL_TIME) && !teamplay) { // race/cts record display on HUD
string timer, distrtimer;
HUD_Panel_UpdateCvars();
- draw_beginBoldFont();
-
vector pos, mySize;
pos = panel_pos;
mySize = panel_size;
if(autocvar__hud_configure)
{
s = "0:13:37";
+ draw_beginBoldFont();
drawstring(pos + eX * 0.5 * mySize.x - '0.5 0 0' * stringwidth(s, false, '0.60 0.60 0' * mySize.y), s, '0.60 0.60 0' * mySize.y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+ draw_endBoldFont();
s = _("^1Intermediate 1 (+15.42)");
drawcolorcodedstring(pos + eX * 0.5 * mySize.x - '0.5 0 0' * stringwidth(s, true, '1 1 0' * 0.20 * mySize.y) + eY * 0.60 * mySize.y, s, '1 1 0' * 0.20 * mySize.y, panel_fg_alpha, DRAWFLAG_NORMAL);
s = sprintf(_("^1PENALTY: %.1f (%s)"), 2, "missing a checkpoint");
}
}
+ draw_beginBoldFont();
+
if(forcetime != "")
{
a = bound(0, (time - race_checkpointtime) / 0.5, 1);
s = TIME_ENCODED_TOSTRING(TIME_ENCODE(time + TIME_DECODE(race_penaltyaccumulator) - race_laptime));
drawstring(pos + eX * 0.5 * mySize.x - '0.5 0 0' * stringwidth(s, false, '0.6 0.6 0' * mySize.y), s, '0.6 0.6 0' * mySize.y, '1 1 1', panel_fg_alpha * a, DRAWFLAG_NORMAL);
}
+
+ draw_endBoldFont();
}
else
{
}
}
}
-
- draw_endBoldFont();
}
// Vote window (#9)
if(spectatee_status == -1)
s = _("^1Observing");
else
- s = sprintf(_("^1Spectating: ^7%s"), GetPlayerName(player_localentnum - 1));
+ s = sprintf(_("^1Spectating: ^7%s"), GetPlayerName(current_player));
drawInfoMessage(s);
if(spectatee_status == -1)
//
vector acc_prevspeed;
float acc_prevtime, acc_avg, top_speed, top_speed_time;
+float physics_update_time, discrete_speed, discrete_acceleration;
void HUD_Physics(void)
{
if(!autocvar__hud_configure)
acc_prevspeed = vel;
acc_prevtime = time;
- f = bound(0, f * 10, 1);
- acc_avg = acc_avg * (1 - f) + acceleration * f;
+ if(autocvar_hud_panel_physics_acceleration_movingaverage)
+ {
+ f = bound(0, f * 10, 1);
+ acc_avg = acc_avg * (1 - f) + acceleration * f;
+ acceleration = acc_avg;
+ }
+ }
+
+ int acc_decimals = 2;
+ if(time > physics_update_time)
+ {
+ // workaround for ftos_decimals returning a negative 0
+ if(discrete_acceleration > -1 / pow(10, acc_decimals) && discrete_acceleration < 0)
+ discrete_acceleration = 0;
+ discrete_acceleration = acceleration;
+ discrete_speed = speed;
+ physics_update_time += autocvar_hud_panel_physics_update_interval;
}
//compute layout
//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);
+ drawstring_aspect(panel_pos + speed_offset + tmp_offset, ftos(discrete_speed), tmp_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
//draw speed unit
if (speed_baralign)
f = acceleration/autocvar_hud_panel_physics_acceleration_max;
if (autocvar_hud_panel_physics_acceleration_progressbar_nonlinear)
- f = sqrt(f);
+ f = (f >= 0 ? sqrt(f) : -sqrt(-f));
if (acceleration_progressbar_scale) // allow progressbar to go out of panel bounds
{
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 + tmp_offset, strcat(ftos_decimals(acceleration, 2), "g"), tmp_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+
+ if(autocvar_hud_panel_physics_text == 1 || autocvar_hud_panel_physics_text == 3)
+ {
+ 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;
+
+ drawstring_aspect(panel_pos + acceleration_offset + tmp_offset, strcat(ftos_decimals(discrete_acceleration, acc_decimals), "g"), tmp_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+ }
draw_endBoldFont();
}
hud_skin_prev = strzone(autocvar_hud_skin);
}
- current_player = player_localentnum;
-
// draw the dock
if(autocvar_hud_dock != "" && autocvar_hud_dock != "0")
{
{
string hud_dock_color = autocvar_hud_dock_color;
if(hud_dock_color == "shirt") {
- f = stof(getplayerkeyvalue(current_player - 1, "colors"));
+ f = stof(getplayerkeyvalue(current_player, "colors"));
color = colormapPaletteColor(floor(f / 16), 0);
}
else if(hud_dock_color == "pants") {
- f = stof(getplayerkeyvalue(current_player - 1, "colors"));
+ f = stof(getplayerkeyvalue(current_player, "colors"));
color = colormapPaletteColor(f % 16, 1);
}
else