活动礼包弹出逻辑补充

This commit is contained in:
Fang 2023-08-11 15:08:23 +08:00
parent a749cbfa94
commit 84796cd4a8
16 changed files with 824 additions and 731 deletions

View File

@ -150,7 +150,6 @@ function DataManager:initWithServerData(data)
self.CollectionData:init(data.collection)
self.TutorialData:init(data.guide)
self.MailData:init(data.mail_info)
self.ActivityData:init()
self.GoldPigData:init(data.pig, true)
self.BountyData:init(data.bounty)
self.ArenaBountyData:init(data.arena_bounty)
@ -166,6 +165,8 @@ function DataManager:initWithServerData(data)
self.ShopData:initGrowUpGift(data.act_grow_up_gift2) -- 成长礼包
self.ShopData:initLevelUpGift(data.act_level_up_gift) -- 助力/金币礼包
self.ShopData:initIntroductGift(data.act_introductory_gift) -- 入门礼包
-- 活动要在礼包后初始化
self.ActivityData:init()
-- 商店礼包都初始化完了后检查一下每日红点
self.ShopData:checkShopDiscountRedPoint()
self.ShopData:checkLoginPopInfo() -- 需要写在shopdata所有初始化之后

View File

@ -7379,7 +7379,7 @@ local chapter = {
},
["daily_challenge_difficulty"]={
41710,
53745
52198
}
},
[36]={
@ -7597,8 +7597,8 @@ local chapter = {
}
},
["daily_challenge_difficulty"]={
37410,
63294
41904,
53805
}
},
[37]={
@ -7816,8 +7816,8 @@ local chapter = {
}
},
["daily_challenge_difficulty"]={
38984,
66067
43347,
55615
}
},
[38]={
@ -8035,8 +8035,8 @@ local chapter = {
}
},
["daily_challenge_difficulty"]={
41000,
69592
44750,
57395
}
},
[39]={
@ -8254,8 +8254,8 @@ local chapter = {
}
},
["daily_challenge_difficulty"]={
42574,
72471
46208,
59200
}
},
[40]={
@ -8472,8 +8472,8 @@ local chapter = {
}
},
["daily_challenge_difficulty"]={
46207,
78535
49049,
62756
}
}
}

View File

@ -8263,22 +8263,22 @@ local chapter_board_daily_challenge = {
{
["pos"]=11,
["type"]=2,
["direction"]=3
["direction"]=4
},
{
["pos"]=21,
["type"]=2,
["direction"]=3
["direction"]=4
},
{
["pos"]=41,
["type"]=2,
["direction"]=3
["direction"]=4
},
{
["pos"]=61,
["type"]=2,
["direction"]=3
["direction"]=4
},
{
["pos"]=62,

View File

@ -1,15 +1,15 @@
local grid_edge_type = {
[1]={
["icon"]="battle_obstacle_stick_3",
["icon"]="battle_obstacle_coral_1",
["break_sfx"]="sfx_piece_za_b01"
},
[2]={
["icon"]="battle_obstacle_stick_2",
["icon"]="battle_obstacle_coral_2",
["next_type"]=1,
["break_sfx"]="sfx_piece_za_b01"
},
[3]={
["icon"]="battle_obstacle_stick_1",
["icon"]="battle_obstacle_coral_3",
["next_type"]=2,
["break_sfx"]="sfx_piece_za_b01"
}

File diff suppressed because it is too large Load Diff

View File

@ -330,7 +330,7 @@ local skill_rogue = {
["desc"]="巨劍轟擊沿X方向可額外消除<color=#3cff28>4</color>格。"
},
[2400102]={
["desc"]="<color=#fcff28>Combo</color>:巨劍轟擊對凍敵人傷害大幅增加,並有<color=#3cff28>50%</color>機率附帶暈眩效果,<color=#3cff28>2</color>回合。"
["desc"]="<color=#fcff28>Combo</color>:巨劍轟擊對凍敵人傷害大幅增加,並有<color=#3cff28>50%</color>機率附帶暈眩效果,<color=#3cff28>2</color>回合。"
},
[2400103]={
["desc"]="巨劍轟擊附帶暈眩效果的機率提高到<color=#3cff28>70%</color>。"
@ -507,13 +507,13 @@ local skill_rogue = {
["desc"]="元素連接隨機消除元素<color=#3cff28>+2</color>。"
},
[4200105]={
["desc"]="<color=#fcff28>Combo</color>:元素連接對冰霜敵人有<color=#3cff28>20%</color>機率附帶凍效果,<color=#3cff28>1</color>回合。"
["desc"]="<color=#fcff28>Combo</color>:元素連接對冰霜敵人有<color=#3cff28>20%</color>機率附帶凍效果,<color=#3cff28>1</color>回合。"
},
[4200106]={
["desc"]="冰心攻擊提高<color=#3cff28>15%</color>。"
},
[4200107]={
["desc"]="元素連接附帶凍效果機率提高到<color=#3cff28>40%</color>。"
["desc"]="元素連接附帶凍效果機率提高到<color=#3cff28>40%</color>。"
},
[4300100]={
["desc"]="解鎖霜凍冰晶:額外造成一次技能傷害,附帶冰霜效果,<color=#3cff28>1</color>回合。"
@ -585,7 +585,7 @@ local skill_rogue = {
["desc"]="寒冰妖姬攻擊提高<color=#3cff28>15%</color>。"
},
[4400107]={
["desc"]="冰霜劍舞附帶凍效果機率提高到<color=#3cff28>70%</color>。"
["desc"]="冰霜劍舞附帶凍效果機率提高到<color=#3cff28>70%</color>。"
},
[4400200]={
["desc"]="解鎖法老詛咒:額外造成一次技能傷害,附帶<color=#3cff28>詛咒</color>效果,<color=#3cff28>1</color>回合。"

View File

@ -16,8 +16,14 @@ end
-- 夏日活动分界线-----------------------------------------------------------------------------------------------------
function ActivityManager:showActivityUI()
UIManager:showUI("app/ui/activity/activity_ui")
function ActivityManager:showActivityUI(panelType)
if panelType == GConst.ActivityConst.PANEL_TYPE.SKIN then
UIManager:showUI("app/ui/activity/activity_gift_skin_ui", panelType)
elseif panelType == GConst.ActivityConst.PANEL_TYPE.HERO then
UIManager:showUI("app/ui/activity/activity_gift_hero_ui", panelType)
else
UIManager:showUI("app/ui/activity/activity_ui", panelType)
end
end
-- 购买夏日活动战令

View File

@ -53,6 +53,10 @@ function ShopManager:showGiftPopUI(actType, actId, onlySelf, showType)
UIManager:showUI("app/ui/shop/first_recharge_pop_ui", {showType = showType})
elseif actType == PayManager.PURCHARSE_TYPE.ACT_GIFT and actId == GConst.ShopConst.INTRODUCT_GIFT_ID then
UIManager:showUI("app/ui/shop/introduct_pop_ui", {showType = showType})
elseif actType == PayManager.PURCHARSE_TYPE.ACT_GIFT and (actId == GConst.ActivityConst.SKIN_GIFT_ID_1 or actId == GConst.ActivityConst.SKIN_GIFT_ID_2) then
ModuleManager.ActivityManager:showActivityUI(GConst.ActivityConst.PANEL_TYPE.SKIN)
elseif actType == PayManager.PURCHARSE_TYPE.ACT_GIFT and actId == GConst.ActivityConst.HERO_GIFT_ID_1 then
ModuleManager.ActivityManager:showActivityUI(GConst.ActivityConst.PANEL_TYPE.HERO)
elseif actType == PayManager.PURCHARSE_TYPE.CHAPTER_GIFT then
UIManager:showUI("app/ui/shop/gift_pop_chapter_ui", {type = actType, id = actId, onlySelf = onlySelf, showType = showType})
elseif actType == PayManager.PURCHARSE_TYPE.GROW_UP_GIFT_NEW then

View File

@ -0,0 +1,6 @@
local ActivityUI = require "app/ui/activity/activity_ui"
local ActivityGiftHeroUI = class("ActivityGiftHeroUI", ActivityUI)
-- 活动英雄礼包为了避免界面和activity_ui冲突
return ActivityGiftHeroUI

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 27dfb616c5928a6408dcd22f5318002c
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}

View File

@ -0,0 +1,6 @@
local ActivityUI = require "app/ui/activity/activity_ui"
local ActivityGiftSkinUI = class("ActivityGiftSkinUI", ActivityUI)
-- 活动皮肤礼包为了避免界面和activity_ui冲突
return ActivityGiftSkinUI

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: fbf4f90499938e74d96a805ca6c2a29b
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}

View File

@ -16,8 +16,10 @@ function ActivityUI:onPressBackspace()
self:closeUI()
end
function ActivityUI:ctor()
if DataManager.ActivityData:hasTaskRedPoint() then
function ActivityUI:ctor(param)
if param then
self.panelType = param
elseif DataManager.ActivityData:hasTaskRedPoint() then
self.panelType = GConst.ActivityConst.PANEL_TYPE.TASK
elseif DataManager.ActivityData:hasBountyRedPoint() then
self.panelType = GConst.ActivityConst.PANEL_TYPE.BOUNTY

View File

@ -21,4 +21,26 @@ function SideBarActivityCell:getIsShowRedPoint()
return DataManager.ActivityData:hasEntryRedPoint()
end
function SideBarActivityCell:onRefresh()
self.timeBg:setVisible(true)
self:_refreshTime()
end
function SideBarActivityCell:updateTime()
if self:getIsOpen() then
self:_refreshTime()
else
self:closeBtn()
end
end
function SideBarActivityCell:_refreshTime()
local remainTime = DataManager.ActivityData:getEndRemainTime()
if remainTime >= 0 then
self.timeTx:setText(GFunc.getTimeStr(remainTime))
else
self.timeTx:setText("00:00:00")
end
end
return SideBarActivityCell

View File

@ -1100,6 +1100,7 @@ function MainCityUI:checkGift()
-- 章节礼包
local chapterPopUpGifts = DataManager.ShopData:getPopUpGiftByType(PayManager.PURCHARSE_TYPE.CHAPTER_GIFT)
-- 通用礼包
local summerGiftIds
local beginnerGiftIds
local levelUpGiftIds
local firstRechargeIds
@ -1110,6 +1111,13 @@ function MainCityUI:checkGift()
for _, actId in ipairs(actPopUpGifts) do
local cfgInfo = DataManager.ShopData:getActGiftConfig()[actId]
if cfgInfo then
-- 夏日活动礼包
if cfgInfo.type == PayManager.PURCHARSE_ACT_TYPE.ACT_SUMMER then
if not summerGiftIds then
summerGiftIds = {}
end
table.insert(summerGiftIds, actId)
end
-- 新手礼包
if cfgInfo.type == PayManager.PURCHARSE_ACT_TYPE.BEGINNER_GIFT then
if not beginnerGiftIds then
@ -1149,6 +1157,11 @@ function MainCityUI:checkGift()
-- ModuleManager.ShopManager:triggerGiftPopUI(PayManager.PURCHARSE_TYPE.ACT_GIFT, firstRechargeIds[1])
-- return true
-- end
-- 夏日礼包在最前
if summerGiftIds and #summerGiftIds > 0 then
ModuleManager.ShopManager:triggerGiftPopUI(PayManager.PURCHARSE_TYPE.ACT_GIFT, summerGiftIds[1], showType)
return true
end
-- 入门礼包
if introductGiftIds and #introductGiftIds > 0 then
ModuleManager.ShopManager:triggerGiftPopUI(PayManager.PURCHARSE_TYPE.ACT_GIFT, introductGiftIds[1], showType)

View File

@ -12,6 +12,7 @@ function ActivityData:init()
self.actData = {}
ModuleManager.ActivityManager:reqSummerData()
self:markGiftPop()
end
function ActivityData:setDirty()
@ -64,7 +65,7 @@ end
-- 是否在活动时间内
function ActivityData:isInActiveTime()
if self.actData.activated_at == nil then
if self.actData.activated_at == nil or self.actData.activated_at <= 0 then
return false
end
@ -466,6 +467,18 @@ end
-- 礼包--------------------------------------------------------------------------------------------------
-- 标记礼包弹出状态
function ActivityData:markGiftPop()
if DataManager.ShopData:getGiftRemainBuyNum(GConst.ActivityConst.SKIN_GIFT_ID_1) > 0 then
DataManager.ShopData:markPopUpGift(PayManager.PURCHARSE_TYPE.ACT_GIFT, GConst.ActivityConst.SKIN_GIFT_ID_1)
elseif DataManager.ShopData:getGiftRemainBuyNum(GConst.ActivityConst.SKIN_GIFT_ID_2) > 0 then
DataManager.ShopData:markPopUpGift(PayManager.PURCHARSE_TYPE.ACT_GIFT, GConst.ActivityConst.SKIN_GIFT_ID_2)
end
if DataManager.ShopData:getGiftRemainBuyNum(GConst.ActivityConst.HERO_GIFT_ID_1) > 0 then
DataManager.ShopData:markPopUpGift(PayManager.PURCHARSE_TYPE.ACT_GIFT, GConst.ActivityConst.HERO_GIFT_ID_1)
end
end
-- 皮肤礼包是否有红点
function ActivityData:hasSkinRedPoint()
return not LocalData:getTodayActSummerWatchedSkin()