Back to Home

ESO Lua File v101044

ingame/armory/keyboard/armorybuildiconpicker_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
---------------------------
--Armory Build Icon Picker --
---------------------------
ZO_ARMORY_BUILD_ICON_PICKER_PICK_KEYBOARD_SIZE = 60
ZO_ARMORY_BUILD_ICON_PICKER_PICK_KEYBOARD_PADDING = 0
ZO_ARMORY_BUILD_ICON_PICKER_ICON_KEYBOARD_SIZE = 48
ZO_ARMORY_BUILD_ICON_PICKER_ICON_KEYBOARD_OFFSET = 10
ZO_ArmoryBuildIconPicker_Keyboard = ZO_ArmoryBuildIconPicker_Shared:Subclass()
function ZO_ArmoryBuildIconPicker_Keyboard:Initialize(control)
    local templateData =
    {
        gridListClass = ZO_GridScrollList_Keyboard,
        entryTemplate = "ZO_ArmoryBuild_BuildIconPickerIcon_Keyboard_Control",
        entryWidth = ZO_ARMORY_BUILD_ICON_PICKER_PICK_KEYBOARD_SIZE,
        entryHeight = ZO_ARMORY_BUILD_ICON_PICKER_PICK_KEYBOARD_SIZE,
        entryPaddingX = ZO_ARMORY_BUILD_ICON_PICKER_PICK_KEYBOARD_PADDING,
        entryPaddingY = ZO_ARMORY_BUILD_ICON_PICKER_PICK_KEYBOARD_PADDING,
    }
    ZO_ArmoryBuildIconPicker_Shared.Initialize(self, control, templateData)
end
function ZO_ArmoryBuildIconPicker_Keyboard:OnArmoryBuildIconPickerEntrySetup(control, data)
    local iconContainer = control:GetNamedChild("IconContainer")
    local checkButton = iconContainer:GetNamedChild("Frame")
    local isCurrent = data.isCurrent
    if type(isCurrent) == "function" then
        isCurrent = isCurrent()
    end
    local function OnClick()
    end
    iconContainer:GetNamedChild("Icon"):SetTexture(ZO_ARMORY_MANAGER:GetBuildIcon(data.iconIndex))
    ZO_CheckButton_SetCheckState(checkButton, isCurrent)
end
function ZO_ArmoryBuildIconPicker_Keyboard:SetArmoryBuildIconPicked(iconIndex)
    ZO_ArmoryBuildIconPicker_Shared.SetArmoryBuildIconPicked(self, iconIndex)
    PlaySound(SOUNDS.GUILD_RANK_LOGO_SELECTED)
end
function ZO_ArmoryBuildIconPicker_Keyboard:OnArmoryBuildIconPickerGridListEntryClicked(newIconIndex)
    self:SetArmoryBuildIconPicked(newIconIndex)
end