Back to Home

ESO Lua File v101041

ingame/zonestories/keyboard/zonestory_achievementtile_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
ZO_ZONE_STORIES_ACHIEVEMENT_TILE_KEYBOARD_DIMENSIONS_X = 284
ZO_ZONE_STORIES_ACHIEVEMENT_TILE_KEYBOARD_DIMENSIONS_Y = 74
ZO_ZONE_STORIES_ACHIEVEMENT_TILE_KEYBOARD_ICON_DIMENSIONS = 64
-- Primary logic class must be subclassed after the platform class so that platform specific functions will have priority over the logic class functionality
ZO_ZoneStory_AchievementTile_Keyboard = ZO_Object.MultiSubclass(ZO_Tile_Keyboard, ZO_ZoneStory_AchievementTile)
function ZO_ZoneStory_AchievementTile_Keyboard:New(...)
    return ZO_ZoneStory_AchievementTile.New(self, ...)
end
function ZO_ZoneStory_AchievementTile_Keyboard:InitializePlatform()
    ZO_Tile_Keyboard.InitializePlatform(self)
    self.iconOverlay = self.control:GetNamedChild("Icon"):GetNamedChild("Overlay")
end
function ZO_ZoneStory_AchievementTile_Keyboard:OnMouseEnter()
    ZO_Tile_Keyboard.OnMouseEnter(self)
    local offsetX = self.control:GetParent():GetLeft() - self.control:GetLeft() - 15
    local anchor = ZO_Anchor:New(RIGHT, self.control, LEFT, offsetX)
    self.iconOverlay:SetHidden(false)
    ACHIEVEMENTS:ShowAchievementDetailedTooltip(self.achievementId, anchor)
end
function ZO_ZoneStory_AchievementTile_Keyboard:OnMouseExit()
    ZO_Tile_Keyboard.OnMouseExit(self)
    self.iconOverlay:SetHidden(true)
    ACHIEVEMENTS:HideAchievementDetailedTooltip()
end
function ZO_ZoneStory_AchievementTile_Keyboard:OnMouseUp(button, upInside)
    if button == MOUSE_BUTTON_INDEX_LEFT and upInside then
        if self.achievementId then
            ACHIEVEMENTS:ShowAchievement(self.achievementId)
        end
    end
end
    ZO_ZoneStory_AchievementTile_Keyboard:New(control)
end