From 9f10082ffcf292ec421a085acd815368f88c8f6f Mon Sep 17 00:00:00 2001 From: Joseph Madamba Date: Tue, 5 Sep 2023 18:23:11 -0700 Subject: [PATCH] Revert param removal of delete beatmap and clear scores methods --- .../Select/FooterV2/BeatmapOptionsPopover.cs | 4 ++-- osu.Game/Screens/Select/SongSelect.cs | 22 +++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/osu.Game/Screens/Select/FooterV2/BeatmapOptionsPopover.cs b/osu.Game/Screens/Select/FooterV2/BeatmapOptionsPopover.cs index 550b3e5cf6..91f315f0d3 100644 --- a/osu.Game/Screens/Select/FooterV2/BeatmapOptionsPopover.cs +++ b/osu.Game/Screens/Select/FooterV2/BeatmapOptionsPopover.cs @@ -54,13 +54,13 @@ namespace osu.Game.Screens.Select.FooterV2 addButton(@"Manage collections", FontAwesome.Solid.Book, () => manageCollectionsDialog?.Show()); addHeader("For all difficulties", beatmapWhenOpening.BeatmapSetInfo.ToString()); - addButton(@"Delete beatmap", FontAwesome.Solid.Trash, () => songSelect?.DeleteBeatmap(), colours.Red1); + addButton(@"Delete beatmap", FontAwesome.Solid.Trash, () => songSelect?.DeleteBeatmap(beatmapWhenOpening.BeatmapSetInfo), colours.Red1); addHeader("For selected difficulty", beatmapWhenOpening.BeatmapInfo.DifficultyName); // TODO: make work, and make show "unplayed" or "played" based on status. addButton(@"Mark as played", FontAwesome.Regular.TimesCircle, null); addButton(@"Hide", FontAwesome.Solid.Magic, null); - addButton(@"Clear all local scores", FontAwesome.Solid.Eraser, () => songSelect?.ClearScores(), colours.Red1); + addButton(@"Clear all local scores", FontAwesome.Solid.Eraser, () => songSelect?.ClearScores(beatmapWhenOpening.BeatmapInfo), colours.Red1); if (songSelect != null && songSelect.AllowEditing) addButton(@"Edit beatmap", FontAwesome.Solid.PencilAlt, () => songSelect.Edit()); diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index f6fc55b2a5..cca18b93af 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -311,9 +311,9 @@ namespace osu.Game.Screens.Select Footer.AddButton(button, overlay); BeatmapOptions.AddButton(@"Manage", @"collections", FontAwesome.Solid.Book, colours.Green, () => manageCollectionsDialog?.Show()); - BeatmapOptions.AddButton(@"Delete", @"all difficulties", FontAwesome.Solid.Trash, colours.Pink, DeleteBeatmap); + BeatmapOptions.AddButton(@"Delete", @"all difficulties", FontAwesome.Solid.Trash, colours.Pink, () => DeleteBeatmap(Beatmap.Value.BeatmapSetInfo)); BeatmapOptions.AddButton(@"Remove", @"from unplayed", FontAwesome.Regular.TimesCircle, colours.Purple, null); - BeatmapOptions.AddButton(@"Clear", @"local scores", FontAwesome.Solid.Eraser, colours.Purple, ClearScores); + BeatmapOptions.AddButton(@"Clear", @"local scores", FontAwesome.Solid.Eraser, colours.Purple, () => ClearScores(Beatmap.Value.BeatmapInfo)); } sampleChangeDifficulty = audio.Samples.Get(@"SongSelect/select-difficulty"); @@ -917,23 +917,23 @@ namespace osu.Game.Screens.Select } /// - /// Request to delete the current beatmap. + /// Request to delete a specific beatmap. /// - public void DeleteBeatmap() + public void DeleteBeatmap(BeatmapSetInfo? beatmap) { - if (Beatmap.Value.BeatmapSetInfo == null) return; + if (beatmap == null) return; - dialogOverlay?.Push(new BeatmapDeleteDialog(Beatmap.Value.BeatmapSetInfo)); + dialogOverlay?.Push(new BeatmapDeleteDialog(beatmap)); } /// - /// Request to clear the scores of the current beatmap. + /// Request to clear the scores of a specific beatmap. /// - public void ClearScores() + public void ClearScores(BeatmapInfo? beatmapInfo) { - if (Beatmap.Value.BeatmapInfo == null) return; + if (beatmapInfo == null) return; - dialogOverlay?.Push(new BeatmapClearScoresDialog(Beatmap.Value.BeatmapInfo, () => + dialogOverlay?.Push(new BeatmapClearScoresDialog(beatmapInfo, () => // schedule done here rather than inside the dialog as the dialog may fade out and never callback. Schedule(() => BeatmapDetails.Refresh()))); } @@ -969,7 +969,7 @@ namespace osu.Game.Screens.Select if (e.ShiftPressed) { if (!Beatmap.IsDefault) - DeleteBeatmap(); + DeleteBeatmap(Beatmap.Value.BeatmapSetInfo); return true; }