From 2559c7ac8b6f1a0e61dfadfeb0f3b4cfe993b992 Mon Sep 17 00:00:00 2001 From: Hivie Date: Sat, 9 Aug 2025 13:13:47 +0100 Subject: [PATCH] add working beatmapset difficulties to verifier context --- .../Rulesets/Edit/BeatmapVerifierContext.cs | 28 ++++++++++++------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/osu.Game/Rulesets/Edit/BeatmapVerifierContext.cs b/osu.Game/Rulesets/Edit/BeatmapVerifierContext.cs index faa5457d65..24f162cfd2 100644 --- a/osu.Game/Rulesets/Edit/BeatmapVerifierContext.cs +++ b/osu.Game/Rulesets/Edit/BeatmapVerifierContext.cs @@ -28,16 +28,22 @@ namespace osu.Game.Rulesets.Edit public DifficultyRating InterpretedDifficulty; /// - /// All beatmap difficulties in the same beatmapset, including the current beatmap. + /// All playable beatmap difficulties in the same beatmapset, including the current beatmap. /// public readonly IReadOnlyList BeatmapsetDifficulties; - public BeatmapVerifierContext(IBeatmap beatmap, IWorkingBeatmap workingBeatmap, DifficultyRating difficultyRating = DifficultyRating.ExpertPlus, IReadOnlyList? beatmapsetDifficulties = null) + /// + /// The working beatmapset difficulties, including the current working beatmap. + /// + public readonly IReadOnlyList WorkingBeatmapsetDifficulties; + + public BeatmapVerifierContext(IBeatmap beatmap, IWorkingBeatmap workingBeatmap, DifficultyRating difficultyRating = DifficultyRating.ExpertPlus, IReadOnlyList? beatmapsetDifficulties = null, IReadOnlyList? workingBeatmapsetDifficulties = null) { Beatmap = beatmap; WorkingBeatmap = workingBeatmap; InterpretedDifficulty = difficultyRating; BeatmapsetDifficulties = beatmapsetDifficulties ?? new List { beatmap }; + WorkingBeatmapsetDifficulties = workingBeatmapsetDifficulties ?? new List { workingBeatmap }; } public static BeatmapVerifierContext Create(IBeatmap beatmap, IWorkingBeatmap workingBeatmap, DifficultyRating difficultyRating = DifficultyRating.ExpertPlus, BeatmapManager? beatmapManager = null) @@ -50,6 +56,7 @@ namespace osu.Game.Rulesets.Edit } var difficulties = new List(); + var workingDifficulties = new List(); foreach (var beatmapInfo in beatmapSet.Beatmaps) { @@ -57,20 +64,21 @@ namespace osu.Game.Rulesets.Edit if (beatmapInfo.Equals(beatmap.BeatmapInfo)) { difficulties.Add(beatmap); + workingDifficulties.Add(workingBeatmap); continue; } // Resolve other difficulties using BeatmapManager if available - if (beatmapManager != null) - { - var working = beatmapManager.GetWorkingBeatmap(beatmapInfo); - var playable = working.GetPlayableBeatmap(beatmapInfo.Ruleset); - if (playable != null) - difficulties.Add(playable); - } + var working = beatmapManager?.GetWorkingBeatmap(beatmapInfo); + if (working != null) + workingDifficulties.Add(working); + + var playable = working?.GetPlayableBeatmap(beatmapInfo.Ruleset); + if (playable != null) + difficulties.Add(playable); } - return new BeatmapVerifierContext(beatmap, workingBeatmap, difficultyRating, difficulties); + return new BeatmapVerifierContext(beatmap, workingBeatmap, difficultyRating, difficulties, workingDifficulties); } } }