]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/items/all.qh
Merge branch 'terencehill/g_lms_extra_lives' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / items / all.qh
1 #ifndef ITEMS_ALL_H
2 #define ITEMS_ALL_H
3
4 #include "../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 /** If you register a new item, make sure to add it to all.inc */
12 #define REGISTER_ITEM(id, class) REGISTER(Items, ITEM, id, m_id, NEW(class))
13
14 REGISTRY_SORT(Items)
15 REGISTRY_CHECK(Items)
16 STATIC_INIT(Items) { FOREACH(Items, true, LAMBDA(it.m_id = i)); }
17
18 void Dump_Items();
19
20 GENERIC_COMMAND(dumpitems, "Dump all items to the console") {
21     switch (request) {
22         case CMD_REQUEST_COMMAND: {
23             Dump_Items();
24             return;
25         }
26         default:
27         case CMD_REQUEST_USAGE: {
28             LOG_INFOF("\nUsage:^3 %s dumpitems", GetProgramCommandPrefix());
29             return;
30         }
31     }
32 }
33
34 #ifndef MENUQC
35 string Item_Model(string item_mdl);
36 #endif
37
38 #endif