}
#endif
+#ifdef CSQC
+int autocvar_hud_panel_itemstime = 2;
+float autocvar_hud_panel_itemstime_dynamicsize = 1;
+float autocvar_hud_panel_itemstime_ratio = 2;
+int autocvar_hud_panel_itemstime_iconalign;
+bool autocvar_hud_panel_itemstime_progressbar = 0;
+float autocvar_hud_panel_itemstime_progressbar_maxtime = 30;
+string autocvar_hud_panel_itemstime_progressbar_name = "progressbar";
+float autocvar_hud_panel_itemstime_progressbar_reduced;
+bool autocvar_hud_panel_itemstime_hidespawned = 1;
+bool autocvar_hud_panel_itemstime_hidelarge = false;
+int autocvar_hud_panel_itemstime_text = 1;
+#define hud_panel_itemstime_hidelarge autocvar_hud_panel_itemstime_hidelarge
+#endif
+
#ifdef SVQC
+#define hud_panel_itemstime_hidelarge false
+#endif
-bool Item_ItemsTime_Allow(entity e)
+bool Item_ItemsTime_Allow(GameItem it, WepSet _weapons)
{
- GameItem it = e.itemdef;
- return (false
- || it.instanceOfPowerup
- || it == ITEM_ArmorMega || it == ITEM_ArmorLarge
- || it == ITEM_HealthMega || it == ITEM_HealthLarge
- || (e.weapons & WEPSET_SUPERWEAPONS)
- );
+ return (false
+ || it.instanceOfPowerup
+ || it == ITEM_ArmorMega || (it == ITEM_ArmorLarge && !hud_panel_itemstime_hidelarge)
+ || it == ITEM_HealthMega || (it == ITEM_HealthLarge && !hud_panel_itemstime_hidelarge)
+ || (_weapons & WEPSET_SUPERWEAPONS)
+ );
}
+#ifdef SVQC
+
float it_times[MAX_ITEMS];
void Item_ItemsTime_Init()
ItemsTime_time[ITEM_Shield.m_id] = time + 4;
}
- float i;
- float count = 0;
+ int count = 0;
if (autocvar_hud_panel_itemstime_hidespawned == 1)
- for (i = 0; i < MAX_ITEMS; ++i)
+ FOREACH(ITEMS, Item_ItemsTime_Allow(it, '0 0 0'), LAMBDA(
count += (ItemsTime_time[i] > time || -ItemsTime_time[i] > time);
+ ));
else if (autocvar_hud_panel_itemstime_hidespawned == 2)
- for (i = 0; i < MAX_ITEMS; ++i)
+ FOREACH(ITEMS, Item_ItemsTime_Allow(it, '0 0 0'), LAMBDA(
count += (ItemsTime_time[i] > time);
+ ));
else
- for (i = 0; i < MAX_ITEMS; ++i)
+ FOREACH(ITEMS, Item_ItemsTime_Allow(it, '0 0 0'), LAMBDA(
count += (ItemsTime_time[i] != -1);
+ ));
if (count == 0)
return;
float row = 0, column = 0;
bool item_available;
- FOREACH(ITEMS, ItemsTime_time[i] != -1, LAMBDA(
+ FOREACH(ITEMS, Item_ItemsTime_Allow(it, '0 0 0') && ItemsTime_time[i] != -1, LAMBDA(
float item_time = ItemsTime_time[i];
if (item_time < -1)
{