]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Item stats panel: show items in default order (ammo, armor, health, superweapons...
authorterencehill <piuntn@gmail.com>
Sat, 24 Oct 2020 08:59:22 +0000 (10:59 +0200)
committerterencehill <piuntn@gmail.com>
Sat, 24 Oct 2020 09:04:27 +0000 (11:04 +0200)
qcsrc/client/hud/panel/scoreboard.qc
qcsrc/common/items/all.qh

index c7adc69d49fc3d313c85515863fadddbd029b92d..0afb9574b021888660f3c8d126c426bec3868206 100644 (file)
@@ -1387,7 +1387,7 @@ vector Scoreboard_ItemStats_Draw(vector pos, vector rgb, vector bg_size)
        vector tmpos = pos;
 
        int column = 0;
-       FOREACH(Items, true, {
+       IL_EACH(default_order_items, true, {
                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;
index 359c0017955794bade60ea96a9565ed2edf5c009..7134a9947b674aa1d2b6573ba598d9bfd969bef7 100644 (file)
@@ -12,6 +12,17 @@ REGISTRY_DEPENDS(Items, Models)
 REGISTER_REGISTRY(Items)
 #define REGISTER_ITEM(id, class) REGISTER(Items, ITEM, id, m_id, NEW(class))
 
+#ifdef CSQC
+IntrusiveList default_order_items;
+STATIC_INIT(default_order_items)
+{
+       default_order_items = IL_NEW();
+       FOREACH(Items, true, {
+               IL_PUSH(default_order_items, it);
+       });
+}
+#endif
+
 REGISTRY_SORT(Items)
 REGISTRY_CHECK(Items)