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
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
-- 冲刺活动 商店兑换

View File

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

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"
function ActBaseUI:ctor(params)
params = params or {}
self.page = params.page or 1
self.ActConst = self:getActConst()
end

View File

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

View File

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

View File

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

View File

@ -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
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)
-- effect:performDurationDelay(function()
-- effect:setActive(false)
-- end)
end
return SummonRewardCell