public static void LoadMods() { var owmlGo = new GameObject(); owmlGo.AddComponent <OwmlBehaviour>(); var owmlConfig = JsonHelper.LoadJsonObject <OwmlConfig>(ConfigPath); var owmlDefaultConfig = JsonHelper.LoadJsonObject <OwmlConfig>(DefaultConfigPath); var owmlManifest = JsonHelper.LoadJsonObject <ModManifest>(ManifestPath); if (owmlConfig == null || owmlManifest == null) { // Everything is wrong and can't write to console... return; } var logger = new ModLogger(owmlConfig, owmlManifest); logger.Log("Got config!"); var console = OutputFactory.CreateOutput(owmlConfig, logger, owmlManifest); console.WriteLine("Mod loader has been initialized."); var modSorter = new ModSorter(console); var modFinder = new ModFinder(owmlConfig, console); var harmonyHelper = new HarmonyHelper(logger, console); var events = new ModEvents(logger, console, harmonyHelper); var inputHandler = new ModInputHandler(logger, console, harmonyHelper, owmlConfig, events); var menus = new ModMenus(console, events, inputHandler, owmlManifest, owmlConfig, owmlDefaultConfig); var owo = new Owo(modFinder, logger, console, owmlConfig, menus, harmonyHelper, inputHandler, modSorter); owo.LoadMods(); }
private IModHelper CreateModHelper(IModData modData) { var logger = new ModLogger(_owmlConfig, modData.Manifest); var console = OutputFactory.CreateOutput(_owmlConfig, _logger, modData.Manifest); var assets = new ModAssets(console, modData.Manifest); var storage = new ModStorage(console, modData.Manifest); var events = new ModEvents(logger, console, _harmonyHelper); var interaction = new ModInteraction(_modList, new InterfaceProxyFactory(), modData.Manifest); return(new ModHelper.ModHelper(logger, console, _harmonyHelper, events, assets, storage, _menus, modData.Manifest, modData.Config, _owmlConfig, interaction)); }
static void Main(string[] args) { var owmlConfig = GetOwmlConfig(); var owmlManifest = GetOwmlManifest(); var writer = OutputFactory.CreateOutput(owmlConfig, null, owmlManifest); var modFinder = new ModFinder(owmlConfig, writer); var outputListener = new OutputListener(owmlConfig); var pathFinder = new PathFinder(owmlConfig, writer); var owPatcher = new OWPatcher(owmlConfig, writer); var vrPatcher = new VRPatcher(owmlConfig, writer); var app = new App(owmlConfig, owmlManifest, writer, modFinder, outputListener, pathFinder, owPatcher, vrPatcher); app.Run(args); }