Add basic score import from stable

This commit is contained in:
HoLLy
2019-06-19 18:33:51 +02:00
parent 82515a52fe
commit 15c75b4442
6 changed files with 54 additions and 7 deletions

View File

@ -22,7 +22,9 @@ namespace osu.Game.Scoring
protected override string[] HashableFileTypes => new[] { ".osr" };
protected override string ImportFromStablePath => "Replays";
protected override string ImportFromStablePath => @"Data\r";
protected override bool StableDirectoryBased => false;
private readonly RulesetStore rulesets;
private readonly Func<BeatmapManager> beatmaps;
@ -36,10 +38,12 @@ namespace osu.Game.Scoring
protected override ScoreInfo CreateModel(ArchiveReader archive)
{
if (archive == null)
string filename = archive?.Filenames.FirstOrDefault(f => f.EndsWith(".osr"));
if (filename == null)
return null;
using (var stream = archive.GetStream(archive.Filenames.First(f => f.EndsWith(".osr"))))
using (var stream = archive.GetStream(filename))
{
try
{