X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fitems%2Fall.qh;h=3d3d62e4631c40e0b4516b25fe9de71e95c84427;hb=579b98f2d87d5d2753618322ade31af1422d91ec;hp=623f71b3904ab7654d9e9e88e23291c45d84bb09;hpb=1b0decb9afb829407eae763b3053a122e2ae3de6;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/items/all.qh b/qcsrc/common/items/all.qh index 623f71b39..3d3d62e46 100644 --- a/qcsrc/common/items/all.qh +++ b/qcsrc/common/items/all.qh @@ -4,21 +4,36 @@ #include "item.qh" -REGISTRY(Items, BITS(7)) -#define Items_from(i) _Items_from(i, NULL) +// NOTE: 24 is the limit for the .items field +REGISTRY(Items, 32) #ifdef GAMEQC REGISTRY_DEPENDS(Items, Models) #endif REGISTER_REGISTRY(Items) #define REGISTER_ITEM(id, class) REGISTER(Items, ITEM, id, m_id, NEW(class)) +#ifdef CSQC +// Copy Items registry here before it gets sorted alphabetically by REGISTRY_SORT +// so we can keep items sorted by categories (as they appear in the code) +IntrusiveList default_order_items; +STATIC_INIT(default_order_items) +{ + default_order_items = IL_NEW(); + FOREACH(Items, true, { + IL_PUSH(default_order_items, it); + }); +} +#endif + REGISTRY_SORT(Items) REGISTRY_CHECK(Items) + +REGISTRY_DEFINE_GET(Items, NULL) STATIC_INIT(Items) { FOREACH(Items, true, it.m_id = i); } void Dump_Items(); -GENERIC_COMMAND(dumpitems, "Dump all items to the console") { +GENERIC_COMMAND(dumpitems, "Dump all items to the console", false) { switch (request) { case CMD_REQUEST_COMMAND: { Dump_Items(); @@ -26,7 +41,7 @@ GENERIC_COMMAND(dumpitems, "Dump all items to the console") { } default: case CMD_REQUEST_USAGE: { - LOG_INFOF("Usage:^3 %s dumpitems", GetProgramCommandPrefix()); + LOG_HELP("Usage:^3 ", GetProgramCommandPrefix(), " dumpitems"); return; } }