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);
|
});
|
}
|
|
}
|