From 67b691c511702a0feb52d8bfdfc0956b6a995412 Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期五, 17 十月 2025 11:44:18 +0800
Subject: [PATCH] 125 战斗 战斗界面排序问题

---
 Main/System/Battle/BattleConst.cs |   37 ++++++++++++++++++++++++++++++-------
 1 files changed, 30 insertions(+), 7 deletions(-)

diff --git a/Main/System/Battle/BattleConst.cs b/Main/System/Battle/BattleConst.cs
index ede50bd..b6d0a27 100644
--- a/Main/System/Battle/BattleConst.cs
+++ b/Main/System/Battle/BattleConst.cs
@@ -1,7 +1,16 @@
 
+using System;
+using System.Collections.Generic;
 
 public static class BattleConst
 {
+    public static List<Type> BattleWindows = new List<Type>()
+    {
+        typeof(BattleWin),
+        typeof(StoryBossBattleWin),
+        typeof(BoneFieldWin),
+    };
+
     public const int BattleStartEffectID = 1001; // Example effect ID for battle start
 
     public const int skillMotionFps = 30;
@@ -36,18 +45,32 @@
     {
         get
         {
+            List<int> activeWinOrders = new List<int>();
 
-            BattleWin battleWin = UIManager.Instance.GetUI<BattleWin>();
-            if (battleWin != null)
+            for (int i = 0; i < BattleWindows.Count; i++)
             {
-                return battleWin.GetSortingOrder();
+                var win = UIManager.Instance.GetUI(BattleWindows[i].Name);
+                if (win != null && win.IsActive())
+                {
+                    activeWinOrders.Add(win.GetSortingOrder());
+                }
             }
-            StoryBossBattleWin fsBattleWin = UIManager.Instance.GetUI<StoryBossBattleWin>();
-            if (fsBattleWin != null)
+
+            if (activeWinOrders.Count == 0)
             {
-                return fsBattleWin.GetSortingOrder();
+                return 0;
             }
-            return 0;
+
+            int maxOrder = activeWinOrders[0];
+            for (int i = 1; i < activeWinOrders.Count; i++)
+            {
+                if (activeWinOrders[i] > maxOrder)
+                {
+                    maxOrder = activeWinOrders[i];
+                }
+            }
+
+            return maxOrder;
         }
     }
 

--
Gitblit v1.8.0