From 178813e55f54e7e50e2615fb5c2284806377e2e5 Mon Sep 17 00:00:00 2001 From: Mister_Nebula <41904486+misternebula@users.noreply.github.com> Date: Thu, 7 Jan 2021 18:58:11 +0000 Subject: [PATCH] Harmony changes (#335) --- src/OWML.Launcher/OWML.Manifest.json | 2 +- src/OWML.ModHelper.Events/HarmonyHelper.cs | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/OWML.Launcher/OWML.Manifest.json b/src/OWML.Launcher/OWML.Manifest.json index aced3206..f15ea357 100644 --- a/src/OWML.Launcher/OWML.Manifest.json +++ b/src/OWML.Launcher/OWML.Manifest.json @@ -2,7 +2,7 @@ "author": "Alek", "name": "OWML", "uniqueName": "Alek.OWML", - "version": "1.1.7", + "version": "1.1.8", "description": "The mod loader and mod framework for Outer Wilds", "minGameVersion": "1.0.7.0", "maxGameVersion": "1.0.7.481" diff --git a/src/OWML.ModHelper.Events/HarmonyHelper.cs b/src/OWML.ModHelper.Events/HarmonyHelper.cs index 4e939b19..299a01f0 100644 --- a/src/OWML.ModHelper.Events/HarmonyHelper.cs +++ b/src/OWML.ModHelper.Events/HarmonyHelper.cs @@ -1,9 +1,9 @@ -using System; +using Harmony; +using OWML.Common; +using System; using System.Collections.Generic; using System.Linq; using System.Reflection; -using Harmony; -using OWML.Common; namespace OWML.ModHelper.Events { @@ -29,8 +29,12 @@ private HarmonyInstance CreateInstance() try { _console.WriteLine($"Creating harmony instance: {_manifest.UniqueName}", MessageType.Debug); - HarmonyInstance.DEBUG = true; - FileLog.logPath = $"{_owmlConfig.LogsPath}/harmony.log.txt"; + if (_owmlConfig.DebugMode) + { + _console.WriteLine("Enabling Harmony debug mode.", MessageType.Debug); + FileLog.logPath = $"{_owmlConfig.LogsPath}/Harmony.Log.{DateTime.Now:dd-MM-yyyy-HH.mm.ss}.txt"; + HarmonyInstance.DEBUG = true; + } harmony = HarmonyInstance.Create(_manifest.UniqueName); } catch (TypeLoadException ex)