From 23d9f08609f139faf85a2f9a1aca26282db667db Mon Sep 17 00:00:00 2001 From: zhouhaihai Date: Mon, 8 Jun 2020 11:25:10 +0800 Subject: [PATCH] 展示房间 --- src/adv/AdvMap.lua | 11 ++++++++--- src/adv/AdvRoom.lua | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/adv/AdvMap.lua b/src/adv/AdvMap.lua index b4038d4..b31ef73 100644 --- a/src/adv/AdvMap.lua +++ b/src/adv/AdvMap.lua @@ -10,7 +10,8 @@ local createMap, getEventLib function Map:ctor(adv, mapIdx, mapInfo, isEnter, isNewRelay) self.adv = adv - if type(mapInfo) == "number" then -- mapInfo 传入 id + local isNew = type(mapInfo) == "number" + if isNew then -- mapInfo 传入 id mapInfo = createMap(self, mapInfo, isEnter, isNewRelay) -- 生成地图 end if not mapInfo then return end @@ -19,10 +20,10 @@ function Map:ctor(adv, mapIdx, mapInfo, isEnter, isNewRelay) self.mapId = mapInfo.mapId self.isShow = mapInfo.isShow -- 是否全部展示 -- 客户端用 self.rooms = {} - self:loadRooms(mapInfo.rooms, isNewRelay) + self:loadRooms(mapInfo.rooms, isNew, isNewRelay) end -function Map:loadRooms(rooms, isNewRelay) +function Map:loadRooms(rooms, isNew, isNewRelay) local mapInfoCsv = csvdb["mapCsv"][self.mapId] local mapData = csvdb["map_" .. mapInfoCsv["path"] .. "Csv"] @@ -34,6 +35,10 @@ function Map:loadRooms(rooms, isNewRelay) self.rooms[roomId] = Room.new(self, roomId, csvdb["room_" .. roomName .. "Csv"], rooms[roomId], false, isNewRelay, mapInfoCsv.type) end end + + if mapInfoCsv.type == 2 and isNew then + self:showMap() + end end function Map:initBattleAfter() diff --git a/src/adv/AdvRoom.lua b/src/adv/AdvRoom.lua index 54c5709..1896e1f 100644 --- a/src/adv/AdvRoom.lua +++ b/src/adv/AdvRoom.lua @@ -38,7 +38,7 @@ function Room:loadBlocks(csvData, info, isNewRelay, mapType) end end --中继层全部开放 boss 房间 开启所有的地块 - if (self.map.adv.isRelay and not isNewRelay) or (self.isBossRoom and self.isShow and isFirstOpen) or mapType == 2 or (isFirstOpen and mapType == 1) then + if (self.map.adv.isRelay and not isNewRelay) or (self.isBossRoom and self.isShow and isFirstOpen) or (isFirstOpen and mapType == 1) then table.insert(self.battleAfterCall, function() for _, block in pairs(self.blocks) do self:openBlock(block) -- libgit2 0.21.2