少年修仙传客户端代码仓库
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
//--------------------------------------------------------
//    [Author]:           第二世界
//    [  Date ]:           Wednesday, December 19, 2018
//--------------------------------------------------------
using EnhancedUI.EnhancedScroller;
using System.Collections;
using System.Collections.Generic;
 
using UnityEngine;
using UnityEngine.UI;
using System;
 
namespace vnxbqy.UI
{
 
    public class RankCellCtrl : ScrollerUI
    {
        [SerializeField] Button m_RankButton;
        [SerializeField] Text m_RankNum;
        [SerializeField] Image m_RankNumBottom;
        [SerializeField] Text m_NameTxt;
        [SerializeField] Text m_JobTxt;
        // [SerializeField] Text m_RankWhatTxt;
        [SerializeField] Text m_SegmentTxt;
        [SerializeField] Text m_IntegralTxt;
        [SerializeField] Image m_RealmImage;
        CrossServerOneVsOneRewardModel m_CrossServerRewardModel;
        CrossServerOneVsOneRewardModel crossServerRewardModel { get { return m_CrossServerRewardModel ?? (m_CrossServerRewardModel = ModelCenter.Instance.GetModel<CrossServerOneVsOneRewardModel>()); } }
        RoleParticularModel roleParticularModel { get { return ModelCenter.Instance.GetModel<RoleParticularModel>(); } }
        public override void Refresh(CellView cell)
        {
            int index = cell.index;
            if (index < 3)
            {
                m_RankNumBottom.SetActive(true);
                if (index == 0)
                {
                    m_RankNumBottom.SetSprite("Rank_First");
                }
                else if (index == 1)
                {
                    m_RankNumBottom.SetSprite("Rank_Second");
                }
                else if (index == 2)
                {
                    m_RankNumBottom.SetSprite("Rank_Third");
                }
                m_RankNum.SetActive(false);
            }
            else
            {
                m_RankNumBottom.SetActive(false);
                m_RankNum.text = (index + 1).ToString();
                m_RankNum.SetActive(true);
            }
            m_RealmImage.SetActive(false);
            RankingInformationClass data = null;
            ZoneRankingStruct zoneRanking = new ZoneRankingStruct();
            zoneRanking.ZoneID = crossServerRewardModel.ZoneID;
            zoneRanking.SeasonID = crossServerRewardModel.SeasonID;
            Dictionary<int, RankingInformationClass> rankDic = new Dictionary<int, RankingInformationClass>();
            if (crossServerRewardModel.ZoneRankingDic.ContainsKey(zoneRanking))
            {
                rankDic = crossServerRewardModel.ZoneRankingDic[zoneRanking];
            }
            if (rankDic != null && index < rankDic.Count)
            {
                data = rankDic[index];
            }
            if (data != null)
            {
                m_RankButton.SetListener(() =>
                {
                    //DebugEx.LogError(data.PlayerID);
                    roleParticularModel.ViewCrossServerPlayerEquip(data.PlayerID);
                });
 
                if (data.PlayerID == PlayerDatas.Instance.baseData.PlayerID)
                {
                    m_JobTxt.color = new Color32(16, 157, 6, 255);
                    m_NameTxt.color = new Color32(16, 157, 6, 255);
                }
                else
                {
                    m_JobTxt.color = new Color32(64, 28, 6, 255);
                    m_NameTxt.color = new Color32(64, 28, 6, 255); ;
                }
                m_NameTxt.text = data.PlayerName;
                m_JobTxt.text = OccupationNameConfig.GetOccupationName(data.Job);
                RealmConfig presentCfg = RealmConfig.Get(data.Realm);
                if (data.Realm > 0 && presentCfg != null)
                {
                    m_RealmImage.SetActive(true);
                    m_RealmImage.SetSprite(presentCfg.Img);
                }
                //  m_RankWhatTxt.text = data.Power.ToString();
                Segment(data.DanLv);
                m_IntegralTxt.text = data.PkScore.ToString();
            }
            else
            {
                m_NameTxt.text = Language.Get("L1046");
                m_JobTxt.text = "-";
                //  m_RankWhatTxt.text = "-";
                m_SegmentTxt.text = "-";
                m_IntegralTxt.text = "-";
 
                m_NameTxt.color = UIHelper.GetUIColor(TextColType.NavyBrown);
                m_JobTxt.color = UIHelper.GetUIColor(TextColType.NavyBrown);
                // m_RankWhatTxt.color = UIHelper.GetUIColor(TextColType.NavyBrown);
                m_SegmentTxt.color = UIHelper.GetUIColor(TextColType.NavyBrown);
                m_RankButton.RemoveAllListeners();
            }
        }
 
        private void Segment(int Danlv)
        {
            var config = CrossServerArenaConfig.Get(Danlv);
            m_SegmentTxt.text = config.Name;
            m_SegmentTxt.color = UIHelper.GetDanLVColor(Danlv, true);
            //if (Danlv >= 24)
            //{
            //    m_SegmentTxt.color = new Color32(255, 3, 3, 255);
            //}
            //else if (Danlv < 24 && Danlv > 15)
            //{
            //    m_SegmentTxt.color = new Color32(255, 103, 1, 255);
            //}
            //else if (Danlv < 15 && Danlv > 10)
            //{
            //    m_SegmentTxt.color = new Color32(218, 72, 213, 255);
            //}
            //else
            //{
            //    m_SegmentTxt.color = new Color32(104, 104, 104, 255);
            //}
        }
 
    }
 
 
}