1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 15:12:57 +08:00

Fix clicking the beatmap import notification at the daily challenge screen exiting to main menu

This commit is contained in:
Dean Herbert 2024-08-07 14:42:34 +09:00
parent 43f1fe350d
commit 3c05b975a0
No known key found for this signature in database

View File

@ -44,7 +44,7 @@ using osuTK;
namespace osu.Game.Screens.OnlinePlay.DailyChallenge namespace osu.Game.Screens.OnlinePlay.DailyChallenge
{ {
[Cached(typeof(IPreviewTrackOwner))] [Cached(typeof(IPreviewTrackOwner))]
public partial class DailyChallenge : OsuScreen, IPreviewTrackOwner public partial class DailyChallenge : OsuScreen, IPreviewTrackOwner, IHandlePresentBeatmap
{ {
private readonly Room room; private readonly Room room;
private readonly PlaylistItem playlistItem; private readonly PlaylistItem playlistItem;
@ -546,5 +546,23 @@ namespace osu.Game.Screens.OnlinePlay.DailyChallenge
if (metadataClient.IsNotNull()) if (metadataClient.IsNotNull())
metadataClient.MultiplayerRoomScoreSet -= onRoomScoreSet; metadataClient.MultiplayerRoomScoreSet -= onRoomScoreSet;
} }
[Resolved]
private OsuGame? game { get; set; }
public void PresentBeatmap(WorkingBeatmap beatmap, RulesetInfo ruleset)
{
if (!this.IsCurrentScreen())
return;
// We can only handle the current daily challenge beatmap.
// If the import was for a different beatmap, pass the duty off to global handling.
if (beatmap.BeatmapSetInfo.OnlineID != playlistItem.Beatmap.BeatmapSet!.OnlineID)
{
game?.PresentBeatmap(beatmap.BeatmapSetInfo, b => b.ID == beatmap.BeatmapInfo.ID);
}
// And if we're handling, we don't really have much to do here.
}
} }
} }