Skip to content

Commit 2cdb5b5

Browse files
fix scoreboard oncommand being inherited improperly from scores.lua
leading to redundant/unintentional leaderboard requests
1 parent e1d1f0e commit 2cdb5b5

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/score.lua

+10-11
Original file line numberDiff line numberDiff line change
@@ -84,20 +84,26 @@ local function highlightIfOver(self)
8484
self:diffusealpha(1)
8585
end
8686
end
87-
87+
local moped
8888
-- Only works if ... it should work
8989
-- You know, if we can see the place where the scores should be.
9090
local function updateLeaderBoardForCurrentChart()
9191
local top = SCREENMAN:GetTopScreen()
9292
if top:GetMusicWheel():IsSettled() and ((getTabIndex() == 2 and nestedTab == 2) or collapsed) then
93-
local chartkey = GAMESTATE:GetCurrentSteps(PLAYER_1):GetChartKey()
94-
DLMAN:RequestChartLeaderBoardFromOnline(chartkey)
93+
local steps = GAMESTATE:GetCurrentSteps(PLAYER_1)
94+
if steps then
95+
DLMAN:RequestChartLeaderBoardFromOnline(steps:GetChartKey())
96+
moped:queuecommand("ChartLeaderboardUpdate")
97+
else
98+
moped:queuecommand("Bort")
99+
end
95100
end
96101
end
97102

98103
local ret =
99104
Def.ActorFrame {
100105
BeginCommand = function(self)
106+
moped = self:GetChild("ScoreDisplay")
101107
self:queuecommand("Set"):visible(false)
102108
self:GetChild("LocalScores"):xy(frameX, frameY):visible(false)
103109
self:GetChild("ScoreDisplay"):xy(frameX, frameY):visible(false)
@@ -143,9 +149,6 @@ local ret =
143149
self:queuecommand("Set")
144150
updateLeaderBoardForCurrentChart()
145151
end,
146-
UpdateChartMessageCommand = function(self)
147-
self:queuecommand("Set")
148-
end,
149152
CollapseCommand = function(self)
150153
collapsed = true
151154
resetTabIndex()
@@ -173,7 +176,7 @@ local ret =
173176
end,
174177
CurrentRateChangedMessageCommand = function(self)
175178
if ((getTabIndex() == 2 and nestedTab == 2) or collapsed) and DLMAN:GetCurrentRateFilter() then
176-
MESSAGEMAN:Broadcast("ChartLeaderboardUpdate")
179+
moped:queuecommand("ChartLeaderboardUpdate")
177180
end
178181
end
179182
}
@@ -702,7 +705,6 @@ function nestedTabButton(i)
702705
if isOver(self) then
703706
nestedTab = i
704707
MESSAGEMAN:Broadcast("NestedTabChanged")
705-
MESSAGEMAN:Broadcast("ChartLeaderboardUpdate")
706708
if nestedTab == 1 then
707709
self:GetParent():GetParent():GetChild("ScoreDisplay"):visible(false)
708710
self:GetParent():GetParent():GetParent():GetChild("StepsDisplay"):visible(true)
@@ -711,9 +713,6 @@ function nestedTabButton(i)
711713
self:GetParent():GetParent():GetParent():GetChild("StepsDisplay"):visible(false)
712714
end
713715
end
714-
end,
715-
NestedTabChangedMessageCommand = function(self)
716-
self:queuecommand("Set")
717716
end
718717
}
719718
}

Themes/Til Death/BGAnimations/superscoreboard.lua

+5-4
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,16 @@ local o =
103103
BeginCommand = function(self)
104104
SCREENMAN:GetTopScreen():AddInputCallback(input)
105105
end,
106-
OnCommand = function(self)
107-
GetPlayerOrMachineProfile(PLAYER_1):SetFromAll()
108-
self:queuecommand("ChartLeaderboardUpdate")
109-
end,
110106
ChartLeaderboardUpdateMessageCommand = function(self)
111107
scoretable = DLMAN:RequestChartLeaderBoard(GAMESTATE:GetCurrentSteps(PLAYER_1):GetChartKey(), currentCountry)
112108
ind = 0
113109
self:playcommand("Update")
114110
end,
111+
BortCommand = function(self)
112+
scoretable = {}
113+
ind = 0
114+
self:playcommand("Update")
115+
end,
115116
UpdateCommand = function(self)
116117
if ind == #scoretable then
117118
ind = ind - numscores

0 commit comments

Comments
 (0)