mirror of
https://github.com/azerothcore/mod-transmog
synced 2025-11-29 22:48:30 +08:00
feat: Do not show appearance added message for items that cannot ever be transmogged (#91)
This commit is contained in:
@@ -714,6 +714,16 @@ bool Transmogrification::IsAllowedQuality(uint32 quality) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Transmogrification::CanNeverTransmog(ItemTemplate const* itemTemplate)
|
||||||
|
{
|
||||||
|
return (itemTemplate->InventoryType == INVTYPE_BAG ||
|
||||||
|
itemTemplate->InventoryType == INVTYPE_RELIC ||
|
||||||
|
itemTemplate->InventoryType == INVTYPE_FINGER ||
|
||||||
|
itemTemplate->InventoryType == INVTYPE_TRINKET ||
|
||||||
|
itemTemplate->InventoryType == INVTYPE_AMMO ||
|
||||||
|
itemTemplate->InventoryType == INVTYPE_QUIVER);
|
||||||
|
}
|
||||||
|
|
||||||
void Transmogrification::LoadConfig(bool reload)
|
void Transmogrification::LoadConfig(bool reload)
|
||||||
{
|
{
|
||||||
#ifdef PRESETS
|
#ifdef PRESETS
|
||||||
|
|||||||
@@ -146,6 +146,7 @@ public:
|
|||||||
bool IsNotAllowed(uint32 entry) const;
|
bool IsNotAllowed(uint32 entry) const;
|
||||||
bool IsAllowedQuality(uint32 quality) const;
|
bool IsAllowedQuality(uint32 quality) const;
|
||||||
bool IsRangedWeapon(uint32 Class, uint32 SubClass) const;
|
bool IsRangedWeapon(uint32 Class, uint32 SubClass) const;
|
||||||
|
bool CanNeverTransmog(ItemTemplate const* itemTemplate);
|
||||||
|
|
||||||
void LoadConfig(bool reload); // thread unsafe
|
void LoadConfig(bool reload); // thread unsafe
|
||||||
|
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ public:
|
|||||||
if (sTransmogrification->AddCollectedAppearance(accountId, itemId))
|
if (sTransmogrification->AddCollectedAppearance(accountId, itemId))
|
||||||
{
|
{
|
||||||
// Notify target of new item in appearance collection
|
// Notify target of new item in appearance collection
|
||||||
if (target && !(target->GetPlayerSetting("mod-transmog", SETTING_HIDE_TRANSMOG).value))
|
if (target && !(target->GetPlayerSetting("mod-transmog", SETTING_HIDE_TRANSMOG).value) && !sTransmogrification->CanNeverTransmog(itemTemplate))
|
||||||
{
|
{
|
||||||
ChatHandler(target->GetSession()).PSendSysMessage(R"(|c%s|Hitem:%u:0:0:0:0:0:0:0:0|h[%s]|h|r has been added to your appearance collection.)", itemQuality.c_str(), itemId, itemName.c_str());
|
ChatHandler(target->GetSession()).PSendSysMessage(R"(|c%s|Hitem:%u:0:0:0:0:0:0:0:0|h[%s]|h|r has been added to your appearance collection.)", itemQuality.c_str(), itemId, itemName.c_str());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -546,7 +546,7 @@ private:
|
|||||||
std::stringstream tempStream;
|
std::stringstream tempStream;
|
||||||
tempStream << std::hex << ItemQualityColors[itemTemplate->Quality];
|
tempStream << std::hex << ItemQualityColors[itemTemplate->Quality];
|
||||||
std::string itemQuality = tempStream.str();
|
std::string itemQuality = tempStream.str();
|
||||||
bool showChatMessage = !(player->GetPlayerSetting("mod-transmog", SETTING_HIDE_TRANSMOG).value);
|
bool showChatMessage = !(player->GetPlayerSetting("mod-transmog", SETTING_HIDE_TRANSMOG).value) && !sT->CanNeverTransmog(itemTemplate);
|
||||||
if (sT->AddCollectedAppearance(accountId, itemId))
|
if (sT->AddCollectedAppearance(accountId, itemId))
|
||||||
{
|
{
|
||||||
if (showChatMessage)
|
if (showChatMessage)
|
||||||
|
|||||||
Reference in New Issue
Block a user