ESO Lua File v100010

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
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:OnScenesLoaded()
    self:SetBaseScene("empty")
    self:Show("empty")
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()