Back to Home

ESO Lua File v100029

ingame/map/gamepad/worldmapkeepinfo_gamepad.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
--Keep Upgrade Type
local KeepUpgrade_Gamepad = ZO_KeepUpgrade_Shared:Subclass()
--Resource Upgrade Type
local ResourceUpgrade_Gamepad = ZO_ResourceUpgrade_Shared:Subclass()
--World Map Keep Info
local WorldMapKeepInfo_Gamepad = ZO_WorldMapKeepInfo_Shared:Subclass()
function WorldMapKeepInfo_Gamepad:New(...)
    return ZO_WorldMapKeepInfo_Shared.New(self, ...)
end
function WorldMapKeepInfo_Gamepad:Initialize(control)
    self.header = control:GetNamedChild("Container"):GetNamedChild("Header")
    ZO_GamepadGenericHeader_Initialize(self.header, ZO_GAMEPAD_HEADER_TABBAR_CREATE)
    ZO_WorldMapKeepInfo_Shared.Initialize(self, control, ZO_TranslateFromLeftSceneFragment)
    self.keepUpgrade = KeepUpgrade_Gamepad:New()
    self.resourceUpgrade = ResourceUpgrade_Gamepad:New()
    GAMEPAD_WORLD_MAP_KEEP_INFO_FRAGMENT = self.worldMapKeepInfoFragment
end
function WorldMapKeepInfo_Gamepad:GetBackgroundFragment()
    return GAMEPAD_NAV_QUADRANT_1_BACKGROUND_FRAGMENT
end
function WorldMapKeepInfo_Gamepad:SwitchToFragments(fragments)
    if(self.fragments) then
        SCENE_MANAGER:RemoveFragmentGroup(self.fragments)
    end
    self.fragments = fragments
    if SCENE_MANAGER:IsShowing("gamepad_worldMap") then
        SCENE_MANAGER:AddFragmentGroup(self.fragments)
    end
end
function WorldMapKeepInfo_Gamepad:BeginBar()
    self.tabBarEntries = {}
end
function WorldMapKeepInfo_Gamepad:AddBar(text, fragments, buttonData)
    self.tabBarEntries[#self.tabBarEntries + 1] = {
        text = GetString(text),
        callback = function() self:SwitchToFragments(fragments) end,
    }
end
function WorldMapKeepInfo_Gamepad:FinishBar()
    self.baseHeaderData = {
        tabBarEntries = self.tabBarEntries,
    }
    ZO_GamepadGenericHeader_Refresh(self.header, self.baseHeaderData)
end
function WorldMapKeepInfo_Gamepad:OnShowing()
    ZO_WorldMapKeepInfo_Shared.OnShowing(self)
    if self.fragments then
        SCENE_MANAGER:AddFragmentGroup(self.fragments)
    end
end
function WorldMapKeepInfo_Gamepad:OnHidden()
    ZO_WorldMapKeepInfo_Shared.OnHidden(self)
    self.keepUpgradeObject = nil
    if self.fragments then
        SCENE_MANAGER:RemoveFragmentGroup(self.fragments)
    end
    ZO_WorldMap_SetKeepMode(false)
end
--Global
    GAMEPAD_WORLD_MAP_KEEP_INFO = WorldMapKeepInfo_Gamepad:New(control)
    SYSTEMS:RegisterGamepadObject("world_map_keep_info", GAMEPAD_WORLD_MAP_KEEP_INFO)
end