From 4acf0850f8f72dc0158767e70b8f5bc532775a2f Mon Sep 17 00:00:00 2001 From: xiekaidong Date: Mon, 24 Apr 2023 21:03:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=80=E8=83=BD=E7=89=B9=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/ui/battle/cell/skill_node_cell.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lua/app/ui/battle/cell/skill_node_cell.lua b/lua/app/ui/battle/cell/skill_node_cell.lua index 6c23ff47..511f1868 100644 --- a/lua/app/ui/battle/cell/skill_node_cell.lua +++ b/lua/app/ui/battle/cell/skill_node_cell.lua @@ -20,7 +20,8 @@ function SkillNodeCell:refresh(skillEntity, elementMap) end local curEnergy = skillEntity:getEnergy() + add local needEnergy = skillEntity:getNeedEnergy() - self.imgComp.fillAmount = curEnergy / needEnergy + local value = curEnergy / needEnergy + self.imgComp.fillAmount = value if self.lastSkillIcon ~= skillEntity:getBattleIcon() then self.lastSkillIcon = skillEntity:getBattleIcon() uiMap["skill_node_cell.skill_icon"]:setSprite(GConst.ATLAS_PATH.ICON_SKILL, self.lastSkillIcon) @@ -33,6 +34,15 @@ function SkillNodeCell:refresh(skillEntity, elementMap) self.lastElementType = elementType uiMap["skill_node_cell.match_bg"]:setSprite(GConst.ATLAS_PATH.BATTLE, GConst.BattleConst.SKILL_ELEMENT_BG[elementType]) end + + local effect = uiMap["skill_node_cell.icon_node.vfx_ui_battle_skill_full_b01"] + if value >= 1 then + effect:setVisible(true) + effect:stopAndClear() + effect:play() + else + effect:setVisible(false) + end end return SkillNodeCell \ No newline at end of file