72 lines
2.0 KiB
C#
72 lines
2.0 KiB
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using UnityEngine.EventSystems;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System;
|
|
using GCGame.Table;
|
|
using GCGame;
|
|
using Module.Log;
|
|
|
|
public class MarketPlayerClassItemInfo
|
|
{
|
|
public int DataId;
|
|
public List<int> ItemDatas;
|
|
public int SellCnt;
|
|
}
|
|
|
|
public class MarketPlayerClassItem : UIItemSelect
|
|
{
|
|
|
|
public Image _ItemIcon;
|
|
public Image _ItemQuality;
|
|
public Text _ItemName;
|
|
public Text _SellCnt;
|
|
|
|
private MarketPlayerClassItemInfo _SellItemClass;
|
|
|
|
public override void Show(Hashtable hash)
|
|
{
|
|
base.Show();
|
|
|
|
var sellItem = (MarketPlayerClassItemInfo)hash["InitObj"];
|
|
UpdateItem(sellItem);
|
|
}
|
|
|
|
private void UpdateItem(MarketPlayerClassItemInfo sellItem)
|
|
{
|
|
_SellItemClass = sellItem;
|
|
var commonItem = TableManager.GetCommonItemByID(sellItem.DataId, 0);
|
|
if (commonItem == null)
|
|
{
|
|
LogModule.DebugLog("CommonItem Error:" + sellItem.DataId);
|
|
}
|
|
LoadAssetBundle.Instance.SetImageSprite(_ItemIcon, commonItem.Icon);
|
|
LoadAssetBundle.Instance.SetImageSprite(_ItemQuality, GCGame.Utils.GetItemQualityFrame(commonItem));
|
|
if (commonItem.QualityEffect > 0)
|
|
{
|
|
CommonItemContainerItem.ShowQualityEffect(true, commonItem.QualityEffect, _ItemIcon.transform);
|
|
}
|
|
else
|
|
{
|
|
CommonItemContainerItem.ShowQualityEffect(false, commonItem.QualityEffect, _ItemIcon.transform);
|
|
}
|
|
|
|
_ItemName.text = commonItem.Name;
|
|
if (sellItem.SellCnt > 0)
|
|
{
|
|
_SellCnt.text = StrDictionary.GetClientDictionaryString("#{6350}", sellItem.SellCnt);
|
|
}
|
|
else
|
|
{
|
|
_SellCnt.text = StrDictionary.GetClientDictionaryString("#{6350}", Utils.GetDisableColorText("0"));
|
|
}
|
|
}
|
|
|
|
public void OnShowItemTips()
|
|
{
|
|
ItemTooltipsLogic.ShowItemTooltip(_SellItemClass.DataId, ItemTooltipsLogic.ShowType.Info, transform.position);
|
|
//OnItemClick();
|
|
}
|
|
}
|