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_itemstats_filter 1 "filter out less interesting items (according to hud_panel_scoreboard_itemstats_filter_mask)"
+seta hud_panel_scoreboard_itemstats_filter_mask 12 "[0-1][0-4]: the tens digit filters out all ammo items if set to 1, the units digit filters out health/armor items (1 small, 2 medium too, 3 big too, 4 mega too)"
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"
bool autocvar_hud_panel_scoreboard_itemstats = true;
bool autocvar_hud_panel_scoreboard_itemstats_doublerows = false;
-bool autocvar_hud_panel_scoreboard_itemstats_filter = true;
+int autocvar_hud_panel_scoreboard_itemstats_filter = 1;
+int autocvar_hud_panel_scoreboard_itemstats_filter_mask = 12;
float autocvar_hud_panel_scoreboard_itemstats_showdelay = 2.2; // slightly more delayed than accuracy
float autocvar_hud_panel_scoreboard_itemstats_showdelay_minpos = 0.75;
return end_pos;
}
-.bool uninteresting;
-STATIC_INIT(default_order_items_label)
+bool is_item_filtered(entity it)
{
- IL_EACH(default_order_items, true, {
- if(!(it.instanceOfPowerup
- || it == ITEM_HealthMega || it == ITEM_HealthBig
- || it == ITEM_ArmorMega || it == ITEM_ArmorBig
- ))
+ if (!autocvar_hud_panel_scoreboard_itemstats_filter)
+ return false;
+ int mask = autocvar_hud_panel_scoreboard_itemstats_filter_mask;
+ if (mask <= 0)
+ return false;
+ if (it.instanceOfArmor || it.instanceOfHealth)
+ {
+ int ha_mask = floor(mask) % 10;
+ switch (ha_mask)
{
- it.uninteresting = true;
+ default: return false;
+ case 4: if (it == ITEM_HealthMega || it == ITEM_ArmorMega) return true; // else fallthrough
+ case 3: if (it == ITEM_HealthBig || it == ITEM_ArmorBig) return true; // else fallthrough
+ case 2: if (it == ITEM_HealthMedium || it == ITEM_ArmorMedium) return true; // else fallthrough
+ case 1: if (it == ITEM_HealthSmall || it == ITEM_ArmorSmall) return true; // else fallthrough
}
- });
+ }
+ if (it.instanceOfAmmo)
+ {
+ int ammo_mask = floor(mask / 10) % 10;
+ return (ammo_mask == 1);
+ }
+ return false;
}
vector Scoreboard_ItemStats_Draw(vector pos, vector rgb, vector bg_size)
IL_EACH(default_order_items, true, {
int q = g_inventory.inv_items[it.m_id];
//q = 1; // debug: display all items
- if (autocvar_hud_panel_scoreboard_itemstats_filter && it.uninteresting)
+ if (is_item_filtered(it))
++uninteresting_cnt;
else if (!q)
++disowned_cnt;
vector tmpos = pos;
int column = 0;
- IL_EACH(default_order_items, !(autocvar_hud_panel_scoreboard_itemstats_filter && it.uninteresting), {
+ IL_EACH(default_order_items, !is_item_filtered(it), {
int n = g_inventory.inv_items[it.m_id];
//n = 1 + floor(i * 3 + 4.8) % 7; // debug: display a value for each item
if (n <= 0) continue;
if (!have_item_stats)
{
IL_EACH(default_order_items, true, {
- if (!(autocvar_hud_panel_scoreboard_itemstats_filter && it.uninteresting))
+ if (!is_item_filtered(it))
{
int q = g_inventory.inv_items[it.m_id];
//q = 1; // debug: display all items