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