This commit is contained in:
puxuan 2025-10-23 18:10:44 +08:00
parent 248e9720be
commit 8d3de2f643
7 changed files with 74 additions and 93 deletions

View File

@ -11,29 +11,7 @@ function ActSprintManager:showActSprintShopUI(params)
end end
function ActSprintManager:showActSprintMainUI(params) function ActSprintManager:showActSprintMainUI(params)
local actId = params.actId UIManager:showUI("app/ui/activity/act_sprint_summon_all/act_main_ui", params)
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
end end
-- 冲刺活动 商店兑换 -- 冲刺活动 商店兑换

View File

@ -41,10 +41,9 @@ function ActMainUI:currencyParams()
return self.params, true return self.params, true
end end
function ActMainUI:ctor(params) function ActMainUI:ctor()
self.params = params or {} self.actId = DataManager[self:getActDataType()]:getActId()
self.actId = params.actId self.curPage = self:getRpPage()
self.curPage = params.page or self:getRpPage()
end end
function ActMainUI:getPrefabPath() function ActMainUI:getPrefabPath()

View File

@ -3,6 +3,7 @@ local ActBaseUI = class("ActBaseUI", BaseUI)
local ACT_PAGE_BTNS_COMP = "app/ui/activity/common/comp/act_page_btns_comp" local ACT_PAGE_BTNS_COMP = "app/ui/activity/common/comp/act_page_btns_comp"
function ActBaseUI:ctor(params) function ActBaseUI:ctor(params)
params = params or {}
self.page = params.page or 1 self.page = params.page or 1
self.ActConst = self:getActConst() self.ActConst = self:getActConst()
end end

View File

@ -93,9 +93,9 @@ function EquipCell:_refresh(entity, showMask, showCheck, showLock)
end end
function EquipCell:refreshEmpty(part, showSelect) function EquipCell:refreshEmpty(part, showSelect)
self.qltImg:setSprite(GConst.ATLAS_PATH.ICON_EQUIP, "frame_0") -- self.qltImg:setSprite(GConst.ATLAS_PATH.ICON_EQUIP, "frame_0")
-- self.iconImg:setActive(true) self.iconImg:setActive(false)
self.iconImg:setSprite(GConst.ATLAS_PATH.ICON_EQUIP, "force_frame_" .. part) self.qltImg:setSprite(GConst.ATLAS_PATH.ICON_EQUIP, "force_frame_" .. part)
self.lvTx:setText("") self.lvTx:setText("")
self.refineBg:setActive(false) self.refineBg:setActive(false)

View File

@ -16,7 +16,7 @@ function SideBarActSprintCell:getSpineName()
end end
function SideBarActSprintCell:onClick() function SideBarActSprintCell:onClick()
ModuleManager.ActSprintManager:showActSprintListUI() ModuleManager.ActSprintManager:showActSprintMainUI()
end end
function SideBarActSprintCell:getIsShowRedPoint() function SideBarActSprintCell:getIsShowRedPoint()

View File

@ -155,7 +155,7 @@ function MainComp:refreshChapter(force)
self.chapterPage = DataManager.ChapterData:getChapterPage(chapterId) self.chapterPage = DataManager.ChapterData:getChapterPage(chapterId)
self.chapterStage = DataManager.ChapterData:getChapterStage(chapterId) self.chapterStage = DataManager.ChapterData:getChapterStage(chapterId)
self:refreshChapterBg() self:refreshChapterBg()
self:refreshFightBtn() self:refreshFightBtn()
end end
self.currChapterId = chapterId self.currChapterId = chapterId
self:refreshChapterInfo() self:refreshChapterInfo()
@ -253,16 +253,16 @@ end
function MainComp:refreshRedPoint() function MainComp:refreshRedPoint()
local time = Time:getServerTime() - DataManager.IdleData:getLastDropTime() local time = Time:getServerTime() - DataManager.IdleData:getLastDropTime()
-- local idleMaxTime = DataManager.IdleData:getIdleMaxTime() -- local idleMaxTime = DataManager.IdleData:getIdleMaxTime()
local idleMaxTime = 3600 local idleMaxTime = 3600
if time >= idleMaxTime then if time >= idleMaxTime then
self.leftBtn:addRedPoint(70, -36, 1) self.leftBtn:addRedPoint(70, -36, 1)
else else
self.leftBtn:removeRedPoint() self.leftBtn:removeRedPoint()
end end
if DataManager.SummonData:hasSummonCostRedPoint() then if DataManager.SummonData:hasSummonCostRedPoint() then
self.rightBtn:addRedPoint(-70, -36, 1) self.rightBtn:addRedPoint(-70, -36, 1)
else else
self.rightBtn:removeRedPoint() self.rightBtn:removeRedPoint()
end end

View File

@ -2,68 +2,71 @@ local UIPrefabObject = require "app/bf/unity/uiprefab_object"
local SummonRewardCell = class("SummonRewardCell", BaseCell) local SummonRewardCell = class("SummonRewardCell", BaseCell)
function SummonRewardCell:init() function SummonRewardCell:init()
local uiMap = self:getUIMap() local uiMap = self:getUIMap()
self.animator = self.baseObject:getComponent(GConst.TYPEOF_UNITY_CLASS.ANIMATOR) self.animator = self.baseObject:getComponent(GConst.TYPEOF_UNITY_CLASS.ANIMATOR)
self.imgIcon = uiMap["summon_reward_cell.bg1.img_icon"] self.imgIcon = uiMap["summon_reward_cell.bg1.img_icon"]
self.txName = uiMap["summon_reward_cell.bg1.tx_name"] self.txName = uiMap["summon_reward_cell.bg1.tx_name"]
self.txCount = uiMap["summon_reward_cell.bg1.tx_count"] self.txCount = uiMap["summon_reward_cell.bg1.tx_count"]
self.bg = uiMap["summon_reward_cell.bg"] self.bg = uiMap["summon_reward_cell.bg"]
self.bg1 = uiMap["summon_reward_cell.bg1"] self.bg1 = uiMap["summon_reward_cell.bg1"]
self.effectQlts = {} self.effectQlts = {}
self.effectQlts[3] = uiMap["summon_reward_cell.bg1.vfx_b13_chouka_lan_b01"] 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[4] = uiMap["summon_reward_cell.bg1.vfx_b13_chouka_zi_b01"]
self.effectQlts[5] = uiMap["summon_reward_cell.bg1.vfx_b13_chouka_cheng_b01"] self.effectQlts[5] = uiMap["summon_reward_cell.bg1.vfx_b13_chouka_cheng_b01"]
end end
function SummonRewardCell:getEffectQlts() function SummonRewardCell:getEffectQlts()
return self.effectQlts return self.effectQlts
end end
function SummonRewardCell:refresh(reward, index, parentUI) function SummonRewardCell:refresh(reward, index, parentUI)
self.patentUI = parentUI self.patentUI = parentUI
if self.effectQlts[5] then if self.effectQlts[5] then
self.effectQlts[5]:setActive(false) self.effectQlts[5]:setActive(false)
end end
self.effectQlts[5]:setActive(false) self.effectQlts[5]:setActive(false)
self.effectQlts[4]:setActive(false) self.effectQlts[4]:setActive(false)
self.effectQlts[3]:setActive(false) self.effectQlts[3]:setActive(false)
local cfg = DataManager.HeroData:getHeroConfig(reward.item.id) local cfg = DataManager.HeroData:getHeroConfig(reward.item.id)
self.imgIcon:setSprite(GConst.ATLAS_PATH.ICON_HERO_SUMMON, tostring(cfg.icon)) if not cfg then
self.bg:setSprite(GConst.ATLAS_PATH.ICON_HERO_SUMMON, "summon_card_b_" .. cfg.qlt) return
self.bg1:setSprite(GConst.ATLAS_PATH.UI_SUMMON, "summon_card_" .. cfg.qlt) end
self.txName:setText(ModuleManager.HeroManager:getHeroName(reward.item.id)) self.imgIcon:setSprite(GConst.ATLAS_PATH.ICON_HERO_SUMMON, tostring(cfg.icon))
-- self.txCount:setText("x" .. reward.item.count) self.bg:setSprite(GConst.ATLAS_PATH.ICON_HERO_SUMMON, "summon_card_b_" .. cfg.qlt)
self:getBaseObject():setActive(true) self.bg1:setSprite(GConst.ATLAS_PATH.UI_SUMMON, "summon_card_" .. cfg.qlt)
self.animator:SetTrigger("t_open") 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.baseObject:performWithDelayGlobal(function()
self:playEffect(cfg.qlt) self:playEffect(cfg.qlt)
end, 0.3) end, 0.3)
end end
function SummonRewardCell:playEffect(qlt) function SummonRewardCell:playEffect(qlt)
if qlt == 6 and self.effectQlts[6] == nil then if qlt == 6 and self.effectQlts[6] == nil then
local tranInfo = self.imgIcon:getComponent(GConst.TYPEOF_UNITY_CLASS.TRANSFORM).parent local tranInfo = self.imgIcon:getComponent(GConst.TYPEOF_UNITY_CLASS.TRANSFORM).parent
if tranInfo then if tranInfo then
local infoBase = UIPrefabObject:create() local infoBase = UIPrefabObject:create()
infoBase:initWithPrefab(GConst.EMPTY_STRING, tranInfo) infoBase:initWithPrefab(GConst.EMPTY_STRING, tranInfo)
infoBase:initPrefabHelper() infoBase:initPrefabHelper()
EffectManager:loadUIEffectAsync("assets/prefabs/effects/ui/vfx_b13_chouka_hong_b01.prefab", self.patentUI, infoBase, 0, EffectManager:loadUIEffectAsync("assets/prefabs/effects/ui/vfx_b13_chouka_hong_b01.prefab", self.patentUI, infoBase, 0,
function(obj) function(obj)
if self.effectQlts[6] then if self.effectQlts[6] then
self.effectQlts[6]:destroy() self.effectQlts[6]:destroy()
self.effectQlts[6] = nil self.effectQlts[6] = nil
end end
self.effectQlts[6] = obj self.effectQlts[6] = obj
end) end)
end end
else else
local effect = self.effectQlts[qlt] local effect = self.effectQlts[qlt]
if effect then if effect then
effect:setActive(true) effect:setActive(true)
effect:play() effect:play()
end end
end end
-- effect:performDurationDelay(function() -- effect:performDurationDelay(function()
-- effect:setActive(false) -- effect:setActive(false)
-- end) -- end)
end end
return SummonRewardCell return SummonRewardCell