1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-09 21:27:18 +08:00

Fix daily challenge results screen beginning score fetch from user highest

This commit is contained in:
Salman Alshamrani 2024-11-23 15:45:29 -05:00
parent 63c2ddb99e
commit eed02c2ab1
2 changed files with 42 additions and 1 deletions

View File

@ -532,7 +532,7 @@ namespace osu.Game.Screens.OnlinePlay.DailyChallenge
private void startPlay()
{
sampleStart?.Play();
this.Push(new PlayerLoader(() => new PlaylistsPlayer(room, playlistItem)
this.Push(new PlayerLoader(() => new DailyChallengePlayer(room, playlistItem)
{
Exited = () => Scheduler.AddOnce(() => leaderboard.RefetchScores())
}));

View File

@ -0,0 +1,41 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Diagnostics;
using osu.Game.Online.Rooms;
using osu.Game.Scoring;
using osu.Game.Screens.OnlinePlay.Playlists;
using osu.Game.Screens.Play;
using osu.Game.Screens.Ranking;
namespace osu.Game.Screens.OnlinePlay.DailyChallenge
{
public partial class DailyChallengePlayer : PlaylistsPlayer
{
public DailyChallengePlayer(Room room, PlaylistItem playlistItem, PlayerConfiguration? configuration = null)
: base(room, playlistItem, configuration)
{
}
protected override ResultsScreen CreateResults(ScoreInfo score)
{
Debug.Assert(Room.RoomID != null);
if (score.OnlineID >= 0)
{
return new PlaylistItemScoreResultsScreen(Room.RoomID.Value, PlaylistItem, score.OnlineID)
{
AllowRetry = true,
ShowUserStatistics = true,
};
}
// If the score has failed submission, fall back to displaying scores from user's highest.
return new PlaylistItemUserResultsScreen(score, Room.RoomID.Value, PlaylistItem)
{
AllowRetry = true,
ShowUserStatistics = true,
};
}
}
}