TechbloxModdingAPI/GamecraftModdingAPI/Commands/CommandPatch.cs

39 lines
1.2 KiB
C#
Raw Permalink Normal View History

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