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