Previously they were implemented a bit differently for each class, for some reason.
METHOD(GameItem, describe, string(GameItem this))
{
TC(GameItem, this);
- return SUPER(Object).describe(this);
+ return SUPER(GameItem).describe(this);
}
#endif
METHOD(GameItem, display, void(GameItem this, void(string name, string icon) returns))
METHOD(Gametype, describe, string(Gametype this))
{
TC(Gametype, this);
- return SUPER(Object).describe(this);
+ return SUPER(Gametype).describe(this);
}
#endif
-
METHOD(Gametype, display, void(Gametype this, void(string name, string icon) returns))
{
TC(Gametype, this);
- returns(this.message, strcat("gametype_", this.mdl));
+ returns(this.m_name, this.mdl ? strcat("gametype_", this.mdl) : string_null);
}
METHOD(Gametype, gametype_init, void(Gametype this, string hname, string sname, string g_name, int gflags, string mutators, string defaults, string gdescription))
/** (BOTH?) sets animations for monster */
METHOD(Monster, mr_anim, bool(Monster this, entity actor)) { TC(Monster, this); return false; }
#ifdef MENUQC
- METHOD(Monster, describe, string(Monster this)) { TC(Monster, this); return SUPER(Object).describe(this); }
+ METHOD(Monster, describe, string(Monster this)) {
+ TC(Monster, this);
+ return SUPER(Monster).describe(this);
+ }
#endif
+ METHOD(Monster, display, void(Monster this, void(string name, string icon) returns)) {
+ TC(Monster, this);
+ returns(this.m_name, this.m_icon ? sprintf("/gfx/hud/%s/%s", cvar_string("menu_skin"), this.m_icon) : string_null);
+ }
ENDCLASS(Monster)
ATTRIB(Mutator, mutatorname, string);
ATTRIB(Mutator, mutatorfunc, mutatorfunc_t);
ATTRIB(Mutator, mutatorcheck, bool());
- METHOD(Mutator, describe, string(entity this)) {
+ METHOD(Mutator, describe, string(Mutator this)) {
TC(Mutator, this);
return SUPER(Mutator).describe(this);
}
- METHOD(Mutator, display, void(entity this, void(string name, string icon) returns)) {
- returns(this.m_name, this.m_icon);
+ METHOD(Mutator, display, void(Mutator this, void(string name, string icon) returns)) {
+ TC(Mutator, this);
+ returns(this.m_name, this.m_icon ? sprintf("/gfx/hud/%s/%s", cvar_string("menu_skin"), this.m_icon) : string_null);
}
ENDCLASS(Mutator)
ATTRIB(Buff, m_skin, int, 0);
ATTRIB(Buff, m_lifetime, float, 60);
ATTRIB(Buff, m_sprite, string, "");
- METHOD(Buff, display, void(entity this, void(string name, string icon) returns)) {
- returns(this.m_name, sprintf("/gfx/hud/%s/%s", cvar_string("menu_skin"), this.m_icon));
+ METHOD(Buff, display, void(Buff this, void(string name, string icon) returns)) {
+ TC(Buff, this);
+ returns(this.m_name, this.m_icon ? sprintf("/gfx/hud/%s/%s", cvar_string("menu_skin"), this.m_icon) : string_null);
}
#ifdef SVQC
- METHOD(Buff, m_time, float(Buff this))
- {
+ METHOD(Buff, m_time, float(Buff this)) {
return cvar(strcat("g_buffs_", this.netname, "_time"));
}
#endif
#ifdef MENUQC
METHOD(Buff, describe, string(Buff this)) {
TC(Buff, this);
- return SUPER(Object).describe(this);
+ return SUPER(Buff).describe(this);
}
#endif
ENDCLASS(Buff)
ATTRIB(Nade, m_alpha, float, 1);
ATTRIBARRAY(Nade, m_projectile, int, 2);
ATTRIBARRAY(Nade, m_trail, entity, 2);
- METHOD(Nade, display, void(entity this, void(string name, string icon) returns)) {
- returns(this.m_name, sprintf("/gfx/hud/%s/%s", cvar_string("menu_skin"), this.m_icon));
+ METHOD(Nade, display, void(Nade this, void(string name, string icon) returns)) {
+ TC(Nade, this);
+ returns(this.m_name, this.m_icon ? sprintf("/gfx/hud/%s/%s", cvar_string("menu_skin"), this.m_icon) : string_null);
}
#ifdef MENUQC
METHOD(Nade, describe, string(Nade this)) {
TC(Nade, this);
- return SUPER(Object).describe(this);
+ return SUPER(Nade).describe(this);
}
#endif
ENDCLASS(Nade)
METHOD(Powerup, describe, string(Powerup this))
{
TC(Powerup, this);
- return SUPER(Object).describe(this);
+ return SUPER(Powerup).describe(this);
}
#endif
ENDCLASS(Powerup)
CLASS(Turret, Object)
ATTRIB(Turret, m_id, int, 0);
+ /** icon */
+ ATTRIB(Turret, m_icon, string);
/** short name */
ATTRIB(Turret, netname, string);
/** human readable name */
ATTRIB(Turret, m_maxs, vector, '0 0 0');
METHOD(Turret, display, void(Turret this, void(string name, string icon) returns)) {
- returns(this.m_name, string_null);
+ TC(Turret, this);
+ returns(this.m_name, this.m_icon ? sprintf("/gfx/hud/%s/%s", cvar_string("menu_skin"), this.m_icon) : string_null);
}
/** (BOTH) setup turret data */
METHOD(Turret, tr_setup, void(Turret this, entity it)) {
#ifdef MENUQC
METHOD(Turret, describe, string(Turret this)) {
TC(Turret, this);
- return SUPER(Object).describe(this);
+ return SUPER(Turret).describe(this);
}
#endif
ENDCLASS(Turret)
#ifdef MENUQC
METHOD(Vehicle, describe, string(Vehicle this)) {
TC(Vehicle, this);
- return SUPER(Object).describe(this);
+ return SUPER(Vehicle).describe(this);
}
#endif
- METHOD(Vehicle, display, void(entity this, void(string name, string icon) returns)) {
+ METHOD(Vehicle, display, void(Vehicle this, void(string name, string icon) returns)) {
+ TC(Vehicle, this);
returns(this.m_name, this.m_icon ? sprintf("/gfx/hud/%s/%s", cvar_string("menu_skin"), this.m_icon) : string_null);
}
METHOD(Weapon, wr_pickup, void(Weapon this, entity actor, .entity weaponentity)) {}
/** (SERVER) update cvar based properties */
METHOD(Weapon, wr_update, void(Weapon this)) {}
- METHOD(Weapon, display, void(entity this, void(string name, string icon) returns)) {
+ METHOD(Weapon, display, void(Weapon this, void(string name, string icon) returns)) {
+ TC(Weapon, this);
returns(this.m_name, this.model2 ? sprintf("/gfx/hud/%s/%s", cvar_string("menu_skin"), this.model2) : string_null);
}
#ifdef MENUQC
METHOD(Weapon, describe, string(Weapon this)) {
TC(Weapon, this);
- return SUPER(Object).describe(this);
+ return SUPER(Weapon).describe(this);
}
#endif
ENDCLASS(Weapon)
}
METHOD(GuidePage, display, void(GuidePage this, void(string name, string icon) returns))
{
+ TC(GuidePage, this);
string icon_str;
if (this.m_title == _("Introduction"))
icon_str = "gametype_dm";
else if (this.m_title == _("Movement"))
icon_str = "gametype_inv";
else
- icon_str = "nopreview_map";
+ icon_str = string_null;
returns(this.m_title, icon_str);
}