/* impulse */ ATTRIB(BallStealer, impulse, int, 0);
/* refname */ ATTRIB(BallStealer, netname, string, "ballstealer");
/* wepname */ ATTRIB(BallStealer, m_name, string, _("Ball Stealer"));
+#ifdef MENUQC
+/* hidden */ ATTRIB(BallStealer, m_hidden, bool, true);
+#endif
ENDCLASS(BallStealer)
REGISTER_WEAPON(NEXBALL, NEW(BallStealer));
#include "monster.qh"
-REGISTER_MONSTER(Null, NEW(Monster));
+CLASS(NullMonster, Monster)
+ ATTRIB(NullMonster, m_hidden, bool, true);
+ENDCLASS(NullMonster)
+REGISTER_MONSTER(Null, NEW(NullMonster));
REGISTRY_DEFINE_GET(Monsters, MON_Null)
}
ENDCLASS(Nade)
-REGISTER_NADE(Null);
+CLASS(NullNade, Nade)
+ ATTRIB(NullNade, m_hidden, bool, true);
+ENDCLASS(NullNade)
+REGISTER(Nades, NADE_TYPE, Null, m_id, NEW(NullNade));
REGISTRY_DEFINE_GET(Nades, NADE_TYPE_Null)
Nade Nade_FromProjectile(int proj)
#ifdef GAMEQC
ATTRIB(Superweapons, m_sound_rm, Sound, SND_POWEROFF);
#endif
+#ifdef MENUQC
+ ATTRIB(Superweapons, m_hidden, bool, true);
+#endif
ENDCLASS(Superweapons)
REGISTER_STATUSEFFECT(Superweapons, NEW(Superweapons));
#define REGISTER_TURRET(id, inst) REGISTER(Turrets, TUR, id, m_id, inst)
-REGISTER_TURRET(Null, NEW(Turret));
+CLASS(NullTurret, Turret)
+ ATTRIB(NullTurret, m_hidden, bool, true);
+ENDCLASS(NullTurret)
+REGISTER_TURRET(Null, NEW(NullTurret));
REGISTRY_DEFINE_GET(Turrets, TUR_Null)
#include "turret/_mod.qh"
#include "cl_vehicles.qh"
#endif
-REGISTER_VEHICLE(Null, NEW(Vehicle));
+CLASS(NullVehicle, Vehicle)
+ ATTRIB(NullVehicle, m_hidden, bool, true);
+ENDCLASS(NullVehicle)
+REGISTER_VEHICLE(Null, NEW(NullVehicle));
REGISTRY_DEFINE_GET(Vehicles, VEH_Null)
#include "vehicle/_mod.qh"
REGISTER_WEAPON_2(id, inst); \
[[alias("WEP_" #id)]] Weapon _wep_##sname
-REGISTER_WEAPON(Null, NEW(Weapon));
+CLASS(NullWeapon, Weapon)
+ ATTRIB(NullWeapon, m_hidden, bool, true);
+ENDCLASS(NullWeapon)
+REGISTER_WEAPON(Null, NEW(NullWeapon));
REGISTRY_DEFINE_GET(Weapons, WEP_Null)
Weapon Weapon_from_name(string s)
#ifdef CSQC
FOREACH(Weapons, true, it.wr_init(it));
#endif
+ #ifdef MENUQC
+ FOREACH(Weapons, (it.spawnflags & WEP_FLAG_HIDDEN) && (it.spawnflags & WEP_FLAG_SPECIALATTACK), it.m_hidden = true); // TODO: should "hidden" weapons like the tuba actually be hidden?
+ #endif
weaponorder_byid = "";
for (int i = REGISTRY_MAX(Weapons) - 1; i >= 1; --i)
if (REGISTRY_GET(Weapons, i))
ENDCLASS(DebugSource)
#define REGISTRY_SOURCE(id, arr) \
+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, { \
+ AL_sete(arr##_MENU, arr##_MENU_COUNT, it); \
+ arr##_MENU_COUNT++; \
+ }); \
+} \
CLASS(id, DataSource) \
METHOD(id, getEntry, entity(id this, int i, void(string, string) returns)) { \
- entity e = _R_GET(_##arr, i); \
+ entity e = AL_gete(arr##_MENU, i); \
if (returns) e.display(e, returns); \
return e; \
} \
- METHOD(id, reload, int(id this, string filter)) { return arr##_COUNT; } \
+ METHOD(id, reload, int(id this, string filter)) { return arr##_MENU_COUNT; } \
ENDCLASS(id)
#include "pages.qh"