ESO Lua File v100011

ingame/map/worldmapinfo.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
local WorldMapInfo = ZO_WorldMapInfo_Shared:Subclass()
function WorldMapInfo:New(...)
    local object = ZO_WorldMapInfo_Shared.New(self, ...)
    return object
end
function WorldMapInfo:Initialize(control)
    ZO_WorldMapInfo_Shared.Initialize(self, control)
    WORLD_MAP_INFO_FRAGMENT = ZO_FadeSceneFragment:New(control)
    WORLD_MAP_INFO_FRAGMENT:RegisterCallback("StateChange", function(oldState, newState)
        if(newState == SCENE_FRAGMENT_SHOWING) then
            self.modeBar:ShowLastFragment()
        elseif(newState == SCENE_FRAGMENT_HIDDEN) then
            self.modeBar:Clear()
        end
    end)
end
function WorldMapInfo:InitializeTabs()
    local function CreateButtonData(normal, pressed, highlight)
        return {
            normal = normal,
            pressed = pressed,
            highlight = highlight,
        }
    end
    
    self.modeBar = ZO_SceneFragmentBar:New(self.control:GetNamedChild("MenuBar"))
    self.modeBar:SetStartingFragment(SI_MAP_INFO_MODE_QUESTS)
    --Quests Button
    local questButtonData = CreateButtonData("EsoUI/Art/WorldMap/map_indexIcon_quests_up.dds",
                                             "EsoUI/Art/WorldMap/map_indexIcon_quests_down.dds",
                                             "EsoUI/Art/WorldMap/map_indexIcon_quests_over.dds")
    self.modeBar:Add(SI_MAP_INFO_MODE_QUESTS, { WORLD_MAP_QUESTS_FRAGMENT }, questButtonData)  
    --Key Button
    local keyButtonData = CreateButtonData("EsoUI/Art/WorldMap/map_indexIcon_key_up.dds",
                                           "EsoUI/Art/WorldMap/map_indexIcon_key_down.dds",
                                           "EsoUI/Art/WorldMap/map_indexIcon_key_over.dds")
    self.modeBar:Add(SI_MAP_INFO_MODE_KEY, { WORLD_MAP_KEY_FRAGMENT }, keyButtonData)
    --Filters Button
    local filtersButtonData = CreateButtonData("EsoUI/Art/WorldMap/map_indexIcon_filters_up.dds",
                                           "EsoUI/Art/WorldMap/map_indexIcon_filters_down.dds",
                                           "EsoUI/Art/WorldMap/map_indexIcon_filters_over.dds")
    self.modeBar:Add(SI_MAP_INFO_MODE_FILTERS, { WORLD_MAP_KEY_FILTERS_FRAGMENT }, filtersButtonData) 
    --Locations Button
    local locationButtonData = CreateButtonData("EsoUI/Art/WorldMap/map_indexIcon_locations_up.dds",
                                                "EsoUI/Art/WorldMap/map_indexIcon_locations_down.dds",
                                                "EsoUI/Art/WorldMap/map_indexIcon_locations_over.dds")
    self.modeBar:Add(SI_MAP_INFO_MODE_LOCATIONS, { WORLD_MAP_LOCATIONS_FRAGMENT }, locationButtonData)
end
function WorldMapInfo:SelectTab(name)
    if(WORLD_MAP_INFO_FRAGMENT:IsShowing()) then
        self.modeBar:SelectFragment(name)
    else
        self.modeBar:SetStartingFragment(name)
    end
end
--Global
    WORLD_MAP_INFO = WorldMapInfo:New(ZO_WorldMapInfo)
end