Files
JJBB/Assets/Project/Script/GUI/Market/MarketPlayerOutSellPage.cs

93 lines
2.8 KiB
C#
Raw Normal View History

2024-08-23 15:49:34 +08:00
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using Games.Item;
using System.Collections.Generic;
using GCGame.Table;
using Module.Log;
public class MarketPlayerOutSellPage : UIControllerBase<MarketPlayerOutSellPage>
{
// Use this for initialization
void OnEnable ()
{
SetInstance(this);
}
void OnDisable()
{
SetInstance(null);
}
// Update is called once per frame
void Update ()
{
}
#region
public Image _ItemIcon;
public Image _ItemQuality;
public Text _Name;
public Text _Level;
public UIDynamicText _Desc;
public Text _IsOnSell;
public UICurrencyItem _SolePrice;
public UICurrencyItem _TotlePrice;
public UICurrencyItem _TaxPrice;
private MarketPlayerSellItemInfo _OutSellItem;
public void InitOutSellItem(MarketPlayerSellItemInfo playerSellItem)
{
Tab_CommonItem commonItem = TableManager.GetCommonItemByID(playerSellItem.DataId, 0);
if (commonItem == null)
return;
_OutSellItem = playerSellItem;
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);
}
_Name.text = commonItem.Name;
_Level.text = StrDictionary.GetClientDictionaryString("#{1166}", commonItem.MinLevelRequire);
_Desc.SetText(StrDictionary.GetClientString_WithNameSex(commonItem.Tips));
if (playerSellItem.SellState == 1)
{
_IsOnSell.text = StrDictionary.GetClientDictionaryString("#{6364}");
}
else if (playerSellItem.SellState == 2)
{
_IsOnSell.text = StrDictionary.GetClientDictionaryString("#{6365}");
}
else if (playerSellItem.SellState == 0)
{
_IsOnSell.text = StrDictionary.GetClientDictionaryString("#{6383}");
}
_SolePrice.ShowCurrency(MONEYTYPE.MONEYTYPE_COIN, playerSellItem.Price);
_TotlePrice.ShowCurrency(MONEYTYPE.MONEYTYPE_COIN, playerSellItem.Price * playerSellItem.SellCnt);
_TaxPrice.ShowCurrency(MONEYTYPE.MONEYTYPE_COIN, 0);
}
public void OnBtnOutSell()
{
LogModule.DebugLog("OnBtnOutSell:" + _OutSellItem.DataId);
CG_CANCELCONSIGNSALEITEM packet = (CG_CANCELCONSIGNSALEITEM)PacketDistributed.CreatePacket(MessageID.PACKET_CG_CANCELCONSIGNSALEITEM);
packet.Itemguid = _OutSellItem.Guid;
packet.SendPacket();
MarketPlayerSell.Instance().CloseOutSellPage();
}
#endregion
}