少年修仙传客户端代码仓库
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
61
62
63
64
65
66
67
using UnityEngine;
using UnityEngine.UI;
using vnxbqy.UI;
 
public class CrossServerGodBattleFieldAssortApplicationListCell : CellView
{
    [SerializeField] TextEx txtName;
    [SerializeField] TextEx txtLV;
    [SerializeField] TextEx txtPowerNum;
    [SerializeField] AvatarCell avatarCell;
    [SerializeField] ButtonEx btnYes;
    [SerializeField] ButtonEx btnNo;
    bool isHaveTeam;
    bool isCaptain;
    uint teamID;
    AssortTeamInfo teamInfo;
    AssortMemberInfo ApplicantInfo;
    CrossServerGodBattleFieldAssortModel model { get { return ModelCenter.Instance.GetModel<CrossServerGodBattleFieldAssortModel>(); } }
    public void Display(int index, CellView cell)
    {
        uint playerID = (uint)cell.info.Value.infoInt1;
        isHaveTeam = model.TryGetPlayerTeamInfo(out isCaptain, out teamID, out teamInfo);
        if (!isHaveTeam || teamInfo.ApplicantDict == null)
            return;
        if (!teamInfo.ApplicantDict.TryGetValue(playerID, out ApplicantInfo))
            return;
 
        string serverName = ServerListCenter.Instance.GetServerName((int)ApplicantInfo.ServerID);
        if (ApplicantInfo.RealmLV > 0)
        {
            txtName.text = Language.Get("GodBattleFieldAssort27", serverName, RealmConfig.Get(ApplicantInfo.RealmLV).Name, ApplicantInfo.Name);
        }
        else
        {
            txtName.text = Language.Get("BlessedLand043", serverName, ApplicantInfo.Name);
        }
        txtLV.text = Language.Get("SkillActLevel", ApplicantInfo.LV);
        txtPowerNum.text = UIHelper.ReplaceLargeNum((double)ApplicantInfo.FightPower);
        avatarCell.InitUI(AvatarHelper.GetAvatarModel((int)ApplicantInfo.PlayerID, (int)ApplicantInfo.Face, (int)ApplicantInfo.FacePic, ApplicantInfo.Job));
 
        btnYes.SetListener(() =>
        {
            if (model.IsOpenAction())
            {
                SysNotifyMgr.Instance.ShowTip("GodBattleFieldAssort03");
                return;
            }
            //队伍人员已满
            if (teamInfo.MemberDict.Count + 1 > FunctionTeamSetConfig.Get((int)model.FuncMapID).MemberMax)
            {
                SysNotifyMgr.Instance.ShowTip("TeamMemFull");
            }
            model.SendFuncTeamMemOP(teamID, model.FuncMapID, 3, (uint)playerID);
        });
 
        btnNo.SetListener(() =>
        {
            if (model.IsOpenAction())
            {
                SysNotifyMgr.Instance.ShowTip("GodBattleFieldAssort03");
                return;
            }
            model.SendFuncTeamMemOP(teamID, model.FuncMapID, 4, (uint)playerID);
        });
    }
 
}