少年修仙传客户端代码仓库
lcy
2024-12-16 a39c35fc6449430cd02bccb681c4a0a880e46cd9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
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;
    }
 
 
}