Add option to import from osu-stable

Also adds an option to delete all beatmaps for testing purposes.
This commit is contained in:
Dean Herbert
2017-07-28 12:46:38 +09:00
parent e5306997dd
commit 7d4218ea6c
4 changed files with 70 additions and 0 deletions

View File

@ -390,5 +390,21 @@ namespace osu.Game.Beatmaps
catch { return new TrackVirtual(); }
}
}
public void ImportFromStable()
{
string stableInstallPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"osu!", "Songs");
if (!Directory.Exists(stableInstallPath))
stableInstallPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".osu", "Songs");
if (!Directory.Exists(stableInstallPath))
{
Logger.Log("Couldn't find an osu!stable installation!", LoggingTarget.Information, LogLevel.Error);
return;
}
Import(Directory.GetDirectories(stableInstallPath));
}
}
}