From 50f4a8553739cd00638e6bfd10f99146ce4405d6 Mon Sep 17 00:00:00 2001 From: Esper Thomson Date: Sun, 22 Aug 2021 21:57:29 -0400 Subject: [PATCH 1/2] Allow mods to check what game is currently running. --- QModManager/API/QModServices.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/QModManager/API/QModServices.cs b/QModManager/API/QModServices.cs index f1d15030..85218e0b 100644 --- a/QModManager/API/QModServices.cs +++ b/QModManager/API/QModServices.cs @@ -138,5 +138,13 @@ public void AddCriticalMessage(string msg, int size = MainMenuMessages.defaultSi var callingMod = GetMod(ReflectionHelper.CallingAssemblyByStackTrace()); MainMenuMessages.Add(msg, callingMod?.DisplayName, size, color, autoformat); } + + /// + /// Gets the currently running game. + /// + /// + /// The currently running game. + /// + public QModGame CurrentlyRunningGame => Patcher.CurrentlyRunningGame; } } From d5cf1b854104406484d3de579913be88f0f19583 Mon Sep 17 00:00:00 2001 From: Esper Thomson Date: Mon, 23 Aug 2021 18:13:07 -0400 Subject: [PATCH 2/2] Add CurrentlyRunningGame to IQModServices. --- QModManager/API/IQModServices.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/QModManager/API/IQModServices.cs b/QModManager/API/IQModServices.cs index 92fa3520..a7709f4a 100644 --- a/QModManager/API/IQModServices.cs +++ b/QModManager/API/IQModServices.cs @@ -31,5 +31,13 @@ public interface IQModServices : IQModAPI /// The color of the text. /// Whether or not to apply formatting tags to the message, or show it as it is. void AddCriticalMessage(string msg, int size = MainMenuMessages.defaultSize, string color = MainMenuMessages.defaultColor, bool autoformat = true); + + /// + /// Gets the currently running game. + /// + /// + /// The currently running game. + /// + QModGame CurrentlyRunningGame { get; } } } \ No newline at end of file