Back to Home

ESO Lua File v100020

ingame/leaderboards/leaderboardbase_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
44
45
46
47
48
49
50
51
52
53
-----------------
-- Base Leaderboard Object
-----------------
ZO_LeaderboardBase_Shared = ZO_Object:Subclass()
function ZO_LeaderboardBase_Shared:New(...)
    local manager = ZO_Object.New(self)
    manager:Initialize(...)
    return manager
end
function ZO_LeaderboardBase_Shared:Initialize(control, leaderboardSystem, leaderboardScene, fragment)
    self.control = control
    self.leaderboardSystem = leaderboardSystem
    self.leaderboardScene = leaderboardScene
    self.fragment = fragment
    self.scoringInfoText = ""
    self.timerLabelIdentifier = nil
    self.currentScoreData = nil
    self.currentRankData = nil
    self.timerLabelData = nil   
end
function ZO_LeaderboardBase_Shared:OnDataChanged()
    self.leaderboardSystem:UpdateCategories()
    self.leaderboardSystem:OnLeaderboardDataChanged(self)
end
function ZO_LeaderboardBase_Shared:OnSelected()
    self.leaderboardScene:AddFragment(self.fragment)
end
function ZO_LeaderboardBase_Shared:OnUnselected()
    self.leaderboardScene:RemoveFragment(self.fragment)
end
function ZO_LeaderboardBase_Shared:OnSubtypeSelected(subType)
    self.selectedSubType = subType
end
function ZO_LeaderboardBase_Shared:TryAddKeybind()
    if self.keybind then
        KEYBIND_STRIP:AddKeybindButton(self.keybind)
    end
end
function ZO_LeaderboardBase_Shared:TryRemoveKeybind()
    if self.keybind then
        KEYBIND_STRIP:RemoveKeybindButton(self.keybind)
    end
end