Back to Home

ESO Lua File v100035

internalingame/marketannouncement/keyboard/eventannouncementtile_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
66
67
68
69
----
-- ZO_EventAnnouncementTile_Keyboard
----
ZO_EVENT_ANNOUNCEMENT_TILE_KEYBOARD_DEFAULT_HIGHLIGHT_ANIMATION_PROVIDER = ZO_ReversibleAnimationProvider:New("ShowOnMouseOverLabelAnimation")
-- Primary logic class must be subclassed after the platform class so that platform specific functions will have priority over the logic class functionality
ZO_EventAnnouncementTile_Keyboard = ZO_Object.MultiSubclass(ZO_ActionTile_Keyboard, ZO_EventAnnouncementTile)
function ZO_EventAnnouncementTile_Keyboard:New(...)
    return ZO_EventAnnouncementTile.New(self, ...)
end
-- Begin ZO_ActionTile_Keyboard Overrides --
function ZO_EventAnnouncementTile_Keyboard:PostInitializePlatform()
    ZO_ActionTile_Keyboard.PostInitializePlatform(self)
    self:SetActionText(GetString(SI_EVENT_ANNOUNCEMENT_ACTION))
    self:SetHighlightAnimationProvider(ZO_EVENT_ANNOUNCEMENT_TILE_KEYBOARD_DEFAULT_HIGHLIGHT_ANIMATION_PROVIDER)
    local function OnActionButtonMouseEnter()
        self:OnMouseEnter()
    end
    local function OnActionButtonMouseExit()
        self:OnMouseExit()
    end
    self.actionButton:SetHandler("OnMouseEnter", OnActionButtonMouseEnter)
    self.actionButton:SetHandler("OnMouseExit", OnActionButtonMouseExit)
end
function ZO_EventAnnouncementTile_Keyboard:Layout(data)
    ZO_EventAnnouncementTile.Layout(self, data)
    self:SetActionCallback(function()
        if self.data.marketProductId ~= 0 then
            ZO_KEYBOARD_MARKET_ANNOUNCEMENT:DoOpenMarketBehaviorForMarketProductId(self.data.marketProductId)
        else
            SYSTEMS:GetObject(ZO_MARKET_NAME):RequestShowMarket(MARKET_OPEN_OPERATION_ANNOUNCEMENT, OPEN_MARKET_BEHAVIOR_SHOW_FEATURED_CATEGORY)
        end
    end)
end
function ZO_EventAnnouncementTile_Keyboard:OnMouseEnter()
    ZO_ActionTile_Keyboard.OnMouseEnter(self)
    self.isMousedOver = true
    self.actionButton:SetShowingHighlight(self.isMousedOver)
end
function ZO_EventAnnouncementTile_Keyboard:OnMouseExit()
    ZO_ActionTile_Keyboard.OnMouseExit(self)
    self.isMousedOver = false
    self.actionButton:SetShowingHighlight(self.isMousedOver)
end
function ZO_EventAnnouncementTile_Keyboard:OnMouseUp(button, upInside)
    if self.actionCallback and self:IsActionAvailable() then
        self.actionCallback()
    end
end
-- Globals
    ZO_EventAnnouncementTile_Keyboard:New(control)
end