]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/items/all.qh
Merge branch 'master' into terencehill/hud_fixes
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / items / all.qh
1 #ifndef ITEMS_ALL_H
2 #define ITEMS_ALL_H
3
4 #include <common/command/all.qh>
5
6 #include "item.qh"
7
8 REGISTRY(Items, BITS(5))
9 #define Items_from(i) _Items_from(i, NULL)
10 REGISTER_REGISTRY(Items)
11 #define REGISTER_ITEM(id, class) REGISTER(Items, ITEM, id, m_id, NEW(class))
12
13 REGISTRY_SORT(Items)
14 REGISTRY_CHECK(Items)
15 STATIC_INIT(Items) { FOREACH(Items, true, it.m_id = i); }
16
17 void Dump_Items();
18
19 GENERIC_COMMAND(dumpitems, "Dump all items to the console") {
20     switch (request) {
21         case CMD_REQUEST_COMMAND: {
22             Dump_Items();
23             return;
24         }
25         default:
26         case CMD_REQUEST_USAGE: {
27             LOG_INFOF("\nUsage:^3 %s dumpitems", GetProgramCommandPrefix());
28             return;
29         }
30     }
31 }
32
33 #ifndef MENUQC
34 string Item_Model(string item_mdl);
35 #endif
36
37 #endif