From 51b0f6ed9f4e1d3bb6f8144470b46908c7699a96 Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期一, 11 五月 2026 16:20:37 +0800
Subject: [PATCH] Merge branch 'master' into h5version

---
 Main/System/OSActivity/OSActivityManager.cs |  289 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 285 insertions(+), 4 deletions(-)

diff --git a/Main/System/OSActivity/OSActivityManager.cs b/Main/System/OSActivity/OSActivityManager.cs
index 3c24867..f981cb8 100644
--- a/Main/System/OSActivity/OSActivityManager.cs
+++ b/Main/System/OSActivity/OSActivityManager.cs
@@ -10,14 +10,26 @@
     Dictionary<int, int[]> rankOpenDays = new Dictionary<int, int[]>();  //鎺掕姒滅被鍨嬶細銆愬紑濮嬪紑鏈嶅ぉ, 缁撴潫寮�鏈嶅ぉ銆�
     public Dictionary<int, int[][]> mainLevelRankAwards = new Dictionary<int, int[][]>();  //涓荤嚎鍏冲崱鍚嶆锛氬鍔�
     public Dictionary<int, int[][]> heroCallRankAwards = new Dictionary<int, int[][]>();  //姝﹀皢鎷涘嫙鍚嶆锛氬鍔�
+    public Dictionary<int, int[][]> beautyMMRankAwards = new Dictionary<int, int[][]>();  //绾㈤鍐叉鍚嶆锛氬鍔�
+    public Dictionary<int, int[][]> heroTrainRankAwards = new Dictionary<int, int[][]>();  //姝﹀皢鍐叉鍚嶆锛氬鍔�
+    public Dictionary<int, int[][]> minggeRankAwards = new Dictionary<int, int[][]>();  //鍛芥牸鍐叉锛氬鍔�
 
     public List<int> osHeroCallGiftSortList = new List<int>();    //寮�鏈嶆嫑鍕熺ぜ鍖� 鍏呭�糏D + 100000000
+    public List<int> osBeautyMMGiftSortList = new List<int>();    //绾㈤鍐叉绀煎寘 鍏呭�糏D + 100000000
+    public List<int> osHeroTrainGiftSortList = new List<int>();    //姝﹀皢鍐叉绀煎寘 鍏呭�糏D + 100000000
+    public List<int> osMinggeGiftSortList = new List<int>();    //鍛芥牸鍐叉绀煎寘 鍏呭�糏D + 100000000
 
+    //寮�鏈嶆瀵瑰簲鐨勫姛鑳絀D
     Dictionary<int, int> rankTypeToFuncID = new Dictionary<int, int>()
     {
         {3, 45},
         {4, 46},
+        {7, 59},
+        {8, 60},
+        {9, 61},
     };
+
+
 
     public override void Init()
     {
@@ -38,6 +50,8 @@
 
     void BeforePlayerDataInitialize()
     {
+        osGalaScore = 0; //褰撳墠绉垎 绱鐨勶紱娑堣�楃殑鏄揣甯�55
+        osGalaAwardState = 0; //鎸変綅璁板綍鏄惁棰嗗彇
     }
 
     void ParseConfig()
@@ -46,6 +60,11 @@
         rankOpenDays = ConfigParse.ParseIntArrayDict(config.Numerical1);
         mainLevelRankAwards = ConfigParse.ParseIntArray2Dict(config.Numerical2);
         heroCallRankAwards = ConfigParse.ParseIntArray2Dict(config.Numerical3);
+        beautyMMRankAwards = ConfigParse.ParseIntArray2Dict(config.Numerical4);
+
+        config = FuncConfigConfig.Get("OSABillboardTrain");
+        heroTrainRankAwards = ConfigParse.ParseIntArray2Dict(config.Numerical3);
+        minggeRankAwards = ConfigParse.ParseIntArray2Dict(config.Numerical5);
 
         var list = StoreModel.Instance.storeTypeDict[(int)StoreFunc.OSHeroCall];
         var _list = RechargeManager.Instance.GetCTGIDListByType(18);
@@ -60,10 +79,50 @@
             osHeroCallGiftSortList.Add(_list[i] + 100000000);
         }
 
+        list = StoreModel.Instance.storeTypeDict[(int)StoreFunc.OSBeautyMM];
+        _list = RechargeManager.Instance.GetCTGIDListByType(22);
+
+        for (int i = 0; i < list.Count; i++)
+        {
+            var item = list[i];
+            osBeautyMMGiftSortList.Add(item.shopId);
+        }
+        for (int i = 0; i < _list.Count; i++)
+        {
+            osBeautyMMGiftSortList.Add(_list[i] + 100000000);
+        }
+
+        list = StoreModel.Instance.storeTypeDict[(int)StoreFunc.OSHeroTrain];
+        _list = RechargeManager.Instance.GetCTGIDListByType(23);
+
+        for (int i = 0; i < list.Count; i++)
+        {
+            var item = list[i];
+            osHeroTrainGiftSortList.Add(item.shopId);
+        }
+        for (int i = 0; i < _list.Count; i++)
+        {
+            osHeroTrainGiftSortList.Add(_list[i] + 100000000);
+        }
+
+        list = StoreModel.Instance.storeTypeDict[(int)StoreFunc.OSMingge];
+        _list = RechargeManager.Instance.GetCTGIDListByType(24);
+
+        for (int i = 0; i < list.Count; i++)
+        {
+            var item = list[i];
+            osMinggeGiftSortList.Add(item.shopId);
+        }
+        for (int i = 0; i < _list.Count; i++)
+        {
+            osMinggeGiftSortList.Add(_list[i] + 100000000);
+        }
+
+        ParseOSGalaConfig();
     }
 
     // 寮�鏈嶆帓琛屾椿鍔ㄦ槸鍚﹀紑鍚�
-    public bool IsOpened(int rankType)
+    public bool IsOpened(int rankType, bool needLastDay = true)
     {
         if (!rankTypeToFuncID.ContainsKey(rankType))
         {
@@ -82,9 +141,19 @@
         }
 
         var openDays = rankOpenDays[rankType];
-        if (TimeUtility.OpenDay > openDays[1])
+        if (needLastDay)
         {
-            return false;
+            if (TimeUtility.OpenDay > openDays[1])
+            {
+                return false;
+            }
+        }
+        else
+        {
+            if (TimeUtility.OpenDay >= openDays[1])
+            {
+                return false;
+            }
         }
 
         return true;
@@ -139,9 +208,13 @@
         return a.CompareTo(b);
     }
 
+    //寮�鏈嶆嫑鍕熸绀煎寘
     public void RefreshGiftSortList()
     {
         osHeroCallGiftSortList.Sort(CmpGift);
+        osBeautyMMGiftSortList.Sort(CmpGift);
+        osHeroTrainGiftSortList.Sort(CmpGift);
+        osMinggeGiftSortList.Sort(CmpGift);
     }
 
     void RefreshStore()
@@ -152,15 +225,27 @@
 
     Redpoint osMainLevelRedpoint = new Redpoint(MainRedDot.RedPoint_OSMainLevel);
     Redpoint osHeroCallRedpoint = new Redpoint(MainRedDot.RedPoint_OSHeroCard);
+    Redpoint osHeroTrainRedpoint = new Redpoint(MainRedDot.RedPoint_OSHeroTrain);
+    Redpoint osBeautyMMRedpoint = new Redpoint(MainRedDot.RedPoint_OSBeautyMM);
+    Redpoint osMinggeRedpoint = new Redpoint(MainRedDot.RedPoint_OSMingge);
 
     public void UpdateRedpoint()
     {
         osMainLevelRedpoint.state = !DayRemind.Instance.GetDayRemind(DayRemind.OSMainLevel) ? RedPointState.Simple : RedPointState.None;
+        osGalaRedpoint2.state = IsOpenedOSGala() && !DayRemind.Instance.GetDayRemind(DayRemind.OSGalaChange) ? RedPointState.Simple : RedPointState.None;
+        osHeroTrainRedpoint.state = !DayRemind.Instance.GetDayRemind(DayRemind.OSMainLevel) ? RedPointState.Simple : RedPointState.None;
+        osBeautyMMRedpoint.state = !DayRemind.Instance.GetDayRemind(DayRemind.OSMainLevel) ? RedPointState.Simple : RedPointState.None;
+        osMinggeRedpoint.state = !DayRemind.Instance.GetDayRemind(DayRemind.OSMainLevel) ? RedPointState.Simple : RedPointState.None;
+
         osHeroCallRedpoint.state = RedPointState.None;
+        osGalaRedpoint3.state = RedPointState.None;
+        osHeroTrainRedpoint.state = RedPointState.None;
+        osBeautyMMRedpoint.state = RedPointState.None;
+        osMinggeRedpoint.state = RedPointState.None;
 
         if (StoreModel.Instance.freeShopDict.Count == 0) return;
 
-        if (StoreModel.Instance.freeShopDict.ContainsKey((int)StoreFunc.OSHeroCall))
+        if (StoreModel.Instance.freeShopDict.ContainsKey((int)StoreFunc.OSHeroCall) && IsOpened(4, false))
         {
             var shopList = StoreModel.Instance.freeShopDict[(int)StoreFunc.OSHeroCall];
 
@@ -175,6 +260,68 @@
                 }
             }
         }
+
+        if (StoreModel.Instance.freeShopDict.ContainsKey((int)StoreFunc.OSGalaGift) && IsOpenedOSGala(false))
+        {
+            var shopList = StoreModel.Instance.freeShopDict[(int)StoreFunc.OSGalaGift];
+
+            for (int i = 0; i < shopList.Count; i++)
+            {
+                var shopID = shopList[i];
+                var config = StoreConfig.Get(shopID);
+                if (StoreModel.Instance.GetShopLimitBuyCount(shopID) < config.LimitCnt)
+                {
+                    osGalaRedpoint3.state = RedPointState.Simple;
+                    break;
+                }
+            }
+        }
+
+        if (StoreModel.Instance.freeShopDict.ContainsKey((int)StoreFunc.OSHeroTrain) && IsOpened(7, false))
+        {
+            var shopList = StoreModel.Instance.freeShopDict[(int)StoreFunc.OSHeroTrain];
+            for (int i = 0; i < shopList.Count; i++)
+            {
+                var shopID = shopList[i];
+                var config = StoreConfig.Get(shopID);
+                if (StoreModel.Instance.GetShopLimitBuyCount(shopID) < config.LimitCnt)
+                {
+                    osHeroTrainRedpoint.state = RedPointState.Simple;
+                    break;
+                }
+            }
+        }
+
+        if (StoreModel.Instance.freeShopDict.ContainsKey((int)StoreFunc.OSBeautyMM) && IsOpened(8, false))
+        {
+            var shopList = StoreModel.Instance.freeShopDict[(int)StoreFunc.OSBeautyMM];
+            for (int i = 0; i < shopList.Count; i++)
+            {
+                var shopID = shopList[i];
+                var config = StoreConfig.Get(shopID);
+                if (StoreModel.Instance.GetShopLimitBuyCount(shopID) < config.LimitCnt)
+                {
+                    osBeautyMMRedpoint.state = RedPointState.Simple;
+                    break;
+                }
+            }
+        }
+
+
+        if (StoreModel.Instance.freeShopDict.ContainsKey((int)StoreFunc.OSMingge) && IsOpened(9, false))
+        {
+            var shopList = StoreModel.Instance.freeShopDict[(int)StoreFunc.OSMingge];
+            for (int i = 0; i < shopList.Count; i++)
+            {
+                var shopID = shopList[i];
+                var config = StoreConfig.Get(shopID);
+                if (StoreModel.Instance.GetShopLimitBuyCount(shopID) < config.LimitCnt)
+                {
+                    osMinggeRedpoint.state = RedPointState.Simple;
+                    break;
+                }
+            }
+        }
     }
 
     private void FuncStateChange(int funcId)
@@ -183,8 +330,142 @@
         {
             case FuncOpenEnum.OSMainLevl:
             case FuncOpenEnum.OSHeroCall:
+            case FuncOpenEnum.OSHeroTrain:
+            case FuncOpenEnum.OSBeautyMM:
+            case FuncOpenEnum.OSMingge:
                 UpdateRedpoint();
                 break;
         }
     }
+
+    #region 寮�鏈嶅簡鍏�
+    //寮�鏈嶅簡鍏�
+    public int osGalaOpenDays = 0; //鎸佺画澶╂暟
+    public Dictionary<int, int[][]> osGalaScoreAwards = new Dictionary<int, int[][]>();  // 寮�鏈嶅簡鍏哥Н鍒嗗鍔� 绉垎锛氬鍔�
+    public Dictionary<int, int> typeToGuideID = new Dictionary<int, int>();
+    public List<int> osGalaChangeSortList = new List<int>();    //鍏戞崲鍒楄〃锛堝晢搴�5锛�
+    public List<int> osGalaGiftSortList = new List<int>();    //寮�鏈嶅簡鍏哥ぜ鍖� 鍏呭�糏D + 100000000
+
+    public int osGalaScore = 0; //褰撳墠绉垎 绱鐨勶紱娑堣�楃殑鏄揣甯�55
+    public int osGalaAwardState = 0; //鎸変綅璁板綍鏄惁棰嗗彇
+    public event Action OnOSGalaDataChangeEvent;
+
+    // 鍏戞崲鍟嗗簵
+    Redpoint osGalaRedpoint2 = new Redpoint(MainRedDot.RedPoint_OSGala, MainRedDot.RedPoint_OSGala * 10 + 2);
+    // 绀煎寘鍏嶈垂
+    Redpoint osGalaRedpoint3 = new Redpoint(MainRedDot.RedPoint_OSGala, MainRedDot.RedPoint_OSGala * 10 + 3);
+    // 鎬诲鍔�
+    Redpoint osGalaRedpoint4 = new Redpoint(MainRedDot.RedPoint_OSGala, MainRedDot.RedPoint_OSGala * 10 + 4);
+
+
+    public void UpdateOSGalaData(HAB05_tagSCOSACelebrationInfo netPack)
+    {
+        osGalaScore = (int)netPack.PointTotal;
+        osGalaAwardState = (int)netPack.PointAward;
+        OnOSGalaDataChangeEvent?.Invoke();
+        UpdateGalaRedpoint();
+    }
+
+    public bool IsOpenedOSGala(bool needLastDay = true)
+    {
+        if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.OSGala))
+        {
+            return false;
+        }
+
+        if (TotDayRechargeManager.Instance.IsOpen || TotalRechargeManager.Instance.IsOpen)
+        {
+            return true;
+        }
+
+        if (needLastDay)
+        {
+            //缁撴潫鍚庡欢杩熶竴澶╁叧闂睍绀�
+            return TimeUtility.OpenDay <= osGalaOpenDays;
+        }
+        else
+        {
+            return TimeUtility.OpenDay < osGalaOpenDays;
+        }
+    }
+
+    // 鏄惁宸查鍙栧鍔�
+    public bool IsGotAward(int index)
+    {
+        return (osGalaAwardState & (1 << index)) != 0;
+    }
+
+    // 鏄惁鍙鍙栧鍔�
+    public bool CanGetAward(int index, int score)
+    {
+        if (IsGotAward(index))
+        {
+            return false;
+        }
+
+        if (osGalaScore < score)
+        {
+            return false;
+        }
+
+        return true;
+    }
+
+    void ParseOSGalaConfig()
+    {
+        var config = FuncConfigConfig.Get("OSACelebration");
+        osGalaOpenDays = int.Parse(config.Numerical1);
+        osGalaScoreAwards = ConfigParse.ParseIntArray2Dict(config.Numerical2);
+
+        config = FuncConfigConfig.Get("Achievement");
+        typeToGuideID = ConfigParse.ParseIntDict(config.Numerical1);
+
+
+        var list = StoreModel.Instance.storeTypeDict[(int)StoreFunc.OSGalaChange];
+        for (int i = 0; i < list.Count; i++)
+        {
+            var item = list[i];
+            osGalaChangeSortList.Add(item.shopId);
+        }
+
+        var _list1 = StoreModel.Instance.storeTypeDict[(int)StoreFunc.OSGalaGift];
+        var _list2 = RechargeManager.Instance.GetCTGIDListByType(19);
+        for (int i = 0; i < _list1.Count; i++)
+        {
+            var item = _list1[i];
+            osGalaGiftSortList.Add(item.shopId);
+        }
+        for (int i = 0; i < _list2.Count; i++)
+        {
+            osGalaGiftSortList.Add(_list2[i] + 100000000);
+        }
+    }
+
+    public void RefreshOSGalaGiftSortList()
+    {
+        osGalaGiftSortList.Sort(CmpGift);
+    }
+
+    public void RefreshOSGalaChangeSortList()
+    {
+        osGalaGiftSortList.Sort(CmpGift);
+    }
+
+    void UpdateGalaRedpoint()
+    {
+        osGalaRedpoint4.state = RedPointState.None;
+        var keys = osGalaScoreAwards.Keys.ToList();
+        keys.Sort();
+        for (int i = 0; i < keys.Count; i++)
+        {
+            var score = keys[i];
+            if (CanGetAward(i, score))
+            {
+                osGalaRedpoint4.state = RedPointState.Simple;
+                return;
+            }
+        }
+
+    }
+    #endregion
 }

--
Gitblit v1.8.0