[3.3.5] ChatCommands, the other half: chat command resolution refactor (PR #25463)

(cherry picked from commit 1eca51b417678b9a48b28552925d5694105f82bb)
This commit is contained in:
Treeston
2022-02-27 20:08:41 +01:00
committed by Shauren
parent 7a2c3af988
commit 3fd2eb126c
57 changed files with 1360 additions and 1294 deletions
+7 -13
View File
@@ -56,6 +56,10 @@
#undef GetClassName
#endif
#if TRINITY_COMPILER == TRINITY_COMPILER_GNU
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
using namespace Trinity::ChatCommands;
class misc_commandscript : public CommandScript
@@ -603,7 +607,7 @@ public:
static bool HandleCommandsCommand(ChatHandler* handler)
{
handler->ShowHelpForCommand(ChatHandler::getCommandTable(), "");
Trinity::ChatCommands::SendCommandHelpFor(*handler, "");
return true;
}
@@ -694,19 +698,9 @@ public:
return true;
}
static bool HandleHelpCommand(ChatHandler* handler, Tail cmdArg)
static bool HandleHelpCommand(ChatHandler* handler, Tail cmd)
{
if (cmdArg.empty())
{
handler->ShowHelpForCommand(ChatHandler::getCommandTable(), "help");
handler->ShowHelpForCommand(ChatHandler::getCommandTable(), "");
}
else
{
if (!handler->ShowHelpForCommand(ChatHandler::getCommandTable(), std::string(cmdArg).c_str()))
handler->SendSysMessage(LANG_NO_HELP_CMD);
}
Trinity::ChatCommands::SendCommandHelpFor(*handler, cmd);
return true;
}