From c46c24e933bef1f29b140aceff6f6f178c23000e Mon Sep 17 00:00:00 2001
From: client_Wu Xijin <364452445@qq.com>
Date: 星期四, 23 五月 2019 16:11:19 +0800
Subject: [PATCH] 6780 boss之家多地图合并。

---
 System/WorldMap/LocalMapWin.cs |   45 +++++++++++++++++++++++++++++++--------------
 1 files changed, 31 insertions(+), 14 deletions(-)

diff --git a/System/WorldMap/LocalMapWin.cs b/System/WorldMap/LocalMapWin.cs
index 6f36dae..7e4a676 100644
--- a/System/WorldMap/LocalMapWin.cs
+++ b/System/WorldMap/LocalMapWin.cs
@@ -22,9 +22,9 @@
         [SerializeField] DynamicCyclicScroll m_LinesScroll;
         [SerializeField] Button m_WorldMap;
 
-        int mapId = 0;
+        int dataMapId = 0;
+        int lineId = 0;
         MapModel model { get { return ModelCenter.Instance.GetModel<MapModel>(); } }
-        FairyGrabBossModel fairyGrabBossModel { get { return ModelCenter.Instance.GetModel<FairyGrabBossModel>(); } }
 
         public Button close { get; set; }
 
@@ -48,7 +48,8 @@
 
         protected override void OnPreOpen()
         {
-            mapId = model.wannaLookLocalMap == 0 ? PlayerDatas.Instance.baseData.MapID : model.wannaLookLocalMap;
+            dataMapId = model.wannaLookLocalMap == 0 ? MapUtility.GetDataMapId() : model.wannaLookLocalMap;
+            lineId = MapUtility.GetDataMapId() == dataMapId ? PlayerDatas.Instance.baseData.dungeonLineId : 0;
             m_MapLineContainer.gameObject.SetActive(false);
             m_MapLineSwitch.gameObject.SetActive(false);
 
@@ -63,7 +64,6 @@
 
         protected override void OnPreClose()
         {
-
             model.wannaLookLocalMap = 0;
             m_LocalMap.UnInit();
             model.mapLinesUpdateEvent -= OnMapLinesUpdate;
@@ -94,25 +94,40 @@
         void Init()
         {
             ShowMapEventPoints();
-            m_LocalMap.Init(mapId);
-            var mapConfig = MapConfig.Get(mapId);
-            m_MapName.text = mapConfig.Name;
+            m_LocalMap.Init(dataMapId, lineId);
+            var mapResourceConfig = MapResourcesConfig.GetConfig(dataMapId, lineId);
+            m_MapName.text = mapResourceConfig.Name;
 
-            m_MapLineSwitch.gameObject.SetActive(!CrossServerUtility.IsCrossServer() && mapId == PlayerDatas.Instance.baseData.MapID);
-            if (BossFakeLineUtility.Instance.showFakeLine)
+            var showLineSwitch = false;
+            if (!CrossServerUtility.IsCrossServer() && dataMapId == MapUtility.GetDataMapId())
             {
-                m_CurrentLine.text = Language.Get("line", 1);
+                var mapId = PlayerDatas.Instance.baseData.MapID;
+                var mapConfig = MapConfig.Get(mapId);
+                if (mapConfig.MapFBType == 0)
+                {
+                    showLineSwitch = true;
+                }
             }
-            else
+
+            m_MapLineSwitch.gameObject.SetActive(showLineSwitch);
+            if (showLineSwitch)
             {
-                m_CurrentLine.text = Language.Get("line", PlayerDatas.Instance.baseData.FBID + 1);
+                if (BossFakeLineUtility.Instance.showFakeLine)
+                {
+                    m_CurrentLine.text = Language.Get("line", 1);
+                }
+                else
+                {
+                    m_CurrentLine.text = Language.Get("line", PlayerDatas.Instance.baseData.FBID + 1);
+                }
             }
+      
         }
 
         private void ShowMapEventPoints()
         {
             var visableEventPoints = new List<int>();
-            var eventPoints = model.GetMapEventPoints(mapId);
+            var eventPoints = model.GetMapEventPoints(dataMapId, lineId);
             for (int i = 0; i < eventPoints.Count; i++)
             {
                 var config = MapEventPointConfig.Get(eventPoints[i]);
@@ -138,7 +153,7 @@
             });
 
             m_EventPointToggleGroup.Init(visableEventPoints);
-            var recommendHangPoint = model.GetRecommendHangPoint(mapId);
+            var recommendHangPoint = model.GetRecommendHangPoint(dataMapId, lineId);
             if (recommendHangPoint == 0)
             {
                 model.selectedMapEventPoint = -1;
@@ -159,6 +174,7 @@
             }
             else
             {
+                var mapId = MapUtility.GetMapId(dataMapId, lineId);
                 var lines = model.GetMapLines(mapId);
                 if (lines != null)
                 {
@@ -194,6 +210,7 @@
 
         private void OnMapLinesUpdate(int _mapId)
         {
+            var mapId = MapUtility.GetMapId(dataMapId, lineId);
             if (mapId != _mapId)
             {
                 return;

--
Gitblit v1.8.0