Don't attempt to import command line arguments as beatmaps.

This commit is contained in:
Dean Herbert
2017-02-12 14:53:33 +09:00
parent 49ae976af6
commit 870aa2750f
2 changed files with 60 additions and 54 deletions

View File

@ -24,6 +24,7 @@ using osu.Game.Screens.Menu;
using OpenTK;
using System.Linq;
using osu.Framework.Graphics.Primitives;
using System.Collections.Generic;
namespace osu.Game
{
@ -67,14 +68,17 @@ namespace osu.Game
}
if (args?.Length > 0)
ImportBeatmaps(args);
{
var paths = args.Where(a => !a.StartsWith(@"-"));
ImportBeatmaps(paths);
}
Dependencies.Cache(this);
PlayMode = LocalConfig.GetBindable<PlayMode>(OsuConfig.PlayMode);
}
public void ImportBeatmaps(params string[] paths)
public void ImportBeatmaps(IEnumerable<string> paths)
{
Schedule(delegate { Dependencies.Get<BeatmapDatabase>().Import(paths); });
}