A stable modding interface between Techblox and mods https://mod.exmods.org/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CommandPatch.cs 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. using System.Collections.Generic;
  2. using System.Linq;
  3. using System.Text;
  4. using System.Threading.Tasks;
  5. using System.Reflection;
  6. using HarmonyLib;
  7. using Svelto.Context;
  8. using Svelto.ECS;
  9. using RobocraftX;
  10. using GamecraftModdingAPI.Utility;
  11. namespace GamecraftModdingAPI.Commands
  12. {
  13. /// <summary>
  14. /// Patch of RobocraftX.GUI.CommandLine.CommandLineCompositionRoot.Compose<T>()
  15. /// </summary>
  16. // TODO: fix
  17. [HarmonyPatch]
  18. //[HarmonyPatch(typeof(RobocraftX.GUI.CommandLine.CommandLineCompositionRoot))]
  19. //[HarmonyPatch("Compose")]
  20. //[HarmonyPatch("Compose", new Type[] { typeof(UnityContext<FullGameCompositionRoot>), typeof(EnginesRoot), typeof(World), typeof(Action), typeof(MultiplayerInitParameters), typeof(StateSyncRegistrationHelper)})]
  21. static class CommandPatch
  22. {
  23. public static void Postfix(EnginesRoot enginesRoot)
  24. {
  25. // When a game is loaded, register the command engines
  26. CommandManager.RegisterEngines(enginesRoot);
  27. }
  28. public static MethodBase TargetMethod(Harmony instance)
  29. {
  30. return typeof(RobocraftX.GUI.CommandLine.CommandLineCompositionRoot).GetMethod("Compose").MakeGenericMethod(typeof(object));
  31. //return func.Method;
  32. }
  33. }
  34. }