From 6d3a0748a1f9eadafe9e26b9bf7534f7ac0b8698 Mon Sep 17 00:00:00 2001 From: Fang Date: Tue, 25 Jul 2023 23:32:55 +0800 Subject: [PATCH] fix --- lua/app/ui/hero/armor_info_comp.lua | 20 ++++++++++++------- lua/app/ui/hero/hero_detail_ui.lua | 4 ++-- .../userdata/dungeon/dungeon_armor_entity.lua | 13 ++++++++++-- 3 files changed, 26 insertions(+), 11 deletions(-) diff --git a/lua/app/ui/hero/armor_info_comp.lua b/lua/app/ui/hero/armor_info_comp.lua index 902377af..8dcb4bc1 100644 --- a/lua/app/ui/hero/armor_info_comp.lua +++ b/lua/app/ui/hero/armor_info_comp.lua @@ -9,9 +9,9 @@ local ARMOR_PART_INDEX = { } -- 升级 local EFFECT_UP_GRADE = { - "assets/prefabs/effects/ui/vfx_ui_equip_up_b01", - "assets/prefabs/effects/ui/vfx_ui_equip_up_b02", - "assets/prefabs/effects/ui/vfx_ui_equip_up_b03", + "assets/prefabs/effects/ui/vfx_ui_equip_up_b01.prefab", + "assets/prefabs/effects/ui/vfx_ui_equip_up_b02.prefab", + "assets/prefabs/effects/ui/vfx_ui_equip_up_b03.prefab", } function ArmorInfoComp:init() @@ -244,8 +244,11 @@ function ArmorInfoComp:playPartUpgradeEffect(part) local map = armorObj:genAllChildren() local rootEffect = map["root_effect"] rootEffect:removeAllChildren() - EffectManager:loadUIEffectAsync(EFFECT_UP_GRADE, self.uiRoot, rootEffect, GConst.UI_EFFECT_ORDER.LEVEL5, function(obj) - obj:play() + local stage = DataManager.EquipData:getEquip(self.heroEntity:getCfgId(), part):getStage() + 1 + EffectManager:loadUIEffectAsync(EFFECT_UP_GRADE[math.floor(stage / 2) + stage % 2], self.uiRoot, rootEffect, GConst.UI_EFFECT_ORDER.LEVEL5, function(obj) + obj:playComplete(function() + rootEffect:removeAllChildren() + end) end) end @@ -262,8 +265,11 @@ end function ArmorInfoComp:playUpgradeEffect(part) self:playPartUpgradeEffect(part) self.rootCurEffect:removeAllChildren() - EffectManager:loadUIEffectAsync(EFFECT_UP_GRADE, self.uiRoot, self.rootCurEffect, GConst.UI_EFFECT_ORDER.LEVEL5, function(obj) - obj:play() + local stage = DataManager.EquipData:getEquip(self.heroEntity:getCfgId(), part):getStage() + 1 + EffectManager:loadUIEffectAsync(EFFECT_UP_GRADE[math.floor(stage / 2) + stage % 2], self.uiRoot, self.rootCurEffect, GConst.UI_EFFECT_ORDER.LEVEL5, function(obj) + obj:playComplete(function() + self.rootCurEffect:removeAllChildren() + end) end) end diff --git a/lua/app/ui/hero/hero_detail_ui.lua b/lua/app/ui/hero/hero_detail_ui.lua index 0ed706ca..fef089c1 100644 --- a/lua/app/ui/hero/hero_detail_ui.lua +++ b/lua/app/ui/hero/hero_detail_ui.lua @@ -116,7 +116,7 @@ function HeroDetailUI:onLoadRootComplete() end) self:addEventListener(EventManager.CUSTOM_EVENT.EQUIP_UPSECTION_SUCCESS, function(part) - Logger.logHighlight("升段:"..part.."/"..tostring(part == GConst.EquipConst.PART_TYPE.WEAPON)) + Logger.logHighlight("升段:"..part) if part == GConst.EquipConst.PART_TYPE.WEAPON then self.compWeapon:playEffect(true, true) else @@ -124,7 +124,7 @@ function HeroDetailUI:onLoadRootComplete() end end) self:addEventListener(EventManager.CUSTOM_EVENT.EQUIP_UPGRADE_SUCCESS, function(part) - Logger.logHighlight("升级:"..part.."/"..tostring(part == GConst.EquipConst.PART_TYPE.WEAPON)) + Logger.logHighlight("升级:"..part) if part == GConst.EquipConst.PART_TYPE.WEAPON then self.compWeapon:playEffect(true, false) else diff --git a/lua/app/userdata/dungeon/dungeon_armor_entity.lua b/lua/app/userdata/dungeon/dungeon_armor_entity.lua index f2a40535..fa355f22 100644 --- a/lua/app/userdata/dungeon/dungeon_armor_entity.lua +++ b/lua/app/userdata/dungeon/dungeon_armor_entity.lua @@ -391,13 +391,14 @@ end -- 获取当前基金奖励所属阶段 function DungeonArmorEntity:getCurFundStage() - for id, data in ipairs(ConfigManager:getConfig("dungeon_armor_fund")) do + local cfg = ConfigManager:getConfig("dungeon_armor_fund") + for id, data in ipairs(cfg) do if id ~= FUND_AD_REWARD_ID and not self:isGotFundReward(id) then return data.stage end end - return nil + return cfg[#cfg].stage end -- 基金是否有红点 @@ -409,6 +410,14 @@ end function DungeonArmorEntity:isBoughtFundStage(stage) local bought = DataManager.ShopData:getActGiftMapByType(PayManager.PURCHARSE_TYPE.ACT_GIFT) + if not stage then + return false + end + + if not self:getFundStageGiftId(stage) then + return + end + if EDITOR_MODE then Logger.logHighlight("支线基金购买状态/"..self:getFundStageGiftId(stage)) Logger.printTable(bought)