少年修仙传客户端代码仓库
hch
2024-12-16 9377811d0ba27047e1e5ec2348a28eba1033d59d
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
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using vnxbqy.UI;
 
public class CelestialPalaceNameListCell : CellView
{
    [SerializeField] AvatarCell avatarCell;
    [SerializeField] Image imgRealm;
    [SerializeField] TextEx txtNum;
    [SerializeField] TextEx txtDate;
    [SerializeField] TextEx txtNew;
    [SerializeField] TextEx txtPlayerInfo;
    [SerializeField] TextEx txtServerName;
    [SerializeField] ButtonEx btnPlayInfo;
    RoleParticularModel roleParticularModel { get { return ModelCenter.Instance.GetModel<RoleParticularModel>(); } }
    CelestialPalaceModel model { get { return ModelCenter.Instance.GetModel<CelestialPalaceModel>(); } }
    public void Display(int index)
    {
        int nowXGId = model.currentSelectedXGId;
        if (nowXGId == 0) return;
        List<CelestialPalacePlayer> xgPlayerList = model.GetSortXGPlayInfo(nowXGId);
        if (xgPlayerList == null || index < 0 || index > xgPlayerList.Count - 1)
            return;
        CelestialPalacePlayer celestialPalacePlayer = xgPlayerList[index];
        avatarCell.InitUI(AvatarHelper.GetAvatarModel((int)celestialPalacePlayer.PlayerID, (int)celestialPalacePlayer.Face, (int)celestialPalacePlayer.FacePic, celestialPalacePlayer.Job));
        int titleId = XiangongConfig.Get(nowXGId).TitleID;
        string serverName = ServerListCenter.Instance.GetServerName((int)celestialPalacePlayer.ServerID);
        txtServerName.text = serverName;
        int realmLV = celestialPalacePlayer.RealmLV;
        string name = celestialPalacePlayer.Name;
        imgRealm.SetActive(realmLV > 0);
        if (realmLV > 0)
        {
            RealmConfig realmConfig = RealmConfig.Get(realmLV);
            if (realmConfig != null)
            {
                imgRealm.SetSprite(realmConfig.Img);
            }
        }
        txtPlayerInfo.text = name;
        txtDate.text = model.GetAddTimeToYearMonthDay(celestialPalacePlayer.AddTime);
        bool isRoomHavePlayer = model.IsNewPlayer(nowXGId, celestialPalacePlayer.PlayerID);
        txtNew.SetActive(isRoomHavePlayer);
        txtNum.SetActive(!isRoomHavePlayer);
        txtNum.text = Language.Get("CelestialPalace11", xgPlayerList.Count - index);
        btnPlayInfo.SetListener(() =>
        {
            roleParticularModel.ViewCrossServerPlayerEquip((int)celestialPalacePlayer.PlayerID);
        });
    }
 
}