diff --git a/GamecraftModdingAPI/Blocks/MovementEngine.cs b/GamecraftModdingAPI/Blocks/MovementEngine.cs index c644d15..133dcd0 100644 --- a/GamecraftModdingAPI/Blocks/MovementEngine.cs +++ b/GamecraftModdingAPI/Blocks/MovementEngine.cs @@ -69,7 +69,7 @@ namespace GamecraftModdingAPI.Blocks public float3 MoveConnectedBlocks(uint blockID, float3 vector) { Stack cubeStack = new Stack(); - Svelto.DataStructures.FasterList cubesToMove = new Svelto.DataStructures.FasterList(); + Gamecraft.DataStructures.FasterList cubesToMove = new Gamecraft.DataStructures.FasterList(); ConnectedCubesUtility.TreeTraversal.GetConnectedCubes(entitiesDB, blockID, cubeStack, cubesToMove, (in GridConnectionsEntityStruct g) => { return false; }); for (int i = 0; i < cubesToMove.Count; i++) { diff --git a/GamecraftModdingAPI/Commands/CommandPatch.cs b/GamecraftModdingAPI/Commands/CommandPatch.cs index 5a11de3..2e9955a 100644 --- a/GamecraftModdingAPI/Commands/CommandPatch.cs +++ b/GamecraftModdingAPI/Commands/CommandPatch.cs @@ -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 /// /// Patch of RobocraftX.GUI.CommandLine.CommandLineCompositionRoot.Compose() /// - [HarmonyPatch] + // TODO: fix + //[HarmonyPatch] + //[HarmonyPatch(typeof(RobocraftX.GUI.CommandLine.CommandLineCompositionRoot))] + //[HarmonyPatch("Compose", new Type[] { typeof(UnityContext), typeof(EnginesRoot), typeof(World), typeof(Action), typeof(MultiplayerInitParameters), typeof(StateSyncRegistrationHelper)})] public static class CommandPatch { - public static void Postfix(UnityContext 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, EnginesRoot, World, Action, MultiplayerInitParameters>)RobocraftX.GUI.CommandLine.CommandLineCompositionRoot.Compose>; - return func.Method; + return typeof(RobocraftX.GUI.CommandLine.CommandLineCompositionRoot).GetMethod("Compose").MakeGenericMethod(typeof(object)); + + //return func.Method; } } } diff --git a/GamecraftModdingAPI/Events/GameActivatedPatch.cs b/GamecraftModdingAPI/Events/GameActivatedPatch.cs index b85a6e6..d14b8d0 100644 --- a/GamecraftModdingAPI/Events/GameActivatedPatch.cs +++ b/GamecraftModdingAPI/Events/GameActivatedPatch.cs @@ -22,6 +22,8 @@ namespace GamecraftModdingAPI.Events { // register custom game engines GameEngineManager.RegisterEngines(____mainGameEnginesRoot); + // register custom command engines + GamecraftModdingAPI.Commands.CommandManager.RegisterEngines(____mainGameEnginesRoot); // A new EnginesRoot is always created when ActivateGame is called // so all event emitters and handlers must be re-registered. EventManager.RegisterEngines(____mainGameEnginesRoot); diff --git a/GamecraftModdingAPI/GamecraftModdingAPI.csproj b/GamecraftModdingAPI/GamecraftModdingAPI.csproj index 19d3534..9ad8c80 100644 --- a/GamecraftModdingAPI/GamecraftModdingAPI.csproj +++ b/GamecraftModdingAPI/GamecraftModdingAPI.csproj @@ -1,9 +1,9 @@ - + net48 true - 0.1.0.0 + 0.1.1.0 Exmods GNU General Public Licence 3+ https://git.exmods.org/modtainers/GamecraftModdingAPI @@ -124,6 +124,9 @@ ..\ref\Gamecraft_Data\Managed\RobocraftX.Common.dll + + ..\ref\Gamecraft_Data\Managed\RobocraftX.ControlsScreen.dll + ..\ref\Gamecraft_Data\Managed\RobocraftX.Crosshair.dll @@ -529,16 +532,10 @@ ..\ref\Gamecraft_Data\Managed\UserReporting.dll - - ..\ref\Gamecraft_Data\Managed\Utf8Json.dll - ..\ref\Gamecraft_Data\Managed\VisualProfiler.dll - - - diff --git a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs index 7c0e7df..c8e4dea 100644 --- a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs +++ b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs @@ -45,6 +45,12 @@ namespace GamecraftModdingAPI.Tests // disable background music AudioTools.SetVolume(0.0f, "Music"); + /*if (!FMODUnity.RuntimeManager.HasBankLoaded("Modded")) + { + FMODUnity.RuntimeManager.LoadBank("Modded", true); + } + FMODUnity.RuntimeManager.PlayOneShot("event:/ModEvents/KillDashNine3D");*/ + // debug/test handlers EventManager.AddEventHandler(new SimpleEventHandlerEngine(() => { Logging.Log("App Inited event!"); }, () => { }, EventType.ApplicationInitialized, "appinit API debug")); @@ -76,7 +82,8 @@ namespace GamecraftModdingAPI.Tests GamecraftModdingAPI.Utility.Logging.CommandLogError("Blocks can only be moved in Build mode!"); } }, "MoveLastBlock", "Move the most-recently-placed block, and any connected blocks by the given offset")); - + /*CommandManager.AddCommand(new SimpleCustomCommandEngine(() => { FMODUnity.RuntimeManager.PlayOneShot("event:/ModEvents/KillDashNine2D"); }, + "Monzy", "Rap"));*/ } public void OnFixedUpdate() { }