Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions StarMap.Core/ModRepository/RuntimeMod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,22 @@ public bool InitializeMod(ModRegistry modRegistry, IPatchManager patchManager, I
var allModsLoadedPatch = patchManager.RegisterStaticVoidPatch(IPatchService.PatchType.Postfix, this, typeof(KSA.ModLibrary).GetMethod(nameof(ModLibrary.LoadAll))!,
args =>
{
classMethod.Invoke(modObject, args);
classMethod.Invoke(modObject, []);
return true;
});
Patches.Add(allModsLoadedPatch);
break;

case StarMapImmediateLoadAttribute:
var immediateLoadPatch = patchManager.RegisterInstanceVoidPatch<Mod>(IPatchService.PatchType.Prefix, this, typeof(KSA.Mod).GetMethod(nameof(Mod.PrepareSystems))!,
// KSA 2026.11.10.5801 removed Mod.PrepareSystems, and ModLibrary.PrepareAll now calls Mod.LoadSettings at its place.
var immediateLoadTarget = typeof(KSA.Mod).GetMethod("PrepareSystems") ?? typeof(KSA.Mod).GetMethod(nameof(Mod.LoadSettings));
if (immediateLoadTarget is null)
{
Console.WriteLine($"StarMap warning: 'StarMap - {ModId} uses StarMapImmediateLoad, but KSA has no method to hook it to'");
break;
}

var immediateLoadPatch = patchManager.RegisterInstanceVoidPatch<Mod>(IPatchService.PatchType.Prefix, this, immediateLoadTarget,
(args, mod) =>
{
if (mod.Id.Equals(ModId))
Expand Down
3 changes: 2 additions & 1 deletion StarMap.Core/UI/ConfirmRestart/ConfirmRestart.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Brutal.GlfwApi;
using Brutal.Collections;
using Brutal.GlfwApi;
using Brutal.ImGuiApi;
using Brutal.VulkanApi;
using Brutal.VulkanApi.Abstractions;
Expand Down
Loading