Back to Home

ESO Lua File v100032

ingame/guild/keyboard/guildweeklybidsdialog_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
56
57
58
59
60
61
62
ZO_GUILD_WEEKLY_BIDS_DIALOG_ROW_KEYBOARD_HEIGHT = 32
ZO_GuildWeeklyBidsDialog_Keyboard = ZO_Object.MultiSubclass(ZO_GuildWeeklyBids_Shared, ZO_SortFilterList)
function ZO_GuildWeeklyBidsDialog_Keyboard:New(control)
    return ZO_SortFilterList.New(self, control)
end
function ZO_GuildWeeklyBidsDialog_Keyboard:Initialize(control)
    ZO_SortFilterList.Initialize(self, control)
    ZO_GuildWeeklyBids_Shared.Initialize(self, "ZO_GuildWeeklyBidsDialogRow_Keyboard", ZO_GUILD_WEEKLY_BIDS_DIALOG_ROW_KEYBOARD_HEIGHT)
    ZO_PreHookHandler(self.control, "OnEffectivelyHidden", function() self.guildId = nil end)
    local function OnGuildPermissionChanged(event, guildId)
        if guildId == self.guildId then
            if not DoesPlayerHaveGuildPermission(self.guildId, GUILD_PERMISSION_GUILD_KIOSK_BID) then
                ZO_Dialogs_ReleaseDialog("GUILD_WEEKLY_BIDS_KEYBOARD")
            end
        end
    end
    ZO_Dialogs_RegisterCustomDialog("GUILD_WEEKLY_BIDS_KEYBOARD",
    {
        customControl = control,
        setup = function(dialog, data)
            self:DialogSetup(data)
            EVENT_MANAGER:RegisterForEvent("ZO_GuildWeeklyBidsDialog_Keyboard", EVENT_GUILD_PLAYER_RANK_CHANGED, OnGuildPermissionChanged)
            EVENT_MANAGER:RegisterForEvent("ZO_GuildWeeklyBidsDialog_Keyboard", EVENT_GUILD_SELF_LEFT_GUILD, OnGuildPermissionChanged)
        end,
        title =
        {
            text = SI_GUILD_WEEKLY_BIDS_TITLE,
        },
        finishedCallback = function(dialog)
            EVENT_MANAGER:UnregisterForEvent("ZO_GuildWeeklyBidsDialog_Keyboard", EVENT_GUILD_PLAYER_RANK_CHANGED, OnGuildPermissionChanged)
            EVENT_MANAGER:UnregisterForEvent("ZO_GuildWeeklyBidsDialog_Keyboard", EVENT_GUILD_SELF_LEFT_GUILD, OnGuildPermissionChanged)
        end,
        buttons =
        {       
            {
                control = control:GetNamedChild("Close"),
                text = SI_DIALOG_CLOSE,
                keybind = "DIALOG_NEGATIVE",
            },
        }
    })
end
function ZO_GuildWeeklyBidsDialog_Keyboard:DialogSetup(data)
    self.guildId = data.guildId
end
function ZO_GuildWeeklyBidsDialog_Keyboard:SetWeeklyBidLimitText(text)
    local weeklyBidsLabel = self.control:GetNamedChild("WeeklyBids")
    weeklyBidsLabel:SetText(zo_strformat(SI_GUILD_WEEKLY_BIDS_KEYBOARD_COUNT, text))
end
    GUILD_WEEKLY_BIDS_DIALOG =  ZO_GuildWeeklyBidsDialog_Keyboard:New(self)
end