From 02c0f5ea45f87655389a5b392cf00268601e67bb Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期三, 10 十二月 2025 11:12:31 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.1.20:10010/r/Project_SG_scripts
---
Main/System/OSActivity/OSActivityManager.cs | 114 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 110 insertions(+), 4 deletions(-)
diff --git a/Main/System/OSActivity/OSActivityManager.cs b/Main/System/OSActivity/OSActivityManager.cs
index 38faf81..f435452 100644
--- a/Main/System/OSActivity/OSActivityManager.cs
+++ b/Main/System/OSActivity/OSActivityManager.cs
@@ -65,9 +65,7 @@
osHeroCallGiftSortList.Add(_list[i] + 100000000);
}
- config = FuncConfigConfig.Get("OSACelebration");
- osGalaOpenDays = int.Parse(config.Numerical1);
- osGalaScoreAwards = ConfigParse.ParseIntArray2Dict(config.Numerical2);
+ ParseOSGalaConfig();
}
// 寮�鏈嶆帓琛屾椿鍔ㄦ槸鍚﹀紑鍚�
@@ -147,6 +145,7 @@
return a.CompareTo(b);
}
+ //寮�鏈嶆嫑鍕熸绀煎寘
public void RefreshGiftSortList()
{
osHeroCallGiftSortList.Sort(CmpGift);
@@ -165,6 +164,7 @@
{
osMainLevelRedpoint.state = !DayRemind.Instance.GetDayRemind(DayRemind.OSMainLevel) ? RedPointState.Simple : RedPointState.None;
osHeroCallRedpoint.state = RedPointState.None;
+ osGalaRedpoint3.state = RedPointState.None;
if (StoreModel.Instance.freeShopDict.Count == 0) return;
@@ -179,6 +179,22 @@
if (StoreModel.Instance.GetShopLimitBuyCount(shopID) < config.LimitCnt)
{
osHeroCallRedpoint.state = RedPointState.Simple;
+ break;
+ }
+ }
+ }
+
+ if (StoreModel.Instance.freeShopDict.ContainsKey((int)StoreFunc.OSGalaGift))
+ {
+ 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;
}
}
@@ -199,16 +215,29 @@
#region 寮�鏈嶅簡鍏�
//寮�鏈嶅簡鍏�
public int osGalaOpenDays = 0; //鎸佺画澶╂暟
- public Dictionary<int, int[][]> osGalaScoreAwards = new Dictionary<int, int[][]>(); // 寮�鏈嶅簡鍏哥Н鍒嗗鍔�
+ 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()
@@ -221,6 +250,83 @@
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