From 5405aa473d1ebb20bcb15d28213093e6753dd136 Mon Sep 17 00:00:00 2001
From: client_Wu Xijin <364452445@qq.com>
Date: 星期三, 26 九月 2018 14:39:57 +0800
Subject: [PATCH] 3867 【前端】神兽地图优化

---
 System/DogzDungeon/DogzDungeonBreifInfoBehaviour.cs |   66 +++++++++++++++++++++++++--------
 System/WorldMap/MapModel.cs                         |   45 ++++++++++++----------
 System/WorldMap/LocalMapFindPath.cs                 |    6 ++-
 3 files changed, 78 insertions(+), 39 deletions(-)

diff --git a/System/DogzDungeon/DogzDungeonBreifInfoBehaviour.cs b/System/DogzDungeon/DogzDungeonBreifInfoBehaviour.cs
index 1784381..18856bd 100644
--- a/System/DogzDungeon/DogzDungeonBreifInfoBehaviour.cs
+++ b/System/DogzDungeon/DogzDungeonBreifInfoBehaviour.cs
@@ -16,22 +16,17 @@
 
         [SerializeField] Image m_Attention;
 
-        protected override int selectedBossId
-        {
-            get
-            {
+        protected override int selectedBossId {
+            get {
                 return model.selectedBoss;
             }
-            set
-            {
+            set {
                 model.selectedBoss = value;
             }
         }
 
-        protected override InteractorableState interactorableState
-        {
-            get
-            {
+        protected override InteractorableState interactorableState {
+            get {
                 var selected = selectedBossId == bossId;
                 var config = Config.Instance.Get<DogzDungeonConfig>(bossId);
                 var dieOrLocked = false;
@@ -58,16 +53,13 @@
                     return selected ? InteractorableState.DieOrLockedSelected : InteractorableState.DieOrLockedUnSelected;
                 }
             }
-            set
-            {
+            set {
                 base.interactorableState = value;
             }
         }
 
-        protected override bool isUnLocked
-        {
-            get
-            {
+        protected override bool isUnLocked {
+            get {
                 return model.IsBossUnLocked(bossId);
             }
         }
@@ -179,6 +171,48 @@
             UpdateBossPortrait(interactorableState);
         }
 
+
+        protected override void DrawBossBaseInfo(string _icon, string _name, int _level, int _realm)
+        {
+            var config = Config.Instance.Get<DogzDungeonConfig>(bossId);
+            switch (config.MonsterType)
+            {
+                case 1:
+                    m_BossName.text = _name;
+                    m_BossLevel.text = string.Empty;
+                    break;
+                case 2:
+                    m_BossName.text = _name;
+                    m_BossLevel.text = string.Empty;
+                    break;
+                case 3:
+                case 4:
+                    m_BossName.text = _name;
+                    m_BossLevel.text = Language.Get("Z1024", _level);
+                    break;
+            }
+
+            m_Portrait.SetSprite(_icon);
+            m_Portrait.SetNativeSize();
+
+            if (m_Realm != null)
+            {
+                if (Config.Instance.ContainKey<RealmConfig>(_realm))
+                {
+                    m_Realm.gameObject.SetActive(true);
+                    var realmConfig = Config.Instance.Get<RealmConfig>(_realm);
+                    if (realmConfig != null)
+                    {
+                        m_Realm.SetSprite(realmConfig.Img);
+                    }
+                }
+                else
+                {
+                    m_Realm.gameObject.SetActive(false);
+                }
+            }
+        }
+
         private void OnSelected(int _bossId)
         {
             UpdateBossNameLevelFont(interactorableState);
diff --git a/System/WorldMap/LocalMapFindPath.cs b/System/WorldMap/LocalMapFindPath.cs
index fc21a24..8cb3c67 100644
--- a/System/WorldMap/LocalMapFindPath.cs
+++ b/System/WorldMap/LocalMapFindPath.cs
@@ -292,9 +292,11 @@
             var npcRefreshIds = model.GetMapNPCRefreshIds(mapId);
             if (npcRefreshIds != null)
             {
-                for (int i = 0; i < npcRefreshIds.Count; i++)
+                foreach ( var item in   npcRefreshIds)
                 {
-                    DrawFunctionNPC(npcRefreshIds[i]);
+                    var config = Config.Instance.Get<mapnpcConfig>(item);
+                    var npcConfig = Config.Instance.Get<NPCConfig>(config.NPCID);
+                    DrawFunctionNPC(item);
                 }
             }
         }
diff --git a/System/WorldMap/MapModel.cs b/System/WorldMap/MapModel.cs
index 4b5d004..c030045 100644
--- a/System/WorldMap/MapModel.cs
+++ b/System/WorldMap/MapModel.cs
@@ -584,33 +584,36 @@
             foreach (var config in mapNpcConfigs)
             {
                 var mapId = config.MapID;
-                if (config.NPCType == (int)E_NpcType.Func)
+                if (config.NPCID != 0)
                 {
-                    List<string> npcRefreshIs;
-                    if (!mapFunctionNPCsToRefreshID.ContainsKey(mapId))
+                    if (config.NPCType == (int)E_NpcType.Func)
                     {
-                        mapFunctionNPCsToRefreshID[mapId] = npcRefreshIs = new List<string>();
-                    }
-                    else
-                    {
-                        npcRefreshIs = mapFunctionNPCsToRefreshID[mapId];
-                    }
+                        List<string> npcRefreshIs;
+                        if (!mapFunctionNPCsToRefreshID.ContainsKey(mapId))
+                        {
+                            mapFunctionNPCsToRefreshID[mapId] = npcRefreshIs = new List<string>();
+                        }
+                        else
+                        {
+                            npcRefreshIs = mapFunctionNPCsToRefreshID[mapId];
+                        }
 
-                    npcRefreshIs.Add(config.RefreshID.ToString());
-                }
-                else if (config.NPCType == (int)E_NpcType.Flag)
-                {
-                    List<string> npcRefreshIs;
-                    if (!mapCollectNPCsToRefreshID.ContainsKey(mapId))
-                    {
-                        mapCollectNPCsToRefreshID[mapId] = npcRefreshIs = new List<string>();
+                        npcRefreshIs.Add(config.RefreshID.ToString());
                     }
-                    else
+                    else if (config.NPCType == (int)E_NpcType.Flag)
                     {
-                        npcRefreshIs = mapCollectNPCsToRefreshID[mapId];
-                    }
+                        List<string> npcRefreshIs;
+                        if (!mapCollectNPCsToRefreshID.ContainsKey(mapId))
+                        {
+                            mapCollectNPCsToRefreshID[mapId] = npcRefreshIs = new List<string>();
+                        }
+                        else
+                        {
+                            npcRefreshIs = mapCollectNPCsToRefreshID[mapId];
+                        }
 
-                    npcRefreshIs.Add(config.RefreshID.ToString());
+                        npcRefreshIs.Add(config.RefreshID.ToString());
+                    }
                 }
             }
 

--
Gitblit v1.8.0