]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/items/item.qh
Merge branch 'master' into Mario/sound_model_paths
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / items / item.qh
1 #ifndef GAMEITEM_H
2 #define GAMEITEM_H
3 #include "../oo.qh"
4 #define ITEM_HANDLE(signal, ...) __Item_Send_##signal(__VA_ARGS__)
5 /** If you register a new item, make sure to add it to all.inc */
6 CLASS(GameItem, Object)
7     ATTRIB(GameItem, m_id, int, 0)
8     ATTRIB(GameItem, m_name, string, string_null)
9     ATTRIB(GameItem, m_icon, string, string_null)
10     ATTRIB(GameItem, m_color, vector, '1 1 1')
11     ATTRIB(GameItem, m_waypoint, string, string_null)
12     ATTRIB(GameItem, m_waypointblink, int, 1)
13     METHOD(GameItem, display, void(entity this, void(string name, string icon) returns)) {
14         returns(this.m_name, this.m_icon ? sprintf("/gfx/hud/%s/%s", cvar_string("menu_skin"), this.m_icon) : string_null);
15     }
16     METHOD(GameItem, show, void(entity this)) { print("A game item\n"); }
17     void ITEM_HANDLE(Show, entity this) { this.show(this); }
18 ENDCLASS(GameItem)
19
20 #endif