|
|
@@ -10,6 +10,7 @@ using Svelto.Context; |
|
|
|
using Svelto.ECS; |
|
|
|
using RobocraftX; |
|
|
|
using RobocraftX.Multiplayer; |
|
|
|
using RobocraftX.StateSync; |
|
|
|
using Unity.Entities; |
|
|
|
|
|
|
|
using GamecraftModdingAPI.Utility; |
|
|
@@ -19,10 +20,13 @@ namespace GamecraftModdingAPI.Commands |
|
|
|
/// <summary> |
|
|
|
/// Patch of RobocraftX.GUI.CommandLine.CommandLineCompositionRoot.Compose<T>() |
|
|
|
/// </summary> |
|
|
|
[HarmonyPatch] |
|
|
|
// TODO: fix |
|
|
|
//[HarmonyPatch] |
|
|
|
//[HarmonyPatch(typeof(RobocraftX.GUI.CommandLine.CommandLineCompositionRoot))] |
|
|
|
//[HarmonyPatch("Compose", new Type[] { typeof(UnityContext<FullGameCompositionRoot>), typeof(EnginesRoot), typeof(World), typeof(Action), typeof(MultiplayerInitParameters), typeof(StateSyncRegistrationHelper)})] |
|
|
|
public static class CommandPatch |
|
|
|
{ |
|
|
|
public static void Postfix(UnityContext<FullGameCompositionRoot> contextHolder, EnginesRoot enginesRoot, World physicsWorld, Action reloadGame, MultiplayerInitParameters multiplayerParameters) |
|
|
|
public static void Postfix(object contextHolder, EnginesRoot enginesRoot, World physicsWorld, Action reloadGame, MultiplayerInitParameters multiplayerParameters, StateSyncRegistrationHelper stateSyncReg) |
|
|
|
{ |
|
|
|
Logging.MetaDebugLog("Command Line was loaded"); |
|
|
|
// When a game is loaded, register the command engines |
|
|
@@ -31,8 +35,9 @@ namespace GamecraftModdingAPI.Commands |
|
|
|
|
|
|
|
public static MethodBase TargetMethod(HarmonyInstance instance) |
|
|
|
{ |
|
|
|
var func = (Action<UnityContext<FullGameCompositionRoot>, EnginesRoot, World, Action, MultiplayerInitParameters>)RobocraftX.GUI.CommandLine.CommandLineCompositionRoot.Compose<UnityContext<FullGameCompositionRoot>>; |
|
|
|
return func.Method; |
|
|
|
return typeof(RobocraftX.GUI.CommandLine.CommandLineCompositionRoot).GetMethod("Compose").MakeGenericMethod(typeof(object)); |
|
|
|
|
|
|
|
//return func.Method; |
|
|
|
} |
|
|
|
} |
|
|
|
} |