少年修仙传客户端代码仓库
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
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);
            });
        }
    }
}