Fix CommandPatch properly
This commit is contained in:
parent
a47958762a
commit
bc3dc81338
2 changed files with 4 additions and 7 deletions
|
@ -21,14 +21,14 @@ namespace GamecraftModdingAPI.Commands
|
||||||
/// Patch of RobocraftX.GUI.CommandLine.CommandLineCompositionRoot.Compose<T>()
|
/// Patch of RobocraftX.GUI.CommandLine.CommandLineCompositionRoot.Compose<T>()
|
||||||
/// </summary>
|
/// </summary>
|
||||||
// TODO: fix
|
// TODO: fix
|
||||||
//[HarmonyPatch]
|
[HarmonyPatch]
|
||||||
//[HarmonyPatch(typeof(RobocraftX.GUI.CommandLine.CommandLineCompositionRoot))]
|
//[HarmonyPatch(typeof(RobocraftX.GUI.CommandLine.CommandLineCompositionRoot))]
|
||||||
|
//[HarmonyPatch("Compose")]
|
||||||
//[HarmonyPatch("Compose", new Type[] { typeof(UnityContext<FullGameCompositionRoot>), typeof(EnginesRoot), typeof(World), typeof(Action), typeof(MultiplayerInitParameters), typeof(StateSyncRegistrationHelper)})]
|
//[HarmonyPatch("Compose", new Type[] { typeof(UnityContext<FullGameCompositionRoot>), typeof(EnginesRoot), typeof(World), typeof(Action), typeof(MultiplayerInitParameters), typeof(StateSyncRegistrationHelper)})]
|
||||||
static class CommandPatch
|
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
|
// When a game is loaded, register the command engines
|
||||||
CommandManager.RegisterEngines(enginesRoot);
|
CommandManager.RegisterEngines(enginesRoot);
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,6 @@ namespace GamecraftModdingAPI.Commands
|
||||||
public static MethodBase TargetMethod(HarmonyInstance instance)
|
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;
|
//return func.Method;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,8 +22,6 @@ namespace GamecraftModdingAPI.Events
|
||||||
{
|
{
|
||||||
// register custom game engines
|
// register custom game engines
|
||||||
GameEngineManager.RegisterEngines(____mainGameEnginesRoot);
|
GameEngineManager.RegisterEngines(____mainGameEnginesRoot);
|
||||||
// register custom command engines
|
|
||||||
GamecraftModdingAPI.Commands.CommandManager.RegisterEngines(____mainGameEnginesRoot);
|
|
||||||
// A new EnginesRoot is always created when ActivateGame is called
|
// A new EnginesRoot is always created when ActivateGame is called
|
||||||
// so all event emitters and handlers must be re-registered.
|
// so all event emitters and handlers must be re-registered.
|
||||||
EventManager.RegisterEngines(____mainGameEnginesRoot);
|
EventManager.RegisterEngines(____mainGameEnginesRoot);
|
||||||
|
|
Loading…
Reference in a new issue