vector Scoreboard_AccuracyStats_Draw(vector pos, vector rgb, vector bg_size)
{
scoreboard_acc_fade_alpha = min(scoreboard_fade_alpha, scoreboard_acc_fade_alpha + frametime * 10);
- vector initial_pos = pos;
WepSet weapons_stat = WepSet_GetFromStat();
WepSet weapons_inmap = WepSet_GetFromStat_InMap();
panel_size.x += panel_bg_padding * 2; // restore initial width
- if (scoreboard_acc_fade_alpha == 1)
- return end_pos;
- return initial_pos + (end_pos - initial_pos) * scoreboard_acc_fade_alpha;
+ return end_pos;
}
.bool uninteresting;
vector Scoreboard_ItemStats_Draw(vector pos, vector rgb, vector bg_size)
{
scoreboard_itemstats_fade_alpha = min(scoreboard_fade_alpha, scoreboard_itemstats_fade_alpha + frametime * 10);
- vector initial_pos = pos;
int disowned_cnt = 0;
int uninteresting_cnt = 0;
panel_size.x += panel_bg_padding * 2; // restore initial width
- if (scoreboard_itemstats_fade_alpha == 1)
- return end_pos;
- return initial_pos + (end_pos - initial_pos) * scoreboard_itemstats_fade_alpha;
+ return end_pos;
}
vector MapStats_DrawKeyValue(vector pos, string key, string value) {
Scoreboard_UpdatePlayerTeams();
+ float initial_pos_y = panel_pos.y;
vector pos = panel_pos;
entity pl, tm;
string str;
drawcolorcodedstring(pos + '0.5 0 0' * (panel_size.x - stringwidth(str, true, hud_fontsize)), str, hud_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL);
}
- scoreboard_bottom = pos.y + 2 * hud_fontsize.y;
+ pos.y += 2 * hud_fontsize.y;
+ if (scoreboard_fade_alpha < 1)
+ scoreboard_bottom = initial_pos_y + (pos.y - initial_pos_y) * scoreboard_fade_alpha;
+ else if (pos.y != scoreboard_bottom)
+ {
+ if (pos.y > scoreboard_bottom)
+ scoreboard_bottom = min(pos.y, scoreboard_bottom + frametime * 10 * (pos.y - initial_pos_y));
+ else
+ scoreboard_bottom = max(pos.y, scoreboard_bottom - frametime * 10 * (pos.y - initial_pos_y));
+ }
}