Revert param removal of delete beatmap and clear scores methods

This commit is contained in:
Joseph Madamba 2023-09-05 18:23:11 -07:00
parent 4cd4eb3b0a
commit 9f10082ffc
No known key found for this signature in database
GPG Key ID: 8B746C7BDDF0BD76
2 changed files with 13 additions and 13 deletions

View File

@ -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());

View File

@ -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
}
/// <summary>
/// Request to delete the current beatmap.
/// Request to delete a specific beatmap.
/// </summary>
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));
}
/// <summary>
/// Request to clear the scores of the current beatmap.
/// Request to clear the scores of a specific beatmap.
/// </summary>
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;
}