From 0ad11e3e215d5edab57a5c8c787cf3cd4662ab2d Mon Sep 17 00:00:00 2001 From: puxuan <413323644@qq.com> Date: Tue, 2 Sep 2025 20:44:41 +0800 Subject: [PATCH] fix bug --- .../localization_global_const.lua | 1 + lua/app/config/strings/cn/global.lua | 1 + lua/app/module/hero/hero_manager.lua | 4 +- lua/app/ui/hero/hero_info_comp.lua | 38 ++++++++++++++----- lua/app/ui/hero/hero_skill_info_ui.lua | 30 ++++++++------- lua/app/ui/hero/star_info_comp.lua | 17 +++++++-- lua/app/userdata/hero/hero_entity.lua | 2 +- 7 files changed, 64 insertions(+), 29 deletions(-) diff --git a/lua/app/config/localization/localization_global_const.lua b/lua/app/config/localization/localization_global_const.lua index 92b44e3e..c67a1865 100644 --- a/lua/app/config/localization/localization_global_const.lua +++ b/lua/app/config/localization/localization_global_const.lua @@ -678,6 +678,7 @@ local LocalizationGlobalConst = SUMMON_DESC_6 = "SUMMON_DESC_6", SUMMON_DESC_7 = "SUMMON_DESC_7", HERO_DESC_21 = "HERO_DESC_21", + HERO_DESC_22 = "HERO_DESC_22", } return LocalizationGlobalConst \ No newline at end of file diff --git a/lua/app/config/strings/cn/global.lua b/lua/app/config/strings/cn/global.lua index fd12bfe6..ac6f41ea 100644 --- a/lua/app/config/strings/cn/global.lua +++ b/lua/app/config/strings/cn/global.lua @@ -678,6 +678,7 @@ local localization_global = ["SUMMON_DESC_6"] = "普通召唤", ["SUMMON_DESC_7"] = "高级召唤", ["HERO_DESC_21"] = "等级达到{0}可升星", + ["HERO_DESC_22"] = "去升星", } return localization_global \ No newline at end of file diff --git a/lua/app/module/hero/hero_manager.lua b/lua/app/module/hero/hero_manager.lua index 39cd9eec..479436ef 100644 --- a/lua/app/module/hero/hero_manager.lua +++ b/lua/app/module/hero/hero_manager.lua @@ -12,8 +12,8 @@ function HeroManager:showHeroUnlockUI(heroIdList) UIManager:showUI("app/ui/hero/hero_unlock_ui", {heroIdList = heroIdList}) end -function HeroManager:showHeroSkillInfoUI(heroEntity, idx, buffId, isUnlock) - UIManager:showUI("app/ui/hero/hero_skill_info_ui", {heroEntity = heroEntity, idx = idx, buffId = buffId, isUnlock = isUnlock}) +function HeroManager:showHeroSkillInfoUI(heroEntity, idx, buffId, isUnlock, isPop) + UIManager:showUI("app/ui/hero/hero_skill_info_ui", {heroEntity = heroEntity, idx = idx, buffId = buffId, isUnlock = isUnlock, isPop = isPop}) end function HeroManager:upgradeHero(heroId, heroEntity, level) diff --git a/lua/app/ui/hero/hero_info_comp.lua b/lua/app/ui/hero/hero_info_comp.lua index 25bafe34..0d1b5a19 100644 --- a/lua/app/ui/hero/hero_info_comp.lua +++ b/lua/app/ui/hero/hero_info_comp.lua @@ -34,11 +34,13 @@ function HeroInfoComp:init() self.needStarNodeDescTx1 = uiMap["hero_info.up.need_star_node.desc_tx_1"] self.needStarNodeStarImg = uiMap["hero_info.up.need_star_node.star_img"] self.needStarNodeDescTx2 = uiMap["hero_info.up.need_star_node.desc_tx_2"] - uiMap["hero_info.up.goto_btn.text"]:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_18)) + uiMap["hero_info.up.goto_btn.text"]:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_22)) self.needStarNodeDescTx2:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_20)) local meshProComp = self.needStarNodeDescTx2:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO) local contentWidth = meshProComp.preferredWidth self.needStarNodeDescTx2:setSizeDeltaX(contentWidth) + self.bg5Vfx01 = uiMap["hero_info.bg_5.vfx_c1_ui_up_b01"] + self.bg6Vfx01 = uiMap["hero_info.bg_6.vfx_c1_ui_up_b01"] self.skill = {} self.skillIcon = {} @@ -54,6 +56,11 @@ function HeroInfoComp:init() self.costCells[i] = uiMap["hero_info.up.reward_cell_" .. i]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL) end + self.lvUpVfxs = {} + for i = 1, 5 do + self.lvUpVfxs[i] = uiMap["hero_info.vfx_c1_ui_uplight_b0" .. i] + end + self.spineObj:setVisible(false) self.txUpdesc:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_15, 1)) self.txUpdesc5:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_15, 5)) @@ -261,19 +268,32 @@ function HeroInfoComp:refresh(checkLevel) -- self.needStarNodeStarImg = uiMap["hero_info.up.need_star_node.star_img"] -- self.needStarNodeDescTx2 = uiMap["hero_info.up.need_star_node.desc_tx_2"] + for i,v in ipairs(self.lvUpVfxs) do + v:setActive(false) + end if isLvChange then - self.spineObj:setVisible(true) - self.spineObj:playAnim("idle", false, true) + local qlt = self.heroEntity:getQlt() + -- self.spineObj:setVisible(true) + -- self.spineObj:playAnim("idle", false, true) + self.lvUpVfxs[qlt - 1]:setActive(true) + self.bg5Vfx01:setActive(true) + self.bg6Vfx01:setActive(true) + else + -- self.spineObj:setVisible(false) + self.bg5Vfx01:setActive(false) + self.bg6Vfx01:setActive(false) end local needPop, isUnlock, skillIdx = self.heroEntity:checkSkillUnlock() if needPop then - local skillInfo = skillList[skillIdx] - if skillInfo then - local skillId = skillInfo[2] - local cfg = ConfigManager:getConfig("skill_rogue")[skillId] - ModuleManager.HeroManager:showHeroSkillInfoUI(self.heroEntity, skillIdx, cfg.buff_id, isUnlock) - end + self.baseObject:performWithDelayGlobal(function() + local skillInfo = skillList[skillIdx] + if skillInfo then + local skillId = skillInfo[2] + local cfg = ConfigManager:getConfig("skill_rogue")[skillId] + ModuleManager.HeroManager:showHeroSkillInfoUI(self.heroEntity, skillIdx, cfg.buff_id, isUnlock, needPop) + end + end, 0.5) end end diff --git a/lua/app/ui/hero/hero_skill_info_ui.lua b/lua/app/ui/hero/hero_skill_info_ui.lua index 23f48774..37cb07c4 100644 --- a/lua/app/ui/hero/hero_skill_info_ui.lua +++ b/lua/app/ui/hero/hero_skill_info_ui.lua @@ -18,6 +18,7 @@ function HeroSkillInfoUI:ctor(parmas) self.heroEntity = parmas.heroEntity self.idx = parmas.idx or 1 self.buffId = parmas.buffId + self.isPop = parmas.isPop end function HeroSkillInfoUI:onLoadRootComplete() @@ -43,18 +44,21 @@ function HeroSkillInfoUI:onLoadRootComplete() self.buffNode = uiMap["hero_skill_info_ui.content.buff_node"] self.content = uiMap["hero_skill_info_ui.content"] self.line2 = uiMap["hero_skill_info_ui.content.line_2"] + self.vfx02 = uiMap["hero_skill_info_ui.content.vfx_c1_ui_up_b02"] + self.vfx02:setActive(false) self.heroCells = {} self.buffImgs = {} self.buffTxs = {} + self.skillDescTxs = {} + self.skillVfxs = {} for i = 1, 2 do self.heroCells[i] = uiMap["hero_skill_info_ui.content.hero_node.hero_cell_" .. i]:addLuaComponent(HERO_CELL) self.buffImgs[i] = uiMap["hero_skill_info_ui.content.buff_node.buff_img_" .. i] self.buffTxs[i] = uiMap["hero_skill_info_ui.content.buff_node.buff_tx_" .. i] - end - self.skillDescTxs = {} - for i = 1, 3 do self.skillDescTxs[i] = uiMap["hero_skill_info_ui.content.skill_desc_tx_" .. i] + self.skillVfxs[i] = uiMap["hero_skill_info_ui.content.skill_desc_tx_" .. i .. ".vfx_c1_ui_up_b03"] + self.skillVfxs[i]:setActive(false) end uiMap["hero_skill_info_ui.content.hero_node.desc_tx_1"]:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_13)) @@ -94,27 +98,25 @@ function HeroSkillInfoUI:refreshSkillIcon() end self.descTx:setText(ModuleManager.HeroManager:getSkillDesc(self.heroEntity:getBaseSkill())) + self.vfx02:setActive(self.isPop) end function HeroSkillInfoUI:refreshSkillDesc() local skillInfo, currIdx = self.heroEntity:getRogueSkillListByIdx(self.idx) - local posY = -324 - for i = 1, 3 do - local skillUnlcokLv = skillInfo[i][1] - local skillId = skillInfo[i][2] + for i = 1, 2 do + local skillUnlcokLv = skillInfo[i + 1][1] + local skillId = skillInfo[i + 1][2] local lvStr = I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_14, skillUnlcokLv) - local skillStr - if i == 1 then - skillStr = ModuleManager.HeroManager:getSkillRogueDesc(skillId) - else - skillStr = ModuleManager.HeroManager:getSkillRogueDescEntry(skillId, i - 1) - end - if currIdx >= i then + local skillStr = ModuleManager.HeroManager:getSkillRogueDescEntry(skillId, i) + if currIdx - 1 >= i then self.skillDescTxs[i]:setText("" .. lvStr .. " " .. skillStr .. "") else self.skillDescTxs[i]:setText("" .. lvStr .. " " .. skillStr .. "") end + if self.isPop and currIdx - 1 == i then + self.skillVfxs[i]:setActive(true) + end self.skillDescTxs[i]:setAnchoredPositionY(posY) local meshProComp = self.skillDescTxs[i]:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO) local contentHeight = meshProComp.preferredHeight diff --git a/lua/app/ui/hero/star_info_comp.lua b/lua/app/ui/hero/star_info_comp.lua index c4a2bf5d..f7800091 100644 --- a/lua/app/ui/hero/star_info_comp.lua +++ b/lua/app/ui/hero/star_info_comp.lua @@ -12,6 +12,8 @@ function StarInfoComp:init() self.descTx = uiMap["star_info.upgrade.desc_tx"] self.upgrade = uiMap["star_info.upgrade"] self.bg = uiMap["star_info.bg"] + self.vfx04 = uiMap["star_info.scrollrect.viewport.content.vfx_c1_ui_up_b04"] + self.vfx04:setActive(false) self.costCells = {} for i = 1, 2 do self.costCells[i] = uiMap["star_info.upgrade.reward_cell_" .. i]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL) @@ -23,8 +25,7 @@ function StarInfoComp:init() self.nextLvTx = uiMap["star_info.info_node.next_lv_tx"] self.upBtnTx:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_16)) - -- self.descTx:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_4)) - self.lvBtnTx:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_4)) + self.lvBtnTx:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_18)) self.upBtn:addClickListener(function() ModuleManager.HeroManager:upgradeHeroStar(self.heroEntity:getCfgId()) end) @@ -39,7 +40,7 @@ function StarInfoComp:init() return STAR_CELL end) self.scrollRectComp:addRefreshCallback(function(index, cell) - cell:refresh(self.heroEntity, index) + cell:refresh(self.heroEntity, index, self.starUp) end) self.scrollRectComp:clearCells() end @@ -57,6 +58,7 @@ function StarInfoComp:setHeroData(heroEntity, onlyLook) end function StarInfoComp:refresh(starUp) + self.starUp = starUp self:refreshInfo() self:refreshStarBtn() self:refreshStarInfo() @@ -128,6 +130,15 @@ end function StarInfoComp:refreshStarInfo() local maxStarLv = self.heroEntity:getMaxStar() self.scrollRectComp:refillCells(maxStarLv) + + if self.starUp then + local star = self.heroEntity:getStar() + self.scrollRectComp:moveToIndex(star - 1) + self.vfx04:setAnchoredPositionY(-33 - (star - 1) * 56) + self.vfx04:setActive(true) + else + self.vfx04:setActive(false) + end end return StarInfoComp \ No newline at end of file diff --git a/lua/app/userdata/hero/hero_entity.lua b/lua/app/userdata/hero/hero_entity.lua index db26a2d2..a65ebb8e 100644 --- a/lua/app/userdata/hero/hero_entity.lua +++ b/lua/app/userdata/hero/hero_entity.lua @@ -591,7 +591,7 @@ function HeroEntity:getRogueSkillListByIdx(idx) local ids = self.config["rouge_skill_" .. idx] local lv = 0 if ids then - for i = 1, #ids do + for i = #ids, 1, -1 do if self.data.lv >= ids[i][1]then lv = i break