42 lines
1.1 KiB
C#
42 lines
1.1 KiB
C#
using System;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using JD.Asset.Types.CustomizableItem;
|
|
|
|
namespace TeaBox.Avatars
|
|
{
|
|
/// <summary>
|
|
/// Simplified representation of an avatar/skin
|
|
/// </summary>
|
|
public class CustomizableItemModel
|
|
{
|
|
public Image Thumbnail => Image.FromFile(Item.MainImagePath).GetThumbnailImage(30, 30, () => false, IntPtr.Zero);
|
|
|
|
private CustomizableItem Item { get; }
|
|
|
|
public string Id { get; set; }
|
|
|
|
public string RelatedMap { get; }
|
|
|
|
public string RelatedBoss { get; }
|
|
|
|
public string RelatedQuest { get; }
|
|
|
|
public int JdVersion { get; }
|
|
|
|
public CustomizableItemModel(CustomizableItem item)
|
|
{
|
|
Item = item;
|
|
Id = item.FormattedId;
|
|
RelatedBoss = item.RelativeWdfBossName;
|
|
RelatedQuest = item.RelativeQuestId;
|
|
if (item.RelativeMap != null)
|
|
{
|
|
RelatedMap = item.RelativeMap.Name;
|
|
}
|
|
JdVersion = (int) item.JdVersion;
|
|
}
|
|
|
|
public override string ToString() => Id;
|
|
}
|
|
}
|