From ba811ec8106796e28139c169a8dab8d88d11d4bf Mon Sep 17 00:00:00 2001 From: 01010100b Date: Mon, 16 Oct 2023 20:02:22 +0200 Subject: [PATCH] get all loaded patches --- AuroraPatch/Patch.cs | 6 ++++++ AuroraPatch/Program.cs | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/AuroraPatch/Patch.cs b/AuroraPatch/Patch.cs index 53fcf6a..2f93ac8 100644 --- a/AuroraPatch/Patch.cs +++ b/AuroraPatch/Patch.cs @@ -17,6 +17,7 @@ public abstract class Patch public string AuroraChecksum => Loader.AuroraChecksum; // available on Loaded public Assembly AuroraAssembly => Loader.AuroraAssembly; // available on Loaded public Form TacticalMap => Loader.TacticalMap; // available on Started + public string Folder => Path.Combine(Path.GetDirectoryName(AuroraExecutablePath), "Patches", Name); /// /// A description for your mod, shown on the AuroraPatch UI. @@ -61,6 +62,11 @@ public bool TryGetPatch(out T patch) where T : Patch } } + /// + /// Iterate all loaded patches. + /// + public IEnumerable GetLoadedPatches() => Loader.LoadedPatches; + /// /// Run code on Aurora's UI thread. Only available on Started.. /// diff --git a/AuroraPatch/Program.cs b/AuroraPatch/Program.cs index e856b04..2ddbe40 100644 --- a/AuroraPatch/Program.cs +++ b/AuroraPatch/Program.cs @@ -31,7 +31,7 @@ static void Main(string[] args) if (!File.Exists(exe)) { - Logger.LogCritical($"File {exe} is missing or is not readable."); + Logger.LogCritical($"File {exe} is missing or is not readable.", true); Application.Exit(); return;