引导问题修复

This commit is contained in:
xiekaidong 2023-07-12 16:02:38 +08:00
parent 62989cb4cf
commit 9f9ee9e1d9
2 changed files with 9 additions and 4 deletions

View File

@ -6,8 +6,8 @@ local ARENA_COMP = "app/ui/main_city/component/arena_comp"
local BOTTOM_HEIGHT = 120
function MainComp:ctor(params)
self.parentUI = params.parentUI
function MainComp:setParentUI(parentUI)
self.parentUI = parentUI
end
function MainComp:init()

View File

@ -327,7 +327,7 @@ function MainCityUI:initComp()
local mainComp = uiMap["main_ui.sub_ui_node.main_comp"]
mainComp:initPrefabHelper()
mainComp:genAllChildren()
self.mainComp = mainComp:addLuaComponent(MAIN_COMP, {parentUI = self})
self.mainComp = mainComp:addLuaComponent(MAIN_COMP)
self.subComps[GConst.MainCityConst.BOTTOM_PAGE.MAIN] = self.mainComp
-- 英雄
local heroComp = uiMap["main_ui.sub_ui_node.hero_ui"]
@ -340,6 +340,9 @@ function MainCityUI:initComp()
shopComp:initPrefabHelper()
shopComp:genAllChildren()
self.subComps[GConst.MainCityConst.BOTTOM_PAGE.SHOP] = shopComp:addLuaComponent(SHOP_COMP)
-- 初始完成后设置
self.mainComp:setParentUI(self)
end
end
@ -758,8 +761,10 @@ function MainCityUI:switchMainCompModule(moduleKey)
if self.selectedIndex ~= GConst.MainCityConst.BOTTOM_PAGE.MAIN then
return
end
self.mainComp:refreshModule(ModuleManager.MaincityManager:getCurModule())
if ModuleManager.MaincityManager:getCurModule() == GConst.MainCityConst.MAIN_MODULE.CHAPTER then
self:checkMainPop()
end
local module = self.mainComp:getCurModule()
if module then
self:setTopNodeVisible(module:isShowTopNode())