]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/items/all.qh
Rename t_items.qc to items.qc
[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 REGISTRY_SORT(Items)
16 REGISTRY_CHECK(Items)
17
18 REGISTRY_DEFINE_GET(Items, NULL)
19 STATIC_INIT(Items) { FOREACH(Items, true, it.m_id = i); }
20
21 void Dump_Items();
22
23 GENERIC_COMMAND(dumpitems, "Dump all items to the console", false) {
24     switch (request) {
25         case CMD_REQUEST_COMMAND: {
26             Dump_Items();
27             return;
28         }
29         default:
30         case CMD_REQUEST_USAGE: {
31             LOG_HELPF("Usage:^3 %s dumpitems", GetProgramCommandPrefix());
32             return;
33         }
34     }
35 }
36
37 #ifdef GAMEQC
38 string Item_Model(string item_mdl);
39 #endif