miduo_client/Assets/ManagedResources/~Lua/Modules/Story/StoryMapManager.lua

39 lines
1.0 KiB
Lua

StoryMapManager = {}
local this = StoryMapManager
this.groupConfigs = {}
this.isShowStory = 0
local storyMapConfig = ConfigManager.GetConfig(ConfigName.StoryMapConfig)
--初始化
function this.Initialize()
end
function this.InitData(groupId)
this.groupConfigs = {}
this.InitGroupIds(groupId)
this.GetSingleStoryConfig()
end
function this.InitGroupIds(groupId)
local config = storyMapConfig[groupId]
table.insert(this.groupConfigs,config)
if config.NextId and config.NextId > 0 then
this.InitGroupIds(config.NextId)
end
end
function this.GetSingleStoryConfig()
local config = {}
if #this.groupConfigs > 0 then
config = this.groupConfigs[1]
if UIManager.IsOpen(UIName.StoryMapPanel) then
UIManager.ClosePanel(UIName.StoryMapPanel)
end
UIManager.OpenPanel(UIName.StoryMapPanel,config)
table.remove(this.groupConfigs,1)
else
Game.GlobalEvent:DispatchEvent(GameEvent.GuaJi.CloseStoryMapPanel)
end
end
return this