This commit is contained in:
puxuan 2025-08-15 20:18:13 +08:00
parent 5994685457
commit 9752a8ff72
4 changed files with 32 additions and 12 deletions

View File

@ -640,8 +640,8 @@ local LocalizationGlobalConst =
ITEM_NOT_ENOUGH_DESC = "ITEM_NOT_ENOUGH_DESC", ITEM_NOT_ENOUGH_DESC = "ITEM_NOT_ENOUGH_DESC",
SUMMON_ONE = "SUMMON_ONE", SUMMON_ONE = "SUMMON_ONE",
SUMMON_TEN = "SUMMON_TEN", SUMMON_TEN = "SUMMON_TEN",
FREE_THIS_TIME_DESC_1 = "FREE_THIS_TIME_DESC_1", FREE_DESC_1 = "FREE_DESC_1",
SUMMON_DESC_22 = "SUMMON_DESC_22", SUMMON_DESC_1 = "SUMMON_DESC_1",
SUMMON_WISH_OK = "SUMMON_WISH_OK", SUMMON_WISH_OK = "SUMMON_WISH_OK",
SUMMON_WISH_TITLE = "SUMMON_WISH_TITLE", SUMMON_WISH_TITLE = "SUMMON_WISH_TITLE",
SUMMON_WISH_UNSELECT = "SUMMON_WISH_UNSELECT", SUMMON_WISH_UNSELECT = "SUMMON_WISH_UNSELECT",

View File

@ -640,8 +640,8 @@ local localization_global =
["ITEM_NOT_ENOUGH_DESC"] = "是否使用<color=#c40e0e>钻石*{0}</color>补充<color=#c45f0e>魔法石*{1}</color>,进行召唤?", ["ITEM_NOT_ENOUGH_DESC"] = "是否使用<color=#c40e0e>钻石*{0}</color>补充<color=#c45f0e>魔法石*{1}</color>,进行召唤?",
["SUMMON_ONE"] = "召唤1次", ["SUMMON_ONE"] = "召唤1次",
["SUMMON_TEN"] = "召唤10次", ["SUMMON_TEN"] = "召唤10次",
["FREE_THIS_TIME_DESC_1"] = "本次免费", ["FREE_DESC_1"] = "本次免费",
["SUMMON_DESC_22"] = "点击广告召唤", ["SUMMON_DESC_1"] = "点击广告召唤",
["SUMMON_WISH_OK"] = "确定选择", ["SUMMON_WISH_OK"] = "确定选择",
["SUMMON_WISH_TITLE"] = "心愿英雄", ["SUMMON_WISH_TITLE"] = "心愿英雄",
["SUMMON_WISH_UNSELECT"] = "暂未选择", ["SUMMON_WISH_UNSELECT"] = "暂未选择",

View File

@ -4,14 +4,9 @@ local UISpineObject = require "app/bf/unity/ui_spine_object"
-- local CHAPTER_PATH = "assets/arts/textures/background/chapter/%s.png" -- local CHAPTER_PATH = "assets/arts/textures/background/chapter/%s.png"
local HERO_SPINE_ASSET_PATH = "assets/arts/spines/characters/%s/%s_skeletondata.asset" local HERO_SPINE_ASSET_PATH = "assets/arts/spines/characters/%s/%s_skeletondata.asset"
local CHAPTER_PATH = "assets/arts/textures/background/main/%s.png" local CHAPTER_PATH = "assets/arts/prefabs/ui/chapter/%s.prefab"
local CHAPTER_PAGE = 5 local CHAPTER_PAGE = 5
local BOX_ICON = {
"common_chest_1",
"common_chest_4"
}
function MainComp:onOpen() function MainComp:onOpen()
self.startMonsterAction = true self.startMonsterAction = true
if self.bossNode then if self.bossNode then
@ -60,6 +55,7 @@ function MainComp:init()
-- uiMap["main_comp.right_btn.text"]:setText(I18N:getGlobalText(I18N.GlobalConst.DAILY_CHALLENGE)) -- uiMap["main_comp.right_btn.text"]:setText(I18N:getGlobalText(I18N.GlobalConst.DAILY_CHALLENGE))
uiMap["main_comp.left_btn.text"]:setText("游历") uiMap["main_comp.left_btn.text"]:setText("游历")
uiMap["main_comp.right_btn.text"]:setText("限时祈愿") uiMap["main_comp.right_btn.text"]:setText("限时祈愿")
self.backGroundNode = uiMap["main_comp.back_ground"]
self.chapterBg = uiMap["main_comp.bg"] self.chapterBg = uiMap["main_comp.bg"]
self.chapterBg:setAnchoredPositionX(-720) self.chapterBg:setAnchoredPositionX(-720)
@ -163,6 +159,8 @@ function MainComp:init()
local chapterId = DataManager.ChapterData:getChapterId() local chapterId = DataManager.ChapterData:getChapterId()
self.chapterPage = DataManager.ChapterData:getChapterPage(chapterId) self.chapterPage = DataManager.ChapterData:getChapterPage(chapterId)
self.chapterStage = DataManager.ChapterData:getChapterStage(chapterId) self.chapterStage = DataManager.ChapterData:getChapterStage(chapterId)
self.chapterScenes = {}
end end
function MainComp:refresh() function MainComp:refresh()
@ -174,6 +172,7 @@ function MainComp:refreshChapter(force)
self.chapterList = DataManager.ChapterData:getChapterList(self.chapterPage) self.chapterList = DataManager.ChapterData:getChapterList(self.chapterPage)
self.currChapterId = chapterId self.currChapterId = chapterId
if self.currChapterId ~= chapterId or force then if self.currChapterId ~= chapterId or force then
self:refreshChapterBg()
self:refreshFightBtn() self:refreshFightBtn()
self:doBossAction() self:doBossAction()
end end
@ -183,6 +182,27 @@ function MainComp:refreshChapter(force)
self:refreshChapterBtn() self:refreshChapterBtn()
end end
function MainComp:refreshChapterBg()
local chapterId = DataManager.ChapterData:getChapterId()
local icon = DataManager.ChapterData:getChapterCfg()[chapterId].icon
local bgPath = string.format(CHAPTER_PATH, icon)
if self.chapterScenes[bgPath] then
self.chapterScenes[bgPath]:setActive(true)
if self.currScenePath and self.chapterScenes[self.currScenePath] then
self.chapterScenes[self.currScenePath]:setActive(false)
end
self.currScenePath = bgPath
else
UIPrefabManager:loadUIWidgetAsync(bgPath, self.backGroundNode, function(prefab)
if self.currScenePath and self.chapterScenes[self.currScenePath] then
self.chapterScenes[self.currScenePath]:setActive(false)
end
self.currScenePath = bgPath
self.chapterScenes[self.currScenePath] = prefab
end)
end
end
function MainComp:refreshChapterBtn() function MainComp:refreshChapterBtn()
local chapterNewId = DataManager.ChapterData:getNewChapterId() local chapterNewId = DataManager.ChapterData:getNewChapterId()
local maxPage = DataManager.ChapterData:getChapterPage(chapterNewId) local maxPage = DataManager.ChapterData:getChapterPage(chapterNewId)

View File

@ -111,8 +111,8 @@ function SummonMainUI:onLoadRootComplete()
self.summonBg = uiMap['summon_main_ui.bg'] self.summonBg = uiMap['summon_main_ui.bg']
uiMap["summon_main_ui.node.btn_summon_one.text_one"]:setText(I18N:getGlobalText(I18N.GlobalConst.SUMMON_ONE)) uiMap["summon_main_ui.node.btn_summon_one.text_one"]:setText(I18N:getGlobalText(I18N.GlobalConst.SUMMON_ONE))
uiMap["summon_main_ui.node.btn_summon_ten.text_ten"]:setText(I18N:getGlobalText(I18N.GlobalConst.SUMMON_TEN)) uiMap["summon_main_ui.node.btn_summon_ten.text_ten"]:setText(I18N:getGlobalText(I18N.GlobalConst.SUMMON_TEN))
uiMap["summon_main_ui.node.btn_summon_free.text_free"]:setText(I18N:getGlobalText(I18N.GlobalConst.FREE_THIS_TIME_DESC_1)) uiMap["summon_main_ui.node.btn_summon_free.text_free"]:setText(I18N:getGlobalText(I18N.GlobalConst.FREE_DESC_1))
uiMap["summon_main_ui.node.btn_summon_ad.desc_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.SUMMON_DESC_22)) uiMap["summon_main_ui.node.btn_summon_ad.desc_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.SUMMON_DESC_1))
uiMap["summon_main_ui.node.btn_info.desc_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.SUMMON_FORCE_3)) uiMap["summon_main_ui.node.btn_info.desc_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.SUMMON_FORCE_3))
self.descBg = uiMap["summon_main_ui.node.desc_bg"] self.descBg = uiMap["summon_main_ui.node.desc_bg"]
self.descTx = uiMap["summon_main_ui.node.desc_bg.desc_tx"] self.descTx = uiMap["summon_main_ui.node.desc_bg.desc_tx"]