Skip to content

Commit

Permalink
harmonyhelper fix (#38)
Browse files Browse the repository at this point in the history
harmonyhelper is separate per mod
  • Loading branch information
amazingalek committed Dec 30, 2019
1 parent 7ebe337 commit b08e1d0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
3 changes: 1 addition & 2 deletions OWML.ModLoader/ModLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ public static void LoadMods()
logger.Log("Got config!");
var console = new ModConsole(config, logger);
console.WriteLine("Mod loader has been initialized.");
var harmonyHelper = new HarmonyHelper(logger, console);
var modFinder = new ModFinder(config);
var owo = new Owo(modFinder, logger, console, config, harmonyHelper);
var owo = new Owo(modFinder, logger, console, config);
owo.LoadMods();
}

Expand Down
9 changes: 4 additions & 5 deletions OWML.ModLoader/Owo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,13 @@ internal class Owo
private readonly IModLogger _logger;
private readonly IModConsole _console;
private readonly IModConfig _config;
private readonly IHarmonyHelper _harmonyHelper;

public Owo(IModFinder modFinder, IModLogger logger, IModConsole console, IModConfig config, IHarmonyHelper harmonyHelper)
public Owo(IModFinder modFinder, IModLogger logger, IModConsole console, IModConfig config)
{
_modFinder = modFinder;
_logger = logger;
_console = console;
_config = config;
_harmonyHelper = harmonyHelper;
}

public void LoadMods()
Expand All @@ -45,8 +43,9 @@ private IModHelper CreateModHelper(IModManifest manifest)
{
var assets = new ModAssets(_console, manifest);
var storage = new ModStorage(manifest);
var events = new ModEvents(_harmonyHelper);
return new ModHelper.ModHelper(_config, _logger, _console, events, _harmonyHelper, assets, storage, manifest);
var harmonyHelper = new HarmonyHelper(_logger, _console);
var events = new ModEvents(harmonyHelper);
return new ModHelper.ModHelper(_config, _logger, _console, events, harmonyHelper, assets, storage, manifest);
}

private void OnLogMessageReceived(string message, string stackTrace, LogType type)
Expand Down

0 comments on commit b08e1d0

Please sign in to comment.