Back to Home

ESO Lua File v100023

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
ZO_REMOTE_SCENE_CHANGE_ORIGIN = SCENE_MANAGER_MESSAGE_ORIGIN_INTERNAL
local ZO_InternalIngameSceneManager = ZO_SceneManager_Follower:Subclass()
function ZO_InternalIngameSceneManager:New(...)
    return ZO_SceneManager_Follower.New(self, ...)
end
function ZO_InternalIngameSceneManager:Initialize(...)
    ZO_SceneManager_Follower.Initialize(self, ...)
    self.topLevelWindows = {}
    self.numTopLevelShown = 0
end
function ZO_InternalIngameSceneManager:OnScenesLoaded()
    self:Show("empty")
end
--Top Levels
function ZO_InternalIngameSceneManager:RegisterTopLevel(topLevel, locksUIMode)
    topLevel.locksUIMode = locksUIMode
    self.topLevelWindows[topLevel] = true
end
function ZO_InternalIngameSceneManager:IsInUIMode()
    if IsGameCameraActive() then
        return IsGameCameraUIModeActive()
    end
    return false
end
function ZO_InternalIngameSceneManager:HideTopLevel(topLevel)
    if not topLevel:IsControlHidden() and self.topLevelWindows[topLevel] == true then
        topLevel:SetHidden(true)
        self.numTopLevelShown = self.numTopLevelShown - 1
        ChangeRemoteTopLevel(ZO_REMOTE_SCENE_CHANGE_ORIGIN, REMOTE_SCENE_REQUEST_TYPE_HIDE)
    end
end
function ZO_InternalIngameSceneManager:ShowTopLevel(topLevel)
    if topLevel:IsControlHidden() and self.topLevelWindows[topLevel] == true then
        topLevel:SetHidden(false)
        self.numTopLevelShown = self.numTopLevelShown + 1
        ChangeRemoteTopLevel(ZO_REMOTE_SCENE_CHANGE_ORIGIN, REMOTE_SCENE_REQUEST_TYPE_SHOW)
    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()