X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fitems%2Fall.qh;h=18cc5ae4f3b707dfd11caea3774cc2473d2587f2;hb=06a08d0c6b573f2562297147171aff3d990fa42d;hp=1bd22f660e52264f488a53390d015045dff5d7cd;hpb=6603ee5ff104719d3d4b9dad7ae4bf66f46706e5;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/items/all.qh b/qcsrc/common/items/all.qh index 1bd22f660..359c00179 100644 --- a/qcsrc/common/items/all.qh +++ b/qcsrc/common/items/all.qh @@ -1,23 +1,26 @@ -#ifndef ITEMS_ALL_H -#define ITEMS_ALL_H +#pragma once -#include "../command/all.qh" +#include #include "item.qh" -REGISTRY(Items, BITS(5)) -#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) -/** If you register a new item, make sure to add it to all.inc */ #define REGISTER_ITEM(id, class) REGISTER(Items, ITEM, id, m_id, NEW(class)) REGISTRY_SORT(Items) REGISTRY_CHECK(Items) -STATIC_INIT(Items) { FOREACH(Items, true, LAMBDA(it.m_id = i)); } + +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(); @@ -25,14 +28,12 @@ GENERIC_COMMAND(dumpitems, "Dump all items to the console") { } default: case CMD_REQUEST_USAGE: { - LOG_INFOF("\nUsage:^3 %s dumpitems", GetProgramCommandPrefix()); + LOG_HELPF("Usage:^3 %s dumpitems", GetProgramCommandPrefix()); return; } } } -#ifndef MENUQC +#ifdef GAMEQC string Item_Model(string item_mdl); #endif - -#endif