using System.Collections.Generic;
|
using UnityEngine;
|
namespace vnxbqy.UI
|
{
|
public class BlessedLandSeekNormalCell : CellView
|
{
|
[SerializeField] TextEx txtPlayerName;
|
[SerializeField] AvatarCell avatarCell;
|
[SerializeField] ImageEx imgCollectFlag;
|
[SerializeField] ButtonEx btnGo;
|
[SerializeField] List<ItemCell> itemCellList;
|
BlessedLandModel blessedLandModel { get { return ModelCenter.Instance.GetModel<BlessedLandModel>(); } }
|
|
public void Display(int combinedValue)
|
{
|
uint playerId = (uint)combinedValue / 10;
|
int state = combinedValue % 10; //2 数据-周围福地 3 数据-道友福地
|
var mineAreaInfo = blessedLandModel.newAreaDataDict[playerId];
|
var mineItems = mineAreaInfo.MineItems;
|
bool isCollectFlag = false;
|
for (int i = 0; i < itemCellList.Count; i++)
|
{
|
int mineID = mineItems[i].MineID;
|
if (!MineAreaItemConfig.Has(mineID))
|
{
|
itemCellList[i].SetActive(false);
|
}
|
else
|
{
|
itemCellList[i].SetActive(true);
|
int itemID = MineAreaItemConfig.Get(mineID).ItemID;
|
int itemLV = MineAreaItemConfig.Get(mineID).ItemLV;
|
ItemConfig itemConfig = ItemConfig.Get(itemID);
|
itemCellList[i].Init(new ItemCellModel(itemID, false, (ulong)itemLV));
|
itemCellList[i].countText.SetActive(true);
|
itemCellList[i].countText.text = Language.Get("FashionDress106", itemLV);
|
if (mineItems[i].RobPlayerID == blessedLandModel.myPlayerId)
|
isCollectFlag = true;
|
}
|
}
|
imgCollectFlag.SetActive(isCollectFlag);
|
txtPlayerName.text = mineAreaInfo.PlayerID < 10000 ? blessedLandModel.GetNameForPlayerId((int)mineAreaInfo.PlayerID) : mineAreaInfo.PlayerName;
|
avatarCell.InitUI(mineAreaInfo.PlayerID < 10000 ? blessedLandModel.GetModelForPlayerId((int)mineAreaInfo.PlayerID) : AvatarHelper.GetAvatarModel((int)mineAreaInfo.PlayerID, (int)mineAreaInfo.Face, (int)mineAreaInfo.FacePic, mineAreaInfo.Job));
|
btnGo.SetListener(() =>
|
{
|
blessedLandModel.SendCB033Pack(1, playerId);
|
blessedLandModel.SendCB033Pack(4);
|
ModelCenter.Instance.GetModel<BlessedLandModel>().detailsIndex = (byte)index;
|
ModelCenter.Instance.GetModel<BlessedLandModel>().showPlayerId = playerId;
|
DebugEx.Log("showPlayerId: " + playerId);
|
});
|
}
|
}
|
}
|
|