From c6ea64fb4e4755c4290bf5228d8cd463bc81c21f Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期四, 13 十一月 2025 21:42:16 +0800
Subject: [PATCH] 0312 英雄之路红点受限每日任务开启;增加检测装备输出

---
 Main/Component/UI/Common/PopupWindowsProcessor.cs |   73 +++++++++++++++++++-----------------
 1 files changed, 38 insertions(+), 35 deletions(-)

diff --git a/Main/Component/UI/Common/PopupWindowsProcessor.cs b/Main/Component/UI/Common/PopupWindowsProcessor.cs
index 480b430..dd730d9 100644
--- a/Main/Component/UI/Common/PopupWindowsProcessor.cs
+++ b/Main/Component/UI/Common/PopupWindowsProcessor.cs
@@ -1,4 +1,3 @@
-using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 
@@ -11,23 +10,29 @@
 {
     // 寮圭獥闃熷垪锛屽瓨鍌ㄥ緟澶勭悊鐨勫脊绐楄姹�
     List<PopupWindow> popupWindowQueue = new List<PopupWindow>();
-    
+
     // 褰撳墠姝e湪鏄剧ず鐨勫脊绐�
     PopupWindow currentWindow;
 
+    float firstTime = 0; //鎵撳紑HomeWin鏃剁殑鏃堕棿
+    float stayTime;
+    bool homeWinFirstOpened = false; //HomeWin鏄惁绗竴娆℃墦寮�
+
+
     // 涓婃寮圭獥鏃堕棿锛岀敤浜庢帶鍒跺脊绐椾箣闂寸殑闂撮殧
     float lastTime = 0; //涓婃寮圭獥鏃堕棿
-    
+
     /// <summary>
     /// 娣诲姞涓�涓脊绐楀埌澶勭悊闃熷垪
     /// </summary>
     /// <param name="name">绐楀彛鍚嶇О</param>
     /// <param name="functionId">鍔熻兘ID锛岀敤浜庢寚瀹氱獥鍙g殑鍏蜂綋鍔熻兘鎴栨樉绀烘ā寮�</param>
-    public void Add(string name, int functionId = 0)
+    public void Add(string name, bool isNeedHomeWin = true, int functionId = 0)
     {
         var popupWindow = new PopupWindow()
         {
             window = name,
+            isNeedHomeWin = isNeedHomeWin,
             functionId = functionId,
         };
 
@@ -37,6 +42,7 @@
         }
 
         popupWindowQueue.Add(popupWindow);
+        popupWindowQueue.Sort((x, y) => y.isNeedHomeWin.CompareTo(x.isNeedHomeWin));
     }
 
     /// <summary>
@@ -44,11 +50,12 @@
     /// </summary>
     /// <param name="name">绐楀彛鍚嶇О</param>
     /// <param name="functionId">鍔熻兘ID</param>
-    public void Remove(string name, int functionId = 0)
+    public void Remove(string name, bool isNeedHomeWin = true, int functionId = 0)
     {
         var popupWindow = new PopupWindow()
         {
             window = name,
+            isNeedHomeWin = isNeedHomeWin,
             functionId = functionId,
         };
 
@@ -57,6 +64,7 @@
             popupWindowQueue.Remove(popupWindow);
         }
     }
+
 
     /// <summary>
     /// LateUpdate涓鐞嗗脊绐楅槦鍒楋紝纭繚鍦ㄦ墍鏈夊叾浠栭�昏緫澶勭悊瀹屾瘯鍚庢墠鏄剧ず寮圭獥
@@ -92,7 +100,24 @@
         if (UIManager.Instance.IsOpened<LoadingWin>())
             return;
 
-        if (!UIManager.Instance.IsOpened<HomeWin>())
+        if (!UIManager.Instance.IsOpened<HomeWin>() && popupWindowQueue[0].isNeedHomeWin)
+            return;
+
+        // 杩涘叆娓告垙绗竴娆℃帹閫佸仛寤惰繜澶勭悊
+        if (!homeWinFirstOpened)
+        {
+            firstTime = Time.realtimeSinceStartup;
+            homeWinFirstOpened = true;
+            stayTime = float.Parse(FuncConfigConfig.Get("PopWin").Numerical1);
+            return;
+        }
+        // 绛夊緟x绉�
+        if (Time.realtimeSinceStartup - firstTime < stayTime)
+            return;
+        
+        // 鍙湪鈥滄病鏈夋垬鏂椻�濆拰鈥滀富绾挎垬鏂椻�濇椂鍏佽寮圭獥
+        string activeBattleName = BattleManager.Instance.GetActiveBattleName();
+        if (activeBattleName != "" && activeBattleName != "StoryBattleField")
             return;
 
         if (UIManager.Instance.IsOpened(popupWindowQueue[0].window))
@@ -101,13 +126,15 @@
             return;
         }
 
-        if (currentWindow.window != null)
+        if (UIManager.Instance.ExistAnyFullScreenOrMaskWin(popupWindowQueue[0].window))
+            return;
+
+        if (currentWindow != null && currentWindow.window != null)
         {
             //鍒ゆ柇涓婁竴涓帹閫佹槸鍚﹀叧闂�
             UIBase ui = UIManager.Instance.GetUI(currentWindow.window);
             if (ui != null && ui.IsActive())
                 return;
-
         }
 
         currentWindow = popupWindowQueue[0];
@@ -122,39 +149,15 @@
     /// 寮圭獥缁撴瀯浣擄紝鐢ㄤ簬琛ㄧず涓�涓緟澶勭悊鐨勫脊绐楄姹�
     /// 鍖呭惈绐楀彛鍚嶇О鍜屽姛鑳絀D锛岄�氳繃杩欎袱涓瓧娈靛彲浠ュ敮涓�鏍囪瘑涓�涓脊绐楄姹�
     /// </summary>
-    public struct PopupWindow
+    public class PopupWindow
     {
         // 绐楀彛鍚嶇О
         public string window;
-        
+
         // 鍔熻兘ID锛岀敤浜庢寚瀹氱獥鍙g殑鍏蜂綋鍔熻兘鎴栨樉绀烘ā寮�
         public int functionId;
 
-        public static bool operator ==(PopupWindow lhs, PopupWindow rhs)
-        {
-            return lhs.window == rhs.window && lhs.functionId == rhs.functionId;
-        }
-
-        public static bool operator !=(PopupWindow lhs, PopupWindow rhs)
-        {
-            return lhs.window != rhs.window || lhs.functionId != rhs.functionId;
-        }
-
-        // 娣诲姞GetHashCode鍜孍quals鏂规硶浠ョ‘淇濈粨鏋勪綋鍙互姝g‘姣旇緝
-        public override bool Equals(object obj)
-        {
-            if (obj is PopupWindow)
-            {
-                PopupWindow other = (PopupWindow)obj;
-                return this.window == other.window && this.functionId == other.functionId;
-            }
-            return false;
-        }
-
-        public override int GetHashCode()
-        {
-            return window.GetHashCode() ^ functionId.GetHashCode();
-        }
+        public bool isNeedHomeWin;
     }
 
 }
\ No newline at end of file

--
Gitblit v1.8.0