]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/items/all.qh
Merge branch 'master' into terencehill/scoreboard_item_stats
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / items / all.qh
1 #pragma once
2
3 #include <common/command/_mod.qh>
4
5 #include "item.qh"
6
7 // NOTE: 24 is the limit for the .items field
8 REGISTRY(Items, 32)
9 #ifdef GAMEQC
10 REGISTRY_DEPENDS(Items, Models)
11 #endif
12 REGISTER_REGISTRY(Items)
13 #define REGISTER_ITEM(id, class) REGISTER(Items, ITEM, id, m_id, NEW(class))
14
15 #ifdef CSQC
16 IntrusiveList default_order_items;
17 STATIC_INIT(default_order_items)
18 {
19         default_order_items = IL_NEW();
20         FOREACH(Items, true, {
21                 IL_PUSH(default_order_items, it);
22         });
23 }
24 #endif
25
26 REGISTRY_SORT(Items)
27 REGISTRY_CHECK(Items)
28
29 REGISTRY_DEFINE_GET(Items, NULL)
30 STATIC_INIT(Items) { FOREACH(Items, true, it.m_id = i); }
31
32 void Dump_Items();
33
34 GENERIC_COMMAND(dumpitems, "Dump all items to the console", false) {
35     switch (request) {
36         case CMD_REQUEST_COMMAND: {
37             Dump_Items();
38             return;
39         }
40         default:
41         case CMD_REQUEST_USAGE: {
42             LOG_HELPF("Usage:^3 %s dumpitems", GetProgramCommandPrefix());
43             return;
44         }
45     }
46 }
47
48 #ifdef GAMEQC
49 string Item_Model(string item_mdl);
50 #endif