装备礼包重登不弹窗

This commit is contained in:
Fang 2023-07-25 22:48:49 +08:00
parent 11624308ea
commit 5d8cb4bfff
3 changed files with 8 additions and 8 deletions

View File

@ -19,7 +19,7 @@ function DungeonArmorEntity:init(data)
self.fundRewards = data.fund_rewards self.fundRewards = data.fund_rewards
self.totalChallengeCount = data.total_challenge_count self.totalChallengeCount = data.total_challenge_count
self:updateGift(data.gift_info) self:updateGift(data.gift_info, true)
DataManager.FormationData:initDungeonArmor(self.heroes) DataManager.FormationData:initDungeonArmor(self.heroes)
DataManager:registerCrossDayFunc("DungeonArmorEntity", function() DataManager:registerCrossDayFunc("DungeonArmorEntity", function()
@ -52,8 +52,8 @@ function DungeonArmorEntity:refreshFarmCount(chapterId, count)
end end
-- 更新礼包状态 -- 更新礼包状态
function DungeonArmorEntity:updateGift(giftInfo) function DungeonArmorEntity:updateGift(giftInfo, isInit)
DataManager.ShopData:initGift(PayManager.PURCHARSE_ACT_TYPE.ARMOR_GIFT, giftInfo) DataManager.ShopData:initGift(PayManager.PURCHARSE_ACT_TYPE.ARMOR_GIFT, giftInfo, isInit)
end end
function DungeonArmorEntity:setStarReward(starId) function DungeonArmorEntity:setStarReward(starId)

View File

@ -15,7 +15,7 @@ function DungeonWeaponEntity:init(data)
self.totalChallengeCount = data.total_challenge_count or {} self.totalChallengeCount = data.total_challenge_count or {}
self.data.isDirty = not self.data.isDirty self.data.isDirty = not self.data.isDirty
self:updateGift(data.gift_info) self:updateGift(data.gift_info, true)
DataManager.FormationData:initDungeonWeapon(self.heroes) DataManager.FormationData:initDungeonWeapon(self.heroes)
DataManager:registerCrossDayFunc("DungeonWeaponEntity", function() DataManager:registerCrossDayFunc("DungeonWeaponEntity", function()
@ -38,8 +38,8 @@ function DungeonWeaponEntity:refreshInfoOnFarm(result)
end end
-- 更新礼包状态 -- 更新礼包状态
function DungeonWeaponEntity:updateGift(giftInfo) function DungeonWeaponEntity:updateGift(giftInfo, isInit)
DataManager.ShopData:initGift(PayManager.PURCHARSE_ACT_TYPE.WEAPON_GIFT, giftInfo) DataManager.ShopData:initGift(PayManager.PURCHARSE_ACT_TYPE.WEAPON_GIFT, giftInfo, isInit)
end end
function DungeonWeaponEntity:setDirty() function DungeonWeaponEntity:setDirty()

View File

@ -823,7 +823,7 @@ end
-- 武器礼包 -------------------------------------------------------------------------------------------- -- 武器礼包 --------------------------------------------------------------------------------------------
-- 初始化礼包(礼包类型1下的礼包可以直接复用这里的方法) -- 初始化礼包(礼包类型1下的礼包可以直接复用这里的方法)
function ShopData:initGift(giftType, gift) function ShopData:initGift(giftType, gift, isInit)
if giftType == nil or gift == nil then if giftType == nil or gift == nil then
return return
end end
@ -846,7 +846,7 @@ function ShopData:initGift(giftType, gift)
local tempId = self.gifts[giftType] and self.gifts[giftType].id or 0 local tempId = self.gifts[giftType] and self.gifts[giftType].id or 0
self.gifts[giftType] = giftStruct self.gifts[giftType] = giftStruct
if self:hasGift(giftType) then if not isInit and self:hasGift(giftType) then
if tempId == self.gifts[giftType].id then if tempId == self.gifts[giftType].id then
if EDITOR_MODE then if EDITOR_MODE then
Logger.logHighlight("重复礼包数据,不处理弹窗:" .. tempId) Logger.logHighlight("重复礼包数据,不处理弹窗:" .. tempId)