TechbloxModdingAPI/GamecraftModdingAPI/Commands/CommandPatch.cs

39 lines
1.2 KiB
C#
Raw Normal View History

using System.Collections.Generic;
2019-12-14 04:42:55 +00:00
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Reflection;
2020-05-03 19:31:09 +00:00
using HarmonyLib;
2019-12-14 04:42:55 +00:00
using Svelto.Context;
using Svelto.ECS;
using RobocraftX;
using GamecraftModdingAPI.Utility;
namespace GamecraftModdingAPI.Commands
{
2019-12-15 07:20:20 +00:00
/// <summary>
/// Patch of RobocraftX.GUI.CommandLine.CommandLineCompositionRoot.Compose<T>()
/// </summary>
// TODO: fix
2020-01-26 18:49:51 +00:00
[HarmonyPatch]
//[HarmonyPatch(typeof(RobocraftX.GUI.CommandLine.CommandLineCompositionRoot))]
2020-01-26 18:49:51 +00:00
//[HarmonyPatch("Compose")]
//[HarmonyPatch("Compose", new Type[] { typeof(UnityContext<FullGameCompositionRoot>), typeof(EnginesRoot), typeof(World), typeof(Action), typeof(MultiplayerInitParameters), typeof(StateSyncRegistrationHelper)})]
2019-12-19 20:42:50 +00:00
static class CommandPatch
2019-12-14 04:42:55 +00:00
{
public static void Postfix(EnginesRoot enginesRoot)
2019-12-14 04:42:55 +00:00
{
// When a game is loaded, register the command engines
2019-12-15 07:20:20 +00:00
CommandManager.RegisterEngines(enginesRoot);
2019-12-14 04:42:55 +00:00
}
2020-05-03 19:31:09 +00:00
public static MethodBase TargetMethod(Harmony instance)
2019-12-14 04:42:55 +00:00
{
2020-01-26 18:49:51 +00:00
return typeof(RobocraftX.GUI.CommandLine.CommandLineCompositionRoot).GetMethod("Compose").MakeGenericMethod(typeof(object));
//return func.Method;
2019-12-14 04:42:55 +00:00
}
}
}