Skip to content

Commit

Permalink
Fix RequestChartLeaderboard callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
nico-abram committed Nov 24, 2018
1 parent cfc8edc commit dbaa975
Show file tree
Hide file tree
Showing 8 changed files with 223 additions and 197 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,20 @@ local jdgs = {

local function arbitraryLeaderboardSpacing(value)
for i, entry in ipairs(entryActors) do
entry.container:addy((i-1) * value)
entry.container:addy((i - 1) * value)
end
if allowedCustomization then
Movable.DeviceButton_s.Border:playcommand("ChangeHeight", {val = entryActors[#entryActors].container:GetY() + ENTRY_HEIGHT})
Movable.DeviceButton_s.Border:playcommand(
"ChangeHeight",
{val = entryActors[#entryActors].container:GetY() + ENTRY_HEIGHT}
)
end
end

if not DLMAN:GetCurrentRateFilter() then
DLMAN:ToggleRateFilter()
end
local onlineScores = DLMAN:RequestChartLeaderBoard(GAMESTATE:GetCurrentSteps(PLAYER_1):GetChartKey())
local onlineScores = DLMAN:GetChartLeaderBoard(GAMESTATE:GetCurrentSteps(PLAYER_1):GetChartKey())
local sortFunction = function(h1, h2)
return h1[CRITERIA](h1) > h2[CRITERIA](h2)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,21 @@ t[#t + 1] =
end
end,
PlayingSampleMusicMessageCommand = function(self)
local leaderboardEnabled = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).leaderboardEnabled and DLMAN:IsLoggedIn()
local leaderboardEnabled =
playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).leaderboardEnabled and DLMAN:IsLoggedIn()
if leaderboardEnabled then
local chartkey = GAMESTATE:GetCurrentSteps(PLAYER_1):GetChartKey()
DLMAN:RequestChartLeaderBoardFromOnline(chartkey)
DLMAN:RequestChartLeaderBoardFromOnline(
chartkey,
function(leaderboard)
end
)
end
end,
ChartPreviewOnMessageCommand=function(self)
ChartPreviewOnMessageCommand = function(self)
self:addx(capWideScale(12, 0)):addy(capWideScale(18, 0))
end,
ChartPreviewOffMessageCommand=function(self)
ChartPreviewOffMessageCommand = function(self)
self:addx(capWideScale(-12, 0)):addy(capWideScale(-18, 0))
end,
Def.StepsDisplayList {
Expand All @@ -74,15 +79,13 @@ t[#t + 1] =
end
}
},
CursorP2 = Def.ActorFrame {
},
CursorP2 = Def.ActorFrame {},
CursorP1Frame = Def.Actor {
ChangeCommand = function(self)
self:stoptweening():decelerate(0.05)
end
},
CursorP2Frame = Def.Actor {
},
CursorP2Frame = Def.Actor {}
}
}

Expand Down
Loading

0 comments on commit dbaa975

Please sign in to comment.