Back to Home

ESO Lua File v100032

ingame/map/keyboard/worldmapkey_keyboard.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
local SYMBOL_PARAMS = {
    NUM_SYMBOLS_PER_ROW = 4,
    HEADER_SECTION_OFFSET_X = 0,
    SYMBOL_PADDING = 16,
    SYMBOL_SECTION_OFFSET_X = 25,
    SYMBOL_SECTION_OFFSET_Y = 3,
    SYMBOL_SIZE = 40,
    BETWEEN_SECTION_PADDING_Y = 20,
}
local WorldMapKey = ZO_WorldMapKey_Shared:Subclass()
function WorldMapKey:New(...)
    local object = ZO_WorldMapKey_Shared.New(self, ...)
    return object
end
function WorldMapKey:Initialize(control)
    ZO_WorldMapKey_Shared.Initialize(self, control)
    self.symbolParams = SYMBOL_PARAMS
    self.scrollChild = GetControl(control, "PaneScrollChild")
    self.noKeyLabel = control:GetNamedChild("NoKey")
    self.headerPool = ZO_ControlPool:New("ZO_WorldMapKeyHeader", self.scrollChild, "Header")
    self.symbolPool = ZO_ControlPool:New("ZO_WorldMapKeySymbol", self.scrollChild, "Symbol")
    WORLD_MAP_KEY_FRAGMENT = ZO_FadeSceneFragment:New(control)
    WORLD_MAP_KEY_FRAGMENT:RegisterCallback("StateChange", function(oldState, newState)
        if(newState == SCENE_FRAGMENT_SHOWING) then
            self:RefreshKey()
        end
    end)
    self.fragment = WORLD_MAP_KEY_FRAGMENT
end
--Local XML
function WorldMapKey:Symbol_OnMouseEnter(symbol)
    InitializeTooltip(InformationTooltip, symbol, BOTTOM, 0, -10)
    InformationTooltip:AddLine(symbol.name, "ZoFontHeader")
    if(symbol.tooltip ~= "") then
        InformationTooltip:AddLine(symbol.tooltip, "", ZO_TOOLTIP_DEFAULT_COLOR:UnpackRGB())
    end
end
function WorldMapKey:Symbol_OnMouseExit(symbol)
    ClearTooltip(InformationTooltip)
end
--Global XML
    WORLD_MAP_KEY:Symbol_OnMouseEnter(self)
end
    WORLD_MAP_KEY:Symbol_OnMouseExit(self)
end
    WORLD_MAP_KEY = WorldMapKey:New(self)
end