From 437ddf790dbb6e2027be870de1e4e682b008b662 Mon Sep 17 00:00:00 2001
From: client_linchunjie <461730578@qq.com>
Date: 星期四, 30 八月 2018 10:53:15 +0800
Subject: [PATCH] Merge branch '2998仙盟宴会界面修改和逻辑修改'

---
 System/WindowBase/WindowCenter.cs               |    2 
 System/Dungeon/DungeonFairyFeastHintWin.cs      |  136 ++++++++++++++++++++++++++++++++++
 System/FairyAu/FairyFeastRankBehaviour.cs.meta  |   12 +++
 System/FairyAu/FairyFeastRankBehaviour.cs       |   20 +++++
 System/Dungeon/DungeonModel.cs                  |    4 
 System/Dungeon/DungeonData.cs                   |   15 +++
 System/Dungeon/DungeonFairyFeastHintWin.cs.meta |   12 +++
 7 files changed, 198 insertions(+), 3 deletions(-)

diff --git a/System/Dungeon/DungeonData.cs b/System/Dungeon/DungeonData.cs
index 5df635b..419fa74 100644
--- a/System/Dungeon/DungeonData.cs
+++ b/System/Dungeon/DungeonData.cs
@@ -104,6 +104,8 @@
         public int topScore;
         public int isFullExp;
         public int leaderID;
+        public FairyFeastRank[] familyPartyRank;
+        public FairyFeastTop familyPartyTop;
 
         public long totalExp
         {
@@ -142,6 +144,19 @@
         }
     }
 
+    public struct FairyFeastRank
+    {
+        public int rank;
+        public string name;
+        public int cnt;
+    }
+
+    public struct FairyFeastTop
+    {
+        public string name;
+        public int cnt;
+    }
+
     public struct ServerItem
     {
         public int ItemID;
diff --git a/System/Dungeon/DungeonFairyFeastHintWin.cs b/System/Dungeon/DungeonFairyFeastHintWin.cs
new file mode 100644
index 0000000..4e61b33
--- /dev/null
+++ b/System/Dungeon/DungeonFairyFeastHintWin.cs
@@ -0,0 +1,136 @@
+锘�//--------------------------------------------------------
+//    [Author]:           绗簩涓栫晫
+//    [  Date ]:           Wednesday, August 29, 2018
+//--------------------------------------------------------
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+namespace Snxxz.UI
+{
+
+    public class DungeonFairyFeastHintWin : Window
+    {
+        [SerializeField] Button m_FairyFeast;
+        [SerializeField] Text m_FairyFeastBtnTxt;
+        [SerializeField] Button m_QuestionRank;
+        [SerializeField] Text m_QuestionRankBtnTxt;
+        [SerializeField] DungeonTargetBehaviour m_TargetBehaviour;
+        [SerializeField] RectTransform m_ContainerRank;
+        [SerializeField] FairyFeastRankBehaviour[] m_RankBehaviours;
+        [SerializeField] FairyFeastRankBehaviour m_TopRank;
+        [SerializeField] DungeonMultipleTaskWin.SelectEffect m_SelectEffect;
+
+        DungeonModel model { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
+
+        int currentSelect = 0;
+        #region Built-in
+        protected override void BindController()
+        {
+            m_FairyFeast.onClick.AddListener(() =>
+            {
+                Select(0);
+            });
+            m_QuestionRank.onClick.AddListener(() =>
+            {
+                Select(1);
+            });
+        }
+
+        protected override void AddListeners()
+        {
+        }
+
+        protected override void OnPreOpen()
+        {
+            Select(0);
+            model.updateMissionEvent += UpdateMissionEvent;
+        }
+
+        protected override void OnAfterOpen()
+        {
+        }
+
+        protected override void OnPreClose()
+        {
+            model.updateMissionEvent -= UpdateMissionEvent;
+        }
+
+        protected override void OnAfterClose()
+        {
+        }
+        #endregion
+
+        private void Select(int _index)
+        {
+            var _color = m_FairyFeast.targetGraphic.color;
+            _color.a = _index == 1 ? m_SelectEffect.unselectAlpha : m_SelectEffect.selectAlpha;
+            m_FairyFeast.targetGraphic.color = _color;
+            m_FairyFeastBtnTxt.color = _index == 1 ? m_SelectEffect.unSelectTextColor : m_SelectEffect.selectTextColor;
+
+            _color = m_QuestionRank.targetGraphic.color;
+            _color.a = _index == 0 ? m_SelectEffect.unselectAlpha : m_SelectEffect.selectAlpha;
+            m_QuestionRank.targetGraphic.color = _color;
+            m_QuestionRankBtnTxt.color = _index == 0 ? m_SelectEffect.unSelectTextColor : m_SelectEffect.selectTextColor;
+
+            m_TargetBehaviour.gameObject.SetActive(_index == 0);
+            m_ContainerRank.gameObject.SetActive(_index == 1);
+            currentSelect = _index;
+            if (_index == 0)
+            {
+                m_TargetBehaviour.Init(31230);
+            }
+            else
+            {
+                DisplayRank();
+            }
+        }
+
+        private void UpdateMissionEvent()
+        {
+            if (currentSelect == 1)
+            {
+                DisplayRank();
+            }
+        }
+
+        void DisplayRank()
+        {
+            var index = 0;
+            if (model.mission.familyPartyRank != null && model.mission.familyPartyRank.Length > 0)
+            {
+                List<FairyFeastRank> list = new List<FairyFeastRank>(model.mission.familyPartyRank);
+                list.Sort(Compare);
+                for (int i = 0; i < m_RankBehaviours.Length; i++)
+                {
+                    if (i < list.Count)
+                    {
+                        var data = list[i];
+                        m_RankBehaviours[i].Display(UIHelper.ServerStringTrim(data.name), data.cnt);
+                        index++;
+                    }
+                }
+            }
+            for (int i = index; i < m_RankBehaviours.Length; i++)
+            {
+                m_RankBehaviours[i].Display(Language.Get("CeremoneyOutOfPrint"), 0);
+            }
+
+            var topName = model.mission.familyPartyTop.name;
+            m_TopRank.Display(string.IsNullOrEmpty(topName) ?
+                Language.Get("CeremoneyOutOfPrint") : topName, string.IsNullOrEmpty(topName) ? 0 : model.mission.familyPartyTop.cnt);
+        }
+
+        int Compare(FairyFeastRank x, FairyFeastRank y)
+        {
+            return x.rank.CompareTo(y.rank);
+        }
+    }
+}
+
+
+
+
diff --git a/System/Dungeon/DungeonFairyFeastHintWin.cs.meta b/System/Dungeon/DungeonFairyFeastHintWin.cs.meta
new file mode 100644
index 0000000..6a95e02
--- /dev/null
+++ b/System/Dungeon/DungeonFairyFeastHintWin.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: d28c93c41cd0c014e8ef4ddbc20a38c0
+timeCreated: 1535531269
+licenseType: Pro
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
diff --git a/System/Dungeon/DungeonModel.cs b/System/Dungeon/DungeonModel.cs
index 00c4558..95bb9e5 100644
--- a/System/Dungeon/DungeonModel.cs
+++ b/System/Dungeon/DungeonModel.cs
@@ -849,9 +849,9 @@
                             WindowCenter.Instance.Open<DungeonMissionHintWin>();
                         }
 
-                        if (!WindowCenter.Instance.CheckOpen<DungeonMissionDetailsWin>())
+                        if (!WindowCenter.Instance.CheckOpen<DungeonFairyFeastHintWin>())
                         {
-                            WindowCenter.Instance.Open<DungeonMissionDetailsWin>();
+                            WindowCenter.Instance.Open<DungeonFairyFeastHintWin>();
                         }
                     }
                     break;
diff --git a/System/FairyAu/FairyFeastRankBehaviour.cs b/System/FairyAu/FairyFeastRankBehaviour.cs
new file mode 100644
index 0000000..537163b
--- /dev/null
+++ b/System/FairyAu/FairyFeastRankBehaviour.cs
@@ -0,0 +1,20 @@
+锘縰sing System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+namespace Snxxz.UI
+{
+    public class FairyFeastRankBehaviour : MonoBehaviour
+    {
+        [SerializeField] Text m_RankName;
+        [SerializeField] Text m_QuestCount;
+
+        public void Display(string _name, int count)
+        {
+            m_RankName.text = _name;
+            m_QuestCount.text = count > 0 ? Language.Get("FairyQuestCount", count) : string.Empty;
+        }
+    }
+}
+
diff --git a/System/FairyAu/FairyFeastRankBehaviour.cs.meta b/System/FairyAu/FairyFeastRankBehaviour.cs.meta
new file mode 100644
index 0000000..cf09e9d
--- /dev/null
+++ b/System/FairyAu/FairyFeastRankBehaviour.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 1f0124458a333b247ba44882c487f1d0
+timeCreated: 1535532258
+licenseType: Pro
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
diff --git a/System/WindowBase/WindowCenter.cs b/System/WindowBase/WindowCenter.cs
index 4bfa32f..d3adfcb 100644
--- a/System/WindowBase/WindowCenter.cs
+++ b/System/WindowBase/WindowCenter.cs
@@ -14,7 +14,7 @@
         List<string> closeAllIgnoreWindows = new List<string>() {
             "MessageWin", "NewBieWin", "NewItemGetWin", "AttributePromoteShowWin" ,"DungeonBeginCoolDownWin","DungeonFightWin","StatusTipWin"
             ,"ScrollTipWin","MarqueeWin","ExperienceOpenWin","TrumpetWin","BattlePrepareCoolDownWin","DungeonGradeWin","BattleHintWin",
-            "TreasureDungeonMissionHintWin","FairyGrabBossHintWin",
+            "TreasureDungeonMissionHintWin","FairyGrabBossHintWin","DungeonFairyFeastHintWin",
         };
 
         UIRoot m_UIRoot;

--
Gitblit v1.8.0