Back to Home

ESO Lua File v100030

ingame/guild/keyboard/guildrankiconpicker_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
---------------------------
--Guild Rank Icon Picker --
---------------------------
ZO_GUILD_RANK_RANK_ICON_PICKER_PICK_KEYBOARD_SIZE = 60
ZO_GUILD_RANK_RANK_ICON_PICKER_PICK_KEYBOARD_PADDING = 0
ZO_GUILD_RANK_RANK_ICON_PICKER_ICON_KEYBOARD_SIZE = 48
ZO_GUILD_RANK_RANK_ICON_PICKER_ICON_KEYBOARD_OFFSET = 10
ZO_GuildRankIconPicker_Keyboard = ZO_GuildRankIconPicker_Shared:Subclass()
function ZO_GuildRankIconPicker_Keyboard:New(...)
    return ZO_GuildRankIconPicker_Shared.New(self, ...)
end
function ZO_GuildRankIconPicker_Keyboard:Initialize(control)
    local templateData =
    {
        gridListClass = ZO_GridScrollList_Keyboard,
        entryTemplate = "ZO_GuildRank_RankIconPickerIcon_Keyboard_Control",
        entryWidth = ZO_GUILD_RANK_RANK_ICON_PICKER_PICK_KEYBOARD_SIZE,
        entryHeight = ZO_GUILD_RANK_RANK_ICON_PICKER_PICK_KEYBOARD_SIZE,
        entryPaddingX = ZO_GUILD_RANK_RANK_ICON_PICKER_PICK_KEYBOARD_PADDING,
        entryPaddingY = ZO_GUILD_RANK_RANK_ICON_PICKER_PICK_KEYBOARD_PADDING,
    }
    ZO_GuildRankIconPicker_Shared.Initialize(self, control, templateData)
end
function ZO_GuildRankIconPicker_Keyboard:OnRankIconPickerEntrySetup(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()
        self:OnRankIconPickerGridListEntryClicked(data.iconIndex)
    end
    iconContainer:GetNamedChild("Icon"):SetTexture(GetGuildRankLargeIcon(data.iconIndex))
    ZO_CheckButton_SetCheckState(checkButton, isCurrent)
end
function ZO_GuildRankIconPicker_Keyboard:OnRankIconPickerGridListEntryClicked(newIconIndex)
    if self.rankIconPickedCallback then
        self.rankIconPickedCallback(newIconIndex)
    end
end