界面处理

This commit is contained in:
xiekaidong 2023-04-19 09:48:53 +08:00
parent 0a7cb2a5b9
commit 073b4cceab

View File

@ -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