Xonotic
all.qh
Go to the documentation of this file.
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 // Copy Items registry here before it gets sorted alphabetically by REGISTRY_SORT
17 // so we can keep items sorted by categories (as they appear in the code)
18 IntrusiveList default_order_items;
19 STATIC_INIT(default_order_items)
20 {
21  default_order_items = IL_NEW();
22  FOREACH(Items, true, {
23  IL_PUSH(default_order_items, it);
24  });
25 }
26 #endif
27 
28 REGISTRY_SORT(Items)
29 REGISTRY_CHECK(Items)
30 
32 STATIC_INIT(Items) { FOREACH(Items, true, it.m_id = i); }
33 
34 void Dump_Items();
35 
36 GENERIC_COMMAND(dumpitems, "Dump all items to the console", false) {
37  switch (request) {
38  case CMD_REQUEST_COMMAND: {
39  Dump_Items();
40  return;
41  }
42  default:
43  case CMD_REQUEST_USAGE: {
44  LOG_HELP("Usage:^3 ", GetProgramCommandPrefix(), " dumpitems");
45  return;
46  }
47  }
48 }
49 
50 #ifdef GAMEQC
51 string Item_Model(string item_mdl);
52 #endif
REGISTRY(Weapons, 72) STATIC_INIT(WeaponPickup)
Definition: all.qh:28
REGISTRY_SORT(Notifications)
const int CMD_REQUEST_USAGE
Definition: command.qh:4
#define IL_NEW()
#define REGISTRY_CHECK(id)
Definition: registry.qh:175
limitations: NULL cannot be present elements can only be present once a maximum of IL_MAX lists can e...
#define LOG_HELP(...)
Definition: log.qh:95
#define REGISTER_REGISTRY(id)
Definition: registry.qh:212
#define REGISTRY_DEFINE_GET(id, null)
Definition: registry.qh:40
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
#define NULL
Definition: post.qh:17
const int CMD_REQUEST_COMMAND
Definition: command.qh:3
void Dump_Items()
Definition: all.qc:3
STATIC_INIT(IMPULSES_renumber)
Definition: all.qh:8
#define REGISTRY_DEPENDS(id, dep)
Add registry dependencies to a registry.
Definition: registry.qh:46
GENERIC_COMMAND(dumpitems, "Dump all items to the console", false)
Definition: all.qh:36
string Item_Model(string item_mdl)
Definition: all.qc:8
#define FOREACH(list, cond, body)
Definition: iter.qh:19