#include "../common/constants.qh"
#include "../common/counting.qh"
#include "../common/mapinfo.qh"
+#include "../common/minigames/cl_minigames.qh"
#include "../common/stats.qh"
#include "../common/teams.qh"
#include "../common/util.qh"
#define HUD_DefaultColumnLayout() \
"ping pl name | " \
"-teams,race,lms/kills +ft,tdm/kills -teams,lms/deaths +ft,tdm/deaths -teams,lms,race,ka/suicides +ft,tdm/suicides -race,dm,tdm,ka,ft/frags " /* tdm already has this in "score" */ \
-"+ctf/caps +ctf/pickups +ctf/fckills +ctf/returns " \
+"+ctf/caps +ctf/pickups +ctf/fckills +ctf/returns +ons/caps +ons/takes " \
"+lms/lives +lms/rank " \
"+kh/caps +kh/pushes +kh/destroyed " \
"?+race/laps ?+race/time ?+race/fastest " \
float HUD_WouldDrawScoreboard() {
if (autocvar__hud_configure)
return 0;
+ else if (HUD_Radar_Clickable())
+ return 0;
else if (scoreboard_showscores)
return 1;
else if (intermission == 1)
return 1;
else if (intermission == 2)
return 0;
- else if (spectatee_status != -1 && getstati(STAT_HEALTH) <= 0 && autocvar_cl_deathscoreboard && gametype != MAPINFO_TYPE_CTS)
+ else if (spectatee_status != -1 && getstati(STAT_HEALTH) <= 0 && autocvar_cl_deathscoreboard && gametype != MAPINFO_TYPE_CTS && !active_minigame)
return 1;
else if (scoreboard_showscores_force)
return 1;
{
WepSet weapons_stat = WepSet_GetFromStat();
WepSet weapons_inmap = WepSet_GetFromStat_InMap();
+ float initial_posx = pos.x;
int i;
float weapon_stats;
int disownedcnt = 0;
rows = 2;
else
rows = 1;
- int count_perrow = rint(weapon_cnt / rows);
+ int columnns = ceil(weapon_cnt / rows);
+
float height = 40;
float fontsize = height * 1/3;
float weapon_height = height * 2/3;
- float weapon_width = sbwidth / weapon_cnt / rows;
- bool g_instagib = false;
+ float weapon_width = sbwidth / columnns / rows;
drawstring(pos, sprintf(_("Accuracy stats (average %d%%)"), average_accuracy), hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
pos.y += 1.25 * hud_fontsize.y + autocvar_scoreboard_border_thickness;
drawborderlines(autocvar_scoreboard_border_thickness, pos, tmp, '0 0 0', scoreboard_alpha_bg * 0.75, DRAWFLAG_NORMAL);
// column highlighting
- for(i = 0; i < count_perrow; ++i)
+ for(i = 0; i < columnns; ++i)
{
if(!(i % 2))
drawfill(pos + '1 0 0' * weapon_width * rows * i, '0 1 0' * height * rows + '1 0 0' * weapon_width * rows, '0 0 0', scoreboard_alpha_bg * 0.2, DRAWFLAG_NORMAL);
if(rows == 2)
pos.x += weapon_width / 2;
- if(switchweapon == WEP_VAPORIZER)
- g_instagib = true; // TODO: real detection for instagib?
-
if(autocvar_scoreboard_accuracy_nocolors)
rgb = '1 1 1';
else
float oldposx = pos.x;
vector tmpos = pos;
- for(i = WEP_FIRST; i <= WEP_LAST; ++i)
+ int column;
+ for(i = WEP_FIRST, column = 0; i <= WEP_LAST; ++i)
{
self = get_weaponinfo(i);
if (!self.weapon)
}
tmpos.x += weapon_width * rows;
pos.x += weapon_width * rows;
- if(rows == 2 && i == count_perrow) {
+ if(rows == 2 && column == columnns - 1) {
tmpos.x = oldposx;
tmpos.y += height;
pos.y += height;
}
+ ++column;
}
if(weapons_with_stats)
average_accuracy = floor((average_accuracy * 100 / weapons_with_stats) + 0.5);
- if(rows == 2)
- pos.x -= weapon_width / 2;
- pos.x -= sbwidth;
pos.y += height;
-
pos.y += 1.25 * hud_fontsize.y;
+ pos.x = initial_posx;
return pos;
}