Back to Home

ESO Lua File v100036

ingame/guildfinder/guildbrowser_applications_shared.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
------------------
-- Guild Finder --
------------------
ZO_GUILD_BROWSER_APPLICATIONS_ENTRY_SORT_KEYS =
{
    ["guildName"] = { },
    ["durationS"] = { tiebreaker = "guildName" },
}
ZO_GuildBrowser_Applications_Shared = ZO_GuildFinder_Panel_Shared:Subclass()
function ZO_GuildBrowser_Applications_Shared:New(...)
    return ZO_GuildFinder_Panel_Shared.New(self, ...)
end
function ZO_GuildBrowser_Applications_Shared:Initialize(control)
    ZO_GuildFinder_Panel_Shared.Initialize(self, control)
    local function OnAccountApplicationResultsReady()
        if self:GetFragment():IsShowing() then
            self:RefreshData()
        end
    end
    GUILD_BROWSER_MANAGER:RegisterCallback("OnApplicationsChanged", OnAccountApplicationResultsReady)
end
function ZO_GuildBrowser_Applications_Shared:OnShowing()
    self:RefreshData()
end
function ZO_GuildBrowser_Applications_Shared:SetupRow(control, data)
    ZO_SortFilterList.SetupRow(self, control, data)
    local guildNameLabel = control:GetNamedChild("Name")
    local expirationLabel = control:GetNamedChild("Expires")
    local guildInfo = ZO_AllianceIconNameFormatter(data.guildAlliance, data.guildName)
    guildNameLabel:SetText(guildInfo)
    local timeRemainingS = GetGuildFinderAccountApplicationDuration(data.index)
    expirationLabel:SetText(ZO_FormatCountdownTimer(timeRemainingS))
end