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

(cherry picked from commit 1eca51b417)
This commit is contained in:
Treeston
2020-09-20 02:50:38 +02:00
committed by Shauren
parent 7a2c3af988
commit 3fd2eb126c
57 changed files with 1360 additions and 1294 deletions

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;
}