f105edae7c
Port From (https://github.com/TrinityCore/TrinityCore/commit/76352cb391b4ff239ef70ff85ede4f09fcffc069)
37 lines
1.4 KiB
C#
37 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:
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|