7fd54e6175
Port From (https://github.com/TrinityCore/TrinityCore/commit/23624ed75abc8cbb77bb2e24a08e0836e4c41db5)
38 lines
1.4 KiB
C#
38 lines
1.4 KiB
C#
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
|
|
// Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE file in the project root for full license information.
|
|
|
|
using Framework.Constants;
|
|
using Game.Networking;
|
|
using Game.Networking.Packets;
|
|
|
|
namespace Game
|
|
{
|
|
public partial class WorldSession
|
|
{
|
|
[WorldPacketHandler(ClientOpcodes.CollectionItemSetFavorite)]
|
|
void HandleCollectionItemSetFavorite(CollectionItemSetFavorite collectionItemSetFavorite)
|
|
{
|
|
switch (collectionItemSetFavorite.Type)
|
|
{
|
|
case ItemCollectionType.Toy:
|
|
GetCollectionMgr().ToySetFavorite(collectionItemSetFavorite.Id, collectionItemSetFavorite.IsFavorite);
|
|
break;
|
|
case ItemCollectionType.Transmog:
|
|
{
|
|
var pair = GetCollectionMgr().HasItemAppearance(collectionItemSetFavorite.Id);
|
|
if (!pair.Item1 || pair.Item2)
|
|
return;
|
|
|
|
GetCollectionMgr().SetAppearanceIsFavorite(collectionItemSetFavorite.Id, collectionItemSetFavorite.IsFavorite);
|
|
break;
|
|
}
|
|
case ItemCollectionType.TransmogSetFavorite:
|
|
case ItemCollectionType.WarbandScene:
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|