Back to Home

ESO Lua File v100023

publicallingames/itempreview/keyboard/itempreviewlisthelper_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
ZO_ItemPreviewListHelper_Keyboard = ZO_ItemPreviewListHelper_Shared:Subclass()
function ZO_ItemPreviewListHelper_Keyboard:New(...)
    return ZO_ItemPreviewListHelper_Shared.New(self, ...)
end
function ZO_ItemPreviewListHelper_Keyboard:Initialize(...)
    ZO_ItemPreviewListHelper_Shared.Initialize(self, ...)
    self.previewPreviousArrowButton = self.control:GetNamedChild("PreviewPreviousArrow")
    self.previewNextArrowButton = self.control:GetNamedChild("PreviewNextArrow")
    self.previewPreviousArrowButton:SetHandler("OnClicked", function() self:PreviewPrevious() end)
    self.previewNextArrowButton:SetHandler("OnClicked", function() self:PreviewNext() end)
end
function ZO_ItemPreviewListHelper_Keyboard:RefreshActions()
    ZO_ItemPreviewListHelper_Shared.RefreshActions(self)
    local areButtonsVisible = self:HasMultiplePreviewDatas()
    self.previewPreviousArrowButton:SetHidden(not areButtonsVisible)
    self.previewNextArrowButton:SetHidden(not areButtonsVisible)
    if areButtonsVisible then
        local enabled = ITEM_PREVIEW_KEYBOARD:CanChangePreview()
        if enabled then
            self.previewPreviousArrowButton:SetState(BSTATE_NORMAL, false)
            self.previewNextArrowButton:SetState(BSTATE_NORMAL, false)
        else
            self.previewPreviousArrowButton:SetState(BSTATE_DISABLED, true)
            self.previewNextArrowButton:SetState(BSTATE_DISABLED, true)
        end
    end
end
function ZO_ItemPreviewListHelper_Keyboard:GetPreviewObject()
    return ITEM_PREVIEW_KEYBOARD
end
    ITEM_PREVIEW_LIST_HELPER_KEYBOARD = ZO_ItemPreviewListHelper_Keyboard:New(control)
end