From 8d3de2f643ba2ee629c4133bf7851e1f27c39887 Mon Sep 17 00:00:00 2001 From: puxuan <413323644@qq.com> Date: Thu, 23 Oct 2025 18:10:44 +0800 Subject: [PATCH] fix bug --- .../act_sprint/act_sprint_manager.lua | 24 +--- .../act_sprint_summon_all/act_main_ui.lua | 7 +- lua/app/ui/activity/common/act_base_ui.lua | 1 + lua/app/ui/common/cell/equip_cell.lua | 6 +- .../cell/side_bar_act_sprint_cell.lua | 2 +- lua/app/ui/main_city/component/main_comp.lua | 14 +-- lua/app/ui/summon/cell/summon_reward_cell.lua | 113 +++++++++--------- 7 files changed, 74 insertions(+), 93 deletions(-) diff --git a/lua/app/module/activity/act_sprint/act_sprint_manager.lua b/lua/app/module/activity/act_sprint/act_sprint_manager.lua index b8b39c01..33745eaa 100644 --- a/lua/app/module/activity/act_sprint/act_sprint_manager.lua +++ b/lua/app/module/activity/act_sprint/act_sprint_manager.lua @@ -11,29 +11,7 @@ function ActSprintManager:showActSprintShopUI(params) end function ActSprintManager:showActSprintMainUI(params) - local actId = params.actId - if actId == GConst.ActSprintConst.ACT_ID.SUMMON_ALL then - UIManager:showUI("app/ui/activity/act_sprint_summon_all/act_main_ui", params) - end - -- if actId == GConst.ActSprintConst.ACT_ID.SUMMON then - -- UIManager:showUI("app/ui/activity/act_sprint_summon/act_sprint_main_ui", params) - -- elseif actId == GConst.ActSprintConst.ACT_ID.CORE_SOUL_BOX then - -- UIManager:showUI("app/ui/activity/act_sprint_box/act_sprint_main_ui", params) - -- elseif actId == GConst.ActSprintConst.ACT_ID.SUMMON_V2 then - -- UIManager:showUI("app/ui/activity/act_sprint_summon_v2/act_sprint_main_ui", params) - -- elseif actId == GConst.ActSprintConst.ACT_ID.CORE_SOUL_BOX_V2 then - -- UIManager:showUI("app/ui/activity/act_sprint_box_v2/act_sprint_main_ui", params) - -- elseif actId == GConst.ActSprintConst.ACT_ID.SUMMON_ALL then - -- UIManager:showUI("app/ui/activity/act_sprint_summon_all/act_sprint_main_ui", params) - -- elseif actId == GConst.ActSprintConst.ACT_ID.CORE_SOUL_BOX_ALL then - -- UIManager:showUI("app/ui/activity/act_sprint_box_all/act_sprint_main_ui", params) - -- elseif actId == GConst.ActSprintConst.ACT_ID.SUMMON_LOOP then - -- UIManager:showUI("app/ui/activity/act_sprint_summon_rp/act_sprint_main_ui", params) - -- elseif actId == GConst.ActSprintConst.ACT_ID.CORE_SOUL_BOX_LOOP then - -- UIManager:showUI("app/ui/activity/act_sprint_box_rp/act_sprint_main_ui", params) - -- elseif actId == GConst.ActSprintConst.ACT_ID.TREE_LOOP then - -- UIManager:showUI("app/ui/activity/act_sprint_tree_rp/act_sprint_main_ui", params) - -- end + UIManager:showUI("app/ui/activity/act_sprint_summon_all/act_main_ui", params) end -- 冲刺活动 商店兑换 diff --git a/lua/app/ui/activity/act_sprint_summon_all/act_main_ui.lua b/lua/app/ui/activity/act_sprint_summon_all/act_main_ui.lua index f2439b8b..e5ec52cf 100644 --- a/lua/app/ui/activity/act_sprint_summon_all/act_main_ui.lua +++ b/lua/app/ui/activity/act_sprint_summon_all/act_main_ui.lua @@ -41,10 +41,9 @@ function ActMainUI:currencyParams() return self.params, true end -function ActMainUI:ctor(params) - self.params = params or {} - self.actId = params.actId - self.curPage = params.page or self:getRpPage() +function ActMainUI:ctor() + self.actId = DataManager[self:getActDataType()]:getActId() + self.curPage = self:getRpPage() end function ActMainUI:getPrefabPath() diff --git a/lua/app/ui/activity/common/act_base_ui.lua b/lua/app/ui/activity/common/act_base_ui.lua index 8855ffd3..8276c042 100755 --- a/lua/app/ui/activity/common/act_base_ui.lua +++ b/lua/app/ui/activity/common/act_base_ui.lua @@ -3,6 +3,7 @@ local ActBaseUI = class("ActBaseUI", BaseUI) local ACT_PAGE_BTNS_COMP = "app/ui/activity/common/comp/act_page_btns_comp" function ActBaseUI:ctor(params) + params = params or {} self.page = params.page or 1 self.ActConst = self:getActConst() end diff --git a/lua/app/ui/common/cell/equip_cell.lua b/lua/app/ui/common/cell/equip_cell.lua index b9409ed3..466b72b5 100644 --- a/lua/app/ui/common/cell/equip_cell.lua +++ b/lua/app/ui/common/cell/equip_cell.lua @@ -93,9 +93,9 @@ function EquipCell:_refresh(entity, showMask, showCheck, showLock) end function EquipCell:refreshEmpty(part, showSelect) - self.qltImg:setSprite(GConst.ATLAS_PATH.ICON_EQUIP, "frame_0") - -- self.iconImg:setActive(true) - self.iconImg:setSprite(GConst.ATLAS_PATH.ICON_EQUIP, "force_frame_" .. part) + -- self.qltImg:setSprite(GConst.ATLAS_PATH.ICON_EQUIP, "frame_0") + self.iconImg:setActive(false) + self.qltImg:setSprite(GConst.ATLAS_PATH.ICON_EQUIP, "force_frame_" .. part) self.lvTx:setText("") self.refineBg:setActive(false) diff --git a/lua/app/ui/main_city/cell/side_bar_act_sprint_cell.lua b/lua/app/ui/main_city/cell/side_bar_act_sprint_cell.lua index e295d3a1..258a2c79 100755 --- a/lua/app/ui/main_city/cell/side_bar_act_sprint_cell.lua +++ b/lua/app/ui/main_city/cell/side_bar_act_sprint_cell.lua @@ -16,7 +16,7 @@ function SideBarActSprintCell:getSpineName() end function SideBarActSprintCell:onClick() - ModuleManager.ActSprintManager:showActSprintListUI() + ModuleManager.ActSprintManager:showActSprintMainUI() end function SideBarActSprintCell:getIsShowRedPoint() diff --git a/lua/app/ui/main_city/component/main_comp.lua b/lua/app/ui/main_city/component/main_comp.lua index 031d450c..3d7e8dad 100644 --- a/lua/app/ui/main_city/component/main_comp.lua +++ b/lua/app/ui/main_city/component/main_comp.lua @@ -155,7 +155,7 @@ function MainComp:refreshChapter(force) self.chapterPage = DataManager.ChapterData:getChapterPage(chapterId) self.chapterStage = DataManager.ChapterData:getChapterStage(chapterId) self:refreshChapterBg() - self:refreshFightBtn() + self:refreshFightBtn() end self.currChapterId = chapterId self:refreshChapterInfo() @@ -253,16 +253,16 @@ end function MainComp:refreshRedPoint() local time = Time:getServerTime() - DataManager.IdleData:getLastDropTime() - -- local idleMaxTime = DataManager.IdleData:getIdleMaxTime() - local idleMaxTime = 3600 - if time >= idleMaxTime then - self.leftBtn:addRedPoint(70, -36, 1) + -- local idleMaxTime = DataManager.IdleData:getIdleMaxTime() + local idleMaxTime = 3600 + if time >= idleMaxTime then + self.leftBtn:addRedPoint(70, -36, 1) else self.leftBtn:removeRedPoint() - end + end if DataManager.SummonData:hasSummonCostRedPoint() then - self.rightBtn:addRedPoint(-70, -36, 1) + self.rightBtn:addRedPoint(-70, -36, 1) else self.rightBtn:removeRedPoint() end diff --git a/lua/app/ui/summon/cell/summon_reward_cell.lua b/lua/app/ui/summon/cell/summon_reward_cell.lua index 5163b398..ce118c15 100755 --- a/lua/app/ui/summon/cell/summon_reward_cell.lua +++ b/lua/app/ui/summon/cell/summon_reward_cell.lua @@ -2,68 +2,71 @@ local UIPrefabObject = require "app/bf/unity/uiprefab_object" local SummonRewardCell = class("SummonRewardCell", BaseCell) function SummonRewardCell:init() - local uiMap = self:getUIMap() - self.animator = self.baseObject:getComponent(GConst.TYPEOF_UNITY_CLASS.ANIMATOR) - self.imgIcon = uiMap["summon_reward_cell.bg1.img_icon"] - self.txName = uiMap["summon_reward_cell.bg1.tx_name"] - self.txCount = uiMap["summon_reward_cell.bg1.tx_count"] - self.bg = uiMap["summon_reward_cell.bg"] - self.bg1 = uiMap["summon_reward_cell.bg1"] - self.effectQlts = {} - self.effectQlts[3] = uiMap["summon_reward_cell.bg1.vfx_b13_chouka_lan_b01"] - self.effectQlts[4] = uiMap["summon_reward_cell.bg1.vfx_b13_chouka_zi_b01"] - self.effectQlts[5] = uiMap["summon_reward_cell.bg1.vfx_b13_chouka_cheng_b01"] + local uiMap = self:getUIMap() + self.animator = self.baseObject:getComponent(GConst.TYPEOF_UNITY_CLASS.ANIMATOR) + self.imgIcon = uiMap["summon_reward_cell.bg1.img_icon"] + self.txName = uiMap["summon_reward_cell.bg1.tx_name"] + self.txCount = uiMap["summon_reward_cell.bg1.tx_count"] + self.bg = uiMap["summon_reward_cell.bg"] + self.bg1 = uiMap["summon_reward_cell.bg1"] + self.effectQlts = {} + self.effectQlts[3] = uiMap["summon_reward_cell.bg1.vfx_b13_chouka_lan_b01"] + self.effectQlts[4] = uiMap["summon_reward_cell.bg1.vfx_b13_chouka_zi_b01"] + self.effectQlts[5] = uiMap["summon_reward_cell.bg1.vfx_b13_chouka_cheng_b01"] end function SummonRewardCell:getEffectQlts() - return self.effectQlts + return self.effectQlts end function SummonRewardCell:refresh(reward, index, parentUI) - self.patentUI = parentUI - if self.effectQlts[5] then - self.effectQlts[5]:setActive(false) - end - self.effectQlts[5]:setActive(false) - self.effectQlts[4]:setActive(false) - self.effectQlts[3]:setActive(false) - local cfg = DataManager.HeroData:getHeroConfig(reward.item.id) - self.imgIcon:setSprite(GConst.ATLAS_PATH.ICON_HERO_SUMMON, tostring(cfg.icon)) - self.bg:setSprite(GConst.ATLAS_PATH.ICON_HERO_SUMMON, "summon_card_b_" .. cfg.qlt) - self.bg1:setSprite(GConst.ATLAS_PATH.UI_SUMMON, "summon_card_" .. cfg.qlt) - self.txName:setText(ModuleManager.HeroManager:getHeroName(reward.item.id)) - -- self.txCount:setText("x" .. reward.item.count) - self:getBaseObject():setActive(true) - self.animator:SetTrigger("t_open") + self.patentUI = parentUI + if self.effectQlts[5] then + self.effectQlts[5]:setActive(false) + end + self.effectQlts[5]:setActive(false) + self.effectQlts[4]:setActive(false) + self.effectQlts[3]:setActive(false) + local cfg = DataManager.HeroData:getHeroConfig(reward.item.id) + if not cfg then + return + end + self.imgIcon:setSprite(GConst.ATLAS_PATH.ICON_HERO_SUMMON, tostring(cfg.icon)) + self.bg:setSprite(GConst.ATLAS_PATH.ICON_HERO_SUMMON, "summon_card_b_" .. cfg.qlt) + self.bg1:setSprite(GConst.ATLAS_PATH.UI_SUMMON, "summon_card_" .. cfg.qlt) + self.txName:setText(ModuleManager.HeroManager:getHeroName(reward.item.id)) + -- self.txCount:setText("x" .. reward.item.count) + self:getBaseObject():setActive(true) + self.animator:SetTrigger("t_open") self.baseObject:performWithDelayGlobal(function() - self:playEffect(cfg.qlt) - end, 0.3) + self:playEffect(cfg.qlt) + end, 0.3) end function SummonRewardCell:playEffect(qlt) - if qlt == 6 and self.effectQlts[6] == nil then - local tranInfo = self.imgIcon:getComponent(GConst.TYPEOF_UNITY_CLASS.TRANSFORM).parent - if tranInfo then - local infoBase = UIPrefabObject:create() - infoBase:initWithPrefab(GConst.EMPTY_STRING, tranInfo) - infoBase:initPrefabHelper() - EffectManager:loadUIEffectAsync("assets/prefabs/effects/ui/vfx_b13_chouka_hong_b01.prefab", self.patentUI, infoBase, 0, - function(obj) - if self.effectQlts[6] then - self.effectQlts[6]:destroy() - self.effectQlts[6] = nil - end - self.effectQlts[6] = obj - end) - end - else - local effect = self.effectQlts[qlt] - if effect then - effect:setActive(true) - effect:play() - end - end - - -- effect:performDurationDelay(function() - -- effect:setActive(false) - -- end) + if qlt == 6 and self.effectQlts[6] == nil then + local tranInfo = self.imgIcon:getComponent(GConst.TYPEOF_UNITY_CLASS.TRANSFORM).parent + if tranInfo then + local infoBase = UIPrefabObject:create() + infoBase:initWithPrefab(GConst.EMPTY_STRING, tranInfo) + infoBase:initPrefabHelper() + EffectManager:loadUIEffectAsync("assets/prefabs/effects/ui/vfx_b13_chouka_hong_b01.prefab", self.patentUI, infoBase, 0, + function(obj) + if self.effectQlts[6] then + self.effectQlts[6]:destroy() + self.effectQlts[6] = nil + end + self.effectQlts[6] = obj + end) + end + else + local effect = self.effectQlts[qlt] + if effect then + effect:setActive(true) + effect:play() + end + end + + -- effect:performDurationDelay(function() + -- effect:setActive(false) + -- end) end return SummonRewardCell