Back to Home

ESO Lua File v101032

ingame/inventory/gamepad/guildbank_dialogs_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
65
66
67
68
69
70
71
72
73
74
75
76
local CHECKED_ICON = "EsoUI/Art/Inventory/Gamepad/gp_inventory_icon_equipped.dds"
local function IsActiveGuild(data)
    return data.isCurrentGuild
end
local function SetupGuildBankItem(control, data, ...)
    if IsActiveGuild(data) then
        control.statusIndicator:AddIcon(CHECKED_ICON)
        control.statusIndicator:Show()
    end
end
local GUILD_ENTRY_TEMPLATE = "ZO_GamepadSubMenuEntryWithStatusTemplate"
local function SetupGuildSelectionDialog(dialog)
    local currentGuildId = GetSelectedGuildBankId()
    dialog.info.parametricList = {}
    for i = 1, GetNumGuilds() do
        local guildId = GetGuildId(i)
        local guildName = GetGuildName(guildId)
        local allianceId = GetGuildAlliance(guildId)
        local icon = GetLargeAllianceSymbolIcon(allianceId)
        local entryData = ZO_GamepadEntryData:New(guildName, icon)
        entryData:SetFontScaleOnSelection(false)
        entryData:SetIconTintOnSelection(true)
        entryData.guildName = guildName
        entryData.guildId = guildId
        entryData.allianceId = allianceId
        entryData.setup = SetupGuildBankItem
        entryData.isCurrentGuild = guildId == currentGuildId
        local listItem = 
        {
            template = GUILD_ENTRY_TEMPLATE,
            entryData = entryData,
        }
        table.insert(dialog.info.parametricList, listItem)
    end
    dialog:setupFunc()
    dialog.entryList:SetSelectedDataByEval(IsActiveGuild)
end
ESO_Dialogs["GUILD_BANK_GAMEPAD_CHANGE_ACTIVE_GUILD"] =
{
    gamepadInfo =
    {
        dialogType = GAMEPAD_DIALOGS.PARAMETRIC,
    },
    title =
    {
        text = SI_GAMEPAD_GUILD_BANK_GUILD_SELECTION,
    },
    buttons =
    {
        {
            text = SI_GAMEPAD_SELECT_OPTION,
            callback =  function(dialog)
                            local data = dialog.entryList:GetTargetData()
                            if data.guildId then
                                GAMEPAD_GUILD_BANK:ChangeGuildBank(data.guildId)
                            end
                        end,
        },
        {
            text = SI_DIALOG_EXIT,
        },
    },
}