This commit is contained in:
Fang 2023-07-25 23:32:55 +08:00
parent 25bb8df7df
commit 6d3a0748a1
3 changed files with 26 additions and 11 deletions

View File

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

View File

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

View File

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