Add a button to restore all hidden difficulties

This commit is contained in:
Dean Herbert 2017-09-01 18:26:01 +09:00
parent 3d61cde266
commit 8e0d18d36f

View File

@ -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));
}
},
};
}
}