优化章节礼包弹出逻辑
This commit is contained in:
parent
99a26d953d
commit
c0c0c8f93e
@ -154,6 +154,7 @@ function DataManager:initWithServerData(data)
|
||||
self.ShopData:initIntroductGift(data.act_introductory_gift) -- 入门礼包
|
||||
-- 商店礼包都初始化完了后检查一下每日红点
|
||||
self.ShopData:checkShopDiscountRedPoint()
|
||||
self.ShopData:checkLoginPopInfo() -- 需要写在shopdata所有初始化之后
|
||||
self.SummonData:init(data.summon, true)
|
||||
self.AIHelperData:init(nil, true)
|
||||
-- 成长基金要在ShopData和PlayerDataBagData还有之后初始化,依赖这些数据
|
||||
|
||||
@ -160,6 +160,10 @@ function ChapterManager:endFightFinish(result)
|
||||
DataManager.ShopData:onTriggerIntroductGift()
|
||||
end
|
||||
|
||||
if not reqData.win then
|
||||
DataManager.ShopData:markPopLastChapterActGift()
|
||||
end
|
||||
|
||||
ModuleManager.TaskManager:addFightTaskProgress(reqData.task_stat)
|
||||
end
|
||||
end
|
||||
|
||||
@ -895,4 +895,22 @@ function ShopData:markShopDiscountRedPoint()
|
||||
LocalData:setShopDiscountRedPointTime(today)
|
||||
end
|
||||
|
||||
function ShopData:checkLoginPopInfo()
|
||||
-- 初始化礼包弹出逻辑
|
||||
local actPopUpGifts = self:getPopUpGiftByType(PayManager.PURCHARSE_TYPE.ACT_GIFT)
|
||||
if not actPopUpGifts or #actPopUpGifts <= 0 then
|
||||
self:markPopLastChapterActGift()
|
||||
end
|
||||
end
|
||||
|
||||
function ShopData:markPopLastChapterActGift()
|
||||
local chapterPopUpGifts = self:getPopUpGiftByType(PayManager.PURCHARSE_TYPE.CHAPTER_GIFT)
|
||||
if not chapterPopUpGifts or #chapterPopUpGifts <= 0 then
|
||||
local list = self:getActChapterStoreCanBuyActIds()
|
||||
if list and list[1] then
|
||||
self:markPopUpGift(PayManager.PURCHARSE_TYPE.CHAPTER_GIFT, list[#list])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return ShopData
|
||||
Loading…
x
Reference in New Issue
Block a user