using vnxbqy.UI;
|
using UnityEngine;
|
using UnityEngine.UI;
|
|
public class CrossServerBattleFieldFactionCell : ILBehaviour
|
{
|
Image factionImg;
|
Button showCallbtn;
|
Transform uncallObj;
|
Transform callObj;
|
Text itemName;
|
Button buyCall;
|
Text factionTxt;
|
Text buyerName;
|
|
PackModel packModel = ModelCenter.Instance.GetModelEx<PackModel>();
|
|
protected override void Awake()
|
{
|
factionImg = proxy.GetWidgtEx<Image>("ImageEx");
|
showCallbtn = proxy.GetWidgtEx<Button>("callbtn");
|
uncallObj = proxy.GetWidgtEx<Transform>("uncall");
|
callObj = proxy.GetWidgtEx<Transform>("callobj");
|
|
itemName = proxy.GetWidgtEx<Text>("itemName");
|
buyCall = proxy.GetWidgtEx<Button>("call");
|
factionTxt = proxy.GetWidgtEx<Text>("faction");
|
buyerName = proxy.GetWidgtEx<Text>("buyerName");
|
}
|
|
public void Display(int faction,Int3 action)
|
{
|
factionImg.SetSprite("GSZCIcon" + faction);
|
int num;
|
var state = ILCrossServerModel.Instance.GetActionState(ILCrossServerModel.Instance.selectIndex);
|
string leaderName = ILCrossServerModel.Instance.GetLeaderName(faction, new Int2(action.x, action.y), out num);
|
showCallbtn.SetActiveIL(leaderName != string.Empty && state != 1);
|
showCallbtn.SetListener(()=> {
|
WindowCenter.Instance.OpenIL<CrossServerBattleFieldCallWin>(false, faction);
|
});
|
uncallObj.SetActiveIL(leaderName == string.Empty && state == 3);
|
callObj.SetActiveIL(leaderName != string.Empty || state != 3);
|
|
int count = packModel.GetItemCountByID(PackType.Item, ILCrossServerModel.Instance.callItemID);
|
string itemNameStr = ItemConfig.Get(ILCrossServerModel.Instance.callItemID).ItemName + " x1";
|
itemName.text = UIHelper.AppendColor(count > 0 ? TextColType.White : TextColType.Red, itemNameStr);
|
//buyCall.SetListener(()=> {
|
// CrossServerBattleFieldBuyWin.hour = action.x;
|
// CrossServerBattleFieldBuyWin.minute = action.y;
|
|
// WindowCenter.Instance.OpenIL<CrossServerBattleFieldBuyWin>();
|
|
//});
|
|
factionTxt.text = Language.Get("CrossBattleField20_" + faction);
|
buyerName.text = leaderName == string.Empty ? Language.Get("CrossBattleField37") : leaderName;
|
}
|
|
|
}
|