From 49c6aef8d723be2220edc53bb7f6bd1775175685 Mon Sep 17 00:00:00 2001
From: client_Hale <339726288@qq.com>
Date: 星期四, 27 十二月 2018 00:07:18 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts

---
 System/CrossServerOneVsOne/SeasonRewardCell.cs |  112 ++++++++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 97 insertions(+), 15 deletions(-)

diff --git a/System/CrossServerOneVsOne/SeasonRewardCell.cs b/System/CrossServerOneVsOne/SeasonRewardCell.cs
index 76bb02c..0c4f1c1 100644
--- a/System/CrossServerOneVsOne/SeasonRewardCell.cs
+++ b/System/CrossServerOneVsOne/SeasonRewardCell.cs
@@ -6,11 +6,14 @@
 using System.Collections;
 using UnityEngine.UI;
 using System.Linq;
+using TableConfig;
 
-namespace Snxxz.UI {
+namespace Snxxz.UI
+{
     //璧涘濂栧姳鐨勫鍔辨潯
     [XLua.Hotfix]
-    public class SeasonRewardCell:MonoBehaviour {
+    public class SeasonRewardCell : MonoBehaviour
+    {
         [SerializeField] Text m_Text_Ranking;
         [SerializeField] Transform m_Itemlist;
         [SerializeField] Button m_ReceiveBtn;
@@ -29,42 +32,69 @@
             set { m_ReceiveBtn = value; }
 
         }
-        public void ScrollerDataTypAndId(ScrollerDataType type,int id)
+        public void ScrollerDataTypAndId(ScrollerDataType type, int id)
         {
             switch (type)
             {
-               case  ScrollerDataType.Header:
-                    SetReceive(id);
+                case ScrollerDataType.Header:
+                    SetReceiveH(id);
                     break;
                 case ScrollerDataType.Normal:
+                    SetReceiveN(id);
                     break;
-
             }
-
         }
 
-        private  void SetReceive(int id)
+        private void SetReceiveH(int id)
         {
             if (!crossServerRewardModel.SeasonRewardDic.AwardDic.ContainsKey(id))
             {
                 return;
             }
+            m_Text_Ranking.gameObject.SetActive(true);
+            m_Segmenttext.gameObject.SetActive(false);
+            m_ImageColor.gameObject.SetActive(true);
+            m_ImageWorld.gameObject.SetActive(true);
             var keyList = crossServerRewardModel.SeasonRewardDic.AwardDic.Keys.ToList();
             int Index = keyList.IndexOf(id);
             if (Index == 0)
             {
-                m_Text_Ranking.text = "1-" + id+"鍚�";
+                m_Text_Ranking.text = "1-" + id + "鍚�";
             }
             else
             {
                 int Number = keyList[(Index - 1)];
-                m_Text_Ranking.text = Number+"-"+ id+"鍚�";
+                m_Text_Ranking.text = (Number+1) + "-" + id + "鍚�";
             }
-            ReceiveItem(id);
+            switch (Index)
+            {
+                case 0:
+                    m_ImageColor.SetSprite("CrossServer_1");
+                    m_ImageWorld.SetSprite("CrossServer_6");
+                    break;
+                case 1:
+                    m_ImageColor.SetSprite("CrossServer_2");
+                    m_ImageWorld.SetSprite("CrossServer_7");
+                    break;
+                case 2:
+                    m_ImageColor.SetSprite("CrossServer_3");
+                    m_ImageWorld.SetSprite("CrossServer_8");
+                    break;
+            }
+            if (CrossServerOneVsOnePKSeason.Instance.SeasonState != 2)
+            {
+                m_ReceiveBtn.gameObject.SetActive(false);
+                m_IsDrawImage.gameObject.SetActive(false);
+                m_IsReachImage.gameObject.SetActive(false);
+            }
+            else
+            {
 
+            }
+            ReceiveItemH(id);
         }
 
-        private void ReceiveItem(int Id)
+        private void ReceiveItemH(int Id)
         {
             var List = crossServerRewardModel.SeasonRewardDic.GetAwardItem(Id);
             for (int i = 0; i < m_Itemlist.childCount; i++)
@@ -78,8 +108,8 @@
                     _ItemCell.Init(cellModel);
                     int type = i;
                     _ItemCell.cellBtn.SetListener(() =>
-                    {                   
-                        ItemAttrData attrData = new ItemAttrData(List[type].item.id, false, (ulong)List[type].item.count,-1, List[type].isBind);
+                    {
+                        ItemAttrData attrData = new ItemAttrData(List[type].item.id, false, (ulong)List[type].item.count, -1, List[type].isBind);
                         itemTipsModel.SetItemTipsModel(attrData);
                     });
                 }
@@ -89,8 +119,60 @@
                 }
 
             }
+        }
+
+        private void SetReceiveN(int Id)
+        {
+            if (!crossServerRewardModel.SeasonRewardConfigDic.ContainsKey(Id))
+            {
+                return;
+            }
+            m_Text_Ranking.gameObject.SetActive(false);
+            m_Segmenttext.gameObject.SetActive(true);
+            m_ImageColor.gameObject.SetActive(true);
+            m_ImageColor.SetSprite("CrossServer_4");
+            m_ImageWorld.gameObject.SetActive(false);
+            var config = Config.Instance.Get<CrossServerArenaConfig>(Id);
+            if (config != null)
+            {
+                m_Segmenttext.text = config.Name;
+            }
+            if (CrossServerOneVsOnePKSeason.Instance.SeasonState != 2)
+            {
+                m_ReceiveBtn.gameObject.SetActive(false);
+                m_IsDrawImage.gameObject.SetActive(false);
+                m_IsReachImage.gameObject.SetActive(false);
+            }
+            else
+            {
 
-
+            }
+            ReceiveItemN(Id);
+        }
+        private void ReceiveItemN(int Id)
+        {
+            var List = crossServerRewardModel.SeasonRewardConfigDic[Id];
+            for (int i = 0; i < m_Itemlist.childCount; i++)
+            {
+                GameObject ObjChild = m_Itemlist.GetChild(i).gameObject;
+                if (i < List.Count)
+                {
+                    ObjChild.SetActive(true);
+                    ItemCell _ItemCell = ObjChild.GetComponent<ItemCell>();
+                    ItemCellModel cellModel = new ItemCellModel(List[i].ItemId, true, (ulong)List[i].ItemNumber, List[i].Isbind);
+                    _ItemCell.Init(cellModel);
+                    int type = i;
+                    _ItemCell.cellBtn.SetListener(() =>
+                    {
+                        ItemAttrData attrData = new ItemAttrData(List[type].ItemId, false, (ulong)List[type].ItemNumber, -1, List[type].Isbind);
+                        itemTipsModel.SetItemTipsModel(attrData);
+                    });
+                }
+                else
+                {
+                    ObjChild.SetActive(false);
+                }
+            }
         }
     }
 

--
Gitblit v1.8.0