ESO Lua File v100012

internalingame/scenes/internalingamescenemanager.lua

[◄ back to folders ]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
ZO_REMOTE_SCENE_CHANGE_ORIGIN = REMOTE_SCENE_STATE_CHANGE_ORIGIN_INTERNAL
local ZO_InternalIngameSceneManager = ZO_SceneManager:Subclass()
function ZO_InternalIngameSceneManager:New(...)
    local manager = ZO_SceneManager.New(self, ...)
    return manager
end
function ZO_InternalIngameSceneManager:Initialize()
    ZO_SceneManager.Initialize(self)
    self.topLevelWindows = {}
    self.numTopLevelShown = 0
end
function ZO_InternalIngameSceneManager:OnRemoteSceneSwap(sceneName)
    -- we'll just let the ingame GUI tell us if we should show or not
end
function ZO_InternalIngameSceneManager:OnRemoteScenePush(sceneName)
    -- we don't keep a stack so ignore
end
function ZO_InternalIngameSceneManager:OnScenesLoaded()
    self:SetBaseScene("empty")
    self:Show("empty")
end
function ZO_InternalIngameSceneManager:Push(sceneName)
    local scene = self:GetScene(sceneName)
    local isRemoteScene = scene and scene:IsRemoteScene()
    if isRemoteScene then
        scene:PushRemoteScene()
    end
    -- we need the ingame GUI to tell us whether we actually get to show or not
    -- so do nothing here
end
function ZO_InternalIngameSceneManager:SwapCurrentScene(newCurrentScene)
    local scene = self:GetScene(newCurrentScene)
    local isRemoteScene = scene and scene:IsRemoteScene()
    if isRemoteScene then
        scene:SwapRemoteScene()
    end
end
--Top Levels
function ZO_InternalIngameSceneManager:RegisterTopLevel(topLevel, locksUIMode)
    topLevel.locksUIMode = locksUIMode
    self.topLevelWindows[topLevel] = true
end
function ZO_InternalIngameSceneManager:HideTopLevel(topLevel)
    if(not topLevel:IsControlHidden() and self.topLevelWindows[topLevel] == true) then
        topLevel:SetHidden(true)
        self.numTopLevelShown = self.numTopLevelShown - 1
    end
end
function ZO_InternalIngameSceneManager:ShowTopLevel(topLevel)
    if(topLevel:IsControlHidden() and self.topLevelWindows[topLevel] == true) then
        topLevel:SetHidden(false)
        self.numTopLevelShown = self.numTopLevelShown + 1
    end    
end
function ZO_InternalIngameSceneManager:ToggleTopLevel(topLevel)
    if(topLevel:IsControlHidden()) then
        self:ShowTopLevel(topLevel)
    else
        self:HideTopLevel(topLevel)
    end
end
function ZO_InternalIngameSceneManager:HideTopLevels()
    local topLevelHidden = false
    for topLevel, _ in pairs(self.topLevelWindows) do
        if(not topLevel:IsControlHidden()) then
            self:HideTopLevel(topLevel)
            topLevelHidden = true
        end
    end
    return topLevelHidden
end
SCENE_MANAGER = ZO_InternalIngameSceneManager:New()