X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fitems%2Fall.qh;h=623f71b3904ab7654d9e9e88e23291c45d84bb09;hb=64d6ae97e47fc166077e544cd3420429ae025139;hp=92c77579abb21d5aba62bad2efc30f792c978f99;hpb=14a31565a2bc3c9a8871e6b3e768c68f7e58eda5;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/items/all.qh b/qcsrc/common/items/all.qh index 92c77579a..623f71b39 100644 --- a/qcsrc/common/items/all.qh +++ b/qcsrc/common/items/all.qh @@ -1,14 +1,20 @@ -#ifndef ITEMS_ALL_H -#define ITEMS_ALL_H +#pragma once -#include "../command/all.qh" +#include #include "item.qh" -REGISTRY(Items, BIT(5)) -REGISTER_REGISTRY(RegisterItems) -/** If you register a new item, make sure to add it to all.inc */ -#define REGISTER_ITEM(id, class) REGISTER(RegisterItems, ITEM, Items, id, m_id, NEW(class)) +REGISTRY(Items, BITS(7)) +#define Items_from(i) _Items_from(i, NULL) +#ifdef GAMEQC +REGISTRY_DEPENDS(Items, Models) +#endif +REGISTER_REGISTRY(Items) +#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, it.m_id = i); } void Dump_Items(); @@ -20,16 +26,12 @@ GENERIC_COMMAND(dumpitems, "Dump all items to the console") { } default: case CMD_REQUEST_USAGE: { - LOG_INFOF("\nUsage:^3 %s dumpitems", GetProgramCommandPrefix()); + LOG_INFOF("Usage:^3 %s dumpitems", GetProgramCommandPrefix()); return; } } } -#ifndef MENUQC +#ifdef GAMEQC string Item_Model(string item_mdl); #endif - -#endif - -#include "inventory.qh"