Back to Home

ESO Lua File v101042

ingame/leaderboards/keyboard/battlegroundleaderboards_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
ZO_BattlegroundLeaderboardsManager_Keyboard = ZO_BattlegroundLeaderboardsManager_Shared:Subclass()
function ZO_BattlegroundLeaderboardsManager_Keyboard:Initialize(control)
    BATTLEGROUND_LEADERBOARD_FRAGMENT = ZO_FadeSceneFragment:New(control)
    self.currentScoreLabel = control:GetNamedChild("CurrentScore")
    self.currentRankLabel = control:GetNamedChild("CurrentRank")
    self.timerLabel = control:GetNamedChild("Timer")
    
    ZO_BattlegroundLeaderboardsManager_Shared.Initialize(self, control, LEADERBOARDS, LEADERBOARDS_SCENE, BATTLEGROUND_LEADERBOARD_FRAGMENT)
    BATTLEGROUND_LEADERBOARD_FRAGMENT:RegisterCallback("StateChange", function(oldState, newState)
        if newState == SCENE_FRAGMENT_SHOWING then
            self:UpdatePlayerInfo()
        end
    end)
    SYSTEMS:RegisterKeyboardObject(ZO_BATTLEGROUND_LEADERBOARD_SYSTEM_NAME, self)
end
function ZO_BattlegroundLeaderboardsManager_Keyboard:RefreshHeaderPlayerInfo(isWeekly)
    local displayedScore = self.currentScoreData or GetString(SI_LEADERBOARDS_NO_CURRENT_SCORE)
    self.currentScoreLabel:SetText(zo_strformat(SI_LEADERBOARDS_CURRENT_SCORE, displayedScore))
    local rankingTypeText = GetString("SI_LEADERBOARDTYPE", LEADERBOARD_LIST_MANAGER.leaderboardRankType)
    local displayedRank = self.currentRankData or GetString(SI_LEADERBOARDS_NOT_RANKED)
    self.currentRankLabel:SetText(zo_strformat(SI_LEADERBOARDS_CURRENT_RANK, rankingTypeText, displayedRank))
end
function ZO_BattlegroundLeaderboardsManager_Keyboard:RefreshHeaderTimer()
    if self.timerLabelData then
        self.timerLabel:SetText(zo_strformat(self.timerLabelIdentifier, self.timerLabelData))
    else
        self.timerLabel:SetText("")
    end
end
    BATTLEGROUND_LEADERBOARDS = ZO_BattlegroundLeaderboardsManager_Keyboard:New(self)
end