mirror of
https://github.com/azerothcore/mod-transmog
synced 2025-12-01 21:13:06 +08:00
feat: Add support for add-on sync command (#98)
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user