From 36526bcd5e4424daf2a834e265e73e4be364fec6 Mon Sep 17 00:00:00 2001 From: xiekaidong Date: Thu, 29 Jun 2023 21:14:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=98=E6=96=97=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/ui/battle/battle_base_ui.lua | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lua/app/ui/battle/battle_base_ui.lua b/lua/app/ui/battle/battle_base_ui.lua index ab285a3e..78a14a4a 100644 --- a/lua/app/ui/battle/battle_base_ui.lua +++ b/lua/app/ui/battle/battle_base_ui.lua @@ -1122,7 +1122,11 @@ function BattleBaseUI:onInitGridCellOver() end) cell:unBindAll() cell:bind(entity, "isDirty", function() - cell:refresh(entity, self.curElementType) + local elementType = self.curElementType + if not self.battleController:getPosIdInCurActionBoardRowRange(entity:getPosId()) then + elementType = nil + end + cell:refresh(entity, elementType) end) local pos = entity:getPos() cell:getBaseObject():setAnchoredPosition(pos.x, pos.y) @@ -1173,8 +1177,14 @@ end function BattleBaseUI:refreshBoard() local entities = self.battleData:getGridEnties() for posId, entity in pairs(entities) do + local elementType = self.curElementType + local skillPosId = self.skillPosId + if not self.battleController:getPosIdInCurActionBoardRowRange(posId) then + elementType = nil + skillPosId = nil + end if entity and entity:getCell() then - entity:getCell():refresh(entity, self.curElementType, self.skillPosId) + entity:getCell():refresh(entity, elementType, skillPosId) end end end