diff --git a/lua/app/ui/battle/cell/grid_cell.lua b/lua/app/ui/battle/cell/grid_cell.lua index 7d21073f..4eeb9c1e 100644 --- a/lua/app/ui/battle/cell/grid_cell.lua +++ b/lua/app/ui/battle/cell/grid_cell.lua @@ -34,15 +34,22 @@ function GridCell:refresh(gridEntity, curElement) elementIcon:setVisible(false) skillIcon:setVisible(true) - if self.lastSkillId ~= skillId then - self.lastSkillId = skillId + local sprite + local skillEntity = DataManager.BattleData:getSkillEntityBySkillId(skillId) + if skillEntity then + sprite = skillEntity:getBattleIcon() + else local cfg = ModuleManager.BattleManager.SKILL_CFG[skillId] if cfg then - skillIcon:setSprite(GConst.ATLAS_PATH.ICON_SKILL, tostring(cfg.battle_icon)) + sprite = tostring(cfg.battle_icon) end end - local skillEntity = DataManager.BattleData:getSkillEntityBySkillId(gridEntity:getSkillId()) + if sprite and self.lastSkillSprite ~= sprite then + self.lastSkillSprite = sprite + skillIcon:setSprite(GConst.ATLAS_PATH.ICON_SKILL, self.lastSkillSprite) + end + elementType = gridEntity:getElementType(skillEntity) if not elementType then showMask = false