Back to Home

ESO Lua File v100032

publicallingames/itempreview/gamepad/itempreviewlisthelper_gamepad.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
ZO_ItemPreviewListHelper_Gamepad = ZO_ItemPreviewListHelper_Shared:Subclass()
function ZO_ItemPreviewListHelper_Gamepad:New(...)
    return ZO_ItemPreviewListHelper_Shared.New(self, ...)
end
function ZO_ItemPreviewListHelper_Gamepad:Initialize(...)
    ZO_ItemPreviewListHelper_Shared.Initialize(self, ...)
end
function ZO_ItemPreviewListHelper_Gamepad:InitializeKeybinds()
    self.keybindStripDescriptor =
    {
        alignment = KEYBIND_STRIP_ALIGN_CENTER,
        {
            name = GetString(SI_GAMEPAD_PREVIEW_PREVIOUS),
            keybind = "UI_SHORTCUT_LEFT_TRIGGER",
            callback = function()
                self:PreviewPrevious()
            end,
            visible = function() return self:HasMultiplePreviewDatas() end,
            enabled = function() return ITEM_PREVIEW_GAMEPAD:CanChangePreview() and self:CanPreviewPrevious() end,
        },
        {
            name = GetString(SI_GAMEPAD_PREVIEW_NEXT),
            keybind = "UI_SHORTCUT_RIGHT_TRIGGER",
            callback = function()
                self:PreviewNext()
            end,
            visible = function() return self:HasMultiplePreviewDatas() end,
            enabled = function() return ITEM_PREVIEW_GAMEPAD:CanChangePreview() and self:CanPreviewNext() end,
        },
    }
end
function ZO_ItemPreviewListHelper_Gamepad:RefreshActions()
    ZO_ItemPreviewListHelper_Shared.RefreshActions(self)
    KEYBIND_STRIP:UpdateKeybindButtonGroup(self.keybindStripDescriptor)
end
function ZO_ItemPreviewListHelper_Gamepad:GetPreviewObject()
    return ITEM_PREVIEW_GAMEPAD
end
function ZO_ItemPreviewListHelper_Gamepad:OnShowing()
    ZO_ItemPreviewListHelper_Shared.OnShowing(self)
    KEYBIND_STRIP:AddKeybindButtonGroup(self.keybindStripDescriptor)
end
function ZO_ItemPreviewListHelper_Gamepad:OnHidden()
    ZO_ItemPreviewListHelper_Shared.OnHidden(self)
    KEYBIND_STRIP:RemoveKeybindButtonGroup(self.keybindStripDescriptor)
end
    ITEM_PREVIEW_LIST_HELPER_GAMEPAD = ZO_ItemPreviewListHelper_Gamepad:New(control)
end