From fbe3a861f641233473a0d1995d147a42f0b43c90 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期五, 07 三月 2025 09:27:52 +0800
Subject: [PATCH] 0312 重置五行第一次免费改1000级,功能预告优化

---
 System/MainInterfacePanel/FeatureNoticeModel.cs |  285 +++++++++++++++++++++++---------------------------------
 1 files changed, 116 insertions(+), 169 deletions(-)

diff --git a/System/MainInterfacePanel/FeatureNoticeModel.cs b/System/MainInterfacePanel/FeatureNoticeModel.cs
index d6b18c7..38ea84f 100644
--- a/System/MainInterfacePanel/FeatureNoticeModel.cs
+++ b/System/MainInterfacePanel/FeatureNoticeModel.cs
@@ -21,67 +21,32 @@
     public event Action UpdateAwarfItem;
     private const int Redpoint_key1 = 38;
     public Redpoint redPointStre1 = new Redpoint(Redpoint_key1);
-    private int OpenFuncId = 0;
-    private bool RedPointChange = false;
-    private bool IsRedPoint = false;
     public int FunctionForecastIndex = 0;
-    private bool  Isbool=true;
+
+    public int ShowLV = 20;//鍏ュ彛鏄剧ず绛夌骇
+
     public override void Init()
     {
         AddList();
-        AddAwardItem();
-        AddRedPoint();
     }
 
     public void OnBeforePlayerDataInitialize()
     {
-        Isbool = true;
         FunctionForecastIndex = 0;
         DicOpenFuncState.Clear();
-        StageLoad.Instance.onStageLoadFinish -= OnStageLoadFinish;
-        PlayerDatas.Instance.playerDataRefreshEvent -= Updatefighting;
     }
 
     public void OnPlayerLoginOk()
     {
-        Isbool = true;
-        StageLoad.Instance.onStageLoadFinish += OnStageLoadFinish;
-        PlayerDatas.Instance.playerDataRefreshEvent += Updatefighting;
-        GlobalTimeEvent.Instance.secondEvent -= secondEvent;
-        GlobalTimeEvent.Instance.secondEvent += secondEvent;
         RedPoint_State();
     }
 
-    private void secondEvent()
-    {
-        if (Isbool)
-        {
-            RedPoint_State();
-            Isbool = false;
-        }
-    }
-
-    private void Updatefighting(PlayerDataType _tCDBPlayerRefresh)
-    {
-        if (_tCDBPlayerRefresh == PlayerDataType.LV &&PlayerDatas.Instance.baseData.LV>=100)
-        {
-            Isbool = true;
-        }
-    }
-
+    
     public override void UnInit()
     {
 
     }
-    private void OnStageLoadFinish()
-    {
-        if (!(StageLoad.Instance.currentStage is DungeonStage))
-        {
-            OpenFuncId = 0;
-            RedPointChange = false;
-            IsRedPoint = false;
-        }
-    }
+    
     private void AddList()//娣诲姞鍒楄〃淇℃伅
     {
         if (FunctionList.Count <= 0)
@@ -90,72 +55,54 @@
             foreach (var key in configs)
             {
                 var functionForecastConfig = FunctionForecastConfig.Get(key);
-                if (functionForecastConfig != null && functionForecastConfig.Display == 1)
-                {
-                    FunctionList.Add(functionForecastConfig);
-                }
+                FunctionList.Add(functionForecastConfig);
+                AddAwardItem(functionForecastConfig);
+                AddRedPoint(functionForecastConfig);
             }
         }
     }
 
-    private void AddAwardItem()
+    
+    private void AddAwardItem(FunctionForecastConfig functionForecastConfig)
     {
-        if (DicAwardItem.Count <= 0)
+        if (!DicAwardItem.ContainsKey(functionForecastConfig.FuncId))
         {
-            var configs = FunctionForecastConfig.GetKeys();
-            foreach (var key in configs)
+            ImpactRankModel.RankAwardItem _award = new ImpactRankModel.RankAwardItem();
+            if (functionForecastConfig.Award == string.Empty)
             {
-                var functionForecastConfig = FunctionForecastConfig.Get(key);
-                if (!DicAwardItem.ContainsKey(functionForecastConfig.FuncId) && functionForecastConfig.Display == 1)
+                return;
+            }
+            var _jsonData = LitJson.JsonMapper.ToObject(functionForecastConfig.Award);
+            foreach (string _key in _jsonData.Keys)
+            {
+                var _job = int.Parse(_key);
+                var _itemArray = LitJson.JsonMapper.ToObject<int[][]>(_jsonData[_key].ToJson());
+                for (int j = 0; j < _itemArray.Length; j++)
                 {
-                    ImpactRankModel.RankAwardItem _award = new ImpactRankModel.RankAwardItem();
-                    if (functionForecastConfig.Award == string.Empty)
-                    {
-                        continue;
-                    }
-                    var _jsonData = LitJson.JsonMapper.ToObject(functionForecastConfig.Award);
-                    foreach (string _key in _jsonData.Keys)
-                    {
-                        var _job = int.Parse(_key);
-                        var _itemArray = LitJson.JsonMapper.ToObject<int[][]>(_jsonData[_key].ToJson());
-                        for (int j = 0; j < _itemArray.Length; j++)
-                        {
-                            _award.Add(_job, new Item(_itemArray[j][0], _itemArray[j][1]));
-                        }
-                    }
-                    DicAwardItem.Add(functionForecastConfig.FuncId, _award);
+                    _award.Add(_job, new Item(_itemArray[j][0], _itemArray[j][1]));
                 }
             }
+            DicAwardItem.Add(functionForecastConfig.FuncId, _award);
         }
-
     }
 
-    private void AddRedPoint()
+    private void AddRedPoint(FunctionForecastConfig functionForecastConfig)
     {
-        if (DicRedPoint.Count <= 0)
+        if (!DicRedPoint.ContainsKey(functionForecastConfig.FuncId))
         {
-            var configs = FunctionForecastConfig.GetKeys();
-            foreach (var key in configs)
-            {
-                var functionForecastConfig = FunctionForecastConfig.Get(key);
-                if (!DicRedPoint.ContainsKey(functionForecastConfig.FuncId) && functionForecastConfig.Display == 1)
-                {
-                    int RedPointkey = Redpoint_key1 * 10000 + functionForecastConfig.FuncId;
-                    Redpoint redPointMountStare = new Redpoint(Redpoint_key1, RedPointkey);
-                    DicRedPoint.Add(functionForecastConfig.FuncId, redPointMountStare);
-                }
-            }
+            int RedPointkey = Redpoint_key1 * 10000 + functionForecastConfig.FuncId;
+            Redpoint redPointMountStare = new Redpoint(Redpoint_key1, RedPointkey);
+            DicRedPoint.Add(functionForecastConfig.FuncId, redPointMountStare);
         }
     }
 
     private void RedPoint_State()
     {
-        var configs = FunctionForecastConfig.GetKeys();
         foreach (var key in DicRedPoint.Keys)
         {
             DicRedPoint[key].state=RedPointState.None;
         }
-        if (PlayerDatas.Instance.baseData.LV <= 19)//鍔熻兘棰勫憡绾㈢偣110绾у墠涓嶆樉绀�
+        if (PlayerDatas.Instance.baseData.LV <= ShowLV)//鍔熻兘棰勫憡绾㈢偣x绾у墠涓嶆樉绀�
         {
             return;
         }
@@ -168,93 +115,93 @@
             }
         }
     }
-    TreasureModel treasureModel { get { return ModelCenter.Instance.GetModel<TreasureModel>(); } }
-    public IEnumerator WhetherToPlayTheBox()
-    {
-        yield return new WaitForSeconds(0.7f);
-        var inDungeon = IsDungeon();
-        var IsOpenMaininterface = WindowCenter.Instance.IsOpen<MainInterfaceWin>();
-        var IsOpenOffLineOnHook = WindowCenter.Instance.IsOpen<OffLineOnHookWin>();
-        var treasureModel = ModelCenter.Instance.GetModel<TreasureModel>();
-        var IsLoading = StageLoad.Instance.isLoading;
-        if (NewBieCenter.Instance.inGuiding || treasureModel.newGotShowing || inDungeon || !IsOpenMaininterface
-            || treasureModel.treasureStageUpShow || WindowCenter.Instance.ExistAnyFullScreenOrMaskWin() ||
-            IsOpenOffLineOnHook || IsLoading)
-        {
-            yield break;
-        }
-        for (int i = 0; i < FunctionList.Count; i++)
-        {
-            if (!FuncOpen.Instance.IsFuncOpen(FunctionList[i].FuncId))
-            {
-                var functionForecastConfig = FunctionForecastConfig.Get(FunctionList[i].FuncId);
-                if (functionForecastConfig.FrameLevel <= 0)
-                {
-                    yield break;
-                }
-                string strKey = "FeatureNotice" + functionForecastConfig.FrameLevel + PlayerDatas.Instance.baseData.PlayerID;
-                int type = LocalSave.GetInt(strKey);
-                bool IsOpenMain = WindowCenter.Instance.IsOpen<MainInterfaceWin>();
-                if (PlayerDatas.Instance.baseData.LV >= functionForecastConfig.FrameLevel && type == 0)
-                {
-                    LocalSave.SetInt(strKey, functionForecastConfig.FrameLevel);
-                   var IsOpenFeatureNotice = WindowCenter.Instance.IsOpen<FeatureNotice2Win>();
-                    if (!IsOpenFeatureNotice)
-                    {
-                        WindowCenter.Instance.Close<MainInterfaceWin>();
-                        WindowCenter.Instance.Open<FeatureNotice2Win>();
-                    }              
-                }
-            }
-        }
-    }
-    public bool IsShowFeatureN()
-    {
-        bool IsBool = false;
-        for (int i = 0; i < FunctionList.Count; i++)
-        {
-            if (!FuncOpen.Instance.IsFuncOpen(FunctionList[i].FuncId))
-            {
-                var functionForecastConfig = FunctionForecastConfig.Get(FunctionList[i].FuncId);
-                if (functionForecastConfig.FrameLevel <= 0)
-                {
-                    return false;
-                }
-                string strKey = "FeatureNotice" + functionForecastConfig.FrameLevel + PlayerDatas.Instance.baseData.PlayerID;
-                int type = LocalSave.GetInt(strKey);
-                bool IsOpenMain = WindowCenter.Instance.IsOpen<MainInterfaceWin>();
-                if (PlayerDatas.Instance.baseData.LV >= functionForecastConfig.FrameLevel && type == 0)
-                {
-                    IsBool = true;
-                }
-            }
-        }
-        return IsBool;
-    }
-    private bool IsDungeon()
-    {
-        var mapId = PlayerDatas.Instance.baseData.MapID;
-        var mapConfig = MapConfig.Get(mapId);
-        return mapConfig != null && mapConfig.MapFBType != 0;
-    }
-    List<FunctionForecastConfig> functionForecastValue = new List<FunctionForecastConfig>();
-    public int GetOpenLv(int Inedx)
-    {
-        int lv = 0;
-        if (functionForecastValue.Count <= 0)
-        {
-            functionForecastValue= FunctionForecastConfig.GetValues();
-        }
-        foreach (var value in functionForecastValue)
-        {
-            if (value.OpenNumber == Inedx)
-            {
-                lv = value.DisplayLevel;
-                return lv;
-            }
-        }     
-        return lv;
-    }
+    //TreasureModel treasureModel { get { return ModelCenter.Instance.GetModel<TreasureModel>(); } }
+    //public IEnumerator WhetherToPlayTheBox()
+    //{
+    //    yield return new WaitForSeconds(0.7f);
+    //    var inDungeon = IsDungeon();
+    //    var IsOpenMaininterface = WindowCenter.Instance.IsOpen<MainInterfaceWin>();
+    //    var IsOpenOffLineOnHook = WindowCenter.Instance.IsOpen<OffLineOnHookWin>();
+    //    var treasureModel = ModelCenter.Instance.GetModel<TreasureModel>();
+    //    var IsLoading = StageLoad.Instance.isLoading;
+    //    if (NewBieCenter.Instance.inGuiding || treasureModel.newGotShowing || inDungeon || !IsOpenMaininterface
+    //        || treasureModel.treasureStageUpShow || WindowCenter.Instance.ExistAnyFullScreenOrMaskWin() ||
+    //        IsOpenOffLineOnHook || IsLoading)
+    //    {
+    //        yield break;
+    //    }
+    //    for (int i = 0; i < FunctionList.Count; i++)
+    //    {
+    //        if (!FuncOpen.Instance.IsFuncOpen(FunctionList[i].FuncId))
+    //        {
+    //            var functionForecastConfig = FunctionForecastConfig.Get(FunctionList[i].FuncId);
+    //            if (functionForecastConfig.FrameLevel <= 0)
+    //            {
+    //                yield break;
+    //            }
+    //            string strKey = "FeatureNotice" + functionForecastConfig.FrameLevel + PlayerDatas.Instance.baseData.PlayerID;
+    //            int type = LocalSave.GetInt(strKey);
+    //            bool IsOpenMain = WindowCenter.Instance.IsOpen<MainInterfaceWin>();
+    //            if (PlayerDatas.Instance.baseData.LV >= functionForecastConfig.FrameLevel && type == 0)
+    //            {
+    //                LocalSave.SetInt(strKey, functionForecastConfig.FrameLevel);
+    //               var IsOpenFeatureNotice = WindowCenter.Instance.IsOpen<FeatureNotice2Win>();
+    //                if (!IsOpenFeatureNotice)
+    //                {
+    //                    WindowCenter.Instance.Close<MainInterfaceWin>();
+    //                    WindowCenter.Instance.Open<FeatureNotice2Win>();
+    //                }              
+    //            }
+    //        }
+    //    }
+    //}
+    //public bool IsShowFeatureN()
+    //{
+    //    bool IsBool = false;
+    //    for (int i = 0; i < FunctionList.Count; i++)
+    //    {
+    //        if (!FuncOpen.Instance.IsFuncOpen(FunctionList[i].FuncId))
+    //        {
+    //            var functionForecastConfig = FunctionForecastConfig.Get(FunctionList[i].FuncId);
+    //            if (functionForecastConfig.FrameLevel <= 0)
+    //            {
+    //                return false;
+    //            }
+    //            string strKey = "FeatureNotice" + functionForecastConfig.FrameLevel + PlayerDatas.Instance.baseData.PlayerID;
+    //            int type = LocalSave.GetInt(strKey);
+    //            bool IsOpenMain = WindowCenter.Instance.IsOpen<MainInterfaceWin>();
+    //            if (PlayerDatas.Instance.baseData.LV >= functionForecastConfig.FrameLevel && type == 0)
+    //            {
+    //                IsBool = true;
+    //            }
+    //        }
+    //    }
+    //    return IsBool;
+    //}
+    //private bool IsDungeon()
+    //{
+    //    var mapId = PlayerDatas.Instance.baseData.MapID;
+    //    var mapConfig = MapConfig.Get(mapId);
+    //    return mapConfig != null && mapConfig.MapFBType != 0;
+    //}
+    //List<FunctionForecastConfig> functionForecastValue = new List<FunctionForecastConfig>();
+    //public int GetOpenLv(int Inedx)
+    //{
+    //    int lv = 0;
+    //    if (functionForecastValue.Count <= 0)
+    //    {
+    //        functionForecastValue= FunctionForecastConfig.GetValues();
+    //    }
+    //    foreach (var value in functionForecastValue)
+    //    {
+    //        if (value.OpenNumber == Inedx)
+    //        {
+    //            lv = value.DisplayLevel;
+    //            return lv;
+    //        }
+    //    }     
+    //    return lv;
+    //}
     public class OpenFuncState
     {
         public int State;

--
Gitblit v1.8.0