X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fcommand%2Fall.qh;h=9bbce5e14a67d6d57474de504b1b696d1c9281f5;hb=6f4c7132e635c0150e3894f2f9958b361ce0c238;hp=253dc857b598cc8f2d9f77e6282b99fccf0ac193;hpb=3dcb07834d937163fce516ffc15156be9b1b95c4;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/command/all.qh b/qcsrc/common/command/all.qh index 253dc857b..9bbce5e14 100644 --- a/qcsrc/common/command/all.qh +++ b/qcsrc/common/command/all.qh @@ -2,17 +2,22 @@ #define COMMON_COMMANDS_ALL_H #include "command.qh" -REGISTRY(GENERIC_COMMANDS, 50) -REGISTER_REGISTRY(RegisterGENERIC_COMMANDS) -REGISTRY_SORT(GENERIC_COMMANDS, m_name, 0) +REGISTRY(GENERIC_COMMANDS, BITS(7)) +#define GENERIC_COMMANDS_from(i) _GENERIC_COMMANDS_from(i, NULL) +REGISTER_REGISTRY(GENERIC_COMMANDS) +REGISTRY_SORT(GENERIC_COMMANDS) #define GENERIC_COMMAND(id, description) \ CLASS(genericcommand_##id, Command) \ ATTRIB(genericcommand_##id, m_name, string, #id); \ ATTRIB(genericcommand_##id, m_description, string, description); \ ENDCLASS(genericcommand_##id) \ - REGISTER(RegisterGENERIC_COMMANDS, CMD_G, GENERIC_COMMANDS, id, m_id, NEW(genericcommand_##id)); \ - METHOD(genericcommand_##id, m_invokecmd, void(int request, int arguments, string command)) + REGISTER(GENERIC_COMMANDS, CMD_G, id, m_id, NEW(genericcommand_##id)); \ + METHOD(genericcommand_##id, m_invokecmd, void(int request, entity caller, int arguments, string command)) + +STATIC_INIT(GENERIC_COMMANDS_aliases) { + FOREACH(GENERIC_COMMANDS, true, localcmd(sprintf("alias %1$s \"%2$s %1$s ${* ?}\"\n", it.m_name, "qc_cmd_svmenu"))); +} #include "generic.qh" #include "markup.qh"