]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Guide: remove Powerups from Buffs list
authorterencehill <piuntn@gmail.com>
Sun, 22 Dec 2024 15:10:42 +0000 (16:10 +0100)
committerterencehill <piuntn@gmail.com>
Sun, 22 Dec 2024 15:10:42 +0000 (16:10 +0100)
qcsrc/menu/xonotic/guide/guide.qh

index 64c1767252267f75726bfe4c0d748a59a82daf2a..3f45cbaa218489a1b15284d23918526fd5fd9cff 100644 (file)
@@ -32,13 +32,13 @@ ENDCLASS(DebugSource)
 
 .bool m_hidden;
 
-#define REGISTRY_SOURCE(id, arr) \
+#define _REGISTRY_SOURCE(id, arr, cond) \
 ArrayList arr##_MENU; \
 int arr##_MENU_COUNT; \
 STATIC_INIT_LATE(arr##_MENU) \
 { \
        AL_NEW(arr##_MENU, arr##_MAX, NULL, e); \
-       FOREACH(arr, !it.m_hidden, { \
+       FOREACH(arr, !it.m_hidden && (cond), { \
                AL_sete(arr##_MENU, arr##_MENU_COUNT, it); \
                arr##_MENU_COUNT++; \
        }); \
@@ -53,6 +53,10 @@ CLASS(id, DataSource) \
        METHOD(id, reload, int(id this, string filter)) { return arr##_MENU_COUNT; } \
 ENDCLASS(id)
 
+#define REGISTRY_SOURCE(...) EVAL(OVERLOAD(REGISTRY_SOURCE, __VA_ARGS__))
+#define REGISTRY_SOURCE_2(id, arr) _REGISTRY_SOURCE(id, arr, true)
+#define REGISTRY_SOURCE_3(id, arr, cond) _REGISTRY_SOURCE(id, arr, cond)
+
 REGISTRY_SOURCE(FreetextSource, GuidePages)
 
 #include <common/mapinfo.qh>
@@ -64,8 +68,8 @@ REGISTRY_SOURCE(ItemSource, Items)
 // The descriptions for these are in common/items/item/*.qc and common/mutators/mutator/instagib/items.qc
 
 #include <common/mutators/mutator/buffs/buffs.qh>
-REGISTRY_SOURCE(BuffSource, StatusEffect)
-// The descriptions for these are in common/mutators/mutator/buffs/all.inc and common/mutators/mutator/powerups/powerup/*.qc
+REGISTRY_SOURCE(BuffSource, StatusEffect, it.instanceOfBuff)
+// The descriptions for these are in common/mutators/mutator/buffs/all.inc
 
 #include <common/mutators/mutator/nades/nades.qh>
 REGISTRY_SOURCE(NadeSource, Nades)