mirror of
https://github.com/ppy/osu
synced 2025-01-05 21:59:46 +00:00
Add a button to restore all hidden difficulties
This commit is contained in:
parent
3d61cde266
commit
8e0d18d36f
@ -13,6 +13,7 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance
|
||||
{
|
||||
private OsuButton importButton;
|
||||
private OsuButton deleteButton;
|
||||
private OsuButton restoreButton;
|
||||
|
||||
protected override string Header => "General";
|
||||
|
||||
@ -41,6 +42,20 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance
|
||||
Task.Run(() => beatmaps.DeleteAll()).ContinueWith(t => Schedule(() => deleteButton.Enabled.Value = true));
|
||||
}
|
||||
},
|
||||
restoreButton = new OsuButton
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Text = "Restore all hidden difficulties",
|
||||
Action = () =>
|
||||
{
|
||||
restoreButton.Enabled.Value = false;
|
||||
Task.Run(() =>
|
||||
{
|
||||
foreach (var b in beatmaps.QueryBeatmaps(b => b.Hidden))
|
||||
beatmaps.Restore(b);
|
||||
}).ContinueWith(t => Schedule(() => restoreButton.Enabled.Value = true));
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user