Back to Home

ESO Lua File v100027

ingame/campaign/currentcampaigns.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
local CURRENT_CAMPAIGNS
CurrentCampaigns = ZO_Object:Subclass()
function CurrentCampaigns:New(control)
    local manager = ZO_Object.New(self)
    manager.control = control
    manager.assigned = GetControl(control, "Assigned")
    control:RegisterForEvent(EVENT_ASSIGNED_CAMPAIGN_CHANGED, function(_, assignedCampaignId) self:RefreshCampaign(assignedCampaignId, manager.assigned) end)
    manager:RefreshCampaigns()
    return manager
end
function CurrentCampaigns:RefreshCampaigns()
end
function CurrentCampaigns:RefreshCampaign(campaignId, label)
    label:SetText(ZO_CurrentCampaigns_GetName(campaignId))
end
function ZO_CurrentCampaigns_GetName(campaignId)
    local campaignName
    if campaignId ~= 0 then
        campaignName = ZO_CachedStrFormat(SI_CAMPAIGN_NAME, GetCampaignName(campaignId))
    else
        campaignName = GetString(SI_UNASSIGNED_CAMPAIGN)
    end
    return campaignName
end
    CURRENT_CAMPAIGNS = CurrentCampaigns:New(self)
end