fix bug
This commit is contained in:
parent
69dc46402f
commit
27f26198b1
@ -136,7 +136,7 @@ ModuleManager.MODULE_KEY = {
|
|||||||
CARD_AD = "card_ad",
|
CARD_AD = "card_ad",
|
||||||
DUNGEON_GOLD = "dungeon_gold", -- 金币副本
|
DUNGEON_GOLD = "dungeon_gold", -- 金币副本
|
||||||
DUNGEON_RES = "dungeon_res", -- 材料副本
|
DUNGEON_RES = "dungeon_res", -- 材料副本
|
||||||
AD_CARD = "card_ad",
|
CARD_MONTHLY = "card_monthly",
|
||||||
}
|
}
|
||||||
|
|
||||||
local _moduleMgrs = {}
|
local _moduleMgrs = {}
|
||||||
|
|||||||
@ -372,7 +372,7 @@ function SDKManager:showFullScreenAds(adsClickType, adCallback, ignoreShowMessag
|
|||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
if not ignoreShowMessageBox and DataManager.PrivilegeCardData:getIsOpen(GConst.ShopConst.PRIVILEGE_CARD_ID.AD_CARD) then
|
if not ignoreShowMessageBox and DataManager.PrivilegeCardData:getIsOpen(GConst.ShopConst.PRIVILEGE_CARD_ID.CARD_AD) then
|
||||||
-- local params = {}
|
-- local params = {}
|
||||||
-- params.content = I18N:getGlobalText(I18N.GlobalConst.ADS_DESC_13)
|
-- params.content = I18N:getGlobalText(I18N.GlobalConst.ADS_DESC_13)
|
||||||
-- params.boxType = GConst.MESSAGE_BOX_TYPE.MB_OK_CANCEL
|
-- params.boxType = GConst.MESSAGE_BOX_TYPE.MB_OK_CANCEL
|
||||||
|
|||||||
@ -49,7 +49,7 @@ end
|
|||||||
function PrivilegeCardManager:buyAdCard()
|
function PrivilegeCardManager:buyAdCard()
|
||||||
local canBuyCard = DataManager.PrivilegeCardData:checkCanBuyAdCard()
|
local canBuyCard = DataManager.PrivilegeCardData:checkCanBuyAdCard()
|
||||||
if canBuyCard then
|
if canBuyCard then
|
||||||
local giftId = GConst.ShopConst.PRIVILEGE_CARD_ID.AD_CARD
|
local giftId = GConst.ShopConst.PRIVILEGE_CARD_ID.CARD_AD
|
||||||
PayManager:purchasePackage(giftId, PayManager.PURCHARSE_TYPE.ACT_GIFT, true)
|
PayManager:purchasePackage(giftId, PayManager.PURCHARSE_TYPE.ACT_GIFT, true)
|
||||||
else
|
else
|
||||||
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.MONTHLY_CARD_17))
|
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.MONTHLY_CARD_17))
|
||||||
|
|||||||
@ -1,14 +1,14 @@
|
|||||||
local ShopConst = {}
|
local ShopConst = {}
|
||||||
|
|
||||||
ShopConst.PRIVILEGE_CARD_ID = {
|
ShopConst.PRIVILEGE_CARD_ID = {
|
||||||
AD_CARD = 1053000101,
|
CARD_AD = 1053000101,
|
||||||
MONTHLY_CARD = 1053000001,
|
MONTHLY_CARD = 1053000001,
|
||||||
-- LIFETIME_CARD = 20302,
|
-- LIFETIME_CARD = 20302,
|
||||||
-- CHALLEGE_CARD = 20402,
|
-- CHALLEGE_CARD = 20402,
|
||||||
}
|
}
|
||||||
|
|
||||||
ShopConst.PRIVILEGE_CARD_ID_MAP = {
|
ShopConst.PRIVILEGE_CARD_ID_MAP = {
|
||||||
[ShopConst.PRIVILEGE_CARD_ID.AD_CARD] = 1,
|
[ShopConst.PRIVILEGE_CARD_ID.CARD_AD] = 1,
|
||||||
[ShopConst.PRIVILEGE_CARD_ID.MONTHLY_CARD] = 1,
|
[ShopConst.PRIVILEGE_CARD_ID.MONTHLY_CARD] = 1,
|
||||||
-- [ShopConst.PRIVILEGE_CARD_ID.LIFETIME_CARD] = 1,
|
-- [ShopConst.PRIVILEGE_CARD_ID.LIFETIME_CARD] = 1,
|
||||||
-- [ShopConst.PRIVILEGE_CARD_ID.CHALLEGE_CARD] = 1,
|
-- [ShopConst.PRIVILEGE_CARD_ID.CHALLEGE_CARD] = 1,
|
||||||
@ -30,7 +30,7 @@ ShopConst.FIRST_RECHARGE_ID = {
|
|||||||
|
|
||||||
ShopConst.PRIVILEGE_SHOW_PAGE = {
|
ShopConst.PRIVILEGE_SHOW_PAGE = {
|
||||||
FREE_DAILY_REWARDS = 1,
|
FREE_DAILY_REWARDS = 1,
|
||||||
AD_CARD = 2,
|
CARD_AD = 2,
|
||||||
MONTHLY_CARD = 3,
|
MONTHLY_CARD = 3,
|
||||||
-- LIFETIME_CARD = 4,
|
-- LIFETIME_CARD = 4,
|
||||||
-- CHALLEGE_CARD = 5,
|
-- CHALLEGE_CARD = 5,
|
||||||
@ -39,7 +39,7 @@ ShopConst.PRIVILEGE_SHOW_PAGE = {
|
|||||||
-- 脚本路径
|
-- 脚本路径
|
||||||
ShopConst.PRIVILEGE_COMP = {
|
ShopConst.PRIVILEGE_COMP = {
|
||||||
FREE_DAILY_REWARDS = "app/ui/privilege/comp/free_daily_rewards_comp",
|
FREE_DAILY_REWARDS = "app/ui/privilege/comp/free_daily_rewards_comp",
|
||||||
AD_CARD = "app/ui/privilege/comp/ad_card_comp",
|
CARD_AD = "app/ui/privilege/comp/ad_card_comp",
|
||||||
MONTHLY_CARD = "app/ui/privilege/comp/monthly_card_comp",
|
MONTHLY_CARD = "app/ui/privilege/comp/monthly_card_comp",
|
||||||
-- LIFETIME_CARD = "app/ui/privilege/comp/lifetime_card_comp",
|
-- LIFETIME_CARD = "app/ui/privilege/comp/lifetime_card_comp",
|
||||||
-- CHALLEGE_CARD = "app/ui/privilege/comp/challege_card_comp",
|
-- CHALLEGE_CARD = "app/ui/privilege/comp/challege_card_comp",
|
||||||
|
|||||||
@ -39,31 +39,35 @@ function HeroCell:refresh(heroEntity, isGray)
|
|||||||
self:refreshRedPoint()
|
self:refreshRedPoint()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
self.selfNode:setVisible(true)
|
self.selfNode:setActive(true)
|
||||||
|
|
||||||
self:_refresh(heroEntity:getCfgId(), isGray)
|
self:_refresh(heroEntity:getCfgId(), isGray)
|
||||||
|
|
||||||
local canLvUp = heroEntity:canLvUp()
|
local canLvUp = heroEntity:canLvUp()
|
||||||
self.lvUpArrow:setVisible(canLvUp)
|
local canStarUp = heroEntity:canStarUp()
|
||||||
if canLvUp then
|
local inTeam = DataManager.HeroData:isInStageFormation(heroEntity:getCfgId())
|
||||||
|
if (canLvUp and inTeam) or canStarUp then
|
||||||
|
self.lvUpArrow:setActive(true)
|
||||||
self.lvUpArrow:playAnim("animation", true, false)
|
self.lvUpArrow:playAnim("animation", true, false)
|
||||||
|
else
|
||||||
|
self.lvUpArrow:setActive(false)
|
||||||
end
|
end
|
||||||
local star = heroEntity:getStar()
|
local star = heroEntity:getStar()
|
||||||
self.starComp:refresh(star)
|
self.starComp:refresh(star)
|
||||||
if heroEntity:isUnlock() then
|
if heroEntity:isUnlock() then
|
||||||
if heroEntity:isActived() then
|
if heroEntity:isActived() then
|
||||||
self.lvTx:setText(I18N:getGlobalText(I18N.GlobalConst.RUNES_DESC_26, heroEntity:getLv()))
|
self.lvTx:setText(I18N:getGlobalText(I18N.GlobalConst.RUNES_DESC_26, heroEntity:getLv()))
|
||||||
self.lvTx:setVisible(true)
|
self.lvTx:setActive(true)
|
||||||
else
|
else
|
||||||
self.lvTx:setVisible(false)
|
self.lvTx:setActive(false)
|
||||||
end
|
end
|
||||||
self.unlockTx:setVisible(false)
|
self.unlockTx:setActive(false)
|
||||||
else
|
else
|
||||||
self.lvTx:setVisible(false)
|
self.lvTx:setActive(false)
|
||||||
if canLvUp then
|
if canLvUp then
|
||||||
self.unlockTx:setVisible(false)
|
self.unlockTx:setActive(false)
|
||||||
else
|
else
|
||||||
self.unlockTx:setVisible(true)
|
self.unlockTx:setActive(true)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
self:refreshRedPoint()
|
self:refreshRedPoint()
|
||||||
@ -111,10 +115,10 @@ function HeroCell:refreshBriefInfo(heroEntity)
|
|||||||
self.heroEntity = heroEntity
|
self.heroEntity = heroEntity
|
||||||
local id = self.heroEntity:getCfgId()
|
local id = self.heroEntity:getCfgId()
|
||||||
local level = self.heroEntity:getLv()
|
local level = self.heroEntity:getLv()
|
||||||
self.selfNode:setVisible(false)
|
self.selfNode:setActive(false)
|
||||||
local star = heroEntity:getStar()
|
local star = heroEntity:getStar()
|
||||||
self.starComp:refresh(star)
|
self.starComp:refresh(star)
|
||||||
self.unlockTx:setVisible(false)
|
self.unlockTx:setActive(false)
|
||||||
|
|
||||||
self:_refresh(id)
|
self:_refresh(id)
|
||||||
self.lvTx:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_1, level))
|
self.lvTx:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_1, level))
|
||||||
@ -126,10 +130,10 @@ function HeroCell:refreshWithCfgId(id, isGray)
|
|||||||
|
|
||||||
local lv = heroInfo.begin_lv
|
local lv = heroInfo.begin_lv
|
||||||
self.lvTx:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_1, lv))
|
self.lvTx:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_1, lv))
|
||||||
self.lvTx:setVisible(true)
|
self.lvTx:setActive(true)
|
||||||
self.unlockTx:setVisible(false)
|
self.unlockTx:setActive(false)
|
||||||
self.lvUpArrow:setVisible(false)
|
self.lvUpArrow:setActive(false)
|
||||||
self.fragmenImg:setVisible(true)
|
self.fragmenImg:setActive(true)
|
||||||
end
|
end
|
||||||
|
|
||||||
function HeroCell:_refresh(id, isGray)
|
function HeroCell:_refresh(id, isGray)
|
||||||
@ -139,14 +143,14 @@ function HeroCell:_refresh(id, isGray)
|
|||||||
self.heroBg:setSprite(GConst.ATLAS_PATH.ICON_HERO, GConst.FRAME_QLT[heroInfo.qlt])
|
self.heroBg:setSprite(GConst.ATLAS_PATH.ICON_HERO, GConst.FRAME_QLT[heroInfo.qlt])
|
||||||
self.heroDec:setSprite(GConst.ATLAS_PATH.ICON_HERO, GConst.HERO_DEC_QLT[heroInfo.qlt])
|
self.heroDec:setSprite(GConst.ATLAS_PATH.ICON_HERO, GConst.HERO_DEC_QLT[heroInfo.qlt])
|
||||||
self.matchImg:setSprite(GConst.ATLAS_PATH.ICON_HERO, GConst.HeroConst.MATCH_ICON_NAME[heroInfo.position])
|
self.matchImg:setSprite(GConst.ATLAS_PATH.ICON_HERO, GConst.HeroConst.MATCH_ICON_NAME[heroInfo.position])
|
||||||
self.check:setVisible(false)
|
self.check:setActive(false)
|
||||||
self:refreshHeroIcon(heroInfo.icon)
|
self:refreshHeroIcon(heroInfo.icon)
|
||||||
-- self:setGray(isGray)
|
-- self:setGray(isGray)
|
||||||
self.nameTx:setText(ModuleManager.HeroManager:getHeroName(id))
|
self.nameTx:setText(ModuleManager.HeroManager:getHeroName(id))
|
||||||
end
|
end
|
||||||
|
|
||||||
function HeroCell:showCheck(visible)
|
function HeroCell:showCheck(visible)
|
||||||
self.check:setVisible(visible)
|
self.check:setActive(visible)
|
||||||
end
|
end
|
||||||
|
|
||||||
function HeroCell:addClickListener(callback)
|
function HeroCell:addClickListener(callback)
|
||||||
@ -158,7 +162,7 @@ function HeroCell:setVisible(visible, scale)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function HeroCell:setSpineVisible(visible, scale)
|
function HeroCell:setSpineVisible(visible, scale)
|
||||||
self.lvUpArrow:setVisible(visible, scale)
|
self.lvUpArrow:setActive(visible, scale)
|
||||||
end
|
end
|
||||||
|
|
||||||
function HeroCell:setGray(isGray)
|
function HeroCell:setGray(isGray)
|
||||||
|
|||||||
@ -55,9 +55,9 @@ function SelectOtherBtnUI:onLoadRootComplete()
|
|||||||
local redPoint, isAdRedPoint = DataManager.MailData:getRedPoint()
|
local redPoint, isAdRedPoint = DataManager.MailData:getRedPoint()
|
||||||
if redPoint then
|
if redPoint then
|
||||||
if isAdRedPoint then
|
if isAdRedPoint then
|
||||||
self.uiMap["select_other_btn_ui.bg.mail_btn"]:addRedPoint(124, 35, 1, "common_ad_3", nil, true)
|
self.uiMap["select_other_btn_ui.bg.mail_btn"]:addRedPoint(60, 24, 1, "common_ad_1", nil, true)
|
||||||
else
|
else
|
||||||
self.uiMap["select_other_btn_ui.bg.mail_btn"]:addRedPoint(124, 35, 0.8, nil, nil, true)
|
self.uiMap["select_other_btn_ui.bg.mail_btn"]:addRedPoint(60, 24, 0.8, nil, nil, true)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
self.uiMap["select_other_btn_ui.bg.mail_btn"]:removeRedPoint()
|
self.uiMap["select_other_btn_ui.bg.mail_btn"]:removeRedPoint()
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
local SideBarPrivilegeCell = class("SideBarPrivilegeCell", SideBarBaseCell)
|
local SideBarPrivilegeCell = class("SideBarPrivilegeCell", SideBarBaseCell)
|
||||||
|
|
||||||
function SideBarPrivilegeCell:getModuleKey()
|
function SideBarPrivilegeCell:getModuleKey()
|
||||||
-- return ModuleManager.MODULE_KEY.TASK
|
return ModuleManager.MODULE_KEY.CARD_MONTHLY
|
||||||
end
|
end
|
||||||
|
|
||||||
function SideBarPrivilegeCell:getIsOpen()
|
function SideBarPrivilegeCell:getIsOpen()
|
||||||
|
|||||||
@ -466,8 +466,8 @@ function MainCityUI:initBounty()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function MainCityUI:initSetting()
|
function MainCityUI:initSetting()
|
||||||
self.settingbtn = self.uiMap["main_ui.top_node.setting_btn"]
|
self.settingBtn = self.uiMap["main_ui.top_node.setting_btn"]
|
||||||
self.settingbtn:addClickListener(function()
|
self.settingBtn:addClickListener(function()
|
||||||
ModuleManager.GameSettingManager:showSelectOtherBtnUI()
|
ModuleManager.GameSettingManager:showSelectOtherBtnUI()
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
@ -606,9 +606,9 @@ end
|
|||||||
|
|
||||||
function MainCityUI:refreshSettingBtn()
|
function MainCityUI:refreshSettingBtn()
|
||||||
if (DataManager.MailData:getIsOpen() and DataManager.MailData:getRedPoint()) or DataManager.AIHelperData:getRp() then
|
if (DataManager.MailData:getIsOpen() and DataManager.MailData:getRedPoint()) or DataManager.AIHelperData:getRp() then
|
||||||
self.settingbtn:addRedPoint(40, 40, 1)
|
self.settingBtn:addRedPoint(40, 40, 1)
|
||||||
else
|
else
|
||||||
self.settingbtn:removeRedPoint()
|
self.settingBtn:removeRedPoint()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -27,11 +27,11 @@ function AdCardComp:init()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function AdCardComp:refresh()
|
function AdCardComp:refresh()
|
||||||
local cfg = DataManager.ShopData:getActGiftConfig(GConst.ShopConst.PRIVILEGE_CARD_ID.AD_CARD)
|
local cfg = DataManager.ShopData:getActGiftConfig(GConst.ShopConst.PRIVILEGE_CARD_ID.CARD_AD)
|
||||||
if cfg == nil then
|
if cfg == nil then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local isActive = DataManager.PrivilegeCardData:getIsCardActive(GConst.ShopConst.PRIVILEGE_CARD_ID.AD_CARD)
|
local isActive = DataManager.PrivilegeCardData:getIsCardActive(GConst.ShopConst.PRIVILEGE_CARD_ID.CARD_AD)
|
||||||
if isActive then
|
if isActive then
|
||||||
self.descTx2:setText("<color=#4BFF53>" .. I18N:getGlobalText(I18N.GlobalConst.MONTHLY_CARD_12) .. "</color>")
|
self.descTx2:setText("<color=#4BFF53>" .. I18N:getGlobalText(I18N.GlobalConst.MONTHLY_CARD_12) .. "</color>")
|
||||||
self.payBtn:setActive(false)
|
self.payBtn:setActive(false)
|
||||||
|
|||||||
@ -158,14 +158,14 @@ function PrivilegeMainUI:updateAdCard(offsetY)
|
|||||||
return offsetY
|
return offsetY
|
||||||
end
|
end
|
||||||
self.adCard:setActive(true)
|
self.adCard:setActive(true)
|
||||||
if self.showPage == GConst.ShopConst.PRIVILEGE_SHOW_PAGE.AD_CARD then
|
if self.showPage == GConst.ShopConst.PRIVILEGE_SHOW_PAGE.CARD_AD then
|
||||||
self.beginPosY = math.abs(offsetY)
|
self.beginPosY = math.abs(offsetY)
|
||||||
end
|
end
|
||||||
|
|
||||||
self.adCard:setAnchoredPositionY(offsetY)
|
self.adCard:setAnchoredPositionY(offsetY)
|
||||||
offsetY = offsetY - 440
|
offsetY = offsetY - 440
|
||||||
|
|
||||||
local cell = self.adCard:addLuaComponent(GConst.ShopConst.PRIVILEGE_COMP.AD_CARD)
|
local cell = self.adCard:addLuaComponent(GConst.ShopConst.PRIVILEGE_COMP.CARD_AD)
|
||||||
cell:refresh()
|
cell:refresh()
|
||||||
|
|
||||||
return offsetY
|
return offsetY
|
||||||
|
|||||||
@ -95,6 +95,17 @@ function HeroData:getHeroIsActive(id)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function HeroData:isInStageFormation(heroId)
|
||||||
|
local cfg = HeroCfg[heroId]
|
||||||
|
local slotId = cfg.position
|
||||||
|
local curFormation = DataManager.FormationData:getStageFormation()
|
||||||
|
if curFormation[slotId] ~= heroId then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
function HeroData:getHeroIsUnlock(id)
|
function HeroData:getHeroIsUnlock(id)
|
||||||
local entity = self.heroes[id]
|
local entity = self.heroes[id]
|
||||||
if entity == nil then
|
if entity == nil then
|
||||||
@ -170,10 +181,8 @@ function HeroData:getRp()
|
|||||||
end
|
end
|
||||||
|
|
||||||
for id, entity in pairs(self.heroes) do
|
for id, entity in pairs(self.heroes) do
|
||||||
if entity:canLvUp() then
|
if (heroMap[id] and entity:canLvUp()) or entity:canStarUp() then
|
||||||
if heroMap[id] or not entity:isActived() then
|
return true
|
||||||
return true
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -604,10 +604,10 @@ function PlayerData:getNoAdFuncOpen()
|
|||||||
return ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.CARD_AD, true)
|
return ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.CARD_AD, true)
|
||||||
end
|
end
|
||||||
function PlayerData:getNoAdActive()
|
function PlayerData:getNoAdActive()
|
||||||
return DataManager.PrivilegeCardData:getIsCardActive(GConst.ShopConst.PRIVILEGE_CARD_ID.AD_CARD)
|
return DataManager.PrivilegeCardData:getIsCardActive(GConst.ShopConst.PRIVILEGE_CARD_ID.CARD_AD)
|
||||||
end
|
end
|
||||||
function PlayerData:getNoAdPrice()
|
function PlayerData:getNoAdPrice()
|
||||||
local cfg = DataManager.ShopData:getActGiftConfig(GConst.ShopConst.PRIVILEGE_CARD_ID.AD_CARD)
|
local cfg = DataManager.ShopData:getActGiftConfig(GConst.ShopConst.PRIVILEGE_CARD_ID.CARD_AD)
|
||||||
if cfg == nil then
|
if cfg == nil then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|||||||
@ -42,11 +42,11 @@ function PrivilegeCardData:getIsOpen(cardId)
|
|||||||
end
|
end
|
||||||
if cardId then
|
if cardId then
|
||||||
if cardId == GConst.ShopConst.PRIVILEGE_CARD_ID.MONTHLY_CARD then
|
if cardId == GConst.ShopConst.PRIVILEGE_CARD_ID.MONTHLY_CARD then
|
||||||
if not ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.MONTHLY_CARD, true) then
|
if not ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.CARD_MONTHLY, true) then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
elseif cardId == GConst.ShopConst.PRIVILEGE_CARD_ID.AD_CARD then
|
elseif cardId == GConst.ShopConst.PRIVILEGE_CARD_ID.CARD_AD then
|
||||||
if not ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.AD_CARD, true) then
|
if not ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.CARD_AD, true) then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
-- elseif cardId == GConst.ShopConst.PRIVILEGE_CARD_ID.LIFETIME_CARD then
|
-- elseif cardId == GConst.ShopConst.PRIVILEGE_CARD_ID.LIFETIME_CARD then
|
||||||
@ -121,12 +121,12 @@ function PrivilegeCardData:checkCanBuyChallengeCard()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function PrivilegeCardData:getIsAdCardOpen()
|
function PrivilegeCardData:getIsAdCardOpen()
|
||||||
return self:getIsOpen(GConst.ShopConst.PRIVILEGE_CARD_ID.AD_CARD)
|
return self:getIsOpen(GConst.ShopConst.PRIVILEGE_CARD_ID.CARD_AD)
|
||||||
end
|
end
|
||||||
|
|
||||||
function PrivilegeCardData:checkCanBuyAdCard()
|
function PrivilegeCardData:checkCanBuyAdCard()
|
||||||
if self:getIsOpen(GConst.ShopConst.PRIVILEGE_CARD_ID.AD_CARD) then
|
if self:getIsOpen(GConst.ShopConst.PRIVILEGE_CARD_ID.CARD_AD) then
|
||||||
local data = self.cardData[GConst.ShopConst.PRIVILEGE_CARD_ID.AD_CARD]
|
local data = self.cardData[GConst.ShopConst.PRIVILEGE_CARD_ID.CARD_AD]
|
||||||
if data == nil then
|
if data == nil then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
@ -171,7 +171,7 @@ function PrivilegeCardData:getIsLifetimeCardActive()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function PrivilegeCardData:getIsSkipAd()
|
function PrivilegeCardData:getIsSkipAd()
|
||||||
if self:getIsCardActive(GConst.ShopConst.PRIVILEGE_CARD_ID.AD_CARD) then
|
if self:getIsCardActive(GConst.ShopConst.PRIVILEGE_CARD_ID.CARD_AD) then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
@ -192,7 +192,7 @@ function PrivilegeCardData:getIsCardActive(cardId)
|
|||||||
if cardId == GConst.ShopConst.PRIVILEGE_CARD_ID.MONTHLY_CARD then
|
if cardId == GConst.ShopConst.PRIVILEGE_CARD_ID.MONTHLY_CARD then
|
||||||
local remainTime = self:getCardRemainTime(cardId)
|
local remainTime = self:getCardRemainTime(cardId)
|
||||||
return remainTime > 0
|
return remainTime > 0
|
||||||
elseif cardId == GConst.ShopConst.PRIVILEGE_CARD_ID.AD_CARD then
|
elseif cardId == GConst.ShopConst.PRIVILEGE_CARD_ID.CARD_AD then
|
||||||
local data = self.cardData[cardId]
|
local data = self.cardData[cardId]
|
||||||
if data and data.expire_at < 0 then
|
if data and data.expire_at < 0 then
|
||||||
return true
|
return true
|
||||||
@ -243,7 +243,7 @@ function PrivilegeCardData:onGiftBuySuccess(cardId)
|
|||||||
end
|
end
|
||||||
self.cardData[cardId].reward = rewardCount
|
self.cardData[cardId].reward = rewardCount
|
||||||
end
|
end
|
||||||
elseif cardId == GConst.ShopConst.PRIVILEGE_CARD_ID.AD_CARD then
|
elseif cardId == GConst.ShopConst.PRIVILEGE_CARD_ID.CARD_AD then
|
||||||
if not self:getIsCardActive(cardId) then
|
if not self:getIsCardActive(cardId) then
|
||||||
self.cardData[cardId] = self.cardData[cardId] or {}
|
self.cardData[cardId] = self.cardData[cardId] or {}
|
||||||
self.cardData[cardId].expire_at = -1
|
self.cardData[cardId].expire_at = -1
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user