This commit is contained in:
puxuan 2025-10-31 11:31:02 +08:00
parent f5d9c36f6e
commit 425cff0eea
8 changed files with 44 additions and 28 deletions

View File

@ -233,7 +233,7 @@ GConst.ATLAS_PATH = {
ICON_TALENT = "assets/arts/atlas/icon/talent.asset", ICON_TALENT = "assets/arts/atlas/icon/talent.asset",
BOUNTY = "assets/arts/atlas/ui/bounty.asset", BOUNTY = "assets/arts/atlas/ui/bounty.asset",
UI_SETTING = "assets/arts/atlas/ui/setting.asset", UI_SETTING = "assets/arts/atlas/ui/setting.asset",
SHOP = "assets/arts/atlas/ui/shop.asset", UI_SHOP = "assets/arts/atlas/ui/shop.asset",
HERO = "assets/arts/atlas/ui/hero.asset", HERO = "assets/arts/atlas/ui/hero.asset",
UI_FUND = "assets/arts/atlas/ui/fund.asset", UI_FUND = "assets/arts/atlas/ui/fund.asset",
SEVEN_DAY = "assets/arts/atlas/ui/sevenday.asset", SEVEN_DAY = "assets/arts/atlas/ui/sevenday.asset",

View File

@ -5,6 +5,7 @@ local PAGE_BTN_CELL = "app/ui/activity/common/cell/act_page_btn_cell"
function PageBtnsComp:init() function PageBtnsComp:init()
local uiMap = self:getUIMap() local uiMap = self:getUIMap()
self.scrollrect = uiMap["act_page_btns_comp.scrollrect"] self.scrollrect = uiMap["act_page_btns_comp.scrollrect"]
self.content = uiMap["act_page_btns_comp.scrollrect.viewport.content"]
end end
function PageBtnsComp:setRedPointPos(posX, posY, scale) function PageBtnsComp:setRedPointPos(posX, posY, scale)
@ -36,7 +37,9 @@ function PageBtnsComp:refresh(list, index)
if index then if index then
self.scrollRect:moveToIndex(index) self.scrollRect:moveToIndex(index)
end end
local maxSizeX = math.min(#self.list * 124, 540)
self.baseObject:setSizeDeltaX(#self.list * 124) self.baseObject:setSizeDeltaX(#self.list * 124)
self.content:setSizeDeltaX(#self.list * 124)
end end
return PageBtnsComp return PageBtnsComp

View File

@ -321,12 +321,12 @@ function BattleResultUI:refreshArenaBoxNode()
if self.isWin then if self.isWin then
-- 胜利宝箱 -- 胜利宝箱
self.arenaBoxNode:setSprite(GConst.ATLAS_PATH.ARENA, "arena_bg_6") self.arenaBoxNode:setSprite(GConst.ATLAS_PATH.ARENA, "arena_bg_6")
self.arenaBoxImgIcon:setSprite(GConst.ATLAS_PATH.SHOP, "shop_chest_5") self.arenaBoxImgIcon:setSprite(GConst.ATLAS_PATH.UI_SHOP, "shop_chest_5")
self.arenaBoxTxTitle:setText(I18N:getGlobalText(I18N.GlobalConst.ARENA_DESC_33)) self.arenaBoxTxTitle:setText(I18N:getGlobalText(I18N.GlobalConst.ARENA_DESC_33))
else else
-- 鼓励宝箱 -- 鼓励宝箱
self.arenaBoxNode:setSprite(GConst.ATLAS_PATH.ARENA, "arena_bg_5") self.arenaBoxNode:setSprite(GConst.ATLAS_PATH.ARENA, "arena_bg_5")
self.arenaBoxImgIcon:setSprite(GConst.ATLAS_PATH.SHOP, "shop_chest_4") self.arenaBoxImgIcon:setSprite(GConst.ATLAS_PATH.UI_SHOP, "shop_chest_4")
self.arenaBoxTxTitle:setText(I18N:getGlobalText(I18N.GlobalConst.ARENA_DESC_34)) self.arenaBoxTxTitle:setText(I18N:getGlobalText(I18N.GlobalConst.ARENA_DESC_34))
end end
ModuleManager.ArenaManager:markAdBox(self.isWin) ModuleManager.ArenaManager:markAdBox(self.isWin)

View File

@ -21,8 +21,7 @@ end
function BattleReviveUI:_display() function BattleReviveUI:_display()
local uiMap = self.root:genAllChildren() local uiMap = self.root:genAllChildren()
self.title1Tx = uiMap["battle_revive_ui.bg.tx_1"] self.title1Tx = uiMap["battle_revive_ui.bg.title_text"]
-- self.title2Tx = uiMap["battle_revive_ui.bg.tx_2"]
self.descTx = uiMap["battle_revive_ui.bg.tx_desc"] self.descTx = uiMap["battle_revive_ui.bg.tx_desc"]
self.costBtn = uiMap["battle_revive_ui.bg.cost_btn"] self.costBtn = uiMap["battle_revive_ui.bg.cost_btn"]
@ -30,7 +29,8 @@ function BattleReviveUI:_display()
self.adBtn = uiMap["battle_revive_ui.bg.ad_btn"] self.adBtn = uiMap["battle_revive_ui.bg.ad_btn"]
self.adIcon = uiMap["battle_revive_ui.bg.ad_btn.icon"] self.adIcon = uiMap["battle_revive_ui.bg.ad_btn.icon"]
self.adTx = uiMap["battle_revive_ui.bg.ad_btn.tx"] self.adTx = uiMap["battle_revive_ui.bg.ad_btn.tx"]
self.adLimitTx = uiMap["battle_revive_ui.limit_tx"] self.adLimitTx = uiMap["battle_revive_ui.bg.limit_tx"]
self.closeBtn = uiMap["battle_revive_ui.bg.close_btn"]
self.cancelBtn = uiMap["battle_revive_ui.bg.cancel_btn"] self.cancelBtn = uiMap["battle_revive_ui.bg.cancel_btn"]
self.cancelTx = uiMap["battle_revive_ui.bg.cancel_btn.tx"] self.cancelTx = uiMap["battle_revive_ui.bg.cancel_btn.tx"]
@ -86,17 +86,17 @@ function BattleReviveUI:_display()
local noAdBuyBtn = uiMap["battle_revive_ui.no_ad_node.btn_buy"] local noAdBuyBtn = uiMap["battle_revive_ui.no_ad_node.btn_buy"]
local noAdBuyTx = uiMap["battle_revive_ui.no_ad_node.btn_buy.tx_desc"] local noAdBuyTx = uiMap["battle_revive_ui.no_ad_node.btn_buy.tx_desc"]
-- if DataManager.PlayerData:getNoAdFuncOpen() and not DataManager.PlayerData:getNoAdActive() then if DataManager.PrivilegeCardData:getIsAdCardOpen() and not DataManager.PrivilegeCardData:getIsCardActive(GConst.ShopConst.PRIVILEGE_CARD_ID.CARD_AD) then
-- noAdNode:setActive(true) noAdNode:setActive(true)
-- noAdTitleTx:setText(I18N:getGlobalText(I18N.GlobalConst.ADS_DESC_15)) noAdTitleTx:setText(I18N:getGlobalText(I18N.GlobalConst.ADS_DESC_15))
-- noAdDescTx:setText(I18N:getGlobalText(I18N.GlobalConst.ADS_DESC_16)) noAdDescTx:setText(I18N:getGlobalText(I18N.GlobalConst.ADS_DESC_16))
-- noAdBuyBtn:addClickListener(function() noAdBuyBtn:addClickListener(function()
-- ModuleManager.PrivilegeCardManager:buyAdCard() ModuleManager.PrivilegeCardManager:buyAdCard()
-- end) end)
-- noAdBuyTx:setText(DataManager.PlayerData:getNoAdPrice()) noAdBuyTx:setText(DataManager.PlayerData:getNoAdPrice())
-- else else
-- noAdNode:setActive(false) noAdNode:setActive(false)
-- end end
end end
function BattleReviveUI:_addListeners() function BattleReviveUI:_addListeners()
@ -117,12 +117,14 @@ function BattleReviveUI:_addListeners()
self.adBtn:addClickListener(function() self.adBtn:addClickListener(function()
SDKManager:showFullScreenAds(BIReport.ADS_CLICK_TYPE.BATTLE_REVIVE, function() SDKManager:showFullScreenAds(BIReport.ADS_CLICK_TYPE.BATTLE_REVIVE, function()
self:doRevive(true) self:doRevive(true)
end) end, true)
end) end)
self.cancelBtn:addClickListener(function() self.cancelBtn:addClickListener(function()
self:cancelRevive() self:cancelRevive()
end) end)
self.closeBtn:addClickListener(function()
self:cancelRevive()
end)
self:addEventListener(EventManager.CUSTOM_EVENT.BATTLE_REVIVE, function() self:addEventListener(EventManager.CUSTOM_EVENT.BATTLE_REVIVE, function()
self:onRevive() self:onRevive()
end) end)
@ -139,10 +141,6 @@ function BattleReviveUI:doRevive(isAd)
end end
function BattleReviveUI:onRevive() function BattleReviveUI:onRevive()
-- self.fx:setActive(true)
-- self.fx:play()
-- self.spineObj:playAnimComplete("open", false, true, function()
-- self:closeUI()
self:closeUI() self:closeUI()
if self.callback then if self.callback then
self.callback(true) self.callback(true)

View File

@ -1,6 +1,6 @@
local SelectOtherBtnUI = class("SelectOtherBtnUI", BaseUI) local SelectOtherBtnUI = class("SelectOtherBtnUI", BaseUI)
local BTN_OFFSET = -10 local BTN_OFFSET = -14
local BTN_INTERVAL = 56 local BTN_INTERVAL = 56
function SelectOtherBtnUI:ctor() function SelectOtherBtnUI:ctor()
@ -95,7 +95,7 @@ function SelectOtherBtnUI:onLoadRootComplete()
self:closeUI() self:closeUI()
ModuleManager.DevToolManager:showOrHideDevListUI() ModuleManager.DevToolManager:showOrHideDevListUI()
end) end)
self.uiMap["select_other_btn_ui.bg.gm_btn.text"]:setText(I18N:getGlobalText(I18N.GlobalConst.SETTING_DESC)) self.uiMap["select_other_btn_ui.bg.gm_btn.text"]:setText("GM")
else else
self.uiMap["select_other_btn_ui.bg.gm_btn"]:setVisible(false) self.uiMap["select_other_btn_ui.bg.gm_btn"]:setVisible(false)
end end

View File

@ -48,6 +48,7 @@ function IdleDropUI:onLoadRootComplete()
self.uiMap = uiMap self.uiMap = uiMap
uiMap["idle_drop_ui.bg.title_text"]:setText(I18N:getGlobalText(I18N.GlobalConst.IDLE_DROP_REWARD)) uiMap["idle_drop_ui.bg.title_text"]:setText(I18N:getGlobalText(I18N.GlobalConst.IDLE_DROP_REWARD))
self.timeTx = uiMap["idle_drop_ui.bg.time_tx"] self.timeTx = uiMap["idle_drop_ui.bg.time_tx"]
self.bg = uiMap["idle_drop_ui.bg"]
local goldPerHour = GFunc.num2Str(DataManager.IdleData:getGoldPerHour()) local goldPerHour = GFunc.num2Str(DataManager.IdleData:getGoldPerHour())
local expPerHour = GFunc.num2Str(DataManager.IdleData:getExpPerHour()) local expPerHour = GFunc.num2Str(DataManager.IdleData:getExpPerHour())
@ -88,7 +89,7 @@ function IdleDropUI:onLoadRootComplete()
ModuleManager.PrivilegeCardManager:showPrivilegeUI() ModuleManager.PrivilegeCardManager:showPrivilegeUI()
end) end)
uiMap["idle_drop_ui.bg.desc_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.CLICK_CLOSE_DESC)) uiMap["idle_drop_ui.desc_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.CLICK_CLOSE_DESC))
uiMap["idle_drop_ui.bg.bg1.desc_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.IDLE_DESC_8)) uiMap["idle_drop_ui.bg.bg1.desc_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.IDLE_DESC_8))
uiMap["idle_drop_ui.bg.bg1.desc_tx_1"]:setText(I18N:getGlobalText(I18N.GlobalConst.IDLE_DESC_9)) uiMap["idle_drop_ui.bg.bg1.desc_tx_1"]:setText(I18N:getGlobalText(I18N.GlobalConst.IDLE_DESC_9))
@ -207,11 +208,15 @@ function IdleDropUI:bindData()
self.canRefreshReward = true self.canRefreshReward = true
self:refreshCD() self:refreshCD()
end) end)
self:bind(DataManager.PrivilegeCardData, "isDirty", function()
self:onRefresh()
end)
end end
function IdleDropUI:onRefresh() function IdleDropUI:onRefresh()
self:refreshRewards() self:refreshRewards()
self:refreshBtns() self:refreshBtns()
self:refreshAd()
GFunc.setAdsSprite(self.adBtnImg) GFunc.setAdsSprite(self.adBtnImg)
end end
@ -421,4 +426,14 @@ function IdleDropUI:tickFight(dt)
end end
end end
function IdleDropUI:refreshAd()
if DataManager.PrivilegeCardData:getIsMonthlyCardOpen() and not DataManager.PrivilegeCardData:getIsCardActive(GConst.ShopConst.PRIVILEGE_CARD_ID.MONTHLY_CARD) then
self.privilegeBtn:setActive(true)
self.bg:setAnchoredPositionY(-55)
else
self.privilegeBtn:setActive(false)
self.bg:setAnchoredPositionY(-120)
end
end
return IdleDropUI return IdleDropUI

View File

@ -280,7 +280,7 @@ function MainComp:refreshRedPoint()
end end
if DataManager.ChapterData:getChapterBoxCanGet() then if DataManager.ChapterData:getChapterBoxCanGet() then
self.chapterBoxBtn:addRedPoint(20, 20, 1) self.chapterBoxBtn:addRedPoint(24, 24, 1)
else else
self.chapterBoxBtn:removeRedPoint() self.chapterBoxBtn:removeRedPoint()
end end

View File

@ -97,7 +97,7 @@ function BoxHeroUI:refreshCummonBox()
end) end)
self.titleTx:setText(TITLE_TEXT[self.summonType]) self.titleTx:setText(TITLE_TEXT[self.summonType])
self.boxImg:setSprite(GConst.ATLAS_PATH.SHOP, ICON_NAME[self.summonType]) self.boxImg:setSprite(GConst.ATLAS_PATH.UI_SHOP, ICON_NAME[self.summonType])
self:showRewards(DataManager.SummonData:getSummonTotalRewardByLv(self.summonType))-- 本次实际奖励 self:showRewards(DataManager.SummonData:getSummonTotalRewardByLv(self.summonType))-- 本次实际奖励