This commit is contained in:
puxuan 2025-10-28 10:28:46 +08:00
parent 69dc46402f
commit 27f26198b1
13 changed files with 64 additions and 51 deletions

View File

@ -136,7 +136,7 @@ ModuleManager.MODULE_KEY = {
CARD_AD = "card_ad",
DUNGEON_GOLD = "dungeon_gold", -- 金币副本
DUNGEON_RES = "dungeon_res", -- 材料副本
AD_CARD = "card_ad",
CARD_MONTHLY = "card_monthly",
}
local _moduleMgrs = {}

View File

@ -372,7 +372,7 @@ function SDKManager:showFullScreenAds(adsClickType, adCallback, ignoreShowMessag
return true
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 = {}
-- params.content = I18N:getGlobalText(I18N.GlobalConst.ADS_DESC_13)
-- params.boxType = GConst.MESSAGE_BOX_TYPE.MB_OK_CANCEL

View File

@ -49,7 +49,7 @@ end
function PrivilegeCardManager:buyAdCard()
local canBuyCard = DataManager.PrivilegeCardData:checkCanBuyAdCard()
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)
else
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.MONTHLY_CARD_17))

View File

@ -1,14 +1,14 @@
local ShopConst = {}
ShopConst.PRIVILEGE_CARD_ID = {
AD_CARD = 1053000101,
CARD_AD = 1053000101,
MONTHLY_CARD = 1053000001,
-- LIFETIME_CARD = 20302,
-- CHALLEGE_CARD = 20402,
}
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.LIFETIME_CARD] = 1,
-- [ShopConst.PRIVILEGE_CARD_ID.CHALLEGE_CARD] = 1,
@ -30,7 +30,7 @@ ShopConst.FIRST_RECHARGE_ID = {
ShopConst.PRIVILEGE_SHOW_PAGE = {
FREE_DAILY_REWARDS = 1,
AD_CARD = 2,
CARD_AD = 2,
MONTHLY_CARD = 3,
-- LIFETIME_CARD = 4,
-- CHALLEGE_CARD = 5,
@ -39,7 +39,7 @@ ShopConst.PRIVILEGE_SHOW_PAGE = {
-- 脚本路径
ShopConst.PRIVILEGE_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",
-- LIFETIME_CARD = "app/ui/privilege/comp/lifetime_card_comp",
-- CHALLEGE_CARD = "app/ui/privilege/comp/challege_card_comp",

View File

@ -39,31 +39,35 @@ function HeroCell:refresh(heroEntity, isGray)
self:refreshRedPoint()
end)
self.selfNode:setVisible(true)
self.selfNode:setActive(true)
self:_refresh(heroEntity:getCfgId(), isGray)
local canLvUp = heroEntity:canLvUp()
self.lvUpArrow:setVisible(canLvUp)
if canLvUp then
local canStarUp = heroEntity:canStarUp()
local inTeam = DataManager.HeroData:isInStageFormation(heroEntity:getCfgId())
if (canLvUp and inTeam) or canStarUp then
self.lvUpArrow:setActive(true)
self.lvUpArrow:playAnim("animation", true, false)
else
self.lvUpArrow:setActive(false)
end
local star = heroEntity:getStar()
self.starComp:refresh(star)
if heroEntity:isUnlock() then
if heroEntity:isActived() then
self.lvTx:setText(I18N:getGlobalText(I18N.GlobalConst.RUNES_DESC_26, heroEntity:getLv()))
self.lvTx:setVisible(true)
self.lvTx:setActive(true)
else
self.lvTx:setVisible(false)
self.lvTx:setActive(false)
end
self.unlockTx:setVisible(false)
self.unlockTx:setActive(false)
else
self.lvTx:setVisible(false)
self.lvTx:setActive(false)
if canLvUp then
self.unlockTx:setVisible(false)
self.unlockTx:setActive(false)
else
self.unlockTx:setVisible(true)
self.unlockTx:setActive(true)
end
end
self:refreshRedPoint()
@ -111,10 +115,10 @@ function HeroCell:refreshBriefInfo(heroEntity)
self.heroEntity = heroEntity
local id = self.heroEntity:getCfgId()
local level = self.heroEntity:getLv()
self.selfNode:setVisible(false)
self.selfNode:setActive(false)
local star = heroEntity:getStar()
self.starComp:refresh(star)
self.unlockTx:setVisible(false)
self.unlockTx:setActive(false)
self:_refresh(id)
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
self.lvTx:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_1, lv))
self.lvTx:setVisible(true)
self.unlockTx:setVisible(false)
self.lvUpArrow:setVisible(false)
self.fragmenImg:setVisible(true)
self.lvTx:setActive(true)
self.unlockTx:setActive(false)
self.lvUpArrow:setActive(false)
self.fragmenImg:setActive(true)
end
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.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.check:setVisible(false)
self.check:setActive(false)
self:refreshHeroIcon(heroInfo.icon)
-- self:setGray(isGray)
self.nameTx:setText(ModuleManager.HeroManager:getHeroName(id))
end
function HeroCell:showCheck(visible)
self.check:setVisible(visible)
self.check:setActive(visible)
end
function HeroCell:addClickListener(callback)
@ -158,7 +162,7 @@ function HeroCell:setVisible(visible, scale)
end
function HeroCell:setSpineVisible(visible, scale)
self.lvUpArrow:setVisible(visible, scale)
self.lvUpArrow:setActive(visible, scale)
end
function HeroCell:setGray(isGray)

View File

@ -55,9 +55,9 @@ function SelectOtherBtnUI:onLoadRootComplete()
local redPoint, isAdRedPoint = DataManager.MailData:getRedPoint()
if redPoint 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
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
else
self.uiMap["select_other_btn_ui.bg.mail_btn"]:removeRedPoint()

View File

@ -1,7 +1,7 @@
local SideBarPrivilegeCell = class("SideBarPrivilegeCell", SideBarBaseCell)
function SideBarPrivilegeCell:getModuleKey()
-- return ModuleManager.MODULE_KEY.TASK
return ModuleManager.MODULE_KEY.CARD_MONTHLY
end
function SideBarPrivilegeCell:getIsOpen()

View File

@ -466,8 +466,8 @@ function MainCityUI:initBounty()
end
function MainCityUI:initSetting()
self.settingbtn = self.uiMap["main_ui.top_node.setting_btn"]
self.settingbtn:addClickListener(function()
self.settingBtn = self.uiMap["main_ui.top_node.setting_btn"]
self.settingBtn:addClickListener(function()
ModuleManager.GameSettingManager:showSelectOtherBtnUI()
end)
end
@ -606,9 +606,9 @@ end
function MainCityUI:refreshSettingBtn()
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
self.settingbtn:removeRedPoint()
self.settingBtn:removeRedPoint()
end
end

View File

@ -27,11 +27,11 @@ function AdCardComp:init()
end
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
return
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
self.descTx2:setText("<color=#4BFF53>" .. I18N:getGlobalText(I18N.GlobalConst.MONTHLY_CARD_12) .. "</color>")
self.payBtn:setActive(false)

View File

@ -158,14 +158,14 @@ function PrivilegeMainUI:updateAdCard(offsetY)
return offsetY
end
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)
end
self.adCard:setAnchoredPositionY(offsetY)
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()
return offsetY

View File

@ -95,6 +95,17 @@ function HeroData:getHeroIsActive(id)
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)
local entity = self.heroes[id]
if entity == nil then
@ -170,10 +181,8 @@ function HeroData:getRp()
end
for id, entity in pairs(self.heroes) do
if entity:canLvUp() then
if heroMap[id] or not entity:isActived() then
return true
end
if (heroMap[id] and entity:canLvUp()) or entity:canStarUp() then
return true
end
end

View File

@ -604,10 +604,10 @@ function PlayerData:getNoAdFuncOpen()
return ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.CARD_AD, true)
end
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
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
return
end

View File

@ -42,11 +42,11 @@ function PrivilegeCardData:getIsOpen(cardId)
end
if cardId 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
end
elseif cardId == GConst.ShopConst.PRIVILEGE_CARD_ID.AD_CARD then
if not ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.AD_CARD, true) then
elseif cardId == GConst.ShopConst.PRIVILEGE_CARD_ID.CARD_AD then
if not ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.CARD_AD, true) then
return false
end
-- elseif cardId == GConst.ShopConst.PRIVILEGE_CARD_ID.LIFETIME_CARD then
@ -121,12 +121,12 @@ function PrivilegeCardData:checkCanBuyChallengeCard()
end
function PrivilegeCardData:getIsAdCardOpen()
return self:getIsOpen(GConst.ShopConst.PRIVILEGE_CARD_ID.AD_CARD)
return self:getIsOpen(GConst.ShopConst.PRIVILEGE_CARD_ID.CARD_AD)
end
function PrivilegeCardData:checkCanBuyAdCard()
if self:getIsOpen(GConst.ShopConst.PRIVILEGE_CARD_ID.AD_CARD) then
local data = self.cardData[GConst.ShopConst.PRIVILEGE_CARD_ID.AD_CARD]
if self:getIsOpen(GConst.ShopConst.PRIVILEGE_CARD_ID.CARD_AD) then
local data = self.cardData[GConst.ShopConst.PRIVILEGE_CARD_ID.CARD_AD]
if data == nil then
return true
end
@ -171,7 +171,7 @@ function PrivilegeCardData:getIsLifetimeCardActive()
end
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
end
return false
@ -192,7 +192,7 @@ function PrivilegeCardData:getIsCardActive(cardId)
if cardId == GConst.ShopConst.PRIVILEGE_CARD_ID.MONTHLY_CARD then
local remainTime = self:getCardRemainTime(cardId)
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]
if data and data.expire_at < 0 then
return true
@ -243,7 +243,7 @@ function PrivilegeCardData:onGiftBuySuccess(cardId)
end
self.cardData[cardId].reward = rewardCount
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
self.cardData[cardId] = self.cardData[cardId] or {}
self.cardData[cardId].expire_at = -1