diff --git a/GamecraftModdingAPI/Commands/CommandPatch.cs b/GamecraftModdingAPI/Commands/CommandPatch.cs index e88887c..a0392ed 100644 --- a/GamecraftModdingAPI/Commands/CommandPatch.cs +++ b/GamecraftModdingAPI/Commands/CommandPatch.cs @@ -21,22 +21,21 @@ namespace GamecraftModdingAPI.Commands /// Patch of RobocraftX.GUI.CommandLine.CommandLineCompositionRoot.Compose() /// // TODO: fix - //[HarmonyPatch] + [HarmonyPatch] //[HarmonyPatch(typeof(RobocraftX.GUI.CommandLine.CommandLineCompositionRoot))] + //[HarmonyPatch("Compose")] //[HarmonyPatch("Compose", new Type[] { typeof(UnityContext), typeof(EnginesRoot), typeof(World), typeof(Action), typeof(MultiplayerInitParameters), typeof(StateSyncRegistrationHelper)})] static class CommandPatch { - public static void Postfix(object contextHolder, EnginesRoot enginesRoot, World physicsWorld, Action reloadGame, MultiplayerInitParameters multiplayerParameters, StateSyncRegistrationHelper stateSyncReg) + public static void Postfix(object contextHolder, EnginesRoot enginesRoot, World physicsWorld, Action reloadGame, MultiplayerInitParameters multiplayerParameters, ref StateSyncRegistrationHelper stateSyncReg) { - Logging.MetaDebugLog("Command Line was loaded"); // When a game is loaded, register the command engines CommandManager.RegisterEngines(enginesRoot); } public static MethodBase TargetMethod(HarmonyInstance instance) { - return typeof(RobocraftX.GUI.CommandLine.CommandLineCompositionRoot).GetMethod("Compose").MakeGenericMethod(typeof(object)); - + return typeof(RobocraftX.GUI.CommandLine.CommandLineCompositionRoot).GetMethod("Compose").MakeGenericMethod(typeof(object)); //return func.Method; } } diff --git a/GamecraftModdingAPI/Events/GameActivatedPatch.cs b/GamecraftModdingAPI/Events/GameActivatedPatch.cs index d14b8d0..b85a6e6 100644 --- a/GamecraftModdingAPI/Events/GameActivatedPatch.cs +++ b/GamecraftModdingAPI/Events/GameActivatedPatch.cs @@ -22,8 +22,6 @@ namespace GamecraftModdingAPI.Events { // register custom game engines GameEngineManager.RegisterEngines(____mainGameEnginesRoot); - // register custom command engines - GamecraftModdingAPI.Commands.CommandManager.RegisterEngines(____mainGameEnginesRoot); // A new EnginesRoot is always created when ActivateGame is called // so all event emitters and handlers must be re-registered. EventManager.RegisterEngines(____mainGameEnginesRoot);