63 lines
1.8 KiB
C#
63 lines
1.8 KiB
C#
using System;
|
|
using System.Drawing;
|
|
using CustomUtility;
|
|
using Entity.EntityData;
|
|
using Entity.Weapon;
|
|
using SepCore.Definition;
|
|
using UnityEngine;
|
|
|
|
namespace SepCore.UI
|
|
{
|
|
public class DisplayItemInfoContext : UIContext
|
|
{
|
|
public int Index;
|
|
public string IconAssetName;
|
|
public string Title;
|
|
public ItemType ItemType;
|
|
public ItemRarity Rarity;
|
|
public string Description;
|
|
public int Price;
|
|
public Vector3 TargetPos;
|
|
|
|
public DisplayItemInfoContext()
|
|
{
|
|
Index = -1;
|
|
IconAssetName = string.Empty;
|
|
Title = string.Empty;
|
|
ItemType = ItemType.None;
|
|
Rarity = ItemRarity.White;
|
|
Description = string.Empty;
|
|
Price = 0;
|
|
TargetPos = Vector3.zero;
|
|
}
|
|
|
|
public DisplayItemInfoContext(DisplayItemInfoRawData rawData)
|
|
{
|
|
Index = rawData.Index;
|
|
ItemType = rawData.ItemType;
|
|
Rarity = rawData.Rarity;
|
|
Price = rawData.Price;
|
|
TargetPos = rawData.TargetPos;
|
|
if (ItemType == ItemType.None)
|
|
{
|
|
IconAssetName = string.Empty;
|
|
Title = string.Empty;
|
|
}
|
|
else if (ItemType == ItemType.Weapon)
|
|
{
|
|
var data = (WeaponData)rawData.Data;
|
|
IconAssetName = data.IconAssetName;
|
|
Title = data.Title;
|
|
Description = ItemDescUtility.CreateWeaponDescription(data);
|
|
}
|
|
else
|
|
{
|
|
var data = (PropItem)rawData.Data;
|
|
IconAssetName = data.IconAssetName;
|
|
Title = data.Title;
|
|
Description = ItemDescUtility.CreatePropDescription(data);
|
|
}
|
|
}
|
|
}
|
|
}
|