From 32b9deba6de314ca95f50f1979ebf2af26709677 Mon Sep 17 00:00:00 2001 From: xiekaidong Date: Wed, 19 Apr 2023 18:38:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=98=E6=96=97=E8=8A=82=E5=A5=8F=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/battle/controller/battle_controller.lua | 10 ++++------ lua/app/ui/battle/battle_skill_select_ui.lua | 4 ++++ lua/app/ui/battle/battle_ui.lua | 13 ++++++++++++- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/lua/app/module/battle/controller/battle_controller.lua b/lua/app/module/battle/controller/battle_controller.lua index f08a6aa1..a49ac45e 100644 --- a/lua/app/module/battle/controller/battle_controller.lua +++ b/lua/app/module/battle/controller/battle_controller.lua @@ -298,9 +298,7 @@ function BattleController:enterNextWave() self.battleUI:refreshWave(self.waveIndex) end if self.waveIndex == 1 then -- 第一波 - self.isBossWave = self.defTeam:getMainUnit().unitEntity:getIsBoss() - self:generateBoard() - return + self:generateBoard(true) end self.defTeam:prepare() @@ -880,7 +878,7 @@ function BattleController:exeInstructions(callback) end end -function BattleController:generateBoard() +function BattleController:generateBoard(isFirst) local boardList, _ = self:getInitBoard() if self.curBoardIndex and self.curBoardIndex >= #boardList then return @@ -896,8 +894,8 @@ function BattleController:generateBoard() self.battleData:refreshBoard(board) self.battleUI:initGridCell() end, function() - self:enterRoundBegin() - end) + -- self:enterRoundBegin() + end, isFirst) end function BattleController:putBoardCacheSkill(callback) diff --git a/lua/app/ui/battle/battle_skill_select_ui.lua b/lua/app/ui/battle/battle_skill_select_ui.lua index 00da2f4d..c4cd10cb 100644 --- a/lua/app/ui/battle/battle_skill_select_ui.lua +++ b/lua/app/ui/battle/battle_skill_select_ui.lua @@ -26,6 +26,7 @@ end function BattleSkillSelectUI:_display() local uiMap = self.root:genAllChildren() uiMap["battle_skill_select_ui.skill_node.ad_btn.tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.BATTLE_DESC_3)) + uiMap["battle_skill_select_ui.bg_1"]:setVisible(true) self:refreshRogueSkill() end @@ -43,11 +44,14 @@ function BattleSkillSelectUI:_addListeners() end) self.canvasGroup = uiMap["battle_skill_select_ui.skill_node"]:getComponent(GConst.TYPEOF_UNITY_CLASS.CANVAS_GROUP) + self.bg = uiMap["battle_skill_select_ui.bg_1"] uiMap["battle_skill_select_ui.look_btn"]:addTouchListener(function(eventType, x, y) if eventType == GConst.TOUCH_EVENT.DOWN or eventType == GConst.TOUCH_EVENT.DRAG then self.canvasGroup.alpha = 0.3 + self.bg:setVisible(false) else self.canvasGroup.alpha = 1 + self.bg:setVisible(true) end end) end diff --git a/lua/app/ui/battle/battle_ui.lua b/lua/app/ui/battle/battle_ui.lua index 3e234c5d..42e5649d 100644 --- a/lua/app/ui/battle/battle_ui.lua +++ b/lua/app/ui/battle/battle_ui.lua @@ -309,12 +309,23 @@ function BattleUI:onInitGridCellOver() end end -function BattleUI:switchBoard(downCallback, callback) +function BattleUI:switchBoard(downCallback, callback, isFirst) if self.switchBoardSeq then self.switchBoardSeq:Kill() self.switchBoardSeq = nil end + if isFirst then + if downCallback then + downCallback() + end + if callback then + callback() + end + self.boardNode:setAnchoredPositionY(BOARD_POS_UP.y) + return + end + self.switchBoardSeq = self.root:createBindTweenSequence() self.switchBoardSeq:Append(self.boardNode:getTransform():DOAnchorPos(BOARD_POS_DOWN, 0.5)) self.switchBoardSeq:AppendCallback(function()