feat: Add support for add-on sync command (#98)

This commit is contained in:
ZhengPeiRu21
2022-08-30 11:55:30 -06:00
committed by GitHub
parent 765f656b9b
commit 18d6acfb83
3 changed files with 22 additions and 3 deletions

View File

@@ -40,7 +40,8 @@ public:
static ChatCommandTable transmogTable =
{
{ "add", addCollectionTable },
{ "", HandleDisableTransMogVisual, SEC_PLAYER, Console::No },
{ "", HandleDisableTransMogVisual, SEC_PLAYER, Console::No },
{ "sync", HandleSyncTransMogCommand, SEC_PLAYER, Console::No },
};
static ChatCommandTable commandTable =
@@ -51,6 +52,19 @@ public:
return commandTable;
}
static bool HandleSyncTransMogCommand(ChatHandler* handler, char const* /*args*/)
{
Player* player = handler->GetPlayer();
uint32 accountId = player->GetSession()->GetAccountId();
handler->SendSysMessage(LANG_CMD_TRANSMOG_BEGIN_SYNC);
for (uint32 itemId : sTransmogrification->collectionCache[accountId])
{
handler->PSendSysMessage("TRANSMOG_SYNC:%u", itemId);
}
handler->SendSysMessage(LANG_CMD_TRANSMOG_COMPLETE_SYNC);
return true;
}
static bool HandleDisableTransMogVisual(ChatHandler* handler, bool hide)
{
Player* player = handler->GetPlayer();