From 06ff858256f1dac610e1daece956252d4a281d4f Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 7 Aug 2024 14:40:52 +0900 Subject: [PATCH 1/3] Fix `PresentBeatmap` sometimes favouring an already `DeletePending` beatmap --- osu.Game/OsuGame.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 53b2fd5904..7e4d2ccf39 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -642,10 +642,10 @@ namespace osu.Game Live databasedSet = null; if (beatmap.OnlineID > 0) - databasedSet = BeatmapManager.QueryBeatmapSet(s => s.OnlineID == beatmap.OnlineID); + databasedSet = BeatmapManager.QueryBeatmapSet(s => s.OnlineID == beatmap.OnlineID && !s.DeletePending); if (beatmap is BeatmapSetInfo localBeatmap) - databasedSet ??= BeatmapManager.QueryBeatmapSet(s => s.Hash == localBeatmap.Hash); + databasedSet ??= BeatmapManager.QueryBeatmapSet(s => s.Hash == localBeatmap.Hash && !s.DeletePending); if (databasedSet == null) { From 5a63c25f4956b042259e77a3a42d48103393201a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 7 Aug 2024 14:42:34 +0900 Subject: [PATCH 2/3] Fix clicking the beatmap import notification at the daily challenge screen exiting to main menu --- .../DailyChallenge/DailyChallenge.cs | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/OnlinePlay/DailyChallenge/DailyChallenge.cs b/osu.Game/Screens/OnlinePlay/DailyChallenge/DailyChallenge.cs index da2d9036c5..c1e1142625 100644 --- a/osu.Game/Screens/OnlinePlay/DailyChallenge/DailyChallenge.cs +++ b/osu.Game/Screens/OnlinePlay/DailyChallenge/DailyChallenge.cs @@ -44,7 +44,7 @@ using osuTK; namespace osu.Game.Screens.OnlinePlay.DailyChallenge { [Cached(typeof(IPreviewTrackOwner))] - public partial class DailyChallenge : OsuScreen, IPreviewTrackOwner + public partial class DailyChallenge : OsuScreen, IPreviewTrackOwner, IHandlePresentBeatmap { private readonly Room room; private readonly PlaylistItem playlistItem; @@ -546,5 +546,23 @@ namespace osu.Game.Screens.OnlinePlay.DailyChallenge if (metadataClient.IsNotNull()) 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. + } } } From cfd7f96e76cbece16f096f0cbe518249b57ce471 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 7 Aug 2024 23:29:24 +0900 Subject: [PATCH 3/3] Add missing exit line causing completely incorrect behaviour --- osu.Game/Screens/OnlinePlay/DailyChallenge/DailyChallenge.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Screens/OnlinePlay/DailyChallenge/DailyChallenge.cs b/osu.Game/Screens/OnlinePlay/DailyChallenge/DailyChallenge.cs index c1e1142625..e915fdc8ec 100644 --- a/osu.Game/Screens/OnlinePlay/DailyChallenge/DailyChallenge.cs +++ b/osu.Game/Screens/OnlinePlay/DailyChallenge/DailyChallenge.cs @@ -559,6 +559,7 @@ namespace osu.Game.Screens.OnlinePlay.DailyChallenge // If the import was for a different beatmap, pass the duty off to global handling. if (beatmap.BeatmapSetInfo.OnlineID != playlistItem.Beatmap.BeatmapSet!.OnlineID) { + this.Exit(); game?.PresentBeatmap(beatmap.BeatmapSetInfo, b => b.ID == beatmap.BeatmapInfo.ID); }