From 5e0fb1f2d7587738d767f39996dc65bc50b72477 Mon Sep 17 00:00:00 2001
From: lcy <1459594991@qq.com>
Date: 星期四, 02 一月 2025 15:35:59 +0800
Subject: [PATCH] 10290 运势-客户端

---
 System/MainInterfacePanel/HighSettingTip.cs |    2 
 System/LoopAct/YunShi/YunShiXBActModel.cs   |   40 ++++++++++++++++++++
 System/LoopAct/YunShi/YunShiXBActWin.cs     |   25 +++++++-----
 3 files changed, 55 insertions(+), 12 deletions(-)

diff --git a/System/LoopAct/YunShi/YunShiXBActModel.cs b/System/LoopAct/YunShi/YunShiXBActModel.cs
index 221711a..fe411cf 100644
--- a/System/LoopAct/YunShi/YunShiXBActModel.cs
+++ b/System/LoopAct/YunShi/YunShiXBActModel.cs
@@ -23,6 +23,8 @@
         //<寻宝类型,<物品id,格子背景编号>>
         public Dictionary<int, Dictionary<int, int>> itemIdBgDict = new Dictionary<int, Dictionary<int, int>>();
 
+        //<寻宝类型,功能ID>
+        public Dictionary<int, int> funcIDDict = new Dictionary<int, int>();
         public int actNum = 10; //对应界面
         public event Action<bool> UpdateMissionEvent;
         public readonly int AwardCellCount = 5;
@@ -50,6 +52,7 @@
         public bool isSkipXB { get; set; }
 
         HappyXBModel happyXBModel { get { return ModelCenter.Instance.GetModelEx<HappyXBModel>(); } }
+        PackModel packModel { get { return ModelCenter.Instance.GetModel<PackModel>(); } }
 
         public override void Init()
         {
@@ -58,6 +61,7 @@
             OperationTimeHepler.Instance.operationAdvanceEvent += OperationAdvanceEvent;
             happyXBModel.RefreshXBTypeInfoAct += OnRefreshXBTypeInfoAct;
             OperationTimeHepler.Instance.operationTimeUpdateEvent += OnOperationTimeUpdateEvent;
+            packModel.refreshItemCountEvent += OnRefreshItemCountEvent;
             OpenServerActivityCenter.Instance.Register(activityID, this, activityType);
 
             var jsonData = JsonMapper.ToObject(FuncConfigConfig.Get("YunShi").Numerical1);
@@ -84,6 +88,15 @@
                     }
                 }
             }
+            jsonData = JsonMapper.ToObject(FuncConfigConfig.Get("YunShi").Numerical2);
+            keyList = jsonData.Keys.ToList();
+            for (int i = 0; i < keyList.Count; i++)
+            {
+                int type = int.Parse(keyList[i]);
+                int funcId = int.Parse(jsonData[keyList[i]].ToJson());
+                funcIDDict[type] = funcId;
+            }
+
         }
 
         public void OnBeforePlayerDataInitialize()
@@ -99,6 +112,12 @@
         {
             happyXBModel.RefreshXBTypeInfoAct -= OnRefreshXBTypeInfoAct;
             OperationTimeHepler.Instance.operationTimeUpdateEvent -= OnOperationTimeUpdateEvent;
+            packModel.refreshItemCountEvent -= OnRefreshItemCountEvent;
+        }
+
+        private void OnRefreshItemCountEvent(PackType type, int arg2, int arg3)
+        {
+            UpdateRedPoint();
         }
 
         private void OnOperationTimeUpdateEvent(Operation operation)
@@ -196,6 +215,10 @@
             list.Sort();
             if (list == null)
                 return;
+
+            if (happyXBModel.IsHaveOneXBTool(type) || (happyXBModel.IsHaveManyXBTool(type, out int toolCnt, out int needToolCnt) && toolCnt >= needToolCnt))
+                redPointTab.state = RedPointState.Simple;
+
             //有奖励未领取
             for (int i = 0; i < AwardCellCount; i++)
             {
@@ -259,6 +282,23 @@
             return ((int)Math.Pow(2, index) & treasureCntAward) == 0 ? 1 : 2;
         }
 
+        public bool IsFuncOpen()
+        {
+            OperationYunShi act;
+            OperationTimeHepler.Instance.TryGetOperation(YunShiXBActModel.operaType, out act);
+            if (act == null)
+                return false;
+
+            int type = act.treasureType;
+            var xbInfo = happyXBModel.GetXBInfoByType(type);
+            if (xbInfo == null)
+                return false;
+
+            if (!funcIDDict.TryGetValue(type, out var funcId))
+                return false;
+            return FuncOpen.Instance.IsFuncOpen(funcId);
+        }
+
         public void SendGetAward(int type, int count)
         {
             CA504_tagCMPlayerGetReward getReward = new CA504_tagCMPlayerGetReward();
diff --git a/System/LoopAct/YunShi/YunShiXBActWin.cs b/System/LoopAct/YunShi/YunShiXBActWin.cs
index 2568fb8..f9c17f5 100644
--- a/System/LoopAct/YunShi/YunShiXBActWin.cs
+++ b/System/LoopAct/YunShi/YunShiXBActWin.cs
@@ -306,18 +306,21 @@
 
         private void ShowGetItem()
         {
-            var xbItemlist = happyXBModel.rangelist;
-            List<Item> itemList = new List<Item>();
-
-            for (int i = 0; i < xbItemlist.Count; i++)
+            if (happyXBModel.title == HappXBTitle.YunShi1 || happyXBModel.title == HappXBTitle.YunShi2 || happyXBModel.title == HappXBTitle.YunShi3 || happyXBModel.title == HappXBTitle.YunShi4)
             {
-                XBGetItem xbItem = xbItemlist[i];
+                var xbItemlist = happyXBModel.rangelist;
+                List<Item> itemList = new List<Item>();
 
-                itemList.Add(new Item(xbItem.itemId, (ulong)xbItem.count));
+                for (int i = 0; i < xbItemlist.Count; i++)
+                {
+                    XBGetItem xbItem = xbItemlist[i];
+
+                    itemList.Add(new Item(xbItem.itemId, (ulong)xbItem.count));
+                }
+                ItemLogicUtility.Instance.ShowGetItem(itemList, seconds: 0);
+                Reset();
+                WindowCenter.Instance.uiRoot.eventSystem.enabled = true;
             }
-            ItemLogicUtility.Instance.ShowGetItem(itemList, seconds: 0);
-            Reset();
-            WindowCenter.Instance.uiRoot.eventSystem.enabled = true;
         }
 
         public void ShakeQianTong()
@@ -470,8 +473,8 @@
             int toolCnt1 = packModel.GetItemCountByID(PackType.Item, funcSet.costToolIds[1]);
             txtXBOneCount.text = StringUtility.Contact(toolCnt0, "/", funcSet.xbNums[0]);
             txtXBManyCount.text = StringUtility.Contact(toolCnt1, "/", funcSet.xbNums[1]);
-            txtXBOne.text = Language.Get("HappyXB101", funcSet.xbNums[0]);
-            txtXBMany.text = Language.Get("HappyXB101", funcSet.xbNums[1]);
+            txtXBOne.text = Language.Get("YunShi07", funcSet.xbNums[0]);
+            txtXBMany.text = Language.Get("YunShi07", funcSet.xbNums[1]);
             RefreshSkipUI();
             txtHasCnt.text = xbInfo.treasureCount.ToString();
             for (int i = 0; i < model.AwardCellCount; i++)
diff --git a/System/MainInterfacePanel/HighSettingTip.cs b/System/MainInterfacePanel/HighSettingTip.cs
index bfd0f16..8b00293 100644
--- a/System/MainInterfacePanel/HighSettingTip.cs
+++ b/System/MainInterfacePanel/HighSettingTip.cs
@@ -121,7 +121,7 @@
             m_JPBN.SetActive(NeedForWhiteModel.Instance.IsOpen());
             m_XY.SetActive(ModelCenter.Instance.GetModel<FairyAffinityLoginActModel>().IsOpen);
             m_LHD.SetActive(ModelCenter.Instance.GetModel<CycleHallActModel>().IsOpen && !ModelCenter.Instance.GetModel<CycleHallActModel>().GetTabIDList().IsNullOrEmpty());
-            m_YS.SetActive(ModelCenter.Instance.GetModel<YunShiXBActModel>().IsOpen);
+            m_YS.SetActive(ModelCenter.Instance.GetModel<YunShiXBActModel>().IsOpen && ModelCenter.Instance.GetModel<YunShiXBActModel>().IsFuncOpen());
             ShowNewActionButton();
         }
 

--
Gitblit v1.8.0