Offer to import skins on first startup

This commit is contained in:
Dean Herbert 2018-08-31 18:36:35 +09:00
parent e67f63eab6
commit fa569e5ae4
2 changed files with 8 additions and 3 deletions

View File

@ -12,7 +12,7 @@ public class ImportFromStablePopup : PopupDialog
public ImportFromStablePopup(Action importFromStable)
{
HeaderText = @"You have no beatmaps!";
BodyText = "An existing copy of osu! was found, though.\nWould you like to import your beatmaps?";
BodyText = "An existing copy of osu! was found, though.\nWould you like to import your beatmaps (and skins)?";
Icon = FontAwesome.fa_plane;

View File

@ -19,6 +19,7 @@
using osu.Game.Screens.Edit;
using osu.Game.Screens.Play;
using osu.Game.Screens.Ranking;
using osu.Game.Skinning;
namespace osu.Game.Screens.Select
{
@ -54,7 +55,7 @@ public PlaySongSelect()
private readonly Bindable<IEnumerable<Mod>> selectedMods = new Bindable<IEnumerable<Mod>>(new Mod[] { });
[BackgroundDependencyLoader(true)]
private void load(OsuColour colours, AudioManager audio, BeatmapManager beatmaps, DialogOverlay dialogOverlay, Bindable<IEnumerable<Mod>> selectedMods)
private void load(OsuColour colours, AudioManager audio, BeatmapManager beatmaps, SkinManager skins, DialogOverlay dialogOverlay, Bindable<IEnumerable<Mod>> selectedMods)
{
if (selectedMods != null) this.selectedMods.BindTo(selectedMods);
@ -76,7 +77,11 @@ private void load(OsuColour colours, AudioManager audio, BeatmapManager beatmaps
{
// if we have no beatmaps but osu-stable is found, let's prompt the user to import.
if (!beatmaps.GetAllUsableBeatmapSets().Any() && beatmaps.StableInstallationAvailable)
dialogOverlay.Push(new ImportFromStablePopup(() => beatmaps.ImportFromStableAsync()));
dialogOverlay.Push(new ImportFromStablePopup(() =>
{
beatmaps.ImportFromStableAsync();
skins.ImportFromStableAsync();
}));
});
}
}