Browse Source

Fix command registration

tags/v2.0.0
NorbiPeti 3 years ago
parent
commit
7a53e1d32f
Signed by: NorbiPeti <szatmari.norbert.peter@gmail.com> GPG Key ID: DBA4C4549A927E56
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      TechbloxModdingAPI/Commands/CommandPatch.cs

+ 4
- 2
TechbloxModdingAPI/Commands/CommandPatch.cs View File

@@ -2,11 +2,11 @@
using System.Reflection;

using HarmonyLib;
using Svelto.Context;
using Svelto.ECS;
using RobocraftX.CR.MainGame;
using RobocraftX.Multiplayer;
using RobocraftX.StateSync;
using TechbloxModdingAPI.Utility;

namespace TechbloxModdingAPI.Commands
{
@@ -26,6 +26,7 @@ namespace TechbloxModdingAPI.Commands
var entityFunctions = enginesRoot.GenerateEntityFunctions();
var entityFactory = enginesRoot.GenerateEntityFactory();
var entitySerializer = enginesRoot.GenerateEntitySerializer();
Logging.MetaDebugLog("Adding existing command engines");
enginesRoot.AddEngine((IEngine) Activator.CreateInstance(
AccessTools.TypeByName("RobocraftX.GUI.CommandLine.ExecuteSetGravityCommandEngine")));
enginesRoot.AddEngine((IEngine) Activator.CreateInstance(
@@ -92,6 +93,7 @@ namespace TechbloxModdingAPI.Commands
AccessTools.TypeByName("RobocraftX.GUI.CommandLine.DamageCharacterCommandEngine"), entityFactory));
enginesRoot.AddEngine((IEngine) Activator.CreateInstance(
AccessTools.TypeByName("RobocraftX.GUI.CommandLine.DisableCharacterDamageCommandEngine")));
Logging.MetaDebugLog("Existing command engines added");
CommandManager.RegisterEngines(enginesRoot);
}
@@ -99,7 +101,7 @@ namespace TechbloxModdingAPI.Commands
public static MethodInfo TargetMethod()
{
return AccessTools.Method(typeof(MainGameCompositionRoot), "DeterministicCompose")
.MakeGenericMethod(typeof(UnityContext<MainGameCompositionRoot>));
.MakeGenericMethod(typeof(object));
}
}
}

Loading…
Cancel
Save