From 0548a2d4e8cb2b39e16a47fc050551ec65a7033a Mon Sep 17 00:00:00 2001
From: client_Zxw <826696702@qq.com>
Date: 星期六, 24 十一月 2018 11:49:25 +0800
Subject: [PATCH] 4714 【1.3】【前端】新的洗练副本-冰晶矿脉(新),原冰晶矿脉副本删除

---
 System/Dungeon/IceCrystalVeinModel.cs |   56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 System/Dungeon/IceCrystalVeinWin.cs   |    2 +-
 2 files changed, 55 insertions(+), 3 deletions(-)

diff --git a/System/Dungeon/IceCrystalVeinModel.cs b/System/Dungeon/IceCrystalVeinModel.cs
index 563b706..388b5de 100644
--- a/System/Dungeon/IceCrystalVeinModel.cs
+++ b/System/Dungeon/IceCrystalVeinModel.cs
@@ -26,6 +26,7 @@
 {
     public Dictionary<int, IceLodeStarAwardClass> DicIceLodeStarAward = new Dictionary<int, IceLodeStarAwardClass>();
     public List<int> LineList = new List<int>();//鐜╂硶鍒楄〃
+    private List<IceLodeStarAwardClass> IceLodeStarAwardList = new List<IceLodeStarAwardClass>();
     public Dictionary<int, string> IconKeyDic = new Dictionary<int, string>();
     public int AwardRecord = 0;//棰嗗璁板綍
     public int HasSweep = 0;//鏄惁宸叉壂鑽�
@@ -37,6 +38,8 @@
     DungeonModel m_Model;
     DungeonModel model { get { return m_Model ?? (m_Model = ModelCenter.Instance.GetModel<DungeonModel>()); } }
     public const int ICECRYSTALVEIN_MAPID = 31140;
+    public const int ICECRYSTALVEIN_REDPOINT = 78102;
+    public Redpoint Redpoint = new Redpoint(78001, ICECRYSTALVEIN_REDPOINT);
     public override void Init()
     {
         var IceLodeCfg = Config.Instance.Get<FuncConfigConfig>("IceLodeCfg");
@@ -49,15 +52,26 @@
     }
     public void OnBeforePlayerDataInitialize()
     {
-
+        model.dungeonRecordChangeEvent -= dungeonRecordChangeEvent;
     }
+
+    private void dungeonRecordChangeEvent(int fbId)
+    {
+        if (fbId == ICECRYSTALVEIN_MAPID)
+        {
+            IsShowRedPoint();
+        }
+    }
+
     public override void UnInit()
     {
 
     }
     public void OnPlayerLoginOk()
     {
-
+        model.dungeonRecordChangeEvent += dungeonRecordChangeEvent;
+        AddIceLodeStarAwardList();
+        IsShowRedPoint();
     }
 
     private void Assignment()
@@ -107,6 +121,8 @@
         AwardRecord = (int)info.AwardRecord;
         HasSweep = (int)info.HasSweep;
         DayLv = (int)info.DayLV;
+        AddIceLodeStarAwardList();
+        IsShowRedPoint();
         if (UpdateIceLodeInf != null)
         {
             UpdateIceLodeInf();
@@ -163,6 +179,42 @@
         }
         return true;
     }
+
+    private void AddIceLodeStarAwardList()
+    {
+        IceLodeStarAwardList.Clear();
+        foreach (var key in DicIceLodeStarAward.Keys)
+        {
+            var Dic = DicIceLodeStarAward[key];
+            int Lv = DayLv;
+            if (Lv >= Dic.MinLv && Lv <= Dic.MaxLv)
+            {
+                IceLodeStarAwardList.Add(Dic);
+            }
+        }
+    }
+    private void  IsShowRedPoint()//鏄惁鏄剧ず绾㈢偣
+    {
+        bool Isbool = false;
+        for (int i = 0; i < IceLodeStarAwardList.Count; i++)
+        {
+            IceLodeStarAwardClass IceLode = IceLodeStarAwardList[i];
+            int All_star = GetAllStar();
+            bool _bool = MathUtility.GetBitValue((uint)AwardRecord, (ushort)IceLode.Index);
+            if (All_star >= IceLode.Star && !_bool)
+            {
+                Isbool = true;
+            }
+        }
+        if (Isbool)
+        {
+            Redpoint.state = RedPointState.Simple;
+        }
+        else
+        {
+            Redpoint.state = RedPointState.None;
+        }
+    }
 }
 
 
diff --git a/System/Dungeon/IceCrystalVeinWin.cs b/System/Dungeon/IceCrystalVeinWin.cs
index abf68a6..278be1f 100644
--- a/System/Dungeon/IceCrystalVeinWin.cs
+++ b/System/Dungeon/IceCrystalVeinWin.cs
@@ -109,7 +109,7 @@
 
         private void dungeonRecordChangeEvent(int fbId)
         {
-            if (fbId == 31140)
+            if (fbId == IceCrystalVeinModel.ICECRYSTALVEIN_MAPID)
             {
                 StarAll = iceCrystalVeinModel.GetAllStar();
                 SetGridBotton();

--
Gitblit v1.8.0