Skip to content

Commit

Permalink
Prioritize Plugins usage for IMapDataFinder(s)
Browse files Browse the repository at this point in the history
  • Loading branch information
Piotrekol committed Jul 2, 2018
1 parent 172cdbd commit 714accc
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions osu!StreamCompanion/Code/Core/Initializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ public void Start()
}
_logger.Log("==========", LogLevel.Advanced);

ProritizePluginsUsage();
#endregion plugins

Settings.Add(_names.FirstRun.Name, false);
Expand All @@ -168,6 +169,21 @@ public void Start()
_logger.Log("Started!", LogLevel.Basic);
}

private void ProritizePluginsUsage()
{
var mapDataFindersCopy = new List<IMapDataFinder>(_mapDataFinders);
_mapDataFinders.Clear();
foreach (var finder in mapDataFindersCopy)
{
if(finder is IPlugin)
_mapDataFinders.Add(finder);
}
foreach (var finder in mapDataFindersCopy)
{
if (finder is IModule && !(finder is IPlugin))
_mapDataFinders.Add(finder);
}
}
private void LoadPlugin(IPlugin plugin)
{
_logger.Log("Loading: {0} by {1}", LogLevel.Advanced, plugin.Name, plugin.Author);
Expand Down

0 comments on commit 714accc

Please sign in to comment.