From d80b42fe727a0b8794e04601f378b861547d8fad Mon Sep 17 00:00:00 2001
From: lcy <1459594991@qq.com>
Date: 星期五, 06 二月 2026 20:37:35 +0800
Subject: [PATCH] 411 定军阁-客户端 修改界面,外层显示npc,可点击查看详情

---
 Main/System/ViewNPC/ViewNPCManager.cs                        |   10 ++
 Main/System/WarlordPavilion/TowerBaseWin.cs.meta             |   11 ++
 Main/System/WarlordPavilion/TowerBaseWin.cs                  |   20 +++++
 Main/Config/Configs/FBDJGLevelConfig.cs                      |    8 +-
 Main/System/WarlordPavilion/WarlordPavilionNPCItem.cs.meta   |   11 ++
 Main/System/ChallengeTab/WarlordPavilionTabHandler.cs        |    2 
 Main/System/WarlordPavilion/WarlordPavilionNPCItem.cs        |   48 ++++++++++++
 Main/System/WarlordPavilion/WarlordPavilionManager.cs        |   41 +++++++--
 Main/System/WarlordPavilion/WarlordPavilionWin.cs            |   57 ++++++++-----
 Main/System/Battle/BattleField/WarlordPavilionBattleField.cs |    4 
 10 files changed, 172 insertions(+), 40 deletions(-)

diff --git a/Main/Config/Configs/FBDJGLevelConfig.cs b/Main/Config/Configs/FBDJGLevelConfig.cs
index 1c68374..ab1dc40 100644
--- a/Main/Config/Configs/FBDJGLevelConfig.cs
+++ b/Main/Config/Configs/FBDJGLevelConfig.cs
@@ -1,6 +1,6 @@
 锘�//--------------------------------------------------------
 //    [Author]:           YYL
-//    [  Date ]:           Tuesday, January 20, 2026
+//    [  Date ]:           Friday, February 6, 2026
 //--------------------------------------------------------
 
 using System.Collections.Generic;
@@ -22,8 +22,8 @@
 	public int[][] PassAwardList;
 	public int[][] AwardList;
 	public int[] LineupIDList;
+	public int NPCLV;
 	public long FightPower;
-	public int NPCID;
 	public int[] SkillIDExList;
 
     public override int LoadKey(string _key)
@@ -60,9 +60,9 @@
 				}
 			}
 
-			long.TryParse(tables[6],out FightPower); 
+			int.TryParse(tables[6],out NPCLV); 
 
-			int.TryParse(tables[7],out NPCID); 
+			long.TryParse(tables[7],out FightPower); 
 
 			if (tables[8].Contains("["))
 			{
diff --git a/Main/System/Battle/BattleField/WarlordPavilionBattleField.cs b/Main/System/Battle/BattleField/WarlordPavilionBattleField.cs
index edf6be1..d9b5c39 100644
--- a/Main/System/Battle/BattleField/WarlordPavilionBattleField.cs
+++ b/Main/System/Battle/BattleField/WarlordPavilionBattleField.cs
@@ -94,9 +94,9 @@
         }
         fsBattleWin.SetBattleField(this);
 
-        if (UIManager.Instance.IsOpened<WarlordPavilionWin>())
+        if (UIManager.Instance.IsOpened<TowerBaseWin>())
         {
-            UIManager.Instance.CloseWindow<WarlordPavilionWin>();
+            UIManager.Instance.CloseWindow<TowerBaseWin>();
         }
     }
 
diff --git a/Main/System/ChallengeTab/WarlordPavilionTabHandler.cs b/Main/System/ChallengeTab/WarlordPavilionTabHandler.cs
index 175e498..2734406 100644
--- a/Main/System/ChallengeTab/WarlordPavilionTabHandler.cs
+++ b/Main/System/ChallengeTab/WarlordPavilionTabHandler.cs
@@ -41,7 +41,7 @@
         }
         else
         {
-            UIManager.Instance.OpenWindow<WarlordPavilionWin>();
+            UIManager.Instance.OpenWindow<TowerBaseWin>();
         }
     }
 
diff --git a/Main/System/ViewNPC/ViewNPCManager.cs b/Main/System/ViewNPC/ViewNPCManager.cs
index 9460ebf..5c0382f 100644
--- a/Main/System/ViewNPC/ViewNPCManager.cs
+++ b/Main/System/ViewNPC/ViewNPCManager.cs
@@ -123,8 +123,16 @@
         });
     }
 
+    public void TryOpenNPCDetailWin(uint mapID, uint funcLineID, uint npcID)
+    {
+        if (TryGetNPCAttr(mapID, funcLineID, npcID, out ViewNPCAttr attr))
+        {
+            OpenNPCDetailWin(attr);
+        }
+    }
+
     public ViewNPCAttr viewNPCAttr;
-    private void OpenNPCDetailWin(ViewNPCAttr viewNPCAttr)
+    public void OpenNPCDetailWin(ViewNPCAttr viewNPCAttr)
     {
         this.viewNPCAttr = viewNPCAttr;
         if (!UIManager.Instance.IsOpened<OtherNPCDetailWin>())
diff --git a/Main/System/WarlordPavilion/TowerBaseWin.cs b/Main/System/WarlordPavilion/TowerBaseWin.cs
new file mode 100644
index 0000000..40e5ab0
--- /dev/null
+++ b/Main/System/WarlordPavilion/TowerBaseWin.cs
@@ -0,0 +1,20 @@
+using UnityEngine;
+
+public class TowerBaseWin : OneLevelWin
+{
+    [SerializeField] Transform WarlordPavilionWinTop;
+    protected override void OpenSubUIByTabIndex()
+    {
+        WarlordPavilionWinTop.SetActive(functionOrder == 0);
+        switch (functionOrder)
+        {
+            case 0:
+                currentSubUI = UIManager.Instance.OpenWindow<WarlordPavilionWin>();
+                break;
+            default:
+                Debug.LogWarning("鏈煡鐨勬爣绛剧储寮�: " + functionOrder);
+                break;
+        }
+
+    }
+}
diff --git a/Main/System/WarlordPavilion/TowerBaseWin.cs.meta b/Main/System/WarlordPavilion/TowerBaseWin.cs.meta
new file mode 100644
index 0000000..462fa96
--- /dev/null
+++ b/Main/System/WarlordPavilion/TowerBaseWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 8849ec4f80ae3604db56ee7a9a1be0b6
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
diff --git a/Main/System/WarlordPavilion/WarlordPavilionManager.cs b/Main/System/WarlordPavilion/WarlordPavilionManager.cs
index 8a6f053..179ce22 100644
--- a/Main/System/WarlordPavilion/WarlordPavilionManager.cs
+++ b/Main/System/WarlordPavilion/WarlordPavilionManager.cs
@@ -1,7 +1,6 @@
 using System;
 using System.Collections.Generic;
 using LitJson;
-using UnityEngine;
 
 public class WarlordPavilionManager : GameSystemManager<WarlordPavilionManager>
 {
@@ -652,17 +651,39 @@
         return true;
     }
 
-    public bool TryGetNPCConfig(int layerNum, int levelNum, out NPCConfig npcConfig)
+    public bool TryGetLineupConfig(int layerNum, int levelNum, out NPCLineupConfig npcLineupConfig)
     {
-        npcConfig = null;
+        npcLineupConfig = null;
         if (!FBDJGLevelConfig.TryGetFBDJGLevelConfig(layerNum, levelNum, out var config))
             return false;
-        int npcID = config.NPCID;
-        if (!NPCConfig.HasKey(npcID))
+        int lineupID = config.LineupIDList[0];
+        if (!NPCLineupConfig.HasKey(lineupID))
             return false;
-        npcConfig = NPCConfig.Get(npcID);
+        npcLineupConfig = NPCLineupConfig.Get(lineupID);
         return true;
     }
+
+    public int viewNPCID = 0;
+    // 鑾峰彇璇ラ樀瀹规寚瀹氫綅缃殑npcID锛� posNum鑼冨洿1-6
+    public bool TryGetNPCIDInLineupByPosNum(NPCLineupConfig config, int posNum, out int npcID)
+    {
+        npcID = 0;
+        if (config == null || posNum < 1 || posNum > 6)
+            return false;
+
+        npcID = posNum switch
+        {
+            1 => config.PosNPCID1,
+            2 => config.PosNPCID2,
+            3 => config.PosNPCID3,
+            4 => config.PosNPCID4,
+            5 => config.PosNPCID5,
+            6 => config.PosNPCID6,
+            _ => 0
+        };
+        return NPCConfig.HasKey(npcID);
+    }
+
 
     public bool IsTodayNoFight()
     {
@@ -726,7 +747,7 @@
 
         if (!IsAutoFuncOpen(false))
         {
-            UIManager.Instance.OpenWindow<WarlordPavilionWin>();
+            UIManager.Instance.OpenWindow<TowerBaseWin>();
             return;
         }
 
@@ -734,7 +755,7 @@
         bool hasNext = FBDJGLevelConfig.TryGetNextLevel(layerNum, levelNum, out int nextLayerNum, out int nextLevelNum);
         if (!hasNext)
         {
-            UIManager.Instance.OpenWindow<WarlordPavilionWin>();
+            UIManager.Instance.OpenWindow<TowerBaseWin>();
             return;
         }
 
@@ -742,14 +763,14 @@
         bool isAutoPresetOn = IsAutoPresetOn();
         if (hasBonusToSelect && !isAutoPresetOn)
         {
-            UIManager.Instance.OpenWindow<WarlordPavilionWin>();
+            UIManager.Instance.OpenWindow<TowerBaseWin>();
             UIManager.Instance.OpenWindow<WarlordPavilionSelectBonusWin>();
             return;
         }
 
         if (!isAutoNext)
         {
-            UIManager.Instance.OpenWindow<WarlordPavilionWin>();
+            UIManager.Instance.OpenWindow<TowerBaseWin>();
             return;
         }
 
diff --git a/Main/System/WarlordPavilion/WarlordPavilionNPCItem.cs b/Main/System/WarlordPavilion/WarlordPavilionNPCItem.cs
new file mode 100644
index 0000000..9a1f67b
--- /dev/null
+++ b/Main/System/WarlordPavilion/WarlordPavilionNPCItem.cs
@@ -0,0 +1,48 @@
+using UnityEngine;
+using UnityEngine.UI;
+public class WarlordPavilionNPCItem : MonoBehaviour
+{
+    public int posNum;
+    [SerializeField] UIHeroController uiHeroController;
+    [SerializeField] Button button;
+    [SerializeField] TextEx nameText;
+    [SerializeField] TextEx numText;
+    WarlordPavilionManager manager { get { return WarlordPavilionManager.Instance; } }
+
+    public void Display(NPCLineupConfig npcLineupConfig, float modelSize, int funcLineID, FBDJGLevelConfig config)
+    {
+        numText.text = posNum.ToString();
+        bool hasHero = manager.TryGetNPCIDInLineupByPosNum(npcLineupConfig, posNum, out int npcID);
+
+        uiHeroController.SetActive(hasHero);
+        nameText.SetActive(hasHero);
+        uiHeroController.SetActive(hasHero);
+
+        if (!NPCConfig.HasKey(npcID))
+            return;
+        NPCConfig npcConfig = NPCConfig.Get(npcID);
+        int heroID = npcConfig.RelatedHeroID;
+        if (!HeroConfig.HasKey(heroID))
+            return;
+        HeroConfig heroConfig = HeroConfig.Get(heroID);
+
+        uiHeroController.Create(npcConfig.SkinID, modelSize);
+
+        Color color = UIHelper.GetUIColorByFunc(heroConfig.Quality);
+        string name = UIHelper.AppendColor(color, heroConfig.Name);
+        nameText.text = config.NPCLV == 0 ? name : Language.Get("WarlordPavilion34", name, config.NPCLV);
+        numText.text = posNum.ToString();
+        button.SetListener(() =>
+        {
+            if (!hasHero)
+                return;
+            if (ViewNPCManager.Instance.TryGetNPCAttr((uint)manager.DataMapID, (uint)funcLineID, (uint)npcID, out var npcAttr))
+            {
+                ViewNPCManager.Instance.OpenNPCDetailWin(npcAttr);
+                return;
+            }
+            ViewNPCManager.Instance.SendViewNPCAttr((uint)manager.DataMapID, (uint)funcLineID, (uint)npcID);
+            manager.viewNPCID = npcID;
+        });
+    }
+}
\ No newline at end of file
diff --git a/Main/System/WarlordPavilion/WarlordPavilionNPCItem.cs.meta b/Main/System/WarlordPavilion/WarlordPavilionNPCItem.cs.meta
new file mode 100644
index 0000000..7caafce
--- /dev/null
+++ b/Main/System/WarlordPavilion/WarlordPavilionNPCItem.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 89a6702338a7e464baff37bb3720cad9
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
diff --git a/Main/System/WarlordPavilion/WarlordPavilionWin.cs b/Main/System/WarlordPavilion/WarlordPavilionWin.cs
index 2f788c1..d638622 100644
--- a/Main/System/WarlordPavilion/WarlordPavilionWin.cs
+++ b/Main/System/WarlordPavilion/WarlordPavilionWin.cs
@@ -1,3 +1,4 @@
+using System;
 using System.Collections.Generic;
 using UnityEngine;
 using UnityEngine.UI;
@@ -5,8 +6,7 @@
 {
     [SerializeField] float modelSize;
     [SerializeField] TextEx txtCurrentLevel;                //褰撳墠鍏冲崱
-    [SerializeField] TextEx txtBossName;
-    [SerializeField] UIHeroController uiHeroController;
+    [SerializeField] WarlordPavilionNPCItem[] heros;
     [SerializeField] List<SkillWordCell> skillWords;
     [SerializeField] ItemCell[] firstAwards;
     [SerializeField] ImageEx[] firstAwardMasks;
@@ -16,7 +16,6 @@
     [SerializeField] TextEx txtMax;
     [SerializeField] ButtonEx btnRank;
     [SerializeField] ButtonEx btnAward;
-    [SerializeField] ButtonEx btnBossInfo;
     [SerializeField] ButtonEx btnFormation;                 //甯冮樀
     [SerializeField] ButtonEx btnBonusPreset;               //鍔犳垚棰勮
     [SerializeField] TextEx txtBonusPreset;               //鍔犳垚棰勮
@@ -32,20 +31,6 @@
     WarlordPavilionManager manager { get { return WarlordPavilionManager.Instance; } }
     protected override void InitComponent()
     {
-        btnBossInfo.SetListener(() =>
-        {
-            if (npcConfig == null)
-                return;
-            uint mapID = (uint)manager.DataMapID;
-            uint funcLineID = (uint)manager.GetLineID(showLayerNum, showLevelNum);
-            uint npcID = (uint)npcConfig.NPCID;
-            if (ViewNPCManager.Instance.TryGetNPCAttr(mapID, funcLineID, npcID, out var npcAttr) && npcAttr != null && npcAttr.AttrDict != null)
-            {
-                AttributeManager.Instance.OpenTotalAttributeWin(npcAttr.AttrDict);
-                return;
-            }
-            ViewNPCManager.Instance.SendViewNPCAttr(mapID, funcLineID, npcID);
-        });
         btnRank.SetListener(() =>
         {
             UIManager.Instance.OpenWindow<WarlordPavilionRankWin>();
@@ -92,6 +77,7 @@
     {
         GlobalTimeEvent.Instance.secondEvent += OnSecondEvent;
         manager.OnUpdateDingjungeInfoEvent += OnUpdateDingjungeInfo;
+        ViewNPCManager.Instance.OnUpdateViewNPCAttrRet += OnUpdateViewNPCAttrRet;
         Display();
     }
 
@@ -99,6 +85,14 @@
     {
         GlobalTimeEvent.Instance.secondEvent -= OnSecondEvent;
         manager.OnUpdateDingjungeInfoEvent -= OnUpdateDingjungeInfo;
+        ViewNPCManager.Instance.OnUpdateViewNPCAttrRet -= OnUpdateViewNPCAttrRet;
+    }
+
+    private void OnUpdateViewNPCAttrRet(uint mapID, uint funcLineID)
+    {
+        if (mapID != (uint)manager.DataMapID)
+            return;
+        ViewNPCManager.Instance.TryOpenNPCDetailWin(mapID, funcLineID, (uint)manager.viewNPCID);
     }
 
     private void OnUpdateDingjungeInfo(List<int> indexs)
@@ -126,8 +120,8 @@
 
     int showLayerNum;
     int showLevelNum;
+    int showFuncLineID;
     FBDJGLevelConfig config;
-    NPCConfig npcConfig;
     private void Display()
     {
         uIEffectPlayer.Stop();
@@ -139,12 +133,11 @@
             return;
         if (!FBDJGLevelConfig.TryGetFBDJGLevelConfig(showLayerNum, showLevelNum, out config))
             return;
-        if (!manager.TryGetNPCConfig(showLayerNum, showLevelNum, out npcConfig))
-            return;
 
+        showFuncLineID = manager.GetLineID(showLayerNum, showLevelNum);
         txtCurrentLevel.text = Language.Get("WarlordPavilion22", showLayerNum, showLevelNum);
-        txtBossName.text = npcConfig.NPCName;
-        uiHeroController.Create(npcConfig.SkinID, modelSize);
+
+        DisplayHeros(config);
         DisplaySkillWordsList(config.SkillIDExList);
         DisplayItemCell(firstAwards, config.PassAwardList);
         manager.DisplayItemCell(challengeAwards, config.AwardList);
@@ -161,6 +154,26 @@
         }
         funPresetBtn.SetActive(FuncPresetManager.Instance.IsPreShow());
     }
+
+    private void DisplayHeros(FBDJGLevelConfig config)
+    {
+        if (!manager.TryGetLineupConfig(config.LayerNum, config.LevelNum, out NPCLineupConfig npcLineupConfig))
+        {
+            for (int i = 0; i < heros.Length; i++)
+            {
+                var hero = heros[i];
+                hero.SetActive(false);
+            }
+            return;
+        }
+
+        for (int i = 0; i < heros.Length; i++)
+        {
+            var hero = heros[i];
+            hero.Display(npcLineupConfig, modelSize, showFuncLineID, config);
+        }
+    }
+
     private void DisplayButtons()
     {
         bool isPass = manager.IsPass();

--
Gitblit v1.8.0