seta hud_panel_itemstime 2 "enable this panel, 1 = show when spectating, 2 = even playing in warmup stage"
//seta hud_panel_quickmenu 1 "enable this panel"
//seta hud_panel_scoreboard 1 "enable this panel"
-seta hud_panel_scoreboard_accuracy 1 "show weapon accuracy stats panel on scoreboard; colors can be configured with accuracy_color* cvars"
+seta hud_panel_scoreboard_accuracy 1 "show weapon accuracy stats panel in the scoreboard; colors can be configured with accuracy_color* cvars"
seta hud_panel_scoreboard_ctf_leaderboard 1 "show a capture time rankings leaderboard in the scoreboard if allowed by the server"
+seta hud_panel_scoreboard_itemstats 1 "show item stats panel in the scoreboard"
seta hud_panel_strafehud 3 "enable this panel, 1 = show if not observing, 2 = show always, 3 = show only in race/cts if not observing"
seta hud_panel_weapons_dynamichud 1 "apply the dynamic hud effects to this panel"
seta hud_panel_scoreboard_spectators_showping 1 "show ping of spectators"
seta hud_panel_scoreboard_spectators_aligned 0 "align spectators in columns"
seta hud_panel_scoreboard_minwidth 0.6 "minimum width of the scoreboard"
+seta hud_panel_scoreboard_team_size_position 0 "where to show the team size (0 = do not show, 1 = left of scoreboard, 2 = right of scoreboard), will move team scores to the other side if necessary"
seta hud_panel_scoreboard_accuracy_showdelay 2 "how long to delay displaying accuracy below the scoreboard if it's too far down"
seta hud_panel_scoreboard_accuracy_showdelay_minpos 0.75 "delay displaying the accuracy panel only if its position is lower than this percentage of the screen height from the top"
+
seta hud_panel_scoreboard_itemstats_filter 1 "filter out less interesting items (ammo and smaller health/armor)"
-seta hud_panel_scoreboard_team_size_position 0 "where to show the team size (0 = do not show, 1 = left of scoreboard, 2 = right of scoreboard), will move team scores to the other side if necessary"
+seta hud_panel_scoreboard_itemstats_showdelay 2.2 "how long to delay displaying item stats below the scoreboard if it's too far down"
+seta hud_panel_scoreboard_itemstats_showdelay_minpos 0.75 "delay displaying the item stats panel only if its position is lower than this percentage of the screen height from the top"
seta _hud_panel_strafehud_demo "0" "strafehud changes angle during configure"
seta hud_panel_strafehud_mode "0" "strafehud mode which controls whether the strafehud is centered at \"0\" = view angle, \"1\" = velocity angle"
float autocvar_hud_panel_scoreboard_accuracy_showdelay = 2;
float autocvar_hud_panel_scoreboard_accuracy_showdelay_minpos = 0.75;
+bool autocvar_hud_panel_scoreboard_itemstats = true;
bool autocvar_hud_panel_scoreboard_itemstats_doublerows = false;
bool autocvar_hud_panel_scoreboard_itemstats_filter = true;
+float autocvar_hud_panel_scoreboard_itemstats_showdelay = 2.2; // slightly more delayed than accuracy
+float autocvar_hud_panel_scoreboard_itemstats_showdelay_minpos = 0.75;
bool autocvar_hud_panel_scoreboard_dynamichud = false;
return true;
}
+bool have_item_stats;
+bool Scoreboard_ItemStats_WouldDraw(float ypos)
+{
+ if (MUTATOR_CALLHOOK(DrawScoreboardItemStats))
+ return false;
+ if (!autocvar_hud_panel_scoreboard_itemstats || warmup_stage || ypos > 0.91 * vid_conheight)
+ return false;
+
+ if (time < scoreboard_time + autocvar_hud_panel_scoreboard_itemstats_showdelay
+ && ypos > autocvar_hud_panel_scoreboard_itemstats_showdelay_minpos * vid_conheight
+ && !intermission)
+ {
+ return false;
+ }
+
+ if (!have_item_stats)
+ {
+ IL_EACH(default_order_items, true, {
+ if (!(autocvar_hud_panel_scoreboard_itemstats_filter && it.uninteresting))
+ {
+ int q = g_inventory.inv_items[it.m_id];
+ //q = 1; // debug: display all items
+ if (q)
+ {
+ have_item_stats = true;
+ break;
+ }
+ }
+ });
+ if (!have_item_stats)
+ return false;
+ }
+
+ return true;
+}
+
void Scoreboard_Draw()
{
if(!autocvar__hud_configure)
if (Scoreboard_AccuracyStats_WouldDraw(pos.y))
pos = Scoreboard_AccuracyStats_Draw(pos, panel_bg_color, bg_size);
- pos = Scoreboard_ItemStats_Draw(pos, panel_bg_color, bg_size);
+ if (Scoreboard_ItemStats_WouldDraw(pos.y))
+ pos = Scoreboard_ItemStats_Draw(pos, panel_bg_color, bg_size);
if(MUTATOR_CALLHOOK(ShowRankings)) {
string ranktitle = M_ARGV(0, string);
/** Return true to not show accuracy stats in the scoreboard */
MUTATOR_HOOKABLE(DrawScoreboardAccuracy, EV_NO_ARGS);
+/** Return true to not show accuracy stats in the scoreboard */
+MUTATOR_HOOKABLE(DrawScoreboardItemStats, EV_NO_ARGS);
+
/** Called when drawing info messages, allows adding new info messages. Return true to hide the standard join message */
#define EV_DrawInfoMessages(i, o) \
/** pos */ i(vector, MUTATOR_ARGV_0_vector) \