]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/items/all.qh
Merge branch 'master' into terencehill/ft_autorevive_progress
[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 // 24 so it matches the limit for the .items field
8 REGISTRY(Items, 24)
9 #define Items_from(i) _Items_from(i, NULL)
10 #ifdef GAMEQC
11 REGISTRY_DEPENDS(Items, Models)
12 #endif
13 REGISTER_REGISTRY(Items)
14 #define REGISTER_ITEM(id, class) REGISTER(Items, ITEM, id, m_id, NEW(class))
15
16 REGISTRY_SORT(Items)
17 REGISTRY_CHECK(Items)
18 STATIC_INIT(Items) { FOREACH(Items, true, it.m_id = i); }
19
20 void Dump_Items();
21
22 GENERIC_COMMAND(dumpitems, "Dump all items to the console") {
23     switch (request) {
24         case CMD_REQUEST_COMMAND: {
25             Dump_Items();
26             return;
27         }
28         default:
29         case CMD_REQUEST_USAGE: {
30             LOG_INFOF("Usage:^3 %s dumpitems", GetProgramCommandPrefix());
31             return;
32         }
33     }
34 }
35
36 #ifdef GAMEQC
37 string Item_Model(string item_mdl);
38 #endif