ATTRIB(Buff, m_prettyName, string, "Buff")
ATTRIB(Buff, m_skin, int, 0)
ATTRIB(Buff, m_sprite, string, "")
+ METHOD(Buff, display, void(entity this, void(string name, string icon) returns))
+ void Buff_display(entity this, void(string name, string icon) returns) {
+ returns(this.m_prettyName, sprintf("/gfx/hud/%s/buff_%s", cvar_string("menu_skin"), this.m_name));
+ }
#ifdef SVQC
METHOD(Buff, m_time, float(entity))
float Buff_m_time(entity this) { return cvar(strcat("g_buffs_", this.netname, "_time")); }
#define TOPICS(X) \
X(NEW(GametypeSource), _("Gametypes"), "gametype_dm") \
X(NEW(ItemSource), _("Items"), "gametype_kh") \
+ X(NEW(BuffSource), _("Buffs"), "gametype_dom") \
X(NEW(MapSource), _("Maps"), "gametype_ctf") \
if (cvar("developer")) X(NEW(DebugSource), _("Debug"), "gametype_ons") \
/**/
int ItemSource_reload(string filter) { return ITEM_COUNT; }
ENDCLASS(ItemSource)
+#include "../../common/buffs.qh"
+CLASS(BuffSource, DataSource)
+ METHOD(BuffSource, getEntry, entity(int, void(string, string)))
+ entity BuffSource_getEntry(int i, void(string, string) returns) {
+ entity e = BUFFS[i];
+ if (returns) e.display(e, returns);
+ return e;
+ }
+ METHOD(BuffSource, reload, int(string))
+ int BuffSource_reload(string filter) { return BUFFS_COUNT; }
+ENDCLASS(BuffSource)
+
CLASS(MapSource, DataSource)
METHOD(MapSource, getEntry, entity(int, void(string, string)))
entity MapSource_getEntry(int i, void(string, string) returns)