This commit is contained in:
puxuan 2025-09-16 14:59:56 +08:00
parent 1aea0564b5
commit 0e0e36522d
4 changed files with 32 additions and 23 deletions

View File

@ -128,6 +128,7 @@ function ChapterManager:endFightFinish(result)
ModuleManager.BattleManager:showBattleResultUI(GConst.BattleConst.BATTLE_TYPE.STAGE, newRewards, reqData.combatReport, mysteryBoxIdx, nil, true)
DataManager.ChapterData:fightChapter(reqData.chapter_id, result.max_chapter_id, result.max_wave, reqData.mystery_box_idx)
DataManager.ChapterData:clearChapterBoxState()
-- 处理金猪,要在章节更新之后
DataManager.GoldPigData:addGoldPigCount()

View File

@ -1,21 +1,24 @@
local DailyChallengeUI = class("DailyChallengeUI", BaseUI)
-- function DailyChallengeUI:getIsOpen()
-- return DataManager.DailyChallengeData:isOpen()
-- end
-- function DailyChallengeUI:getEntranceName()
-- return I18N:getGlobalText(I18N.GlobalConst.DAILY_CHALLENGE)
-- end
-- function DailyChallengeUI:getShowEntranceRedPoint()
-- return DataManager.DailyChallengeData:isMeetChallenge()
-- end
function DailyChallengeUI:isFullScreen()
return false
end
function DailyChallengeUI:getCurrencyParams()
if self.currencyParams == nil then
self.currencyParams = {
itemIds = {
GConst.ItemConst.ITEM_ID_GOLD,
GConst.ItemConst.ITEM_ID_GEM,
GConst.ItemConst.ITEM_ID_VIT
},
showType = GConst.CURRENCY_TYPE.HORIZONTAL
}
end
return self.currencyParams
end
function DailyChallengeUI:getPrefabPath()
return "assets/prefabs/ui/daily_challenge/daily_challenge_ui.prefab"
end
@ -45,8 +48,8 @@ function DailyChallengeUI:onLoadRootComplete()
table.insert(self.taskMasks, uiMap["daily_challenge_ui.task.icon_task2.mask"])
table.insert(self.taskMasks, uiMap["daily_challenge_ui.task.icon_task3.mask"])
self.buffObj = uiMap["daily_challenge_ui.buffs.buff.btn_buff"]
self.debuffObj = uiMap["daily_challenge_ui.buffs.debuff.btn_debuff"]
self.buffBtn = uiMap["daily_challenge_ui.buffs.buff"]
self.debuffBtn = uiMap["daily_challenge_ui.buffs.debuff"]
self.bossSpine = uiMap["daily_challenge_ui.spine_node"]
self.countdownTx = uiMap["daily_challenge_ui.countdown.time_tx"]
@ -172,12 +175,12 @@ end
function DailyChallengeUI:refreshBuff()
local buffIds = DataManager.DailyChallengeData:getTodayBuffIds()
self.buffObj:addClickListener(function()
ModuleManager.TipsManager:showDescTips(DataManager.DailyChallengeData:getBuffDesc(buffIds[1]), self.buffObj)
self.buffBtn:addClickListener(function()
ModuleManager.TipsManager:showDescTips(DataManager.DailyChallengeData:getBuffDesc(buffIds[1]), self.buffBtn)
end)
self.debuffObj:addClickListener(function()
ModuleManager.TipsManager:showDescTips(DataManager.DailyChallengeData:getBuffDesc(buffIds[2]), self.debuffObj)
self.debuffBtn:addClickListener(function()
ModuleManager.TipsManager:showDescTips(DataManager.DailyChallengeData:getBuffDesc(buffIds[2]), self.debuffBtn)
end)
end
@ -247,9 +250,9 @@ function DailyChallengeUI:refreshDiffBtn()
local chapterStage = DataManager.ChapterData:getChapterStage(diffChapter + 1)
local str
if cfg.max_chapter <= chapterId then
str = I18N:getGlobalText(I18N.GlobalConst.DAILY_CHALLENGE_DESC_3, chapterPage, chapterStage, "<color=#5BFF5F>" .. I18N:getGlobalText(I18N.GlobalConst.DAILY_CHALLENGE_DESC_8) .. "</color>")
str = I18N:getGlobalText(I18N.GlobalConst.DAILY_CHALLENGE_DESC_3, chapterPage, chapterStage, "<color=#87FF9E>(" .. I18N:getGlobalText(I18N.GlobalConst.DAILY_CHALLENGE_DESC_8) .. ")</color>")
else
str = I18N:getGlobalText(I18N.GlobalConst.DAILY_CHALLENGE_DESC_3, chapterPage, chapterStage, "<color=#FF5D5D>" .. I18N:getGlobalText(I18N.GlobalConst.CHAPTER_WAVE_REAWRD_1) .. "</color>")
str = I18N:getGlobalText(I18N.GlobalConst.DAILY_CHALLENGE_DESC_3, chapterPage, chapterStage, "<color=#FF8787>(" .. I18N:getGlobalText(I18N.GlobalConst.CHAPTER_WAVE_REAWRD_1) .. ")</color>")
end
self.upDiffBtnDescTx:setText(str)
end

View File

@ -30,10 +30,10 @@ function SummonUnlockUI:onLoadRootComplete()
self:checkUnlockMap()
end)
self.heroNode = uiMap["summon_unlock_ui.hero_node"]
self.heroNode = uiMap["summon_unlock_ui.hero_bg.hero_node"]
self.nameTx = uiMap["summon_unlock_ui.name_tx"]
self.matchTx = uiMap["summon_unlock_ui.match_tx"]
self.matchImg = uiMap["summon_unlock_ui.match_tx.match_img"]
self.matchTx = uiMap["summon_unlock_ui.match_node.match_tx"]
self.matchImg = uiMap["summon_unlock_ui.match_node.match_tx.match_img"]
self.qltBg = uiMap["summon_unlock_ui.qlt_bg"]
self.qltBgTx = uiMap["summon_unlock_ui.qlt_bg.qlt_tx"]
self.uiSpine = uiMap["summon_unlock_ui.ui_spine_obj"]
@ -48,6 +48,7 @@ function SummonUnlockUI:onRefresh()
local heroEntity = DataManager.HeroData:getHeroById(self.heroId)
local matchType = heroEntity:getMatchType()
local qlt = heroEntity:getQlt()
self.nameTx:setText(heroEntity:getName())
self.matchTx:setText(ModuleManager.HeroManager:getMatchTypeName(matchType))
self.matchImg:setSprite(GConst.ATLAS_PATH.ICON_HERO, ModuleManager.HeroManager:getMatchTypeIcon(matchType))
self.qltBg:setSprite(GFunc.getHeroQltImg(qlt))

View File

@ -154,6 +154,10 @@ function ChapterData:getChapterBoxNum(chapterId, index)
return 1
end
function ChapterData:clearChapterBoxState()
self.boxCanGetState = nil
end
function ChapterData:getChapterBoxCanGet()
if self.boxCanGetState == nil then
self:calcChapterBoxCanGet()