From bbc04cf46ab05564930a0c7a2b20b4d6597689a3 Mon Sep 17 00:00:00 2001 From: xiekaidong Date: Tue, 18 Apr 2023 20:37:00 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/module/hero/hero_manager.lua | 12 +++++++++++- .../ui/battle/cell/battle_select_skill_cell.lua | 1 + lua/app/ui/battle/cell/select_skill_cell.lua | 1 + lua/app/ui/hero/hero_detail_ui.lua | 17 ++++++++++++----- .../userdata/battle/team/battle_unit_entity.lua | 8 +++++--- 5 files changed, 30 insertions(+), 9 deletions(-) diff --git a/lua/app/module/hero/hero_manager.lua b/lua/app/module/hero/hero_manager.lua index 76664abc..0483c233 100644 --- a/lua/app/module/hero/hero_manager.lua +++ b/lua/app/module/hero/hero_manager.lua @@ -55,7 +55,7 @@ end function HeroManager:getSkillIcon(skillId) local cfg = ConfigManager:getConfig("skill")[skillId] - return cfg and tostring(cfg.icon) + return cfg and tostring(cfg.battle_icon) end function HeroManager:getSkillRogueDesc(skillId) @@ -68,6 +68,16 @@ function HeroManager:getSkillRogueIcon(skillId) return cfg and tostring(cfg.icon) end +function HeroManager:getSkillRogueBattleBg(skillId) + local cfg = ConfigManager:getConfig("skill_rogue")[skillId] + return cfg and "battle_board_" .. cfg.qlt +end + +function HeroManager:getSkillRogueBg(skillId) + local cfg = ConfigManager:getConfig("skill_rogue")[skillId] + return cfg and "frame_" .. cfg.qlt +end + function HeroManager:getActiveRogueLvs() if not self.activeRogueLvs then self.activeRogueLvs = {} diff --git a/lua/app/ui/battle/cell/battle_select_skill_cell.lua b/lua/app/ui/battle/cell/battle_select_skill_cell.lua index f52667fb..dda2731f 100644 --- a/lua/app/ui/battle/cell/battle_select_skill_cell.lua +++ b/lua/app/ui/battle/cell/battle_select_skill_cell.lua @@ -16,6 +16,7 @@ function BattleSelectSkillCell:refresh(skillId, func) self.selectSkillCell = CellManager:addCellComp(uiMap["skill_select_cell.skill_select_cell"], SELECT_SKILL_CELL) end self.selectSkillCell:refresh(skillId) + uiMap["skill_select_cell.img"]:setSprite(GConst.ATLAS_PATH.BATTLE, ModuleManager.HeroManager:getSkillRogueBattleBg(skillId)) end return BattleSelectSkillCell \ No newline at end of file diff --git a/lua/app/ui/battle/cell/select_skill_cell.lua b/lua/app/ui/battle/cell/select_skill_cell.lua index bb275938..f9e5b476 100644 --- a/lua/app/ui/battle/cell/select_skill_cell.lua +++ b/lua/app/ui/battle/cell/select_skill_cell.lua @@ -5,6 +5,7 @@ function SelectSkillCell:refresh(skillId, count) uiMap["skill_select_cell.icon"]:setSprite(GConst.ATLAS_PATH.ICON_SKILL_BUFF, ModuleManager.HeroManager:getSkillRogueIcon(skillId)) -- uiMap["skill_select_cell.value"]:setText() uiMap["skill_select_cell.count"]:setText(count or GConst.EMPTY_STRING) + self.baseObject:setSprite(GConst.ATLAS_PATH.ICON_SKILL_BUFF, ModuleManager.HeroManager:getSkillRogueBg(skillId)) end function SelectSkillCell:addClickListener(func) diff --git a/lua/app/ui/hero/hero_detail_ui.lua b/lua/app/ui/hero/hero_detail_ui.lua index c60a1d6f..1b5f3f14 100644 --- a/lua/app/ui/hero/hero_detail_ui.lua +++ b/lua/app/ui/hero/hero_detail_ui.lua @@ -2,6 +2,12 @@ local HeroDetailUI = class("HeroDetailUI", BaseUI) local DEFAULT_FACTOR = GConst.BattleConst.DEFAULT_FACTOR +local SKILL_BUFF_BG = { + [2] = "frame_1", + [3] = "frame_2", + [4] = "frame_3", +} + function HeroDetailUI:isFullScreen() return false end @@ -46,15 +52,16 @@ function HeroDetailUI:_display() for i = 1, 3 do local skillId = skillList[i] if skillId then - local skillIcon = uiMap["hero_detail_ui.bg.skill_up_" .. i] + local skillIcon = uiMap["hero_detail_ui.bg.skill_up_" .. i .. ".icon"] + local skillBg = uiMap["hero_detail_ui.bg.skill_up_" .. i] local skillLv = uiMap["hero_detail_ui.bg.skill_up_" .. i .. ".desc"] - skillIcon:addClickListener(function() + skillBg:addClickListener(function() ModuleManager.TipsManager:showDescTips(ModuleManager.HeroManager:getSkillRogueDesc(skillId), skillIcon) end) - + skillBg:setSprite(GConst.ATLAS_PATH.ICON_SKILL_BUFF, ModuleManager.HeroManager:getSkillRogueBg(skillId)) skillIcon:setSprite(GConst.ATLAS_PATH.ICON_SKILL_BUFF, ModuleManager.HeroManager:getSkillRogueIcon(skillId)) - skillIcon:setImageGray(i > activeCount) - skillIcon:setTouchEnable(true) + skillBg:setImageGray(i > activeCount) + skillBg:setTouchEnable(true) if i > activeCount then skillLv:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_1, skillLvs[i] or 0)) else diff --git a/lua/app/userdata/battle/team/battle_unit_entity.lua b/lua/app/userdata/battle/team/battle_unit_entity.lua index 2941463b..124a8b34 100644 --- a/lua/app/userdata/battle/team/battle_unit_entity.lua +++ b/lua/app/userdata/battle/team/battle_unit_entity.lua @@ -146,9 +146,11 @@ function BattleUnitEntity:changeActiveSkillId(originSkillId, tartgetSkillId) for _, skillEntity in ipairs(self.activeSkills) do if skillEntity:getSkillid() == originSkillId then skillEntity:changeSkillId(tartgetSkillId) - local extraCount = self.skillExtraUseTimes[originSkillId] - if extraCount then - self.skillExtraUseTimes[tartgetSkillId] = extraCount + if self.skillExtraUseTimes then + local extraCount = self.skillExtraUseTimes[originSkillId] + if extraCount then + self.skillExtraUseTimes[tartgetSkillId] = extraCount + end end break end