ESO Lua File v100010

ingame/leaderboards/keyboard/raidleaderboards_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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
local RAID_LEADERBOARD_FRAGMENT
local ZO_RaidLeaderboardsManager_Keyboard = ZO_RaidLeaderboardsManager_Shared:Subclass()
function ZO_RaidLeaderboardsManager_Keyboard:New(...)
    local manager = ZO_RaidLeaderboardsManager_Shared.New(self, ...)
    return manager
end
function ZO_RaidLeaderboardsManager_Keyboard:Initialize(control)
    RAID_LEADERBOARD_FRAGMENT = ZO_FadeSceneFragment:New(control)
    ZO_RaidLeaderboardsManager_Shared.Initialize(self, control, LEADERBOARDS, LEADERBOARDS_SCENE, RAID_LEADERBOARD_FRAGMENT)
    self.currentScoreLabel = GetControl(control, "CurrentScore")
    self.currentRankLabel = GetControl(control, "CurrentRank")
    self.scoringInfoLabel = GetControl(control, "ScoringInfo")
    self.timerLabel = GetControl(control, "Timer")
    self.activeScore = GetControl(control, "ActiveScore")
    self.raidListNodes = {}
    self.scoringInfoHelpIcon = GetControl(control, "ScoringInfoHelp")
    self.scoringInfoHelpIcon:SetParent(self.scoringInfoLabel)
    RAID_LEADERBOARD_FRAGMENT:RegisterCallback("StateChange", function(oldState, newState)
                                                 if newState == SCENE_FRAGMENT_SHOWING then
                                                     self:UpdatePlayerInfo()
                                                     self:UpdatePlayerParticipationStatus()
                                                     self:UpdateRaidScore()
                                                     QueryRaidLeaderboardData()
                                                 end
                                             end)
end
function ZO_RaidLeaderboardsManager_Keyboard:RefreshHeaderPlayerInfo(isWeekly)
    if self.currentScoreData then
        self.currentScoreLabel:SetText(zo_strformat(SI_RAID_LEADERBOARDS_BEST_SCORE, self.currentScoreData))
    else
        self.currentScoreLabel:SetText(GetString(SI_RAID_LEADERBOARDS_NO_SCORE_RECORDED))
    end
    if self.currentRankData then
        self.currentRankLabel:SetText(zo_strformat(SI_RAID_LEADERBOARDS_CURRENT_RANK, self.currentRankData))
    else
        self.currentRankLabel:SetText(GetString(SI_RAID_LEADERBOARDS_NOT_RANKED))
    end
    self.timerLabel:SetHidden(not isWeekly)
end
function ZO_RaidLeaderboardsManager_Keyboard:RefreshHeaderTimer()
    if self.timerLabelData then
        self.timerLabel:SetText(zo_strformat(self.timerLabelIdentifier, self.timerLabelData))
    else
        self.timerLabel:SetText("")
    end
end
function ZO_RaidLeaderboardsManager_Keyboard:RefreshHeaderScoringInfo()
    self.scoringInfoLabel:SetText(self.scoringInfoText)
end
function ZO_RaidLeaderboardsManager_Keyboard:RefreshActiveScore(showScore)
    self.activeScore:SetHidden(not showScore)
    if showScore then
        self.activeScore:SetText(GetCurrentRaidScore())
    end
end
    InitializeTooltip(InformationTooltip, control, TOPLEFT, 5, 0)
    SetTooltipText(InformationTooltip, GetString(SI_RAID_LEADERBOARDS_RANK_HELP_TOOLTIP))
end
    ClearTooltip(InformationTooltip)
end
    InitializeTooltip(InformationTooltip, control, TOPRIGHT, -5, 0)
    SetTooltipText(InformationTooltip, GetString(SI_RAID_LEADERBOARDS_PARTICIPATING_NOT_ELIGIBLE_HELP_TOOLTIP))
end
    ClearTooltip(InformationTooltip)
end
    RAID_LEADERBOARDS = ZO_RaidLeaderboardsManager_Keyboard:New(self)
    SYSTEMS:RegisterKeyboardObject(RAID_LEADERBOARD_SYSTEM_NAME, RAID_LEADERBOARDS)
end