//--------------------------------------------------------
|
// [Author]: 第二世界
|
// [ Date ]: Tuesday, March 12, 2019
|
//--------------------------------------------------------
|
using UnityEngine;
|
using System.Collections;
|
using UnityEngine.UI;
|
|
namespace Snxxz.UI
|
{
|
|
public class TipEquipBaseInfoWidget : MonoBehaviour
|
{
|
[SerializeField] ImageEx m_Label;
|
[SerializeField] Text m_ItemName;
|
[SerializeField] ItemBehaviour m_Item;
|
[SerializeField] Text m_ScoreOrType;
|
[SerializeField] RectTransform m_RealmContainer;
|
[SerializeField] Image m_Realm;
|
[SerializeField] RectTransform m_SurplusTimeContainer;
|
[SerializeField] Text m_SurplusTime;
|
[SerializeField] Text m_Star;
|
|
public void Display(ItemTipUtility.BaseInfo baseInfo)
|
{
|
if (baseInfo.isEquiped)
|
{
|
m_Label.gameObject.SetActive(true);
|
m_Label.SetSprite("Equiped_a");
|
m_Label.gray = false;
|
m_Star.text = baseInfo.star >= 1 ? string.Format("{0}星", baseInfo.star) : "";
|
}
|
else if (baseInfo.isAuction)
|
{
|
m_Label.gameObject.SetActive(true);
|
m_Label.SetSprite("Item_Auction_2");
|
m_Label.gray = baseInfo.auctionSurplusTime <= 0;
|
m_Star.text = "";
|
}
|
else
|
{
|
m_Star.text = "";
|
m_Label.gameObject.SetActive(false);
|
}
|
|
var itemConfig = ItemConfig.Get(baseInfo.itemId);
|
var strengthenPostfix = baseInfo.strengthenLevel > 0 ? string.Format("+{0}", baseInfo.strengthenLevel) : "";
|
if (itemConfig.SuiteiD > 0)
|
{
|
var setName = UIHelper.AppendColor(TextColType.Green, EquipModel.GetSuitName(itemConfig.LV));
|
var itemNeme = UIHelper.AppendColor(itemConfig.ItemColor, itemConfig.ItemName + strengthenPostfix);
|
m_ItemName.text = setName + itemNeme;
|
}
|
else
|
{
|
m_ItemName.text = itemConfig.ItemName + strengthenPostfix;
|
m_ItemName.color = UIHelper.GetUIColor(itemConfig.ItemColor);
|
}
|
|
m_Item.SetItem(baseInfo.itemId, 1);
|
|
if (baseInfo.score != 0)
|
{
|
if (!baseInfo.isPreview && !baseInfo.isAuction)
|
{
|
m_ScoreOrType.text = Language.Get("EquipWin_EquipPointText_1") + baseInfo.score;
|
}
|
else
|
{
|
m_ScoreOrType.text = Language.Get("EquipWin_EquipPointText_2") + baseInfo.score;
|
}
|
}
|
else
|
{
|
m_ScoreOrType.text = itemConfig.ItemTypeName;
|
}
|
|
if (itemConfig.RealmLimit > 0 && RealmConfig.Has(itemConfig.RealmLimit))
|
{
|
m_RealmContainer.gameObject.SetActive(true);
|
var realmConfig = RealmConfig.Get(itemConfig.RealmLimit);
|
m_Realm.SetSprite(realmConfig.Img);
|
}
|
else
|
{
|
m_RealmContainer.gameObject.SetActive(false);
|
}
|
|
if (baseInfo.isAuction)
|
{
|
m_SurplusTimeContainer.gameObject.SetActive(true);
|
if (baseInfo.auctionSurplusTime > 0)
|
{
|
m_SurplusTime.text = TimeUtility.SecondsToHMSCHSRetain(baseInfo.auctionSurplusTime);
|
}
|
else
|
{
|
m_SurplusTime.text = "已过期";
|
}
|
}
|
else
|
{
|
m_SurplusTimeContainer.gameObject.SetActive(false);
|
}
|
|
}
|
|
}
|
|
}
|