From 81f2f613f7fb96eb5c2a9600ba2fb1465c6efefb Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Mon, 13 Apr 2020 01:31:06 +0200 Subject: [PATCH 001/252] Add API to remove blocks --- GamecraftModdingAPI/Blocks/PlacementEngine.cs | 13 ++- GamecraftModdingAPI/Blocks/Removal.cs | 28 ++++++ GamecraftModdingAPI/Blocks/RemovalEngine.cs | 94 +++++++++++++++++++ GamecraftModdingAPI/Blocks/RotationEngine.cs | 2 +- GamecraftModdingAPI/Main.cs | 1 + 5 files changed, 130 insertions(+), 8 deletions(-) create mode 100644 GamecraftModdingAPI/Blocks/Removal.cs create mode 100644 GamecraftModdingAPI/Blocks/RemovalEngine.cs diff --git a/GamecraftModdingAPI/Blocks/PlacementEngine.cs b/GamecraftModdingAPI/Blocks/PlacementEngine.cs index 1101431..cb5804f 100644 --- a/GamecraftModdingAPI/Blocks/PlacementEngine.cs +++ b/GamecraftModdingAPI/Blocks/PlacementEngine.cs @@ -113,12 +113,11 @@ namespace GamecraftModdingAPI.Blocks { scaleFactor = placementScale.desiredScaleFactor }); - structInitializer.Init( - new BlockPlacementInfoStruct() - { - loadedFromDisk = false, - placedBy = playerId - }); + structInitializer.Init(new BlockPlacementInfoStruct() + { + loadedFromDisk = false, + placedBy = playerId + }); PrimaryRotationUtility.InitialisePrimaryDirection(rotation.rotation, ref structInitializer); EGID playerEGID = new EGID(playerId, CharacterExclusiveGroups.OnFootGroup); ref PickedBlockExtraDataStruct pickedBlock = ref entitiesDB.QueryEntity(playerEGID); @@ -139,7 +138,7 @@ namespace GamecraftModdingAPI.Blocks static MethodBase TargetMethod(HarmonyInstance instance) { - return AccessTools.TypeByName("RobocraftX.CR.MachineEditing.PlaceBlockEngine").GetConstructors()[0]; + return AccessTools.TypeByName("RobocraftX.CR.MachineEditing.PlaceBlockEngine").GetConstructors()[0]; } } } diff --git a/GamecraftModdingAPI/Blocks/Removal.cs b/GamecraftModdingAPI/Blocks/Removal.cs new file mode 100644 index 0000000..0bb54fb --- /dev/null +++ b/GamecraftModdingAPI/Blocks/Removal.cs @@ -0,0 +1,28 @@ +using Svelto.ECS; + +using GamecraftModdingAPI.Utility; + +namespace GamecraftModdingAPI.Blocks +{ + public class Removal + { + private static RemovalEngine _removalEngine = new RemovalEngine(); + + /// + /// Removes the block with the given ID. Returns false if the block doesn't exist or the game isn't in build mode. + /// + /// The block to remove + /// Whether the block was successfully removed + public static bool RemoveBlock(EGID targetBlock) + { + if (GameState.IsBuildMode()) + return _removalEngine.RemoveBlock(targetBlock); + return false; + } + + public static void Init() + { + GameEngineManager.AddGameEngine(_removalEngine); + } + } +} \ No newline at end of file diff --git a/GamecraftModdingAPI/Blocks/RemovalEngine.cs b/GamecraftModdingAPI/Blocks/RemovalEngine.cs new file mode 100644 index 0000000..2e378f9 --- /dev/null +++ b/GamecraftModdingAPI/Blocks/RemovalEngine.cs @@ -0,0 +1,94 @@ +using System.Reflection; + +using Harmony; +using RobocraftX.Blocks; +using RobocraftX.Blocks.Ghost; +using RobocraftX.Character.Camera; +using RobocraftX.Character.Factories; +using RobocraftX.Common; +using RobocraftX.Players; +using Svelto.ECS; +using uREPL; + +using GamecraftModdingAPI.Commands; +using GamecraftModdingAPI.Utility; + +namespace GamecraftModdingAPI.Blocks +{ + public class RemovalEngine : IApiEngine + { + private static IEntityFunctions _entityFunctions; + private static MachineGraphConnectionEntityFactory _connectionFactory; + + public bool RemoveBlock(EGID target) + { + if (!entitiesDB.Exists(target)) + return false; + var connections = entitiesDB.QueryEntity(target); + for (int i = connections.connections.Length - 1; i >= 0; i--) + _connectionFactory.RemoveConnection(connections, i, entitiesDB); + _entityFunctions.RemoveEntity(target); + return true; + } + + /// + /// Returns the block the player is currently looking at. + /// + /// The player's ID + /// The maximum distance from the player (default is the player's building reach) + /// The block's EGID or null if not found + public EGID? GetBlockUnderCursor(uint playerId, float maxDistance = -1f) + { + if (!entitiesDB.TryQueryMappedEntities( + CameraExclusiveGroups.CameraGroup, out var mapper)) + return null; + mapper.TryGetEntity(playerId, out CharacterCameraRayCastEntityStruct rayCast); + float distance = maxDistance < 0 + ? GhostBlockUtils.GetBuildInteractionDistance(entitiesDB, rayCast) + : maxDistance; + if (rayCast.hit && rayCast.distance <= distance) + return rayCast.hitEgid; + return null; + } + + public void Ready() + { + CommandManager.AddCommand(new SimpleCustomCommandEngine(() => + { + var block = GetBlockUnderCursor(LocalPlayerIDUtility.GetLocalPlayerID(entitiesDB)); + if (block.HasValue) + { + RemoveBlock(block.Value); + Log.Output("Removed block."); + } + else + Log.Output("No block found where you're looking at."); + }, "removeCube", "Removes the cube you're looking at.")); + } + + public EntitiesDB entitiesDB { get; set; } + + public void Dispose() + { + } + + public string Name { get; } = "GamecraftModdingAPIRemovalGameEngine"; + + [HarmonyPatch] + public class FactoryObtainerPatch + { + static void Postfix(IEntityFunctions entityFunctions, + MachineGraphConnectionEntityFactory machineGraphConnectionEntityFactory) + { + _entityFunctions = entityFunctions; + _connectionFactory = machineGraphConnectionEntityFactory; + Logging.MetaDebugLog("Requirements injected."); + } + + static MethodBase TargetMethod(HarmonyInstance instance) + { + return AccessTools.TypeByName("RobocraftX.CR.MachineEditing.RemoveBlockEngine").GetConstructors()[0]; + } + } + } +} \ No newline at end of file diff --git a/GamecraftModdingAPI/Blocks/RotationEngine.cs b/GamecraftModdingAPI/Blocks/RotationEngine.cs index 50dbb4c..e84c7c2 100644 --- a/GamecraftModdingAPI/Blocks/RotationEngine.cs +++ b/GamecraftModdingAPI/Blocks/RotationEngine.cs @@ -44,7 +44,7 @@ namespace GamecraftModdingAPI.Blocks IsInGame = true; } - // implementations for Movement static class + // implementations for Rotation static class public float3 RotateBlock(uint blockID, Vector3 vector) { diff --git a/GamecraftModdingAPI/Main.cs b/GamecraftModdingAPI/Main.cs index 6ce1126..ff8b63c 100644 --- a/GamecraftModdingAPI/Main.cs +++ b/GamecraftModdingAPI/Main.cs @@ -65,6 +65,7 @@ namespace GamecraftModdingAPI Blocks.Signals.Init(); Blocks.Placement.Init(); Blocks.Tweakable.Init(); + Blocks.Removal.Init(); // init inventory Inventory.Hotbar.Init(); // init input -- 2.30.2 From 9609187cff2314f6408d5e29ba83d4ac4208712e Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Mon, 13 Apr 2020 02:03:23 +0200 Subject: [PATCH 002/252] Created a BlockUtility class, changed PlaceBlock return type Removed GameState methods from block APIs Created a BlockUtility class to get the block the player is looking at Changed the return type of PlaceBlock, returning the ID of the newly placed block or null --- GamecraftModdingAPI/Blocks/BlockUtility.cs | 31 +++++++++++++++++++ GamecraftModdingAPI/Blocks/Movement.cs | 4 +-- GamecraftModdingAPI/Blocks/MovementEngine.cs | 5 --- GamecraftModdingAPI/Blocks/Placement.cs | 18 +++++------ GamecraftModdingAPI/Blocks/PlacementEngine.cs | 17 +++++----- GamecraftModdingAPI/Blocks/RemovalEngine.cs | 26 ++-------------- GamecraftModdingAPI/Blocks/Rotation.cs | 4 +-- GamecraftModdingAPI/Blocks/RotationEngine.cs | 5 --- GamecraftModdingAPI/Blocks/SignalEngine.cs | 5 --- GamecraftModdingAPI/Blocks/Signals.cs | 18 +++++------ 10 files changed, 63 insertions(+), 70 deletions(-) create mode 100644 GamecraftModdingAPI/Blocks/BlockUtility.cs diff --git a/GamecraftModdingAPI/Blocks/BlockUtility.cs b/GamecraftModdingAPI/Blocks/BlockUtility.cs new file mode 100644 index 0000000..342ee73 --- /dev/null +++ b/GamecraftModdingAPI/Blocks/BlockUtility.cs @@ -0,0 +1,31 @@ +using RobocraftX.Blocks.Ghost; +using RobocraftX.Character.Camera; +using RobocraftX.Character.Factories; +using Svelto.ECS; + +namespace GamecraftModdingAPI.Blocks +{ + public class BlockUtility + { + /// + /// Returns the block the player is currently looking at. + /// + /// The player's ID + /// The entities DB + /// The maximum distance from the player (default is the player's building reach) + /// The block's EGID or null if not found + public static EGID? GetBlockLookedAt(uint playerId, EntitiesDB entitiesDB, float maxDistance = -1f) + { + if (!entitiesDB.TryQueryMappedEntities( + CameraExclusiveGroups.CameraGroup, out var mapper)) + return null; + mapper.TryGetEntity(playerId, out CharacterCameraRayCastEntityStruct rayCast); + float distance = maxDistance < 0 + ? GhostBlockUtils.GetBuildInteractionDistance(entitiesDB, rayCast) + : maxDistance; + if (rayCast.hit && rayCast.distance <= distance) + return rayCast.hitEgid; + return null; + } + } +} \ No newline at end of file diff --git a/GamecraftModdingAPI/Blocks/Movement.cs b/GamecraftModdingAPI/Blocks/Movement.cs index 132fedf..28575a9 100644 --- a/GamecraftModdingAPI/Blocks/Movement.cs +++ b/GamecraftModdingAPI/Blocks/Movement.cs @@ -26,7 +26,7 @@ namespace GamecraftModdingAPI.Blocks /// Whether the operation was successful public static bool MoveBlock(uint id, float3 vector) { - if (movementEngine.IsInGame && movementEngine.IsBuildMode()) + if (movementEngine.IsInGame && GamecraftModdingAPI.Utility.GameState.IsBuildMode()) { movementEngine.MoveBlock(id, vector); return true; @@ -45,7 +45,7 @@ namespace GamecraftModdingAPI.Blocks /// Whether the operation was successful public static bool MoveConnectedBlocks(uint id, float3 vector) { - if (movementEngine.IsInGame && movementEngine.IsBuildMode()) + if (movementEngine.IsInGame && GamecraftModdingAPI.Utility.GameState.IsBuildMode()) { movementEngine.MoveConnectedBlocks(id, vector); return true; diff --git a/GamecraftModdingAPI/Blocks/MovementEngine.cs b/GamecraftModdingAPI/Blocks/MovementEngine.cs index 77d73c4..ab4eaa4 100644 --- a/GamecraftModdingAPI/Blocks/MovementEngine.cs +++ b/GamecraftModdingAPI/Blocks/MovementEngine.cs @@ -79,10 +79,5 @@ namespace GamecraftModdingAPI.Blocks } return this.entitiesDB.QueryEntity(blockID, CommonExclusiveGroups.OWNED_BLOCKS_GROUP).position; } - - public bool IsBuildMode() - { - return GamecraftModdingAPI.Utility.GameState.IsBuildMode(); - } } } diff --git a/GamecraftModdingAPI/Blocks/Placement.cs b/GamecraftModdingAPI/Blocks/Placement.cs index 11c11eb..c029ebb 100644 --- a/GamecraftModdingAPI/Blocks/Placement.cs +++ b/GamecraftModdingAPI/Blocks/Placement.cs @@ -1,6 +1,7 @@ using System; using Unity.Mathematics; +using Svelto.ECS; using GamecraftModdingAPI.Utility; @@ -27,8 +28,8 @@ namespace GamecraftModdingAPI.Blocks /// The block's uniform scale - default scale is 1 (with 0.2 width) /// The block's non-uniform scale - 0 means is used /// The player who placed the block - /// Whether the operation was successful - public static bool PlaceBlock(BlockIDs block, float3 position, + /// The placed block's ID or null if failed + public static EGID? PlaceBlock(BlockIDs block, float3 position, float3 rotation = default, BlockColors color = BlockColors.Default, byte darkness = 0, int uscale = 1, float3 scale = default, uint playerId = 0) { @@ -36,19 +37,14 @@ namespace GamecraftModdingAPI.Blocks { try { - placementEngine.PlaceBlock(block, color, darkness, position, uscale, scale, playerId, rotation); + return placementEngine.PlaceBlock(block, color, darkness, position, uscale, scale, playerId, rotation); } catch (Exception e) { - uREPL.Log.Output(e.Message); -#if DEBUG - //Logging.LogException(e); -#endif - return false; - } - return true; + Logging.MetaDebugLog(e); + } } - return false; + return null; } public static void Init() diff --git a/GamecraftModdingAPI/Blocks/PlacementEngine.cs b/GamecraftModdingAPI/Blocks/PlacementEngine.cs index cb5804f..0b9293c 100644 --- a/GamecraftModdingAPI/Blocks/PlacementEngine.cs +++ b/GamecraftModdingAPI/Blocks/PlacementEngine.cs @@ -42,17 +42,17 @@ namespace GamecraftModdingAPI.Blocks } public EntitiesDB entitiesDB { get; set; } - internal static BlockEntityFactory _blockEntityFactory; //Injected from PlaceBlockEngine + private static BlockEntityFactory _blockEntityFactory; //Injected from PlaceBlockEngine - public void PlaceBlock(BlockIDs block, BlockColors color, byte darkness, float3 position, int uscale, + public EGID PlaceBlock(BlockIDs block, BlockColors color, byte darkness, float3 position, int uscale, float3 scale, uint playerId, float3 rotation) { //It appears that only the non-uniform scale has any visible effect, but if that's not given here it will be set to the uniform one if (darkness > 9) throw new Exception("That is too dark. Make sure to use 0-9 as darkness. (0 is default.)"); - BuildBlock((ushort) block, (byte) (color + darkness * 10), position, uscale, scale, rotation, playerId); + return BuildBlock((ushort) block, (byte) (color + darkness * 10), position, uscale, scale, rotation, playerId); } - private void BuildBlock(ushort block, byte color, float3 position, int uscale, float3 scale, float3 rot, uint playerId) + private EGID BuildBlock(ushort block, byte color, float3 position, int uscale, float3 scale, float3 rot, uint playerId) { if (_blockEntityFactory == null) throw new Exception("The factory is null."); @@ -80,21 +80,21 @@ namespace GamecraftModdingAPI.Blocks unitSnapOffset = 0, isUsingUnitSize = true }; EquippedColourStruct colour = new EquippedColourStruct {indexInPalette = color}; - EGID egid2; + EGID newBlockID; switch (category.category) { case CubeCategory.SpawnPoint: case CubeCategory.BuildingSpawnPoint: - egid2 = MachineEditingGroups.NewSpawnPointBlockID; + newBlockID = MachineEditingGroups.NewSpawnPointBlockID; break; default: - egid2 = MachineEditingGroups.NewBlockID; + newBlockID = MachineEditingGroups.NewBlockID; break; } EntityStructInitializer structInitializer = - _blockEntityFactory.Build(egid2, dbid); //The ghost block index is only used for triggers + _blockEntityFactory.Build(newBlockID, dbid); //The ghost block index is only used for triggers if (colour.indexInPalette != byte.MaxValue) structInitializer.Init(new ColourParameterEntityStruct { @@ -123,6 +123,7 @@ namespace GamecraftModdingAPI.Blocks ref PickedBlockExtraDataStruct pickedBlock = ref entitiesDB.QueryEntity(playerEGID); pickedBlock.placedBlockEntityID = playerEGID; pickedBlock.placedBlockWasAPickedBlock = false; + return newBlockID; } public string Name { get; } = "GamecraftModdingAPIPlacementGameEngine"; diff --git a/GamecraftModdingAPI/Blocks/RemovalEngine.cs b/GamecraftModdingAPI/Blocks/RemovalEngine.cs index 2e378f9..41e3c03 100644 --- a/GamecraftModdingAPI/Blocks/RemovalEngine.cs +++ b/GamecraftModdingAPI/Blocks/RemovalEngine.cs @@ -31,31 +31,11 @@ namespace GamecraftModdingAPI.Blocks return true; } - /// - /// Returns the block the player is currently looking at. - /// - /// The player's ID - /// The maximum distance from the player (default is the player's building reach) - /// The block's EGID or null if not found - public EGID? GetBlockUnderCursor(uint playerId, float maxDistance = -1f) - { - if (!entitiesDB.TryQueryMappedEntities( - CameraExclusiveGroups.CameraGroup, out var mapper)) - return null; - mapper.TryGetEntity(playerId, out CharacterCameraRayCastEntityStruct rayCast); - float distance = maxDistance < 0 - ? GhostBlockUtils.GetBuildInteractionDistance(entitiesDB, rayCast) - : maxDistance; - if (rayCast.hit && rayCast.distance <= distance) - return rayCast.hitEgid; - return null; - } - public void Ready() { - CommandManager.AddCommand(new SimpleCustomCommandEngine(() => + /*CommandManager.AddCommand(new SimpleCustomCommandEngine(() => { - var block = GetBlockUnderCursor(LocalPlayerIDUtility.GetLocalPlayerID(entitiesDB)); + var block = BlockUtility.GetBlockLookedAt(LocalPlayerIDUtility.GetLocalPlayerID(entitiesDB), entitiesDB); if (block.HasValue) { RemoveBlock(block.Value); @@ -63,7 +43,7 @@ namespace GamecraftModdingAPI.Blocks } else Log.Output("No block found where you're looking at."); - }, "removeCube", "Removes the cube you're looking at.")); + }, "removeCube", "Removes the cube you're looking at."));*/ } public EntitiesDB entitiesDB { get; set; } diff --git a/GamecraftModdingAPI/Blocks/Rotation.cs b/GamecraftModdingAPI/Blocks/Rotation.cs index a0b6785..b881cdb 100644 --- a/GamecraftModdingAPI/Blocks/Rotation.cs +++ b/GamecraftModdingAPI/Blocks/Rotation.cs @@ -26,7 +26,7 @@ namespace GamecraftModdingAPI.Blocks /// Whether the operation was successful public static bool RotateBlock(uint id, float3 vector) { - if (rotationEngine.IsInGame && rotationEngine.IsBuildMode()) + if (rotationEngine.IsInGame && GamecraftModdingAPI.Utility.GameState.IsBuildMode()) { rotationEngine.RotateBlock(id, vector); return true; @@ -43,7 +43,7 @@ namespace GamecraftModdingAPI.Blocks /// Whether the operation was successful public static bool RotateConnectedBlocks(uint id, float3 vector) { - if (rotationEngine.IsInGame && rotationEngine.IsBuildMode()) + if (rotationEngine.IsInGame && GamecraftModdingAPI.Utility.GameState.IsBuildMode()) { rotationEngine.RotateConnectedBlocks(id, vector); return true; diff --git a/GamecraftModdingAPI/Blocks/RotationEngine.cs b/GamecraftModdingAPI/Blocks/RotationEngine.cs index e84c7c2..8038739 100644 --- a/GamecraftModdingAPI/Blocks/RotationEngine.cs +++ b/GamecraftModdingAPI/Blocks/RotationEngine.cs @@ -78,10 +78,5 @@ namespace GamecraftModdingAPI.Blocks // TODO: Implement and figure out the math throw new NotImplementedException(); } - - public bool IsBuildMode() - { - return GamecraftModdingAPI.Utility.GameState.IsBuildMode(); - } } } diff --git a/GamecraftModdingAPI/Blocks/SignalEngine.cs b/GamecraftModdingAPI/Blocks/SignalEngine.cs index 6af4176..3b732ba 100644 --- a/GamecraftModdingAPI/Blocks/SignalEngine.cs +++ b/GamecraftModdingAPI/Blocks/SignalEngine.cs @@ -147,10 +147,5 @@ namespace GamecraftModdingAPI.Blocks } return res; } - - public bool IsSimulationMode() - { - return GamecraftModdingAPI.Utility.GameState.IsSimulationMode(); - } } } diff --git a/GamecraftModdingAPI/Blocks/Signals.cs b/GamecraftModdingAPI/Blocks/Signals.cs index 6b6d779..c844d3a 100644 --- a/GamecraftModdingAPI/Blocks/Signals.cs +++ b/GamecraftModdingAPI/Blocks/Signals.cs @@ -34,7 +34,7 @@ namespace GamecraftModdingAPI.Blocks public static void SetSignalByBlock(uint blockID, float signal, bool input = true, bool owned = true) { EGID egid = new EGID(blockID, owned ? BlockIdentifiers.OWNED_BLOCKS : BlockIdentifiers.FUNCTIONAL_BLOCK_PARTS); - if (signalEngine.IsInGame && signalEngine.IsSimulationMode()) + if (signalEngine.IsInGame && GameState.IsSimulationMode()) { signalEngine.SetSignal(egid, signal, out uint _, input); } @@ -42,7 +42,7 @@ namespace GamecraftModdingAPI.Blocks public static void SetSignalByBlock(EGID blockID, float signal, bool input = true) { - if (signalEngine.IsInGame && signalEngine.IsSimulationMode()) + if (signalEngine.IsInGame && GameState.IsSimulationMode()) { signalEngine.SetSignal(blockID, signal, out uint _, input); } @@ -56,7 +56,7 @@ namespace GamecraftModdingAPI.Blocks /// Whether to retrieve input IDs (true) or output IDs (false). public static void SetSignalByID(uint signalID, float signal, bool input = true) { - if (signalEngine.IsInGame && signalEngine.IsSimulationMode()) + if (signalEngine.IsInGame && GamecraftModdingAPI.Utility.GameState.IsSimulationMode()) { signalEngine.SetSignal(signalID, signal, input); } @@ -74,7 +74,7 @@ namespace GamecraftModdingAPI.Blocks public static float AddSignalByBlock(uint blockID, float signal, bool clamp = true, bool input = true, bool owned = true) { EGID egid = new EGID(blockID, owned ? BlockIdentifiers.OWNED_BLOCKS : BlockIdentifiers.FUNCTIONAL_BLOCK_PARTS); - if (signalEngine.IsInGame && signalEngine.IsSimulationMode()) + if (signalEngine.IsInGame && GamecraftModdingAPI.Utility.GameState.IsSimulationMode()) { return signalEngine.AddSignal(egid, signal, out uint _, clamp, input); } @@ -83,7 +83,7 @@ namespace GamecraftModdingAPI.Blocks public static float AddSignalByBlock(EGID blockID, float signal, bool clamp = true, bool input = true) { - if (signalEngine.IsInGame && signalEngine.IsSimulationMode()) + if (signalEngine.IsInGame && GamecraftModdingAPI.Utility.GameState.IsSimulationMode()) { return signalEngine.AddSignal(blockID, signal, out uint _, clamp, input); } @@ -100,7 +100,7 @@ namespace GamecraftModdingAPI.Blocks /// The signal's new value. public static float AddSignalByID(uint signalID, float signal, bool clamp = true, bool input = true) { - if (signalEngine.IsInGame && signalEngine.IsSimulationMode()) + if (signalEngine.IsInGame && GamecraftModdingAPI.Utility.GameState.IsSimulationMode()) { return signalEngine.AddSignal(signalID, signal, clamp, input); } @@ -117,7 +117,7 @@ namespace GamecraftModdingAPI.Blocks public static float GetSignalByBlock(uint blockID, bool input = true, bool owned = true) { EGID egid = new EGID(blockID, owned? BlockIdentifiers.OWNED_BLOCKS : BlockIdentifiers.FUNCTIONAL_BLOCK_PARTS); - if (signalEngine.IsInGame && signalEngine.IsSimulationMode()) + if (signalEngine.IsInGame && GamecraftModdingAPI.Utility.GameState.IsSimulationMode()) { return signalEngine.GetSignal(egid, out uint _, input); } @@ -126,7 +126,7 @@ namespace GamecraftModdingAPI.Blocks public static float GetSignalByBlock(EGID blockID, bool input = true) { - if (signalEngine.IsInGame && signalEngine.IsSimulationMode()) + if (signalEngine.IsInGame && GamecraftModdingAPI.Utility.GameState.IsSimulationMode()) { return signalEngine.GetSignal(blockID, out uint _, input); } @@ -141,7 +141,7 @@ namespace GamecraftModdingAPI.Blocks /// The signal's value. public static float GetSignalByID(uint signalID, bool input = true) { - if (signalEngine.IsInGame && signalEngine.IsSimulationMode()) + if (signalEngine.IsInGame && GamecraftModdingAPI.Utility.GameState.IsSimulationMode()) { return signalEngine.GetSignal(signalID, input); } -- 2.30.2 From 83427b806e60f7a544af85432a83eff2fb6ce784 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Tue, 28 Apr 2020 15:55:08 +0200 Subject: [PATCH 003/252] Update to Gamecraft 2020.04.27.14.21 --- GamecraftModdingAPI/Blocks/PlacementEngine.cs | 2 +- GamecraftModdingAPI/Blocks/SignalEngine.cs | 74 +++++++++++-------- .../Events/ModEventEntityStruct.cs | 2 +- .../GamecraftModdingAPI.csproj | 4 +- GamecraftModdingAPI/Utility/FullGameFields.cs | 8 +- 5 files changed, 51 insertions(+), 39 deletions(-) diff --git a/GamecraftModdingAPI/Blocks/PlacementEngine.cs b/GamecraftModdingAPI/Blocks/PlacementEngine.cs index 0b9293c..879141c 100644 --- a/GamecraftModdingAPI/Blocks/PlacementEngine.cs +++ b/GamecraftModdingAPI/Blocks/PlacementEngine.cs @@ -92,7 +92,7 @@ namespace GamecraftModdingAPI.Blocks break; } - EntityStructInitializer + EntityComponentInitializer structInitializer = _blockEntityFactory.Build(newBlockID, dbid); //The ghost block index is only used for triggers if (colour.indexInPalette != byte.MaxValue) diff --git a/GamecraftModdingAPI/Blocks/SignalEngine.cs b/GamecraftModdingAPI/Blocks/SignalEngine.cs index 3b732ba..b40b0bb 100644 --- a/GamecraftModdingAPI/Blocks/SignalEngine.cs +++ b/GamecraftModdingAPI/Blocks/SignalEngine.cs @@ -56,12 +56,8 @@ namespace GamecraftModdingAPI.Blocks public bool SetSignal(uint signalID, float signal, bool input = true) { - ExclusiveGroup group = input ? NamedExclusiveGroup.Group : NamedExclusiveGroup.Group; - if (entitiesDB.Exists(signalID, group)) - { - entitiesDB.QueryEntity(signalID, group).anyChannel.valueAsFloat = signal; - return true; - } + var array = GetSignalStruct(signalID, out uint index, input); + if (array != null) array[index].valueAsFloat = signal; return false; } @@ -73,25 +69,27 @@ namespace GamecraftModdingAPI.Blocks public float AddSignal(uint signalID, float signal, bool clamp = true, bool input = true) { - ExclusiveGroup group = input ? NamedExclusiveGroup.Group : NamedExclusiveGroup.Group; - if (entitiesDB.Exists(signalID, group)) - { - ref PortEntityStruct pes = ref entitiesDB.QueryEntity(signalID, group); - pes.anyChannel.valueAsFloat += signal; - if (clamp) - { - if (pes.anyChannel.valueAsFloat > Signals.POSITIVE_HIGH) - { - pes.anyChannel.valueAsFloat = Signals.POSITIVE_HIGH; - } - else if (pes.anyChannel.valueAsFloat < Signals.NEGATIVE_HIGH) - { - pes.anyChannel.valueAsFloat = Signals.NEGATIVE_HIGH; - } - return pes.anyChannel.valueAsFloat; - } - } - return signal; + var array = GetSignalStruct(signalID, out uint index, input); + if (array != null) + { + ref var channelData = ref array[index]; + channelData.valueAsFloat += signal; + if (clamp) + { + if (channelData.valueAsFloat > Signals.POSITIVE_HIGH) + { + channelData.valueAsFloat = Signals.POSITIVE_HIGH; + } + else if (channelData.valueAsFloat < Signals.NEGATIVE_HIGH) + { + channelData.valueAsFloat = Signals.NEGATIVE_HIGH; + } + + return channelData.valueAsFloat; + } + } + + return signal; } public float GetSignal(EGID blockID, out uint signalID, bool input = true) @@ -102,12 +100,8 @@ namespace GamecraftModdingAPI.Blocks public float GetSignal(uint signalID, bool input = true) { - ExclusiveGroup group = input ? NamedExclusiveGroup.Group : NamedExclusiveGroup.Group; - if (entitiesDB.Exists(signalID, group)) - { - return entitiesDB.QueryEntity(signalID, group).anyChannel.valueAsFloat; - } - return 0f; + var array = GetSignalStruct(signalID, out uint index, input); + return array?[index].valueAsFloat ?? 0f; } public uint[] GetSignalIDs(EGID blockID, bool input = true) @@ -147,5 +141,23 @@ namespace GamecraftModdingAPI.Blocks } return res; } + + private ChannelDataStruct[] GetSignalStruct(uint signalID, out uint index, bool input = true) + { + ExclusiveGroup group = input + ? NamedExclusiveGroup.Group + : NamedExclusiveGroup.Group; + if (entitiesDB.Exists(signalID, group)) + { + index = entitiesDB.QueryEntity(signalID, group).anyChannelIndex; + ChannelDataStruct[] channelData = entitiesDB + .QueryEntities(NamedExclusiveGroup.Group) + .ToFastAccess(out uint _); + return channelData; + } + + index = 0; + return null; + } } } diff --git a/GamecraftModdingAPI/Events/ModEventEntityStruct.cs b/GamecraftModdingAPI/Events/ModEventEntityStruct.cs index 03bd65f..cc945ec 100644 --- a/GamecraftModdingAPI/Events/ModEventEntityStruct.cs +++ b/GamecraftModdingAPI/Events/ModEventEntityStruct.cs @@ -11,7 +11,7 @@ namespace GamecraftModdingAPI.Events /// /// The event entity struct /// - public struct ModEventEntityStruct : IEntityStruct, INeedEGID + public struct ModEventEntityStruct : IEntityComponent, INeedEGID { /// /// The type of event that has been emitted diff --git a/GamecraftModdingAPI/GamecraftModdingAPI.csproj b/GamecraftModdingAPI/GamecraftModdingAPI.csproj index 4371236..e6bec2b 100644 --- a/GamecraftModdingAPI/GamecraftModdingAPI.csproj +++ b/GamecraftModdingAPI/GamecraftModdingAPI.csproj @@ -232,8 +232,8 @@ ..\ref\Gamecraft_Data\Managed\StringFormatter.dll - - ..\ref\Gamecraft_Data\Managed\Svelto.Common.dll + + ..\ref\Gamecraft_Data\Managed\Svelto.Common_3.dll ..\ref\Gamecraft_Data\Managed\Svelto.ECS.Debugger.dll diff --git a/GamecraftModdingAPI/Utility/FullGameFields.cs b/GamecraftModdingAPI/Utility/FullGameFields.cs index d90ef44..377f451 100644 --- a/GamecraftModdingAPI/Utility/FullGameFields.cs +++ b/GamecraftModdingAPI/Utility/FullGameFields.cs @@ -64,11 +64,11 @@ namespace GamecraftModdingAPI.Utility } } - public static SimpleSubmissionEntityViewScheduler _mainGameSubmissionScheduler + public static SimpleEntitiesSubmissionScheduler _mainGameSubmissionScheduler { get { - return (SimpleSubmissionEntityViewScheduler)fgcr?.Field("_mainGameSubmissionScheduler").GetValue(); + return (SimpleEntitiesSubmissionScheduler)fgcr?.Field("_sub").Field("_mainGameSubmissionScheduler").GetValue(); } } @@ -112,13 +112,13 @@ namespace GamecraftModdingAPI.Utility } } - public static UnityEntitySubmissionScheduler _frontEndSubmissionScheduler + /*public static UnityEntitySubmissionScheduler _frontEndSubmissionScheduler { get { return (UnityEntitySubmissionScheduler)fgcr?.Field("_frontEndSubmissionScheduler").GetValue(); } - } + }*/ public static LoadingScreenImplementer _loadingScreen { -- 2.30.2 From 07ba6f2dc450ca9ac43214b0e9e93a4c74d8da65 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Tue, 28 Apr 2020 21:56:34 -0400 Subject: [PATCH 004/252] Add game file persistence functionality --- GamecraftModdingAPI/Main.cs | 1 + .../DeserializeFromDiskEntitiesEnginePatch.cs | 87 +++++++++++++++++ .../Persistence/IEntitySerializer.cs | 18 ++++ .../SaveAndLoadCompositionRootPatch.cs | 18 ++++ .../Persistence/SaveGameEnginePatch.cs | 81 ++++++++++++++++ .../Persistence/SerializerManager.cs | 72 ++++++++++++++ .../Persistence/SimpleEntitySerializer.cs | 63 ++++++++++++ .../Tests/GamecraftModdingAPIPluginTest.cs | 3 + .../Utility/ApiExclusiveGroups.cs | 2 + .../Utility/VersionTracking.cs | 96 +++++++++++++++++++ 10 files changed, 441 insertions(+) create mode 100644 GamecraftModdingAPI/Persistence/DeserializeFromDiskEntitiesEnginePatch.cs create mode 100644 GamecraftModdingAPI/Persistence/IEntitySerializer.cs create mode 100644 GamecraftModdingAPI/Persistence/SaveAndLoadCompositionRootPatch.cs create mode 100644 GamecraftModdingAPI/Persistence/SaveGameEnginePatch.cs create mode 100644 GamecraftModdingAPI/Persistence/SerializerManager.cs create mode 100644 GamecraftModdingAPI/Persistence/SimpleEntitySerializer.cs create mode 100644 GamecraftModdingAPI/Utility/VersionTracking.cs diff --git a/GamecraftModdingAPI/Main.cs b/GamecraftModdingAPI/Main.cs index ff8b63c..e0717d2 100644 --- a/GamecraftModdingAPI/Main.cs +++ b/GamecraftModdingAPI/Main.cs @@ -48,6 +48,7 @@ namespace GamecraftModdingAPI // init utility Logging.MetaDebugLog($"Initializing Utility"); Utility.GameState.Init(); + Utility.VersionTracking.Init(); // create default event emitters Logging.MetaDebugLog($"Initializing Events"); EventManager.AddEventEmitter(new SimpleEventEmitterEngine(EventType.ApplicationInitialized, "GamecraftModdingAPIApplicationInitializedEventEmitter", false)); diff --git a/GamecraftModdingAPI/Persistence/DeserializeFromDiskEntitiesEnginePatch.cs b/GamecraftModdingAPI/Persistence/DeserializeFromDiskEntitiesEnginePatch.cs new file mode 100644 index 0000000..8f3482f --- /dev/null +++ b/GamecraftModdingAPI/Persistence/DeserializeFromDiskEntitiesEnginePatch.cs @@ -0,0 +1,87 @@ +using System; +using System.Text; +using System.Reflection; + +using RobocraftX.Common; +using Svelto.DataStructures; +using Svelto.ECS; +using Svelto.ECS.Serialization; + +using Harmony; +using GamecraftModdingAPI.Utility; + +namespace GamecraftModdingAPI.Persistence +{ + [HarmonyPatch] + class DeserializeFromDiskEntitiesEnginePatch + { + internal static EntitiesDB entitiesDB = null; + + private static readonly byte[] frameStart = Encoding.UTF8.GetBytes("\0\0\0GamecraftModdingAPI\0\0\0"); + + public static void Prefix(ref ISerializationData ____serializationData, ref FasterList ____bytesStream, ref IEntitySerialization ____entitySerializer, bool ____spawnBlocksOnly) + { + if (____spawnBlocksOnly) return; // only run after second deserialization call (when all vanilla stuff is already deserialized) + uint originalPos = ____serializationData.dataPos; + Logging.MetaDebugLog($"dataPos: {originalPos}"); + BinaryBufferReader bbr = new BinaryBufferReader(____bytesStream.ToArrayFast(out uint count), ____serializationData.dataPos); + byte[] frameBuffer = new byte[frameStart.Length]; + Logging.MetaDebugLog($"serial data count: {____serializationData.data.count} capacity: {____serializationData.data.capacity}"); + int i = 0; + // match frame start + while (frameBuffer != frameStart && bbr.Position < count-frameStart.Length) + { + i = 0; + frameBuffer[0] = bbr.ReadByte(); + while (frameBuffer[i] == frameStart[i] && bbr.Position < count - frameStart.Length + i) + { + i++; + if (i == frameStart.Length) break; + frameBuffer[i] = bbr.ReadByte(); + } + if (i == frameStart.Length) break; + } + // abort if at end of file + if (bbr.Position >= count - frameStart.Length) + { + Logging.MetaLog("Skipping deserialization (no frame found)"); + return; + } + //____serializationData.dataPos = bbr.Position; + Logging.MetaDebugLog($"dataPos (after frame): {bbr.Position}"); + uint customComponentsCount = bbr.ReadUint(); + for (uint c = 0; c < customComponentsCount; c++) + { + // determine component from info + uint nameLength = bbr.ReadUint(); + byte[] nameBytes = new byte[nameLength]; + bbr.ReadBytes(nameBytes, nameLength); + string name = Encoding.UTF8.GetString(nameBytes); + Logging.MetaDebugLog($"Component name: {name} (len: {nameLength})"); + uint componentEnd = bbr.ReadUint(); + ____serializationData.dataPos = bbr.Position; + if (SerializerManager.ExistsSerializer(name)) + { + // deserialize component + IEntitySerializer serial = SerializerManager.GetSerializer(name); + if (!serial.Deserialize(ref ____serializationData, ____entitySerializer)) + { + Logging.MetaDebugLog("Component deserialization failed!"); + } + } + else + { + Logging.MetaDebugLog("Skipping component deserialization: not found!"); + } + bbr = new BinaryBufferReader(____bytesStream.ToArrayFast(out count), componentEnd); + } + ____serializationData.dataPos = originalPos; // change back to original end point (just in case) + Logging.MetaDebugLog("Deserialization complete"); + } + + public static MethodBase TargetMethod() + { + return AccessTools.Method("RobocraftX.SaveAndLoad.DeserializeFromDiskEntitiesEngine:LoadingFinished");//AccessTools.TypeByName("RobocraftX.SaveAndLoad.DeserializeFromDiskEntities") + } + } +} diff --git a/GamecraftModdingAPI/Persistence/IEntitySerializer.cs b/GamecraftModdingAPI/Persistence/IEntitySerializer.cs new file mode 100644 index 0000000..c32ee17 --- /dev/null +++ b/GamecraftModdingAPI/Persistence/IEntitySerializer.cs @@ -0,0 +1,18 @@ +using System; + +using Svelto.ECS; +using Svelto.ECS.Serialization; + +using GamecraftModdingAPI.Utility; + +namespace GamecraftModdingAPI.Persistence +{ + public interface IEntitySerializer : IDeserializationFactory, IQueryingEntitiesEngine + { + IEntityFactory EntityFactory { set; } + + bool Serialize(ref ISerializationData serializationData, EntitiesDB entitiesDB, IEntitySerialization entitySerializer); + + bool Deserialize(ref ISerializationData serializationData, IEntitySerialization entitySerializer); + } +} diff --git a/GamecraftModdingAPI/Persistence/SaveAndLoadCompositionRootPatch.cs b/GamecraftModdingAPI/Persistence/SaveAndLoadCompositionRootPatch.cs new file mode 100644 index 0000000..a510580 --- /dev/null +++ b/GamecraftModdingAPI/Persistence/SaveAndLoadCompositionRootPatch.cs @@ -0,0 +1,18 @@ +using System; + +using RobocraftX.SaveAndLoad; +using Svelto.ECS; + +using Harmony; + +namespace GamecraftModdingAPI.Persistence +{ + [HarmonyPatch(typeof(SaveAndLoadCompositionRoot), "Compose")] + class SaveAndLoadCompositionRootPatch + { + public static void Prefix(EnginesRoot enginesRoot) + { + SerializerManager.RegisterSerializers(enginesRoot); + } + } +} diff --git a/GamecraftModdingAPI/Persistence/SaveGameEnginePatch.cs b/GamecraftModdingAPI/Persistence/SaveGameEnginePatch.cs new file mode 100644 index 0000000..21cd68a --- /dev/null +++ b/GamecraftModdingAPI/Persistence/SaveGameEnginePatch.cs @@ -0,0 +1,81 @@ +using System; +using System.Text; +using System.Reflection; + +using RobocraftX.Common; +using RobocraftX.SaveAndLoad; +using Svelto.DataStructures; +using Svelto.ECS; +using Svelto.ECS.Serialization; + +using GamecraftModdingAPI.Utility; +using Harmony; + +namespace GamecraftModdingAPI.Persistence +{ + [HarmonyPatch] + class SaveGameEnginePatch + { + private static readonly byte[] frameStart = Encoding.UTF8.GetBytes("\0\0\0GamecraftModdingAPI\0\0\0"); + + public static void Postfix(ref ISerializationData serializationData, EntitiesDB entitiesDB, IEntitySerialization entitySerializer) + { + Logging.MetaDebugLog("Running Postfix on SerializeGameToBuffer: serializing custom components..."); + if (SerializerManager.GetSerializersCount() == 0) + { + Logging.MetaDebugLog("Skipping component serialization: no serializers registered!"); + return; + } + serializationData.data.ExpandBy((uint)frameStart.Length); + BinaryBufferWriter bbw = new BinaryBufferWriter(serializationData.data.ToArrayFast(out uint buffLen), serializationData.dataPos); + uint originalPos = serializationData.dataPos; + Logging.MetaDebugLog($"dataPos: {originalPos}"); + // Add frame start so it's easier to find GamecraftModdingAPI-serialized components + for (int i = 0; i < frameStart.Length; i++) + { + bbw.Write(frameStart[i]); + } + Logging.MetaDebugLog($"dataPos (after frame start): {bbw.Position}"); + serializationData.data.ExpandBy(4u); + bbw.Write((uint)SerializerManager.GetSerializersCount()); + string[] serializerKeys = SerializerManager.GetSerializerNames(); + for (uint c = 0; c < serializerKeys.Length; c++) + { + Logging.MetaDebugLog($"dataPos (loop start): {bbw.Position}"); + // write component info + serializationData.data.ExpandBy(4u + (uint)serializerKeys[c].Length); + bbw.Write((uint)serializerKeys[c].Length); + Logging.MetaDebugLog($"dataPos (now): {bbw.Position}"); + byte[] nameBytes = Encoding.UTF8.GetBytes(serializerKeys[c]); + for (int i = 0; i < nameBytes.Length; i++) + { + bbw.Write(nameBytes[i]); + } + Logging.MetaDebugLog($"dataPos (now): {bbw.Position}"); + serializationData.data.ExpandBy(4u); + serializationData.dataPos = bbw.Position + 4u; + Logging.MetaDebugLog($"dataPos (now): {bbw.Position}"); + Logging.MetaDebugLog($"dataPos (appears to be): {serializationData.dataPos}"); + // serialize component + IEntitySerializer serializer = SerializerManager.GetSerializer(serializerKeys[c]); + if (!serializer.Serialize(ref serializationData, entitiesDB, entitySerializer)) + { + Logging.MetaDebugLog("Component serialization failed!"); + } + Logging.MetaDebugLog($"dataPos (now): {bbw.Position}"); + bbw.Write((uint)serializationData.dataPos); + Logging.MetaDebugLog($"dataPos (now): {bbw.Position}"); + bbw = new BinaryBufferWriter(serializationData.data.ToArrayFast(out buffLen), serializationData.dataPos); + Logging.MetaDebugLog($"dataPos (loop end): {bbw.Position}"); + } + serializationData.data.Trim(); + Logging.MetaDebugLog($"dataPos (end): {bbw.Position}"); + Logging.MetaDebugLog("Serialization complete"); + } + + public static MethodBase TargetMethod() + { + return typeof(SaveGameEngine).GetMethod("SerializeGameToBuffer"); + } + } +} diff --git a/GamecraftModdingAPI/Persistence/SerializerManager.cs b/GamecraftModdingAPI/Persistence/SerializerManager.cs new file mode 100644 index 0000000..ae4d9c3 --- /dev/null +++ b/GamecraftModdingAPI/Persistence/SerializerManager.cs @@ -0,0 +1,72 @@ +using System; +using System.Collections.Generic; +using System.Linq; + +using Svelto.ECS; +using Svelto.ECS.Serialization; + +using GamecraftModdingAPI.Utility; + +namespace GamecraftModdingAPI.Persistence +{ + public static class SerializerManager + { + private static Dictionary _serializers = new Dictionary(); + + private static Dictionary> _registrations = new Dictionary>(); + + private static EnginesRoot _lastEnginesRoot; + + public static void AddSerializer(IEntitySerializer serializer) where T : ISerializableEntityDescriptor, new() + { + string name = typeof(T).FullName; + _serializers[name] = serializer; + _registrations[name] = (IEntitySerialization ies) => { ies.RegisterSerializationFactory(serializer); }; + if (_lastEnginesRoot != null) + { + serializer.EntityFactory = _lastEnginesRoot.GenerateEntityFactory(); + _registrations[name].Invoke(_lastEnginesRoot.GenerateEntitySerializer()); + _lastEnginesRoot.AddEngine(serializer); + } + } + + public static bool ExistsSerializer(string name) + { + return _serializers.ContainsKey(name); + } + + public static bool ExistsSerializer(IEntitySerializer serializer) where T : ISerializableEntityDescriptor, new() + { + return ExistsSerializer(typeof(T).FullName); + } + + public static IEntitySerializer GetSerializer(string name) + { + return _serializers[name]; + } + + public static string[] GetSerializerNames() + { + return _serializers.Keys.ToArray(); + } + + public static int GetSerializersCount() + { + return _serializers.Count; + } + + public static void RegisterSerializers(EnginesRoot enginesRoot) + { + _lastEnginesRoot = enginesRoot; + IEntityFactory factory = enginesRoot.GenerateEntityFactory(); + IEntitySerialization ies = enginesRoot.GenerateEntitySerializer(); + foreach (string key in _serializers.Keys) + { + Logging.MetaDebugLog($"Registering IEntitySerializer for {key}"); + _serializers[key].EntityFactory = factory; + _registrations[key].Invoke(ies); + enginesRoot.AddEngine(_serializers[key]); + } + } + } +} diff --git a/GamecraftModdingAPI/Persistence/SimpleEntitySerializer.cs b/GamecraftModdingAPI/Persistence/SimpleEntitySerializer.cs new file mode 100644 index 0000000..e18943f --- /dev/null +++ b/GamecraftModdingAPI/Persistence/SimpleEntitySerializer.cs @@ -0,0 +1,63 @@ +using System; + +using Svelto.ECS; +using Svelto.ECS.Serialization; + +using RobocraftX.Common; + +namespace GamecraftModdingAPI.Persistence +{ + public class SimpleEntitySerializer : IEntitySerializer where Descriptor : ISerializableEntityDescriptor, new() + { + public delegate EGID[] GetEntitiesToSerialize(EntitiesDB entitiesDB); + + private GetEntitiesToSerialize getEntitiesToSerialize; + + protected int serializationType; + + public IEntityFactory EntityFactory { set; protected get; } + + public EntitiesDB entitiesDB { set; protected get; } + + public EntityComponentInitializer BuildDeserializedEntity(EGID egid, ISerializationData serializationData, ISerializableEntityDescriptor entityDescriptor, int serializationType, IEntitySerialization entitySerialization) + { + EntityComponentInitializer esi = EntityFactory.BuildEntity(egid); + entitySerialization.DeserializeEntityComponents(serializationData, entityDescriptor, ref esi, serializationType); + return esi; + } + + public bool Deserialize(ref ISerializationData serializationData, IEntitySerialization entitySerializer) + { + BinaryBufferReader bbr = new BinaryBufferReader(serializationData.data.ToArrayFast(out uint count), serializationData.dataPos); + uint entityCount = bbr.ReadUint(); + serializationData.dataPos = bbr.Position; + for (uint i = 0; i < entityCount; i++) + { + entitySerializer.DeserializeEntity(serializationData, serializationType); + } + return true; + } + + public void Ready() { } + + public bool Serialize(ref ISerializationData serializationData, EntitiesDB entitiesDB, IEntitySerialization entitySerializer) + { + serializationData.data.ExpandBy(4u); + BinaryBufferWriter bbw = new BinaryBufferWriter(serializationData.data.ToArrayFast(out uint count), serializationData.dataPos); + EGID[] toSerialize = getEntitiesToSerialize(entitiesDB); + bbw.Write((uint)toSerialize.Length); + serializationData.dataPos = bbw.Position; + for (uint i = 0; i < toSerialize.Length; i++) + { + entitySerializer.SerializeEntity(toSerialize[i], serializationData, serializationType); + } + return true; + } + + public SimpleEntitySerializer(GetEntitiesToSerialize getEntitiesToSerialize) + { + this.getEntitiesToSerialize = getEntitiesToSerialize; + serializationType = (int)SerializationType.Storage; + } + } +} diff --git a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs index dac4312..11d63c6 100644 --- a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs +++ b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs @@ -44,6 +44,7 @@ namespace GamecraftModdingAPI.Tests FileLog.Reset(); HarmonyInstance.DEBUG = true; GamecraftModdingAPI.Main.Init(); + Logging.MetaDebugLog($"Version group id {(uint)ApiExclusiveGroups.versionGroup}"); // in case Steam is not installed/running // this will crash the game slightly later during startup //SteamInitPatch.ForcePassSteamCheck = true; @@ -55,6 +56,8 @@ namespace GamecraftModdingAPI.Tests Logging.MetaDebugLog("Audio Mixers: "+string.Join(",", AudioTools.GetMixers())); //AudioTools.SetVolume(0.0f, "Music"); // The game now sets this from settings again after this is called :( + Utility.VersionTracking.Enable(); + // debug/test handlers EventManager.AddEventHandler(new SimpleEventHandlerEngine(() => { Logging.Log("App Inited event!"); }, () => { }, EventType.ApplicationInitialized, "appinit API debug")); diff --git a/GamecraftModdingAPI/Utility/ApiExclusiveGroups.cs b/GamecraftModdingAPI/Utility/ApiExclusiveGroups.cs index df32418..5538404 100644 --- a/GamecraftModdingAPI/Utility/ApiExclusiveGroups.cs +++ b/GamecraftModdingAPI/Utility/ApiExclusiveGroups.cs @@ -13,5 +13,7 @@ namespace GamecraftModdingAPI.Utility public static readonly ExclusiveGroup eventsExclusiveGroup = new ExclusiveGroup(); public static uint eventID; + + public static readonly ExclusiveGroup versionGroup = new ExclusiveGroup("GamecraftModdingAPIVersion"); } } diff --git a/GamecraftModdingAPI/Utility/VersionTracking.cs b/GamecraftModdingAPI/Utility/VersionTracking.cs new file mode 100644 index 0000000..108220c --- /dev/null +++ b/GamecraftModdingAPI/Utility/VersionTracking.cs @@ -0,0 +1,96 @@ +using System; +using System.Reflection; + +using RobocraftX.Common; +using Svelto.ECS; +using Svelto.ECS.Serialization; + +using GamecraftModdingAPI.Persistence; +using GamecraftModdingAPI.Events; + +namespace GamecraftModdingAPI.Utility +{ + public static class VersionTracking + { + private static readonly VersionTrackingEngine versionEngine = new VersionTrackingEngine(); + + private static bool isEnabled = false; + + public static uint GetVersion() + { + if (!isEnabled) return 0u; + return versionEngine.GetGameVersion(); + } + + public static void Enable() + { + EventManager.AddEventEmitter(versionEngine); + isEnabled = true; + } + + public static void Disable() + { + EventManager.AddEventEmitter(versionEngine); + isEnabled = false; + } + + public static void Init() + { + SerializerManager.AddSerializer(new SimpleEntitySerializer( + (_) => { return new EGID[1] { new EGID(0u, ApiExclusiveGroups.versionGroup) }; } + )); + } + } + + internal class VersionTrackingEngine : IEventEmitterEngine + { + public string Name { get; } = "GamecraftModdingAPIVersionTrackingGameEngine"; + + public EntitiesDB entitiesDB { set; private get; } + + public int type => -1; + + public bool isRemovable => false; + + public IEntityFactory Factory { set; private get; } + + public void Dispose() { } + + public void Ready() + { + EGID egid = new EGID(0u, ApiExclusiveGroups.versionGroup); + if (!entitiesDB.Exists(egid)) + { + Version currentVersion = Assembly.GetExecutingAssembly().GetName().Version; + int v = (currentVersion.Major * 1000) + (currentVersion.Minor); + Factory.BuildEntity(egid).Init(new ModVersionStruct + { + version = (uint)v + }); + } + } + + public uint GetGameVersion() + { + return entitiesDB.QueryUniqueEntity(ApiExclusiveGroups.versionGroup).version; + } + + public void Emit() { } + } + + public struct ModVersionStruct : IEntityComponent + { + public uint version; + } + + public class ModVersionDescriptor: SerializableEntityDescriptor + { + [HashName("GamecraftModdingAPIVersionV0")] + public class _ModVersionDescriptor : IEntityDescriptor + { + public IComponentBuilder[] componentsToBuild { get; } = new IComponentBuilder[]{ + new SerializableComponentBuilder(((int)SerializationType.Network, new DefaultSerializer()), ((int)SerializationType.Storage, new DefaultSerializer())), + }; + } + } +} -- 2.30.2 From 36516ec185944210ebdcf7e33c819a4b5e9ea77b Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Tue, 28 Apr 2020 22:59:36 -0400 Subject: [PATCH 005/252] Add Persistence documentation --- .../Persistence/IEntitySerializer.cs | 20 +++++++++++++++++++ .../Persistence/SerializerManager.cs | 5 +++++ .../Persistence/SimpleEntitySerializer.cs | 10 ++++++++++ .../Utility/VersionTracking.cs | 14 +++++++++++++ 4 files changed, 49 insertions(+) diff --git a/GamecraftModdingAPI/Persistence/IEntitySerializer.cs b/GamecraftModdingAPI/Persistence/IEntitySerializer.cs index c32ee17..a060f3c 100644 --- a/GamecraftModdingAPI/Persistence/IEntitySerializer.cs +++ b/GamecraftModdingAPI/Persistence/IEntitySerializer.cs @@ -7,12 +7,32 @@ using GamecraftModdingAPI.Utility; namespace GamecraftModdingAPI.Persistence { + /// + /// Entity serializer and deserializer interface for storing and retrieving data in a Gamecraft save file (GameSave.GC). + /// public interface IEntitySerializer : IDeserializationFactory, IQueryingEntitiesEngine { + /// + /// The entity factory used for creating entities and entity components. + /// + /// The entity factory. IEntityFactory EntityFactory { set; } + /// + /// Serialize the entities. + /// + /// Whether serialization was successful. + /// Serialized data to write to (writes to GameSave.GC). + /// Entities db for the game. + /// Entity serializer with support for single-entity serialization. bool Serialize(ref ISerializationData serializationData, EntitiesDB entitiesDB, IEntitySerialization entitySerializer); + /// + /// Deserialize the entities. + /// + /// Whether deserialization was successful. + /// Serialized data to read from (read from GameSave.GC). + /// Entity serializer with support for single-entity deserialization. bool Deserialize(ref ISerializationData serializationData, IEntitySerialization entitySerializer); } } diff --git a/GamecraftModdingAPI/Persistence/SerializerManager.cs b/GamecraftModdingAPI/Persistence/SerializerManager.cs index ae4d9c3..0584834 100644 --- a/GamecraftModdingAPI/Persistence/SerializerManager.cs +++ b/GamecraftModdingAPI/Persistence/SerializerManager.cs @@ -9,6 +9,11 @@ using GamecraftModdingAPI.Utility; namespace GamecraftModdingAPI.Persistence { + /// + /// Keeps track of serializers. + /// This is used to add and retrieve serializers. + /// Added IEntitySerializations are used in serializing and deserializing Gamecraft save files (GameSave.GC). + /// public static class SerializerManager { private static Dictionary _serializers = new Dictionary(); diff --git a/GamecraftModdingAPI/Persistence/SimpleEntitySerializer.cs b/GamecraftModdingAPI/Persistence/SimpleEntitySerializer.cs index e18943f..1048edb 100644 --- a/GamecraftModdingAPI/Persistence/SimpleEntitySerializer.cs +++ b/GamecraftModdingAPI/Persistence/SimpleEntitySerializer.cs @@ -7,8 +7,14 @@ using RobocraftX.Common; namespace GamecraftModdingAPI.Persistence { + /// + /// Simple entity serializer sufficient for simple entity components. + /// public class SimpleEntitySerializer : IEntitySerializer where Descriptor : ISerializableEntityDescriptor, new() { + /// + /// Delegate function called when the serializer needs to know what entities to serialize. + /// public delegate EGID[] GetEntitiesToSerialize(EntitiesDB entitiesDB); private GetEntitiesToSerialize getEntitiesToSerialize; @@ -54,6 +60,10 @@ namespace GamecraftModdingAPI.Persistence return true; } + /// + /// Construct the entity serializer. + /// + /// Provider of entity IDs to serialize. public SimpleEntitySerializer(GetEntitiesToSerialize getEntitiesToSerialize) { this.getEntitiesToSerialize = getEntitiesToSerialize; diff --git a/GamecraftModdingAPI/Utility/VersionTracking.cs b/GamecraftModdingAPI/Utility/VersionTracking.cs index 108220c..3b83cc2 100644 --- a/GamecraftModdingAPI/Utility/VersionTracking.cs +++ b/GamecraftModdingAPI/Utility/VersionTracking.cs @@ -10,24 +10,38 @@ using GamecraftModdingAPI.Events; namespace GamecraftModdingAPI.Utility { + /// + /// Tracks the API version the current game was built for. + /// For compatibility reasons, this must be enabled before it will work. + /// public static class VersionTracking { private static readonly VersionTrackingEngine versionEngine = new VersionTrackingEngine(); private static bool isEnabled = false; + /// + /// Gets the API version saved in the current game. + /// + /// The version. public static uint GetVersion() { if (!isEnabled) return 0u; return versionEngine.GetGameVersion(); } + /// + /// Enable API version tracking. + /// public static void Enable() { EventManager.AddEventEmitter(versionEngine); isEnabled = true; } + /// + /// Disable API version tracking. + /// public static void Disable() { EventManager.AddEventEmitter(versionEngine); -- 2.30.2 From 1faa9898f7aa12a85648844e03e6fbf439b074f0 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Wed, 29 Apr 2020 12:07:06 -0400 Subject: [PATCH 006/252] Version 0.2.2 --- GamecraftModdingAPI/GamecraftModdingAPI.csproj | 2 +- doxygen.conf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/GamecraftModdingAPI/GamecraftModdingAPI.csproj b/GamecraftModdingAPI/GamecraftModdingAPI.csproj index e6bec2b..9b76ea5 100644 --- a/GamecraftModdingAPI/GamecraftModdingAPI.csproj +++ b/GamecraftModdingAPI/GamecraftModdingAPI.csproj @@ -3,7 +3,7 @@ net472 true - 0.2.0 + 0.2.2 Exmods GNU General Public Licence 3+ https://git.exmods.org/modtainers/GamecraftModdingAPI diff --git a/doxygen.conf b/doxygen.conf index 396453c..4596b01 100644 --- a/doxygen.conf +++ b/doxygen.conf @@ -38,7 +38,7 @@ PROJECT_NAME = "GamecraftModdingAPI" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = "v0.2.0" +PROJECT_NUMBER = "v0.2.2" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a -- 2.30.2 From 934b542ea12e72a890cf0cec3d1c0abe24ca15cc Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Thu, 14 May 2020 11:42:34 -0400 Subject: [PATCH 007/252] Fix build errors from GC update --- GamecraftModdingAPI/Blocks/BlockIdentifiers.cs | 4 ++-- GamecraftModdingAPI/Blocks/PlacementEngine.cs | 2 +- GamecraftModdingAPI/Events/GameStateBuildEmitterEngine.cs | 8 ++++---- .../Events/GameStateSimulationEmitterEngine.cs | 6 +++--- GamecraftModdingAPI/Input/FakeInput.cs | 4 ++-- GamecraftModdingAPI/Utility/GameStateEngine.cs | 4 ++-- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/GamecraftModdingAPI/Blocks/BlockIdentifiers.cs b/GamecraftModdingAPI/Blocks/BlockIdentifiers.cs index 13bafce..6da100d 100644 --- a/GamecraftModdingAPI/Blocks/BlockIdentifiers.cs +++ b/GamecraftModdingAPI/Blocks/BlockIdentifiers.cs @@ -32,9 +32,9 @@ namespace GamecraftModdingAPI.Blocks /// public static ExclusiveGroup SIM_BLOCKS_DISABLED { get { return CommonExclusiveGroups.BLOCKS_DISABLED_IN_SIM_GROUP; } } - public static ExclusiveGroup SPAWN_POINTS { get { return CommonExclusiveGroups.SPAWN_POINTS_GROUP; } } + //public static ExclusiveGroup SPAWN_POINTS { get { return CommonExclusiveGroups.SPAWN_POINTS_GROUP; } } - public static ExclusiveGroup SPAWN_POINTS_DISABLED { get { return CommonExclusiveGroups.SPAWN_POINTS_DISABLED_GROUP; } } + //public static ExclusiveGroup SPAWN_POINTS_DISABLED { get { return CommonExclusiveGroups.SPAWN_POINTS_DISABLED_GROUP; } } /// /// The ID of the most recently placed block diff --git a/GamecraftModdingAPI/Blocks/PlacementEngine.cs b/GamecraftModdingAPI/Blocks/PlacementEngine.cs index 879141c..d352fe4 100644 --- a/GamecraftModdingAPI/Blocks/PlacementEngine.cs +++ b/GamecraftModdingAPI/Blocks/PlacementEngine.cs @@ -85,7 +85,7 @@ namespace GamecraftModdingAPI.Blocks { case CubeCategory.SpawnPoint: case CubeCategory.BuildingSpawnPoint: - newBlockID = MachineEditingGroups.NewSpawnPointBlockID; + newBlockID = MachineEditingGroups.NewUncheckedBlockEGID; break; default: newBlockID = MachineEditingGroups.NewBlockID; diff --git a/GamecraftModdingAPI/Events/GameStateBuildEmitterEngine.cs b/GamecraftModdingAPI/Events/GameStateBuildEmitterEngine.cs index 1c5b363..ed89812 100644 --- a/GamecraftModdingAPI/Events/GameStateBuildEmitterEngine.cs +++ b/GamecraftModdingAPI/Events/GameStateBuildEmitterEngine.cs @@ -12,7 +12,7 @@ namespace GamecraftModdingAPI.Events /// /// Event emitter engine for switching to to build mode. /// - public class GameStateBuildEmitterEngine : IEventEmitterEngine, IInitializeOnBuildStart + public class GameStateBuildEmitterEngine : IEventEmitterEngine, IUnorderedInitializeOnTimeStoppedModeEntered { public string Name { get; } = "GamecraftModdingAPIGameStateBuildEventEmitter" ; @@ -37,13 +37,13 @@ namespace GamecraftModdingAPI.Events public void EmitIfBuildMode() { //Logging.MetaDebugLog($"nextSimulationMode: {entitiesDB.QueryUniqueEntity(SimulationModeStateExclusiveGroups.GAME_STATE_GROUP).nextSimulationMode}"); - if (entitiesDB.QueryUniqueEntity(SimulationModeStateExclusiveGroups.GAME_STATE_GROUP).nextSimulationMode == SimulationMode.Build) + if (entitiesDB.QueryUniqueEntity(SimulationModeStateExclusiveGroups.GAME_STATE_GROUP).nextSimulationMode == SimulationMode.TimeStopped) { Emit(); } } - - public JobHandle OnInitializeBuildMode() + + public JobHandle OnInitializeTimeStoppedMode() { Emit(); return default(JobHandle); diff --git a/GamecraftModdingAPI/Events/GameStateSimulationEmitterEngine.cs b/GamecraftModdingAPI/Events/GameStateSimulationEmitterEngine.cs index 91ee596..165e7c5 100644 --- a/GamecraftModdingAPI/Events/GameStateSimulationEmitterEngine.cs +++ b/GamecraftModdingAPI/Events/GameStateSimulationEmitterEngine.cs @@ -12,7 +12,7 @@ namespace GamecraftModdingAPI.Events /// /// Event emitter engine for switching to simulation mode. /// - public class GameStateSimulationEmitterEngine : IEventEmitterEngine, IInitializeOnSimulationStart + public class GameStateSimulationEmitterEngine : IEventEmitterEngine, IUnorderedInitializeOnTimeRunningModeEntered { public string Name { get; } = "GamecraftModdingAPIGameStateSimulationEventEmitter" ; @@ -36,13 +36,13 @@ namespace GamecraftModdingAPI.Events public void EmitIfSimMode() { - if (entitiesDB.QueryUniqueEntity(SimulationModeStateExclusiveGroups.GAME_STATE_GROUP).nextSimulationMode == SimulationMode.Simulation) + if (entitiesDB.QueryUniqueEntity(SimulationModeStateExclusiveGroups.GAME_STATE_GROUP).nextSimulationMode == SimulationMode.TimeRunning) { Emit(); } } - public JobHandle OnInitializeSimulationMode() + public JobHandle OnInitializeTimeRunningMode() { Emit(); return default(JobHandle); diff --git a/GamecraftModdingAPI/Input/FakeInput.cs b/GamecraftModdingAPI/Input/FakeInput.cs index 3d9a379..918531b 100644 --- a/GamecraftModdingAPI/Input/FakeInput.cs +++ b/GamecraftModdingAPI/Input/FakeInput.cs @@ -62,7 +62,7 @@ namespace GamecraftModdingAPI.Input playerID = inputEngine.GetLocalPlayerID(); } ref InputEntityStruct currentInput = ref inputEngine.GetInputRef(playerID); - Utility.Logging.CommandLog($"Current sim frame {currentInput.frame}"); + //Utility.Logging.CommandLog($"Current sim frame {currentInput.frame}"); // set inputs switch(hotbar) { @@ -114,7 +114,7 @@ namespace GamecraftModdingAPI.Input playerID = inputEngine.GetLocalPlayerID(); } ref InputEntityStruct currentInput = ref inputEngine.GetInputRef(playerID); - Utility.Logging.CommandLog($"Current sim frame {currentInput.frame}"); + //Utility.Logging.CommandLog($"Current sim frame {currentInput.frame}"); // set inputs if (toggleMode) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.ToggleSimulation; if (forward) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.Forward; diff --git a/GamecraftModdingAPI/Utility/GameStateEngine.cs b/GamecraftModdingAPI/Utility/GameStateEngine.cs index 55c0de2..204f491 100644 --- a/GamecraftModdingAPI/Utility/GameStateEngine.cs +++ b/GamecraftModdingAPI/Utility/GameStateEngine.cs @@ -31,12 +31,12 @@ namespace GamecraftModdingAPI.Utility public bool IsBuildMode() { - return _isInGame && SimModeUtil.IsBuildMode(entitiesDB); + return _isInGame && TimeRunningModeUtil.IsTimeStoppedMode(entitiesDB); } public bool IsSimulationMode() { - return _isInGame && SimModeUtil.IsSimulationMode(entitiesDB); + return _isInGame && TimeRunningModeUtil.IsTimeRunningMode(entitiesDB); } } -- 2.30.2 From 5cb27b05c061cd004297f74b61cc960b0f0a5e9f Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Fri, 1 May 2020 14:50:55 -0400 Subject: [PATCH 008/252] Create CommandBuilder --- .../Commands/CommandBuilder.cs | 181 ++++++++++++++++++ .../Commands/CommandManager.cs | 4 + .../GamecraftModdingAPI.csproj | 2 +- .../Tests/GamecraftModdingAPIPluginTest.cs | 68 ++++++- doxygen.conf | 2 +- 5 files changed, 249 insertions(+), 8 deletions(-) create mode 100644 GamecraftModdingAPI/Commands/CommandBuilder.cs diff --git a/GamecraftModdingAPI/Commands/CommandBuilder.cs b/GamecraftModdingAPI/Commands/CommandBuilder.cs new file mode 100644 index 0000000..f0f9258 --- /dev/null +++ b/GamecraftModdingAPI/Commands/CommandBuilder.cs @@ -0,0 +1,181 @@ +using System; + +using Svelto.ECS; + +using GamecraftModdingAPI.Utility; + +namespace GamecraftModdingAPI.Commands +{ + /// + /// Custom Command builder. + /// + public class CommandBuilder + { + private string name; + + private string description; + + private short parameterCount; + + private ICustomCommandEngine commandEngine; + + /// + /// Create a new command builder. + /// + public CommandBuilder() + { + name = ""; + description = null; + parameterCount = -1; + } + + /// + /// Create and return a command builder. + /// + /// The builder. + public static CommandBuilder Builder() + { + return new CommandBuilder(); + } + + /// + /// Create a new command builder. + /// + /// The command name. + /// The command description (shown in help). + public CommandBuilder(string name, string description = null) + { + this.name = name; + this.description = description; + parameterCount = -1; + } + + /// + /// Create and return a command builder. + /// If name and description are provided, this is equivalent to Builder().Name(name).Description(description) + /// + /// The command name. + /// The command description (shown in help). + /// The builder. + public static CommandBuilder Builder(string name, string description = null) + { + return new CommandBuilder(name, description); + } + + /// + /// Name the command. + /// + /// The builder. + /// The command name. + public CommandBuilder Name(string name) + { + this.name = name; + return this; + } + + /// + /// Describe the command. + /// + /// The builder. + /// The command description (shown in help). + public CommandBuilder Description(string description) + { + this.description = description; + return this; + } + + /// + /// Set the action the command performs. + /// + /// The builder. + /// The action to perform when the command is called. + public CommandBuilder Action(Action action) + { + parameterCount = 0; + commandEngine = new SimpleCustomCommandEngine(action, name, description); + return this; + } + + /// + /// Set the action the command performs. + /// + /// The builder. + /// The action to perform when the command is called. + /// The 1st parameter's type. + public CommandBuilder Action(Action action) + { + parameterCount = 1; + commandEngine = new SimpleCustomCommandEngine(action, name, description); + return this; + } + + /// + /// Set the action the command performs. + /// + /// The builder. + /// The action to perform when the command is called. + /// The 1st parameter's type. + /// The 2nd parameter's type. + public CommandBuilder Action(Action action) + { + parameterCount = 2; + commandEngine = new SimpleCustomCommandEngine(action, name, description); + return this; + } + + /// + /// Set the action the command performs. + /// + /// The builder. + /// The action to perform when the command is called. + /// The 1st parameter's type. + /// The 2nd parameter's type. + /// The 3rd parameter's type. + public CommandBuilder Action(Action action) + { + parameterCount = 3; + commandEngine = new SimpleCustomCommandEngine(action, name, description); + return this; + } + + /// + /// Build the command. + /// + /// The built command. + /// Automatically register the command with CommandManager.AddCommand()? + public ICustomCommandEngine Build(bool register = true) + { + if (string.IsNullOrWhiteSpace(name)) + { + throw new InvalidOperationException("Command name must be defined before Build() is called"); + } + if (commandEngine == null) + { + throw new InvalidOperationException("Command action must be defined before Build() is called"); + } + if (string.IsNullOrWhiteSpace(description)) + { + Logging.LogWarning($"Command {name} was built without a description"); + } + if (register) + { + CommandManager.AddCommand(commandEngine); + Logging.MetaDebugLog($"Command {FullName()} was automatically registered"); + } + return commandEngine; + } + + /// + /// Get the full command name, in the form [name]::[description]::[# of parameters] + /// + /// The name. + public string FullName() + { + if (string.IsNullOrWhiteSpace(description)) + { + return name + "::" + parameterCount; + } + return name + "::" + description + "::" + parameterCount; + } + } +} diff --git a/GamecraftModdingAPI/Commands/CommandManager.cs b/GamecraftModdingAPI/Commands/CommandManager.cs index f2f79b4..986405e 100644 --- a/GamecraftModdingAPI/Commands/CommandManager.cs +++ b/GamecraftModdingAPI/Commands/CommandManager.cs @@ -22,6 +22,10 @@ namespace GamecraftModdingAPI.Commands public static void AddCommand(ICustomCommandEngine engine) { + if (ExistsCommand(engine)) + { + Logging.LogWarning($"Command {engine.Name} already exists!"); + } _customCommands[engine.Name] = engine; if (_lastEngineRoot != null) { diff --git a/GamecraftModdingAPI/GamecraftModdingAPI.csproj b/GamecraftModdingAPI/GamecraftModdingAPI.csproj index 9b76ea5..263c18a 100644 --- a/GamecraftModdingAPI/GamecraftModdingAPI.csproj +++ b/GamecraftModdingAPI/GamecraftModdingAPI.csproj @@ -3,7 +3,7 @@ net472 true - 0.2.2 + 1.0.0 Exmods GNU General Public Licence 3+ https://git.exmods.org/modtainers/GamecraftModdingAPI diff --git a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs index 11d63c6..732854e 100644 --- a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs +++ b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs @@ -81,8 +81,67 @@ namespace GamecraftModdingAPI.Tests // debug/test commands if (Dependency.Hell("ExtraCommands")) { - CommandManager.AddCommand(new SimpleCustomCommandEngine(() => { UnityEngine.Application.Quit(); }, - "Exit", "Close Gamecraft without any prompts")); + CommandBuilder.Builder() + .Name("Exit") + .Description("Close Gamecraft immediately, without any prompts") + .Action(() => { UnityEngine.Application.Quit(); }) + .Build(); + + CommandBuilder.Builder() + .Name("SetFOV") + .Description("Set the player camera's field of view") + .Action((float d) => { UnityEngine.Camera.main.fieldOfView = d; }) + .Build(); + + CommandBuilder.Builder() + .Name("MoveLastBlock") + .Description("Move the most-recently-placed block, and any connected blocks by the given offset") + .Action((float x, float y, float z) => { + bool success = GamecraftModdingAPI.Blocks.Movement.MoveConnectedBlocks( + GamecraftModdingAPI.Blocks.BlockIdentifiers.LatestBlockID, + new Unity.Mathematics.float3(x, y, z)); + if (!success) + { + GamecraftModdingAPI.Utility.Logging.CommandLogError("Blocks can only be moved in Build mode!"); + } + }).Build(); + + CommandBuilder.Builder() + .Name("PlaceAluminium") + .Description("Place a block of aluminium at the given coordinates") + .Action((float x, float y, float z) => { Blocks.Placement.PlaceBlock(Blocks.BlockIDs.AluminiumCube, new Unity.Mathematics.float3(x, y, z)); }) + .Build(); + + System.Random random = new System.Random(); // for command below + CommandBuilder.Builder() + .Name("RandomizeSignalsInputs") + .Description("Do the thing") + .Action(() => { + if (!GameState.IsSimulationMode()) + { + Logging.CommandLogError("You must be in simulation mode for this to work!"); + return; + } + Tasks.Repeatable task = new Tasks.Repeatable( + () => { + uint count = 0; + EGID[] eBlocks = Blocks.Signals.GetElectricBlocks(); + for (uint i = 0u; i < eBlocks.Length; i++) + { + uint[] ids = Blocks.Signals.GetSignalIDs(eBlocks[i]); + for (uint j = 0u; j < ids.Length; j++) + { + Blocks.Signals.SetSignalByID(ids[j], (float)random.NextDouble()); + count++; + } + } + Logging.MetaDebugLog($"Did the thing on {count} inputs"); + }, + () => { return GameState.IsSimulationMode(); }); + Tasks.Scheduler.Schedule(task); + }).Build(); + + /* CommandManager.AddCommand(new SimpleCustomCommandEngine((float d) => { UnityEngine.Camera.main.fieldOfView = d; }, "SetFOV", "Set the player camera's field of view")); CommandManager.AddCommand(new SimpleCustomCommandEngine( @@ -98,10 +157,6 @@ namespace GamecraftModdingAPI.Tests CommandManager.AddCommand(new SimpleCustomCommandEngine( (x, y, z) => { Blocks.Placement.PlaceBlock(Blocks.BlockIDs.AluminiumCube, new Unity.Mathematics.float3(x, y, z)); }, "PlaceAluminium", "Place a block of aluminium at the given coordinates")); - Analytics.DeltaDNAHelper.PlayerLifetimeParameters plp = new Analytics.DeltaDNAHelper.PlayerLifetimeParameters(); - CommandManager.AddCommand(new SimpleCustomCommandEngine( - (s) => { Analytics.DeltaDNAHelper.SendActionCompletedEvent(in plp, s.Replace(", ", " ")); }, - "SendAnalyticsAction", "Send an analytics action")); System.Random random = new System.Random(); // for command below CommandManager.AddCommand(new SimpleCustomCommandEngine( () => { @@ -127,6 +182,7 @@ namespace GamecraftModdingAPI.Tests () => { return GameState.IsSimulationMode(); }); Tasks.Scheduler.Schedule(task); }, "RandomizeSignalsInputs", "Do the thing")); + */ } // dependency test diff --git a/doxygen.conf b/doxygen.conf index 4596b01..0535320 100644 --- a/doxygen.conf +++ b/doxygen.conf @@ -38,7 +38,7 @@ PROJECT_NAME = "GamecraftModdingAPI" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = "v0.2.2" +PROJECT_NUMBER = "v1.0.0" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a -- 2.30.2 From 4e5cc40be462161b30a660759481c57ee32b1f92 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Sun, 3 May 2020 15:14:13 -0400 Subject: [PATCH 009/252] Convert Automation to something actually cross-platform --- Automation/Automation.cs | 66 -- Automation/Automation.csproj | 8 - Automation/gen_csproj.py | 55 ++ GamecraftModdingAPI.sln | 8 +- .../GamecraftModdingAPI.csproj | 874 ++++++++++++------ 5 files changed, 640 insertions(+), 371 deletions(-) delete mode 100644 Automation/Automation.cs delete mode 100644 Automation/Automation.csproj create mode 100755 Automation/gen_csproj.py diff --git a/Automation/Automation.cs b/Automation/Automation.cs deleted file mode 100644 index 92787f6..0000000 --- a/Automation/Automation.cs +++ /dev/null @@ -1,66 +0,0 @@ -using System; -using System.IO; -using System.Text; -using System.Text.RegularExpressions; - -namespace Automation -{ - class Automation - { - private static readonly string Name = "automation"; - - private static readonly string XmlPrefix = "\n \n"; - private static readonly string XmlSuffix = " \n"; - - private static readonly string GamecraftModdingAPI_csproj = @"\GamecraftModdingAPI.csproj"; - static void Main(string[] args) - { - if (args.Length != 2 || args[0] == "-h" || args[0] == "--help") - { - Console.WriteLine($"Usage : {Name}.exe "); - Console.WriteLine("Other arguments:"); - Console.WriteLine(" --help : display this message"); - Console.WriteLine($" --version : display {Name}'s version"); - return; - } - Console.WriteLine("Building Assembly references"); - string asmXml = BuildAssemblyReferencesXML(args[0]); - //Console.WriteLine(asmXml); - string csprojPath = args[1].EndsWith(GamecraftModdingAPI_csproj)? args[1] : args[1]+GamecraftModdingAPI_csproj; - Console.WriteLine($"Parsing {csprojPath}"); - string csprojContents = File.ReadAllText(csprojPath); - Match dependenciesStart = (new Regex(@"<\s*!--\s*Start\s+Dependencies\s*--\s*>", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Multiline)).Match(csprojContents); - Match dependenciesEnd = (new Regex(@"<\s*!--\s*End\s+Dependencies\s*--\s*>", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Multiline)).Match(csprojContents); - if (!dependenciesEnd.Success || !dependenciesStart.Success) - { - Console.WriteLine("Unable to find dependency XML comments, aborting!"); - return; - } - csprojContents = csprojContents.Substring(0, dependenciesStart.Index) + asmXml + csprojContents.Substring(dependenciesEnd.Index+dependenciesEnd.Length); - //Console.WriteLine(csprojContents); - Console.WriteLine($"Writing Assembly references into {csprojPath}"); - File.WriteAllText(csprojPath, csprojContents); - Console.WriteLine("Successfully generated Gamecraft assembly DLL references"); - } - - static string BuildAssemblyReferencesXML(string path) - { - StringBuilder result = new StringBuilder(); - result.Append(XmlPrefix); - string[] files = Directory.GetFiles(path, "*.dll"); - for(int i = 0; i\n {files[i]}\n \n"); - } - } - result.Append(XmlSuffix); - return result.ToString(); - } - } -} diff --git a/Automation/Automation.csproj b/Automation/Automation.csproj deleted file mode 100644 index c73e0d1..0000000 --- a/Automation/Automation.csproj +++ /dev/null @@ -1,8 +0,0 @@ - - - - Exe - netcoreapp3.1 - - - diff --git a/Automation/gen_csproj.py b/Automation/gen_csproj.py new file mode 100755 index 0000000..bda910b --- /dev/null +++ b/Automation/gen_csproj.py @@ -0,0 +1,55 @@ +#!/usr/bin/python3 + +import argparse +from pathlib import Path, PurePath +import re + +DLL_EXCLUSIONS_REGEX = r"(System|Microsoft|Mono)\." + +def getAssemblyReferences(path): + asmDir = Path(path) + result = list() + for child in asmDir.iterdir(): + if child.is_file() and re.search(DLL_EXCLUSIONS_REGEX, str(child), re.I) is None: + result.append(str(child).replace("\\", "/")) + return result + +def buildReferencesXml(path): + assemblyPathes = getAssemblyReferences(path) + result = list() + for asm in assemblyPathes: + asmPath = str(asm) + xml = " \n" \ + + " " + asmPath.replace("/", "\\") + "\n" \ + + " ..\\" + asmPath.replace("/", "\\") + "\n" \ + + " \n" + result.append(xml) + return "".join(result) + #return "\n \n" + "".join(result) + " \n" + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description="Generate GamecraftModdingAPI.csproj") + # TODO (maybe?): add params for custom csproj read and write locations + args = parser.parse_args() + + print("Building Assembly references") + asmXml = buildReferencesXml("../ref/Gamecraft_Data/Managed") + print(asmXml) + + with open("../GamecraftModdingAPI/GamecraftModdingAPI.csproj", "r") as xmlFile: + print("Parsing GamecraftModdingAPI.csproj") + fileStr = xmlFile.read() + print(fileStr) + depsStart = re.search(r"\ - - - ..\ref\Gamecraft_Data\Managed\Analytics.dll - - - ..\ref\Gamecraft_Data\Managed\Assembly-CSharp-firstpass.dll - - - ..\ref\Gamecraft_Data\Managed\Assembly-CSharp.dll - - - ..\ref\Gamecraft_Data\Managed\Authentication.dll - - - ..\ref\Gamecraft_Data\Managed\BlockEntityFactory.dll - - - ..\ref\Gamecraft_Data\Managed\CommandLine.dll - - - ..\ref\Gamecraft_Data\Managed\DataLoader.dll - - - ..\ref\Gamecraft_Data\Managed\DDNA.dll - - - ..\ref\Gamecraft_Data\Managed\Facepunch.Steamworks.Win64.dll - - - ..\ref\Gamecraft_Data\Managed\FMOD.dll - - - ..\ref\Gamecraft_Data\Managed\FullGame.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.ConsoleBlock.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.Effects.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Tweaks.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Wires.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.Tweaks.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.Wires.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.Wires.Input.dll - - - ..\ref\Gamecraft_Data\Managed\GameState.dll - - - ..\ref\Gamecraft_Data\Managed\GPUInstancer.dll - - - ..\ref\Gamecraft_Data\Managed\Havok.Physics.dll - - - ..\ref\Gamecraft_Data\Managed\Havok.Physics.Hybrid.dll - ..\ref\Gamecraft_Data\Managed\IllusionInjector.dll + ..\..\ref\Gamecraft_Data\Managed\IllusionInjector.dll + + + ..\ref\Gamecraft_Data\Managed\IllusionInjector.pdb + ..\..\ref\Gamecraft_Data\Managed\IllusionInjector.pdb ..\ref\Gamecraft_Data\Managed\IllusionPlugin.dll + ..\..\ref\Gamecraft_Data\Managed\IllusionPlugin.dll + + + ..\ref\Gamecraft_Data\Managed\IllusionPlugin.pdb + ..\..\ref\Gamecraft_Data\Managed\IllusionPlugin.pdb ..\ref\Gamecraft_Data\Managed\JWT.dll - - - ..\ref\Gamecraft_Data\Managed\LZ4.dll - - - ..\ref\Gamecraft_Data\Managed\MultiplayerNetworking.dll - - - ..\ref\Gamecraft_Data\Managed\MultiplayerTest.dll - - - ..\ref\Gamecraft_Data\Managed\Newtonsoft.Json.dll - - - ..\ref\Gamecraft_Data\Managed\RCX.ScreenshotTaker.dll - - - ..\ref\Gamecraft_Data\Managed\Rewired_Core.dll - - - ..\ref\Gamecraft_Data\Managed\Rewired_Windows.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.AccountPreferences.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Blocks.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Blocks.Ghost.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Blocks.Triggers.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Character.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Common.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.ControlsScreen.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Crosshair.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.FrontEnd.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.DebugDisplay.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.RemoveBlock.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.ScaleGhost.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.GUIs.WorkshopPrefabs.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Input.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.MachineEditor.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.MainGame.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.MainSimulation.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Multiplayer.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.MultiplayerInput.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Party.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.PartyGui.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Physics.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.PilotSeat.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Player.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Rendering.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Rendering.Mock.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.SaveAndLoad.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.SaveGameDialog.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Serializers.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Services.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.SignalHandling.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.StateSync.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX_SpawnPoints.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX_TextBlock.dll - - - ..\ref\Gamecraft_Data\Managed\RobocratX.SimulationCompositionRoot.dll - - - ..\ref\Gamecraft_Data\Managed\StringFormatter.dll - - - ..\ref\Gamecraft_Data\Managed\Svelto.Common_3.dll - - - ..\ref\Gamecraft_Data\Managed\Svelto.ECS.Debugger.dll - - - ..\ref\Gamecraft_Data\Managed\Svelto.ECS.dll - - - ..\ref\Gamecraft_Data\Managed\Svelto.Services.dll - - - ..\ref\Gamecraft_Data\Managed\Svelto.Tasks.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Addressables.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Burst.dll + ..\..\ref\Gamecraft_Data\Managed\JWT.dll ..\ref\Gamecraft_Data\Managed\Unity.Burst.Unsafe.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Burst.Unsafe.dll - - ..\ref\Gamecraft_Data\Managed\Unity.Collections.dll + + ..\ref\Gamecraft_Data\Managed\IronPython.Wpf.dll + ..\..\ref\Gamecraft_Data\Managed\IronPython.Wpf.dll - - ..\ref\Gamecraft_Data\Managed\Unity.Entities.dll + + ..\ref\Gamecraft_Data\Managed\IronPython.dll + ..\..\ref\Gamecraft_Data\Managed\IronPython.dll - - ..\ref\Gamecraft_Data\Managed\Unity.Entities.Hybrid.dll + + ..\ref\Gamecraft_Data\Managed\IronPython.Modules.dll + ..\..\ref\Gamecraft_Data\Managed\IronPython.Modules.dll - - ..\ref\Gamecraft_Data\Managed\Unity.Jobs.dll + + ..\ref\Gamecraft_Data\Managed\IronPython.SQLite.dll + ..\..\ref\Gamecraft_Data\Managed\IronPython.SQLite.dll - - ..\ref\Gamecraft_Data\Managed\Unity.Mathematics.dll + + ..\ref\Gamecraft_Data\Managed\Facepunch.Steamworks.Win64.dll + ..\..\ref\Gamecraft_Data\Managed\Facepunch.Steamworks.Win64.dll - - ..\ref\Gamecraft_Data\Managed\Unity.Mathematics.Extensions.dll + + ..\ref\Gamecraft_Data\Managed\Rewired_Core.dll + ..\..\ref\Gamecraft_Data\Managed\Rewired_Core.dll - - ..\ref\Gamecraft_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll + + ..\ref\Gamecraft_Data\Managed\Rewired_Windows.dll + ..\..\ref\Gamecraft_Data\Managed\Rewired_Windows.dll - - ..\ref\Gamecraft_Data\Managed\Unity.Physics.dll + + ..\ref\Gamecraft_Data\Managed\DiscordRPC.dll + ..\..\ref\Gamecraft_Data\Managed\DiscordRPC.dll - - ..\ref\Gamecraft_Data\Managed\Unity.Physics.Hybrid.dll + + ..\ref\Gamecraft_Data\Managed\mscorlib.dll + ..\..\ref\Gamecraft_Data\Managed\mscorlib.dll - - ..\ref\Gamecraft_Data\Managed\Unity.Postprocessing.Runtime.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Properties.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.ResourceManager.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Scenes.Hybrid.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.ScriptableBuildPipeline.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.TextMeshPro.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Timeline.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Transforms.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Transforms.Hybrid.dll + + ..\ref\Gamecraft_Data\Managed\Newtonsoft.Json.dll + ..\..\ref\Gamecraft_Data\Managed\Newtonsoft.Json.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.AccessibilityModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.AccessibilityModule.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.AIModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.AIModule.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.AndroidJNIModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.AndroidJNIModule.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.AnimationModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.AnimationModule.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.ARModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.ARModule.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.AssetBundleModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.AssetBundleModule.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.AudioModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.AudioModule.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.ClothModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.ClothModule.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.ClusterInputModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.ClusterInputModule.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.ClusterRendererModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.ClusterRendererModule.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.CoreModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.CoreModule.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.CrashReportingModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.CrashReportingModule.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.DirectorModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.DirectorModule.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.DSPGraphModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.DSPGraphModule.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.GameCenterModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.GameCenterModule.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.GridModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.GridModule.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.HotReloadModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.HotReloadModule.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.ImageConversionModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.ImageConversionModule.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.IMGUIModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.IMGUIModule.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.InputLegacyModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.InputLegacyModule.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.InputModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.InputModule.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.JSONSerializeModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.JSONSerializeModule.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.LocalizationModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.LocalizationModule.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.ParticleSystemModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.ParticleSystemModule.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.PerformanceReportingModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.PerformanceReportingModule.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.Physics2DModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.Physics2DModule.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.PhysicsModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.PhysicsModule.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.ProfilerModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.ProfilerModule.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.ScreenCaptureModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.ScreenCaptureModule.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.SharedInternalsModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.SharedInternalsModule.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.SpriteMaskModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.SpriteMaskModule.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.SpriteShapeModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.SpriteShapeModule.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.StreamingModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.StreamingModule.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.SubstanceModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.SubstanceModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.SubsystemsModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.SubsystemsModule.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.TerrainModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.TerrainModule.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.TerrainPhysicsModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.TerrainPhysicsModule.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.TextCoreModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.TextCoreModule.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.TextRenderingModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.TextRenderingModule.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.TilemapModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.TilemapModule.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.TLSModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.UI.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.TLSModule.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.UIElementsModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UIElementsModule.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.UIModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UIModule.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.UmbraModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UmbraModule.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.UNETModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UNETModule.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.UnityAnalyticsModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UnityAnalyticsModule.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.UnityConnectModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UnityConnectModule.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.UnityTestProtocolModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UnityTestProtocolModule.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.UnityWebRequestModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UnityWebRequestModule.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.VehiclesModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.VehiclesModule.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.VFXModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.VFXModule.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.VideoModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.VideoModule.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.VRModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.VRModule.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.WindModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.WindModule.dll ..\ref\Gamecraft_Data\Managed\UnityEngine.XRModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.XRModule.dll + + + ..\ref\Gamecraft_Data\Managed\Analytics.dll + ..\..\ref\Gamecraft_Data\Managed\Analytics.dll + + + ..\ref\Gamecraft_Data\Managed\Assembly-CSharp-firstpass.dll + ..\..\ref\Gamecraft_Data\Managed\Assembly-CSharp-firstpass.dll + + + ..\ref\Gamecraft_Data\Managed\Assembly-CSharp.dll + ..\..\ref\Gamecraft_Data\Managed\Assembly-CSharp.dll + + + ..\ref\Gamecraft_Data\Managed\Authentication.dll + ..\..\ref\Gamecraft_Data\Managed\Authentication.dll + + + ..\ref\Gamecraft_Data\Managed\BlockEntityFactory.dll + ..\..\ref\Gamecraft_Data\Managed\BlockEntityFactory.dll + + + ..\ref\Gamecraft_Data\Managed\Blocks.HUDFeedbackBlocks.dll + ..\..\ref\Gamecraft_Data\Managed\Blocks.HUDFeedbackBlocks.dll + + + ..\ref\Gamecraft_Data\Managed\ChannelsCommon.dll + ..\..\ref\Gamecraft_Data\Managed\ChannelsCommon.dll + + + ..\ref\Gamecraft_Data\Managed\ClusterToWireConversion.Mock.dll + ..\..\ref\Gamecraft_Data\Managed\ClusterToWireConversion.Mock.dll + + + ..\ref\Gamecraft_Data\Managed\CommandLine.dll + ..\..\ref\Gamecraft_Data\Managed\CommandLine.dll + + + ..\ref\Gamecraft_Data\Managed\DataLoader.dll + ..\..\ref\Gamecraft_Data\Managed\DataLoader.dll + + + ..\ref\Gamecraft_Data\Managed\DDNA.dll + ..\..\ref\Gamecraft_Data\Managed\DDNA.dll + + + ..\ref\Gamecraft_Data\Managed\FMOD.dll + ..\..\ref\Gamecraft_Data\Managed\FMOD.dll + + + ..\ref\Gamecraft_Data\Managed\FullGame.dll + ..\..\ref\Gamecraft_Data\Managed\FullGame.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.ConsoleBlock.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.ConsoleBlock.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.GenericPhysicsBlocks.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.GenericPhysicsBlocks.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.LogicBlock.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.LogicBlock.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.TimerBlock.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.TimerBlock.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.Effects.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Effects.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.ConsoleBlock.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.ConsoleBlock.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.HUDFeedbackBlocks.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.HUDFeedbackBlocks.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Tweaks.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Tweaks.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Wires.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Wires.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Wires.Mockup.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Wires.Mockup.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.Tweaks.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Tweaks.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.Tweaks.Mockup.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Tweaks.Mockup.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.Wires.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Wires.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.Wires.Input.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Wires.Input.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.Wires.Mockup.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Wires.Mockup.dll + + + ..\ref\Gamecraft_Data\Managed\GameState.dll + ..\..\ref\Gamecraft_Data\Managed\GameState.dll + + + ..\ref\Gamecraft_Data\Managed\GPUInstancer.dll + ..\..\ref\Gamecraft_Data\Managed\GPUInstancer.dll + + + ..\ref\Gamecraft_Data\Managed\Havok.Physics.dll + ..\..\ref\Gamecraft_Data\Managed\Havok.Physics.dll + + + ..\ref\Gamecraft_Data\Managed\Havok.Physics.Hybrid.dll + ..\..\ref\Gamecraft_Data\Managed\Havok.Physics.Hybrid.dll + + + ..\ref\Gamecraft_Data\Managed\LZ4.dll + ..\..\ref\Gamecraft_Data\Managed\LZ4.dll + + + ..\ref\Gamecraft_Data\Managed\MultiplayerNetworking.dll + ..\..\ref\Gamecraft_Data\Managed\MultiplayerNetworking.dll + + + ..\ref\Gamecraft_Data\Managed\MultiplayerTest.dll + ..\..\ref\Gamecraft_Data\Managed\MultiplayerTest.dll + + + ..\ref\Gamecraft_Data\Managed\RCX.ScreenshotTaker.dll + ..\..\ref\Gamecraft_Data\Managed\RCX.ScreenshotTaker.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.AccountPreferences.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.AccountPreferences.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.Blocks.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Blocks.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.Blocks.Ghost.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Blocks.Ghost.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.Blocks.Triggers.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Blocks.Triggers.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.Building.BoxSelect.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Building.BoxSelect.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.Building.Jobs.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Building.Jobs.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.Character.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Character.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.ClusterToWireConversion.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.ClusterToWireConversion.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.Common.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Common.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.ControlsScreen.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.ControlsScreen.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.Crosshair.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Crosshair.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.FrontEnd.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.FrontEnd.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.BlockLabel.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.BlockLabel.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.DebugDisplay.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.DebugDisplay.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.RemoveBlock.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.RemoveBlock.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.ScaleGhost.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.ScaleGhost.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.GUIs.WorkshopPrefabs.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUIs.WorkshopPrefabs.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.Input.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Input.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.MachineEditor.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.MachineEditor.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.MainGame.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.MainGame.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.MainSimulation.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.MainSimulation.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.MockCharacter.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.MockCharacter.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.Multiplayer.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Multiplayer.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.MultiplayerInput.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.MultiplayerInput.dll + + + ..\ref\Gamecraft_Data\Managed\Robocraftx.ObjectIdBlocks.dll + ..\..\ref\Gamecraft_Data\Managed\Robocraftx.ObjectIdBlocks.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.Party.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Party.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.PartyGui.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.PartyGui.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.Physics.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Physics.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.PilotSeat.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.PilotSeat.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.Player.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Player.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.Rendering.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Rendering.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.Rendering.Mock.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Rendering.Mock.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.SaveAndLoad.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.SaveAndLoad.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.SaveGameDialog.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.SaveGameDialog.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.Serializers.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Serializers.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.Services.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Services.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.SignalHandling.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.SignalHandling.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.StateSync.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.StateSync.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX_SpawnPoints.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX_SpawnPoints.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX_TextBlock.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX_TextBlock.dll + + + ..\ref\Gamecraft_Data\Managed\RobocratX.SimulationCompositionRoot.dll + ..\..\ref\Gamecraft_Data\Managed\RobocratX.SimulationCompositionRoot.dll + + + ..\ref\Gamecraft_Data\Managed\StringFormatter.dll + ..\..\ref\Gamecraft_Data\Managed\StringFormatter.dll + + + ..\ref\Gamecraft_Data\Managed\Svelto.Common_3.dll + ..\..\ref\Gamecraft_Data\Managed\Svelto.Common_3.dll + + + ..\ref\Gamecraft_Data\Managed\Svelto.ECS.Debugger.dll + ..\..\ref\Gamecraft_Data\Managed\Svelto.ECS.Debugger.dll + + + ..\ref\Gamecraft_Data\Managed\Svelto.ECS.Debugger.Internal.dll + ..\..\ref\Gamecraft_Data\Managed\Svelto.ECS.Debugger.Internal.dll + + + ..\ref\Gamecraft_Data\Managed\Svelto.ECS.dll + ..\..\ref\Gamecraft_Data\Managed\Svelto.ECS.dll + + + ..\ref\Gamecraft_Data\Managed\Svelto.Services.dll + ..\..\ref\Gamecraft_Data\Managed\Svelto.Services.dll + + + ..\ref\Gamecraft_Data\Managed\Svelto.Tasks.dll + ..\..\ref\Gamecraft_Data\Managed\Svelto.Tasks.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Addressables.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Addressables.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Burst.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Burst.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Collections.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Collections.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Deformations.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Deformations.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Entities.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Entities.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Entities.Hybrid.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Entities.Hybrid.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Jobs.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Jobs.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Mathematics.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Mathematics.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Mathematics.Extensions.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Mathematics.Extensions.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Physics.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Physics.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Physics.Hybrid.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Physics.Hybrid.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Platforms.Common.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Platforms.Common.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Postprocessing.Runtime.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Postprocessing.Runtime.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Properties.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Properties.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Properties.Reflection.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Properties.Reflection.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Properties.UI.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Properties.UI.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.RenderPipeline.Universal.ShaderLibrary.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipeline.Universal.ShaderLibrary.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Universal.Runtime.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Universal.Runtime.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Universal.Shaders.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Universal.Shaders.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.ResourceManager.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.ResourceManager.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Scenes.Hybrid.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Scenes.Hybrid.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.ScriptableBuildPipeline.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.ScriptableBuildPipeline.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Serialization.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Serialization.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.TextMeshPro.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.TextMeshPro.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Timeline.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Timeline.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Transforms.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Transforms.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Transforms.Hybrid.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Transforms.Hybrid.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.UI.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UI.dll ..\ref\Gamecraft_Data\Managed\uREPL.dll + ..\..\ref\Gamecraft_Data\Managed\uREPL.dll ..\ref\Gamecraft_Data\Managed\VisualProfiler.dll + ..\..\ref\Gamecraft_Data\Managed\VisualProfiler.dll - - - ..\ref\Gamecraft_Data\Managed\Assembly-CSharp.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.CoreModule.dll - - + -- 2.30.2 From f244eb96830ba1a65b907f4e9bcd471db34aa0ba Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Sun, 3 May 2020 15:21:40 -0400 Subject: [PATCH 010/252] Fix script errors --- Automation/gen_csproj.py | 14 ++++++-------- GamecraftModdingAPI/GamecraftModdingAPI.csproj | 17 ++++++++--------- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/Automation/gen_csproj.py b/Automation/gen_csproj.py index bda910b..fecdc0b 100755 --- a/Automation/gen_csproj.py +++ b/Automation/gen_csproj.py @@ -10,7 +10,7 @@ def getAssemblyReferences(path): asmDir = Path(path) result = list() for child in asmDir.iterdir(): - if child.is_file() and re.search(DLL_EXCLUSIONS_REGEX, str(child), re.I) is None: + if child.is_file() and re.search(DLL_EXCLUSIONS_REGEX, str(child), re.I) is None and str(child).lower().endswith(".dll"): result.append(str(child).replace("\\", "/")) return result @@ -24,8 +24,7 @@ def buildReferencesXml(path): + " ..\\" + asmPath.replace("/", "\\") + "\n" \ + " \n" result.append(xml) - return "".join(result) - #return "\n \n" + "".join(result) + " \n" + return "\n \n" + "".join(result) + " \n" if __name__ == "__main__": parser = argparse.ArgumentParser(description="Generate GamecraftModdingAPI.csproj") @@ -34,22 +33,21 @@ if __name__ == "__main__": print("Building Assembly references") asmXml = buildReferencesXml("../ref/Gamecraft_Data/Managed") - print(asmXml) + # print(asmXml) with open("../GamecraftModdingAPI/GamecraftModdingAPI.csproj", "r") as xmlFile: print("Parsing GamecraftModdingAPI.csproj") fileStr = xmlFile.read() - print(fileStr) + # print(fileStr) depsStart = re.search(r"\ + ..\ref\Gamecraft_Data\Managed\IllusionInjector.dll ..\..\ref\Gamecraft_Data\Managed\IllusionInjector.dll - - ..\ref\Gamecraft_Data\Managed\IllusionInjector.pdb - ..\..\ref\Gamecraft_Data\Managed\IllusionInjector.pdb - ..\ref\Gamecraft_Data\Managed\IllusionPlugin.dll ..\..\ref\Gamecraft_Data\Managed\IllusionPlugin.dll - - ..\ref\Gamecraft_Data\Managed\IllusionPlugin.pdb - ..\..\ref\Gamecraft_Data\Managed\IllusionPlugin.pdb - ..\ref\Gamecraft_Data\Managed\JWT.dll ..\..\ref\Gamecraft_Data\Managed\JWT.dll @@ -806,7 +805,7 @@ ..\ref\Gamecraft_Data\Managed\VisualProfiler.dll ..\..\ref\Gamecraft_Data\Managed\VisualProfiler.dll - + -- 2.30.2 From 1f35b2a43424e06013eae2483c4df3037c568105 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Sun, 3 May 2020 15:31:09 -0400 Subject: [PATCH 011/252] Upgrade to Harmony v2.0.0 --- GamecraftModdingAPI/Blocks/BlockIdentifiers.cs | 2 +- GamecraftModdingAPI/Blocks/PlacementEngine.cs | 4 ++-- GamecraftModdingAPI/Blocks/RemovalEngine.cs | 4 ++-- GamecraftModdingAPI/Commands/CommandPatch.cs | 4 ++-- .../Events/DeterministicStepComposeEngineGroupsPatch.cs | 4 ++-- GamecraftModdingAPI/Events/GameActivatedComposePatch.cs | 2 +- GamecraftModdingAPI/Events/GameReloadedPatch.cs | 2 +- GamecraftModdingAPI/Events/GameSwitchedToPatch.cs | 2 +- GamecraftModdingAPI/Events/MenuActivatedPatch.cs | 2 +- GamecraftModdingAPI/Events/MenuSwitchedToPatch.cs | 2 +- GamecraftModdingAPI/GamecraftModdingAPI.csproj | 2 +- GamecraftModdingAPI/Inventory/Hotbar.cs | 2 +- .../Inventory/HotbarSlotSelectionHandlerEnginePatch.cs | 4 ++-- GamecraftModdingAPI/Main.cs | 6 +++--- .../Persistence/DeserializeFromDiskEntitiesEnginePatch.cs | 2 +- .../Persistence/SaveAndLoadCompositionRootPatch.cs | 2 +- GamecraftModdingAPI/Persistence/SaveGameEnginePatch.cs | 2 +- GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs | 6 +++--- GamecraftModdingAPI/Utility/AnalyticsDisablerPatch.cs | 4 ++-- GamecraftModdingAPI/Utility/FullGameFields.cs | 2 +- GamecraftModdingAPI/Utility/MinimumSpecsCheckPatch.cs | 2 +- GamecraftModdingAPI/Utility/SteamInitPatch.cs | 2 +- 22 files changed, 32 insertions(+), 32 deletions(-) diff --git a/GamecraftModdingAPI/Blocks/BlockIdentifiers.cs b/GamecraftModdingAPI/Blocks/BlockIdentifiers.cs index 6da100d..60819fe 100644 --- a/GamecraftModdingAPI/Blocks/BlockIdentifiers.cs +++ b/GamecraftModdingAPI/Blocks/BlockIdentifiers.cs @@ -8,7 +8,7 @@ using System.Reflection; using Svelto.ECS; using RobocraftX.Common; -using Harmony; +using HarmonyLib; namespace GamecraftModdingAPI.Blocks { diff --git a/GamecraftModdingAPI/Blocks/PlacementEngine.cs b/GamecraftModdingAPI/Blocks/PlacementEngine.cs index d352fe4..d954940 100644 --- a/GamecraftModdingAPI/Blocks/PlacementEngine.cs +++ b/GamecraftModdingAPI/Blocks/PlacementEngine.cs @@ -2,7 +2,7 @@ using System; using System.Reflection; using DataLoader; -using Harmony; +using HarmonyLib; using RobocraftX.Blocks; using RobocraftX.Blocks.Ghost; using RobocraftX.Blocks.Scaling; @@ -137,7 +137,7 @@ namespace GamecraftModdingAPI.Blocks Logging.MetaDebugLog("Block entity factory injected."); } - static MethodBase TargetMethod(HarmonyInstance instance) + static MethodBase TargetMethod(Harmony instance) { return AccessTools.TypeByName("RobocraftX.CR.MachineEditing.PlaceBlockEngine").GetConstructors()[0]; } diff --git a/GamecraftModdingAPI/Blocks/RemovalEngine.cs b/GamecraftModdingAPI/Blocks/RemovalEngine.cs index 41e3c03..010b2fe 100644 --- a/GamecraftModdingAPI/Blocks/RemovalEngine.cs +++ b/GamecraftModdingAPI/Blocks/RemovalEngine.cs @@ -1,6 +1,6 @@ using System.Reflection; -using Harmony; +using HarmonyLib; using RobocraftX.Blocks; using RobocraftX.Blocks.Ghost; using RobocraftX.Character.Camera; @@ -65,7 +65,7 @@ namespace GamecraftModdingAPI.Blocks Logging.MetaDebugLog("Requirements injected."); } - static MethodBase TargetMethod(HarmonyInstance instance) + static MethodBase TargetMethod(Harmony instance) { return AccessTools.TypeByName("RobocraftX.CR.MachineEditing.RemoveBlockEngine").GetConstructors()[0]; } diff --git a/GamecraftModdingAPI/Commands/CommandPatch.cs b/GamecraftModdingAPI/Commands/CommandPatch.cs index a0392ed..9cd3020 100644 --- a/GamecraftModdingAPI/Commands/CommandPatch.cs +++ b/GamecraftModdingAPI/Commands/CommandPatch.cs @@ -5,7 +5,7 @@ using System.Text; using System.Threading.Tasks; using System.Reflection; -using Harmony; +using HarmonyLib; using Svelto.Context; using Svelto.ECS; using RobocraftX; @@ -33,7 +33,7 @@ namespace GamecraftModdingAPI.Commands CommandManager.RegisterEngines(enginesRoot); } - public static MethodBase TargetMethod(HarmonyInstance instance) + public static MethodBase TargetMethod(Harmony instance) { return typeof(RobocraftX.GUI.CommandLine.CommandLineCompositionRoot).GetMethod("Compose").MakeGenericMethod(typeof(object)); //return func.Method; diff --git a/GamecraftModdingAPI/Events/DeterministicStepComposeEngineGroupsPatch.cs b/GamecraftModdingAPI/Events/DeterministicStepComposeEngineGroupsPatch.cs index 4779869..d6e58dc 100644 --- a/GamecraftModdingAPI/Events/DeterministicStepComposeEngineGroupsPatch.cs +++ b/GamecraftModdingAPI/Events/DeterministicStepComposeEngineGroupsPatch.cs @@ -5,7 +5,7 @@ using System.Reflection; using System.Text; using System.Threading.Tasks; -using Harmony; +using HarmonyLib; using Svelto.ECS; using RobocraftX.Common; using RobocraftX.StateSync; @@ -37,7 +37,7 @@ namespace GamecraftModdingAPI.Events } [HarmonyTargetMethod] - public static MethodBase TargetMethod(HarmonyInstance harmonyInstance) + public static MethodBase TargetMethod(Harmony harmonyInstance) { return AccessTools.Method(AccessTools.TypeByName("RobocraftX.StateSync.GameHostTransitionDeterministicGroupEngine"), "EndTransition"); //.MakeGenericMethod(typeof(CosmeticEnginesSequenceBuildOrder), typeof(CosmeticEnginesSequenceSimOrder), typeof(DeterministicToCosmeticSyncBuildOrder), typeof(DeterministicToCosmeticSyncSimOrder)); diff --git a/GamecraftModdingAPI/Events/GameActivatedComposePatch.cs b/GamecraftModdingAPI/Events/GameActivatedComposePatch.cs index 2c16c0c..9b2bf39 100644 --- a/GamecraftModdingAPI/Events/GameActivatedComposePatch.cs +++ b/GamecraftModdingAPI/Events/GameActivatedComposePatch.cs @@ -5,7 +5,7 @@ using System.Reflection; using System.Text; using System.Threading.Tasks; -using Harmony; +using HarmonyLib; using RobocraftX; using Svelto.ECS; diff --git a/GamecraftModdingAPI/Events/GameReloadedPatch.cs b/GamecraftModdingAPI/Events/GameReloadedPatch.cs index becd4dc..40f46e1 100644 --- a/GamecraftModdingAPI/Events/GameReloadedPatch.cs +++ b/GamecraftModdingAPI/Events/GameReloadedPatch.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -using Harmony; +using HarmonyLib; using RobocraftX; using GamecraftModdingAPI.Utility; diff --git a/GamecraftModdingAPI/Events/GameSwitchedToPatch.cs b/GamecraftModdingAPI/Events/GameSwitchedToPatch.cs index eae4652..30bb0d5 100644 --- a/GamecraftModdingAPI/Events/GameSwitchedToPatch.cs +++ b/GamecraftModdingAPI/Events/GameSwitchedToPatch.cs @@ -5,7 +5,7 @@ using System.Text; using System.Threading.Tasks; using System.Reflection; -using Harmony; +using HarmonyLib; using RobocraftX; using RobocraftX.CR.MainGame; using Svelto.ECS; diff --git a/GamecraftModdingAPI/Events/MenuActivatedPatch.cs b/GamecraftModdingAPI/Events/MenuActivatedPatch.cs index 451e71e..2b66a05 100644 --- a/GamecraftModdingAPI/Events/MenuActivatedPatch.cs +++ b/GamecraftModdingAPI/Events/MenuActivatedPatch.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -using Harmony; +using HarmonyLib; using RobocraftX; using Svelto.ECS; diff --git a/GamecraftModdingAPI/Events/MenuSwitchedToPatch.cs b/GamecraftModdingAPI/Events/MenuSwitchedToPatch.cs index ae26268..52a00b2 100644 --- a/GamecraftModdingAPI/Events/MenuSwitchedToPatch.cs +++ b/GamecraftModdingAPI/Events/MenuSwitchedToPatch.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -using Harmony; +using HarmonyLib; using RobocraftX; using Svelto.ECS; diff --git a/GamecraftModdingAPI/GamecraftModdingAPI.csproj b/GamecraftModdingAPI/GamecraftModdingAPI.csproj index 100a7c9..86dfe3f 100644 --- a/GamecraftModdingAPI/GamecraftModdingAPI.csproj +++ b/GamecraftModdingAPI/GamecraftModdingAPI.csproj @@ -14,7 +14,7 @@ - + diff --git a/GamecraftModdingAPI/Inventory/Hotbar.cs b/GamecraftModdingAPI/Inventory/Hotbar.cs index c649a66..838c554 100644 --- a/GamecraftModdingAPI/Inventory/Hotbar.cs +++ b/GamecraftModdingAPI/Inventory/Hotbar.cs @@ -5,7 +5,7 @@ using RobocraftX.Multiplayer.Input; using GamecraftModdingAPI.Blocks; using GamecraftModdingAPI.Utility; -using Harmony; +using HarmonyLib; namespace GamecraftModdingAPI.Inventory { diff --git a/GamecraftModdingAPI/Inventory/HotbarSlotSelectionHandlerEnginePatch.cs b/GamecraftModdingAPI/Inventory/HotbarSlotSelectionHandlerEnginePatch.cs index db50e4d..530184b 100644 --- a/GamecraftModdingAPI/Inventory/HotbarSlotSelectionHandlerEnginePatch.cs +++ b/GamecraftModdingAPI/Inventory/HotbarSlotSelectionHandlerEnginePatch.cs @@ -5,7 +5,7 @@ using RobocraftX.GUI; using RobocraftX.GUI.Hotbar; using Svelto.ECS; -using Harmony; +using HarmonyLib; using GamecraftModdingAPI.Blocks; namespace GamecraftModdingAPI.Inventory @@ -24,7 +24,7 @@ namespace GamecraftModdingAPI.Inventory selectedBlockInt = selectedDBPartID; } - public static MethodBase TargetMethod(HarmonyInstance instance) + public static MethodBase TargetMethod(Harmony harmonyInstance) { return PatchedMethod; } diff --git a/GamecraftModdingAPI/Main.cs b/GamecraftModdingAPI/Main.cs index e0717d2..1258435 100644 --- a/GamecraftModdingAPI/Main.cs +++ b/GamecraftModdingAPI/Main.cs @@ -5,7 +5,7 @@ using System.Text; using System.Threading.Tasks; using System.Reflection; -using Harmony; +using HarmonyLib; using GamecraftModdingAPI.Utility; using GamecraftModdingAPI.Events; @@ -19,7 +19,7 @@ namespace GamecraftModdingAPI /// public static class Main { - private static HarmonyInstance harmony; + private static Harmony harmony; public static bool IsInitialized { get { return harmony != null; } @@ -43,7 +43,7 @@ namespace GamecraftModdingAPI } Logging.MetaDebugLog($"Patching Gamecraft"); var currentAssembly = Assembly.GetExecutingAssembly(); - harmony = HarmonyInstance.Create(currentAssembly.GetName().Name); + harmony = new Harmony(currentAssembly.GetName().Name); harmony.PatchAll(currentAssembly); // init utility Logging.MetaDebugLog($"Initializing Utility"); diff --git a/GamecraftModdingAPI/Persistence/DeserializeFromDiskEntitiesEnginePatch.cs b/GamecraftModdingAPI/Persistence/DeserializeFromDiskEntitiesEnginePatch.cs index 8f3482f..29bf987 100644 --- a/GamecraftModdingAPI/Persistence/DeserializeFromDiskEntitiesEnginePatch.cs +++ b/GamecraftModdingAPI/Persistence/DeserializeFromDiskEntitiesEnginePatch.cs @@ -7,7 +7,7 @@ using Svelto.DataStructures; using Svelto.ECS; using Svelto.ECS.Serialization; -using Harmony; +using HarmonyLib; using GamecraftModdingAPI.Utility; namespace GamecraftModdingAPI.Persistence diff --git a/GamecraftModdingAPI/Persistence/SaveAndLoadCompositionRootPatch.cs b/GamecraftModdingAPI/Persistence/SaveAndLoadCompositionRootPatch.cs index a510580..987cf86 100644 --- a/GamecraftModdingAPI/Persistence/SaveAndLoadCompositionRootPatch.cs +++ b/GamecraftModdingAPI/Persistence/SaveAndLoadCompositionRootPatch.cs @@ -3,7 +3,7 @@ using RobocraftX.SaveAndLoad; using Svelto.ECS; -using Harmony; +using HarmonyLib; namespace GamecraftModdingAPI.Persistence { diff --git a/GamecraftModdingAPI/Persistence/SaveGameEnginePatch.cs b/GamecraftModdingAPI/Persistence/SaveGameEnginePatch.cs index 21cd68a..a603fa2 100644 --- a/GamecraftModdingAPI/Persistence/SaveGameEnginePatch.cs +++ b/GamecraftModdingAPI/Persistence/SaveGameEnginePatch.cs @@ -9,7 +9,7 @@ using Svelto.ECS; using Svelto.ECS.Serialization; using GamecraftModdingAPI.Utility; -using Harmony; +using HarmonyLib; namespace GamecraftModdingAPI.Persistence { diff --git a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs index 732854e..80cc916 100644 --- a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs +++ b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs @@ -1,7 +1,7 @@ using System; using System.Reflection; -using Harmony; +using HarmonyLib; // test using Svelto.ECS; using RobocraftX.Blocks; @@ -24,7 +24,7 @@ namespace GamecraftModdingAPI.Tests : IllusionPlugin.IEnhancedPlugin #endif { - private static HarmonyInstance harmony { get; set; } + private static Harmony harmony { get; set; } public string[] Filter { get; } = new string[] { "Gamecraft", "GamecraftPreview" }; @@ -42,7 +42,7 @@ namespace GamecraftModdingAPI.Tests public void OnApplicationStart() { FileLog.Reset(); - HarmonyInstance.DEBUG = true; + Harmony.DEBUG = true; GamecraftModdingAPI.Main.Init(); Logging.MetaDebugLog($"Version group id {(uint)ApiExclusiveGroups.versionGroup}"); // in case Steam is not installed/running diff --git a/GamecraftModdingAPI/Utility/AnalyticsDisablerPatch.cs b/GamecraftModdingAPI/Utility/AnalyticsDisablerPatch.cs index b18304a..048e6fc 100644 --- a/GamecraftModdingAPI/Utility/AnalyticsDisablerPatch.cs +++ b/GamecraftModdingAPI/Utility/AnalyticsDisablerPatch.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; using System.Reflection; using Analytics; -using Harmony; +using HarmonyLib; using RobocraftX.Common; using Svelto.ECS; @@ -30,7 +30,7 @@ namespace GamecraftModdingAPI.Utility return !DisableAnalytics; } - public static MethodBase TargetMethod(HarmonyInstance instance) + public static MethodBase TargetMethod(Harmony instance) { return typeof(Analytics.AnalyticsCompositionRoot).GetMethod("Compose").MakeGenericMethod(typeof(object)); } diff --git a/GamecraftModdingAPI/Utility/FullGameFields.cs b/GamecraftModdingAPI/Utility/FullGameFields.cs index 377f451..5291d4a 100644 --- a/GamecraftModdingAPI/Utility/FullGameFields.cs +++ b/GamecraftModdingAPI/Utility/FullGameFields.cs @@ -5,7 +5,7 @@ using System.Text; using System.Threading.Tasks; using DataLoader; -using Harmony; +using HarmonyLib; using RobocraftX; using RobocraftX.Common.Utilities; using RobocraftX.GUI; diff --git a/GamecraftModdingAPI/Utility/MinimumSpecsCheckPatch.cs b/GamecraftModdingAPI/Utility/MinimumSpecsCheckPatch.cs index 739c232..23d392c 100644 --- a/GamecraftModdingAPI/Utility/MinimumSpecsCheckPatch.cs +++ b/GamecraftModdingAPI/Utility/MinimumSpecsCheckPatch.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -using Harmony; +using HarmonyLib; using RobocraftX.FrontEnd; namespace GamecraftModdingAPI.Utility diff --git a/GamecraftModdingAPI/Utility/SteamInitPatch.cs b/GamecraftModdingAPI/Utility/SteamInitPatch.cs index c57b4e8..b8546c2 100644 --- a/GamecraftModdingAPI/Utility/SteamInitPatch.cs +++ b/GamecraftModdingAPI/Utility/SteamInitPatch.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -using Harmony; +using HarmonyLib; using RobocraftX.Common; namespace GamecraftModdingAPI.Utility -- 2.30.2 From ac2d3b38c711fb490db36d041461d26a40484027 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Fri, 8 May 2020 20:07:39 -0400 Subject: [PATCH 012/252] Remove IronPython --- GamecraftModdingAPI/GamecraftModdingAPI.csproj | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/GamecraftModdingAPI/GamecraftModdingAPI.csproj b/GamecraftModdingAPI/GamecraftModdingAPI.csproj index 86dfe3f..c74d456 100644 --- a/GamecraftModdingAPI/GamecraftModdingAPI.csproj +++ b/GamecraftModdingAPI/GamecraftModdingAPI.csproj @@ -41,22 +41,6 @@ ..\ref\Gamecraft_Data\Managed\Unity.Burst.Unsafe.dll ..\..\ref\Gamecraft_Data\Managed\Unity.Burst.Unsafe.dll - - ..\ref\Gamecraft_Data\Managed\IronPython.Wpf.dll - ..\..\ref\Gamecraft_Data\Managed\IronPython.Wpf.dll - - - ..\ref\Gamecraft_Data\Managed\IronPython.dll - ..\..\ref\Gamecraft_Data\Managed\IronPython.dll - - - ..\ref\Gamecraft_Data\Managed\IronPython.Modules.dll - ..\..\ref\Gamecraft_Data\Managed\IronPython.Modules.dll - - - ..\ref\Gamecraft_Data\Managed\IronPython.SQLite.dll - ..\..\ref\Gamecraft_Data\Managed\IronPython.SQLite.dll - ..\ref\Gamecraft_Data\Managed\Facepunch.Steamworks.Win64.dll ..\..\ref\Gamecraft_Data\Managed\Facepunch.Steamworks.Win64.dll -- 2.30.2 From bc77c35bdbcacf20a67e211181d03bd0783d6d1a Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Fri, 8 May 2020 20:08:39 -0400 Subject: [PATCH 013/252] Remove DiscordRPC --- GamecraftModdingAPI/GamecraftModdingAPI.csproj | 4 ---- 1 file changed, 4 deletions(-) diff --git a/GamecraftModdingAPI/GamecraftModdingAPI.csproj b/GamecraftModdingAPI/GamecraftModdingAPI.csproj index c74d456..f08761b 100644 --- a/GamecraftModdingAPI/GamecraftModdingAPI.csproj +++ b/GamecraftModdingAPI/GamecraftModdingAPI.csproj @@ -53,10 +53,6 @@ ..\ref\Gamecraft_Data\Managed\Rewired_Windows.dll ..\..\ref\Gamecraft_Data\Managed\Rewired_Windows.dll - - ..\ref\Gamecraft_Data\Managed\DiscordRPC.dll - ..\..\ref\Gamecraft_Data\Managed\DiscordRPC.dll - ..\ref\Gamecraft_Data\Managed\mscorlib.dll ..\..\ref\Gamecraft_Data\Managed\mscorlib.dll -- 2.30.2 From a17e5a6449637d1910f8ac30956ead999c555d37 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Fri, 8 May 2020 20:09:41 -0400 Subject: [PATCH 014/252] Fix ref gen --- Automation/gen_csproj.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Automation/gen_csproj.py b/Automation/gen_csproj.py index fecdc0b..ffdd37b 100755 --- a/Automation/gen_csproj.py +++ b/Automation/gen_csproj.py @@ -4,7 +4,7 @@ import argparse from pathlib import Path, PurePath import re -DLL_EXCLUSIONS_REGEX = r"(System|Microsoft|Mono)\." +DLL_EXCLUSIONS_REGEX = r"(System|Microsoft|Mono|IronPython|DiscordRPC)\." def getAssemblyReferences(path): asmDir = Path(path) -- 2.30.2 From 42b21bc16d4e77a94c7b12031e59888b39fec41f Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Mon, 11 May 2020 20:28:26 -0400 Subject: [PATCH 015/252] Rework engine inheritance structure --- GamecraftModdingAPI/Blocks/MovementEngine.cs | 7 +++- GamecraftModdingAPI/Blocks/PlacementEngine.cs | 5 ++- GamecraftModdingAPI/Blocks/RemovalEngine.cs | 5 ++- GamecraftModdingAPI/Blocks/RotationEngine.cs | 5 ++- GamecraftModdingAPI/Blocks/SignalEngine.cs | 5 ++- GamecraftModdingAPI/Blocks/TweakableEngine.cs | 6 ++- .../Commands/ICustomCommandEngine.cs | 1 + .../Commands/SimpleCustomCommandEngine.cs | 4 +- .../Commands/SimpleCustomCommandEngine1.cs | 4 +- .../Commands/SimpleCustomCommandEngine2.cs | 4 +- .../Commands/SimpleCustomCommandEngine3.cs | 4 +- .../{Utility => Engines}/IApiEngine.cs | 7 +++- GamecraftModdingAPI/Engines/IFactoryEngine.cs | 24 ++++++++++++ .../Engines/IReactionaryEngine.cs | 20 ++++++++++ .../Events/IEventEmitterEngine.cs | 27 +++---------- .../Events/IEventHandlerEngine.cs | 4 +- .../Events/SimpleEventHandlerEngine.cs | 4 +- GamecraftModdingAPI/Input/FakeInputEngine.cs | 3 ++ GamecraftModdingAPI/Inventory/HotbarEngine.cs | 3 ++ .../Utility/AnalyticsDisablerPatch.cs | 38 ------------------- .../Utility/GameEngineManager.cs | 16 +++++++- .../Utility/GameStateEngine.cs | 6 ++- .../Utility/MenuEngineManager.cs | 16 +++++++- .../Utility/MinimumSpecsCheckPatch.cs | 28 -------------- GamecraftModdingAPI/Utility/SteamInitPatch.cs | 30 --------------- 25 files changed, 140 insertions(+), 136 deletions(-) rename GamecraftModdingAPI/{Utility => Engines}/IApiEngine.cs (69%) create mode 100644 GamecraftModdingAPI/Engines/IFactoryEngine.cs create mode 100644 GamecraftModdingAPI/Engines/IReactionaryEngine.cs delete mode 100644 GamecraftModdingAPI/Utility/AnalyticsDisablerPatch.cs delete mode 100644 GamecraftModdingAPI/Utility/MinimumSpecsCheckPatch.cs delete mode 100644 GamecraftModdingAPI/Utility/SteamInitPatch.cs diff --git a/GamecraftModdingAPI/Blocks/MovementEngine.cs b/GamecraftModdingAPI/Blocks/MovementEngine.cs index ab4eaa4..fbeea99 100644 --- a/GamecraftModdingAPI/Blocks/MovementEngine.cs +++ b/GamecraftModdingAPI/Blocks/MovementEngine.cs @@ -18,9 +18,10 @@ using Svelto.ECS.EntityStructs; using Unity.Transforms; using Unity.Mathematics; using UnityEngine; +using Svelto.DataStructures; using GamecraftModdingAPI.Utility; -using Svelto.DataStructures; +using GamecraftModdingAPI.Engines; namespace GamecraftModdingAPI.Blocks { @@ -33,7 +34,9 @@ namespace GamecraftModdingAPI.Blocks public EntitiesDB entitiesDB { set; private get; } - public bool IsInGame = false; + public bool isRemovable => false; + + public bool IsInGame = false; public void Dispose() { diff --git a/GamecraftModdingAPI/Blocks/PlacementEngine.cs b/GamecraftModdingAPI/Blocks/PlacementEngine.cs index d954940..17f3314 100644 --- a/GamecraftModdingAPI/Blocks/PlacementEngine.cs +++ b/GamecraftModdingAPI/Blocks/PlacementEngine.cs @@ -21,6 +21,7 @@ using UnityEngine; using uREPL; using GamecraftModdingAPI.Utility; +using GamecraftModdingAPI.Engines; namespace GamecraftModdingAPI.Blocks { @@ -128,7 +129,9 @@ namespace GamecraftModdingAPI.Blocks public string Name { get; } = "GamecraftModdingAPIPlacementGameEngine"; - [HarmonyPatch] + public bool isRemovable => false; + + [HarmonyPatch] public class FactoryObtainerPatch { static void Postfix(BlockEntityFactory blockEntityFactory) diff --git a/GamecraftModdingAPI/Blocks/RemovalEngine.cs b/GamecraftModdingAPI/Blocks/RemovalEngine.cs index 010b2fe..823cc86 100644 --- a/GamecraftModdingAPI/Blocks/RemovalEngine.cs +++ b/GamecraftModdingAPI/Blocks/RemovalEngine.cs @@ -12,6 +12,7 @@ using uREPL; using GamecraftModdingAPI.Commands; using GamecraftModdingAPI.Utility; +using GamecraftModdingAPI.Engines; namespace GamecraftModdingAPI.Blocks { @@ -54,7 +55,9 @@ namespace GamecraftModdingAPI.Blocks public string Name { get; } = "GamecraftModdingAPIRemovalGameEngine"; - [HarmonyPatch] + public bool isRemovable => false; + + [HarmonyPatch] public class FactoryObtainerPatch { static void Postfix(IEntityFunctions entityFunctions, diff --git a/GamecraftModdingAPI/Blocks/RotationEngine.cs b/GamecraftModdingAPI/Blocks/RotationEngine.cs index 8038739..d56994f 100644 --- a/GamecraftModdingAPI/Blocks/RotationEngine.cs +++ b/GamecraftModdingAPI/Blocks/RotationEngine.cs @@ -20,6 +20,7 @@ using Unity.Mathematics; using UnityEngine; using GamecraftModdingAPI.Utility; +using GamecraftModdingAPI.Engines; namespace GamecraftModdingAPI.Blocks { @@ -32,7 +33,9 @@ namespace GamecraftModdingAPI.Blocks public EntitiesDB entitiesDB { set; private get; } - public bool IsInGame = false; + public bool isRemovable => false; + + public bool IsInGame = false; public void Dispose() { diff --git a/GamecraftModdingAPI/Blocks/SignalEngine.cs b/GamecraftModdingAPI/Blocks/SignalEngine.cs index b40b0bb..6bac3cb 100644 --- a/GamecraftModdingAPI/Blocks/SignalEngine.cs +++ b/GamecraftModdingAPI/Blocks/SignalEngine.cs @@ -22,6 +22,7 @@ using UnityEngine; using Gamecraft.Wires; using GamecraftModdingAPI.Utility; +using GamecraftModdingAPI.Engines; namespace GamecraftModdingAPI.Blocks { @@ -33,8 +34,10 @@ namespace GamecraftModdingAPI.Blocks public string Name { get; } = "GamecraftModdingAPISignalGameEngine"; public EntitiesDB entitiesDB { set; private get; } + + public bool isRemovable => false; - public bool IsInGame = false; + public bool IsInGame = false; public void Dispose() { diff --git a/GamecraftModdingAPI/Blocks/TweakableEngine.cs b/GamecraftModdingAPI/Blocks/TweakableEngine.cs index 1d029ee..63b02f7 100644 --- a/GamecraftModdingAPI/Blocks/TweakableEngine.cs +++ b/GamecraftModdingAPI/Blocks/TweakableEngine.cs @@ -3,9 +3,11 @@ using System.Reflection; using RobocraftX.Blocks; using Gamecraft.Wires; +using Svelto.ECS; using GamecraftModdingAPI.Utility; -using Svelto.ECS; +using GamecraftModdingAPI.Engines; + namespace GamecraftModdingAPI.Blocks { @@ -15,6 +17,8 @@ namespace GamecraftModdingAPI.Blocks public EntitiesDB entitiesDB { set; private get; } + public bool isRemovable => false; + public bool IsInGame = false; public void Dispose() diff --git a/GamecraftModdingAPI/Commands/ICustomCommandEngine.cs b/GamecraftModdingAPI/Commands/ICustomCommandEngine.cs index b971390..aafd257 100644 --- a/GamecraftModdingAPI/Commands/ICustomCommandEngine.cs +++ b/GamecraftModdingAPI/Commands/ICustomCommandEngine.cs @@ -7,6 +7,7 @@ using System.Threading.Tasks; using Svelto.ECS; using GamecraftModdingAPI.Utility; +using GamecraftModdingAPI.Engines; namespace GamecraftModdingAPI.Commands { diff --git a/GamecraftModdingAPI/Commands/SimpleCustomCommandEngine.cs b/GamecraftModdingAPI/Commands/SimpleCustomCommandEngine.cs index e5ea499..d99edce 100644 --- a/GamecraftModdingAPI/Commands/SimpleCustomCommandEngine.cs +++ b/GamecraftModdingAPI/Commands/SimpleCustomCommandEngine.cs @@ -31,7 +31,9 @@ namespace GamecraftModdingAPI.Commands public EntitiesDB entitiesDB { set; private get; } - public void Dispose() + public bool isRemovable => true; + + public void Dispose() { GamecraftModdingAPI.Utility.Logging.MetaDebugLog($"Unregistering SimpleCustomCommandEngine {this.Name}"); CommandRegistrationHelper.Unregister(this.Name); diff --git a/GamecraftModdingAPI/Commands/SimpleCustomCommandEngine1.cs b/GamecraftModdingAPI/Commands/SimpleCustomCommandEngine1.cs index 4ec5949..307cac6 100644 --- a/GamecraftModdingAPI/Commands/SimpleCustomCommandEngine1.cs +++ b/GamecraftModdingAPI/Commands/SimpleCustomCommandEngine1.cs @@ -22,7 +22,9 @@ namespace GamecraftModdingAPI.Commands public EntitiesDB entitiesDB { set; private get; } - public void Dispose() + public bool isRemovable => true; + + public void Dispose() { GamecraftModdingAPI.Utility.Logging.MetaDebugLog($"Unregistering SimpleCustomCommandEngine {this.Name}"); CommandRegistrationHelper.Unregister(this.Name); diff --git a/GamecraftModdingAPI/Commands/SimpleCustomCommandEngine2.cs b/GamecraftModdingAPI/Commands/SimpleCustomCommandEngine2.cs index 2aa81a3..2e162aa 100644 --- a/GamecraftModdingAPI/Commands/SimpleCustomCommandEngine2.cs +++ b/GamecraftModdingAPI/Commands/SimpleCustomCommandEngine2.cs @@ -22,7 +22,9 @@ namespace GamecraftModdingAPI.Commands public EntitiesDB entitiesDB { set; private get; } - public void Dispose() + public bool isRemovable => true; + + public void Dispose() { GamecraftModdingAPI.Utility.Logging.MetaDebugLog($"Unregistering SimpleCustomCommandEngine {this.Name}"); CommandRegistrationHelper.Unregister(this.Name); diff --git a/GamecraftModdingAPI/Commands/SimpleCustomCommandEngine3.cs b/GamecraftModdingAPI/Commands/SimpleCustomCommandEngine3.cs index 5db84c2..e88b153 100644 --- a/GamecraftModdingAPI/Commands/SimpleCustomCommandEngine3.cs +++ b/GamecraftModdingAPI/Commands/SimpleCustomCommandEngine3.cs @@ -22,7 +22,9 @@ namespace GamecraftModdingAPI.Commands public EntitiesDB entitiesDB { set; private get; } - public void Dispose() + public bool isRemovable => true; + + public void Dispose() { GamecraftModdingAPI.Utility.Logging.MetaDebugLog($"Unregistering SimpleCustomCommandEngine {this.Name}"); CommandRegistrationHelper.Unregister(this.Name); diff --git a/GamecraftModdingAPI/Utility/IApiEngine.cs b/GamecraftModdingAPI/Engines/IApiEngine.cs similarity index 69% rename from GamecraftModdingAPI/Utility/IApiEngine.cs rename to GamecraftModdingAPI/Engines/IApiEngine.cs index 0dd3e78..210c13d 100644 --- a/GamecraftModdingAPI/Utility/IApiEngine.cs +++ b/GamecraftModdingAPI/Engines/IApiEngine.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; using Svelto.ECS; -namespace GamecraftModdingAPI.Utility +namespace GamecraftModdingAPI.Engines { /// /// Base engine interface used by all GamecraftModdingAPI engines @@ -17,5 +17,10 @@ namespace GamecraftModdingAPI.Utility /// The name of the engine /// string Name { get; } + + /// + /// Whether the emitter can be removed with Manager.RemoveEventEmitter(name) + /// + bool isRemovable { get; } } } diff --git a/GamecraftModdingAPI/Engines/IFactoryEngine.cs b/GamecraftModdingAPI/Engines/IFactoryEngine.cs new file mode 100644 index 0000000..3e9c23e --- /dev/null +++ b/GamecraftModdingAPI/Engines/IFactoryEngine.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using Svelto.ECS; + +using GamecraftModdingAPI.Utility; + +namespace GamecraftModdingAPI.Engines +{ + /// + /// Engine interface to create a ModEventEntityStruct in entitiesDB when Emit() is called. + /// + public interface IFactoryEngine : IApiEngine + { + /// + /// The EntityFactory for the entitiesDB. + /// Use this to create a ModEventEntityStruct when Emit() is called. + /// + IEntityFactory Factory { set; } + } +} diff --git a/GamecraftModdingAPI/Engines/IReactionaryEngine.cs b/GamecraftModdingAPI/Engines/IReactionaryEngine.cs new file mode 100644 index 0000000..9381605 --- /dev/null +++ b/GamecraftModdingAPI/Engines/IReactionaryEngine.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using Svelto.ECS; +using Svelto.ECS.Internal; + +using GamecraftModdingAPI.Events; + +namespace GamecraftModdingAPI.Engines +{ + /// + /// Engine interface to handle ModEventEntityStruct events emitted by IEventEmitterEngines. + /// + public interface IReactionaryEngine : IApiEngine, IReactOnAddAndRemove, IReactOnAddAndRemove where T : unmanaged, IEntityComponent + { + } +} diff --git a/GamecraftModdingAPI/Events/IEventEmitterEngine.cs b/GamecraftModdingAPI/Events/IEventEmitterEngine.cs index 6a303aa..f6fefc5 100644 --- a/GamecraftModdingAPI/Events/IEventEmitterEngine.cs +++ b/GamecraftModdingAPI/Events/IEventEmitterEngine.cs @@ -6,35 +6,18 @@ using System.Threading.Tasks; using Svelto.ECS; -using GamecraftModdingAPI.Utility; +using GamecraftModdingAPI.Engines; namespace GamecraftModdingAPI.Events { /// - /// Engine interface to create a ModEventEntityStruct in entitiesDB when Emit() is called. + /// Engine interface to create a ModEventEntityStruct in entitiesDB when a specific event occurs. /// - public interface IEventEmitterEngine : IApiEngine + public interface IEventEmitterEngine : IFactoryEngine { /// - /// The type of event emitted + /// Emit the event. (Optional) /// - int type { get; } - - /// - /// Whether the emitter can be removed with Manager.RemoveEventEmitter(name) - /// - bool isRemovable { get; } - - /// - /// The EntityFactory for the entitiesDB. - /// Use this to create a ModEventEntityStruct when Emit() is called. - /// - IEntityFactory Factory { set; } - - /// - /// Emit the event so IEventHandlerEngines can handle it. - /// Call Emit() to trigger the IEventEmitterEngine's event. - /// - void Emit(); + void Emit(); } } diff --git a/GamecraftModdingAPI/Events/IEventHandlerEngine.cs b/GamecraftModdingAPI/Events/IEventHandlerEngine.cs index 7f0aa3f..34a14af 100644 --- a/GamecraftModdingAPI/Events/IEventHandlerEngine.cs +++ b/GamecraftModdingAPI/Events/IEventHandlerEngine.cs @@ -7,14 +7,14 @@ using System.Threading.Tasks; using Svelto.ECS; using Svelto.ECS.Internal; -using GamecraftModdingAPI.Utility; +using GamecraftModdingAPI.Engines; namespace GamecraftModdingAPI.Events { /// /// Engine interface to handle ModEventEntityStruct events emitted by IEventEmitterEngines. /// - public interface IEventHandlerEngine : IApiEngine, IReactOnAddAndRemove, IReactOnAddAndRemove + public interface IEventHandlerEngine : IReactionaryEngine { } } diff --git a/GamecraftModdingAPI/Events/SimpleEventHandlerEngine.cs b/GamecraftModdingAPI/Events/SimpleEventHandlerEngine.cs index d0bc341..b656273 100644 --- a/GamecraftModdingAPI/Events/SimpleEventHandlerEngine.cs +++ b/GamecraftModdingAPI/Events/SimpleEventHandlerEngine.cs @@ -24,7 +24,9 @@ namespace GamecraftModdingAPI.Events public EntitiesDB entitiesDB { set; private get; } - public void Add(ref ModEventEntityStruct entityView, EGID egid) + public bool isRemovable => true; + + public void Add(ref ModEventEntityStruct entityView, EGID egid) { if (entityView.type.Equals(this.type)) { diff --git a/GamecraftModdingAPI/Input/FakeInputEngine.cs b/GamecraftModdingAPI/Input/FakeInputEngine.cs index dea0f3e..bc9aaa8 100644 --- a/GamecraftModdingAPI/Input/FakeInputEngine.cs +++ b/GamecraftModdingAPI/Input/FakeInputEngine.cs @@ -5,6 +5,7 @@ using RobocraftX.Players; using Svelto.ECS; using GamecraftModdingAPI.Utility; +using GamecraftModdingAPI.Engines; namespace GamecraftModdingAPI.Input { @@ -14,6 +15,8 @@ namespace GamecraftModdingAPI.Input public EntitiesDB entitiesDB { set; private get; } + public bool isRemovable => false; + public bool IsReady = false; public void Dispose() diff --git a/GamecraftModdingAPI/Inventory/HotbarEngine.cs b/GamecraftModdingAPI/Inventory/HotbarEngine.cs index 065298b..2079fb1 100644 --- a/GamecraftModdingAPI/Inventory/HotbarEngine.cs +++ b/GamecraftModdingAPI/Inventory/HotbarEngine.cs @@ -10,6 +10,7 @@ using Svelto.ECS; using GamecraftModdingAPI.Blocks; using GamecraftModdingAPI.Utility; +using GamecraftModdingAPI.Engines; namespace GamecraftModdingAPI.Inventory { @@ -19,6 +20,8 @@ namespace GamecraftModdingAPI.Inventory public EntitiesDB entitiesDB { set; private get; } + public bool isRemovable => false; + public bool IsInGame = false; public void Dispose() diff --git a/GamecraftModdingAPI/Utility/AnalyticsDisablerPatch.cs b/GamecraftModdingAPI/Utility/AnalyticsDisablerPatch.cs deleted file mode 100644 index 048e6fc..0000000 --- a/GamecraftModdingAPI/Utility/AnalyticsDisablerPatch.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Reflection; - -using Analytics; -using HarmonyLib; -using RobocraftX.Common; -using Svelto.ECS; - -namespace GamecraftModdingAPI.Utility -{ - /// - /// Patch of Analytics.AnalyticsCompositionRoot.Compose(...) - /// This stops some analytics collection built into Gamecraft. - /// DO NOT USE! (This will likely crash your game on shutdown) - /// - [HarmonyPatch] - class AnalyticsDisablerPatch - { - /// - /// Don't activate gameplay analytics? - /// - public static bool DisableAnalytics = false; - - public static bool Prefix(object contextHolder, EnginesRoot enginesRoot, RCXMode rcxMode) - { - return !DisableAnalytics; - } - - public static MethodBase TargetMethod(Harmony instance) - { - return typeof(Analytics.AnalyticsCompositionRoot).GetMethod("Compose").MakeGenericMethod(typeof(object)); - } - } -} diff --git a/GamecraftModdingAPI/Utility/GameEngineManager.cs b/GamecraftModdingAPI/Utility/GameEngineManager.cs index 5a52fd0..cc4973f 100644 --- a/GamecraftModdingAPI/Utility/GameEngineManager.cs +++ b/GamecraftModdingAPI/Utility/GameEngineManager.cs @@ -6,6 +6,8 @@ using System.Threading.Tasks; using Svelto.ECS; +using GamecraftModdingAPI.Engines; + namespace GamecraftModdingAPI.Utility { /// @@ -24,6 +26,10 @@ namespace GamecraftModdingAPI.Utility { Logging.MetaDebugLog($"Registering Game IApiEngine {engine.Name}"); _lastEngineRoot.AddEngine(engine); + if (typeof(IFactoryEngine).IsAssignableFrom(engine.GetType())) + { + ((IFactoryEngine)engine).Factory = _lastEngineRoot.GenerateEntityFactory(); + } } } @@ -49,16 +55,24 @@ namespace GamecraftModdingAPI.Utility public static void RemoveGameEngine(string name) { - _gameEngines.Remove(name); + if (_gameEngines[name].isRemovable) + { + _gameEngines.Remove(name); + } } public static void RegisterEngines(EnginesRoot enginesRoot) { _lastEngineRoot = enginesRoot; + IEntityFactory factory = enginesRoot.GenerateEntityFactory(); foreach (var key in _gameEngines.Keys) { Logging.MetaDebugLog($"Registering Game IApiEngine {_gameEngines[key].Name}"); enginesRoot.AddEngine(_gameEngines[key]); + if (typeof(IFactoryEngine).IsAssignableFrom(_gameEngines[key].GetType())) + { + ((IFactoryEngine)_gameEngines[key]).Factory = factory; + } } } } diff --git a/GamecraftModdingAPI/Utility/GameStateEngine.cs b/GamecraftModdingAPI/Utility/GameStateEngine.cs index 204f491..be20ba1 100644 --- a/GamecraftModdingAPI/Utility/GameStateEngine.cs +++ b/GamecraftModdingAPI/Utility/GameStateEngine.cs @@ -7,6 +7,8 @@ using System.Threading.Tasks; using RobocraftX.SimulationModeState; +using GamecraftModdingAPI.Engines; + namespace GamecraftModdingAPI.Utility { class GameStateEngine : IApiEngine @@ -19,7 +21,9 @@ namespace GamecraftModdingAPI.Utility public bool IsInGame { get { return _isInGame; } } - public void Dispose() + public bool isRemovable => false; + + public void Dispose() { _isInGame = false; } diff --git a/GamecraftModdingAPI/Utility/MenuEngineManager.cs b/GamecraftModdingAPI/Utility/MenuEngineManager.cs index b5d7be1..9be203d 100644 --- a/GamecraftModdingAPI/Utility/MenuEngineManager.cs +++ b/GamecraftModdingAPI/Utility/MenuEngineManager.cs @@ -6,6 +6,8 @@ using System.Threading.Tasks; using Svelto.ECS; +using GamecraftModdingAPI.Engines; + namespace GamecraftModdingAPI.Utility { /// @@ -25,6 +27,10 @@ namespace GamecraftModdingAPI.Utility { Logging.MetaDebugLog($"Registering Menu IApiEngine {engine.Name}"); _lastEngineRoot.AddEngine(engine); + if (typeof(IFactoryEngine).IsAssignableFrom(engine.GetType())) + { + ((IFactoryEngine)engine).Factory = _lastEngineRoot.GenerateEntityFactory(); + } } } @@ -50,16 +56,24 @@ namespace GamecraftModdingAPI.Utility public static void RemoveMenuEngine(string name) { - _menuEngines.Remove(name); + if (_menuEngines[name].isRemovable) + { + _menuEngines.Remove(name); + } } public static void RegisterEngines(EnginesRoot enginesRoot) { _lastEngineRoot = enginesRoot; + IEntityFactory factory = enginesRoot.GenerateEntityFactory(); foreach (var key in _menuEngines.Keys) { Logging.MetaDebugLog($"Registering Menu IApiEngine {_menuEngines[key].Name}"); enginesRoot.AddEngine(_menuEngines[key]); + if (typeof(IFactoryEngine).IsAssignableFrom(_menuEngines[key].GetType())) + { + ((IFactoryEngine)_menuEngines[key]).Factory = factory; + } } } } diff --git a/GamecraftModdingAPI/Utility/MinimumSpecsCheckPatch.cs b/GamecraftModdingAPI/Utility/MinimumSpecsCheckPatch.cs deleted file mode 100644 index 23d392c..0000000 --- a/GamecraftModdingAPI/Utility/MinimumSpecsCheckPatch.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -using HarmonyLib; -using RobocraftX.FrontEnd; - -namespace GamecraftModdingAPI.Utility -{ - /// - /// Patch of bool RobocraftX.FrontEnd.MinimumSpecsCheck.CheckRequirementsMet() - /// - [HarmonyPatch(typeof(MinimumSpecsCheck), "CheckRequirementsMet")] - class MinimumSpecsCheckPatch - { - /// - /// Ignore result of the requirement check? - /// - public static bool ForcePassMinimumSpecCheck = false; - - public static void Postfix(ref bool __result) - { - __result = __result || ForcePassMinimumSpecCheck; - } - } -} diff --git a/GamecraftModdingAPI/Utility/SteamInitPatch.cs b/GamecraftModdingAPI/Utility/SteamInitPatch.cs deleted file mode 100644 index b8546c2..0000000 --- a/GamecraftModdingAPI/Utility/SteamInitPatch.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -using HarmonyLib; -using RobocraftX.Common; - -namespace GamecraftModdingAPI.Utility -{ - /// - /// Patch of bool RobocraftX.Common.SteamManager.VerifyOrInit() - /// This does not let you run Gamecraft without Steam. - /// DO NOT USE! - /// - [HarmonyPatch(typeof(SteamManager), "VerifyOrInit")] - class SteamInitPatch - { - /// - /// Ignore the result of steam initialization? - /// - public static bool ForcePassSteamCheck = false; - - public static void Postfix(ref bool __result) - { - __result = __result || ForcePassSteamCheck; - } - } -} -- 2.30.2 From e3b3fd5ef4ad4d29d50cb1c2c93e89914885f527 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Mon, 11 May 2020 20:30:16 -0400 Subject: [PATCH 016/252] Implement Player OOP class --- GamecraftModdingAPI/Main.cs | 2 + GamecraftModdingAPI/Player.cs | 166 ++++++++++++++ GamecraftModdingAPI/Players/PlayerEngine.cs | 238 ++++++++++++++++++++ GamecraftModdingAPI/Players/PlayerType.cs | 9 + 4 files changed, 415 insertions(+) create mode 100644 GamecraftModdingAPI/Player.cs create mode 100644 GamecraftModdingAPI/Players/PlayerEngine.cs create mode 100644 GamecraftModdingAPI/Players/PlayerType.cs diff --git a/GamecraftModdingAPI/Main.cs b/GamecraftModdingAPI/Main.cs index 1258435..4dced5e 100644 --- a/GamecraftModdingAPI/Main.cs +++ b/GamecraftModdingAPI/Main.cs @@ -71,6 +71,8 @@ namespace GamecraftModdingAPI Inventory.Hotbar.Init(); // init input Input.FakeInput.Init(); + // init object-oriented classes + Player.Init(); Logging.MetaLog($"{currentAssembly.GetName().Name} v{currentAssembly.GetName().Version} initialized"); } diff --git a/GamecraftModdingAPI/Player.cs b/GamecraftModdingAPI/Player.cs new file mode 100644 index 0000000..6bd05c5 --- /dev/null +++ b/GamecraftModdingAPI/Player.cs @@ -0,0 +1,166 @@ +using System; + +using Unity.Mathematics; + +using GamecraftModdingAPI.Players; +using GamecraftModdingAPI.Utility; + +namespace GamecraftModdingAPI +{ + public class Player + { + // static functionality + private static PlayerEngine playerEngine = new PlayerEngine(); + + public static bool Exists(PlayerType player) + { + switch (player) + { + case PlayerType.Remote: + return playerEngine.GetRemotePlayer() != uint.MaxValue; + case PlayerType.Local: + return playerEngine.GetLocalPlayer() != uint.MaxValue; + } + return false; + } + + public static bool Exists(uint player) + { + return playerEngine.ExistsById(player); + } + + public Player(uint id) + { + this.Id = id; + if (!Exists(id)) + { + throw new InvalidOperationException($"No player with id {id} exists"); + } + this.Type = playerEngine.GetLocalPlayer() == id ? PlayerType.Local : PlayerType.Remote; + } + + public Player(PlayerType player) + { + uint localId = playerEngine.GetLocalPlayer(); + switch (player) + { + case PlayerType.Local: + this.Id = playerEngine.GetLocalPlayer(); + break; + case PlayerType.Remote: + this.Id = playerEngine.GetRemotePlayer(); + break; + } + if (this.Id == uint.MaxValue) + { + throw new InvalidOperationException($"No player of {player} type exists"); + } + this.Type = player; + } + + // object fields & properties + + public PlayerType Type { get; } + + public uint Id { get; private set; } + + public float3 Position + { + get + { + return playerEngine.GetLocation(Id); + } + + set + { + playerEngine.SetLocation(Id, value, false); + } + } + + public quaternion Rotation + { + get + { + return playerEngine.GetRotation(Id); + } + + set + { + playerEngine.SetRotation(Id, value); + } + } + + public float3 Velocity + { + get + { + return playerEngine.GetLinearVelocity(Id); + } + + set + { + playerEngine.SetLinearVelocity(Id, value); + } + } + + public float3 AngularVelocity + { + get + { + return playerEngine.GetAngularVelocity(Id); + } + + set + { + playerEngine.SetAngularVelocity(Id, value); + } + } + + public float Mass + { + get + { + return 1f / playerEngine.GetMass(Id).InverseMass; + } + + set + { + playerEngine.SetInverseMass(Id, 1f / value); + } + } + + private float _ping = -1f; + + public float Ping + { + get + { + float? temp = playerEngine.GetLastPingTime(Id, Type); + if (temp.HasValue) + { + _ping = temp.Value; + } + return _ping; + } + } + + // object methods + + public void Teleport(float x, float y, float z, bool relative = true, bool exitSeat = true) + { + float3 location = new float3(x, y, z); + if (relative) + { + location += playerEngine.GetLocation(Id); + } + playerEngine.SetLocation(Id, location, exitSeat: exitSeat); + } + + // internal methods + + public static void Init() + { + Utility.GameEngineManager.AddGameEngine(playerEngine); + } + } +} diff --git a/GamecraftModdingAPI/Players/PlayerEngine.cs b/GamecraftModdingAPI/Players/PlayerEngine.cs new file mode 100644 index 0000000..beef48a --- /dev/null +++ b/GamecraftModdingAPI/Players/PlayerEngine.cs @@ -0,0 +1,238 @@ +using System; +using System.Runtime.CompilerServices; + +using RobocraftX.Character; +using RobocraftX.Character.Movement; +using RobocraftX.Common.Players; +using RobocraftX.Common.Input; +using RobocraftX.Physics; +using Svelto.ECS; +using Unity.Mathematics; +using Unity.Physics; + +using GamecraftModdingAPI.Engines; + +namespace GamecraftModdingAPI.Players +{ + internal class PlayerEngine : IApiEngine + { + public string Name { get; } = "GamecraftModdingAPIPlayerGameEngine"; + + public EntitiesDB entitiesDB { set; private get; } + + public bool isRemovable => false; + + private bool isReady = false; + + public void Dispose() + { + isReady = false; + } + + public void Ready() + { + isReady = true; + } + + public uint GetLocalPlayer() + { + if (!isReady) return uint.MaxValue; + PlayerIDStruct[] localPlayers = entitiesDB.QueryEntities(PlayersExclusiveGroups.LocalPlayers).ToFastAccess(out uint count); + if (count > 0) + { + return localPlayers[0].ID.entityID; + } + return uint.MaxValue; + } + + public uint GetRemotePlayer() + { + if (!isReady) return uint.MaxValue; + PlayerIDStruct[] localPlayers = entitiesDB.QueryEntities(PlayersExclusiveGroups.RemotePlayers).ToFastAccess(out uint count); + if (count > 0) + { + return localPlayers[0].ID.entityID; + } + return uint.MaxValue; + } + + public bool ExistsById(uint playerId) + { + PlayerIDStruct[] players = entitiesDB.QueryEntities(PlayersExclusiveGroups.LocalPlayers).ToFastAccess(out uint count); + for (int i = 0; i < count; i++) + { + if (players[i].ID.entityID == playerId) + { + return true; + } + } + players = entitiesDB.QueryEntities(PlayersExclusiveGroups.RemotePlayers).ToFastAccess(out count); + for (int i = 0; i < count; i++) + { + if (players[i].ID.entityID == playerId) + { + return true; + } + } + return false; + } + + public float3 GetLocation(uint playerId) + { + if (GetCharacterStruct(playerId, out RigidBodyEntityStruct rbes)) + { + return rbes.position; + } + return float3.zero; + } + + public bool SetLocation(uint playerId, float3 location, bool exitSeat = true) + { + ExclusiveGroup[] characterGroups = CharacterExclusiveGroups.AllCharacters; + for (int i = 0; i < characterGroups.Length; i++) + { + EGID egid = new EGID(playerId, characterGroups[i]); + if (entitiesDB.Exists(egid)) + { + ref RigidBodyEntityStruct rbes = ref entitiesDB.QueryEntity(egid); + if (characterGroups[i] == CharacterExclusiveGroups.InPilotSeatGroup && exitSeat) + { + entitiesDB.QueryEntity(egid).instantExit = true; + entitiesDB.PublishEntityChange(egid); + } + rbes.position = location; + return true; + } + } + return false; + } + + public quaternion GetRotation(uint playerId) + { + if (GetCharacterStruct(playerId, out RigidBodyEntityStruct rbes)) + { + return rbes.rotation; + } + return quaternion.identity; + } + + public bool SetRotation(uint playerId, quaternion value) + { + if (GetCharacterStruct(playerId, out RigidBodyEntityStruct rbes)) + { + rbes.rotation = value; + return true; + } + return false; + } + + public float3 GetLinearVelocity(uint playerId) + { + if (GetCharacterStruct(playerId, out RigidBodyEntityStruct rbes)) + { + return rbes.velocity; + } + return float3.zero; + } + + public bool SetLinearVelocity(uint playerId, float3 value) + { + if (GetCharacterStruct(playerId, out RigidBodyEntityStruct rbes)) + { + rbes.velocity = value; + return true; + } + return false; + } + + public float3 GetAngularVelocity(uint playerId) + { + if (GetCharacterStruct(playerId, out RigidBodyEntityStruct rbes)) + { + return rbes.angularVelocity; + } + return float3.zero; + } + + public bool SetAngularVelocity(uint playerId, float3 value) + { + if (GetCharacterStruct(playerId, out RigidBodyEntityStruct rbes)) + { + rbes.angularVelocity = value; + return true; + } + return false; + } + + public PhysicsMass GetMass(uint playerId) + { + if (GetCharacterStruct(playerId, out RigidBodyEntityStruct rbes)) + { + return rbes.physicsMass; + } + return default; + } + + public bool SetInverseMass(uint playerId, float inverseMass) + { + if (GetCharacterStruct(playerId, out RigidBodyEntityStruct rbes)) + { + rbes.physicsMass.InverseInertia = inverseMass; + return true; + } + return false; + } + + public float? GetLastPingTime(uint playerId, PlayerType type) + { + EGID egid = new EGID(playerId, GroupFromEnum(type)); + if (entitiesDB.Exists(egid)) + { + return entitiesDB.QueryEntity(egid).lastPingTimeSinceLevelLoad; + } + return null; + } + + // reusable methods + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private ExclusiveGroup GroupFromEnum(PlayerType type) + { + return type == PlayerType.Local ? PlayersExclusiveGroups.LocalPlayers : PlayersExclusiveGroups.RemotePlayers; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool GetCharacterStruct(uint playerId, out T s) where T : unmanaged, IEntityComponent + { + ExclusiveGroup[] characterGroups = CharacterExclusiveGroups.AllCharacters; + for (int i = 0; i < characterGroups.Length; i++) + { + EGID egid = new EGID(playerId, characterGroups[i]); + if (entitiesDB.Exists(egid)) + { + s = entitiesDB.QueryEntity(egid); + return true; + } + } + s = default; + return false; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool GetPlayerStruct(uint playerId, out T s) where T : unmanaged, IEntityComponent + { + ExclusiveGroup[] playerGroups = PlayersExclusiveGroups.AllPlayers; + for (int i = 0; i < playerGroups.Length; i++) + { + EGID egid = new EGID(playerId, playerGroups[i]); + if (entitiesDB.Exists(egid)) + { + s = entitiesDB.QueryEntity(egid); + return true; + } + } + s = default; + return false; + } + } +} diff --git a/GamecraftModdingAPI/Players/PlayerType.cs b/GamecraftModdingAPI/Players/PlayerType.cs new file mode 100644 index 0000000..0b4966c --- /dev/null +++ b/GamecraftModdingAPI/Players/PlayerType.cs @@ -0,0 +1,9 @@ +using System; +namespace GamecraftModdingAPI.Players +{ + public enum PlayerType + { + Local, + Remote + } +} -- 2.30.2 From 211c9c9c311300599b53a1988b6817e264056a13 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Tue, 12 May 2020 17:00:41 -0400 Subject: [PATCH 017/252] Add CommandBuilder existing commands function --- .../Commands/CommandBuilder.cs | 96 +++++++++++++++++++ .../Commands/SimpleCustomCommandEngine.cs | 5 + .../Commands/SimpleCustomCommandEngine1.cs | 5 + .../Commands/SimpleCustomCommandEngine2.cs | 5 + .../Commands/SimpleCustomCommandEngine3.cs | 5 + 5 files changed, 116 insertions(+) diff --git a/GamecraftModdingAPI/Commands/CommandBuilder.cs b/GamecraftModdingAPI/Commands/CommandBuilder.cs index f0f9258..d5f1b51 100644 --- a/GamecraftModdingAPI/Commands/CommandBuilder.cs +++ b/GamecraftModdingAPI/Commands/CommandBuilder.cs @@ -19,6 +19,8 @@ namespace GamecraftModdingAPI.Commands private ICustomCommandEngine commandEngine; + private bool fromExisting = false; + /// /// Create a new command builder. /// @@ -138,6 +140,96 @@ namespace GamecraftModdingAPI.Commands return this; } + /// + /// Build the command from an existing command. + /// + /// The command. Use Invoke() to execute it. + public SimpleCustomCommandEngine FromExisting() + { + if (string.IsNullOrWhiteSpace(name)) + { + throw new InvalidOperationException("Command name must be defined before FromExisting() is called"); + } + if (!ExistingCommands.Exists(name)) + { + throw new InvalidOperationException("Command cannot be built from existing because it does not exist."); + } + fromExisting = true; + return new SimpleCustomCommandEngine( + () => { ExistingCommands.Call(name); }, + name, + description); + } + + /// + /// Build the command from an existing command. + /// + /// The command. Use Invoke() to execute it. + /// The 1st parameter's type. + public SimpleCustomCommandEngine FromExisting() + { + if (string.IsNullOrWhiteSpace(name)) + { + throw new InvalidOperationException("Command name must be defined before FromExisting() is called"); + } + if (!ExistingCommands.Exists(name)) + { + throw new InvalidOperationException("Command cannot be built from existing because it does not exist."); + } + fromExisting = true; + return new SimpleCustomCommandEngine( + (A a) => { ExistingCommands.Call(name, a); }, + name, + description); + } + + /// + /// Build the command from an existing command. + /// + /// The command. Use Invoke() to execute it. + /// The 1st parameter's type. + /// The 2nd parameter's type. + public SimpleCustomCommandEngine FromExisting() + { + if (string.IsNullOrWhiteSpace(name)) + { + throw new InvalidOperationException("Command name must be defined before FromExisting() is called"); + } + if (!ExistingCommands.Exists(name)) + { + throw new InvalidOperationException("Command cannot be built from existing because it does not exist."); + } + fromExisting = true; + return new SimpleCustomCommandEngine( + (A a, B b) => { ExistingCommands.Call(name, a, b); }, + name, + description); + } + + /// + /// Build the command from an existing command. + /// + /// The command. Use Invoke() to execute it. + /// The 1st parameter's type. + /// The 2nd parameter's type. + /// The 3rd parameter's type. + public SimpleCustomCommandEngine FromExisting() + { + if (string.IsNullOrWhiteSpace(name)) + { + throw new InvalidOperationException("Command name must be defined before FromExisting() is called"); + } + if (!ExistingCommands.Exists(name)) + { + throw new InvalidOperationException("Command cannot be built from existing because it does not exist."); + } + fromExisting = true; + return new SimpleCustomCommandEngine( + (A a, B b, C c) => { ExistingCommands.Call(name, a, b, c); }, + name, + description); + } + /// /// Build the command. /// @@ -149,6 +241,10 @@ namespace GamecraftModdingAPI.Commands { throw new InvalidOperationException("Command name must be defined before Build() is called"); } + if (fromExisting) + { + throw new InvalidOperationException("Command was already built by FromExisting()"); + } if (commandEngine == null) { throw new InvalidOperationException("Command action must be defined before Build() is called"); diff --git a/GamecraftModdingAPI/Commands/SimpleCustomCommandEngine.cs b/GamecraftModdingAPI/Commands/SimpleCustomCommandEngine.cs index d99edce..ebf0758 100644 --- a/GamecraftModdingAPI/Commands/SimpleCustomCommandEngine.cs +++ b/GamecraftModdingAPI/Commands/SimpleCustomCommandEngine.cs @@ -57,5 +57,10 @@ namespace GamecraftModdingAPI.Commands this.Name = name; this.Description = description; } + + public void Invoke() + { + runCommand(); + } } } diff --git a/GamecraftModdingAPI/Commands/SimpleCustomCommandEngine1.cs b/GamecraftModdingAPI/Commands/SimpleCustomCommandEngine1.cs index 307cac6..a8dd96b 100644 --- a/GamecraftModdingAPI/Commands/SimpleCustomCommandEngine1.cs +++ b/GamecraftModdingAPI/Commands/SimpleCustomCommandEngine1.cs @@ -47,6 +47,11 @@ namespace GamecraftModdingAPI.Commands this.runCommand = command; this.Name = name; this.Description = description; + } + + public void Invoke(A a) + { + runCommand(a); } } } diff --git a/GamecraftModdingAPI/Commands/SimpleCustomCommandEngine2.cs b/GamecraftModdingAPI/Commands/SimpleCustomCommandEngine2.cs index 2e162aa..8333cd2 100644 --- a/GamecraftModdingAPI/Commands/SimpleCustomCommandEngine2.cs +++ b/GamecraftModdingAPI/Commands/SimpleCustomCommandEngine2.cs @@ -47,6 +47,11 @@ namespace GamecraftModdingAPI.Commands this.runCommand = command; this.Name = name; this.Description = description; + } + + public void Invoke(A a, B b) + { + runCommand(a, b); } } } diff --git a/GamecraftModdingAPI/Commands/SimpleCustomCommandEngine3.cs b/GamecraftModdingAPI/Commands/SimpleCustomCommandEngine3.cs index e88b153..e5570c3 100644 --- a/GamecraftModdingAPI/Commands/SimpleCustomCommandEngine3.cs +++ b/GamecraftModdingAPI/Commands/SimpleCustomCommandEngine3.cs @@ -47,6 +47,11 @@ namespace GamecraftModdingAPI.Commands this.runCommand = command; this.Name = name; this.Description = description; + } + + public void Invoke(A a, B b, C c) + { + runCommand(a, b, c); } } } -- 2.30.2 From 5168bfbad70dc12bf65988175ba10bc77c2c76a5 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Tue, 12 May 2020 17:08:30 -0400 Subject: [PATCH 018/252] Document Player API --- GamecraftModdingAPI/Player.cs | 67 +++++++++++++++++++++++++++++++++-- 1 file changed, 65 insertions(+), 2 deletions(-) diff --git a/GamecraftModdingAPI/Player.cs b/GamecraftModdingAPI/Player.cs index 6bd05c5..996ea01 100644 --- a/GamecraftModdingAPI/Player.cs +++ b/GamecraftModdingAPI/Player.cs @@ -7,11 +7,19 @@ using GamecraftModdingAPI.Utility; namespace GamecraftModdingAPI { + /// + /// An in-game player character. Any Leo you see is a player. + /// public class Player { // static functionality private static PlayerEngine playerEngine = new PlayerEngine(); + /// + /// Checks if the specified player exists. + /// + /// Whether the player exists. + /// Player type. public static bool Exists(PlayerType player) { switch (player) @@ -24,11 +32,20 @@ namespace GamecraftModdingAPI return false; } + /// + /// Checks if the specified player exists. + /// + /// Whether the player exists. + /// The player's unique identifier. public static bool Exists(uint player) { return playerEngine.ExistsById(player); } + /// + /// Initializes a new instance of the class. + /// + /// The player's unique identifier. public Player(uint id) { this.Id = id; @@ -39,6 +56,10 @@ namespace GamecraftModdingAPI this.Type = playerEngine.GetLocalPlayer() == id ? PlayerType.Local : PlayerType.Remote; } + /// + /// Initializes a new instance of the class. + /// + /// The player type. Chooses the first available player matching the criteria. public Player(PlayerType player) { uint localId = playerEngine.GetLocalPlayer(); @@ -60,10 +81,23 @@ namespace GamecraftModdingAPI // object fields & properties + /// + /// The player's type. + /// The player type is always relative to the current client, not the game host. + /// + /// The enumerated player type. public PlayerType Type { get; } + /// + /// The player's unique identifier. + /// + /// The identifier. public uint Id { get; private set; } + /// + /// The player's current position. + /// + /// The position. public float3 Position { get @@ -77,6 +111,10 @@ namespace GamecraftModdingAPI } } + /// + /// The player's current rotation. + /// + /// The rotation. public quaternion Rotation { get @@ -90,6 +128,10 @@ namespace GamecraftModdingAPI } } + /// + /// The player's current velocity. + /// + /// The velocity. public float3 Velocity { get @@ -103,6 +145,10 @@ namespace GamecraftModdingAPI } } + /// + /// The player's current angular velocity. + /// + /// The angular velocity. public float3 AngularVelocity { get @@ -116,6 +162,10 @@ namespace GamecraftModdingAPI } } + /// + /// The player's mass. + /// + /// The mass. public float Mass { get @@ -123,14 +173,19 @@ namespace GamecraftModdingAPI return 1f / playerEngine.GetMass(Id).InverseMass; } - set + // FIXME: Setting mass doesn't do anything + /*set { playerEngine.SetInverseMass(Id, 1f / value); - } + }*/ } private float _ping = -1f; + /// + /// The player's latest network ping time. + /// + /// The ping (s). public float Ping { get @@ -146,6 +201,14 @@ namespace GamecraftModdingAPI // object methods + /// + /// Teleport the player to the specified coordinates. + /// + /// The x coordinate. + /// The y coordinate. + /// The z coordinate. + /// If set to true teleport relative to the player's current position. + /// If set to true exit any seat the player is in. public void Teleport(float x, float y, float z, bool relative = true, bool exitSeat = true) { float3 location = new float3(x, y, z); -- 2.30.2 From ff57a16565b1e91685c9182b6be0664c4a94ec54 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Wed, 13 May 2020 14:02:36 +0200 Subject: [PATCH 019/252] Create Block class with existing functionality Placement, movement, rotation, removal Block looked at (in Player class), connected blocks --- GamecraftModdingAPI/Block.cs | 115 ++++++++++++++++++ GamecraftModdingAPI/Blocks/BlockEngine.cs | 39 ++++++ GamecraftModdingAPI/Blocks/BlockUtility.cs | 31 ----- GamecraftModdingAPI/Blocks/Movement.cs | 61 ---------- GamecraftModdingAPI/Blocks/MovementEngine.cs | 20 ++- GamecraftModdingAPI/Blocks/Placement.cs | 55 --------- GamecraftModdingAPI/Blocks/PlacementEngine.cs | 6 +- GamecraftModdingAPI/Blocks/Removal.cs | 28 ----- GamecraftModdingAPI/Blocks/Rotation.cs | 59 --------- GamecraftModdingAPI/Blocks/RotationEngine.cs | 7 +- GamecraftModdingAPI/Main.cs | 8 +- GamecraftModdingAPI/Player.cs | 12 ++ GamecraftModdingAPI/Players/PlayerEngine.cs | 21 ++++ .../Tests/GamecraftModdingAPIPluginTest.cs | 24 ++-- 14 files changed, 218 insertions(+), 268 deletions(-) create mode 100644 GamecraftModdingAPI/Block.cs create mode 100644 GamecraftModdingAPI/Blocks/BlockEngine.cs delete mode 100644 GamecraftModdingAPI/Blocks/BlockUtility.cs delete mode 100644 GamecraftModdingAPI/Blocks/Movement.cs delete mode 100644 GamecraftModdingAPI/Blocks/Placement.cs delete mode 100644 GamecraftModdingAPI/Blocks/Removal.cs delete mode 100644 GamecraftModdingAPI/Blocks/Rotation.cs diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs new file mode 100644 index 0000000..d099aba --- /dev/null +++ b/GamecraftModdingAPI/Block.cs @@ -0,0 +1,115 @@ +using System; +using System.Collections.Generic; +using GamecraftModdingAPI.Blocks; +using GamecraftModdingAPI.Utility; +using RobocraftX.Common; +using Svelto.ECS; +using Unity.Mathematics; + +namespace GamecraftModdingAPI +{ + public class Block + { + private static readonly PlacementEngine PlacementEngine = new PlacementEngine(); + private static readonly MovementEngine MovementEngine = new MovementEngine(); + private static readonly RotationEngine RotationEngine = new RotationEngine(); + private static readonly RemovalEngine RemovalEngine = new RemovalEngine(); + private static readonly BlockEngine BlockEngine = new BlockEngine(); + + /// + /// Place a new block at the given position. If scaled, position means the center of the block. The default block size is 0.2 in terms of position. + /// Place blocks next to each other to connect them. + /// The placed block will be a complete block with a placement grid and collision which will be saved along with the game. + /// + /// The block's type + /// The block's color + /// The block color's darkness (0-9) - 0 is default color + /// The block's position in the grid - default block size is 0.2 + /// The block's rotation in degrees + /// The block's uniform scale - default scale is 1 (with 0.2 width) + /// The block's non-uniform scale - 0 means is used + /// The player who placed the block + /// The placed block or null if failed + public static Block PlaceNew(BlockIDs block, float3 position, + float3 rotation = default, BlockColors color = BlockColors.Default, byte darkness = 0, + int uscale = 1, float3 scale = default, Player player = null) + { + if (PlacementEngine.IsInGame && GameState.IsBuildMode()) + { + try + { + return new Block(PlacementEngine.PlaceBlock(block, color, darkness, + position, uscale, scale, player, rotation)); + } + catch (Exception e) + { + Logging.MetaDebugLog(e); + } + } + + return null; + } + + /// + /// Returns the most recently placed block. + /// + /// The block object + public static Block GetLastPlacedBlock() + { + return new Block(BlockIdentifiers.LatestBlockID); + } + + public Block(EGID id) + { + Id = id; + } + + public Block(uint id) + { + Id = new EGID(id, CommonExclusiveGroups.OWNED_BLOCKS_GROUP); + } + + public EGID Id { get; } + + /// + /// The block's current position. + /// + public float3 Position + { + get => MovementEngine.GetPosition(Id.entityID); + set => MovementEngine.MoveBlock(Id.entityID, value); + } + + /// + /// Returns an array of blocks that are connected to this one. + /// + public Block[] ConnectedCubes => BlockEngine.GetConnectedBlocks(Id.entityID); + + /// + /// The block's current rotation in degrees. + /// + public float3 Rotation + { + get => RotationEngine.GetRotation(Id.entityID); + set => RotationEngine.RotateBlock(Id.entityID, value); + } + + /// + /// Removes this block. + /// + /// True if the block exists and could be removed. + public bool Remove() + { + return RemovalEngine.RemoveBlock(Id); + } + + public static void Init() + { + GameEngineManager.AddGameEngine(PlacementEngine); + GameEngineManager.AddGameEngine(MovementEngine); + GameEngineManager.AddGameEngine(RotationEngine); + GameEngineManager.AddGameEngine(RemovalEngine); + GameEngineManager.AddGameEngine(BlockEngine); + } + } +} \ No newline at end of file diff --git a/GamecraftModdingAPI/Blocks/BlockEngine.cs b/GamecraftModdingAPI/Blocks/BlockEngine.cs new file mode 100644 index 0000000..ad2af1b --- /dev/null +++ b/GamecraftModdingAPI/Blocks/BlockEngine.cs @@ -0,0 +1,39 @@ +using System.Collections.Generic; +using GamecraftModdingAPI.Engines; +using RobocraftX.Blocks; +using RobocraftX.Common; +using Svelto.DataStructures; +using Svelto.ECS; +using Svelto.ECS.EntityStructs; +using Unity.Mathematics; + +namespace GamecraftModdingAPI.Blocks +{ + public class BlockEngine : IApiEngine + { + public string Name { get; } = "GamecraftModdingAPIBlockGameEngine"; + + public EntitiesDB entitiesDB { set; private get; } + + public bool isRemovable => false; + + public void Dispose() + { + } + + public void Ready() + { + } + + public Block[] GetConnectedBlocks(uint blockID) + { + Stack cubeStack = new Stack(); + FasterList cubesToProcess = new FasterList(); + ConnectedCubesUtility.TreeTraversal.GetConnectedCubes(entitiesDB, blockID, cubeStack, cubesToProcess, (in GridConnectionsEntityStruct g) => { return false; }); + var ret = new Block[cubesToProcess.count]; + for (int i = 0; i < cubesToProcess.count; i++) + ret[i] = new Block(cubesToProcess[i]); + return ret; + } + } +} \ No newline at end of file diff --git a/GamecraftModdingAPI/Blocks/BlockUtility.cs b/GamecraftModdingAPI/Blocks/BlockUtility.cs deleted file mode 100644 index 342ee73..0000000 --- a/GamecraftModdingAPI/Blocks/BlockUtility.cs +++ /dev/null @@ -1,31 +0,0 @@ -using RobocraftX.Blocks.Ghost; -using RobocraftX.Character.Camera; -using RobocraftX.Character.Factories; -using Svelto.ECS; - -namespace GamecraftModdingAPI.Blocks -{ - public class BlockUtility - { - /// - /// Returns the block the player is currently looking at. - /// - /// The player's ID - /// The entities DB - /// The maximum distance from the player (default is the player's building reach) - /// The block's EGID or null if not found - public static EGID? GetBlockLookedAt(uint playerId, EntitiesDB entitiesDB, float maxDistance = -1f) - { - if (!entitiesDB.TryQueryMappedEntities( - CameraExclusiveGroups.CameraGroup, out var mapper)) - return null; - mapper.TryGetEntity(playerId, out CharacterCameraRayCastEntityStruct rayCast); - float distance = maxDistance < 0 - ? GhostBlockUtils.GetBuildInteractionDistance(entitiesDB, rayCast) - : maxDistance; - if (rayCast.hit && rayCast.distance <= distance) - return rayCast.hitEgid; - return null; - } - } -} \ No newline at end of file diff --git a/GamecraftModdingAPI/Blocks/Movement.cs b/GamecraftModdingAPI/Blocks/Movement.cs deleted file mode 100644 index 28575a9..0000000 --- a/GamecraftModdingAPI/Blocks/Movement.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -using Unity.Mathematics; - -namespace GamecraftModdingAPI.Blocks -{ - /// - /// Common block movement operations. - /// The functionality of this class only works in build mode. - /// - public static class Movement - { - private static MovementEngine movementEngine = new MovementEngine(); - - /// - /// Move a single block by a specific (x,y,z) amount (offset). - /// The moved block will remain connected to the blocks it was touching before it was moved. - /// The block's placement grid and collision box are also moved. - /// - /// The block's id - /// The movement amount (x,y,z) - /// Whether the operation was successful - public static bool MoveBlock(uint id, float3 vector) - { - if (movementEngine.IsInGame && GamecraftModdingAPI.Utility.GameState.IsBuildMode()) - { - movementEngine.MoveBlock(id, vector); - return true; - } - return false; - } - - /// - /// Move all connected blocks by a specific (x,y,z) amount (offset). - /// The moved blocks will remain connected to the block they're touching. - /// All of the block's placement grids and collision boxes are also moved. - /// This is equivalent to calling MoveBlock() for every connected block. - /// - /// The starting block's id - /// The movement amount (x,y,z) - /// Whether the operation was successful - public static bool MoveConnectedBlocks(uint id, float3 vector) - { - if (movementEngine.IsInGame && GamecraftModdingAPI.Utility.GameState.IsBuildMode()) - { - movementEngine.MoveConnectedBlocks(id, vector); - return true; - } - return false; - } - - public static void Init() - { - GamecraftModdingAPI.Utility.GameEngineManager.AddGameEngine(movementEngine); - } - } -} diff --git a/GamecraftModdingAPI/Blocks/MovementEngine.cs b/GamecraftModdingAPI/Blocks/MovementEngine.cs index fbeea99..6615949 100644 --- a/GamecraftModdingAPI/Blocks/MovementEngine.cs +++ b/GamecraftModdingAPI/Blocks/MovementEngine.cs @@ -57,30 +57,24 @@ namespace GamecraftModdingAPI.Blocks ref LocalTransformEntityStruct transStruct = ref this.entitiesDB.QueryEntity(blockID, CommonExclusiveGroups.OWNED_BLOCKS_GROUP); ref UECSPhysicsEntityStruct phyStruct = ref this.entitiesDB.QueryEntity(blockID, CommonExclusiveGroups.OWNED_BLOCKS_GROUP); // main (persistent) position - posStruct.position += vector; + posStruct.position = vector; // placement grid position - gridStruct.position += vector; + gridStruct.position = vector; // rendered position - transStruct.position += vector; + transStruct.position = vector; // collision position FullGameFields._physicsWorld.EntityManager.SetComponentData(phyStruct.uecsEntity, new Translation { Value = posStruct.position }); + entitiesDB.QueryEntity(blockID, CommonExclusiveGroups.OWNED_BLOCKS_GROUP).isProcessed = false; return posStruct.position; } - public float3 MoveConnectedBlocks(uint blockID, float3 vector) + public float3 GetPosition(uint blockID) { - Stack cubeStack = new Stack(); - FasterList cubesToMove = new FasterList(); - ConnectedCubesUtility.TreeTraversal.GetConnectedCubes(entitiesDB, blockID, cubeStack, cubesToMove, (in GridConnectionsEntityStruct g) => { return false; }); - for (int i = 0; i < cubesToMove.count; i++) - { - MoveBlock(cubesToMove[i], vector); - entitiesDB.QueryEntity(cubesToMove[i], CommonExclusiveGroups.OWNED_BLOCKS_GROUP).isProcessed = false; - } - return this.entitiesDB.QueryEntity(blockID, CommonExclusiveGroups.OWNED_BLOCKS_GROUP).position; + ref PositionEntityStruct posStruct = ref this.entitiesDB.QueryEntity(blockID, CommonExclusiveGroups.OWNED_BLOCKS_GROUP); + return posStruct.position; } } } diff --git a/GamecraftModdingAPI/Blocks/Placement.cs b/GamecraftModdingAPI/Blocks/Placement.cs deleted file mode 100644 index c029ebb..0000000 --- a/GamecraftModdingAPI/Blocks/Placement.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System; - -using Unity.Mathematics; -using Svelto.ECS; - -using GamecraftModdingAPI.Utility; - -namespace GamecraftModdingAPI.Blocks -{ - /// - /// Common block placement operations. - /// The functionality in this class is for build mode. - /// - public static class Placement - { - private static PlacementEngine placementEngine = new PlacementEngine(); - - /// - /// Place a new block at the given position. If scaled, position means the center of the block. The default block size is 0.2 in terms of position. - /// Place blocks next to each other to connect them. - /// The placed block will be a complete block with a placement grid and collision which will be saved along with the game. - /// - /// The block's type - /// The block's color - /// The block color's darkness (0-9) - 0 is default color - /// The block's position in the grid - default block size is 0.2 - /// The block's rotation in degrees - /// The block's uniform scale - default scale is 1 (with 0.2 width) - /// The block's non-uniform scale - 0 means is used - /// The player who placed the block - /// The placed block's ID or null if failed - public static EGID? PlaceBlock(BlockIDs block, float3 position, - float3 rotation = default, BlockColors color = BlockColors.Default, byte darkness = 0, - int uscale = 1, float3 scale = default, uint playerId = 0) - { - if (placementEngine.IsInGame && GameState.IsBuildMode()) - { - try - { - return placementEngine.PlaceBlock(block, color, darkness, position, uscale, scale, playerId, rotation); - } - catch (Exception e) - { - Logging.MetaDebugLog(e); - } - } - return null; - } - - public static void Init() - { - GameEngineManager.AddGameEngine(placementEngine); - } - } -} diff --git a/GamecraftModdingAPI/Blocks/PlacementEngine.cs b/GamecraftModdingAPI/Blocks/PlacementEngine.cs index 17f3314..d0a1192 100644 --- a/GamecraftModdingAPI/Blocks/PlacementEngine.cs +++ b/GamecraftModdingAPI/Blocks/PlacementEngine.cs @@ -22,6 +22,7 @@ using uREPL; using GamecraftModdingAPI.Utility; using GamecraftModdingAPI.Engines; +using GamecraftModdingAPI.Players; namespace GamecraftModdingAPI.Blocks { @@ -46,11 +47,12 @@ namespace GamecraftModdingAPI.Blocks private static BlockEntityFactory _blockEntityFactory; //Injected from PlaceBlockEngine public EGID PlaceBlock(BlockIDs block, BlockColors color, byte darkness, float3 position, int uscale, - float3 scale, uint playerId, float3 rotation) + float3 scale, Player player, float3 rotation) { //It appears that only the non-uniform scale has any visible effect, but if that's not given here it will be set to the uniform one if (darkness > 9) throw new Exception("That is too dark. Make sure to use 0-9 as darkness. (0 is default.)"); - return BuildBlock((ushort) block, (byte) (color + darkness * 10), position, uscale, scale, rotation, playerId); + return BuildBlock((ushort) block, (byte) (color + darkness * 10), position, uscale, scale, rotation, + (player ?? new Player(PlayerType.Local)).Id); } private EGID BuildBlock(ushort block, byte color, float3 position, int uscale, float3 scale, float3 rot, uint playerId) diff --git a/GamecraftModdingAPI/Blocks/Removal.cs b/GamecraftModdingAPI/Blocks/Removal.cs deleted file mode 100644 index 0bb54fb..0000000 --- a/GamecraftModdingAPI/Blocks/Removal.cs +++ /dev/null @@ -1,28 +0,0 @@ -using Svelto.ECS; - -using GamecraftModdingAPI.Utility; - -namespace GamecraftModdingAPI.Blocks -{ - public class Removal - { - private static RemovalEngine _removalEngine = new RemovalEngine(); - - /// - /// Removes the block with the given ID. Returns false if the block doesn't exist or the game isn't in build mode. - /// - /// The block to remove - /// Whether the block was successfully removed - public static bool RemoveBlock(EGID targetBlock) - { - if (GameState.IsBuildMode()) - return _removalEngine.RemoveBlock(targetBlock); - return false; - } - - public static void Init() - { - GameEngineManager.AddGameEngine(_removalEngine); - } - } -} \ No newline at end of file diff --git a/GamecraftModdingAPI/Blocks/Rotation.cs b/GamecraftModdingAPI/Blocks/Rotation.cs deleted file mode 100644 index b881cdb..0000000 --- a/GamecraftModdingAPI/Blocks/Rotation.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -using Unity.Mathematics; - -namespace GamecraftModdingAPI.Blocks -{ - /// - /// Common block rotation operations. - /// The functionality in this class is not completely implemented and will only work in build mode. - /// - public static class Rotation - { - private static RotationEngine rotationEngine = new RotationEngine(); - - /// - /// Rotate a single block by a specific amount in degrees. - /// This not destroy inter-block connections, so neighbouring blocks will remain attached despite appearances. - /// The cube placement grid and collision are also rotated. - /// - /// The block's id - /// The rotation amount around the x,y,z-axis - /// Whether the operation was successful - public static bool RotateBlock(uint id, float3 vector) - { - if (rotationEngine.IsInGame && GamecraftModdingAPI.Utility.GameState.IsBuildMode()) - { - rotationEngine.RotateBlock(id, vector); - return true; - } - return false; - } - - /// - /// Rotate all connected blocks by a specific amount in degrees. - /// This does not do anything because it has not been implemented. - /// - /// The starting block's id - /// The rotation around the x,y,z-axis - /// Whether the operation was successful - public static bool RotateConnectedBlocks(uint id, float3 vector) - { - if (rotationEngine.IsInGame && GamecraftModdingAPI.Utility.GameState.IsBuildMode()) - { - rotationEngine.RotateConnectedBlocks(id, vector); - return true; - } - return false; - } - - public static void Init() - { - GamecraftModdingAPI.Utility.GameEngineManager.AddGameEngine(rotationEngine); - } - } -} diff --git a/GamecraftModdingAPI/Blocks/RotationEngine.cs b/GamecraftModdingAPI/Blocks/RotationEngine.cs index d56994f..b295441 100644 --- a/GamecraftModdingAPI/Blocks/RotationEngine.cs +++ b/GamecraftModdingAPI/Blocks/RotationEngine.cs @@ -72,14 +72,15 @@ namespace GamecraftModdingAPI.Blocks { Value = rotStruct.rotation }); + entitiesDB.QueryEntity(blockID, CommonExclusiveGroups.OWNED_BLOCKS_GROUP).isProcessed = false; return ((Quaternion)rotStruct.rotation).eulerAngles; } - public float3 RotateConnectedBlocks(uint blockID, Vector3 vector) + public float3 GetRotation(uint blockID) { - // TODO: Implement and figure out the math - throw new NotImplementedException(); + ref RotationEntityStruct rotStruct = ref entitiesDB.QueryEntity(blockID, CommonExclusiveGroups.OWNED_BLOCKS_GROUP); + return ((Quaternion) rotStruct.rotation).eulerAngles; } } } diff --git a/GamecraftModdingAPI/Main.cs b/GamecraftModdingAPI/Main.cs index 4dced5e..ea5911f 100644 --- a/GamecraftModdingAPI/Main.cs +++ b/GamecraftModdingAPI/Main.cs @@ -9,7 +9,9 @@ using HarmonyLib; using GamecraftModdingAPI.Utility; using GamecraftModdingAPI.Events; +using GamecraftModdingAPI.Players; using GamecraftModdingAPI.Tasks; +using uREPL; namespace GamecraftModdingAPI { @@ -61,18 +63,16 @@ namespace GamecraftModdingAPI EventManager.AddEventEmitter(GameHostTransitionDeterministicGroupEnginePatch.simEngine); // init block implementors Logging.MetaDebugLog($"Initializing Blocks"); - Blocks.Movement.Init(); - Blocks.Rotation.Init(); Blocks.Signals.Init(); - Blocks.Placement.Init(); Blocks.Tweakable.Init(); - Blocks.Removal.Init(); // init inventory Inventory.Hotbar.Init(); // init input Input.FakeInput.Init(); // init object-oriented classes Player.Init(); + Block.Init(); + RuntimeCommands.Register("getblock", () => new Player(PlayerType.Local).GetBlockLookedAt()); Logging.MetaLog($"{currentAssembly.GetName().Name} v{currentAssembly.GetName().Version} initialized"); } diff --git a/GamecraftModdingAPI/Player.cs b/GamecraftModdingAPI/Player.cs index 996ea01..3f11cfb 100644 --- a/GamecraftModdingAPI/Player.cs +++ b/GamecraftModdingAPI/Player.cs @@ -218,6 +218,18 @@ namespace GamecraftModdingAPI } playerEngine.SetLocation(Id, location, exitSeat: exitSeat); } + + /// + /// Returns the block the player is currently looking at. + /// + /// The player's ID + /// The entities DB + /// The maximum distance from the player (default is the player's building reach) + /// The block's EGID or null if not found + public Block GetBlockLookedAt(float maxDistance = -1f) + { + return playerEngine.GetBlockLookedAt(Id, maxDistance); + } // internal methods diff --git a/GamecraftModdingAPI/Players/PlayerEngine.cs b/GamecraftModdingAPI/Players/PlayerEngine.cs index beef48a..d1df72e 100644 --- a/GamecraftModdingAPI/Players/PlayerEngine.cs +++ b/GamecraftModdingAPI/Players/PlayerEngine.cs @@ -11,6 +11,9 @@ using Unity.Mathematics; using Unity.Physics; using GamecraftModdingAPI.Engines; +using RobocraftX.Blocks.Ghost; +using RobocraftX.Character.Camera; +using RobocraftX.Character.Factories; namespace GamecraftModdingAPI.Players { @@ -234,5 +237,23 @@ namespace GamecraftModdingAPI.Players s = default; return false; } + + public Block GetBlockLookedAt(uint playerId, float maxDistance = -1f) + { + if (!entitiesDB.TryQueryMappedEntities( + CameraExclusiveGroups.CameraGroup, out var mapper)) + return null; + mapper.TryGetEntity(playerId, out CharacterCameraRayCastEntityStruct rayCast); + float distance = maxDistance < 0 + ? GhostBlockUtils.GetBuildInteractionDistance(entitiesDB, rayCast) + : maxDistance; + if (rayCast.hit && rayCast.distance <= distance) + { + Console.WriteLine("Hit block: " + rayCast.hitEgid); + return new Block(rayCast.hitEgid); + } + + return null; + } } } diff --git a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs index 80cc916..5ea4965 100644 --- a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs +++ b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs @@ -1,4 +1,5 @@ using System; +using System.Linq; using System.Reflection; using HarmonyLib; @@ -94,22 +95,21 @@ namespace GamecraftModdingAPI.Tests .Build(); CommandBuilder.Builder() - .Name("MoveLastBlock") - .Description("Move the most-recently-placed block, and any connected blocks by the given offset") - .Action((float x, float y, float z) => { - bool success = GamecraftModdingAPI.Blocks.Movement.MoveConnectedBlocks( - GamecraftModdingAPI.Blocks.BlockIdentifiers.LatestBlockID, - new Unity.Mathematics.float3(x, y, z)); - if (!success) - { - GamecraftModdingAPI.Utility.Logging.CommandLogError("Blocks can only be moved in Build mode!"); - } - }).Build(); + .Name("MoveLastBlock") + .Description("Move the most-recently-placed block, and any connected blocks by the given offset") + .Action((float x, float y, float z) => + { + if (GameState.IsBuildMode()) + foreach (var block in Block.GetLastPlacedBlock().ConnectedCubes) + block.Position += new Unity.Mathematics.float3(x, y, z); + else + GamecraftModdingAPI.Utility.Logging.CommandLogError("Blocks can only be moved in Build mode!"); + }).Build(); CommandBuilder.Builder() .Name("PlaceAluminium") .Description("Place a block of aluminium at the given coordinates") - .Action((float x, float y, float z) => { Blocks.Placement.PlaceBlock(Blocks.BlockIDs.AluminiumCube, new Unity.Mathematics.float3(x, y, z)); }) + .Action((float x, float y, float z) => { Block.PlaceNew(Blocks.BlockIDs.AluminiumCube, new Unity.Mathematics.float3(x, y, z)); }) .Build(); System.Random random = new System.Random(); // for command below -- 2.30.2 From 6f8241554df4f02a6a5cd3eb735f5bd89e684fef Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Wed, 13 May 2020 16:52:21 +0200 Subject: [PATCH 020/252] Add block type and color properties --- GamecraftModdingAPI/Block.cs | 62 +++++++++++++++---- GamecraftModdingAPI/Blocks/BlockEngine.cs | 11 +++- .../Blocks/BlockIdentifiers.cs | 9 +-- GamecraftModdingAPI/Blocks/MovementEngine.cs | 17 +---- GamecraftModdingAPI/Blocks/PlacementEngine.cs | 7 --- GamecraftModdingAPI/Blocks/RemovalEngine.cs | 6 -- GamecraftModdingAPI/Blocks/RotationEngine.cs | 16 +---- GamecraftModdingAPI/Blocks/SignalEngine.cs | 23 +------ GamecraftModdingAPI/Blocks/Signals.cs | 8 +-- GamecraftModdingAPI/Blocks/Tweakable.cs | 6 +- GamecraftModdingAPI/Blocks/TweakableEngine.cs | 6 +- GamecraftModdingAPI/Blocks/TweakableStat.cs | 3 +- GamecraftModdingAPI/Main.cs | 1 - GamecraftModdingAPI/Player.cs | 1 - GamecraftModdingAPI/Players/PlayerEngine.cs | 3 - .../Tests/GamecraftModdingAPIPluginTest.cs | 9 ++- 16 files changed, 75 insertions(+), 113 deletions(-) diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index d099aba..336215e 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -1,10 +1,11 @@ using System; -using System.Collections.Generic; + +using Svelto.ECS; +using RobocraftX.Common; +using Unity.Mathematics; + using GamecraftModdingAPI.Blocks; using GamecraftModdingAPI.Utility; -using RobocraftX.Common; -using Svelto.ECS; -using Unity.Mathematics; namespace GamecraftModdingAPI { @@ -80,11 +81,6 @@ namespace GamecraftModdingAPI set => MovementEngine.MoveBlock(Id.entityID, value); } - /// - /// Returns an array of blocks that are connected to this one. - /// - public Block[] ConnectedCubes => BlockEngine.GetConnectedBlocks(Id.entityID); - /// /// The block's current rotation in degrees. /// @@ -94,13 +90,57 @@ namespace GamecraftModdingAPI set => RotationEngine.RotateBlock(Id.entityID, value); } + /// + /// The block's type (ID). Changing from or to a functional part may crash the game. + /// + public BlockIDs Type + { + get => (BlockIDs) BlockEngine.GetBlockInfo(Id).DBID; + set + { + BlockEngine.GetBlockInfo(Id).DBID = (uint) value; + uint prefabId = PrefabsID.GetPrefabId((uint) value, 0); + BlockEngine.GetBlockInfo(Id).prefabID = prefabId; + BlockEngine.GetBlockInfo(Id) = new PhysicsPrefabEntityStruct(prefabId); + } + } + + public BlockColors Color + { + get => (BlockColors) (BlockEngine.GetBlockInfo(Id).indexInPalette % 10); + set + { + ref var color = ref BlockEngine.GetBlockInfo(Id); + color.indexInPalette = (byte) (color.indexInPalette / 10 * 10 + value); + color.needsUpdate = true; + } + } + + public byte ColorDarkness + { + get => (byte) (BlockEngine.GetBlockInfo(Id).indexInPalette / 10); + set + { + ref var color = ref BlockEngine.GetBlockInfo(Id); + color.indexInPalette = (byte) (10 * (byte) value + color.indexInPalette % 10); + color.needsUpdate = true; + } + } + + /// + /// Returns an array of blocks that are connected to this one. + /// + public Block[] GetConnectedCubes() => BlockEngine.GetConnectedBlocks(Id.entityID); + /// /// Removes this block. /// /// True if the block exists and could be removed. - public bool Remove() + public bool Remove() => RemovalEngine.RemoveBlock(Id); + + public override string ToString() { - return RemovalEngine.RemoveBlock(Id); + return $"{nameof(Id)}: {Id}, {nameof(Position)}: {Position}, {nameof(Rotation)}: {Rotation}"; } public static void Init() diff --git a/GamecraftModdingAPI/Blocks/BlockEngine.cs b/GamecraftModdingAPI/Blocks/BlockEngine.cs index ad2af1b..a851643 100644 --- a/GamecraftModdingAPI/Blocks/BlockEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlockEngine.cs @@ -1,11 +1,11 @@ using System.Collections.Generic; -using GamecraftModdingAPI.Engines; + using RobocraftX.Blocks; using RobocraftX.Common; using Svelto.DataStructures; using Svelto.ECS; -using Svelto.ECS.EntityStructs; -using Unity.Mathematics; + +using GamecraftModdingAPI.Engines; namespace GamecraftModdingAPI.Blocks { @@ -35,5 +35,10 @@ namespace GamecraftModdingAPI.Blocks ret[i] = new Block(cubesToProcess[i]); return ret; } + + public ref T GetBlockInfo(EGID blockID) where T : struct, IEntityComponent + { + return ref entitiesDB.QueryEntity(blockID); + } } } \ No newline at end of file diff --git a/GamecraftModdingAPI/Blocks/BlockIdentifiers.cs b/GamecraftModdingAPI/Blocks/BlockIdentifiers.cs index 60819fe..eb479c0 100644 --- a/GamecraftModdingAPI/Blocks/BlockIdentifiers.cs +++ b/GamecraftModdingAPI/Blocks/BlockIdentifiers.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Reflection; - -using Svelto.ECS; +using Svelto.ECS; using RobocraftX.Common; using HarmonyLib; diff --git a/GamecraftModdingAPI/Blocks/MovementEngine.cs b/GamecraftModdingAPI/Blocks/MovementEngine.cs index 6615949..a887763 100644 --- a/GamecraftModdingAPI/Blocks/MovementEngine.cs +++ b/GamecraftModdingAPI/Blocks/MovementEngine.cs @@ -1,24 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -using RobocraftX; -using RobocraftX.Blocks; -using RobocraftX.Blocks.Ghost; -using RobocraftX.Common; -using RobocraftX.Multiplayer; -using RobocraftX.SimulationModeState; +using RobocraftX.Common; using RobocraftX.UECS; -using Unity.Entities; -using Svelto.Context; using Svelto.ECS; using Svelto.ECS.EntityStructs; using Unity.Transforms; using Unity.Mathematics; -using UnityEngine; -using Svelto.DataStructures; using GamecraftModdingAPI.Utility; using GamecraftModdingAPI.Engines; diff --git a/GamecraftModdingAPI/Blocks/PlacementEngine.cs b/GamecraftModdingAPI/Blocks/PlacementEngine.cs index d0a1192..28642e8 100644 --- a/GamecraftModdingAPI/Blocks/PlacementEngine.cs +++ b/GamecraftModdingAPI/Blocks/PlacementEngine.cs @@ -4,21 +4,14 @@ using System.Reflection; using DataLoader; using HarmonyLib; using RobocraftX.Blocks; -using RobocraftX.Blocks.Ghost; using RobocraftX.Blocks.Scaling; using RobocraftX.Character; -using RobocraftX.CommandLine.Custom; using RobocraftX.Common; -using RobocraftX.Common.Input; -using RobocraftX.Common.Utilities; using RobocraftX.CR.MachineEditing; -using RobocraftX.StateSync; using Svelto.ECS; using Svelto.ECS.EntityStructs; -using Unity.Jobs; using Unity.Mathematics; using UnityEngine; -using uREPL; using GamecraftModdingAPI.Utility; using GamecraftModdingAPI.Engines; diff --git a/GamecraftModdingAPI/Blocks/RemovalEngine.cs b/GamecraftModdingAPI/Blocks/RemovalEngine.cs index 823cc86..05ad7c9 100644 --- a/GamecraftModdingAPI/Blocks/RemovalEngine.cs +++ b/GamecraftModdingAPI/Blocks/RemovalEngine.cs @@ -2,15 +2,9 @@ using System.Reflection; using HarmonyLib; using RobocraftX.Blocks; -using RobocraftX.Blocks.Ghost; -using RobocraftX.Character.Camera; -using RobocraftX.Character.Factories; using RobocraftX.Common; -using RobocraftX.Players; using Svelto.ECS; -using uREPL; -using GamecraftModdingAPI.Commands; using GamecraftModdingAPI.Utility; using GamecraftModdingAPI.Engines; diff --git a/GamecraftModdingAPI/Blocks/RotationEngine.cs b/GamecraftModdingAPI/Blocks/RotationEngine.cs index b295441..88c43d2 100644 --- a/GamecraftModdingAPI/Blocks/RotationEngine.cs +++ b/GamecraftModdingAPI/Blocks/RotationEngine.cs @@ -1,21 +1,7 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -using RobocraftX; -using RobocraftX.Blocks; -using RobocraftX.Blocks.Ghost; -using RobocraftX.Common; -using RobocraftX.Multiplayer; -using RobocraftX.SimulationModeState; +using RobocraftX.Common; using RobocraftX.UECS; -using Unity.Entities; -using Svelto.Context; using Svelto.ECS; using Svelto.ECS.EntityStructs; -using Unity.Transforms; using Unity.Mathematics; using UnityEngine; diff --git a/GamecraftModdingAPI/Blocks/SignalEngine.cs b/GamecraftModdingAPI/Blocks/SignalEngine.cs index 6bac3cb..90343e2 100644 --- a/GamecraftModdingAPI/Blocks/SignalEngine.cs +++ b/GamecraftModdingAPI/Blocks/SignalEngine.cs @@ -1,27 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -using RobocraftX; -using RobocraftX.Blocks; -using RobocraftX.Blocks.Ghost; -using RobocraftX.Common; -using RobocraftX.Multiplayer; -using RobocraftX.SimulationModeState; -using RobocraftX.UECS; -using Unity.Entities; -using Svelto.Context; -using Svelto.DataStructures; -using Svelto.ECS; -using Svelto.ECS.EntityStructs; -using Unity.Transforms; -using Unity.Mathematics; -using UnityEngine; +using Svelto.ECS; using Gamecraft.Wires; -using GamecraftModdingAPI.Utility; using GamecraftModdingAPI.Engines; namespace GamecraftModdingAPI.Blocks diff --git a/GamecraftModdingAPI/Blocks/Signals.cs b/GamecraftModdingAPI/Blocks/Signals.cs index c844d3a..6adf670 100644 --- a/GamecraftModdingAPI/Blocks/Signals.cs +++ b/GamecraftModdingAPI/Blocks/Signals.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -using Svelto.ECS; +using Svelto.ECS; using GamecraftModdingAPI.Utility; diff --git a/GamecraftModdingAPI/Blocks/Tweakable.cs b/GamecraftModdingAPI/Blocks/Tweakable.cs index 920bbb6..6405ac3 100644 --- a/GamecraftModdingAPI/Blocks/Tweakable.cs +++ b/GamecraftModdingAPI/Blocks/Tweakable.cs @@ -1,8 +1,4 @@ -using System; - -using Svelto.ECS; - -namespace GamecraftModdingAPI.Blocks +namespace GamecraftModdingAPI.Blocks { /// /// Common tweakable stats operations. diff --git a/GamecraftModdingAPI/Blocks/TweakableEngine.cs b/GamecraftModdingAPI/Blocks/TweakableEngine.cs index 63b02f7..36ace8a 100644 --- a/GamecraftModdingAPI/Blocks/TweakableEngine.cs +++ b/GamecraftModdingAPI/Blocks/TweakableEngine.cs @@ -1,11 +1,7 @@ -using System; -using System.Reflection; - -using RobocraftX.Blocks; +using RobocraftX.Blocks; using Gamecraft.Wires; using Svelto.ECS; -using GamecraftModdingAPI.Utility; using GamecraftModdingAPI.Engines; diff --git a/GamecraftModdingAPI/Blocks/TweakableStat.cs b/GamecraftModdingAPI/Blocks/TweakableStat.cs index 18f5bad..228c89d 100644 --- a/GamecraftModdingAPI/Blocks/TweakableStat.cs +++ b/GamecraftModdingAPI/Blocks/TweakableStat.cs @@ -1,5 +1,4 @@ -using System; -namespace GamecraftModdingAPI.Blocks +namespace GamecraftModdingAPI.Blocks { public enum TweakableStat { diff --git a/GamecraftModdingAPI/Main.cs b/GamecraftModdingAPI/Main.cs index ea5911f..e8ab256 100644 --- a/GamecraftModdingAPI/Main.cs +++ b/GamecraftModdingAPI/Main.cs @@ -72,7 +72,6 @@ namespace GamecraftModdingAPI // init object-oriented classes Player.Init(); Block.Init(); - RuntimeCommands.Register("getblock", () => new Player(PlayerType.Local).GetBlockLookedAt()); Logging.MetaLog($"{currentAssembly.GetName().Name} v{currentAssembly.GetName().Version} initialized"); } diff --git a/GamecraftModdingAPI/Player.cs b/GamecraftModdingAPI/Player.cs index 3f11cfb..29546da 100644 --- a/GamecraftModdingAPI/Player.cs +++ b/GamecraftModdingAPI/Player.cs @@ -3,7 +3,6 @@ using Unity.Mathematics; using GamecraftModdingAPI.Players; -using GamecraftModdingAPI.Utility; namespace GamecraftModdingAPI { diff --git a/GamecraftModdingAPI/Players/PlayerEngine.cs b/GamecraftModdingAPI/Players/PlayerEngine.cs index d1df72e..f8e53f0 100644 --- a/GamecraftModdingAPI/Players/PlayerEngine.cs +++ b/GamecraftModdingAPI/Players/PlayerEngine.cs @@ -248,10 +248,7 @@ namespace GamecraftModdingAPI.Players ? GhostBlockUtils.GetBuildInteractionDistance(entitiesDB, rayCast) : maxDistance; if (rayCast.hit && rayCast.distance <= distance) - { - Console.WriteLine("Hit block: " + rayCast.hitEgid); return new Block(rayCast.hitEgid); - } return null; } diff --git a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs index 5ea4965..c241159 100644 --- a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs +++ b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs @@ -12,6 +12,7 @@ using RobocraftX.SimulationModeState; using GamecraftModdingAPI.Commands; using GamecraftModdingAPI.Events; using GamecraftModdingAPI.Utility; +using GamecraftModdingAPI.Blocks; namespace GamecraftModdingAPI.Tests { @@ -100,7 +101,7 @@ namespace GamecraftModdingAPI.Tests .Action((float x, float y, float z) => { if (GameState.IsBuildMode()) - foreach (var block in Block.GetLastPlacedBlock().ConnectedCubes) + foreach (var block in Block.GetLastPlacedBlock().GetConnectedCubes()) block.Position += new Unity.Mathematics.float3(x, y, z); else GamecraftModdingAPI.Utility.Logging.CommandLogError("Blocks can only be moved in Build mode!"); @@ -141,6 +142,12 @@ namespace GamecraftModdingAPI.Tests Tasks.Scheduler.Schedule(task); }).Build(); + CommandBuilder.Builder("getBlock") + .Action(() => uREPL.Log.Output(new Player(Players.PlayerType.Local).GetBlockLookedAt()+"")).Build(); + CommandBuilder.Builder("changeToAluminium") + .Action(() => new Player(Players.PlayerType.Local).GetBlockLookedAt().Type = BlockIDs.AluminiumCube) + .Build(); + /* CommandManager.AddCommand(new SimpleCustomCommandEngine((float d) => { UnityEngine.Camera.main.fieldOfView = d; }, "SetFOV", "Set the player camera's field of view")); -- 2.30.2 From 9cb6917d28d8ff48bd6ba57d5cea7a2aa411dae5 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Wed, 13 May 2020 16:52:06 -0400 Subject: [PATCH 021/252] Create custom error types and error catching --- .../Commands/CommandBuilder.cs | 24 +++---- .../Commands/CommandExceptions.cs | 71 +++++++++++++++++++ .../Commands/CommandManager.cs | 2 +- .../Commands/ICustomCommandEngine.cs | 4 +- .../Commands/SimpleCustomCommandEngine.cs | 18 ++++- .../Commands/SimpleCustomCommandEngine1.cs | 18 ++++- .../Commands/SimpleCustomCommandEngine2.cs | 18 ++++- .../Commands/SimpleCustomCommandEngine3.cs | 18 ++++- GamecraftModdingAPI/Events/EventExceptions.cs | 55 ++++++++++++++ GamecraftModdingAPI/Events/EventManager.cs | 8 +++ .../Events/SimpleEventHandlerEngine.cs | 38 +++++++++- .../GamecraftModdingAPIException.cs | 24 +++++++ GamecraftModdingAPI/Player.cs | 4 +- .../Players/PlayerExceptions.cs | 29 ++++++++ .../Tests/GamecraftModdingAPIPluginTest.cs | 10 ++- 15 files changed, 317 insertions(+), 24 deletions(-) create mode 100644 GamecraftModdingAPI/Commands/CommandExceptions.cs create mode 100644 GamecraftModdingAPI/Events/EventExceptions.cs create mode 100644 GamecraftModdingAPI/GamecraftModdingAPIException.cs create mode 100644 GamecraftModdingAPI/Players/PlayerExceptions.cs diff --git a/GamecraftModdingAPI/Commands/CommandBuilder.cs b/GamecraftModdingAPI/Commands/CommandBuilder.cs index d5f1b51..7bd5ed9 100644 --- a/GamecraftModdingAPI/Commands/CommandBuilder.cs +++ b/GamecraftModdingAPI/Commands/CommandBuilder.cs @@ -148,11 +148,11 @@ namespace GamecraftModdingAPI.Commands { if (string.IsNullOrWhiteSpace(name)) { - throw new InvalidOperationException("Command name must be defined before FromExisting() is called"); + throw new CommandParameterMissingException("Command name must be defined before FromExisting() is called"); } if (!ExistingCommands.Exists(name)) { - throw new InvalidOperationException("Command cannot be built from existing because it does not exist."); + throw new CommandNotFoundException("Command cannot be built from existing because it does not exist."); } fromExisting = true; return new SimpleCustomCommandEngine( @@ -170,11 +170,11 @@ namespace GamecraftModdingAPI.Commands { if (string.IsNullOrWhiteSpace(name)) { - throw new InvalidOperationException("Command name must be defined before FromExisting() is called"); + throw new CommandParameterMissingException("Command name must be defined before FromExisting() is called"); } if (!ExistingCommands.Exists(name)) { - throw new InvalidOperationException("Command cannot be built from existing because it does not exist."); + throw new CommandNotFoundException("Command cannot be built from existing because it does not exist."); } fromExisting = true; return new SimpleCustomCommandEngine( @@ -193,11 +193,11 @@ namespace GamecraftModdingAPI.Commands { if (string.IsNullOrWhiteSpace(name)) { - throw new InvalidOperationException("Command name must be defined before FromExisting() is called"); + throw new CommandParameterMissingException("Command name must be defined before FromExisting() is called"); } if (!ExistingCommands.Exists(name)) { - throw new InvalidOperationException("Command cannot be built from existing because it does not exist."); + throw new CommandNotFoundException("Command cannot be built from existing because it does not exist."); } fromExisting = true; return new SimpleCustomCommandEngine( @@ -217,11 +217,11 @@ namespace GamecraftModdingAPI.Commands { if (string.IsNullOrWhiteSpace(name)) { - throw new InvalidOperationException("Command name must be defined before FromExisting() is called"); + throw new CommandParameterMissingException("Command name must be defined before FromExisting() is called"); } if (!ExistingCommands.Exists(name)) { - throw new InvalidOperationException("Command cannot be built from existing because it does not exist."); + throw new CommandNotFoundException("Command cannot be built from existing because it does not exist."); } fromExisting = true; return new SimpleCustomCommandEngine( @@ -239,19 +239,19 @@ namespace GamecraftModdingAPI.Commands { if (string.IsNullOrWhiteSpace(name)) { - throw new InvalidOperationException("Command name must be defined before Build() is called"); + throw new CommandParameterMissingException("Command name must be defined before Build() is called"); } if (fromExisting) { - throw new InvalidOperationException("Command was already built by FromExisting()"); + throw new CommandAlreadyBuiltException("Command was already built by FromExisting()"); } if (commandEngine == null) { - throw new InvalidOperationException("Command action must be defined before Build() is called"); + throw new CommandParameterMissingException("Command action must be defined before Build() is called"); } if (string.IsNullOrWhiteSpace(description)) { - Logging.LogWarning($"Command {name} was built without a description"); + Logging.LogWarning($"Command {FullName()} was built without a description"); } if (register) { diff --git a/GamecraftModdingAPI/Commands/CommandExceptions.cs b/GamecraftModdingAPI/Commands/CommandExceptions.cs new file mode 100644 index 0000000..39502a7 --- /dev/null +++ b/GamecraftModdingAPI/Commands/CommandExceptions.cs @@ -0,0 +1,71 @@ +using System; +namespace GamecraftModdingAPI.Commands +{ + public class CommandException : GamecraftModdingAPIException + { + public CommandException() : base() {} + + public CommandException(string msg) : base(msg) {} + + public CommandException(string msg, Exception innerException) : base(msg, innerException) {} + } + + public class CommandNotFoundException : CommandException + { + public CommandNotFoundException() + { + } + + public CommandNotFoundException(string msg) : base(msg) + { + } + } + + public class CommandAlreadyExistsException : CommandException + { + public CommandAlreadyExistsException() + { + } + + public CommandAlreadyExistsException(string msg) : base(msg) + { + } + } + + public class CommandRuntimeException : CommandException + { + public CommandRuntimeException() + { + } + + public CommandRuntimeException(string msg) : base(msg) + { + } + + public CommandRuntimeException(string msg, Exception innerException) : base(msg, innerException) + { + } + } + + public class CommandAlreadyBuiltException : CommandException + { + public CommandAlreadyBuiltException() + { + } + + public CommandAlreadyBuiltException(string msg) : base(msg) + { + } + } + + public class CommandParameterMissingException : CommandException + { + public CommandParameterMissingException() + { + } + + public CommandParameterMissingException(string msg) : base(msg) + { + } + } +} diff --git a/GamecraftModdingAPI/Commands/CommandManager.cs b/GamecraftModdingAPI/Commands/CommandManager.cs index 986405e..876d634 100644 --- a/GamecraftModdingAPI/Commands/CommandManager.cs +++ b/GamecraftModdingAPI/Commands/CommandManager.cs @@ -24,7 +24,7 @@ namespace GamecraftModdingAPI.Commands { if (ExistsCommand(engine)) { - Logging.LogWarning($"Command {engine.Name} already exists!"); + throw new CommandAlreadyExistsException($"Command {engine.Name} already exists"); } _customCommands[engine.Name] = engine; if (_lastEngineRoot != null) diff --git a/GamecraftModdingAPI/Commands/ICustomCommandEngine.cs b/GamecraftModdingAPI/Commands/ICustomCommandEngine.cs index aafd257..1704e84 100644 --- a/GamecraftModdingAPI/Commands/ICustomCommandEngine.cs +++ b/GamecraftModdingAPI/Commands/ICustomCommandEngine.cs @@ -12,7 +12,9 @@ using GamecraftModdingAPI.Engines; namespace GamecraftModdingAPI.Commands { /// - /// Engine interface to handle command operations + /// Engine interface to handle command operations. + /// If you are using implementing this yourself, you must manually register the command. + /// See SimpleCustomCommandEngine's Ready() and Dispose() methods for an example of command registration. /// public interface ICustomCommandEngine : IApiEngine { diff --git a/GamecraftModdingAPI/Commands/SimpleCustomCommandEngine.cs b/GamecraftModdingAPI/Commands/SimpleCustomCommandEngine.cs index ebf0758..2ce60a9 100644 --- a/GamecraftModdingAPI/Commands/SimpleCustomCommandEngine.cs +++ b/GamecraftModdingAPI/Commands/SimpleCustomCommandEngine.cs @@ -6,6 +6,8 @@ using System.Threading.Tasks; using Svelto.ECS; +using GamecraftModdingAPI.Utility; + namespace GamecraftModdingAPI.Commands { /// @@ -42,7 +44,7 @@ namespace GamecraftModdingAPI.Commands public void Ready() { GamecraftModdingAPI.Utility.Logging.MetaDebugLog($"Registering SimpleCustomCommandEngine {this.Name}"); - CommandRegistrationHelper.Register(this.Name, this.runCommand, this.Description); + CommandRegistrationHelper.Register(this.Name, this.InvokeCatchError, this.Description); } /// @@ -62,5 +64,19 @@ namespace GamecraftModdingAPI.Commands { runCommand(); } + + private void InvokeCatchError() + { + try + { + runCommand(); + } + catch (Exception e) + { + CommandRuntimeException wrappedException = new CommandRuntimeException($"Command {Name} threw an exception when executed", e); + Logging.LogWarning(wrappedException.ToString()); + Logging.CommandLogError(wrappedException.ToString()); + } + } } } diff --git a/GamecraftModdingAPI/Commands/SimpleCustomCommandEngine1.cs b/GamecraftModdingAPI/Commands/SimpleCustomCommandEngine1.cs index a8dd96b..bac16ef 100644 --- a/GamecraftModdingAPI/Commands/SimpleCustomCommandEngine1.cs +++ b/GamecraftModdingAPI/Commands/SimpleCustomCommandEngine1.cs @@ -6,6 +6,8 @@ using System.Threading.Tasks; using Svelto.ECS; +using GamecraftModdingAPI.Utility; + namespace GamecraftModdingAPI.Commands { /// @@ -33,7 +35,7 @@ namespace GamecraftModdingAPI.Commands public void Ready() { GamecraftModdingAPI.Utility.Logging.MetaDebugLog($"Registering SimpleCustomCommandEngine {this.Name}"); - CommandRegistrationHelper.Register(this.Name, this.runCommand, this.Description); + CommandRegistrationHelper.Register(this.Name, this.InvokeCatchError, this.Description); } /// @@ -52,6 +54,20 @@ namespace GamecraftModdingAPI.Commands public void Invoke(A a) { runCommand(a); + } + + private void InvokeCatchError(A a) + { + try + { + runCommand(a); + } + catch (Exception e) + { + CommandRuntimeException wrappedException = new CommandRuntimeException($"Command {Name} threw an exception when executed", e); + Logging.LogWarning(wrappedException.ToString()); + Logging.CommandLogError(wrappedException.ToString()); + } } } } diff --git a/GamecraftModdingAPI/Commands/SimpleCustomCommandEngine2.cs b/GamecraftModdingAPI/Commands/SimpleCustomCommandEngine2.cs index 8333cd2..4b2b38d 100644 --- a/GamecraftModdingAPI/Commands/SimpleCustomCommandEngine2.cs +++ b/GamecraftModdingAPI/Commands/SimpleCustomCommandEngine2.cs @@ -6,6 +6,8 @@ using System.Threading.Tasks; using Svelto.ECS; +using GamecraftModdingAPI.Utility; + namespace GamecraftModdingAPI.Commands { /// @@ -33,7 +35,7 @@ namespace GamecraftModdingAPI.Commands public void Ready() { GamecraftModdingAPI.Utility.Logging.MetaDebugLog($"Registering SimpleCustomCommandEngine {this.Name}"); - CommandRegistrationHelper.Register(this.Name, this.runCommand, this.Description); + CommandRegistrationHelper.Register(this.Name, this.InvokeCatchError, this.Description); } /// @@ -52,6 +54,20 @@ namespace GamecraftModdingAPI.Commands public void Invoke(A a, B b) { runCommand(a, b); + } + + private void InvokeCatchError(A a, B b) + { + try + { + runCommand(a, b); + } + catch (Exception e) + { + CommandRuntimeException wrappedException = new CommandRuntimeException($"Command {Name} threw an exception when executed", e); + Logging.LogWarning(wrappedException.ToString()); + Logging.CommandLogError(wrappedException.ToString()); + } } } } diff --git a/GamecraftModdingAPI/Commands/SimpleCustomCommandEngine3.cs b/GamecraftModdingAPI/Commands/SimpleCustomCommandEngine3.cs index e5570c3..c9c942e 100644 --- a/GamecraftModdingAPI/Commands/SimpleCustomCommandEngine3.cs +++ b/GamecraftModdingAPI/Commands/SimpleCustomCommandEngine3.cs @@ -6,6 +6,8 @@ using System.Threading.Tasks; using Svelto.ECS; +using GamecraftModdingAPI.Utility; + namespace GamecraftModdingAPI.Commands { /// @@ -33,7 +35,7 @@ namespace GamecraftModdingAPI.Commands public void Ready() { GamecraftModdingAPI.Utility.Logging.MetaDebugLog($"Registering SimpleCustomCommandEngine {this.Name}"); - CommandRegistrationHelper.Register(this.Name, this.runCommand, this.Description); + CommandRegistrationHelper.Register(this.Name, this.InvokeCatchError, this.Description); } /// @@ -52,6 +54,20 @@ namespace GamecraftModdingAPI.Commands public void Invoke(A a, B b, C c) { runCommand(a, b, c); + } + + private void InvokeCatchError(A a, B b, C c) + { + try + { + runCommand(a, b, c); + } + catch (Exception e) + { + CommandRuntimeException wrappedException = new CommandRuntimeException($"Command {Name} threw an exception when executed", e); + Logging.LogWarning(wrappedException.ToString()); + Logging.CommandLogError(wrappedException.ToString()); + } } } } diff --git a/GamecraftModdingAPI/Events/EventExceptions.cs b/GamecraftModdingAPI/Events/EventExceptions.cs new file mode 100644 index 0000000..ee29480 --- /dev/null +++ b/GamecraftModdingAPI/Events/EventExceptions.cs @@ -0,0 +1,55 @@ +using System; +namespace GamecraftModdingAPI.Events +{ + public class EventException : GamecraftModdingAPIException + { + public EventException() + { + } + + public EventException(string message) : base(message) + { + } + + public EventException(string message, Exception innerException) : base(message, innerException) + { + } + } + + public class EventNotFoundException : EventException + { + public EventNotFoundException() + { + } + + public EventNotFoundException(string message) : base(message) + { + } + } + + public class EventAlreadyExistsException : EventException + { + public EventAlreadyExistsException() + { + } + + public EventAlreadyExistsException(string message) : base(message) + { + } + } + + public class EventRuntimeException : EventException + { + public EventRuntimeException() + { + } + + public EventRuntimeException(string message) : base(message) + { + } + + public EventRuntimeException(string message, Exception innerException) : base(message, innerException) + { + } + } +} diff --git a/GamecraftModdingAPI/Events/EventManager.cs b/GamecraftModdingAPI/Events/EventManager.cs index 227c7fd..efbf377 100644 --- a/GamecraftModdingAPI/Events/EventManager.cs +++ b/GamecraftModdingAPI/Events/EventManager.cs @@ -26,6 +26,10 @@ namespace GamecraftModdingAPI.Events public static void AddEventHandler(IEventHandlerEngine engine) { + if (ExistsEventHandler(engine)) + { + throw new EventAlreadyExistsException($"IEventHandlerEngine {engine.Name} already exists"); + } _eventHandlers[engine.Name] = engine; if (_lastEngineRoot != null) { @@ -63,6 +67,10 @@ namespace GamecraftModdingAPI.Events public static void AddEventEmitter(IEventEmitterEngine engine) { + if (ExistsEventEmitter(engine)) + { + throw new EventAlreadyExistsException($"IEventEmitterEngine {engine.Name} already exists"); + } _eventEmitters[engine.Name] = engine; if (_lastEngineRoot != null) { diff --git a/GamecraftModdingAPI/Events/SimpleEventHandlerEngine.cs b/GamecraftModdingAPI/Events/SimpleEventHandlerEngine.cs index b656273..133ad29 100644 --- a/GamecraftModdingAPI/Events/SimpleEventHandlerEngine.cs +++ b/GamecraftModdingAPI/Events/SimpleEventHandlerEngine.cs @@ -6,6 +6,8 @@ using System.Threading.Tasks; using Svelto.ECS; +using GamecraftModdingAPI.Utility; + namespace GamecraftModdingAPI.Events { /// @@ -31,7 +33,7 @@ namespace GamecraftModdingAPI.Events if (entityView.type.Equals(this.type)) { isActivated = true; - onActivated.Invoke(entitiesDB); + onActivatedInvokeCatchError(entitiesDB); } } @@ -43,6 +45,10 @@ namespace GamecraftModdingAPI.Events public void Activate(bool handle = false) { isActivated = true; + if (handle && entitiesDB != null) + { + onActivatedInvokeCatchError(entitiesDB); + } } public void Ready() { } @@ -52,7 +58,7 @@ namespace GamecraftModdingAPI.Events if (entityView.type.Equals(this.type) && isActivated) { isActivated = false; - onDestroyed.Invoke(entitiesDB); + onDestroyedInvokeCatchError(entitiesDB); } } @@ -61,7 +67,7 @@ namespace GamecraftModdingAPI.Events if (isActivated) { isActivated = false; - onDestroyed.Invoke(entitiesDB); + onDestroyedInvokeCatchError(entitiesDB); } } @@ -91,6 +97,32 @@ namespace GamecraftModdingAPI.Events this.onDestroyed = removed; } + private void onActivatedInvokeCatchError(EntitiesDB _entitiesDB) + { + try + { + onActivated.Invoke(_entitiesDB); + } + catch (Exception e) + { + EventRuntimeException wrappedException = new EventRuntimeException($"EventHandler {Name} threw an exception when activated", e); + Logging.LogWarning(wrappedException.ToString()); + } + } + + private void onDestroyedInvokeCatchError(EntitiesDB _entitiesDB) + { + try + { + onDestroyed.Invoke(_entitiesDB); + } + catch (Exception e) + { + EventRuntimeException wrappedException = new EventRuntimeException($"EventHandler {Name} threw an exception when destroyed", e); + Logging.LogWarning(wrappedException.ToString()); + } + } + public SimpleEventHandlerEngine(Action activated, Action removed, EventType type, string name, bool simple = true) : this((EntitiesDB _) => { activated.Invoke(); }, (EntitiesDB _) => { removed.Invoke(); }, (int)type, name) { } diff --git a/GamecraftModdingAPI/GamecraftModdingAPIException.cs b/GamecraftModdingAPI/GamecraftModdingAPIException.cs new file mode 100644 index 0000000..bc944aa --- /dev/null +++ b/GamecraftModdingAPI/GamecraftModdingAPIException.cs @@ -0,0 +1,24 @@ +using System; +using System.Runtime.Serialization; + +namespace GamecraftModdingAPI +{ + public class GamecraftModdingAPIException : Exception + { + public GamecraftModdingAPIException() + { + } + + public GamecraftModdingAPIException(string message) : base(message) + { + } + + public GamecraftModdingAPIException(string message, Exception innerException) : base(message, innerException) + { + } + + protected GamecraftModdingAPIException(SerializationInfo info, StreamingContext context) : base(info, context) + { + } + } +} diff --git a/GamecraftModdingAPI/Player.cs b/GamecraftModdingAPI/Player.cs index 29546da..965ba45 100644 --- a/GamecraftModdingAPI/Player.cs +++ b/GamecraftModdingAPI/Player.cs @@ -50,7 +50,7 @@ namespace GamecraftModdingAPI this.Id = id; if (!Exists(id)) { - throw new InvalidOperationException($"No player with id {id} exists"); + throw new PlayerNotFoundException($"No player with id {id} exists"); } this.Type = playerEngine.GetLocalPlayer() == id ? PlayerType.Local : PlayerType.Remote; } @@ -73,7 +73,7 @@ namespace GamecraftModdingAPI } if (this.Id == uint.MaxValue) { - throw new InvalidOperationException($"No player of {player} type exists"); + throw new PlayerNotFoundException($"No player of {player} type exists"); } this.Type = player; } diff --git a/GamecraftModdingAPI/Players/PlayerExceptions.cs b/GamecraftModdingAPI/Players/PlayerExceptions.cs new file mode 100644 index 0000000..94312b9 --- /dev/null +++ b/GamecraftModdingAPI/Players/PlayerExceptions.cs @@ -0,0 +1,29 @@ +using System; +namespace GamecraftModdingAPI.Players +{ + public class PlayerException : GamecraftModdingAPIException + { + public PlayerException() + { + } + + public PlayerException(string message) : base(message) + { + } + + public PlayerException(string message, Exception innerException) : base(message, innerException) + { + } + } + + public class PlayerNotFoundException : PlayerException + { + public PlayerNotFoundException() + { + } + + public PlayerNotFoundException(string message) : base(message) + { + } + } +} diff --git a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs index c241159..183b4f0 100644 --- a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs +++ b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs @@ -25,7 +25,8 @@ namespace GamecraftModdingAPI.Tests #if DEBUG : IllusionPlugin.IEnhancedPlugin #endif - { + { + private static Harmony harmony { get; set; } public string[] Filter { get; } = new string[] { "Gamecraft", "GamecraftPreview" }; @@ -80,6 +81,9 @@ namespace GamecraftModdingAPI.Tests EventManager.AddEventHandler(new SimpleEventHandlerEngine(() => { Logging.Log("Game Mode Build Switched To event!"); }, () => { }, EventType.BuildSwitchedTo, "buildswitch API debug")); + EventManager.AddEventHandler(new SimpleEventHandlerEngine(() => { throw new Exception(""); }, () => {}, + EventType.Menu, "menu activated API error thrower test")); + // debug/test commands if (Dependency.Hell("ExtraCommands")) { @@ -148,6 +152,10 @@ namespace GamecraftModdingAPI.Tests .Action(() => new Player(Players.PlayerType.Local).GetBlockLookedAt().Type = BlockIDs.AluminiumCube) .Build(); + CommandBuilder.Builder("Error", "Throw an error to make sure SimpleCustomCommandEngine's wrapper catches it.") + .Action(() => { throw new Exception("Error Command always throws an error"); }) + .Build(); + /* CommandManager.AddCommand(new SimpleCustomCommandEngine((float d) => { UnityEngine.Camera.main.fieldOfView = d; }, "SetFOV", "Set the player camera's field of view")); -- 2.30.2 From 205b3fc51a99e5048e25709ce5aaae0ba593bc8e Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Wed, 13 May 2020 16:56:47 -0400 Subject: [PATCH 022/252] Tweak exclusive group names --- GamecraftModdingAPI/Utility/ApiExclusiveGroups.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GamecraftModdingAPI/Utility/ApiExclusiveGroups.cs b/GamecraftModdingAPI/Utility/ApiExclusiveGroups.cs index 5538404..bc7e8ab 100644 --- a/GamecraftModdingAPI/Utility/ApiExclusiveGroups.cs +++ b/GamecraftModdingAPI/Utility/ApiExclusiveGroups.cs @@ -10,10 +10,10 @@ namespace GamecraftModdingAPI.Utility { public static class ApiExclusiveGroups { - public static readonly ExclusiveGroup eventsExclusiveGroup = new ExclusiveGroup(); + public static readonly ExclusiveGroup eventsExclusiveGroup = new ExclusiveGroup("GamecraftModdingAPI EventGroup"); public static uint eventID; - public static readonly ExclusiveGroup versionGroup = new ExclusiveGroup("GamecraftModdingAPIVersion"); + public static readonly ExclusiveGroup versionGroup = new ExclusiveGroup("GamecraftModdingAPI VersionGroup"); } } -- 2.30.2 From 06b8c3664e188ba1bde50e0361390e4356a8b037 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Wed, 13 May 2020 22:34:26 -0400 Subject: [PATCH 023/252] Add Event builders --- GamecraftModdingAPI/Events/EmitterBuilder.cs | 105 +++++++++++ GamecraftModdingAPI/Events/EventExceptions.cs | 11 ++ GamecraftModdingAPI/Events/HandlerBuilder.cs | 165 ++++++++++++++++++ .../Tests/GamecraftModdingAPIPluginTest.cs | 68 +++++--- 4 files changed, 328 insertions(+), 21 deletions(-) create mode 100644 GamecraftModdingAPI/Events/EmitterBuilder.cs create mode 100644 GamecraftModdingAPI/Events/HandlerBuilder.cs diff --git a/GamecraftModdingAPI/Events/EmitterBuilder.cs b/GamecraftModdingAPI/Events/EmitterBuilder.cs new file mode 100644 index 0000000..48a6cba --- /dev/null +++ b/GamecraftModdingAPI/Events/EmitterBuilder.cs @@ -0,0 +1,105 @@ +using System; + +using Svelto.ECS; + +namespace GamecraftModdingAPI.Events +{ + public class EmitterBuilder + { + private string name; + + private int? type; + + /// + /// Create a new event emitter builder. + /// + public EmitterBuilder() + { + } + + /// + /// Create a new event emitter builder. + /// This is equivalent to new EmitterBuilder().Name(name) + /// + /// The emitter name. + public EmitterBuilder(string name) + { + this.name = name; + } + + /// + /// Create and return an event emitter builder. + /// + /// The builder. + public static EmitterBuilder Builder() + { + return new EmitterBuilder(); + } + + /// + /// Create and return an event emitter builder. + /// This is equivalent to Builder().Name(name) + /// + /// The builder. + /// The emitter name. + public static EmitterBuilder Builder(string name) + { + return new EmitterBuilder(name); + } + + /// + /// Name the event emitter. + /// + /// The builder. + /// The event emitter name. + public EmitterBuilder Name(string name) + { + this.name = name; + return this; + } + + /// + /// Set the type of event to handle. + /// + /// The builder. + /// The event type. + public EmitterBuilder Handle(EventType eventType) + { + return Handle((int)eventType); + } + + /// + /// Set the type of event to handle. + /// + /// The builder. + /// The event type. + public EmitterBuilder Handle(int eventType) + { + this.type = eventType; + return this; + } + + /// + /// Build the event emitter. + /// + /// The event emitter. + /// Automatically register the event emitter with EventManager.AddEventemitter(). + public IEventEmitterEngine Build(bool register = true) + { + if (string.IsNullOrWhiteSpace(name)) + { + throw new EventParameterMissingException("Event emitter name must be defined before Build() is called"); + } + if (!type.HasValue) + { + throw new EventParameterMissingException("Event emitter event type must be defined before Build() is called"); + } + SimpleEventEmitterEngine result = new SimpleEventEmitterEngine(type.Value, name); + if (register) + { + EventManager.AddEventEmitter(result); + } + return result; + } + } +} diff --git a/GamecraftModdingAPI/Events/EventExceptions.cs b/GamecraftModdingAPI/Events/EventExceptions.cs index ee29480..b4458bc 100644 --- a/GamecraftModdingAPI/Events/EventExceptions.cs +++ b/GamecraftModdingAPI/Events/EventExceptions.cs @@ -52,4 +52,15 @@ namespace GamecraftModdingAPI.Events { } } + + public class EventParameterMissingException : EventException + { + public EventParameterMissingException() + { + } + + public EventParameterMissingException(string message) : base(message) + { + } + } } diff --git a/GamecraftModdingAPI/Events/HandlerBuilder.cs b/GamecraftModdingAPI/Events/HandlerBuilder.cs new file mode 100644 index 0000000..d5d9879 --- /dev/null +++ b/GamecraftModdingAPI/Events/HandlerBuilder.cs @@ -0,0 +1,165 @@ +using System; + +using Svelto.ECS; + +namespace GamecraftModdingAPI.Events +{ + public class HandlerBuilder + { + private string name; + + private int? type; + + private Action activated; + + private Action destroyed; + + /// + /// Create a new event handler builder. + /// + public HandlerBuilder() + { + } + + /// + /// Create a new event handler builder. + /// This is equivalent to new HandlerBuilder().Name(name) + /// + /// The handler name. + public HandlerBuilder(string name) + { + this.name = name; + } + + /// + /// Create and return an event handler builder. + /// + /// The builder. + public static HandlerBuilder Builder() + { + return new HandlerBuilder(); + } + + /// + /// Create and return an event handler builder. + /// This is equivalent to Builder().Name(name) + /// + /// The builder. + /// The handler name. + public static HandlerBuilder Builder(string name) + { + return new HandlerBuilder(name); + } + + /// + /// Name the event handler. + /// + /// The builder. + /// The event handler name. + public HandlerBuilder Name(string name) + { + this.name = name; + return this; + } + + /// + /// Set the action to perform on when the activated event occurs. + /// + /// The builder. + /// The activated event action. + public HandlerBuilder OnActivation(Action action) + { + return OnActivation((_) => { action(); }); + } + + /// + /// Set the action to perform on when the activated event occurs. + /// + /// The builder. + /// The activated event action. + public HandlerBuilder OnActivation(Action action) + { + this.activated = action; + return this; + } + + /// + /// Set the action to perform when the destroyed event occurs. + /// + /// The builder. + /// The destroyed event action. + public HandlerBuilder OnDestruction(Action action) + { + return OnDestruction((_) => { action(); }); + } + + /// + /// Set the action to perform when the destroyed event occurs. + /// + /// The builder. + /// The destroyed event action. + public HandlerBuilder OnDestruction(Action action) + { + this.destroyed = action; + return this; + } + + /// + /// Set the type of event to handle. + /// + /// The builder. + /// The event type. + public HandlerBuilder Handle(EventType eventType) + { + return Handle((int)eventType); + } + + /// + /// Set the type of event to handle. + /// + /// The builder. + /// The event type. + public HandlerBuilder Handle(int eventType) + { + this.type = eventType; + return this; + } + + /// + /// Build the event handler. + /// + /// The event handler. + /// Automatically register the event handler with EventManager.AddEventHandler(). + public IEventHandlerEngine Build(bool register = true) + { + if (string.IsNullOrWhiteSpace(name)) + { + throw new EventParameterMissingException("Event handler name must be defined before Build() is called"); + } + if (activated == null && destroyed == null) + { + throw new EventParameterMissingException("Event handler destruction or activated event action must be defined before Build() is called"); + } + if (!type.HasValue) + { + throw new EventParameterMissingException("Event handler event type must be defined before Build() is called"); + } + Action validActivated = activated; + if (validActivated == null) + { + validActivated = (_) => { }; + } + Action validDestroyed = destroyed; + if (validDestroyed == null) + { + validDestroyed = (_) => { }; + } + SimpleEventHandlerEngine result = new SimpleEventHandlerEngine(validActivated, validDestroyed, type.Value, name); + if (register) + { + EventManager.AddEventHandler(result); + } + return result; + } + } +} diff --git a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs index 183b4f0..307b3f6 100644 --- a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs +++ b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs @@ -61,28 +61,54 @@ namespace GamecraftModdingAPI.Tests Utility.VersionTracking.Enable(); - // debug/test handlers - EventManager.AddEventHandler(new SimpleEventHandlerEngine(() => { Logging.Log("App Inited event!"); }, () => { }, - EventType.ApplicationInitialized, "appinit API debug")); - EventManager.AddEventHandler(new SimpleEventHandlerEngine(() => { Logging.Log("Menu Activated event!"); }, - () => { Logging.Log("Menu Destroyed event!"); }, - EventType.Menu, "menuact API debug")); - EventManager.AddEventHandler(new SimpleEventHandlerEngine(() => { Logging.Log("Menu Switched To event!"); }, () => { }, - EventType.MenuSwitchedTo, "menuswitch API debug")); - EventManager.AddEventHandler(new SimpleEventHandlerEngine(() => { Logging.Log("Game Activated event!"); }, - () => { Logging.Log("Game Destroyed event!"); }, - EventType.Game, "gameact API debug")); - EventManager.AddEventHandler(new SimpleEventHandlerEngine(() => { Logging.Log("Game Reloaded event!"); }, () => { }, - EventType.GameReloaded, "gamerel API debug")); - EventManager.AddEventHandler(new SimpleEventHandlerEngine(() => { Logging.Log("Game Switched To event!"); }, () => { }, - EventType.GameSwitchedTo, "gameswitch API debug")); - EventManager.AddEventHandler(new SimpleEventHandlerEngine(() => { Logging.Log("Game Mode Simulation Switched To event!"); }, () => { }, - EventType.SimulationSwitchedTo, "simulationswitch API debug")); - EventManager.AddEventHandler(new SimpleEventHandlerEngine(() => { Logging.Log("Game Mode Build Switched To event!"); }, () => { }, - EventType.BuildSwitchedTo, "buildswitch API debug")); + // debug/test handlers + HandlerBuilder.Builder() + .Name("appinit API debug") + .Handle(EventType.ApplicationInitialized) + .OnActivation(() => { Logging.Log("App Inited event!"); }) + .Build(); - EventManager.AddEventHandler(new SimpleEventHandlerEngine(() => { throw new Exception(""); }, () => {}, - EventType.Menu, "menu activated API error thrower test")); + HandlerBuilder.Builder("menuact API debug") + .Handle(EventType.Menu) + .OnActivation(() => { Logging.Log("Menu Activated event!"); }) + .OnDestruction(() => { Logging.Log("Menu Destroyed event!"); }) + .Build(); + + HandlerBuilder.Builder("menuswitch API debug") + .Handle(EventType.MenuSwitchedTo) + .OnActivation(() => { Logging.Log("Menu Switched To event!"); }) + .Build(); + + HandlerBuilder.Builder("gameact API debug") + .Handle(EventType.Menu) + .OnActivation(() => { Logging.Log("Game Activated event!"); }) + .OnDestruction(() => { Logging.Log("Game Destroyed event!"); }) + .Build(); + + HandlerBuilder.Builder("gamerel API debug") + .Handle(EventType.GameReloaded) + .OnActivation(() => { Logging.Log("Game Reloaded event!"); }) + .Build(); + + HandlerBuilder.Builder("gameswitch API debug") + .Handle(EventType.GameSwitchedTo) + .OnActivation(() => { Logging.Log("Game Switched To event!"); }) + .Build(); + + HandlerBuilder.Builder("simulationswitch API debug") + .Handle(EventType.SimulationSwitchedTo) + .OnActivation(() => { Logging.Log("Game Mode Simulation Switched To event!"); }) + .Build(); + + HandlerBuilder.Builder("buildswitch API debug") + .Handle(EventType.BuildSwitchedTo) + .OnActivation(() => { Logging.Log("Game Mode Build Switched To event!"); }) + .Build(); + + HandlerBuilder.Builder("menu activated API error thrower test") + .Handle(EventType.Menu) + .OnActivation(() => { throw new Exception("Event Handler always throws an exception!"); }) + .Build(); // debug/test commands if (Dependency.Hell("ExtraCommands")) -- 2.30.2 From 782e00e3dd1ce2efc75fb45f447447e034318afd Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Thu, 14 May 2020 23:08:37 -0400 Subject: [PATCH 024/252] Update deps --- Automation/gen_csproj.py | 2 +- GamecraftModdingAPI/GamecraftModdingAPI.csproj | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Automation/gen_csproj.py b/Automation/gen_csproj.py index ffdd37b..d0f18c4 100755 --- a/Automation/gen_csproj.py +++ b/Automation/gen_csproj.py @@ -46,7 +46,7 @@ if __name__ == "__main__": exit(1) newFileStr = fileStr[:depsStart.start()] + "\n" + asmXml + "\n" + fileStr[depsEnd.end() + 1:] with open("../GamecraftModdingAPI/GamecraftModdingAPI.csproj", "w") as xmlFile: - print("Writing Assembly references (not)") + print("Writing Assembly references") xmlFile.write(newFileStr) # print(newFileStr) diff --git a/GamecraftModdingAPI/GamecraftModdingAPI.csproj b/GamecraftModdingAPI/GamecraftModdingAPI.csproj index f08761b..06c6396 100644 --- a/GamecraftModdingAPI/GamecraftModdingAPI.csproj +++ b/GamecraftModdingAPI/GamecraftModdingAPI.csproj @@ -23,6 +23,7 @@ + @@ -369,6 +370,14 @@ ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.TimerBlock.dll ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.TimerBlock.dll + + ..\ref\Gamecraft_Data\Managed\Gamecraft.CharacterVulnerability.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.CharacterVulnerability.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.CharacterVulnerabilityGui.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.CharacterVulnerabilityGui.dll + ..\ref\Gamecraft_Data\Managed\Gamecraft.Effects.dll ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Effects.dll @@ -397,6 +406,10 @@ ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Wires.Mockup.dll ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Wires.Mockup.dll + + ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll + ..\ref\Gamecraft_Data\Managed\Gamecraft.Tweaks.dll ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Tweaks.dll -- 2.30.2 From 500cb9b7160f427dd5aa5363564d3cb84f690b8c Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Sat, 16 May 2020 12:53:58 -0400 Subject: [PATCH 025/252] Fix groups stealing Ids --- .../GamecraftModdingAPI.csproj | 2 +- .../Utility/ApiExclusiveGroups.cs | 28 +++++++++++++++++-- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/GamecraftModdingAPI/GamecraftModdingAPI.csproj b/GamecraftModdingAPI/GamecraftModdingAPI.csproj index 06c6396..a27b050 100644 --- a/GamecraftModdingAPI/GamecraftModdingAPI.csproj +++ b/GamecraftModdingAPI/GamecraftModdingAPI.csproj @@ -3,7 +3,7 @@ net472 true - 1.0.0 + 1.0.1 Exmods GNU General Public Licence 3+ https://git.exmods.org/modtainers/GamecraftModdingAPI diff --git a/GamecraftModdingAPI/Utility/ApiExclusiveGroups.cs b/GamecraftModdingAPI/Utility/ApiExclusiveGroups.cs index bc7e8ab..19211e6 100644 --- a/GamecraftModdingAPI/Utility/ApiExclusiveGroups.cs +++ b/GamecraftModdingAPI/Utility/ApiExclusiveGroups.cs @@ -10,10 +10,34 @@ namespace GamecraftModdingAPI.Utility { public static class ApiExclusiveGroups { - public static readonly ExclusiveGroup eventsExclusiveGroup = new ExclusiveGroup("GamecraftModdingAPI EventGroup"); + private static ExclusiveGroup _eventsExclusiveGroup = null; + + public static ExclusiveGroup eventsExclusiveGroup + { + get + { + if (_eventsExclusiveGroup == null) + { + _eventsExclusiveGroup = new ExclusiveGroup("GamecraftModdingAPI EventGroup"); + } + return _eventsExclusiveGroup; + } + } public static uint eventID; - public static readonly ExclusiveGroup versionGroup = new ExclusiveGroup("GamecraftModdingAPI VersionGroup"); + private static ExclusiveGroup _versionGroup = null; + + public static ExclusiveGroup versionGroup + { + get + { + if (_versionGroup == null) + { + _versionGroup = new ExclusiveGroup("GamecraftModdingAPI VersionGroup"); + } + return _versionGroup; + } + } } } -- 2.30.2 From ebea9da232458820d527986102a1aa375c66e572 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Sun, 17 May 2020 11:52:55 -0400 Subject: [PATCH 026/252] Remove serializer registration at startup --- GamecraftModdingAPI/GamecraftModdingAPI.csproj | 2 +- GamecraftModdingAPI/Utility/VersionTracking.cs | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/GamecraftModdingAPI/GamecraftModdingAPI.csproj b/GamecraftModdingAPI/GamecraftModdingAPI.csproj index a27b050..55339fa 100644 --- a/GamecraftModdingAPI/GamecraftModdingAPI.csproj +++ b/GamecraftModdingAPI/GamecraftModdingAPI.csproj @@ -3,7 +3,7 @@ net472 true - 1.0.1 + 1.0.2 Exmods GNU General Public Licence 3+ https://git.exmods.org/modtainers/GamecraftModdingAPI diff --git a/GamecraftModdingAPI/Utility/VersionTracking.cs b/GamecraftModdingAPI/Utility/VersionTracking.cs index 3b83cc2..780ac38 100644 --- a/GamecraftModdingAPI/Utility/VersionTracking.cs +++ b/GamecraftModdingAPI/Utility/VersionTracking.cs @@ -35,6 +35,12 @@ namespace GamecraftModdingAPI.Utility /// public static void Enable() { + if (!SerializerManager.ExistsSerializer(typeof(ModVersionStruct).FullName)) + { + SerializerManager.AddSerializer(new SimpleEntitySerializer( + (_) => { return new EGID[1] { new EGID(0u, ApiExclusiveGroups.versionGroup) }; } + )); + } EventManager.AddEventEmitter(versionEngine); isEnabled = true; } @@ -48,12 +54,8 @@ namespace GamecraftModdingAPI.Utility isEnabled = false; } - public static void Init() - { - SerializerManager.AddSerializer(new SimpleEntitySerializer( - (_) => { return new EGID[1] { new EGID(0u, ApiExclusiveGroups.versionGroup) }; } - )); - } + public static void Init() { } + } internal class VersionTrackingEngine : IEventEmitterEngine -- 2.30.2 From 1c5ce37fcece606505ce5e62c5786a00b8c70d21 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sun, 17 May 2020 20:13:45 +0200 Subject: [PATCH 027/252] Add debug interface API and improve block API Added API for adding more information on the debug display (not object-oriented yet) Removed the setter for block type to ensure stability Made the block API return defaults if the block no longer exists Added property to check if the block exists Made a struct for the block's color property Added missing block IDs --- Automation/gen_csproj.py | 0 GamecraftModdingAPI/Block.cs | 55 ++++++------ .../Blocks/{BlockColors.cs => BlockColor.cs} | 13 ++- GamecraftModdingAPI/Blocks/BlockEngine.cs | 38 ++++++++- GamecraftModdingAPI/Blocks/BlockIDs.cs | 5 ++ GamecraftModdingAPI/Main.cs | 1 + .../Tests/GamecraftModdingAPIPluginTest.cs | 19 ++++- GamecraftModdingAPI/Utility/DebugInterface.cs | 30 +++++++ .../Utility/DebugInterfaceEngine.cs | 84 +++++++++++++++++++ 9 files changed, 206 insertions(+), 39 deletions(-) mode change 100755 => 100644 Automation/gen_csproj.py rename GamecraftModdingAPI/Blocks/{BlockColors.cs => BlockColor.cs} (50%) create mode 100644 GamecraftModdingAPI/Utility/DebugInterface.cs create mode 100644 GamecraftModdingAPI/Utility/DebugInterfaceEngine.cs diff --git a/Automation/gen_csproj.py b/Automation/gen_csproj.py old mode 100755 new mode 100644 diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index 336215e..db220dc 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -77,8 +77,11 @@ namespace GamecraftModdingAPI /// public float3 Position { - get => MovementEngine.GetPosition(Id.entityID); - set => MovementEngine.MoveBlock(Id.entityID, value); + get => Exists ? MovementEngine.GetPosition(Id.entityID) : float3.zero; + set + { + if (Exists) MovementEngine.MoveBlock(Id.entityID, value); + } } /// @@ -86,51 +89,41 @@ namespace GamecraftModdingAPI /// public float3 Rotation { - get => RotationEngine.GetRotation(Id.entityID); - set => RotationEngine.RotateBlock(Id.entityID, value); + get => Exists ? RotationEngine.GetRotation(Id.entityID) : float3.zero; + set + { + if (Exists) RotationEngine.RotateBlock(Id.entityID, value); + } } /// - /// The block's type (ID). Changing from or to a functional part may crash the game. + /// The block's type (ID). /// - public BlockIDs Type - { - get => (BlockIDs) BlockEngine.GetBlockInfo(Id).DBID; - set - { - BlockEngine.GetBlockInfo(Id).DBID = (uint) value; - uint prefabId = PrefabsID.GetPrefabId((uint) value, 0); - BlockEngine.GetBlockInfo(Id).prefabID = prefabId; - BlockEngine.GetBlockInfo(Id) = new PhysicsPrefabEntityStruct(prefabId); - } - } + public BlockIDs Type => (BlockIDs) (BlockEngine.GetBlockInfo(Id)?.DBID ?? 0); - public BlockColors Color + public BlockColor Color { - get => (BlockColors) (BlockEngine.GetBlockInfo(Id).indexInPalette % 10); + get + { + byte index = BlockEngine.GetBlockInfo(Id)?.indexInPalette ?? byte.MaxValue; + if (index == byte.MaxValue) return new BlockColor {Color = BlockColors.Default}; + return new BlockColor {Color = (BlockColors) (index % 10), Darkness = (byte) (index / 10)}; + } set { - ref var color = ref BlockEngine.GetBlockInfo(Id); - color.indexInPalette = (byte) (color.indexInPalette / 10 * 10 + value); + var def = new ColourParameterEntityStruct(); + ref var color = ref BlockEngine.GetBlockInfo(Id, ref def); + color.indexInPalette = (byte) (value.Color + value.Darkness * 10); color.needsUpdate = true; } } - public byte ColorDarkness - { - get => (byte) (BlockEngine.GetBlockInfo(Id).indexInPalette / 10); - set - { - ref var color = ref BlockEngine.GetBlockInfo(Id); - color.indexInPalette = (byte) (10 * (byte) value + color.indexInPalette % 10); - color.needsUpdate = true; - } - } + public bool Exists => BlockEngine.BlockExists(Id); /// /// Returns an array of blocks that are connected to this one. /// - public Block[] GetConnectedCubes() => BlockEngine.GetConnectedBlocks(Id.entityID); + public Block[] GetConnectedCubes() => BlockEngine.GetConnectedBlocks(Id); /// /// Removes this block. diff --git a/GamecraftModdingAPI/Blocks/BlockColors.cs b/GamecraftModdingAPI/Blocks/BlockColor.cs similarity index 50% rename from GamecraftModdingAPI/Blocks/BlockColors.cs rename to GamecraftModdingAPI/Blocks/BlockColor.cs index 146bcbf..fc87eb7 100644 --- a/GamecraftModdingAPI/Blocks/BlockColors.cs +++ b/GamecraftModdingAPI/Blocks/BlockColor.cs @@ -1,5 +1,16 @@ -namespace GamecraftModdingAPI.Blocks +namespace GamecraftModdingAPI.Blocks { + public struct BlockColor + { + public BlockColors Color; + public byte Darkness; + + public override string ToString() + { + return $"{nameof(Color)}: {Color}, {nameof(Darkness)}: {Darkness}"; + } + } + /// /// Preset block colours /// diff --git a/GamecraftModdingAPI/Blocks/BlockEngine.cs b/GamecraftModdingAPI/Blocks/BlockEngine.cs index a851643..f678501 100644 --- a/GamecraftModdingAPI/Blocks/BlockEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlockEngine.cs @@ -25,20 +25,50 @@ namespace GamecraftModdingAPI.Blocks { } - public Block[] GetConnectedBlocks(uint blockID) + public Block[] GetConnectedBlocks(EGID blockID) { + if (!BlockExists(blockID)) return new Block[0]; Stack cubeStack = new Stack(); FasterList cubesToProcess = new FasterList(); - ConnectedCubesUtility.TreeTraversal.GetConnectedCubes(entitiesDB, blockID, cubeStack, cubesToProcess, (in GridConnectionsEntityStruct g) => { return false; }); + ConnectedCubesUtility.TreeTraversal.GetConnectedCubes(entitiesDB, blockID.entityID, cubeStack, cubesToProcess, (in GridConnectionsEntityStruct g) => { return false; }); var ret = new Block[cubesToProcess.count]; for (int i = 0; i < cubesToProcess.count; i++) ret[i] = new Block(cubesToProcess[i]); return ret; } - public ref T GetBlockInfo(EGID blockID) where T : struct, IEntityComponent + /// + /// Get a struct of a block. Can be used to set properties. + /// When only querying parameters, use the other overload for convenience. + /// + /// + /// + /// + /// + public ref T GetBlockInfo(EGID blockID, ref T def) where T : struct, IEntityComponent { - return ref entitiesDB.QueryEntity(blockID); + if (entitiesDB.Exists(blockID)) + return ref entitiesDB.QueryEntity(blockID); + return ref def; + } + + /// + /// Get a struct of a block. Can only be used to retrieve information. + /// Use the overload with a default parameter to get the struct by reference to set values. + /// + /// The block's EGID + /// The struct's type to get + /// A copy of the struct or null + public T? GetBlockInfo(EGID blockID) where T : struct, IEntityComponent + { + if (entitiesDB.Exists(blockID)) + return entitiesDB.QueryEntity(blockID); + return null; + } + + public bool BlockExists(EGID id) + { + return entitiesDB.Exists(id); } } } \ No newline at end of file diff --git a/GamecraftModdingAPI/Blocks/BlockIDs.cs b/GamecraftModdingAPI/Blocks/BlockIDs.cs index 1a7a77a..bba2583 100644 --- a/GamecraftModdingAPI/Blocks/BlockIDs.cs +++ b/GamecraftModdingAPI/Blocks/BlockIDs.cs @@ -220,6 +220,11 @@ namespace GamecraftModdingAPI.Blocks CentreHUD, ObjectiveHUD, GameStatsHUD, //231 + GameOverBlock, + MovementConstrainer = 246, + RotationConstrainer, + AdvancedMovementDampener, + AdvancedRotationDampener, Mover = 250, Rotator, MovementDampener, diff --git a/GamecraftModdingAPI/Main.cs b/GamecraftModdingAPI/Main.cs index e8ab256..3b15de8 100644 --- a/GamecraftModdingAPI/Main.cs +++ b/GamecraftModdingAPI/Main.cs @@ -72,6 +72,7 @@ namespace GamecraftModdingAPI // init object-oriented classes Player.Init(); Block.Init(); + DebugInterface.Init(); Logging.MetaLog($"{currentAssembly.GetName().Name} v{currentAssembly.GetName().Version} initialized"); } diff --git a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs index 307b3f6..2e97df7 100644 --- a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs +++ b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs @@ -13,6 +13,7 @@ using GamecraftModdingAPI.Commands; using GamecraftModdingAPI.Events; using GamecraftModdingAPI.Utility; using GamecraftModdingAPI.Blocks; +using RobocraftX.FrontEnd; namespace GamecraftModdingAPI.Tests { @@ -174,9 +175,6 @@ namespace GamecraftModdingAPI.Tests CommandBuilder.Builder("getBlock") .Action(() => uREPL.Log.Output(new Player(Players.PlayerType.Local).GetBlockLookedAt()+"")).Build(); - CommandBuilder.Builder("changeToAluminium") - .Action(() => new Player(Players.PlayerType.Local).GetBlockLookedAt().Type = BlockIDs.AluminiumCube) - .Build(); CommandBuilder.Builder("Error", "Throw an error to make sure SimpleCustomCommandEngine's wrapper catches it.") .Action(() => { throw new Exception("Error Command always throws an error"); }) @@ -246,5 +244,20 @@ namespace GamecraftModdingAPI.Tests public void OnLevelWasLoaded(int level) { } public void OnUpdate() { } + + [HarmonyPatch] + public class MinimumSpecsPatch + { + public static bool Prefix(ref bool __result) + { + __result = true; + return false; + } + + public static MethodInfo TargetMethod() + { + return ((Func)MinimumSpecsCheck.CheckRequirementsMet).Method; + } + } } } diff --git a/GamecraftModdingAPI/Utility/DebugInterface.cs b/GamecraftModdingAPI/Utility/DebugInterface.cs new file mode 100644 index 0000000..1d5499e --- /dev/null +++ b/GamecraftModdingAPI/Utility/DebugInterface.cs @@ -0,0 +1,30 @@ +using System; +using GamecraftModdingAPI.Blocks; + +namespace GamecraftModdingAPI.Utility +{ + public static class DebugInterface + { + private static DebugInterfaceEngine _engine = new DebugInterfaceEngine(); + + /// + /// Saves the extra information to be displayed on the debug view. + /// The provided getter function is called each time the view updates so make sure it returns quickly. + /// + /// A global ID for the custom information + /// A function that returns the current information + public static void SetInfo(string id, Func contentGetter) => _engine.SetInfo(id, contentGetter); + + /// + /// Removes an information provided by a plugin. + /// + /// The ID of the custom information + /// + public static bool RemoveInfo(string id) => _engine.RemoveInfo(id); + + public static void Init() + { + GameEngineManager.AddGameEngine(_engine); + } + } +} \ No newline at end of file diff --git a/GamecraftModdingAPI/Utility/DebugInterfaceEngine.cs b/GamecraftModdingAPI/Utility/DebugInterfaceEngine.cs new file mode 100644 index 0000000..2d470bb --- /dev/null +++ b/GamecraftModdingAPI/Utility/DebugInterfaceEngine.cs @@ -0,0 +1,84 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Reflection.Emit; +using System.Text.Formatting; +using GamecraftModdingAPI.Blocks; +using GamecraftModdingAPI.Engines; +using GamecraftModdingAPI.Players; +using HarmonyLib; +using RobocraftX.GUI.Debug; +using Svelto.ECS; +using Svelto.ECS.Experimental; + +namespace GamecraftModdingAPI.Utility +{ + public class DebugInterfaceEngine : IApiEngine + { + private static Dictionary> _extraInfo=new Dictionary>(); + public void Ready() + { + SetInfo("lookedAt", LookedAt); + } + + public EntitiesDB entitiesDB { get; set; } + + public void Dispose() + { + } + + public void SetInfo(string id, Func contentGetter) => _extraInfo[id] = contentGetter; + public bool RemoveInfo(string id) => _extraInfo.Remove(id); + + private Player player; + private string LookedAt() + { + if (player == null) + player = new Player(PlayerType.Local); + Block block = player.GetBlockLookedAt(); + if (block == null) return "Block: none"; + return "Block: " + block.Type + "\nColor: " + block.Color + "\n" + "At: " + block.Position; + } + + public string Name { get; } = "GamecraftModdingAPIDebugInterfaceGameEngine"; + public bool isRemovable { get; } = true; + + [HarmonyPatch] + private class Patch + { + public static IEnumerable Transpiler(IEnumerable instructions) + { + var list = new List(instructions); + try + { + //Before setting the text from the StringBuffer + int index = list.FindLastIndex(inst => inst.opcode == OpCodes.Ldfld); + var array = new CodeInstruction[] + { + new CodeInstruction(OpCodes.Ldloc_0), //StringBuffer + new CodeInstruction(OpCodes.Call, ((Action)AddInfo).Method) + }; + list.InsertRange(index, array); + } + catch (Exception e) + { + Console.WriteLine(e); + } + + return list; + } + + public static void AddInfo(StringBuffer sb) + { + foreach (var info in _extraInfo.Values) + sb.Append(info() + "\n"); + } + + public static MethodInfo TargetMethod() + { + return AccessTools.Method("RobocraftX.GUI.Debug.DebugDisplayEngine:UpdateDisplay"); + } + } + } +} \ No newline at end of file -- 2.30.2 From 6dce87fb661b80b2a4c86c04984177539eba5ebd Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sun, 17 May 2020 23:23:06 +0200 Subject: [PATCH 028/252] Documentation, added invalid block ID, error handling --- GamecraftModdingAPI/Block.cs | 51 +++++++++++++++++-- GamecraftModdingAPI/Blocks/BlockIDs.cs | 5 +- GamecraftModdingAPI/Main.cs | 2 +- .../Tests/GamecraftModdingAPIPluginTest.cs | 13 +++++ .../Utility/DebugInterfaceEngine.cs | 26 +++++----- .../{DebugInterface.cs => GameClient.cs} | 6 +-- 6 files changed, 78 insertions(+), 25 deletions(-) rename GamecraftModdingAPI/Utility/{DebugInterface.cs => GameClient.cs} (79%) diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index db220dc..88fcc3d 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -1,7 +1,9 @@ using System; using Svelto.ECS; +using Svelto.ECS.EntityStructs; using RobocraftX.Common; +using RobocraftX.Blocks.Scaling; using Unity.Mathematics; using GamecraftModdingAPI.Blocks; @@ -9,6 +11,9 @@ using GamecraftModdingAPI.Utility; namespace GamecraftModdingAPI { + /// + /// A single (perhaps scaled) block. Properties may return default values if the block is removed and then setting them is ignored. + /// public class Block { private static readonly PlacementEngine PlacementEngine = new PlacementEngine(); @@ -73,7 +78,8 @@ namespace GamecraftModdingAPI public EGID Id { get; } /// - /// The block's current position. + /// The block's current position or zero if the block no longer exists. + /// A block is 0.2 wide by default in terms of position. /// public float3 Position { @@ -85,7 +91,7 @@ namespace GamecraftModdingAPI } /// - /// The block's current rotation in degrees. + /// The block's current rotation in degrees or zero if the block doesn't exist. /// public float3 Rotation { @@ -97,10 +103,42 @@ namespace GamecraftModdingAPI } /// - /// The block's type (ID). + /// The block's non-uniform scale or zero if the block's invalid. Independent of the uniform scaling. /// - public BlockIDs Type => (BlockIDs) (BlockEngine.GetBlockInfo(Id)?.DBID ?? 0); + public float3 Scale + { + get => BlockEngine.GetBlockInfo(Id)?.scale ?? float3.zero; + set + { + var def = new ScalingEntityStruct(); + BlockEngine.GetBlockInfo(Id, ref def).scale = value; + } + } + /// + /// The block's uniform scale or zero if the block's invalid. Also sets the non-uniform scale. + /// + public int UniformScale + { + get => BlockEngine.GetBlockInfo(Id)?.desiredScaleFactor ?? 0; + set + { + var def = new BlockPlacementScaleEntityStruct(); + ref var scaleStruct = ref BlockEngine.GetBlockInfo(Id, ref def); + scaleStruct.blockPlacementHeight = scaleStruct.blockPlacementWidth = + scaleStruct.desiredScaleFactor = scaleStruct.snapGridScale = value; + Scale = new float3(value, value, value); + } + } + + /// + /// The block's type (ID). Returns BlockIDs.Invalid if the block doesn't exist anymore. + /// + public BlockIDs Type => (BlockIDs) (BlockEngine.GetBlockInfo(Id)?.DBID ?? ushort.MaxValue); + + /// + /// The block's color. Returns BlockColors.Default if the block no longer exists. + /// public BlockColor Color { get @@ -118,10 +156,13 @@ namespace GamecraftModdingAPI } } + /// + /// Whether the block exists. The other properties will return a default value if the block doesn't exist. + /// public bool Exists => BlockEngine.BlockExists(Id); /// - /// Returns an array of blocks that are connected to this one. + /// Returns an array of blocks that are connected to this one. Returns an empty array if the block doesn't exist. /// public Block[] GetConnectedCubes() => BlockEngine.GetConnectedBlocks(Id); diff --git a/GamecraftModdingAPI/Blocks/BlockIDs.cs b/GamecraftModdingAPI/Blocks/BlockIDs.cs index bba2583..a4d07ff 100644 --- a/GamecraftModdingAPI/Blocks/BlockIDs.cs +++ b/GamecraftModdingAPI/Blocks/BlockIDs.cs @@ -3,9 +3,10 @@ namespace GamecraftModdingAPI.Blocks /// /// Possible block types /// - public enum BlockIDs + public enum BlockIDs : ushort { - AluminiumCube, + Invalid = ushort.MaxValue, + AluminiumCube = 0, AxleS, HingeS = 3, MotorS, diff --git a/GamecraftModdingAPI/Main.cs b/GamecraftModdingAPI/Main.cs index 3b15de8..5a65baf 100644 --- a/GamecraftModdingAPI/Main.cs +++ b/GamecraftModdingAPI/Main.cs @@ -72,7 +72,7 @@ namespace GamecraftModdingAPI // init object-oriented classes Player.Init(); Block.Init(); - DebugInterface.Init(); + GameClient.Init(); Logging.MetaLog($"{currentAssembly.GetName().Name} v{currentAssembly.GetName().Version} initialized"); } diff --git a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs index 2e97df7..e37a5bb 100644 --- a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs +++ b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs @@ -179,6 +179,8 @@ namespace GamecraftModdingAPI.Tests CommandBuilder.Builder("Error", "Throw an error to make sure SimpleCustomCommandEngine's wrapper catches it.") .Action(() => { throw new Exception("Error Command always throws an error"); }) .Build(); + + GameClient.SetDebugInfo("lookedAt", LookedAt); /* CommandManager.AddCommand(new SimpleCustomCommandEngine((float d) => { UnityEngine.Camera.main.fieldOfView = d; }, @@ -235,6 +237,17 @@ namespace GamecraftModdingAPI.Tests } } + private Player player; + + private string LookedAt() + { + if (player == null) + player = new Player(Players.PlayerType.Local); + Block block = player.GetBlockLookedAt(); + if (block == null) return "Block: none"; + return "Block: " + block.Type + "\nColor: " + block.Color + "\n" + "At: " + block.Position; + } + public void OnFixedUpdate() { } public void OnLateUpdate() { } diff --git a/GamecraftModdingAPI/Utility/DebugInterfaceEngine.cs b/GamecraftModdingAPI/Utility/DebugInterfaceEngine.cs index 2d470bb..b8b0222 100644 --- a/GamecraftModdingAPI/Utility/DebugInterfaceEngine.cs +++ b/GamecraftModdingAPI/Utility/DebugInterfaceEngine.cs @@ -19,7 +19,6 @@ namespace GamecraftModdingAPI.Utility private static Dictionary> _extraInfo=new Dictionary>(); public void Ready() { - SetInfo("lookedAt", LookedAt); } public EntitiesDB entitiesDB { get; set; } @@ -31,16 +30,6 @@ namespace GamecraftModdingAPI.Utility public void SetInfo(string id, Func contentGetter) => _extraInfo[id] = contentGetter; public bool RemoveInfo(string id) => _extraInfo.Remove(id); - private Player player; - private string LookedAt() - { - if (player == null) - player = new Player(PlayerType.Local); - Block block = player.GetBlockLookedAt(); - if (block == null) return "Block: none"; - return "Block: " + block.Type + "\nColor: " + block.Color + "\n" + "At: " + block.Position; - } - public string Name { get; } = "GamecraftModdingAPIDebugInterfaceGameEngine"; public bool isRemovable { get; } = true; @@ -63,7 +52,7 @@ namespace GamecraftModdingAPI.Utility } catch (Exception e) { - Console.WriteLine(e); + Logging.LogException(e, "Failed to inject AddInfo method for the debug display!"); } return list; @@ -71,8 +60,17 @@ namespace GamecraftModdingAPI.Utility public static void AddInfo(StringBuffer sb) { - foreach (var info in _extraInfo.Values) - sb.Append(info() + "\n"); + foreach (var info in _extraInfo) + { + try + { + sb.Append(info.Value() + "\n"); + } + catch (Exception e) + { + Logging.LogException(e, "Unable to get info for " + info.Key); + } + } } public static MethodInfo TargetMethod() diff --git a/GamecraftModdingAPI/Utility/DebugInterface.cs b/GamecraftModdingAPI/Utility/GameClient.cs similarity index 79% rename from GamecraftModdingAPI/Utility/DebugInterface.cs rename to GamecraftModdingAPI/Utility/GameClient.cs index 1d5499e..98d8ccb 100644 --- a/GamecraftModdingAPI/Utility/DebugInterface.cs +++ b/GamecraftModdingAPI/Utility/GameClient.cs @@ -3,7 +3,7 @@ using GamecraftModdingAPI.Blocks; namespace GamecraftModdingAPI.Utility { - public static class DebugInterface + public static class GameClient { private static DebugInterfaceEngine _engine = new DebugInterfaceEngine(); @@ -13,14 +13,14 @@ namespace GamecraftModdingAPI.Utility /// /// A global ID for the custom information /// A function that returns the current information - public static void SetInfo(string id, Func contentGetter) => _engine.SetInfo(id, contentGetter); + public static void SetDebugInfo(string id, Func contentGetter) => _engine.SetInfo(id, contentGetter); /// /// Removes an information provided by a plugin. /// /// The ID of the custom information /// - public static bool RemoveInfo(string id) => _engine.RemoveInfo(id); + public static bool RemoveDebugInfo(string id) => _engine.RemoveInfo(id); public static void Init() { -- 2.30.2 From 97de5e606bdcdfd13b63f9190861327f3c39c18e Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Sun, 17 May 2020 23:19:16 -0400 Subject: [PATCH 029/252] Add first block children ConsoleBlock and TextBlock, I hope they're not bullied at school for those names --- GamecraftModdingAPI/Block.cs | 349 ++++++++++-------- GamecraftModdingAPI/Blocks/BlockEngine.cs | 120 +++--- GamecraftModdingAPI/Blocks/BlockExceptions.cs | 43 +++ GamecraftModdingAPI/Blocks/ConsoleBlock.cs | 97 +++++ GamecraftModdingAPI/Blocks/TextBlock.cs | 92 +++++ .../GamecraftModdingAPI.csproj | 2 +- .../DeterministicStepCompositionRootPatch.cs | 25 ++ 7 files changed, 514 insertions(+), 214 deletions(-) create mode 100644 GamecraftModdingAPI/Blocks/BlockExceptions.cs create mode 100644 GamecraftModdingAPI/Blocks/ConsoleBlock.cs create mode 100644 GamecraftModdingAPI/Blocks/TextBlock.cs create mode 100644 GamecraftModdingAPI/Utility/DeterministicStepCompositionRootPatch.cs diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index 88fcc3d..11a7ddc 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -1,4 +1,5 @@ using System; +using System.Reflection; using Svelto.ECS; using Svelto.ECS.EntityStructs; @@ -11,179 +12,209 @@ using GamecraftModdingAPI.Utility; namespace GamecraftModdingAPI { - /// - /// A single (perhaps scaled) block. Properties may return default values if the block is removed and then setting them is ignored. - /// - public class Block - { - private static readonly PlacementEngine PlacementEngine = new PlacementEngine(); - private static readonly MovementEngine MovementEngine = new MovementEngine(); - private static readonly RotationEngine RotationEngine = new RotationEngine(); - private static readonly RemovalEngine RemovalEngine = new RemovalEngine(); - private static readonly BlockEngine BlockEngine = new BlockEngine(); + /// + /// A single (perhaps scaled) block. Properties may return default values if the block is removed and then setting them is ignored. + /// + public class Block + { + protected static readonly PlacementEngine PlacementEngine = new PlacementEngine(); + protected static readonly MovementEngine MovementEngine = new MovementEngine(); + protected static readonly RotationEngine RotationEngine = new RotationEngine(); + protected static readonly RemovalEngine RemovalEngine = new RemovalEngine(); + protected static readonly BlockEngine BlockEngine = new BlockEngine(); - /// - /// Place a new block at the given position. If scaled, position means the center of the block. The default block size is 0.2 in terms of position. - /// Place blocks next to each other to connect them. - /// The placed block will be a complete block with a placement grid and collision which will be saved along with the game. - /// - /// The block's type - /// The block's color - /// The block color's darkness (0-9) - 0 is default color - /// The block's position in the grid - default block size is 0.2 - /// The block's rotation in degrees - /// The block's uniform scale - default scale is 1 (with 0.2 width) - /// The block's non-uniform scale - 0 means is used - /// The player who placed the block - /// The placed block or null if failed - public static Block PlaceNew(BlockIDs block, float3 position, - float3 rotation = default, BlockColors color = BlockColors.Default, byte darkness = 0, - int uscale = 1, float3 scale = default, Player player = null) - { - if (PlacementEngine.IsInGame && GameState.IsBuildMode()) - { - try - { - return new Block(PlacementEngine.PlaceBlock(block, color, darkness, - position, uscale, scale, player, rotation)); - } - catch (Exception e) - { - Logging.MetaDebugLog(e); - } - } + /// + /// Place a new block at the given position. If scaled, position means the center of the block. The default block size is 0.2 in terms of position. + /// Place blocks next to each other to connect them. + /// The placed block will be a complete block with a placement grid and collision which will be saved along with the game. + /// + /// The block's type + /// The block's color + /// The block color's darkness (0-9) - 0 is default color + /// The block's position in the grid - default block size is 0.2 + /// The block's rotation in degrees + /// The block's uniform scale - default scale is 1 (with 0.2 width) + /// The block's non-uniform scale - 0 means is used + /// The player who placed the block + /// The placed block or null if failed + public static Block PlaceNew(BlockIDs block, float3 position, + float3 rotation = default, BlockColors color = BlockColors.Default, byte darkness = 0, + int uscale = 1, float3 scale = default, Player player = null) + { + if (PlacementEngine.IsInGame && GameState.IsBuildMode()) + { + try + { + return new Block(PlacementEngine.PlaceBlock(block, color, darkness, + position, uscale, scale, player, rotation)); + } + catch (Exception e) + { + Logging.MetaDebugLog(e); + } + } - return null; - } + return null; + } - /// - /// Returns the most recently placed block. - /// - /// The block object - public static Block GetLastPlacedBlock() - { - return new Block(BlockIdentifiers.LatestBlockID); - } + /// + /// Returns the most recently placed block. + /// + /// The block object + public static Block GetLastPlacedBlock() + { + return new Block(BlockIdentifiers.LatestBlockID); + } - public Block(EGID id) - { - Id = id; - } + public Block(EGID id) + { + Id = id; + } - public Block(uint id) - { - Id = new EGID(id, CommonExclusiveGroups.OWNED_BLOCKS_GROUP); - } - - public EGID Id { get; } + public Block(uint id) + { + Id = new EGID(id, CommonExclusiveGroups.OWNED_BLOCKS_GROUP); + } - /// - /// The block's current position or zero if the block no longer exists. - /// A block is 0.2 wide by default in terms of position. - /// - public float3 Position - { - get => Exists ? MovementEngine.GetPosition(Id.entityID) : float3.zero; - set - { - if (Exists) MovementEngine.MoveBlock(Id.entityID, value); - } - } + protected static void Sync() + { + DeterministicStepCompositionRootPatch.SubmitEntitiesNow(); + } - /// - /// The block's current rotation in degrees or zero if the block doesn't exist. - /// - public float3 Rotation - { - get => Exists ? RotationEngine.GetRotation(Id.entityID) : float3.zero; - set - { - if (Exists) RotationEngine.RotateBlock(Id.entityID, value); - } - } + public EGID Id { get; } - /// - /// The block's non-uniform scale or zero if the block's invalid. Independent of the uniform scaling. - /// - public float3 Scale - { - get => BlockEngine.GetBlockInfo(Id)?.scale ?? float3.zero; - set - { - var def = new ScalingEntityStruct(); - BlockEngine.GetBlockInfo(Id, ref def).scale = value; - } - } + /// + /// The block's current position or zero if the block no longer exists. + /// A block is 0.2 wide by default in terms of position. + /// + public float3 Position + { + get => Exists ? MovementEngine.GetPosition(Id.entityID) : float3.zero; + set + { + if (Exists) MovementEngine.MoveBlock(Id.entityID, value); + } + } - /// - /// The block's uniform scale or zero if the block's invalid. Also sets the non-uniform scale. - /// - public int UniformScale - { - get => BlockEngine.GetBlockInfo(Id)?.desiredScaleFactor ?? 0; - set - { - var def = new BlockPlacementScaleEntityStruct(); - ref var scaleStruct = ref BlockEngine.GetBlockInfo(Id, ref def); - scaleStruct.blockPlacementHeight = scaleStruct.blockPlacementWidth = - scaleStruct.desiredScaleFactor = scaleStruct.snapGridScale = value; - Scale = new float3(value, value, value); - } - } + /// + /// The block's current rotation in degrees or zero if the block doesn't exist. + /// + public float3 Rotation + { + get => Exists ? RotationEngine.GetRotation(Id.entityID) : float3.zero; + set + { + if (Exists) RotationEngine.RotateBlock(Id.entityID, value); + } + } - /// - /// The block's type (ID). Returns BlockIDs.Invalid if the block doesn't exist anymore. - /// - public BlockIDs Type => (BlockIDs) (BlockEngine.GetBlockInfo(Id)?.DBID ?? ushort.MaxValue); + /// + /// The block's non-uniform scale or zero if the block's invalid. Independent of the uniform scaling. + /// + public float3 Scale + { + get => BlockEngine.GetBlockInfo(Id)?.scale ?? float3.zero; + set + { + var def = new ScalingEntityStruct(); + BlockEngine.GetBlockInfo(Id, ref def).scale = value; + } + } - /// - /// The block's color. Returns BlockColors.Default if the block no longer exists. - /// - public BlockColor Color - { - get - { - byte index = BlockEngine.GetBlockInfo(Id)?.indexInPalette ?? byte.MaxValue; - if (index == byte.MaxValue) return new BlockColor {Color = BlockColors.Default}; - return new BlockColor {Color = (BlockColors) (index % 10), Darkness = (byte) (index / 10)}; - } - set - { - var def = new ColourParameterEntityStruct(); - ref var color = ref BlockEngine.GetBlockInfo(Id, ref def); - color.indexInPalette = (byte) (value.Color + value.Darkness * 10); - color.needsUpdate = true; - } - } + /// + /// The block's uniform scale or zero if the block's invalid. Also sets the non-uniform scale. + /// + public int UniformScale + { + get => BlockEngine.GetBlockInfo(Id)?.desiredScaleFactor ?? 0; + set + { + var def = new BlockPlacementScaleEntityStruct(); + ref var scaleStruct = ref BlockEngine.GetBlockInfo(Id, ref def); + scaleStruct.blockPlacementHeight = scaleStruct.blockPlacementWidth = + scaleStruct.desiredScaleFactor = scaleStruct.snapGridScale = value; + Scale = new float3(value, value, value); + } + } - /// - /// Whether the block exists. The other properties will return a default value if the block doesn't exist. - /// - public bool Exists => BlockEngine.BlockExists(Id); + /// + /// The block's type (ID). Returns BlockIDs.Invalid if the block doesn't exist anymore. + /// + public BlockIDs Type => (BlockIDs)(BlockEngine.GetBlockInfo(Id)?.DBID ?? ushort.MaxValue); - /// - /// Returns an array of blocks that are connected to this one. Returns an empty array if the block doesn't exist. - /// - public Block[] GetConnectedCubes() => BlockEngine.GetConnectedBlocks(Id); + /// + /// The block's color. Returns BlockColors.Default if the block no longer exists. + /// + public BlockColor Color + { + get + { + byte index = BlockEngine.GetBlockInfo(Id)?.indexInPalette ?? byte.MaxValue; + if (index == byte.MaxValue) return new BlockColor { Color = BlockColors.Default }; + return new BlockColor { Color = (BlockColors)(index % 10), Darkness = (byte)(index / 10) }; + } + set + { + var def = new ColourParameterEntityStruct(); + ref var color = ref BlockEngine.GetBlockInfo(Id, ref def); + color.indexInPalette = (byte)(value.Color + value.Darkness * 10); + color.needsUpdate = true; + } + } - /// - /// Removes this block. - /// - /// True if the block exists and could be removed. - public bool Remove() => RemovalEngine.RemoveBlock(Id); + /// + /// Whether the block exists. The other properties will return a default value if the block doesn't exist. + /// + public bool Exists => BlockEngine.BlockExists(Id); - public override string ToString() - { - return $"{nameof(Id)}: {Id}, {nameof(Position)}: {Position}, {nameof(Rotation)}: {Rotation}"; - } + /// + /// Returns an array of blocks that are connected to this one. Returns an empty array if the block doesn't exist. + /// + public Block[] GetConnectedCubes() => BlockEngine.GetConnectedBlocks(Id); - public static void Init() - { - GameEngineManager.AddGameEngine(PlacementEngine); - GameEngineManager.AddGameEngine(MovementEngine); - GameEngineManager.AddGameEngine(RotationEngine); - GameEngineManager.AddGameEngine(RemovalEngine); - GameEngineManager.AddGameEngine(BlockEngine); - } - } + /// + /// Removes this block. + /// + /// True if the block exists and could be removed. + public bool Remove() => RemovalEngine.RemoveBlock(Id); + + public override string ToString() + { + return $"{nameof(Id)}: {Id}, {nameof(Position)}: {Position}, {nameof(Rotation)}: {Rotation}"; + } + + public static void Init() + { + GameEngineManager.AddGameEngine(PlacementEngine); + GameEngineManager.AddGameEngine(MovementEngine); + GameEngineManager.AddGameEngine(RotationEngine); + GameEngineManager.AddGameEngine(RemovalEngine); + GameEngineManager.AddGameEngine(BlockEngine); + } + + public T Specialise(bool sameTick = true) where T : Block + { + // What have I gotten myself into? + // C# can't cast to a child of Block unless the object was originally that child type + // And C# doesn't let me make implicit cast operators for child types + // So thanks to Microsoft, we've got this horrible implementation using reflection + ConstructorInfo ctor = typeof(T).GetConstructor(types: new System.Type[] { typeof(EGID) }); + if (ctor == null) + { + throw new BlockSpecializationException("Specialized block constructor does not accept an EGID"); + } + if (sameTick) Sync(); + return (T)ctor.Invoke(new object[] { Id }); + } + +#if DEBUG + public static EntitiesDB entitiesDB + { + get + { + return BlockEngine.GetEntitiesDB(); + } + } +#endif + } } \ No newline at end of file diff --git a/GamecraftModdingAPI/Blocks/BlockEngine.cs b/GamecraftModdingAPI/Blocks/BlockEngine.cs index f678501..d8182ca 100644 --- a/GamecraftModdingAPI/Blocks/BlockEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlockEngine.cs @@ -9,66 +9,78 @@ using GamecraftModdingAPI.Engines; namespace GamecraftModdingAPI.Blocks { - public class BlockEngine : IApiEngine - { - public string Name { get; } = "GamecraftModdingAPIBlockGameEngine"; + public class BlockEngine : IApiEngine + { + public string Name { get; } = "GamecraftModdingAPIBlockGameEngine"; - public EntitiesDB entitiesDB { set; private get; } + public EntitiesDB entitiesDB { set; private get; } - public bool isRemovable => false; + public bool isRemovable => false; - public void Dispose() - { - } + public void Dispose() + { + } - public void Ready() - { - } + public void Ready() + { + } - public Block[] GetConnectedBlocks(EGID blockID) - { - if (!BlockExists(blockID)) return new Block[0]; - Stack cubeStack = new Stack(); - FasterList cubesToProcess = new FasterList(); - ConnectedCubesUtility.TreeTraversal.GetConnectedCubes(entitiesDB, blockID.entityID, cubeStack, cubesToProcess, (in GridConnectionsEntityStruct g) => { return false; }); - var ret = new Block[cubesToProcess.count]; - for (int i = 0; i < cubesToProcess.count; i++) - ret[i] = new Block(cubesToProcess[i]); - return ret; - } + public Block[] GetConnectedBlocks(EGID blockID) + { + if (!BlockExists(blockID)) return new Block[0]; + Stack cubeStack = new Stack(); + FasterList cubesToProcess = new FasterList(); + ConnectedCubesUtility.TreeTraversal.GetConnectedCubes(entitiesDB, blockID.entityID, cubeStack, cubesToProcess, (in GridConnectionsEntityStruct g) => { return false; }); + var ret = new Block[cubesToProcess.count]; + for (int i = 0; i < cubesToProcess.count; i++) + ret[i] = new Block(cubesToProcess[i]); + return ret; + } - /// - /// Get a struct of a block. Can be used to set properties. - /// When only querying parameters, use the other overload for convenience. - /// - /// - /// - /// - /// - public ref T GetBlockInfo(EGID blockID, ref T def) where T : struct, IEntityComponent - { - if (entitiesDB.Exists(blockID)) - return ref entitiesDB.QueryEntity(blockID); - return ref def; - } + /// + /// Get a struct of a block. Can be used to set properties. + /// When only querying parameters, use the other overload for convenience. + /// + /// + /// + /// + /// + public ref T GetBlockInfo(EGID blockID, ref T def) where T : struct, IEntityComponent + { + if (entitiesDB.Exists(blockID)) + return ref entitiesDB.QueryEntity(blockID); + return ref def; + } - /// - /// Get a struct of a block. Can only be used to retrieve information. - /// Use the overload with a default parameter to get the struct by reference to set values. - /// - /// The block's EGID - /// The struct's type to get - /// A copy of the struct or null - public T? GetBlockInfo(EGID blockID) where T : struct, IEntityComponent - { - if (entitiesDB.Exists(blockID)) - return entitiesDB.QueryEntity(blockID); - return null; - } + /// + /// Get a struct of a block. Can only be used to retrieve information. + /// Use the overload with a default parameter to get the struct by reference to set values. + /// + /// The block's EGID + /// The struct's type to get + /// A copy of the struct or null + public T? GetBlockInfo(EGID blockID) where T : struct, IEntityComponent + { + if (entitiesDB.Exists(blockID)) + return entitiesDB.QueryEntity(blockID); + return null; + } - public bool BlockExists(EGID id) - { - return entitiesDB.Exists(id); - } - } + public bool BlockExists(EGID id) + { + return entitiesDB.Exists(id); + } + + public bool GetBlockInfoExists(EGID blockID) where T : struct, IEntityComponent + { + return entitiesDB.Exists(blockID); + } + +#if DEBUG + public EntitiesDB GetEntitiesDB() + { + return entitiesDB; + } +#endif + } } \ No newline at end of file diff --git a/GamecraftModdingAPI/Blocks/BlockExceptions.cs b/GamecraftModdingAPI/Blocks/BlockExceptions.cs new file mode 100644 index 0000000..47af014 --- /dev/null +++ b/GamecraftModdingAPI/Blocks/BlockExceptions.cs @@ -0,0 +1,43 @@ +using System; + +using GamecraftModdingAPI; + +namespace GamecraftModdingAPI.Blocks +{ + public class BlockException : GamecraftModdingAPIException + { + public BlockException() + { + } + + public BlockException(System.String message) : base(message) + { + } + + public BlockException(System.String message, Exception innerException) : base(message, innerException) + { + } + } + + public class BlockTypeException : BlockException + { + public BlockTypeException() + { + } + + public BlockTypeException(string message) : base(message) + { + } + } + + public class BlockSpecializationException : BlockException + { + public BlockSpecializationException() + { + } + + public BlockSpecializationException(string message) : base(message) + { + } + } +} diff --git a/GamecraftModdingAPI/Blocks/ConsoleBlock.cs b/GamecraftModdingAPI/Blocks/ConsoleBlock.cs new file mode 100644 index 0000000..c1dec27 --- /dev/null +++ b/GamecraftModdingAPI/Blocks/ConsoleBlock.cs @@ -0,0 +1,97 @@ +using System; + +using RobocraftX.Blocks; +using Svelto.ECS; +using Unity.Mathematics; + +using GamecraftModdingAPI; +using GamecraftModdingAPI.Utility; + +namespace GamecraftModdingAPI.Blocks +{ + public class ConsoleBlock : Block + { + public static ConsoleBlock PlaceNew(float3 position, + float3 rotation = default, BlockColors color = BlockColors.Default, byte darkness = 0, + int uscale = 1, float3 scale = default, Player player = null) + { + if (PlacementEngine.IsInGame && GameState.IsBuildMode()) + { + try + { + EGID id = PlacementEngine.PlaceBlock(BlockIDs.ConsoleBlock, color, darkness, + position, uscale, scale, player, rotation); + Sync(); + return new ConsoleBlock(id); + } + catch (Exception e) + { + Logging.MetaDebugLog(e); + } + } + + return null; + } + + public ConsoleBlock(EGID id): base(id) + { + if (!BlockEngine.GetBlockInfoExists(this.Id)) + { + throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); + } + } + + public ConsoleBlock(uint id): base(id) + { + if (!BlockEngine.GetBlockInfoExists(this.Id)) + { + throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); + } + } + + // custom console block properties + + public string Command + { + get + { + return BlockEngine.GetBlockInfo(Id)?.commandName ?? null; + } + + set + { + BlockEngine.GetBlockInfo(Id)?.commandName.Set(value); + } + } + + public string Arg1 + { + get => BlockEngine.GetBlockInfo(Id)?.arg1 ?? null; + + set + { + BlockEngine.GetBlockInfo(Id)?.arg1.Set(value); + } + } + + public string Arg2 + { + get => BlockEngine.GetBlockInfo(Id)?.arg2 ?? null; + + set + { + BlockEngine.GetBlockInfo(Id)?.arg2.Set(value); + } + } + + public string Arg3 + { + get => BlockEngine.GetBlockInfo(Id)?.arg3 ?? null; + + set + { + BlockEngine.GetBlockInfo(Id)?.arg3.Set(value); + } + } + } +} diff --git a/GamecraftModdingAPI/Blocks/TextBlock.cs b/GamecraftModdingAPI/Blocks/TextBlock.cs new file mode 100644 index 0000000..bd2a23b --- /dev/null +++ b/GamecraftModdingAPI/Blocks/TextBlock.cs @@ -0,0 +1,92 @@ +using System; + +using Gamecraft.Blocks.GUI; +using Svelto.ECS; +using Unity.Mathematics; + +using GamecraftModdingAPI; +using GamecraftModdingAPI.Utility; + +namespace GamecraftModdingAPI.Blocks +{ + public class TextBlock : Block + { + + public static TextBlock PlaceNew(float3 position, + float3 rotation = default, BlockColors color = BlockColors.Default, byte darkness = 0, + int uscale = 1, float3 scale = default, Player player = null) + { + if (PlacementEngine.IsInGame && GameState.IsBuildMode()) + { + try + { + EGID id = PlacementEngine.PlaceBlock(BlockIDs.TextBlock, color, darkness, + position, uscale, scale, player, rotation); + Sync(); + return new TextBlock(id); + } + catch (Exception e) + { + Logging.MetaDebugLog(e); + } + } + + return null; + } + + public TextBlock(EGID id) : base(id) + { + if (!BlockEngine.GetBlockInfoExists(this.Id)) + { + throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); + } + } + + public TextBlock(uint id) : base(id) + { + if (!BlockEngine.GetBlockInfoExists(this.Id)) + { + throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); + } + } + + // custom text block properties + + /// + /// The text block's current text. + /// + public string Text + { + get + { + return BlockEngine.GetBlockInfo(Id)?.textCurrent ?? null; + } + + set + { + TextBlockDataStruct def = default; + ref TextBlockDataStruct tbds = ref BlockEngine.GetBlockInfo(Id, ref def); + tbds.textCurrent.Set(value); + tbds.textStored.Set(value); + BlockEngine.GetBlockInfo(Id)?.newTextBlockStringContent.Set(value); + } + } + + /// + /// The text block's current text block ID (used in ChangeTextBlockCommand). + /// + public string TextBlockId + { + get + { + return BlockEngine.GetBlockInfo(Id)?.textBlockID ?? null; + } + + set + { + BlockEngine.GetBlockInfo(Id)?.textBlockID.Set(value); + BlockEngine.GetBlockInfo(Id)?.newTextBlockID.Set(value); + } + } + } +} diff --git a/GamecraftModdingAPI/GamecraftModdingAPI.csproj b/GamecraftModdingAPI/GamecraftModdingAPI.csproj index 55339fa..074c5b6 100644 --- a/GamecraftModdingAPI/GamecraftModdingAPI.csproj +++ b/GamecraftModdingAPI/GamecraftModdingAPI.csproj @@ -3,7 +3,7 @@ net472 true - 1.0.2 + 1.1.0 Exmods GNU General Public Licence 3+ https://git.exmods.org/modtainers/GamecraftModdingAPI diff --git a/GamecraftModdingAPI/Utility/DeterministicStepCompositionRootPatch.cs b/GamecraftModdingAPI/Utility/DeterministicStepCompositionRootPatch.cs new file mode 100644 index 0000000..9cabbe0 --- /dev/null +++ b/GamecraftModdingAPI/Utility/DeterministicStepCompositionRootPatch.cs @@ -0,0 +1,25 @@ +using System; + +using RobocraftX.StateSync; +using Svelto.ECS; + +using HarmonyLib; + +namespace GamecraftModdingAPI.Utility +{ + [HarmonyPatch(typeof(DeterministicStepCompositionRoot), "ResetWorld")] + public static class DeterministicStepCompositionRootPatch + { + private static SimpleEntitiesSubmissionScheduler engineRootScheduler; + public static void Postfix(SimpleEntitiesSubmissionScheduler scheduler) + { + engineRootScheduler = scheduler; + } + + internal static void SubmitEntitiesNow() + { + if (engineRootScheduler != null) + engineRootScheduler.SubmitEntities(); + } + } +} -- 2.30.2 From 3ff98f29bbfadabd6c70907bb39a9c0fa4c9d1a7 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Wed, 20 May 2020 00:08:02 +0200 Subject: [PATCH 030/252] Improve GetBlockInfo(), block colors Made GetBlockInfo() always return a reference without needing it as a parameter Fixed Color property Added CustomColor property for temporarily setting any color --- GamecraftModdingAPI/Block.cs | 47 ++++++++++++----- GamecraftModdingAPI/Blocks/BlockEngine.cs | 52 ++++++++++++------- GamecraftModdingAPI/Blocks/BlockIDs.cs | 3 ++ GamecraftModdingAPI/Blocks/ConsoleBlock.cs | 16 +++--- GamecraftModdingAPI/Blocks/TextBlock.cs | 13 +++-- .../Tests/GamecraftModdingAPIPluginTest.cs | 26 ++++++++-- 6 files changed, 106 insertions(+), 51 deletions(-) diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index 11a7ddc..6a5b2a1 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -4,7 +4,7 @@ using System.Reflection; using Svelto.ECS; using Svelto.ECS.EntityStructs; using RobocraftX.Common; -using RobocraftX.Blocks.Scaling; +using RobocraftX.Blocks; using Unity.Mathematics; using GamecraftModdingAPI.Blocks; @@ -113,11 +113,10 @@ namespace GamecraftModdingAPI /// public float3 Scale { - get => BlockEngine.GetBlockInfo(Id)?.scale ?? float3.zero; + get => BlockEngine.GetBlockInfo(Id).scale; set { - var def = new ScalingEntityStruct(); - BlockEngine.GetBlockInfo(Id, ref def).scale = value; + BlockEngine.GetBlockInfo(Id).scale = value; } } @@ -126,13 +125,11 @@ namespace GamecraftModdingAPI /// public int UniformScale { - get => BlockEngine.GetBlockInfo(Id)?.desiredScaleFactor ?? 0; + get => BlockEngine.GetBlockInfo(Id).scaleFactor; set { - var def = new BlockPlacementScaleEntityStruct(); - ref var scaleStruct = ref BlockEngine.GetBlockInfo(Id, ref def); - scaleStruct.blockPlacementHeight = scaleStruct.blockPlacementWidth = - scaleStruct.desiredScaleFactor = scaleStruct.snapGridScale = value; + ref var scaleStruct = ref BlockEngine.GetBlockInfo(Id); + scaleStruct.scaleFactor = value; Scale = new float3(value, value, value); } } @@ -140,7 +137,14 @@ namespace GamecraftModdingAPI /// /// The block's type (ID). Returns BlockIDs.Invalid if the block doesn't exist anymore. /// - public BlockIDs Type => (BlockIDs)(BlockEngine.GetBlockInfo(Id)?.DBID ?? ushort.MaxValue); + public BlockIDs Type + { + get + { + var id = (BlockIDs) BlockEngine.GetBlockInfo(Id, out var exists).DBID; + return exists ? id : BlockIDs.Invalid; + } + } /// /// The block's color. Returns BlockColors.Default if the block no longer exists. @@ -149,15 +153,32 @@ namespace GamecraftModdingAPI { get { - byte index = BlockEngine.GetBlockInfo(Id)?.indexInPalette ?? byte.MaxValue; + byte index = BlockEngine.GetBlockInfo(Id, out var exists).indexInPalette; + if (!exists) index = byte.MaxValue; if (index == byte.MaxValue) return new BlockColor { Color = BlockColors.Default }; return new BlockColor { Color = (BlockColors)(index % 10), Darkness = (byte)(index / 10) }; } set { - var def = new ColourParameterEntityStruct(); - ref var color = ref BlockEngine.GetBlockInfo(Id, ref def); + ref var color = ref BlockEngine.GetBlockInfo(Id); color.indexInPalette = (byte)(value.Color + value.Darkness * 10); + color.overridePaletteColour = false; + color.needsUpdate = true; + BlockEngine.SetBlockColorFromPalette(ref color); + } + } + + /// + /// The block's exact color. Gets reset to the palette color (Color property) after reentering the game. + /// + public float4 CustomColor + { + get => BlockEngine.GetBlockInfo(Id).overriddenColour; + set + { + ref var color = ref BlockEngine.GetBlockInfo(Id); + color.overriddenColour = value; + color.overridePaletteColour = true; color.needsUpdate = true; } } diff --git a/GamecraftModdingAPI/Blocks/BlockEngine.cs b/GamecraftModdingAPI/Blocks/BlockEngine.cs index d8182ca..377fa5b 100644 --- a/GamecraftModdingAPI/Blocks/BlockEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlockEngine.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using RobocraftX.Blocks; using RobocraftX.Common; +using RobocraftX.GUI.Hotbar.Colours; using Svelto.DataStructures; using Svelto.ECS; @@ -37,33 +38,44 @@ namespace GamecraftModdingAPI.Blocks return ret; } - /// - /// Get a struct of a block. Can be used to set properties. - /// When only querying parameters, use the other overload for convenience. - /// - /// - /// - /// - /// - public ref T GetBlockInfo(EGID blockID, ref T def) where T : struct, IEntityComponent + public void SetBlockColorFromPalette(ref ColourParameterEntityStruct color) { - if (entitiesDB.Exists(blockID)) - return ref entitiesDB.QueryEntity(blockID); - return ref def; + ref var paletteEntry = ref entitiesDB.QueryEntity(color.indexInPalette, + CommonExclusiveGroups.COLOUR_PALETTE_GROUP); + color.paletteColour = paletteEntry.Colour; } /// - /// Get a struct of a block. Can only be used to retrieve information. - /// Use the overload with a default parameter to get the struct by reference to set values. + /// Get a struct of a block. Can be used to set properties. + /// Returns a default value if not found. /// - /// The block's EGID - /// The struct's type to get - /// A copy of the struct or null - public T? GetBlockInfo(EGID blockID) where T : struct, IEntityComponent + /// The block's ID + /// The struct to query + /// An editable reference to the struct + public ref T GetBlockInfo(EGID blockID) where T : struct, IEntityComponent { if (entitiesDB.Exists(blockID)) - return entitiesDB.QueryEntity(blockID); - return null; + return ref entitiesDB.QueryEntity(blockID); + T[] structHolder = new T[1]; //Create something that can be referenced + return ref structHolder[0]; //Gets a default value automatically + } + + /// + /// Get a struct of a block. Can be used to set properties. + /// Returns a default value if not found. + /// + /// The block's ID + /// Whether the specified struct exists for the block + /// The struct to query + /// An editable reference to the struct + public ref T GetBlockInfo(EGID blockID, out bool exists) where T : struct, IEntityComponent + { + exists = entitiesDB.Exists(blockID); + if (exists) + return ref entitiesDB.QueryEntity(blockID); + T[] structHolder = new T[1]; + ref T structRef = ref structHolder[0]; + return ref structRef; } public bool BlockExists(EGID id) diff --git a/GamecraftModdingAPI/Blocks/BlockIDs.cs b/GamecraftModdingAPI/Blocks/BlockIDs.cs index a4d07ff..4babe62 100644 --- a/GamecraftModdingAPI/Blocks/BlockIDs.cs +++ b/GamecraftModdingAPI/Blocks/BlockIDs.cs @@ -5,6 +5,9 @@ namespace GamecraftModdingAPI.Blocks /// public enum BlockIDs : ushort { + /// + /// A custom value for the API. Doesn't exist for Gamecraft. + /// Invalid = ushort.MaxValue, AluminiumCube = 0, AxleS, diff --git a/GamecraftModdingAPI/Blocks/ConsoleBlock.cs b/GamecraftModdingAPI/Blocks/ConsoleBlock.cs index c1dec27..b4fcaa4 100644 --- a/GamecraftModdingAPI/Blocks/ConsoleBlock.cs +++ b/GamecraftModdingAPI/Blocks/ConsoleBlock.cs @@ -55,42 +55,42 @@ namespace GamecraftModdingAPI.Blocks { get { - return BlockEngine.GetBlockInfo(Id)?.commandName ?? null; + return BlockEngine.GetBlockInfo(Id).commandName; } set { - BlockEngine.GetBlockInfo(Id)?.commandName.Set(value); + BlockEngine.GetBlockInfo(Id).commandName.Set(value); } } public string Arg1 { - get => BlockEngine.GetBlockInfo(Id)?.arg1 ?? null; + get => BlockEngine.GetBlockInfo(Id).arg1; set { - BlockEngine.GetBlockInfo(Id)?.arg1.Set(value); + BlockEngine.GetBlockInfo(Id).arg1.Set(value); } } public string Arg2 { - get => BlockEngine.GetBlockInfo(Id)?.arg2 ?? null; + get => BlockEngine.GetBlockInfo(Id).arg2; set { - BlockEngine.GetBlockInfo(Id)?.arg2.Set(value); + BlockEngine.GetBlockInfo(Id).arg2.Set(value); } } public string Arg3 { - get => BlockEngine.GetBlockInfo(Id)?.arg3 ?? null; + get => BlockEngine.GetBlockInfo(Id).arg3; set { - BlockEngine.GetBlockInfo(Id)?.arg3.Set(value); + BlockEngine.GetBlockInfo(Id).arg3.Set(value); } } } diff --git a/GamecraftModdingAPI/Blocks/TextBlock.cs b/GamecraftModdingAPI/Blocks/TextBlock.cs index bd2a23b..a905a6d 100644 --- a/GamecraftModdingAPI/Blocks/TextBlock.cs +++ b/GamecraftModdingAPI/Blocks/TextBlock.cs @@ -59,16 +59,15 @@ namespace GamecraftModdingAPI.Blocks { get { - return BlockEngine.GetBlockInfo(Id)?.textCurrent ?? null; + return BlockEngine.GetBlockInfo(Id).textCurrent; } set { - TextBlockDataStruct def = default; - ref TextBlockDataStruct tbds = ref BlockEngine.GetBlockInfo(Id, ref def); + ref TextBlockDataStruct tbds = ref BlockEngine.GetBlockInfo(Id); tbds.textCurrent.Set(value); tbds.textStored.Set(value); - BlockEngine.GetBlockInfo(Id)?.newTextBlockStringContent.Set(value); + BlockEngine.GetBlockInfo(Id).newTextBlockStringContent.Set(value); } } @@ -79,13 +78,13 @@ namespace GamecraftModdingAPI.Blocks { get { - return BlockEngine.GetBlockInfo(Id)?.textBlockID ?? null; + return BlockEngine.GetBlockInfo(Id).textBlockID; } set { - BlockEngine.GetBlockInfo(Id)?.textBlockID.Set(value); - BlockEngine.GetBlockInfo(Id)?.newTextBlockID.Set(value); + BlockEngine.GetBlockInfo(Id).textBlockID.Set(value); + BlockEngine.GetBlockInfo(Id).newTextBlockID.Set(value); } } } diff --git a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs index e37a5bb..9d180ea 100644 --- a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs +++ b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs @@ -8,12 +8,14 @@ using Svelto.ECS; using RobocraftX.Blocks; using RobocraftX.Common; using RobocraftX.SimulationModeState; +using RobocraftX.FrontEnd; +using Unity.Mathematics; using GamecraftModdingAPI.Commands; using GamecraftModdingAPI.Events; using GamecraftModdingAPI.Utility; using GamecraftModdingAPI.Blocks; -using RobocraftX.FrontEnd; +using GamecraftModdingAPI.Players; namespace GamecraftModdingAPI.Tests { @@ -177,8 +179,26 @@ namespace GamecraftModdingAPI.Tests .Action(() => uREPL.Log.Output(new Player(Players.PlayerType.Local).GetBlockLookedAt()+"")).Build(); CommandBuilder.Builder("Error", "Throw an error to make sure SimpleCustomCommandEngine's wrapper catches it.") - .Action(() => { throw new Exception("Error Command always throws an error"); }) - .Build(); + .Action(() => { throw new Exception("Error Command always throws an error"); }) + .Build(); + + CommandBuilder.Builder("ColorBlock", + "Change color of the block looked at if there's any.") + .Action(str => + { + if (!Enum.TryParse(str, out BlockColors color)) + { + Logging.CommandLog("Color " + str + " not found! Interpreting as 4 color values."); + var s = str.Split(' '); + new Player(PlayerType.Local).GetBlockLookedAt().CustomColor = new float4(float.Parse(s[0]), + float.Parse(s[1]), float.Parse(s[2]), float.Parse(s[3])); + return; + } + new Player(PlayerType.Local).GetBlockLookedAt().Color = + new BlockColor {Color = color}; + Logging.CommandLog("Colored block to " + color); + + }).Build(); GameClient.SetDebugInfo("lookedAt", LookedAt); -- 2.30.2 From fb841b65426a97fca8a3e5192729e4b713af28b2 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Wed, 20 May 2020 20:42:02 -0400 Subject: [PATCH 031/252] Add Timer and spawn point block properties --- GamecraftModdingAPI/Block.cs | 10 +- GamecraftModdingAPI/Blocks/SpawnPoint.cs | 132 +++++++++++++++++++++++ GamecraftModdingAPI/Blocks/Timer.cs | 127 ++++++++++++++++++++++ 3 files changed, 268 insertions(+), 1 deletion(-) create mode 100644 GamecraftModdingAPI/Blocks/SpawnPoint.cs create mode 100644 GamecraftModdingAPI/Blocks/Timer.cs diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index 6a5b2a1..88932da 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -14,6 +14,7 @@ namespace GamecraftModdingAPI { /// /// A single (perhaps scaled) block. Properties may return default values if the block is removed and then setting them is ignored. + /// For specific block type operations, use the specialised block classes in the GamecraftModdingAPI.Blocks namespace. /// public class Block { @@ -81,7 +82,7 @@ namespace GamecraftModdingAPI DeterministicStepCompositionRootPatch.SubmitEntitiesNow(); } - public EGID Id { get; } + public EGID Id { get; protected set; } /// /// The block's current position or zero if the block no longer exists. @@ -213,6 +214,13 @@ namespace GamecraftModdingAPI GameEngineManager.AddGameEngine(BlockEngine); } + /// + /// Convert the block to a specialised block class. + /// + /// The block. + /// Force an entity sync when true. + /// Only set this to false when the block was not placed the same tick this was called. + /// The specialised block type. public T Specialise(bool sameTick = true) where T : Block { // What have I gotten myself into? diff --git a/GamecraftModdingAPI/Blocks/SpawnPoint.cs b/GamecraftModdingAPI/Blocks/SpawnPoint.cs new file mode 100644 index 0000000..8fd1fda --- /dev/null +++ b/GamecraftModdingAPI/Blocks/SpawnPoint.cs @@ -0,0 +1,132 @@ +using System; + +using RobocraftX.Blocks; +using Gamecraft.CharacterVulnerability; +using Svelto.ECS; +using Unity.Mathematics; + +using GamecraftModdingAPI; +using GamecraftModdingAPI.Utility; + +namespace GamecraftModdingAPI.Blocks +{ + public class SpawnPoint : Block + { + /// + /// Places a new spawn point. + /// Any valid spawn block type is accepted. + /// This re-implements Block.PlaceNew(...) + /// + public static new SpawnPoint PlaceNew(BlockIDs block, float3 position, + float3 rotation = default, BlockColors color = BlockColors.Default, byte darkness = 0, + int uscale = 1, float3 scale = default, Player player = null) + { + if (!(block == BlockIDs.LargeSpawn || block == BlockIDs.SmallSpawn || block == BlockIDs.MediumSpawn || block == BlockIDs.PlayerSpawn)) + { + throw new BlockTypeException($"Block is not a {typeof(SpawnPoint).Name} block"); + } + if (PlacementEngine.IsInGame && GameState.IsBuildMode()) + { + try + { + EGID id = PlacementEngine.PlaceBlock(block, color, darkness, + position, uscale, scale, player, rotation); + Sync(); + return new SpawnPoint(id); + } + catch (Exception e) + { + Logging.MetaDebugLog(e); + } + } + + return null; + } + + public SpawnPoint(EGID id) : base(id) + { + if (!BlockEngine.GetBlockInfoExists(this.Id)) + { + throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); + } + } + + public SpawnPoint(uint id) : base(id) + { + if (!BlockEngine.GetBlockInfoExists(this.Id)) + { + throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); + } + } + + // custom spawn point properties + + /// + /// The lives the player spawns in with. + /// + public uint Lives + { + get + { + return BlockEngine.GetBlockInfo(Id).lives; + } + + set + { + ref SpawnPointStatsEntityStruct spses = ref BlockEngine.GetBlockInfo(Id); + spses.lives = value; + } + } + + /// + /// Whether the spawned player can take damage. + /// + public bool Damageable + { + get + { + return BlockEngine.GetBlockInfo(Id).canTakeDamage; + } + + set + { + ref SpawnPointStatsEntityStruct spses = ref BlockEngine.GetBlockInfo(Id); + spses.canTakeDamage = value; + } + } + + /// + /// Whether the game over screen will be displayed + /// + public bool GameOverEnabled + { + get + { + return BlockEngine.GetBlockInfo(Id).gameOverScreen; + } + + set + { + ref SpawnPointStatsEntityStruct spses = ref BlockEngine.GetBlockInfo(Id); + spses.gameOverScreen = value; + } + } + + /// + /// The team id for players who spawn here. + /// + public byte Team + { + get + { + return BlockEngine.GetBlockInfo(Id).teamId; + } + + set + { + ref SpawnPointIdsEntityStruct spses = ref BlockEngine.GetBlockInfo(Id); + spses.teamId = value; + } + } + } +} diff --git a/GamecraftModdingAPI/Blocks/Timer.cs b/GamecraftModdingAPI/Blocks/Timer.cs new file mode 100644 index 0000000..b31f9f8 --- /dev/null +++ b/GamecraftModdingAPI/Blocks/Timer.cs @@ -0,0 +1,127 @@ +using System; + +using RobocraftX.Blocks; +using Gamecraft.Blocks.TimerBlock; +using Svelto.ECS; +using Unity.Mathematics; + +using GamecraftModdingAPI; +using GamecraftModdingAPI.Utility; + +namespace GamecraftModdingAPI.Blocks +{ + public class Timer : Block + { + /// + /// Places a new timer block. + /// + public static Timer PlaceNew(float3 position, + float3 rotation = default, BlockColors color = BlockColors.Default, byte darkness = 0, + int uscale = 1, float3 scale = default, Player player = null) + { + if (PlacementEngine.IsInGame && GameState.IsBuildMode()) + { + + try + { + EGID id = PlacementEngine.PlaceBlock(BlockIDs.Timer, color, darkness, + position, uscale, scale, player, rotation); + Sync(); + return new Timer(id); + } + catch (Exception e) + { + Logging.MetaDebugLog(e); + } + } + + return null; + } + + public Timer(EGID id) : base(id) + { + if (!BlockEngine.GetBlockInfoExists(this.Id)) + { + throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); + } + } + + public Timer(uint id) : base(id) + { + if (!BlockEngine.GetBlockInfoExists(this.Id)) + { + throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); + } + } + + // custom timer properties + + /// + /// The player-specified start time. + /// + public float Start + { + get + { + return BlockEngine.GetBlockInfo(Id).startTime; + } + + set + { + ref TimerBlockDataStruct tbds = ref BlockEngine.GetBlockInfo(Id); + tbds.startTime = value; + } + } + + /// + /// The player-specified end time. + /// + public float End + { + get + { + return BlockEngine.GetBlockInfo(Id).endTime; + } + + set + { + ref TimerBlockDataStruct tbds = ref BlockEngine.GetBlockInfo(Id); + tbds.endTime = value; + } + } + + /// + /// Whether to display time with millisecond precision. + /// + public bool DisplayMilliseconds + { + get + { + return BlockEngine.GetBlockInfo(Id).outputFormatHasMS; + } + + set + { + ref TimerBlockDataStruct tbds = ref BlockEngine.GetBlockInfo(Id); + tbds.outputFormatHasMS = value; + } + } + + /// + /// Current time (as of the last video frame), in milliseconds. + /// + public int CurrentTime + { + get + { + return BlockEngine.GetBlockInfo(Id).timeLastRenderFrameMS; + } + + set + { + ref TimerBlockLabelCacheEntityStruct tblces = ref BlockEngine.GetBlockInfo(Id); + tblces.timeLastRenderFrameMS = value; + } + } + } +} -- 2.30.2 From 8326d70cbf799901a1763ad9136f77a7a494f665 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Thu, 21 May 2020 15:04:55 -0400 Subject: [PATCH 032/252] Integrate tweak and signal functionality into Blocks --- GamecraftModdingAPI/Block.cs | 1 + GamecraftModdingAPI/Blocks/BlockEngine.cs | 4 +- GamecraftModdingAPI/Blocks/Motor.cs | 113 +++++ GamecraftModdingAPI/Blocks/Piston.cs | 90 ++++ GamecraftModdingAPI/Blocks/Servo.cs | 118 +++++ GamecraftModdingAPI/Blocks/SignalEngine.cs | 67 ++- GamecraftModdingAPI/Blocks/SignalingBlock.cs | 131 +++++ GamecraftModdingAPI/Blocks/Signals.cs | 177 ------- GamecraftModdingAPI/Blocks/Tweakable.cs | 98 ---- GamecraftModdingAPI/Blocks/TweakableEngine.cs | 452 ------------------ GamecraftModdingAPI/Blocks/TweakableStat.cs | 13 - GamecraftModdingAPI/Main.cs | 2 - .../Tests/GamecraftModdingAPIPluginTest.cs | 29 -- doxygen.conf | 2 +- 14 files changed, 519 insertions(+), 778 deletions(-) create mode 100644 GamecraftModdingAPI/Blocks/Motor.cs create mode 100644 GamecraftModdingAPI/Blocks/Piston.cs create mode 100644 GamecraftModdingAPI/Blocks/Servo.cs create mode 100644 GamecraftModdingAPI/Blocks/SignalingBlock.cs delete mode 100644 GamecraftModdingAPI/Blocks/Signals.cs delete mode 100644 GamecraftModdingAPI/Blocks/Tweakable.cs delete mode 100644 GamecraftModdingAPI/Blocks/TweakableEngine.cs delete mode 100644 GamecraftModdingAPI/Blocks/TweakableStat.cs diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index 88932da..1a8673a 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -23,6 +23,7 @@ namespace GamecraftModdingAPI protected static readonly RotationEngine RotationEngine = new RotationEngine(); protected static readonly RemovalEngine RemovalEngine = new RemovalEngine(); protected static readonly BlockEngine BlockEngine = new BlockEngine(); + protected static readonly SignalEngine SignalEngine = new SignalEngine(); /// /// Place a new block at the given position. If scaled, position means the center of the block. The default block size is 0.2 in terms of position. diff --git a/GamecraftModdingAPI/Blocks/BlockEngine.cs b/GamecraftModdingAPI/Blocks/BlockEngine.cs index 377fa5b..6275ca1 100644 --- a/GamecraftModdingAPI/Blocks/BlockEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlockEngine.cs @@ -74,8 +74,8 @@ namespace GamecraftModdingAPI.Blocks if (exists) return ref entitiesDB.QueryEntity(blockID); T[] structHolder = new T[1]; - ref T structRef = ref structHolder[0]; - return ref structRef; + //ref T defRef = ref structHolder[0]; + return ref structHolder[0]; } public bool BlockExists(EGID id) diff --git a/GamecraftModdingAPI/Blocks/Motor.cs b/GamecraftModdingAPI/Blocks/Motor.cs new file mode 100644 index 0000000..13a246f --- /dev/null +++ b/GamecraftModdingAPI/Blocks/Motor.cs @@ -0,0 +1,113 @@ +using System; + +using RobocraftX.Blocks; +using Svelto.ECS; +using Unity.Mathematics; + +using GamecraftModdingAPI.Utility; + +namespace GamecraftModdingAPI.Blocks +{ + public class Motor : Block + { + /// + /// Places a new motor. + /// Any valid motor type is accepted. + /// This re-implements Block.PlaceNew(...) + /// + public static new Motor PlaceNew(BlockIDs block, float3 position, + float3 rotation = default, BlockColors color = BlockColors.Default, byte darkness = 0, + int uscale = 1, float3 scale = default, Player player = null) + { + if (!(block == BlockIDs.MotorS || block == BlockIDs.MotorM)) + { + throw new BlockTypeException($"Block is not a {typeof(Motor).Name} block"); + } + if (PlacementEngine.IsInGame && GameState.IsBuildMode()) + { + try + { + EGID id = PlacementEngine.PlaceBlock(block, color, darkness, + position, uscale, scale, player, rotation); + Sync(); + return new Motor(id); + } + catch (Exception e) + { + Logging.MetaDebugLog(e); + } + } + + return null; + } + + public Motor(EGID id) : base(id) + { + if (!BlockEngine.GetBlockInfoExists(this.Id)) + { + throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); + } + } + + public Motor(uint id) : base(id) + { + if (!BlockEngine.GetBlockInfoExists(this.Id)) + { + throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); + } + } + + // custom motor properties + + /// + /// The motor's maximum rotational velocity. + /// + public float TopSpeed + { + get + { + return BlockEngine.GetBlockInfo(Id).maxVelocity; + } + + set + { + ref MotorReadOnlyStruct motor = ref BlockEngine.GetBlockInfo(Id); + motor.maxVelocity = value; + } + } + + /// + /// The motor's maximum rotational force. + /// + public float Torque + { + get + { + return BlockEngine.GetBlockInfo(Id).maxForce; + } + + set + { + ref MotorReadOnlyStruct motor = ref BlockEngine.GetBlockInfo(Id); + motor.maxForce = value; + } + } + + /// + /// The motor's direction. + /// + public bool Reverse + { + get + { + return BlockEngine.GetBlockInfo(Id).reverse; + } + + set + { + ref MotorReadOnlyStruct motor = ref BlockEngine.GetBlockInfo(Id); + motor.reverse = value; + } + } + } +} diff --git a/GamecraftModdingAPI/Blocks/Piston.cs b/GamecraftModdingAPI/Blocks/Piston.cs new file mode 100644 index 0000000..1e69df6 --- /dev/null +++ b/GamecraftModdingAPI/Blocks/Piston.cs @@ -0,0 +1,90 @@ +using System; + +using RobocraftX.Blocks; +using Svelto.ECS; +using Unity.Mathematics; + +using GamecraftModdingAPI.Utility; + +namespace GamecraftModdingAPI.Blocks +{ + public class Piston : Block + { + /// + /// Places a new piston. + /// Any valid piston type is accepted. + /// This re-implements Block.PlaceNew(...) + /// + public static new Piston PlaceNew(BlockIDs block, float3 position, + float3 rotation = default, BlockColors color = BlockColors.Default, byte darkness = 0, + int uscale = 1, float3 scale = default, Player player = null) + { + if (!(block == BlockIDs.ServoPiston || block == BlockIDs.StepperPiston || block == BlockIDs.PneumaticPiston)) + { + throw new BlockTypeException($"Block is not a {typeof(Piston).Name} block"); + } + if (PlacementEngine.IsInGame && GameState.IsBuildMode()) + { + try + { + EGID id = PlacementEngine.PlaceBlock(block, color, darkness, + position, uscale, scale, player, rotation); + Sync(); + return new Piston(id); + } + catch (Exception e) + { + Logging.MetaDebugLog(e); + } + } + + return null; + } + + public Piston(EGID id) : base(id) + { + if (!BlockEngine.GetBlockInfoExists(this.Id)) + { + throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); + } + } + + public Piston(uint id) : base(id) + { + if (!BlockEngine.GetBlockInfoExists(this.Id)) + { + throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); + } + } + + // custom piston properties + + /// + /// The piston's max extension distance. + /// + public float MaximumExtension + { + get => BlockEngine.GetBlockInfo(Id).maxDeviation; + + set + { + ref PistonReadOnlyStruct piston = ref BlockEngine.GetBlockInfo(Id); + piston.maxDeviation = value; + } + } + + /// + /// The piston's max extension force. + /// + public float MaximumForce + { + get => BlockEngine.GetBlockInfo(Id).maxForce; + + set + { + ref PistonReadOnlyStruct piston = ref BlockEngine.GetBlockInfo(Id); + piston.maxForce = value; + } + } + } +} diff --git a/GamecraftModdingAPI/Blocks/Servo.cs b/GamecraftModdingAPI/Blocks/Servo.cs new file mode 100644 index 0000000..1c22d0b --- /dev/null +++ b/GamecraftModdingAPI/Blocks/Servo.cs @@ -0,0 +1,118 @@ +using System; + +using RobocraftX.Blocks; +using Svelto.ECS; +using Unity.Mathematics; + +using GamecraftModdingAPI.Utility; + +namespace GamecraftModdingAPI.Blocks +{ + public class Servo : Block + { + /// + /// Places a new servo. + /// Any valid servo type is accepted. + /// This re-implements Block.PlaceNew(...) + /// + public static new Servo PlaceNew(BlockIDs block, float3 position, + float3 rotation = default, BlockColors color = BlockColors.Default, byte darkness = 0, + int uscale = 1, float3 scale = default, Player player = null) + { + if (!(block == BlockIDs.ServoAxle || block == BlockIDs.ServoHinge || block == BlockIDs.ServoPiston)) + { + throw new BlockTypeException($"Block is not a {typeof(Servo).Name} block"); + } + if (PlacementEngine.IsInGame && GameState.IsBuildMode()) + { + try + { + EGID id = PlacementEngine.PlaceBlock(block, color, darkness, + position, uscale, scale, player, rotation); + Sync(); + return new Servo(id); + } + catch (Exception e) + { + Logging.MetaDebugLog(e); + } + } + + return null; + } + + public Servo(EGID id) : base(id) + { + if (!BlockEngine.GetBlockInfoExists(this.Id)) + { + throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); + } + } + + public Servo(uint id) : base(id) + { + if (!BlockEngine.GetBlockInfoExists(this.Id)) + { + throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); + } + } + + // custom servo properties + + /// + /// The servo's minimum angle. + /// + public float MinimumAngle + { + get => BlockEngine.GetBlockInfo(Id).minDeviation; + + set + { + ref ServoReadOnlyStruct servo = ref BlockEngine.GetBlockInfo(Id); + servo.minDeviation = value; + } + } + + /// + /// The servo's maximum angle. + /// + public float MaximumAngle + { + get => BlockEngine.GetBlockInfo(Id).maxDeviation; + + set + { + ref ServoReadOnlyStruct servo = ref BlockEngine.GetBlockInfo(Id); + servo.maxDeviation = value; + } + } + + /// + /// The servo's maximum force. + /// + public float MaximumForce + { + get => BlockEngine.GetBlockInfo(Id).maxForce; + + set + { + ref ServoReadOnlyStruct servo = ref BlockEngine.GetBlockInfo(Id); + servo.maxForce = value; + } + } + + /// + /// The servo's direction. + /// + public bool Reverse + { + get => BlockEngine.GetBlockInfo(Id).reverse; + + set + { + ref ServoReadOnlyStruct servo = ref BlockEngine.GetBlockInfo(Id); + servo.reverse = value; + } + } + } +} diff --git a/GamecraftModdingAPI/Blocks/SignalEngine.cs b/GamecraftModdingAPI/Blocks/SignalEngine.cs index 90343e2..36716af 100644 --- a/GamecraftModdingAPI/Blocks/SignalEngine.cs +++ b/GamecraftModdingAPI/Blocks/SignalEngine.cs @@ -10,6 +10,11 @@ namespace GamecraftModdingAPI.Blocks /// public class SignalEngine : IApiEngine { + public const float POSITIVE_HIGH = 1.0f; + public const float NEGATIVE_HIGH = -1.0f; + public const float HIGH = 1.0f; + public const float ZERO = 0.0f; + public string Name { get; } = "GamecraftModdingAPISignalGameEngine"; public EntitiesDB entitiesDB { set; private get; } @@ -58,13 +63,13 @@ namespace GamecraftModdingAPI.Blocks channelData.valueAsFloat += signal; if (clamp) { - if (channelData.valueAsFloat > Signals.POSITIVE_HIGH) + if (channelData.valueAsFloat > POSITIVE_HIGH) { - channelData.valueAsFloat = Signals.POSITIVE_HIGH; + channelData.valueAsFloat = POSITIVE_HIGH; } - else if (channelData.valueAsFloat < Signals.NEGATIVE_HIGH) + else if (channelData.valueAsFloat < NEGATIVE_HIGH) { - channelData.valueAsFloat = Signals.NEGATIVE_HIGH; + channelData.valueAsFloat = NEGATIVE_HIGH; } return channelData.valueAsFloat; @@ -106,6 +111,60 @@ namespace GamecraftModdingAPI.Blocks return signals; } + public EGID[] GetSignalInputs(EGID blockID) + { + BlockPortsStruct ports = entitiesDB.QueryEntity(blockID); + EGID[] inputs = new EGID[ports.inputCount]; + for (uint i = 0; i < ports.inputCount; i++) + { + inputs[i] = new EGID(i + ports.firstInputID, NamedExclusiveGroup.Group); + } + return inputs; + } + + public EGID[] GetSignalOutputs(EGID blockID) + { + BlockPortsStruct ports = entitiesDB.QueryEntity(blockID); + EGID[] outputs = new EGID[ports.outputCount]; + for (uint i = 0; i < ports.outputCount; i++) + { + outputs[i] = new EGID(i + ports.firstOutputID, NamedExclusiveGroup.Group); + } + return outputs; + } + + public ref WireEntityStruct MatchPortToWire(EGID portID, EGID blockID, out bool exists) + { + ref PortEntityStruct port = ref entitiesDB.QueryEntity(portID); + WireEntityStruct[] wires = entitiesDB.QueryEntities(NamedExclusiveGroup.Group).ToFastAccess(out uint count); + for (uint i = 0; i < count; i++) + { + if ((wires[i].destinationPortUsage == port.usage && wires[i].destinationBlockEGID == blockID) + || (wires[i].sourcePortUsage == port.usage && wires[i].sourceBlockEGID == blockID)) + { + exists = true; + return ref wires[i]; + } + } + exists = false; + WireEntityStruct[] defRef = new WireEntityStruct[1]; + return ref defRef[0]; + } + + public ref ChannelDataStruct GetChannelDataStruct(EGID portID, out bool exists) + { + ref PortEntityStruct port = ref entitiesDB.QueryEntity(portID); + ChannelDataStruct[] channels = entitiesDB.QueryEntities(NamedExclusiveGroup.Group).ToFastAccess(out uint count); + if (port.firstChannelIndexCachedInSim < count) + { + exists = true; + return ref channels[port.firstChannelIndexCachedInSim]; + } + exists = false; + ChannelDataStruct[] defRef = new ChannelDataStruct[1]; + return ref defRef[0]; + } + public EGID[] GetElectricBlocks() { uint count = entitiesDB.Count(BlockIdentifiers.OWNED_BLOCKS) + entitiesDB.Count(BlockIdentifiers.FUNCTIONAL_BLOCK_PARTS); diff --git a/GamecraftModdingAPI/Blocks/SignalingBlock.cs b/GamecraftModdingAPI/Blocks/SignalingBlock.cs new file mode 100644 index 0000000..d654ca9 --- /dev/null +++ b/GamecraftModdingAPI/Blocks/SignalingBlock.cs @@ -0,0 +1,131 @@ +using System; + +using Gamecraft.Wires; +using Svelto.ECS; +using Unity.Mathematics; + +using GamecraftModdingAPI; +using GamecraftModdingAPI.Utility; + +namespace GamecraftModdingAPI.Blocks +{ + /// + /// Common implementation for blocks that support wiring. + /// + public class SignalingBlock : Block + { + /// + /// Places a new signaling block. + /// Any valid functional block type with IO ports will work. + /// This re-implements Block.PlaceNew(...) + /// + public static new SignalingBlock PlaceNew(BlockIDs block, float3 position, + float3 rotation = default, BlockColors color = BlockColors.Default, byte darkness = 0, + int uscale = 1, float3 scale = default, Player player = null) + { + if (PlacementEngine.IsInGame && GameState.IsBuildMode()) + { + try + { + EGID id = PlacementEngine.PlaceBlock(block, color, darkness, + position, uscale, scale, player, rotation); + Sync(); + return new SignalingBlock(id); + } + catch (Exception e) + { + Logging.MetaDebugLog(e); + } + } + + return null; + } + + public SignalingBlock(EGID id) : base(id) + { + if (!BlockEngine.GetBlockInfoExists(this.Id)) + { + throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); + } + } + + public SignalingBlock(uint id) : base(id) + { + if (!BlockEngine.GetBlockInfoExists(this.Id)) + { + throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); + } + } + + protected ref BlockPortsStruct GetBlockPortsStruct() + { + return ref BlockEngine.GetBlockInfo(Id); + } + + /// + /// Generates the input port identifiers. + /// + /// The input identifiers. + protected EGID[] GetInputIds() + { + return SignalEngine.GetSignalInputs(Id); + } + + /// + /// Generates the output port identifiers. + /// + /// The output identifiers. + protected EGID[] GetOutputIds() + { + return SignalEngine.GetSignalOutputs(Id); + } + + /// + /// Gets the port struct. + /// + /// The port struct. + /// Port identifier. + protected ref PortEntityStruct GetPortStruct(EGID portId) + { + return ref BlockEngine.GetBlockInfo(portId); + } + + /// + /// Gets the connected wire. + /// + /// The connected wire. + /// Port identifier. + /// Whether the port has a wire connected to it. + protected ref WireEntityStruct GetConnectedWire(EGID portId, out bool connected) + { + return ref SignalEngine.MatchPortToWire(portId, Id, out connected); + } + + /// + /// [EXPERIMENTAL] Gets the channel data. + /// + /// The channel data. + /// Port identifier. + /// Whether the channel actually exists. + protected ref ChannelDataStruct GetChannelData(EGID portId, out bool exists) + { + return ref SignalEngine.GetChannelDataStruct(portId, out exists); + } + + /// + /// The input port count. + /// + public uint InputCount + { + get => GetBlockPortsStruct().inputCount; + } + + /// + /// The output port count. + /// + public uint OutputCount + { + get => GetBlockPortsStruct().outputCount; + } + } +} diff --git a/GamecraftModdingAPI/Blocks/Signals.cs b/GamecraftModdingAPI/Blocks/Signals.cs deleted file mode 100644 index 6adf670..0000000 --- a/GamecraftModdingAPI/Blocks/Signals.cs +++ /dev/null @@ -1,177 +0,0 @@ -using Svelto.ECS; - -using GamecraftModdingAPI.Utility; - -namespace GamecraftModdingAPI.Blocks -{ - /// - /// [EXPERIMENTAL] Common block signal operations - /// The functionality in this class only works when in a game. - /// - public static class Signals - { - // Signal constants - public static readonly float HIGH = 1.0f; - public static readonly float POSITIVE_HIGH = HIGH; - public static readonly float NEGATIVE_HIGH = -1.0f; - public static readonly float LOW = 0.0f; - - private static SignalEngine signalEngine = new SignalEngine(); - - /// - /// Set the electric block's (first) signal value. - /// - /// The block's id. - /// The signal value (-1 to 1; not enforced). - /// Whether to retrieve input IDs (true) or output IDs (false). - /// Whether the block is in the owned group (true) or functional group (false) - public static void SetSignalByBlock(uint blockID, float signal, bool input = true, bool owned = true) - { - EGID egid = new EGID(blockID, owned ? BlockIdentifiers.OWNED_BLOCKS : BlockIdentifiers.FUNCTIONAL_BLOCK_PARTS); - if (signalEngine.IsInGame && GameState.IsSimulationMode()) - { - signalEngine.SetSignal(egid, signal, out uint _, input); - } - } - - public static void SetSignalByBlock(EGID blockID, float signal, bool input = true) - { - if (signalEngine.IsInGame && GameState.IsSimulationMode()) - { - signalEngine.SetSignal(blockID, signal, out uint _, input); - } - } - - /// - /// Set the signal's value. - /// - /// The channel cluster's id. - /// The signal value (-1 to 1; not enforced). - /// Whether to retrieve input IDs (true) or output IDs (false). - public static void SetSignalByID(uint signalID, float signal, bool input = true) - { - if (signalEngine.IsInGame && GamecraftModdingAPI.Utility.GameState.IsSimulationMode()) - { - signalEngine.SetSignal(signalID, signal, input); - } - } - - /// - /// Add a value to an electric block's signal. - /// - /// The block's id. - /// The signal value to add. - /// Whether to clamp the resulting signal value between -1 and 1. - /// Whether to retrieve input IDs (true) or output IDs (false). - /// Whether the block is in the owned group (true) or functional group (false) - /// The signal's new value. - public static float AddSignalByBlock(uint blockID, float signal, bool clamp = true, bool input = true, bool owned = true) - { - EGID egid = new EGID(blockID, owned ? BlockIdentifiers.OWNED_BLOCKS : BlockIdentifiers.FUNCTIONAL_BLOCK_PARTS); - if (signalEngine.IsInGame && GamecraftModdingAPI.Utility.GameState.IsSimulationMode()) - { - return signalEngine.AddSignal(egid, signal, out uint _, clamp, input); - } - return 0f; - } - - public static float AddSignalByBlock(EGID blockID, float signal, bool clamp = true, bool input = true) - { - if (signalEngine.IsInGame && GamecraftModdingAPI.Utility.GameState.IsSimulationMode()) - { - return signalEngine.AddSignal(blockID, signal, out uint _, clamp, input); - } - return 0f; - } - - /// - /// Add a value to a conductive cluster channel. - /// - /// The channel cluster's id. - /// The signal value to add. - /// Whether to clamp the resulting signal value between -1 and 1. - /// Whether to retrieve input IDs (true) or output IDs (false). - /// The signal's new value. - public static float AddSignalByID(uint signalID, float signal, bool clamp = true, bool input = true) - { - if (signalEngine.IsInGame && GamecraftModdingAPI.Utility.GameState.IsSimulationMode()) - { - return signalEngine.AddSignal(signalID, signal, clamp, input); - } - return 0f; - } - - /// - /// Get a electric block's signal's (first) value. - /// - /// The block's id. - /// Whether to retrieve input IDs (true) or output IDs (false). - /// Whether the block is in the owned group (true) or functional group (false) - /// The signal's value. - public static float GetSignalByBlock(uint blockID, bool input = true, bool owned = true) - { - EGID egid = new EGID(blockID, owned? BlockIdentifiers.OWNED_BLOCKS : BlockIdentifiers.FUNCTIONAL_BLOCK_PARTS); - if (signalEngine.IsInGame && GamecraftModdingAPI.Utility.GameState.IsSimulationMode()) - { - return signalEngine.GetSignal(egid, out uint _, input); - } - return 0f; - } - - public static float GetSignalByBlock(EGID blockID, bool input = true) - { - if (signalEngine.IsInGame && GamecraftModdingAPI.Utility.GameState.IsSimulationMode()) - { - return signalEngine.GetSignal(blockID, out uint _, input); - } - return 0f; - } - - /// - /// Get a signal's value. - /// - /// The signal's id. - /// Whether to retrieve input IDs (true) or output IDs (false). - /// The signal's value. - public static float GetSignalByID(uint signalID, bool input = true) - { - if (signalEngine.IsInGame && GamecraftModdingAPI.Utility.GameState.IsSimulationMode()) - { - return signalEngine.GetSignal(signalID, input); - } - return 0f; - } - - /// - /// Get the ID of every electric block in the game world. - /// - /// The block IDs. - public static EGID[] GetElectricBlocks() - { - return signalEngine.GetElectricBlocks(); - } - - /// - /// Get the unique identifiers for the input wires connected to an electric block. - /// - /// The block's id. - /// Whether to retrieve input IDs (true) or output IDs (false). - /// Whether the block is in the owned group (true) or functional group (false) - /// The unique IDs. - public static uint[] GetSignalIDs(uint blockID, bool input = true, bool owned = true) - { - EGID egid = new EGID(blockID, owned ? BlockIdentifiers.OWNED_BLOCKS : BlockIdentifiers.FUNCTIONAL_BLOCK_PARTS); - return signalEngine.GetSignalIDs(egid, input); - } - - public static uint[] GetSignalIDs(EGID blockID, bool input = true, bool owned = true) - { - return signalEngine.GetSignalIDs(blockID, input); - } - - public static void Init() - { - GameEngineManager.AddGameEngine(signalEngine); - } - } -} diff --git a/GamecraftModdingAPI/Blocks/Tweakable.cs b/GamecraftModdingAPI/Blocks/Tweakable.cs deleted file mode 100644 index 6405ac3..0000000 --- a/GamecraftModdingAPI/Blocks/Tweakable.cs +++ /dev/null @@ -1,98 +0,0 @@ -namespace GamecraftModdingAPI.Blocks -{ - /// - /// Common tweakable stats operations. - /// The functionality of this class works best in build mode. - /// - public static class Tweakable - { - private static TweakableEngine tweakableEngine = new TweakableEngine(); - - /// - /// Get the tweakable stat's value using a dynamic variable type. - /// This is similar to GetStat but without strong type enforcement. - /// This should be used in dynamically-typed languages like Python. - /// - /// The stat's value. - /// The block's id. - /// The stat's enumerated id. - public static dynamic GetStatD(uint blockID, TweakableStat stat) - { - return tweakableEngine.GetStatDynamic(blockID, stat); - } - - /// - /// Get the tweakable stat's value. - /// If T is not the same type as the stat, an InvalidCastException will be thrown. - /// - /// The stat's value. - /// The block's id. - /// The stat's enumerated id. - /// The stat's type. - public static T GetStat(uint blockID, TweakableStat stat) - { - return tweakableEngine.GetStatAny(blockID, stat); - } - - /// - /// Set the tweakable stat's value using dynamically-typed variables. - /// This is similar to SetStat but without strong type enforcement. - /// This should be used in dynamically-typed languages like Python. - /// - /// The stat's new value. - /// The block's id. - /// The stat's enumerated id. - /// The stat's new value. - public static dynamic SetStatD(uint blockID, TweakableStat stat, dynamic value) - { - return tweakableEngine.SetStatDynamic(blockID, stat, value); - } - - /// - /// Set the tweakable stat's value. - /// If T is not the stat's actual type, an InvalidCastException will be thrown. - /// - /// The stat's new value. - /// The block's id. - /// The stat's enumerated id. - /// The stat's new value. - /// The stat's type. - public static T SetStat(uint blockID, TweakableStat stat, T value) - { - return tweakableEngine.SetStatAny(blockID, stat, value); - } - - /// - /// Add another value to the tweakable stat's value using dynamically-typed variables. - /// This is similar to AddStat but without strong type enforcement. - /// This should be used in dynamically-typed languages like Python. - /// - /// The stat's new value. - /// The block's id. - /// The stat's enumerated id. - /// The value to be added to the stat. - public static dynamic AddStatD(uint blockID, TweakableStat stat, dynamic value) - { - return tweakableEngine.AddStatDynamic(blockID, stat, value); - } - - /// - /// Add another value to the tweakable stat's value. - /// If T is not the stat's actual type, an InvalidCastException will be thrown. - /// - /// The stat's new value. - /// The block's id. - /// The stat's enumerated id. - /// The value to be added to the stat. - /// The stat's type. - public static T AddStat(uint blockID, TweakableStat stat, T value) - { - return tweakableEngine.AddStatAny(blockID, stat, value); - } - - public static void Init() - { - GamecraftModdingAPI.Utility.GameEngineManager.AddGameEngine(tweakableEngine); - } - } -} diff --git a/GamecraftModdingAPI/Blocks/TweakableEngine.cs b/GamecraftModdingAPI/Blocks/TweakableEngine.cs deleted file mode 100644 index 36ace8a..0000000 --- a/GamecraftModdingAPI/Blocks/TweakableEngine.cs +++ /dev/null @@ -1,452 +0,0 @@ -using RobocraftX.Blocks; -using Gamecraft.Wires; -using Svelto.ECS; - -using GamecraftModdingAPI.Engines; - - -namespace GamecraftModdingAPI.Blocks -{ - public class TweakableEngine : IApiEngine - { - public string Name { get; } = "GamecraftModdingAPITweakableGameEngine"; - - public EntitiesDB entitiesDB { set; private get; } - - public bool isRemovable => false; - - public bool IsInGame = false; - - public void Dispose() - { - IsInGame = false; - } - - public void Ready() - { - IsInGame = true; - } - - // Implementations for Tweakable static class - - public T GetStatAny(EGID blockID, TweakableStat stat) - { - switch (stat) - { - case TweakableStat.TopSpeed: - if (entitiesDB.Exists(blockID)) - { - return (T)(object)entitiesDB.QueryEntity(blockID).maxVelocity; - } - break; - case TweakableStat.Torque: - if (entitiesDB.Exists(blockID)) - { - return (T)(object)entitiesDB.QueryEntity(blockID).maxForce; - } - break; - case TweakableStat.MaxExtension: - if (entitiesDB.Exists(blockID)) - { - return (T)(object)entitiesDB.QueryEntity(blockID).maxDeviation; - } - break; - case TweakableStat.MinAngle: - if (entitiesDB.Exists(blockID)) - { - return (T)(object)entitiesDB.QueryEntity(blockID).minDeviation; - } - break; - case TweakableStat.MaxAngle: - if (entitiesDB.Exists(blockID)) - { - return (T)(object)entitiesDB.QueryEntity(blockID).maxDeviation; - } - break; - case TweakableStat.Reverse: - if (entitiesDB.Exists(blockID)) - { - return (T)(object)entitiesDB.QueryEntity(blockID).reverse; - } - else if (entitiesDB.Exists(blockID)) - { - return (T)(object)entitiesDB.QueryEntity(blockID).reverse; - } - break; - case TweakableStat.StartValue: - if (entitiesDB.Exists(blockID)) - { - return (T)(object)entitiesDB.QueryEntity(blockID).startValue; - } - break; - } - return default(T); - } - - public T GetStatAny(uint blockID, TweakableStat stat) - { - return GetStatAny(new EGID(blockID, BlockIdentifiers.OWNED_BLOCKS), stat); - } - - public dynamic GetStatDynamic(EGID blockID, TweakableStat stat) - { - switch (stat) - { - case TweakableStat.TopSpeed: - if (entitiesDB.Exists(blockID)) - { - return entitiesDB.QueryEntity(blockID).maxVelocity; - } - break; - case TweakableStat.Torque: - if (entitiesDB.Exists(blockID)) - { - return entitiesDB.QueryEntity(blockID).maxForce; - } - break; - case TweakableStat.MaxExtension: - if (entitiesDB.Exists(blockID)) - { - return entitiesDB.QueryEntity(blockID).maxDeviation; - } - break; - case TweakableStat.MinAngle: - if (entitiesDB.Exists(blockID)) - { - return entitiesDB.QueryEntity(blockID).minDeviation; - } - break; - case TweakableStat.MaxAngle: - if (entitiesDB.Exists(blockID)) - { - return entitiesDB.QueryEntity(blockID).maxDeviation; - } - break; - case TweakableStat.Reverse: - if (entitiesDB.Exists(blockID)) - { - return entitiesDB.QueryEntity(blockID).reverse; - } - else if (entitiesDB.Exists(blockID)) - { - return entitiesDB.QueryEntity(blockID).reverse; - } - break; - case TweakableStat.StartValue: - if (entitiesDB.Exists(blockID)) - { - return entitiesDB.QueryEntity(blockID).startValue; - } - break; - } - return null; - } - - public dynamic GetStatDynamic(uint blockID, TweakableStat stat) - { - return GetStatDynamic(new EGID(blockID, BlockIdentifiers.OWNED_BLOCKS), stat); - } - - public T SetStatAny(EGID blockID, TweakableStat stat, T value) - { - switch (stat) - { - case TweakableStat.TopSpeed: - if (entitiesDB.Exists(blockID)) - { - ref MotorReadOnlyStruct refStruct = ref entitiesDB.QueryEntity(blockID); - refStruct.maxVelocity = (float)(object)value; - return (T)(object)refStruct.maxVelocity; - } - break; - case TweakableStat.Torque: - if (entitiesDB.Exists(blockID)) - { - ref MotorReadOnlyStruct refStruct = ref entitiesDB.QueryEntity(blockID); - refStruct.maxForce = (float)(object)value; - return (T)(object)refStruct.maxForce; - } - break; - case TweakableStat.MaxExtension: - if (entitiesDB.Exists(blockID)) - { - ref PistonReadOnlyStruct refStruct = ref entitiesDB.QueryEntity(blockID); - refStruct.maxDeviation = (float)(object)value; - return (T)(object)refStruct.maxDeviation; - } - break; - case TweakableStat.MinAngle: - if (entitiesDB.Exists(blockID)) - { - ref ServoReadOnlyStruct refStruct = ref entitiesDB.QueryEntity(blockID); - refStruct.minDeviation = (float)(object)value; - return (T)(object)refStruct.minDeviation; - } - break; - case TweakableStat.MaxAngle: - if (entitiesDB.Exists(blockID)) - { - ref ServoReadOnlyStruct refStruct = ref entitiesDB.QueryEntity(blockID); - refStruct.maxDeviation = (float)(object)value; - return (T)(object)refStruct.maxDeviation; - } - break; - case TweakableStat.Reverse: - if (entitiesDB.Exists(blockID)) - { - ref MotorReadOnlyStruct refStruct = ref entitiesDB.QueryEntity(blockID); - refStruct.reverse = (bool)(object)value; - return (T)(object)refStruct.reverse; - } - else if (entitiesDB.Exists(blockID)) - { - ref ServoReadOnlyStruct refStruct = ref entitiesDB.QueryEntity(blockID); - refStruct.reverse = (bool)(object)value; - return (T)(object)refStruct.reverse; - } - break; - case TweakableStat.StartValue: - if (entitiesDB.Exists(blockID)) - { - ref SignalGeneratorEntityStruct refStruct = ref entitiesDB.QueryEntity(blockID); - refStruct.startValue = (float)(object)value; - return (T)(object)refStruct.startValue; - } - break; - } - return default(T); - } - - public T SetStatAny(uint blockID, TweakableStat stat, T value) - { - return SetStatAny(new EGID(blockID, BlockIdentifiers.OWNED_BLOCKS), stat, value); - } - - public dynamic SetStatDynamic(EGID blockID, TweakableStat stat, dynamic value) - { - switch (stat) - { - case TweakableStat.TopSpeed: - if (entitiesDB.Exists(blockID)) - { - ref MotorReadOnlyStruct refStruct = ref entitiesDB.QueryEntity(blockID); - refStruct.maxVelocity = value; - return refStruct.maxVelocity; - } - break; - case TweakableStat.Torque: - if (entitiesDB.Exists(blockID)) - { - ref MotorReadOnlyStruct refStruct = ref entitiesDB.QueryEntity(blockID); - refStruct.maxForce = value; - return refStruct.maxForce; - } - break; - case TweakableStat.MaxExtension: - if (entitiesDB.Exists(blockID)) - { - ref PistonReadOnlyStruct refStruct = ref entitiesDB.QueryEntity(blockID); - refStruct.maxDeviation = value; - return refStruct.maxDeviation; - } - break; - case TweakableStat.MinAngle: - if (entitiesDB.Exists(blockID)) - { - ref ServoReadOnlyStruct refStruct = ref entitiesDB.QueryEntity(blockID); - refStruct.minDeviation = value; - return refStruct.minDeviation; - } - break; - case TweakableStat.MaxAngle: - if (entitiesDB.Exists(blockID)) - { - ref ServoReadOnlyStruct refStruct = ref entitiesDB.QueryEntity(blockID); - refStruct.maxDeviation = value; - return refStruct.maxDeviation; - } - break; - case TweakableStat.Reverse: - if (entitiesDB.Exists(blockID)) - { - ref MotorReadOnlyStruct refStruct = ref entitiesDB.QueryEntity(blockID); - refStruct.reverse = value; - return refStruct.reverse; - } - else if (entitiesDB.Exists(blockID)) - { - ref ServoReadOnlyStruct refStruct = ref entitiesDB.QueryEntity(blockID); - refStruct.reverse = value; - return refStruct.reverse; - } - break; - case TweakableStat.StartValue: - if (entitiesDB.Exists(blockID)) - { - ref SignalGeneratorEntityStruct refStruct = ref entitiesDB.QueryEntity(blockID); - refStruct.startValue = value; - return refStruct.startValue; - } - break; - } - return null; - } - - public dynamic SetStatDynamic(uint blockID, TweakableStat stat, dynamic value) - { - return SetStatDynamic(new EGID(blockID, BlockIdentifiers.OWNED_BLOCKS), stat, value); - } - - public T AddStatAny(EGID blockID, TweakableStat stat, T value) - { - switch (stat) - { - case TweakableStat.TopSpeed: - if (entitiesDB.Exists(blockID)) - { - ref MotorReadOnlyStruct refStruct = ref entitiesDB.QueryEntity(blockID); - refStruct.maxVelocity += (float)(object)value; - return (T)(object)refStruct.maxVelocity; - } - break; - case TweakableStat.Torque: - if (entitiesDB.Exists(blockID)) - { - ref MotorReadOnlyStruct refStruct = ref entitiesDB.QueryEntity(blockID); - refStruct.maxForce += (float)(object)value; - return (T)(object)refStruct.maxForce; - } - break; - case TweakableStat.MaxExtension: - if (entitiesDB.Exists(blockID)) - { - ref PistonReadOnlyStruct refStruct = ref entitiesDB.QueryEntity(blockID); - refStruct.maxDeviation += (float)(object)value; - return (T)(object)refStruct.maxDeviation; - } - break; - case TweakableStat.MinAngle: - if (entitiesDB.Exists(blockID)) - { - ref ServoReadOnlyStruct refStruct = ref entitiesDB.QueryEntity(blockID); - refStruct.minDeviation += (float)(object)value; - return (T)(object)refStruct.minDeviation; - } - break; - case TweakableStat.MaxAngle: - if (entitiesDB.Exists(blockID)) - { - ref ServoReadOnlyStruct refStruct = ref entitiesDB.QueryEntity(blockID); - refStruct.maxDeviation += (float)(object)value; - return (T)(object)refStruct.maxDeviation; - } - break; - case TweakableStat.Reverse: - // '+' is associated with logical OR in some fields, so it technically isn't invalid to "add" booleans - if (entitiesDB.Exists(blockID)) - { - ref MotorReadOnlyStruct refStruct = ref entitiesDB.QueryEntity(blockID); - refStruct.reverse = refStruct.reverse || (bool)(object)value; - return (T)(object)refStruct.reverse; - } - else if (entitiesDB.Exists(blockID)) - { - ref ServoReadOnlyStruct refStruct = ref entitiesDB.QueryEntity(blockID); - refStruct.reverse = refStruct.reverse || (bool)(object)value; - return (T)(object)refStruct.reverse; - } - break; - case TweakableStat.StartValue: - if (entitiesDB.Exists(blockID)) - { - ref SignalGeneratorEntityStruct refStruct = ref entitiesDB.QueryEntity(blockID); - refStruct.startValue += (float)(object)value; - return (T)(object)refStruct.startValue; - } - break; - } - return default(T); - } - - public T AddStatAny(uint blockID, TweakableStat stat, T value) - { - return AddStatAny(new EGID(blockID, BlockIdentifiers.OWNED_BLOCKS), stat, value); - } - - public dynamic AddStatDynamic(EGID blockID, TweakableStat stat, dynamic value) - { - switch (stat) - { - case TweakableStat.TopSpeed: - if (entitiesDB.Exists(blockID)) - { - ref MotorReadOnlyStruct refStruct = ref entitiesDB.QueryEntity(blockID); - refStruct.maxVelocity += value; - return refStruct.maxVelocity; - } - break; - case TweakableStat.Torque: - if (entitiesDB.Exists(blockID)) - { - ref MotorReadOnlyStruct refStruct = ref entitiesDB.QueryEntity(blockID); - refStruct.maxForce += value; - return refStruct.maxForce; - } - break; - case TweakableStat.MaxExtension: - if (entitiesDB.Exists(blockID)) - { - ref PistonReadOnlyStruct refStruct = ref entitiesDB.QueryEntity(blockID); - refStruct.maxDeviation += value; - return refStruct.maxDeviation; - } - break; - case TweakableStat.MinAngle: - if (entitiesDB.Exists(blockID)) - { - ref ServoReadOnlyStruct refStruct = ref entitiesDB.QueryEntity(blockID); - refStruct.minDeviation += value; - return refStruct.minDeviation; - } - break; - case TweakableStat.MaxAngle: - if (entitiesDB.Exists(blockID)) - { - ref ServoReadOnlyStruct refStruct = ref entitiesDB.QueryEntity(blockID); - refStruct.maxDeviation += value; - return refStruct.maxDeviation; - } - break; - case TweakableStat.Reverse: - // '+' is associated with logical OR in some fields, so it technically isn't invalid to "add" booleans - if (entitiesDB.Exists(blockID)) - { - ref MotorReadOnlyStruct refStruct = ref entitiesDB.QueryEntity(blockID); - refStruct.reverse = refStruct.reverse || value; - return refStruct.reverse; - } - else if (entitiesDB.Exists(blockID)) - { - ref ServoReadOnlyStruct refStruct = ref entitiesDB.QueryEntity(blockID); - refStruct.reverse = refStruct.reverse || value; - return refStruct.reverse; - } - break; - case TweakableStat.StartValue: - if (entitiesDB.Exists(blockID)) - { - ref SignalGeneratorEntityStruct refStruct = ref entitiesDB.QueryEntity(blockID); - refStruct.startValue += value; - return refStruct.startValue; - } - break; - } - return null; - } - - public dynamic AddStatDynamic(uint blockID, TweakableStat stat, dynamic value) - { - return AddStatDynamic(new EGID(blockID, BlockIdentifiers.OWNED_BLOCKS), stat, value); - } - } -} diff --git a/GamecraftModdingAPI/Blocks/TweakableStat.cs b/GamecraftModdingAPI/Blocks/TweakableStat.cs deleted file mode 100644 index 228c89d..0000000 --- a/GamecraftModdingAPI/Blocks/TweakableStat.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace GamecraftModdingAPI.Blocks -{ - public enum TweakableStat - { - TopSpeed, // MotorReadOnlyStruct - Torque, // MotorReadOnlyStruct - MaxExtension, // PistonReadOnlyStruct - MinAngle, // ServoReadOnlyStruct - MaxAngle, // ServoReadOnlyStruct - Reverse, // MotorReadOnlyStruct or ServoReadOnlyStruct - StartValue, // SignalGeneratorEntityStruct - } -} diff --git a/GamecraftModdingAPI/Main.cs b/GamecraftModdingAPI/Main.cs index 5a65baf..56f481f 100644 --- a/GamecraftModdingAPI/Main.cs +++ b/GamecraftModdingAPI/Main.cs @@ -63,8 +63,6 @@ namespace GamecraftModdingAPI EventManager.AddEventEmitter(GameHostTransitionDeterministicGroupEnginePatch.simEngine); // init block implementors Logging.MetaDebugLog($"Initializing Blocks"); - Blocks.Signals.Init(); - Blocks.Tweakable.Init(); // init inventory Inventory.Hotbar.Init(); // init input diff --git a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs index 9d180ea..8576f97 100644 --- a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs +++ b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs @@ -146,35 +146,6 @@ namespace GamecraftModdingAPI.Tests .Action((float x, float y, float z) => { Block.PlaceNew(Blocks.BlockIDs.AluminiumCube, new Unity.Mathematics.float3(x, y, z)); }) .Build(); - System.Random random = new System.Random(); // for command below - CommandBuilder.Builder() - .Name("RandomizeSignalsInputs") - .Description("Do the thing") - .Action(() => { - if (!GameState.IsSimulationMode()) - { - Logging.CommandLogError("You must be in simulation mode for this to work!"); - return; - } - Tasks.Repeatable task = new Tasks.Repeatable( - () => { - uint count = 0; - EGID[] eBlocks = Blocks.Signals.GetElectricBlocks(); - for (uint i = 0u; i < eBlocks.Length; i++) - { - uint[] ids = Blocks.Signals.GetSignalIDs(eBlocks[i]); - for (uint j = 0u; j < ids.Length; j++) - { - Blocks.Signals.SetSignalByID(ids[j], (float)random.NextDouble()); - count++; - } - } - Logging.MetaDebugLog($"Did the thing on {count} inputs"); - }, - () => { return GameState.IsSimulationMode(); }); - Tasks.Scheduler.Schedule(task); - }).Build(); - CommandBuilder.Builder("getBlock") .Action(() => uREPL.Log.Output(new Player(Players.PlayerType.Local).GetBlockLookedAt()+"")).Build(); diff --git a/doxygen.conf b/doxygen.conf index 0535320..bdd0ed0 100644 --- a/doxygen.conf +++ b/doxygen.conf @@ -38,7 +38,7 @@ PROJECT_NAME = "GamecraftModdingAPI" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = "v1.0.0" +PROJECT_NUMBER = "v1.1.0" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a -- 2.30.2 From e8f59e86418ccefd532d7d72a7420aef0426fbb7 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Thu, 21 May 2020 19:40:46 -0400 Subject: [PATCH 033/252] Delay serializer registration and disable version check even in Debug mode to fix #5 --- .../Persistence/DeserializeFromDiskEntitiesEnginePatch.cs | 2 ++ .../Persistence/SaveAndLoadCompositionRootPatch.cs | 5 ++++- GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/GamecraftModdingAPI/Persistence/DeserializeFromDiskEntitiesEnginePatch.cs b/GamecraftModdingAPI/Persistence/DeserializeFromDiskEntitiesEnginePatch.cs index 29bf987..0ff675f 100644 --- a/GamecraftModdingAPI/Persistence/DeserializeFromDiskEntitiesEnginePatch.cs +++ b/GamecraftModdingAPI/Persistence/DeserializeFromDiskEntitiesEnginePatch.cs @@ -22,6 +22,8 @@ namespace GamecraftModdingAPI.Persistence public static void Prefix(ref ISerializationData ____serializationData, ref FasterList ____bytesStream, ref IEntitySerialization ____entitySerializer, bool ____spawnBlocksOnly) { if (____spawnBlocksOnly) return; // only run after second deserialization call (when all vanilla stuff is already deserialized) + if (SaveAndLoadCompositionRootPatch.currentEnginesRoot == null) return; + SerializerManager.RegisterSerializers(SaveAndLoadCompositionRootPatch.currentEnginesRoot); uint originalPos = ____serializationData.dataPos; Logging.MetaDebugLog($"dataPos: {originalPos}"); BinaryBufferReader bbr = new BinaryBufferReader(____bytesStream.ToArrayFast(out uint count), ____serializationData.dataPos); diff --git a/GamecraftModdingAPI/Persistence/SaveAndLoadCompositionRootPatch.cs b/GamecraftModdingAPI/Persistence/SaveAndLoadCompositionRootPatch.cs index 987cf86..58f5708 100644 --- a/GamecraftModdingAPI/Persistence/SaveAndLoadCompositionRootPatch.cs +++ b/GamecraftModdingAPI/Persistence/SaveAndLoadCompositionRootPatch.cs @@ -10,9 +10,12 @@ namespace GamecraftModdingAPI.Persistence [HarmonyPatch(typeof(SaveAndLoadCompositionRoot), "Compose")] class SaveAndLoadCompositionRootPatch { + public static EnginesRoot currentEnginesRoot; + public static void Prefix(EnginesRoot enginesRoot) { - SerializerManager.RegisterSerializers(enginesRoot); + currentEnginesRoot = enginesRoot; + //SerializerManager.RegisterSerializers(enginesRoot); } } } diff --git a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs index 8576f97..46a7ef8 100644 --- a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs +++ b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs @@ -62,7 +62,7 @@ namespace GamecraftModdingAPI.Tests Logging.MetaDebugLog("Audio Mixers: "+string.Join(",", AudioTools.GetMixers())); //AudioTools.SetVolume(0.0f, "Music"); // The game now sets this from settings again after this is called :( - Utility.VersionTracking.Enable(); + //Utility.VersionTracking.Enable();//(very) unstable // debug/test handlers HandlerBuilder.Builder() -- 2.30.2 From 4e08acf44cd5f21e4034b3fe498fe5e906586f66 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Thu, 21 May 2020 20:00:31 -0400 Subject: [PATCH 034/252] Reduce potentially unnecessary calls to Sync() by always forcing Sync() for new blocks --- GamecraftModdingAPI/Block.cs | 27 ++++++++++++++++--- GamecraftModdingAPI/Blocks/BlockExceptions.cs | 11 ++++++++ GamecraftModdingAPI/Blocks/ConsoleBlock.cs | 1 - GamecraftModdingAPI/Blocks/Motor.cs | 1 - GamecraftModdingAPI/Blocks/Piston.cs | 1 - GamecraftModdingAPI/Blocks/Servo.cs | 1 - GamecraftModdingAPI/Blocks/SignalingBlock.cs | 1 - GamecraftModdingAPI/Blocks/SpawnPoint.cs | 1 - GamecraftModdingAPI/Blocks/TextBlock.cs | 1 - GamecraftModdingAPI/Blocks/Timer.cs | 1 - 10 files changed, 34 insertions(+), 12 deletions(-) diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index 1a8673a..46fb00c 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -71,13 +71,35 @@ namespace GamecraftModdingAPI public Block(EGID id) { Id = id; + if (!BlockEngine.BlockExists(Id)) + { + Sync(); + if (!BlockEngine.BlockExists(Id)) + { + throw new BlockDoesNotExistException($"Block {Id.entityID} must be placed using PlaceNew(...) since it does not exist yet"); + } + } } public Block(uint id) { Id = new EGID(id, CommonExclusiveGroups.OWNED_BLOCKS_GROUP); + if (!BlockEngine.BlockExists(Id)) + { + Sync(); + if (!BlockEngine.BlockExists(Id)) + { + throw new BlockDoesNotExistException($"Block {Id.entityID} must be placed using PlaceNew(...) since it does not exist yet"); + } + } } + /// + /// Synchronize newly created entity components with entities DB. + /// This forces a partial game tick, so it may be slow. + /// This also has the potential to make Gamecraft unstable. + /// Use this sparingly. + /// protected static void Sync() { DeterministicStepCompositionRootPatch.SubmitEntitiesNow(); @@ -219,10 +241,8 @@ namespace GamecraftModdingAPI /// Convert the block to a specialised block class. /// /// The block. - /// Force an entity sync when true. - /// Only set this to false when the block was not placed the same tick this was called. /// The specialised block type. - public T Specialise(bool sameTick = true) where T : Block + public T Specialise() where T : Block { // What have I gotten myself into? // C# can't cast to a child of Block unless the object was originally that child type @@ -233,7 +253,6 @@ namespace GamecraftModdingAPI { throw new BlockSpecializationException("Specialized block constructor does not accept an EGID"); } - if (sameTick) Sync(); return (T)ctor.Invoke(new object[] { Id }); } diff --git a/GamecraftModdingAPI/Blocks/BlockExceptions.cs b/GamecraftModdingAPI/Blocks/BlockExceptions.cs index 47af014..557282a 100644 --- a/GamecraftModdingAPI/Blocks/BlockExceptions.cs +++ b/GamecraftModdingAPI/Blocks/BlockExceptions.cs @@ -40,4 +40,15 @@ namespace GamecraftModdingAPI.Blocks { } } + + public class BlockDoesNotExistException : BlockException + { + public BlockDoesNotExistException() + { + } + + public BlockDoesNotExistException(string message) : base(message) + { + } + } } diff --git a/GamecraftModdingAPI/Blocks/ConsoleBlock.cs b/GamecraftModdingAPI/Blocks/ConsoleBlock.cs index b4fcaa4..da9c895 100644 --- a/GamecraftModdingAPI/Blocks/ConsoleBlock.cs +++ b/GamecraftModdingAPI/Blocks/ConsoleBlock.cs @@ -21,7 +21,6 @@ namespace GamecraftModdingAPI.Blocks { EGID id = PlacementEngine.PlaceBlock(BlockIDs.ConsoleBlock, color, darkness, position, uscale, scale, player, rotation); - Sync(); return new ConsoleBlock(id); } catch (Exception e) diff --git a/GamecraftModdingAPI/Blocks/Motor.cs b/GamecraftModdingAPI/Blocks/Motor.cs index 13a246f..8cafccb 100644 --- a/GamecraftModdingAPI/Blocks/Motor.cs +++ b/GamecraftModdingAPI/Blocks/Motor.cs @@ -29,7 +29,6 @@ namespace GamecraftModdingAPI.Blocks { EGID id = PlacementEngine.PlaceBlock(block, color, darkness, position, uscale, scale, player, rotation); - Sync(); return new Motor(id); } catch (Exception e) diff --git a/GamecraftModdingAPI/Blocks/Piston.cs b/GamecraftModdingAPI/Blocks/Piston.cs index 1e69df6..2f7064c 100644 --- a/GamecraftModdingAPI/Blocks/Piston.cs +++ b/GamecraftModdingAPI/Blocks/Piston.cs @@ -29,7 +29,6 @@ namespace GamecraftModdingAPI.Blocks { EGID id = PlacementEngine.PlaceBlock(block, color, darkness, position, uscale, scale, player, rotation); - Sync(); return new Piston(id); } catch (Exception e) diff --git a/GamecraftModdingAPI/Blocks/Servo.cs b/GamecraftModdingAPI/Blocks/Servo.cs index 1c22d0b..dd2cc52 100644 --- a/GamecraftModdingAPI/Blocks/Servo.cs +++ b/GamecraftModdingAPI/Blocks/Servo.cs @@ -29,7 +29,6 @@ namespace GamecraftModdingAPI.Blocks { EGID id = PlacementEngine.PlaceBlock(block, color, darkness, position, uscale, scale, player, rotation); - Sync(); return new Servo(id); } catch (Exception e) diff --git a/GamecraftModdingAPI/Blocks/SignalingBlock.cs b/GamecraftModdingAPI/Blocks/SignalingBlock.cs index d654ca9..9c2f457 100644 --- a/GamecraftModdingAPI/Blocks/SignalingBlock.cs +++ b/GamecraftModdingAPI/Blocks/SignalingBlock.cs @@ -29,7 +29,6 @@ namespace GamecraftModdingAPI.Blocks { EGID id = PlacementEngine.PlaceBlock(block, color, darkness, position, uscale, scale, player, rotation); - Sync(); return new SignalingBlock(id); } catch (Exception e) diff --git a/GamecraftModdingAPI/Blocks/SpawnPoint.cs b/GamecraftModdingAPI/Blocks/SpawnPoint.cs index 8fd1fda..b43dffb 100644 --- a/GamecraftModdingAPI/Blocks/SpawnPoint.cs +++ b/GamecraftModdingAPI/Blocks/SpawnPoint.cs @@ -31,7 +31,6 @@ namespace GamecraftModdingAPI.Blocks { EGID id = PlacementEngine.PlaceBlock(block, color, darkness, position, uscale, scale, player, rotation); - Sync(); return new SpawnPoint(id); } catch (Exception e) diff --git a/GamecraftModdingAPI/Blocks/TextBlock.cs b/GamecraftModdingAPI/Blocks/TextBlock.cs index a905a6d..f2993fb 100644 --- a/GamecraftModdingAPI/Blocks/TextBlock.cs +++ b/GamecraftModdingAPI/Blocks/TextBlock.cs @@ -22,7 +22,6 @@ namespace GamecraftModdingAPI.Blocks { EGID id = PlacementEngine.PlaceBlock(BlockIDs.TextBlock, color, darkness, position, uscale, scale, player, rotation); - Sync(); return new TextBlock(id); } catch (Exception e) diff --git a/GamecraftModdingAPI/Blocks/Timer.cs b/GamecraftModdingAPI/Blocks/Timer.cs index b31f9f8..a53adf1 100644 --- a/GamecraftModdingAPI/Blocks/Timer.cs +++ b/GamecraftModdingAPI/Blocks/Timer.cs @@ -26,7 +26,6 @@ namespace GamecraftModdingAPI.Blocks { EGID id = PlacementEngine.PlaceBlock(BlockIDs.Timer, color, darkness, position, uscale, scale, player, rotation); - Sync(); return new Timer(id); } catch (Exception e) -- 2.30.2 From 084cbb40c4f6b035d6e76881f43a9dcee149570f Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Fri, 22 May 2020 03:00:33 +0200 Subject: [PATCH 035/252] Added AsyncUtils and Block.PlaceNewAsync() --- GamecraftModdingAPI/Block.cs | 41 +++++++++++++++ GamecraftModdingAPI/Blocks/BlockEngine.cs | 3 ++ .../Events/GameActivatedComposePatch.cs | 2 + GamecraftModdingAPI/Main.cs | 1 + .../Tests/GamecraftModdingAPIPluginTest.cs | 8 ++- GamecraftModdingAPI/Utility/AsyncUtils.cs | 29 +++++++++++ .../Utility/AsyncUtilsEngine.cs | 50 +++++++++++++++++++ 7 files changed, 132 insertions(+), 2 deletions(-) create mode 100644 GamecraftModdingAPI/Utility/AsyncUtils.cs create mode 100644 GamecraftModdingAPI/Utility/AsyncUtilsEngine.cs diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index 46fb00c..271ca1c 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -1,5 +1,6 @@ using System; using System.Reflection; +using System.Threading.Tasks; using Svelto.ECS; using Svelto.ECS.EntityStructs; @@ -29,6 +30,8 @@ namespace GamecraftModdingAPI /// Place a new block at the given position. If scaled, position means the center of the block. The default block size is 0.2 in terms of position. /// Place blocks next to each other to connect them. /// The placed block will be a complete block with a placement grid and collision which will be saved along with the game. + /// + /// This method causes a sync which may have a performance impact. Use the async version if possible. /// /// The block's type /// The block's color @@ -59,6 +62,44 @@ namespace GamecraftModdingAPI return null; } + /// + /// Place a new block at the given position. If scaled, position means the center of the block. The default block size is 0.2 in terms of position. + /// Place blocks next to each other to connect them. + /// The placed block will be a complete block with a placement grid and collision which will be saved along with the game. + /// + /// This method waits for the block to be constructed in the game. + /// + /// The block's type + /// The block's color + /// The block color's darkness (0-9) - 0 is default color + /// The block's position in the grid - default block size is 0.2 + /// The block's rotation in degrees + /// The block's uniform scale - default scale is 1 (with 0.2 width) + /// The block's non-uniform scale - 0 means is used + /// The player who placed the block + /// The placed block or null if failed + public static async Task PlaceNewAsync(BlockIDs block, float3 position, + float3 rotation = default, BlockColors color = BlockColors.Default, byte darkness = 0, + int uscale = 1, float3 scale = default, Player player = null) + { + if (PlacementEngine.IsInGame && GameState.IsBuildMode()) + { + try + { + var ret = new Block(PlacementEngine.PlaceBlock(block, color, darkness, + position, uscale, scale, player, rotation)); + await AsyncUtils.WaitForSubmission(); + return ret; + } + catch (Exception e) + { + Logging.MetaDebugLog(e); + } + } + + return null; + } + /// /// Returns the most recently placed block. /// diff --git a/GamecraftModdingAPI/Blocks/BlockEngine.cs b/GamecraftModdingAPI/Blocks/BlockEngine.cs index 6275ca1..a47a328 100644 --- a/GamecraftModdingAPI/Blocks/BlockEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlockEngine.cs @@ -10,6 +10,9 @@ using GamecraftModdingAPI.Engines; namespace GamecraftModdingAPI.Blocks { + /// + /// Engine for executing general block actions + /// public class BlockEngine : IApiEngine { public string Name { get; } = "GamecraftModdingAPIBlockGameEngine"; diff --git a/GamecraftModdingAPI/Events/GameActivatedComposePatch.cs b/GamecraftModdingAPI/Events/GameActivatedComposePatch.cs index 9b2bf39..35f075e 100644 --- a/GamecraftModdingAPI/Events/GameActivatedComposePatch.cs +++ b/GamecraftModdingAPI/Events/GameActivatedComposePatch.cs @@ -28,6 +28,8 @@ namespace GamecraftModdingAPI.Events { // register custom game engines GameEngineManager.RegisterEngines(enginesRoot); + // initialize AsyncUtils + AsyncUtils.Setup(enginesRoot); // A new EnginesRoot is always created when ActivateGame is called // so all event emitters and handlers must be re-registered. EventManager.RegisterEngines(enginesRoot); diff --git a/GamecraftModdingAPI/Main.cs b/GamecraftModdingAPI/Main.cs index 56f481f..bea58e1 100644 --- a/GamecraftModdingAPI/Main.cs +++ b/GamecraftModdingAPI/Main.cs @@ -71,6 +71,7 @@ namespace GamecraftModdingAPI Player.Init(); Block.Init(); GameClient.Init(); + AsyncUtils.Init(); Logging.MetaLog($"{currentAssembly.GetName().Name} v{currentAssembly.GetName().Version} initialized"); } diff --git a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs index 46a7ef8..4c9105c 100644 --- a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs +++ b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs @@ -143,7 +143,11 @@ namespace GamecraftModdingAPI.Tests CommandBuilder.Builder() .Name("PlaceAluminium") .Description("Place a block of aluminium at the given coordinates") - .Action((float x, float y, float z) => { Block.PlaceNew(Blocks.BlockIDs.AluminiumCube, new Unity.Mathematics.float3(x, y, z)); }) + .Action(async (float x, float y, float z) => + { + var block = await Block.PlaceNewAsync(BlockIDs.AluminiumCube, new float3(x, y, z)); + Logging.MetaDebugLog("Block placed with type: " + block.Type); + }) .Build(); CommandBuilder.Builder("getBlock") @@ -170,7 +174,7 @@ namespace GamecraftModdingAPI.Tests Logging.CommandLog("Colored block to " + color); }).Build(); - + GameClient.SetDebugInfo("lookedAt", LookedAt); /* diff --git a/GamecraftModdingAPI/Utility/AsyncUtils.cs b/GamecraftModdingAPI/Utility/AsyncUtils.cs new file mode 100644 index 0000000..fcb5878 --- /dev/null +++ b/GamecraftModdingAPI/Utility/AsyncUtils.cs @@ -0,0 +1,29 @@ +using System.Threading.Tasks; + +using Svelto.ECS; + +namespace GamecraftModdingAPI.Utility +{ + public static class AsyncUtils + { + private static AsyncUtilsEngine gameEngine = new AsyncUtilsEngine(); + + /// + /// Waits for entity submission asynchronously. + /// + public static async Task WaitForSubmission() + { + await gameEngine.WaitForSubmission(); + } + + public static void Setup(EnginesRoot enginesRoot) + { + gameEngine.Setup(enginesRoot.GenerateEntityFunctions(), enginesRoot.GenerateEntityFactory()); + } + + public static void Init() + { + GameEngineManager.AddGameEngine(gameEngine); + } + } +} \ No newline at end of file diff --git a/GamecraftModdingAPI/Utility/AsyncUtilsEngine.cs b/GamecraftModdingAPI/Utility/AsyncUtilsEngine.cs new file mode 100644 index 0000000..9027de1 --- /dev/null +++ b/GamecraftModdingAPI/Utility/AsyncUtilsEngine.cs @@ -0,0 +1,50 @@ +using System.Collections; +using System.Threading.Tasks; + +using RobocraftX.Schedulers; +using Svelto.ECS; +using Svelto.Tasks.ExtraLean; + +using GamecraftModdingAPI.Engines; + +namespace GamecraftModdingAPI.Utility +{ + public class AsyncUtilsEngine : IApiEngine + { + private IEntityFunctions _efu; + private IEntityFactory _efa; + private IEnumerator WaitForSubmissionInternal(IEntityFunctions efu, IEntityFactory efa, + EntitiesDB entitiesDB, TaskCompletionSource task) + { + var waitEnumerator = new WaitForSubmissionEnumerator(efu, efa, entitiesDB); + while (waitEnumerator.MoveNext()) + yield return null; + task.SetResult(null); + } + + public Task WaitForSubmission() + { + var task = new TaskCompletionSource(); + WaitForSubmissionInternal(_efu, _efa, entitiesDB, task).RunOn(ExtraLean.EveryFrameStepRunner); + return task.Task; + } + + public void Setup(IEntityFunctions efu, IEntityFactory efa) + { + _efu = efu; + _efa = efa; + } + + public void Ready() + { + } + + public EntitiesDB entitiesDB { get; set; } + public void Dispose() + { + } + + public string Name { get; } = "GamecraftModdingAPIAsyncUtilsGameEngine"; + public bool isRemovable { get; } = false; + } +} \ No newline at end of file -- 2.30.2 From dca6fe4c1bae761d57bd040ddecdd972a4931331 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sat, 23 May 2020 00:06:49 +0200 Subject: [PATCH 036/252] Fixes, added SimBody class --- GamecraftModdingAPI/Block.cs | 38 ++++---- GamecraftModdingAPI/Blocks/ConsoleBlock.cs | 21 ++--- GamecraftModdingAPI/Blocks/Motor.cs | 13 +-- GamecraftModdingAPI/Blocks/Piston.cs | 13 +-- GamecraftModdingAPI/Blocks/Servo.cs | 15 +--- GamecraftModdingAPI/Blocks/SignalingBlock.cs | 13 +-- GamecraftModdingAPI/Blocks/SpawnPoint.cs | 13 +-- GamecraftModdingAPI/Blocks/TextBlock.cs | 13 +-- GamecraftModdingAPI/Blocks/Timer.cs | 14 +-- GamecraftModdingAPI/Player.cs | 23 ++++- GamecraftModdingAPI/Players/PlayerEngine.cs | 19 +++- GamecraftModdingAPI/SimBody.cs | 88 +++++++++++++++++++ .../Tests/GamecraftModdingAPIPluginTest.cs | 78 ++++++++++++++-- .../Utility/DebugInterfaceEngine.cs | 4 +- GamecraftModdingAPI/Utility/Logging.cs | 4 +- 15 files changed, 242 insertions(+), 127 deletions(-) create mode 100644 GamecraftModdingAPI/SimBody.cs diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index 271ca1c..4768a57 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -23,15 +23,14 @@ namespace GamecraftModdingAPI protected static readonly MovementEngine MovementEngine = new MovementEngine(); protected static readonly RotationEngine RotationEngine = new RotationEngine(); protected static readonly RemovalEngine RemovalEngine = new RemovalEngine(); - protected static readonly BlockEngine BlockEngine = new BlockEngine(); protected static readonly SignalEngine SignalEngine = new SignalEngine(); + + protected internal static readonly BlockEngine BlockEngine = new BlockEngine(); /// /// Place a new block at the given position. If scaled, position means the center of the block. The default block size is 0.2 in terms of position. /// Place blocks next to each other to connect them. /// The placed block will be a complete block with a placement grid and collision which will be saved along with the game. - /// - /// This method causes a sync which may have a performance impact. Use the async version if possible. /// /// The block's type /// The block's color @@ -48,15 +47,8 @@ namespace GamecraftModdingAPI { if (PlacementEngine.IsInGame && GameState.IsBuildMode()) { - try - { - return new Block(PlacementEngine.PlaceBlock(block, color, darkness, - position, uscale, scale, player, rotation)); - } - catch (Exception e) - { - Logging.MetaDebugLog(e); - } + return new Block(PlacementEngine.PlaceBlock(block, color, darkness, + position, uscale, scale, player, rotation)); } return null; @@ -122,17 +114,8 @@ namespace GamecraftModdingAPI } } - public Block(uint id) + public Block(uint id) : this(new EGID(id, CommonExclusiveGroups.OWNED_BLOCKS_GROUP)) { - Id = new EGID(id, CommonExclusiveGroups.OWNED_BLOCKS_GROUP); - if (!BlockEngine.BlockExists(Id)) - { - Sync(); - if (!BlockEngine.BlockExists(Id)) - { - throw new BlockDoesNotExistException($"Block {Id.entityID} must be placed using PlaceNew(...) since it does not exist yet"); - } - } } /// @@ -264,6 +247,17 @@ namespace GamecraftModdingAPI /// True if the block exists and could be removed. public bool Remove() => RemovalEngine.RemoveBlock(Id); + /// + /// Returns the rigid body of the cluster of blocks this one belongs to during simulation. + /// Can be used to apply forces or move the block around while the simulation is running. + /// + /// + public SimBody ToSimBody() + { + uint id = BlockEngine.GetBlockInfo(Id).machineRigidBodyId; + return new SimBody(id); + } + public override string ToString() { return $"{nameof(Id)}: {Id}, {nameof(Position)}: {Position}, {nameof(Rotation)}: {Rotation}"; diff --git a/GamecraftModdingAPI/Blocks/ConsoleBlock.cs b/GamecraftModdingAPI/Blocks/ConsoleBlock.cs index da9c895..173b3f6 100644 --- a/GamecraftModdingAPI/Blocks/ConsoleBlock.cs +++ b/GamecraftModdingAPI/Blocks/ConsoleBlock.cs @@ -15,21 +15,14 @@ namespace GamecraftModdingAPI.Blocks float3 rotation = default, BlockColors color = BlockColors.Default, byte darkness = 0, int uscale = 1, float3 scale = default, Player player = null) { - if (PlacementEngine.IsInGame && GameState.IsBuildMode()) - { - try - { - EGID id = PlacementEngine.PlaceBlock(BlockIDs.ConsoleBlock, color, darkness, - position, uscale, scale, player, rotation); - return new ConsoleBlock(id); - } - catch (Exception e) - { - Logging.MetaDebugLog(e); - } - } + if (PlacementEngine.IsInGame && GameState.IsBuildMode()) + { + EGID id = PlacementEngine.PlaceBlock(BlockIDs.ConsoleBlock, color, darkness, + position, uscale, scale, player, rotation); + return new ConsoleBlock(id); + } - return null; + return null; } public ConsoleBlock(EGID id): base(id) diff --git a/GamecraftModdingAPI/Blocks/Motor.cs b/GamecraftModdingAPI/Blocks/Motor.cs index 8cafccb..c900f10 100644 --- a/GamecraftModdingAPI/Blocks/Motor.cs +++ b/GamecraftModdingAPI/Blocks/Motor.cs @@ -25,16 +25,9 @@ namespace GamecraftModdingAPI.Blocks } if (PlacementEngine.IsInGame && GameState.IsBuildMode()) { - try - { - EGID id = PlacementEngine.PlaceBlock(block, color, darkness, - position, uscale, scale, player, rotation); - return new Motor(id); - } - catch (Exception e) - { - Logging.MetaDebugLog(e); - } + EGID id = PlacementEngine.PlaceBlock(block, color, darkness, + position, uscale, scale, player, rotation); + return new Motor(id); } return null; diff --git a/GamecraftModdingAPI/Blocks/Piston.cs b/GamecraftModdingAPI/Blocks/Piston.cs index 2f7064c..00ad273 100644 --- a/GamecraftModdingAPI/Blocks/Piston.cs +++ b/GamecraftModdingAPI/Blocks/Piston.cs @@ -25,16 +25,9 @@ namespace GamecraftModdingAPI.Blocks } if (PlacementEngine.IsInGame && GameState.IsBuildMode()) { - try - { - EGID id = PlacementEngine.PlaceBlock(block, color, darkness, - position, uscale, scale, player, rotation); - return new Piston(id); - } - catch (Exception e) - { - Logging.MetaDebugLog(e); - } + EGID id = PlacementEngine.PlaceBlock(block, color, darkness, + position, uscale, scale, player, rotation); + return new Piston(id); } return null; diff --git a/GamecraftModdingAPI/Blocks/Servo.cs b/GamecraftModdingAPI/Blocks/Servo.cs index dd2cc52..9a66e3b 100644 --- a/GamecraftModdingAPI/Blocks/Servo.cs +++ b/GamecraftModdingAPI/Blocks/Servo.cs @@ -21,20 +21,13 @@ namespace GamecraftModdingAPI.Blocks { if (!(block == BlockIDs.ServoAxle || block == BlockIDs.ServoHinge || block == BlockIDs.ServoPiston)) { - throw new BlockTypeException($"Block is not a {typeof(Servo).Name} block"); + throw new BlockTypeException($"Block is not a {nameof(Servo)} block"); } if (PlacementEngine.IsInGame && GameState.IsBuildMode()) { - try - { - EGID id = PlacementEngine.PlaceBlock(block, color, darkness, - position, uscale, scale, player, rotation); - return new Servo(id); - } - catch (Exception e) - { - Logging.MetaDebugLog(e); - } + EGID id = PlacementEngine.PlaceBlock(block, color, darkness, + position, uscale, scale, player, rotation); + return new Servo(id); } return null; diff --git a/GamecraftModdingAPI/Blocks/SignalingBlock.cs b/GamecraftModdingAPI/Blocks/SignalingBlock.cs index 9c2f457..f8006f6 100644 --- a/GamecraftModdingAPI/Blocks/SignalingBlock.cs +++ b/GamecraftModdingAPI/Blocks/SignalingBlock.cs @@ -25,16 +25,9 @@ namespace GamecraftModdingAPI.Blocks { if (PlacementEngine.IsInGame && GameState.IsBuildMode()) { - try - { - EGID id = PlacementEngine.PlaceBlock(block, color, darkness, - position, uscale, scale, player, rotation); - return new SignalingBlock(id); - } - catch (Exception e) - { - Logging.MetaDebugLog(e); - } + EGID id = PlacementEngine.PlaceBlock(block, color, darkness, + position, uscale, scale, player, rotation); + return new SignalingBlock(id); } return null; diff --git a/GamecraftModdingAPI/Blocks/SpawnPoint.cs b/GamecraftModdingAPI/Blocks/SpawnPoint.cs index b43dffb..bb3e7f4 100644 --- a/GamecraftModdingAPI/Blocks/SpawnPoint.cs +++ b/GamecraftModdingAPI/Blocks/SpawnPoint.cs @@ -23,20 +23,13 @@ namespace GamecraftModdingAPI.Blocks { if (!(block == BlockIDs.LargeSpawn || block == BlockIDs.SmallSpawn || block == BlockIDs.MediumSpawn || block == BlockIDs.PlayerSpawn)) { - throw new BlockTypeException($"Block is not a {typeof(SpawnPoint).Name} block"); + throw new BlockTypeException($"Block is not a {nameof(SpawnPoint)} block"); } if (PlacementEngine.IsInGame && GameState.IsBuildMode()) { - try - { - EGID id = PlacementEngine.PlaceBlock(block, color, darkness, - position, uscale, scale, player, rotation); + EGID id = PlacementEngine.PlaceBlock(block, color, darkness, + position, uscale, scale, player, rotation); return new SpawnPoint(id); - } - catch (Exception e) - { - Logging.MetaDebugLog(e); - } } return null; diff --git a/GamecraftModdingAPI/Blocks/TextBlock.cs b/GamecraftModdingAPI/Blocks/TextBlock.cs index f2993fb..92f8116 100644 --- a/GamecraftModdingAPI/Blocks/TextBlock.cs +++ b/GamecraftModdingAPI/Blocks/TextBlock.cs @@ -18,16 +18,9 @@ namespace GamecraftModdingAPI.Blocks { if (PlacementEngine.IsInGame && GameState.IsBuildMode()) { - try - { - EGID id = PlacementEngine.PlaceBlock(BlockIDs.TextBlock, color, darkness, - position, uscale, scale, player, rotation); - return new TextBlock(id); - } - catch (Exception e) - { - Logging.MetaDebugLog(e); - } + EGID id = PlacementEngine.PlaceBlock(BlockIDs.TextBlock, color, darkness, + position, uscale, scale, player, rotation); + return new TextBlock(id); } return null; diff --git a/GamecraftModdingAPI/Blocks/Timer.cs b/GamecraftModdingAPI/Blocks/Timer.cs index a53adf1..d26620e 100644 --- a/GamecraftModdingAPI/Blocks/Timer.cs +++ b/GamecraftModdingAPI/Blocks/Timer.cs @@ -21,17 +21,9 @@ namespace GamecraftModdingAPI.Blocks { if (PlacementEngine.IsInGame && GameState.IsBuildMode()) { - - try - { - EGID id = PlacementEngine.PlaceBlock(BlockIDs.Timer, color, darkness, - position, uscale, scale, player, rotation); - return new Timer(id); - } - catch (Exception e) - { - Logging.MetaDebugLog(e); - } + EGID id = PlacementEngine.PlaceBlock(BlockIDs.Timer, color, darkness, + position, uscale, scale, player, rotation); + return new Timer(id); } return null; diff --git a/GamecraftModdingAPI/Player.cs b/GamecraftModdingAPI/Player.cs index 965ba45..0b7a134 100644 --- a/GamecraftModdingAPI/Player.cs +++ b/GamecraftModdingAPI/Player.cs @@ -1,6 +1,7 @@ using System; using Unity.Mathematics; +using RobocraftX.Common; using GamecraftModdingAPI.Players; @@ -221,13 +222,27 @@ namespace GamecraftModdingAPI /// /// Returns the block the player is currently looking at. /// - /// The player's ID - /// The entities DB /// The maximum distance from the player (default is the player's building reach) - /// The block's EGID or null if not found + /// The block or null if not found public Block GetBlockLookedAt(float maxDistance = -1f) { - return playerEngine.GetBlockLookedAt(Id, maxDistance); + var egid = playerEngine.GetThingLookedAt(Id, maxDistance); + return egid.HasValue && egid.Value.groupID == CommonExclusiveGroups.OWNED_BLOCKS_GROUP + ? new Block(egid.Value) + : null; + } + + /// + /// Returns the rigid body the player is currently looking at during simulation. + /// + /// The maximum distance from the player (default is the player's building reach) + /// The block or null if not found + public SimBody GetSimBodyLookedAt(float maxDistance = -1f) + { + var egid = playerEngine.GetThingLookedAt(Id, maxDistance); + return egid.HasValue && egid.Value.groupID == CommonExclusiveGroups.SIMULATION_BODIES_GROUP + ? new SimBody(egid.Value) + : null; } // internal methods diff --git a/GamecraftModdingAPI/Players/PlayerEngine.cs b/GamecraftModdingAPI/Players/PlayerEngine.cs index f8e53f0..d2c8fa3 100644 --- a/GamecraftModdingAPI/Players/PlayerEngine.cs +++ b/GamecraftModdingAPI/Players/PlayerEngine.cs @@ -238,7 +238,7 @@ namespace GamecraftModdingAPI.Players return false; } - public Block GetBlockLookedAt(uint playerId, float maxDistance = -1f) + public EGID? GetThingLookedAt(uint playerId, float maxDistance = -1f) { if (!entitiesDB.TryQueryMappedEntities( CameraExclusiveGroups.CameraGroup, out var mapper)) @@ -248,7 +248,22 @@ namespace GamecraftModdingAPI.Players ? GhostBlockUtils.GetBuildInteractionDistance(entitiesDB, rayCast) : maxDistance; if (rayCast.hit && rayCast.distance <= distance) - return new Block(rayCast.hitEgid); + return rayCast.hitEgid; + /*if (rayCast.hit) + { + *Logging.MetaDebugLog("RayCast EGID: " + rayCast.hitEgid); + var d = AccessTools.Field(typeof(ExclusiveGroup), "_knownGroups").GetValue(null) as + Dictionary; + foreach (var groupStruct in d) + { + if (groupStruct.Value == rayCast.hitEgid.groupID) + { + Logging.MetaDebugLog("Group name: " + groupStruct.Key); + break; //SIMULATION_BODIES_GROUP + } + }* + //Logging.MetaDebugLog("Position: " + Block.GetBlockPositionTest(rayCast.hitEgid)); + }*/ return null; } diff --git a/GamecraftModdingAPI/SimBody.cs b/GamecraftModdingAPI/SimBody.cs new file mode 100644 index 0000000..e6d1c68 --- /dev/null +++ b/GamecraftModdingAPI/SimBody.cs @@ -0,0 +1,88 @@ +using RobocraftX.Common; +using RobocraftX.Physics; +using Svelto.ECS; +using Unity.Mathematics; +using Unity.Physics; +using UnityEngine; + +namespace GamecraftModdingAPI +{ + /// + /// A rigid body (like a cluster of connected blocks) during simulation. + /// + public class SimBody + { + public EGID Id { get; } + + public SimBody(EGID id) + { + Id = id; + } + + public SimBody(uint id) : this(new EGID(id, CommonExclusiveGroups.SIMULATION_BODIES_GROUP)) + { + } + + public float3 Position + { + get => GetStruct().position; + set => GetStruct().position = value; + } + + public float3 Velocity + { + get => GetStruct().velocity; + set => GetStruct().velocity = value; + } + + public float3 AngularVelocity + { + get => GetStruct().angularVelocity; + set => GetStruct().angularVelocity = value; + } + + public float3 DeltaVelocity + { + get => GetStruct().deltaVelocity; + set => GetStruct().deltaVelocity = value; + } + + public float3 DeltaAngularVelocity + { + get => GetStruct().deltaAngularVelocity; + set => GetStruct().deltaAngularVelocity = value; + } + + public float3 Rotation + { + get => ((Quaternion) GetStruct().rotation).eulerAngles; + set + { + ref var str = ref GetStruct(); + Quaternion quaternion = str.rotation; + quaternion.eulerAngles = value; + str.rotation = quaternion; + } + } + + public float Mass + { + get => math.rcp(GetStruct().physicsMass.InverseMass); + set => GetStruct().physicsMass.InverseMass = math.rcp(value); + } + + /// + /// Whether the body can be moved or static + /// + public bool Static + { + get => Block.BlockEngine.GetBlockInfo(Id).isStatic; + set => Block.BlockEngine.GetBlockInfo(Id).isStatic = value; + } + + private ref RigidBodyEntityStruct GetStruct() + { + return ref Block.BlockEngine.GetBlockInfo(Id); + } + } +} \ No newline at end of file diff --git a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs index 4c9105c..b662dd7 100644 --- a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs +++ b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs @@ -1,8 +1,11 @@ using System; +using System.Diagnostics; using System.Linq; using System.Reflection; +using System.Text; using HarmonyLib; +using IllusionInjector; // test using Svelto.ECS; using RobocraftX.Blocks; @@ -143,15 +146,46 @@ namespace GamecraftModdingAPI.Tests CommandBuilder.Builder() .Name("PlaceAluminium") .Description("Place a block of aluminium at the given coordinates") - .Action(async (float x, float y, float z) => + .Action((float x, float y, float z) => { - var block = await Block.PlaceNewAsync(BlockIDs.AluminiumCube, new float3(x, y, z)); - Logging.MetaDebugLog("Block placed with type: " + block.Type); + var block = Block.PlaceNew(BlockIDs.AluminiumCube, new float3(x, y, z)); + Logging.CommandLog("Block placed with type: " + block.Type); }) .Build(); - CommandBuilder.Builder("getBlock") - .Action(() => uREPL.Log.Output(new Player(Players.PlayerType.Local).GetBlockLookedAt()+"")).Build(); + CommandBuilder.Builder() + .Name("PlaceAluminiumLots") + .Description("Place a lot of blocks of aluminium at the given coordinates") + .Action((float x, float y, float z) => + { + Logging.CommandLog("Starting..."); + var sw = Stopwatch.StartNew(); + for (int i = 0; i < 100; i++) + for (int j = 0; j < 100; j++) + Block.PlaceNew(BlockIDs.AluminiumCube, new float3(x + i, y, z + j)); + //Block.Sync(); + sw.Stop(); + Logging.CommandLog("Finished in " + sw.ElapsedMilliseconds + "ms"); + }) + .Build(); + //With Sync(): 1135ms + //Without Sync(): 134ms + //Async: 348 794ms, doesn't freeze game + //Without Sync() but wait for submission: 530ms + //With Sync() at the end: 380ms + + Block b = null; + CommandBuilder.Builder("moveBlockInSim", "Run in build mode first, then in sim while looking at a block to move it up") + .Action(() => + { + if (b == null) + { + b = new Player(PlayerType.Local).GetBlockLookedAt(); + Logging.CommandLog("Block saved: " + b); + } + else + Logging.CommandLog("Block moved to: " + (b.ToSimBody().Position += new float3(0, 2, 0))); + }).Build(); CommandBuilder.Builder("Error", "Throw an error to make sure SimpleCustomCommandEngine's wrapper catches it.") .Action(() => { throw new Exception("Error Command always throws an error"); }) @@ -176,6 +210,7 @@ namespace GamecraftModdingAPI.Tests }).Build(); GameClient.SetDebugInfo("lookedAt", LookedAt); + GameClient.SetDebugInfo("InstalledMods", InstalledMods); /* CommandManager.AddCommand(new SimpleCustomCommandEngine((float d) => { UnityEngine.Camera.main.fieldOfView = d; }, @@ -237,10 +272,35 @@ namespace GamecraftModdingAPI.Tests private string LookedAt() { if (player == null) - player = new Player(Players.PlayerType.Local); - Block block = player.GetBlockLookedAt(); - if (block == null) return "Block: none"; - return "Block: " + block.Type + "\nColor: " + block.Color + "\n" + "At: " + block.Position; + player = new Player(PlayerType.Local); + if (GameState.IsBuildMode()) + { + Block block = player.GetBlockLookedAt(); + if (block == null) return "Block: none"; + return "Block: " + block.Type + "\nColor: " + block.Color + "\n" + "At: " + block.Position; + } + if (GameState.IsSimulationMode()) + { + SimBody body = player.GetSimBodyLookedAt(); + if (body == null) return "Body: none"; + return "Body: " + (body.Static ? "static" : "non-static") + + "\nAt: " + body.Position + " - rotated: " + body.Rotation + + "\nWith mass: " + body.Mass + + "\nVelocity: " + body.Velocity + " - angular: " + body.AngularVelocity + + "\nDelta velocity: " + body.DeltaVelocity + " - angular: " + body.DeltaAngularVelocity; + } + + return "Switching modes..."; + } + + private string modsString; + private string InstalledMods() + { + if (modsString != null) return modsString; + StringBuilder sb = new StringBuilder("Installed mods:"); + foreach (var plugin in PluginManager.Plugins) + sb.Append("\n" + plugin); + return modsString = sb.ToString(); } public void OnFixedUpdate() { } diff --git a/GamecraftModdingAPI/Utility/DebugInterfaceEngine.cs b/GamecraftModdingAPI/Utility/DebugInterfaceEngine.cs index b8b0222..c604c34 100644 --- a/GamecraftModdingAPI/Utility/DebugInterfaceEngine.cs +++ b/GamecraftModdingAPI/Utility/DebugInterfaceEngine.cs @@ -52,7 +52,7 @@ namespace GamecraftModdingAPI.Utility } catch (Exception e) { - Logging.LogException(e, "Failed to inject AddInfo method for the debug display!"); + Logging.LogWarning("Failed to inject AddInfo method for the debug display!\n" + e); } return list; @@ -68,7 +68,7 @@ namespace GamecraftModdingAPI.Utility } catch (Exception e) { - Logging.LogException(e, "Unable to get info for " + info.Key); + Logging.LogWarning("Unable to get info for " + info.Key + "\n" + e); } } } diff --git a/GamecraftModdingAPI/Utility/Logging.cs b/GamecraftModdingAPI/Utility/Logging.cs index 20c17cf..80ef323 100644 --- a/GamecraftModdingAPI/Utility/Logging.cs +++ b/GamecraftModdingAPI/Utility/Logging.cs @@ -83,7 +83,7 @@ namespace GamecraftModdingAPI.Utility } /// - /// Write an exception to Gamecraft's log + /// Write an exception to Gamecraft's log and to the screen and exit game /// /// The exception to log /// The extra data to pass to the ILogger. @@ -95,7 +95,7 @@ namespace GamecraftModdingAPI.Utility } /// - /// Write an exception message to Gamecraft's log + /// Write an exception message to Gamecraft's log and to the screen and exit game /// /// The object to log /// The exception to log -- 2.30.2 From ab7c5805fe85793aa7c2acbdac47fa74f759d236 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sun, 24 May 2020 19:29:02 +0200 Subject: [PATCH 037/252] Add object ID block and label support --- GamecraftModdingAPI/Block.cs | 21 ++++++++-- GamecraftModdingAPI/Blocks/BlockEngine.cs | 35 ++++++++++++++++ .../Blocks/ObjectIdentifier.cs | 41 +++++++++++++++++++ GamecraftModdingAPI/SimBody.cs | 24 +++++++---- .../Tests/GamecraftModdingAPIPluginTest.cs | 17 ++++++-- 5 files changed, 125 insertions(+), 13 deletions(-) create mode 100644 GamecraftModdingAPI/Blocks/ObjectIdentifier.cs diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index 4768a57..ff89be3 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -7,6 +7,7 @@ using Svelto.ECS.EntityStructs; using RobocraftX.Common; using RobocraftX.Blocks; using Unity.Mathematics; +using Gamecraft.Blocks.GUI; using GamecraftModdingAPI.Blocks; using GamecraftModdingAPI.Utility; @@ -231,6 +232,20 @@ namespace GamecraftModdingAPI } } + /// + /// The short text displayed on the block if applicable, or null. + /// Setting it is temporary to the session, it won't be saved. + /// + public string Label + { + get => BlockEngine.GetBlockInfo(Id).textLabelComponent?.text; + set + { + ref var text = ref BlockEngine.GetBlockInfo(Id); + if (text.textLabelComponent != null) text.textLabelComponent.text = value; + } + } + /// /// Whether the block exists. The other properties will return a default value if the block doesn't exist. /// @@ -251,8 +266,8 @@ namespace GamecraftModdingAPI /// Returns the rigid body of the cluster of blocks this one belongs to during simulation. /// Can be used to apply forces or move the block around while the simulation is running. /// - /// - public SimBody ToSimBody() + /// The SimBody of the cluster + public SimBody GetSimBody() { uint id = BlockEngine.GetBlockInfo(Id).machineRigidBodyId; return new SimBody(id); @@ -260,7 +275,7 @@ namespace GamecraftModdingAPI public override string ToString() { - return $"{nameof(Id)}: {Id}, {nameof(Position)}: {Position}, {nameof(Rotation)}: {Rotation}"; + return $"{nameof(Id)}: {Id}, {nameof(Position)}: {Position}, {nameof(Type)}: {Type}, {nameof(Color)}: {Color}, {nameof(Exists)}: {Exists}"; } public static void Init() diff --git a/GamecraftModdingAPI/Blocks/BlockEngine.cs b/GamecraftModdingAPI/Blocks/BlockEngine.cs index a47a328..eecebc2 100644 --- a/GamecraftModdingAPI/Blocks/BlockEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlockEngine.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; +using Gamecraft.Wires; using RobocraftX.Blocks; using RobocraftX.Common; using RobocraftX.GUI.Hotbar.Colours; @@ -91,6 +92,40 @@ namespace GamecraftModdingAPI.Blocks return entitiesDB.Exists(blockID); } + public SimBody[] GetSimBodiesFromID(byte id) + { + var ret = new FasterList(4); + if (!entitiesDB.HasAny(CommonExclusiveGroups.OWNED_BLOCKS_GROUP)) + return new SimBody[0]; + var oids = entitiesDB.QueryEntities(CommonExclusiveGroups.OWNED_BLOCKS_GROUP); + var connections = entitiesDB.QueryMappedEntities(CommonExclusiveGroups.OWNED_BLOCKS_GROUP); + foreach (ref ObjectIdEntityStruct oid in oids) + { + if (oid.objectId != id) continue; + var rid = connections.Entity(oid.ID.entityID).machineRigidBodyId; + foreach (var rb in ret) + { + if (rb.Id.entityID == rid) + goto DUPLICATE; //Multiple Object Identifiers on one rigid body + } + ret.Add(new SimBody(rid)); + DUPLICATE: ; + } + return ret.ToArray(); + } + + public ObjectIdentifier[] GetObjectIDsFromID(byte id) + { + var ret = new FasterList(4); + if (!entitiesDB.HasAny(CommonExclusiveGroups.OWNED_BLOCKS_GROUP)) + return new ObjectIdentifier[0]; + var oids = entitiesDB.QueryEntities(CommonExclusiveGroups.OWNED_BLOCKS_GROUP); + foreach (ref ObjectIdEntityStruct oid in oids) + if (oid.objectId == id) + ret.Add(new ObjectIdentifier(oid.ID)); + return ret.ToArray(); + } + #if DEBUG public EntitiesDB GetEntitiesDB() { diff --git a/GamecraftModdingAPI/Blocks/ObjectIdentifier.cs b/GamecraftModdingAPI/Blocks/ObjectIdentifier.cs new file mode 100644 index 0000000..3beacfa --- /dev/null +++ b/GamecraftModdingAPI/Blocks/ObjectIdentifier.cs @@ -0,0 +1,41 @@ +using Gamecraft.Wires; +using Svelto.ECS; + +namespace GamecraftModdingAPI.Blocks +{ + public class ObjectIdentifier : Block + { + public ObjectIdentifier(EGID id) : base(id) + { + if (!BlockEngine.GetBlockInfoExists(Id)) + { + throw new BlockTypeException($"Block is not a {GetType().Name} block"); + } + } + + public ObjectIdentifier(uint id) : base(id) + { + if (!BlockEngine.GetBlockInfoExists(Id)) + { + throw new BlockTypeException($"Block is not a {GetType().Name} block"); + } + } + + public char Identifier + { + get => (char) (BlockEngine.GetBlockInfo(Id).objectId + 'A'); + set + { + BlockEngine.GetBlockInfo(Id).objectId = (byte) (value - 'A'); + Label = value + ""; //The label isn't updated automatically + } + } + + /// + /// Finds the identfier blocks with the given ID. + /// + /// The ID to look for + /// An array that may be empty + public static ObjectIdentifier[] GetByID(char id) => BlockEngine.GetObjectIDsFromID((byte) (id - 'A')); + } +} \ No newline at end of file diff --git a/GamecraftModdingAPI/SimBody.cs b/GamecraftModdingAPI/SimBody.cs index e6d1c68..f38df01 100644 --- a/GamecraftModdingAPI/SimBody.cs +++ b/GamecraftModdingAPI/SimBody.cs @@ -1,8 +1,8 @@ -using RobocraftX.Common; +using Gamecraft.Wires; +using RobocraftX.Common; using RobocraftX.Physics; using Svelto.ECS; using Unity.Mathematics; -using Unity.Physics; using UnityEngine; namespace GamecraftModdingAPI @@ -74,15 +74,25 @@ namespace GamecraftModdingAPI /// /// Whether the body can be moved or static /// - public bool Static - { - get => Block.BlockEngine.GetBlockInfo(Id).isStatic; - set => Block.BlockEngine.GetBlockInfo(Id).isStatic = value; - } + public bool Static => Block.BlockEngine.GetBlockInfo(Id).isStatic; + //Setting it doesn't have any effect private ref RigidBodyEntityStruct GetStruct() { return ref Block.BlockEngine.GetBlockInfo(Id); } + + public override string ToString() + { + return $"{nameof(Id)}: {Id}, {nameof(Position)}: {Position}, {nameof(Mass)}: {Mass}, {nameof(Static)}: {Static}"; + } + + /// + /// Returns the object identified by the given ID (A-Z). + /// This has the same result as calling ObjectIdentifier.GetByID(id) and then GetRigidBody() with the duplicates filtered out. + /// + /// The alphabetical ID + /// An array that may be empty + public static SimBody[] GetFromObjectID(char id) => Block.BlockEngine.GetSimBodiesFromID((byte) (id - 'A')); } } \ No newline at end of file diff --git a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs index b662dd7..1342eae 100644 --- a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs +++ b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs @@ -175,7 +175,7 @@ namespace GamecraftModdingAPI.Tests //With Sync() at the end: 380ms Block b = null; - CommandBuilder.Builder("moveBlockInSim", "Run in build mode first, then in sim while looking at a block to move it up") + CommandBuilder.Builder("moveBlockInSim", "Run in build mode first while looking at a block, then in sim to move it up") .Action(() => { if (b == null) @@ -184,7 +184,7 @@ namespace GamecraftModdingAPI.Tests Logging.CommandLog("Block saved: " + b); } else - Logging.CommandLog("Block moved to: " + (b.ToSimBody().Position += new float3(0, 2, 0))); + Logging.CommandLog("Block moved to: " + (b.GetSimBody().Position += new float3(0, 2, 0))); }).Build(); CommandBuilder.Builder("Error", "Throw an error to make sure SimpleCustomCommandEngine's wrapper catches it.") @@ -209,6 +209,16 @@ namespace GamecraftModdingAPI.Tests }).Build(); + CommandBuilder.Builder("GetBlockByID", "Gets a block based on its object identifier and teleports it up.") + .Action(ch => + { + foreach (var body in SimBody.GetFromObjectID(ch)) + { + Logging.CommandLog("SimBody: " + body); + body.Position += new float3(0, 10, 0); + } + }).Build(); + GameClient.SetDebugInfo("lookedAt", LookedAt); GameClient.SetDebugInfo("InstalledMods", InstalledMods); @@ -277,7 +287,8 @@ namespace GamecraftModdingAPI.Tests { Block block = player.GetBlockLookedAt(); if (block == null) return "Block: none"; - return "Block: " + block.Type + "\nColor: " + block.Color + "\n" + "At: " + block.Position; + return "Block: " + block.Type + "\nColor: " + block.Color + "\n" + "At: " + block.Position + + "\nText: " + block.Label; } if (GameState.IsSimulationMode()) { -- 2.30.2 From 269d30b0db52e8e2cc06ae87ef82b206c6f82fbd Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sun, 24 May 2020 21:55:49 +0200 Subject: [PATCH 038/252] Add support for connected bodies Added center of mass Removed delta velocities --- GamecraftModdingAPI/Blocks/BlockEngine.cs | 16 +++++++ GamecraftModdingAPI/Blocks/RemovalEngine.cs | 11 ----- GamecraftModdingAPI/Players/PlayerEngine.cs | 15 ------- GamecraftModdingAPI/SimBody.cs | 42 ++++++++++--------- .../Tests/GamecraftModdingAPIPluginTest.cs | 12 ++++-- 5 files changed, 47 insertions(+), 49 deletions(-) diff --git a/GamecraftModdingAPI/Blocks/BlockEngine.cs b/GamecraftModdingAPI/Blocks/BlockEngine.cs index eecebc2..eb462f9 100644 --- a/GamecraftModdingAPI/Blocks/BlockEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlockEngine.cs @@ -4,6 +4,8 @@ using Gamecraft.Wires; using RobocraftX.Blocks; using RobocraftX.Common; using RobocraftX.GUI.Hotbar.Colours; +using RobocraftX.Physics; +using RobocraftX.Scene.Simulation; using Svelto.DataStructures; using Svelto.ECS; @@ -126,6 +128,20 @@ namespace GamecraftModdingAPI.Blocks return ret.ToArray(); } + public SimBody[] GetConnectedSimBodies(uint id) + { + var joints = entitiesDB.QueryEntities(MachineSimulationGroups.JOINTS_GROUP); + var list = new FasterList(4); + foreach (var joint in joints) + { + if (joint.jointState == JointState.Broken) continue; + if (joint.connectedEntityA == id) list.Add(new SimBody(joint.connectedEntityB)); + else if (joint.connectedEntityB == id) list.Add(new SimBody(joint.connectedEntityA)); + } + + return list.ToArray(); + } + #if DEBUG public EntitiesDB GetEntitiesDB() { diff --git a/GamecraftModdingAPI/Blocks/RemovalEngine.cs b/GamecraftModdingAPI/Blocks/RemovalEngine.cs index 05ad7c9..2aadaaa 100644 --- a/GamecraftModdingAPI/Blocks/RemovalEngine.cs +++ b/GamecraftModdingAPI/Blocks/RemovalEngine.cs @@ -28,17 +28,6 @@ namespace GamecraftModdingAPI.Blocks public void Ready() { - /*CommandManager.AddCommand(new SimpleCustomCommandEngine(() => - { - var block = BlockUtility.GetBlockLookedAt(LocalPlayerIDUtility.GetLocalPlayerID(entitiesDB), entitiesDB); - if (block.HasValue) - { - RemoveBlock(block.Value); - Log.Output("Removed block."); - } - else - Log.Output("No block found where you're looking at."); - }, "removeCube", "Removes the cube you're looking at."));*/ } public EntitiesDB entitiesDB { get; set; } diff --git a/GamecraftModdingAPI/Players/PlayerEngine.cs b/GamecraftModdingAPI/Players/PlayerEngine.cs index d2c8fa3..1fa1296 100644 --- a/GamecraftModdingAPI/Players/PlayerEngine.cs +++ b/GamecraftModdingAPI/Players/PlayerEngine.cs @@ -249,21 +249,6 @@ namespace GamecraftModdingAPI.Players : maxDistance; if (rayCast.hit && rayCast.distance <= distance) return rayCast.hitEgid; - /*if (rayCast.hit) - { - *Logging.MetaDebugLog("RayCast EGID: " + rayCast.hitEgid); - var d = AccessTools.Field(typeof(ExclusiveGroup), "_knownGroups").GetValue(null) as - Dictionary; - foreach (var groupStruct in d) - { - if (groupStruct.Value == rayCast.hitEgid.groupID) - { - Logging.MetaDebugLog("Group name: " + groupStruct.Key); - break; //SIMULATION_BODIES_GROUP - } - }* - //Logging.MetaDebugLog("Position: " + Block.GetBlockPositionTest(rayCast.hitEgid)); - }*/ return null; } diff --git a/GamecraftModdingAPI/SimBody.cs b/GamecraftModdingAPI/SimBody.cs index f38df01..d9ba0c2 100644 --- a/GamecraftModdingAPI/SimBody.cs +++ b/GamecraftModdingAPI/SimBody.cs @@ -1,5 +1,4 @@ -using Gamecraft.Wires; -using RobocraftX.Common; +using RobocraftX.Common; using RobocraftX.Physics; using Svelto.ECS; using Unity.Mathematics; @@ -23,6 +22,10 @@ namespace GamecraftModdingAPI { } + /// + /// The position of this body. When setting the position, update the position of the connected bodies as well, + /// otherwise unexpected forces may arise. + /// public float3 Position { get => GetStruct().position; @@ -39,19 +42,7 @@ namespace GamecraftModdingAPI { get => GetStruct().angularVelocity; set => GetStruct().angularVelocity = value; - } - - public float3 DeltaVelocity - { - get => GetStruct().deltaVelocity; - set => GetStruct().deltaVelocity = value; - } - - public float3 DeltaAngularVelocity - { - get => GetStruct().deltaAngularVelocity; - set => GetStruct().deltaAngularVelocity = value; - } + } //Delta versions are used internally, can't be set or get public float3 Rotation { @@ -68,14 +59,27 @@ namespace GamecraftModdingAPI public float Mass { get => math.rcp(GetStruct().physicsMass.InverseMass); - set => GetStruct().physicsMass.InverseMass = math.rcp(value); + //set => GetStruct().physicsMass.InverseMass = math.rcp(value); + } + + public float3 CenterOfMass + { + get => GetStruct().physicsMass.CenterOfMass; + //set => GetStruct().physicsMass.CenterOfMass = value; } /// - /// Whether the body can be moved or static + /// Whether the body can be moved or static. /// - public bool Static => Block.BlockEngine.GetBlockInfo(Id).isStatic; - //Setting it doesn't have any effect + public bool Static => Block.BlockEngine.GetBlockInfo(Id).isStatic; //Setting it doesn't have any effect + + /// + /// The rigid bodies connected to this one via functional joints (broken ones don't count). + /// + public SimBody[] GetConnectedBodies() + { + return Block.BlockEngine.GetConnectedSimBodies(Id.entityID); + } private ref RigidBodyEntityStruct GetStruct() { diff --git a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs index 1342eae..783a33d 100644 --- a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs +++ b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs @@ -216,6 +216,11 @@ namespace GamecraftModdingAPI.Tests { Logging.CommandLog("SimBody: " + body); body.Position += new float3(0, 10, 0); + foreach (var bodyConnectedBody in body.GetConnectedBodies()) + { + Logging.CommandLog("Moving " + bodyConnectedBody); + bodyConnectedBody.Position += new float3(0, 10, 0); + } } }).Build(); @@ -296,9 +301,8 @@ namespace GamecraftModdingAPI.Tests if (body == null) return "Body: none"; return "Body: " + (body.Static ? "static" : "non-static") + "\nAt: " + body.Position + " - rotated: " + body.Rotation - + "\nWith mass: " + body.Mass - + "\nVelocity: " + body.Velocity + " - angular: " + body.AngularVelocity - + "\nDelta velocity: " + body.DeltaVelocity + " - angular: " + body.DeltaAngularVelocity; + + "\nWith mass: " + body.Mass + " - center: " + body.CenterOfMass + + "\nVelocity: " + body.Velocity + " - angular: " + body.AngularVelocity; } return "Switching modes..."; @@ -310,7 +314,7 @@ namespace GamecraftModdingAPI.Tests if (modsString != null) return modsString; StringBuilder sb = new StringBuilder("Installed mods:"); foreach (var plugin in PluginManager.Plugins) - sb.Append("\n" + plugin); + sb.Append("\n" + plugin.Name + " - " + plugin.Version); return modsString = sb.ToString(); } -- 2.30.2 From 0b8491cecfbc1a14b0f4ab6a0410bf5512a84f94 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Wed, 27 May 2020 17:20:53 +0200 Subject: [PATCH 039/252] Move Sync() to properties and improve Block doc --- GamecraftModdingAPI/Block.cs | 26 +++++++++---------- GamecraftModdingAPI/Blocks/BlockEngine.cs | 25 +++++++++++++++++- GamecraftModdingAPI/Blocks/PlacementEngine.cs | 5 ++-- GamecraftModdingAPI/Utility/AsyncUtils.cs | 1 + 4 files changed, 40 insertions(+), 17 deletions(-) diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index ff89be3..d7c37dc 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -32,6 +32,11 @@ namespace GamecraftModdingAPI /// Place a new block at the given position. If scaled, position means the center of the block. The default block size is 0.2 in terms of position. /// Place blocks next to each other to connect them. /// The placed block will be a complete block with a placement grid and collision which will be saved along with the game. + /// + /// When placing multiple blocks, do not access properties immediately after creation as this + /// triggers a sync each time which can affect performance and may cause issues with the game. + /// You may either use AsyncUtils.WaitForSubmission() after placing all of the blocks + /// or simply access the block properties which will trigger the synchronization the first time a property is used. /// /// The block's type /// The block's color @@ -60,7 +65,9 @@ namespace GamecraftModdingAPI /// Place blocks next to each other to connect them. /// The placed block will be a complete block with a placement grid and collision which will be saved along with the game. /// - /// This method waits for the block to be constructed in the game. + /// This method waits for the block to be constructed in the game which may take a significant amount of time. + /// Only use this to place a single block. + /// For placing multiple blocks, use PlaceNew() then AsyncUtils.WaitForSubmission() when done with placing blocks. /// /// The block's type /// The block's color @@ -107,11 +114,11 @@ namespace GamecraftModdingAPI Id = id; if (!BlockEngine.BlockExists(Id)) { - Sync(); + /*Sync(); if (!BlockEngine.BlockExists(Id)) { throw new BlockDoesNotExistException($"Block {Id.entityID} must be placed using PlaceNew(...) since it does not exist yet"); - } + }*/ } } @@ -119,17 +126,6 @@ namespace GamecraftModdingAPI { } - /// - /// Synchronize newly created entity components with entities DB. - /// This forces a partial game tick, so it may be slow. - /// This also has the potential to make Gamecraft unstable. - /// Use this sparingly. - /// - protected static void Sync() - { - DeterministicStepCompositionRootPatch.SubmitEntitiesNow(); - } - public EGID Id { get; protected set; } /// @@ -159,6 +155,7 @@ namespace GamecraftModdingAPI /// /// The block's non-uniform scale or zero if the block's invalid. Independent of the uniform scaling. + /// The default scale of 1 means 0.2 in terms of position. /// public float3 Scale { @@ -171,6 +168,7 @@ namespace GamecraftModdingAPI /// /// The block's uniform scale or zero if the block's invalid. Also sets the non-uniform scale. + /// The default scale of 1 means 0.2 in terms of position. /// public int UniformScale { diff --git a/GamecraftModdingAPI/Blocks/BlockEngine.cs b/GamecraftModdingAPI/Blocks/BlockEngine.cs index eb462f9..6b412a7 100644 --- a/GamecraftModdingAPI/Blocks/BlockEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlockEngine.cs @@ -10,6 +10,7 @@ using Svelto.DataStructures; using Svelto.ECS; using GamecraftModdingAPI.Engines; +using GamecraftModdingAPI.Utility; namespace GamecraftModdingAPI.Blocks { @@ -24,6 +25,8 @@ namespace GamecraftModdingAPI.Blocks public bool isRemovable => false; + internal bool Synced = true; + public void Dispose() { } @@ -60,6 +63,11 @@ namespace GamecraftModdingAPI.Blocks /// An editable reference to the struct public ref T GetBlockInfo(EGID blockID) where T : struct, IEntityComponent { + if (!Synced) + { + Sync(); + Synced = true; + } if (entitiesDB.Exists(blockID)) return ref entitiesDB.QueryEntity(blockID); T[] structHolder = new T[1]; //Create something that can be referenced @@ -76,11 +84,15 @@ namespace GamecraftModdingAPI.Blocks /// An editable reference to the struct public ref T GetBlockInfo(EGID blockID, out bool exists) where T : struct, IEntityComponent { + if (!Synced) + { + Sync(); + Synced = true; + } exists = entitiesDB.Exists(blockID); if (exists) return ref entitiesDB.QueryEntity(blockID); T[] structHolder = new T[1]; - //ref T defRef = ref structHolder[0]; return ref structHolder[0]; } @@ -142,6 +154,17 @@ namespace GamecraftModdingAPI.Blocks return list.ToArray(); } + /// + /// Synchronize newly created entity components with entities DB. + /// This forces a partial game tick, so it may be slow. + /// This also has the potential to make Gamecraft unstable. + /// Use this sparingly. + /// + private static void Sync() + { + DeterministicStepCompositionRootPatch.SubmitEntitiesNow(); + } + #if DEBUG public EntitiesDB GetEntitiesDB() { diff --git a/GamecraftModdingAPI/Blocks/PlacementEngine.cs b/GamecraftModdingAPI/Blocks/PlacementEngine.cs index 28642e8..35f0a92 100644 --- a/GamecraftModdingAPI/Blocks/PlacementEngine.cs +++ b/GamecraftModdingAPI/Blocks/PlacementEngine.cs @@ -24,7 +24,7 @@ namespace GamecraftModdingAPI.Blocks /// public class PlacementEngine : IApiEngine { - public bool IsInGame = false; + public bool IsInGame; public void Dispose() { @@ -119,6 +119,7 @@ namespace GamecraftModdingAPI.Blocks ref PickedBlockExtraDataStruct pickedBlock = ref entitiesDB.QueryEntity(playerEGID); pickedBlock.placedBlockEntityID = playerEGID; pickedBlock.placedBlockWasAPickedBlock = false; + Block.BlockEngine.Synced = false; // Block entities will need to be submitted before properties can be used return newBlockID; } @@ -126,7 +127,7 @@ namespace GamecraftModdingAPI.Blocks public bool isRemovable => false; - [HarmonyPatch] + [HarmonyPatch] public class FactoryObtainerPatch { static void Postfix(BlockEntityFactory blockEntityFactory) diff --git a/GamecraftModdingAPI/Utility/AsyncUtils.cs b/GamecraftModdingAPI/Utility/AsyncUtils.cs index fcb5878..c646f8f 100644 --- a/GamecraftModdingAPI/Utility/AsyncUtils.cs +++ b/GamecraftModdingAPI/Utility/AsyncUtils.cs @@ -10,6 +10,7 @@ namespace GamecraftModdingAPI.Utility /// /// Waits for entity submission asynchronously. + /// Use after placing a block or otherwise creating things in the game to access their properties. /// public static async Task WaitForSubmission() { -- 2.30.2 From 2d89b82759b8a65f67f6ff1c2de0b0a67a847bae Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Fri, 29 May 2020 21:30:24 -0400 Subject: [PATCH 040/252] Add player health and block-in-hand --- .../GamecraftModdingAPI.csproj | 2 +- GamecraftModdingAPI/Player.cs | 120 ++++++++++++++ GamecraftModdingAPI/Players/PlayerEngine.cs | 156 +++++++++++++++++- doxygen.conf | 2 +- 4 files changed, 272 insertions(+), 8 deletions(-) diff --git a/GamecraftModdingAPI/GamecraftModdingAPI.csproj b/GamecraftModdingAPI/GamecraftModdingAPI.csproj index 074c5b6..c72b77a 100644 --- a/GamecraftModdingAPI/GamecraftModdingAPI.csproj +++ b/GamecraftModdingAPI/GamecraftModdingAPI.csproj @@ -3,7 +3,7 @@ net472 true - 1.1.0 + 1.2.0 Exmods GNU General Public Licence 3+ https://git.exmods.org/modtainers/GamecraftModdingAPI diff --git a/GamecraftModdingAPI/Player.cs b/GamecraftModdingAPI/Player.cs index 0b7a134..501c3df 100644 --- a/GamecraftModdingAPI/Player.cs +++ b/GamecraftModdingAPI/Player.cs @@ -4,6 +4,7 @@ using Unity.Mathematics; using RobocraftX.Common; using GamecraftModdingAPI.Players; +using GamecraftModdingAPI.Blocks; namespace GamecraftModdingAPI { @@ -199,6 +200,125 @@ namespace GamecraftModdingAPI } } + /// + /// The player's initial health when entering Simulation (aka Time Running) mode. + /// + /// The initial health. + public float InitialHealth + { + get => playerEngine.GetInitialHealth(Id); + + set + { + playerEngine.SetInitialHealth(Id, value); + } + } + + /// + /// The player's current health in Simulation (aka Time Running) mode. + /// + /// The current health. + public float CurrentHealth + { + get => playerEngine.GetCurrentHealth(Id); + + set + { + playerEngine.DamagePlayer(Id, CurrentHealth - value); + } + } + + /// + /// Whether this is damageable. + /// + /// true if damageable; otherwise, false. + public bool Damageable + { + get => playerEngine.GetDamageable(Id); + + set + { + playerEngine.SetDamageable(Id, value); + } + } + + /// + /// The player's lives when initially entering Simulation (aka Time Running) mode. + /// + /// The initial lives. + public uint InitialLives + { + get => playerEngine.GetInitialLives(Id); + + set => playerEngine.SetInitialLives(Id, value); + } + + /// + /// The player's current lives in Simulation (aka Time Running) mode. + /// + /// The current lives. + public uint CurrentLives + { + get => playerEngine.GetCurrentLives(Id); + + set => playerEngine.SetCurrentLives(Id, value); + } + + /// + /// Whether the Game Over screen is displayed for the player. + /// + /// true if game over; otherwise, false. + public bool GameOver + { + get => playerEngine.GetGameOverScreen(Id); + } + + /// + /// Whether the player is dead. + /// If true, hopefully it was quick. + /// + /// true if dead; otherwise, false. + public bool Dead + { + get => playerEngine.IsDead(Id); + } + + /// + /// The player's selected block ID in their hand. + /// + /// The selected block. + public BlockIDs SelectedBlock + { + get + { + return (BlockIDs)playerEngine.GetSelectedBlock(Id); + } + } + + /// + /// The player's selected block color in their hand. + /// + /// The selected block's color. + public BlockColors SelectedColor + { + get + { + return (BlockColors)playerEngine.GetSelectedColor(Id); + } + } + + /// + /// The player's selected block colour in their hand. + /// + /// The selected block's colour. + public BlockColors SelectedColour + { + get + { + return (BlockColors)playerEngine.GetSelectedColor(Id); + } + } + // object methods /// diff --git a/GamecraftModdingAPI/Players/PlayerEngine.cs b/GamecraftModdingAPI/Players/PlayerEngine.cs index 1fa1296..c86a4ae 100644 --- a/GamecraftModdingAPI/Players/PlayerEngine.cs +++ b/GamecraftModdingAPI/Players/PlayerEngine.cs @@ -6,18 +6,20 @@ using RobocraftX.Character.Movement; using RobocraftX.Common.Players; using RobocraftX.Common.Input; using RobocraftX.Physics; +using RobocraftX.Blocks.Ghost; +using RobocraftX.Character.Camera; +using RobocraftX.Character.Factories; +using Gamecraft.CharacterVulnerability; +using Gamecraft.CharacterVulnerability.Entities; using Svelto.ECS; using Unity.Mathematics; using Unity.Physics; using GamecraftModdingAPI.Engines; -using RobocraftX.Blocks.Ghost; -using RobocraftX.Character.Camera; -using RobocraftX.Character.Factories; namespace GamecraftModdingAPI.Players { - internal class PlayerEngine : IApiEngine + internal class PlayerEngine : IApiEngine, IFactoryEngine { public string Name { get; } = "GamecraftModdingAPIPlayerGameEngine"; @@ -25,6 +27,8 @@ namespace GamecraftModdingAPI.Players public bool isRemovable => false; + public IEntityFactory Factory { set; private get; } + private bool isReady = false; public void Dispose() @@ -188,7 +192,7 @@ namespace GamecraftModdingAPI.Players public float? GetLastPingTime(uint playerId, PlayerType type) { - EGID egid = new EGID(playerId, GroupFromEnum(type)); + EGID egid = new EGID(playerId, PlayerGroupFromEnum(type)); if (entitiesDB.Exists(egid)) { return entitiesDB.QueryEntity(egid).lastPingTimeSinceLevelLoad; @@ -196,10 +200,150 @@ namespace GamecraftModdingAPI.Players return null; } + public float GetInitialHealth(uint playerId) + { + if (GetCharacterStruct(playerId, out CharacterHealthEntityStruct c)) + { + return c.initialHealth; + } + return -1f; + } + + public bool SetInitialHealth(uint playerId, float val) + { + if (GetCharacterStruct(playerId, out CharacterHealthEntityStruct c)) + { + c.initialHealth = val; + return true; + } + return false; + } + + public float GetCurrentHealth(uint playerId) + { + if (GetCharacterStruct(playerId, out CharacterHealthEntityStruct c)) + { + return c.currentHealth; + } + return -1f; + } + + public bool SetCurrentHealth(uint playerId, float val) + { + if (GetCharacterStruct(playerId, out CharacterHealthEntityStruct c)) + { + c.currentHealth = val; + return true; + } + return false; + } + + public bool DamagePlayer(uint playerId, float amount) + { + Factory.BuildEntity( + new EGID(CharacterVulnerabilityExclusiveGroups.NextDamageEntityId, CharacterVulnerabilityExclusiveGroups.CharacterDamageExclusiveGroup) + ).Init(new DamageEntityStruct + { + damage = amount, + targetPlayerEntityId = playerId, + }); + return true; + } + + public bool GetDamageable(uint playerId) + { + if (GetCharacterStruct(playerId, out CharacterHealthEntityStruct c)) + { + return c.canTakeDamageStat; + } + return false; + } + + public bool SetDamageable(uint playerId, bool val) + { + if (GetCharacterStruct(playerId, out CharacterHealthEntityStruct ches)) + { + ches.canTakeDamage = val; + ches.canTakeDamage = val; + return true; + } + return false; + } + + public uint GetInitialLives(uint playerId) + { + if (GetCharacterStruct(playerId, out CharacterLivesEntityComponent c)) + { + return c.initialLives; + } + return uint.MaxValue; + } + + public bool SetInitialLives(uint playerId, uint val) + { + if (GetCharacterStruct(playerId, out CharacterLivesEntityComponent c)) + { + c.initialLives = val; + return true; + } + return false; + } + + public uint GetCurrentLives(uint playerId) + { + if (GetCharacterStruct(playerId, out CharacterLivesEntityComponent c)) + { + return c.currentLives; + } + return uint.MaxValue; + } + + public bool SetCurrentLives(uint playerId, uint val) + { + if (GetCharacterStruct(playerId, out CharacterLivesEntityComponent c)) + { + c.currentLives = val; + return true; + } + return false; + } + + public bool GetGameOverScreen(uint playerId) + { + if (GetCharacterStruct(playerId, out CharacterLivesEntityComponent c)) + { + return c.gameOverScreen; + } + return false; + } + + public bool IsDead(uint playerId) + { + return entitiesDB.Exists(playerId, CharacterExclusiveGroups.DeadGroup); + } + + public int GetSelectedBlock(uint playerId) + { + if (GetCharacterStruct(playerId, out EquippedPartStruct c)) + { + return c.SelectedDBPartID; + } + return ushort.MaxValue; + } + + public byte GetSelectedColor(uint playerId) + { + if (GetCharacterStruct(playerId, out EquippedColourStruct c)) + { + return c.indexInPalette; + } + return 255; + } + // reusable methods [MethodImpl(MethodImplOptions.AggressiveInlining)] - private ExclusiveGroup GroupFromEnum(PlayerType type) + private ExclusiveGroup PlayerGroupFromEnum(PlayerType type) { return type == PlayerType.Local ? PlayersExclusiveGroups.LocalPlayers : PlayersExclusiveGroups.RemotePlayers; } diff --git a/doxygen.conf b/doxygen.conf index bdd0ed0..19df3c4 100644 --- a/doxygen.conf +++ b/doxygen.conf @@ -38,7 +38,7 @@ PROJECT_NAME = "GamecraftModdingAPI" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = "v1.1.0" +PROJECT_NUMBER = "v1.2.0" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a -- 2.30.2 From 98c7e624f82d6d9fae97b5dcd7313d298278bacb Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Fri, 29 May 2020 21:30:53 -0400 Subject: [PATCH 041/252] Add OOP Audio class --- GamecraftModdingAPI/Utility/Audio.cs | 106 +++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 GamecraftModdingAPI/Utility/Audio.cs diff --git a/GamecraftModdingAPI/Utility/Audio.cs b/GamecraftModdingAPI/Utility/Audio.cs new file mode 100644 index 0000000..9d227a8 --- /dev/null +++ b/GamecraftModdingAPI/Utility/Audio.cs @@ -0,0 +1,106 @@ +using System; +using System.Reflection; + +using FMOD.Studio; +using FMODUnity; +using RobocraftX.Common.Audio; +using Unity.Mathematics; + +namespace GamecraftModdingAPI.Utility +{ + public class Audio + { + private EventInstance sound; + + public Audio(string uri) : this(RuntimeManager.PathToGUID(uri)) + { + } + + public Audio(Guid uri) + { + sound = RuntimeManager.CreateInstance(uri); + } + + public static Audio Random() + { + System.Random potato = new System.Random(); + FieldInfo[] options = typeof(FMODAudioEvents).GetFields(); + Guid audio_uri; + while (true) + { + int index = potato.Next(0, options.Length); + try + { + audio_uri = (Guid)options[index].GetValue(null); + break; + } + catch (InvalidCastException) { } + } + return new Audio(audio_uri); + } + + public float this[string key] + { + get + { + sound.getParameterValue(key, out float val, out float finalVal); + return val; + } + + set => sound.setParameterValue(key, value); + } + + public float this[int index] + { + get + { + sound.getParameterValueByIndex(index, out float val, out float finalVal); + return val; + } + + set => sound.setParameterValueByIndex(index, value); + } + + public string[] Parameters + { + get + { + sound.getParameterCount(out int count); + string[] parameters = new string[count]; + for (int i = 0; i < count; i++) + { + sound.getParameterByIndex(i, out ParameterInstance param); + param.getDescription(out PARAMETER_DESCRIPTION desc); + parameters[i] = desc.name; + } + return parameters; + } + } + + public float3 Position + { + get + { + sound.get3DAttributes(out FMOD.ATTRIBUTES_3D attr); + return new float3(attr.position.x, attr.position.y, attr.position.z); + } + + set => sound.set3DAttributes(RuntimeUtils.To3DAttributes(value)); + } + + public void Play() + { + sound.start(); + } + + public void Stop(FMOD.Studio.STOP_MODE mode = FMOD.Studio.STOP_MODE.IMMEDIATE) + { + sound.stop(mode); + } + + ~Audio() // Use the wannabe C++ destructor to destroy the C++ object + { + sound.release(); + } + } +} -- 2.30.2 From dba7c0a46f7ae52ce355dc9fad141c6181e9bdcc Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Tue, 2 Jun 2020 03:12:40 +0200 Subject: [PATCH 042/252] Added 2 block events and removed BDNEException Added an event for placing and removing blocks Added a class to wrap event calls in a try-catch Removed BlockDoesNotExistException Made Block.GetSimBody() return null if block doesn't exist --- GamecraftModdingAPI/Block.cs | 34 ++++++++++----- .../Blocks/BlockEventsEngine.cs | 42 +++++++++++++++++++ GamecraftModdingAPI/Blocks/BlockExceptions.cs | 11 ----- .../Tests/GamecraftModdingAPIPluginTest.cs | 4 ++ GamecraftModdingAPI/Utility/ExceptionUtil.cs | 29 +++++++++++++ 5 files changed, 98 insertions(+), 22 deletions(-) create mode 100644 GamecraftModdingAPI/Blocks/BlockEventsEngine.cs create mode 100644 GamecraftModdingAPI/Utility/ExceptionUtil.cs diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index d7c37dc..7a65d04 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -25,6 +25,7 @@ namespace GamecraftModdingAPI protected static readonly RotationEngine RotationEngine = new RotationEngine(); protected static readonly RemovalEngine RemovalEngine = new RemovalEngine(); protected static readonly SignalEngine SignalEngine = new SignalEngine(); + protected static readonly BlockEventsEngine BlockEventsEngine = new BlockEventsEngine(); protected internal static readonly BlockEngine BlockEngine = new BlockEngine(); @@ -109,17 +110,27 @@ namespace GamecraftModdingAPI return new Block(BlockIdentifiers.LatestBlockID); } + /// + /// An event that fires each time a block is placed. + /// + public static event EventHandler Placed + { + add => BlockEventsEngine.Placed += value; + remove => BlockEventsEngine.Placed -= value; + } + + /// + /// An event that fires each time a block is removed. + /// + public static event EventHandler Removed + { + add => BlockEventsEngine.Removed += value; + remove => BlockEventsEngine.Removed -= value; + } + public Block(EGID id) { Id = id; - if (!BlockEngine.BlockExists(Id)) - { - /*Sync(); - if (!BlockEngine.BlockExists(Id)) - { - throw new BlockDoesNotExistException($"Block {Id.entityID} must be placed using PlaceNew(...) since it does not exist yet"); - }*/ - } } public Block(uint id) : this(new EGID(id, CommonExclusiveGroups.OWNED_BLOCKS_GROUP)) @@ -264,11 +275,11 @@ namespace GamecraftModdingAPI /// Returns the rigid body of the cluster of blocks this one belongs to during simulation. /// Can be used to apply forces or move the block around while the simulation is running. /// - /// The SimBody of the cluster + /// The SimBody of the cluster or null if the block doesn't exist. public SimBody GetSimBody() { - uint id = BlockEngine.GetBlockInfo(Id).machineRigidBodyId; - return new SimBody(id); + uint id = BlockEngine.GetBlockInfo(Id, out var exists).machineRigidBodyId; + return exists ? new SimBody(id) : null; } public override string ToString() @@ -283,6 +294,7 @@ namespace GamecraftModdingAPI GameEngineManager.AddGameEngine(RotationEngine); GameEngineManager.AddGameEngine(RemovalEngine); GameEngineManager.AddGameEngine(BlockEngine); + GameEngineManager.AddGameEngine(BlockEventsEngine); } /// diff --git a/GamecraftModdingAPI/Blocks/BlockEventsEngine.cs b/GamecraftModdingAPI/Blocks/BlockEventsEngine.cs new file mode 100644 index 0000000..3c34b65 --- /dev/null +++ b/GamecraftModdingAPI/Blocks/BlockEventsEngine.cs @@ -0,0 +1,42 @@ +using System; +using GamecraftModdingAPI.Engines; +using GamecraftModdingAPI.Utility; +using RobocraftX.Common; +using Svelto.ECS; + +namespace GamecraftModdingAPI.Blocks +{ + public class BlockEventsEngine : IReactionaryEngine + { + public event EventHandler Placed; + public event EventHandler Removed; + + public void Ready() + { + } + + public EntitiesDB entitiesDB { get; set; } + public void Dispose() + { + } + + public string Name { get; } = "GamecraftModdingAPIBlockEventsEngine"; + public bool isRemovable { get; } = false; + + public void Add(ref DBEntityStruct entityComponent, EGID egid) + { + ExceptionUtil.InvokeEvent(Placed, this, new BlockPlacedRemovedEventArgs {ID = egid, Type = (BlockIDs) entityComponent.DBID}); + } + + public void Remove(ref DBEntityStruct entityComponent, EGID egid) + { + ExceptionUtil.InvokeEvent(Removed, this, new BlockPlacedRemovedEventArgs {ID = egid, Type = (BlockIDs) entityComponent.DBID}); + } + } + + public struct BlockPlacedRemovedEventArgs + { + public EGID ID; + public BlockIDs Type; + } +} \ No newline at end of file diff --git a/GamecraftModdingAPI/Blocks/BlockExceptions.cs b/GamecraftModdingAPI/Blocks/BlockExceptions.cs index 557282a..47af014 100644 --- a/GamecraftModdingAPI/Blocks/BlockExceptions.cs +++ b/GamecraftModdingAPI/Blocks/BlockExceptions.cs @@ -40,15 +40,4 @@ namespace GamecraftModdingAPI.Blocks { } } - - public class BlockDoesNotExistException : BlockException - { - public BlockDoesNotExistException() - { - } - - public BlockDoesNotExistException(string message) : base(message) - { - } - } } diff --git a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs index 783a33d..1e249bb 100644 --- a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs +++ b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs @@ -226,6 +226,10 @@ namespace GamecraftModdingAPI.Tests GameClient.SetDebugInfo("lookedAt", LookedAt); GameClient.SetDebugInfo("InstalledMods", InstalledMods); + Block.Placed += (sender, args) => + Logging.MetaDebugLog("Placed block " + args.Type + " with ID " + args.ID); + Block.Removed += (sender, args) => + Logging.MetaDebugLog("Removed block " + args.Type + " with ID " + args.ID); /* CommandManager.AddCommand(new SimpleCustomCommandEngine((float d) => { UnityEngine.Camera.main.fieldOfView = d; }, diff --git a/GamecraftModdingAPI/Utility/ExceptionUtil.cs b/GamecraftModdingAPI/Utility/ExceptionUtil.cs new file mode 100644 index 0000000..63d0fef --- /dev/null +++ b/GamecraftModdingAPI/Utility/ExceptionUtil.cs @@ -0,0 +1,29 @@ +using System; +using GamecraftModdingAPI.Events; + +namespace GamecraftModdingAPI.Utility +{ + public static class ExceptionUtil + { + /// + /// Invokes an event in a try-catch block to avoid propagating exceptions. + /// + /// The event to emit, can be null + /// Event sender + /// Event arguments + /// Type of the event arguments + public static void InvokeEvent(EventHandler handler, object sender, T args) + { + try + { + handler?.Invoke(sender, args); + } + catch (Exception e) + { + EventRuntimeException wrappedException = + new EventRuntimeException($"EventHandler with arg type {typeof(T).Name} threw an exception", e); + Logging.LogWarning(wrappedException.ToString()); + } + } + } +} \ No newline at end of file -- 2.30.2 From 5660bfc28d410e816aa8cd7f4a7e16f11c979477 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Wed, 3 Jun 2020 01:49:54 +0200 Subject: [PATCH 043/252] Fix connected blocks not being detected in prefabs Apparently they're processed, unlike in my save --- GamecraftModdingAPI/Blocks/BlockEngine.cs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/GamecraftModdingAPI/Blocks/BlockEngine.cs b/GamecraftModdingAPI/Blocks/BlockEngine.cs index 6b412a7..a2fdc51 100644 --- a/GamecraftModdingAPI/Blocks/BlockEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlockEngine.cs @@ -39,11 +39,17 @@ namespace GamecraftModdingAPI.Blocks { if (!BlockExists(blockID)) return new Block[0]; Stack cubeStack = new Stack(); - FasterList cubesToProcess = new FasterList(); - ConnectedCubesUtility.TreeTraversal.GetConnectedCubes(entitiesDB, blockID.entityID, cubeStack, cubesToProcess, (in GridConnectionsEntityStruct g) => { return false; }); - var ret = new Block[cubesToProcess.count]; - for (int i = 0; i < cubesToProcess.count; i++) - ret[i] = new Block(cubesToProcess[i]); + FasterList cubes = new FasterList(10); + var coll = entitiesDB.QueryEntities(CommonExclusiveGroups + .OWNED_BLOCKS_GROUP); + for (int i = 0; i < coll.count; i++) + coll[i].isProcessed = false; + + ConnectedCubesUtility.TreeTraversal.GetConnectedCubes(entitiesDB, blockID.entityID, cubeStack, cubes, (in GridConnectionsEntityStruct g) => { return false; }); + + var ret = new Block[cubes.count]; + for (int i = 0; i < cubes.count; i++) + ret[i] = new Block(cubes[i]); return ret; } -- 2.30.2 From 6a137472c185d18b99d2b121512a3e23c61b2343 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Tue, 2 Jun 2020 20:38:35 -0400 Subject: [PATCH 044/252] Fix Block type exception on unsynced Specialize() --- GamecraftModdingAPI/Blocks/BlockEngine.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/GamecraftModdingAPI/Blocks/BlockEngine.cs b/GamecraftModdingAPI/Blocks/BlockEngine.cs index a2fdc51..1d9f8c9 100644 --- a/GamecraftModdingAPI/Blocks/BlockEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlockEngine.cs @@ -104,11 +104,21 @@ namespace GamecraftModdingAPI.Blocks public bool BlockExists(EGID id) { + if (!Synced) + { + Sync(); + Synced = true; + } return entitiesDB.Exists(id); } public bool GetBlockInfoExists(EGID blockID) where T : struct, IEntityComponent { + if (!Synced) + { + Sync(); + Synced = true; + } return entitiesDB.Exists(blockID); } -- 2.30.2 From 197fc5f2f91fe2d0e7fb3ee8dfac63c4079f51fc Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Wed, 3 Jun 2020 14:37:11 -0400 Subject: [PATCH 045/252] Update twitter link --- docs/footer.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/footer.html b/docs/footer.html index 7150873..a518f55 100644 --- a/docs/footer.html +++ b/docs/footer.html @@ -7,7 +7,7 @@ - + @@ -17,7 +17,7 @@ $generatedby   doxygen $doxygenversion -Contact ExMods | Discord | Twitter | Email | +Contact ExMods | Discord | Twitter | Email | -- 2.30.2 From f62211309ecdbe54c27b55831629b4118fd10a6f Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Thu, 4 Jun 2020 01:42:13 +0200 Subject: [PATCH 046/252] Added WaitForNextFrame() and fixed block scaling A bit hacky, but it works --- GamecraftModdingAPI/Block.cs | 12 +++- GamecraftModdingAPI/Blocks/ScalingEngine.cs | 62 +++++++++++++++++++ .../Events/GameActivatedComposePatch.cs | 10 +-- GamecraftModdingAPI/Player.cs | 2 +- .../Tests/GamecraftModdingAPIPluginTest.cs | 27 -------- GamecraftModdingAPI/Utility/AsyncUtils.cs | 5 ++ .../Utility/AsyncUtilsEngine.cs | 13 ++++ 7 files changed, 98 insertions(+), 33 deletions(-) create mode 100644 GamecraftModdingAPI/Blocks/ScalingEngine.cs diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index 7a65d04..d7752c8 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -7,6 +7,7 @@ using Svelto.ECS.EntityStructs; using RobocraftX.Common; using RobocraftX.Blocks; using Unity.Mathematics; +using Unity.Entities; using Gamecraft.Blocks.GUI; using GamecraftModdingAPI.Blocks; @@ -26,6 +27,7 @@ namespace GamecraftModdingAPI protected static readonly RemovalEngine RemovalEngine = new RemovalEngine(); protected static readonly SignalEngine SignalEngine = new SignalEngine(); protected static readonly BlockEventsEngine BlockEventsEngine = new BlockEventsEngine(); + protected static readonly ScalingEngine ScalingEngine = new ScalingEngine(); protected internal static readonly BlockEngine BlockEngine = new BlockEngine(); @@ -173,7 +175,10 @@ namespace GamecraftModdingAPI get => BlockEngine.GetBlockInfo(Id).scale; set { - BlockEngine.GetBlockInfo(Id).scale = value; + if (!Exists) return; //UpdateCollision needs the block to exist + ref var scaling = ref BlockEngine.GetBlockInfo(Id); + scaling.scale = value; + ScalingEngine.UpdateCollision(Id); } } @@ -295,6 +300,7 @@ namespace GamecraftModdingAPI GameEngineManager.AddGameEngine(RemovalEngine); GameEngineManager.AddGameEngine(BlockEngine); GameEngineManager.AddGameEngine(BlockEventsEngine); + GameEngineManager.AddGameEngine(ScalingEngine); } /// @@ -325,5 +331,9 @@ namespace GamecraftModdingAPI } } #endif + internal static void Setup(World physicsWorld) + { + ScalingEngine.Setup(physicsWorld.EntityManager); + } } } \ No newline at end of file diff --git a/GamecraftModdingAPI/Blocks/ScalingEngine.cs b/GamecraftModdingAPI/Blocks/ScalingEngine.cs new file mode 100644 index 0000000..a531865 --- /dev/null +++ b/GamecraftModdingAPI/Blocks/ScalingEngine.cs @@ -0,0 +1,62 @@ +using System.Reflection; + +using HarmonyLib; +using RobocraftX.Common; +using RobocraftX.UECS; +using Svelto.ECS; +using Unity.Entities; + +using GamecraftModdingAPI.Engines; +using GamecraftModdingAPI.Utility; + +namespace GamecraftModdingAPI.Blocks +{ + public class ScalingEngine : IApiEngine + { + private static IReactOnAddAndRemove physicsEngine; + + public void Ready() + { + } + + public EntitiesDB entitiesDB { get; set; } + public void Dispose() + { + } + + public string Name { get; } = "GamecraftModdingAPIScalingEngine"; + public bool isRemovable { get; } = false; + + private static EntityManager _entityManager; //Unity entity manager + + public void UpdateCollision(EGID egid) + { + //Assuming the block exists + var entity = entitiesDB.QueryEntity(egid).uecsEntity; + var pes = new UECSPhysicsEntityCreationStruct(); + physicsEngine.Add(ref pes, egid); //Create new UECS entity + _entityManager.DestroyEntity(entity); + } + + internal void Setup(EntityManager entityManager) + { + _entityManager = entityManager; + } + + [HarmonyPatch] + public class PhysicsEnginePatch + { + static void Postfix(IReactOnAddAndRemove __instance) + { + physicsEngine = __instance; + Logging.MetaDebugLog("Physics engine injected."); + } + + static MethodBase TargetMethod(Harmony instance) + { + return AccessTools.Method("RobocraftX.StateSync.HandleUECSPhysicEntitiesWithPrefabCreationEngine" + + ":Ready"); + } + } + } +} \ No newline at end of file diff --git a/GamecraftModdingAPI/Events/GameActivatedComposePatch.cs b/GamecraftModdingAPI/Events/GameActivatedComposePatch.cs index 35f075e..4481f4b 100644 --- a/GamecraftModdingAPI/Events/GameActivatedComposePatch.cs +++ b/GamecraftModdingAPI/Events/GameActivatedComposePatch.cs @@ -6,11 +6,11 @@ using System.Text; using System.Threading.Tasks; using HarmonyLib; -using RobocraftX; +using RobocraftX.CR.MainGame; using Svelto.ECS; +using Unity.Entities; using GamecraftModdingAPI.Utility; -using RobocraftX.CR.MainGame; namespace GamecraftModdingAPI.Events { @@ -24,13 +24,15 @@ namespace GamecraftModdingAPI.Events public static bool IsGameReloading = false; - public static void Postfix(ref object contextHolder, ref EnginesRoot enginesRoot) + public static void Postfix(ref object contextHolder, ref EnginesRoot enginesRoot, World physicsWorld) { // register custom game engines GameEngineManager.RegisterEngines(enginesRoot); // initialize AsyncUtils AsyncUtils.Setup(enginesRoot); - // A new EnginesRoot is always created when ActivateGame is called + // initialize Block + Block.Setup(physicsWorld); + // A new EnginesRoot is always created when ActivateGame is called // so all event emitters and handlers must be re-registered. EventManager.RegisterEngines(enginesRoot); Logging.Log("Dispatching Game Activated event"); diff --git a/GamecraftModdingAPI/Player.cs b/GamecraftModdingAPI/Player.cs index 501c3df..af20e36 100644 --- a/GamecraftModdingAPI/Player.cs +++ b/GamecraftModdingAPI/Player.cs @@ -340,7 +340,7 @@ namespace GamecraftModdingAPI } /// - /// Returns the block the player is currently looking at. + /// Returns the block the player is currently looking at in build mode. /// /// The maximum distance from the player (default is the player's building reach) /// The block or null if not found diff --git a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs index 1e249bb..d505806 100644 --- a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs +++ b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs @@ -224,7 +224,6 @@ namespace GamecraftModdingAPI.Tests } }).Build(); - GameClient.SetDebugInfo("lookedAt", LookedAt); GameClient.SetDebugInfo("InstalledMods", InstalledMods); Block.Placed += (sender, args) => Logging.MetaDebugLog("Placed block " + args.Type + " with ID " + args.ID); @@ -286,32 +285,6 @@ namespace GamecraftModdingAPI.Tests } } - private Player player; - - private string LookedAt() - { - if (player == null) - player = new Player(PlayerType.Local); - if (GameState.IsBuildMode()) - { - Block block = player.GetBlockLookedAt(); - if (block == null) return "Block: none"; - return "Block: " + block.Type + "\nColor: " + block.Color + "\n" + "At: " + block.Position - + "\nText: " + block.Label; - } - if (GameState.IsSimulationMode()) - { - SimBody body = player.GetSimBodyLookedAt(); - if (body == null) return "Body: none"; - return "Body: " + (body.Static ? "static" : "non-static") - + "\nAt: " + body.Position + " - rotated: " + body.Rotation - + "\nWith mass: " + body.Mass + " - center: " + body.CenterOfMass - + "\nVelocity: " + body.Velocity + " - angular: " + body.AngularVelocity; - } - - return "Switching modes..."; - } - private string modsString; private string InstalledMods() { diff --git a/GamecraftModdingAPI/Utility/AsyncUtils.cs b/GamecraftModdingAPI/Utility/AsyncUtils.cs index c646f8f..8fed9ee 100644 --- a/GamecraftModdingAPI/Utility/AsyncUtils.cs +++ b/GamecraftModdingAPI/Utility/AsyncUtils.cs @@ -17,6 +17,11 @@ namespace GamecraftModdingAPI.Utility await gameEngine.WaitForSubmission(); } + public static async Task WaitForNextFrame() + { + await gameEngine.WaitForNextFrame(); + } + public static void Setup(EnginesRoot enginesRoot) { gameEngine.Setup(enginesRoot.GenerateEntityFunctions(), enginesRoot.GenerateEntityFactory()); diff --git a/GamecraftModdingAPI/Utility/AsyncUtilsEngine.cs b/GamecraftModdingAPI/Utility/AsyncUtilsEngine.cs index 9027de1..f46bd6c 100644 --- a/GamecraftModdingAPI/Utility/AsyncUtilsEngine.cs +++ b/GamecraftModdingAPI/Utility/AsyncUtilsEngine.cs @@ -22,6 +22,12 @@ namespace GamecraftModdingAPI.Utility task.SetResult(null); } + private IEnumerator WaitForNextFrameInternal(TaskCompletionSource task) + { + yield return null; + task.SetResult(null); + } + public Task WaitForSubmission() { var task = new TaskCompletionSource(); @@ -29,6 +35,13 @@ namespace GamecraftModdingAPI.Utility return task.Task; } + public Task WaitForNextFrame() + { + var task = new TaskCompletionSource(); + WaitForNextFrameInternal(task).RunOn(ExtraLean.EveryFrameStepRunner); + return task.Task; + } + public void Setup(IEntityFunctions efu, IEntityFactory efa) { _efu = efu; -- 2.30.2 From cd78fd67181757051cf6b9ceb957de78c062e726 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Thu, 4 Jun 2020 08:30:53 -0400 Subject: [PATCH 047/252] Fix expired discord invite --- docs/footer.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/footer.html b/docs/footer.html index a518f55..314cef7 100644 --- a/docs/footer.html +++ b/docs/footer.html @@ -7,7 +7,7 @@ - + @@ -17,7 +17,7 @@ $generatedby   doxygen $doxygenversion -Contact ExMods | Discord | Twitter | Email | +Contact ExMods | Discord | Twitter | Email | -- 2.30.2 From cae626197f5f736311bc092cf642766a9cc90dbe Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Fri, 5 Jun 2020 00:20:35 +0200 Subject: [PATCH 048/252] Implement Equals for the OOPs & fix Player properties Fixed setting player properties Changed player rotation to float3 Added constructor for BlockColor with an index param Improved Player.Exists() ~~hopefully~~ --- GamecraftModdingAPI/Block.cs | 32 +++++- GamecraftModdingAPI/Blocks/BlockColor.cs | 20 ++++ GamecraftModdingAPI/Player.cs | 44 ++++++-- GamecraftModdingAPI/Players/PlayerEngine.cs | 116 +++++++++++--------- GamecraftModdingAPI/SimBody.cs | 33 +++++- 5 files changed, 178 insertions(+), 67 deletions(-) diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index d7752c8..f97c57c 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -19,7 +19,7 @@ namespace GamecraftModdingAPI /// A single (perhaps scaled) block. Properties may return default values if the block is removed and then setting them is ignored. /// For specific block type operations, use the specialised block classes in the GamecraftModdingAPI.Blocks namespace. /// - public class Block + public class Block : IEquatable, IEquatable { protected static readonly PlacementEngine PlacementEngine = new PlacementEngine(); protected static readonly MovementEngine MovementEngine = new MovementEngine(); @@ -139,7 +139,7 @@ namespace GamecraftModdingAPI { } - public EGID Id { get; protected set; } + public EGID Id { get; } /// /// The block's current position or zero if the block no longer exists. @@ -218,8 +218,7 @@ namespace GamecraftModdingAPI { byte index = BlockEngine.GetBlockInfo(Id, out var exists).indexInPalette; if (!exists) index = byte.MaxValue; - if (index == byte.MaxValue) return new BlockColor { Color = BlockColors.Default }; - return new BlockColor { Color = (BlockColors)(index % 10), Darkness = (byte)(index / 10) }; + return new BlockColor(index); } set { @@ -292,6 +291,31 @@ namespace GamecraftModdingAPI return $"{nameof(Id)}: {Id}, {nameof(Position)}: {Position}, {nameof(Type)}: {Type}, {nameof(Color)}: {Color}, {nameof(Exists)}: {Exists}"; } + public bool Equals(Block other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + return Id.Equals(other.Id); + } + + public bool Equals(EGID other) + { + return Id.Equals(other); + } + + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != this.GetType()) return false; + return Equals((Block) obj); + } + + public override int GetHashCode() + { + return Id.GetHashCode(); + } + public static void Init() { GameEngineManager.AddGameEngine(PlacementEngine); diff --git a/GamecraftModdingAPI/Blocks/BlockColor.cs b/GamecraftModdingAPI/Blocks/BlockColor.cs index fc87eb7..d7ada0d 100644 --- a/GamecraftModdingAPI/Blocks/BlockColor.cs +++ b/GamecraftModdingAPI/Blocks/BlockColor.cs @@ -5,6 +5,26 @@ public BlockColors Color; public byte Darkness; + public BlockColor(byte index) + { + if (index == byte.MaxValue) + { + Color = BlockColors.Default; + Darkness = 0; + } + else + { + Color = (BlockColors) (index % 10); + Darkness = (byte) (index / 10); + } + } + + public BlockColor(BlockColors color, byte darkness) + { + Color = color; + Darkness = darkness; + } + public override string ToString() { return $"{nameof(Color)}: {Color}, {nameof(Darkness)}: {Darkness}"; diff --git a/GamecraftModdingAPI/Player.cs b/GamecraftModdingAPI/Player.cs index af20e36..086c910 100644 --- a/GamecraftModdingAPI/Player.cs +++ b/GamecraftModdingAPI/Player.cs @@ -2,6 +2,8 @@ using Unity.Mathematics; using RobocraftX.Common; +using RobocraftX.Common.Players; +using Svelto.ECS; using GamecraftModdingAPI.Players; using GamecraftModdingAPI.Blocks; @@ -11,7 +13,7 @@ namespace GamecraftModdingAPI /// /// An in-game player character. Any Leo you see is a player. /// - public class Player + public class Player : IEquatable, IEquatable { // static functionality private static PlayerEngine playerEngine = new PlayerEngine(); @@ -63,7 +65,6 @@ namespace GamecraftModdingAPI /// The player type. Chooses the first available player matching the criteria. public Player(PlayerType player) { - uint localId = playerEngine.GetLocalPlayer(); switch (player) { case PlayerType.Local: @@ -93,7 +94,7 @@ namespace GamecraftModdingAPI /// The player's unique identifier. /// /// The identifier. - public uint Id { get; private set; } + public uint Id { get; } /// /// The player's current position. @@ -116,7 +117,7 @@ namespace GamecraftModdingAPI /// The player's current rotation. /// /// The rotation. - public quaternion Rotation + public float3 Rotation { get { @@ -299,11 +300,11 @@ namespace GamecraftModdingAPI /// The player's selected block color in their hand. /// /// The selected block's color. - public BlockColors SelectedColor + public BlockColor SelectedColor { get { - return (BlockColors)playerEngine.GetSelectedColor(Id); + return new BlockColor(playerEngine.GetSelectedColor(Id)); } } @@ -311,11 +312,11 @@ namespace GamecraftModdingAPI /// The player's selected block colour in their hand. /// /// The selected block's colour. - public BlockColors SelectedColour + public BlockColor SelectedColour { get { - return (BlockColors)playerEngine.GetSelectedColor(Id); + return new BlockColor(playerEngine.GetSelectedColor(Id)); } } @@ -365,6 +366,33 @@ namespace GamecraftModdingAPI : null; } + public bool Equals(Player other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + return Id == other.Id; + } + + public bool Equals(EGID other) + { + return Id == other.entityID && other.groupID == (Type == PlayerType.Local + ? PlayersExclusiveGroups.LocalPlayers + : PlayersExclusiveGroups.RemotePlayers); + } + + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != this.GetType()) return false; + return Equals((Player) obj); + } + + public override int GetHashCode() + { + return (int) Id; + } + // internal methods public static void Init() diff --git a/GamecraftModdingAPI/Players/PlayerEngine.cs b/GamecraftModdingAPI/Players/PlayerEngine.cs index c86a4ae..bcbfd11 100644 --- a/GamecraftModdingAPI/Players/PlayerEngine.cs +++ b/GamecraftModdingAPI/Players/PlayerEngine.cs @@ -14,6 +14,7 @@ using Gamecraft.CharacterVulnerability.Entities; using Svelto.ECS; using Unity.Mathematics; using Unity.Physics; +using UnityEngine; using GamecraftModdingAPI.Engines; @@ -65,28 +66,14 @@ namespace GamecraftModdingAPI.Players public bool ExistsById(uint playerId) { - PlayerIDStruct[] players = entitiesDB.QueryEntities(PlayersExclusiveGroups.LocalPlayers).ToFastAccess(out uint count); - for (int i = 0; i < count; i++) - { - if (players[i].ID.entityID == playerId) - { - return true; - } - } - players = entitiesDB.QueryEntities(PlayersExclusiveGroups.RemotePlayers).ToFastAccess(out count); - for (int i = 0; i < count; i++) - { - if (players[i].ID.entityID == playerId) - { - return true; - } - } - return false; + return entitiesDB.Exists(playerId, PlayersExclusiveGroups.LocalPlayers) + || entitiesDB.Exists(playerId, PlayersExclusiveGroups.RemotePlayers); } public float3 GetLocation(uint playerId) { - if (GetCharacterStruct(playerId, out RigidBodyEntityStruct rbes)) + ref var rbes = ref GetCharacterStruct(playerId, out bool exists); + if (exists) { return rbes.position; } @@ -114,20 +101,24 @@ namespace GamecraftModdingAPI.Players return false; } - public quaternion GetRotation(uint playerId) + public float3 GetRotation(uint playerId) { - if (GetCharacterStruct(playerId, out RigidBodyEntityStruct rbes)) - { - return rbes.rotation; - } - return quaternion.identity; + ref var rbes = ref GetCharacterStruct(playerId, out bool exists); + if (exists) + { + return ((Quaternion) rbes.rotation).eulerAngles; + } + return default; } - public bool SetRotation(uint playerId, quaternion value) + public bool SetRotation(uint playerId, float3 value) { - if (GetCharacterStruct(playerId, out RigidBodyEntityStruct rbes)) + ref var rbes = ref GetCharacterStruct(playerId, out bool exists); + if (exists) { - rbes.rotation = value; + Quaternion q = rbes.rotation; + q.eulerAngles = value; + rbes.rotation = q; return true; } return false; @@ -135,7 +126,8 @@ namespace GamecraftModdingAPI.Players public float3 GetLinearVelocity(uint playerId) { - if (GetCharacterStruct(playerId, out RigidBodyEntityStruct rbes)) + ref var rbes = ref GetCharacterStruct(playerId, out bool exists); + if (exists) { return rbes.velocity; } @@ -144,7 +136,8 @@ namespace GamecraftModdingAPI.Players public bool SetLinearVelocity(uint playerId, float3 value) { - if (GetCharacterStruct(playerId, out RigidBodyEntityStruct rbes)) + ref var rbes = ref GetCharacterStruct(playerId, out bool exists); + if (exists) { rbes.velocity = value; return true; @@ -154,7 +147,8 @@ namespace GamecraftModdingAPI.Players public float3 GetAngularVelocity(uint playerId) { - if (GetCharacterStruct(playerId, out RigidBodyEntityStruct rbes)) + ref var rbes = ref GetCharacterStruct(playerId, out bool exists); + if (exists) { return rbes.angularVelocity; } @@ -163,7 +157,8 @@ namespace GamecraftModdingAPI.Players public bool SetAngularVelocity(uint playerId, float3 value) { - if (GetCharacterStruct(playerId, out RigidBodyEntityStruct rbes)) + ref var rbes = ref GetCharacterStruct(playerId, out bool exists); + if (exists) { rbes.angularVelocity = value; return true; @@ -173,7 +168,8 @@ namespace GamecraftModdingAPI.Players public PhysicsMass GetMass(uint playerId) { - if (GetCharacterStruct(playerId, out RigidBodyEntityStruct rbes)) + ref var rbes = ref GetCharacterStruct(playerId, out bool exists); + if (exists) { return rbes.physicsMass; } @@ -182,7 +178,8 @@ namespace GamecraftModdingAPI.Players public bool SetInverseMass(uint playerId, float inverseMass) { - if (GetCharacterStruct(playerId, out RigidBodyEntityStruct rbes)) + ref var rbes = ref GetCharacterStruct(playerId, out bool exists); + if (exists) { rbes.physicsMass.InverseInertia = inverseMass; return true; @@ -202,7 +199,8 @@ namespace GamecraftModdingAPI.Players public float GetInitialHealth(uint playerId) { - if (GetCharacterStruct(playerId, out CharacterHealthEntityStruct c)) + ref var c = ref GetCharacterStruct(playerId, out bool exists); + if (exists) { return c.initialHealth; } @@ -211,7 +209,8 @@ namespace GamecraftModdingAPI.Players public bool SetInitialHealth(uint playerId, float val) { - if (GetCharacterStruct(playerId, out CharacterHealthEntityStruct c)) + ref var c = ref GetCharacterStruct(playerId, out bool exists); + if (exists) { c.initialHealth = val; return true; @@ -221,7 +220,8 @@ namespace GamecraftModdingAPI.Players public float GetCurrentHealth(uint playerId) { - if (GetCharacterStruct(playerId, out CharacterHealthEntityStruct c)) + ref var c = ref GetCharacterStruct(playerId, out bool exists); + if (exists) { return c.currentHealth; } @@ -230,7 +230,8 @@ namespace GamecraftModdingAPI.Players public bool SetCurrentHealth(uint playerId, float val) { - if (GetCharacterStruct(playerId, out CharacterHealthEntityStruct c)) + ref var c = ref GetCharacterStruct(playerId, out bool exists); + if (exists) { c.currentHealth = val; return true; @@ -252,7 +253,8 @@ namespace GamecraftModdingAPI.Players public bool GetDamageable(uint playerId) { - if (GetCharacterStruct(playerId, out CharacterHealthEntityStruct c)) + ref var c = ref GetCharacterStruct(playerId, out bool exists); + if (exists) { return c.canTakeDamageStat; } @@ -261,7 +263,8 @@ namespace GamecraftModdingAPI.Players public bool SetDamageable(uint playerId, bool val) { - if (GetCharacterStruct(playerId, out CharacterHealthEntityStruct ches)) + ref var ches = ref GetCharacterStruct(playerId, out bool exists); + if (exists) { ches.canTakeDamage = val; ches.canTakeDamage = val; @@ -272,7 +275,8 @@ namespace GamecraftModdingAPI.Players public uint GetInitialLives(uint playerId) { - if (GetCharacterStruct(playerId, out CharacterLivesEntityComponent c)) + ref var c = ref GetCharacterStruct(playerId, out bool exists); + if (exists) { return c.initialLives; } @@ -281,7 +285,8 @@ namespace GamecraftModdingAPI.Players public bool SetInitialLives(uint playerId, uint val) { - if (GetCharacterStruct(playerId, out CharacterLivesEntityComponent c)) + ref var c = ref GetCharacterStruct(playerId, out bool exists); + if (exists) { c.initialLives = val; return true; @@ -291,7 +296,8 @@ namespace GamecraftModdingAPI.Players public uint GetCurrentLives(uint playerId) { - if (GetCharacterStruct(playerId, out CharacterLivesEntityComponent c)) + ref var c = ref GetCharacterStruct(playerId, out bool exists); + if (exists) { return c.currentLives; } @@ -300,7 +306,8 @@ namespace GamecraftModdingAPI.Players public bool SetCurrentLives(uint playerId, uint val) { - if (GetCharacterStruct(playerId, out CharacterLivesEntityComponent c)) + ref var c = ref GetCharacterStruct(playerId, out bool exists); + if (exists) { c.currentLives = val; return true; @@ -310,7 +317,8 @@ namespace GamecraftModdingAPI.Players public bool GetGameOverScreen(uint playerId) { - if (GetCharacterStruct(playerId, out CharacterLivesEntityComponent c)) + ref var c = ref GetCharacterStruct(playerId, out bool exists); + if (exists) { return c.gameOverScreen; } @@ -323,8 +331,9 @@ namespace GamecraftModdingAPI.Players } public int GetSelectedBlock(uint playerId) - { - if (GetCharacterStruct(playerId, out EquippedPartStruct c)) + { + ref var c = ref GetCharacterStruct(playerId, out bool exists); + if (exists) { return c.SelectedDBPartID; } @@ -333,7 +342,8 @@ namespace GamecraftModdingAPI.Players public byte GetSelectedColor(uint playerId) { - if (GetCharacterStruct(playerId, out EquippedColourStruct c)) + ref var c = ref GetCharacterStruct(playerId, out bool exists); + if (exists) { return c.indexInPalette; } @@ -349,7 +359,7 @@ namespace GamecraftModdingAPI.Players } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public bool GetCharacterStruct(uint playerId, out T s) where T : unmanaged, IEntityComponent + public ref T GetCharacterStruct(uint playerId, out bool exists) where T : unmanaged, IEntityComponent { ExclusiveGroup[] characterGroups = CharacterExclusiveGroups.AllCharacters; for (int i = 0; i < characterGroups.Length; i++) @@ -357,12 +367,14 @@ namespace GamecraftModdingAPI.Players EGID egid = new EGID(playerId, characterGroups[i]); if (entitiesDB.Exists(egid)) { - s = entitiesDB.QueryEntity(egid); - return true; + exists = true; + return ref entitiesDB.QueryEntity(egid); } } - s = default; - return false; + + exists = false; + T[] arr = new T[1]; + return ref arr[0]; //Return default value } [MethodImpl(MethodImplOptions.AggressiveInlining)] diff --git a/GamecraftModdingAPI/SimBody.cs b/GamecraftModdingAPI/SimBody.cs index d9ba0c2..420a655 100644 --- a/GamecraftModdingAPI/SimBody.cs +++ b/GamecraftModdingAPI/SimBody.cs @@ -1,15 +1,17 @@ -using RobocraftX.Common; -using RobocraftX.Physics; +using System; using Svelto.ECS; using Unity.Mathematics; using UnityEngine; +using RobocraftX.Common; +using RobocraftX.Physics; + namespace GamecraftModdingAPI { /// /// A rigid body (like a cluster of connected blocks) during simulation. /// - public class SimBody + public class SimBody : IEquatable, IEquatable { public EGID Id { get; } @@ -91,6 +93,31 @@ namespace GamecraftModdingAPI return $"{nameof(Id)}: {Id}, {nameof(Position)}: {Position}, {nameof(Mass)}: {Mass}, {nameof(Static)}: {Static}"; } + public bool Equals(SimBody other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + return Id.Equals(other.Id); + } + + public bool Equals(EGID other) + { + return Id.Equals(other); + } + + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != this.GetType()) return false; + return Equals((SimBody) obj); + } + + public override int GetHashCode() + { + return Id.GetHashCode(); + } + /// /// Returns the object identified by the given ID (A-Z). /// This has the same result as calling ObjectIdentifier.GetByID(id) and then GetRigidBody() with the duplicates filtered out. -- 2.30.2 From 448cf3af48007fedc9a700e56bc78ed481b9905e Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Fri, 5 Jun 2020 00:57:22 +0200 Subject: [PATCH 049/252] Expose the simulation-time object IDs They are useful --- GamecraftModdingAPI/Blocks/BlockEngine.cs | 4 ++-- .../Blocks/ObjectIdentifier.cs | 19 +++++++++++++++++-- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/GamecraftModdingAPI/Blocks/BlockEngine.cs b/GamecraftModdingAPI/Blocks/BlockEngine.cs index 1d9f8c9..3473106 100644 --- a/GamecraftModdingAPI/Blocks/BlockEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlockEngine.cs @@ -144,14 +144,14 @@ namespace GamecraftModdingAPI.Blocks return ret.ToArray(); } - public ObjectIdentifier[] GetObjectIDsFromID(byte id) + public ObjectIdentifier[] GetObjectIDsFromID(byte id, bool sim) { var ret = new FasterList(4); if (!entitiesDB.HasAny(CommonExclusiveGroups.OWNED_BLOCKS_GROUP)) return new ObjectIdentifier[0]; var oids = entitiesDB.QueryEntities(CommonExclusiveGroups.OWNED_BLOCKS_GROUP); foreach (ref ObjectIdEntityStruct oid in oids) - if (oid.objectId == id) + if (sim ? oid.simObjectId == id : oid.objectId == id) ret.Add(new ObjectIdentifier(oid.ID)); return ret.ToArray(); } diff --git a/GamecraftModdingAPI/Blocks/ObjectIdentifier.cs b/GamecraftModdingAPI/Blocks/ObjectIdentifier.cs index 3beacfa..6357053 100644 --- a/GamecraftModdingAPI/Blocks/ObjectIdentifier.cs +++ b/GamecraftModdingAPI/Blocks/ObjectIdentifier.cs @@ -32,10 +32,25 @@ namespace GamecraftModdingAPI.Blocks } /// - /// Finds the identfier blocks with the given ID. + /// Simulation-time ID. Assigned by the game starting from 0. + /// + public byte SimID + { + get => BlockEngine.GetBlockInfo(Id).simObjectId; + } + + /// + /// Finds the identifier blocks with the given ID. /// /// The ID to look for /// An array that may be empty - public static ObjectIdentifier[] GetByID(char id) => BlockEngine.GetObjectIDsFromID((byte) (id - 'A')); + public static ObjectIdentifier[] GetByID(char id) => BlockEngine.GetObjectIDsFromID((byte) (id - 'A'), false); + + /// + /// Finds the identifier blocks with the given simulation-time ID. This ID is assigned by the game starting from 0. + /// + /// + /// + public static ObjectIdentifier[] GetBySimID(byte id) => BlockEngine.GetObjectIDsFromID(id, true); } } \ No newline at end of file -- 2.30.2 From 3dcce18ceb63da9c88a6d285623cb6f98b41c167 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Mon, 8 Jun 2020 00:10:10 +0200 Subject: [PATCH 050/252] Add method to get selected blocks by player --- .../GamecraftModdingAPI.csproj | 1 + GamecraftModdingAPI/Player.cs | 9 ++++++++ GamecraftModdingAPI/Players/PlayerEngine.cs | 22 +++++++++++++++++++ 3 files changed, 32 insertions(+) diff --git a/GamecraftModdingAPI/GamecraftModdingAPI.csproj b/GamecraftModdingAPI/GamecraftModdingAPI.csproj index c72b77a..559ddd8 100644 --- a/GamecraftModdingAPI/GamecraftModdingAPI.csproj +++ b/GamecraftModdingAPI/GamecraftModdingAPI.csproj @@ -8,6 +8,7 @@ GNU General Public Licence 3+ https://git.exmods.org/modtainers/GamecraftModdingAPI en-CA + true diff --git a/GamecraftModdingAPI/Player.cs b/GamecraftModdingAPI/Player.cs index 086c910..efb381e 100644 --- a/GamecraftModdingAPI/Player.cs +++ b/GamecraftModdingAPI/Player.cs @@ -366,6 +366,15 @@ namespace GamecraftModdingAPI : null; } + /// + /// Returns the blocks that are in the player's current selection. + /// + /// An array of blocks or an empty array + public Block[] GetSelectedBlocks() + { + return playerEngine.GetSelectedBlocks(Id); + } + public bool Equals(Player other) { if (ReferenceEquals(null, other)) return false; diff --git a/GamecraftModdingAPI/Players/PlayerEngine.cs b/GamecraftModdingAPI/Players/PlayerEngine.cs index bcbfd11..4ab5ed9 100644 --- a/GamecraftModdingAPI/Players/PlayerEngine.cs +++ b/GamecraftModdingAPI/Players/PlayerEngine.cs @@ -5,6 +5,7 @@ using RobocraftX.Character; using RobocraftX.Character.Movement; using RobocraftX.Common.Players; using RobocraftX.Common.Input; +using RobocraftX.CR.MachineEditing.BoxSelect; using RobocraftX.Physics; using RobocraftX.Blocks.Ghost; using RobocraftX.Character.Camera; @@ -408,5 +409,26 @@ namespace GamecraftModdingAPI.Players return null; } + + public unsafe Block[] GetSelectedBlocks(uint playerid) + { + if (!entitiesDB.Exists(playerid, + BoxSelectExclusiveGroups.BoxSelectVolumeExclusiveGroup)) + return new Block[0]; + var state = entitiesDB.QueryEntity(playerid, + BoxSelectExclusiveGroups.BoxSelectVolumeExclusiveGroup); + var blocks = entitiesDB.QueryEntity(playerid, + BoxSelectExclusiveGroups.BoxSelectVolumeExclusiveGroup); + if (!state.active) return new Block[0]; + var pointer = (EGID*) blocks.selectedBlocks.ToPointer(); + var ret = new Block[blocks.count]; + for (int j = 0; j < blocks.count; j++) + { + var egid = pointer[j]; + ret[j] = new Block(egid); + } + + return ret; + } } } -- 2.30.2 From 62318b08433a16b182908f0d6ebf697e4c9fd84d Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Fri, 12 Jun 2020 17:27:36 +0200 Subject: [PATCH 051/252] Update to Gamecraft 2020.06.11.18.50 Removed some inputs from FakeInput --- GamecraftModdingAPI/Blocks/RemovalEngine.cs | 2 +- GamecraftModdingAPI/Blocks/SignalEngine.cs | 23 ++++++++-------- GamecraftModdingAPI/Commands/CommandPatch.cs | 8 ++---- .../GamecraftModdingAPI.csproj | 12 --------- GamecraftModdingAPI/Input/FakeInput.cs | 21 +++++---------- GamecraftModdingAPI/Input/FakeInputEngine.cs | 18 ++++++------- GamecraftModdingAPI/Inventory/HotbarEngine.cs | 6 ++--- .../HotbarSlotSelectionHandlerEnginePatch.cs | 2 +- GamecraftModdingAPI/Players/PlayerEngine.cs | 27 ++++++++++--------- .../Tests/GamecraftModdingAPIPluginTest.cs | 5 ++-- .../Utility/AsyncUtilsEngine.cs | 4 +-- 11 files changed, 52 insertions(+), 76 deletions(-) diff --git a/GamecraftModdingAPI/Blocks/RemovalEngine.cs b/GamecraftModdingAPI/Blocks/RemovalEngine.cs index 2aadaaa..629fd7e 100644 --- a/GamecraftModdingAPI/Blocks/RemovalEngine.cs +++ b/GamecraftModdingAPI/Blocks/RemovalEngine.cs @@ -20,7 +20,7 @@ namespace GamecraftModdingAPI.Blocks if (!entitiesDB.Exists(target)) return false; var connections = entitiesDB.QueryEntity(target); - for (int i = connections.connections.Length - 1; i >= 0; i--) + for (int i = connections.connections.Count() - 1; i >= 0; i--) _connectionFactory.RemoveConnection(connections, i, entitiesDB); _entityFunctions.RemoveEntity(target); return true; diff --git a/GamecraftModdingAPI/Blocks/SignalEngine.cs b/GamecraftModdingAPI/Blocks/SignalEngine.cs index 36716af..b36e708 100644 --- a/GamecraftModdingAPI/Blocks/SignalEngine.cs +++ b/GamecraftModdingAPI/Blocks/SignalEngine.cs @@ -44,7 +44,7 @@ namespace GamecraftModdingAPI.Blocks public bool SetSignal(uint signalID, float signal, bool input = true) { var array = GetSignalStruct(signalID, out uint index, input); - if (array != null) array[index].valueAsFloat = signal; + if (array.count > 0) array[index].valueAsFloat = signal; return false; } @@ -57,7 +57,7 @@ namespace GamecraftModdingAPI.Blocks public float AddSignal(uint signalID, float signal, bool clamp = true, bool input = true) { var array = GetSignalStruct(signalID, out uint index, input); - if (array != null) + if (array.count > 0) { ref var channelData = ref array[index]; channelData.valueAsFloat += signal; @@ -88,7 +88,7 @@ namespace GamecraftModdingAPI.Blocks public float GetSignal(uint signalID, bool input = true) { var array = GetSignalStruct(signalID, out uint index, input); - return array?[index].valueAsFloat ?? 0f; + return array.count > 0 ? array[index].valueAsFloat : 0f; } public uint[] GetSignalIDs(EGID blockID, bool input = true) @@ -136,8 +136,8 @@ namespace GamecraftModdingAPI.Blocks public ref WireEntityStruct MatchPortToWire(EGID portID, EGID blockID, out bool exists) { ref PortEntityStruct port = ref entitiesDB.QueryEntity(portID); - WireEntityStruct[] wires = entitiesDB.QueryEntities(NamedExclusiveGroup.Group).ToFastAccess(out uint count); - for (uint i = 0; i < count; i++) + var wires = entitiesDB.QueryEntities(NamedExclusiveGroup.Group); + for (uint i = 0; i < wires.count; i++) { if ((wires[i].destinationPortUsage == port.usage && wires[i].destinationBlockEGID == blockID) || (wires[i].sourcePortUsage == port.usage && wires[i].sourceBlockEGID == blockID)) @@ -154,8 +154,8 @@ namespace GamecraftModdingAPI.Blocks public ref ChannelDataStruct GetChannelDataStruct(EGID portID, out bool exists) { ref PortEntityStruct port = ref entitiesDB.QueryEntity(portID); - ChannelDataStruct[] channels = entitiesDB.QueryEntities(NamedExclusiveGroup.Group).ToFastAccess(out uint count); - if (port.firstChannelIndexCachedInSim < count) + var channels = entitiesDB.QueryEntities(NamedExclusiveGroup.Group); + if (port.firstChannelIndexCachedInSim < channels.count) { exists = true; return ref channels[port.firstChannelIndexCachedInSim]; @@ -183,7 +183,7 @@ namespace GamecraftModdingAPI.Blocks return res; } - private ChannelDataStruct[] GetSignalStruct(uint signalID, out uint index, bool input = true) + private EntityCollection GetSignalStruct(uint signalID, out uint index, bool input = true) { ExclusiveGroup group = input ? NamedExclusiveGroup.Group @@ -191,14 +191,13 @@ namespace GamecraftModdingAPI.Blocks if (entitiesDB.Exists(signalID, group)) { index = entitiesDB.QueryEntity(signalID, group).anyChannelIndex; - ChannelDataStruct[] channelData = entitiesDB - .QueryEntities(NamedExclusiveGroup.Group) - .ToFastAccess(out uint _); + var channelData = + entitiesDB.QueryEntities(NamedExclusiveGroup.Group); return channelData; } index = 0; - return null; + return default; //count: 0 } } } diff --git a/GamecraftModdingAPI/Commands/CommandPatch.cs b/GamecraftModdingAPI/Commands/CommandPatch.cs index 9cd3020..ab90e6e 100644 --- a/GamecraftModdingAPI/Commands/CommandPatch.cs +++ b/GamecraftModdingAPI/Commands/CommandPatch.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -9,9 +8,6 @@ using HarmonyLib; using Svelto.Context; using Svelto.ECS; using RobocraftX; -using RobocraftX.Multiplayer; -using RobocraftX.StateSync; -using Unity.Entities; using GamecraftModdingAPI.Utility; @@ -27,7 +23,7 @@ namespace GamecraftModdingAPI.Commands //[HarmonyPatch("Compose", new Type[] { typeof(UnityContext), typeof(EnginesRoot), typeof(World), typeof(Action), typeof(MultiplayerInitParameters), typeof(StateSyncRegistrationHelper)})] static class CommandPatch { - public static void Postfix(object contextHolder, EnginesRoot enginesRoot, World physicsWorld, Action reloadGame, MultiplayerInitParameters multiplayerParameters, ref StateSyncRegistrationHelper stateSyncReg) + public static void Postfix(EnginesRoot enginesRoot) { // When a game is loaded, register the command engines CommandManager.RegisterEngines(enginesRoot); diff --git a/GamecraftModdingAPI/GamecraftModdingAPI.csproj b/GamecraftModdingAPI/GamecraftModdingAPI.csproj index 559ddd8..d8d84fe 100644 --- a/GamecraftModdingAPI/GamecraftModdingAPI.csproj +++ b/GamecraftModdingAPI/GamecraftModdingAPI.csproj @@ -327,10 +327,6 @@ ..\ref\Gamecraft_Data\Managed\Blocks.HUDFeedbackBlocks.dll ..\..\ref\Gamecraft_Data\Managed\Blocks.HUDFeedbackBlocks.dll - - ..\ref\Gamecraft_Data\Managed\ChannelsCommon.dll - ..\..\ref\Gamecraft_Data\Managed\ChannelsCommon.dll - ..\ref\Gamecraft_Data\Managed\ClusterToWireConversion.Mock.dll ..\..\ref\Gamecraft_Data\Managed\ClusterToWireConversion.Mock.dll @@ -643,14 +639,6 @@ ..\ref\Gamecraft_Data\Managed\Svelto.Common_3.dll ..\..\ref\Gamecraft_Data\Managed\Svelto.Common_3.dll - - ..\ref\Gamecraft_Data\Managed\Svelto.ECS.Debugger.dll - ..\..\ref\Gamecraft_Data\Managed\Svelto.ECS.Debugger.dll - - - ..\ref\Gamecraft_Data\Managed\Svelto.ECS.Debugger.Internal.dll - ..\..\ref\Gamecraft_Data\Managed\Svelto.ECS.Debugger.Internal.dll - ..\ref\Gamecraft_Data\Managed\Svelto.ECS.dll ..\..\ref\Gamecraft_Data\Managed\Svelto.ECS.dll diff --git a/GamecraftModdingAPI/Input/FakeInput.cs b/GamecraftModdingAPI/Input/FakeInput.cs index 918531b..df6c3ce 100644 --- a/GamecraftModdingAPI/Input/FakeInput.cs +++ b/GamecraftModdingAPI/Input/FakeInput.cs @@ -17,7 +17,7 @@ namespace GamecraftModdingAPI.Input /// /// The custom input. /// The player. Omit this to use the local player. - public static void CustomInput(InputEntityStruct input, uint playerID = uint.MaxValue) + public static void CustomInput(LocalInputEntityStruct input, uint playerID = uint.MaxValue) { if (playerID == uint.MaxValue) { @@ -26,7 +26,7 @@ namespace GamecraftModdingAPI.Input inputEngine.SendCustomInput(input, playerID); } - public static InputEntityStruct GetInput(uint playerID = uint.MaxValue) + public static LocalInputEntityStruct GetInput(uint playerID = uint.MaxValue) { if (playerID == uint.MaxValue) { @@ -42,9 +42,7 @@ namespace GamecraftModdingAPI.Input /// /// The player. Omit this to use the local player. /// Select the hotbar slot by number. - /// Select the hotbar hand. /// Toggle the command line? - /// Open inventory? /// Open escape menu? /// Page return? /// Toggle debug display? @@ -55,13 +53,13 @@ namespace GamecraftModdingAPI.Input /// Select the hotbar page by number? /// Quicksave? /// Paste? - public static void GuiInput(uint playerID = uint.MaxValue, int hotbar = -1, bool hotbarHand = false, bool commandLine = false, bool inventory = false, bool escape = false, bool enter = false, bool debug = false, bool next = false, bool previous = false, bool tab = false, bool colour = false, int hotbarPage = -1, bool quickSave = false, bool paste = false) + public static void GuiInput(uint playerID = uint.MaxValue, int hotbar = -1, bool commandLine = false, bool escape = false, bool enter = false, bool debug = false, bool next = false, bool previous = false, bool tab = false, bool colour = false, int hotbarPage = -1, bool quickSave = false, bool paste = false) { if (playerID == uint.MaxValue) { playerID = inputEngine.GetLocalPlayerID(); } - ref InputEntityStruct currentInput = ref inputEngine.GetInputRef(playerID); + ref LocalInputEntityStruct currentInput = ref inputEngine.GetInputRef(playerID); //Utility.Logging.CommandLog($"Current sim frame {currentInput.frame}"); // set inputs switch(hotbar) @@ -76,19 +74,15 @@ namespace GamecraftModdingAPI.Input case 7: currentInput.guiMask |= RobocraftX.Common.Input.GuiInput.Hotbar_7; break; case 8: currentInput.guiMask |= RobocraftX.Common.Input.GuiInput.Hotbar_8; break; case 9: currentInput.guiMask |= RobocraftX.Common.Input.GuiInput.Hotbar_9; break; - case 10: currentInput.guiMask |= RobocraftX.Common.Input.GuiInput.Hotbar_Hand; break; default: break; } - if (hotbarHand) currentInput.guiMask |= RobocraftX.Common.Input.GuiInput.Hotbar_Hand; if (commandLine) currentInput.guiMask |= RobocraftX.Common.Input.GuiInput.ToggleCommandLine; - if (inventory) currentInput.guiMask |= RobocraftX.Common.Input.GuiInput.Inventory; if (escape) currentInput.guiMask |= RobocraftX.Common.Input.GuiInput.Escape; if (enter) currentInput.guiMask |= RobocraftX.Common.Input.GuiInput.Return; if (debug) currentInput.guiMask |= RobocraftX.Common.Input.GuiInput.ToggleDebugDisplay; if (next) currentInput.guiMask |= RobocraftX.Common.Input.GuiInput.SelectNext; if (previous) currentInput.guiMask |= RobocraftX.Common.Input.GuiInput.SelectPrev; if (tab) currentInput.guiMask |= RobocraftX.Common.Input.GuiInput.Tab; - if (colour) currentInput.guiMask |= RobocraftX.Common.Input.GuiInput.Hotbar_Colour; switch (hotbarPage) { case 1: currentInput.guiMask |= RobocraftX.Common.Input.GuiInput.HotbarPage1; break; @@ -107,16 +101,16 @@ namespace GamecraftModdingAPI.Input if (paste) currentInput.guiMask |= RobocraftX.Common.Input.GuiInput.PasteSelection; } - public static void ActionInput(uint playerID = uint.MaxValue, bool toggleMode = false, bool forward = false, bool backward = false, bool up = false, bool down = false, bool left = false, bool right = false, bool sprint = false, bool toggleFly = false, bool alt = false, bool primary = false, bool secondary = false, bool tertiary = false, bool primaryRelease = false, bool primaryHeld = false, bool secondaryHeld = false, bool toggleUnitGrid = false, bool ctrl = false, bool toggleColourMode = false, bool scaleBlockUp = false, bool scaleBlockDown = false, bool rotateBlockClockwise = false, bool rotateBlockCounterclockwise = false, bool cutSelection = false, bool copySelection = false, bool deleteSelection = false) + public static void ActionInput(uint playerID = uint.MaxValue, bool toggleMode = false, bool forward = false, bool backward = false, bool up = false, bool down = false, bool left = false, bool right = false, bool sprint = false, bool toggleFly = false, bool alt = false, bool primary = false, bool secondary = false, bool tertiary = false, bool primaryHeld = false, bool secondaryHeld = false, bool toggleUnitGrid = false, bool ctrl = false, bool toggleColourMode = false, bool scaleBlockUp = false, bool scaleBlockDown = false, bool rotateBlockClockwise = false, bool rotateBlockCounterclockwise = false, bool cutSelection = false, bool copySelection = false, bool deleteSelection = false) { if (playerID == uint.MaxValue) { playerID = inputEngine.GetLocalPlayerID(); } - ref InputEntityStruct currentInput = ref inputEngine.GetInputRef(playerID); + ref LocalInputEntityStruct currentInput = ref inputEngine.GetInputRef(playerID); //Utility.Logging.CommandLog($"Current sim frame {currentInput.frame}"); // set inputs - if (toggleMode) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.ToggleSimulation; + if (toggleMode) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.ToggleTimeRunningMode; if (forward) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.Forward; if (backward) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.Backward; if (up) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.Up; @@ -129,7 +123,6 @@ namespace GamecraftModdingAPI.Input if (primary) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.PrimaryAction; if (secondary) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.SecondaryAction; if (tertiary) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.TertiaryAction; - if (primaryRelease) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.PrimaryActionRelease; if (primaryHeld) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.PrimaryActionHeld; if (secondaryHeld) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.SecondaryActionHeld; if (toggleUnitGrid) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.ToggleUnitGrid; diff --git a/GamecraftModdingAPI/Input/FakeInputEngine.cs b/GamecraftModdingAPI/Input/FakeInputEngine.cs index bc9aaa8..11d5f3a 100644 --- a/GamecraftModdingAPI/Input/FakeInputEngine.cs +++ b/GamecraftModdingAPI/Input/FakeInputEngine.cs @@ -29,32 +29,32 @@ namespace GamecraftModdingAPI.Input IsReady = true; } - public bool SendCustomInput(InputEntityStruct input, uint playerID, bool remote = false) + public bool SendCustomInput(LocalInputEntityStruct input, uint playerID, bool remote = false) { EGID egid = new EGID(playerID, remote ? InputExclusiveGroups.RemotePlayers : InputExclusiveGroups.LocalPlayers); - if (entitiesDB.Exists(egid)) + if (entitiesDB.Exists(egid)) { - ref InputEntityStruct ies = ref entitiesDB.QueryEntity(egid); + ref LocalInputEntityStruct ies = ref entitiesDB.QueryEntity(egid); ies = input; return true; } else return false; } - public InputEntityStruct GetInput(uint playerID, bool remote = false) + public LocalInputEntityStruct GetInput(uint playerID, bool remote = false) { EGID egid = new EGID(playerID, remote ? InputExclusiveGroups.RemotePlayers : InputExclusiveGroups.LocalPlayers); - if (entitiesDB.Exists(egid)) + if (entitiesDB.Exists(egid)) { - return entitiesDB.QueryEntity(egid); + return entitiesDB.QueryEntity(egid); } - else return default(InputEntityStruct); + else return default(LocalInputEntityStruct); } - public ref InputEntityStruct GetInputRef(uint playerID, bool remote = false) + public ref LocalInputEntityStruct GetInputRef(uint playerID, bool remote = false) { EGID egid = new EGID(playerID, remote ? InputExclusiveGroups.RemotePlayers : InputExclusiveGroups.LocalPlayers); - return ref entitiesDB.QueryEntity(egid); + return ref entitiesDB.QueryEntity(egid); } public uint GetLocalPlayerID() diff --git a/GamecraftModdingAPI/Inventory/HotbarEngine.cs b/GamecraftModdingAPI/Inventory/HotbarEngine.cs index 2079fb1..d5eb2d8 100644 --- a/GamecraftModdingAPI/Inventory/HotbarEngine.cs +++ b/GamecraftModdingAPI/Inventory/HotbarEngine.cs @@ -36,9 +36,9 @@ namespace GamecraftModdingAPI.Inventory public bool SelectBlock(int block, uint playerID, bool cubeSelectedByPick = false) { - InputEntityStruct[] inputs = entitiesDB.QueryEntities(InputExclusiveGroups.LocalPlayers).ToFastAccess(out uint count); - if (count == 0) return false; - for (int i = 0; i < count; i++) + var inputs = entitiesDB.QueryEntities(InputExclusiveGroups.LocalPlayers); + if (inputs.count == 0) return false; + for (int i = 0; i < inputs.count; i++) { if (inputs[i].ID.entityID == playerID) { inputs[i].cubeSelectedByPick = cubeSelectedByPick; diff --git a/GamecraftModdingAPI/Inventory/HotbarSlotSelectionHandlerEnginePatch.cs b/GamecraftModdingAPI/Inventory/HotbarSlotSelectionHandlerEnginePatch.cs index 530184b..dd8a375 100644 --- a/GamecraftModdingAPI/Inventory/HotbarSlotSelectionHandlerEnginePatch.cs +++ b/GamecraftModdingAPI/Inventory/HotbarSlotSelectionHandlerEnginePatch.cs @@ -17,7 +17,7 @@ namespace GamecraftModdingAPI.Inventory public static BlockIDs EquippedPartID { get => (BlockIDs)selectedBlockInt; } - private static MethodInfo PatchedMethod { get; } = AccessTools.Method(AccessTools.TypeByName("RobocraftX.GUI.Hotbar.HotbarSlotSelectionHandlerEngine"), "HandleEquippedCubeChanged", parameters: new Type[] { typeof(uint), typeof(int), typeof(ExclusiveGroupStruct) }); + private static MethodInfo PatchedMethod { get; } = AccessTools.Method(AccessTools.TypeByName("RobocraftX.GUI.Hotbar.HotbarSlotSelectionHandlerEngine"), "ActivateSlotForCube", parameters: new Type[] { typeof(uint), typeof(int), typeof(ExclusiveGroupStruct) }); public static void Prefix(uint playerID, int selectedDBPartID, ExclusiveGroupStruct groupID) { diff --git a/GamecraftModdingAPI/Players/PlayerEngine.cs b/GamecraftModdingAPI/Players/PlayerEngine.cs index 4ab5ed9..2bb29a7 100644 --- a/GamecraftModdingAPI/Players/PlayerEngine.cs +++ b/GamecraftModdingAPI/Players/PlayerEngine.cs @@ -46,8 +46,8 @@ namespace GamecraftModdingAPI.Players public uint GetLocalPlayer() { if (!isReady) return uint.MaxValue; - PlayerIDStruct[] localPlayers = entitiesDB.QueryEntities(PlayersExclusiveGroups.LocalPlayers).ToFastAccess(out uint count); - if (count > 0) + var localPlayers = entitiesDB.QueryEntities(PlayersExclusiveGroups.LocalPlayers); + if (localPlayers.count > 0) { return localPlayers[0].ID.entityID; } @@ -57,8 +57,8 @@ namespace GamecraftModdingAPI.Players public uint GetRemotePlayer() { if (!isReady) return uint.MaxValue; - PlayerIDStruct[] localPlayers = entitiesDB.QueryEntities(PlayersExclusiveGroups.RemotePlayers).ToFastAccess(out uint count); - if (count > 0) + var localPlayers = entitiesDB.QueryEntities(PlayersExclusiveGroups.RemotePlayers); + if (localPlayers.count > 0) { return localPlayers[0].ID.entityID; } @@ -83,8 +83,8 @@ namespace GamecraftModdingAPI.Players public bool SetLocation(uint playerId, float3 location, bool exitSeat = true) { - ExclusiveGroup[] characterGroups = CharacterExclusiveGroups.AllCharacters; - for (int i = 0; i < characterGroups.Length; i++) + var characterGroups = CharacterExclusiveGroups.AllCharacters; + for (int i = 0; i < characterGroups.count; i++) { EGID egid = new EGID(playerId, characterGroups[i]); if (entitiesDB.Exists(egid)) @@ -328,7 +328,7 @@ namespace GamecraftModdingAPI.Players public bool IsDead(uint playerId) { - return entitiesDB.Exists(playerId, CharacterExclusiveGroups.DeadGroup); + return entitiesDB.Exists(playerId, CharacterExclusiveGroups.DeadCharacters); } public int GetSelectedBlock(uint playerId) @@ -362,8 +362,8 @@ namespace GamecraftModdingAPI.Players [MethodImpl(MethodImplOptions.AggressiveInlining)] public ref T GetCharacterStruct(uint playerId, out bool exists) where T : unmanaged, IEntityComponent { - ExclusiveGroup[] characterGroups = CharacterExclusiveGroups.AllCharacters; - for (int i = 0; i < characterGroups.Length; i++) + var characterGroups = CharacterExclusiveGroups.AllCharacters; + for (int i = 0; i < characterGroups.count; i++) { EGID egid = new EGID(playerId, characterGroups[i]); if (entitiesDB.Exists(egid)) @@ -381,8 +381,8 @@ namespace GamecraftModdingAPI.Players [MethodImpl(MethodImplOptions.AggressiveInlining)] public bool GetPlayerStruct(uint playerId, out T s) where T : unmanaged, IEntityComponent { - ExclusiveGroup[] playerGroups = PlayersExclusiveGroups.AllPlayers; - for (int i = 0; i < playerGroups.Length; i++) + var playerGroups = PlayersExclusiveGroups.AllPlayers; + for (int i = 0; i < playerGroups.count; i++) { EGID egid = new EGID(playerId, playerGroups[i]); if (entitiesDB.Exists(egid)) @@ -394,7 +394,7 @@ namespace GamecraftModdingAPI.Players s = default; return false; } - + public EGID? GetThingLookedAt(uint playerId, float maxDistance = -1f) { if (!entitiesDB.TryQueryMappedEntities( @@ -402,7 +402,8 @@ namespace GamecraftModdingAPI.Players return null; mapper.TryGetEntity(playerId, out CharacterCameraRayCastEntityStruct rayCast); float distance = maxDistance < 0 - ? GhostBlockUtils.GetBuildInteractionDistance(entitiesDB, rayCast) + ? GhostBlockUtils.GetBuildInteractionDistance(entitiesDB, rayCast, + GhostBlockUtils.GhostCastMethod.GhostCastProportionalToBlockSize) : maxDistance; if (rayCast.hit && rayCast.distance <= distance) return rayCast.hitEgid; diff --git a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs index d505806..dc07e1e 100644 --- a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs +++ b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs @@ -308,15 +308,14 @@ namespace GamecraftModdingAPI.Tests [HarmonyPatch] public class MinimumSpecsPatch { - public static bool Prefix(ref bool __result) + public static bool Prefix() { - __result = true; return false; } public static MethodInfo TargetMethod() { - return ((Func)MinimumSpecsCheck.CheckRequirementsMet).Method; + return ((Action) MinimumSpecsCheck.CheckRequirementsMet).Method; } } } diff --git a/GamecraftModdingAPI/Utility/AsyncUtilsEngine.cs b/GamecraftModdingAPI/Utility/AsyncUtilsEngine.cs index f46bd6c..56aab89 100644 --- a/GamecraftModdingAPI/Utility/AsyncUtilsEngine.cs +++ b/GamecraftModdingAPI/Utility/AsyncUtilsEngine.cs @@ -31,14 +31,14 @@ namespace GamecraftModdingAPI.Utility public Task WaitForSubmission() { var task = new TaskCompletionSource(); - WaitForSubmissionInternal(_efu, _efa, entitiesDB, task).RunOn(ExtraLean.EveryFrameStepRunner); + WaitForSubmissionInternal(_efu, _efa, entitiesDB, task).RunOn(ExtraLean.EveryFrameStepRunner_TimeStopped); return task.Task; } public Task WaitForNextFrame() { var task = new TaskCompletionSource(); - WaitForNextFrameInternal(task).RunOn(ExtraLean.EveryFrameStepRunner); + WaitForNextFrameInternal(task).RunOn(ExtraLean.EveryFrameStepRunner_TimeStopped); return task.Task; } -- 2.30.2 From ae1f53e11953043628e243220c178676cf8c8120 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sat, 13 Jun 2020 00:48:13 +0200 Subject: [PATCH 052/252] Add new blocks --- GamecraftModdingAPI/Blocks/BlockIDs.cs | 35 ++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/GamecraftModdingAPI/Blocks/BlockIDs.cs b/GamecraftModdingAPI/Blocks/BlockIDs.cs index 4babe62..b0eca31 100644 --- a/GamecraftModdingAPI/Blocks/BlockIDs.cs +++ b/GamecraftModdingAPI/Blocks/BlockIDs.cs @@ -225,7 +225,13 @@ namespace GamecraftModdingAPI.Blocks ObjectiveHUD, GameStatsHUD, //231 GameOverBlock, - MovementConstrainer = 246, + SFXBlockGameplay=240, + SFXBlock8Bit, + SFXBlockInstrument, + SFXBlockSciFi, + SFXBlockLoops, + SFXBlockVocal, + MovementConstrainer, //246 RotationConstrainer, AdvancedMovementDampener, AdvancedRotationDampener, @@ -234,6 +240,31 @@ namespace GamecraftModdingAPI.Blocks MovementDampener, RotationDampener, AdvancedMover, - AdvancedRotator + AdvancedRotator, + MusicBlock, //256 + PlasmaCannonBlock, + MagmaRockCube=777, + MagmaRockCubeSliced, + MagmaRockSlope, + MagmaRockCorner, + MagmaRockPyramidSegment, + MagmaRockConeSegment, + MagmaRockSlicedRounded, + MagmaRockSlopeRounded, + MagmaRockCornerRounded, + HexNetCube, + HexNetCubeSliced, + HexNetSlope, + HexNetCorner, + HexNetPyramidSegment, + HexNetConeSegment, + HexNetSlicedRounded, + HexNetSlopeRounded, + HexNetCornerRounded, //794 + MagmaRockBulgedInner, + HexNetCylinder=797, + HexNetHemisphere, + HexNetSphere, + HexNetTubeCorner //800 } } \ No newline at end of file -- 2.30.2 From d2c9cde1d2a74855fcbfe17711d8475ddbe5fca4 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Sat, 13 Jun 2020 15:23:52 -0400 Subject: [PATCH 053/252] Fix double event call, jankily --- GamecraftModdingAPI/Events/MenuActivatedPatch.cs | 1 + .../Events/SimpleEventHandlerEngine.cs | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/GamecraftModdingAPI/Events/MenuActivatedPatch.cs b/GamecraftModdingAPI/Events/MenuActivatedPatch.cs index 2b66a05..4237faa 100644 --- a/GamecraftModdingAPI/Events/MenuActivatedPatch.cs +++ b/GamecraftModdingAPI/Events/MenuActivatedPatch.cs @@ -31,6 +31,7 @@ namespace GamecraftModdingAPI.Events { firstLoad = false; FullGameFields.Init(__instance); + //Application.Application.SetFullGameCompositionRoot(__instance); Logging.Log("Dispatching App Init event"); EventManager.GetEventEmitter("GamecraftModdingAPIApplicationInitializedEventEmitter").Emit(); } diff --git a/GamecraftModdingAPI/Events/SimpleEventHandlerEngine.cs b/GamecraftModdingAPI/Events/SimpleEventHandlerEngine.cs index 133ad29..18314d9 100644 --- a/GamecraftModdingAPI/Events/SimpleEventHandlerEngine.cs +++ b/GamecraftModdingAPI/Events/SimpleEventHandlerEngine.cs @@ -20,6 +20,10 @@ namespace GamecraftModdingAPI.Events private bool isActivated = false; + private bool jankActivateFix = false; + + private bool jankDestroyFix = false; + private readonly Action onActivated; private readonly Action onDestroyed; @@ -32,6 +36,8 @@ namespace GamecraftModdingAPI.Events { if (entityView.type.Equals(this.type)) { + jankActivateFix = !jankActivateFix; + if (jankActivateFix) return; isActivated = true; onActivatedInvokeCatchError(entitiesDB); } @@ -51,12 +57,19 @@ namespace GamecraftModdingAPI.Events } } + public void Deactivate() + { + isActivated = false; + } + public void Ready() { } public void Remove(ref ModEventEntityStruct entityView, EGID egid) { if (entityView.type.Equals(this.type) && isActivated) { + jankDestroyFix = !jankDestroyFix; + if (jankDestroyFix) return; isActivated = false; onDestroyedInvokeCatchError(entitiesDB); } -- 2.30.2 From 0d17a1b509a8017c83892db1c6ac0e71e11541da Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Sat, 13 Jun 2020 16:19:12 -0400 Subject: [PATCH 054/252] Update project references --- .../GamecraftModdingAPI.csproj | 539 ++++++++++-------- 1 file changed, 292 insertions(+), 247 deletions(-) diff --git a/GamecraftModdingAPI/GamecraftModdingAPI.csproj b/GamecraftModdingAPI/GamecraftModdingAPI.csproj index d8d84fe..0fdbcfd 100644 --- a/GamecraftModdingAPI/GamecraftModdingAPI.csproj +++ b/GamecraftModdingAPI/GamecraftModdingAPI.csproj @@ -25,6 +25,7 @@ + @@ -43,10 +44,6 @@ ..\ref\Gamecraft_Data\Managed\Unity.Burst.Unsafe.dll ..\..\ref\Gamecraft_Data\Managed\Unity.Burst.Unsafe.dll - - ..\ref\Gamecraft_Data\Managed\Facepunch.Steamworks.Win64.dll - ..\..\ref\Gamecraft_Data\Managed\Facepunch.Steamworks.Win64.dll - ..\ref\Gamecraft_Data\Managed\Rewired_Core.dll ..\..\ref\Gamecraft_Data\Managed\Rewired_Core.dll @@ -59,249 +56,9 @@ ..\ref\Gamecraft_Data\Managed\mscorlib.dll ..\..\ref\Gamecraft_Data\Managed\mscorlib.dll - - ..\ref\Gamecraft_Data\Managed\Newtonsoft.Json.dll - ..\..\ref\Gamecraft_Data\Managed\Newtonsoft.Json.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.AccessibilityModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.AccessibilityModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.AIModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.AIModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.AndroidJNIModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.AndroidJNIModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.AnimationModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.AnimationModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.ARModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.ARModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.AssetBundleModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.AssetBundleModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.AudioModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.AudioModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.ClothModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.ClothModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.ClusterInputModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.ClusterInputModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.ClusterRendererModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.ClusterRendererModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.CoreModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.CoreModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.CrashReportingModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.CrashReportingModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.DirectorModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.DirectorModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.DSPGraphModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.DSPGraphModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.GameCenterModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.GameCenterModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.GridModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.GridModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.HotReloadModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.HotReloadModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.ImageConversionModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.ImageConversionModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.IMGUIModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.IMGUIModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.InputLegacyModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.InputLegacyModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.InputModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.InputModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.JSONSerializeModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.JSONSerializeModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.LocalizationModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.LocalizationModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.ParticleSystemModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.ParticleSystemModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.PerformanceReportingModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.PerformanceReportingModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.Physics2DModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.Physics2DModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.PhysicsModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.PhysicsModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.ProfilerModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.ProfilerModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.ScreenCaptureModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.ScreenCaptureModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.SharedInternalsModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.SharedInternalsModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.SpriteMaskModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.SpriteMaskModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.SpriteShapeModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.SpriteShapeModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.StreamingModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.StreamingModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.SubstanceModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.SubstanceModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.SubsystemsModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.SubsystemsModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.TerrainModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.TerrainModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.TerrainPhysicsModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.TerrainPhysicsModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.TextCoreModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.TextCoreModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.TextRenderingModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.TextRenderingModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.TilemapModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.TilemapModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.TLSModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.TLSModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.UIElementsModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UIElementsModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.UIModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UIModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.UmbraModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UmbraModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.UNETModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UNETModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.UnityAnalyticsModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UnityAnalyticsModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.UnityConnectModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UnityConnectModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.UnityTestProtocolModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UnityTestProtocolModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.UnityWebRequestModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UnityWebRequestModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.VehiclesModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.VehiclesModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.VFXModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.VFXModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.VideoModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.VideoModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.VRModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.VRModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.WindModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.WindModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.XRModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.XRModule.dll + + ..\ref\Gamecraft_Data\Managed\Accessibility.dll + ..\..\ref\Gamecraft_Data\Managed\Accessibility.dll ..\ref\Gamecraft_Data\Managed\Analytics.dll @@ -343,6 +100,10 @@ ..\ref\Gamecraft_Data\Managed\DDNA.dll ..\..\ref\Gamecraft_Data\Managed\DDNA.dll + + ..\ref\Gamecraft_Data\Managed\Facepunch.Steamworks.Win64.dll + ..\..\ref\Gamecraft_Data\Managed\Facepunch.Steamworks.Win64.dll + ..\ref\Gamecraft_Data\Managed\FMOD.dll ..\..\ref\Gamecraft_Data\Managed\FMOD.dll @@ -351,10 +112,18 @@ ..\ref\Gamecraft_Data\Managed\FullGame.dll ..\..\ref\Gamecraft_Data\Managed\FullGame.dll + + ..\ref\Gamecraft_Data\Managed\Gamecraft.AudioBlocks.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.AudioBlocks.dll + ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.ConsoleBlock.dll ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.ConsoleBlock.dll + + ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.DamagingSurfaceBlock.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.DamagingSurfaceBlock.dll + ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.GenericPhysicsBlocks.dll ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.GenericPhysicsBlocks.dll @@ -363,6 +132,10 @@ ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.LogicBlock.dll ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.LogicBlock.dll + + ..\ref\Gamecraft_Data\Managed\GameCraft.Blocks.ProjectileBlock.dll + ..\..\ref\Gamecraft_Data\Managed\GameCraft.Blocks.ProjectileBlock.dll + ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.TimerBlock.dll ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.TimerBlock.dll @@ -407,6 +180,14 @@ ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll + + ..\ref\Gamecraft_Data\Managed\Gamecraft.Music.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Music.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.PerformanceWarnings.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.PerformanceWarnings.dll + ..\ref\Gamecraft_Data\Managed\Gamecraft.Tweaks.dll ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Tweaks.dll @@ -415,6 +196,10 @@ ..\ref\Gamecraft_Data\Managed\Gamecraft.Tweaks.Mockup.dll ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Tweaks.Mockup.dll + + ..\ref\Gamecraft_Data\Managed\Gamecraft.VisualEffects.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.VisualEffects.dll + ..\ref\Gamecraft_Data\Managed\Gamecraft.Wires.dll ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Wires.dll @@ -455,10 +240,26 @@ ..\ref\Gamecraft_Data\Managed\MultiplayerTest.dll ..\..\ref\Gamecraft_Data\Managed\MultiplayerTest.dll + + ..\ref\Gamecraft_Data\Managed\netstandard.dll + ..\..\ref\Gamecraft_Data\Managed\netstandard.dll + + + ..\ref\Gamecraft_Data\Managed\Newtonsoft.Json.dll + ..\..\ref\Gamecraft_Data\Managed\Newtonsoft.Json.dll + + + ..\ref\Gamecraft_Data\Managed\Novell.Directory.Ldap.dll + ..\..\ref\Gamecraft_Data\Managed\Novell.Directory.Ldap.dll + ..\ref\Gamecraft_Data\Managed\RCX.ScreenshotTaker.dll ..\..\ref\Gamecraft_Data\Managed\RCX.ScreenshotTaker.dll + + ..\ref\Gamecraft_Data\Managed\RobocraftECS.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftECS.dll + ..\ref\Gamecraft_Data\Managed\RobocraftX.AccountPreferences.dll ..\..\ref\Gamecraft_Data\Managed\RobocraftX.AccountPreferences.dll @@ -655,6 +456,10 @@ ..\ref\Gamecraft_Data\Managed\Unity.Addressables.dll ..\..\ref\Gamecraft_Data\Managed\Unity.Addressables.dll + + ..\ref\Gamecraft_Data\Managed\Unity.Build.SlimPlayerRuntime.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Build.SlimPlayerRuntime.dll + ..\ref\Gamecraft_Data\Managed\Unity.Burst.dll ..\..\ref\Gamecraft_Data\Managed\Unity.Burst.dll @@ -775,10 +580,250 @@ ..\ref\Gamecraft_Data\Managed\Unity.Transforms.Hybrid.dll ..\..\ref\Gamecraft_Data\Managed\Unity.Transforms.Hybrid.dll + + ..\ref\Gamecraft_Data\Managed\UnityEngine.AccessibilityModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.AccessibilityModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.AIModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.AIModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.AndroidJNIModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.AndroidJNIModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.AnimationModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.AnimationModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.ARModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.ARModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.AssetBundleModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.AssetBundleModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.AudioModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.AudioModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.ClothModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.ClothModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.ClusterInputModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.ClusterInputModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.ClusterRendererModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.ClusterRendererModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.CoreModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.CoreModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.CrashReportingModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.CrashReportingModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.DirectorModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.DirectorModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.DSPGraphModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.DSPGraphModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.GameCenterModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.GameCenterModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.GridModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.GridModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.HotReloadModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.HotReloadModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.ImageConversionModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.ImageConversionModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.IMGUIModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.IMGUIModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.InputLegacyModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.InputLegacyModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.InputModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.InputModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.JSONSerializeModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.JSONSerializeModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.LocalizationModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.LocalizationModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.ParticleSystemModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.ParticleSystemModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.PerformanceReportingModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.PerformanceReportingModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.Physics2DModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.Physics2DModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.PhysicsModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.PhysicsModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.ProfilerModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.ProfilerModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.ScreenCaptureModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.ScreenCaptureModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.SharedInternalsModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.SharedInternalsModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.SpriteMaskModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.SpriteMaskModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.SpriteShapeModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.SpriteShapeModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.StreamingModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.StreamingModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.SubstanceModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.SubstanceModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.SubsystemsModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.SubsystemsModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.TerrainModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.TerrainModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.TerrainPhysicsModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.TerrainPhysicsModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.TextCoreModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.TextCoreModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.TextRenderingModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.TextRenderingModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.TilemapModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.TilemapModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.TLSModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.TLSModule.dll + ..\ref\Gamecraft_Data\Managed\UnityEngine.UI.dll ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UI.dll + + ..\ref\Gamecraft_Data\Managed\UnityEngine.UIElementsModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UIElementsModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.UIModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UIModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.UmbraModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UmbraModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.UNETModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UNETModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.UnityAnalyticsModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UnityAnalyticsModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.UnityConnectModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UnityConnectModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.UnityTestProtocolModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UnityTestProtocolModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.UnityWebRequestModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UnityWebRequestModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.VehiclesModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.VehiclesModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.VFXModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.VFXModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.VideoModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.VideoModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.VRModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.VRModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.WindModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.WindModule.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.XRModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.XRModule.dll + ..\ref\Gamecraft_Data\Managed\uREPL.dll ..\..\ref\Gamecraft_Data\Managed\uREPL.dll -- 2.30.2 From 9b1e2548d1c2ba3f82d2356d25921efadb588118 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sun, 14 Jun 2020 21:40:47 +0200 Subject: [PATCH 055/252] Attempts to create custom block types It can load certain assets (a Cube from a sample) but fails because of missing shaders My own Cube doesn't even get that far --- GamecraftModdingAPI/Blocks/CustomBlock.cs | 159 ++++++++++++++++++ .../Tests/GamecraftModdingAPIPluginTest.cs | 19 +++ 2 files changed, 178 insertions(+) create mode 100644 GamecraftModdingAPI/Blocks/CustomBlock.cs diff --git a/GamecraftModdingAPI/Blocks/CustomBlock.cs b/GamecraftModdingAPI/Blocks/CustomBlock.cs new file mode 100644 index 0000000..9801e40 --- /dev/null +++ b/GamecraftModdingAPI/Blocks/CustomBlock.cs @@ -0,0 +1,159 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Reflection.Emit; +using System.Text.Formatting; +using DataLoader; +using GamecraftModdingAPI.Utility; +using GPUInstancer; +using HarmonyLib; +using RobocraftX.Common; +using RobocraftX.Schedulers; +using Svelto.Tasks; +using Svelto.Tasks.ExtraLean; +using UnityEngine; +using UnityEngine.AddressableAssets; + +namespace GamecraftModdingAPI.Blocks +{ + public class CustomBlock + { + private static ushort nextID = 500; + public static void RegisterCustomBlock(string path) + { + var prefabData = new List(); + //category ID: + //0 - regular + //1 - joint + //2 - controller + uint prefabId = PrefabsID.FetchNewPrefabID(PrefabsID.GenerateDBID(0, nextID++)); + prefabData.Add(new PrefabData() + { + prefabName = path, + prefabId = prefabId + }); + var loadTask = Addressables.LoadAssetAsync(path); + AccessTools.Method("RobocraftX.Common.ECSGPUIResourceManager:RegisterPrefab") + .Invoke(ECSGPUIResourceManager.Instance, new object[] {prefabId, loadTask.Result, 1}); + } + + [HarmonyPatch] + public static class Patch + { + /*public static IEnumerable Transpiler(IEnumerable instructions) + { + var list = new List(instructions); + try + { + *int index = -1; + CodeInstruction loadTask = null; + for (var i = 0; i < list.Count - 1; i++) + { + if (list[i].opcode == OpCodes.Ldfld + && ((string) list[i].operand).Contains("renderingWorld") + && list[i + 1].opcode == OpCodes.Brfalse_S) + index = i - 1; //It loads 'this' first + if (list[i].opcode == OpCodes.Ldflda + && ((string) list[i].operand).Contains("loadTask")) + loadTask = new CodeInstruction(list[i]); + }* + + var array = new[] + { + //Set Yield.It to be returned (current) + new CodeInstruction(OpCodes.Ldarg_0), // this + new CodeInstruction(OpCodes.Ldsfld, + typeof(Yield).GetField("It", BindingFlags.Public | BindingFlags.Static)), + new CodeInstruction(OpCodes.Stfld, "object RobocraftX.Common.ECSResourceManagerUtility/'d__0'::'<>2__current'"), + + //Set which yield return we're at (state) + new CodeInstruction(OpCodes.Ldarg_0), // this + new CodeInstruction(OpCodes.Ldc_I4_1), + //new CodeInstruction(OpCodes.Call, ((Action)AddInfo).Method) + }; + list.InsertRange(index, array); + * + IL_00ad: ldarg.0 // this + IL_00ae: ldsfld class [Svelto.Tasks]Svelto.Tasks.Yield [Svelto.Tasks]Svelto.Tasks.Yield::It + IL_00b3: stfld object RobocraftX.Common.ECSResourceManagerUtility/'d__0'::'<>2__current' + + IL_0072: ldarg.0 // this + IL_0073: ldnull + IL_0074: stfld object RobocraftX.Common.ECSResourceManagerUtility/'d__0'::'<>2__current' + IL_0079: ldarg.0 // this + IL_007a: ldc.i4.2 + IL_007b: stfld object RobocraftX.Common.ECSResourceManagerUtility/'d__0'::'<>1__state' + IL_0080: ldc.i4.1 + IL_0081: ret + * + yield break; + } + catch (Exception e) + { + Logging.LogWarning("Failed to inject AddInfo method for the debug display!\n" + e); + } + }*/ + + public static void Prefix(ref Dictionary blocks) + { + /*foreach (var block in blocks.Values.Cast()) + { + Console.WriteLine("Block info: " + block); + }*/ + + /*var res = Addressables.LoadContentCatalogAsync("customCatalog.json"); + while (!res.IsDone) yield return Yield.It;*/ + + blocks.Add("modded_ConsoleBlock", new CubeListData + { + cubeType = CubeType.Block, + cubeCategory = CubeCategory.ConsoleBlock, + inventoryCategory = InventoryCategory.Logic, + ID = 500, + Path = "Assets/Cube.prefab", //Index out of range exception: Asset failed to load (wrong path) + SpriteName = "CTR_CommandBlock", + CubeNameKey = "strConsoleBlock", + SelectableFaces = new[] {0, 1, 2, 3, 4, 5}, + GridScale = new[] {1, 1, 1}, + Mass = 1, + JointBreakAngle = 1 + }); + } + + public static MethodBase TargetMethod() + { //General block registration + return AccessTools.Method("RobocraftX.Blocks.BlocksCompositionRoot:RegisterPartPrefabs"); + } + } + + [HarmonyPatch] + public static class GOPatch + { + public static void Prefix(uint prefabID, GameObject gameObject) + { + Console.WriteLine("ID: " + prefabID + " - Name: " + gameObject.name); + if (gameObject.name == "Cube") + ECSGPUIResourceManager.Instance.RegisterRuntimePrefabs( + new[] {new PrefabData {prefabId = 500, prefabName = "Assets/Cube.prefab"}}, + new List {gameObject}, 1).Complete(); + } + + public static MethodBase TargetMethod() + { + return AccessTools.Method("RobocraftX.Common.ECSGPUIResourceManager:RegisterPrefab", + new[] {typeof(uint), typeof(GameObject), typeof(uint)}); + } + } + + public static IEnumerator Prep() + { + Console.WriteLine("Loading custom catalog..."); + var res = Addressables.LoadContentCatalogAsync("customCatalog.json"); + while (!res.IsDone) yield return Yield.It; + Console.WriteLine("Loaded custom catalog: " + res.Result.LocatorId); + Addressables.AddResourceLocator(res.Result); + } + } +} \ No newline at end of file diff --git a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs index dc07e1e..c4077d0 100644 --- a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs +++ b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs @@ -13,6 +13,9 @@ using RobocraftX.Common; using RobocraftX.SimulationModeState; using RobocraftX.FrontEnd; using Unity.Mathematics; +using RobocraftX.Schedulers; +using Svelto.Tasks.ExtraLean; +using uREPL; using GamecraftModdingAPI.Commands; using GamecraftModdingAPI.Events; @@ -283,6 +286,22 @@ namespace GamecraftModdingAPI.Tests { Logging.Log("Compatible GamecraftScripting detected"); } + + CommandBuilder.Builder("enableCompletions") + .Action(() => + { + var p = Window.selected.main.parameters; + p.useCommandCompletion = true; + p.useMonoCompletion = true; + p.useGlobalClassCompletion = true; + Log.Output("Submitted: " + Window.selected.submittedCode); + }) + .Build(); + /*JObject o1 = JObject.Parse(File.ReadAllText(@"Gamecraft_Data\StreamingAssets\aa\Windows\catalog.json")); + JObject o2 = JObject.Parse(File.ReadAllText(@"customCatalog.json")); + o1.Merge(o2, new JsonMergeSettings {MergeArrayHandling = MergeArrayHandling.Union}); + File.WriteAllText(@"Gamecraft_Data\StreamingAssets\aa\Windows\catalog.json", o1.ToString());*/ + CustomBlock.Prep().RunOn(ExtraLean.UIScheduler); } private string modsString; -- 2.30.2 From c912f3ba64d16ca9c37ccbe5c3c97ac05e77ece3 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Wed, 17 Jun 2020 21:04:08 -0400 Subject: [PATCH 056/252] Add Client and Game OOP features (undocumented) --- GamecraftModdingAPI/App/AppCallbacksTest.cs | 31 ++ GamecraftModdingAPI/App/AppEngine.cs | 63 ++++ GamecraftModdingAPI/App/AppExceptions.cs | 42 +++ GamecraftModdingAPI/App/Client.cs | 49 +++ GamecraftModdingAPI/App/Game.cs | 331 ++++++++++++++++++ .../App/GameBuildSimEventEngine.cs | 48 +++ GamecraftModdingAPI/App/GameGameEngine.cs | 80 +++++ GamecraftModdingAPI/App/GameMenuEngine.cs | 128 +++++++ GamecraftModdingAPI/App/StateSyncRegPatch.cs | 26 ++ GamecraftModdingAPI/Main.cs | 2 + GamecraftModdingAPI/Utility/FullGameFields.cs | 10 +- 11 files changed, 809 insertions(+), 1 deletion(-) create mode 100644 GamecraftModdingAPI/App/AppCallbacksTest.cs create mode 100644 GamecraftModdingAPI/App/AppEngine.cs create mode 100644 GamecraftModdingAPI/App/AppExceptions.cs create mode 100644 GamecraftModdingAPI/App/Client.cs create mode 100644 GamecraftModdingAPI/App/Game.cs create mode 100644 GamecraftModdingAPI/App/GameBuildSimEventEngine.cs create mode 100644 GamecraftModdingAPI/App/GameGameEngine.cs create mode 100644 GamecraftModdingAPI/App/GameMenuEngine.cs create mode 100644 GamecraftModdingAPI/App/StateSyncRegPatch.cs diff --git a/GamecraftModdingAPI/App/AppCallbacksTest.cs b/GamecraftModdingAPI/App/AppCallbacksTest.cs new file mode 100644 index 0000000..0c2987b --- /dev/null +++ b/GamecraftModdingAPI/App/AppCallbacksTest.cs @@ -0,0 +1,31 @@ +using System; + +using GamecraftModdingAPI.Tests; + +namespace GamecraftModdingAPI.App +{ +#if TEST + [APITestClass] + public static class AppCallbacksTest + { + [APITestStartUp] + public static void StartUp() + { + // this could be split into 6 separate test cases + Game.Enter += Assert.CallsBack("GameEnter"); + Game.Exit += Assert.CallsBack("GameExit"); + Game.Simulate += Assert.CallsBack("GameSimulate"); + Game.Edit += Assert.CallsBack("GameEdit"); + Client.EnterMenu += Assert.CallsBack("MenuEnter"); + Client.ExitMenu += Assert.CallsBack("MenuExit"); + } + + [APITestCase(TestType.Game)] + public static void Test() + { + // the test is actually completely implemented in StartUp() + // this is here just so it looks less weird (not required) + } + } +#endif +} diff --git a/GamecraftModdingAPI/App/AppEngine.cs b/GamecraftModdingAPI/App/AppEngine.cs new file mode 100644 index 0000000..4f20b7e --- /dev/null +++ b/GamecraftModdingAPI/App/AppEngine.cs @@ -0,0 +1,63 @@ +using System; + +using RobocraftX.GUI.MyGamesScreen; +using RobocraftX.GUI; +using Svelto.ECS; + +using GamecraftModdingAPI.Engines; +using GamecraftModdingAPI.Utility; + +namespace GamecraftModdingAPI.App +{ + public class AppEngine : IFactoryEngine + { + public event EventHandler EnterMenu; + + public event EventHandler ExitMenu; + + public IEntityFactory Factory { set; private get; } + + public string Name => "GamecraftModdingAPIAppEngine"; + + public bool isRemovable => false; + + public EntitiesDB entitiesDB { set; private get; } + + public void Dispose() + { + IsInMenu = false; + ExceptionUtil.InvokeEvent(ExitMenu, this, new MenuEventArgs { }); + } + + public void Ready() + { + IsInMenu = true; + ExceptionUtil.InvokeEvent(EnterMenu, this, new MenuEventArgs { }); + } + + // app functionality + + public bool IsInMenu + { + get; + private set; + } = false; + + public Game[] GetMyGames() + { + EntityCollection mgsevs = entitiesDB.QueryEntities(MyGamesScreenExclusiveGroups.MyGames); + Game[] games = new Game[mgsevs.count]; + for (int i = 0; i < mgsevs.count; i++) + { + Utility.Logging.MetaDebugLog($"Found game named {mgsevs[i].GameName}"); + games[i] = new Game(mgsevs[i].ID); + } + return games; + } + } + + public struct MenuEventArgs + { + + } +} diff --git a/GamecraftModdingAPI/App/AppExceptions.cs b/GamecraftModdingAPI/App/AppExceptions.cs new file mode 100644 index 0000000..2e67695 --- /dev/null +++ b/GamecraftModdingAPI/App/AppExceptions.cs @@ -0,0 +1,42 @@ +using System; +using System.Runtime.Serialization; + +namespace GamecraftModdingAPI.App +{ + public class AppException : GamecraftModdingAPIException + { + public AppException() + { + } + + public AppException(string message) : base(message) + { + } + + public AppException(string message, Exception innerException) : base(message, innerException) + { + } + } + + public class AppStateException : AppException + { + public AppStateException() + { + } + + public AppStateException(string message) : base(message) + { + } + } + + public class GameNotFoundException : AppException + { + public GameNotFoundException() + { + } + + public GameNotFoundException(string message) : base(message) + { + } + } +} diff --git a/GamecraftModdingAPI/App/Client.cs b/GamecraftModdingAPI/App/Client.cs new file mode 100644 index 0000000..2f1f005 --- /dev/null +++ b/GamecraftModdingAPI/App/Client.cs @@ -0,0 +1,49 @@ +using System; + +using UnityEngine; + +using GamecraftModdingAPI.Utility; + +namespace GamecraftModdingAPI.App +{ + public class Client + { + protected static AppEngine appEngine = new AppEngine(); + + public static event EventHandler EnterMenu + { + add => appEngine.EnterMenu += value; + remove => appEngine.EnterMenu -= value; + } + + public static event EventHandler ExitMenu + { + add => appEngine.ExitMenu += value; + remove => appEngine.ExitMenu -= value; + } + + public string Version + { + get => Application.version; + } + + public string UnityVersion + { + get => Application.unityVersion; + } + + public Game[] MyGames + { + get + { + if (!appEngine.IsInMenu) return new Game[0]; + return appEngine.GetMyGames(); + } + } + + internal static void Init() + { + MenuEngineManager.AddMenuEngine(appEngine); + } + } +} diff --git a/GamecraftModdingAPI/App/Game.cs b/GamecraftModdingAPI/App/Game.cs new file mode 100644 index 0000000..0d31abf --- /dev/null +++ b/GamecraftModdingAPI/App/Game.cs @@ -0,0 +1,331 @@ +using System; +using System.Collections.Generic; +using System.Runtime.CompilerServices; + +using RobocraftX.Common; +using RobocraftX.GUI.MyGamesScreen; +using RobocraftX.StateSync; +using Svelto.ECS; + +using GamecraftModdingAPI.Tasks; +using GamecraftModdingAPI.Utility; +// TODO: exceptions + +namespace GamecraftModdingAPI.App +{ + public class Game + { + protected static GameGameEngine gameEngine = new GameGameEngine(); + protected static GameMenuEngine menuEngine = new GameMenuEngine(); + protected static DebugInterfaceEngine debugOverlayEngine = new DebugInterfaceEngine(); + protected static GameBuildSimEventEngine buildSimEventEngine = new GameBuildSimEventEngine(); + + private List debugIds = new List(); + + private bool menuMode = true; + private bool hasId = false; + + public Game(uint id) : this(new EGID(id, MyGamesScreenExclusiveGroups.MyGames)) + { + } + + public Game(EGID id) + { + this.Id = id.entityID; + this.EGID = id; + this.hasId = true; + menuMode = true; + if (!VerifyMode()) throw new AppStateException("Game cannot be created while not in a game nor in a menu (is the game in a loading screen?)"); + } + + public Game() + { + menuMode = false; + if (!VerifyMode()) throw new AppStateException("Game cannot be created while not in a game nor in a menu (is the game in a loading screen?)"); + if (menuEngine.IsInMenu) throw new GameNotFoundException("Game not found."); + } + + public static Game CurrentGame() + { + return new Game(); + } + + public static Game NewGame() + { + if (!menuEngine.IsInMenu) throw new AppStateException("New Game cannot be created while not in a menu."); + uint nextId = menuEngine.HighestID() + 1; + EGID egid = new EGID(nextId, MyGamesScreenExclusiveGroups.MyGames); + menuEngine.CreateMyGame(egid); + return new Game(egid); + } + + public static event EventHandler Simulate + { + add => buildSimEventEngine.SimulationMode += value; + remove => buildSimEventEngine.SimulationMode -= value; + } + + public static event EventHandler Edit + { + add => buildSimEventEngine.BuildMode += value; + remove => buildSimEventEngine.BuildMode -= value; + } + + public static event EventHandler Enter + { + add => gameEngine.EnterGame += value; + remove => gameEngine.EnterGame -= value; + } + + public static event EventHandler Exit + { + add => gameEngine.ExitGame += value; + remove => gameEngine.ExitGame -= value; + } + + public uint Id + { + get; + private set; + } + + public EGID EGID + { + get; + private set; + } + + public bool MenuItem + { + get => menuMode && hasId; + } + + public string Name + { + get + { + if (!VerifyMode()) return null; + if (menuMode) return menuEngine.GetGameInfo(EGID).GameName; + return GameMode.SaveGameDetails.Name; + } + + set + { + if (!VerifyMode()) return; + if (menuMode) + { + menuEngine.SetGameName(EGID, value); + } + else + { + GameMode.SaveGameDetails.Name = value; + } + } + } + + public string Description + { + get + { + if (!VerifyMode()) return null; + if (menuMode) return menuEngine.GetGameInfo(EGID).GameDescription; + return ""; + } + + set + { + if (!VerifyMode()) return; + if (menuMode) + { + menuEngine.SetGameDescription(EGID, value); + } + else + { + // No description exists in-game + } + } + } + + public string Path + { + get + { + if (!VerifyMode()) return null; + if (menuMode) return menuEngine.GetGameInfo(EGID).SavedGamePath; + return GameMode.SaveGameDetails.Folder; + } + + set + { + if (!VerifyMode()) return; + if (menuMode) + { + menuEngine.GetGameInfo(EGID).SavedGamePath.Set(value); + } + else + { + // this likely breaks things + GameMode.SaveGameDetails = new SaveGameDetails(GameMode.SaveGameDetails.Name, value, GameMode.SaveGameDetails.WorkshopId); + } + } + } + + public ulong WorkshopId + { + get + { + if (!VerifyMode()) return 0uL; + if (menuMode) return 0uL; // MyGames don't have workshop IDs + return GameMode.SaveGameDetails.WorkshopId; + } + + set + { + VerifyMode(); + if (menuMode) + { + // MyGames don't have workshop IDs + // menuEngine.GetGameInfo(EGID).GameName.Set(value); + } + else + { + // this likely breaks things + GameMode.SaveGameDetails = new SaveGameDetails(GameMode.SaveGameDetails.Name, GameMode.SaveGameDetails.Folder, value); + } + } + } + + public bool IsSimulating + { + get + { + if (!VerifyMode()) return false; + return !menuMode && gameEngine.IsTimeRunningMode(); + } + + set + { + if (!VerifyMode()) return; + if (!menuMode && gameEngine.IsTimeRunningMode() != value) + gameEngine.ToggleTimeMode(); + } + } + + public bool IsTimeRunning + { + get => IsSimulating; + + set + { + IsSimulating = value; + } + } + + public bool IsTimeStopped + { + get + { + if (!VerifyMode()) return false; + return !menuMode && gameEngine.IsTimeStoppedMode(); + } + + set + { + if (!VerifyMode()) return; + if (!menuMode && gameEngine.IsTimeStoppedMode() != value) + gameEngine.ToggleTimeMode(); + } + } + + public void ToggleTimeMode() + { + if (!VerifyMode()) return; + if (menuMode || !gameEngine.IsInGame) + { + throw new AppStateException("Game menu item cannot toggle it's time mode"); + } + gameEngine.ToggleTimeMode(); + } + + public void EnterGame() + { + if (!VerifyMode()) return; + if (!hasId) + { + throw new GameNotFoundException("Game has an invalid ID"); + } + ISchedulable task = new Once(() => { menuEngine.EnterGame(EGID); this.menuMode = false; }); + Scheduler.Schedule(task); + } + + public void ExitGame() + { + if (!VerifyMode()) return; + if (menuMode) + { + throw new GameNotFoundException("Cannot exit game using menu ID"); + } + ISchedulable task = new Once(() => { gameEngine.ExitCurrentGame(); this.menuMode = true; }); + Scheduler.Schedule(task); + } + + public void AddDebugInfo(string id, Func contentGetter) + { + if (!VerifyMode()) return; + if (menuMode) + { + throw new GameNotFoundException("Game object references a menu item but AddDebugInfo only works on the currently-loaded game"); + } + debugOverlayEngine.SetInfo(id, contentGetter); + debugIds.Add(id); + } + + public bool RemoveDebugInfo(string id) + { + if (!VerifyMode()) return false; + if (menuMode) + { + throw new GameNotFoundException("Game object references a menu item but RemoveDebugInfo only works on the currently-loaded game"); + } + if (!debugIds.Contains(id)) return false; + debugOverlayEngine.RemoveInfo(id); + return debugIds.Remove(id); + } + + ~Game() + { + foreach (string id in debugIds) + { + debugOverlayEngine.RemoveInfo(id); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private bool VerifyMode() + { + if (menuMode && (!menuEngine.IsInMenu || gameEngine.IsInGame)) + { + // either game loading or API is broken + return false; + } + if (!menuMode && (menuEngine.IsInMenu || !gameEngine.IsInGame)) + { + // either game loading or API is broken + return false; + } + return true; + } + + internal static void Init() + { + GameEngineManager.AddGameEngine(gameEngine); + GameEngineManager.AddGameEngine(debugOverlayEngine); + MenuEngineManager.AddMenuEngine(menuEngine); + } + + internal static void InitDeterministic(StateSyncRegistrationHelper stateSyncReg) + { + stateSyncReg.AddDeterministicEngine(buildSimEventEngine); + } + } +} diff --git a/GamecraftModdingAPI/App/GameBuildSimEventEngine.cs b/GamecraftModdingAPI/App/GameBuildSimEventEngine.cs new file mode 100644 index 0000000..b4bc049 --- /dev/null +++ b/GamecraftModdingAPI/App/GameBuildSimEventEngine.cs @@ -0,0 +1,48 @@ +using System; + +using RobocraftX.Common; +using RobocraftX.StateSync; +using Svelto.ECS; +using Unity.Jobs; + +using GamecraftModdingAPI.Engines; +using GamecraftModdingAPI.Utility; + +namespace GamecraftModdingAPI.App +{ + public class GameBuildSimEventEngine : IApiEngine, IUnorderedInitializeOnTimeRunningModeEntered, IUnorderedInitializeOnTimeStoppedModeEntered + { + public event EventHandler SimulationMode; + + public event EventHandler BuildMode; + + public string Name => "GamecraftModdingAPIBuildSimEventGameEngine"; + + public bool isRemovable => false; + + public EntitiesDB entitiesDB { set; private get; } + + public void Dispose() { } + + public void Ready() { } + + public JobHandle OnInitializeTimeRunningMode() + { + ExceptionUtil.InvokeEvent(SimulationMode, this, new GameEventArgs { GameName = GameMode.SaveGameDetails.Name, GamePath = GameMode.SaveGameDetails.Folder }); + return default(JobHandle); + } + + public JobHandle OnInitializeTimeStoppedMode() + { + ExceptionUtil.InvokeEvent(BuildMode, this, new GameEventArgs { GameName = GameMode.SaveGameDetails.Name, GamePath = GameMode.SaveGameDetails.Folder }); + return default(JobHandle); + } + } + + public struct GameEventArgs + { + public string GameName; + + public string GamePath; + } +} diff --git a/GamecraftModdingAPI/App/GameGameEngine.cs b/GamecraftModdingAPI/App/GameGameEngine.cs new file mode 100644 index 0000000..9253af2 --- /dev/null +++ b/GamecraftModdingAPI/App/GameGameEngine.cs @@ -0,0 +1,80 @@ +using System; +using System.Collections.Generic; +using HarmonyLib; + +using RobocraftX; +using RobocraftX.Common; +using RobocraftX.Schedulers; +using RobocraftX.SimulationModeState; +using Svelto.ECS; +using Svelto.Tasks; +using Svelto.Tasks.Lean; + +using GamecraftModdingAPI.Engines; +using GamecraftModdingAPI.Utility; + +namespace GamecraftModdingAPI.App +{ + public class GameGameEngine : IApiEngine + { + public event EventHandler EnterGame; + + public event EventHandler ExitGame; + + public string Name => "GamecraftModdingAPIGameInfoMenuEngine"; + + public bool isRemovable => false; + + public EntitiesDB entitiesDB { set; private get; } + + public void Dispose() + { + ExceptionUtil.InvokeEvent(ExitGame, this, new GameEventArgs { GameName = GameMode.SaveGameDetails.Name, GamePath = GameMode.SaveGameDetails.Folder }); + IsInGame = false; + } + + public void Ready() + { + ExceptionUtil.InvokeEvent(EnterGame, this, new GameEventArgs { GameName = GameMode.SaveGameDetails.Name, GamePath = GameMode.SaveGameDetails.Folder }); + IsInGame = true; + } + + // game functionality + + public bool IsInGame + { + get; + private set; + } = false; + + public void ExitCurrentGame() + { + ExitCurrentGameAsync().RunOn(Lean.EveryFrameStepRunner_RUNS_IN_TIME_STOPPED_AND_RUNNING); + } + + public IEnumerator ExitCurrentGameAsync() + { + /* + while (Lean.EveryFrameStepRunner_RUNS_IN_TIME_STOPPED_AND_RUNNING.isStopping) { yield return Yield.It; } + AccessTools.Method(typeof(FullGameCompositionRoot), "SwitchToMenu").Invoke(FullGameFields.Instance, new object[0]);*/ + yield return Yield.It; + entitiesDB.QueryEntity(CommonExclusiveGroups.GameSceneEGID).WantsToQuit = true; + entitiesDB.PublishEntityChange(CommonExclusiveGroups.GameSceneEGID); + } + + public bool IsTimeRunningMode() + { + return TimeRunningModeUtil.IsTimeRunningMode(entitiesDB); + } + + public bool IsTimeStoppedMode() + { + return TimeRunningModeUtil.IsTimeStoppedMode(entitiesDB); + } + + public void ToggleTimeMode() + { + TimeRunningModeUtil.ToggleTimeRunningState(entitiesDB); + } + } +} diff --git a/GamecraftModdingAPI/App/GameMenuEngine.cs b/GamecraftModdingAPI/App/GameMenuEngine.cs new file mode 100644 index 0000000..fc2c35f --- /dev/null +++ b/GamecraftModdingAPI/App/GameMenuEngine.cs @@ -0,0 +1,128 @@ +using System; +using HarmonyLib; + +using RobocraftX; +using RobocraftX.Common; +using RobocraftX.GUI; +using RobocraftX.GUI.MyGamesScreen; +using Svelto.ECS; +using Svelto.ECS.Experimental; + +using GamecraftModdingAPI.Engines; +using GamecraftModdingAPI.Utility; + +namespace GamecraftModdingAPI.App +{ + public class GameMenuEngine : IFactoryEngine + { + public IEntityFactory Factory { set; private get; } + + public string Name => "GamecraftModdingAPIGameInfoGameEngine"; + + public bool isRemovable => false; + + public EntitiesDB entitiesDB { set; private get; } + + public void Dispose() + { + IsInMenu = false; + } + + public void Ready() + { + IsInMenu = true; + } + + // game functionality + + public bool IsInMenu + { + get; + private set; + } = false; + + public bool CreateMyGame(EGID id, string path = "", uint thumbnailId = 0, string gameName = "", string creatorName = "", string description = "", long createdDate = 0L) + { + EntityComponentInitializer eci = Factory.BuildEntity(id); + eci.Init(new MyGameDataEntityStruct + { + SavedGamePath = new ECSString(path), + ThumbnailId = thumbnailId, + GameName = new ECSString(gameName), + CreatorName = new ECSString(creatorName), + GameDescription = new ECSString(description), + CreatedDate = createdDate, + }); + // entitiesDB.PublishEntityChange(id); // this will always fail + return true; + } + + public uint HighestID() + { + EntityCollection games = entitiesDB.QueryEntities(MyGamesScreenExclusiveGroups.MyGames); + uint max = 0; + for (int i = 0; i < games.count; i++) + { + if (games[i].ID.entityID > max) + { + max = games[i].ID.entityID; + } + } + return max; + } + + public bool EnterGame(EGID id) + { + if (!ExistsGameInfo(id)) return false; + ref MyGameDataEntityStruct mgdes = ref GetGameInfo(id); + return EnterGame(mgdes.GameName, mgdes.SavedGamePath); + } + + public bool EnterGame(string gameName, string path, ulong workshopId = 0uL, bool autoEnterSim = false) + { + GameMode.CurrentMode = autoEnterSim ? RCXMode.Play : RCXMode.Build; + GameMode.SaveGameDetails = new SaveGameDetails(gameName, path, workshopId); + // the private FullGameCompositionRoot.SwitchToGame() method gets passed to menu items for this reason + AccessTools.Method(typeof(FullGameCompositionRoot), "SwitchToGame").Invoke(FullGameFields.Instance, new object[0]); + return true; + } + + public bool SetGameName(EGID id, string name) + { + if (!ExistsGameInfo(id)) return false; + GetGameInfo(id).GameName.Set(name); + GetGameViewInfo(id).MyGamesSlotComponent.GameName = StringUtil.SanitiseString(name); + return true; + } + + public bool SetGameDescription(EGID id, string name) + { + if (!ExistsGameInfo(id)) return false; + GetGameInfo(id).GameDescription.Set(name); + GetGameViewInfo(id).MyGamesSlotComponent.GameDescription = StringUtil.SanitiseString(name); + return true; + } + + public bool ExistsGameInfo(EGID id) + { + return entitiesDB.Exists(id); + } + + public ref MyGameDataEntityStruct GetGameInfo(EGID id) + { + return ref GetComponent(id); + } + + public ref MyGamesSlotEntityViewStruct GetGameViewInfo(EGID id) + { + return ref GetComponent(new EGID(id.entityID, MyGamesScreenExclusiveGroups.GameSlotGuiEntities)); + } + + public ref T GetComponent(EGID id) where T: struct, IEntityComponent + { + return ref entitiesDB.QueryEntity(id); + } + } + + internal class MyGameDataEntityDescriptor_DamnItFJWhyDidYouMakeThisInternal : GenericEntityDescriptor { } +} diff --git a/GamecraftModdingAPI/App/StateSyncRegPatch.cs b/GamecraftModdingAPI/App/StateSyncRegPatch.cs new file mode 100644 index 0000000..9c2ce68 --- /dev/null +++ b/GamecraftModdingAPI/App/StateSyncRegPatch.cs @@ -0,0 +1,26 @@ +using System; +using System.Reflection; + +using RobocraftX.CR.MainGame; +using RobocraftX.StateSync; + +using HarmonyLib; + +namespace GamecraftModdingAPI.App +{ + [HarmonyPatch] + class StateSyncRegPatch + { + public static void Postfix(StateSyncRegistrationHelper stateSyncReg) + { + // register sim/build events engines + Game.InitDeterministic(stateSyncReg); + } + + [HarmonyTargetMethod] + public static MethodBase Target() + { + return AccessTools.Method(typeof(MainGameCompositionRoot), "DeterministicCompose").MakeGenericMethod(typeof(object)); + } + } +} diff --git a/GamecraftModdingAPI/Main.cs b/GamecraftModdingAPI/Main.cs index bea58e1..aa80e2a 100644 --- a/GamecraftModdingAPI/Main.cs +++ b/GamecraftModdingAPI/Main.cs @@ -72,6 +72,8 @@ namespace GamecraftModdingAPI Block.Init(); GameClient.Init(); AsyncUtils.Init(); + GamecraftModdingAPI.App.Client.Init(); + GamecraftModdingAPI.App.Game.Init(); Logging.MetaLog($"{currentAssembly.GetName().Name} v{currentAssembly.GetName().Version} initialized"); } diff --git a/GamecraftModdingAPI/Utility/FullGameFields.cs b/GamecraftModdingAPI/Utility/FullGameFields.cs index 5291d4a..8fd8895 100644 --- a/GamecraftModdingAPI/Utility/FullGameFields.cs +++ b/GamecraftModdingAPI/Utility/FullGameFields.cs @@ -25,8 +25,15 @@ namespace GamecraftModdingAPI.Utility /// public static class FullGameFields { + public static FullGameCompositionRoot Instance + { + private set; + get; + } = null; + public static MultiplayerInitParameters _multiplayerParams - { get + { + get { return (MultiplayerInitParameters)fgcr?.Field("_multiplayerParams").GetValue(); } @@ -157,6 +164,7 @@ namespace GamecraftModdingAPI.Utility public static void Init(FullGameCompositionRoot instance) { fgcr = new Traverse(instance); + FullGameFields.Instance = instance; } } } -- 2.30.2 From 78122ee445917a8d0cc87cb67c21db024cd6e57b Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Wed, 17 Jun 2020 21:04:40 -0400 Subject: [PATCH 057/252] Add automatic testing functionality --- GamecraftModdingAPI.sln | 3 + .../GamecraftModdingAPI.csproj | 406 +++++++++++++++++- .../Tests/APITestAttributes.cs | 45 ++ GamecraftModdingAPI/Tests/Assert.cs | 64 +++ .../Tests/GamecraftModdingAPIPluginTest.cs | 150 ++++--- GamecraftModdingAPI/Tests/TestRoot.cs | 247 +++++++++++ GamecraftModdingAPI/Tests/TestTest.cs | 52 +++ 7 files changed, 903 insertions(+), 64 deletions(-) create mode 100644 GamecraftModdingAPI/Tests/APITestAttributes.cs create mode 100644 GamecraftModdingAPI/Tests/Assert.cs create mode 100644 GamecraftModdingAPI/Tests/TestRoot.cs create mode 100644 GamecraftModdingAPI/Tests/TestTest.cs diff --git a/GamecraftModdingAPI.sln b/GamecraftModdingAPI.sln index ff9fc7f..6482776 100644 --- a/GamecraftModdingAPI.sln +++ b/GamecraftModdingAPI.sln @@ -9,12 +9,15 @@ Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU + Test|Any CPU = Test|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {7FD5A7D8-4F3E-426A-B07D-7DC70442A4DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {7FD5A7D8-4F3E-426A-B07D-7DC70442A4DF}.Debug|Any CPU.Build.0 = Debug|Any CPU {7FD5A7D8-4F3E-426A-B07D-7DC70442A4DF}.Release|Any CPU.ActiveCfg = Release|Any CPU {7FD5A7D8-4F3E-426A-B07D-7DC70442A4DF}.Release|Any CPU.Build.0 = Release|Any CPU + {7FD5A7D8-4F3E-426A-B07D-7DC70442A4DF}.Test|Any CPU.ActiveCfg = Test|Any CPU + {7FD5A7D8-4F3E-426A-B07D-7DC70442A4DF}.Test|Any CPU.Build.0 = Test|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/GamecraftModdingAPI/GamecraftModdingAPI.csproj b/GamecraftModdingAPI/GamecraftModdingAPI.csproj index 0fdbcfd..c78272a 100644 --- a/GamecraftModdingAPI/GamecraftModdingAPI.csproj +++ b/GamecraftModdingAPI/GamecraftModdingAPI.csproj @@ -1,5 +1,4 @@ - - + net472 true @@ -14,19 +13,403 @@ + + DEBUG;TEST;TRACE + + + ..\..\ref\Gamecraft_Data\Managed\Analytics.dll + + + ..\..\ref\Gamecraft_Data\Managed\Assembly-CSharp-firstpass.dll + + + ..\..\ref\Gamecraft_Data\Managed\Assembly-CSharp.dll + + + ..\..\ref\Gamecraft_Data\Managed\Authentication.dll + + + ..\..\ref\Gamecraft_Data\Managed\BlockEntityFactory.dll + + + ..\..\ref\Gamecraft_Data\Managed\Blocks.HUDFeedbackBlocks.dll + + + ..\..\ref\Gamecraft_Data\Managed\ClusterToWireConversion.Mock.dll + + + ..\..\ref\Gamecraft_Data\Managed\CommandLine.dll + + + ..\..\ref\Gamecraft_Data\Managed\DataLoader.dll + + + ..\..\ref\Gamecraft_Data\Managed\DDNA.dll + + + ..\..\ref\Gamecraft_Data\Managed\FMOD.dll + + + ..\..\ref\Gamecraft_Data\Managed\FullGame.dll + + + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.AudioBlocks.dll + + + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.ConsoleBlock.dll + + + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.DamagingSurfaceBlock.dll + + + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.GenericPhysicsBlocks.dll + + + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.LogicBlock.dll + + + ..\..\ref\Gamecraft_Data\Managed\GameCraft.Blocks.ProjectileBlock.dll + + + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.TimerBlock.dll + + + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.CharacterVulnerability.dll + + + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.CharacterVulnerabilityGui.dll + + + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Effects.dll + + + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.ConsoleBlock.dll + + + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll + + + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.HUDFeedbackBlocks.dll + + + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Tweaks.dll + + + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Wires.dll + + + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Wires.Mockup.dll + + + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll + + + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Music.dll + + + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.PerformanceWarnings.dll + + + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Tweaks.dll + + + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Tweaks.Mockup.dll + + + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.VisualEffects.dll + + + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Wires.dll + + + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Wires.Input.dll + + + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Wires.Mockup.dll + + + ..\..\ref\Gamecraft_Data\Managed\GameState.dll + + + ..\..\ref\Gamecraft_Data\Managed\GPUInstancer.dll + + + ..\..\ref\Gamecraft_Data\Managed\Havok.Physics.dll + + + ..\..\ref\Gamecraft_Data\Managed\Havok.Physics.Hybrid.dll + + + ..\..\ref\Gamecraft_Data\Managed\LZ4.dll + + + ..\..\ref\Gamecraft_Data\Managed\MultiplayerNetworking.dll + + + ..\..\ref\Gamecraft_Data\Managed\MultiplayerTest.dll + + + ..\..\ref\Gamecraft_Data\Managed\RCX.ScreenshotTaker.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftECS.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.AccountPreferences.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Blocks.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Blocks.Ghost.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Blocks.Triggers.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Building.BoxSelect.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Building.Jobs.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Character.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.ClusterToWireConversion.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Common.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.ControlsScreen.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Crosshair.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.FrontEnd.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.BlockLabel.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.DebugDisplay.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.RemoveBlock.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.ScaleGhost.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUIs.WorkshopPrefabs.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Input.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.MachineEditor.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.MainGame.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.MainSimulation.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.MockCharacter.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Multiplayer.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.MultiplayerInput.dll + + + ..\..\ref\Gamecraft_Data\Managed\Robocraftx.ObjectIdBlocks.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Party.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.PartyGui.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Physics.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.PilotSeat.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Player.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Rendering.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Rendering.Mock.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.SaveAndLoad.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.SaveGameDialog.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Serializers.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Services.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.SignalHandling.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.StateSync.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX_SpawnPoints.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX_TextBlock.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocratX.SimulationCompositionRoot.dll + + + ..\..\ref\Gamecraft_Data\Managed\StringFormatter.dll + + + ..\..\ref\Gamecraft_Data\Managed\Svelto.Common_3.dll + + + ..\..\ref\Gamecraft_Data\Managed\Svelto.ECS.dll + + + ..\..\ref\Gamecraft_Data\Managed\Svelto.Services.dll + + + ..\..\ref\Gamecraft_Data\Managed\Svelto.Tasks.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.Addressables.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.Build.SlimPlayerRuntime.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.Burst.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.Collections.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.Deformations.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.Entities.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.Entities.Hybrid.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.Jobs.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.Mathematics.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.Mathematics.Extensions.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.Physics.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.Physics.Hybrid.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.Platforms.Common.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.Postprocessing.Runtime.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.Properties.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.Properties.Reflection.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.Properties.UI.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipeline.Universal.ShaderLibrary.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Universal.Runtime.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Universal.Shaders.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.ResourceManager.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.Scenes.Hybrid.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.ScriptableBuildPipeline.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.Serialization.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.TextMeshPro.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.Timeline.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.Transforms.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.Transforms.Hybrid.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UI.dll + + + ..\..\ref\Gamecraft_Data\Managed\uREPL.dll + + + ..\..\ref\Gamecraft_Data\Managed\VisualProfiler.dll + - - - - - - - + ..\ref\Gamecraft_Data\Managed\IllusionInjector.dll @@ -833,6 +1216,5 @@ ..\..\ref\Gamecraft_Data\Managed\VisualProfiler.dll - - - + + \ No newline at end of file diff --git a/GamecraftModdingAPI/Tests/APITestAttributes.cs b/GamecraftModdingAPI/Tests/APITestAttributes.cs new file mode 100644 index 0000000..8506a56 --- /dev/null +++ b/GamecraftModdingAPI/Tests/APITestAttributes.cs @@ -0,0 +1,45 @@ +using System; +namespace GamecraftModdingAPI.Tests +{ + public enum TestType + { + Menu, + Game, + SimulationMode, + EditMode, + } + + [AttributeUsage(AttributeTargets.Class)] + public class APITestClassAttribute : Attribute + { + internal string Name; + + public APITestClassAttribute(string name = "") + { + this.Name = name; + } + } + + [AttributeUsage(AttributeTargets.Method)] + public class APITestCaseAttribute : Attribute + { + internal TestType TestType; + + public APITestCaseAttribute(TestType testType) + { + this.TestType = testType; + } + } + + [AttributeUsage(AttributeTargets.Method)] + public class APITestStartUpAttribute : Attribute + { + + } + + [AttributeUsage(AttributeTargets.Method)] + public class APITestTearDownAttribute : Attribute + { + + } +} diff --git a/GamecraftModdingAPI/Tests/Assert.cs b/GamecraftModdingAPI/Tests/Assert.cs new file mode 100644 index 0000000..fb03013 --- /dev/null +++ b/GamecraftModdingAPI/Tests/Assert.cs @@ -0,0 +1,64 @@ +using System; +using System.Collections.Concurrent; +using System.IO; +using System.Runtime.CompilerServices; + +namespace GamecraftModdingAPI.Tests +{ + public static class Assert + { + private static StreamWriter logFile = null; + + private static ConcurrentDictionary callbacks = new ConcurrentDictionary(); + + private const string PASS = "SUCCESS: "; + + private const string FAIL = "FAILURE: "; + + private const string WARN = "WARNING: "; + + private const string INFO = "DEBUG: "; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void Log(string msg, string end = "\n") + { + if (logFile == null) openTestLog(); + logFile.Write(msg + end); + logFile.Flush(); + } + + public static EventHandler CallsBack(string eventName, string eventMsg = null) + { + if (eventMsg == null) eventMsg = $"expected callback to {eventName} but it never occurred..."; + callbacks[eventName] = eventMsg; + + return (sender, args) => + { + string value = null; + if (!callbacks.TryRemove(eventName, out value)) { Log(WARN + $"callback to {eventName} occurred again or a related error occurred... (Received '{args.ToString()}' from '{(sender == null ? (string)sender : sender.ToString())}')"); } + Log(PASS + $"callback to {eventName} occurred... (Received '{args.ToString()}' from '{(sender == null ? (string)sender : sender.ToString())}')"); + TestRoot.TestsPassed = true; + }; + } + + internal static void CallsComplete() + { + foreach(string key in callbacks.Keys) + { + Log(FAIL + callbacks[key]); + TestRoot.TestsPassed = false; + } + } + + internal static void CloseLog() + { + if (logFile != null) logFile.Close(); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static void openTestLog() + { + logFile = File.CreateText(TestRoot.ReportFile); + } + } +} diff --git a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs index dc07e1e..fa65ebb 100644 --- a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs +++ b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs @@ -48,11 +48,11 @@ namespace GamecraftModdingAPI.Tests GamecraftModdingAPI.Main.Shutdown(); } - public void OnApplicationStart() - { + public void OnApplicationStart() + { FileLog.Reset(); Harmony.DEBUG = true; - GamecraftModdingAPI.Main.Init(); + GamecraftModdingAPI.Main.Init(); Logging.MetaDebugLog($"Version group id {(uint)ApiExclusiveGroups.versionGroup}"); // in case Steam is not installed/running // this will crash the game slightly later during startup @@ -62,7 +62,7 @@ namespace GamecraftModdingAPI.Tests // disable some Gamecraft analytics //AnalyticsDisablerPatch.DisableAnalytics = true; // disable background music - Logging.MetaDebugLog("Audio Mixers: "+string.Join(",", AudioTools.GetMixers())); + Logging.MetaDebugLog("Audio Mixers: " + string.Join(",", AudioTools.GetMixers())); //AudioTools.SetVolume(0.0f, "Music"); // The game now sets this from settings again after this is called :( //Utility.VersionTracking.Enable();//(very) unstable @@ -76,60 +76,68 @@ namespace GamecraftModdingAPI.Tests HandlerBuilder.Builder("menuact API debug") .Handle(EventType.Menu) - .OnActivation(() => { Logging.Log("Menu Activated event!"); }) + .OnActivation(() => { Logging.Log("Menu Activated event!"); }) .OnDestruction(() => { Logging.Log("Menu Destroyed event!"); }) .Build(); HandlerBuilder.Builder("menuswitch API debug") - .Handle(EventType.MenuSwitchedTo) - .OnActivation(() => { Logging.Log("Menu Switched To event!"); }) - .Build(); + .Handle(EventType.MenuSwitchedTo) + .OnActivation(() => { Logging.Log("Menu Switched To event!"); }) + .Build(); HandlerBuilder.Builder("gameact API debug") - .Handle(EventType.Menu) - .OnActivation(() => { Logging.Log("Game Activated event!"); }) - .OnDestruction(() => { Logging.Log("Game Destroyed event!"); }) - .Build(); + .Handle(EventType.Menu) + .OnActivation(() => { Logging.Log("Game Activated event!"); }) + .OnDestruction(() => { Logging.Log("Game Destroyed event!"); }) + .Build(); HandlerBuilder.Builder("gamerel API debug") - .Handle(EventType.GameReloaded) - .OnActivation(() => { Logging.Log("Game Reloaded event!"); }) - .Build(); + .Handle(EventType.GameReloaded) + .OnActivation(() => { Logging.Log("Game Reloaded event!"); }) + .Build(); HandlerBuilder.Builder("gameswitch API debug") - .Handle(EventType.GameSwitchedTo) - .OnActivation(() => { Logging.Log("Game Switched To event!"); }) - .Build(); + .Handle(EventType.GameSwitchedTo) + .OnActivation(() => { Logging.Log("Game Switched To event!"); }) + .Build(); HandlerBuilder.Builder("simulationswitch API debug") - .Handle(EventType.SimulationSwitchedTo) - .OnActivation(() => { Logging.Log("Game Mode Simulation Switched To event!"); }) - .Build(); + .Handle(EventType.SimulationSwitchedTo) + .OnActivation(() => { Logging.Log("Game Mode Simulation Switched To event!"); }) + .Build(); HandlerBuilder.Builder("buildswitch API debug") - .Handle(EventType.BuildSwitchedTo) - .OnActivation(() => { Logging.Log("Game Mode Build Switched To event!"); }) - .Build(); + .Handle(EventType.BuildSwitchedTo) + .OnActivation(() => { Logging.Log("Game Mode Build Switched To event!"); }) + .Build(); HandlerBuilder.Builder("menu activated API error thrower test") .Handle(EventType.Menu) .OnActivation(() => { throw new Exception("Event Handler always throws an exception!"); }) .Build(); - // debug/test commands + /*HandlerBuilder.Builder("enter game from menu test") + .Handle(EventType.Menu) + .OnActivation(() => + { + Tasks.Scheduler.Schedule(new Tasks.Repeatable(enterGame, shouldRetry, 0.2f)); + }) + .Build();*/ + + // debug/test commands if (Dependency.Hell("ExtraCommands")) { CommandBuilder.Builder() - .Name("Exit") - .Description("Close Gamecraft immediately, without any prompts") - .Action(() => { UnityEngine.Application.Quit(); }) - .Build(); - + .Name("Exit") + .Description("Close Gamecraft immediately, without any prompts") + .Action(() => { UnityEngine.Application.Quit(); }) + .Build(); + CommandBuilder.Builder() - .Name("SetFOV") - .Description("Set the player camera's field of view") - .Action((float d) => { UnityEngine.Camera.main.fieldOfView = d; }) - .Build(); + .Name("SetFOV") + .Description("Set the player camera's field of view") + .Action((float d) => { UnityEngine.Camera.main.fieldOfView = d; }) + .Build(); CommandBuilder.Builder() .Name("MoveLastBlock") @@ -144,14 +152,14 @@ namespace GamecraftModdingAPI.Tests }).Build(); CommandBuilder.Builder() - .Name("PlaceAluminium") - .Description("Place a block of aluminium at the given coordinates") - .Action((float x, float y, float z) => - { - var block = Block.PlaceNew(BlockIDs.AluminiumCube, new float3(x, y, z)); - Logging.CommandLog("Block placed with type: " + block.Type); - }) - .Build(); + .Name("PlaceAluminium") + .Description("Place a block of aluminium at the given coordinates") + .Action((float x, float y, float z) => + { + var block = Block.PlaceNew(BlockIDs.AluminiumCube, new float3(x, y, z)); + Logging.CommandLog("Block placed with type: " + block.Type); + }) + .Build(); CommandBuilder.Builder() .Name("PlaceAluminiumLots") @@ -161,8 +169,8 @@ namespace GamecraftModdingAPI.Tests Logging.CommandLog("Starting..."); var sw = Stopwatch.StartNew(); for (int i = 0; i < 100; i++) - for (int j = 0; j < 100; j++) - Block.PlaceNew(BlockIDs.AluminiumCube, new float3(x + i, y, z + j)); + for (int j = 0; j < 100; j++) + Block.PlaceNew(BlockIDs.AluminiumCube, new float3(x + i, y, z + j)); //Block.Sync(); sw.Stop(); Logging.CommandLog("Finished in " + sw.ElapsedMilliseconds + "ms"); @@ -171,10 +179,10 @@ namespace GamecraftModdingAPI.Tests //With Sync(): 1135ms //Without Sync(): 134ms //Async: 348 794ms, doesn't freeze game - //Without Sync() but wait for submission: 530ms - //With Sync() at the end: 380ms + //Without Sync() but wait for submission: 530ms + //With Sync() at the end: 380ms - Block b = null; + Block b = null; CommandBuilder.Builder("moveBlockInSim", "Run in build mode first while looking at a block, then in sim to move it up") .Action(() => { @@ -204,7 +212,7 @@ namespace GamecraftModdingAPI.Tests return; } new Player(PlayerType.Local).GetBlockLookedAt().Color = - new BlockColor {Color = color}; + new BlockColor { Color = color }; Logging.CommandLog("Colored block to " + color); }).Build(); @@ -230,7 +238,7 @@ namespace GamecraftModdingAPI.Tests Block.Removed += (sender, args) => Logging.MetaDebugLog("Removed block " + args.Type + " with ID " + args.ID); - /* + /* CommandManager.AddCommand(new SimpleCustomCommandEngine((float d) => { UnityEngine.Camera.main.fieldOfView = d; }, "SetFOV", "Set the player camera's field of view")); CommandManager.AddCommand(new SimpleCustomCommandEngine( @@ -274,8 +282,8 @@ namespace GamecraftModdingAPI.Tests */ } - // dependency test - if (Dependency.Hell("GamecraftScripting", new Version("0.0.1.0"))) + // dependency test + if (Dependency.Hell("GamecraftScripting", new Version("0.0.1.0"))) { Logging.LogWarning("You're in GamecraftScripting dependency hell"); } @@ -283,7 +291,11 @@ namespace GamecraftModdingAPI.Tests { Logging.Log("Compatible GamecraftScripting detected"); } - } + +#if TEST + TestRoot.RunTests(); +#endif + } private string modsString; private string InstalledMods() @@ -295,6 +307,40 @@ namespace GamecraftModdingAPI.Tests return modsString = sb.ToString(); } + private bool retry = true; + + private bool shouldRetry() + { + return retry; + } + + private void enterGame() + { + App.Client app = new App.Client(); + App.Game[] myGames = app.MyGames; + Logging.MetaDebugLog($"MyGames count {myGames.Length}"); + if (myGames.Length != 0) + { + Logging.MetaDebugLog($"MyGames[0] EGID {myGames[0].EGID}"); + retry = false; + try + { + //myGames[0].Description = "test msg pls ignore"; // make sure game exists first + Logging.MetaDebugLog($"Entering game {myGames[0].Name}"); + myGames[0].EnterGame(); + } + catch (Exception e) + { + Logging.MetaDebugLog($"Failed to enter game; exception: {e}"); + retry = true; + } + } + else + { + Logging.MetaDebugLog("MyGames not populated yet :("); + } + } + public void OnFixedUpdate() { } public void OnLateUpdate() { } diff --git a/GamecraftModdingAPI/Tests/TestRoot.cs b/GamecraftModdingAPI/Tests/TestRoot.cs new file mode 100644 index 0000000..167173f --- /dev/null +++ b/GamecraftModdingAPI/Tests/TestRoot.cs @@ -0,0 +1,247 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Reflection; +using System.Linq; // welcome to the dark side + +using Svelto.Tasks; +using Svelto.Tasks.Lean; +using Svelto.Tasks.Enumerators; +using UnityEngine; + +using GamecraftModdingAPI.App; +using GamecraftModdingAPI.Tasks; +using GamecraftModdingAPI.Utility; + +namespace GamecraftModdingAPI.Tests +{ + public static class TestRoot + { + public static bool AutoShutdown = true; + + public const string ReportFile = "GamecraftModdingAPI_tests.log"; + + private static bool _testsPassed = false; + + private static uint _testsCount = 0; + + private static uint _testsCountPassed = 0; + + private static uint _testsCountFailed = 0; + + private static string state = "StartingUp"; + + private static Stopwatch timer; + + private static List testTypes = null; + + public static bool TestsPassed + { + get => _testsPassed; + set + { + _testsPassed = _testsPassed && value; + _testsCount++; + if (value) + { + _testsCountPassed++; + } + else + { + _testsCountFailed++; + } + } + } + + private static void StartUp() + { + // init + timer = Stopwatch.StartNew(); + _testsPassed = true; + _testsCount = 0; + _testsCountPassed = 0; + _testsCountFailed = 0; + // flow control + Game.Enter += (sender, args) => { GameTests().RunOn(RobocraftX.Schedulers.Lean.EveryFrameStepRunner_RUNS_IN_TIME_STOPPED_AND_RUNNING); }; + Game.Exit += (s, a) => state = "ReturningFromGame"; + Client.EnterMenu += (sender, args) => + { + if (state == "EnteringMenu") + { + MenuTests().RunOn(Scheduler.leanRunner); + state = "EnteringGame"; + } + if (state == "ReturningFromGame") + { + TearDown().RunOn(Scheduler.leanRunner); + state = "ShuttingDown"; + } + }; + // init tests here + foreach (Type t in testTypes) + { + foreach (MethodBase m in t.GetMethods()) + { + if (m.GetCustomAttribute() != null) + { + m.Invoke(null, new object[0]); + } + } + } + state = "EnteringMenu"; + } + + private static IEnumerator MenuTests() + { + yield return Yield.It; + // menu tests + foreach (Type t in testTypes) + { + foreach (MethodBase m in t.GetMethods()) + { + APITestCaseAttribute a = m.GetCustomAttribute(); + if (a != null && a.TestType == TestType.Menu) + { + m.Invoke(null, new object[0]); + yield return Yield.It; + } + } + } + // load game + yield return GoToGameTests().Continue(); + } + + private static IEnumerator GoToGameTests() + { + Client app = new Client(); + int oldLength = 0; + while (app.MyGames.Length == 0 || oldLength != app.MyGames.Length) + { + oldLength = app.MyGames.Length; + yield return new WaitForSecondsEnumerator(1).Continue(); + } + yield return Yield.It; + app.MyGames[0].EnterGame(); + // returning from a new game without saving will hard lock GC (it's an invalid state) + //Game newGame = Game.NewGame(); + //yield return new WaitForSecondsEnumerator(5).Continue(); // wait for sync + //newGame.EnterGame(); + } + + private static IEnumerator GameTests() + { + yield return Yield.It; + Game currentGame = Game.CurrentGame(); + // in-game tests + yield return new WaitForSecondsEnumerator(5).Continue(); // wait for game to finish loading + foreach (Type t in testTypes) + { + foreach (MethodBase m in t.GetMethods()) + { + APITestCaseAttribute a = m.GetCustomAttribute(); + if (a != null && a.TestType == TestType.Game) + { + m.Invoke(null, new object[0]); + yield return Yield.It; + } + } + } + currentGame.ToggleTimeMode(); + yield return new WaitForSecondsEnumerator(5).Continue(); + // simulation tests + foreach (Type t in testTypes) + { + foreach (MethodBase m in t.GetMethods()) + { + APITestCaseAttribute a = m.GetCustomAttribute(); + if (a != null && a.TestType == TestType.SimulationMode) + { + m.Invoke(null, new object[0]); + yield return Yield.It; + } + } + } + currentGame.ToggleTimeMode(); + yield return new WaitForSecondsEnumerator(5).Continue(); + // build tests + foreach (Type t in testTypes) + { + foreach (MethodBase m in t.GetMethods()) + { + APITestCaseAttribute a = m.GetCustomAttribute(); + if (a != null && a.TestType == TestType.EditMode) + { + m.Invoke(null, new object[0]); + yield return Yield.It; + } + } + } + // exit game + yield return new WaitForSecondsEnumerator(5).Continue(); + yield return ReturnToMenu().Continue(); + } + + private static IEnumerator ReturnToMenu() + { + Logging.MetaLog("Returning to main menu"); + yield return Yield.It; + Game.CurrentGame().ExitGame(); + } + + private static IEnumerator TearDown() + { + yield return new WaitForSecondsEnumerator(5).Continue(); + Logging.MetaLog("Tearing down test run"); + // dispose tests here + foreach (Type t in testTypes) + { + foreach (MethodBase m in t.GetMethods()) + { + if (m.GetCustomAttribute() != null) + { + m.Invoke(null, new object[0]); + yield return Yield.It; + } + } + } + // finish up + Assert.CallsComplete(); + timer.Stop(); + string verdict = _testsPassed ? "--- PASSED :) ---" : "--- FAILED :( ---"; + Assert.Log($"VERDICT: {verdict} ({_testsCountPassed}/{_testsCountFailed}/{_testsCount} P/F/T in {timer.ElapsedMilliseconds}ms)"); + yield return Yield.It; + // end game + Logging.MetaLog("Completed test run: " + verdict); + yield return Yield.It; + Assert.CloseLog(); + if (AutoShutdown) Application.Quit(); + } + + private static void FindTests(Assembly asm) + { + testTypes = new List(); + foreach (Type t in asm.GetTypes()) + { + if (t.GetCustomAttribute() != null) + { + testTypes.Add(t); + } + } + } + + public static void RunTests(Assembly asm = null) + { + if (asm == null) asm = Assembly.GetExecutingAssembly(); + FindTests(asm); + Logging.MetaLog("Starting test run"); + // log metadata + Assert.Log($"Unity {Application.unityVersion}"); + Assert.Log($"Gamecraft {Application.version}"); + Assert.Log($"GamecraftModdingAPI {Assembly.GetExecutingAssembly().GetName().Version}"); + Assert.Log($"Testing {asm.GetName().Name} {asm.GetName().Version}"); + Assert.Log($"START: --- {DateTime.Now.ToString()} --- ({testTypes.Count} tests classes detected)"); + StartUp(); + Logging.MetaLog("Test StartUp complete"); + } + } +} diff --git a/GamecraftModdingAPI/Tests/TestTest.cs b/GamecraftModdingAPI/Tests/TestTest.cs new file mode 100644 index 0000000..02eeda0 --- /dev/null +++ b/GamecraftModdingAPI/Tests/TestTest.cs @@ -0,0 +1,52 @@ +using System; + +using System.Reflection; + +using HarmonyLib; + +namespace GamecraftModdingAPI.Tests +{ +#if TEST + /// + /// Test test test. + /// + [APITestClass] + public static class TestTest + { + public static event EventHandler StartUp; + + public static event EventHandler Test; + + public static event EventHandler TearDown; + + [APITestStartUp] + public static void Init() + { + StartUp += Assert.CallsBack("TestStartUp"); + Test += Assert.CallsBack("TestCase"); + TearDown += Assert.CallsBack("TestTearDown"); + StartUp(null, default(TestEventArgs)); + } + + [APITestCase(TestType.Menu)] + public static void RunTest() + { + Test(null, default(TestEventArgs)); + } + + [APITestTearDown] + public static void End() + { + TearDown(null, default(TestEventArgs)); + } + } + + public struct TestEventArgs + { + public override string ToString() + { + return "TestEventArgs{}"; + } + } +#endif +} -- 2.30.2 From 0019b7c0734292cf12718bf0523333fbd61780e5 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Mon, 22 Jun 2020 12:04:21 -0400 Subject: [PATCH 058/252] Version bump to v1.3.0 --- .../GamecraftModdingAPI.csproj | 389 +----------------- doxygen.conf | 2 +- 2 files changed, 2 insertions(+), 389 deletions(-) diff --git a/GamecraftModdingAPI/GamecraftModdingAPI.csproj b/GamecraftModdingAPI/GamecraftModdingAPI.csproj index c78272a..199eed6 100644 --- a/GamecraftModdingAPI/GamecraftModdingAPI.csproj +++ b/GamecraftModdingAPI/GamecraftModdingAPI.csproj @@ -2,7 +2,7 @@ net472 true - 1.2.0 + 1.3.0 Exmods GNU General Public Licence 3+ https://git.exmods.org/modtainers/GamecraftModdingAPI @@ -21,393 +21,6 @@ - - ..\..\ref\Gamecraft_Data\Managed\Analytics.dll - - - ..\..\ref\Gamecraft_Data\Managed\Assembly-CSharp-firstpass.dll - - - ..\..\ref\Gamecraft_Data\Managed\Assembly-CSharp.dll - - - ..\..\ref\Gamecraft_Data\Managed\Authentication.dll - - - ..\..\ref\Gamecraft_Data\Managed\BlockEntityFactory.dll - - - ..\..\ref\Gamecraft_Data\Managed\Blocks.HUDFeedbackBlocks.dll - - - ..\..\ref\Gamecraft_Data\Managed\ClusterToWireConversion.Mock.dll - - - ..\..\ref\Gamecraft_Data\Managed\CommandLine.dll - - - ..\..\ref\Gamecraft_Data\Managed\DataLoader.dll - - - ..\..\ref\Gamecraft_Data\Managed\DDNA.dll - - - ..\..\ref\Gamecraft_Data\Managed\FMOD.dll - - - ..\..\ref\Gamecraft_Data\Managed\FullGame.dll - - - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.AudioBlocks.dll - - - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.ConsoleBlock.dll - - - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.DamagingSurfaceBlock.dll - - - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.GenericPhysicsBlocks.dll - - - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.LogicBlock.dll - - - ..\..\ref\Gamecraft_Data\Managed\GameCraft.Blocks.ProjectileBlock.dll - - - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.TimerBlock.dll - - - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.CharacterVulnerability.dll - - - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.CharacterVulnerabilityGui.dll - - - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Effects.dll - - - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.ConsoleBlock.dll - - - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll - - - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.HUDFeedbackBlocks.dll - - - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Tweaks.dll - - - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Wires.dll - - - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Wires.Mockup.dll - - - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll - - - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Music.dll - - - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.PerformanceWarnings.dll - - - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Tweaks.dll - - - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Tweaks.Mockup.dll - - - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.VisualEffects.dll - - - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Wires.dll - - - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Wires.Input.dll - - - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Wires.Mockup.dll - - - ..\..\ref\Gamecraft_Data\Managed\GameState.dll - - - ..\..\ref\Gamecraft_Data\Managed\GPUInstancer.dll - - - ..\..\ref\Gamecraft_Data\Managed\Havok.Physics.dll - - - ..\..\ref\Gamecraft_Data\Managed\Havok.Physics.Hybrid.dll - - - ..\..\ref\Gamecraft_Data\Managed\LZ4.dll - - - ..\..\ref\Gamecraft_Data\Managed\MultiplayerNetworking.dll - - - ..\..\ref\Gamecraft_Data\Managed\MultiplayerTest.dll - - - ..\..\ref\Gamecraft_Data\Managed\RCX.ScreenshotTaker.dll - - - ..\..\ref\Gamecraft_Data\Managed\RobocraftECS.dll - - - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.AccountPreferences.dll - - - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Blocks.dll - - - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Blocks.Ghost.dll - - - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Blocks.Triggers.dll - - - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Building.BoxSelect.dll - - - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Building.Jobs.dll - - - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Character.dll - - - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.ClusterToWireConversion.dll - - - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Common.dll - - - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.ControlsScreen.dll - - - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Crosshair.dll - - - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.FrontEnd.dll - - - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.BlockLabel.dll - - - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.DebugDisplay.dll - - - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.dll - - - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.RemoveBlock.dll - - - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.ScaleGhost.dll - - - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUIs.WorkshopPrefabs.dll - - - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Input.dll - - - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.MachineEditor.dll - - - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.MainGame.dll - - - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.MainSimulation.dll - - - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.MockCharacter.dll - - - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Multiplayer.dll - - - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll - - - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.MultiplayerInput.dll - - - ..\..\ref\Gamecraft_Data\Managed\Robocraftx.ObjectIdBlocks.dll - - - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Party.dll - - - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.PartyGui.dll - - - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Physics.dll - - - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.PilotSeat.dll - - - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Player.dll - - - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Rendering.dll - - - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Rendering.Mock.dll - - - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.SaveAndLoad.dll - - - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.SaveGameDialog.dll - - - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Serializers.dll - - - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Services.dll - - - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.SignalHandling.dll - - - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.StateSync.dll - - - ..\..\ref\Gamecraft_Data\Managed\RobocraftX_SpawnPoints.dll - - - ..\..\ref\Gamecraft_Data\Managed\RobocraftX_TextBlock.dll - - - ..\..\ref\Gamecraft_Data\Managed\RobocratX.SimulationCompositionRoot.dll - - - ..\..\ref\Gamecraft_Data\Managed\StringFormatter.dll - - - ..\..\ref\Gamecraft_Data\Managed\Svelto.Common_3.dll - - - ..\..\ref\Gamecraft_Data\Managed\Svelto.ECS.dll - - - ..\..\ref\Gamecraft_Data\Managed\Svelto.Services.dll - - - ..\..\ref\Gamecraft_Data\Managed\Svelto.Tasks.dll - - - ..\..\ref\Gamecraft_Data\Managed\Unity.Addressables.dll - - - ..\..\ref\Gamecraft_Data\Managed\Unity.Build.SlimPlayerRuntime.dll - - - ..\..\ref\Gamecraft_Data\Managed\Unity.Burst.dll - - - ..\..\ref\Gamecraft_Data\Managed\Unity.Collections.dll - - - ..\..\ref\Gamecraft_Data\Managed\Unity.Deformations.dll - - - ..\..\ref\Gamecraft_Data\Managed\Unity.Entities.dll - - - ..\..\ref\Gamecraft_Data\Managed\Unity.Entities.Hybrid.dll - - - ..\..\ref\Gamecraft_Data\Managed\Unity.Jobs.dll - - - ..\..\ref\Gamecraft_Data\Managed\Unity.Mathematics.dll - - - ..\..\ref\Gamecraft_Data\Managed\Unity.Mathematics.Extensions.dll - - - ..\..\ref\Gamecraft_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll - - - ..\..\ref\Gamecraft_Data\Managed\Unity.Physics.dll - - - ..\..\ref\Gamecraft_Data\Managed\Unity.Physics.Hybrid.dll - - - ..\..\ref\Gamecraft_Data\Managed\Unity.Platforms.Common.dll - - - ..\..\ref\Gamecraft_Data\Managed\Unity.Postprocessing.Runtime.dll - - - ..\..\ref\Gamecraft_Data\Managed\Unity.Properties.dll - - - ..\..\ref\Gamecraft_Data\Managed\Unity.Properties.Reflection.dll - - - ..\..\ref\Gamecraft_Data\Managed\Unity.Properties.UI.dll - - - ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipeline.Universal.ShaderLibrary.dll - - - ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll - - - ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll - - - ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll - - - ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Universal.Runtime.dll - - - ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Universal.Shaders.dll - - - ..\..\ref\Gamecraft_Data\Managed\Unity.ResourceManager.dll - - - ..\..\ref\Gamecraft_Data\Managed\Unity.Scenes.Hybrid.dll - - - ..\..\ref\Gamecraft_Data\Managed\Unity.ScriptableBuildPipeline.dll - - - ..\..\ref\Gamecraft_Data\Managed\Unity.Serialization.dll - - - ..\..\ref\Gamecraft_Data\Managed\Unity.TextMeshPro.dll - - - ..\..\ref\Gamecraft_Data\Managed\Unity.Timeline.dll - - - ..\..\ref\Gamecraft_Data\Managed\Unity.Transforms.dll - - - ..\..\ref\Gamecraft_Data\Managed\Unity.Transforms.Hybrid.dll - - - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UI.dll - - - ..\..\ref\Gamecraft_Data\Managed\uREPL.dll - - - ..\..\ref\Gamecraft_Data\Managed\VisualProfiler.dll - diff --git a/doxygen.conf b/doxygen.conf index 19df3c4..d587ecd 100644 --- a/doxygen.conf +++ b/doxygen.conf @@ -38,7 +38,7 @@ PROJECT_NAME = "GamecraftModdingAPI" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = "v1.2.0" +PROJECT_NUMBER = "v1.3.0" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a -- 2.30.2 From 189c3ca2a5a545d6cf48f43e3aee791b063cbca0 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Tue, 23 Jun 2020 13:49:42 -0400 Subject: [PATCH 059/252] Document App and Test additions (+ minor tweaks) --- GamecraftModdingAPI/App/AppCallbacksTest.cs | 4 + GamecraftModdingAPI/App/Client.cs | 24 ++++ GamecraftModdingAPI/App/Game.cs | 130 +++++++++++++++++- GamecraftModdingAPI/App/GameGameEngine.cs | 21 ++- GamecraftModdingAPI/Player.cs | 9 ++ GamecraftModdingAPI/Players/PlayerEngine.cs | 24 +++- .../Tests/APITestAttributes.cs | 20 +++ GamecraftModdingAPI/Tests/Assert.cs | 18 +++ GamecraftModdingAPI/Tests/TestRoot.cs | 7 + 9 files changed, 249 insertions(+), 8 deletions(-) diff --git a/GamecraftModdingAPI/App/AppCallbacksTest.cs b/GamecraftModdingAPI/App/AppCallbacksTest.cs index 0c2987b..041ac50 100644 --- a/GamecraftModdingAPI/App/AppCallbacksTest.cs +++ b/GamecraftModdingAPI/App/AppCallbacksTest.cs @@ -5,6 +5,10 @@ using GamecraftModdingAPI.Tests; namespace GamecraftModdingAPI.App { #if TEST + /// + /// App callbacks tests. + /// Only available in TEST builds. + /// [APITestClass] public static class AppCallbacksTest { diff --git a/GamecraftModdingAPI/App/Client.cs b/GamecraftModdingAPI/App/Client.cs index 2f1f005..e95d9f3 100644 --- a/GamecraftModdingAPI/App/Client.cs +++ b/GamecraftModdingAPI/App/Client.cs @@ -6,32 +6,56 @@ using GamecraftModdingAPI.Utility; namespace GamecraftModdingAPI.App { + /// + /// The Gamecraft application that is running this code right now. + /// public class Client { + // extensible engine protected static AppEngine appEngine = new AppEngine(); + /// + /// An event that fires whenever the main menu is loaded. + /// public static event EventHandler EnterMenu { add => appEngine.EnterMenu += value; remove => appEngine.EnterMenu -= value; } + /// + /// An event that fire whenever the main menu is exited. + /// public static event EventHandler ExitMenu { add => appEngine.ExitMenu += value; remove => appEngine.ExitMenu -= value; } + /// + /// Gamecraft build version string. + /// Usually this is in the form YYYY.mm.DD.HH.MM.SS + /// + /// The version. public string Version { get => Application.version; } + /// + /// Unity version string. + /// + /// The unity version. public string UnityVersion { get => Application.unityVersion; } + /// + /// Game saves currently visible in the menu. + /// These take a second to completely populate after the EnterMenu event fires. + /// + /// My games. public Game[] MyGames { get diff --git a/GamecraftModdingAPI/App/Game.cs b/GamecraftModdingAPI/App/Game.cs index 0d31abf..3fd4900 100644 --- a/GamecraftModdingAPI/App/Game.cs +++ b/GamecraftModdingAPI/App/Game.cs @@ -9,12 +9,17 @@ using Svelto.ECS; using GamecraftModdingAPI.Tasks; using GamecraftModdingAPI.Utility; -// TODO: exceptions namespace GamecraftModdingAPI.App { + /// + /// An in-game save. + /// This can be a menu item for a local save or the currently loaded save. + /// Support for Steam Workshop coming soon (hopefully). + /// public class Game { + // extensible engines protected static GameGameEngine gameEngine = new GameGameEngine(); protected static GameMenuEngine menuEngine = new GameMenuEngine(); protected static DebugInterfaceEngine debugOverlayEngine = new DebugInterfaceEngine(); @@ -25,10 +30,18 @@ namespace GamecraftModdingAPI.App private bool menuMode = true; private bool hasId = false; + /// + /// Initializes a new instance of the class. + /// + /// Menu identifier. public Game(uint id) : this(new EGID(id, MyGamesScreenExclusiveGroups.MyGames)) { } + /// + /// Initializes a new instance of the class. + /// + /// Menu identifier. public Game(EGID id) { this.Id = id.entityID; @@ -38,6 +51,10 @@ namespace GamecraftModdingAPI.App if (!VerifyMode()) throw new AppStateException("Game cannot be created while not in a game nor in a menu (is the game in a loading screen?)"); } + /// + /// Initializes a new instance of the class without id. + /// This is assumed to be the current game. + /// public Game() { menuMode = false; @@ -45,11 +62,21 @@ namespace GamecraftModdingAPI.App if (menuEngine.IsInMenu) throw new GameNotFoundException("Game not found."); } + /// + /// Returns the currently loaded game. + /// If in a menu, manipulating the returned object may not work as intended. + /// + /// The current game. public static Game CurrentGame() { return new Game(); } + /// + /// Creates a new game and adds it to the menu. + /// If not in a menu, this will throw AppStateException. + /// + /// The new game. public static Game NewGame() { if (!menuEngine.IsInMenu) throw new AppStateException("New Game cannot be created while not in a menu."); @@ -59,47 +86,77 @@ namespace GamecraftModdingAPI.App return new Game(egid); } + /// + /// An event that fires whenever a game is switched to simulation mode (time running mode). + /// public static event EventHandler Simulate { add => buildSimEventEngine.SimulationMode += value; remove => buildSimEventEngine.SimulationMode -= value; } + /// + /// An event that fires whenever a game is switched to edit mode (time stopped mode). + /// This does not fire when a game is loaded. + /// public static event EventHandler Edit { add => buildSimEventEngine.BuildMode += value; remove => buildSimEventEngine.BuildMode -= value; } + /// + /// An event that fires right after a game is completely loaded. + /// public static event EventHandler Enter { add => gameEngine.EnterGame += value; remove => gameEngine.EnterGame -= value; } + /// + /// An event that fires right before a game returns to the main menu. + /// At this point, Gamecraft is transitioning state so many things are invalid/unstable here. + /// public static event EventHandler Exit { add => gameEngine.ExitGame += value; remove => gameEngine.ExitGame -= value; } + /// + /// The game's unique menu identifier. + /// + /// The identifier. public uint Id { get; private set; } + /// + /// The game's unique menu EGID. + /// + /// The egid. public EGID EGID { get; private set; } + /// + /// Whether the game is a (valid) menu item. + /// + /// true if menu item; otherwise, false. public bool MenuItem { get => menuMode && hasId; } + /// + /// The game's name. + /// + /// The name. public string Name { get @@ -123,6 +180,10 @@ namespace GamecraftModdingAPI.App } } + /// + /// The game's description. + /// + /// The description. public string Description { get @@ -146,6 +207,10 @@ namespace GamecraftModdingAPI.App } } + /// + /// The path to the game's save folder. + /// + /// The path. public string Path { get @@ -170,6 +235,11 @@ namespace GamecraftModdingAPI.App } } + /// + /// The Steam Workshop Id of the game save. + /// In most cases this is invalid and returns 0, so this can be ignored. + /// + /// The workshop identifier. public ulong WorkshopId { get @@ -195,6 +265,10 @@ namespace GamecraftModdingAPI.App } } + /// + /// Whether the game is in simulation mode. + /// + /// true if is simulating; otherwise, false. public bool IsSimulating { get @@ -211,6 +285,11 @@ namespace GamecraftModdingAPI.App } } + /// + /// Whether the game is in time-running mode. + /// Alias of IsSimulating. + /// + /// true if is time running; otherwise, false. public bool IsTimeRunning { get => IsSimulating; @@ -221,6 +300,10 @@ namespace GamecraftModdingAPI.App } } + /// + /// Whether the game is in time-stopped mode. + /// + /// true if is time stopped; otherwise, false. public bool IsTimeStopped { get @@ -237,6 +320,9 @@ namespace GamecraftModdingAPI.App } } + /// + /// Toggles the time mode. + /// public void ToggleTimeMode() { if (!VerifyMode()) return; @@ -247,6 +333,11 @@ namespace GamecraftModdingAPI.App gameEngine.ToggleTimeMode(); } + /// + /// Load the game save. + /// This happens asynchronously, so when this method returns the game not loaded yet. + /// Use the Game.Enter event to perform operations after the game has completely loaded. + /// public void EnterGame() { if (!VerifyMode()) return; @@ -258,17 +349,43 @@ namespace GamecraftModdingAPI.App Scheduler.Schedule(task); } - public void ExitGame() + /// + /// Return to the menu. + /// Part of this always happens asynchronously, so when this method returns the game has not exited yet. + /// Use the Client.EnterMenu event to perform operations after the game has completely exited. + /// + /// If set to true, do this async. + public void ExitGame(bool async = false) { if (!VerifyMode()) return; if (menuMode) { throw new GameNotFoundException("Cannot exit game using menu ID"); } - ISchedulable task = new Once(() => { gameEngine.ExitCurrentGame(); this.menuMode = true; }); - Scheduler.Schedule(task); + gameEngine.ExitCurrentGame(async); + this.menuMode = true; } + /// + /// Saves the game. + /// Part of this happens asynchronously, so when this method returns the game has not been saved yet. + /// + public void SaveGame() + { + if (!VerifyMode()) return; + if (menuMode) + { + throw new GameNotFoundException("Cannot save game using menu ID"); + } + gameEngine.SaveCurrentGame(); + } + + /// + /// Add information to the in-game debug display. + /// When this object is garbage collected, this debug info is automatically removed. + /// + /// Debug info identifier. + /// Content getter. public void AddDebugInfo(string id, Func contentGetter) { if (!VerifyMode()) return; @@ -280,6 +397,11 @@ namespace GamecraftModdingAPI.App debugIds.Add(id); } + /// + /// Remove information from the in-game debug display. + /// + /// true, if debug info was removed, false otherwise. + /// Debug info identifier. public bool RemoveDebugInfo(string id) { if (!VerifyMode()) return false; diff --git a/GamecraftModdingAPI/App/GameGameEngine.cs b/GamecraftModdingAPI/App/GameGameEngine.cs index 9253af2..d46eb32 100644 --- a/GamecraftModdingAPI/App/GameGameEngine.cs +++ b/GamecraftModdingAPI/App/GameGameEngine.cs @@ -47,9 +47,18 @@ namespace GamecraftModdingAPI.App private set; } = false; - public void ExitCurrentGame() + public void ExitCurrentGame(bool async = false) { - ExitCurrentGameAsync().RunOn(Lean.EveryFrameStepRunner_RUNS_IN_TIME_STOPPED_AND_RUNNING); + if (async) + { + ExitCurrentGameAsync().RunOn(Lean.EveryFrameStepRunner_RUNS_IN_TIME_STOPPED_AND_RUNNING); + } + else + { + entitiesDB.QueryEntity(CommonExclusiveGroups.GameSceneEGID).WantsToQuit = true; + entitiesDB.PublishEntityChange(CommonExclusiveGroups.GameSceneEGID); + } + } public IEnumerator ExitCurrentGameAsync() @@ -62,6 +71,14 @@ namespace GamecraftModdingAPI.App entitiesDB.PublishEntityChange(CommonExclusiveGroups.GameSceneEGID); } + public void SaveCurrentGame() + { + ref GameSceneEntityStruct gses = ref entitiesDB.QueryEntity(CommonExclusiveGroups.GameSceneEGID); + gses.LoadAfterSaving = false; + gses.SaveNow = true; + entitiesDB.PublishEntityChange(CommonExclusiveGroups.GameSceneEGID); + } + public bool IsTimeRunningMode() { return TimeRunningModeUtil.IsTimeRunningMode(entitiesDB); diff --git a/GamecraftModdingAPI/Player.cs b/GamecraftModdingAPI/Player.cs index efb381e..3d80e7b 100644 --- a/GamecraftModdingAPI/Player.cs +++ b/GamecraftModdingAPI/Player.cs @@ -45,6 +45,15 @@ namespace GamecraftModdingAPI return playerEngine.ExistsById(player); } + /// + /// The amount of Players in the current game. + /// + /// The count. + public static uint Count() + { + return playerEngine.GetAllPlayerCount(); + } + /// /// Initializes a new instance of the class. /// diff --git a/GamecraftModdingAPI/Players/PlayerEngine.cs b/GamecraftModdingAPI/Players/PlayerEngine.cs index 2bb29a7..1bcce50 100644 --- a/GamecraftModdingAPI/Players/PlayerEngine.cs +++ b/GamecraftModdingAPI/Players/PlayerEngine.cs @@ -65,6 +65,26 @@ namespace GamecraftModdingAPI.Players return uint.MaxValue; } + public uint GetAllPlayerCount() + { + uint count = 0; + foreach (ExclusiveGroupStruct eg in PlayersExclusiveGroups.AllPlayers) + { + count += entitiesDB.Count(eg); + } + return count; + } + + public uint GetLocalPlayerCount() + { + return entitiesDB.Count(PlayersExclusiveGroups.LocalPlayers); + } + + public uint GetRemotePlayerCount() + { + return entitiesDB.Count(PlayersExclusiveGroups.RemotePlayers); + } + public bool ExistsById(uint playerId) { return entitiesDB.Exists(playerId, PlayersExclusiveGroups.LocalPlayers) @@ -109,7 +129,7 @@ namespace GamecraftModdingAPI.Players { return ((Quaternion) rbes.rotation).eulerAngles; } - return default; + return default(float3); } public bool SetRotation(uint playerId, float3 value) @@ -174,7 +194,7 @@ namespace GamecraftModdingAPI.Players { return rbes.physicsMass; } - return default; + return default(PhysicsMass); } public bool SetInverseMass(uint playerId, float inverseMass) diff --git a/GamecraftModdingAPI/Tests/APITestAttributes.cs b/GamecraftModdingAPI/Tests/APITestAttributes.cs index 8506a56..cf9da49 100644 --- a/GamecraftModdingAPI/Tests/APITestAttributes.cs +++ b/GamecraftModdingAPI/Tests/APITestAttributes.cs @@ -1,6 +1,10 @@ using System; namespace GamecraftModdingAPI.Tests { + /// + /// Test type. + /// When provided to APITestCaseAttribute, this dictates when the test case is called. + /// public enum TestType { Menu, @@ -9,6 +13,10 @@ namespace GamecraftModdingAPI.Tests EditMode, } + /// + /// API Test Class attribute. + /// Classes without this attribute will be ignored when searching for test cases. + /// [AttributeUsage(AttributeTargets.Class)] public class APITestClassAttribute : Attribute { @@ -20,6 +28,10 @@ namespace GamecraftModdingAPI.Tests } } + /// + /// API Test Case attribute. + /// Static methods with this attribute will be called when the API test system is running. + /// [AttributeUsage(AttributeTargets.Method)] public class APITestCaseAttribute : Attribute { @@ -31,12 +43,20 @@ namespace GamecraftModdingAPI.Tests } } + /// + /// API Test StartUp attribute. + /// Static methods with this attribute will be called before any test case is run by the API test system. + /// [AttributeUsage(AttributeTargets.Method)] public class APITestStartUpAttribute : Attribute { } + /// + /// API Test TearDown attribute. + /// Static methods with this attribute will be called after all API test system test cases have completed (failed or succeeded). + /// [AttributeUsage(AttributeTargets.Method)] public class APITestTearDownAttribute : Attribute { diff --git a/GamecraftModdingAPI/Tests/Assert.cs b/GamecraftModdingAPI/Tests/Assert.cs index fb03013..d888f45 100644 --- a/GamecraftModdingAPI/Tests/Assert.cs +++ b/GamecraftModdingAPI/Tests/Assert.cs @@ -5,6 +5,9 @@ using System.Runtime.CompilerServices; namespace GamecraftModdingAPI.Tests { + /// + /// API test system assertion utilities. + /// public static class Assert { private static StreamWriter logFile = null; @@ -19,6 +22,11 @@ namespace GamecraftModdingAPI.Tests private const string INFO = "DEBUG: "; + /// + /// Log a message to the test log. + /// + /// Message. + /// Message ending. [MethodImpl(MethodImplOptions.AggressiveInlining)] public static void Log(string msg, string end = "\n") { @@ -27,6 +35,16 @@ namespace GamecraftModdingAPI.Tests logFile.Flush(); } + /// + /// Asserts that the event receives a callback... eventually. + /// Add the eventhandler returned by this method to the relevant event. + /// This does not assert that the callback happens under that event's intended circumstances. + /// Add another event handler to assert specific circumstance requirements. + /// + /// The callback event handler. + /// Event name. + /// Event error message. + /// The event handler callback argument object. public static EventHandler CallsBack(string eventName, string eventMsg = null) { if (eventMsg == null) eventMsg = $"expected callback to {eventName} but it never occurred..."; diff --git a/GamecraftModdingAPI/Tests/TestRoot.cs b/GamecraftModdingAPI/Tests/TestRoot.cs index 167173f..99f77b7 100644 --- a/GamecraftModdingAPI/Tests/TestRoot.cs +++ b/GamecraftModdingAPI/Tests/TestRoot.cs @@ -15,6 +15,9 @@ using GamecraftModdingAPI.Utility; namespace GamecraftModdingAPI.Tests { + /// + /// API test system root class. + /// public static class TestRoot { public static bool AutoShutdown = true; @@ -229,6 +232,10 @@ namespace GamecraftModdingAPI.Tests } } + /// + /// Runs the tests. + /// + /// Assembly to search for tests. When set to null, this uses the GamecraftModdingAPI assembly. public static void RunTests(Assembly asm = null) { if (asm == null) asm = Assembly.GetExecutingAssembly(); -- 2.30.2 From b6a5074fd2344e15a374a8d65235befe2f35b118 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Fri, 26 Jun 2020 19:37:58 -0400 Subject: [PATCH 060/252] Add some state info and save method --- GamecraftModdingAPI/App/Client.cs | 9 ++++++++ GamecraftModdingAPI/App/Game.cs | 24 +++++++++++++++++++ GamecraftModdingAPI/App/GameGameEngine.cs | 28 +++++++++++++++++++++++ 3 files changed, 61 insertions(+) diff --git a/GamecraftModdingAPI/App/Client.cs b/GamecraftModdingAPI/App/Client.cs index e95d9f3..fbe960e 100644 --- a/GamecraftModdingAPI/App/Client.cs +++ b/GamecraftModdingAPI/App/Client.cs @@ -65,6 +65,15 @@ namespace GamecraftModdingAPI.App } } + /// + /// Whether Gamecraft is in the Main Menu + /// + /// true if in menu; false when loading or in a game. + public bool InMenu + { + get => appEngine.IsInMenu; + } + internal static void Init() { MenuEngineManager.AddMenuEngine(appEngine); diff --git a/GamecraftModdingAPI/App/Game.cs b/GamecraftModdingAPI/App/Game.cs index 3fd4900..d6a4eff 100644 --- a/GamecraftModdingAPI/App/Game.cs +++ b/GamecraftModdingAPI/App/Game.cs @@ -7,6 +7,8 @@ using RobocraftX.GUI.MyGamesScreen; using RobocraftX.StateSync; using Svelto.ECS; +using GamecraftModdingAPI; +using GamecraftModdingAPI.Blocks; using GamecraftModdingAPI.Tasks; using GamecraftModdingAPI.Utility; @@ -414,6 +416,28 @@ namespace GamecraftModdingAPI.App return debugIds.Remove(id); } + /// + /// Gets the blocks in the game. + /// This returns null when in a loading state, and throws AppStateException when in menu. + /// + /// The blocks in game. + /// The block to search for. BlockIDs.Invalid will return all blocks. + public Block[] GetBlocksInGame(BlockIDs filter = BlockIDs.Invalid) + { + if (!VerifyMode()) return null; + if (menuMode) + { + throw new AppStateException("Game object references a menu item but GetBlocksInGame only works on the currently-loaded game"); + } + EGID[] blockEGIDs = gameEngine.GetAllBlocksInGame(filter); + Block[] blocks = new Block[blockEGIDs.Length]; + for (int b = 0; b < blockEGIDs.Length; b++) + { + blocks[b] = new Block(blockEGIDs[b]); + } + return blocks; + } + ~Game() { foreach (string id in debugIds) diff --git a/GamecraftModdingAPI/App/GameGameEngine.cs b/GamecraftModdingAPI/App/GameGameEngine.cs index d46eb32..cbb1c79 100644 --- a/GamecraftModdingAPI/App/GameGameEngine.cs +++ b/GamecraftModdingAPI/App/GameGameEngine.cs @@ -10,6 +10,7 @@ using Svelto.ECS; using Svelto.Tasks; using Svelto.Tasks.Lean; +using GamecraftModdingAPI.Blocks; using GamecraftModdingAPI.Engines; using GamecraftModdingAPI.Utility; @@ -93,5 +94,32 @@ namespace GamecraftModdingAPI.App { TimeRunningModeUtil.ToggleTimeRunningState(entitiesDB); } + + public EGID[] GetAllBlocksInGame(BlockIDs filter = BlockIDs.Invalid) + { + EntityCollection blocks = entitiesDB.QueryEntities(CommonExclusiveGroups.OWNED_BLOCKS_GROUP); + if (filter == BlockIDs.Invalid) + { + EGID[] blockEGIDs = new EGID[blocks.count]; + for (uint b = 0; b < blocks.count; b++) + { + blockEGIDs[b] = blocks[b].ID; + } + return blockEGIDs; + } + else + { + uint dbidFilter = (uint)filter; + List blockEGIDs = new List(); + for (uint b = 0; b < blocks.count; b++) + { + if (blocks[b].DBID == dbidFilter) + { + blockEGIDs.Add(blocks[b].ID); + } + } + return blockEGIDs.ToArray(); + } + } } } -- 2.30.2 From 60f231f939210485e9d258fd6da8d318f49deec8 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Tue, 30 Jun 2020 20:43:14 -0400 Subject: [PATCH 061/252] Add standard asserts --- GamecraftModdingAPI/Tests/Assert.cs | 158 ++++++++++++++++++++++++++ GamecraftModdingAPI/Tests/TestRoot.cs | 54 ++++++++- 2 files changed, 206 insertions(+), 6 deletions(-) diff --git a/GamecraftModdingAPI/Tests/Assert.cs b/GamecraftModdingAPI/Tests/Assert.cs index d888f45..eec9c5c 100644 --- a/GamecraftModdingAPI/Tests/Assert.cs +++ b/GamecraftModdingAPI/Tests/Assert.cs @@ -3,6 +3,8 @@ using System.Collections.Concurrent; using System.IO; using System.Runtime.CompilerServices; +using Unity.Mathematics; + namespace GamecraftModdingAPI.Tests { /// @@ -59,6 +61,162 @@ namespace GamecraftModdingAPI.Tests }; } + public static bool NotNull(T obj, string err = null, string success = null) + { + if (err == null) err = $"{nameof(T)} object was null."; + if (success == null) success = $"{nameof(T)} '{obj}' not null"; + if (obj == null) + { + Log(FAIL + err); + TestRoot.TestsPassed = false; + return false; + } + else + { + Log(PASS + success); + TestRoot.TestsPassed = true; + return true; + } + } + + public static bool Equal(T obj1, T obj2, string err = null, string success = null) + { + if (err == null) err = $"{nameof(T)} '{obj1}' is not equal to '{obj2}'."; + if (success == null) success = $"{nameof(T)} '{obj1}' is equal to '{obj2}'."; + if (obj1 == null && obj2 == null) + { + // pass + Log(PASS + success); + TestRoot.TestsPassed = true; + return true; + } + else if (!(obj1 == null && obj2 == null) && obj1.Equals(obj2) && obj2.Equals(obj1)) + { + // pass + Log(PASS + success); + TestRoot.TestsPassed = true; + return true; + } + else if (obj1 != null && (obj1 != null && !obj1.Equals(obj2))) + { + // pass + Log(PASS + success); + TestRoot.TestsPassed = true; + return true; + } + else if (obj2 != null && !obj2.Equals(obj1)) + { + // pass + Log(PASS + success); + TestRoot.TestsPassed = true; + return true; + } + else + { + // fail + Log(FAIL + err); + TestRoot.TestsPassed = false; + return false; + } + } + + public static bool Errorless(Action tryThis, string err = null, string success = null) + { + if (err == null) err = $"{tryThis} raised an exception: "; + if (success == null) success = $"{tryThis} completed without raising an exception."; + try + { + tryThis(); + } + catch (Exception e) + { + Log(FAIL + err + e); + TestRoot.TestsPassed = false; + return false; + } + TestRoot.TestsPassed = true; + Log(PASS + success); + return true; + } + + public static bool CloseTo(float a, float b, string err = null, string success = null, float delta = float.Epsilon) + { + if (err == null) err = $"{a} is not within {delta} of {b}."; + if (success == null) success = $"{a} is close enough to {b}."; + if (Math.Abs(a - b) > delta) + { + Log(FAIL + err); + TestRoot.TestsPassed = false; + return false; + } + else + { + TestRoot.TestsPassed = true; + Log(PASS + success); + return true; + } + } + + public static bool CloseTo(double a, double b, string err = null, string success = null, double delta = double.Epsilon) + { + if (err == null) err = $"{a} is not within {delta} of {b}."; + if (success == null) success = $"{a} is close enough to {b}."; + if (Math.Abs(a - b) > delta) + { + Log(FAIL + err); + TestRoot.TestsPassed = false; + return false; + } + else + { + TestRoot.TestsPassed = true; + Log(PASS + success); + return true; + } + } + + public static bool CloseTo(float3 a, float3 b, string err = null, string success = null, float delta = float.Epsilon) + { + if (err == null) err = $"{a} is not within {delta} of {b} in every direction."; + if (success == null) success = $"{a} is close enough to {b}."; + bool xClose = CloseTo(a.x, b.x, err, success, delta); + bool yClose = CloseTo(a.y, b.y, err, success, delta); + bool zClose = CloseTo(a.z, b.z, err, success, delta); + if (xClose && yClose && zClose) + { + //TestRoot.TestsPassed = true; + //Log(PASS + success); + return true; + } + else + { + //Log(FAIL + err); + //TestRoot.TestsPassed = false; + return false; + } + } + + public static void Fail(string msg = null) + { + if (msg == null) msg = $"Manual test failure with no message provided."; + Log(FAIL + msg); + TestRoot.TestsPassed = false; + } + + public static void Pass(string msg = null) + { + if (msg == null) msg = $"Manual test pass with no message provided."; + Log(PASS + msg); + TestRoot.TestsPassed = true; + } + + public static void Warn(string msg = null) + { + if (msg == null) msg = $"Manual test warning with no message provided."; + Log(WARN + msg); + TestRoot.TestsPassed = true; + } + internal static void CallsComplete() { foreach(string key in callbacks.Keys) diff --git a/GamecraftModdingAPI/Tests/TestRoot.cs b/GamecraftModdingAPI/Tests/TestRoot.cs index 99f77b7..4e9da73 100644 --- a/GamecraftModdingAPI/Tests/TestRoot.cs +++ b/GamecraftModdingAPI/Tests/TestRoot.cs @@ -87,7 +87,14 @@ namespace GamecraftModdingAPI.Tests { if (m.GetCustomAttribute() != null) { - m.Invoke(null, new object[0]); + try + { + m.Invoke(null, new object[0]); + } + catch (Exception e) + { + Assert.Fail($"Start up method '{m}' raised an exception: {e.ToString()}"); + } } } } @@ -105,7 +112,14 @@ namespace GamecraftModdingAPI.Tests APITestCaseAttribute a = m.GetCustomAttribute(); if (a != null && a.TestType == TestType.Menu) { - m.Invoke(null, new object[0]); + try + { + m.Invoke(null, new object[0]); + } + catch (Exception e) + { + Assert.Fail($"Menu test '{m}' raised an exception: {e.ToString()}"); + } yield return Yield.It; } } @@ -144,7 +158,14 @@ namespace GamecraftModdingAPI.Tests APITestCaseAttribute a = m.GetCustomAttribute(); if (a != null && a.TestType == TestType.Game) { - m.Invoke(null, new object[0]); + try + { + m.Invoke(null, new object[0]); + } + catch (Exception e) + { + Assert.Fail($"Game test '{m}' raised an exception: {e.ToString()}"); + } yield return Yield.It; } } @@ -159,7 +180,14 @@ namespace GamecraftModdingAPI.Tests APITestCaseAttribute a = m.GetCustomAttribute(); if (a != null && a.TestType == TestType.SimulationMode) { - m.Invoke(null, new object[0]); + try + { + m.Invoke(null, new object[0]); + } + catch (Exception e) + { + Assert.Fail($"Simulation test '{m}' raised an exception: {e.ToString()}"); + } yield return Yield.It; } } @@ -174,7 +202,14 @@ namespace GamecraftModdingAPI.Tests APITestCaseAttribute a = m.GetCustomAttribute(); if (a != null && a.TestType == TestType.EditMode) { - m.Invoke(null, new object[0]); + try + { + m.Invoke(null, new object[0]); + } + catch (Exception e) + { + Assert.Fail($"Build test '{m}' raised an exception: {e.ToString()}"); + } yield return Yield.It; } } @@ -202,7 +237,14 @@ namespace GamecraftModdingAPI.Tests { if (m.GetCustomAttribute() != null) { - m.Invoke(null, new object[0]); + try + { + m.Invoke(null, new object[0]); + } + catch (Exception e) + { + Assert.Warn($"Tear down method '{m}' raised an exception: {e.ToString()}"); + } yield return Yield.It; } } -- 2.30.2 From b376133d2877721a96e390f432cd009840addf85 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Tue, 30 Jun 2020 20:43:45 -0400 Subject: [PATCH 062/252] Create some test cases for blocks --- GamecraftModdingAPI/Blocks/BlockTests.cs | 74 ++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 GamecraftModdingAPI/Blocks/BlockTests.cs diff --git a/GamecraftModdingAPI/Blocks/BlockTests.cs b/GamecraftModdingAPI/Blocks/BlockTests.cs new file mode 100644 index 0000000..8fb40be --- /dev/null +++ b/GamecraftModdingAPI/Blocks/BlockTests.cs @@ -0,0 +1,74 @@ +using System; + +using GamecraftModdingAPI; +using GamecraftModdingAPI.Tests; + +namespace GamecraftModdingAPI.Blocks +{ +#if TEST + [APITestClass] + public static class BlockTests + { + [APITestCase(TestType.EditMode)] + public static void TestPlaceNew() + { + Block newBlock = Block.PlaceNew(BlockIDs.AluminiumCube, Unity.Mathematics.float3.zero); + Assert.NotNull(newBlock.Id, "Newly placed block is missing Id. This should be populated when the block is placed.", "Newly placed block Id is not null, block successfully placed."); + } + + [APITestCase(TestType.EditMode)] + public static void TestSync() + { + Block newBlock = Block.PlaceNew(BlockIDs.AluminiumCube, Unity.Mathematics.float3.zero + 2); + if (!Assert.CloseTo(newBlock.Position, (Unity.Mathematics.float3.zero + 2), $"Newly placed block at {newBlock.Position} is expected at {Unity.Mathematics.float3.zero + 2}.", "Newly placed block position matches.")) return; + Assert.Equal(newBlock.Exists, true, "Newly placed block does not exist, possibly because Sync() skipped/missed/failed.", "Newly placed block exists, Sync() successful."); + } + + [APITestCase(TestType.EditMode)] + public static void TestTextBlock() + { + Block newBlock = Block.PlaceNew(BlockIDs.TextBlock, Unity.Mathematics.float3.zero + 1); + TextBlock textBlock = null; // Note: the assignment operation is a lambda, which slightly confuses the compiler + Assert.Errorless(() => { textBlock = newBlock.Specialise(); }, "Block.Specialize() raised an exception: ", "Block.Specialize() completed without issue."); + if (!Assert.NotNull(textBlock, "Block.Specialize() returned null, possibly because it failed silently.", "Specialized TextBlock is not null.")) return; + if (!Assert.NotNull(textBlock.Text, "TextBlock.Text is null, possibly because it failed silently.", "TextBlock.Text is not null.")) return; + if (!Assert.NotNull(textBlock.TextBlockId, "TextBlock.TextBlockId is null, possibly because it failed silently.", "TextBlock.TextBlockId is not null.")) return; + } + + [APITestCase(TestType.EditMode)] + public static void TestMotor() + { + Block newBlock = Block.PlaceNew(BlockIDs.MotorS, Unity.Mathematics.float3.zero + 1); + Motor b = null; // Note: the assignment operation is a lambda, which slightly confuses the compiler + Assert.Errorless(() => { b = newBlock.Specialise(); }, "Block.Specialize() raised an exception: ", "Block.Specialize() completed without issue."); + if (!Assert.NotNull(b, "Block.Specialize() returned null, possibly because it failed silently.", "Specialized Motor is not null.")) return; + if (!Assert.CloseTo(b.Torque, 75f, $"Motor.Torque {b.Torque} does not equal default value, possibly because it failed silently.", "Motor.Torque close enough to default.")) return; + if (!Assert.CloseTo(b.TopSpeed, 30f, $"Motor.TopSpeed {b.TopSpeed} does not equal default value, possibly because it failed silently.", "Motor.Torque is close enough to default.")) return; + if (!Assert.Equal(b.Reverse, false, $"Motor.Reverse {b.Reverse} does not equal default value, possibly because it failed silently.", "Motor.Reverse is default.")) return; + } + + [APITestCase(TestType.EditMode)] + public static void TestPiston() + { + Block newBlock = Block.PlaceNew(BlockIDs.PneumaticPiston, Unity.Mathematics.float3.zero + 1); + Piston b = null; // Note: the assignment operation is a lambda, which slightly confuses the compiler + Assert.Errorless(() => { b = newBlock.Specialise(); }, "Block.Specialize() raised an exception: ", "Block.Specialize() completed without issue."); + if (!Assert.NotNull(b, "Block.Specialize() returned null, possibly because it failed silently.", "Specialized Piston is not null.")) return; + if (!Assert.CloseTo(b.MaximumExtension, 1.01f, $"Piston.MaximumExtension {b.MaximumExtension} does not equal default value, possibly because it failed silently.", "Piston.MaximumExtension is close enough to default.")) return; + if (!Assert.CloseTo(b.MaximumForce, 750f, $"Piston.MaximumForce {b.MaximumForce} does not equal default value, possibly because it failed silently.", "Piston.MaximumForce is close enough to default.")) return; + } + + [APITestCase(TestType.EditMode)] + public static void TestServo() + { + Block newBlock = Block.PlaceNew(BlockIDs.ServoAxle, Unity.Mathematics.float3.zero + 1); + Servo b = null; // Note: the assignment operation is a lambda, which slightly confuses the compiler + Assert.Errorless(() => { b = newBlock.Specialise(); }, "Block.Specialize() raised an exception: ", "Block.Specialize() completed without issue."); + if (!Assert.NotNull(b, "Block.Specialize() returned null, possibly because it failed silently.", "Specialized Servo is not null.")) return; + if (!Assert.CloseTo(b.MaximumAngle, 180f, $"Servo.MaximumAngle {b.MaximumAngle} does not equal default value, possibly because it failed silently.", "Servo.MaximumAngle is close enough to default.")) return; + if (!Assert.CloseTo(b.MinimumAngle, -180f, $"Servo.MinimumAngle {b.MinimumAngle} does not equal default value, possibly because it failed silently.", "Servo.MinimumAngle is close enough to default.")) return; + if (!Assert.CloseTo(b.MaximumForce, 750f, $"Servo.MaximumForce {b.MaximumForce} does not equal default value, possibly because it failed silently.", "Servo.MaximumForce is close enough to default.")) return; + } + } +#endif +} -- 2.30.2 From 6f589f1744887e669961f98bfa3e2026334a41a0 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Wed, 1 Jul 2020 13:43:56 -0400 Subject: [PATCH 063/252] Create Player tests --- GamecraftModdingAPI/Blocks/BlockTests.cs | 3 ++ GamecraftModdingAPI/Player.cs | 2 +- GamecraftModdingAPI/Players/PlayerEngine.cs | 30 +++++++++++++++ GamecraftModdingAPI/Players/PlayerTests.cs | 42 +++++++++++++++++++++ 4 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 GamecraftModdingAPI/Players/PlayerTests.cs diff --git a/GamecraftModdingAPI/Blocks/BlockTests.cs b/GamecraftModdingAPI/Blocks/BlockTests.cs index 8fb40be..418fa43 100644 --- a/GamecraftModdingAPI/Blocks/BlockTests.cs +++ b/GamecraftModdingAPI/Blocks/BlockTests.cs @@ -6,6 +6,9 @@ using GamecraftModdingAPI.Tests; namespace GamecraftModdingAPI.Blocks { #if TEST + /// + /// Block test cases. Not accessible in release versions. + /// [APITestClass] public static class BlockTests { diff --git a/GamecraftModdingAPI/Player.cs b/GamecraftModdingAPI/Player.cs index 3d80e7b..cff13ff 100644 --- a/GamecraftModdingAPI/Player.cs +++ b/GamecraftModdingAPI/Player.cs @@ -413,7 +413,7 @@ namespace GamecraftModdingAPI // internal methods - public static void Init() + internal static void Init() { Utility.GameEngineManager.AddGameEngine(playerEngine); } diff --git a/GamecraftModdingAPI/Players/PlayerEngine.cs b/GamecraftModdingAPI/Players/PlayerEngine.cs index 1bcce50..d30993c 100644 --- a/GamecraftModdingAPI/Players/PlayerEngine.cs +++ b/GamecraftModdingAPI/Players/PlayerEngine.cs @@ -67,6 +67,7 @@ namespace GamecraftModdingAPI.Players public uint GetAllPlayerCount() { + if (entitiesDB == null) return 0; uint count = 0; foreach (ExclusiveGroupStruct eg in PlayersExclusiveGroups.AllPlayers) { @@ -77,22 +78,26 @@ namespace GamecraftModdingAPI.Players public uint GetLocalPlayerCount() { + if (entitiesDB == null) return 0; return entitiesDB.Count(PlayersExclusiveGroups.LocalPlayers); } public uint GetRemotePlayerCount() { + if (entitiesDB == null) return 0; return entitiesDB.Count(PlayersExclusiveGroups.RemotePlayers); } public bool ExistsById(uint playerId) { + if (entitiesDB == null) return false; return entitiesDB.Exists(playerId, PlayersExclusiveGroups.LocalPlayers) || entitiesDB.Exists(playerId, PlayersExclusiveGroups.RemotePlayers); } public float3 GetLocation(uint playerId) { + if (entitiesDB == null) return float3.zero; ref var rbes = ref GetCharacterStruct(playerId, out bool exists); if (exists) { @@ -103,6 +108,7 @@ namespace GamecraftModdingAPI.Players public bool SetLocation(uint playerId, float3 location, bool exitSeat = true) { + if (entitiesDB == null) return false; var characterGroups = CharacterExclusiveGroups.AllCharacters; for (int i = 0; i < characterGroups.count; i++) { @@ -124,6 +130,7 @@ namespace GamecraftModdingAPI.Players public float3 GetRotation(uint playerId) { + if (entitiesDB == null) return float3.zero; ref var rbes = ref GetCharacterStruct(playerId, out bool exists); if (exists) { @@ -134,6 +141,7 @@ namespace GamecraftModdingAPI.Players public bool SetRotation(uint playerId, float3 value) { + if (entitiesDB == null) return false; ref var rbes = ref GetCharacterStruct(playerId, out bool exists); if (exists) { @@ -147,6 +155,7 @@ namespace GamecraftModdingAPI.Players public float3 GetLinearVelocity(uint playerId) { + if (entitiesDB == null) return float3.zero; ref var rbes = ref GetCharacterStruct(playerId, out bool exists); if (exists) { @@ -157,6 +166,7 @@ namespace GamecraftModdingAPI.Players public bool SetLinearVelocity(uint playerId, float3 value) { + if (entitiesDB == null) return false; ref var rbes = ref GetCharacterStruct(playerId, out bool exists); if (exists) { @@ -168,6 +178,7 @@ namespace GamecraftModdingAPI.Players public float3 GetAngularVelocity(uint playerId) { + if (entitiesDB == null) return float3.zero; ref var rbes = ref GetCharacterStruct(playerId, out bool exists); if (exists) { @@ -178,6 +189,7 @@ namespace GamecraftModdingAPI.Players public bool SetAngularVelocity(uint playerId, float3 value) { + if (entitiesDB == null) return false; ref var rbes = ref GetCharacterStruct(playerId, out bool exists); if (exists) { @@ -189,6 +201,7 @@ namespace GamecraftModdingAPI.Players public PhysicsMass GetMass(uint playerId) { + if (entitiesDB == null) return default(PhysicsMass); ref var rbes = ref GetCharacterStruct(playerId, out bool exists); if (exists) { @@ -199,6 +212,7 @@ namespace GamecraftModdingAPI.Players public bool SetInverseMass(uint playerId, float inverseMass) { + if (entitiesDB == null) return false; ref var rbes = ref GetCharacterStruct(playerId, out bool exists); if (exists) { @@ -210,6 +224,7 @@ namespace GamecraftModdingAPI.Players public float? GetLastPingTime(uint playerId, PlayerType type) { + if (entitiesDB == null) return null; EGID egid = new EGID(playerId, PlayerGroupFromEnum(type)); if (entitiesDB.Exists(egid)) { @@ -220,6 +235,7 @@ namespace GamecraftModdingAPI.Players public float GetInitialHealth(uint playerId) { + if (entitiesDB == null) return 0; ref var c = ref GetCharacterStruct(playerId, out bool exists); if (exists) { @@ -230,6 +246,7 @@ namespace GamecraftModdingAPI.Players public bool SetInitialHealth(uint playerId, float val) { + if (entitiesDB == null) return false; ref var c = ref GetCharacterStruct(playerId, out bool exists); if (exists) { @@ -241,6 +258,7 @@ namespace GamecraftModdingAPI.Players public float GetCurrentHealth(uint playerId) { + if (entitiesDB == null) return 0; ref var c = ref GetCharacterStruct(playerId, out bool exists); if (exists) { @@ -251,6 +269,7 @@ namespace GamecraftModdingAPI.Players public bool SetCurrentHealth(uint playerId, float val) { + if (entitiesDB == null) return false; ref var c = ref GetCharacterStruct(playerId, out bool exists); if (exists) { @@ -262,6 +281,7 @@ namespace GamecraftModdingAPI.Players public bool DamagePlayer(uint playerId, float amount) { + if (entitiesDB == null) return false; Factory.BuildEntity( new EGID(CharacterVulnerabilityExclusiveGroups.NextDamageEntityId, CharacterVulnerabilityExclusiveGroups.CharacterDamageExclusiveGroup) ).Init(new DamageEntityStruct @@ -274,6 +294,7 @@ namespace GamecraftModdingAPI.Players public bool GetDamageable(uint playerId) { + if (entitiesDB == null) return false; ref var c = ref GetCharacterStruct(playerId, out bool exists); if (exists) { @@ -284,6 +305,7 @@ namespace GamecraftModdingAPI.Players public bool SetDamageable(uint playerId, bool val) { + if (entitiesDB == null) return false; ref var ches = ref GetCharacterStruct(playerId, out bool exists); if (exists) { @@ -296,6 +318,7 @@ namespace GamecraftModdingAPI.Players public uint GetInitialLives(uint playerId) { + if (entitiesDB == null) return 0; ref var c = ref GetCharacterStruct(playerId, out bool exists); if (exists) { @@ -306,6 +329,7 @@ namespace GamecraftModdingAPI.Players public bool SetInitialLives(uint playerId, uint val) { + if (entitiesDB == null) return false; ref var c = ref GetCharacterStruct(playerId, out bool exists); if (exists) { @@ -317,6 +341,7 @@ namespace GamecraftModdingAPI.Players public uint GetCurrentLives(uint playerId) { + if (entitiesDB == null) return 0; ref var c = ref GetCharacterStruct(playerId, out bool exists); if (exists) { @@ -327,6 +352,7 @@ namespace GamecraftModdingAPI.Players public bool SetCurrentLives(uint playerId, uint val) { + if (entitiesDB == null) return false; ref var c = ref GetCharacterStruct(playerId, out bool exists); if (exists) { @@ -338,6 +364,7 @@ namespace GamecraftModdingAPI.Players public bool GetGameOverScreen(uint playerId) { + if (entitiesDB == null) return false; ref var c = ref GetCharacterStruct(playerId, out bool exists); if (exists) { @@ -348,11 +375,13 @@ namespace GamecraftModdingAPI.Players public bool IsDead(uint playerId) { + if (entitiesDB == null) return true; return entitiesDB.Exists(playerId, CharacterExclusiveGroups.DeadCharacters); } public int GetSelectedBlock(uint playerId) { + if (entitiesDB == null) return 0; ref var c = ref GetCharacterStruct(playerId, out bool exists); if (exists) { @@ -363,6 +392,7 @@ namespace GamecraftModdingAPI.Players public byte GetSelectedColor(uint playerId) { + if (entitiesDB == null) return 0; ref var c = ref GetCharacterStruct(playerId, out bool exists); if (exists) { diff --git a/GamecraftModdingAPI/Players/PlayerTests.cs b/GamecraftModdingAPI/Players/PlayerTests.cs new file mode 100644 index 0000000..1af7992 --- /dev/null +++ b/GamecraftModdingAPI/Players/PlayerTests.cs @@ -0,0 +1,42 @@ +using System; + +using Unity.Mathematics; + +using GamecraftModdingAPI; +using GamecraftModdingAPI.Tests; + +namespace GamecraftModdingAPI.Players +{ +#if TEST + /// + /// Player test cases. Not accessible in release versions. + /// + [APITestClass] + public static class PlayerTests + { + [APITestCase(TestType.EditMode)] + public static void ExistsTest() + { + if (!Assert.Equal(Player.Exists(PlayerType.Local), true, "Local player does not exist.", "Local player detected.")) return; + Assert.Equal(Player.Count(), 1u, "Player.Count() is not one, possibly because it failed silently.", "Player count is one for single player game."); + } + + [APITestCase(TestType.EditMode)] + public static void PositionTest() + { + Player p = new Player(PlayerType.Local); + if (!Assert.Errorless(() => { p.Teleport(0, 0, 0, relative: false); }, "Player.Teleport(origin) errored: ", "Player teleported to origin successfully.")) return; + if (!Assert.CloseTo(p.Position, float3.zero, "Player is not close to origin despite being teleported there.", "Player.Position is at origin.")) return; + if (!Assert.Errorless(() => { p.Position = float3.zero + 1; }, "Player.Position = origin+1 errored: ", "Player moved to origin+1.")) return; + Assert.CloseTo(p.Position, float3.zero + 1, "Player is not close to origin+1 despite being teleported there.", "Player.Position is at origin+1."); + } + + [APITestCase(TestType.Menu)] + public static void InvalidStateTest() + { + if (!Assert.Errorless(() => { Player.Count(); }, "Player.Count() errored in menu.", "Player.Count() succeeded in menu.")) return; + Assert.Equal(Player.Count(), 0u, "Player.Count() is not zero in menu.", "Player count is zero in menu as expected."); + } + } +#endif +} -- 2.30.2 From f403feb298ff9b6f8d385069229ca79700a0a477 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sat, 11 Jul 2020 00:30:58 +0200 Subject: [PATCH 064/252] Update to Gamecraft 2020.06.17.08.41 (preview) Removed BlockIdentifiers.OWNED_BLOCKS as the original got replaced with an array Added the correct group for each supported functional block Removed EntityFactory property from IEntitySerializer as it is provided on deserialization --- .../App/GameBuildSimEventEngine.cs | 8 +++--- GamecraftModdingAPI/App/GameGameEngine.cs | 28 ++++++++----------- GamecraftModdingAPI/Block.cs | 12 ++++---- GamecraftModdingAPI/Blocks/BlockEngine.cs | 25 +++++++++-------- .../Blocks/BlockIdentifiers.cs | 8 +++--- GamecraftModdingAPI/Blocks/ConsoleBlock.cs | 3 +- GamecraftModdingAPI/Blocks/Motor.cs | 3 +- GamecraftModdingAPI/Blocks/MovementEngine.cs | 16 +++++------ .../Blocks/ObjectIdentifier.cs | 3 +- GamecraftModdingAPI/Blocks/Piston.cs | 3 +- GamecraftModdingAPI/Blocks/PlacementEngine.cs | 19 ++----------- GamecraftModdingAPI/Blocks/RotationEngine.cs | 16 +++++------ GamecraftModdingAPI/Blocks/Servo.cs | 3 +- GamecraftModdingAPI/Blocks/SignalEngine.cs | 22 +++++---------- GamecraftModdingAPI/Blocks/SpawnPoint.cs | 3 +- GamecraftModdingAPI/Blocks/TextBlock.cs | 3 +- GamecraftModdingAPI/Blocks/Timer.cs | 3 +- .../Events/GameStateBuildEmitterEngine.cs | 4 +-- .../GameStateSimulationEmitterEngine.cs | 4 +-- .../GamecraftModdingAPI.csproj | 4 --- .../Persistence/IEntitySerializer.cs | 8 +----- .../Persistence/SerializerManager.cs | 3 -- .../Persistence/SimpleEntitySerializer.cs | 6 ++-- GamecraftModdingAPI/Player.cs | 4 +-- GamecraftModdingAPI/Players/PlayerEngine.cs | 8 +++--- 25 files changed, 93 insertions(+), 126 deletions(-) diff --git a/GamecraftModdingAPI/App/GameBuildSimEventEngine.cs b/GamecraftModdingAPI/App/GameBuildSimEventEngine.cs index b4bc049..4c9a536 100644 --- a/GamecraftModdingAPI/App/GameBuildSimEventEngine.cs +++ b/GamecraftModdingAPI/App/GameBuildSimEventEngine.cs @@ -26,16 +26,16 @@ namespace GamecraftModdingAPI.App public void Ready() { } - public JobHandle OnInitializeTimeRunningMode() + public JobHandle OnInitializeTimeRunningMode(JobHandle inputDeps) { ExceptionUtil.InvokeEvent(SimulationMode, this, new GameEventArgs { GameName = GameMode.SaveGameDetails.Name, GamePath = GameMode.SaveGameDetails.Folder }); - return default(JobHandle); + return inputDeps; } - public JobHandle OnInitializeTimeStoppedMode() + public JobHandle OnInitializeTimeStoppedMode(JobHandle inputDeps) { ExceptionUtil.InvokeEvent(BuildMode, this, new GameEventArgs { GameName = GameMode.SaveGameDetails.Name, GamePath = GameMode.SaveGameDetails.Folder }); - return default(JobHandle); + return inputDeps; } } diff --git a/GamecraftModdingAPI/App/GameGameEngine.cs b/GamecraftModdingAPI/App/GameGameEngine.cs index cbb1c79..a616df5 100644 --- a/GamecraftModdingAPI/App/GameGameEngine.cs +++ b/GamecraftModdingAPI/App/GameGameEngine.cs @@ -97,28 +97,22 @@ namespace GamecraftModdingAPI.App public EGID[] GetAllBlocksInGame(BlockIDs filter = BlockIDs.Invalid) { - EntityCollection blocks = entitiesDB.QueryEntities(CommonExclusiveGroups.OWNED_BLOCKS_GROUP); + var allBlocks = entitiesDB.QueryEntities(); + List blockEGIDs = new List(); if (filter == BlockIDs.Invalid) { - EGID[] blockEGIDs = new EGID[blocks.count]; - for (uint b = 0; b < blocks.count; b++) - { - blockEGIDs[b] = blocks[b].ID; - } - return blockEGIDs; + foreach (var (blocks, _) in allBlocks) + foreach (var block in blocks) + blockEGIDs.Add(block.ID); + return blockEGIDs.ToArray(); } else { - uint dbidFilter = (uint)filter; - List blockEGIDs = new List(); - for (uint b = 0; b < blocks.count; b++) - { - if (blocks[b].DBID == dbidFilter) - { - blockEGIDs.Add(blocks[b].ID); - } - } - return blockEGIDs.ToArray(); + foreach (var (blocks, _) in allBlocks) + foreach (var block in blocks) + if (block.DBID == (ulong) filter) + blockEGIDs.Add(block.ID); + return blockEGIDs.ToArray(); } } } diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index f97c57c..939d16c 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -135,8 +135,8 @@ namespace GamecraftModdingAPI Id = id; } - public Block(uint id) : this(new EGID(id, CommonExclusiveGroups.OWNED_BLOCKS_GROUP)) - { + public Block(uint id) : this(new EGID(id, CommonExclusiveGroups.BUILD_STANDARD_BLOCK_GROUP)) + { //TODO: Figure out the block group based on the id } public EGID Id { get; } @@ -147,10 +147,10 @@ namespace GamecraftModdingAPI /// public float3 Position { - get => Exists ? MovementEngine.GetPosition(Id.entityID) : float3.zero; + get => Exists ? MovementEngine.GetPosition(Id) : float3.zero; set { - if (Exists) MovementEngine.MoveBlock(Id.entityID, value); + if (Exists) MovementEngine.MoveBlock(Id, value); } } @@ -159,10 +159,10 @@ namespace GamecraftModdingAPI /// public float3 Rotation { - get => Exists ? RotationEngine.GetRotation(Id.entityID) : float3.zero; + get => Exists ? RotationEngine.GetRotation(Id) : float3.zero; set { - if (Exists) RotationEngine.RotateBlock(Id.entityID, value); + if (Exists) RotationEngine.RotateBlock(Id, value); } } diff --git a/GamecraftModdingAPI/Blocks/BlockEngine.cs b/GamecraftModdingAPI/Blocks/BlockEngine.cs index 3473106..4a90de7 100644 --- a/GamecraftModdingAPI/Blocks/BlockEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlockEngine.cs @@ -38,14 +38,15 @@ namespace GamecraftModdingAPI.Blocks public Block[] GetConnectedBlocks(EGID blockID) { if (!BlockExists(blockID)) return new Block[0]; - Stack cubeStack = new Stack(); - FasterList cubes = new FasterList(10); - var coll = entitiesDB.QueryEntities(CommonExclusiveGroups - .OWNED_BLOCKS_GROUP); - for (int i = 0; i < coll.count; i++) - coll[i].isProcessed = false; + Stack cubeStack = new Stack(); + FasterList cubes = new FasterList(10); + var coll = entitiesDB.QueryEntities(); + foreach (var (ecoll, _) in coll) + foreach (ref var conn in ecoll) + conn.isProcessed = false; - ConnectedCubesUtility.TreeTraversal.GetConnectedCubes(entitiesDB, blockID.entityID, cubeStack, cubes, (in GridConnectionsEntityStruct g) => { return false; }); + ConnectedCubesUtility.TreeTraversal.GetConnectedCubes(entitiesDB, blockID, cubeStack, cubes, + (in GridConnectionsEntityStruct g) => { return false; }); var ret = new Block[cubes.count]; for (int i = 0; i < cubes.count; i++) @@ -125,10 +126,10 @@ namespace GamecraftModdingAPI.Blocks public SimBody[] GetSimBodiesFromID(byte id) { var ret = new FasterList(4); - if (!entitiesDB.HasAny(CommonExclusiveGroups.OWNED_BLOCKS_GROUP)) + if (!entitiesDB.HasAny(CommonExclusiveGroups.BUILD_OBJID_BLOCK_GROUP)) return new SimBody[0]; - var oids = entitiesDB.QueryEntities(CommonExclusiveGroups.OWNED_BLOCKS_GROUP); - var connections = entitiesDB.QueryMappedEntities(CommonExclusiveGroups.OWNED_BLOCKS_GROUP); + var oids = entitiesDB.QueryEntities(CommonExclusiveGroups.BUILD_OBJID_BLOCK_GROUP); + var connections = entitiesDB.QueryMappedEntities(CommonExclusiveGroups.BUILD_OBJID_BLOCK_GROUP); foreach (ref ObjectIdEntityStruct oid in oids) { if (oid.objectId != id) continue; @@ -147,9 +148,9 @@ namespace GamecraftModdingAPI.Blocks public ObjectIdentifier[] GetObjectIDsFromID(byte id, bool sim) { var ret = new FasterList(4); - if (!entitiesDB.HasAny(CommonExclusiveGroups.OWNED_BLOCKS_GROUP)) + if (!entitiesDB.HasAny(CommonExclusiveGroups.BUILD_OBJID_BLOCK_GROUP)) return new ObjectIdentifier[0]; - var oids = entitiesDB.QueryEntities(CommonExclusiveGroups.OWNED_BLOCKS_GROUP); + var oids = entitiesDB.QueryEntities(CommonExclusiveGroups.BUILD_OBJID_BLOCK_GROUP); foreach (ref ObjectIdEntityStruct oid in oids) if (sim ? oid.simObjectId == id : oid.objectId == id) ret.Add(new ObjectIdentifier(oid.ID)); diff --git a/GamecraftModdingAPI/Blocks/BlockIdentifiers.cs b/GamecraftModdingAPI/Blocks/BlockIdentifiers.cs index eb479c0..0c3222b 100644 --- a/GamecraftModdingAPI/Blocks/BlockIdentifiers.cs +++ b/GamecraftModdingAPI/Blocks/BlockIdentifiers.cs @@ -12,8 +12,8 @@ namespace GamecraftModdingAPI.Blocks { /// /// Blocks placed by the player - /// - public static ExclusiveGroup OWNED_BLOCKS { get { return CommonExclusiveGroups.OWNED_BLOCKS_GROUP; } } + /// - TODO + //public static ExclusiveGroup OWNED_BLOCKS { get { return CommonExclusiveGroups.REAL_BLOCKS_GROUPS_DON_T_USE_IN_NEW_CODE; } } /// /// Extra parts used in functional blocks @@ -23,7 +23,7 @@ namespace GamecraftModdingAPI.Blocks /// /// Blocks which are disabled in Simulation mode /// - public static ExclusiveGroup SIM_BLOCKS_DISABLED { get { return CommonExclusiveGroups.BLOCKS_DISABLED_IN_SIM_GROUP; } } + public static ExclusiveGroup SIM_BLOCKS_DISABLED { get { return CommonExclusiveGroups.DISABLED_JOINTS_IN_SIM_GROUP; } } //public static ExclusiveGroup SPAWN_POINTS { get { return CommonExclusiveGroups.SPAWN_POINTS_GROUP; } } @@ -34,7 +34,7 @@ namespace GamecraftModdingAPI.Blocks /// public static uint LatestBlockID { get - { + { //Need the private field as the property increments itself return ((uint) AccessTools.Field(typeof(CommonExclusiveGroups), "_nextBlockEntityID").GetValue(null)) - 1; } } diff --git a/GamecraftModdingAPI/Blocks/ConsoleBlock.cs b/GamecraftModdingAPI/Blocks/ConsoleBlock.cs index 173b3f6..6d4217d 100644 --- a/GamecraftModdingAPI/Blocks/ConsoleBlock.cs +++ b/GamecraftModdingAPI/Blocks/ConsoleBlock.cs @@ -1,6 +1,7 @@ using System; using RobocraftX.Blocks; +using RobocraftX.Common; using Svelto.ECS; using Unity.Mathematics; @@ -33,7 +34,7 @@ namespace GamecraftModdingAPI.Blocks } } - public ConsoleBlock(uint id): base(id) + public ConsoleBlock(uint id): base(new EGID(id, CommonExclusiveGroups.BUILD_CONSOLE_BLOCK_GROUP)) { if (!BlockEngine.GetBlockInfoExists(this.Id)) { diff --git a/GamecraftModdingAPI/Blocks/Motor.cs b/GamecraftModdingAPI/Blocks/Motor.cs index c900f10..55f3649 100644 --- a/GamecraftModdingAPI/Blocks/Motor.cs +++ b/GamecraftModdingAPI/Blocks/Motor.cs @@ -1,6 +1,7 @@ using System; using RobocraftX.Blocks; +using RobocraftX.Common; using Svelto.ECS; using Unity.Mathematics; @@ -41,7 +42,7 @@ namespace GamecraftModdingAPI.Blocks } } - public Motor(uint id) : base(id) + public Motor(uint id): base(new EGID(id, CommonExclusiveGroups.BUILD_MOTOR_BLOCK_GROUP)) { if (!BlockEngine.GetBlockInfoExists(this.Id)) { diff --git a/GamecraftModdingAPI/Blocks/MovementEngine.cs b/GamecraftModdingAPI/Blocks/MovementEngine.cs index a887763..0ff119a 100644 --- a/GamecraftModdingAPI/Blocks/MovementEngine.cs +++ b/GamecraftModdingAPI/Blocks/MovementEngine.cs @@ -35,12 +35,12 @@ namespace GamecraftModdingAPI.Blocks // implementations for Movement static class - public float3 MoveBlock(uint blockID, float3 vector) + public float3 MoveBlock(EGID blockID, float3 vector) { - ref PositionEntityStruct posStruct = ref this.entitiesDB.QueryEntity(blockID, CommonExclusiveGroups.OWNED_BLOCKS_GROUP); - ref GridRotationStruct gridStruct = ref this.entitiesDB.QueryEntity(blockID, CommonExclusiveGroups.OWNED_BLOCKS_GROUP); - ref LocalTransformEntityStruct transStruct = ref this.entitiesDB.QueryEntity(blockID, CommonExclusiveGroups.OWNED_BLOCKS_GROUP); - ref UECSPhysicsEntityStruct phyStruct = ref this.entitiesDB.QueryEntity(blockID, CommonExclusiveGroups.OWNED_BLOCKS_GROUP); + ref PositionEntityStruct posStruct = ref this.entitiesDB.QueryEntity(blockID); + ref GridRotationStruct gridStruct = ref this.entitiesDB.QueryEntity(blockID); + ref LocalTransformEntityStruct transStruct = ref this.entitiesDB.QueryEntity(blockID); + ref UECSPhysicsEntityStruct phyStruct = ref this.entitiesDB.QueryEntity(blockID); // main (persistent) position posStruct.position = vector; // placement grid position @@ -52,13 +52,13 @@ namespace GamecraftModdingAPI.Blocks { Value = posStruct.position }); - entitiesDB.QueryEntity(blockID, CommonExclusiveGroups.OWNED_BLOCKS_GROUP).isProcessed = false; + entitiesDB.QueryEntity(blockID).isProcessed = false; return posStruct.position; } - public float3 GetPosition(uint blockID) + public float3 GetPosition(EGID blockID) { - ref PositionEntityStruct posStruct = ref this.entitiesDB.QueryEntity(blockID, CommonExclusiveGroups.OWNED_BLOCKS_GROUP); + ref PositionEntityStruct posStruct = ref this.entitiesDB.QueryEntity(blockID); return posStruct.position; } } diff --git a/GamecraftModdingAPI/Blocks/ObjectIdentifier.cs b/GamecraftModdingAPI/Blocks/ObjectIdentifier.cs index 6357053..9af96c2 100644 --- a/GamecraftModdingAPI/Blocks/ObjectIdentifier.cs +++ b/GamecraftModdingAPI/Blocks/ObjectIdentifier.cs @@ -1,4 +1,5 @@ using Gamecraft.Wires; +using RobocraftX.Common; using Svelto.ECS; namespace GamecraftModdingAPI.Blocks @@ -13,7 +14,7 @@ namespace GamecraftModdingAPI.Blocks } } - public ObjectIdentifier(uint id) : base(id) + public ObjectIdentifier(uint id) : base(new EGID(id, CommonExclusiveGroups.BUILD_OBJID_BLOCK_GROUP)) { if (!BlockEngine.GetBlockInfoExists(Id)) { diff --git a/GamecraftModdingAPI/Blocks/Piston.cs b/GamecraftModdingAPI/Blocks/Piston.cs index 00ad273..b96a806 100644 --- a/GamecraftModdingAPI/Blocks/Piston.cs +++ b/GamecraftModdingAPI/Blocks/Piston.cs @@ -5,6 +5,7 @@ using Svelto.ECS; using Unity.Mathematics; using GamecraftModdingAPI.Utility; +using RobocraftX.Common; namespace GamecraftModdingAPI.Blocks { @@ -41,7 +42,7 @@ namespace GamecraftModdingAPI.Blocks } } - public Piston(uint id) : base(id) + public Piston(uint id) : base(new EGID(id, CommonExclusiveGroups.BUILD_PISTON_BLOCK_GROUP)) { if (!BlockEngine.GetBlockInfoExists(this.Id)) { diff --git a/GamecraftModdingAPI/Blocks/PlacementEngine.cs b/GamecraftModdingAPI/Blocks/PlacementEngine.cs index 35f0a92..2297d90 100644 --- a/GamecraftModdingAPI/Blocks/PlacementEngine.cs +++ b/GamecraftModdingAPI/Blocks/PlacementEngine.cs @@ -66,8 +66,6 @@ namespace GamecraftModdingAPI.Blocks RotationEntityStruct rotation = new RotationEntityStruct {rotation = rotQ}; GridRotationStruct gridRotation = new GridRotationStruct {position = position, rotation = rotQ}; - CubeCategoryStruct category = new CubeCategoryStruct - {category = CubeCategory.General, type = CubeType.Block}; DBEntityStruct dbEntity = new DBEntityStruct {DBID = dbid}; BlockPlacementScaleEntityStruct placementScale = new BlockPlacementScaleEntityStruct { @@ -76,21 +74,10 @@ namespace GamecraftModdingAPI.Blocks unitSnapOffset = 0, isUsingUnitSize = true }; EquippedColourStruct colour = new EquippedColourStruct {indexInPalette = color}; - EGID newBlockID; - switch (category.category) - { - case CubeCategory.SpawnPoint: - case CubeCategory.BuildingSpawnPoint: - newBlockID = MachineEditingGroups.NewUncheckedBlockEGID; - break; - default: - newBlockID = MachineEditingGroups.NewBlockID; - break; - } EntityComponentInitializer structInitializer = - _blockEntityFactory.Build(newBlockID, dbid); //The ghost block index is only used for triggers + _blockEntityFactory.Build(CommonExclusiveGroups.nextBlockEntityID, dbid); //The ghost block index is only used for triggers if (colour.indexInPalette != byte.MaxValue) structInitializer.Init(new ColourParameterEntityStruct { @@ -117,10 +104,10 @@ namespace GamecraftModdingAPI.Blocks PrimaryRotationUtility.InitialisePrimaryDirection(rotation.rotation, ref structInitializer); EGID playerEGID = new EGID(playerId, CharacterExclusiveGroups.OnFootGroup); ref PickedBlockExtraDataStruct pickedBlock = ref entitiesDB.QueryEntity(playerEGID); - pickedBlock.placedBlockEntityID = playerEGID; + pickedBlock.placedBlockEntityID = structInitializer.EGID; pickedBlock.placedBlockWasAPickedBlock = false; Block.BlockEngine.Synced = false; // Block entities will need to be submitted before properties can be used - return newBlockID; + return structInitializer.EGID; } public string Name { get; } = "GamecraftModdingAPIPlacementGameEngine"; diff --git a/GamecraftModdingAPI/Blocks/RotationEngine.cs b/GamecraftModdingAPI/Blocks/RotationEngine.cs index 88c43d2..e9cd1ef 100644 --- a/GamecraftModdingAPI/Blocks/RotationEngine.cs +++ b/GamecraftModdingAPI/Blocks/RotationEngine.cs @@ -35,12 +35,12 @@ namespace GamecraftModdingAPI.Blocks // implementations for Rotation static class - public float3 RotateBlock(uint blockID, Vector3 vector) + public float3 RotateBlock(EGID blockID, Vector3 vector) { - ref RotationEntityStruct rotStruct = ref this.entitiesDB.QueryEntity(blockID, CommonExclusiveGroups.OWNED_BLOCKS_GROUP); - ref GridRotationStruct gridStruct = ref this.entitiesDB.QueryEntity(blockID, CommonExclusiveGroups.OWNED_BLOCKS_GROUP); - ref LocalTransformEntityStruct transStruct = ref this.entitiesDB.QueryEntity(blockID, CommonExclusiveGroups.OWNED_BLOCKS_GROUP); - ref UECSPhysicsEntityStruct phyStruct = ref this.entitiesDB.QueryEntity(blockID, CommonExclusiveGroups.OWNED_BLOCKS_GROUP); + ref RotationEntityStruct rotStruct = ref this.entitiesDB.QueryEntity(blockID); + ref GridRotationStruct gridStruct = ref this.entitiesDB.QueryEntity(blockID); + ref LocalTransformEntityStruct transStruct = ref this.entitiesDB.QueryEntity(blockID); + ref UECSPhysicsEntityStruct phyStruct = ref this.entitiesDB.QueryEntity(blockID); // main (persistent) position Quaternion newRotation = (Quaternion)rotStruct.rotation; newRotation.eulerAngles += vector; @@ -58,14 +58,14 @@ namespace GamecraftModdingAPI.Blocks { Value = rotStruct.rotation }); - entitiesDB.QueryEntity(blockID, CommonExclusiveGroups.OWNED_BLOCKS_GROUP).isProcessed = false; + entitiesDB.QueryEntity(blockID).isProcessed = false; return ((Quaternion)rotStruct.rotation).eulerAngles; } - public float3 GetRotation(uint blockID) + public float3 GetRotation(EGID blockID) { - ref RotationEntityStruct rotStruct = ref entitiesDB.QueryEntity(blockID, CommonExclusiveGroups.OWNED_BLOCKS_GROUP); + ref RotationEntityStruct rotStruct = ref entitiesDB.QueryEntity(blockID); return ((Quaternion) rotStruct.rotation).eulerAngles; } } diff --git a/GamecraftModdingAPI/Blocks/Servo.cs b/GamecraftModdingAPI/Blocks/Servo.cs index 9a66e3b..ef7225b 100644 --- a/GamecraftModdingAPI/Blocks/Servo.cs +++ b/GamecraftModdingAPI/Blocks/Servo.cs @@ -1,6 +1,7 @@ using System; using RobocraftX.Blocks; +using RobocraftX.Common; using Svelto.ECS; using Unity.Mathematics; @@ -41,7 +42,7 @@ namespace GamecraftModdingAPI.Blocks } } - public Servo(uint id) : base(id) + public Servo(uint id) : base(new EGID(id, CommonExclusiveGroups.BUILD_SERVO_BLOCK_GROUP)) { if (!BlockEngine.GetBlockInfoExists(this.Id)) { diff --git a/GamecraftModdingAPI/Blocks/SignalEngine.cs b/GamecraftModdingAPI/Blocks/SignalEngine.cs index b36e708..13a0b3b 100644 --- a/GamecraftModdingAPI/Blocks/SignalEngine.cs +++ b/GamecraftModdingAPI/Blocks/SignalEngine.cs @@ -1,4 +1,5 @@ using Svelto.ECS; +using Svelto.DataStructures; using Gamecraft.Wires; using GamecraftModdingAPI.Engines; @@ -166,21 +167,12 @@ namespace GamecraftModdingAPI.Blocks } public EGID[] GetElectricBlocks() - { - uint count = entitiesDB.Count(BlockIdentifiers.OWNED_BLOCKS) + entitiesDB.Count(BlockIdentifiers.FUNCTIONAL_BLOCK_PARTS); - uint i = 0; - EGID[] res = new EGID[count]; - foreach (ref BlockPortsStruct s in entitiesDB.QueryEntities(BlockIdentifiers.OWNED_BLOCKS)) - { - res[i] = s.ID; - i++; - } - foreach (ref BlockPortsStruct s in entitiesDB.QueryEntities(BlockIdentifiers.FUNCTIONAL_BLOCK_PARTS)) - { - res[i] = s.ID; - i++; - } - return res; + { + var res = new FasterList(); + foreach (var (coll, _) in entitiesDB.QueryEntities()) + foreach (ref BlockPortsStruct s in coll) + res.Add(s.ID); + return res.ToArray(); } private EntityCollection GetSignalStruct(uint signalID, out uint index, bool input = true) diff --git a/GamecraftModdingAPI/Blocks/SpawnPoint.cs b/GamecraftModdingAPI/Blocks/SpawnPoint.cs index bb3e7f4..65ef750 100644 --- a/GamecraftModdingAPI/Blocks/SpawnPoint.cs +++ b/GamecraftModdingAPI/Blocks/SpawnPoint.cs @@ -1,6 +1,7 @@ using System; using RobocraftX.Blocks; +using RobocraftX.Common; using Gamecraft.CharacterVulnerability; using Svelto.ECS; using Unity.Mathematics; @@ -43,7 +44,7 @@ namespace GamecraftModdingAPI.Blocks } } - public SpawnPoint(uint id) : base(id) + public SpawnPoint(uint id) : base(new EGID(id, CommonExclusiveGroups.BUILD_SPAWNPOINT_BLOCK_GROUP)) { if (!BlockEngine.GetBlockInfoExists(this.Id)) { diff --git a/GamecraftModdingAPI/Blocks/TextBlock.cs b/GamecraftModdingAPI/Blocks/TextBlock.cs index 92f8116..c1a9344 100644 --- a/GamecraftModdingAPI/Blocks/TextBlock.cs +++ b/GamecraftModdingAPI/Blocks/TextBlock.cs @@ -1,6 +1,7 @@ using System; using Gamecraft.Blocks.GUI; +using RobocraftX.Common; using Svelto.ECS; using Unity.Mathematics; @@ -34,7 +35,7 @@ namespace GamecraftModdingAPI.Blocks } } - public TextBlock(uint id) : base(id) + public TextBlock(uint id) : base(new EGID(id, CommonExclusiveGroups.BUILD_TEXT_BLOCK_GROUP)) { if (!BlockEngine.GetBlockInfoExists(this.Id)) { diff --git a/GamecraftModdingAPI/Blocks/Timer.cs b/GamecraftModdingAPI/Blocks/Timer.cs index d26620e..0e7f744 100644 --- a/GamecraftModdingAPI/Blocks/Timer.cs +++ b/GamecraftModdingAPI/Blocks/Timer.cs @@ -1,6 +1,7 @@ using System; using RobocraftX.Blocks; +using RobocraftX.Common; using Gamecraft.Blocks.TimerBlock; using Svelto.ECS; using Unity.Mathematics; @@ -37,7 +38,7 @@ namespace GamecraftModdingAPI.Blocks } } - public Timer(uint id) : base(id) + public Timer(uint id) : base(new EGID(id, CommonExclusiveGroups.BUILD_TIMER_BLOCK_GROUP)) { if (!BlockEngine.GetBlockInfoExists(this.Id)) { diff --git a/GamecraftModdingAPI/Events/GameStateBuildEmitterEngine.cs b/GamecraftModdingAPI/Events/GameStateBuildEmitterEngine.cs index ed89812..a12433a 100644 --- a/GamecraftModdingAPI/Events/GameStateBuildEmitterEngine.cs +++ b/GamecraftModdingAPI/Events/GameStateBuildEmitterEngine.cs @@ -43,10 +43,10 @@ namespace GamecraftModdingAPI.Events } } - public JobHandle OnInitializeTimeStoppedMode() + public JobHandle OnInitializeTimeStoppedMode(JobHandle inputDeps) { Emit(); - return default(JobHandle); + return inputDeps; } public void Ready() { } diff --git a/GamecraftModdingAPI/Events/GameStateSimulationEmitterEngine.cs b/GamecraftModdingAPI/Events/GameStateSimulationEmitterEngine.cs index 165e7c5..5689db9 100644 --- a/GamecraftModdingAPI/Events/GameStateSimulationEmitterEngine.cs +++ b/GamecraftModdingAPI/Events/GameStateSimulationEmitterEngine.cs @@ -42,10 +42,10 @@ namespace GamecraftModdingAPI.Events } } - public JobHandle OnInitializeTimeRunningMode() + public JobHandle OnInitializeTimeRunningMode(JobHandle inputDeps) { Emit(); - return default(JobHandle); + return inputDeps; } public void Ready() { } diff --git a/GamecraftModdingAPI/GamecraftModdingAPI.csproj b/GamecraftModdingAPI/GamecraftModdingAPI.csproj index 199eed6..29cc08f 100644 --- a/GamecraftModdingAPI/GamecraftModdingAPI.csproj +++ b/GamecraftModdingAPI/GamecraftModdingAPI.csproj @@ -80,10 +80,6 @@ ..\ref\Gamecraft_Data\Managed\Blocks.HUDFeedbackBlocks.dll ..\..\ref\Gamecraft_Data\Managed\Blocks.HUDFeedbackBlocks.dll - - ..\ref\Gamecraft_Data\Managed\ClusterToWireConversion.Mock.dll - ..\..\ref\Gamecraft_Data\Managed\ClusterToWireConversion.Mock.dll - ..\ref\Gamecraft_Data\Managed\CommandLine.dll ..\..\ref\Gamecraft_Data\Managed\CommandLine.dll diff --git a/GamecraftModdingAPI/Persistence/IEntitySerializer.cs b/GamecraftModdingAPI/Persistence/IEntitySerializer.cs index a060f3c..5c4fb85 100644 --- a/GamecraftModdingAPI/Persistence/IEntitySerializer.cs +++ b/GamecraftModdingAPI/Persistence/IEntitySerializer.cs @@ -12,13 +12,7 @@ namespace GamecraftModdingAPI.Persistence /// public interface IEntitySerializer : IDeserializationFactory, IQueryingEntitiesEngine { - /// - /// The entity factory used for creating entities and entity components. - /// - /// The entity factory. - IEntityFactory EntityFactory { set; } - - /// + /// /// Serialize the entities. /// /// Whether serialization was successful. diff --git a/GamecraftModdingAPI/Persistence/SerializerManager.cs b/GamecraftModdingAPI/Persistence/SerializerManager.cs index 0584834..161662b 100644 --- a/GamecraftModdingAPI/Persistence/SerializerManager.cs +++ b/GamecraftModdingAPI/Persistence/SerializerManager.cs @@ -29,7 +29,6 @@ namespace GamecraftModdingAPI.Persistence _registrations[name] = (IEntitySerialization ies) => { ies.RegisterSerializationFactory(serializer); }; if (_lastEnginesRoot != null) { - serializer.EntityFactory = _lastEnginesRoot.GenerateEntityFactory(); _registrations[name].Invoke(_lastEnginesRoot.GenerateEntitySerializer()); _lastEnginesRoot.AddEngine(serializer); } @@ -63,12 +62,10 @@ namespace GamecraftModdingAPI.Persistence public static void RegisterSerializers(EnginesRoot enginesRoot) { _lastEnginesRoot = enginesRoot; - IEntityFactory factory = enginesRoot.GenerateEntityFactory(); IEntitySerialization ies = enginesRoot.GenerateEntitySerializer(); foreach (string key in _serializers.Keys) { Logging.MetaDebugLog($"Registering IEntitySerializer for {key}"); - _serializers[key].EntityFactory = factory; _registrations[key].Invoke(ies); enginesRoot.AddEngine(_serializers[key]); } diff --git a/GamecraftModdingAPI/Persistence/SimpleEntitySerializer.cs b/GamecraftModdingAPI/Persistence/SimpleEntitySerializer.cs index 1048edb..3e136ae 100644 --- a/GamecraftModdingAPI/Persistence/SimpleEntitySerializer.cs +++ b/GamecraftModdingAPI/Persistence/SimpleEntitySerializer.cs @@ -21,13 +21,11 @@ namespace GamecraftModdingAPI.Persistence protected int serializationType; - public IEntityFactory EntityFactory { set; protected get; } - public EntitiesDB entitiesDB { set; protected get; } - public EntityComponentInitializer BuildDeserializedEntity(EGID egid, ISerializationData serializationData, ISerializableEntityDescriptor entityDescriptor, int serializationType, IEntitySerialization entitySerialization) + public EntityComponentInitializer BuildDeserializedEntity(EGID egid, ISerializationData serializationData, ISerializableEntityDescriptor entityDescriptor, int serializationType, IEntitySerialization entitySerialization, IEntityFactory factory, bool enginesRootIsDeserializationOnly) { - EntityComponentInitializer esi = EntityFactory.BuildEntity(egid); + EntityComponentInitializer esi = factory.BuildEntity(egid); entitySerialization.DeserializeEntityComponents(serializationData, entityDescriptor, ref esi, serializationType); return esi; } diff --git a/GamecraftModdingAPI/Player.cs b/GamecraftModdingAPI/Player.cs index cff13ff..40dd385 100644 --- a/GamecraftModdingAPI/Player.cs +++ b/GamecraftModdingAPI/Player.cs @@ -51,7 +51,7 @@ namespace GamecraftModdingAPI /// The count. public static uint Count() { - return playerEngine.GetAllPlayerCount(); + return (uint) playerEngine.GetAllPlayerCount(); } /// @@ -357,7 +357,7 @@ namespace GamecraftModdingAPI public Block GetBlockLookedAt(float maxDistance = -1f) { var egid = playerEngine.GetThingLookedAt(Id, maxDistance); - return egid.HasValue && egid.Value.groupID == CommonExclusiveGroups.OWNED_BLOCKS_GROUP + return egid.HasValue && egid.Value.groupID != CommonExclusiveGroups.SIMULATION_BODIES_GROUP ? new Block(egid.Value) : null; } diff --git a/GamecraftModdingAPI/Players/PlayerEngine.cs b/GamecraftModdingAPI/Players/PlayerEngine.cs index d30993c..805ae21 100644 --- a/GamecraftModdingAPI/Players/PlayerEngine.cs +++ b/GamecraftModdingAPI/Players/PlayerEngine.cs @@ -65,10 +65,10 @@ namespace GamecraftModdingAPI.Players return uint.MaxValue; } - public uint GetAllPlayerCount() + public long GetAllPlayerCount() { if (entitiesDB == null) return 0; - uint count = 0; + long count = 0; foreach (ExclusiveGroupStruct eg in PlayersExclusiveGroups.AllPlayers) { count += entitiesDB.Count(eg); @@ -76,13 +76,13 @@ namespace GamecraftModdingAPI.Players return count; } - public uint GetLocalPlayerCount() + public long GetLocalPlayerCount() { if (entitiesDB == null) return 0; return entitiesDB.Count(PlayersExclusiveGroups.LocalPlayers); } - public uint GetRemotePlayerCount() + public long GetRemotePlayerCount() { if (entitiesDB == null) return 0; return entitiesDB.Count(PlayersExclusiveGroups.RemotePlayers); -- 2.30.2 From aa0aefd41b4b1bbf1adb55bc1850d6f1e5baf5d3 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sat, 11 Jul 2020 02:26:36 +0200 Subject: [PATCH 065/252] Find block when group is unknown --- GamecraftModdingAPI/Block.cs | 10 ++++++++-- GamecraftModdingAPI/Blocks/BlockEngine.cs | 12 ++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index 939d16c..16a0c81 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -135,8 +135,14 @@ namespace GamecraftModdingAPI Id = id; } - public Block(uint id) : this(new EGID(id, CommonExclusiveGroups.BUILD_STANDARD_BLOCK_GROUP)) - { //TODO: Figure out the block group based on the id + /// + /// This overload searches for the correct group the block is in. + /// It will throw an exception if the block doesn't exist. + /// Use the EGID constructor where possible or subclasses of Block as those specify the group. + /// + public Block(uint id) + { + Id = BlockEngine.FindBlockEGID(id) ?? throw new BlockTypeException("Could not find the appropriate group for the block. The block probably doesn't exist or hasn't been submitted."); } public EGID Id { get; } diff --git a/GamecraftModdingAPI/Blocks/BlockEngine.cs b/GamecraftModdingAPI/Blocks/BlockEngine.cs index 4a90de7..81a1630 100644 --- a/GamecraftModdingAPI/Blocks/BlockEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlockEngine.cs @@ -171,6 +171,18 @@ namespace GamecraftModdingAPI.Blocks return list.ToArray(); } + public EGID? FindBlockEGID(uint id) + { + var groups = entitiesDB.FindGroups(); + foreach (ExclusiveGroupStruct group in groups) + { + if (entitiesDB.Exists(id, group)) + return new EGID(id, group); + } + + return null; + } + /// /// Synchronize newly created entity components with entities DB. /// This forces a partial game tick, so it may be slow. -- 2.30.2 From 5bbb54c0c58075d4795bbed4bed006a8b64cc149 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Mon, 13 Jul 2020 21:55:48 +0200 Subject: [PATCH 066/252] Automatically invoke the correct block constructor And store delegates of dynamic methods invoking constructors Tested with the automated tests --- GamecraftModdingAPI/Block.cs | 107 +++++++++++++----- GamecraftModdingAPI/Blocks/BlockTests.cs | 3 +- GamecraftModdingAPI/Blocks/ConsoleBlock.cs | 30 ++--- GamecraftModdingAPI/Blocks/Motor.cs | 23 ---- GamecraftModdingAPI/Blocks/Piston.cs | 25 +--- GamecraftModdingAPI/Blocks/Servo.cs | 23 ---- GamecraftModdingAPI/Blocks/SignalingBlock.cs | 19 ---- GamecraftModdingAPI/Blocks/SpawnPoint.cs | 25 +--- GamecraftModdingAPI/Blocks/TextBlock.cs | 15 --- GamecraftModdingAPI/Blocks/Timer.cs | 17 --- .../Tests/GamecraftModdingAPIPluginTest.cs | 22 ++++ 11 files changed, 114 insertions(+), 195 deletions(-) diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index 16a0c81..673ef49 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -1,6 +1,7 @@ using System; -using System.Reflection; -using System.Threading.Tasks; +using System.Collections.Generic; +using System.Linq; +using System.Reflection.Emit; using Svelto.ECS; using Svelto.ECS.EntityStructs; @@ -67,10 +68,6 @@ namespace GamecraftModdingAPI /// Place a new block at the given position. If scaled, position means the center of the block. The default block size is 0.2 in terms of position. /// Place blocks next to each other to connect them. /// The placed block will be a complete block with a placement grid and collision which will be saved along with the game. - /// - /// This method waits for the block to be constructed in the game which may take a significant amount of time. - /// Only use this to place a single block. - /// For placing multiple blocks, use PlaceNew() then AsyncUtils.WaitForSubmission() when done with placing blocks. /// /// The block's type /// The block's color @@ -81,23 +78,15 @@ namespace GamecraftModdingAPI /// The block's non-uniform scale - 0 means is used /// The player who placed the block /// The placed block or null if failed - public static async Task PlaceNewAsync(BlockIDs block, float3 position, + public static T PlaceNew(BlockIDs block, float3 position, float3 rotation = default, BlockColors color = BlockColors.Default, byte darkness = 0, - int uscale = 1, float3 scale = default, Player player = null) + int uscale = 1, float3 scale = default, Player player = null) where T : Block { if (PlacementEngine.IsInGame && GameState.IsBuildMode()) { - try - { - var ret = new Block(PlacementEngine.PlaceBlock(block, color, darkness, - position, uscale, scale, player, rotation)); - await AsyncUtils.WaitForSubmission(); - return ret; - } - catch (Exception e) - { - Logging.MetaDebugLog(e); - } + var egid = PlacementEngine.PlaceBlock(block, color, darkness, + position, uscale, scale, player, rotation); + return New(egid.entityID, egid.groupID); } return null; @@ -109,7 +98,7 @@ namespace GamecraftModdingAPI /// The block object public static Block GetLastPlacedBlock() { - return new Block(BlockIdentifiers.LatestBlockID); + return New(BlockIdentifiers.LatestBlockID); } /// @@ -130,6 +119,75 @@ namespace GamecraftModdingAPI remove => BlockEventsEngine.Removed -= value; } + private static Dictionary> initializers = new Dictionary>(); + + private static Dictionary typeToGroup = + new Dictionary + { + {typeof(ConsoleBlock), new[] {CommonExclusiveGroups.BUILD_CONSOLE_BLOCK_GROUP}}, + {typeof(Motor), new[] {CommonExclusiveGroups.BUILD_MOTOR_BLOCK_GROUP}}, + {typeof(Piston), new[] {CommonExclusiveGroups.BUILD_PISTON_BLOCK_GROUP}}, + {typeof(Servo), new[] {CommonExclusiveGroups.BUILD_SERVO_BLOCK_GROUP}}, + { + typeof(SpawnPoint), + new[] + { + CommonExclusiveGroups.BUILD_SPAWNPOINT_BLOCK_GROUP, + CommonExclusiveGroups.BUILD_BUILDINGSPAWN_BLOCK_GROUP + } + }, + {typeof(TextBlock), new[] {CommonExclusiveGroups.BUILD_TEXT_BLOCK_GROUP}}, + {typeof(Timer), new[] {CommonExclusiveGroups.BUILD_TIMER_BLOCK_GROUP}} + }; + + private static T New(uint id, ExclusiveGroupStruct? group = null) where T : Block + { + var type = typeof(T); + EGID egid; + if (!group.HasValue) + { + if (typeToGroup.TryGetValue(type, out var gr) && gr.Length == 1) + egid = new EGID(id, gr[0]); + else + egid = BlockEngine.FindBlockEGID(id) ?? throw new BlockTypeException("Could not find block group!"); + } + else + { + egid = new EGID(id, group.Value); + if (typeToGroup.TryGetValue(type, out var gr) + && gr.All(egs => egs != group.Value)) //If this subclass has a specific group, then use that - so Block should still work + throw new BlockTypeException($"Incompatible block type! Type {type.Name} belongs to group {gr.Select(g => g.ToString()).Aggregate((a, b) => a + ", " + b)} instead of {group.Value}"); + } + + if (initializers.TryGetValue(type, out var func)) + { + var bl = (T) func(egid); + return bl; + } + + //https://stackoverflow.com/a/10593806/2703239 + var ctor = type.GetConstructor(new[] {typeof(EGID)}); + if (ctor == null) + throw new MissingMethodException("There is no constructor with an EGID parameter for this object"); + DynamicMethod dynamic = new DynamicMethod(string.Empty, + type, + new[] {typeof(EGID)}, + type); + ILGenerator il = dynamic.GetILGenerator(); + + il.DeclareLocal(type); + il.Emit(OpCodes.Ldarg_0); //Load EGID and pass to constructor + il.Emit(OpCodes.Newobj, ctor); //Call constructor + il.Emit(OpCodes.Stloc_0); + il.Emit(OpCodes.Ldloc_0); + il.Emit(OpCodes.Ret); + + func = (Func) dynamic.CreateDelegate(typeof(Func)); + initializers.Add(type, func); + var block = (T) func(egid); + return block; + } + public Block(EGID id) { Id = id; @@ -344,12 +402,9 @@ namespace GamecraftModdingAPI // C# can't cast to a child of Block unless the object was originally that child type // And C# doesn't let me make implicit cast operators for child types // So thanks to Microsoft, we've got this horrible implementation using reflection - ConstructorInfo ctor = typeof(T).GetConstructor(types: new System.Type[] { typeof(EGID) }); - if (ctor == null) - { - throw new BlockSpecializationException("Specialized block constructor does not accept an EGID"); - } - return (T)ctor.Invoke(new object[] { Id }); + + //Lets improve that using delegates + return New(Id.entityID, Id.groupID); } #if DEBUG diff --git a/GamecraftModdingAPI/Blocks/BlockTests.cs b/GamecraftModdingAPI/Blocks/BlockTests.cs index 418fa43..133db5e 100644 --- a/GamecraftModdingAPI/Blocks/BlockTests.cs +++ b/GamecraftModdingAPI/Blocks/BlockTests.cs @@ -30,9 +30,8 @@ namespace GamecraftModdingAPI.Blocks [APITestCase(TestType.EditMode)] public static void TestTextBlock() { - Block newBlock = Block.PlaceNew(BlockIDs.TextBlock, Unity.Mathematics.float3.zero + 1); TextBlock textBlock = null; // Note: the assignment operation is a lambda, which slightly confuses the compiler - Assert.Errorless(() => { textBlock = newBlock.Specialise(); }, "Block.Specialize() raised an exception: ", "Block.Specialize() completed without issue."); + Assert.Errorless(() => { textBlock = Block.PlaceNew(BlockIDs.TextBlock, Unity.Mathematics.float3.zero + 1); }, "Block.PlaceNew() raised an exception: ", "Block.PlaceNew() completed without issue."); if (!Assert.NotNull(textBlock, "Block.Specialize() returned null, possibly because it failed silently.", "Specialized TextBlock is not null.")) return; if (!Assert.NotNull(textBlock.Text, "TextBlock.Text is null, possibly because it failed silently.", "TextBlock.Text is not null.")) return; if (!Assert.NotNull(textBlock.TextBlockId, "TextBlock.TextBlockId is null, possibly because it failed silently.", "TextBlock.TextBlockId is not null.")) return; diff --git a/GamecraftModdingAPI/Blocks/ConsoleBlock.cs b/GamecraftModdingAPI/Blocks/ConsoleBlock.cs index 6d4217d..e132029 100644 --- a/GamecraftModdingAPI/Blocks/ConsoleBlock.cs +++ b/GamecraftModdingAPI/Blocks/ConsoleBlock.cs @@ -12,33 +12,19 @@ namespace GamecraftModdingAPI.Blocks { public class ConsoleBlock : Block { - public static ConsoleBlock PlaceNew(float3 position, - float3 rotation = default, BlockColors color = BlockColors.Default, byte darkness = 0, - int uscale = 1, float3 scale = default, Player player = null) + public ConsoleBlock(EGID id): base(id) { - if (PlacementEngine.IsInGame && GameState.IsBuildMode()) - { - EGID id = PlacementEngine.PlaceBlock(BlockIDs.ConsoleBlock, color, darkness, - position, uscale, scale, player, rotation); - return new ConsoleBlock(id); - } - - return null; + if (!BlockEngine.GetBlockInfoExists(this.Id)) + { + throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); + } } - public ConsoleBlock(EGID id): base(id) + public ConsoleBlock(uint id): base(new EGID(id, CommonExclusiveGroups.BUILD_CONSOLE_BLOCK_GROUP)) { - if (!BlockEngine.GetBlockInfoExists(this.Id)) - { - throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); - } - } - - public ConsoleBlock(uint id): base(new EGID(id, CommonExclusiveGroups.BUILD_CONSOLE_BLOCK_GROUP)) - { - if (!BlockEngine.GetBlockInfoExists(this.Id)) + if (!BlockEngine.GetBlockInfoExists(this.Id)) { - throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); + throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); } } diff --git a/GamecraftModdingAPI/Blocks/Motor.cs b/GamecraftModdingAPI/Blocks/Motor.cs index 55f3649..fde2920 100644 --- a/GamecraftModdingAPI/Blocks/Motor.cs +++ b/GamecraftModdingAPI/Blocks/Motor.cs @@ -11,29 +11,6 @@ namespace GamecraftModdingAPI.Blocks { public class Motor : Block { - /// - /// Places a new motor. - /// Any valid motor type is accepted. - /// This re-implements Block.PlaceNew(...) - /// - public static new Motor PlaceNew(BlockIDs block, float3 position, - float3 rotation = default, BlockColors color = BlockColors.Default, byte darkness = 0, - int uscale = 1, float3 scale = default, Player player = null) - { - if (!(block == BlockIDs.MotorS || block == BlockIDs.MotorM)) - { - throw new BlockTypeException($"Block is not a {typeof(Motor).Name} block"); - } - if (PlacementEngine.IsInGame && GameState.IsBuildMode()) - { - EGID id = PlacementEngine.PlaceBlock(block, color, darkness, - position, uscale, scale, player, rotation); - return new Motor(id); - } - - return null; - } - public Motor(EGID id) : base(id) { if (!BlockEngine.GetBlockInfoExists(this.Id)) diff --git a/GamecraftModdingAPI/Blocks/Piston.cs b/GamecraftModdingAPI/Blocks/Piston.cs index b96a806..2586b60 100644 --- a/GamecraftModdingAPI/Blocks/Piston.cs +++ b/GamecraftModdingAPI/Blocks/Piston.cs @@ -11,30 +11,7 @@ namespace GamecraftModdingAPI.Blocks { public class Piston : Block { - /// - /// Places a new piston. - /// Any valid piston type is accepted. - /// This re-implements Block.PlaceNew(...) - /// - public static new Piston PlaceNew(BlockIDs block, float3 position, - float3 rotation = default, BlockColors color = BlockColors.Default, byte darkness = 0, - int uscale = 1, float3 scale = default, Player player = null) - { - if (!(block == BlockIDs.ServoPiston || block == BlockIDs.StepperPiston || block == BlockIDs.PneumaticPiston)) - { - throw new BlockTypeException($"Block is not a {typeof(Piston).Name} block"); - } - if (PlacementEngine.IsInGame && GameState.IsBuildMode()) - { - EGID id = PlacementEngine.PlaceBlock(block, color, darkness, - position, uscale, scale, player, rotation); - return new Piston(id); - } - - return null; - } - - public Piston(EGID id) : base(id) + public Piston(EGID id) : base(id) { if (!BlockEngine.GetBlockInfoExists(this.Id)) { diff --git a/GamecraftModdingAPI/Blocks/Servo.cs b/GamecraftModdingAPI/Blocks/Servo.cs index ef7225b..c4b57fb 100644 --- a/GamecraftModdingAPI/Blocks/Servo.cs +++ b/GamecraftModdingAPI/Blocks/Servo.cs @@ -11,29 +11,6 @@ namespace GamecraftModdingAPI.Blocks { public class Servo : Block { - /// - /// Places a new servo. - /// Any valid servo type is accepted. - /// This re-implements Block.PlaceNew(...) - /// - public static new Servo PlaceNew(BlockIDs block, float3 position, - float3 rotation = default, BlockColors color = BlockColors.Default, byte darkness = 0, - int uscale = 1, float3 scale = default, Player player = null) - { - if (!(block == BlockIDs.ServoAxle || block == BlockIDs.ServoHinge || block == BlockIDs.ServoPiston)) - { - throw new BlockTypeException($"Block is not a {nameof(Servo)} block"); - } - if (PlacementEngine.IsInGame && GameState.IsBuildMode()) - { - EGID id = PlacementEngine.PlaceBlock(block, color, darkness, - position, uscale, scale, player, rotation); - return new Servo(id); - } - - return null; - } - public Servo(EGID id) : base(id) { if (!BlockEngine.GetBlockInfoExists(this.Id)) diff --git a/GamecraftModdingAPI/Blocks/SignalingBlock.cs b/GamecraftModdingAPI/Blocks/SignalingBlock.cs index f8006f6..8a62d64 100644 --- a/GamecraftModdingAPI/Blocks/SignalingBlock.cs +++ b/GamecraftModdingAPI/Blocks/SignalingBlock.cs @@ -14,25 +14,6 @@ namespace GamecraftModdingAPI.Blocks /// public class SignalingBlock : Block { - /// - /// Places a new signaling block. - /// Any valid functional block type with IO ports will work. - /// This re-implements Block.PlaceNew(...) - /// - public static new SignalingBlock PlaceNew(BlockIDs block, float3 position, - float3 rotation = default, BlockColors color = BlockColors.Default, byte darkness = 0, - int uscale = 1, float3 scale = default, Player player = null) - { - if (PlacementEngine.IsInGame && GameState.IsBuildMode()) - { - EGID id = PlacementEngine.PlaceBlock(block, color, darkness, - position, uscale, scale, player, rotation); - return new SignalingBlock(id); - } - - return null; - } - public SignalingBlock(EGID id) : base(id) { if (!BlockEngine.GetBlockInfoExists(this.Id)) diff --git a/GamecraftModdingAPI/Blocks/SpawnPoint.cs b/GamecraftModdingAPI/Blocks/SpawnPoint.cs index 65ef750..4419e38 100644 --- a/GamecraftModdingAPI/Blocks/SpawnPoint.cs +++ b/GamecraftModdingAPI/Blocks/SpawnPoint.cs @@ -13,30 +13,7 @@ namespace GamecraftModdingAPI.Blocks { public class SpawnPoint : Block { - /// - /// Places a new spawn point. - /// Any valid spawn block type is accepted. - /// This re-implements Block.PlaceNew(...) - /// - public static new SpawnPoint PlaceNew(BlockIDs block, float3 position, - float3 rotation = default, BlockColors color = BlockColors.Default, byte darkness = 0, - int uscale = 1, float3 scale = default, Player player = null) - { - if (!(block == BlockIDs.LargeSpawn || block == BlockIDs.SmallSpawn || block == BlockIDs.MediumSpawn || block == BlockIDs.PlayerSpawn)) - { - throw new BlockTypeException($"Block is not a {nameof(SpawnPoint)} block"); - } - if (PlacementEngine.IsInGame && GameState.IsBuildMode()) - { - EGID id = PlacementEngine.PlaceBlock(block, color, darkness, - position, uscale, scale, player, rotation); - return new SpawnPoint(id); - } - - return null; - } - - public SpawnPoint(EGID id) : base(id) + public SpawnPoint(EGID id) : base(id) { if (!BlockEngine.GetBlockInfoExists(this.Id)) { diff --git a/GamecraftModdingAPI/Blocks/TextBlock.cs b/GamecraftModdingAPI/Blocks/TextBlock.cs index c1a9344..94cf212 100644 --- a/GamecraftModdingAPI/Blocks/TextBlock.cs +++ b/GamecraftModdingAPI/Blocks/TextBlock.cs @@ -12,21 +12,6 @@ namespace GamecraftModdingAPI.Blocks { public class TextBlock : Block { - - public static TextBlock PlaceNew(float3 position, - float3 rotation = default, BlockColors color = BlockColors.Default, byte darkness = 0, - int uscale = 1, float3 scale = default, Player player = null) - { - if (PlacementEngine.IsInGame && GameState.IsBuildMode()) - { - EGID id = PlacementEngine.PlaceBlock(BlockIDs.TextBlock, color, darkness, - position, uscale, scale, player, rotation); - return new TextBlock(id); - } - - return null; - } - public TextBlock(EGID id) : base(id) { if (!BlockEngine.GetBlockInfoExists(this.Id)) diff --git a/GamecraftModdingAPI/Blocks/Timer.cs b/GamecraftModdingAPI/Blocks/Timer.cs index 0e7f744..2acab5b 100644 --- a/GamecraftModdingAPI/Blocks/Timer.cs +++ b/GamecraftModdingAPI/Blocks/Timer.cs @@ -13,23 +13,6 @@ namespace GamecraftModdingAPI.Blocks { public class Timer : Block { - /// - /// Places a new timer block. - /// - public static Timer PlaceNew(float3 position, - float3 rotation = default, BlockColors color = BlockColors.Default, byte darkness = 0, - int uscale = 1, float3 scale = default, Player player = null) - { - if (PlacementEngine.IsInGame && GameState.IsBuildMode()) - { - EGID id = PlacementEngine.PlaceBlock(BlockIDs.Timer, color, darkness, - position, uscale, scale, player, rotation); - return new Timer(id); - } - - return null; - } - public Timer(EGID id) : base(id) { if (!BlockEngine.GetBlockInfoExists(this.Id)) diff --git a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs index fa65ebb..d5cf714 100644 --- a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs +++ b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs @@ -232,6 +232,28 @@ namespace GamecraftModdingAPI.Tests } }).Build(); + CommandBuilder.Builder() + .Name("PlaceConsole") + .Description("Place a bunch of console block with a given text") + .Action((float x, float y, float z) => + { + Stopwatch sw = new Stopwatch(); + sw.Start(); + for (int i = 0; i < 100; i++) + { + for (int j = 0; j < 100; j++) + { + var block = Block.PlaceNew(BlockIDs.ConsoleBlock, + new float3(x + i, y, z + j)); + block.Command = "test_command"; + } + } + + sw.Stop(); + Logging.CommandLog($"Blocks placed in {sw.ElapsedMilliseconds} ms"); + }) + .Build(); + GameClient.SetDebugInfo("InstalledMods", InstalledMods); Block.Placed += (sender, args) => Logging.MetaDebugLog("Placed block " + args.Type + " with ID " + args.ID); -- 2.30.2 From 3592c6f464abde1588a184af34a5f5a36d7b84b4 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Wed, 15 Jul 2020 21:58:24 +0200 Subject: [PATCH 067/252] Add support for initializing blocks with properties Newly created blocks use the initializer to set properties, allowing the user to set per-block properties --- GamecraftModdingAPI/Block.cs | 76 ++++++++-------- GamecraftModdingAPI/Blocks/BlockEngine.cs | 89 +++++++------------ GamecraftModdingAPI/Blocks/BlockEngineInit.cs | 46 ++++++++++ .../Blocks/BlockEventsEngine.cs | 52 ++++++++++- GamecraftModdingAPI/Blocks/BlockIDs.cs | 2 +- GamecraftModdingAPI/Blocks/ConsoleBlock.cs | 40 ++++----- GamecraftModdingAPI/Blocks/Motor.cs | 23 ++--- .../Blocks/ObjectIdentifier.cs | 19 ++-- GamecraftModdingAPI/Blocks/Piston.cs | 23 ++--- GamecraftModdingAPI/Blocks/PlacementEngine.cs | 9 +- GamecraftModdingAPI/Blocks/Servo.cs | 48 ++++------ GamecraftModdingAPI/Blocks/SignalingBlock.cs | 27 ++---- GamecraftModdingAPI/Blocks/SpawnPoint.cs | 64 +++++-------- GamecraftModdingAPI/Blocks/TextBlock.cs | 53 +++++------ GamecraftModdingAPI/Blocks/Timer.cs | 68 +++++--------- 15 files changed, 301 insertions(+), 338 deletions(-) create mode 100644 GamecraftModdingAPI/Blocks/BlockEngineInit.cs diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index 673ef49..c3e0393 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -55,13 +55,7 @@ namespace GamecraftModdingAPI float3 rotation = default, BlockColors color = BlockColors.Default, byte darkness = 0, int uscale = 1, float3 scale = default, Player player = null) { - if (PlacementEngine.IsInGame && GameState.IsBuildMode()) - { - return new Block(PlacementEngine.PlaceBlock(block, color, darkness, - position, uscale, scale, player, rotation)); - } - - return null; + return PlaceNew(block, position, rotation, color, darkness, uscale, scale, player); } /// @@ -85,8 +79,10 @@ namespace GamecraftModdingAPI if (PlacementEngine.IsInGame && GameState.IsBuildMode()) { var egid = PlacementEngine.PlaceBlock(block, color, darkness, - position, uscale, scale, player, rotation); - return New(egid.entityID, egid.groupID); + position, uscale, scale, player, rotation, out var initializer); + var bl = New(egid.entityID, egid.groupID); + bl.InitData.Group = BlockEngine.InitGroup(initializer); + return bl; } return null; @@ -205,6 +201,8 @@ namespace GamecraftModdingAPI public EGID Id { get; } + internal BlockEngine.BlockInitData InitData; + /// /// The block's current position or zero if the block no longer exists. /// A block is 0.2 wide by default in terms of position. @@ -236,12 +234,11 @@ namespace GamecraftModdingAPI /// public float3 Scale { - get => BlockEngine.GetBlockInfo(Id).scale; + get => BlockEngine.GetBlockInfo(this, (ScalingEntityStruct st) => st.scale); set { + BlockEngine.SetBlockInfo(this, (ref ScalingEntityStruct st, float3 val) => st.scale = val, value); if (!Exists) return; //UpdateCollision needs the block to exist - ref var scaling = ref BlockEngine.GetBlockInfo(Id); - scaling.scale = value; ScalingEngine.UpdateCollision(Id); } } @@ -252,11 +249,11 @@ namespace GamecraftModdingAPI /// public int UniformScale { - get => BlockEngine.GetBlockInfo(Id).scaleFactor; + get => BlockEngine.GetBlockInfo(this, (UniformBlockScaleEntityStruct st) => st.scaleFactor); set { - ref var scaleStruct = ref BlockEngine.GetBlockInfo(Id); - scaleStruct.scaleFactor = value; + BlockEngine.SetBlockInfo(this, (ref UniformBlockScaleEntityStruct st, int val) => st.scaleFactor = val, + value); Scale = new float3(value, value, value); } } @@ -268,8 +265,7 @@ namespace GamecraftModdingAPI { get { - var id = (BlockIDs) BlockEngine.GetBlockInfo(Id, out var exists).DBID; - return exists ? id : BlockIDs.Invalid; + return BlockEngine.GetBlockInfo(this, (DBEntityStruct st) => (BlockIDs) st.DBID, BlockIDs.Invalid); } } @@ -280,17 +276,19 @@ namespace GamecraftModdingAPI { get { - byte index = BlockEngine.GetBlockInfo(Id, out var exists).indexInPalette; - if (!exists) index = byte.MaxValue; + byte index = BlockEngine.GetBlockInfo(this, (ColourParameterEntityStruct st) => st.indexInPalette, + byte.MaxValue); return new BlockColor(index); } set { - ref var color = ref BlockEngine.GetBlockInfo(Id); - color.indexInPalette = (byte)(value.Color + value.Darkness * 10); - color.overridePaletteColour = false; - color.needsUpdate = true; - BlockEngine.SetBlockColorFromPalette(ref color); + BlockEngine.SetBlockInfo(this, (ref ColourParameterEntityStruct color, BlockColor val) => + { + color.indexInPalette = (byte) (val.Color + val.Darkness * 10); + color.overridePaletteColour = false; + color.needsUpdate = true; + BlockEngine.SetBlockColorFromPalette(ref color); + }, value); } } @@ -299,27 +297,31 @@ namespace GamecraftModdingAPI /// public float4 CustomColor { - get => BlockEngine.GetBlockInfo(Id).overriddenColour; + get => BlockEngine.GetBlockInfo(this, (ColourParameterEntityStruct st) => st.overriddenColour); set { - ref var color = ref BlockEngine.GetBlockInfo(Id); - color.overriddenColour = value; - color.overridePaletteColour = true; - color.needsUpdate = true; + BlockEngine.SetBlockInfo(this, (ref ColourParameterEntityStruct color, float4 val) => + { + color.overriddenColour = val; + color.overridePaletteColour = true; + color.needsUpdate = true; + }, value); } } /// - /// The short text displayed on the block if applicable, or null. + /// The text displayed on the block if applicable, or null. /// Setting it is temporary to the session, it won't be saved. /// public string Label { - get => BlockEngine.GetBlockInfo(Id).textLabelComponent?.text; + get => BlockEngine.GetBlockInfo(this, (TextLabelEntityViewStruct st) => st.textLabelComponent?.text); set { - ref var text = ref BlockEngine.GetBlockInfo(Id); - if (text.textLabelComponent != null) text.textLabelComponent.text = value; + BlockEngine.SetBlockInfo(this, (ref TextLabelEntityViewStruct text, string val) => + { + if (text.textLabelComponent != null) text.textLabelComponent.text = val; + }, value); } } @@ -346,8 +348,8 @@ namespace GamecraftModdingAPI /// The SimBody of the cluster or null if the block doesn't exist. public SimBody GetSimBody() { - uint id = BlockEngine.GetBlockInfo(Id, out var exists).machineRigidBodyId; - return exists ? new SimBody(id) : null; + return BlockEngine.GetBlockInfo(this, + (GridConnectionsEntityStruct st) => new SimBody(st.machineRigidBodyId)); } public override string ToString() @@ -404,7 +406,9 @@ namespace GamecraftModdingAPI // So thanks to Microsoft, we've got this horrible implementation using reflection //Lets improve that using delegates - return New(Id.entityID, Id.groupID); + var block = New(Id.entityID, Id.groupID); + block.InitData = this.InitData; + return block; } #if DEBUG diff --git a/GamecraftModdingAPI/Blocks/BlockEngine.cs b/GamecraftModdingAPI/Blocks/BlockEngine.cs index 81a1630..d6f4907 100644 --- a/GamecraftModdingAPI/Blocks/BlockEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlockEngine.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using Gamecraft.Wires; @@ -10,14 +11,13 @@ using Svelto.DataStructures; using Svelto.ECS; using GamecraftModdingAPI.Engines; -using GamecraftModdingAPI.Utility; namespace GamecraftModdingAPI.Blocks { /// /// Engine for executing general block actions /// - public class BlockEngine : IApiEngine + public partial class BlockEngine : IApiEngine { public string Name { get; } = "GamecraftModdingAPIBlockGameEngine"; @@ -61,66 +61,54 @@ namespace GamecraftModdingAPI.Blocks color.paletteColour = paletteEntry.Colour; } - /// - /// Get a struct of a block. Can be used to set properties. - /// Returns a default value if not found. - /// - /// The block's ID - /// The struct to query - /// An editable reference to the struct public ref T GetBlockInfo(EGID blockID) where T : struct, IEntityComponent { - if (!Synced) - { - Sync(); - Synced = true; - } if (entitiesDB.Exists(blockID)) return ref entitiesDB.QueryEntity(blockID); T[] structHolder = new T[1]; //Create something that can be referenced return ref structHolder[0]; //Gets a default value automatically } - /// - /// Get a struct of a block. Can be used to set properties. - /// Returns a default value if not found. - /// - /// The block's ID - /// Whether the specified struct exists for the block - /// The struct to query - /// An editable reference to the struct - public ref T GetBlockInfo(EGID blockID, out bool exists) where T : struct, IEntityComponent + public U GetBlockInfo(Block block, Func getter, + U def = default) where T : struct, IEntityComponent { - if (!Synced) + if (entitiesDB.Exists(block.Id)) + return getter(entitiesDB.QueryEntity(block.Id)); + if (block.InitData.Group == null) return def; + var initializer = new EntityComponentInitializer(block.Id, block.InitData.Group); + if (initializer.Has()) + return getter(initializer.Get()); + return def; + } + + public delegate void Setter(ref T component, U value) where T : struct, IEntityComponent; + + public void SetBlockInfo(Block block, Setter setter, U value) where T : struct, IEntityComponent + { + if (entitiesDB.Exists(block.Id)) + setter(ref entitiesDB.QueryEntity(block.Id), value); + if (block.InitData.Group != null) { - Sync(); - Synced = true; + var initializer = new EntityComponentInitializer(block.Id, block.InitData.Group); + ref T structRef = ref (new T[1])[0]; //A reference for a default value for struct + setter(ref structRef, value); + initializer.Init(structRef); } - exists = entitiesDB.Exists(blockID); - if (exists) - return ref entitiesDB.QueryEntity(blockID); - T[] structHolder = new T[1]; - return ref structHolder[0]; } - public bool BlockExists(EGID id) + public bool BlockExists(EGID blockID) { - if (!Synced) - { - Sync(); - Synced = true; - } - return entitiesDB.Exists(id); + return entitiesDB.Exists(blockID); } - public bool GetBlockInfoExists(EGID blockID) where T : struct, IEntityComponent + public bool GetBlockInfoExists(Block block) where T : struct, IEntityComponent { - if (!Synced) - { - Sync(); - Synced = true; - } - return entitiesDB.Exists(blockID); + if (entitiesDB.Exists(block.Id)) + return true; + if (block.InitData.Group == null) + return false; + var init = new EntityComponentInitializer(block.Id, block.InitData.Group); + return init.Has(); } public SimBody[] GetSimBodiesFromID(byte id) @@ -183,17 +171,6 @@ namespace GamecraftModdingAPI.Blocks return null; } - /// - /// Synchronize newly created entity components with entities DB. - /// This forces a partial game tick, so it may be slow. - /// This also has the potential to make Gamecraft unstable. - /// Use this sparingly. - /// - private static void Sync() - { - DeterministicStepCompositionRootPatch.SubmitEntitiesNow(); - } - #if DEBUG public EntitiesDB GetEntitiesDB() { diff --git a/GamecraftModdingAPI/Blocks/BlockEngineInit.cs b/GamecraftModdingAPI/Blocks/BlockEngineInit.cs new file mode 100644 index 0000000..4be9a98 --- /dev/null +++ b/GamecraftModdingAPI/Blocks/BlockEngineInit.cs @@ -0,0 +1,46 @@ +using System; +using System.Linq.Expressions; + +using Svelto.DataStructures; +using Svelto.ECS; +using Svelto.ECS.Internal; + +namespace GamecraftModdingAPI.Blocks +{ + public partial class BlockEngine + { + internal struct BlockInitData + { + public FasterDictionary, ITypeSafeDictionary> Group; + } + + internal delegate FasterDictionary, ITypeSafeDictionary> GetInitGroup( + EntityComponentInitializer initializer); + + internal GetInitGroup InitGroup = CreateAccessor("_group"); + + //https://stackoverflow.com/questions/55878525/unit-testing-ref-structs-with-private-fields-via-reflection + internal static TDelegate CreateAccessor(string memberName) where TDelegate : Delegate + { + var invokeMethod = typeof(TDelegate).GetMethod("Invoke"); + if (invokeMethod == null) + throw new InvalidOperationException($"{typeof(TDelegate)} signature could not be determined."); + + var delegateParameters = invokeMethod.GetParameters(); + if (delegateParameters.Length != 1) + throw new InvalidOperationException("Delegate must have a single parameter."); + + var paramType = delegateParameters[0].ParameterType; + + var objParam = Expression.Parameter(paramType, "obj"); + var memberExpr = Expression.PropertyOrField(objParam, memberName); + Expression returnExpr = memberExpr; + if (invokeMethod.ReturnType != memberExpr.Type) + returnExpr = Expression.ConvertChecked(memberExpr, invokeMethod.ReturnType); + + var lambda = + Expression.Lambda(returnExpr, $"Access{paramType.Name}_{memberName}", new[] {objParam}); + return lambda.Compile(); + } + } +} \ No newline at end of file diff --git a/GamecraftModdingAPI/Blocks/BlockEventsEngine.cs b/GamecraftModdingAPI/Blocks/BlockEventsEngine.cs index 3c34b65..0a205f0 100644 --- a/GamecraftModdingAPI/Blocks/BlockEventsEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlockEventsEngine.cs @@ -1,9 +1,11 @@ using System; -using GamecraftModdingAPI.Engines; -using GamecraftModdingAPI.Utility; + using RobocraftX.Common; using Svelto.ECS; +using GamecraftModdingAPI.Engines; +using GamecraftModdingAPI.Utility; + namespace GamecraftModdingAPI.Blocks { public class BlockEventsEngine : IReactionaryEngine @@ -11,11 +13,18 @@ namespace GamecraftModdingAPI.Blocks public event EventHandler Placed; public event EventHandler Removed; + public BlockEventsEngine() + { + //Console.WriteLine("Creating BlockEventsEngine\n" + Environment.StackTrace); + } + public void Ready() { + //Console.WriteLine("BlockEventsEngine registered"); } public EntitiesDB entitiesDB { get; set; } + public void Dispose() { } @@ -23,17 +32,52 @@ namespace GamecraftModdingAPI.Blocks public string Name { get; } = "GamecraftModdingAPIBlockEventsEngine"; public bool isRemovable { get; } = false; + private bool shouldAddRemove; public void Add(ref DBEntityStruct entityComponent, EGID egid) { - ExceptionUtil.InvokeEvent(Placed, this, new BlockPlacedRemovedEventArgs {ID = egid, Type = (BlockIDs) entityComponent.DBID}); + if (!(shouldAddRemove = !shouldAddRemove)) + return; + ExceptionUtil.InvokeEvent(Placed, this, + new BlockPlacedRemovedEventArgs {ID = egid, Type = (BlockIDs) entityComponent.DBID}); } public void Remove(ref DBEntityStruct entityComponent, EGID egid) { - ExceptionUtil.InvokeEvent(Removed, this, new BlockPlacedRemovedEventArgs {ID = egid, Type = (BlockIDs) entityComponent.DBID}); + if (!(shouldAddRemove = !shouldAddRemove)) + return; + ExceptionUtil.InvokeEvent(Removed, this, + new BlockPlacedRemovedEventArgs {ID = egid, Type = (BlockIDs) entityComponent.DBID}); } } + /*[HarmonyPatch] + public static class TestPatch + { + public static void Postfix(FasterDictionary, FasterList> engines, + ExclusiveGroupStruct? previousGroup, in PlatformProfiler profiler, EGID egid) + { + if (!engines.TryGetValue(new RefWrapper(TypeSafeDictionary._type), out result)) + return; + } + public static MethodBase TargetMethod() + { + return AccessTools.Method("Svelto.ECS.Internal.TypeSafeDictionary:AddEntityComponentToEngines"); + } + }*/ + + /*[HarmonyPatch] + public static class TestPatch + { + public static void Postfix(EGID basePartEGID) + { + Console.WriteLine("Patched Add method: " + basePartEGID); + } + public static MethodBase TargetMethod() + { + return AccessTools.Method("RobocraftX.CR.MachineEditing.BuildBlockAdditionalPartEngine:Add"); + } + }*/ + public struct BlockPlacedRemovedEventArgs { public EGID ID; diff --git a/GamecraftModdingAPI/Blocks/BlockIDs.cs b/GamecraftModdingAPI/Blocks/BlockIDs.cs index b0eca31..596fb38 100644 --- a/GamecraftModdingAPI/Blocks/BlockIDs.cs +++ b/GamecraftModdingAPI/Blocks/BlockIDs.cs @@ -6,7 +6,7 @@ namespace GamecraftModdingAPI.Blocks public enum BlockIDs : ushort { /// - /// A custom value for the API. Doesn't exist for Gamecraft. + /// Called "nothing" in Gamecraft. (DBID.NOTHING) /// Invalid = ushort.MaxValue, AluminiumCube = 0, diff --git a/GamecraftModdingAPI/Blocks/ConsoleBlock.cs b/GamecraftModdingAPI/Blocks/ConsoleBlock.cs index e132029..4425a1e 100644 --- a/GamecraftModdingAPI/Blocks/ConsoleBlock.cs +++ b/GamecraftModdingAPI/Blocks/ConsoleBlock.cs @@ -14,18 +14,10 @@ namespace GamecraftModdingAPI.Blocks { public ConsoleBlock(EGID id): base(id) { - if (!BlockEngine.GetBlockInfoExists(this.Id)) - { - throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); - } } public ConsoleBlock(uint id): base(new EGID(id, CommonExclusiveGroups.BUILD_CONSOLE_BLOCK_GROUP)) { - if (!BlockEngine.GetBlockInfoExists(this.Id)) - { - throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); - } } // custom console block properties @@ -34,43 +26,47 @@ namespace GamecraftModdingAPI.Blocks { get { - return BlockEngine.GetBlockInfo(Id).commandName; + return BlockEngine.GetBlockInfo(this, (ConsoleBlockEntityStruct st) => st.commandName); } set { - BlockEngine.GetBlockInfo(Id).commandName.Set(value); + BlockEngine.SetBlockInfo(this, (ref ConsoleBlockEntityStruct st, string val) => st.commandName.Set(val), + value); } } public string Arg1 { - get => BlockEngine.GetBlockInfo(Id).arg1; + get => BlockEngine.GetBlockInfo(this, (ConsoleBlockEntityStruct st) => st.arg1); set { - BlockEngine.GetBlockInfo(Id).arg1.Set(value); + BlockEngine.SetBlockInfo(this, (ref ConsoleBlockEntityStruct st, string val) => st.arg1.Set(val), + value); } } public string Arg2 { - get => BlockEngine.GetBlockInfo(Id).arg2; + get => BlockEngine.GetBlockInfo(this, (ConsoleBlockEntityStruct st) => st.arg2); - set - { - BlockEngine.GetBlockInfo(Id).arg2.Set(value); - } + set + { + BlockEngine.SetBlockInfo(this, (ref ConsoleBlockEntityStruct st, string val) => st.arg2.Set(val), + value); + } } public string Arg3 { - get => BlockEngine.GetBlockInfo(Id).arg3; + get => BlockEngine.GetBlockInfo(this, (ConsoleBlockEntityStruct st) => st.arg3); - set - { - BlockEngine.GetBlockInfo(Id).arg3.Set(value); - } + set + { + BlockEngine.SetBlockInfo(this, (ref ConsoleBlockEntityStruct st, string val) => st.arg3.Set(val), + value); + } } } } diff --git a/GamecraftModdingAPI/Blocks/Motor.cs b/GamecraftModdingAPI/Blocks/Motor.cs index fde2920..fdadd26 100644 --- a/GamecraftModdingAPI/Blocks/Motor.cs +++ b/GamecraftModdingAPI/Blocks/Motor.cs @@ -13,18 +13,10 @@ namespace GamecraftModdingAPI.Blocks { public Motor(EGID id) : base(id) { - if (!BlockEngine.GetBlockInfoExists(this.Id)) - { - throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); - } } public Motor(uint id): base(new EGID(id, CommonExclusiveGroups.BUILD_MOTOR_BLOCK_GROUP)) { - if (!BlockEngine.GetBlockInfoExists(this.Id)) - { - throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); - } } // custom motor properties @@ -36,13 +28,12 @@ namespace GamecraftModdingAPI.Blocks { get { - return BlockEngine.GetBlockInfo(Id).maxVelocity; + return BlockEngine.GetBlockInfo(this, (MotorReadOnlyStruct st) => st.maxVelocity); } set { - ref MotorReadOnlyStruct motor = ref BlockEngine.GetBlockInfo(Id); - motor.maxVelocity = value; + BlockEngine.SetBlockInfo(this, (ref MotorReadOnlyStruct st, float val) => st.maxVelocity = val, value); } } @@ -53,13 +44,12 @@ namespace GamecraftModdingAPI.Blocks { get { - return BlockEngine.GetBlockInfo(Id).maxForce; + return BlockEngine.GetBlockInfo(this, (MotorReadOnlyStruct st) => st.maxForce); } set { - ref MotorReadOnlyStruct motor = ref BlockEngine.GetBlockInfo(Id); - motor.maxForce = value; + BlockEngine.SetBlockInfo(this, (ref MotorReadOnlyStruct st, float val) => st.maxForce = val, value); } } @@ -70,13 +60,12 @@ namespace GamecraftModdingAPI.Blocks { get { - return BlockEngine.GetBlockInfo(Id).reverse; + return BlockEngine.GetBlockInfo(this, (MotorReadOnlyStruct st) => st.reverse); } set { - ref MotorReadOnlyStruct motor = ref BlockEngine.GetBlockInfo(Id); - motor.reverse = value; + BlockEngine.SetBlockInfo(this, (ref MotorReadOnlyStruct st, bool val) => st.reverse = val, value); } } } diff --git a/GamecraftModdingAPI/Blocks/ObjectIdentifier.cs b/GamecraftModdingAPI/Blocks/ObjectIdentifier.cs index 9af96c2..0dc835a 100644 --- a/GamecraftModdingAPI/Blocks/ObjectIdentifier.cs +++ b/GamecraftModdingAPI/Blocks/ObjectIdentifier.cs @@ -8,27 +8,22 @@ namespace GamecraftModdingAPI.Blocks { public ObjectIdentifier(EGID id) : base(id) { - if (!BlockEngine.GetBlockInfoExists(Id)) - { - throw new BlockTypeException($"Block is not a {GetType().Name} block"); - } } public ObjectIdentifier(uint id) : base(new EGID(id, CommonExclusiveGroups.BUILD_OBJID_BLOCK_GROUP)) { - if (!BlockEngine.GetBlockInfoExists(Id)) - { - throw new BlockTypeException($"Block is not a {GetType().Name} block"); - } } public char Identifier { - get => (char) (BlockEngine.GetBlockInfo(Id).objectId + 'A'); + get => (char) BlockEngine.GetBlockInfo(this, (ObjectIdEntityStruct st) => st.objectId + 'A'); set { - BlockEngine.GetBlockInfo(Id).objectId = (byte) (value - 'A'); - Label = value + ""; //The label isn't updated automatically + BlockEngine.SetBlockInfo(this, (ref ObjectIdEntityStruct st, char val) => + { + st.objectId = (byte) (val - 'A'); + Label = val + ""; //The label isn't updated automatically + }, value); } } @@ -37,7 +32,7 @@ namespace GamecraftModdingAPI.Blocks /// public byte SimID { - get => BlockEngine.GetBlockInfo(Id).simObjectId; + get => BlockEngine.GetBlockInfo(this, (ObjectIdEntityStruct st) => st.simObjectId); } /// diff --git a/GamecraftModdingAPI/Blocks/Piston.cs b/GamecraftModdingAPI/Blocks/Piston.cs index 2586b60..aed8c33 100644 --- a/GamecraftModdingAPI/Blocks/Piston.cs +++ b/GamecraftModdingAPI/Blocks/Piston.cs @@ -13,18 +13,10 @@ namespace GamecraftModdingAPI.Blocks { public Piston(EGID id) : base(id) { - if (!BlockEngine.GetBlockInfoExists(this.Id)) - { - throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); - } } public Piston(uint id) : base(new EGID(id, CommonExclusiveGroups.BUILD_PISTON_BLOCK_GROUP)) { - if (!BlockEngine.GetBlockInfoExists(this.Id)) - { - throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); - } } // custom piston properties @@ -33,13 +25,13 @@ namespace GamecraftModdingAPI.Blocks /// The piston's max extension distance. /// public float MaximumExtension - { - get => BlockEngine.GetBlockInfo(Id).maxDeviation; + { + get => BlockEngine.GetBlockInfo(this, (PistonReadOnlyStruct st) => st.maxDeviation); set { - ref PistonReadOnlyStruct piston = ref BlockEngine.GetBlockInfo(Id); - piston.maxDeviation = value; + BlockEngine.SetBlockInfo(this, (ref PistonReadOnlyStruct st, float val) => st.maxDeviation = val, + value); } } @@ -47,13 +39,12 @@ namespace GamecraftModdingAPI.Blocks /// The piston's max extension force. /// public float MaximumForce - { - get => BlockEngine.GetBlockInfo(Id).maxForce; + { + get => BlockEngine.GetBlockInfo(this, (PistonReadOnlyStruct st) => st.maxForce); set { - ref PistonReadOnlyStruct piston = ref BlockEngine.GetBlockInfo(Id); - piston.maxForce = value; + BlockEngine.SetBlockInfo(this, (ref PistonReadOnlyStruct st, float val) => st.maxForce = val, value); } } } diff --git a/GamecraftModdingAPI/Blocks/PlacementEngine.cs b/GamecraftModdingAPI/Blocks/PlacementEngine.cs index 2297d90..61834b0 100644 --- a/GamecraftModdingAPI/Blocks/PlacementEngine.cs +++ b/GamecraftModdingAPI/Blocks/PlacementEngine.cs @@ -40,15 +40,16 @@ namespace GamecraftModdingAPI.Blocks private static BlockEntityFactory _blockEntityFactory; //Injected from PlaceBlockEngine public EGID PlaceBlock(BlockIDs block, BlockColors color, byte darkness, float3 position, int uscale, - float3 scale, Player player, float3 rotation) + float3 scale, Player player, float3 rotation, out EntityComponentInitializer initializer) { //It appears that only the non-uniform scale has any visible effect, but if that's not given here it will be set to the uniform one if (darkness > 9) throw new Exception("That is too dark. Make sure to use 0-9 as darkness. (0 is default.)"); - return BuildBlock((ushort) block, (byte) (color + darkness * 10), position, uscale, scale, rotation, + initializer = BuildBlock((ushort) block, (byte) (color + darkness * 10), position, uscale, scale, rotation, (player ?? new Player(PlayerType.Local)).Id); + return initializer.EGID; } - private EGID BuildBlock(ushort block, byte color, float3 position, int uscale, float3 scale, float3 rot, uint playerId) + private EntityComponentInitializer BuildBlock(ushort block, byte color, float3 position, int uscale, float3 scale, float3 rot, uint playerId) { if (_blockEntityFactory == null) throw new Exception("The factory is null."); @@ -107,7 +108,7 @@ namespace GamecraftModdingAPI.Blocks pickedBlock.placedBlockEntityID = structInitializer.EGID; pickedBlock.placedBlockWasAPickedBlock = false; Block.BlockEngine.Synced = false; // Block entities will need to be submitted before properties can be used - return structInitializer.EGID; + return structInitializer; } public string Name { get; } = "GamecraftModdingAPIPlacementGameEngine"; diff --git a/GamecraftModdingAPI/Blocks/Servo.cs b/GamecraftModdingAPI/Blocks/Servo.cs index c4b57fb..730749a 100644 --- a/GamecraftModdingAPI/Blocks/Servo.cs +++ b/GamecraftModdingAPI/Blocks/Servo.cs @@ -13,18 +13,10 @@ namespace GamecraftModdingAPI.Blocks { public Servo(EGID id) : base(id) { - if (!BlockEngine.GetBlockInfoExists(this.Id)) - { - throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); - } } public Servo(uint id) : base(new EGID(id, CommonExclusiveGroups.BUILD_SERVO_BLOCK_GROUP)) { - if (!BlockEngine.GetBlockInfoExists(this.Id)) - { - throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); - } } // custom servo properties @@ -33,13 +25,12 @@ namespace GamecraftModdingAPI.Blocks /// The servo's minimum angle. /// public float MinimumAngle - { - get => BlockEngine.GetBlockInfo(Id).minDeviation; + { + get => BlockEngine.GetBlockInfo(this, (ServoReadOnlyStruct st) => st.minDeviation); set { - ref ServoReadOnlyStruct servo = ref BlockEngine.GetBlockInfo(Id); - servo.minDeviation = value; + BlockEngine.SetBlockInfo(this, (ref ServoReadOnlyStruct st, float val) => st.minDeviation = val, value); } } @@ -48,13 +39,12 @@ namespace GamecraftModdingAPI.Blocks /// public float MaximumAngle { - get => BlockEngine.GetBlockInfo(Id).maxDeviation; + get => BlockEngine.GetBlockInfo(this, (ServoReadOnlyStruct st) => st.maxDeviation); - set - { - ref ServoReadOnlyStruct servo = ref BlockEngine.GetBlockInfo(Id); - servo.maxDeviation = value; - } + set + { + BlockEngine.SetBlockInfo(this, (ref ServoReadOnlyStruct st, float val) => st.maxDeviation = val, value); + } } /// @@ -62,13 +52,12 @@ namespace GamecraftModdingAPI.Blocks /// public float MaximumForce { - get => BlockEngine.GetBlockInfo(Id).maxForce; + get => BlockEngine.GetBlockInfo(this, (ServoReadOnlyStruct st) => st.maxForce); - set - { - ref ServoReadOnlyStruct servo = ref BlockEngine.GetBlockInfo(Id); - servo.maxForce = value; - } + set + { + BlockEngine.SetBlockInfo(this, (ref ServoReadOnlyStruct st, float val) => st.maxForce = val, value); + } } /// @@ -76,13 +65,12 @@ namespace GamecraftModdingAPI.Blocks /// public bool Reverse { - get => BlockEngine.GetBlockInfo(Id).reverse; + get => BlockEngine.GetBlockInfo(this, (ServoReadOnlyStruct st) => st.reverse); - set - { - ref ServoReadOnlyStruct servo = ref BlockEngine.GetBlockInfo(Id); - servo.reverse = value; - } + set + { + BlockEngine.SetBlockInfo(this, (ref ServoReadOnlyStruct st, bool val) => st.reverse = val, value); + } } } } diff --git a/GamecraftModdingAPI/Blocks/SignalingBlock.cs b/GamecraftModdingAPI/Blocks/SignalingBlock.cs index 8a62d64..149e450 100644 --- a/GamecraftModdingAPI/Blocks/SignalingBlock.cs +++ b/GamecraftModdingAPI/Blocks/SignalingBlock.cs @@ -16,7 +16,7 @@ namespace GamecraftModdingAPI.Blocks { public SignalingBlock(EGID id) : base(id) { - if (!BlockEngine.GetBlockInfoExists(this.Id)) + if (!BlockEngine.GetBlockInfoExists(this)) { throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); } @@ -24,17 +24,12 @@ namespace GamecraftModdingAPI.Blocks public SignalingBlock(uint id) : base(id) { - if (!BlockEngine.GetBlockInfoExists(this.Id)) + if (!BlockEngine.GetBlockInfoExists(this)) { throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); } } - protected ref BlockPortsStruct GetBlockPortsStruct() - { - return ref BlockEngine.GetBlockInfo(Id); - } - /// /// Generates the input port identifiers. /// @@ -53,16 +48,6 @@ namespace GamecraftModdingAPI.Blocks return SignalEngine.GetSignalOutputs(Id); } - /// - /// Gets the port struct. - /// - /// The port struct. - /// Port identifier. - protected ref PortEntityStruct GetPortStruct(EGID portId) - { - return ref BlockEngine.GetBlockInfo(portId); - } - /// /// Gets the connected wire. /// @@ -89,16 +74,16 @@ namespace GamecraftModdingAPI.Blocks /// The input port count. /// public uint InputCount - { - get => GetBlockPortsStruct().inputCount; - } + { + get => BlockEngine.GetBlockInfo(this, (BlockPortsStruct st) => st.inputCount); + } /// /// The output port count. /// public uint OutputCount { - get => GetBlockPortsStruct().outputCount; + get => BlockEngine.GetBlockInfo(this, (BlockPortsStruct st) => st.outputCount); } } } diff --git a/GamecraftModdingAPI/Blocks/SpawnPoint.cs b/GamecraftModdingAPI/Blocks/SpawnPoint.cs index 4419e38..7616acb 100644 --- a/GamecraftModdingAPI/Blocks/SpawnPoint.cs +++ b/GamecraftModdingAPI/Blocks/SpawnPoint.cs @@ -15,18 +15,10 @@ namespace GamecraftModdingAPI.Blocks { public SpawnPoint(EGID id) : base(id) { - if (!BlockEngine.GetBlockInfoExists(this.Id)) - { - throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); - } } public SpawnPoint(uint id) : base(new EGID(id, CommonExclusiveGroups.BUILD_SPAWNPOINT_BLOCK_GROUP)) { - if (!BlockEngine.GetBlockInfoExists(this.Id)) - { - throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); - } } // custom spawn point properties @@ -36,16 +28,12 @@ namespace GamecraftModdingAPI.Blocks /// public uint Lives { - get - { - return BlockEngine.GetBlockInfo(Id).lives; - } + get => BlockEngine.GetBlockInfo(this, (SpawnPointStatsEntityStruct st) => st.lives); - set - { - ref SpawnPointStatsEntityStruct spses = ref BlockEngine.GetBlockInfo(Id); - spses.lives = value; - } + set + { + BlockEngine.SetBlockInfo(this, (ref SpawnPointStatsEntityStruct st, uint val) => st.lives = val, value); + } } /// @@ -53,16 +41,12 @@ namespace GamecraftModdingAPI.Blocks /// public bool Damageable { - get - { - return BlockEngine.GetBlockInfo(Id).canTakeDamage; - } + get => BlockEngine.GetBlockInfo(this, (SpawnPointStatsEntityStruct st) => st.canTakeDamage); - set - { - ref SpawnPointStatsEntityStruct spses = ref BlockEngine.GetBlockInfo(Id); - spses.canTakeDamage = value; - } + set + { + BlockEngine.SetBlockInfo(this, (ref SpawnPointStatsEntityStruct st, bool val) => st.canTakeDamage = val, value); + } } /// @@ -70,16 +54,12 @@ namespace GamecraftModdingAPI.Blocks /// public bool GameOverEnabled { - get - { - return BlockEngine.GetBlockInfo(Id).gameOverScreen; - } + get => BlockEngine.GetBlockInfo(this, (SpawnPointStatsEntityStruct st) => st.gameOverScreen); - set - { - ref SpawnPointStatsEntityStruct spses = ref BlockEngine.GetBlockInfo(Id); - spses.gameOverScreen = value; - } + set + { + BlockEngine.SetBlockInfo(this, (ref SpawnPointStatsEntityStruct st, bool val) => st.gameOverScreen = val, value); + } } /// @@ -87,16 +67,12 @@ namespace GamecraftModdingAPI.Blocks /// public byte Team { - get - { - return BlockEngine.GetBlockInfo(Id).teamId; - } + get => BlockEngine.GetBlockInfo(this, (SpawnPointIdsEntityStruct st) => st.teamId); - set - { - ref SpawnPointIdsEntityStruct spses = ref BlockEngine.GetBlockInfo(Id); - spses.teamId = value; - } + set + { + BlockEngine.SetBlockInfo(this, (ref SpawnPointIdsEntityStruct st, byte val) => st.teamId = val, value); + } } } } diff --git a/GamecraftModdingAPI/Blocks/TextBlock.cs b/GamecraftModdingAPI/Blocks/TextBlock.cs index 94cf212..6096dd4 100644 --- a/GamecraftModdingAPI/Blocks/TextBlock.cs +++ b/GamecraftModdingAPI/Blocks/TextBlock.cs @@ -14,18 +14,10 @@ namespace GamecraftModdingAPI.Blocks { public TextBlock(EGID id) : base(id) { - if (!BlockEngine.GetBlockInfoExists(this.Id)) - { - throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); - } } public TextBlock(uint id) : base(new EGID(id, CommonExclusiveGroups.BUILD_TEXT_BLOCK_GROUP)) { - if (!BlockEngine.GetBlockInfoExists(this.Id)) - { - throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); - } } // custom text block properties @@ -35,35 +27,34 @@ namespace GamecraftModdingAPI.Blocks /// public string Text { - get - { - return BlockEngine.GetBlockInfo(Id).textCurrent; - } + get => BlockEngine.GetBlockInfo(this, (TextBlockDataStruct st) => st.textCurrent); - set - { - ref TextBlockDataStruct tbds = ref BlockEngine.GetBlockInfo(Id); - tbds.textCurrent.Set(value); - tbds.textStored.Set(value); - BlockEngine.GetBlockInfo(Id).newTextBlockStringContent.Set(value); - } - } + set + { + BlockEngine.SetBlockInfo(this, (ref TextBlockDataStruct tbds, string val) => + { + tbds.textCurrent.Set(val); + tbds.textStored.Set(val); + }, value); + BlockEngine.SetBlockInfo(this, + (ref TextBlockNetworkDataStruct st, string val) => st.newTextBlockStringContent.Set(val), value); + } + } /// - /// The text block's current text block ID (used in ChangeTextBlockCommand). + /// The text block's current text block ID (used in ChangeTextBlockCommand). /// - public string TextBlockId + public string TextBlockId { - get - { - return BlockEngine.GetBlockInfo(Id).textBlockID; - } + get => BlockEngine.GetBlockInfo(this, (TextBlockDataStruct st) => st.textBlockID); - set - { - BlockEngine.GetBlockInfo(Id).textBlockID.Set(value); - BlockEngine.GetBlockInfo(Id).newTextBlockID.Set(value); - } + set + { + BlockEngine.SetBlockInfo(this, (ref TextBlockDataStruct tbds, string val) => + tbds.textBlockID.Set(val), value); + BlockEngine.SetBlockInfo(this, + (ref TextBlockNetworkDataStruct st, string val) => st.newTextBlockID.Set(val), value); + } } } } diff --git a/GamecraftModdingAPI/Blocks/Timer.cs b/GamecraftModdingAPI/Blocks/Timer.cs index 2acab5b..5766a41 100644 --- a/GamecraftModdingAPI/Blocks/Timer.cs +++ b/GamecraftModdingAPI/Blocks/Timer.cs @@ -15,18 +15,10 @@ namespace GamecraftModdingAPI.Blocks { public Timer(EGID id) : base(id) { - if (!BlockEngine.GetBlockInfoExists(this.Id)) - { - throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); - } } public Timer(uint id) : base(new EGID(id, CommonExclusiveGroups.BUILD_TIMER_BLOCK_GROUP)) { - if (!BlockEngine.GetBlockInfoExists(this.Id)) - { - throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); - } } // custom timer properties @@ -36,16 +28,13 @@ namespace GamecraftModdingAPI.Blocks /// public float Start { - get - { - return BlockEngine.GetBlockInfo(Id).startTime; - } + get => BlockEngine.GetBlockInfo(this, (TimerBlockDataStruct st) => st.startTime); - set - { - ref TimerBlockDataStruct tbds = ref BlockEngine.GetBlockInfo(Id); - tbds.startTime = value; - } + set + { + BlockEngine.SetBlockInfo(this, (ref TimerBlockDataStruct tbds, float val) => tbds.startTime = val, + value); + } } /// @@ -53,16 +42,13 @@ namespace GamecraftModdingAPI.Blocks /// public float End { - get - { - return BlockEngine.GetBlockInfo(Id).endTime; - } + get => BlockEngine.GetBlockInfo(this, (TimerBlockDataStruct st) => st.endTime); - set - { - ref TimerBlockDataStruct tbds = ref BlockEngine.GetBlockInfo(Id); - tbds.endTime = value; - } + set + { + BlockEngine.SetBlockInfo(this, (ref TimerBlockDataStruct tbds, float val) => tbds.endTime = val, + value); + } } /// @@ -70,16 +56,13 @@ namespace GamecraftModdingAPI.Blocks /// public bool DisplayMilliseconds { - get - { - return BlockEngine.GetBlockInfo(Id).outputFormatHasMS; - } + get => BlockEngine.GetBlockInfo(this, (TimerBlockDataStruct st) => st.outputFormatHasMS); - set - { - ref TimerBlockDataStruct tbds = ref BlockEngine.GetBlockInfo(Id); - tbds.outputFormatHasMS = value; - } + set + { + BlockEngine.SetBlockInfo(this, (ref TimerBlockDataStruct tbds, bool val) => tbds.outputFormatHasMS = val, + value); + } } /// @@ -87,16 +70,13 @@ namespace GamecraftModdingAPI.Blocks /// public int CurrentTime { - get - { - return BlockEngine.GetBlockInfo(Id).timeLastRenderFrameMS; - } + get => BlockEngine.GetBlockInfo(this, (TimerBlockLabelCacheEntityStruct st) => st.timeLastRenderFrameMS); - set - { - ref TimerBlockLabelCacheEntityStruct tblces = ref BlockEngine.GetBlockInfo(Id); - tblces.timeLastRenderFrameMS = value; - } + set + { + BlockEngine.SetBlockInfo(this, (ref TimerBlockLabelCacheEntityStruct tbds, int val) => tbds.timeLastRenderFrameMS = val, + value); + } } } } -- 2.30.2 From d842df7681206f6c30e16fb098a912e971b47f19 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Wed, 15 Jul 2020 22:46:48 +0200 Subject: [PATCH 068/252] Implement init for position and rotation --- GamecraftModdingAPI/Block.cs | 8 ++--- GamecraftModdingAPI/Blocks/ConsoleBlock.cs | 3 ++ GamecraftModdingAPI/Blocks/MovementEngine.cs | 19 ++++++++-- GamecraftModdingAPI/Blocks/RotationEngine.cs | 38 ++++++++++++++------ 4 files changed, 52 insertions(+), 16 deletions(-) diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index c3e0393..f334c30 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -209,10 +209,10 @@ namespace GamecraftModdingAPI /// public float3 Position { - get => Exists ? MovementEngine.GetPosition(Id) : float3.zero; + get => MovementEngine.GetPosition(Id, InitData); set { - if (Exists) MovementEngine.MoveBlock(Id, value); + MovementEngine.MoveBlock(Id, InitData, value); } } @@ -221,10 +221,10 @@ namespace GamecraftModdingAPI /// public float3 Rotation { - get => Exists ? RotationEngine.GetRotation(Id) : float3.zero; + get => RotationEngine.GetRotation(Id, InitData); set { - if (Exists) RotationEngine.RotateBlock(Id, value); + RotationEngine.RotateBlock(Id, InitData, value); } } diff --git a/GamecraftModdingAPI/Blocks/ConsoleBlock.cs b/GamecraftModdingAPI/Blocks/ConsoleBlock.cs index 4425a1e..edf3e76 100644 --- a/GamecraftModdingAPI/Blocks/ConsoleBlock.cs +++ b/GamecraftModdingAPI/Blocks/ConsoleBlock.cs @@ -22,6 +22,9 @@ namespace GamecraftModdingAPI.Blocks // custom console block properties + /// + /// Setting a nonexistent command will crash the game when switching to simulation + /// public string Command { get diff --git a/GamecraftModdingAPI/Blocks/MovementEngine.cs b/GamecraftModdingAPI/Blocks/MovementEngine.cs index 0ff119a..a4ac0fa 100644 --- a/GamecraftModdingAPI/Blocks/MovementEngine.cs +++ b/GamecraftModdingAPI/Blocks/MovementEngine.cs @@ -35,8 +35,17 @@ namespace GamecraftModdingAPI.Blocks // implementations for Movement static class - public float3 MoveBlock(EGID blockID, float3 vector) + internal float3 MoveBlock(EGID blockID, BlockEngine.BlockInitData data, float3 vector) { + if (!entitiesDB.Exists(blockID)) + { + if (data.Group == null) return float3.zero; + var init = new EntityComponentInitializer(blockID, data.Group); + init.Init(new PositionEntityStruct {position = vector}); + init.Init(new GridRotationStruct {position = vector}); + init.Init(new LocalTransformEntityStruct {position = vector}); + return vector; + } ref PositionEntityStruct posStruct = ref this.entitiesDB.QueryEntity(blockID); ref GridRotationStruct gridStruct = ref this.entitiesDB.QueryEntity(blockID); ref LocalTransformEntityStruct transStruct = ref this.entitiesDB.QueryEntity(blockID); @@ -56,8 +65,14 @@ namespace GamecraftModdingAPI.Blocks return posStruct.position; } - public float3 GetPosition(EGID blockID) + internal float3 GetPosition(EGID blockID, BlockEngine.BlockInitData data) { + if (!entitiesDB.Exists(blockID)) + { + if (data.Group == null) return float3.zero; + var init = new EntityComponentInitializer(blockID, data.Group); + return init.Has() ? init.Get().position : float3.zero; + } ref PositionEntityStruct posStruct = ref this.entitiesDB.QueryEntity(blockID); return posStruct.position; } diff --git a/GamecraftModdingAPI/Blocks/RotationEngine.cs b/GamecraftModdingAPI/Blocks/RotationEngine.cs index e9cd1ef..ca97874 100644 --- a/GamecraftModdingAPI/Blocks/RotationEngine.cs +++ b/GamecraftModdingAPI/Blocks/RotationEngine.cs @@ -35,23 +35,32 @@ namespace GamecraftModdingAPI.Blocks // implementations for Rotation static class - public float3 RotateBlock(EGID blockID, Vector3 vector) + internal float3 RotateBlock(EGID blockID, BlockEngine.BlockInitData data, Vector3 vector) { + if (!entitiesDB.Exists(blockID)) + { + if (data.Group == null) return float3.zero; + var init = new EntityComponentInitializer(blockID, data.Group); + init.Init(new RotationEntityStruct {rotation = new Quaternion {eulerAngles = vector}}); + init.Init(new GridRotationStruct {rotation = new Quaternion {eulerAngles = vector}}); + init.Init(new LocalTransformEntityStruct {rotation = new Quaternion {eulerAngles = vector}}); + return vector; + } ref RotationEntityStruct rotStruct = ref this.entitiesDB.QueryEntity(blockID); ref GridRotationStruct gridStruct = ref this.entitiesDB.QueryEntity(blockID); ref LocalTransformEntityStruct transStruct = ref this.entitiesDB.QueryEntity(blockID); ref UECSPhysicsEntityStruct phyStruct = ref this.entitiesDB.QueryEntity(blockID); // main (persistent) position - Quaternion newRotation = (Quaternion)rotStruct.rotation; - newRotation.eulerAngles += vector; - rotStruct.rotation = (quaternion)newRotation; + Quaternion newRotation = rotStruct.rotation; + newRotation.eulerAngles = vector; + rotStruct.rotation = newRotation; // placement grid rotation - Quaternion newGridRotation = (Quaternion)gridStruct.rotation; - newGridRotation.eulerAngles += vector; - gridStruct.rotation = (quaternion)newGridRotation; + Quaternion newGridRotation = gridStruct.rotation; + newGridRotation.eulerAngles = vector; + gridStruct.rotation = newGridRotation; // rendered position - Quaternion newTransRotation = (Quaternion)rotStruct.rotation; - newTransRotation.eulerAngles += vector; + Quaternion newTransRotation = rotStruct.rotation; + newTransRotation.eulerAngles = vector; transStruct.rotation = newTransRotation; // collision position FullGameFields._physicsWorld.EntityManager.SetComponentData(phyStruct.uecsEntity, new Unity.Transforms.Rotation @@ -63,8 +72,17 @@ namespace GamecraftModdingAPI.Blocks } - public float3 GetRotation(EGID blockID) + internal float3 GetRotation(EGID blockID, BlockEngine.BlockInitData data) { + if (!entitiesDB.Exists(blockID)) + { + if (data.Group == null) return float3.zero; + var init = new EntityComponentInitializer(blockID, data.Group); + return init.Has() + ? (float3) ((Quaternion) init.Get().rotation).eulerAngles + : float3.zero; + } + ref RotationEntityStruct rotStruct = ref entitiesDB.QueryEntity(blockID); return ((Quaternion) rotStruct.rotation).eulerAngles; } -- 2.30.2 From e0aa052305d750d147872e2348baf33e3b3eacba Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Thu, 16 Jul 2020 20:38:51 -0400 Subject: [PATCH 069/252] Fix dev tools for preview changes --- Automation/gen_csproj.py | 2 +- .../GamecraftModdingAPI.csproj | 1133 +++++++++-------- GamecraftModdingAPI/Tests/TestRoot.cs | 11 +- 3 files changed, 592 insertions(+), 554 deletions(-) diff --git a/Automation/gen_csproj.py b/Automation/gen_csproj.py index d0f18c4..1180d71 100644 --- a/Automation/gen_csproj.py +++ b/Automation/gen_csproj.py @@ -32,7 +32,7 @@ if __name__ == "__main__": args = parser.parse_args() print("Building Assembly references") - asmXml = buildReferencesXml("../ref/Gamecraft_Data/Managed") + asmXml = buildReferencesXml("../ref/GamecraftPreview_Data/Managed") # print(asmXml) with open("../GamecraftModdingAPI/GamecraftModdingAPI.csproj", "r") as xmlFile: diff --git a/GamecraftModdingAPI/GamecraftModdingAPI.csproj b/GamecraftModdingAPI/GamecraftModdingAPI.csproj index 29cc08f..46dffee 100644 --- a/GamecraftModdingAPI/GamecraftModdingAPI.csproj +++ b/GamecraftModdingAPI/GamecraftModdingAPI.csproj @@ -2,7 +2,7 @@ net472 true - 1.3.0 + 1.4.0-preview Exmods GNU General Public Licence 3+ https://git.exmods.org/modtainers/GamecraftModdingAPI @@ -22,808 +22,847 @@ - + + + + - - ..\ref\Gamecraft_Data\Managed\IllusionInjector.dll - ..\..\ref\Gamecraft_Data\Managed\IllusionInjector.dll - - - ..\ref\Gamecraft_Data\Managed\IllusionPlugin.dll - ..\..\ref\Gamecraft_Data\Managed\IllusionPlugin.dll - - - ..\ref\Gamecraft_Data\Managed\JWT.dll - ..\..\ref\Gamecraft_Data\Managed\JWT.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Burst.Unsafe.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Burst.Unsafe.dll - - - ..\ref\Gamecraft_Data\Managed\Rewired_Core.dll - ..\..\ref\Gamecraft_Data\Managed\Rewired_Core.dll - - - ..\ref\Gamecraft_Data\Managed\Rewired_Windows.dll - ..\..\ref\Gamecraft_Data\Managed\Rewired_Windows.dll - - - ..\ref\Gamecraft_Data\Managed\mscorlib.dll - ..\..\ref\Gamecraft_Data\Managed\mscorlib.dll - - - ..\ref\Gamecraft_Data\Managed\Accessibility.dll - ..\..\ref\Gamecraft_Data\Managed\Accessibility.dll - - ..\ref\Gamecraft_Data\Managed\Analytics.dll - ..\..\ref\Gamecraft_Data\Managed\Analytics.dll + ..\ref\GamecraftPreview_Data\Managed\Analytics.dll + ..\..\ref\GamecraftPreview_Data\Managed\Analytics.dll - ..\ref\Gamecraft_Data\Managed\Assembly-CSharp-firstpass.dll - ..\..\ref\Gamecraft_Data\Managed\Assembly-CSharp-firstpass.dll + ..\ref\GamecraftPreview_Data\Managed\Assembly-CSharp-firstpass.dll + ..\..\ref\GamecraftPreview_Data\Managed\Assembly-CSharp-firstpass.dll - ..\ref\Gamecraft_Data\Managed\Assembly-CSharp.dll - ..\..\ref\Gamecraft_Data\Managed\Assembly-CSharp.dll + ..\ref\GamecraftPreview_Data\Managed\Assembly-CSharp.dll + ..\..\ref\GamecraftPreview_Data\Managed\Assembly-CSharp.dll - ..\ref\Gamecraft_Data\Managed\Authentication.dll - ..\..\ref\Gamecraft_Data\Managed\Authentication.dll + ..\ref\GamecraftPreview_Data\Managed\Authentication.dll + ..\..\ref\GamecraftPreview_Data\Managed\Authentication.dll - ..\ref\Gamecraft_Data\Managed\BlockEntityFactory.dll - ..\..\ref\Gamecraft_Data\Managed\BlockEntityFactory.dll + ..\ref\GamecraftPreview_Data\Managed\BlockEntityFactory.dll + ..\..\ref\GamecraftPreview_Data\Managed\BlockEntityFactory.dll - ..\ref\Gamecraft_Data\Managed\Blocks.HUDFeedbackBlocks.dll - ..\..\ref\Gamecraft_Data\Managed\Blocks.HUDFeedbackBlocks.dll + ..\ref\GamecraftPreview_Data\Managed\Blocks.HUDFeedbackBlocks.dll + ..\..\ref\GamecraftPreview_Data\Managed\Blocks.HUDFeedbackBlocks.dll - ..\ref\Gamecraft_Data\Managed\CommandLine.dll - ..\..\ref\Gamecraft_Data\Managed\CommandLine.dll + ..\ref\GamecraftPreview_Data\Managed\CommandLine.dll + ..\..\ref\GamecraftPreview_Data\Managed\CommandLine.dll - ..\ref\Gamecraft_Data\Managed\DataLoader.dll - ..\..\ref\Gamecraft_Data\Managed\DataLoader.dll + ..\ref\GamecraftPreview_Data\Managed\DataLoader.dll + ..\..\ref\GamecraftPreview_Data\Managed\DataLoader.dll - ..\ref\Gamecraft_Data\Managed\DDNA.dll - ..\..\ref\Gamecraft_Data\Managed\DDNA.dll - - - ..\ref\Gamecraft_Data\Managed\Facepunch.Steamworks.Win64.dll - ..\..\ref\Gamecraft_Data\Managed\Facepunch.Steamworks.Win64.dll + ..\ref\GamecraftPreview_Data\Managed\DDNA.dll + ..\..\ref\GamecraftPreview_Data\Managed\DDNA.dll - ..\ref\Gamecraft_Data\Managed\FMOD.dll - ..\..\ref\Gamecraft_Data\Managed\FMOD.dll + ..\ref\GamecraftPreview_Data\Managed\FMOD.dll + ..\..\ref\GamecraftPreview_Data\Managed\FMOD.dll - ..\ref\Gamecraft_Data\Managed\FullGame.dll - ..\..\ref\Gamecraft_Data\Managed\FullGame.dll + ..\ref\GamecraftPreview_Data\Managed\FullGame.dll + ..\..\ref\GamecraftPreview_Data\Managed\FullGame.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.AudioBlocks.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.AudioBlocks.dll + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.AudioBlocks.dll + ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.AudioBlocks.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.ConsoleBlock.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.ConsoleBlock.dll + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.Blocks.ConsoleBlock.dll + ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.Blocks.ConsoleBlock.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.DamagingSurfaceBlock.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.DamagingSurfaceBlock.dll + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.Blocks.DamagingSurfaceBlock.dll + ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.Blocks.DamagingSurfaceBlock.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.GenericPhysicsBlocks.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.GenericPhysicsBlocks.dll + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.Blocks.GenericPhysicsBlocks.dll + ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.Blocks.GenericPhysicsBlocks.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.LogicBlock.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.LogicBlock.dll + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.Blocks.LogicBlock.dll + ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.Blocks.LogicBlock.dll - ..\ref\Gamecraft_Data\Managed\GameCraft.Blocks.ProjectileBlock.dll - ..\..\ref\Gamecraft_Data\Managed\GameCraft.Blocks.ProjectileBlock.dll + ..\ref\GamecraftPreview_Data\Managed\GameCraft.Blocks.ProjectileBlock.dll + ..\..\ref\GamecraftPreview_Data\Managed\GameCraft.Blocks.ProjectileBlock.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.TimerBlock.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.TimerBlock.dll + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.Blocks.TimerBlock.dll + ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.Blocks.TimerBlock.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.CharacterVulnerability.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.CharacterVulnerability.dll + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.CharacterVulnerability.dll + ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.CharacterVulnerability.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.CharacterVulnerabilityGui.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.CharacterVulnerabilityGui.dll + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.CharacterVulnerabilityGui.dll + ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.CharacterVulnerabilityGui.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.Effects.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Effects.dll + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.Effects.dll + ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.Effects.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.ConsoleBlock.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.ConsoleBlock.dll + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.ConsoleBlock.dll + ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.ConsoleBlock.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll + ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.HUDFeedbackBlocks.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.HUDFeedbackBlocks.dll + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.HUDFeedbackBlocks.dll + ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.HUDFeedbackBlocks.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Tweaks.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Tweaks.dll + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.Tweaks.dll + ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.Tweaks.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Wires.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Wires.dll + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.Wires.dll + ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.Wires.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Wires.Mockup.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Wires.Mockup.dll + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.Wires.Mockup.dll + ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.Wires.Mockup.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll + ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.Music.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Music.dll + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.Music.dll + ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.Music.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.PerformanceWarnings.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.PerformanceWarnings.dll + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.PerformanceWarnings.dll + ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.PerformanceWarnings.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.Tweaks.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Tweaks.dll + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.Tweaks.dll + ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.Tweaks.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.Tweaks.Mockup.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Tweaks.Mockup.dll + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.Tweaks.Mockup.dll + ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.Tweaks.Mockup.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.VisualEffects.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.VisualEffects.dll + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.VisualEffects.dll + ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.VisualEffects.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.Wires.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Wires.dll + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.Wires.dll + ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.Wires.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.Wires.Input.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Wires.Input.dll + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.Wires.Input.dll + ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.Wires.Input.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.Wires.Mockup.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Wires.Mockup.dll + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.Wires.Mockup.dll + ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.Wires.Mockup.dll - ..\ref\Gamecraft_Data\Managed\GameState.dll - ..\..\ref\Gamecraft_Data\Managed\GameState.dll + ..\ref\GamecraftPreview_Data\Managed\GameState.dll + ..\..\ref\GamecraftPreview_Data\Managed\GameState.dll - ..\ref\Gamecraft_Data\Managed\GPUInstancer.dll - ..\..\ref\Gamecraft_Data\Managed\GPUInstancer.dll + ..\ref\GamecraftPreview_Data\Managed\GPUInstancer.dll + ..\..\ref\GamecraftPreview_Data\Managed\GPUInstancer.dll - ..\ref\Gamecraft_Data\Managed\Havok.Physics.dll - ..\..\ref\Gamecraft_Data\Managed\Havok.Physics.dll + ..\ref\GamecraftPreview_Data\Managed\Havok.Physics.dll + ..\..\ref\GamecraftPreview_Data\Managed\Havok.Physics.dll - ..\ref\Gamecraft_Data\Managed\Havok.Physics.Hybrid.dll - ..\..\ref\Gamecraft_Data\Managed\Havok.Physics.Hybrid.dll + ..\ref\GamecraftPreview_Data\Managed\Havok.Physics.Hybrid.dll + ..\..\ref\GamecraftPreview_Data\Managed\Havok.Physics.Hybrid.dll - ..\ref\Gamecraft_Data\Managed\LZ4.dll - ..\..\ref\Gamecraft_Data\Managed\LZ4.dll + ..\ref\GamecraftPreview_Data\Managed\LZ4.dll + ..\..\ref\GamecraftPreview_Data\Managed\LZ4.dll - ..\ref\Gamecraft_Data\Managed\MultiplayerNetworking.dll - ..\..\ref\Gamecraft_Data\Managed\MultiplayerNetworking.dll + ..\ref\GamecraftPreview_Data\Managed\MultiplayerNetworking.dll + ..\..\ref\GamecraftPreview_Data\Managed\MultiplayerNetworking.dll - ..\ref\Gamecraft_Data\Managed\MultiplayerTest.dll - ..\..\ref\Gamecraft_Data\Managed\MultiplayerTest.dll - - - ..\ref\Gamecraft_Data\Managed\netstandard.dll - ..\..\ref\Gamecraft_Data\Managed\netstandard.dll - - - ..\ref\Gamecraft_Data\Managed\Newtonsoft.Json.dll - ..\..\ref\Gamecraft_Data\Managed\Newtonsoft.Json.dll - - - ..\ref\Gamecraft_Data\Managed\Novell.Directory.Ldap.dll - ..\..\ref\Gamecraft_Data\Managed\Novell.Directory.Ldap.dll + ..\ref\GamecraftPreview_Data\Managed\MultiplayerTest.dll + ..\..\ref\GamecraftPreview_Data\Managed\MultiplayerTest.dll - ..\ref\Gamecraft_Data\Managed\RCX.ScreenshotTaker.dll - ..\..\ref\Gamecraft_Data\Managed\RCX.ScreenshotTaker.dll + ..\ref\GamecraftPreview_Data\Managed\RCX.ScreenshotTaker.dll + ..\..\ref\GamecraftPreview_Data\Managed\RCX.ScreenshotTaker.dll - ..\ref\Gamecraft_Data\Managed\RobocraftECS.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftECS.dll + ..\ref\GamecraftPreview_Data\Managed\RobocraftECS.dll + ..\..\ref\GamecraftPreview_Data\Managed\RobocraftECS.dll - ..\ref\Gamecraft_Data\Managed\RobocraftX.AccountPreferences.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.AccountPreferences.dll + ..\ref\GamecraftPreview_Data\Managed\RobocraftX.AccountPreferences.dll + ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.AccountPreferences.dll - ..\ref\Gamecraft_Data\Managed\RobocraftX.Blocks.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Blocks.dll + ..\ref\GamecraftPreview_Data\Managed\RobocraftX.Blocks.dll + ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.Blocks.dll - ..\ref\Gamecraft_Data\Managed\RobocraftX.Blocks.Ghost.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Blocks.Ghost.dll + ..\ref\GamecraftPreview_Data\Managed\RobocraftX.Blocks.Ghost.dll + ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.Blocks.Ghost.dll - ..\ref\Gamecraft_Data\Managed\RobocraftX.Blocks.Triggers.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Blocks.Triggers.dll + ..\ref\GamecraftPreview_Data\Managed\RobocraftX.Blocks.Triggers.dll + ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.Blocks.Triggers.dll - ..\ref\Gamecraft_Data\Managed\RobocraftX.Building.BoxSelect.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Building.BoxSelect.dll + ..\ref\GamecraftPreview_Data\Managed\RobocraftX.Building.BoxSelect.dll + ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.Building.BoxSelect.dll - ..\ref\Gamecraft_Data\Managed\RobocraftX.Building.Jobs.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Building.Jobs.dll + ..\ref\GamecraftPreview_Data\Managed\RobocraftX.Building.Jobs.dll + ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.Building.Jobs.dll - ..\ref\Gamecraft_Data\Managed\RobocraftX.Character.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Character.dll + ..\ref\GamecraftPreview_Data\Managed\RobocraftX.Character.dll + ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.Character.dll - ..\ref\Gamecraft_Data\Managed\RobocraftX.ClusterToWireConversion.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.ClusterToWireConversion.dll + ..\ref\GamecraftPreview_Data\Managed\RobocraftX.ClusterToWireConversion.dll + ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.ClusterToWireConversion.dll - ..\ref\Gamecraft_Data\Managed\RobocraftX.Common.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Common.dll + ..\ref\GamecraftPreview_Data\Managed\RobocraftX.Common.dll + ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.Common.dll - ..\ref\Gamecraft_Data\Managed\RobocraftX.ControlsScreen.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.ControlsScreen.dll + ..\ref\GamecraftPreview_Data\Managed\RobocraftX.ControlsScreen.dll + ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.ControlsScreen.dll - ..\ref\Gamecraft_Data\Managed\RobocraftX.Crosshair.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Crosshair.dll + ..\ref\GamecraftPreview_Data\Managed\RobocraftX.Crosshair.dll + ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.Crosshair.dll - ..\ref\Gamecraft_Data\Managed\RobocraftX.FrontEnd.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.FrontEnd.dll + ..\ref\GamecraftPreview_Data\Managed\RobocraftX.FrontEnd.dll + ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.FrontEnd.dll - ..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.BlockLabel.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.BlockLabel.dll + ..\ref\GamecraftPreview_Data\Managed\RobocraftX.GUI.BlockLabel.dll + ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.GUI.BlockLabel.dll - ..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.DebugDisplay.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.DebugDisplay.dll + ..\ref\GamecraftPreview_Data\Managed\RobocraftX.GUI.DebugDisplay.dll + ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.GUI.DebugDisplay.dll - ..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.dll + ..\ref\GamecraftPreview_Data\Managed\RobocraftX.GUI.dll + ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.GUI.dll - ..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.RemoveBlock.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.RemoveBlock.dll + ..\ref\GamecraftPreview_Data\Managed\RobocraftX.GUI.RemoveBlock.dll + ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.GUI.RemoveBlock.dll - ..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.ScaleGhost.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.ScaleGhost.dll + ..\ref\GamecraftPreview_Data\Managed\RobocraftX.GUI.ScaleGhost.dll + ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.GUI.ScaleGhost.dll - ..\ref\Gamecraft_Data\Managed\RobocraftX.GUIs.WorkshopPrefabs.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUIs.WorkshopPrefabs.dll + ..\ref\GamecraftPreview_Data\Managed\RobocraftX.GUIs.WorkshopPrefabs.dll + ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.GUIs.WorkshopPrefabs.dll - ..\ref\Gamecraft_Data\Managed\RobocraftX.Input.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Input.dll + ..\ref\GamecraftPreview_Data\Managed\RobocraftX.Input.dll + ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.Input.dll - ..\ref\Gamecraft_Data\Managed\RobocraftX.MachineEditor.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.MachineEditor.dll + ..\ref\GamecraftPreview_Data\Managed\RobocraftX.MachineEditor.dll + ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.MachineEditor.dll - ..\ref\Gamecraft_Data\Managed\RobocraftX.MainGame.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.MainGame.dll + ..\ref\GamecraftPreview_Data\Managed\RobocraftX.MainGame.dll + ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.MainGame.dll - ..\ref\Gamecraft_Data\Managed\RobocraftX.MainSimulation.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.MainSimulation.dll + ..\ref\GamecraftPreview_Data\Managed\RobocraftX.MainSimulation.dll + ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.MainSimulation.dll - ..\ref\Gamecraft_Data\Managed\RobocraftX.MockCharacter.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.MockCharacter.dll + ..\ref\GamecraftPreview_Data\Managed\RobocraftX.MockCharacter.dll + ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.MockCharacter.dll - ..\ref\Gamecraft_Data\Managed\RobocraftX.Multiplayer.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Multiplayer.dll + ..\ref\GamecraftPreview_Data\Managed\RobocraftX.Multiplayer.dll + ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.Multiplayer.dll - ..\ref\Gamecraft_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll + ..\ref\GamecraftPreview_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll + ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll - ..\ref\Gamecraft_Data\Managed\RobocraftX.MultiplayerInput.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.MultiplayerInput.dll + ..\ref\GamecraftPreview_Data\Managed\RobocraftX.MultiplayerInput.dll + ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.MultiplayerInput.dll - ..\ref\Gamecraft_Data\Managed\Robocraftx.ObjectIdBlocks.dll - ..\..\ref\Gamecraft_Data\Managed\Robocraftx.ObjectIdBlocks.dll + ..\ref\GamecraftPreview_Data\Managed\Robocraftx.ObjectIdBlocks.dll + ..\..\ref\GamecraftPreview_Data\Managed\Robocraftx.ObjectIdBlocks.dll - ..\ref\Gamecraft_Data\Managed\RobocraftX.Party.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Party.dll + ..\ref\GamecraftPreview_Data\Managed\RobocraftX.Party.dll + ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.Party.dll - ..\ref\Gamecraft_Data\Managed\RobocraftX.PartyGui.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.PartyGui.dll + ..\ref\GamecraftPreview_Data\Managed\RobocraftX.PartyGui.dll + ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.PartyGui.dll - ..\ref\Gamecraft_Data\Managed\RobocraftX.Physics.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Physics.dll + ..\ref\GamecraftPreview_Data\Managed\RobocraftX.Physics.dll + ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.Physics.dll - ..\ref\Gamecraft_Data\Managed\RobocraftX.PilotSeat.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.PilotSeat.dll + ..\ref\GamecraftPreview_Data\Managed\RobocraftX.PilotSeat.dll + ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.PilotSeat.dll - ..\ref\Gamecraft_Data\Managed\RobocraftX.Player.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Player.dll + ..\ref\GamecraftPreview_Data\Managed\RobocraftX.Player.dll + ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.Player.dll - ..\ref\Gamecraft_Data\Managed\RobocraftX.Rendering.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Rendering.dll + ..\ref\GamecraftPreview_Data\Managed\RobocraftX.Rendering.dll + ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.Rendering.dll - ..\ref\Gamecraft_Data\Managed\RobocraftX.Rendering.Mock.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Rendering.Mock.dll + ..\ref\GamecraftPreview_Data\Managed\RobocraftX.Rendering.Mock.dll + ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.Rendering.Mock.dll - ..\ref\Gamecraft_Data\Managed\RobocraftX.SaveAndLoad.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.SaveAndLoad.dll + ..\ref\GamecraftPreview_Data\Managed\RobocraftX.SaveAndLoad.dll + ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.SaveAndLoad.dll - ..\ref\Gamecraft_Data\Managed\RobocraftX.SaveGameDialog.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.SaveGameDialog.dll + ..\ref\GamecraftPreview_Data\Managed\RobocraftX.SaveGameDialog.dll + ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.SaveGameDialog.dll - ..\ref\Gamecraft_Data\Managed\RobocraftX.Serializers.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Serializers.dll + ..\ref\GamecraftPreview_Data\Managed\RobocraftX.Serializers.dll + ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.Serializers.dll - ..\ref\Gamecraft_Data\Managed\RobocraftX.Services.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Services.dll + ..\ref\GamecraftPreview_Data\Managed\RobocraftX.Services.dll + ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.Services.dll - ..\ref\Gamecraft_Data\Managed\RobocraftX.SignalHandling.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.SignalHandling.dll + ..\ref\GamecraftPreview_Data\Managed\RobocraftX.SignalHandling.dll + ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.SignalHandling.dll - ..\ref\Gamecraft_Data\Managed\RobocraftX.StateSync.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.StateSync.dll + ..\ref\GamecraftPreview_Data\Managed\RobocraftX.StateSync.dll + ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.StateSync.dll - ..\ref\Gamecraft_Data\Managed\RobocraftX_SpawnPoints.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX_SpawnPoints.dll + ..\ref\GamecraftPreview_Data\Managed\RobocraftX_SpawnPoints.dll + ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX_SpawnPoints.dll - ..\ref\Gamecraft_Data\Managed\RobocraftX_TextBlock.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX_TextBlock.dll + ..\ref\GamecraftPreview_Data\Managed\RobocraftX_TextBlock.dll + ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX_TextBlock.dll - ..\ref\Gamecraft_Data\Managed\RobocratX.SimulationCompositionRoot.dll - ..\..\ref\Gamecraft_Data\Managed\RobocratX.SimulationCompositionRoot.dll + ..\ref\GamecraftPreview_Data\Managed\RobocratX.SimulationCompositionRoot.dll + ..\..\ref\GamecraftPreview_Data\Managed\RobocratX.SimulationCompositionRoot.dll - ..\ref\Gamecraft_Data\Managed\StringFormatter.dll - ..\..\ref\Gamecraft_Data\Managed\StringFormatter.dll + ..\ref\GamecraftPreview_Data\Managed\StringFormatter.dll + ..\..\ref\GamecraftPreview_Data\Managed\StringFormatter.dll - ..\ref\Gamecraft_Data\Managed\Svelto.Common_3.dll - ..\..\ref\Gamecraft_Data\Managed\Svelto.Common_3.dll + ..\ref\GamecraftPreview_Data\Managed\Svelto.Common_3.dll + ..\..\ref\GamecraftPreview_Data\Managed\Svelto.Common_3.dll - ..\ref\Gamecraft_Data\Managed\Svelto.ECS.dll - ..\..\ref\Gamecraft_Data\Managed\Svelto.ECS.dll + ..\ref\GamecraftPreview_Data\Managed\Svelto.ECS.dll + ..\..\ref\GamecraftPreview_Data\Managed\Svelto.ECS.dll - ..\ref\Gamecraft_Data\Managed\Svelto.Services.dll - ..\..\ref\Gamecraft_Data\Managed\Svelto.Services.dll + ..\ref\GamecraftPreview_Data\Managed\Svelto.Services.dll + ..\..\ref\GamecraftPreview_Data\Managed\Svelto.Services.dll - ..\ref\Gamecraft_Data\Managed\Svelto.Tasks.dll - ..\..\ref\Gamecraft_Data\Managed\Svelto.Tasks.dll + ..\ref\GamecraftPreview_Data\Managed\Svelto.Tasks.dll + ..\..\ref\GamecraftPreview_Data\Managed\Svelto.Tasks.dll - ..\ref\Gamecraft_Data\Managed\Unity.Addressables.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Addressables.dll + ..\ref\GamecraftPreview_Data\Managed\Unity.Addressables.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.Addressables.dll + + + ..\ref\GamecraftPreview_Data\Managed\Unity.Animation.Curves.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.Animation.Curves.dll + + + ..\ref\GamecraftPreview_Data\Managed\Unity.Animation.Curves.Hybrid.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.Animation.Curves.Hybrid.dll + + + ..\ref\GamecraftPreview_Data\Managed\Unity.Animation.DefaultGraphPipeline.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.Animation.DefaultGraphPipeline.dll + + + ..\ref\GamecraftPreview_Data\Managed\Unity.Animation.DefaultGraphPipeline.Hybrid.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.Animation.DefaultGraphPipeline.Hybrid.dll + + + ..\ref\GamecraftPreview_Data\Managed\Unity.Animation.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.Animation.dll + + + ..\ref\GamecraftPreview_Data\Managed\Unity.Animation.Graph.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.Animation.Graph.dll + + + ..\ref\GamecraftPreview_Data\Managed\Unity.Animation.Hybrid.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.Animation.Hybrid.dll - ..\ref\Gamecraft_Data\Managed\Unity.Build.SlimPlayerRuntime.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Build.SlimPlayerRuntime.dll + ..\ref\GamecraftPreview_Data\Managed\Unity.Build.SlimPlayerRuntime.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.Build.SlimPlayerRuntime.dll - ..\ref\Gamecraft_Data\Managed\Unity.Burst.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Burst.dll + ..\ref\GamecraftPreview_Data\Managed\Unity.Burst.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.Burst.dll - ..\ref\Gamecraft_Data\Managed\Unity.Collections.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Collections.dll + ..\ref\GamecraftPreview_Data\Managed\Unity.Collections.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.Collections.dll + + + ..\ref\GamecraftPreview_Data\Managed\Unity.DataFlowGraph.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.DataFlowGraph.dll - ..\ref\Gamecraft_Data\Managed\Unity.Deformations.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Deformations.dll + ..\ref\GamecraftPreview_Data\Managed\Unity.Deformations.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.Deformations.dll - ..\ref\Gamecraft_Data\Managed\Unity.Entities.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Entities.dll + ..\ref\GamecraftPreview_Data\Managed\Unity.Entities.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.Entities.dll - ..\ref\Gamecraft_Data\Managed\Unity.Entities.Hybrid.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Entities.Hybrid.dll + ..\ref\GamecraftPreview_Data\Managed\Unity.Entities.Hybrid.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.Entities.Hybrid.dll - ..\ref\Gamecraft_Data\Managed\Unity.Jobs.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Jobs.dll + ..\ref\GamecraftPreview_Data\Managed\Unity.Jobs.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.Jobs.dll - ..\ref\Gamecraft_Data\Managed\Unity.Mathematics.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Mathematics.dll + ..\ref\GamecraftPreview_Data\Managed\Unity.Mathematics.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.Mathematics.dll - ..\ref\Gamecraft_Data\Managed\Unity.Mathematics.Extensions.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Mathematics.Extensions.dll + ..\ref\GamecraftPreview_Data\Managed\Unity.Mathematics.Extensions.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.Mathematics.Extensions.dll - ..\ref\Gamecraft_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll + ..\ref\GamecraftPreview_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll + + + ..\ref\GamecraftPreview_Data\Managed\Unity.MemoryProfiler.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.MemoryProfiler.dll - ..\ref\Gamecraft_Data\Managed\Unity.Physics.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Physics.dll + ..\ref\GamecraftPreview_Data\Managed\Unity.Physics.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.Physics.dll - ..\ref\Gamecraft_Data\Managed\Unity.Physics.Hybrid.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Physics.Hybrid.dll + ..\ref\GamecraftPreview_Data\Managed\Unity.Physics.Hybrid.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.Physics.Hybrid.dll - ..\ref\Gamecraft_Data\Managed\Unity.Platforms.Common.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Platforms.Common.dll + ..\ref\GamecraftPreview_Data\Managed\Unity.Platforms.Common.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.Platforms.Common.dll - ..\ref\Gamecraft_Data\Managed\Unity.Postprocessing.Runtime.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Postprocessing.Runtime.dll + ..\ref\GamecraftPreview_Data\Managed\Unity.Postprocessing.Runtime.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.Postprocessing.Runtime.dll - ..\ref\Gamecraft_Data\Managed\Unity.Properties.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Properties.dll + ..\ref\GamecraftPreview_Data\Managed\Unity.Properties.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.Properties.dll - ..\ref\Gamecraft_Data\Managed\Unity.Properties.Reflection.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Properties.Reflection.dll + ..\ref\GamecraftPreview_Data\Managed\Unity.Properties.Reflection.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.Properties.Reflection.dll - ..\ref\Gamecraft_Data\Managed\Unity.Properties.UI.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Properties.UI.dll + ..\ref\GamecraftPreview_Data\Managed\Unity.Properties.UI.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.Properties.UI.dll - ..\ref\Gamecraft_Data\Managed\Unity.RenderPipeline.Universal.ShaderLibrary.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipeline.Universal.ShaderLibrary.dll + ..\ref\GamecraftPreview_Data\Managed\Unity.RenderPipeline.Universal.ShaderLibrary.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.RenderPipeline.Universal.ShaderLibrary.dll - ..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll + ..\ref\GamecraftPreview_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll - ..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll + ..\ref\GamecraftPreview_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll - ..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll + ..\ref\GamecraftPreview_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll - ..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Universal.Runtime.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Universal.Runtime.dll + ..\ref\GamecraftPreview_Data\Managed\Unity.RenderPipelines.Universal.Runtime.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.RenderPipelines.Universal.Runtime.dll - ..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Universal.Shaders.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Universal.Shaders.dll + ..\ref\GamecraftPreview_Data\Managed\Unity.RenderPipelines.Universal.Shaders.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.RenderPipelines.Universal.Shaders.dll - ..\ref\Gamecraft_Data\Managed\Unity.ResourceManager.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.ResourceManager.dll + ..\ref\GamecraftPreview_Data\Managed\Unity.ResourceManager.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.ResourceManager.dll - ..\ref\Gamecraft_Data\Managed\Unity.Scenes.Hybrid.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Scenes.Hybrid.dll + ..\ref\GamecraftPreview_Data\Managed\Unity.Scenes.Hybrid.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.Scenes.Hybrid.dll - ..\ref\Gamecraft_Data\Managed\Unity.ScriptableBuildPipeline.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.ScriptableBuildPipeline.dll + ..\ref\GamecraftPreview_Data\Managed\Unity.ScriptableBuildPipeline.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.ScriptableBuildPipeline.dll - ..\ref\Gamecraft_Data\Managed\Unity.Serialization.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Serialization.dll + ..\ref\GamecraftPreview_Data\Managed\Unity.Serialization.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.Serialization.dll - ..\ref\Gamecraft_Data\Managed\Unity.TextMeshPro.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.TextMeshPro.dll + ..\ref\GamecraftPreview_Data\Managed\Unity.TextMeshPro.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.TextMeshPro.dll - ..\ref\Gamecraft_Data\Managed\Unity.Timeline.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Timeline.dll + ..\ref\GamecraftPreview_Data\Managed\Unity.Timeline.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.Timeline.dll - ..\ref\Gamecraft_Data\Managed\Unity.Transforms.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Transforms.dll + ..\ref\GamecraftPreview_Data\Managed\Unity.Transforms.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.Transforms.dll - ..\ref\Gamecraft_Data\Managed\Unity.Transforms.Hybrid.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Transforms.Hybrid.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.AccessibilityModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.AccessibilityModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.AIModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.AIModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.AndroidJNIModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.AndroidJNIModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.AnimationModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.AnimationModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.ARModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.ARModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.AssetBundleModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.AssetBundleModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.AudioModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.AudioModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.ClothModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.ClothModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.ClusterInputModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.ClusterInputModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.ClusterRendererModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.ClusterRendererModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.CoreModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.CoreModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.CrashReportingModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.CrashReportingModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.DirectorModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.DirectorModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.DSPGraphModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.DSPGraphModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.GameCenterModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.GameCenterModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.GridModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.GridModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.HotReloadModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.HotReloadModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.ImageConversionModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.ImageConversionModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.IMGUIModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.IMGUIModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.InputLegacyModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.InputLegacyModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.InputModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.InputModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.JSONSerializeModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.JSONSerializeModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.LocalizationModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.LocalizationModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.ParticleSystemModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.ParticleSystemModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.PerformanceReportingModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.PerformanceReportingModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.Physics2DModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.Physics2DModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.PhysicsModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.PhysicsModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.ProfilerModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.ProfilerModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.ScreenCaptureModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.ScreenCaptureModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.SharedInternalsModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.SharedInternalsModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.SpriteMaskModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.SpriteMaskModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.SpriteShapeModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.SpriteShapeModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.StreamingModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.StreamingModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.SubstanceModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.SubstanceModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.SubsystemsModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.SubsystemsModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.TerrainModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.TerrainModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.TerrainPhysicsModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.TerrainPhysicsModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.TextCoreModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.TextCoreModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.TextRenderingModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.TextRenderingModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.TilemapModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.TilemapModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.TLSModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.TLSModule.dll + ..\ref\GamecraftPreview_Data\Managed\Unity.Transforms.Hybrid.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.Transforms.Hybrid.dll - ..\ref\Gamecraft_Data\Managed\UnityEngine.UI.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UI.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.UIElementsModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UIElementsModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.UIModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UIModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.UmbraModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UmbraModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.UNETModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UNETModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.UnityAnalyticsModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UnityAnalyticsModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.UnityConnectModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UnityConnectModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.UnityTestProtocolModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UnityTestProtocolModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.UnityWebRequestModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UnityWebRequestModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.VehiclesModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.VehiclesModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.VFXModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.VFXModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.VideoModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.VideoModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.VRModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.VRModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.WindModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.WindModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.XRModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.XRModule.dll + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.UI.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.UI.dll - ..\ref\Gamecraft_Data\Managed\uREPL.dll - ..\..\ref\Gamecraft_Data\Managed\uREPL.dll + ..\ref\GamecraftPreview_Data\Managed\uREPL.dll + ..\..\ref\GamecraftPreview_Data\Managed\uREPL.dll - ..\ref\Gamecraft_Data\Managed\VisualProfiler.dll - ..\..\ref\Gamecraft_Data\Managed\VisualProfiler.dll + ..\ref\GamecraftPreview_Data\Managed\VisualProfiler.dll + ..\..\ref\GamecraftPreview_Data\Managed\VisualProfiler.dll + + + ..\ref\GamecraftPreview_Data\Managed\Accessibility.dll + ..\..\ref\GamecraftPreview_Data\Managed\Accessibility.dll + + + ..\ref\GamecraftPreview_Data\Managed\Facepunch.Steamworks.Win64.dll + ..\..\ref\GamecraftPreview_Data\Managed\Facepunch.Steamworks.Win64.dll + + + ..\ref\GamecraftPreview_Data\Managed\JWT.dll + ..\..\ref\GamecraftPreview_Data\Managed\JWT.dll + + + ..\ref\GamecraftPreview_Data\Managed\mscorlib.dll + ..\..\ref\GamecraftPreview_Data\Managed\mscorlib.dll + + + ..\ref\GamecraftPreview_Data\Managed\netstandard.dll + ..\..\ref\GamecraftPreview_Data\Managed\netstandard.dll + + + ..\ref\GamecraftPreview_Data\Managed\Newtonsoft.Json.dll + ..\..\ref\GamecraftPreview_Data\Managed\Newtonsoft.Json.dll + + + ..\ref\GamecraftPreview_Data\Managed\Novell.Directory.Ldap.dll + ..\..\ref\GamecraftPreview_Data\Managed\Novell.Directory.Ldap.dll + + + ..\ref\GamecraftPreview_Data\Managed\Rewired_Core.dll + ..\..\ref\GamecraftPreview_Data\Managed\Rewired_Core.dll + + + ..\ref\GamecraftPreview_Data\Managed\Rewired_Windows.dll + ..\..\ref\GamecraftPreview_Data\Managed\Rewired_Windows.dll + + + ..\ref\GamecraftPreview_Data\Managed\Unity.Burst.Unsafe.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.Burst.Unsafe.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.AccessibilityModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.AccessibilityModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.AIModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.AIModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.AndroidJNIModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.AndroidJNIModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.AnimationModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.AnimationModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.ARModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.ARModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.AssetBundleModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.AssetBundleModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.AudioModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.AudioModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.ClothModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.ClothModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.ClusterInputModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.ClusterInputModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.ClusterRendererModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.ClusterRendererModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.CoreModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.CoreModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.CrashReportingModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.CrashReportingModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.DirectorModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.DirectorModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.DSPGraphModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.DSPGraphModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.GameCenterModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.GameCenterModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.GridModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.GridModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.HotReloadModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.HotReloadModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.ImageConversionModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.ImageConversionModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.IMGUIModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.IMGUIModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.InputLegacyModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.InputLegacyModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.InputModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.InputModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.JSONSerializeModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.JSONSerializeModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.LocalizationModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.LocalizationModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.ParticleSystemModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.ParticleSystemModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.PerformanceReportingModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.PerformanceReportingModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.Physics2DModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.Physics2DModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.PhysicsModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.PhysicsModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.ProfilerModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.ProfilerModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.ScreenCaptureModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.ScreenCaptureModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.SharedInternalsModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.SharedInternalsModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.SpriteMaskModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.SpriteMaskModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.SpriteShapeModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.SpriteShapeModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.StreamingModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.StreamingModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.SubstanceModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.SubstanceModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.SubsystemsModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.SubsystemsModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.TerrainModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.TerrainModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.TerrainPhysicsModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.TerrainPhysicsModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.TextCoreModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.TextCoreModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.TextRenderingModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.TextRenderingModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.TilemapModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.TilemapModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.TLSModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.TLSModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.UIElementsModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.UIElementsModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.UIModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.UIModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.UmbraModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.UmbraModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.UNETModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.UNETModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.UnityAnalyticsModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.UnityAnalyticsModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.UnityConnectModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.UnityConnectModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.UnityTestProtocolModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.UnityTestProtocolModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.UnityWebRequestModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.UnityWebRequestModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.VehiclesModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.VehiclesModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.VFXModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.VFXModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.VideoModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.VideoModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.VRModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.VRModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.WindModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.WindModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.XRModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.XRModule.dll + + + ..\ref\GamecraftPreview_Data\Managed\IllusionInjector.dll + ..\..\ref\GamecraftPreview_Data\Managed\IllusionInjector.dll + + + ..\ref\GamecraftPreview_Data\Managed\IllusionPlugin.dll + ..\..\ref\GamecraftPreview_Data\Managed\IllusionPlugin.dll - + \ No newline at end of file diff --git a/GamecraftModdingAPI/Tests/TestRoot.cs b/GamecraftModdingAPI/Tests/TestRoot.cs index 4e9da73..3cb32f5 100644 --- a/GamecraftModdingAPI/Tests/TestRoot.cs +++ b/GamecraftModdingAPI/Tests/TestRoot.cs @@ -130,7 +130,7 @@ namespace GamecraftModdingAPI.Tests private static IEnumerator GoToGameTests() { - Client app = new Client(); + /*Client app = new Client(); int oldLength = 0; while (app.MyGames.Length == 0 || oldLength != app.MyGames.Length) { @@ -138,11 +138,10 @@ namespace GamecraftModdingAPI.Tests yield return new WaitForSecondsEnumerator(1).Continue(); } yield return Yield.It; - app.MyGames[0].EnterGame(); - // returning from a new game without saving will hard lock GC (it's an invalid state) - //Game newGame = Game.NewGame(); - //yield return new WaitForSecondsEnumerator(5).Continue(); // wait for sync - //newGame.EnterGame(); + app.MyGames[0].EnterGame();*/ + Game newGame = Game.NewGame(); + yield return new WaitForSecondsEnumerator(5).Continue(); // wait for sync + newGame.EnterGame(); } private static IEnumerator GameTests() -- 2.30.2 From cc4ed3e17495080c90df8d58b5cd7116fa8c0c25 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sun, 19 Jul 2020 01:13:39 +0200 Subject: [PATCH 070/252] Test fixes, block event Block property Fixed Assert.Equal() Changed tests to reflect changes Added Block property to the block event args Completely removed sync things --- GamecraftModdingAPI/Block.cs | 4 +- GamecraftModdingAPI/Blocks/BlockEngine.cs | 2 - .../Blocks/BlockEventsEngine.cs | 37 ++----------------- GamecraftModdingAPI/Blocks/BlockTests.cs | 6 +-- GamecraftModdingAPI/Blocks/PlacementEngine.cs | 1 - GamecraftModdingAPI/SimBody.cs | 2 +- GamecraftModdingAPI/Tests/Assert.cs | 24 +----------- .../Tests/GamecraftModdingAPIPluginTest.cs | 2 +- .../DeterministicStepCompositionRootPatch.cs | 25 ------------- 9 files changed, 12 insertions(+), 91 deletions(-) delete mode 100644 GamecraftModdingAPI/Utility/DeterministicStepCompositionRootPatch.cs diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index f334c30..ade9f9b 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -342,10 +342,10 @@ namespace GamecraftModdingAPI public bool Remove() => RemovalEngine.RemoveBlock(Id); /// - /// Returns the rigid body of the cluster of blocks this one belongs to during simulation. + /// Returns the rigid body of the chunk of blocks this one belongs to during simulation. /// Can be used to apply forces or move the block around while the simulation is running. /// - /// The SimBody of the cluster or null if the block doesn't exist. + /// The SimBody of the chunk or null if the block doesn't exist. public SimBody GetSimBody() { return BlockEngine.GetBlockInfo(this, diff --git a/GamecraftModdingAPI/Blocks/BlockEngine.cs b/GamecraftModdingAPI/Blocks/BlockEngine.cs index d6f4907..375620e 100644 --- a/GamecraftModdingAPI/Blocks/BlockEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlockEngine.cs @@ -25,8 +25,6 @@ namespace GamecraftModdingAPI.Blocks public bool isRemovable => false; - internal bool Synced = true; - public void Dispose() { } diff --git a/GamecraftModdingAPI/Blocks/BlockEventsEngine.cs b/GamecraftModdingAPI/Blocks/BlockEventsEngine.cs index 0a205f0..1e5ce21 100644 --- a/GamecraftModdingAPI/Blocks/BlockEventsEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlockEventsEngine.cs @@ -13,14 +13,8 @@ namespace GamecraftModdingAPI.Blocks public event EventHandler Placed; public event EventHandler Removed; - public BlockEventsEngine() - { - //Console.WriteLine("Creating BlockEventsEngine\n" + Environment.StackTrace); - } - public void Ready() { - //Console.WriteLine("BlockEventsEngine registered"); } public EntitiesDB entitiesDB { get; set; } @@ -50,37 +44,12 @@ namespace GamecraftModdingAPI.Blocks } } - /*[HarmonyPatch] - public static class TestPatch - { - public static void Postfix(FasterDictionary, FasterList> engines, - ExclusiveGroupStruct? previousGroup, in PlatformProfiler profiler, EGID egid) - { - if (!engines.TryGetValue(new RefWrapper(TypeSafeDictionary._type), out result)) - return; - } - public static MethodBase TargetMethod() - { - return AccessTools.Method("Svelto.ECS.Internal.TypeSafeDictionary:AddEntityComponentToEngines"); - } - }*/ - - /*[HarmonyPatch] - public static class TestPatch - { - public static void Postfix(EGID basePartEGID) - { - Console.WriteLine("Patched Add method: " + basePartEGID); - } - public static MethodBase TargetMethod() - { - return AccessTools.Method("RobocraftX.CR.MachineEditing.BuildBlockAdditionalPartEngine:Add"); - } - }*/ - public struct BlockPlacedRemovedEventArgs { public EGID ID; public BlockIDs Type; + private Block block; + + public Block Block => block ?? (block = new Block(ID)); } } \ No newline at end of file diff --git a/GamecraftModdingAPI/Blocks/BlockTests.cs b/GamecraftModdingAPI/Blocks/BlockTests.cs index 133db5e..3e430ea 100644 --- a/GamecraftModdingAPI/Blocks/BlockTests.cs +++ b/GamecraftModdingAPI/Blocks/BlockTests.cs @@ -20,11 +20,11 @@ namespace GamecraftModdingAPI.Blocks } [APITestCase(TestType.EditMode)] - public static void TestSync() + public static void TestInitProperty() { Block newBlock = Block.PlaceNew(BlockIDs.AluminiumCube, Unity.Mathematics.float3.zero + 2); if (!Assert.CloseTo(newBlock.Position, (Unity.Mathematics.float3.zero + 2), $"Newly placed block at {newBlock.Position} is expected at {Unity.Mathematics.float3.zero + 2}.", "Newly placed block position matches.")) return; - Assert.Equal(newBlock.Exists, true, "Newly placed block does not exist, possibly because Sync() skipped/missed/failed.", "Newly placed block exists, Sync() successful."); + //Assert.Equal(newBlock.Exists, true, "Newly placed block does not exist, possibly because Sync() skipped/missed/failed.", "Newly placed block exists, Sync() successful."); } [APITestCase(TestType.EditMode)] @@ -32,7 +32,7 @@ namespace GamecraftModdingAPI.Blocks { TextBlock textBlock = null; // Note: the assignment operation is a lambda, which slightly confuses the compiler Assert.Errorless(() => { textBlock = Block.PlaceNew(BlockIDs.TextBlock, Unity.Mathematics.float3.zero + 1); }, "Block.PlaceNew() raised an exception: ", "Block.PlaceNew() completed without issue."); - if (!Assert.NotNull(textBlock, "Block.Specialize() returned null, possibly because it failed silently.", "Specialized TextBlock is not null.")) return; + if (!Assert.NotNull(textBlock, "Block.PlaceNew() returned null, possibly because it failed silently.", "Specialized TextBlock is not null.")) return; if (!Assert.NotNull(textBlock.Text, "TextBlock.Text is null, possibly because it failed silently.", "TextBlock.Text is not null.")) return; if (!Assert.NotNull(textBlock.TextBlockId, "TextBlock.TextBlockId is null, possibly because it failed silently.", "TextBlock.TextBlockId is not null.")) return; } diff --git a/GamecraftModdingAPI/Blocks/PlacementEngine.cs b/GamecraftModdingAPI/Blocks/PlacementEngine.cs index 61834b0..e111598 100644 --- a/GamecraftModdingAPI/Blocks/PlacementEngine.cs +++ b/GamecraftModdingAPI/Blocks/PlacementEngine.cs @@ -107,7 +107,6 @@ namespace GamecraftModdingAPI.Blocks ref PickedBlockExtraDataStruct pickedBlock = ref entitiesDB.QueryEntity(playerEGID); pickedBlock.placedBlockEntityID = structInitializer.EGID; pickedBlock.placedBlockWasAPickedBlock = false; - Block.BlockEngine.Synced = false; // Block entities will need to be submitted before properties can be used return structInitializer; } diff --git a/GamecraftModdingAPI/SimBody.cs b/GamecraftModdingAPI/SimBody.cs index 420a655..19f4285 100644 --- a/GamecraftModdingAPI/SimBody.cs +++ b/GamecraftModdingAPI/SimBody.cs @@ -9,7 +9,7 @@ using RobocraftX.Physics; namespace GamecraftModdingAPI { /// - /// A rigid body (like a cluster of connected blocks) during simulation. + /// A rigid body (like a chunk of connected blocks) during simulation. /// public class SimBody : IEquatable, IEquatable { diff --git a/GamecraftModdingAPI/Tests/Assert.cs b/GamecraftModdingAPI/Tests/Assert.cs index eec9c5c..78f0597 100644 --- a/GamecraftModdingAPI/Tests/Assert.cs +++ b/GamecraftModdingAPI/Tests/Assert.cs @@ -83,32 +83,12 @@ namespace GamecraftModdingAPI.Tests { if (err == null) err = $"{nameof(T)} '{obj1}' is not equal to '{obj2}'."; if (success == null) success = $"{nameof(T)} '{obj1}' is equal to '{obj2}'."; - if (obj1 == null && obj2 == null) + if ((obj1 == null && obj2 == null) + || (obj1 != null && obj2 != null && obj1.Equals(obj2) && obj2.Equals(obj1))) { // pass Log(PASS + success); TestRoot.TestsPassed = true; - return true; - } - else if (!(obj1 == null && obj2 == null) && obj1.Equals(obj2) && obj2.Equals(obj1)) - { - // pass - Log(PASS + success); - TestRoot.TestsPassed = true; - return true; - } - else if (obj1 != null && (obj1 != null && !obj1.Equals(obj2))) - { - // pass - Log(PASS + success); - TestRoot.TestsPassed = true; - return true; - } - else if (obj2 != null && !obj2.Equals(obj1)) - { - // pass - Log(PASS + success); - TestRoot.TestsPassed = true; return true; } else diff --git a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs index d5cf714..d8b50fa 100644 --- a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs +++ b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs @@ -234,7 +234,7 @@ namespace GamecraftModdingAPI.Tests CommandBuilder.Builder() .Name("PlaceConsole") - .Description("Place a bunch of console block with a given text") + .Description("Place a bunch of console block with a given text - entering simulation with them crashes the game as the cmd doesn't exist") .Action((float x, float y, float z) => { Stopwatch sw = new Stopwatch(); diff --git a/GamecraftModdingAPI/Utility/DeterministicStepCompositionRootPatch.cs b/GamecraftModdingAPI/Utility/DeterministicStepCompositionRootPatch.cs deleted file mode 100644 index 9cabbe0..0000000 --- a/GamecraftModdingAPI/Utility/DeterministicStepCompositionRootPatch.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; - -using RobocraftX.StateSync; -using Svelto.ECS; - -using HarmonyLib; - -namespace GamecraftModdingAPI.Utility -{ - [HarmonyPatch(typeof(DeterministicStepCompositionRoot), "ResetWorld")] - public static class DeterministicStepCompositionRootPatch - { - private static SimpleEntitiesSubmissionScheduler engineRootScheduler; - public static void Postfix(SimpleEntitiesSubmissionScheduler scheduler) - { - engineRootScheduler = scheduler; - } - - internal static void SubmitEntitiesNow() - { - if (engineRootScheduler != null) - engineRootScheduler.SubmitEntities(); - } - } -} -- 2.30.2 From 16521ab7eb26ecca2f26cabc671adcd90228a2a0 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sun, 19 Jul 2020 01:42:32 +0200 Subject: [PATCH 071/252] Remove initializer data once the block is placed --- GamecraftModdingAPI/Block.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index ade9f9b..dc3fe19 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -82,6 +82,7 @@ namespace GamecraftModdingAPI position, uscale, scale, player, rotation, out var initializer); var bl = New(egid.entityID, egid.groupID); bl.InitData.Group = BlockEngine.InitGroup(initializer); + Placed += bl.OnPlacedInit; return bl; } @@ -352,6 +353,13 @@ namespace GamecraftModdingAPI (GridConnectionsEntityStruct st) => new SimBody(st.machineRigidBodyId)); } + private void OnPlacedInit(object sender, BlockPlacedRemovedEventArgs e) + { //Member method instead of lambda to avoid constantly creating delegates + if (e.ID != Id) return; + Placed -= OnPlacedInit; //And we can reference it + InitData = default; //Remove initializer as it's no longer valid - if the block gets removed it shouldn't be used again + } + public override string ToString() { return $"{nameof(Id)}: {Id}, {nameof(Position)}: {Position}, {nameof(Type)}: {Type}, {nameof(Color)}: {Color}, {nameof(Exists)}: {Exists}"; -- 2.30.2 From 4a9ceecc292e5bfcab9e4b40b38291703bfe0abb Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Sun, 19 Jul 2020 12:43:06 -0400 Subject: [PATCH 072/252] Improve dev info in README --- README.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1955de0..fd3bf5a 100644 --- a/README.md +++ b/README.md @@ -10,10 +10,16 @@ This means your code won't break when the GamecraftModdingAPI or Gamecraft updat For more info, please check out the [official documentation](https://mod.exmods.org). -For more support, join the ExMods [Discord](https://discord.gg/xjnFxQV). +For more support, join the ExMods [Discord](https://discord.exmods.org). ## Installation -[Please follow the official mod installation guide](https://www.exmods.org/guides/install.html) +[Please follow the official mod installation guide](https://www.exmods.org/guides/install.html) or use GCMM. + +## Development +To get started, create a symbolic link called `ref` in the root of the project, or one folder higher, linking to the Gamecraft install folder. +This will allow your IDE to resolve references to Gamecraft files for building and IDE tools. + +GamecraftModdingAPI version numbers follow the [Semantic Versioning guidelines](https://semver.org/). ## External Libraries GamecraftModdingAPI includes [Harmony](https://github.com/pardeike/Harmony) to modify the behaviour of existing Gamecraft code. @@ -21,4 +27,5 @@ GamecraftModdingAPI includes [Harmony](https://github.com/pardeike/Harmony) to m # Disclaimer This API is an unofficial modification of Gamecraft software, and is not endorsed or supported by FreeJam or Gamecraft. The GamecraftModdingAPI developer(s) claim no rights on the Gamecraft code referenced within this project. +All code contained in this project is licensed under the [GNU Public License v3](https://git.exmods.org/modtainers/GamecraftModdingAPI/src/branch/master/LICENSE). -- 2.30.2 From cda57afade2745eebd77cb664e98cbbf55d35824 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Sun, 19 Jul 2020 16:39:35 -0400 Subject: [PATCH 073/252] Add sfx block support --- GamecraftModdingAPI/Blocks/BlockTests.cs | 18 +++ GamecraftModdingAPI/Blocks/MusicBlock.cs | 157 +++++++++++++++++++++++ GamecraftModdingAPI/Tests/TestRoot.cs | 8 +- 3 files changed, 179 insertions(+), 4 deletions(-) create mode 100644 GamecraftModdingAPI/Blocks/MusicBlock.cs diff --git a/GamecraftModdingAPI/Blocks/BlockTests.cs b/GamecraftModdingAPI/Blocks/BlockTests.cs index 418fa43..ed42024 100644 --- a/GamecraftModdingAPI/Blocks/BlockTests.cs +++ b/GamecraftModdingAPI/Blocks/BlockTests.cs @@ -1,5 +1,7 @@ using System; +using Gamecraft.Wires; + using GamecraftModdingAPI; using GamecraftModdingAPI.Tests; @@ -72,6 +74,22 @@ namespace GamecraftModdingAPI.Blocks if (!Assert.CloseTo(b.MinimumAngle, -180f, $"Servo.MinimumAngle {b.MinimumAngle} does not equal default value, possibly because it failed silently.", "Servo.MinimumAngle is close enough to default.")) return; if (!Assert.CloseTo(b.MaximumForce, 750f, $"Servo.MaximumForce {b.MaximumForce} does not equal default value, possibly because it failed silently.", "Servo.MaximumForce is close enough to default.")) return; } + + [APITestCase(TestType.EditMode)] + public static void TestMusicBlock() + { + Block newBlock = Block.PlaceNew(BlockIDs.MusicBlock, Unity.Mathematics.float3.zero + 2); + MusicBlock b = null; // Note: the assignment operation is a lambda, which slightly confuses the compiler + Assert.Errorless(() => { b = newBlock.Specialise(); }, "Block.Specialize() raised an exception: ", "Block.Specialize() completed without issue."); + if (!Assert.NotNull(b, "Block.Specialize() returned null, possibly because it failed silently.", "Specialized MusicBlock is not null.")) return; + if (!Assert.CloseTo(b.Volume, 100f, $"MusicBlock.Volume {b.Volume} does not equal default value, possibly because it failed silently.", "MusicBlock.Volume is close enough to default.")) return; + if (!Assert.Equal(b.TrackIndex, 0, $"MusicBlock.TrackIndex {b.TrackIndex} does not equal default value, possibly because it failed silently.", "MusicBlock.TrackIndex is equal to default.")) return; + b.IsPlaying = true; // play sfx + if (!Assert.Equal(b.IsPlaying, true, $"MusicBlock.IsPlaying {b.IsPlaying} does not equal default value, possibly because it failed silently.", "MusicBlock.IsPlaying is set properly.")) return; + if (!Assert.Equal(b.ChannelType, ChannelType.Character, $"MusicBlock.ChannelType {b.ChannelType} does not equal default value, possibly because it failed silently.", "MusicBlock.ChannelType is equal to default.")) return; + //Assert.Log(b.Track.ToString()); + if (!Assert.Equal(b.Track.ToString(), new Guid("3237ff8f-f5f2-4f84-8144-496ca280f8c0").ToString(), $"MusicBlock.Track {b.Track} does not equal default value, possibly because it failed silently.", "MusicBlock.Track is equal to default.")) return; + } } #endif } diff --git a/GamecraftModdingAPI/Blocks/MusicBlock.cs b/GamecraftModdingAPI/Blocks/MusicBlock.cs new file mode 100644 index 0000000..a7f862e --- /dev/null +++ b/GamecraftModdingAPI/Blocks/MusicBlock.cs @@ -0,0 +1,157 @@ +using System; + +using FMOD.Studio; +using FMODUnity; +using Gamecraft.Wires; +using RobocraftX.Blocks; +using Svelto.ECS; +using Unity.Mathematics; + +using GamecraftModdingAPI; +using GamecraftModdingAPI.Utility; + +namespace GamecraftModdingAPI.Blocks +{ + public class MusicBlock : Block + { + public static MusicBlock PlaceNew(float3 position, + float3 rotation = default, BlockColors color = BlockColors.Default, byte darkness = 0, + int uscale = 1, float3 scale = default, Player player = null) + { + if (PlacementEngine.IsInGame && GameState.IsBuildMode()) + { + EGID id = PlacementEngine.PlaceBlock(BlockIDs.MusicBlock, color, darkness, + position, uscale, scale, player, rotation); + return new MusicBlock(id); + } + + return null; + } + + public MusicBlock(EGID id) : base(id) + { + if (!BlockEngine.GetBlockInfoExists(this.Id)) + { + throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); + } + } + + public MusicBlock(uint id) : base(id) + { + if (!BlockEngine.GetBlockInfoExists(this.Id)) + { + throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); + } + } + + public byte TrackIndex + { + get + { + return BlockEngine.GetBlockInfo(Id).trackIndx; + } + + set + { + ref MusicBlockDataEntityStruct msdes = ref BlockEngine.GetBlockInfo(Id); + msdes.trackIndx = value; + } + } + + public Guid Track + { + get + { + ref MusicBlockDataEntityStruct msdes = ref BlockEngine.GetBlockInfo(Id); + return msdes.fmod2DEventPaths.Get(msdes.trackIndx); + } + + set + { + ref MusicBlockDataEntityStruct msdes = ref BlockEngine.GetBlockInfo(Id); + for (byte i = 0; i < msdes.fmod2DEventPaths.Count(); i++) + { + Guid track = msdes.fmod2DEventPaths.Get(i); + if (track == value) + { + msdes.trackIndx = i; + break; + } + } + } + } + + public Guid[] Tracks + { + get + { + ref MusicBlockDataEntityStruct msdes = ref BlockEngine.GetBlockInfo(Id); + Guid[] tracks = new Guid[msdes.fmod2DEventPaths.Count()]; + for (byte i = 0; i < tracks.Length; i++) + { + tracks[i] = msdes.fmod2DEventPaths.Get(i); + } + return tracks; + } + } + + public float Volume + { + get + { + return BlockEngine.GetBlockInfo(Id).tweakableVolume; + } + + set + { + ref MusicBlockDataEntityStruct msdes = ref BlockEngine.GetBlockInfo(Id); + msdes.tweakableVolume = value; + } + } + + public ChannelType ChannelType + { + get + { + return (ChannelType)BlockEngine.GetBlockInfo(Id).channelType; + } + + set + { + ref MusicBlockDataEntityStruct msdes = ref BlockEngine.GetBlockInfo(Id); + msdes.channelType = (byte)value; + } + } + + public bool IsPlaying + { + get + { + return BlockEngine.GetBlockInfo(Id).isPlaying; + } + + set + { + ref MusicBlockDataEntityStruct msdes = ref BlockEngine.GetBlockInfo(Id); + if (msdes.isPlaying == value) return; + if (value) + { + // start playing + EventInstance inst = RuntimeManager.CreateInstance(msdes.fmod2DEventPaths.Get(msdes.trackIndx)); + inst.setVolume(msdes.tweakableVolume / 100f); + inst.start(); + msdes.eventHandle = inst.handle; + } + else + { + // stop playing + EventInstance inst = default(EventInstance); + inst.handle = msdes.eventHandle; + inst.stop(FMOD.Studio.STOP_MODE.ALLOWFADEOUT); + inst.release(); + } + msdes.isPlaying = value; + } + } + } +} \ No newline at end of file diff --git a/GamecraftModdingAPI/Tests/TestRoot.cs b/GamecraftModdingAPI/Tests/TestRoot.cs index 3cb32f5..f39169e 100644 --- a/GamecraftModdingAPI/Tests/TestRoot.cs +++ b/GamecraftModdingAPI/Tests/TestRoot.cs @@ -130,7 +130,7 @@ namespace GamecraftModdingAPI.Tests private static IEnumerator GoToGameTests() { - /*Client app = new Client(); + Client app = new Client(); int oldLength = 0; while (app.MyGames.Length == 0 || oldLength != app.MyGames.Length) { @@ -138,10 +138,10 @@ namespace GamecraftModdingAPI.Tests yield return new WaitForSecondsEnumerator(1).Continue(); } yield return Yield.It; - app.MyGames[0].EnterGame();*/ - Game newGame = Game.NewGame(); + app.MyGames[0].EnterGame(); + /*Game newGame = Game.NewGame(); yield return new WaitForSecondsEnumerator(5).Continue(); // wait for sync - newGame.EnterGame(); + newGame.EnterGame();*/ } private static IEnumerator GameTests() -- 2.30.2 From 9e47bbcd9ad578627a69d0b1f96582603091a4a2 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Sun, 19 Jul 2020 20:05:01 -0400 Subject: [PATCH 074/252] Add popup UI method to Client --- GamecraftModdingAPI/App/Client.cs | 77 ++++++++++++++++++++++ GamecraftModdingAPI/App/ClientAlertTest.cs | 59 +++++++++++++++++ GamecraftModdingAPI/App/UserPrompts.cs | 27 ++++++++ 3 files changed, 163 insertions(+) create mode 100644 GamecraftModdingAPI/App/ClientAlertTest.cs create mode 100644 GamecraftModdingAPI/App/UserPrompts.cs diff --git a/GamecraftModdingAPI/App/Client.cs b/GamecraftModdingAPI/App/Client.cs index fbe960e..ca5dcfa 100644 --- a/GamecraftModdingAPI/App/Client.cs +++ b/GamecraftModdingAPI/App/Client.cs @@ -1,8 +1,12 @@ using System; +using System.Reflection; +using HarmonyLib; +using RobocraftX.Services; using UnityEngine; using GamecraftModdingAPI.Utility; +using RobocraftX.Common; namespace GamecraftModdingAPI.App { @@ -14,6 +18,12 @@ namespace GamecraftModdingAPI.App // extensible engine protected static AppEngine appEngine = new AppEngine(); + protected static Func ErrorHandlerInstanceGetter; + + protected static Action EnqueueError; + + protected static Action HandleErrorClosed; + /// /// An event that fires whenever the main menu is loaded. /// @@ -74,9 +84,76 @@ namespace GamecraftModdingAPI.App get => appEngine.IsInMenu; } + /// + /// Open a popup which prompts the user to click a button. + /// This reuses Gamecraft's error dialog popup + /// + /// The popup to display. Use an instance of SingleChoicePrompt or DualChoicePrompt. + public void PromptUser(Error popup) + { + // if the stuff wasn't mostly set to internal, this would be written as: + // RobocraftX.Services.ErrorHandler.Instance.EqueueError(error); + object errorHandlerInstance = ErrorHandlerInstanceGetter(); + EnqueueError(errorHandlerInstance, popup); + } + + // TODO + /*public void CloseCurrentPrompt() + { + // RobocraftX.Services.ErrorHandler.Instance.HandlePopupClosed(); + // FIXME: this is a call that is also called when closing, not the actual closing action itself (so it doesn't work) + object errorHandlerInstance = ErrorHandlerInstanceGetter(); + HandleErrorClosed(errorHandlerInstance); + }*/ + internal static void Init() { + // this would have been so much simpler if this didn't involve a bunch of internal fields & classes + Type errorHandler = AccessTools.TypeByName("RobocraftX.Services.ErrorHandler"); + Type errorHandle = AccessTools.TypeByName("RobocraftX.Services.ErrorHandle"); + ErrorHandlerInstanceGetter = (Func) AccessTools.Method("GamecraftModdingAPI.App.Client:GenInstanceGetter") + .MakeGenericMethod(errorHandler) + .Invoke(null, new object[0]); + EnqueueError = (Action) AccessTools.Method("GamecraftModdingAPI.App.Client:GenEnqueueError") + .MakeGenericMethod(errorHandler, errorHandle) + .Invoke(null, new object[0]); + /*HandleErrorClosed = (Action) AccessTools.Method("GamecraftModdingAPI.App.Client:GenHandlePopupClosed") + .MakeGenericMethod(errorHandler) + .Invoke(null, new object[0]);*/ + // register engines MenuEngineManager.AddMenuEngine(appEngine); } + + // Creating delegates once is faster than reflection every time + // Admittedly, this way is more difficult to code and less readable + private static Func GenInstanceGetter() + { + Type errorHandler = AccessTools.TypeByName("RobocraftX.Services.ErrorHandler"); + MethodInfo instance = AccessTools.PropertyGetter(errorHandler, "Instance"); + Func getterSimple = (Func) Delegate.CreateDelegate(typeof(Func), null, instance); + Func getterCasted = () => (object) getterSimple(); + return getterCasted; + } + + private static Action GenEnqueueError() + { + Type errorHandler = AccessTools.TypeByName("RobocraftX.Services.ErrorHandler"); + MethodInfo enqueueError = AccessTools.Method(errorHandler, "EnqueueError"); + Func enqueueSimple = + (Func) Delegate.CreateDelegate(typeof(Func), enqueueError); + Action enqueueCasted = + (object instance, Error error) => { enqueueSimple((T) instance, error); }; + return enqueueCasted; + } + + private static Action GenHandlePopupClosed() + { + Type errorHandler = AccessTools.TypeByName("RobocraftX.Services.ErrorHandler"); + MethodInfo handlePopupClosed = AccessTools.Method(errorHandler, "HandlePopupClosed"); + Action handleSimple = + (Action) Delegate.CreateDelegate(typeof(Action), handlePopupClosed); + Action handleCasted = (object instance) => handleSimple((T) instance); + return handleCasted; + } } } diff --git a/GamecraftModdingAPI/App/ClientAlertTest.cs b/GamecraftModdingAPI/App/ClientAlertTest.cs new file mode 100644 index 0000000..23ced76 --- /dev/null +++ b/GamecraftModdingAPI/App/ClientAlertTest.cs @@ -0,0 +1,59 @@ +using System; +using HarmonyLib; + +using RobocraftX.Services; + +using GamecraftModdingAPI.Tests; + +namespace GamecraftModdingAPI.App +{ +#if TEST + /// + /// Client popups tests. + /// Only available in TEST builds. + /// + [APITestClass] + public static class ClientAlertTest + { + private static DualChoicePrompt popup2 = null; + + private static SingleChoicePrompt popup1 = null; + + [APITestStartUp] + public static void StartUp2() + { + popup2 = new DualChoicePrompt("This is a test double-button popup", + "The cake is a lie", + "lmao", + () => { }, + "kek", + () => { }); + } + + [APITestStartUp] + public static void StartUp1() + { + popup1 = new SingleChoicePrompt("The cake is a lie", + "This is a test single-button popup", + "qwertyuiop", + () => { }); + } + + [APITestCase(TestType.Menu)] + public static void TestPopUp2() + { + Client c = new Client(); + c.PromptUser(popup2); + //c.CloseCurrentPrompt(); + } + + [APITestCase(TestType.Menu)] + public static void TestPopUp1() + { + Client c = new Client(); + c.PromptUser(popup1); + //c.CloseCurrentPrompt(); + } + } +#endif +} \ No newline at end of file diff --git a/GamecraftModdingAPI/App/UserPrompts.cs b/GamecraftModdingAPI/App/UserPrompts.cs new file mode 100644 index 0000000..26a9395 --- /dev/null +++ b/GamecraftModdingAPI/App/UserPrompts.cs @@ -0,0 +1,27 @@ +using System; +using HarmonyLib; + +using RobocraftX.Services; + +namespace GamecraftModdingAPI.App +{ + public class DualChoicePrompt : MultiChoiceError + { + public DualChoicePrompt(string errorMessage, string title, string firstButtonText, Action firstButtonAction, string secondButtonText, Action secondButtonAction) : base(errorMessage, firstButtonText, firstButtonAction, secondButtonText, secondButtonAction) + { + // internal readonly field smh + new Traverse(this).Field("Title").Value = title; + } + } + + public class SingleChoicePrompt : SingleChoiceError + { + public SingleChoicePrompt(string errorMessage, string buttonText, Action buttonClickAction) : base(errorMessage, buttonText, buttonClickAction) + { + } + + public SingleChoicePrompt(string titleText, string errorMessage, string buttonText, Action buttonClickAction) : base(titleText, errorMessage, buttonText, buttonClickAction) + { + } + } +} \ No newline at end of file -- 2.30.2 From 3f2139d5921993a5ee98e4146817220109f5ea6b Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Tue, 21 Jul 2020 00:19:30 +0200 Subject: [PATCH 075/252] Add some info and prev. value for setters --- GamecraftModdingAPI/Block.cs | 18 ++++++++++++++++-- GamecraftModdingAPI/Blocks/BlockEngine.cs | 5 +++-- GamecraftModdingAPI/Blocks/BlockEngineInit.cs | 6 ++++++ 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index dc3fe19..5f30a64 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -137,6 +137,16 @@ namespace GamecraftModdingAPI {typeof(Timer), new[] {CommonExclusiveGroups.BUILD_TIMER_BLOCK_GROUP}} }; + /// + /// Constructs a new instance of T with the given ID and group using dynamically created delegates. + /// It's equivalent to new T(EGID) with a minimal overhead thanks to caching the created delegates. + /// + /// The block ID + /// The block group + /// The block's type or Block itself + /// An instance of the provided type + /// The block group doesn't match or cannot be found + /// The block class doesn't have the needed constructor private static T New(uint id, ExclusiveGroupStruct? group = null) where T : Block { var type = typeof(T); @@ -175,8 +185,8 @@ namespace GamecraftModdingAPI il.DeclareLocal(type); il.Emit(OpCodes.Ldarg_0); //Load EGID and pass to constructor il.Emit(OpCodes.Newobj, ctor); //Call constructor - il.Emit(OpCodes.Stloc_0); - il.Emit(OpCodes.Ldloc_0); + //il.Emit(OpCodes.Stloc_0); - doesn't seem like we need these + //il.Emit(OpCodes.Ldloc_0); il.Emit(OpCodes.Ret); func = (Func) dynamic.CreateDelegate(typeof(Func)); @@ -188,6 +198,9 @@ namespace GamecraftModdingAPI public Block(EGID id) { Id = id; + if (typeToGroup.TryGetValue(GetType(), out var groups) && groups.All(gr => gr != id.groupID)) + throw new BlockTypeException("The block has the wrong group! The type is " + GetType() + + " while the group is " + id.groupID); } /// @@ -328,6 +341,7 @@ namespace GamecraftModdingAPI /// /// Whether the block exists. The other properties will return a default value if the block doesn't exist. + /// If the block was just placed, then this will also return false but the properties will work correctly. /// public bool Exists => BlockEngine.BlockExists(Id); diff --git a/GamecraftModdingAPI/Blocks/BlockEngine.cs b/GamecraftModdingAPI/Blocks/BlockEngine.cs index 375620e..f97e405 100644 --- a/GamecraftModdingAPI/Blocks/BlockEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlockEngine.cs @@ -85,10 +85,11 @@ namespace GamecraftModdingAPI.Blocks { if (entitiesDB.Exists(block.Id)) setter(ref entitiesDB.QueryEntity(block.Id), value); - if (block.InitData.Group != null) + else if (block.InitData.Group != null) { var initializer = new EntityComponentInitializer(block.Id, block.InitData.Group); - ref T structRef = ref (new T[1])[0]; //A reference for a default value for struct + T component = initializer.Has() ? initializer.Get() : default; + ref T structRef = ref component; setter(ref structRef, value); initializer.Init(structRef); } diff --git a/GamecraftModdingAPI/Blocks/BlockEngineInit.cs b/GamecraftModdingAPI/Blocks/BlockEngineInit.cs index 4be9a98..70f713a 100644 --- a/GamecraftModdingAPI/Blocks/BlockEngineInit.cs +++ b/GamecraftModdingAPI/Blocks/BlockEngineInit.cs @@ -9,6 +9,9 @@ namespace GamecraftModdingAPI.Blocks { public partial class BlockEngine { + /// + /// Holds information needed to construct a component initializer + /// internal struct BlockInitData { public FasterDictionary, ITypeSafeDictionary> Group; @@ -17,6 +20,9 @@ namespace GamecraftModdingAPI.Blocks internal delegate FasterDictionary, ITypeSafeDictionary> GetInitGroup( EntityComponentInitializer initializer); + /// + /// Accesses the group field of the initializer + /// internal GetInitGroup InitGroup = CreateAccessor("_group"); //https://stackoverflow.com/questions/55878525/unit-testing-ref-structs-with-private-fields-via-reflection -- 2.30.2 From 47126d2d799fca78f13fff3cf250d0884a87befb Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Tue, 21 Jul 2020 02:36:11 +0200 Subject: [PATCH 076/252] Update music block and attempt to fix test --- GamecraftModdingAPI/Block.cs | 15 ++- GamecraftModdingAPI/Blocks/BlockTests.cs | 17 +++- GamecraftModdingAPI/Blocks/MusicBlock.cs | 123 +++++++++++------------ 3 files changed, 81 insertions(+), 74 deletions(-) diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index 5f30a64..2f9a901 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -29,7 +29,7 @@ namespace GamecraftModdingAPI protected static readonly SignalEngine SignalEngine = new SignalEngine(); protected static readonly BlockEventsEngine BlockEventsEngine = new BlockEventsEngine(); protected static readonly ScalingEngine ScalingEngine = new ScalingEngine(); - + protected internal static readonly BlockEngine BlockEngine = new BlockEngine(); /// @@ -123,6 +123,7 @@ namespace GamecraftModdingAPI { {typeof(ConsoleBlock), new[] {CommonExclusiveGroups.BUILD_CONSOLE_BLOCK_GROUP}}, {typeof(Motor), new[] {CommonExclusiveGroups.BUILD_MOTOR_BLOCK_GROUP}}, + {typeof(MusicBlock), new[] {CommonExclusiveGroups.BUILD_MUSIC_BLOCK_GROUP}}, {typeof(Piston), new[] {CommonExclusiveGroups.BUILD_PISTON_BLOCK_GROUP}}, {typeof(Servo), new[] {CommonExclusiveGroups.BUILD_SERVO_BLOCK_GROUP}}, { @@ -198,9 +199,15 @@ namespace GamecraftModdingAPI public Block(EGID id) { Id = id; - if (typeToGroup.TryGetValue(GetType(), out var groups) && groups.All(gr => gr != id.groupID)) - throw new BlockTypeException("The block has the wrong group! The type is " + GetType() + - " while the group is " + id.groupID); + var type = GetType(); + if (typeToGroup.TryGetValue(type, out var groups)) + { + if (groups.All(gr => gr != id.groupID)) + throw new BlockTypeException("The block has the wrong group! The type is " + GetType() + + " while the group is " + id.groupID); + } + else if (type != typeof(Block)) + Logging.LogWarning($"Unknown block type! Add {type} to the dictionary."); } /// diff --git a/GamecraftModdingAPI/Blocks/BlockTests.cs b/GamecraftModdingAPI/Blocks/BlockTests.cs index 85328d2..6186a1d 100644 --- a/GamecraftModdingAPI/Blocks/BlockTests.cs +++ b/GamecraftModdingAPI/Blocks/BlockTests.cs @@ -74,8 +74,8 @@ namespace GamecraftModdingAPI.Blocks if (!Assert.CloseTo(b.MaximumForce, 750f, $"Servo.MaximumForce {b.MaximumForce} does not equal default value, possibly because it failed silently.", "Servo.MaximumForce is close enough to default.")) return; } - [APITestCase(TestType.EditMode)] - public static void TestMusicBlock() + [APITestCase(TestType.Game)] + public static void TestMusicBlock1() { Block newBlock = Block.PlaceNew(BlockIDs.MusicBlock, Unity.Mathematics.float3.zero + 2); MusicBlock b = null; // Note: the assignment operation is a lambda, which slightly confuses the compiler @@ -83,8 +83,19 @@ namespace GamecraftModdingAPI.Blocks if (!Assert.NotNull(b, "Block.Specialize() returned null, possibly because it failed silently.", "Specialized MusicBlock is not null.")) return; if (!Assert.CloseTo(b.Volume, 100f, $"MusicBlock.Volume {b.Volume} does not equal default value, possibly because it failed silently.", "MusicBlock.Volume is close enough to default.")) return; if (!Assert.Equal(b.TrackIndex, 0, $"MusicBlock.TrackIndex {b.TrackIndex} does not equal default value, possibly because it failed silently.", "MusicBlock.TrackIndex is equal to default.")) return; + _musicBlock = b; + } + + private static MusicBlock _musicBlock; + + [APITestCase(TestType.EditMode)] + public static void TestMusicBlock2() + { + //Block newBlock = Block.GetLastPlacedBlock(); + var b = _musicBlock; + if (!Assert.NotNull(b, "Block.Specialize() returned null, possibly because it failed silently.", "Specialized MusicBlock is not null.")) return; b.IsPlaying = true; // play sfx - if (!Assert.Equal(b.IsPlaying, true, $"MusicBlock.IsPlaying {b.IsPlaying} does not equal default value, possibly because it failed silently.", "MusicBlock.IsPlaying is set properly.")) return; + if (!Assert.Equal(b.IsPlaying, true, $"MusicBlock.IsPlaying {b.IsPlaying} does not equal true, possibly because it failed silently.", "MusicBlock.IsPlaying is set properly.")) return; if (!Assert.Equal(b.ChannelType, ChannelType.Character, $"MusicBlock.ChannelType {b.ChannelType} does not equal default value, possibly because it failed silently.", "MusicBlock.ChannelType is equal to default.")) return; //Assert.Log(b.Track.ToString()); if (!Assert.Equal(b.Track.ToString(), new Guid("3237ff8f-f5f2-4f84-8144-496ca280f8c0").ToString(), $"MusicBlock.Track {b.Track} does not equal default value, possibly because it failed silently.", "MusicBlock.Track is equal to default.")) return; diff --git a/GamecraftModdingAPI/Blocks/MusicBlock.cs b/GamecraftModdingAPI/Blocks/MusicBlock.cs index a7f862e..2128a45 100644 --- a/GamecraftModdingAPI/Blocks/MusicBlock.cs +++ b/GamecraftModdingAPI/Blocks/MusicBlock.cs @@ -3,58 +3,38 @@ using System; using FMOD.Studio; using FMODUnity; using Gamecraft.Wires; +using RobocraftX.Common; using RobocraftX.Blocks; using Svelto.ECS; using Unity.Mathematics; using GamecraftModdingAPI; +using GamecraftModdingAPI.Tests; using GamecraftModdingAPI.Utility; namespace GamecraftModdingAPI.Blocks { public class MusicBlock : Block { - public static MusicBlock PlaceNew(float3 position, - float3 rotation = default, BlockColors color = BlockColors.Default, byte darkness = 0, - int uscale = 1, float3 scale = default, Player player = null) - { - if (PlacementEngine.IsInGame && GameState.IsBuildMode()) - { - EGID id = PlacementEngine.PlaceBlock(BlockIDs.MusicBlock, color, darkness, - position, uscale, scale, player, rotation); - return new MusicBlock(id); - } - - return null; - } - public MusicBlock(EGID id) : base(id) { - if (!BlockEngine.GetBlockInfoExists(this.Id)) - { - throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); - } } - public MusicBlock(uint id) : base(id) + public MusicBlock(uint id) : base(new EGID(id, CommonExclusiveGroups.BUILD_MUSIC_BLOCK_GROUP)) { - if (!BlockEngine.GetBlockInfoExists(this.Id)) - { - throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); - } } public byte TrackIndex { get { - return BlockEngine.GetBlockInfo(Id).trackIndx; + return BlockEngine.GetBlockInfo(this, (MusicBlockDataEntityStruct st) => st.trackIndx); } set { - ref MusicBlockDataEntityStruct msdes = ref BlockEngine.GetBlockInfo(Id); - msdes.trackIndx = value; + BlockEngine.SetBlockInfo(this, + (ref MusicBlockDataEntityStruct msdes, byte val) => msdes.trackIndx = val, value); } } @@ -62,22 +42,24 @@ namespace GamecraftModdingAPI.Blocks { get { - ref MusicBlockDataEntityStruct msdes = ref BlockEngine.GetBlockInfo(Id); - return msdes.fmod2DEventPaths.Get(msdes.trackIndx); + return BlockEngine.GetBlockInfo(this, + (MusicBlockDataEntityStruct msdes) => msdes.fmod2DEventPaths.Get(msdes.trackIndx)); } set { - ref MusicBlockDataEntityStruct msdes = ref BlockEngine.GetBlockInfo(Id); - for (byte i = 0; i < msdes.fmod2DEventPaths.Count(); i++) + BlockEngine.SetBlockInfo(this, (ref MusicBlockDataEntityStruct msdes, Guid val) => { - Guid track = msdes.fmod2DEventPaths.Get(i); - if (track == value) + for (byte i = 0; i < msdes.fmod2DEventPaths.Count(); i++) { - msdes.trackIndx = i; - break; + Guid track = msdes.fmod2DEventPaths.Get(i); + if (track == val) + { + msdes.trackIndx = i; + break; + } } - } + }, value); } } @@ -85,13 +67,15 @@ namespace GamecraftModdingAPI.Blocks { get { - ref MusicBlockDataEntityStruct msdes = ref BlockEngine.GetBlockInfo(Id); - Guid[] tracks = new Guid[msdes.fmod2DEventPaths.Count()]; - for (byte i = 0; i < tracks.Length; i++) + return BlockEngine.GetBlockInfo(this, (MusicBlockDataEntityStruct msdes) => { - tracks[i] = msdes.fmod2DEventPaths.Get(i); - } - return tracks; + Guid[] tracks = new Guid[msdes.fmod2DEventPaths.Count()]; + for (byte i = 0; i < tracks.Length; i++) + { + tracks[i] = msdes.fmod2DEventPaths.Get(i); + } + return tracks; + }); } } @@ -99,13 +83,13 @@ namespace GamecraftModdingAPI.Blocks { get { - return BlockEngine.GetBlockInfo(Id).tweakableVolume; + return BlockEngine.GetBlockInfo(this, (MusicBlockDataEntityStruct msdes) => msdes.tweakableVolume); } set { - ref MusicBlockDataEntityStruct msdes = ref BlockEngine.GetBlockInfo(Id); - msdes.tweakableVolume = value; + BlockEngine.SetBlockInfo(this, + (ref MusicBlockDataEntityStruct msdes, float val) => msdes.tweakableVolume = val, value); } } @@ -113,13 +97,15 @@ namespace GamecraftModdingAPI.Blocks { get { - return (ChannelType)BlockEngine.GetBlockInfo(Id).channelType; + Assert.Log("Block exists: " + Exists); + return BlockEngine.GetBlockInfo(this, + (MusicBlockDataEntityStruct msdes) => (ChannelType) msdes.channelType); } - + set { - ref MusicBlockDataEntityStruct msdes = ref BlockEngine.GetBlockInfo(Id); - msdes.channelType = (byte)value; + BlockEngine.SetBlockInfo(this, + (ref MusicBlockDataEntityStruct msdes, ChannelType val) => msdes.channelType = (byte) val, value); } } @@ -127,30 +113,33 @@ namespace GamecraftModdingAPI.Blocks { get { - return BlockEngine.GetBlockInfo(Id).isPlaying; + return BlockEngine.GetBlockInfo(this, + (MusicBlockDataEntityStruct msdes) => msdes.isPlaying); } set { - ref MusicBlockDataEntityStruct msdes = ref BlockEngine.GetBlockInfo(Id); - if (msdes.isPlaying == value) return; - if (value) + BlockEngine.SetBlockInfo(this, (ref MusicBlockDataEntityStruct msdes, bool val) => { - // start playing - EventInstance inst = RuntimeManager.CreateInstance(msdes.fmod2DEventPaths.Get(msdes.trackIndx)); - inst.setVolume(msdes.tweakableVolume / 100f); - inst.start(); - msdes.eventHandle = inst.handle; - } - else - { - // stop playing - EventInstance inst = default(EventInstance); - inst.handle = msdes.eventHandle; - inst.stop(FMOD.Studio.STOP_MODE.ALLOWFADEOUT); - inst.release(); - } - msdes.isPlaying = value; + if (msdes.isPlaying == val) return; + if (val) + { + // start playing + EventInstance inst = RuntimeManager.CreateInstance(msdes.fmod2DEventPaths.Get(msdes.trackIndx)); + inst.setVolume(msdes.tweakableVolume / 100f); + inst.start(); + msdes.eventHandle = inst.handle; + } + else + { + // stop playing + EventInstance inst = default(EventInstance); + inst.handle = msdes.eventHandle; + inst.stop(FMOD.Studio.STOP_MODE.ALLOWFADEOUT); + inst.release(); + } + msdes.isPlaying = val; + }, value); } } } -- 2.30.2 From 421faf7167cf2d4942e295a797bb52f92c91ae1f Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Sun, 19 Jul 2020 12:43:06 -0400 Subject: [PATCH 077/252] Improve dev info in README --- README.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1955de0..fd3bf5a 100644 --- a/README.md +++ b/README.md @@ -10,10 +10,16 @@ This means your code won't break when the GamecraftModdingAPI or Gamecraft updat For more info, please check out the [official documentation](https://mod.exmods.org). -For more support, join the ExMods [Discord](https://discord.gg/xjnFxQV). +For more support, join the ExMods [Discord](https://discord.exmods.org). ## Installation -[Please follow the official mod installation guide](https://www.exmods.org/guides/install.html) +[Please follow the official mod installation guide](https://www.exmods.org/guides/install.html) or use GCMM. + +## Development +To get started, create a symbolic link called `ref` in the root of the project, or one folder higher, linking to the Gamecraft install folder. +This will allow your IDE to resolve references to Gamecraft files for building and IDE tools. + +GamecraftModdingAPI version numbers follow the [Semantic Versioning guidelines](https://semver.org/). ## External Libraries GamecraftModdingAPI includes [Harmony](https://github.com/pardeike/Harmony) to modify the behaviour of existing Gamecraft code. @@ -21,4 +27,5 @@ GamecraftModdingAPI includes [Harmony](https://github.com/pardeike/Harmony) to m # Disclaimer This API is an unofficial modification of Gamecraft software, and is not endorsed or supported by FreeJam or Gamecraft. The GamecraftModdingAPI developer(s) claim no rights on the Gamecraft code referenced within this project. +All code contained in this project is licensed under the [GNU Public License v3](https://git.exmods.org/modtainers/GamecraftModdingAPI/src/branch/master/LICENSE). -- 2.30.2 From 926d968eed33e5ec8c18e423299ca0ca7c23e4c2 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Sun, 19 Jul 2020 16:39:35 -0400 Subject: [PATCH 078/252] Add sfx block support --- GamecraftModdingAPI/Blocks/BlockTests.cs | 18 +++ GamecraftModdingAPI/Blocks/MusicBlock.cs | 157 +++++++++++++++++++++++ GamecraftModdingAPI/Tests/TestRoot.cs | 7 +- 3 files changed, 178 insertions(+), 4 deletions(-) create mode 100644 GamecraftModdingAPI/Blocks/MusicBlock.cs diff --git a/GamecraftModdingAPI/Blocks/BlockTests.cs b/GamecraftModdingAPI/Blocks/BlockTests.cs index 418fa43..ed42024 100644 --- a/GamecraftModdingAPI/Blocks/BlockTests.cs +++ b/GamecraftModdingAPI/Blocks/BlockTests.cs @@ -1,5 +1,7 @@ using System; +using Gamecraft.Wires; + using GamecraftModdingAPI; using GamecraftModdingAPI.Tests; @@ -72,6 +74,22 @@ namespace GamecraftModdingAPI.Blocks if (!Assert.CloseTo(b.MinimumAngle, -180f, $"Servo.MinimumAngle {b.MinimumAngle} does not equal default value, possibly because it failed silently.", "Servo.MinimumAngle is close enough to default.")) return; if (!Assert.CloseTo(b.MaximumForce, 750f, $"Servo.MaximumForce {b.MaximumForce} does not equal default value, possibly because it failed silently.", "Servo.MaximumForce is close enough to default.")) return; } + + [APITestCase(TestType.EditMode)] + public static void TestMusicBlock() + { + Block newBlock = Block.PlaceNew(BlockIDs.MusicBlock, Unity.Mathematics.float3.zero + 2); + MusicBlock b = null; // Note: the assignment operation is a lambda, which slightly confuses the compiler + Assert.Errorless(() => { b = newBlock.Specialise(); }, "Block.Specialize() raised an exception: ", "Block.Specialize() completed without issue."); + if (!Assert.NotNull(b, "Block.Specialize() returned null, possibly because it failed silently.", "Specialized MusicBlock is not null.")) return; + if (!Assert.CloseTo(b.Volume, 100f, $"MusicBlock.Volume {b.Volume} does not equal default value, possibly because it failed silently.", "MusicBlock.Volume is close enough to default.")) return; + if (!Assert.Equal(b.TrackIndex, 0, $"MusicBlock.TrackIndex {b.TrackIndex} does not equal default value, possibly because it failed silently.", "MusicBlock.TrackIndex is equal to default.")) return; + b.IsPlaying = true; // play sfx + if (!Assert.Equal(b.IsPlaying, true, $"MusicBlock.IsPlaying {b.IsPlaying} does not equal default value, possibly because it failed silently.", "MusicBlock.IsPlaying is set properly.")) return; + if (!Assert.Equal(b.ChannelType, ChannelType.Character, $"MusicBlock.ChannelType {b.ChannelType} does not equal default value, possibly because it failed silently.", "MusicBlock.ChannelType is equal to default.")) return; + //Assert.Log(b.Track.ToString()); + if (!Assert.Equal(b.Track.ToString(), new Guid("3237ff8f-f5f2-4f84-8144-496ca280f8c0").ToString(), $"MusicBlock.Track {b.Track} does not equal default value, possibly because it failed silently.", "MusicBlock.Track is equal to default.")) return; + } } #endif } diff --git a/GamecraftModdingAPI/Blocks/MusicBlock.cs b/GamecraftModdingAPI/Blocks/MusicBlock.cs new file mode 100644 index 0000000..a7f862e --- /dev/null +++ b/GamecraftModdingAPI/Blocks/MusicBlock.cs @@ -0,0 +1,157 @@ +using System; + +using FMOD.Studio; +using FMODUnity; +using Gamecraft.Wires; +using RobocraftX.Blocks; +using Svelto.ECS; +using Unity.Mathematics; + +using GamecraftModdingAPI; +using GamecraftModdingAPI.Utility; + +namespace GamecraftModdingAPI.Blocks +{ + public class MusicBlock : Block + { + public static MusicBlock PlaceNew(float3 position, + float3 rotation = default, BlockColors color = BlockColors.Default, byte darkness = 0, + int uscale = 1, float3 scale = default, Player player = null) + { + if (PlacementEngine.IsInGame && GameState.IsBuildMode()) + { + EGID id = PlacementEngine.PlaceBlock(BlockIDs.MusicBlock, color, darkness, + position, uscale, scale, player, rotation); + return new MusicBlock(id); + } + + return null; + } + + public MusicBlock(EGID id) : base(id) + { + if (!BlockEngine.GetBlockInfoExists(this.Id)) + { + throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); + } + } + + public MusicBlock(uint id) : base(id) + { + if (!BlockEngine.GetBlockInfoExists(this.Id)) + { + throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); + } + } + + public byte TrackIndex + { + get + { + return BlockEngine.GetBlockInfo(Id).trackIndx; + } + + set + { + ref MusicBlockDataEntityStruct msdes = ref BlockEngine.GetBlockInfo(Id); + msdes.trackIndx = value; + } + } + + public Guid Track + { + get + { + ref MusicBlockDataEntityStruct msdes = ref BlockEngine.GetBlockInfo(Id); + return msdes.fmod2DEventPaths.Get(msdes.trackIndx); + } + + set + { + ref MusicBlockDataEntityStruct msdes = ref BlockEngine.GetBlockInfo(Id); + for (byte i = 0; i < msdes.fmod2DEventPaths.Count(); i++) + { + Guid track = msdes.fmod2DEventPaths.Get(i); + if (track == value) + { + msdes.trackIndx = i; + break; + } + } + } + } + + public Guid[] Tracks + { + get + { + ref MusicBlockDataEntityStruct msdes = ref BlockEngine.GetBlockInfo(Id); + Guid[] tracks = new Guid[msdes.fmod2DEventPaths.Count()]; + for (byte i = 0; i < tracks.Length; i++) + { + tracks[i] = msdes.fmod2DEventPaths.Get(i); + } + return tracks; + } + } + + public float Volume + { + get + { + return BlockEngine.GetBlockInfo(Id).tweakableVolume; + } + + set + { + ref MusicBlockDataEntityStruct msdes = ref BlockEngine.GetBlockInfo(Id); + msdes.tweakableVolume = value; + } + } + + public ChannelType ChannelType + { + get + { + return (ChannelType)BlockEngine.GetBlockInfo(Id).channelType; + } + + set + { + ref MusicBlockDataEntityStruct msdes = ref BlockEngine.GetBlockInfo(Id); + msdes.channelType = (byte)value; + } + } + + public bool IsPlaying + { + get + { + return BlockEngine.GetBlockInfo(Id).isPlaying; + } + + set + { + ref MusicBlockDataEntityStruct msdes = ref BlockEngine.GetBlockInfo(Id); + if (msdes.isPlaying == value) return; + if (value) + { + // start playing + EventInstance inst = RuntimeManager.CreateInstance(msdes.fmod2DEventPaths.Get(msdes.trackIndx)); + inst.setVolume(msdes.tweakableVolume / 100f); + inst.start(); + msdes.eventHandle = inst.handle; + } + else + { + // stop playing + EventInstance inst = default(EventInstance); + inst.handle = msdes.eventHandle; + inst.stop(FMOD.Studio.STOP_MODE.ALLOWFADEOUT); + inst.release(); + } + msdes.isPlaying = value; + } + } + } +} \ No newline at end of file diff --git a/GamecraftModdingAPI/Tests/TestRoot.cs b/GamecraftModdingAPI/Tests/TestRoot.cs index 4e9da73..f39169e 100644 --- a/GamecraftModdingAPI/Tests/TestRoot.cs +++ b/GamecraftModdingAPI/Tests/TestRoot.cs @@ -139,10 +139,9 @@ namespace GamecraftModdingAPI.Tests } yield return Yield.It; app.MyGames[0].EnterGame(); - // returning from a new game without saving will hard lock GC (it's an invalid state) - //Game newGame = Game.NewGame(); - //yield return new WaitForSecondsEnumerator(5).Continue(); // wait for sync - //newGame.EnterGame(); + /*Game newGame = Game.NewGame(); + yield return new WaitForSecondsEnumerator(5).Continue(); // wait for sync + newGame.EnterGame();*/ } private static IEnumerator GameTests() -- 2.30.2 From ea8a9184bc96bab234cd49540672419a4a03bbea Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Sun, 19 Jul 2020 20:05:01 -0400 Subject: [PATCH 079/252] Add popup UI method to Client --- GamecraftModdingAPI/App/Client.cs | 77 ++++++++++++++++++++++ GamecraftModdingAPI/App/ClientAlertTest.cs | 59 +++++++++++++++++ GamecraftModdingAPI/App/UserPrompts.cs | 27 ++++++++ 3 files changed, 163 insertions(+) create mode 100644 GamecraftModdingAPI/App/ClientAlertTest.cs create mode 100644 GamecraftModdingAPI/App/UserPrompts.cs diff --git a/GamecraftModdingAPI/App/Client.cs b/GamecraftModdingAPI/App/Client.cs index fbe960e..ca5dcfa 100644 --- a/GamecraftModdingAPI/App/Client.cs +++ b/GamecraftModdingAPI/App/Client.cs @@ -1,8 +1,12 @@ using System; +using System.Reflection; +using HarmonyLib; +using RobocraftX.Services; using UnityEngine; using GamecraftModdingAPI.Utility; +using RobocraftX.Common; namespace GamecraftModdingAPI.App { @@ -14,6 +18,12 @@ namespace GamecraftModdingAPI.App // extensible engine protected static AppEngine appEngine = new AppEngine(); + protected static Func ErrorHandlerInstanceGetter; + + protected static Action EnqueueError; + + protected static Action HandleErrorClosed; + /// /// An event that fires whenever the main menu is loaded. /// @@ -74,9 +84,76 @@ namespace GamecraftModdingAPI.App get => appEngine.IsInMenu; } + /// + /// Open a popup which prompts the user to click a button. + /// This reuses Gamecraft's error dialog popup + /// + /// The popup to display. Use an instance of SingleChoicePrompt or DualChoicePrompt. + public void PromptUser(Error popup) + { + // if the stuff wasn't mostly set to internal, this would be written as: + // RobocraftX.Services.ErrorHandler.Instance.EqueueError(error); + object errorHandlerInstance = ErrorHandlerInstanceGetter(); + EnqueueError(errorHandlerInstance, popup); + } + + // TODO + /*public void CloseCurrentPrompt() + { + // RobocraftX.Services.ErrorHandler.Instance.HandlePopupClosed(); + // FIXME: this is a call that is also called when closing, not the actual closing action itself (so it doesn't work) + object errorHandlerInstance = ErrorHandlerInstanceGetter(); + HandleErrorClosed(errorHandlerInstance); + }*/ + internal static void Init() { + // this would have been so much simpler if this didn't involve a bunch of internal fields & classes + Type errorHandler = AccessTools.TypeByName("RobocraftX.Services.ErrorHandler"); + Type errorHandle = AccessTools.TypeByName("RobocraftX.Services.ErrorHandle"); + ErrorHandlerInstanceGetter = (Func) AccessTools.Method("GamecraftModdingAPI.App.Client:GenInstanceGetter") + .MakeGenericMethod(errorHandler) + .Invoke(null, new object[0]); + EnqueueError = (Action) AccessTools.Method("GamecraftModdingAPI.App.Client:GenEnqueueError") + .MakeGenericMethod(errorHandler, errorHandle) + .Invoke(null, new object[0]); + /*HandleErrorClosed = (Action) AccessTools.Method("GamecraftModdingAPI.App.Client:GenHandlePopupClosed") + .MakeGenericMethod(errorHandler) + .Invoke(null, new object[0]);*/ + // register engines MenuEngineManager.AddMenuEngine(appEngine); } + + // Creating delegates once is faster than reflection every time + // Admittedly, this way is more difficult to code and less readable + private static Func GenInstanceGetter() + { + Type errorHandler = AccessTools.TypeByName("RobocraftX.Services.ErrorHandler"); + MethodInfo instance = AccessTools.PropertyGetter(errorHandler, "Instance"); + Func getterSimple = (Func) Delegate.CreateDelegate(typeof(Func), null, instance); + Func getterCasted = () => (object) getterSimple(); + return getterCasted; + } + + private static Action GenEnqueueError() + { + Type errorHandler = AccessTools.TypeByName("RobocraftX.Services.ErrorHandler"); + MethodInfo enqueueError = AccessTools.Method(errorHandler, "EnqueueError"); + Func enqueueSimple = + (Func) Delegate.CreateDelegate(typeof(Func), enqueueError); + Action enqueueCasted = + (object instance, Error error) => { enqueueSimple((T) instance, error); }; + return enqueueCasted; + } + + private static Action GenHandlePopupClosed() + { + Type errorHandler = AccessTools.TypeByName("RobocraftX.Services.ErrorHandler"); + MethodInfo handlePopupClosed = AccessTools.Method(errorHandler, "HandlePopupClosed"); + Action handleSimple = + (Action) Delegate.CreateDelegate(typeof(Action), handlePopupClosed); + Action handleCasted = (object instance) => handleSimple((T) instance); + return handleCasted; + } } } diff --git a/GamecraftModdingAPI/App/ClientAlertTest.cs b/GamecraftModdingAPI/App/ClientAlertTest.cs new file mode 100644 index 0000000..23ced76 --- /dev/null +++ b/GamecraftModdingAPI/App/ClientAlertTest.cs @@ -0,0 +1,59 @@ +using System; +using HarmonyLib; + +using RobocraftX.Services; + +using GamecraftModdingAPI.Tests; + +namespace GamecraftModdingAPI.App +{ +#if TEST + /// + /// Client popups tests. + /// Only available in TEST builds. + /// + [APITestClass] + public static class ClientAlertTest + { + private static DualChoicePrompt popup2 = null; + + private static SingleChoicePrompt popup1 = null; + + [APITestStartUp] + public static void StartUp2() + { + popup2 = new DualChoicePrompt("This is a test double-button popup", + "The cake is a lie", + "lmao", + () => { }, + "kek", + () => { }); + } + + [APITestStartUp] + public static void StartUp1() + { + popup1 = new SingleChoicePrompt("The cake is a lie", + "This is a test single-button popup", + "qwertyuiop", + () => { }); + } + + [APITestCase(TestType.Menu)] + public static void TestPopUp2() + { + Client c = new Client(); + c.PromptUser(popup2); + //c.CloseCurrentPrompt(); + } + + [APITestCase(TestType.Menu)] + public static void TestPopUp1() + { + Client c = new Client(); + c.PromptUser(popup1); + //c.CloseCurrentPrompt(); + } + } +#endif +} \ No newline at end of file diff --git a/GamecraftModdingAPI/App/UserPrompts.cs b/GamecraftModdingAPI/App/UserPrompts.cs new file mode 100644 index 0000000..26a9395 --- /dev/null +++ b/GamecraftModdingAPI/App/UserPrompts.cs @@ -0,0 +1,27 @@ +using System; +using HarmonyLib; + +using RobocraftX.Services; + +namespace GamecraftModdingAPI.App +{ + public class DualChoicePrompt : MultiChoiceError + { + public DualChoicePrompt(string errorMessage, string title, string firstButtonText, Action firstButtonAction, string secondButtonText, Action secondButtonAction) : base(errorMessage, firstButtonText, firstButtonAction, secondButtonText, secondButtonAction) + { + // internal readonly field smh + new Traverse(this).Field("Title").Value = title; + } + } + + public class SingleChoicePrompt : SingleChoiceError + { + public SingleChoicePrompt(string errorMessage, string buttonText, Action buttonClickAction) : base(errorMessage, buttonText, buttonClickAction) + { + } + + public SingleChoicePrompt(string titleText, string errorMessage, string buttonText, Action buttonClickAction) : base(titleText, errorMessage, buttonText, buttonClickAction) + { + } + } +} \ No newline at end of file -- 2.30.2 From 89d32956d950e1eb08ac9c3844ec96c748108eaf Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Mon, 13 Jul 2020 21:55:48 +0200 Subject: [PATCH 080/252] Automatically invoke the correct block constructor And store delegates of dynamic methods invoking constructors Tested with the automated tests --- GamecraftModdingAPI/Block.cs | 107 +++++++++++++----- GamecraftModdingAPI/Blocks/BlockTests.cs | 3 +- GamecraftModdingAPI/Blocks/ConsoleBlock.cs | 30 ++--- GamecraftModdingAPI/Blocks/Motor.cs | 23 ---- GamecraftModdingAPI/Blocks/Piston.cs | 25 +--- GamecraftModdingAPI/Blocks/Servo.cs | 23 ---- GamecraftModdingAPI/Blocks/SignalingBlock.cs | 19 ---- GamecraftModdingAPI/Blocks/SpawnPoint.cs | 25 +--- GamecraftModdingAPI/Blocks/TextBlock.cs | 15 --- GamecraftModdingAPI/Blocks/Timer.cs | 17 --- .../Tests/GamecraftModdingAPIPluginTest.cs | 22 ++++ 11 files changed, 114 insertions(+), 195 deletions(-) diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index 16a0c81..673ef49 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -1,6 +1,7 @@ using System; -using System.Reflection; -using System.Threading.Tasks; +using System.Collections.Generic; +using System.Linq; +using System.Reflection.Emit; using Svelto.ECS; using Svelto.ECS.EntityStructs; @@ -67,10 +68,6 @@ namespace GamecraftModdingAPI /// Place a new block at the given position. If scaled, position means the center of the block. The default block size is 0.2 in terms of position. /// Place blocks next to each other to connect them. /// The placed block will be a complete block with a placement grid and collision which will be saved along with the game. - /// - /// This method waits for the block to be constructed in the game which may take a significant amount of time. - /// Only use this to place a single block. - /// For placing multiple blocks, use PlaceNew() then AsyncUtils.WaitForSubmission() when done with placing blocks. /// /// The block's type /// The block's color @@ -81,23 +78,15 @@ namespace GamecraftModdingAPI /// The block's non-uniform scale - 0 means is used /// The player who placed the block /// The placed block or null if failed - public static async Task PlaceNewAsync(BlockIDs block, float3 position, + public static T PlaceNew(BlockIDs block, float3 position, float3 rotation = default, BlockColors color = BlockColors.Default, byte darkness = 0, - int uscale = 1, float3 scale = default, Player player = null) + int uscale = 1, float3 scale = default, Player player = null) where T : Block { if (PlacementEngine.IsInGame && GameState.IsBuildMode()) { - try - { - var ret = new Block(PlacementEngine.PlaceBlock(block, color, darkness, - position, uscale, scale, player, rotation)); - await AsyncUtils.WaitForSubmission(); - return ret; - } - catch (Exception e) - { - Logging.MetaDebugLog(e); - } + var egid = PlacementEngine.PlaceBlock(block, color, darkness, + position, uscale, scale, player, rotation); + return New(egid.entityID, egid.groupID); } return null; @@ -109,7 +98,7 @@ namespace GamecraftModdingAPI /// The block object public static Block GetLastPlacedBlock() { - return new Block(BlockIdentifiers.LatestBlockID); + return New(BlockIdentifiers.LatestBlockID); } /// @@ -130,6 +119,75 @@ namespace GamecraftModdingAPI remove => BlockEventsEngine.Removed -= value; } + private static Dictionary> initializers = new Dictionary>(); + + private static Dictionary typeToGroup = + new Dictionary + { + {typeof(ConsoleBlock), new[] {CommonExclusiveGroups.BUILD_CONSOLE_BLOCK_GROUP}}, + {typeof(Motor), new[] {CommonExclusiveGroups.BUILD_MOTOR_BLOCK_GROUP}}, + {typeof(Piston), new[] {CommonExclusiveGroups.BUILD_PISTON_BLOCK_GROUP}}, + {typeof(Servo), new[] {CommonExclusiveGroups.BUILD_SERVO_BLOCK_GROUP}}, + { + typeof(SpawnPoint), + new[] + { + CommonExclusiveGroups.BUILD_SPAWNPOINT_BLOCK_GROUP, + CommonExclusiveGroups.BUILD_BUILDINGSPAWN_BLOCK_GROUP + } + }, + {typeof(TextBlock), new[] {CommonExclusiveGroups.BUILD_TEXT_BLOCK_GROUP}}, + {typeof(Timer), new[] {CommonExclusiveGroups.BUILD_TIMER_BLOCK_GROUP}} + }; + + private static T New(uint id, ExclusiveGroupStruct? group = null) where T : Block + { + var type = typeof(T); + EGID egid; + if (!group.HasValue) + { + if (typeToGroup.TryGetValue(type, out var gr) && gr.Length == 1) + egid = new EGID(id, gr[0]); + else + egid = BlockEngine.FindBlockEGID(id) ?? throw new BlockTypeException("Could not find block group!"); + } + else + { + egid = new EGID(id, group.Value); + if (typeToGroup.TryGetValue(type, out var gr) + && gr.All(egs => egs != group.Value)) //If this subclass has a specific group, then use that - so Block should still work + throw new BlockTypeException($"Incompatible block type! Type {type.Name} belongs to group {gr.Select(g => g.ToString()).Aggregate((a, b) => a + ", " + b)} instead of {group.Value}"); + } + + if (initializers.TryGetValue(type, out var func)) + { + var bl = (T) func(egid); + return bl; + } + + //https://stackoverflow.com/a/10593806/2703239 + var ctor = type.GetConstructor(new[] {typeof(EGID)}); + if (ctor == null) + throw new MissingMethodException("There is no constructor with an EGID parameter for this object"); + DynamicMethod dynamic = new DynamicMethod(string.Empty, + type, + new[] {typeof(EGID)}, + type); + ILGenerator il = dynamic.GetILGenerator(); + + il.DeclareLocal(type); + il.Emit(OpCodes.Ldarg_0); //Load EGID and pass to constructor + il.Emit(OpCodes.Newobj, ctor); //Call constructor + il.Emit(OpCodes.Stloc_0); + il.Emit(OpCodes.Ldloc_0); + il.Emit(OpCodes.Ret); + + func = (Func) dynamic.CreateDelegate(typeof(Func)); + initializers.Add(type, func); + var block = (T) func(egid); + return block; + } + public Block(EGID id) { Id = id; @@ -344,12 +402,9 @@ namespace GamecraftModdingAPI // C# can't cast to a child of Block unless the object was originally that child type // And C# doesn't let me make implicit cast operators for child types // So thanks to Microsoft, we've got this horrible implementation using reflection - ConstructorInfo ctor = typeof(T).GetConstructor(types: new System.Type[] { typeof(EGID) }); - if (ctor == null) - { - throw new BlockSpecializationException("Specialized block constructor does not accept an EGID"); - } - return (T)ctor.Invoke(new object[] { Id }); + + //Lets improve that using delegates + return New(Id.entityID, Id.groupID); } #if DEBUG diff --git a/GamecraftModdingAPI/Blocks/BlockTests.cs b/GamecraftModdingAPI/Blocks/BlockTests.cs index ed42024..3b66f28 100644 --- a/GamecraftModdingAPI/Blocks/BlockTests.cs +++ b/GamecraftModdingAPI/Blocks/BlockTests.cs @@ -32,9 +32,8 @@ namespace GamecraftModdingAPI.Blocks [APITestCase(TestType.EditMode)] public static void TestTextBlock() { - Block newBlock = Block.PlaceNew(BlockIDs.TextBlock, Unity.Mathematics.float3.zero + 1); TextBlock textBlock = null; // Note: the assignment operation is a lambda, which slightly confuses the compiler - Assert.Errorless(() => { textBlock = newBlock.Specialise(); }, "Block.Specialize() raised an exception: ", "Block.Specialize() completed without issue."); + Assert.Errorless(() => { textBlock = Block.PlaceNew(BlockIDs.TextBlock, Unity.Mathematics.float3.zero + 1); }, "Block.PlaceNew() raised an exception: ", "Block.PlaceNew() completed without issue."); if (!Assert.NotNull(textBlock, "Block.Specialize() returned null, possibly because it failed silently.", "Specialized TextBlock is not null.")) return; if (!Assert.NotNull(textBlock.Text, "TextBlock.Text is null, possibly because it failed silently.", "TextBlock.Text is not null.")) return; if (!Assert.NotNull(textBlock.TextBlockId, "TextBlock.TextBlockId is null, possibly because it failed silently.", "TextBlock.TextBlockId is not null.")) return; diff --git a/GamecraftModdingAPI/Blocks/ConsoleBlock.cs b/GamecraftModdingAPI/Blocks/ConsoleBlock.cs index 6d4217d..e132029 100644 --- a/GamecraftModdingAPI/Blocks/ConsoleBlock.cs +++ b/GamecraftModdingAPI/Blocks/ConsoleBlock.cs @@ -12,33 +12,19 @@ namespace GamecraftModdingAPI.Blocks { public class ConsoleBlock : Block { - public static ConsoleBlock PlaceNew(float3 position, - float3 rotation = default, BlockColors color = BlockColors.Default, byte darkness = 0, - int uscale = 1, float3 scale = default, Player player = null) + public ConsoleBlock(EGID id): base(id) { - if (PlacementEngine.IsInGame && GameState.IsBuildMode()) - { - EGID id = PlacementEngine.PlaceBlock(BlockIDs.ConsoleBlock, color, darkness, - position, uscale, scale, player, rotation); - return new ConsoleBlock(id); - } - - return null; + if (!BlockEngine.GetBlockInfoExists(this.Id)) + { + throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); + } } - public ConsoleBlock(EGID id): base(id) + public ConsoleBlock(uint id): base(new EGID(id, CommonExclusiveGroups.BUILD_CONSOLE_BLOCK_GROUP)) { - if (!BlockEngine.GetBlockInfoExists(this.Id)) - { - throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); - } - } - - public ConsoleBlock(uint id): base(new EGID(id, CommonExclusiveGroups.BUILD_CONSOLE_BLOCK_GROUP)) - { - if (!BlockEngine.GetBlockInfoExists(this.Id)) + if (!BlockEngine.GetBlockInfoExists(this.Id)) { - throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); + throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); } } diff --git a/GamecraftModdingAPI/Blocks/Motor.cs b/GamecraftModdingAPI/Blocks/Motor.cs index 55f3649..fde2920 100644 --- a/GamecraftModdingAPI/Blocks/Motor.cs +++ b/GamecraftModdingAPI/Blocks/Motor.cs @@ -11,29 +11,6 @@ namespace GamecraftModdingAPI.Blocks { public class Motor : Block { - /// - /// Places a new motor. - /// Any valid motor type is accepted. - /// This re-implements Block.PlaceNew(...) - /// - public static new Motor PlaceNew(BlockIDs block, float3 position, - float3 rotation = default, BlockColors color = BlockColors.Default, byte darkness = 0, - int uscale = 1, float3 scale = default, Player player = null) - { - if (!(block == BlockIDs.MotorS || block == BlockIDs.MotorM)) - { - throw new BlockTypeException($"Block is not a {typeof(Motor).Name} block"); - } - if (PlacementEngine.IsInGame && GameState.IsBuildMode()) - { - EGID id = PlacementEngine.PlaceBlock(block, color, darkness, - position, uscale, scale, player, rotation); - return new Motor(id); - } - - return null; - } - public Motor(EGID id) : base(id) { if (!BlockEngine.GetBlockInfoExists(this.Id)) diff --git a/GamecraftModdingAPI/Blocks/Piston.cs b/GamecraftModdingAPI/Blocks/Piston.cs index b96a806..2586b60 100644 --- a/GamecraftModdingAPI/Blocks/Piston.cs +++ b/GamecraftModdingAPI/Blocks/Piston.cs @@ -11,30 +11,7 @@ namespace GamecraftModdingAPI.Blocks { public class Piston : Block { - /// - /// Places a new piston. - /// Any valid piston type is accepted. - /// This re-implements Block.PlaceNew(...) - /// - public static new Piston PlaceNew(BlockIDs block, float3 position, - float3 rotation = default, BlockColors color = BlockColors.Default, byte darkness = 0, - int uscale = 1, float3 scale = default, Player player = null) - { - if (!(block == BlockIDs.ServoPiston || block == BlockIDs.StepperPiston || block == BlockIDs.PneumaticPiston)) - { - throw new BlockTypeException($"Block is not a {typeof(Piston).Name} block"); - } - if (PlacementEngine.IsInGame && GameState.IsBuildMode()) - { - EGID id = PlacementEngine.PlaceBlock(block, color, darkness, - position, uscale, scale, player, rotation); - return new Piston(id); - } - - return null; - } - - public Piston(EGID id) : base(id) + public Piston(EGID id) : base(id) { if (!BlockEngine.GetBlockInfoExists(this.Id)) { diff --git a/GamecraftModdingAPI/Blocks/Servo.cs b/GamecraftModdingAPI/Blocks/Servo.cs index ef7225b..c4b57fb 100644 --- a/GamecraftModdingAPI/Blocks/Servo.cs +++ b/GamecraftModdingAPI/Blocks/Servo.cs @@ -11,29 +11,6 @@ namespace GamecraftModdingAPI.Blocks { public class Servo : Block { - /// - /// Places a new servo. - /// Any valid servo type is accepted. - /// This re-implements Block.PlaceNew(...) - /// - public static new Servo PlaceNew(BlockIDs block, float3 position, - float3 rotation = default, BlockColors color = BlockColors.Default, byte darkness = 0, - int uscale = 1, float3 scale = default, Player player = null) - { - if (!(block == BlockIDs.ServoAxle || block == BlockIDs.ServoHinge || block == BlockIDs.ServoPiston)) - { - throw new BlockTypeException($"Block is not a {nameof(Servo)} block"); - } - if (PlacementEngine.IsInGame && GameState.IsBuildMode()) - { - EGID id = PlacementEngine.PlaceBlock(block, color, darkness, - position, uscale, scale, player, rotation); - return new Servo(id); - } - - return null; - } - public Servo(EGID id) : base(id) { if (!BlockEngine.GetBlockInfoExists(this.Id)) diff --git a/GamecraftModdingAPI/Blocks/SignalingBlock.cs b/GamecraftModdingAPI/Blocks/SignalingBlock.cs index f8006f6..8a62d64 100644 --- a/GamecraftModdingAPI/Blocks/SignalingBlock.cs +++ b/GamecraftModdingAPI/Blocks/SignalingBlock.cs @@ -14,25 +14,6 @@ namespace GamecraftModdingAPI.Blocks /// public class SignalingBlock : Block { - /// - /// Places a new signaling block. - /// Any valid functional block type with IO ports will work. - /// This re-implements Block.PlaceNew(...) - /// - public static new SignalingBlock PlaceNew(BlockIDs block, float3 position, - float3 rotation = default, BlockColors color = BlockColors.Default, byte darkness = 0, - int uscale = 1, float3 scale = default, Player player = null) - { - if (PlacementEngine.IsInGame && GameState.IsBuildMode()) - { - EGID id = PlacementEngine.PlaceBlock(block, color, darkness, - position, uscale, scale, player, rotation); - return new SignalingBlock(id); - } - - return null; - } - public SignalingBlock(EGID id) : base(id) { if (!BlockEngine.GetBlockInfoExists(this.Id)) diff --git a/GamecraftModdingAPI/Blocks/SpawnPoint.cs b/GamecraftModdingAPI/Blocks/SpawnPoint.cs index 65ef750..4419e38 100644 --- a/GamecraftModdingAPI/Blocks/SpawnPoint.cs +++ b/GamecraftModdingAPI/Blocks/SpawnPoint.cs @@ -13,30 +13,7 @@ namespace GamecraftModdingAPI.Blocks { public class SpawnPoint : Block { - /// - /// Places a new spawn point. - /// Any valid spawn block type is accepted. - /// This re-implements Block.PlaceNew(...) - /// - public static new SpawnPoint PlaceNew(BlockIDs block, float3 position, - float3 rotation = default, BlockColors color = BlockColors.Default, byte darkness = 0, - int uscale = 1, float3 scale = default, Player player = null) - { - if (!(block == BlockIDs.LargeSpawn || block == BlockIDs.SmallSpawn || block == BlockIDs.MediumSpawn || block == BlockIDs.PlayerSpawn)) - { - throw new BlockTypeException($"Block is not a {nameof(SpawnPoint)} block"); - } - if (PlacementEngine.IsInGame && GameState.IsBuildMode()) - { - EGID id = PlacementEngine.PlaceBlock(block, color, darkness, - position, uscale, scale, player, rotation); - return new SpawnPoint(id); - } - - return null; - } - - public SpawnPoint(EGID id) : base(id) + public SpawnPoint(EGID id) : base(id) { if (!BlockEngine.GetBlockInfoExists(this.Id)) { diff --git a/GamecraftModdingAPI/Blocks/TextBlock.cs b/GamecraftModdingAPI/Blocks/TextBlock.cs index c1a9344..94cf212 100644 --- a/GamecraftModdingAPI/Blocks/TextBlock.cs +++ b/GamecraftModdingAPI/Blocks/TextBlock.cs @@ -12,21 +12,6 @@ namespace GamecraftModdingAPI.Blocks { public class TextBlock : Block { - - public static TextBlock PlaceNew(float3 position, - float3 rotation = default, BlockColors color = BlockColors.Default, byte darkness = 0, - int uscale = 1, float3 scale = default, Player player = null) - { - if (PlacementEngine.IsInGame && GameState.IsBuildMode()) - { - EGID id = PlacementEngine.PlaceBlock(BlockIDs.TextBlock, color, darkness, - position, uscale, scale, player, rotation); - return new TextBlock(id); - } - - return null; - } - public TextBlock(EGID id) : base(id) { if (!BlockEngine.GetBlockInfoExists(this.Id)) diff --git a/GamecraftModdingAPI/Blocks/Timer.cs b/GamecraftModdingAPI/Blocks/Timer.cs index 0e7f744..2acab5b 100644 --- a/GamecraftModdingAPI/Blocks/Timer.cs +++ b/GamecraftModdingAPI/Blocks/Timer.cs @@ -13,23 +13,6 @@ namespace GamecraftModdingAPI.Blocks { public class Timer : Block { - /// - /// Places a new timer block. - /// - public static Timer PlaceNew(float3 position, - float3 rotation = default, BlockColors color = BlockColors.Default, byte darkness = 0, - int uscale = 1, float3 scale = default, Player player = null) - { - if (PlacementEngine.IsInGame && GameState.IsBuildMode()) - { - EGID id = PlacementEngine.PlaceBlock(BlockIDs.Timer, color, darkness, - position, uscale, scale, player, rotation); - return new Timer(id); - } - - return null; - } - public Timer(EGID id) : base(id) { if (!BlockEngine.GetBlockInfoExists(this.Id)) diff --git a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs index fa65ebb..d5cf714 100644 --- a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs +++ b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs @@ -232,6 +232,28 @@ namespace GamecraftModdingAPI.Tests } }).Build(); + CommandBuilder.Builder() + .Name("PlaceConsole") + .Description("Place a bunch of console block with a given text") + .Action((float x, float y, float z) => + { + Stopwatch sw = new Stopwatch(); + sw.Start(); + for (int i = 0; i < 100; i++) + { + for (int j = 0; j < 100; j++) + { + var block = Block.PlaceNew(BlockIDs.ConsoleBlock, + new float3(x + i, y, z + j)); + block.Command = "test_command"; + } + } + + sw.Stop(); + Logging.CommandLog($"Blocks placed in {sw.ElapsedMilliseconds} ms"); + }) + .Build(); + GameClient.SetDebugInfo("InstalledMods", InstalledMods); Block.Placed += (sender, args) => Logging.MetaDebugLog("Placed block " + args.Type + " with ID " + args.ID); -- 2.30.2 From 7336fe8353057a0cfe0b792528b90ed7cc955b0a Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Wed, 15 Jul 2020 21:58:24 +0200 Subject: [PATCH 081/252] Add support for initializing blocks with properties Newly created blocks use the initializer to set properties, allowing the user to set per-block properties --- GamecraftModdingAPI/Block.cs | 76 ++++++++-------- GamecraftModdingAPI/Blocks/BlockEngine.cs | 89 +++++++------------ GamecraftModdingAPI/Blocks/BlockEngineInit.cs | 46 ++++++++++ .../Blocks/BlockEventsEngine.cs | 52 ++++++++++- GamecraftModdingAPI/Blocks/BlockIDs.cs | 2 +- GamecraftModdingAPI/Blocks/ConsoleBlock.cs | 40 ++++----- GamecraftModdingAPI/Blocks/Motor.cs | 23 ++--- .../Blocks/ObjectIdentifier.cs | 19 ++-- GamecraftModdingAPI/Blocks/Piston.cs | 23 ++--- GamecraftModdingAPI/Blocks/PlacementEngine.cs | 9 +- GamecraftModdingAPI/Blocks/Servo.cs | 48 ++++------ GamecraftModdingAPI/Blocks/SignalingBlock.cs | 27 ++---- GamecraftModdingAPI/Blocks/SpawnPoint.cs | 64 +++++-------- GamecraftModdingAPI/Blocks/TextBlock.cs | 53 +++++------ GamecraftModdingAPI/Blocks/Timer.cs | 68 +++++--------- 15 files changed, 301 insertions(+), 338 deletions(-) create mode 100644 GamecraftModdingAPI/Blocks/BlockEngineInit.cs diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index 673ef49..c3e0393 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -55,13 +55,7 @@ namespace GamecraftModdingAPI float3 rotation = default, BlockColors color = BlockColors.Default, byte darkness = 0, int uscale = 1, float3 scale = default, Player player = null) { - if (PlacementEngine.IsInGame && GameState.IsBuildMode()) - { - return new Block(PlacementEngine.PlaceBlock(block, color, darkness, - position, uscale, scale, player, rotation)); - } - - return null; + return PlaceNew(block, position, rotation, color, darkness, uscale, scale, player); } /// @@ -85,8 +79,10 @@ namespace GamecraftModdingAPI if (PlacementEngine.IsInGame && GameState.IsBuildMode()) { var egid = PlacementEngine.PlaceBlock(block, color, darkness, - position, uscale, scale, player, rotation); - return New(egid.entityID, egid.groupID); + position, uscale, scale, player, rotation, out var initializer); + var bl = New(egid.entityID, egid.groupID); + bl.InitData.Group = BlockEngine.InitGroup(initializer); + return bl; } return null; @@ -205,6 +201,8 @@ namespace GamecraftModdingAPI public EGID Id { get; } + internal BlockEngine.BlockInitData InitData; + /// /// The block's current position or zero if the block no longer exists. /// A block is 0.2 wide by default in terms of position. @@ -236,12 +234,11 @@ namespace GamecraftModdingAPI /// public float3 Scale { - get => BlockEngine.GetBlockInfo(Id).scale; + get => BlockEngine.GetBlockInfo(this, (ScalingEntityStruct st) => st.scale); set { + BlockEngine.SetBlockInfo(this, (ref ScalingEntityStruct st, float3 val) => st.scale = val, value); if (!Exists) return; //UpdateCollision needs the block to exist - ref var scaling = ref BlockEngine.GetBlockInfo(Id); - scaling.scale = value; ScalingEngine.UpdateCollision(Id); } } @@ -252,11 +249,11 @@ namespace GamecraftModdingAPI /// public int UniformScale { - get => BlockEngine.GetBlockInfo(Id).scaleFactor; + get => BlockEngine.GetBlockInfo(this, (UniformBlockScaleEntityStruct st) => st.scaleFactor); set { - ref var scaleStruct = ref BlockEngine.GetBlockInfo(Id); - scaleStruct.scaleFactor = value; + BlockEngine.SetBlockInfo(this, (ref UniformBlockScaleEntityStruct st, int val) => st.scaleFactor = val, + value); Scale = new float3(value, value, value); } } @@ -268,8 +265,7 @@ namespace GamecraftModdingAPI { get { - var id = (BlockIDs) BlockEngine.GetBlockInfo(Id, out var exists).DBID; - return exists ? id : BlockIDs.Invalid; + return BlockEngine.GetBlockInfo(this, (DBEntityStruct st) => (BlockIDs) st.DBID, BlockIDs.Invalid); } } @@ -280,17 +276,19 @@ namespace GamecraftModdingAPI { get { - byte index = BlockEngine.GetBlockInfo(Id, out var exists).indexInPalette; - if (!exists) index = byte.MaxValue; + byte index = BlockEngine.GetBlockInfo(this, (ColourParameterEntityStruct st) => st.indexInPalette, + byte.MaxValue); return new BlockColor(index); } set { - ref var color = ref BlockEngine.GetBlockInfo(Id); - color.indexInPalette = (byte)(value.Color + value.Darkness * 10); - color.overridePaletteColour = false; - color.needsUpdate = true; - BlockEngine.SetBlockColorFromPalette(ref color); + BlockEngine.SetBlockInfo(this, (ref ColourParameterEntityStruct color, BlockColor val) => + { + color.indexInPalette = (byte) (val.Color + val.Darkness * 10); + color.overridePaletteColour = false; + color.needsUpdate = true; + BlockEngine.SetBlockColorFromPalette(ref color); + }, value); } } @@ -299,27 +297,31 @@ namespace GamecraftModdingAPI /// public float4 CustomColor { - get => BlockEngine.GetBlockInfo(Id).overriddenColour; + get => BlockEngine.GetBlockInfo(this, (ColourParameterEntityStruct st) => st.overriddenColour); set { - ref var color = ref BlockEngine.GetBlockInfo(Id); - color.overriddenColour = value; - color.overridePaletteColour = true; - color.needsUpdate = true; + BlockEngine.SetBlockInfo(this, (ref ColourParameterEntityStruct color, float4 val) => + { + color.overriddenColour = val; + color.overridePaletteColour = true; + color.needsUpdate = true; + }, value); } } /// - /// The short text displayed on the block if applicable, or null. + /// The text displayed on the block if applicable, or null. /// Setting it is temporary to the session, it won't be saved. /// public string Label { - get => BlockEngine.GetBlockInfo(Id).textLabelComponent?.text; + get => BlockEngine.GetBlockInfo(this, (TextLabelEntityViewStruct st) => st.textLabelComponent?.text); set { - ref var text = ref BlockEngine.GetBlockInfo(Id); - if (text.textLabelComponent != null) text.textLabelComponent.text = value; + BlockEngine.SetBlockInfo(this, (ref TextLabelEntityViewStruct text, string val) => + { + if (text.textLabelComponent != null) text.textLabelComponent.text = val; + }, value); } } @@ -346,8 +348,8 @@ namespace GamecraftModdingAPI /// The SimBody of the cluster or null if the block doesn't exist. public SimBody GetSimBody() { - uint id = BlockEngine.GetBlockInfo(Id, out var exists).machineRigidBodyId; - return exists ? new SimBody(id) : null; + return BlockEngine.GetBlockInfo(this, + (GridConnectionsEntityStruct st) => new SimBody(st.machineRigidBodyId)); } public override string ToString() @@ -404,7 +406,9 @@ namespace GamecraftModdingAPI // So thanks to Microsoft, we've got this horrible implementation using reflection //Lets improve that using delegates - return New(Id.entityID, Id.groupID); + var block = New(Id.entityID, Id.groupID); + block.InitData = this.InitData; + return block; } #if DEBUG diff --git a/GamecraftModdingAPI/Blocks/BlockEngine.cs b/GamecraftModdingAPI/Blocks/BlockEngine.cs index 81a1630..d6f4907 100644 --- a/GamecraftModdingAPI/Blocks/BlockEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlockEngine.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using Gamecraft.Wires; @@ -10,14 +11,13 @@ using Svelto.DataStructures; using Svelto.ECS; using GamecraftModdingAPI.Engines; -using GamecraftModdingAPI.Utility; namespace GamecraftModdingAPI.Blocks { /// /// Engine for executing general block actions /// - public class BlockEngine : IApiEngine + public partial class BlockEngine : IApiEngine { public string Name { get; } = "GamecraftModdingAPIBlockGameEngine"; @@ -61,66 +61,54 @@ namespace GamecraftModdingAPI.Blocks color.paletteColour = paletteEntry.Colour; } - /// - /// Get a struct of a block. Can be used to set properties. - /// Returns a default value if not found. - /// - /// The block's ID - /// The struct to query - /// An editable reference to the struct public ref T GetBlockInfo(EGID blockID) where T : struct, IEntityComponent { - if (!Synced) - { - Sync(); - Synced = true; - } if (entitiesDB.Exists(blockID)) return ref entitiesDB.QueryEntity(blockID); T[] structHolder = new T[1]; //Create something that can be referenced return ref structHolder[0]; //Gets a default value automatically } - /// - /// Get a struct of a block. Can be used to set properties. - /// Returns a default value if not found. - /// - /// The block's ID - /// Whether the specified struct exists for the block - /// The struct to query - /// An editable reference to the struct - public ref T GetBlockInfo(EGID blockID, out bool exists) where T : struct, IEntityComponent + public U GetBlockInfo(Block block, Func getter, + U def = default) where T : struct, IEntityComponent { - if (!Synced) + if (entitiesDB.Exists(block.Id)) + return getter(entitiesDB.QueryEntity(block.Id)); + if (block.InitData.Group == null) return def; + var initializer = new EntityComponentInitializer(block.Id, block.InitData.Group); + if (initializer.Has()) + return getter(initializer.Get()); + return def; + } + + public delegate void Setter(ref T component, U value) where T : struct, IEntityComponent; + + public void SetBlockInfo(Block block, Setter setter, U value) where T : struct, IEntityComponent + { + if (entitiesDB.Exists(block.Id)) + setter(ref entitiesDB.QueryEntity(block.Id), value); + if (block.InitData.Group != null) { - Sync(); - Synced = true; + var initializer = new EntityComponentInitializer(block.Id, block.InitData.Group); + ref T structRef = ref (new T[1])[0]; //A reference for a default value for struct + setter(ref structRef, value); + initializer.Init(structRef); } - exists = entitiesDB.Exists(blockID); - if (exists) - return ref entitiesDB.QueryEntity(blockID); - T[] structHolder = new T[1]; - return ref structHolder[0]; } - public bool BlockExists(EGID id) + public bool BlockExists(EGID blockID) { - if (!Synced) - { - Sync(); - Synced = true; - } - return entitiesDB.Exists(id); + return entitiesDB.Exists(blockID); } - public bool GetBlockInfoExists(EGID blockID) where T : struct, IEntityComponent + public bool GetBlockInfoExists(Block block) where T : struct, IEntityComponent { - if (!Synced) - { - Sync(); - Synced = true; - } - return entitiesDB.Exists(blockID); + if (entitiesDB.Exists(block.Id)) + return true; + if (block.InitData.Group == null) + return false; + var init = new EntityComponentInitializer(block.Id, block.InitData.Group); + return init.Has(); } public SimBody[] GetSimBodiesFromID(byte id) @@ -183,17 +171,6 @@ namespace GamecraftModdingAPI.Blocks return null; } - /// - /// Synchronize newly created entity components with entities DB. - /// This forces a partial game tick, so it may be slow. - /// This also has the potential to make Gamecraft unstable. - /// Use this sparingly. - /// - private static void Sync() - { - DeterministicStepCompositionRootPatch.SubmitEntitiesNow(); - } - #if DEBUG public EntitiesDB GetEntitiesDB() { diff --git a/GamecraftModdingAPI/Blocks/BlockEngineInit.cs b/GamecraftModdingAPI/Blocks/BlockEngineInit.cs new file mode 100644 index 0000000..4be9a98 --- /dev/null +++ b/GamecraftModdingAPI/Blocks/BlockEngineInit.cs @@ -0,0 +1,46 @@ +using System; +using System.Linq.Expressions; + +using Svelto.DataStructures; +using Svelto.ECS; +using Svelto.ECS.Internal; + +namespace GamecraftModdingAPI.Blocks +{ + public partial class BlockEngine + { + internal struct BlockInitData + { + public FasterDictionary, ITypeSafeDictionary> Group; + } + + internal delegate FasterDictionary, ITypeSafeDictionary> GetInitGroup( + EntityComponentInitializer initializer); + + internal GetInitGroup InitGroup = CreateAccessor("_group"); + + //https://stackoverflow.com/questions/55878525/unit-testing-ref-structs-with-private-fields-via-reflection + internal static TDelegate CreateAccessor(string memberName) where TDelegate : Delegate + { + var invokeMethod = typeof(TDelegate).GetMethod("Invoke"); + if (invokeMethod == null) + throw new InvalidOperationException($"{typeof(TDelegate)} signature could not be determined."); + + var delegateParameters = invokeMethod.GetParameters(); + if (delegateParameters.Length != 1) + throw new InvalidOperationException("Delegate must have a single parameter."); + + var paramType = delegateParameters[0].ParameterType; + + var objParam = Expression.Parameter(paramType, "obj"); + var memberExpr = Expression.PropertyOrField(objParam, memberName); + Expression returnExpr = memberExpr; + if (invokeMethod.ReturnType != memberExpr.Type) + returnExpr = Expression.ConvertChecked(memberExpr, invokeMethod.ReturnType); + + var lambda = + Expression.Lambda(returnExpr, $"Access{paramType.Name}_{memberName}", new[] {objParam}); + return lambda.Compile(); + } + } +} \ No newline at end of file diff --git a/GamecraftModdingAPI/Blocks/BlockEventsEngine.cs b/GamecraftModdingAPI/Blocks/BlockEventsEngine.cs index 3c34b65..0a205f0 100644 --- a/GamecraftModdingAPI/Blocks/BlockEventsEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlockEventsEngine.cs @@ -1,9 +1,11 @@ using System; -using GamecraftModdingAPI.Engines; -using GamecraftModdingAPI.Utility; + using RobocraftX.Common; using Svelto.ECS; +using GamecraftModdingAPI.Engines; +using GamecraftModdingAPI.Utility; + namespace GamecraftModdingAPI.Blocks { public class BlockEventsEngine : IReactionaryEngine @@ -11,11 +13,18 @@ namespace GamecraftModdingAPI.Blocks public event EventHandler Placed; public event EventHandler Removed; + public BlockEventsEngine() + { + //Console.WriteLine("Creating BlockEventsEngine\n" + Environment.StackTrace); + } + public void Ready() { + //Console.WriteLine("BlockEventsEngine registered"); } public EntitiesDB entitiesDB { get; set; } + public void Dispose() { } @@ -23,17 +32,52 @@ namespace GamecraftModdingAPI.Blocks public string Name { get; } = "GamecraftModdingAPIBlockEventsEngine"; public bool isRemovable { get; } = false; + private bool shouldAddRemove; public void Add(ref DBEntityStruct entityComponent, EGID egid) { - ExceptionUtil.InvokeEvent(Placed, this, new BlockPlacedRemovedEventArgs {ID = egid, Type = (BlockIDs) entityComponent.DBID}); + if (!(shouldAddRemove = !shouldAddRemove)) + return; + ExceptionUtil.InvokeEvent(Placed, this, + new BlockPlacedRemovedEventArgs {ID = egid, Type = (BlockIDs) entityComponent.DBID}); } public void Remove(ref DBEntityStruct entityComponent, EGID egid) { - ExceptionUtil.InvokeEvent(Removed, this, new BlockPlacedRemovedEventArgs {ID = egid, Type = (BlockIDs) entityComponent.DBID}); + if (!(shouldAddRemove = !shouldAddRemove)) + return; + ExceptionUtil.InvokeEvent(Removed, this, + new BlockPlacedRemovedEventArgs {ID = egid, Type = (BlockIDs) entityComponent.DBID}); } } + /*[HarmonyPatch] + public static class TestPatch + { + public static void Postfix(FasterDictionary, FasterList> engines, + ExclusiveGroupStruct? previousGroup, in PlatformProfiler profiler, EGID egid) + { + if (!engines.TryGetValue(new RefWrapper(TypeSafeDictionary._type), out result)) + return; + } + public static MethodBase TargetMethod() + { + return AccessTools.Method("Svelto.ECS.Internal.TypeSafeDictionary:AddEntityComponentToEngines"); + } + }*/ + + /*[HarmonyPatch] + public static class TestPatch + { + public static void Postfix(EGID basePartEGID) + { + Console.WriteLine("Patched Add method: " + basePartEGID); + } + public static MethodBase TargetMethod() + { + return AccessTools.Method("RobocraftX.CR.MachineEditing.BuildBlockAdditionalPartEngine:Add"); + } + }*/ + public struct BlockPlacedRemovedEventArgs { public EGID ID; diff --git a/GamecraftModdingAPI/Blocks/BlockIDs.cs b/GamecraftModdingAPI/Blocks/BlockIDs.cs index b0eca31..596fb38 100644 --- a/GamecraftModdingAPI/Blocks/BlockIDs.cs +++ b/GamecraftModdingAPI/Blocks/BlockIDs.cs @@ -6,7 +6,7 @@ namespace GamecraftModdingAPI.Blocks public enum BlockIDs : ushort { /// - /// A custom value for the API. Doesn't exist for Gamecraft. + /// Called "nothing" in Gamecraft. (DBID.NOTHING) /// Invalid = ushort.MaxValue, AluminiumCube = 0, diff --git a/GamecraftModdingAPI/Blocks/ConsoleBlock.cs b/GamecraftModdingAPI/Blocks/ConsoleBlock.cs index e132029..4425a1e 100644 --- a/GamecraftModdingAPI/Blocks/ConsoleBlock.cs +++ b/GamecraftModdingAPI/Blocks/ConsoleBlock.cs @@ -14,18 +14,10 @@ namespace GamecraftModdingAPI.Blocks { public ConsoleBlock(EGID id): base(id) { - if (!BlockEngine.GetBlockInfoExists(this.Id)) - { - throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); - } } public ConsoleBlock(uint id): base(new EGID(id, CommonExclusiveGroups.BUILD_CONSOLE_BLOCK_GROUP)) { - if (!BlockEngine.GetBlockInfoExists(this.Id)) - { - throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); - } } // custom console block properties @@ -34,43 +26,47 @@ namespace GamecraftModdingAPI.Blocks { get { - return BlockEngine.GetBlockInfo(Id).commandName; + return BlockEngine.GetBlockInfo(this, (ConsoleBlockEntityStruct st) => st.commandName); } set { - BlockEngine.GetBlockInfo(Id).commandName.Set(value); + BlockEngine.SetBlockInfo(this, (ref ConsoleBlockEntityStruct st, string val) => st.commandName.Set(val), + value); } } public string Arg1 { - get => BlockEngine.GetBlockInfo(Id).arg1; + get => BlockEngine.GetBlockInfo(this, (ConsoleBlockEntityStruct st) => st.arg1); set { - BlockEngine.GetBlockInfo(Id).arg1.Set(value); + BlockEngine.SetBlockInfo(this, (ref ConsoleBlockEntityStruct st, string val) => st.arg1.Set(val), + value); } } public string Arg2 { - get => BlockEngine.GetBlockInfo(Id).arg2; + get => BlockEngine.GetBlockInfo(this, (ConsoleBlockEntityStruct st) => st.arg2); - set - { - BlockEngine.GetBlockInfo(Id).arg2.Set(value); - } + set + { + BlockEngine.SetBlockInfo(this, (ref ConsoleBlockEntityStruct st, string val) => st.arg2.Set(val), + value); + } } public string Arg3 { - get => BlockEngine.GetBlockInfo(Id).arg3; + get => BlockEngine.GetBlockInfo(this, (ConsoleBlockEntityStruct st) => st.arg3); - set - { - BlockEngine.GetBlockInfo(Id).arg3.Set(value); - } + set + { + BlockEngine.SetBlockInfo(this, (ref ConsoleBlockEntityStruct st, string val) => st.arg3.Set(val), + value); + } } } } diff --git a/GamecraftModdingAPI/Blocks/Motor.cs b/GamecraftModdingAPI/Blocks/Motor.cs index fde2920..fdadd26 100644 --- a/GamecraftModdingAPI/Blocks/Motor.cs +++ b/GamecraftModdingAPI/Blocks/Motor.cs @@ -13,18 +13,10 @@ namespace GamecraftModdingAPI.Blocks { public Motor(EGID id) : base(id) { - if (!BlockEngine.GetBlockInfoExists(this.Id)) - { - throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); - } } public Motor(uint id): base(new EGID(id, CommonExclusiveGroups.BUILD_MOTOR_BLOCK_GROUP)) { - if (!BlockEngine.GetBlockInfoExists(this.Id)) - { - throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); - } } // custom motor properties @@ -36,13 +28,12 @@ namespace GamecraftModdingAPI.Blocks { get { - return BlockEngine.GetBlockInfo(Id).maxVelocity; + return BlockEngine.GetBlockInfo(this, (MotorReadOnlyStruct st) => st.maxVelocity); } set { - ref MotorReadOnlyStruct motor = ref BlockEngine.GetBlockInfo(Id); - motor.maxVelocity = value; + BlockEngine.SetBlockInfo(this, (ref MotorReadOnlyStruct st, float val) => st.maxVelocity = val, value); } } @@ -53,13 +44,12 @@ namespace GamecraftModdingAPI.Blocks { get { - return BlockEngine.GetBlockInfo(Id).maxForce; + return BlockEngine.GetBlockInfo(this, (MotorReadOnlyStruct st) => st.maxForce); } set { - ref MotorReadOnlyStruct motor = ref BlockEngine.GetBlockInfo(Id); - motor.maxForce = value; + BlockEngine.SetBlockInfo(this, (ref MotorReadOnlyStruct st, float val) => st.maxForce = val, value); } } @@ -70,13 +60,12 @@ namespace GamecraftModdingAPI.Blocks { get { - return BlockEngine.GetBlockInfo(Id).reverse; + return BlockEngine.GetBlockInfo(this, (MotorReadOnlyStruct st) => st.reverse); } set { - ref MotorReadOnlyStruct motor = ref BlockEngine.GetBlockInfo(Id); - motor.reverse = value; + BlockEngine.SetBlockInfo(this, (ref MotorReadOnlyStruct st, bool val) => st.reverse = val, value); } } } diff --git a/GamecraftModdingAPI/Blocks/ObjectIdentifier.cs b/GamecraftModdingAPI/Blocks/ObjectIdentifier.cs index 9af96c2..0dc835a 100644 --- a/GamecraftModdingAPI/Blocks/ObjectIdentifier.cs +++ b/GamecraftModdingAPI/Blocks/ObjectIdentifier.cs @@ -8,27 +8,22 @@ namespace GamecraftModdingAPI.Blocks { public ObjectIdentifier(EGID id) : base(id) { - if (!BlockEngine.GetBlockInfoExists(Id)) - { - throw new BlockTypeException($"Block is not a {GetType().Name} block"); - } } public ObjectIdentifier(uint id) : base(new EGID(id, CommonExclusiveGroups.BUILD_OBJID_BLOCK_GROUP)) { - if (!BlockEngine.GetBlockInfoExists(Id)) - { - throw new BlockTypeException($"Block is not a {GetType().Name} block"); - } } public char Identifier { - get => (char) (BlockEngine.GetBlockInfo(Id).objectId + 'A'); + get => (char) BlockEngine.GetBlockInfo(this, (ObjectIdEntityStruct st) => st.objectId + 'A'); set { - BlockEngine.GetBlockInfo(Id).objectId = (byte) (value - 'A'); - Label = value + ""; //The label isn't updated automatically + BlockEngine.SetBlockInfo(this, (ref ObjectIdEntityStruct st, char val) => + { + st.objectId = (byte) (val - 'A'); + Label = val + ""; //The label isn't updated automatically + }, value); } } @@ -37,7 +32,7 @@ namespace GamecraftModdingAPI.Blocks /// public byte SimID { - get => BlockEngine.GetBlockInfo(Id).simObjectId; + get => BlockEngine.GetBlockInfo(this, (ObjectIdEntityStruct st) => st.simObjectId); } /// diff --git a/GamecraftModdingAPI/Blocks/Piston.cs b/GamecraftModdingAPI/Blocks/Piston.cs index 2586b60..aed8c33 100644 --- a/GamecraftModdingAPI/Blocks/Piston.cs +++ b/GamecraftModdingAPI/Blocks/Piston.cs @@ -13,18 +13,10 @@ namespace GamecraftModdingAPI.Blocks { public Piston(EGID id) : base(id) { - if (!BlockEngine.GetBlockInfoExists(this.Id)) - { - throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); - } } public Piston(uint id) : base(new EGID(id, CommonExclusiveGroups.BUILD_PISTON_BLOCK_GROUP)) { - if (!BlockEngine.GetBlockInfoExists(this.Id)) - { - throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); - } } // custom piston properties @@ -33,13 +25,13 @@ namespace GamecraftModdingAPI.Blocks /// The piston's max extension distance. /// public float MaximumExtension - { - get => BlockEngine.GetBlockInfo(Id).maxDeviation; + { + get => BlockEngine.GetBlockInfo(this, (PistonReadOnlyStruct st) => st.maxDeviation); set { - ref PistonReadOnlyStruct piston = ref BlockEngine.GetBlockInfo(Id); - piston.maxDeviation = value; + BlockEngine.SetBlockInfo(this, (ref PistonReadOnlyStruct st, float val) => st.maxDeviation = val, + value); } } @@ -47,13 +39,12 @@ namespace GamecraftModdingAPI.Blocks /// The piston's max extension force. /// public float MaximumForce - { - get => BlockEngine.GetBlockInfo(Id).maxForce; + { + get => BlockEngine.GetBlockInfo(this, (PistonReadOnlyStruct st) => st.maxForce); set { - ref PistonReadOnlyStruct piston = ref BlockEngine.GetBlockInfo(Id); - piston.maxForce = value; + BlockEngine.SetBlockInfo(this, (ref PistonReadOnlyStruct st, float val) => st.maxForce = val, value); } } } diff --git a/GamecraftModdingAPI/Blocks/PlacementEngine.cs b/GamecraftModdingAPI/Blocks/PlacementEngine.cs index 2297d90..61834b0 100644 --- a/GamecraftModdingAPI/Blocks/PlacementEngine.cs +++ b/GamecraftModdingAPI/Blocks/PlacementEngine.cs @@ -40,15 +40,16 @@ namespace GamecraftModdingAPI.Blocks private static BlockEntityFactory _blockEntityFactory; //Injected from PlaceBlockEngine public EGID PlaceBlock(BlockIDs block, BlockColors color, byte darkness, float3 position, int uscale, - float3 scale, Player player, float3 rotation) + float3 scale, Player player, float3 rotation, out EntityComponentInitializer initializer) { //It appears that only the non-uniform scale has any visible effect, but if that's not given here it will be set to the uniform one if (darkness > 9) throw new Exception("That is too dark. Make sure to use 0-9 as darkness. (0 is default.)"); - return BuildBlock((ushort) block, (byte) (color + darkness * 10), position, uscale, scale, rotation, + initializer = BuildBlock((ushort) block, (byte) (color + darkness * 10), position, uscale, scale, rotation, (player ?? new Player(PlayerType.Local)).Id); + return initializer.EGID; } - private EGID BuildBlock(ushort block, byte color, float3 position, int uscale, float3 scale, float3 rot, uint playerId) + private EntityComponentInitializer BuildBlock(ushort block, byte color, float3 position, int uscale, float3 scale, float3 rot, uint playerId) { if (_blockEntityFactory == null) throw new Exception("The factory is null."); @@ -107,7 +108,7 @@ namespace GamecraftModdingAPI.Blocks pickedBlock.placedBlockEntityID = structInitializer.EGID; pickedBlock.placedBlockWasAPickedBlock = false; Block.BlockEngine.Synced = false; // Block entities will need to be submitted before properties can be used - return structInitializer.EGID; + return structInitializer; } public string Name { get; } = "GamecraftModdingAPIPlacementGameEngine"; diff --git a/GamecraftModdingAPI/Blocks/Servo.cs b/GamecraftModdingAPI/Blocks/Servo.cs index c4b57fb..730749a 100644 --- a/GamecraftModdingAPI/Blocks/Servo.cs +++ b/GamecraftModdingAPI/Blocks/Servo.cs @@ -13,18 +13,10 @@ namespace GamecraftModdingAPI.Blocks { public Servo(EGID id) : base(id) { - if (!BlockEngine.GetBlockInfoExists(this.Id)) - { - throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); - } } public Servo(uint id) : base(new EGID(id, CommonExclusiveGroups.BUILD_SERVO_BLOCK_GROUP)) { - if (!BlockEngine.GetBlockInfoExists(this.Id)) - { - throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); - } } // custom servo properties @@ -33,13 +25,12 @@ namespace GamecraftModdingAPI.Blocks /// The servo's minimum angle. /// public float MinimumAngle - { - get => BlockEngine.GetBlockInfo(Id).minDeviation; + { + get => BlockEngine.GetBlockInfo(this, (ServoReadOnlyStruct st) => st.minDeviation); set { - ref ServoReadOnlyStruct servo = ref BlockEngine.GetBlockInfo(Id); - servo.minDeviation = value; + BlockEngine.SetBlockInfo(this, (ref ServoReadOnlyStruct st, float val) => st.minDeviation = val, value); } } @@ -48,13 +39,12 @@ namespace GamecraftModdingAPI.Blocks /// public float MaximumAngle { - get => BlockEngine.GetBlockInfo(Id).maxDeviation; + get => BlockEngine.GetBlockInfo(this, (ServoReadOnlyStruct st) => st.maxDeviation); - set - { - ref ServoReadOnlyStruct servo = ref BlockEngine.GetBlockInfo(Id); - servo.maxDeviation = value; - } + set + { + BlockEngine.SetBlockInfo(this, (ref ServoReadOnlyStruct st, float val) => st.maxDeviation = val, value); + } } /// @@ -62,13 +52,12 @@ namespace GamecraftModdingAPI.Blocks /// public float MaximumForce { - get => BlockEngine.GetBlockInfo(Id).maxForce; + get => BlockEngine.GetBlockInfo(this, (ServoReadOnlyStruct st) => st.maxForce); - set - { - ref ServoReadOnlyStruct servo = ref BlockEngine.GetBlockInfo(Id); - servo.maxForce = value; - } + set + { + BlockEngine.SetBlockInfo(this, (ref ServoReadOnlyStruct st, float val) => st.maxForce = val, value); + } } /// @@ -76,13 +65,12 @@ namespace GamecraftModdingAPI.Blocks /// public bool Reverse { - get => BlockEngine.GetBlockInfo(Id).reverse; + get => BlockEngine.GetBlockInfo(this, (ServoReadOnlyStruct st) => st.reverse); - set - { - ref ServoReadOnlyStruct servo = ref BlockEngine.GetBlockInfo(Id); - servo.reverse = value; - } + set + { + BlockEngine.SetBlockInfo(this, (ref ServoReadOnlyStruct st, bool val) => st.reverse = val, value); + } } } } diff --git a/GamecraftModdingAPI/Blocks/SignalingBlock.cs b/GamecraftModdingAPI/Blocks/SignalingBlock.cs index 8a62d64..149e450 100644 --- a/GamecraftModdingAPI/Blocks/SignalingBlock.cs +++ b/GamecraftModdingAPI/Blocks/SignalingBlock.cs @@ -16,7 +16,7 @@ namespace GamecraftModdingAPI.Blocks { public SignalingBlock(EGID id) : base(id) { - if (!BlockEngine.GetBlockInfoExists(this.Id)) + if (!BlockEngine.GetBlockInfoExists(this)) { throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); } @@ -24,17 +24,12 @@ namespace GamecraftModdingAPI.Blocks public SignalingBlock(uint id) : base(id) { - if (!BlockEngine.GetBlockInfoExists(this.Id)) + if (!BlockEngine.GetBlockInfoExists(this)) { throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); } } - protected ref BlockPortsStruct GetBlockPortsStruct() - { - return ref BlockEngine.GetBlockInfo(Id); - } - /// /// Generates the input port identifiers. /// @@ -53,16 +48,6 @@ namespace GamecraftModdingAPI.Blocks return SignalEngine.GetSignalOutputs(Id); } - /// - /// Gets the port struct. - /// - /// The port struct. - /// Port identifier. - protected ref PortEntityStruct GetPortStruct(EGID portId) - { - return ref BlockEngine.GetBlockInfo(portId); - } - /// /// Gets the connected wire. /// @@ -89,16 +74,16 @@ namespace GamecraftModdingAPI.Blocks /// The input port count. /// public uint InputCount - { - get => GetBlockPortsStruct().inputCount; - } + { + get => BlockEngine.GetBlockInfo(this, (BlockPortsStruct st) => st.inputCount); + } /// /// The output port count. /// public uint OutputCount { - get => GetBlockPortsStruct().outputCount; + get => BlockEngine.GetBlockInfo(this, (BlockPortsStruct st) => st.outputCount); } } } diff --git a/GamecraftModdingAPI/Blocks/SpawnPoint.cs b/GamecraftModdingAPI/Blocks/SpawnPoint.cs index 4419e38..7616acb 100644 --- a/GamecraftModdingAPI/Blocks/SpawnPoint.cs +++ b/GamecraftModdingAPI/Blocks/SpawnPoint.cs @@ -15,18 +15,10 @@ namespace GamecraftModdingAPI.Blocks { public SpawnPoint(EGID id) : base(id) { - if (!BlockEngine.GetBlockInfoExists(this.Id)) - { - throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); - } } public SpawnPoint(uint id) : base(new EGID(id, CommonExclusiveGroups.BUILD_SPAWNPOINT_BLOCK_GROUP)) { - if (!BlockEngine.GetBlockInfoExists(this.Id)) - { - throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); - } } // custom spawn point properties @@ -36,16 +28,12 @@ namespace GamecraftModdingAPI.Blocks /// public uint Lives { - get - { - return BlockEngine.GetBlockInfo(Id).lives; - } + get => BlockEngine.GetBlockInfo(this, (SpawnPointStatsEntityStruct st) => st.lives); - set - { - ref SpawnPointStatsEntityStruct spses = ref BlockEngine.GetBlockInfo(Id); - spses.lives = value; - } + set + { + BlockEngine.SetBlockInfo(this, (ref SpawnPointStatsEntityStruct st, uint val) => st.lives = val, value); + } } /// @@ -53,16 +41,12 @@ namespace GamecraftModdingAPI.Blocks /// public bool Damageable { - get - { - return BlockEngine.GetBlockInfo(Id).canTakeDamage; - } + get => BlockEngine.GetBlockInfo(this, (SpawnPointStatsEntityStruct st) => st.canTakeDamage); - set - { - ref SpawnPointStatsEntityStruct spses = ref BlockEngine.GetBlockInfo(Id); - spses.canTakeDamage = value; - } + set + { + BlockEngine.SetBlockInfo(this, (ref SpawnPointStatsEntityStruct st, bool val) => st.canTakeDamage = val, value); + } } /// @@ -70,16 +54,12 @@ namespace GamecraftModdingAPI.Blocks /// public bool GameOverEnabled { - get - { - return BlockEngine.GetBlockInfo(Id).gameOverScreen; - } + get => BlockEngine.GetBlockInfo(this, (SpawnPointStatsEntityStruct st) => st.gameOverScreen); - set - { - ref SpawnPointStatsEntityStruct spses = ref BlockEngine.GetBlockInfo(Id); - spses.gameOverScreen = value; - } + set + { + BlockEngine.SetBlockInfo(this, (ref SpawnPointStatsEntityStruct st, bool val) => st.gameOverScreen = val, value); + } } /// @@ -87,16 +67,12 @@ namespace GamecraftModdingAPI.Blocks /// public byte Team { - get - { - return BlockEngine.GetBlockInfo(Id).teamId; - } + get => BlockEngine.GetBlockInfo(this, (SpawnPointIdsEntityStruct st) => st.teamId); - set - { - ref SpawnPointIdsEntityStruct spses = ref BlockEngine.GetBlockInfo(Id); - spses.teamId = value; - } + set + { + BlockEngine.SetBlockInfo(this, (ref SpawnPointIdsEntityStruct st, byte val) => st.teamId = val, value); + } } } } diff --git a/GamecraftModdingAPI/Blocks/TextBlock.cs b/GamecraftModdingAPI/Blocks/TextBlock.cs index 94cf212..6096dd4 100644 --- a/GamecraftModdingAPI/Blocks/TextBlock.cs +++ b/GamecraftModdingAPI/Blocks/TextBlock.cs @@ -14,18 +14,10 @@ namespace GamecraftModdingAPI.Blocks { public TextBlock(EGID id) : base(id) { - if (!BlockEngine.GetBlockInfoExists(this.Id)) - { - throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); - } } public TextBlock(uint id) : base(new EGID(id, CommonExclusiveGroups.BUILD_TEXT_BLOCK_GROUP)) { - if (!BlockEngine.GetBlockInfoExists(this.Id)) - { - throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); - } } // custom text block properties @@ -35,35 +27,34 @@ namespace GamecraftModdingAPI.Blocks /// public string Text { - get - { - return BlockEngine.GetBlockInfo(Id).textCurrent; - } + get => BlockEngine.GetBlockInfo(this, (TextBlockDataStruct st) => st.textCurrent); - set - { - ref TextBlockDataStruct tbds = ref BlockEngine.GetBlockInfo(Id); - tbds.textCurrent.Set(value); - tbds.textStored.Set(value); - BlockEngine.GetBlockInfo(Id).newTextBlockStringContent.Set(value); - } - } + set + { + BlockEngine.SetBlockInfo(this, (ref TextBlockDataStruct tbds, string val) => + { + tbds.textCurrent.Set(val); + tbds.textStored.Set(val); + }, value); + BlockEngine.SetBlockInfo(this, + (ref TextBlockNetworkDataStruct st, string val) => st.newTextBlockStringContent.Set(val), value); + } + } /// - /// The text block's current text block ID (used in ChangeTextBlockCommand). + /// The text block's current text block ID (used in ChangeTextBlockCommand). /// - public string TextBlockId + public string TextBlockId { - get - { - return BlockEngine.GetBlockInfo(Id).textBlockID; - } + get => BlockEngine.GetBlockInfo(this, (TextBlockDataStruct st) => st.textBlockID); - set - { - BlockEngine.GetBlockInfo(Id).textBlockID.Set(value); - BlockEngine.GetBlockInfo(Id).newTextBlockID.Set(value); - } + set + { + BlockEngine.SetBlockInfo(this, (ref TextBlockDataStruct tbds, string val) => + tbds.textBlockID.Set(val), value); + BlockEngine.SetBlockInfo(this, + (ref TextBlockNetworkDataStruct st, string val) => st.newTextBlockID.Set(val), value); + } } } } diff --git a/GamecraftModdingAPI/Blocks/Timer.cs b/GamecraftModdingAPI/Blocks/Timer.cs index 2acab5b..5766a41 100644 --- a/GamecraftModdingAPI/Blocks/Timer.cs +++ b/GamecraftModdingAPI/Blocks/Timer.cs @@ -15,18 +15,10 @@ namespace GamecraftModdingAPI.Blocks { public Timer(EGID id) : base(id) { - if (!BlockEngine.GetBlockInfoExists(this.Id)) - { - throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); - } } public Timer(uint id) : base(new EGID(id, CommonExclusiveGroups.BUILD_TIMER_BLOCK_GROUP)) { - if (!BlockEngine.GetBlockInfoExists(this.Id)) - { - throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); - } } // custom timer properties @@ -36,16 +28,13 @@ namespace GamecraftModdingAPI.Blocks /// public float Start { - get - { - return BlockEngine.GetBlockInfo(Id).startTime; - } + get => BlockEngine.GetBlockInfo(this, (TimerBlockDataStruct st) => st.startTime); - set - { - ref TimerBlockDataStruct tbds = ref BlockEngine.GetBlockInfo(Id); - tbds.startTime = value; - } + set + { + BlockEngine.SetBlockInfo(this, (ref TimerBlockDataStruct tbds, float val) => tbds.startTime = val, + value); + } } /// @@ -53,16 +42,13 @@ namespace GamecraftModdingAPI.Blocks /// public float End { - get - { - return BlockEngine.GetBlockInfo(Id).endTime; - } + get => BlockEngine.GetBlockInfo(this, (TimerBlockDataStruct st) => st.endTime); - set - { - ref TimerBlockDataStruct tbds = ref BlockEngine.GetBlockInfo(Id); - tbds.endTime = value; - } + set + { + BlockEngine.SetBlockInfo(this, (ref TimerBlockDataStruct tbds, float val) => tbds.endTime = val, + value); + } } /// @@ -70,16 +56,13 @@ namespace GamecraftModdingAPI.Blocks /// public bool DisplayMilliseconds { - get - { - return BlockEngine.GetBlockInfo(Id).outputFormatHasMS; - } + get => BlockEngine.GetBlockInfo(this, (TimerBlockDataStruct st) => st.outputFormatHasMS); - set - { - ref TimerBlockDataStruct tbds = ref BlockEngine.GetBlockInfo(Id); - tbds.outputFormatHasMS = value; - } + set + { + BlockEngine.SetBlockInfo(this, (ref TimerBlockDataStruct tbds, bool val) => tbds.outputFormatHasMS = val, + value); + } } /// @@ -87,16 +70,13 @@ namespace GamecraftModdingAPI.Blocks /// public int CurrentTime { - get - { - return BlockEngine.GetBlockInfo(Id).timeLastRenderFrameMS; - } + get => BlockEngine.GetBlockInfo(this, (TimerBlockLabelCacheEntityStruct st) => st.timeLastRenderFrameMS); - set - { - ref TimerBlockLabelCacheEntityStruct tblces = ref BlockEngine.GetBlockInfo(Id); - tblces.timeLastRenderFrameMS = value; - } + set + { + BlockEngine.SetBlockInfo(this, (ref TimerBlockLabelCacheEntityStruct tbds, int val) => tbds.timeLastRenderFrameMS = val, + value); + } } } } -- 2.30.2 From 5e335e78ffa99f8726aefa2e24f54d61e3de7808 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Wed, 15 Jul 2020 22:46:48 +0200 Subject: [PATCH 082/252] Implement init for position and rotation --- GamecraftModdingAPI/Block.cs | 8 ++--- GamecraftModdingAPI/Blocks/ConsoleBlock.cs | 3 ++ GamecraftModdingAPI/Blocks/MovementEngine.cs | 19 ++++++++-- GamecraftModdingAPI/Blocks/RotationEngine.cs | 38 ++++++++++++++------ 4 files changed, 52 insertions(+), 16 deletions(-) diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index c3e0393..f334c30 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -209,10 +209,10 @@ namespace GamecraftModdingAPI /// public float3 Position { - get => Exists ? MovementEngine.GetPosition(Id) : float3.zero; + get => MovementEngine.GetPosition(Id, InitData); set { - if (Exists) MovementEngine.MoveBlock(Id, value); + MovementEngine.MoveBlock(Id, InitData, value); } } @@ -221,10 +221,10 @@ namespace GamecraftModdingAPI /// public float3 Rotation { - get => Exists ? RotationEngine.GetRotation(Id) : float3.zero; + get => RotationEngine.GetRotation(Id, InitData); set { - if (Exists) RotationEngine.RotateBlock(Id, value); + RotationEngine.RotateBlock(Id, InitData, value); } } diff --git a/GamecraftModdingAPI/Blocks/ConsoleBlock.cs b/GamecraftModdingAPI/Blocks/ConsoleBlock.cs index 4425a1e..edf3e76 100644 --- a/GamecraftModdingAPI/Blocks/ConsoleBlock.cs +++ b/GamecraftModdingAPI/Blocks/ConsoleBlock.cs @@ -22,6 +22,9 @@ namespace GamecraftModdingAPI.Blocks // custom console block properties + /// + /// Setting a nonexistent command will crash the game when switching to simulation + /// public string Command { get diff --git a/GamecraftModdingAPI/Blocks/MovementEngine.cs b/GamecraftModdingAPI/Blocks/MovementEngine.cs index 0ff119a..a4ac0fa 100644 --- a/GamecraftModdingAPI/Blocks/MovementEngine.cs +++ b/GamecraftModdingAPI/Blocks/MovementEngine.cs @@ -35,8 +35,17 @@ namespace GamecraftModdingAPI.Blocks // implementations for Movement static class - public float3 MoveBlock(EGID blockID, float3 vector) + internal float3 MoveBlock(EGID blockID, BlockEngine.BlockInitData data, float3 vector) { + if (!entitiesDB.Exists(blockID)) + { + if (data.Group == null) return float3.zero; + var init = new EntityComponentInitializer(blockID, data.Group); + init.Init(new PositionEntityStruct {position = vector}); + init.Init(new GridRotationStruct {position = vector}); + init.Init(new LocalTransformEntityStruct {position = vector}); + return vector; + } ref PositionEntityStruct posStruct = ref this.entitiesDB.QueryEntity(blockID); ref GridRotationStruct gridStruct = ref this.entitiesDB.QueryEntity(blockID); ref LocalTransformEntityStruct transStruct = ref this.entitiesDB.QueryEntity(blockID); @@ -56,8 +65,14 @@ namespace GamecraftModdingAPI.Blocks return posStruct.position; } - public float3 GetPosition(EGID blockID) + internal float3 GetPosition(EGID blockID, BlockEngine.BlockInitData data) { + if (!entitiesDB.Exists(blockID)) + { + if (data.Group == null) return float3.zero; + var init = new EntityComponentInitializer(blockID, data.Group); + return init.Has() ? init.Get().position : float3.zero; + } ref PositionEntityStruct posStruct = ref this.entitiesDB.QueryEntity(blockID); return posStruct.position; } diff --git a/GamecraftModdingAPI/Blocks/RotationEngine.cs b/GamecraftModdingAPI/Blocks/RotationEngine.cs index e9cd1ef..ca97874 100644 --- a/GamecraftModdingAPI/Blocks/RotationEngine.cs +++ b/GamecraftModdingAPI/Blocks/RotationEngine.cs @@ -35,23 +35,32 @@ namespace GamecraftModdingAPI.Blocks // implementations for Rotation static class - public float3 RotateBlock(EGID blockID, Vector3 vector) + internal float3 RotateBlock(EGID blockID, BlockEngine.BlockInitData data, Vector3 vector) { + if (!entitiesDB.Exists(blockID)) + { + if (data.Group == null) return float3.zero; + var init = new EntityComponentInitializer(blockID, data.Group); + init.Init(new RotationEntityStruct {rotation = new Quaternion {eulerAngles = vector}}); + init.Init(new GridRotationStruct {rotation = new Quaternion {eulerAngles = vector}}); + init.Init(new LocalTransformEntityStruct {rotation = new Quaternion {eulerAngles = vector}}); + return vector; + } ref RotationEntityStruct rotStruct = ref this.entitiesDB.QueryEntity(blockID); ref GridRotationStruct gridStruct = ref this.entitiesDB.QueryEntity(blockID); ref LocalTransformEntityStruct transStruct = ref this.entitiesDB.QueryEntity(blockID); ref UECSPhysicsEntityStruct phyStruct = ref this.entitiesDB.QueryEntity(blockID); // main (persistent) position - Quaternion newRotation = (Quaternion)rotStruct.rotation; - newRotation.eulerAngles += vector; - rotStruct.rotation = (quaternion)newRotation; + Quaternion newRotation = rotStruct.rotation; + newRotation.eulerAngles = vector; + rotStruct.rotation = newRotation; // placement grid rotation - Quaternion newGridRotation = (Quaternion)gridStruct.rotation; - newGridRotation.eulerAngles += vector; - gridStruct.rotation = (quaternion)newGridRotation; + Quaternion newGridRotation = gridStruct.rotation; + newGridRotation.eulerAngles = vector; + gridStruct.rotation = newGridRotation; // rendered position - Quaternion newTransRotation = (Quaternion)rotStruct.rotation; - newTransRotation.eulerAngles += vector; + Quaternion newTransRotation = rotStruct.rotation; + newTransRotation.eulerAngles = vector; transStruct.rotation = newTransRotation; // collision position FullGameFields._physicsWorld.EntityManager.SetComponentData(phyStruct.uecsEntity, new Unity.Transforms.Rotation @@ -63,8 +72,17 @@ namespace GamecraftModdingAPI.Blocks } - public float3 GetRotation(EGID blockID) + internal float3 GetRotation(EGID blockID, BlockEngine.BlockInitData data) { + if (!entitiesDB.Exists(blockID)) + { + if (data.Group == null) return float3.zero; + var init = new EntityComponentInitializer(blockID, data.Group); + return init.Has() + ? (float3) ((Quaternion) init.Get().rotation).eulerAngles + : float3.zero; + } + ref RotationEntityStruct rotStruct = ref entitiesDB.QueryEntity(blockID); return ((Quaternion) rotStruct.rotation).eulerAngles; } -- 2.30.2 From 5264d98ce71d8e9be46d3bfe0e676b7014c32d71 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sun, 19 Jul 2020 01:13:39 +0200 Subject: [PATCH 083/252] Test fixes, block event Block property Fixed Assert.Equal() Changed tests to reflect changes Added Block property to the block event args Completely removed sync things --- GamecraftModdingAPI/Block.cs | 4 +- GamecraftModdingAPI/Blocks/BlockEngine.cs | 2 - .../Blocks/BlockEventsEngine.cs | 37 ++----------------- GamecraftModdingAPI/Blocks/BlockTests.cs | 6 +-- GamecraftModdingAPI/Blocks/PlacementEngine.cs | 1 - GamecraftModdingAPI/SimBody.cs | 2 +- GamecraftModdingAPI/Tests/Assert.cs | 24 +----------- .../Tests/GamecraftModdingAPIPluginTest.cs | 2 +- .../DeterministicStepCompositionRootPatch.cs | 25 ------------- 9 files changed, 12 insertions(+), 91 deletions(-) delete mode 100644 GamecraftModdingAPI/Utility/DeterministicStepCompositionRootPatch.cs diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index f334c30..ade9f9b 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -342,10 +342,10 @@ namespace GamecraftModdingAPI public bool Remove() => RemovalEngine.RemoveBlock(Id); /// - /// Returns the rigid body of the cluster of blocks this one belongs to during simulation. + /// Returns the rigid body of the chunk of blocks this one belongs to during simulation. /// Can be used to apply forces or move the block around while the simulation is running. /// - /// The SimBody of the cluster or null if the block doesn't exist. + /// The SimBody of the chunk or null if the block doesn't exist. public SimBody GetSimBody() { return BlockEngine.GetBlockInfo(this, diff --git a/GamecraftModdingAPI/Blocks/BlockEngine.cs b/GamecraftModdingAPI/Blocks/BlockEngine.cs index d6f4907..375620e 100644 --- a/GamecraftModdingAPI/Blocks/BlockEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlockEngine.cs @@ -25,8 +25,6 @@ namespace GamecraftModdingAPI.Blocks public bool isRemovable => false; - internal bool Synced = true; - public void Dispose() { } diff --git a/GamecraftModdingAPI/Blocks/BlockEventsEngine.cs b/GamecraftModdingAPI/Blocks/BlockEventsEngine.cs index 0a205f0..1e5ce21 100644 --- a/GamecraftModdingAPI/Blocks/BlockEventsEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlockEventsEngine.cs @@ -13,14 +13,8 @@ namespace GamecraftModdingAPI.Blocks public event EventHandler Placed; public event EventHandler Removed; - public BlockEventsEngine() - { - //Console.WriteLine("Creating BlockEventsEngine\n" + Environment.StackTrace); - } - public void Ready() { - //Console.WriteLine("BlockEventsEngine registered"); } public EntitiesDB entitiesDB { get; set; } @@ -50,37 +44,12 @@ namespace GamecraftModdingAPI.Blocks } } - /*[HarmonyPatch] - public static class TestPatch - { - public static void Postfix(FasterDictionary, FasterList> engines, - ExclusiveGroupStruct? previousGroup, in PlatformProfiler profiler, EGID egid) - { - if (!engines.TryGetValue(new RefWrapper(TypeSafeDictionary._type), out result)) - return; - } - public static MethodBase TargetMethod() - { - return AccessTools.Method("Svelto.ECS.Internal.TypeSafeDictionary:AddEntityComponentToEngines"); - } - }*/ - - /*[HarmonyPatch] - public static class TestPatch - { - public static void Postfix(EGID basePartEGID) - { - Console.WriteLine("Patched Add method: " + basePartEGID); - } - public static MethodBase TargetMethod() - { - return AccessTools.Method("RobocraftX.CR.MachineEditing.BuildBlockAdditionalPartEngine:Add"); - } - }*/ - public struct BlockPlacedRemovedEventArgs { public EGID ID; public BlockIDs Type; + private Block block; + + public Block Block => block ?? (block = new Block(ID)); } } \ No newline at end of file diff --git a/GamecraftModdingAPI/Blocks/BlockTests.cs b/GamecraftModdingAPI/Blocks/BlockTests.cs index 3b66f28..85328d2 100644 --- a/GamecraftModdingAPI/Blocks/BlockTests.cs +++ b/GamecraftModdingAPI/Blocks/BlockTests.cs @@ -22,11 +22,11 @@ namespace GamecraftModdingAPI.Blocks } [APITestCase(TestType.EditMode)] - public static void TestSync() + public static void TestInitProperty() { Block newBlock = Block.PlaceNew(BlockIDs.AluminiumCube, Unity.Mathematics.float3.zero + 2); if (!Assert.CloseTo(newBlock.Position, (Unity.Mathematics.float3.zero + 2), $"Newly placed block at {newBlock.Position} is expected at {Unity.Mathematics.float3.zero + 2}.", "Newly placed block position matches.")) return; - Assert.Equal(newBlock.Exists, true, "Newly placed block does not exist, possibly because Sync() skipped/missed/failed.", "Newly placed block exists, Sync() successful."); + //Assert.Equal(newBlock.Exists, true, "Newly placed block does not exist, possibly because Sync() skipped/missed/failed.", "Newly placed block exists, Sync() successful."); } [APITestCase(TestType.EditMode)] @@ -34,7 +34,7 @@ namespace GamecraftModdingAPI.Blocks { TextBlock textBlock = null; // Note: the assignment operation is a lambda, which slightly confuses the compiler Assert.Errorless(() => { textBlock = Block.PlaceNew(BlockIDs.TextBlock, Unity.Mathematics.float3.zero + 1); }, "Block.PlaceNew() raised an exception: ", "Block.PlaceNew() completed without issue."); - if (!Assert.NotNull(textBlock, "Block.Specialize() returned null, possibly because it failed silently.", "Specialized TextBlock is not null.")) return; + if (!Assert.NotNull(textBlock, "Block.PlaceNew() returned null, possibly because it failed silently.", "Specialized TextBlock is not null.")) return; if (!Assert.NotNull(textBlock.Text, "TextBlock.Text is null, possibly because it failed silently.", "TextBlock.Text is not null.")) return; if (!Assert.NotNull(textBlock.TextBlockId, "TextBlock.TextBlockId is null, possibly because it failed silently.", "TextBlock.TextBlockId is not null.")) return; } diff --git a/GamecraftModdingAPI/Blocks/PlacementEngine.cs b/GamecraftModdingAPI/Blocks/PlacementEngine.cs index 61834b0..e111598 100644 --- a/GamecraftModdingAPI/Blocks/PlacementEngine.cs +++ b/GamecraftModdingAPI/Blocks/PlacementEngine.cs @@ -107,7 +107,6 @@ namespace GamecraftModdingAPI.Blocks ref PickedBlockExtraDataStruct pickedBlock = ref entitiesDB.QueryEntity(playerEGID); pickedBlock.placedBlockEntityID = structInitializer.EGID; pickedBlock.placedBlockWasAPickedBlock = false; - Block.BlockEngine.Synced = false; // Block entities will need to be submitted before properties can be used return structInitializer; } diff --git a/GamecraftModdingAPI/SimBody.cs b/GamecraftModdingAPI/SimBody.cs index 420a655..19f4285 100644 --- a/GamecraftModdingAPI/SimBody.cs +++ b/GamecraftModdingAPI/SimBody.cs @@ -9,7 +9,7 @@ using RobocraftX.Physics; namespace GamecraftModdingAPI { /// - /// A rigid body (like a cluster of connected blocks) during simulation. + /// A rigid body (like a chunk of connected blocks) during simulation. /// public class SimBody : IEquatable, IEquatable { diff --git a/GamecraftModdingAPI/Tests/Assert.cs b/GamecraftModdingAPI/Tests/Assert.cs index eec9c5c..78f0597 100644 --- a/GamecraftModdingAPI/Tests/Assert.cs +++ b/GamecraftModdingAPI/Tests/Assert.cs @@ -83,32 +83,12 @@ namespace GamecraftModdingAPI.Tests { if (err == null) err = $"{nameof(T)} '{obj1}' is not equal to '{obj2}'."; if (success == null) success = $"{nameof(T)} '{obj1}' is equal to '{obj2}'."; - if (obj1 == null && obj2 == null) + if ((obj1 == null && obj2 == null) + || (obj1 != null && obj2 != null && obj1.Equals(obj2) && obj2.Equals(obj1))) { // pass Log(PASS + success); TestRoot.TestsPassed = true; - return true; - } - else if (!(obj1 == null && obj2 == null) && obj1.Equals(obj2) && obj2.Equals(obj1)) - { - // pass - Log(PASS + success); - TestRoot.TestsPassed = true; - return true; - } - else if (obj1 != null && (obj1 != null && !obj1.Equals(obj2))) - { - // pass - Log(PASS + success); - TestRoot.TestsPassed = true; - return true; - } - else if (obj2 != null && !obj2.Equals(obj1)) - { - // pass - Log(PASS + success); - TestRoot.TestsPassed = true; return true; } else diff --git a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs index d5cf714..d8b50fa 100644 --- a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs +++ b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs @@ -234,7 +234,7 @@ namespace GamecraftModdingAPI.Tests CommandBuilder.Builder() .Name("PlaceConsole") - .Description("Place a bunch of console block with a given text") + .Description("Place a bunch of console block with a given text - entering simulation with them crashes the game as the cmd doesn't exist") .Action((float x, float y, float z) => { Stopwatch sw = new Stopwatch(); diff --git a/GamecraftModdingAPI/Utility/DeterministicStepCompositionRootPatch.cs b/GamecraftModdingAPI/Utility/DeterministicStepCompositionRootPatch.cs deleted file mode 100644 index 9cabbe0..0000000 --- a/GamecraftModdingAPI/Utility/DeterministicStepCompositionRootPatch.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; - -using RobocraftX.StateSync; -using Svelto.ECS; - -using HarmonyLib; - -namespace GamecraftModdingAPI.Utility -{ - [HarmonyPatch(typeof(DeterministicStepCompositionRoot), "ResetWorld")] - public static class DeterministicStepCompositionRootPatch - { - private static SimpleEntitiesSubmissionScheduler engineRootScheduler; - public static void Postfix(SimpleEntitiesSubmissionScheduler scheduler) - { - engineRootScheduler = scheduler; - } - - internal static void SubmitEntitiesNow() - { - if (engineRootScheduler != null) - engineRootScheduler.SubmitEntities(); - } - } -} -- 2.30.2 From b53dff5d12b93ca9c0cb93c29a6d008599d1d66e Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sun, 19 Jul 2020 01:42:32 +0200 Subject: [PATCH 084/252] Remove initializer data once the block is placed --- GamecraftModdingAPI/Block.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index ade9f9b..dc3fe19 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -82,6 +82,7 @@ namespace GamecraftModdingAPI position, uscale, scale, player, rotation, out var initializer); var bl = New(egid.entityID, egid.groupID); bl.InitData.Group = BlockEngine.InitGroup(initializer); + Placed += bl.OnPlacedInit; return bl; } @@ -352,6 +353,13 @@ namespace GamecraftModdingAPI (GridConnectionsEntityStruct st) => new SimBody(st.machineRigidBodyId)); } + private void OnPlacedInit(object sender, BlockPlacedRemovedEventArgs e) + { //Member method instead of lambda to avoid constantly creating delegates + if (e.ID != Id) return; + Placed -= OnPlacedInit; //And we can reference it + InitData = default; //Remove initializer as it's no longer valid - if the block gets removed it shouldn't be used again + } + public override string ToString() { return $"{nameof(Id)}: {Id}, {nameof(Position)}: {Position}, {nameof(Type)}: {Type}, {nameof(Color)}: {Color}, {nameof(Exists)}: {Exists}"; -- 2.30.2 From 15485481a2e4529b9c99d07e116910a39c136521 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Tue, 21 Jul 2020 00:19:30 +0200 Subject: [PATCH 085/252] Add some info and prev. value for setters --- GamecraftModdingAPI/Block.cs | 18 ++++++++++++++++-- GamecraftModdingAPI/Blocks/BlockEngine.cs | 5 +++-- GamecraftModdingAPI/Blocks/BlockEngineInit.cs | 6 ++++++ 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index dc3fe19..5f30a64 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -137,6 +137,16 @@ namespace GamecraftModdingAPI {typeof(Timer), new[] {CommonExclusiveGroups.BUILD_TIMER_BLOCK_GROUP}} }; + /// + /// Constructs a new instance of T with the given ID and group using dynamically created delegates. + /// It's equivalent to new T(EGID) with a minimal overhead thanks to caching the created delegates. + /// + /// The block ID + /// The block group + /// The block's type or Block itself + /// An instance of the provided type + /// The block group doesn't match or cannot be found + /// The block class doesn't have the needed constructor private static T New(uint id, ExclusiveGroupStruct? group = null) where T : Block { var type = typeof(T); @@ -175,8 +185,8 @@ namespace GamecraftModdingAPI il.DeclareLocal(type); il.Emit(OpCodes.Ldarg_0); //Load EGID and pass to constructor il.Emit(OpCodes.Newobj, ctor); //Call constructor - il.Emit(OpCodes.Stloc_0); - il.Emit(OpCodes.Ldloc_0); + //il.Emit(OpCodes.Stloc_0); - doesn't seem like we need these + //il.Emit(OpCodes.Ldloc_0); il.Emit(OpCodes.Ret); func = (Func) dynamic.CreateDelegate(typeof(Func)); @@ -188,6 +198,9 @@ namespace GamecraftModdingAPI public Block(EGID id) { Id = id; + if (typeToGroup.TryGetValue(GetType(), out var groups) && groups.All(gr => gr != id.groupID)) + throw new BlockTypeException("The block has the wrong group! The type is " + GetType() + + " while the group is " + id.groupID); } /// @@ -328,6 +341,7 @@ namespace GamecraftModdingAPI /// /// Whether the block exists. The other properties will return a default value if the block doesn't exist. + /// If the block was just placed, then this will also return false but the properties will work correctly. /// public bool Exists => BlockEngine.BlockExists(Id); diff --git a/GamecraftModdingAPI/Blocks/BlockEngine.cs b/GamecraftModdingAPI/Blocks/BlockEngine.cs index 375620e..f97e405 100644 --- a/GamecraftModdingAPI/Blocks/BlockEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlockEngine.cs @@ -85,10 +85,11 @@ namespace GamecraftModdingAPI.Blocks { if (entitiesDB.Exists(block.Id)) setter(ref entitiesDB.QueryEntity(block.Id), value); - if (block.InitData.Group != null) + else if (block.InitData.Group != null) { var initializer = new EntityComponentInitializer(block.Id, block.InitData.Group); - ref T structRef = ref (new T[1])[0]; //A reference for a default value for struct + T component = initializer.Has() ? initializer.Get() : default; + ref T structRef = ref component; setter(ref structRef, value); initializer.Init(structRef); } diff --git a/GamecraftModdingAPI/Blocks/BlockEngineInit.cs b/GamecraftModdingAPI/Blocks/BlockEngineInit.cs index 4be9a98..70f713a 100644 --- a/GamecraftModdingAPI/Blocks/BlockEngineInit.cs +++ b/GamecraftModdingAPI/Blocks/BlockEngineInit.cs @@ -9,6 +9,9 @@ namespace GamecraftModdingAPI.Blocks { public partial class BlockEngine { + /// + /// Holds information needed to construct a component initializer + /// internal struct BlockInitData { public FasterDictionary, ITypeSafeDictionary> Group; @@ -17,6 +20,9 @@ namespace GamecraftModdingAPI.Blocks internal delegate FasterDictionary, ITypeSafeDictionary> GetInitGroup( EntityComponentInitializer initializer); + /// + /// Accesses the group field of the initializer + /// internal GetInitGroup InitGroup = CreateAccessor("_group"); //https://stackoverflow.com/questions/55878525/unit-testing-ref-structs-with-private-fields-via-reflection -- 2.30.2 From 057a030c2075485a8476c0c6d7306189f1e7cf60 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Tue, 21 Jul 2020 02:36:11 +0200 Subject: [PATCH 086/252] Update music block and attempt to fix test --- GamecraftModdingAPI/Block.cs | 15 ++- GamecraftModdingAPI/Blocks/BlockTests.cs | 17 +++- GamecraftModdingAPI/Blocks/MusicBlock.cs | 123 +++++++++++------------ 3 files changed, 81 insertions(+), 74 deletions(-) diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index 5f30a64..2f9a901 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -29,7 +29,7 @@ namespace GamecraftModdingAPI protected static readonly SignalEngine SignalEngine = new SignalEngine(); protected static readonly BlockEventsEngine BlockEventsEngine = new BlockEventsEngine(); protected static readonly ScalingEngine ScalingEngine = new ScalingEngine(); - + protected internal static readonly BlockEngine BlockEngine = new BlockEngine(); /// @@ -123,6 +123,7 @@ namespace GamecraftModdingAPI { {typeof(ConsoleBlock), new[] {CommonExclusiveGroups.BUILD_CONSOLE_BLOCK_GROUP}}, {typeof(Motor), new[] {CommonExclusiveGroups.BUILD_MOTOR_BLOCK_GROUP}}, + {typeof(MusicBlock), new[] {CommonExclusiveGroups.BUILD_MUSIC_BLOCK_GROUP}}, {typeof(Piston), new[] {CommonExclusiveGroups.BUILD_PISTON_BLOCK_GROUP}}, {typeof(Servo), new[] {CommonExclusiveGroups.BUILD_SERVO_BLOCK_GROUP}}, { @@ -198,9 +199,15 @@ namespace GamecraftModdingAPI public Block(EGID id) { Id = id; - if (typeToGroup.TryGetValue(GetType(), out var groups) && groups.All(gr => gr != id.groupID)) - throw new BlockTypeException("The block has the wrong group! The type is " + GetType() + - " while the group is " + id.groupID); + var type = GetType(); + if (typeToGroup.TryGetValue(type, out var groups)) + { + if (groups.All(gr => gr != id.groupID)) + throw new BlockTypeException("The block has the wrong group! The type is " + GetType() + + " while the group is " + id.groupID); + } + else if (type != typeof(Block)) + Logging.LogWarning($"Unknown block type! Add {type} to the dictionary."); } /// diff --git a/GamecraftModdingAPI/Blocks/BlockTests.cs b/GamecraftModdingAPI/Blocks/BlockTests.cs index 85328d2..6186a1d 100644 --- a/GamecraftModdingAPI/Blocks/BlockTests.cs +++ b/GamecraftModdingAPI/Blocks/BlockTests.cs @@ -74,8 +74,8 @@ namespace GamecraftModdingAPI.Blocks if (!Assert.CloseTo(b.MaximumForce, 750f, $"Servo.MaximumForce {b.MaximumForce} does not equal default value, possibly because it failed silently.", "Servo.MaximumForce is close enough to default.")) return; } - [APITestCase(TestType.EditMode)] - public static void TestMusicBlock() + [APITestCase(TestType.Game)] + public static void TestMusicBlock1() { Block newBlock = Block.PlaceNew(BlockIDs.MusicBlock, Unity.Mathematics.float3.zero + 2); MusicBlock b = null; // Note: the assignment operation is a lambda, which slightly confuses the compiler @@ -83,8 +83,19 @@ namespace GamecraftModdingAPI.Blocks if (!Assert.NotNull(b, "Block.Specialize() returned null, possibly because it failed silently.", "Specialized MusicBlock is not null.")) return; if (!Assert.CloseTo(b.Volume, 100f, $"MusicBlock.Volume {b.Volume} does not equal default value, possibly because it failed silently.", "MusicBlock.Volume is close enough to default.")) return; if (!Assert.Equal(b.TrackIndex, 0, $"MusicBlock.TrackIndex {b.TrackIndex} does not equal default value, possibly because it failed silently.", "MusicBlock.TrackIndex is equal to default.")) return; + _musicBlock = b; + } + + private static MusicBlock _musicBlock; + + [APITestCase(TestType.EditMode)] + public static void TestMusicBlock2() + { + //Block newBlock = Block.GetLastPlacedBlock(); + var b = _musicBlock; + if (!Assert.NotNull(b, "Block.Specialize() returned null, possibly because it failed silently.", "Specialized MusicBlock is not null.")) return; b.IsPlaying = true; // play sfx - if (!Assert.Equal(b.IsPlaying, true, $"MusicBlock.IsPlaying {b.IsPlaying} does not equal default value, possibly because it failed silently.", "MusicBlock.IsPlaying is set properly.")) return; + if (!Assert.Equal(b.IsPlaying, true, $"MusicBlock.IsPlaying {b.IsPlaying} does not equal true, possibly because it failed silently.", "MusicBlock.IsPlaying is set properly.")) return; if (!Assert.Equal(b.ChannelType, ChannelType.Character, $"MusicBlock.ChannelType {b.ChannelType} does not equal default value, possibly because it failed silently.", "MusicBlock.ChannelType is equal to default.")) return; //Assert.Log(b.Track.ToString()); if (!Assert.Equal(b.Track.ToString(), new Guid("3237ff8f-f5f2-4f84-8144-496ca280f8c0").ToString(), $"MusicBlock.Track {b.Track} does not equal default value, possibly because it failed silently.", "MusicBlock.Track is equal to default.")) return; diff --git a/GamecraftModdingAPI/Blocks/MusicBlock.cs b/GamecraftModdingAPI/Blocks/MusicBlock.cs index a7f862e..2128a45 100644 --- a/GamecraftModdingAPI/Blocks/MusicBlock.cs +++ b/GamecraftModdingAPI/Blocks/MusicBlock.cs @@ -3,58 +3,38 @@ using System; using FMOD.Studio; using FMODUnity; using Gamecraft.Wires; +using RobocraftX.Common; using RobocraftX.Blocks; using Svelto.ECS; using Unity.Mathematics; using GamecraftModdingAPI; +using GamecraftModdingAPI.Tests; using GamecraftModdingAPI.Utility; namespace GamecraftModdingAPI.Blocks { public class MusicBlock : Block { - public static MusicBlock PlaceNew(float3 position, - float3 rotation = default, BlockColors color = BlockColors.Default, byte darkness = 0, - int uscale = 1, float3 scale = default, Player player = null) - { - if (PlacementEngine.IsInGame && GameState.IsBuildMode()) - { - EGID id = PlacementEngine.PlaceBlock(BlockIDs.MusicBlock, color, darkness, - position, uscale, scale, player, rotation); - return new MusicBlock(id); - } - - return null; - } - public MusicBlock(EGID id) : base(id) { - if (!BlockEngine.GetBlockInfoExists(this.Id)) - { - throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); - } } - public MusicBlock(uint id) : base(id) + public MusicBlock(uint id) : base(new EGID(id, CommonExclusiveGroups.BUILD_MUSIC_BLOCK_GROUP)) { - if (!BlockEngine.GetBlockInfoExists(this.Id)) - { - throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); - } } public byte TrackIndex { get { - return BlockEngine.GetBlockInfo(Id).trackIndx; + return BlockEngine.GetBlockInfo(this, (MusicBlockDataEntityStruct st) => st.trackIndx); } set { - ref MusicBlockDataEntityStruct msdes = ref BlockEngine.GetBlockInfo(Id); - msdes.trackIndx = value; + BlockEngine.SetBlockInfo(this, + (ref MusicBlockDataEntityStruct msdes, byte val) => msdes.trackIndx = val, value); } } @@ -62,22 +42,24 @@ namespace GamecraftModdingAPI.Blocks { get { - ref MusicBlockDataEntityStruct msdes = ref BlockEngine.GetBlockInfo(Id); - return msdes.fmod2DEventPaths.Get(msdes.trackIndx); + return BlockEngine.GetBlockInfo(this, + (MusicBlockDataEntityStruct msdes) => msdes.fmod2DEventPaths.Get(msdes.trackIndx)); } set { - ref MusicBlockDataEntityStruct msdes = ref BlockEngine.GetBlockInfo(Id); - for (byte i = 0; i < msdes.fmod2DEventPaths.Count(); i++) + BlockEngine.SetBlockInfo(this, (ref MusicBlockDataEntityStruct msdes, Guid val) => { - Guid track = msdes.fmod2DEventPaths.Get(i); - if (track == value) + for (byte i = 0; i < msdes.fmod2DEventPaths.Count(); i++) { - msdes.trackIndx = i; - break; + Guid track = msdes.fmod2DEventPaths.Get(i); + if (track == val) + { + msdes.trackIndx = i; + break; + } } - } + }, value); } } @@ -85,13 +67,15 @@ namespace GamecraftModdingAPI.Blocks { get { - ref MusicBlockDataEntityStruct msdes = ref BlockEngine.GetBlockInfo(Id); - Guid[] tracks = new Guid[msdes.fmod2DEventPaths.Count()]; - for (byte i = 0; i < tracks.Length; i++) + return BlockEngine.GetBlockInfo(this, (MusicBlockDataEntityStruct msdes) => { - tracks[i] = msdes.fmod2DEventPaths.Get(i); - } - return tracks; + Guid[] tracks = new Guid[msdes.fmod2DEventPaths.Count()]; + for (byte i = 0; i < tracks.Length; i++) + { + tracks[i] = msdes.fmod2DEventPaths.Get(i); + } + return tracks; + }); } } @@ -99,13 +83,13 @@ namespace GamecraftModdingAPI.Blocks { get { - return BlockEngine.GetBlockInfo(Id).tweakableVolume; + return BlockEngine.GetBlockInfo(this, (MusicBlockDataEntityStruct msdes) => msdes.tweakableVolume); } set { - ref MusicBlockDataEntityStruct msdes = ref BlockEngine.GetBlockInfo(Id); - msdes.tweakableVolume = value; + BlockEngine.SetBlockInfo(this, + (ref MusicBlockDataEntityStruct msdes, float val) => msdes.tweakableVolume = val, value); } } @@ -113,13 +97,15 @@ namespace GamecraftModdingAPI.Blocks { get { - return (ChannelType)BlockEngine.GetBlockInfo(Id).channelType; + Assert.Log("Block exists: " + Exists); + return BlockEngine.GetBlockInfo(this, + (MusicBlockDataEntityStruct msdes) => (ChannelType) msdes.channelType); } - + set { - ref MusicBlockDataEntityStruct msdes = ref BlockEngine.GetBlockInfo(Id); - msdes.channelType = (byte)value; + BlockEngine.SetBlockInfo(this, + (ref MusicBlockDataEntityStruct msdes, ChannelType val) => msdes.channelType = (byte) val, value); } } @@ -127,30 +113,33 @@ namespace GamecraftModdingAPI.Blocks { get { - return BlockEngine.GetBlockInfo(Id).isPlaying; + return BlockEngine.GetBlockInfo(this, + (MusicBlockDataEntityStruct msdes) => msdes.isPlaying); } set { - ref MusicBlockDataEntityStruct msdes = ref BlockEngine.GetBlockInfo(Id); - if (msdes.isPlaying == value) return; - if (value) + BlockEngine.SetBlockInfo(this, (ref MusicBlockDataEntityStruct msdes, bool val) => { - // start playing - EventInstance inst = RuntimeManager.CreateInstance(msdes.fmod2DEventPaths.Get(msdes.trackIndx)); - inst.setVolume(msdes.tweakableVolume / 100f); - inst.start(); - msdes.eventHandle = inst.handle; - } - else - { - // stop playing - EventInstance inst = default(EventInstance); - inst.handle = msdes.eventHandle; - inst.stop(FMOD.Studio.STOP_MODE.ALLOWFADEOUT); - inst.release(); - } - msdes.isPlaying = value; + if (msdes.isPlaying == val) return; + if (val) + { + // start playing + EventInstance inst = RuntimeManager.CreateInstance(msdes.fmod2DEventPaths.Get(msdes.trackIndx)); + inst.setVolume(msdes.tweakableVolume / 100f); + inst.start(); + msdes.eventHandle = inst.handle; + } + else + { + // stop playing + EventInstance inst = default(EventInstance); + inst.handle = msdes.eventHandle; + inst.stop(FMOD.Studio.STOP_MODE.ALLOWFADEOUT); + inst.release(); + } + msdes.isPlaying = val; + }, value); } } } -- 2.30.2 From b81562ea58229dc41837b104abdbc00c6cc816b0 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Sat, 25 Jul 2020 12:12:48 -0400 Subject: [PATCH 087/252] Fix sfx block test default value --- GamecraftModdingAPI/Blocks/BlockTests.cs | 2 +- GamecraftModdingAPI/GamecraftModdingAPI.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/GamecraftModdingAPI/Blocks/BlockTests.cs b/GamecraftModdingAPI/Blocks/BlockTests.cs index 6186a1d..19ad7e6 100644 --- a/GamecraftModdingAPI/Blocks/BlockTests.cs +++ b/GamecraftModdingAPI/Blocks/BlockTests.cs @@ -96,7 +96,7 @@ namespace GamecraftModdingAPI.Blocks if (!Assert.NotNull(b, "Block.Specialize() returned null, possibly because it failed silently.", "Specialized MusicBlock is not null.")) return; b.IsPlaying = true; // play sfx if (!Assert.Equal(b.IsPlaying, true, $"MusicBlock.IsPlaying {b.IsPlaying} does not equal true, possibly because it failed silently.", "MusicBlock.IsPlaying is set properly.")) return; - if (!Assert.Equal(b.ChannelType, ChannelType.Character, $"MusicBlock.ChannelType {b.ChannelType} does not equal default value, possibly because it failed silently.", "MusicBlock.ChannelType is equal to default.")) return; + if (!Assert.Equal(b.ChannelType, ChannelType.None, $"MusicBlock.ChannelType {b.ChannelType} does not equal default value, possibly because it failed silently.", "MusicBlock.ChannelType is equal to default.")) return; //Assert.Log(b.Track.ToString()); if (!Assert.Equal(b.Track.ToString(), new Guid("3237ff8f-f5f2-4f84-8144-496ca280f8c0").ToString(), $"MusicBlock.Track {b.Track} does not equal default value, possibly because it failed silently.", "MusicBlock.Track is equal to default.")) return; } diff --git a/GamecraftModdingAPI/GamecraftModdingAPI.csproj b/GamecraftModdingAPI/GamecraftModdingAPI.csproj index 29cc08f..a7c108a 100644 --- a/GamecraftModdingAPI/GamecraftModdingAPI.csproj +++ b/GamecraftModdingAPI/GamecraftModdingAPI.csproj @@ -2,7 +2,7 @@ net472 true - 1.3.0 + 1.4.0 Exmods GNU General Public Licence 3+ https://git.exmods.org/modtainers/GamecraftModdingAPI -- 2.30.2 From ca0e6e089d489e3bc9a16c04376b3ea9e35a80c3 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Sun, 2 Aug 2020 22:39:26 -0400 Subject: [PATCH 088/252] Mark old event system as deprecated --- .../Events/DeterministicStepComposeEngineGroupsPatch.cs | 3 ++- GamecraftModdingAPI/Events/EmitterBuilder.cs | 1 + GamecraftModdingAPI/Events/EventEngineFactory.cs | 1 + GamecraftModdingAPI/Events/EventManager.cs | 1 + GamecraftModdingAPI/Events/GameActivatedComposePatch.cs | 1 + GamecraftModdingAPI/Events/GameReloadedPatch.cs | 1 + GamecraftModdingAPI/Events/GameStateBuildEmitterEngine.cs | 1 + .../Events/GameStateSimulationEmitterEngine.cs | 1 + GamecraftModdingAPI/Events/GameSwitchedToPatch.cs | 1 + GamecraftModdingAPI/Events/HandlerBuilder.cs | 1 + GamecraftModdingAPI/Events/IEventEmitterEngine.cs | 1 + GamecraftModdingAPI/Events/IEventHandlerEngine.cs | 1 + GamecraftModdingAPI/Events/MenuActivatedPatch.cs | 1 + GamecraftModdingAPI/Events/MenuSwitchedToPatch.cs | 1 + GamecraftModdingAPI/Events/SimpleEventEmitterEngine.cs | 1 + GamecraftModdingAPI/Events/SimpleEventHandlerEngine.cs | 1 + GamecraftModdingAPI/Utility/VersionTracking.cs | 4 ++++ 17 files changed, 21 insertions(+), 1 deletion(-) diff --git a/GamecraftModdingAPI/Events/DeterministicStepComposeEngineGroupsPatch.cs b/GamecraftModdingAPI/Events/DeterministicStepComposeEngineGroupsPatch.cs index d6e58dc..9f16955 100644 --- a/GamecraftModdingAPI/Events/DeterministicStepComposeEngineGroupsPatch.cs +++ b/GamecraftModdingAPI/Events/DeterministicStepComposeEngineGroupsPatch.cs @@ -18,7 +18,8 @@ namespace GamecraftModdingAPI.Events /// Patch of RobocraftX.StateSync.DeterministicStepCompositionRoot.ComposeEnginesGroups(...) /// //[HarmonyPatch(typeof(DeterministicStepCompositionRoot), "DeterministicCompose")] - [HarmonyPatch] + [Obsolete] + [HarmonyPatch] class GameHostTransitionDeterministicGroupEnginePatch { diff --git a/GamecraftModdingAPI/Events/EmitterBuilder.cs b/GamecraftModdingAPI/Events/EmitterBuilder.cs index 48a6cba..c6a6879 100644 --- a/GamecraftModdingAPI/Events/EmitterBuilder.cs +++ b/GamecraftModdingAPI/Events/EmitterBuilder.cs @@ -4,6 +4,7 @@ using Svelto.ECS; namespace GamecraftModdingAPI.Events { + [Obsolete] public class EmitterBuilder { private string name; diff --git a/GamecraftModdingAPI/Events/EventEngineFactory.cs b/GamecraftModdingAPI/Events/EventEngineFactory.cs index f79dfca..7981303 100644 --- a/GamecraftModdingAPI/Events/EventEngineFactory.cs +++ b/GamecraftModdingAPI/Events/EventEngineFactory.cs @@ -11,6 +11,7 @@ namespace GamecraftModdingAPI.Events /// /// Convenient factories for mod event engines /// + [Obsolete] public static class EventEngineFactory { /// diff --git a/GamecraftModdingAPI/Events/EventManager.cs b/GamecraftModdingAPI/Events/EventManager.cs index efbf377..a1c757e 100644 --- a/GamecraftModdingAPI/Events/EventManager.cs +++ b/GamecraftModdingAPI/Events/EventManager.cs @@ -14,6 +14,7 @@ namespace GamecraftModdingAPI.Events /// Keeps track of event handlers and emitters. /// This is used to add, remove and get API event handlers and emitters. /// + [Obsolete] public static class EventManager { private static Dictionary _eventEmitters = new Dictionary(); diff --git a/GamecraftModdingAPI/Events/GameActivatedComposePatch.cs b/GamecraftModdingAPI/Events/GameActivatedComposePatch.cs index 4481f4b..4142fb3 100644 --- a/GamecraftModdingAPI/Events/GameActivatedComposePatch.cs +++ b/GamecraftModdingAPI/Events/GameActivatedComposePatch.cs @@ -17,6 +17,7 @@ namespace GamecraftModdingAPI.Events /// /// Patch of RobocraftX.FullGameCompositionRoot.ActivateGame() /// + [Obsolete] [HarmonyPatch] class GameActivatedComposePatch { diff --git a/GamecraftModdingAPI/Events/GameReloadedPatch.cs b/GamecraftModdingAPI/Events/GameReloadedPatch.cs index 40f46e1..7228084 100644 --- a/GamecraftModdingAPI/Events/GameReloadedPatch.cs +++ b/GamecraftModdingAPI/Events/GameReloadedPatch.cs @@ -14,6 +14,7 @@ namespace GamecraftModdingAPI.Events /// /// Patch of RobocraftX.FullGameCompositionRoot.ReloadGame() /// + [Obsolete] [HarmonyPatch(typeof(FullGameCompositionRoot), "ReloadGame")] class GameReloadedPatch { diff --git a/GamecraftModdingAPI/Events/GameStateBuildEmitterEngine.cs b/GamecraftModdingAPI/Events/GameStateBuildEmitterEngine.cs index a12433a..725f544 100644 --- a/GamecraftModdingAPI/Events/GameStateBuildEmitterEngine.cs +++ b/GamecraftModdingAPI/Events/GameStateBuildEmitterEngine.cs @@ -12,6 +12,7 @@ namespace GamecraftModdingAPI.Events /// /// Event emitter engine for switching to to build mode. /// + [Obsolete] public class GameStateBuildEmitterEngine : IEventEmitterEngine, IUnorderedInitializeOnTimeStoppedModeEntered { public string Name { get; } = "GamecraftModdingAPIGameStateBuildEventEmitter" ; diff --git a/GamecraftModdingAPI/Events/GameStateSimulationEmitterEngine.cs b/GamecraftModdingAPI/Events/GameStateSimulationEmitterEngine.cs index 5689db9..6e6e2ce 100644 --- a/GamecraftModdingAPI/Events/GameStateSimulationEmitterEngine.cs +++ b/GamecraftModdingAPI/Events/GameStateSimulationEmitterEngine.cs @@ -12,6 +12,7 @@ namespace GamecraftModdingAPI.Events /// /// Event emitter engine for switching to simulation mode. /// + [Obsolete] public class GameStateSimulationEmitterEngine : IEventEmitterEngine, IUnorderedInitializeOnTimeRunningModeEntered { public string Name { get; } = "GamecraftModdingAPIGameStateSimulationEventEmitter" ; diff --git a/GamecraftModdingAPI/Events/GameSwitchedToPatch.cs b/GamecraftModdingAPI/Events/GameSwitchedToPatch.cs index 30bb0d5..dbd63c0 100644 --- a/GamecraftModdingAPI/Events/GameSwitchedToPatch.cs +++ b/GamecraftModdingAPI/Events/GameSwitchedToPatch.cs @@ -18,6 +18,7 @@ namespace GamecraftModdingAPI.Events /// Patch of RobocraftX.FullGameCompositionRoot.ActivateGame() /// (scheduled for execution during RobocraftX.FullGameCompositionRoot.SwitchToGame()) /// + [Obsolete] [HarmonyPatch(typeof(FullGameCompositionRoot), "SwitchToGame")] class GameSwitchedToPatch { diff --git a/GamecraftModdingAPI/Events/HandlerBuilder.cs b/GamecraftModdingAPI/Events/HandlerBuilder.cs index d5d9879..10f3290 100644 --- a/GamecraftModdingAPI/Events/HandlerBuilder.cs +++ b/GamecraftModdingAPI/Events/HandlerBuilder.cs @@ -4,6 +4,7 @@ using Svelto.ECS; namespace GamecraftModdingAPI.Events { + [Obsolete] public class HandlerBuilder { private string name; diff --git a/GamecraftModdingAPI/Events/IEventEmitterEngine.cs b/GamecraftModdingAPI/Events/IEventEmitterEngine.cs index f6fefc5..8917cef 100644 --- a/GamecraftModdingAPI/Events/IEventEmitterEngine.cs +++ b/GamecraftModdingAPI/Events/IEventEmitterEngine.cs @@ -13,6 +13,7 @@ namespace GamecraftModdingAPI.Events /// /// Engine interface to create a ModEventEntityStruct in entitiesDB when a specific event occurs. /// + [Obsolete] public interface IEventEmitterEngine : IFactoryEngine { /// diff --git a/GamecraftModdingAPI/Events/IEventHandlerEngine.cs b/GamecraftModdingAPI/Events/IEventHandlerEngine.cs index 34a14af..228adb8 100644 --- a/GamecraftModdingAPI/Events/IEventHandlerEngine.cs +++ b/GamecraftModdingAPI/Events/IEventHandlerEngine.cs @@ -14,6 +14,7 @@ namespace GamecraftModdingAPI.Events /// /// Engine interface to handle ModEventEntityStruct events emitted by IEventEmitterEngines. /// + [Obsolete] public interface IEventHandlerEngine : IReactionaryEngine { } diff --git a/GamecraftModdingAPI/Events/MenuActivatedPatch.cs b/GamecraftModdingAPI/Events/MenuActivatedPatch.cs index 4237faa..382bac4 100644 --- a/GamecraftModdingAPI/Events/MenuActivatedPatch.cs +++ b/GamecraftModdingAPI/Events/MenuActivatedPatch.cs @@ -15,6 +15,7 @@ namespace GamecraftModdingAPI.Events /// /// Patch of RobocraftX.FullGameCompositionRoot.ActivateMenu() /// + [Obsolete] [HarmonyPatch(typeof(FullGameCompositionRoot), "ActivateMenu")] class MenuActivatedPatch { diff --git a/GamecraftModdingAPI/Events/MenuSwitchedToPatch.cs b/GamecraftModdingAPI/Events/MenuSwitchedToPatch.cs index 52a00b2..30b84da 100644 --- a/GamecraftModdingAPI/Events/MenuSwitchedToPatch.cs +++ b/GamecraftModdingAPI/Events/MenuSwitchedToPatch.cs @@ -15,6 +15,7 @@ namespace GamecraftModdingAPI.Events /// /// Patch of RobocraftX.FullGameCompositionRoot.SwitchToMenu() /// + [Obsolete] [HarmonyPatch(typeof(FullGameCompositionRoot), "SwitchToMenu")] class MenuSwitchedToPatch { diff --git a/GamecraftModdingAPI/Events/SimpleEventEmitterEngine.cs b/GamecraftModdingAPI/Events/SimpleEventEmitterEngine.cs index 0e51823..0ea8170 100644 --- a/GamecraftModdingAPI/Events/SimpleEventEmitterEngine.cs +++ b/GamecraftModdingAPI/Events/SimpleEventEmitterEngine.cs @@ -12,6 +12,7 @@ namespace GamecraftModdingAPI.Events /// /// A simple implementation of IEventEmitterEngine sufficient for most uses /// + [Obsolete] public class SimpleEventEmitterEngine : IEventEmitterEngine { public string Name { get; set; } diff --git a/GamecraftModdingAPI/Events/SimpleEventHandlerEngine.cs b/GamecraftModdingAPI/Events/SimpleEventHandlerEngine.cs index 18314d9..ebce21d 100644 --- a/GamecraftModdingAPI/Events/SimpleEventHandlerEngine.cs +++ b/GamecraftModdingAPI/Events/SimpleEventHandlerEngine.cs @@ -13,6 +13,7 @@ namespace GamecraftModdingAPI.Events /// /// A simple implementation of IEventHandlerEngine sufficient for most uses /// + [Obsolete] public class SimpleEventHandlerEngine : IEventHandlerEngine { public int type { get; set; } diff --git a/GamecraftModdingAPI/Utility/VersionTracking.cs b/GamecraftModdingAPI/Utility/VersionTracking.cs index 780ac38..32b86dc 100644 --- a/GamecraftModdingAPI/Utility/VersionTracking.cs +++ b/GamecraftModdingAPI/Utility/VersionTracking.cs @@ -14,6 +14,7 @@ namespace GamecraftModdingAPI.Utility /// Tracks the API version the current game was built for. /// For compatibility reasons, this must be enabled before it will work. /// + [Obsolete] public static class VersionTracking { private static readonly VersionTrackingEngine versionEngine = new VersionTrackingEngine(); @@ -58,6 +59,7 @@ namespace GamecraftModdingAPI.Utility } + [Obsolete] internal class VersionTrackingEngine : IEventEmitterEngine { public string Name { get; } = "GamecraftModdingAPIVersionTrackingGameEngine"; @@ -94,11 +96,13 @@ namespace GamecraftModdingAPI.Utility public void Emit() { } } + [Obsolete] public struct ModVersionStruct : IEntityComponent { public uint version; } + [Obsolete] public class ModVersionDescriptor: SerializableEntityDescriptor { [HashName("GamecraftModdingAPIVersionV0")] -- 2.30.2 From 708dbdd81d99bb6c9e8986d78fd252e82e0754de Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Mon, 3 Aug 2020 12:45:38 -0400 Subject: [PATCH 089/252] Add wiring API and improve signal support --- GamecraftModdingAPI/Block.cs | 3 + GamecraftModdingAPI/Blocks/BlockExceptions.cs | 22 ++ GamecraftModdingAPI/Blocks/BlockTests.cs | 19 + GamecraftModdingAPI/Blocks/LogicGate.cs | 16 + GamecraftModdingAPI/Blocks/SignalEngine.cs | 203 ++++++++++- GamecraftModdingAPI/Blocks/SignalingBlock.cs | 94 ++++- GamecraftModdingAPI/Blocks/Wire.cs | 338 ++++++++++++++++++ GamecraftModdingAPI/Events/EventManager.cs | 2 +- .../GamecraftModdingAPI.csproj | 2 +- GamecraftModdingAPI/Main.cs | 5 +- .../Tests/GamecraftModdingAPIPluginTest.cs | 16 +- GamecraftModdingAPI/Tests/TestRoot.cs | 2 +- doxygen.conf | 2 +- 13 files changed, 706 insertions(+), 18 deletions(-) create mode 100644 GamecraftModdingAPI/Blocks/LogicGate.cs create mode 100644 GamecraftModdingAPI/Blocks/Wire.cs diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index 2f9a901..0194bae 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -122,6 +122,7 @@ namespace GamecraftModdingAPI new Dictionary { {typeof(ConsoleBlock), new[] {CommonExclusiveGroups.BUILD_CONSOLE_BLOCK_GROUP}}, + {typeof(LogicGate), new [] {CommonExclusiveGroups.BUILD_LOGIC_BLOCK_GROUP}}, {typeof(Motor), new[] {CommonExclusiveGroups.BUILD_MOTOR_BLOCK_GROUP}}, {typeof(MusicBlock), new[] {CommonExclusiveGroups.BUILD_MUSIC_BLOCK_GROUP}}, {typeof(Piston), new[] {CommonExclusiveGroups.BUILD_PISTON_BLOCK_GROUP}}, @@ -420,6 +421,8 @@ namespace GamecraftModdingAPI GameEngineManager.AddGameEngine(BlockEngine); GameEngineManager.AddGameEngine(BlockEventsEngine); GameEngineManager.AddGameEngine(ScalingEngine); + GameEngineManager.AddGameEngine(SignalEngine); + Wire.signalEngine = SignalEngine; // requires same functionality, no need to duplicate the engine } /// diff --git a/GamecraftModdingAPI/Blocks/BlockExceptions.cs b/GamecraftModdingAPI/Blocks/BlockExceptions.cs index 47af014..9949424 100644 --- a/GamecraftModdingAPI/Blocks/BlockExceptions.cs +++ b/GamecraftModdingAPI/Blocks/BlockExceptions.cs @@ -40,4 +40,26 @@ namespace GamecraftModdingAPI.Blocks { } } + + public class WiringException : BlockException + { + public WiringException() + { + } + + public WiringException(string message) : base(message) + { + } + } + + public class WireInvalidException : WiringException + { + public WireInvalidException() + { + } + + public WireInvalidException(string message) : base(message) + { + } + } } diff --git a/GamecraftModdingAPI/Blocks/BlockTests.cs b/GamecraftModdingAPI/Blocks/BlockTests.cs index 19ad7e6..5447f6c 100644 --- a/GamecraftModdingAPI/Blocks/BlockTests.cs +++ b/GamecraftModdingAPI/Blocks/BlockTests.cs @@ -4,6 +4,7 @@ using Gamecraft.Wires; using GamecraftModdingAPI; using GamecraftModdingAPI.Tests; +using GamecraftModdingAPI.Utility; namespace GamecraftModdingAPI.Blocks { @@ -100,6 +101,24 @@ namespace GamecraftModdingAPI.Blocks //Assert.Log(b.Track.ToString()); if (!Assert.Equal(b.Track.ToString(), new Guid("3237ff8f-f5f2-4f84-8144-496ca280f8c0").ToString(), $"MusicBlock.Track {b.Track} does not equal default value, possibly because it failed silently.", "MusicBlock.Track is equal to default.")) return; } + + [APITestCase(TestType.EditMode)] + public static void TestLogicGate() + { + Block newBlock = Block.PlaceNew(BlockIDs.NOTLogicBlock, Unity.Mathematics.float3.zero + 1); + LogicGate b = null; // Note: the assignment operation is a lambda, which slightly confuses the compiler + Assert.Errorless(() => { b = newBlock.Specialise(); }, "Block.Specialize() raised an exception: ", "Block.Specialize() completed without issue."); + if (!Assert.NotNull(b, "Block.Specialize() returned null, possibly because it failed silently.", "Specialized LogicGate is not null.")) return; + if (!Assert.Equal(b.InputCount, 1u, $"LogicGate.InputCount {b.InputCount} does not equal default value, possibly because it failed silently.", "LogicGate.InputCount is default.")) return; + if (!Assert.Equal(b.OutputCount, 1u, $"LogicGate.OutputCount {b.OutputCount} does not equal default value, possibly because it failed silently.", "LogicGate.OutputCount is default.")) return; + if (!Assert.NotNull(b, "Block.Specialize() returned null, possibly because it failed silently.", "Specialized LogicGate is not null.")) return; + //if (!Assert.Equal(b.PortName(0, true), "Input", $"LogicGate.PortName(0, input:true) {b.PortName(0, true)} does not equal default value, possibly because it failed silently.", "LogicGate.PortName(0, input:true) is close enough to default.")) return; + LogicGate target = null; + if (!Assert.Errorless(() => { target = Block.PlaceNew(BlockIDs.ANDLogicBlock, Unity.Mathematics.float3.zero + 2); })) return; + Wire newWire = null; + if (!Assert.Errorless(() => { newWire = b.Connect(0, target, 0);})) return; + if (!Assert.NotNull(newWire, "SignalingBlock.Connect(...) returned null, possible because it failed silently.", "SignalingBlock.Connect(...) returned a non-null value.")) return; + } } #endif } diff --git a/GamecraftModdingAPI/Blocks/LogicGate.cs b/GamecraftModdingAPI/Blocks/LogicGate.cs new file mode 100644 index 0000000..124bc10 --- /dev/null +++ b/GamecraftModdingAPI/Blocks/LogicGate.cs @@ -0,0 +1,16 @@ +using RobocraftX.Common; +using Svelto.ECS; + +namespace GamecraftModdingAPI.Blocks +{ + public class LogicGate : SignalingBlock + { + public LogicGate(EGID id) : base(id) + { + } + + public LogicGate(uint id) : base(new EGID(id, CommonExclusiveGroups.BUILD_LOGIC_BLOCK_GROUP)) + { + } + } +} \ No newline at end of file diff --git a/GamecraftModdingAPI/Blocks/SignalEngine.cs b/GamecraftModdingAPI/Blocks/SignalEngine.cs index 13a0b3b..e710e24 100644 --- a/GamecraftModdingAPI/Blocks/SignalEngine.cs +++ b/GamecraftModdingAPI/Blocks/SignalEngine.cs @@ -1,4 +1,5 @@ -using Svelto.ECS; +using System; +using Svelto.ECS; using Svelto.DataStructures; using Gamecraft.Wires; @@ -9,7 +10,7 @@ namespace GamecraftModdingAPI.Blocks /// /// Engine which executes signal actions /// - public class SignalEngine : IApiEngine + public class SignalEngine : IApiEngine, IFactoryEngine { public const float POSITIVE_HIGH = 1.0f; public const float NEGATIVE_HIGH = -1.0f; @@ -20,6 +21,8 @@ namespace GamecraftModdingAPI.Blocks public EntitiesDB entitiesDB { set; private get; } + public IEntityFactory Factory { get; set; } + public bool isRemovable => false; public bool IsInGame = false; @@ -34,7 +37,73 @@ namespace GamecraftModdingAPI.Blocks IsInGame = true; } - // implementations for Signal static class + // implementations for block wiring + + public EGID CreateNewWire(EGID startBlock, byte startPort, EGID endBlock, byte endPort) + { + EGID wireEGID = new EGID(WiresExclusiveGroups.NewWireEntityId, NamedExclusiveGroup.Group); + EntityComponentInitializer wireInitializer = Factory.BuildEntity(wireEGID); + wireInitializer.Init(new WireEntityStruct + { + sourceBlockEGID = startBlock, + sourcePortUsage = startPort, + destinationBlockEGID = endBlock, + destinationPortUsage = endPort, + }); + return wireEGID; + } + + public ref WireEntityStruct GetWire(EGID wire) + { + if (!entitiesDB.Exists(wire)) + { + throw new WiringException($"Wire {wire} does not exist"); + } + return ref entitiesDB.QueryEntity(wire); + } + + public ref PortEntityStruct GetPort(EGID port) + { + if (!entitiesDB.Exists(port)) + { + throw new WiringException($"Port {port} does not exist (yet?)"); + } + return ref entitiesDB.QueryEntity(port); + } + + public ref PortEntityStruct GetPortByOffset(BlockPortsStruct bps, byte portNumber, bool input) + { + ExclusiveGroup group = input + ? NamedExclusiveGroup.Group + : NamedExclusiveGroup.Group; + uint id = (input ? bps.firstInputID : bps.firstOutputID) + portNumber; + EGID egid = new EGID(id, group); + if (!entitiesDB.Exists(egid)) + { + throw new WiringException("Port does not exist"); + } + return ref entitiesDB.QueryEntity(egid); + } + + public ref PortEntityStruct GetPortByOffset(Block block, byte portNumber, bool input) + { + BlockPortsStruct bps = GetFromDbOrInitData(block, block.Id, out bool exists); + if (!exists) + { + throw new BlockException("Block does not exist"); + } + return ref GetPortByOffset(bps, portNumber, input); + } + + public ref T GetComponent(EGID egid) where T : struct, IEntityComponent + { + return ref entitiesDB.QueryEntity(egid); + } + + public bool Exists(EGID egid) where T : struct, IEntityComponent + { + return entitiesDB.Exists(egid); + } public bool SetSignal(EGID blockID, float signal, out uint signalID, bool input = true) { @@ -123,7 +192,7 @@ namespace GamecraftModdingAPI.Blocks return inputs; } - public EGID[] GetSignalOutputs(EGID blockID) + public EGID[] GetSignalOutputs(EGID blockID) { BlockPortsStruct ports = entitiesDB.QueryEntity(blockID); EGID[] outputs = new EGID[ports.outputCount]; @@ -134,6 +203,18 @@ namespace GamecraftModdingAPI.Blocks return outputs; } + public EGID MatchBlockInputToPort(Block block, byte portUsage, out bool exists) + { + BlockPortsStruct ports = GetFromDbOrInitData(block, block.Id, out exists); + return new EGID(ports.firstInputID + portUsage, NamedExclusiveGroup.Group); + } + + public EGID MatchBlockOutputToPort(Block block, byte portUsage, out bool exists) + { + BlockPortsStruct ports = GetFromDbOrInitData(block, block.Id, out exists); + return new EGID(ports.firstOutputID + portUsage, NamedExclusiveGroup.Group); + } + public ref WireEntityStruct MatchPortToWire(EGID portID, EGID blockID, out bool exists) { ref PortEntityStruct port = ref entitiesDB.QueryEntity(portID); @@ -152,6 +233,57 @@ namespace GamecraftModdingAPI.Blocks return ref defRef[0]; } + public ref WireEntityStruct MatchBlocksToWire(EGID startBlock, EGID endBlock, out bool exists, byte startPort = byte.MaxValue, + byte endPort = byte.MaxValue) + { + EGID[] startPorts; + if (startPort == byte.MaxValue) + { + // search all output ports on source block + startPorts = GetSignalOutputs(startBlock); + } + else + { + BlockPortsStruct ports = entitiesDB.QueryEntity(startBlock); + startPorts = new EGID[] {new EGID(ports.firstOutputID + startPort, NamedExclusiveGroup.Group) }; + } + + EGID[] endPorts; + if (startPort == byte.MaxValue) + { + // search all input ports on destination block + endPorts = GetSignalInputs(endBlock); + } + else + { + BlockPortsStruct ports = entitiesDB.QueryEntity(endBlock); + endPorts = new EGID[] {new EGID(ports.firstInputID + endPort, NamedExclusiveGroup.Group) }; + } + + EntityCollection wires = entitiesDB.QueryEntities(NamedExclusiveGroup.Group); + for (int endIndex = 0; endIndex < endPorts.Length; endIndex++) + { + PortEntityStruct endPES = entitiesDB.QueryEntity(endPorts[endIndex]); + for (int startIndex = 0; startIndex < startPorts.Length; startIndex++) + { + PortEntityStruct startPES = entitiesDB.QueryEntity(startPorts[startIndex]); + for (int w = 0; w < wires.count; w++) + { + if ((wires[w].destinationPortUsage == endPES.usage && wires[w].destinationBlockEGID == endBlock) + && (wires[w].sourcePortUsage == startPES.usage && wires[w].sourceBlockEGID == startBlock)) + { + exists = true; + return ref wires[w]; + } + } + } + } + + exists = false; + WireEntityStruct[] defRef = new WireEntityStruct[1]; + return ref defRef[0]; + } + public ref ChannelDataStruct GetChannelDataStruct(EGID portID, out bool exists) { ref PortEntityStruct port = ref entitiesDB.QueryEntity(portID); @@ -175,6 +307,69 @@ namespace GamecraftModdingAPI.Blocks return res.ToArray(); } + public EGID[] WiredToInput(EGID block, byte port) + { + WireEntityStruct[] wireEntityStructs = Search(NamedExclusiveGroup.Group, + (WireEntityStruct wes) => wes.destinationPortUsage == port && wes.destinationBlockEGID == block); + EGID[] result = new EGID[wireEntityStructs.Length]; + for (uint i = 0; i < wireEntityStructs.Length; i++) + { + result[i] = wireEntityStructs[i].ID; + } + + return result; + } + + public EGID[] WiredToOutput(EGID block, byte port) + { + WireEntityStruct[] wireEntityStructs = Search(NamedExclusiveGroup.Group, + (WireEntityStruct wes) => wes.sourcePortUsage == port && wes.sourceBlockEGID == block); + EGID[] result = new EGID[wireEntityStructs.Length]; + for (uint i = 0; i < wireEntityStructs.Length; i++) + { + result[i] = wireEntityStructs[i].ID; + } + + return result; + } + + private T[] Search(ExclusiveGroup group, Func isMatch) where T : struct, IEntityComponent + { + FasterList results = new FasterList(); + EntityCollection components = entitiesDB.QueryEntities(group); + for (uint i = 0; i < components.count; i++) + { + if (isMatch(components[i])) + { + results.Add(components[i]); + } + } + return results.ToArray(); + } + + private ref T GetFromDbOrInitData(Block block, EGID id, out bool exists) where T : struct, IEntityComponent + { + T[] defRef = new T[1]; + if (entitiesDB.Exists(id)) + { + exists = true; + return ref entitiesDB.QueryEntity(id); + } + if (block == null || block.InitData.Group == null) + { + exists = false; + return ref defRef[0]; + } + EntityComponentInitializer initializer = new EntityComponentInitializer(block.Id, block.InitData.Group); + if (initializer.Has()) + { + exists = true; + return ref initializer.Get(); + } + exists = false; + return ref defRef[0]; + } + private EntityCollection GetSignalStruct(uint signalID, out uint index, bool input = true) { ExclusiveGroup group = input diff --git a/GamecraftModdingAPI/Blocks/SignalingBlock.cs b/GamecraftModdingAPI/Blocks/SignalingBlock.cs index 149e450..a137b98 100644 --- a/GamecraftModdingAPI/Blocks/SignalingBlock.cs +++ b/GamecraftModdingAPI/Blocks/SignalingBlock.cs @@ -16,18 +16,10 @@ namespace GamecraftModdingAPI.Blocks { public SignalingBlock(EGID id) : base(id) { - if (!BlockEngine.GetBlockInfoExists(this)) - { - throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); - } } public SignalingBlock(uint id) : base(id) { - if (!BlockEngine.GetBlockInfoExists(this)) - { - throw new BlockTypeException($"Block is not a {this.GetType().Name} block"); - } } /// @@ -85,5 +77,91 @@ namespace GamecraftModdingAPI.Blocks { get => BlockEngine.GetBlockInfo(this, (BlockPortsStruct st) => st.outputCount); } + + /// + /// Connect an output on this block to an input on another block. + /// + /// Output port number. + /// Input block. + /// Input port number. + /// The wire connection + /// The wire could not be created. + public Wire Connect(byte sourcePort, SignalingBlock destination, byte destinationPort) + { + if (sourcePort >= OutputCount) + { + throw new WiringException("Source port does not exist"); + } + + if (destinationPort >= destination.InputCount) + { + throw new WiringException("Destination port does not exist"); + } + return Wire.Connect(this, sourcePort, destination, destinationPort); + } + + /// + /// The port's name. + /// This is localized to the user's language, so this is not reliable for port identification. + /// + /// Port number. + /// Whether the port is an input (true) or an output (false). + /// The localized port name. + public string PortName(byte port, bool input) + { + BlockPortsStruct bps = BlockEngine.GetBlockInfo(this, (BlockPortsStruct a) => a); + PortEntityStruct pes = SignalEngine.GetPortByOffset(this, port, input); + return pes.portNameLocalised; + } + + /// + /// The input port's name. + /// + /// Input port number. + /// The port name, localized to the user's language. + public string InputPortName(byte port) => PortName(port, true); + + /// + /// The output port's name. + /// + /// Output port number. + /// The port name, localized to the user's language. + public string OutputPortName(byte port) => PortName(port, false); + + /// + /// All wires connected to the input port. + /// These wires will always be wired output -> input. + /// + /// Port number. + /// Wires connected to the input port. + public Wire[] ConnectedToInput(byte port) + { + if (port >= InputCount) throw new WiringException($"Port input {port} does not exist"); + EGID[] wireEgids = SignalEngine.WiredToInput(Id, port); + Wire[] wires = new Wire[wireEgids.Length]; + for (uint i = 0; i < wireEgids.Length; i++) + { + wires[i] = new Wire(wireEgids[i]); + } + return wires; + } + + /// + /// All wires connected to the output port. + /// These wires will always be wired output -> input. + /// + /// Port number. + /// Wires connected to the output port. + public Wire[] ConnectedToOutput(byte port) + { + if (port >= OutputCount) throw new WiringException($"Port output {port} does not exist"); + EGID[] wireEgids = SignalEngine.WiredToOutput(Id, port); + Wire[] wires = new Wire[wireEgids.Length]; + for (uint i = 0; i < wireEgids.Length; i++) + { + wires[i] = new Wire(wireEgids[i]); + } + return wires; + } } } diff --git a/GamecraftModdingAPI/Blocks/Wire.cs b/GamecraftModdingAPI/Blocks/Wire.cs new file mode 100644 index 0000000..9a73135 --- /dev/null +++ b/GamecraftModdingAPI/Blocks/Wire.cs @@ -0,0 +1,338 @@ +using System; + +using Gamecraft.Wires; +using Svelto.ECS; +using Svelto.ECS.Experimental; + +using GamecraftModdingAPI.Utility; + +namespace GamecraftModdingAPI.Blocks +{ + public class Wire + { + internal static SignalEngine signalEngine; + + protected EGID startPortEGID; + + protected EGID endPortEGID; + + protected EGID startBlockEGID; + + protected EGID endBlockEGID; + + protected EGID wireEGID; + + protected bool inputToOutput; + + public static Wire Connect(SignalingBlock start, byte startPort, SignalingBlock end, byte endPort) + { + EGID wireEgid = signalEngine.CreateNewWire(start.Id, startPort, end.Id, endPort); + return new Wire(start, end, startPort, endPort, wireEgid, false); + } + + /// + /// An existing wire connection ending at the specified input. + /// If multiple exist, this will return the first one found. + /// + /// Destination block. + /// Port number. + /// The wire, where the end of the wire is the block port specified, or null if does not exist. + public static Wire ConnectedToInputPort(SignalingBlock end, byte endPort) + { + EGID port = signalEngine.MatchBlockInputToPort(end, endPort, out bool exists); + if (!exists) return null; + WireEntityStruct wire = signalEngine.MatchPortToWire(port, end.Id, out exists); + if (exists) + { + return new Wire(new Block(wire.sourceBlockEGID), end, wire.sourcePortUsage, endPort); + } + return null; + } + + /// + /// An existing wire connection starting at the specified output. + /// If multiple exist, this will return the first one found. + /// + /// Source block entity ID. + /// Port number. + /// The wire, where the start of the wire is the block port specified, or null if does not exist. + public static Wire ConnectedToOutputPort(SignalingBlock start, byte startPort) + { + EGID port = signalEngine.MatchBlockOutputToPort(start, startPort, out bool exists); + if (!exists) return null; + WireEntityStruct wire = signalEngine.MatchPortToWire(port, start.Id, out exists); + if (exists) + { + return new Wire(start, new Block(wire.destinationBlockEGID), startPort, wire.destinationPortUsage); + } + return null; + } + + /// + /// Construct a wire object from an existing connection. + /// + /// Starting block ID. + /// Ending block ID. + /// Starting port number, or guess if omitted. + /// Ending port number, or guess if omitted. + /// Guessing failed or wire does not exist. + public Wire(Block start, Block end, byte startPort = Byte.MaxValue, byte endPort = Byte.MaxValue) + { + startBlockEGID = start.Id; + endBlockEGID = end.Id; + // find block ports + WireEntityStruct wire = signalEngine.MatchBlocksToWire(start.Id, end.Id, out bool exists, startPort, endPort); + if (exists) + { + wireEGID = wire.ID; + endPortEGID = signalEngine.MatchBlockInputToPort(end, wire.destinationPortUsage, out exists); + if (!exists) throw new WireInvalidException("Wire end port not found"); + startPortEGID = signalEngine.MatchBlockOutputToPort(start, wire.sourcePortUsage, out exists); + if (!exists) throw new WireInvalidException("Wire start port not found"); + inputToOutput = false; + } + else + { + // flip I/O around and try again + wire = signalEngine.MatchBlocksToWire(end.Id, start.Id, out exists, endPort, startPort); + if (exists) + { + wireEGID = wire.ID; + endPortEGID = signalEngine.MatchBlockOutputToPort(end, wire.sourcePortUsage, out exists); + if (!exists) throw new WireInvalidException("Wire end port not found"); + startPortEGID = signalEngine.MatchBlockInputToPort(start, wire.destinationPortUsage, out exists); + if (!exists) throw new WireInvalidException("Wire start port not found"); + inputToOutput = true; // end is actually the source + // NB: start and end are handled exactly as they're received as params. + // This makes wire traversal easier, but makes logic in this class a bit more complex + } + else + { + throw new WireInvalidException("Wire not found"); + } + } + } + + /// + /// Construct a wire object from an existing wire connection. + /// + /// Starting block ID. + /// Ending block ID. + /// Starting port number. + /// Ending port number. + /// The wire ID. + /// Whether the wire direction goes input -> output (true) or output -> input (false, preferred). + public Wire(Block start, Block end, byte startPort, byte endPort, EGID wire, bool inputToOutput) + { + this.startBlockEGID = start.Id; + this.endBlockEGID = end.Id; + this.inputToOutput = inputToOutput; + this.wireEGID = wire; + if (inputToOutput) + { + endPortEGID = signalEngine.MatchBlockOutputToPort(start, startPort, out bool exists); + if (!exists) throw new WireInvalidException("Wire end port not found"); + startPortEGID = signalEngine.MatchBlockInputToPort(end, endPort, out exists); + if (!exists) throw new WireInvalidException("Wire start port not found"); + } + else + { + endPortEGID = signalEngine.MatchBlockInputToPort(end, endPort, out bool exists); + if (!exists) throw new WireInvalidException("Wire end port not found"); + startPortEGID = signalEngine.MatchBlockOutputToPort(start, startPort, out exists); + if (!exists) throw new WireInvalidException("Wire start port not found"); + } + } + + /// + /// Construct a wire object from an existing wire connection. + /// + /// The wire ID. + public Wire(EGID wireEgid) + { + this.wireEGID = wireEgid; + WireEntityStruct wire = signalEngine.GetWire(wireEGID); + this.startBlockEGID = wire.sourceBlockEGID; + this.endBlockEGID = wire.destinationBlockEGID; + this.inputToOutput = false; + } + + /// + /// The wire's in-game id. + /// + public EGID Id + { + get => wireEGID; + } + + /// + /// The wire's signal value, as a float. + /// + public float Float + { + get + { + ref ChannelDataStruct cds = ref signalEngine.GetChannelDataStruct(startPortEGID, out bool exists); + if (!exists) return 0f; + return cds.valueAsFloat; + } + + set + { + ref ChannelDataStruct cds = ref signalEngine.GetChannelDataStruct(startPortEGID, out bool exists); + if (!exists) return; + cds.valueAsFloat = value; + } + } + + /// + /// The wire's string signal. + /// + public string String + { + get + { + ref ChannelDataStruct cds = ref signalEngine.GetChannelDataStruct(startPortEGID, out bool exists); + if (!exists) return ""; + return cds.valueAsEcsString; + } + + set + { + ref ChannelDataStruct cds = ref signalEngine.GetChannelDataStruct(startPortEGID, out bool exists); + if (!exists) return; + cds.valueAsEcsString.Set(value); + } + } + + /// + /// The wire's raw string signal. + /// + public ECSString ECSString + { + get + { + ref ChannelDataStruct cds = ref signalEngine.GetChannelDataStruct(startPortEGID, out bool exists); + if (!exists) return default; + return cds.valueAsEcsString; + } + + set + { + ref ChannelDataStruct cds = ref signalEngine.GetChannelDataStruct(startPortEGID, out bool exists); + if (!exists) return; + cds.valueAsEcsString = value; + } + } + + /// + /// The wire's signal id. + /// I'm 50% sure this is useless. + /// + public uint SignalId + { + get + { + ref ChannelDataStruct cds = ref signalEngine.GetChannelDataStruct(startPortEGID, out bool exists); + if (!exists) return uint.MaxValue; + return cds.valueAsID; + } + + set + { + ref ChannelDataStruct cds = ref signalEngine.GetChannelDataStruct(startPortEGID, out bool exists); + if (!exists) return; + cds.valueAsID = value; + } + } + + /// + /// The block at the beginning of the wire. + /// + public SignalingBlock Start + { + get => new SignalingBlock(startBlockEGID); + } + + /// + /// The port number that the beginning of the wire connects to. + /// + public byte StartPort + { + get + { + WireEntityStruct wire = signalEngine.GetWire(wireEGID); + if (inputToOutput) + { + return wire.destinationPortUsage; + } + return wire.sourcePortUsage; + } + } + + /// + /// The block at the end of the wire. + /// + public SignalingBlock End + { + get => new SignalingBlock(endBlockEGID); + } + + /// + /// The port number that the end of the wire connects to. + /// + public byte EndPort + { + get + { + WireEntityStruct wire = signalEngine.GetWire(wireEGID); + if (inputToOutput) + { + return wire.sourcePortUsage; + } + return wire.destinationPortUsage; + } + } + + /// + /// Create a copy of the wire object where the direction of the wire is guaranteed to be from a block output to a block input. + /// This is simply a different memory configuration and does not affect the in-game wire (which is always output -> input). + /// + /// A copy of the wire object. + public Wire OutputToInputCopy() + { + return new Wire(wireEGID); + } + + /// + /// Convert the wire object to the direction the signal flows. + /// Signals on wires always flows from a block output port to a block input port. + /// This is simply a different memory configuration and does not affect the in-game wire (which is always output -> input). + /// + public void OutputToInputInPlace() + { + if (inputToOutput) + { + inputToOutput = false; + // swap inputs and outputs + EGID temp = endBlockEGID; + endBlockEGID = startBlockEGID; + startBlockEGID = temp; + temp = endPortEGID; + endPortEGID = startPortEGID; + startPortEGID = temp; + } + } + + public override string ToString() + { + if (signalEngine.Exists(wireEGID)) + { + return $"{nameof(Id)}: {Id}, Start{nameof(Start.Id)}: {Start.Id}, End{nameof(Id)}: {End.Id}, ({Start.Type}::{StartPort} aka {Start.PortName(StartPort, inputToOutput)}) -> ({End.Type}::{EndPort} aka {End.PortName(EndPort, !inputToOutput)})"; + } + return $"{nameof(Id)}: {Id}, Start{nameof(Start.Id)}: {Start.Id}, End{nameof(Id)}: {End.Id}, ({Start.Type}::{StartPort}) -> ({End.Type}::{EndPort})"; + } + + internal static void Init() { } + } +} \ No newline at end of file diff --git a/GamecraftModdingAPI/Events/EventManager.cs b/GamecraftModdingAPI/Events/EventManager.cs index a1c757e..f021e9f 100644 --- a/GamecraftModdingAPI/Events/EventManager.cs +++ b/GamecraftModdingAPI/Events/EventManager.cs @@ -14,7 +14,7 @@ namespace GamecraftModdingAPI.Events /// Keeps track of event handlers and emitters. /// This is used to add, remove and get API event handlers and emitters. /// - [Obsolete] + [Obsolete("This will be removed in an upcoming update. Use the new C# event architecture from GamecraftModdingAPI.App")] public static class EventManager { private static Dictionary _eventEmitters = new Dictionary(); diff --git a/GamecraftModdingAPI/GamecraftModdingAPI.csproj b/GamecraftModdingAPI/GamecraftModdingAPI.csproj index a7c108a..32c780b 100644 --- a/GamecraftModdingAPI/GamecraftModdingAPI.csproj +++ b/GamecraftModdingAPI/GamecraftModdingAPI.csproj @@ -2,7 +2,7 @@ net472 true - 1.4.0 + 1.5.0 Exmods GNU General Public Licence 3+ https://git.exmods.org/modtainers/GamecraftModdingAPI diff --git a/GamecraftModdingAPI/Main.cs b/GamecraftModdingAPI/Main.cs index aa80e2a..4a8cf24 100644 --- a/GamecraftModdingAPI/Main.cs +++ b/GamecraftModdingAPI/Main.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using System.Reflection; - +using GamecraftModdingAPI.Blocks; using HarmonyLib; using GamecraftModdingAPI.Utility; @@ -49,6 +49,7 @@ namespace GamecraftModdingAPI harmony.PatchAll(currentAssembly); // init utility Logging.MetaDebugLog($"Initializing Utility"); +#pragma warning disable 0612,0618 Utility.GameState.Init(); Utility.VersionTracking.Init(); // create default event emitters @@ -61,6 +62,7 @@ namespace GamecraftModdingAPI EventManager.AddEventEmitter(new SimpleEventEmitterEngine(EventType.GameSwitchedTo, "GamecraftModdingAPIGameSwitchedToEventEmitter", false)); EventManager.AddEventEmitter(GameHostTransitionDeterministicGroupEnginePatch.buildEngine); EventManager.AddEventEmitter(GameHostTransitionDeterministicGroupEnginePatch.simEngine); +#pragma warning restore 0612,0618 // init block implementors Logging.MetaDebugLog($"Initializing Blocks"); // init inventory @@ -70,6 +72,7 @@ namespace GamecraftModdingAPI // init object-oriented classes Player.Init(); Block.Init(); + Wire.Init(); GameClient.Init(); AsyncUtils.Init(); GamecraftModdingAPI.App.Client.Init(); diff --git a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs index d8b50fa..639125c 100644 --- a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs +++ b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs @@ -68,6 +68,7 @@ namespace GamecraftModdingAPI.Tests //Utility.VersionTracking.Enable();//(very) unstable // debug/test handlers +#pragma warning disable 0612 HandlerBuilder.Builder() .Name("appinit API debug") .Handle(EventType.ApplicationInitialized) @@ -115,7 +116,7 @@ namespace GamecraftModdingAPI.Tests .Handle(EventType.Menu) .OnActivation(() => { throw new Exception("Event Handler always throws an exception!"); }) .Build(); - +#pragma warning restore 0612 /*HandlerBuilder.Builder("enter game from menu test") .Handle(EventType.Menu) .OnActivation(() => @@ -253,6 +254,19 @@ namespace GamecraftModdingAPI.Tests Logging.CommandLog($"Blocks placed in {sw.ElapsedMilliseconds} ms"); }) .Build(); + + CommandBuilder.Builder() + .Name("WireTest") + .Description("Place two blocks and then wire them together") + .Action(() => + { + LogicGate notBlock = Block.PlaceNew(BlockIDs.NOTLogicBlock, new float3(1, 2, 0)); + LogicGate andBlock = Block.PlaceNew(BlockIDs.ANDLogicBlock, new float3(2, 2, 0)); + // connect NOT Gate output to AND Gate input #2 (ports are zero-indexed, so 1 is 2nd position and 0 is 1st position) + Wire conn = notBlock.Connect(0, andBlock, 1); + Logging.CommandLog(conn.ToString()); + }) + .Build(); GameClient.SetDebugInfo("InstalledMods", InstalledMods); Block.Placed += (sender, args) => diff --git a/GamecraftModdingAPI/Tests/TestRoot.cs b/GamecraftModdingAPI/Tests/TestRoot.cs index f39169e..6acb51c 100644 --- a/GamecraftModdingAPI/Tests/TestRoot.cs +++ b/GamecraftModdingAPI/Tests/TestRoot.cs @@ -209,7 +209,7 @@ namespace GamecraftModdingAPI.Tests { Assert.Fail($"Build test '{m}' raised an exception: {e.ToString()}"); } - yield return Yield.It; + yield return Yield.It; } } } diff --git a/doxygen.conf b/doxygen.conf index d587ecd..bf447b4 100644 --- a/doxygen.conf +++ b/doxygen.conf @@ -38,7 +38,7 @@ PROJECT_NAME = "GamecraftModdingAPI" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = "v1.3.0" +PROJECT_NUMBER = "v1.5.0" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a -- 2.30.2 From e56871f5efa28420904bd8ec013a4b424186bb67 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Mon, 3 Aug 2020 13:24:35 -0400 Subject: [PATCH 090/252] Fix wire entity queries when its not submitted yet --- GamecraftModdingAPI/Blocks/SignalEngine.cs | 29 ++++++++++++++++++++-- GamecraftModdingAPI/Blocks/Wire.cs | 24 +++++++++++++++--- 2 files changed, 47 insertions(+), 6 deletions(-) diff --git a/GamecraftModdingAPI/Blocks/SignalEngine.cs b/GamecraftModdingAPI/Blocks/SignalEngine.cs index e710e24..e961423 100644 --- a/GamecraftModdingAPI/Blocks/SignalEngine.cs +++ b/GamecraftModdingAPI/Blocks/SignalEngine.cs @@ -39,7 +39,7 @@ namespace GamecraftModdingAPI.Blocks // implementations for block wiring - public EGID CreateNewWire(EGID startBlock, byte startPort, EGID endBlock, byte endPort) + public WireEntityStruct CreateNewWire(EGID startBlock, byte startPort, EGID endBlock, byte endPort) { EGID wireEGID = new EGID(WiresExclusiveGroups.NewWireEntityId, NamedExclusiveGroup.Group); EntityComponentInitializer wireInitializer = Factory.BuildEntity(wireEGID); @@ -49,8 +49,9 @@ namespace GamecraftModdingAPI.Blocks sourcePortUsage = startPort, destinationBlockEGID = endBlock, destinationPortUsage = endPort, + ID = wireEGID }); - return wireEGID; + return wireInitializer.Get(); } public ref WireEntityStruct GetWire(EGID wire) @@ -209,11 +210,35 @@ namespace GamecraftModdingAPI.Blocks return new EGID(ports.firstInputID + portUsage, NamedExclusiveGroup.Group); } + public EGID MatchBlockInputToPort(EGID block, byte portUsage, out bool exists) + { + if (!entitiesDB.Exists(block)) + { + exists = false; + return default; + } + exists = true; + BlockPortsStruct ports = entitiesDB.QueryEntity(block); + return new EGID(ports.firstInputID + portUsage, NamedExclusiveGroup.Group); + } + public EGID MatchBlockOutputToPort(Block block, byte portUsage, out bool exists) { BlockPortsStruct ports = GetFromDbOrInitData(block, block.Id, out exists); return new EGID(ports.firstOutputID + portUsage, NamedExclusiveGroup.Group); } + + public EGID MatchBlockOutputToPort(EGID block, byte portUsage, out bool exists) + { + if (!entitiesDB.Exists(block)) + { + exists = false; + return default; + } + exists = true; + BlockPortsStruct ports = entitiesDB.QueryEntity(block); + return new EGID(ports.firstOutputID + portUsage, NamedExclusiveGroup.Group); + } public ref WireEntityStruct MatchPortToWire(EGID portID, EGID blockID, out bool exists) { diff --git a/GamecraftModdingAPI/Blocks/Wire.cs b/GamecraftModdingAPI/Blocks/Wire.cs index 9a73135..6c427f6 100644 --- a/GamecraftModdingAPI/Blocks/Wire.cs +++ b/GamecraftModdingAPI/Blocks/Wire.cs @@ -26,8 +26,8 @@ namespace GamecraftModdingAPI.Blocks public static Wire Connect(SignalingBlock start, byte startPort, SignalingBlock end, byte endPort) { - EGID wireEgid = signalEngine.CreateNewWire(start.Id, startPort, end.Id, endPort); - return new Wire(start, end, startPort, endPort, wireEgid, false); + WireEntityStruct wire = signalEngine.CreateNewWire(start.Id, startPort, end.Id, endPort); + return new Wire(wire); } /// @@ -155,6 +155,22 @@ namespace GamecraftModdingAPI.Blocks this.startBlockEGID = wire.sourceBlockEGID; this.endBlockEGID = wire.destinationBlockEGID; this.inputToOutput = false; + endPortEGID = signalEngine.MatchBlockInputToPort(wire.destinationBlockEGID, wire.destinationPortUsage, out bool exists); + if (!exists) throw new WireInvalidException("Wire end port not found"); + startPortEGID = signalEngine.MatchBlockOutputToPort(wire.sourceBlockEGID, wire.sourcePortUsage, out exists); + if (!exists) throw new WireInvalidException("Wire start port not found"); + } + + internal Wire(WireEntityStruct wire) + { + this.wireEGID = wire.ID; + this.startBlockEGID = wire.sourceBlockEGID; + this.endBlockEGID = wire.destinationBlockEGID; + inputToOutput = false; + endPortEGID = signalEngine.MatchBlockInputToPort(wire.destinationBlockEGID, wire.destinationPortUsage, out bool exists); + if (!exists) throw new WireInvalidException("Wire end port not found"); + startPortEGID = signalEngine.MatchBlockOutputToPort(wire.sourceBlockEGID, wire.sourcePortUsage, out exists); + if (!exists) throw new WireInvalidException("Wire start port not found"); } /// @@ -328,9 +344,9 @@ namespace GamecraftModdingAPI.Blocks { if (signalEngine.Exists(wireEGID)) { - return $"{nameof(Id)}: {Id}, Start{nameof(Start.Id)}: {Start.Id}, End{nameof(Id)}: {End.Id}, ({Start.Type}::{StartPort} aka {Start.PortName(StartPort, inputToOutput)}) -> ({End.Type}::{EndPort} aka {End.PortName(EndPort, !inputToOutput)})"; + return $"{nameof(Id)}: {Id}, Start{nameof(Start.Id)}: {Start.Id}, End{nameof(End.Id)}: {End.Id}, ({Start.Type}::{StartPort} aka {Start.PortName(StartPort, inputToOutput)}) -> ({End.Type}::{EndPort} aka {End.PortName(EndPort, !inputToOutput)})"; } - return $"{nameof(Id)}: {Id}, Start{nameof(Start.Id)}: {Start.Id}, End{nameof(Id)}: {End.Id}, ({Start.Type}::{StartPort}) -> ({End.Type}::{EndPort})"; + return $"{nameof(Id)}: {Id}, Start{nameof(Start.Id)}: {Start.Id}, End{nameof(End.Id)}: {End.Id}, ({Start.Type} -> {End.Type})"; } internal static void Init() { } -- 2.30.2 From 7f5a36cb621213d07af665f58165ac95bc272f77 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Tue, 4 Aug 2020 15:10:07 -0400 Subject: [PATCH 091/252] Automate version bumping because I keep forgetting doxygen.conf --- Automation/bump_version.py | 67 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100755 Automation/bump_version.py diff --git a/Automation/bump_version.py b/Automation/bump_version.py new file mode 100755 index 0000000..d3de051 --- /dev/null +++ b/Automation/bump_version.py @@ -0,0 +1,67 @@ +#!/usr/bin/python3 + +import argparse +import re +# this assumes a mostly semver-complient version number + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description="Increment GamecraftModdingAPI version") + parser.add_argument('version', metavar="VN", type=str, help="The version number to increment, or the index of the number (zero-indexed).") + args = parser.parse_args() + + version_index = -1 + try: + version_index = int(args.version) + except Exception: + if args.version.lower() == "major": + version_index = 0 + elif args.version.lower() == "minor": + version_index = 1 + elif args.version.lower() == "patch": + version_index = 2 + + if version_index < 0: + print("Could not parse version argument.") + exit(version_index) + + print(version_index) + old_version = "" + new_version = "" + + with open("../GamecraftModdingAPI/GamecraftModdingAPI.csproj", "r") as xmlFile: + print("Parsing GamecraftModdingAPI.csproj") + fileStr = xmlFile.read() + versionMatch = re.search(r"(.+)", fileStr) + if versionMatch is None: + print("Unable to find version number in GamecraftModdingAPI.csproj") + exit(1) + old_version = versionMatch.group(1) + versionList = old_version.split(".") + if len(versionList) <= version_index: + print("Invalid version string") + exit(1) + versionList[version_index] = str(int(versionList[version_index]) + 1) + for i in range(version_index + 1, len(versionList)): + try: + int(versionList[i]) + versionList[i] = "0" + except Exception: + tmp = versionList[i].split("-") + tmp[0] = "0" + versionList[i] = "-".join(tmp) + new_version = ".".join(versionList) + print(new_version) + newFileContents = fileStr.replace(""+old_version+"", ""+new_version+"") + + with open("../GamecraftModdingAPI/GamecraftModdingAPI.csproj", "w") as xmlFile: + print("Writing new version to project file") + xmlFile.write(newFileContents) + + with open("../doxygen.conf", "r") as doxFile: + print("Parsing doxygen.conf") + doxStr = doxFile.read() + newFileContents = doxStr.replace("= \"v" + old_version + "\"", "= \"v" + new_version + "\"") + + with open("../doxygen.conf", "w") as doxFile: + print("Writing new version to doxygen config") + doxFile.write(newFileContents) -- 2.30.2 From 83541231695ac99062c495c056cf25d863ed2b6d Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Fri, 7 Aug 2020 12:05:49 -0400 Subject: [PATCH 092/252] Cache additional info to avoid entity queries --- GamecraftModdingAPI/Blocks/Wire.cs | 41 +++++++++++++++--------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/GamecraftModdingAPI/Blocks/Wire.cs b/GamecraftModdingAPI/Blocks/Wire.cs index 6c427f6..c29795f 100644 --- a/GamecraftModdingAPI/Blocks/Wire.cs +++ b/GamecraftModdingAPI/Blocks/Wire.cs @@ -24,6 +24,10 @@ namespace GamecraftModdingAPI.Blocks protected bool inputToOutput; + protected byte startPort; + + protected byte endPort; + public static Wire Connect(SignalingBlock start, byte startPort, SignalingBlock end, byte endPort) { WireEntityStruct wire = signalEngine.CreateNewWire(start.Id, startPort, end.Id, endPort); @@ -90,6 +94,8 @@ namespace GamecraftModdingAPI.Blocks startPortEGID = signalEngine.MatchBlockOutputToPort(start, wire.sourcePortUsage, out exists); if (!exists) throw new WireInvalidException("Wire start port not found"); inputToOutput = false; + endPort = wire.destinationPortUsage; + startPort = wire.sourcePortUsage; } else { @@ -105,6 +111,8 @@ namespace GamecraftModdingAPI.Blocks inputToOutput = true; // end is actually the source // NB: start and end are handled exactly as they're received as params. // This makes wire traversal easier, but makes logic in this class a bit more complex + endPort = wire.sourcePortUsage; + startPort = wire.destinationPortUsage; } else { @@ -142,6 +150,8 @@ namespace GamecraftModdingAPI.Blocks startPortEGID = signalEngine.MatchBlockOutputToPort(start, startPort, out exists); if (!exists) throw new WireInvalidException("Wire start port not found"); } + this.startPort = startPort; + this.endPort = endPort; } /// @@ -159,6 +169,8 @@ namespace GamecraftModdingAPI.Blocks if (!exists) throw new WireInvalidException("Wire end port not found"); startPortEGID = signalEngine.MatchBlockOutputToPort(wire.sourceBlockEGID, wire.sourcePortUsage, out exists); if (!exists) throw new WireInvalidException("Wire start port not found"); + this.endPort = wire.destinationPortUsage; + this.startPort = wire.sourcePortUsage; } internal Wire(WireEntityStruct wire) @@ -171,6 +183,8 @@ namespace GamecraftModdingAPI.Blocks if (!exists) throw new WireInvalidException("Wire end port not found"); startPortEGID = signalEngine.MatchBlockOutputToPort(wire.sourceBlockEGID, wire.sourcePortUsage, out exists); if (!exists) throw new WireInvalidException("Wire start port not found"); + this.endPort = wire.destinationPortUsage; + this.startPort = wire.sourcePortUsage; } /// @@ -275,15 +289,7 @@ namespace GamecraftModdingAPI.Blocks /// public byte StartPort { - get - { - WireEntityStruct wire = signalEngine.GetWire(wireEGID); - if (inputToOutput) - { - return wire.destinationPortUsage; - } - return wire.sourcePortUsage; - } + get => startPort; } /// @@ -299,15 +305,7 @@ namespace GamecraftModdingAPI.Blocks /// public byte EndPort { - get - { - WireEntityStruct wire = signalEngine.GetWire(wireEGID); - if (inputToOutput) - { - return wire.sourcePortUsage; - } - return wire.destinationPortUsage; - } + get => endPort; } /// @@ -322,7 +320,7 @@ namespace GamecraftModdingAPI.Blocks /// /// Convert the wire object to the direction the signal flows. - /// Signals on wires always flows from a block output port to a block input port. + /// Signals on wires always flow from a block output port to a block input port. /// This is simply a different memory configuration and does not affect the in-game wire (which is always output -> input). /// public void OutputToInputInPlace() @@ -337,6 +335,9 @@ namespace GamecraftModdingAPI.Blocks temp = endPortEGID; endPortEGID = startPortEGID; startPortEGID = temp; + byte tempPortNumber = endPort; + endPort = startPort; + startPort = tempPortNumber; } } @@ -346,7 +347,7 @@ namespace GamecraftModdingAPI.Blocks { return $"{nameof(Id)}: {Id}, Start{nameof(Start.Id)}: {Start.Id}, End{nameof(End.Id)}: {End.Id}, ({Start.Type}::{StartPort} aka {Start.PortName(StartPort, inputToOutput)}) -> ({End.Type}::{EndPort} aka {End.PortName(EndPort, !inputToOutput)})"; } - return $"{nameof(Id)}: {Id}, Start{nameof(Start.Id)}: {Start.Id}, End{nameof(End.Id)}: {End.Id}, ({Start.Type} -> {End.Type})"; + return $"{nameof(Id)}: {Id}, Start{nameof(Start.Id)}: {Start.Id}, End{nameof(End.Id)}: {End.Id}, ({Start.Type}::{StartPort} -> {End.Type}::{EndPort})"; } internal static void Init() { } -- 2.30.2 From 50ebf4f0a600430a1f33452ac1cad0eb8a054783 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Fri, 7 Aug 2020 13:55:00 -0400 Subject: [PATCH 093/252] Fix build issues for latest Gamecraft preview version --- GamecraftModdingAPI/App/GameMenuEngine.cs | 17 ++- GamecraftModdingAPI/Block.cs | 4 +- GamecraftModdingAPI/Blocks/BlockEngine.cs | 70 ++++++++++- GamecraftModdingAPI/Blocks/BlockTests.cs | 2 +- GamecraftModdingAPI/Blocks/SignalEngine.cs | 4 +- .../GamecraftModdingAPI.csproj | 113 +++++++++++++++--- GamecraftModdingAPI/Players/PlayerEngine.cs | 11 +- 7 files changed, 184 insertions(+), 37 deletions(-) diff --git a/GamecraftModdingAPI/App/GameMenuEngine.cs b/GamecraftModdingAPI/App/GameMenuEngine.cs index fc2c35f..74bc42a 100644 --- a/GamecraftModdingAPI/App/GameMenuEngine.cs +++ b/GamecraftModdingAPI/App/GameMenuEngine.cs @@ -10,6 +10,7 @@ using Svelto.ECS.Experimental; using GamecraftModdingAPI.Engines; using GamecraftModdingAPI.Utility; +using Svelto.DataStructures; namespace GamecraftModdingAPI.App { @@ -114,11 +115,21 @@ namespace GamecraftModdingAPI.App } public ref MyGamesSlotEntityViewStruct GetGameViewInfo(EGID id) - { - return ref GetComponent(new EGID(id.entityID, MyGamesScreenExclusiveGroups.GameSlotGuiEntities)); + { + EntityCollection entities = + entitiesDB.QueryEntities(MyGamesScreenExclusiveGroups.GameSlotGuiEntities); + for (int i = 0; i < entities.count; i++) + { + if (entities[i].ID.entityID == id.entityID) + { + return ref entities[i]; + } + } + MyGamesSlotEntityViewStruct[] defRef = new MyGamesSlotEntityViewStruct[1]; + return ref defRef[0]; } - public ref T GetComponent(EGID id) where T: struct, IEntityComponent + public ref T GetComponent(EGID id) where T: unmanaged, IEntityComponent { return ref entitiesDB.QueryEntity(id); } diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index 0194bae..c7b5d0d 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -337,10 +337,10 @@ namespace GamecraftModdingAPI /// public string Label { - get => BlockEngine.GetBlockInfo(this, (TextLabelEntityViewStruct st) => st.textLabelComponent?.text); + get => BlockEngine.GetBlockInfoViewStruct(this, (TextLabelEntityViewStruct st) => st.textLabelComponent?.text); set { - BlockEngine.SetBlockInfo(this, (ref TextLabelEntityViewStruct text, string val) => + BlockEngine.SetBlockInfoViewStruct(this, (ref TextLabelEntityViewStruct text, string val) => { if (text.textLabelComponent != null) text.textLabelComponent.text = val; }, value); diff --git a/GamecraftModdingAPI/Blocks/BlockEngine.cs b/GamecraftModdingAPI/Blocks/BlockEngine.cs index f97e405..33c4002 100644 --- a/GamecraftModdingAPI/Blocks/BlockEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlockEngine.cs @@ -59,16 +59,34 @@ namespace GamecraftModdingAPI.Blocks color.paletteColour = paletteEntry.Colour; } - public ref T GetBlockInfo(EGID blockID) where T : struct, IEntityComponent + public ref T GetBlockInfo(EGID blockID) where T : unmanaged, IEntityComponent { if (entitiesDB.Exists(blockID)) return ref entitiesDB.QueryEntity(blockID); T[] structHolder = new T[1]; //Create something that can be referenced return ref structHolder[0]; //Gets a default value automatically } + + public ref T GetBlockInfoViewStruct(EGID blockID) where T : struct, INeedEGID, IEntityComponent + { + if (entitiesDB.Exists(blockID)) + { + // TODO: optimize by using EntitiesDB internal calls instead of iterating over everything + EntityCollection entities = entitiesDB.QueryEntities(blockID.groupID); + for (int i = 0; i < entities.count; i++) + { + if (entities[i].ID == blockID) + { + return ref entities[i]; + } + } + } + T[] structHolder = new T[1]; //Create something that can be referenced + return ref structHolder[0]; //Gets a default value automatically + } public U GetBlockInfo(Block block, Func getter, - U def = default) where T : struct, IEntityComponent + U def = default) where T : unmanaged, IEntityComponent { if (entitiesDB.Exists(block.Id)) return getter(entitiesDB.QueryEntity(block.Id)); @@ -78,10 +96,56 @@ namespace GamecraftModdingAPI.Blocks return getter(initializer.Get()); return def; } + + public U GetBlockInfoViewStruct(Block block, Func getter, + U def = default) where T : struct, INeedEGID, IEntityComponent + { + if (entitiesDB.Exists(block.Id)) + { + // TODO: optimize by using EntitiesDB internal calls instead of iterating over everything + EntityCollection entities = entitiesDB.QueryEntities(block.Id.groupID); + for (int i = 0; i < entities.count; i++) + { + if (entities[i].ID == block.Id) + { + return getter(entities[i]); + } + } + } + if (block.InitData.Group == null) return def; + var initializer = new EntityComponentInitializer(block.Id, block.InitData.Group); + if (initializer.Has()) + return getter(initializer.Get()); + return def; + } public delegate void Setter(ref T component, U value) where T : struct, IEntityComponent; - public void SetBlockInfo(Block block, Setter setter, U value) where T : struct, IEntityComponent + public void SetBlockInfoViewStruct(Block block, Setter setter, U value) where T : struct, INeedEGID, IEntityComponent + { + if (entitiesDB.Exists(block.Id)) + { + EntityCollection entities = entitiesDB.QueryEntities(block.Id.groupID); + for (int i = 0; i < entities.count; i++) + { + if (entities[i].ID == block.Id) + { + setter(ref entities[i], value); + return; + } + } + } + else if (block.InitData.Group != null) + { + var initializer = new EntityComponentInitializer(block.Id, block.InitData.Group); + T component = initializer.Has() ? initializer.Get() : default; + ref T structRef = ref component; + setter(ref structRef, value); + initializer.Init(structRef); + } + } + + public void SetBlockInfo(Block block, Setter setter, U value) where T : unmanaged, IEntityComponent { if (entitiesDB.Exists(block.Id)) setter(ref entitiesDB.QueryEntity(block.Id), value); diff --git a/GamecraftModdingAPI/Blocks/BlockTests.cs b/GamecraftModdingAPI/Blocks/BlockTests.cs index 9013b3d..5447f6c 100644 --- a/GamecraftModdingAPI/Blocks/BlockTests.cs +++ b/GamecraftModdingAPI/Blocks/BlockTests.cs @@ -119,6 +119,6 @@ namespace GamecraftModdingAPI.Blocks if (!Assert.Errorless(() => { newWire = b.Connect(0, target, 0);})) return; if (!Assert.NotNull(newWire, "SignalingBlock.Connect(...) returned null, possible because it failed silently.", "SignalingBlock.Connect(...) returned a non-null value.")) return; } -} + } #endif } diff --git a/GamecraftModdingAPI/Blocks/SignalEngine.cs b/GamecraftModdingAPI/Blocks/SignalEngine.cs index e961423..763a1a1 100644 --- a/GamecraftModdingAPI/Blocks/SignalEngine.cs +++ b/GamecraftModdingAPI/Blocks/SignalEngine.cs @@ -96,7 +96,7 @@ namespace GamecraftModdingAPI.Blocks return ref GetPortByOffset(bps, portNumber, input); } - public ref T GetComponent(EGID egid) where T : struct, IEntityComponent + public ref T GetComponent(EGID egid) where T : unmanaged, IEntityComponent { return ref entitiesDB.QueryEntity(egid); } @@ -372,7 +372,7 @@ namespace GamecraftModdingAPI.Blocks return results.ToArray(); } - private ref T GetFromDbOrInitData(Block block, EGID id, out bool exists) where T : struct, IEntityComponent + private ref T GetFromDbOrInitData(Block block, EGID id, out bool exists) where T : unmanaged, IEntityComponent { T[] defRef = new T[1]; if (entitiesDB.Exists(id)) diff --git a/GamecraftModdingAPI/GamecraftModdingAPI.csproj b/GamecraftModdingAPI/GamecraftModdingAPI.csproj index 7337ebe..7a7fe1d 100644 --- a/GamecraftModdingAPI/GamecraftModdingAPI.csproj +++ b/GamecraftModdingAPI/GamecraftModdingAPI.csproj @@ -25,8 +25,17 @@ + + + ..\ref\GamecraftPreview_Data\Managed\IllusionInjector.dll + ..\..\ref\GamecraftPreview_Data\Managed\IllusionInjector.dll + + + ..\ref\GamecraftPreview_Data\Managed\IllusionPlugin.dll + ..\..\ref\GamecraftPreview_Data\Managed\IllusionPlugin.dll + ..\ref\GamecraftPreview_Data\Managed\Analytics.dll ..\..\ref\GamecraftPreview_Data\Managed\Analytics.dll @@ -43,10 +52,6 @@ ..\ref\GamecraftPreview_Data\Managed\Authentication.dll ..\..\ref\GamecraftPreview_Data\Managed\Authentication.dll - - ..\ref\GamecraftPreview_Data\Managed\BlockEntityFactory.dll - ..\..\ref\GamecraftPreview_Data\Managed\BlockEntityFactory.dll - ..\ref\GamecraftPreview_Data\Managed\Blocks.HUDFeedbackBlocks.dll ..\..\ref\GamecraftPreview_Data\Managed\Blocks.HUDFeedbackBlocks.dll @@ -55,6 +60,18 @@ ..\ref\GamecraftPreview_Data\Managed\CommandLine.dll ..\..\ref\GamecraftPreview_Data\Managed\CommandLine.dll + + ..\ref\GamecraftPreview_Data\Managed\CommandLineCompositionRoot.dll + ..\..\ref\GamecraftPreview_Data\Managed\CommandLineCompositionRoot.dll + + + ..\ref\GamecraftPreview_Data\Managed\ConsoleBlockComposotionRoot.dll + ..\..\ref\GamecraftPreview_Data\Managed\ConsoleBlockComposotionRoot.dll + + + ..\ref\GamecraftPreview_Data\Managed\ConsoleCommand.dll + ..\..\ref\GamecraftPreview_Data\Managed\ConsoleCommand.dll + ..\ref\GamecraftPreview_Data\Managed\DataLoader.dll ..\..\ref\GamecraftPreview_Data\Managed\DataLoader.dll @@ -75,6 +92,14 @@ ..\ref\GamecraftPreview_Data\Managed\Gamecraft.AudioBlocks.dll ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.AudioBlocks.dll + + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.BlockCompositionRoot.dll + ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.BlockCompositionRoot.dll + + + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.BlockEntityFactory.dll + ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.BlockEntityFactory.dll + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.Blocks.ConsoleBlock.dll ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.Blocks.ConsoleBlock.dll @@ -83,6 +108,10 @@ ..\ref\GamecraftPreview_Data\Managed\Gamecraft.Blocks.DamagingSurfaceBlock.dll ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.Blocks.DamagingSurfaceBlock.dll + + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.Blocks.DestructionBlocks.dll + ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.Blocks.DestructionBlocks.dll + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.Blocks.GenericPhysicsBlocks.dll ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.Blocks.GenericPhysicsBlocks.dll @@ -95,10 +124,18 @@ ..\ref\GamecraftPreview_Data\Managed\GameCraft.Blocks.ProjectileBlock.dll ..\..\ref\GamecraftPreview_Data\Managed\GameCraft.Blocks.ProjectileBlock.dll + + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.Blocks.TextBlock.CompositionRoot.dll + ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.Blocks.TextBlock.CompositionRoot.dll + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.Blocks.TimerBlock.dll ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.Blocks.TimerBlock.dll + + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll + ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.CharacterVulnerability.dll ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.CharacterVulnerability.dll @@ -107,10 +144,22 @@ ..\ref\GamecraftPreview_Data\Managed\Gamecraft.CharacterVulnerabilityGui.dll ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.CharacterVulnerabilityGui.dll + + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.Damage.dll + ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.Damage.dll + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.Effects.dll ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.Effects.dll + + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.ExplosionFragments.dll + ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.ExplosionFragments.dll + + + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.GraphicsSettings.dll + ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.GraphicsSettings.dll + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.ConsoleBlock.dll ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.ConsoleBlock.dll @@ -139,6 +188,14 @@ ..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll + + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.InventoryTimeRunning.dll + ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.InventoryTimeRunning.dll + + + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.JointBlocks.dll + ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.JointBlocks.dll + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.Music.dll ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.Music.dll @@ -147,6 +204,22 @@ ..\ref\GamecraftPreview_Data\Managed\Gamecraft.PerformanceWarnings.dll ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.PerformanceWarnings.dll + + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.PickupBlck.dll + ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.PickupBlck.dll + + + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.PickupsCommon.dll + ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.PickupsCommon.dll + + + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.PopupMessage.dll + ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.PopupMessage.dll + + + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.Projectiles.dll + ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.Projectiles.dll + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.Tweaks.dll ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.Tweaks.dll @@ -155,6 +228,10 @@ ..\ref\GamecraftPreview_Data\Managed\Gamecraft.Tweaks.Mockup.dll ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.Tweaks.Mockup.dll + + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.VisualEffects.Decals.dll + ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.VisualEffects.Decals.dll + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.VisualEffects.dll ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.VisualEffects.dll @@ -163,10 +240,6 @@ ..\ref\GamecraftPreview_Data\Managed\Gamecraft.Wires.dll ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.Wires.dll - - ..\ref\GamecraftPreview_Data\Managed\Gamecraft.Wires.Input.dll - ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.Wires.Input.dll - ..\ref\GamecraftPreview_Data\Managed\Gamecraft.Wires.Mockup.dll ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.Wires.Mockup.dll @@ -379,6 +452,14 @@ ..\ref\GamecraftPreview_Data\Managed\RobocratX.SimulationCompositionRoot.dll ..\..\ref\GamecraftPreview_Data\Managed\RobocratX.SimulationCompositionRoot.dll + + ..\ref\GamecraftPreview_Data\Managed\SpawningPointCompositionRoot.dll + ..\..\ref\GamecraftPreview_Data\Managed\SpawningPointCompositionRoot.dll + + + ..\ref\GamecraftPreview_Data\Managed\SpecializedDescriptors.dll + ..\..\ref\GamecraftPreview_Data\Managed\SpecializedDescriptors.dll + ..\ref\GamecraftPreview_Data\Managed\StringFormatter.dll ..\..\ref\GamecraftPreview_Data\Managed\StringFormatter.dll @@ -399,6 +480,10 @@ ..\ref\GamecraftPreview_Data\Managed\Svelto.Tasks.dll ..\..\ref\GamecraftPreview_Data\Managed\Svelto.Tasks.dll + + ..\ref\GamecraftPreview_Data\Managed\UltimateDecals.dll + ..\..\ref\GamecraftPreview_Data\Managed\UltimateDecals.dll + ..\ref\GamecraftPreview_Data\Managed\Unity.Addressables.dll ..\..\ref\GamecraftPreview_Data\Managed\Unity.Addressables.dll @@ -563,6 +648,10 @@ ..\ref\GamecraftPreview_Data\Managed\Unity.Transforms.Hybrid.dll ..\..\ref\GamecraftPreview_Data\Managed\Unity.Transforms.Hybrid.dll + + ..\ref\GamecraftPreview_Data\Managed\Unity.VisualEffectGraph.Runtime.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.VisualEffectGraph.Runtime.dll + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.UI.dll ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.UI.dll @@ -855,14 +944,6 @@ ..\ref\GamecraftPreview_Data\Managed\UnityEngine.XRModule.dll ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.XRModule.dll - - ..\ref\GamecraftPreview_Data\Managed\IllusionInjector.dll - ..\..\ref\GamecraftPreview_Data\Managed\IllusionInjector.dll - - - ..\ref\GamecraftPreview_Data\Managed\IllusionPlugin.dll - ..\..\ref\GamecraftPreview_Data\Managed\IllusionPlugin.dll - \ No newline at end of file diff --git a/GamecraftModdingAPI/Players/PlayerEngine.cs b/GamecraftModdingAPI/Players/PlayerEngine.cs index 805ae21..ce0b63a 100644 --- a/GamecraftModdingAPI/Players/PlayerEngine.cs +++ b/GamecraftModdingAPI/Players/PlayerEngine.cs @@ -10,8 +10,6 @@ using RobocraftX.Physics; using RobocraftX.Blocks.Ghost; using RobocraftX.Character.Camera; using RobocraftX.Character.Factories; -using Gamecraft.CharacterVulnerability; -using Gamecraft.CharacterVulnerability.Entities; using Svelto.ECS; using Unity.Mathematics; using Unity.Physics; @@ -282,14 +280,7 @@ namespace GamecraftModdingAPI.Players public bool DamagePlayer(uint playerId, float amount) { if (entitiesDB == null) return false; - Factory.BuildEntity( - new EGID(CharacterVulnerabilityExclusiveGroups.NextDamageEntityId, CharacterVulnerabilityExclusiveGroups.CharacterDamageExclusiveGroup) - ).Init(new DamageEntityStruct - { - damage = amount, - targetPlayerEntityId = playerId, - }); - return true; + return SetCurrentHealth(playerId, GetCurrentHealth(playerId) - amount); } public bool GetDamageable(uint playerId) -- 2.30.2 From 89f354b647d1f2fcefa8db82828318d76af3b28c Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Thu, 13 Aug 2020 10:12:36 -0400 Subject: [PATCH 094/252] Fix Game Over detection --- GamecraftModdingAPI/Players/PlayerEngine.cs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/GamecraftModdingAPI/Players/PlayerEngine.cs b/GamecraftModdingAPI/Players/PlayerEngine.cs index 805ae21..f0aa31d 100644 --- a/GamecraftModdingAPI/Players/PlayerEngine.cs +++ b/GamecraftModdingAPI/Players/PlayerEngine.cs @@ -1,4 +1,6 @@ using System; +using System.Collections.Generic; +using System.Reflection; using System.Runtime.CompilerServices; using RobocraftX.Character; @@ -12,12 +14,16 @@ using RobocraftX.Character.Camera; using RobocraftX.Character.Factories; using Gamecraft.CharacterVulnerability; using Gamecraft.CharacterVulnerability.Entities; +using Gamecraft.GUI.HUDFeedbackBlocks; using Svelto.ECS; using Unity.Mathematics; using Unity.Physics; using UnityEngine; using GamecraftModdingAPI.Engines; +using HarmonyLib; +using RobocraftX.Common; +using Svelto.ECS.DataStructures; namespace GamecraftModdingAPI.Players { @@ -365,15 +371,12 @@ namespace GamecraftModdingAPI.Players public bool GetGameOverScreen(uint playerId) { if (entitiesDB == null) return false; - ref var c = ref GetCharacterStruct(playerId, out bool exists); - if (exists) - { - return c.gameOverScreen; - } - return false; + ref HudActivatedBlocksEntityStruct habes = ref entitiesDB.QueryEntity(HUDFeedbackBlocksGUIExclusiveGroups.GameOverHudEgid); + NativeDynamicArrayCast nativeDynamicArrayCast = new NativeDynamicArrayCast(habes.activatedBlocksOrdered); + return nativeDynamicArrayCast.count > 0; } - public bool IsDead(uint playerId) + public bool IsDead(uint playerId) { if (entitiesDB == null) return true; return entitiesDB.Exists(playerId, CharacterExclusiveGroups.DeadCharacters); -- 2.30.2 From 2172364d2674f65b3db843fdcdfe7d3fb573a0f9 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Thu, 13 Aug 2020 16:59:13 +0200 Subject: [PATCH 095/252] Fixes, block IDs, cluster & chunk health support --- GamecraftModdingAPI/Block.cs | 2 +- GamecraftModdingAPI/Blocks/BlockEngine.cs | 91 +++++++++++-------- GamecraftModdingAPI/Blocks/BlockIDs.cs | 5 + GamecraftModdingAPI/Cluster.cs | 41 +++++++++ GamecraftModdingAPI/SimBody.cs | 37 ++++++++ .../Tests/GamecraftModdingAPIPluginTest.cs | 10 ++ .../Utility/DebugInterfaceEngine.cs | 11 ++- 7 files changed, 154 insertions(+), 43 deletions(-) create mode 100644 GamecraftModdingAPI/Cluster.cs diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index c7b5d0d..b901f81 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -372,7 +372,7 @@ namespace GamecraftModdingAPI public SimBody GetSimBody() { return BlockEngine.GetBlockInfo(this, - (GridConnectionsEntityStruct st) => new SimBody(st.machineRigidBodyId)); + (GridConnectionsEntityStruct st) => new SimBody(st.machineRigidBodyId, st.clusterId)); } private void OnPlacedInit(object sender, BlockPlacedRemovedEventArgs e) diff --git a/GamecraftModdingAPI/Blocks/BlockEngine.cs b/GamecraftModdingAPI/Blocks/BlockEngine.cs index 33c4002..2622d41 100644 --- a/GamecraftModdingAPI/Blocks/BlockEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlockEngine.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Linq; using Gamecraft.Wires; using RobocraftX.Blocks; @@ -9,6 +10,7 @@ using RobocraftX.Physics; using RobocraftX.Scene.Simulation; using Svelto.DataStructures; using Svelto.ECS; +using Svelto.ECS.Hybrid; using GamecraftModdingAPI.Engines; @@ -90,28 +92,19 @@ namespace GamecraftModdingAPI.Blocks { if (entitiesDB.Exists(block.Id)) return getter(entitiesDB.QueryEntity(block.Id)); - if (block.InitData.Group == null) return def; - var initializer = new EntityComponentInitializer(block.Id, block.InitData.Group); - if (initializer.Has()) - return getter(initializer.Get()); - return def; + return GetBlockInitInfo(block, getter, def); } public U GetBlockInfoViewStruct(Block block, Func getter, - U def = default) where T : struct, INeedEGID, IEntityComponent + U def = default) where T : struct, IEntityViewComponent { if (entitiesDB.Exists(block.Id)) - { - // TODO: optimize by using EntitiesDB internal calls instead of iterating over everything - EntityCollection entities = entitiesDB.QueryEntities(block.Id.groupID); - for (int i = 0; i < entities.count; i++) - { - if (entities[i].ID == block.Id) - { - return getter(entities[i]); - } - } - } + return getter(entitiesDB.QueryEntity(block.Id)); + return GetBlockInitInfo(block, getter, def); + } + + private U GetBlockInitInfo(Block block, Func getter, U def) where T : struct, IEntityComponent + { if (block.InitData.Group == null) return def; var initializer = new EntityComponentInitializer(block.Id, block.InitData.Group); if (initializer.Has()) @@ -121,35 +114,26 @@ namespace GamecraftModdingAPI.Blocks public delegate void Setter(ref T component, U value) where T : struct, IEntityComponent; - public void SetBlockInfoViewStruct(Block block, Setter setter, U value) where T : struct, INeedEGID, IEntityComponent + public void SetBlockInfoViewStruct(Block block, Setter setter, U value) where T : struct, IEntityViewComponent { if (entitiesDB.Exists(block.Id)) - { - EntityCollection entities = entitiesDB.QueryEntities(block.Id.groupID); - for (int i = 0; i < entities.count; i++) - { - if (entities[i].ID == block.Id) - { - setter(ref entities[i], value); - return; - } - } - } - else if (block.InitData.Group != null) - { - var initializer = new EntityComponentInitializer(block.Id, block.InitData.Group); - T component = initializer.Has() ? initializer.Get() : default; - ref T structRef = ref component; - setter(ref structRef, value); - initializer.Init(structRef); - } + setter(ref entitiesDB.QueryEntity(block.Id), value); + else + SetBlockInitInfo(block, setter, value); } public void SetBlockInfo(Block block, Setter setter, U value) where T : unmanaged, IEntityComponent { if (entitiesDB.Exists(block.Id)) setter(ref entitiesDB.QueryEntity(block.Id), value); - else if (block.InitData.Group != null) + else + SetBlockInitInfo(block, setter, value); + } + + private void SetBlockInitInfo(Block block, Setter setter, U value) + where T : struct, IEntityComponent + { + if (block.InitData.Group != null) { var initializer = new EntityComponentInitializer(block.Id, block.InitData.Group); T component = initializer.Has() ? initializer.Get() : default; @@ -222,6 +206,22 @@ namespace GamecraftModdingAPI.Blocks return list.ToArray(); } + public SimBody[] GetClusterBodies(uint cid) + { + var groups = entitiesDB.QueryEntities(); + var bodies = new HashSet(); + foreach (var (coll, _) in groups) + { + foreach (var conn in coll) + { + if (conn.clusterId == cid) + bodies.Add(conn.machineRigidBodyId); + } + } + + return bodies.Select(id => new SimBody(id)).ToArray(); + } + public EGID? FindBlockEGID(uint id) { var groups = entitiesDB.FindGroups(); @@ -234,6 +234,21 @@ namespace GamecraftModdingAPI.Blocks return null; } + public Cluster GetCluster(uint sbid) + { + var groups = entitiesDB.QueryEntities(); + foreach (var (coll, _) in groups) + { + foreach (var conn in coll) + { + if (conn.machineRigidBodyId == sbid) + return new Cluster(conn.clusterId); + } + } + + return null; + } + #if DEBUG public EntitiesDB GetEntitiesDB() { diff --git a/GamecraftModdingAPI/Blocks/BlockIDs.cs b/GamecraftModdingAPI/Blocks/BlockIDs.cs index 596fb38..33f9522 100644 --- a/GamecraftModdingAPI/Blocks/BlockIDs.cs +++ b/GamecraftModdingAPI/Blocks/BlockIDs.cs @@ -192,6 +192,9 @@ namespace GamecraftModdingAPI.Blocks PlayerFilter, TeamFilter, Number2Text, //193 + DestructionManager = 260, + ChunkHealthModifier, + ClusterHealthModifier, //262 BeachTree1 = 200, BeachTree2, BeachTree3, @@ -243,6 +246,8 @@ namespace GamecraftModdingAPI.Blocks AdvancedRotator, MusicBlock, //256 PlasmaCannonBlock, + QuantumRiflePickup = 300, + QuantumRifleAmmoPickup, MagmaRockCube=777, MagmaRockCubeSliced, MagmaRockSlope, diff --git a/GamecraftModdingAPI/Cluster.cs b/GamecraftModdingAPI/Cluster.cs new file mode 100644 index 0000000..074c26c --- /dev/null +++ b/GamecraftModdingAPI/Cluster.cs @@ -0,0 +1,41 @@ +using Gamecraft.Damage; +using RobocraftX.Common; +using Svelto.ECS; + +namespace GamecraftModdingAPI +{ + /// + /// Represnts a cluster of blocks in time running mode, meaning blocks that are connected either directly or via joints. + /// + public class Cluster + { + public EGID Id { get; } + + public Cluster(EGID id) + { + Id = id; + } + + public Cluster(uint id) : this(new EGID(id, CommonExclusiveGroups.SIMULATION_CLUSTERS_GROUP)) + { + } + + public float InitialHealth + { + get => Block.BlockEngine.GetBlockInfo(Id).initialHealth; + set => Block.BlockEngine.GetBlockInfo(Id).initialHealth = value; + } + + public float CurrentHealth + { + get => Block.BlockEngine.GetBlockInfo(Id).currentHealth; + set => Block.BlockEngine.GetBlockInfo(Id).currentHealth = value; + } + + public float HealthMultiplier + { + get => Block.BlockEngine.GetBlockInfo(Id).healthMultiplier; + set => Block.BlockEngine.GetBlockInfo(Id).healthMultiplier = value; + } + } +} \ No newline at end of file diff --git a/GamecraftModdingAPI/SimBody.cs b/GamecraftModdingAPI/SimBody.cs index 19f4285..a3f6d55 100644 --- a/GamecraftModdingAPI/SimBody.cs +++ b/GamecraftModdingAPI/SimBody.cs @@ -3,6 +3,7 @@ using Svelto.ECS; using Unity.Mathematics; using UnityEngine; +using Gamecraft.Damage; using RobocraftX.Common; using RobocraftX.Physics; @@ -15,6 +16,14 @@ namespace GamecraftModdingAPI { public EGID Id { get; } + /// + /// The cluster this chunk belongs to, or null if the chunk doesn't exist. Get the SimBody from a Block if possible for good performance here. + /// + public Cluster Cluster => cluster ?? (cluster = clusterId == uint.MaxValue ? Block.BlockEngine.GetCluster(Id.entityID) : new Cluster(clusterId)); + + private Cluster cluster; + private uint clusterId; + public SimBody(EGID id) { Id = id; @@ -24,6 +33,11 @@ namespace GamecraftModdingAPI { } + internal SimBody(uint id, uint clusterID) : this(id) + { + clusterId = clusterID; + } + /// /// The position of this body. When setting the position, update the position of the connected bodies as well, /// otherwise unexpected forces may arise. @@ -70,6 +84,29 @@ namespace GamecraftModdingAPI //set => GetStruct().physicsMass.CenterOfMass = value; } + public float Volume + { + get => GetStruct().volume; + } + + public float InitialHealth + { + get => Block.BlockEngine.GetBlockInfo(Id).initialHealth; + set => Block.BlockEngine.GetBlockInfo(Id).initialHealth = value; + } + + public float CurrentHealth + { + get => Block.BlockEngine.GetBlockInfo(Id).currentHealth; + set => Block.BlockEngine.GetBlockInfo(Id).currentHealth = value; + } + + public float HealthMultiplier + { + get => Block.BlockEngine.GetBlockInfo(Id).healthMultiplier; + set => Block.BlockEngine.GetBlockInfo(Id).healthMultiplier = value; + } + /// /// Whether the body can be moved or static. /// diff --git a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs index e7bed82..62e369b 100644 --- a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs +++ b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs @@ -268,6 +268,16 @@ namespace GamecraftModdingAPI.Tests }) .Build(); + CommandBuilder.Builder("TestChunkHealth", "Sets the chunk looked at to the given health.") + .Action((float val, float max) => + { + var body = new Player(PlayerType.Local).GetSimBodyLookedAt(); + if (body == null) return; + body.CurrentHealth = val; + body.InitialHealth = max; + Logging.CommandLog("Health set to: " + val); + }).Build(); + GameClient.SetDebugInfo("InstalledMods", InstalledMods); Block.Placed += (sender, args) => Logging.MetaDebugLog("Placed block " + args.Type + " with ID " + args.ID); diff --git a/GamecraftModdingAPI/Utility/DebugInterfaceEngine.cs b/GamecraftModdingAPI/Utility/DebugInterfaceEngine.cs index c604c34..0e4d023 100644 --- a/GamecraftModdingAPI/Utility/DebugInterfaceEngine.cs +++ b/GamecraftModdingAPI/Utility/DebugInterfaceEngine.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Reflection.Emit; +using System.Text; using System.Text.Formatting; using GamecraftModdingAPI.Blocks; using GamecraftModdingAPI.Engines; @@ -46,9 +47,9 @@ namespace GamecraftModdingAPI.Utility var array = new CodeInstruction[] { new CodeInstruction(OpCodes.Ldloc_0), //StringBuffer - new CodeInstruction(OpCodes.Call, ((Action)AddInfo).Method) + new CodeInstruction(OpCodes.Call, ((Action)AddInfo).Method) }; - list.InsertRange(index, array); + list.InsertRange(index - 1, array); //-1: ldloc.1 ("local") before ldfld } catch (Exception e) { @@ -58,13 +59,15 @@ namespace GamecraftModdingAPI.Utility return list; } - public static void AddInfo(StringBuffer sb) + public static void AddInfo(StringBuilder sb) { foreach (var info in _extraInfo) { try { - sb.Append(info.Value() + "\n"); + string text = info.Value().Trim(); + if (text.Length != 0) + sb.Append(text + "\n"); } catch (Exception e) { -- 2.30.2 From fd9719490329670ea33288f754bbc5170f442273 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Fri, 7 Aug 2020 13:55:00 -0400 Subject: [PATCH 096/252] Fix build issues for latest Gamecraft preview version --- GamecraftModdingAPI/App/GameMenuEngine.cs | 17 ++- GamecraftModdingAPI/Block.cs | 4 +- GamecraftModdingAPI/Blocks/BlockEngine.cs | 70 ++++++++++- GamecraftModdingAPI/Blocks/SignalEngine.cs | 4 +- .../GamecraftModdingAPI.csproj | 109 ++++++++++++++++++ GamecraftModdingAPI/Players/PlayerEngine.cs | 9 +- 6 files changed, 195 insertions(+), 18 deletions(-) diff --git a/GamecraftModdingAPI/App/GameMenuEngine.cs b/GamecraftModdingAPI/App/GameMenuEngine.cs index fc2c35f..74bc42a 100644 --- a/GamecraftModdingAPI/App/GameMenuEngine.cs +++ b/GamecraftModdingAPI/App/GameMenuEngine.cs @@ -10,6 +10,7 @@ using Svelto.ECS.Experimental; using GamecraftModdingAPI.Engines; using GamecraftModdingAPI.Utility; +using Svelto.DataStructures; namespace GamecraftModdingAPI.App { @@ -114,11 +115,21 @@ namespace GamecraftModdingAPI.App } public ref MyGamesSlotEntityViewStruct GetGameViewInfo(EGID id) - { - return ref GetComponent(new EGID(id.entityID, MyGamesScreenExclusiveGroups.GameSlotGuiEntities)); + { + EntityCollection entities = + entitiesDB.QueryEntities(MyGamesScreenExclusiveGroups.GameSlotGuiEntities); + for (int i = 0; i < entities.count; i++) + { + if (entities[i].ID.entityID == id.entityID) + { + return ref entities[i]; + } + } + MyGamesSlotEntityViewStruct[] defRef = new MyGamesSlotEntityViewStruct[1]; + return ref defRef[0]; } - public ref T GetComponent(EGID id) where T: struct, IEntityComponent + public ref T GetComponent(EGID id) where T: unmanaged, IEntityComponent { return ref entitiesDB.QueryEntity(id); } diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index 0194bae..c7b5d0d 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -337,10 +337,10 @@ namespace GamecraftModdingAPI /// public string Label { - get => BlockEngine.GetBlockInfo(this, (TextLabelEntityViewStruct st) => st.textLabelComponent?.text); + get => BlockEngine.GetBlockInfoViewStruct(this, (TextLabelEntityViewStruct st) => st.textLabelComponent?.text); set { - BlockEngine.SetBlockInfo(this, (ref TextLabelEntityViewStruct text, string val) => + BlockEngine.SetBlockInfoViewStruct(this, (ref TextLabelEntityViewStruct text, string val) => { if (text.textLabelComponent != null) text.textLabelComponent.text = val; }, value); diff --git a/GamecraftModdingAPI/Blocks/BlockEngine.cs b/GamecraftModdingAPI/Blocks/BlockEngine.cs index f97e405..33c4002 100644 --- a/GamecraftModdingAPI/Blocks/BlockEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlockEngine.cs @@ -59,16 +59,34 @@ namespace GamecraftModdingAPI.Blocks color.paletteColour = paletteEntry.Colour; } - public ref T GetBlockInfo(EGID blockID) where T : struct, IEntityComponent + public ref T GetBlockInfo(EGID blockID) where T : unmanaged, IEntityComponent { if (entitiesDB.Exists(blockID)) return ref entitiesDB.QueryEntity(blockID); T[] structHolder = new T[1]; //Create something that can be referenced return ref structHolder[0]; //Gets a default value automatically } + + public ref T GetBlockInfoViewStruct(EGID blockID) where T : struct, INeedEGID, IEntityComponent + { + if (entitiesDB.Exists(blockID)) + { + // TODO: optimize by using EntitiesDB internal calls instead of iterating over everything + EntityCollection entities = entitiesDB.QueryEntities(blockID.groupID); + for (int i = 0; i < entities.count; i++) + { + if (entities[i].ID == blockID) + { + return ref entities[i]; + } + } + } + T[] structHolder = new T[1]; //Create something that can be referenced + return ref structHolder[0]; //Gets a default value automatically + } public U GetBlockInfo(Block block, Func getter, - U def = default) where T : struct, IEntityComponent + U def = default) where T : unmanaged, IEntityComponent { if (entitiesDB.Exists(block.Id)) return getter(entitiesDB.QueryEntity(block.Id)); @@ -78,10 +96,56 @@ namespace GamecraftModdingAPI.Blocks return getter(initializer.Get()); return def; } + + public U GetBlockInfoViewStruct(Block block, Func getter, + U def = default) where T : struct, INeedEGID, IEntityComponent + { + if (entitiesDB.Exists(block.Id)) + { + // TODO: optimize by using EntitiesDB internal calls instead of iterating over everything + EntityCollection entities = entitiesDB.QueryEntities(block.Id.groupID); + for (int i = 0; i < entities.count; i++) + { + if (entities[i].ID == block.Id) + { + return getter(entities[i]); + } + } + } + if (block.InitData.Group == null) return def; + var initializer = new EntityComponentInitializer(block.Id, block.InitData.Group); + if (initializer.Has()) + return getter(initializer.Get()); + return def; + } public delegate void Setter(ref T component, U value) where T : struct, IEntityComponent; - public void SetBlockInfo(Block block, Setter setter, U value) where T : struct, IEntityComponent + public void SetBlockInfoViewStruct(Block block, Setter setter, U value) where T : struct, INeedEGID, IEntityComponent + { + if (entitiesDB.Exists(block.Id)) + { + EntityCollection entities = entitiesDB.QueryEntities(block.Id.groupID); + for (int i = 0; i < entities.count; i++) + { + if (entities[i].ID == block.Id) + { + setter(ref entities[i], value); + return; + } + } + } + else if (block.InitData.Group != null) + { + var initializer = new EntityComponentInitializer(block.Id, block.InitData.Group); + T component = initializer.Has() ? initializer.Get() : default; + ref T structRef = ref component; + setter(ref structRef, value); + initializer.Init(structRef); + } + } + + public void SetBlockInfo(Block block, Setter setter, U value) where T : unmanaged, IEntityComponent { if (entitiesDB.Exists(block.Id)) setter(ref entitiesDB.QueryEntity(block.Id), value); diff --git a/GamecraftModdingAPI/Blocks/SignalEngine.cs b/GamecraftModdingAPI/Blocks/SignalEngine.cs index e961423..763a1a1 100644 --- a/GamecraftModdingAPI/Blocks/SignalEngine.cs +++ b/GamecraftModdingAPI/Blocks/SignalEngine.cs @@ -96,7 +96,7 @@ namespace GamecraftModdingAPI.Blocks return ref GetPortByOffset(bps, portNumber, input); } - public ref T GetComponent(EGID egid) where T : struct, IEntityComponent + public ref T GetComponent(EGID egid) where T : unmanaged, IEntityComponent { return ref entitiesDB.QueryEntity(egid); } @@ -372,7 +372,7 @@ namespace GamecraftModdingAPI.Blocks return results.ToArray(); } - private ref T GetFromDbOrInitData(Block block, EGID id, out bool exists) where T : struct, IEntityComponent + private ref T GetFromDbOrInitData(Block block, EGID id, out bool exists) where T : unmanaged, IEntityComponent { T[] defRef = new T[1]; if (entitiesDB.Exists(id)) diff --git a/GamecraftModdingAPI/GamecraftModdingAPI.csproj b/GamecraftModdingAPI/GamecraftModdingAPI.csproj index 32c780b..49a3a6a 100644 --- a/GamecraftModdingAPI/GamecraftModdingAPI.csproj +++ b/GamecraftModdingAPI/GamecraftModdingAPI.csproj @@ -22,6 +22,7 @@ +<<<<<<< HEAD @@ -55,6 +56,21 @@ ..\ref\Gamecraft_Data\Managed\Accessibility.dll ..\..\ref\Gamecraft_Data\Managed\Accessibility.dll +======= + + + + + + + + ..\ref\GamecraftPreview_Data\Managed\IllusionInjector.dll + ..\..\ref\GamecraftPreview_Data\Managed\IllusionInjector.dll + + + ..\ref\GamecraftPreview_Data\Managed\IllusionPlugin.dll + ..\..\ref\GamecraftPreview_Data\Managed\IllusionPlugin.dll +>>>>>>> 50ebf4f... Fix build issues for latest Gamecraft preview version ..\ref\Gamecraft_Data\Managed\Analytics.dll @@ -72,10 +88,13 @@ ..\ref\Gamecraft_Data\Managed\Authentication.dll ..\..\ref\Gamecraft_Data\Managed\Authentication.dll +<<<<<<< HEAD ..\ref\Gamecraft_Data\Managed\BlockEntityFactory.dll ..\..\ref\Gamecraft_Data\Managed\BlockEntityFactory.dll +======= +>>>>>>> 50ebf4f... Fix build issues for latest Gamecraft preview version ..\ref\Gamecraft_Data\Managed\Blocks.HUDFeedbackBlocks.dll ..\..\ref\Gamecraft_Data\Managed\Blocks.HUDFeedbackBlocks.dll @@ -84,6 +103,18 @@ ..\ref\Gamecraft_Data\Managed\CommandLine.dll ..\..\ref\Gamecraft_Data\Managed\CommandLine.dll + + ..\ref\GamecraftPreview_Data\Managed\CommandLineCompositionRoot.dll + ..\..\ref\GamecraftPreview_Data\Managed\CommandLineCompositionRoot.dll + + + ..\ref\GamecraftPreview_Data\Managed\ConsoleBlockComposotionRoot.dll + ..\..\ref\GamecraftPreview_Data\Managed\ConsoleBlockComposotionRoot.dll + + + ..\ref\GamecraftPreview_Data\Managed\ConsoleCommand.dll + ..\..\ref\GamecraftPreview_Data\Managed\ConsoleCommand.dll + ..\ref\Gamecraft_Data\Managed\DataLoader.dll ..\..\ref\Gamecraft_Data\Managed\DataLoader.dll @@ -108,6 +139,14 @@ ..\ref\Gamecraft_Data\Managed\Gamecraft.AudioBlocks.dll ..\..\ref\Gamecraft_Data\Managed\Gamecraft.AudioBlocks.dll + + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.BlockCompositionRoot.dll + ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.BlockCompositionRoot.dll + + + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.BlockEntityFactory.dll + ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.BlockEntityFactory.dll + ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.ConsoleBlock.dll ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.ConsoleBlock.dll @@ -116,6 +155,10 @@ ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.DamagingSurfaceBlock.dll ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.DamagingSurfaceBlock.dll + + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.Blocks.DestructionBlocks.dll + ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.Blocks.DestructionBlocks.dll + ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.GenericPhysicsBlocks.dll ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.GenericPhysicsBlocks.dll @@ -128,10 +171,18 @@ ..\ref\Gamecraft_Data\Managed\GameCraft.Blocks.ProjectileBlock.dll ..\..\ref\Gamecraft_Data\Managed\GameCraft.Blocks.ProjectileBlock.dll + + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.Blocks.TextBlock.CompositionRoot.dll + ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.Blocks.TextBlock.CompositionRoot.dll + ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.TimerBlock.dll ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.TimerBlock.dll + + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll + ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll + ..\ref\Gamecraft_Data\Managed\Gamecraft.CharacterVulnerability.dll ..\..\ref\Gamecraft_Data\Managed\Gamecraft.CharacterVulnerability.dll @@ -140,10 +191,22 @@ ..\ref\Gamecraft_Data\Managed\Gamecraft.CharacterVulnerabilityGui.dll ..\..\ref\Gamecraft_Data\Managed\Gamecraft.CharacterVulnerabilityGui.dll + + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.Damage.dll + ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.Damage.dll + ..\ref\Gamecraft_Data\Managed\Gamecraft.Effects.dll ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Effects.dll + + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.ExplosionFragments.dll + ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.ExplosionFragments.dll + + + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.GraphicsSettings.dll + ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.GraphicsSettings.dll + ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.ConsoleBlock.dll ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.ConsoleBlock.dll @@ -172,6 +235,14 @@ ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll + + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.InventoryTimeRunning.dll + ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.InventoryTimeRunning.dll + + + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.JointBlocks.dll + ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.JointBlocks.dll + ..\ref\Gamecraft_Data\Managed\Gamecraft.Music.dll ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Music.dll @@ -180,6 +251,22 @@ ..\ref\Gamecraft_Data\Managed\Gamecraft.PerformanceWarnings.dll ..\..\ref\Gamecraft_Data\Managed\Gamecraft.PerformanceWarnings.dll + + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.PickupBlck.dll + ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.PickupBlck.dll + + + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.PickupsCommon.dll + ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.PickupsCommon.dll + + + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.PopupMessage.dll + ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.PopupMessage.dll + + + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.Projectiles.dll + ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.Projectiles.dll + ..\ref\Gamecraft_Data\Managed\Gamecraft.Tweaks.dll ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Tweaks.dll @@ -188,6 +275,10 @@ ..\ref\Gamecraft_Data\Managed\Gamecraft.Tweaks.Mockup.dll ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Tweaks.Mockup.dll + + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.VisualEffects.Decals.dll + ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.VisualEffects.Decals.dll + ..\ref\Gamecraft_Data\Managed\Gamecraft.VisualEffects.dll ..\..\ref\Gamecraft_Data\Managed\Gamecraft.VisualEffects.dll @@ -196,10 +287,13 @@ ..\ref\Gamecraft_Data\Managed\Gamecraft.Wires.dll ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Wires.dll +<<<<<<< HEAD ..\ref\Gamecraft_Data\Managed\Gamecraft.Wires.Input.dll ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Wires.Input.dll +======= +>>>>>>> 50ebf4f... Fix build issues for latest Gamecraft preview version ..\ref\Gamecraft_Data\Managed\Gamecraft.Wires.Mockup.dll ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Wires.Mockup.dll @@ -424,6 +518,14 @@ ..\ref\Gamecraft_Data\Managed\RobocratX.SimulationCompositionRoot.dll ..\..\ref\Gamecraft_Data\Managed\RobocratX.SimulationCompositionRoot.dll + + ..\ref\GamecraftPreview_Data\Managed\SpawningPointCompositionRoot.dll + ..\..\ref\GamecraftPreview_Data\Managed\SpawningPointCompositionRoot.dll + + + ..\ref\GamecraftPreview_Data\Managed\SpecializedDescriptors.dll + ..\..\ref\GamecraftPreview_Data\Managed\SpecializedDescriptors.dll + ..\ref\Gamecraft_Data\Managed\StringFormatter.dll ..\..\ref\Gamecraft_Data\Managed\StringFormatter.dll @@ -444,6 +546,10 @@ ..\ref\Gamecraft_Data\Managed\Svelto.Tasks.dll ..\..\ref\Gamecraft_Data\Managed\Svelto.Tasks.dll + + ..\ref\GamecraftPreview_Data\Managed\UltimateDecals.dll + ..\..\ref\GamecraftPreview_Data\Managed\UltimateDecals.dll + ..\ref\Gamecraft_Data\Managed\Unity.Addressables.dll ..\..\ref\Gamecraft_Data\Managed\Unity.Addressables.dll @@ -816,6 +922,7 @@ ..\ref\Gamecraft_Data\Managed\UnityEngine.XRModule.dll ..\..\ref\Gamecraft_Data\Managed\UnityEngine.XRModule.dll +<<<<<<< HEAD ..\ref\Gamecraft_Data\Managed\uREPL.dll ..\..\ref\Gamecraft_Data\Managed\uREPL.dll @@ -824,6 +931,8 @@ ..\ref\Gamecraft_Data\Managed\VisualProfiler.dll ..\..\ref\Gamecraft_Data\Managed\VisualProfiler.dll +======= +>>>>>>> 50ebf4f... Fix build issues for latest Gamecraft preview version \ No newline at end of file diff --git a/GamecraftModdingAPI/Players/PlayerEngine.cs b/GamecraftModdingAPI/Players/PlayerEngine.cs index f0aa31d..948c6e9 100644 --- a/GamecraftModdingAPI/Players/PlayerEngine.cs +++ b/GamecraftModdingAPI/Players/PlayerEngine.cs @@ -288,14 +288,7 @@ namespace GamecraftModdingAPI.Players public bool DamagePlayer(uint playerId, float amount) { if (entitiesDB == null) return false; - Factory.BuildEntity( - new EGID(CharacterVulnerabilityExclusiveGroups.NextDamageEntityId, CharacterVulnerabilityExclusiveGroups.CharacterDamageExclusiveGroup) - ).Init(new DamageEntityStruct - { - damage = amount, - targetPlayerEntityId = playerId, - }); - return true; + return SetCurrentHealth(playerId, GetCurrentHealth(playerId) - amount); } public bool GetDamageable(uint playerId) -- 2.30.2 From cfdc5e8c26701bd452a63b8a591cbeba1559151b Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Thu, 13 Aug 2020 16:59:13 +0200 Subject: [PATCH 097/252] Fixes, block IDs, cluster & chunk health support --- GamecraftModdingAPI/Block.cs | 2 +- GamecraftModdingAPI/Blocks/BlockEngine.cs | 91 +++++++++++-------- GamecraftModdingAPI/Blocks/BlockIDs.cs | 5 + GamecraftModdingAPI/Cluster.cs | 41 +++++++++ GamecraftModdingAPI/SimBody.cs | 37 ++++++++ .../Tests/GamecraftModdingAPIPluginTest.cs | 10 ++ .../Utility/DebugInterfaceEngine.cs | 11 ++- 7 files changed, 154 insertions(+), 43 deletions(-) create mode 100644 GamecraftModdingAPI/Cluster.cs diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index c7b5d0d..b901f81 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -372,7 +372,7 @@ namespace GamecraftModdingAPI public SimBody GetSimBody() { return BlockEngine.GetBlockInfo(this, - (GridConnectionsEntityStruct st) => new SimBody(st.machineRigidBodyId)); + (GridConnectionsEntityStruct st) => new SimBody(st.machineRigidBodyId, st.clusterId)); } private void OnPlacedInit(object sender, BlockPlacedRemovedEventArgs e) diff --git a/GamecraftModdingAPI/Blocks/BlockEngine.cs b/GamecraftModdingAPI/Blocks/BlockEngine.cs index 33c4002..2622d41 100644 --- a/GamecraftModdingAPI/Blocks/BlockEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlockEngine.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Linq; using Gamecraft.Wires; using RobocraftX.Blocks; @@ -9,6 +10,7 @@ using RobocraftX.Physics; using RobocraftX.Scene.Simulation; using Svelto.DataStructures; using Svelto.ECS; +using Svelto.ECS.Hybrid; using GamecraftModdingAPI.Engines; @@ -90,28 +92,19 @@ namespace GamecraftModdingAPI.Blocks { if (entitiesDB.Exists(block.Id)) return getter(entitiesDB.QueryEntity(block.Id)); - if (block.InitData.Group == null) return def; - var initializer = new EntityComponentInitializer(block.Id, block.InitData.Group); - if (initializer.Has()) - return getter(initializer.Get()); - return def; + return GetBlockInitInfo(block, getter, def); } public U GetBlockInfoViewStruct(Block block, Func getter, - U def = default) where T : struct, INeedEGID, IEntityComponent + U def = default) where T : struct, IEntityViewComponent { if (entitiesDB.Exists(block.Id)) - { - // TODO: optimize by using EntitiesDB internal calls instead of iterating over everything - EntityCollection entities = entitiesDB.QueryEntities(block.Id.groupID); - for (int i = 0; i < entities.count; i++) - { - if (entities[i].ID == block.Id) - { - return getter(entities[i]); - } - } - } + return getter(entitiesDB.QueryEntity(block.Id)); + return GetBlockInitInfo(block, getter, def); + } + + private U GetBlockInitInfo(Block block, Func getter, U def) where T : struct, IEntityComponent + { if (block.InitData.Group == null) return def; var initializer = new EntityComponentInitializer(block.Id, block.InitData.Group); if (initializer.Has()) @@ -121,35 +114,26 @@ namespace GamecraftModdingAPI.Blocks public delegate void Setter(ref T component, U value) where T : struct, IEntityComponent; - public void SetBlockInfoViewStruct(Block block, Setter setter, U value) where T : struct, INeedEGID, IEntityComponent + public void SetBlockInfoViewStruct(Block block, Setter setter, U value) where T : struct, IEntityViewComponent { if (entitiesDB.Exists(block.Id)) - { - EntityCollection entities = entitiesDB.QueryEntities(block.Id.groupID); - for (int i = 0; i < entities.count; i++) - { - if (entities[i].ID == block.Id) - { - setter(ref entities[i], value); - return; - } - } - } - else if (block.InitData.Group != null) - { - var initializer = new EntityComponentInitializer(block.Id, block.InitData.Group); - T component = initializer.Has() ? initializer.Get() : default; - ref T structRef = ref component; - setter(ref structRef, value); - initializer.Init(structRef); - } + setter(ref entitiesDB.QueryEntity(block.Id), value); + else + SetBlockInitInfo(block, setter, value); } public void SetBlockInfo(Block block, Setter setter, U value) where T : unmanaged, IEntityComponent { if (entitiesDB.Exists(block.Id)) setter(ref entitiesDB.QueryEntity(block.Id), value); - else if (block.InitData.Group != null) + else + SetBlockInitInfo(block, setter, value); + } + + private void SetBlockInitInfo(Block block, Setter setter, U value) + where T : struct, IEntityComponent + { + if (block.InitData.Group != null) { var initializer = new EntityComponentInitializer(block.Id, block.InitData.Group); T component = initializer.Has() ? initializer.Get() : default; @@ -222,6 +206,22 @@ namespace GamecraftModdingAPI.Blocks return list.ToArray(); } + public SimBody[] GetClusterBodies(uint cid) + { + var groups = entitiesDB.QueryEntities(); + var bodies = new HashSet(); + foreach (var (coll, _) in groups) + { + foreach (var conn in coll) + { + if (conn.clusterId == cid) + bodies.Add(conn.machineRigidBodyId); + } + } + + return bodies.Select(id => new SimBody(id)).ToArray(); + } + public EGID? FindBlockEGID(uint id) { var groups = entitiesDB.FindGroups(); @@ -234,6 +234,21 @@ namespace GamecraftModdingAPI.Blocks return null; } + public Cluster GetCluster(uint sbid) + { + var groups = entitiesDB.QueryEntities(); + foreach (var (coll, _) in groups) + { + foreach (var conn in coll) + { + if (conn.machineRigidBodyId == sbid) + return new Cluster(conn.clusterId); + } + } + + return null; + } + #if DEBUG public EntitiesDB GetEntitiesDB() { diff --git a/GamecraftModdingAPI/Blocks/BlockIDs.cs b/GamecraftModdingAPI/Blocks/BlockIDs.cs index 596fb38..33f9522 100644 --- a/GamecraftModdingAPI/Blocks/BlockIDs.cs +++ b/GamecraftModdingAPI/Blocks/BlockIDs.cs @@ -192,6 +192,9 @@ namespace GamecraftModdingAPI.Blocks PlayerFilter, TeamFilter, Number2Text, //193 + DestructionManager = 260, + ChunkHealthModifier, + ClusterHealthModifier, //262 BeachTree1 = 200, BeachTree2, BeachTree3, @@ -243,6 +246,8 @@ namespace GamecraftModdingAPI.Blocks AdvancedRotator, MusicBlock, //256 PlasmaCannonBlock, + QuantumRiflePickup = 300, + QuantumRifleAmmoPickup, MagmaRockCube=777, MagmaRockCubeSliced, MagmaRockSlope, diff --git a/GamecraftModdingAPI/Cluster.cs b/GamecraftModdingAPI/Cluster.cs new file mode 100644 index 0000000..074c26c --- /dev/null +++ b/GamecraftModdingAPI/Cluster.cs @@ -0,0 +1,41 @@ +using Gamecraft.Damage; +using RobocraftX.Common; +using Svelto.ECS; + +namespace GamecraftModdingAPI +{ + /// + /// Represnts a cluster of blocks in time running mode, meaning blocks that are connected either directly or via joints. + /// + public class Cluster + { + public EGID Id { get; } + + public Cluster(EGID id) + { + Id = id; + } + + public Cluster(uint id) : this(new EGID(id, CommonExclusiveGroups.SIMULATION_CLUSTERS_GROUP)) + { + } + + public float InitialHealth + { + get => Block.BlockEngine.GetBlockInfo(Id).initialHealth; + set => Block.BlockEngine.GetBlockInfo(Id).initialHealth = value; + } + + public float CurrentHealth + { + get => Block.BlockEngine.GetBlockInfo(Id).currentHealth; + set => Block.BlockEngine.GetBlockInfo(Id).currentHealth = value; + } + + public float HealthMultiplier + { + get => Block.BlockEngine.GetBlockInfo(Id).healthMultiplier; + set => Block.BlockEngine.GetBlockInfo(Id).healthMultiplier = value; + } + } +} \ No newline at end of file diff --git a/GamecraftModdingAPI/SimBody.cs b/GamecraftModdingAPI/SimBody.cs index 19f4285..a3f6d55 100644 --- a/GamecraftModdingAPI/SimBody.cs +++ b/GamecraftModdingAPI/SimBody.cs @@ -3,6 +3,7 @@ using Svelto.ECS; using Unity.Mathematics; using UnityEngine; +using Gamecraft.Damage; using RobocraftX.Common; using RobocraftX.Physics; @@ -15,6 +16,14 @@ namespace GamecraftModdingAPI { public EGID Id { get; } + /// + /// The cluster this chunk belongs to, or null if the chunk doesn't exist. Get the SimBody from a Block if possible for good performance here. + /// + public Cluster Cluster => cluster ?? (cluster = clusterId == uint.MaxValue ? Block.BlockEngine.GetCluster(Id.entityID) : new Cluster(clusterId)); + + private Cluster cluster; + private uint clusterId; + public SimBody(EGID id) { Id = id; @@ -24,6 +33,11 @@ namespace GamecraftModdingAPI { } + internal SimBody(uint id, uint clusterID) : this(id) + { + clusterId = clusterID; + } + /// /// The position of this body. When setting the position, update the position of the connected bodies as well, /// otherwise unexpected forces may arise. @@ -70,6 +84,29 @@ namespace GamecraftModdingAPI //set => GetStruct().physicsMass.CenterOfMass = value; } + public float Volume + { + get => GetStruct().volume; + } + + public float InitialHealth + { + get => Block.BlockEngine.GetBlockInfo(Id).initialHealth; + set => Block.BlockEngine.GetBlockInfo(Id).initialHealth = value; + } + + public float CurrentHealth + { + get => Block.BlockEngine.GetBlockInfo(Id).currentHealth; + set => Block.BlockEngine.GetBlockInfo(Id).currentHealth = value; + } + + public float HealthMultiplier + { + get => Block.BlockEngine.GetBlockInfo(Id).healthMultiplier; + set => Block.BlockEngine.GetBlockInfo(Id).healthMultiplier = value; + } + /// /// Whether the body can be moved or static. /// diff --git a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs index 639125c..7002605 100644 --- a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs +++ b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs @@ -268,6 +268,16 @@ namespace GamecraftModdingAPI.Tests }) .Build(); + CommandBuilder.Builder("TestChunkHealth", "Sets the chunk looked at to the given health.") + .Action((float val, float max) => + { + var body = new Player(PlayerType.Local).GetSimBodyLookedAt(); + if (body == null) return; + body.CurrentHealth = val; + body.InitialHealth = max; + Logging.CommandLog("Health set to: " + val); + }).Build(); + GameClient.SetDebugInfo("InstalledMods", InstalledMods); Block.Placed += (sender, args) => Logging.MetaDebugLog("Placed block " + args.Type + " with ID " + args.ID); diff --git a/GamecraftModdingAPI/Utility/DebugInterfaceEngine.cs b/GamecraftModdingAPI/Utility/DebugInterfaceEngine.cs index c604c34..0e4d023 100644 --- a/GamecraftModdingAPI/Utility/DebugInterfaceEngine.cs +++ b/GamecraftModdingAPI/Utility/DebugInterfaceEngine.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Reflection.Emit; +using System.Text; using System.Text.Formatting; using GamecraftModdingAPI.Blocks; using GamecraftModdingAPI.Engines; @@ -46,9 +47,9 @@ namespace GamecraftModdingAPI.Utility var array = new CodeInstruction[] { new CodeInstruction(OpCodes.Ldloc_0), //StringBuffer - new CodeInstruction(OpCodes.Call, ((Action)AddInfo).Method) + new CodeInstruction(OpCodes.Call, ((Action)AddInfo).Method) }; - list.InsertRange(index, array); + list.InsertRange(index - 1, array); //-1: ldloc.1 ("local") before ldfld } catch (Exception e) { @@ -58,13 +59,15 @@ namespace GamecraftModdingAPI.Utility return list; } - public static void AddInfo(StringBuffer sb) + public static void AddInfo(StringBuilder sb) { foreach (var info in _extraInfo) { try { - sb.Append(info.Value() + "\n"); + string text = info.Value().Trim(); + if (text.Length != 0) + sb.Append(text + "\n"); } catch (Exception e) { -- 2.30.2 From 11b94e384ee9a0d21966b1eeefde696c4d24caa2 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Sat, 22 Aug 2020 09:25:14 -0400 Subject: [PATCH 098/252] Update refs --- .../GamecraftModdingAPI.csproj | 266 +++++++++--------- 1 file changed, 137 insertions(+), 129 deletions(-) diff --git a/GamecraftModdingAPI/GamecraftModdingAPI.csproj b/GamecraftModdingAPI/GamecraftModdingAPI.csproj index 49a3a6a..8be57a7 100644 --- a/GamecraftModdingAPI/GamecraftModdingAPI.csproj +++ b/GamecraftModdingAPI/GamecraftModdingAPI.csproj @@ -22,8 +22,8 @@ -<<<<<<< HEAD - + + ..\ref\Gamecraft_Data\Managed\IllusionInjector.dll @@ -33,45 +33,6 @@ ..\ref\Gamecraft_Data\Managed\IllusionPlugin.dll ..\..\ref\Gamecraft_Data\Managed\IllusionPlugin.dll - - ..\ref\Gamecraft_Data\Managed\JWT.dll - ..\..\ref\Gamecraft_Data\Managed\JWT.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Burst.Unsafe.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Burst.Unsafe.dll - - - ..\ref\Gamecraft_Data\Managed\Rewired_Core.dll - ..\..\ref\Gamecraft_Data\Managed\Rewired_Core.dll - - - ..\ref\Gamecraft_Data\Managed\Rewired_Windows.dll - ..\..\ref\Gamecraft_Data\Managed\Rewired_Windows.dll - - - ..\ref\Gamecraft_Data\Managed\mscorlib.dll - ..\..\ref\Gamecraft_Data\Managed\mscorlib.dll - - - ..\ref\Gamecraft_Data\Managed\Accessibility.dll - ..\..\ref\Gamecraft_Data\Managed\Accessibility.dll -======= - - - - - - - - ..\ref\GamecraftPreview_Data\Managed\IllusionInjector.dll - ..\..\ref\GamecraftPreview_Data\Managed\IllusionInjector.dll - - - ..\ref\GamecraftPreview_Data\Managed\IllusionPlugin.dll - ..\..\ref\GamecraftPreview_Data\Managed\IllusionPlugin.dll ->>>>>>> 50ebf4f... Fix build issues for latest Gamecraft preview version - ..\ref\Gamecraft_Data\Managed\Analytics.dll ..\..\ref\Gamecraft_Data\Managed\Analytics.dll @@ -88,13 +49,6 @@ ..\ref\Gamecraft_Data\Managed\Authentication.dll ..\..\ref\Gamecraft_Data\Managed\Authentication.dll -<<<<<<< HEAD - - ..\ref\Gamecraft_Data\Managed\BlockEntityFactory.dll - ..\..\ref\Gamecraft_Data\Managed\BlockEntityFactory.dll - -======= ->>>>>>> 50ebf4f... Fix build issues for latest Gamecraft preview version ..\ref\Gamecraft_Data\Managed\Blocks.HUDFeedbackBlocks.dll ..\..\ref\Gamecraft_Data\Managed\Blocks.HUDFeedbackBlocks.dll @@ -104,16 +58,16 @@ ..\..\ref\Gamecraft_Data\Managed\CommandLine.dll - ..\ref\GamecraftPreview_Data\Managed\CommandLineCompositionRoot.dll - ..\..\ref\GamecraftPreview_Data\Managed\CommandLineCompositionRoot.dll + ..\ref\Gamecraft_Data\Managed\CommandLineCompositionRoot.dll + ..\..\ref\Gamecraft_Data\Managed\CommandLineCompositionRoot.dll - ..\ref\GamecraftPreview_Data\Managed\ConsoleBlockComposotionRoot.dll - ..\..\ref\GamecraftPreview_Data\Managed\ConsoleBlockComposotionRoot.dll + ..\ref\Gamecraft_Data\Managed\ConsoleBlockComposotionRoot.dll + ..\..\ref\Gamecraft_Data\Managed\ConsoleBlockComposotionRoot.dll - ..\ref\GamecraftPreview_Data\Managed\ConsoleCommand.dll - ..\..\ref\GamecraftPreview_Data\Managed\ConsoleCommand.dll + ..\ref\Gamecraft_Data\Managed\ConsoleCommand.dll + ..\..\ref\Gamecraft_Data\Managed\ConsoleCommand.dll ..\ref\Gamecraft_Data\Managed\DataLoader.dll @@ -123,10 +77,6 @@ ..\ref\Gamecraft_Data\Managed\DDNA.dll ..\..\ref\Gamecraft_Data\Managed\DDNA.dll - - ..\ref\Gamecraft_Data\Managed\Facepunch.Steamworks.Win64.dll - ..\..\ref\Gamecraft_Data\Managed\Facepunch.Steamworks.Win64.dll - ..\ref\Gamecraft_Data\Managed\FMOD.dll ..\..\ref\Gamecraft_Data\Managed\FMOD.dll @@ -140,12 +90,12 @@ ..\..\ref\Gamecraft_Data\Managed\Gamecraft.AudioBlocks.dll - ..\ref\GamecraftPreview_Data\Managed\Gamecraft.BlockCompositionRoot.dll - ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.BlockCompositionRoot.dll + ..\ref\Gamecraft_Data\Managed\Gamecraft.BlockCompositionRoot.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.BlockCompositionRoot.dll - ..\ref\GamecraftPreview_Data\Managed\Gamecraft.BlockEntityFactory.dll - ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.BlockEntityFactory.dll + ..\ref\Gamecraft_Data\Managed\Gamecraft.BlockEntityFactory.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.BlockEntityFactory.dll ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.ConsoleBlock.dll @@ -156,8 +106,8 @@ ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.DamagingSurfaceBlock.dll - ..\ref\GamecraftPreview_Data\Managed\Gamecraft.Blocks.DestructionBlocks.dll - ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.Blocks.DestructionBlocks.dll + ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.DestructionBlocks.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.DestructionBlocks.dll ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.GenericPhysicsBlocks.dll @@ -172,16 +122,16 @@ ..\..\ref\Gamecraft_Data\Managed\GameCraft.Blocks.ProjectileBlock.dll - ..\ref\GamecraftPreview_Data\Managed\Gamecraft.Blocks.TextBlock.CompositionRoot.dll - ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.Blocks.TextBlock.CompositionRoot.dll + ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.TextBlock.CompositionRoot.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.TextBlock.CompositionRoot.dll ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.TimerBlock.dll ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.TimerBlock.dll - ..\ref\GamecraftPreview_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll - ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll + ..\ref\Gamecraft_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll ..\ref\Gamecraft_Data\Managed\Gamecraft.CharacterVulnerability.dll @@ -192,20 +142,20 @@ ..\..\ref\Gamecraft_Data\Managed\Gamecraft.CharacterVulnerabilityGui.dll - ..\ref\GamecraftPreview_Data\Managed\Gamecraft.Damage.dll - ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.Damage.dll + ..\ref\Gamecraft_Data\Managed\Gamecraft.Damage.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Damage.dll ..\ref\Gamecraft_Data\Managed\Gamecraft.Effects.dll ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Effects.dll - ..\ref\GamecraftPreview_Data\Managed\Gamecraft.ExplosionFragments.dll - ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.ExplosionFragments.dll + ..\ref\Gamecraft_Data\Managed\Gamecraft.ExplosionFragments.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.ExplosionFragments.dll - ..\ref\GamecraftPreview_Data\Managed\Gamecraft.GraphicsSettings.dll - ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.GraphicsSettings.dll + ..\ref\Gamecraft_Data\Managed\Gamecraft.GraphicsSettings.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GraphicsSettings.dll ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.ConsoleBlock.dll @@ -236,12 +186,12 @@ ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll - ..\ref\GamecraftPreview_Data\Managed\Gamecraft.InventoryTimeRunning.dll - ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.InventoryTimeRunning.dll + ..\ref\Gamecraft_Data\Managed\Gamecraft.InventoryTimeRunning.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.InventoryTimeRunning.dll - ..\ref\GamecraftPreview_Data\Managed\Gamecraft.JointBlocks.dll - ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.JointBlocks.dll + ..\ref\Gamecraft_Data\Managed\Gamecraft.JointBlocks.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.JointBlocks.dll ..\ref\Gamecraft_Data\Managed\Gamecraft.Music.dll @@ -252,20 +202,20 @@ ..\..\ref\Gamecraft_Data\Managed\Gamecraft.PerformanceWarnings.dll - ..\ref\GamecraftPreview_Data\Managed\Gamecraft.PickupBlck.dll - ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.PickupBlck.dll + ..\ref\Gamecraft_Data\Managed\Gamecraft.PickupBlck.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.PickupBlck.dll - ..\ref\GamecraftPreview_Data\Managed\Gamecraft.PickupsCommon.dll - ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.PickupsCommon.dll + ..\ref\Gamecraft_Data\Managed\Gamecraft.PickupsCommon.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.PickupsCommon.dll - ..\ref\GamecraftPreview_Data\Managed\Gamecraft.PopupMessage.dll - ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.PopupMessage.dll + ..\ref\Gamecraft_Data\Managed\Gamecraft.PopupMessage.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.PopupMessage.dll - ..\ref\GamecraftPreview_Data\Managed\Gamecraft.Projectiles.dll - ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.Projectiles.dll + ..\ref\Gamecraft_Data\Managed\Gamecraft.Projectiles.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Projectiles.dll ..\ref\Gamecraft_Data\Managed\Gamecraft.Tweaks.dll @@ -276,8 +226,8 @@ ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Tweaks.Mockup.dll - ..\ref\GamecraftPreview_Data\Managed\Gamecraft.VisualEffects.Decals.dll - ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.VisualEffects.Decals.dll + ..\ref\Gamecraft_Data\Managed\Gamecraft.VisualEffects.Decals.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.VisualEffects.Decals.dll ..\ref\Gamecraft_Data\Managed\Gamecraft.VisualEffects.dll @@ -287,13 +237,6 @@ ..\ref\Gamecraft_Data\Managed\Gamecraft.Wires.dll ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Wires.dll -<<<<<<< HEAD - - ..\ref\Gamecraft_Data\Managed\Gamecraft.Wires.Input.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Wires.Input.dll - -======= ->>>>>>> 50ebf4f... Fix build issues for latest Gamecraft preview version ..\ref\Gamecraft_Data\Managed\Gamecraft.Wires.Mockup.dll ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Wires.Mockup.dll @@ -326,18 +269,6 @@ ..\ref\Gamecraft_Data\Managed\MultiplayerTest.dll ..\..\ref\Gamecraft_Data\Managed\MultiplayerTest.dll - - ..\ref\Gamecraft_Data\Managed\netstandard.dll - ..\..\ref\Gamecraft_Data\Managed\netstandard.dll - - - ..\ref\Gamecraft_Data\Managed\Newtonsoft.Json.dll - ..\..\ref\Gamecraft_Data\Managed\Newtonsoft.Json.dll - - - ..\ref\Gamecraft_Data\Managed\Novell.Directory.Ldap.dll - ..\..\ref\Gamecraft_Data\Managed\Novell.Directory.Ldap.dll - ..\ref\Gamecraft_Data\Managed\RCX.ScreenshotTaker.dll ..\..\ref\Gamecraft_Data\Managed\RCX.ScreenshotTaker.dll @@ -519,12 +450,12 @@ ..\..\ref\Gamecraft_Data\Managed\RobocratX.SimulationCompositionRoot.dll - ..\ref\GamecraftPreview_Data\Managed\SpawningPointCompositionRoot.dll - ..\..\ref\GamecraftPreview_Data\Managed\SpawningPointCompositionRoot.dll + ..\ref\Gamecraft_Data\Managed\SpawningPointCompositionRoot.dll + ..\..\ref\Gamecraft_Data\Managed\SpawningPointCompositionRoot.dll - ..\ref\GamecraftPreview_Data\Managed\SpecializedDescriptors.dll - ..\..\ref\GamecraftPreview_Data\Managed\SpecializedDescriptors.dll + ..\ref\Gamecraft_Data\Managed\SpecializedDescriptors.dll + ..\..\ref\Gamecraft_Data\Managed\SpecializedDescriptors.dll ..\ref\Gamecraft_Data\Managed\StringFormatter.dll @@ -547,13 +478,41 @@ ..\..\ref\Gamecraft_Data\Managed\Svelto.Tasks.dll - ..\ref\GamecraftPreview_Data\Managed\UltimateDecals.dll - ..\..\ref\GamecraftPreview_Data\Managed\UltimateDecals.dll + ..\ref\Gamecraft_Data\Managed\UltimateDecals.dll + ..\..\ref\Gamecraft_Data\Managed\UltimateDecals.dll ..\ref\Gamecraft_Data\Managed\Unity.Addressables.dll ..\..\ref\Gamecraft_Data\Managed\Unity.Addressables.dll + + ..\ref\Gamecraft_Data\Managed\Unity.Animation.Curves.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Animation.Curves.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Animation.Curves.Hybrid.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Animation.Curves.Hybrid.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Animation.DefaultGraphPipeline.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Animation.DefaultGraphPipeline.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Animation.DefaultGraphPipeline.Hybrid.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Animation.DefaultGraphPipeline.Hybrid.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Animation.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Animation.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Animation.Graph.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Animation.Graph.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Animation.Hybrid.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Animation.Hybrid.dll + ..\ref\Gamecraft_Data\Managed\Unity.Build.SlimPlayerRuntime.dll ..\..\ref\Gamecraft_Data\Managed\Unity.Build.SlimPlayerRuntime.dll @@ -566,6 +525,10 @@ ..\ref\Gamecraft_Data\Managed\Unity.Collections.dll ..\..\ref\Gamecraft_Data\Managed\Unity.Collections.dll + + ..\ref\Gamecraft_Data\Managed\Unity.DataFlowGraph.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.DataFlowGraph.dll + ..\ref\Gamecraft_Data\Managed\Unity.Deformations.dll ..\..\ref\Gamecraft_Data\Managed\Unity.Deformations.dll @@ -594,6 +557,10 @@ ..\ref\Gamecraft_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll ..\..\ref\Gamecraft_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll + + ..\ref\Gamecraft_Data\Managed\Unity.MemoryProfiler.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.MemoryProfiler.dll + ..\ref\Gamecraft_Data\Managed\Unity.Physics.dll ..\..\ref\Gamecraft_Data\Managed\Unity.Physics.dll @@ -678,6 +645,62 @@ ..\ref\Gamecraft_Data\Managed\Unity.Transforms.Hybrid.dll ..\..\ref\Gamecraft_Data\Managed\Unity.Transforms.Hybrid.dll + + ..\ref\Gamecraft_Data\Managed\Unity.VisualEffectGraph.Runtime.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.VisualEffectGraph.Runtime.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.UI.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UI.dll + + + ..\ref\Gamecraft_Data\Managed\uREPL.dll + ..\..\ref\Gamecraft_Data\Managed\uREPL.dll + + + ..\ref\Gamecraft_Data\Managed\VisualProfiler.dll + ..\..\ref\Gamecraft_Data\Managed\VisualProfiler.dll + + + ..\ref\Gamecraft_Data\Managed\Accessibility.dll + ..\..\ref\Gamecraft_Data\Managed\Accessibility.dll + + + ..\ref\Gamecraft_Data\Managed\Facepunch.Steamworks.Win64.dll + ..\..\ref\Gamecraft_Data\Managed\Facepunch.Steamworks.Win64.dll + + + ..\ref\Gamecraft_Data\Managed\JWT.dll + ..\..\ref\Gamecraft_Data\Managed\JWT.dll + + + ..\ref\Gamecraft_Data\Managed\mscorlib.dll + ..\..\ref\Gamecraft_Data\Managed\mscorlib.dll + + + ..\ref\Gamecraft_Data\Managed\netstandard.dll + ..\..\ref\Gamecraft_Data\Managed\netstandard.dll + + + ..\ref\Gamecraft_Data\Managed\Newtonsoft.Json.dll + ..\..\ref\Gamecraft_Data\Managed\Newtonsoft.Json.dll + + + ..\ref\Gamecraft_Data\Managed\Novell.Directory.Ldap.dll + ..\..\ref\Gamecraft_Data\Managed\Novell.Directory.Ldap.dll + + + ..\ref\Gamecraft_Data\Managed\Rewired_Core.dll + ..\..\ref\Gamecraft_Data\Managed\Rewired_Core.dll + + + ..\ref\Gamecraft_Data\Managed\Rewired_Windows.dll + ..\..\ref\Gamecraft_Data\Managed\Rewired_Windows.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Burst.Unsafe.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Burst.Unsafe.dll + ..\ref\Gamecraft_Data\Managed\UnityEngine.AccessibilityModule.dll ..\..\ref\Gamecraft_Data\Managed\UnityEngine.AccessibilityModule.dll @@ -846,10 +869,6 @@ ..\ref\Gamecraft_Data\Managed\UnityEngine.TLSModule.dll ..\..\ref\Gamecraft_Data\Managed\UnityEngine.TLSModule.dll - - ..\ref\Gamecraft_Data\Managed\UnityEngine.UI.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UI.dll - ..\ref\Gamecraft_Data\Managed\UnityEngine.UIElementsModule.dll ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UIElementsModule.dll @@ -922,17 +941,6 @@ ..\ref\Gamecraft_Data\Managed\UnityEngine.XRModule.dll ..\..\ref\Gamecraft_Data\Managed\UnityEngine.XRModule.dll -<<<<<<< HEAD - - ..\ref\Gamecraft_Data\Managed\uREPL.dll - ..\..\ref\Gamecraft_Data\Managed\uREPL.dll - - - ..\ref\Gamecraft_Data\Managed\VisualProfiler.dll - ..\..\ref\Gamecraft_Data\Managed\VisualProfiler.dll - -======= ->>>>>>> 50ebf4f... Fix build issues for latest Gamecraft preview version - + \ No newline at end of file -- 2.30.2 From daf4a24bc90f333c35cba1d3af576f82a2867ced Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Sat, 22 Aug 2020 09:26:51 -0400 Subject: [PATCH 099/252] Fix namespace build error from unused using statement (I deleted it) --- GamecraftModdingAPI/Players/PlayerEngine.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/GamecraftModdingAPI/Players/PlayerEngine.cs b/GamecraftModdingAPI/Players/PlayerEngine.cs index 948c6e9..6d461f2 100644 --- a/GamecraftModdingAPI/Players/PlayerEngine.cs +++ b/GamecraftModdingAPI/Players/PlayerEngine.cs @@ -12,8 +12,6 @@ using RobocraftX.Physics; using RobocraftX.Blocks.Ghost; using RobocraftX.Character.Camera; using RobocraftX.Character.Factories; -using Gamecraft.CharacterVulnerability; -using Gamecraft.CharacterVulnerability.Entities; using Gamecraft.GUI.HUDFeedbackBlocks; using Svelto.ECS; using Unity.Mathematics; -- 2.30.2 From aae20579723070aaa2fba9f26e1cdd980bd8c4e5 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Sun, 23 Aug 2020 09:59:13 -0400 Subject: [PATCH 100/252] Convert relevant blocks to wireable blocks and fix wire connect during block init --- GamecraftModdingAPI/Blocks/ConsoleBlock.cs | 2 +- GamecraftModdingAPI/Blocks/Motor.cs | 2 +- GamecraftModdingAPI/Blocks/MusicBlock.cs | 2 +- GamecraftModdingAPI/Blocks/Piston.cs | 2 +- GamecraftModdingAPI/Blocks/Servo.cs | 2 +- GamecraftModdingAPI/Blocks/TextBlock.cs | 2 +- GamecraftModdingAPI/Blocks/Timer.cs | 2 +- GamecraftModdingAPI/Blocks/Wire.cs | 8 +++--- .../Tests/GamecraftModdingAPIPluginTest.cs | 27 +++++-------------- 9 files changed, 18 insertions(+), 31 deletions(-) diff --git a/GamecraftModdingAPI/Blocks/ConsoleBlock.cs b/GamecraftModdingAPI/Blocks/ConsoleBlock.cs index edf3e76..c8982e4 100644 --- a/GamecraftModdingAPI/Blocks/ConsoleBlock.cs +++ b/GamecraftModdingAPI/Blocks/ConsoleBlock.cs @@ -10,7 +10,7 @@ using GamecraftModdingAPI.Utility; namespace GamecraftModdingAPI.Blocks { - public class ConsoleBlock : Block + public class ConsoleBlock : SignalingBlock { public ConsoleBlock(EGID id): base(id) { diff --git a/GamecraftModdingAPI/Blocks/Motor.cs b/GamecraftModdingAPI/Blocks/Motor.cs index fdadd26..3c38a52 100644 --- a/GamecraftModdingAPI/Blocks/Motor.cs +++ b/GamecraftModdingAPI/Blocks/Motor.cs @@ -9,7 +9,7 @@ using GamecraftModdingAPI.Utility; namespace GamecraftModdingAPI.Blocks { - public class Motor : Block + public class Motor : SignalingBlock { public Motor(EGID id) : base(id) { diff --git a/GamecraftModdingAPI/Blocks/MusicBlock.cs b/GamecraftModdingAPI/Blocks/MusicBlock.cs index 2128a45..185913b 100644 --- a/GamecraftModdingAPI/Blocks/MusicBlock.cs +++ b/GamecraftModdingAPI/Blocks/MusicBlock.cs @@ -14,7 +14,7 @@ using GamecraftModdingAPI.Utility; namespace GamecraftModdingAPI.Blocks { - public class MusicBlock : Block + public class MusicBlock : SignalingBlock { public MusicBlock(EGID id) : base(id) { diff --git a/GamecraftModdingAPI/Blocks/Piston.cs b/GamecraftModdingAPI/Blocks/Piston.cs index aed8c33..c3f2497 100644 --- a/GamecraftModdingAPI/Blocks/Piston.cs +++ b/GamecraftModdingAPI/Blocks/Piston.cs @@ -9,7 +9,7 @@ using RobocraftX.Common; namespace GamecraftModdingAPI.Blocks { - public class Piston : Block + public class Piston : SignalingBlock { public Piston(EGID id) : base(id) { diff --git a/GamecraftModdingAPI/Blocks/Servo.cs b/GamecraftModdingAPI/Blocks/Servo.cs index 730749a..1177fb6 100644 --- a/GamecraftModdingAPI/Blocks/Servo.cs +++ b/GamecraftModdingAPI/Blocks/Servo.cs @@ -9,7 +9,7 @@ using GamecraftModdingAPI.Utility; namespace GamecraftModdingAPI.Blocks { - public class Servo : Block + public class Servo : SignalingBlock { public Servo(EGID id) : base(id) { diff --git a/GamecraftModdingAPI/Blocks/TextBlock.cs b/GamecraftModdingAPI/Blocks/TextBlock.cs index 6096dd4..e4b4c73 100644 --- a/GamecraftModdingAPI/Blocks/TextBlock.cs +++ b/GamecraftModdingAPI/Blocks/TextBlock.cs @@ -10,7 +10,7 @@ using GamecraftModdingAPI.Utility; namespace GamecraftModdingAPI.Blocks { - public class TextBlock : Block + public class TextBlock : SignalingBlock { public TextBlock(EGID id) : base(id) { diff --git a/GamecraftModdingAPI/Blocks/Timer.cs b/GamecraftModdingAPI/Blocks/Timer.cs index 5766a41..1aeecd9 100644 --- a/GamecraftModdingAPI/Blocks/Timer.cs +++ b/GamecraftModdingAPI/Blocks/Timer.cs @@ -11,7 +11,7 @@ using GamecraftModdingAPI.Utility; namespace GamecraftModdingAPI.Blocks { - public class Timer : Block + public class Timer : SignalingBlock { public Timer(EGID id) : base(id) { diff --git a/GamecraftModdingAPI/Blocks/Wire.cs b/GamecraftModdingAPI/Blocks/Wire.cs index c29795f..e58a625 100644 --- a/GamecraftModdingAPI/Blocks/Wire.cs +++ b/GamecraftModdingAPI/Blocks/Wire.cs @@ -31,7 +31,7 @@ namespace GamecraftModdingAPI.Blocks public static Wire Connect(SignalingBlock start, byte startPort, SignalingBlock end, byte endPort) { WireEntityStruct wire = signalEngine.CreateNewWire(start.Id, startPort, end.Id, endPort); - return new Wire(wire); + return new Wire(wire, start, end); } /// @@ -173,15 +173,15 @@ namespace GamecraftModdingAPI.Blocks this.startPort = wire.sourcePortUsage; } - internal Wire(WireEntityStruct wire) + internal Wire(WireEntityStruct wire, SignalingBlock src, SignalingBlock dest) { this.wireEGID = wire.ID; this.startBlockEGID = wire.sourceBlockEGID; this.endBlockEGID = wire.destinationBlockEGID; inputToOutput = false; - endPortEGID = signalEngine.MatchBlockInputToPort(wire.destinationBlockEGID, wire.destinationPortUsage, out bool exists); + endPortEGID = signalEngine.MatchBlockInputToPort(dest, wire.destinationPortUsage, out bool exists); if (!exists) throw new WireInvalidException("Wire end port not found"); - startPortEGID = signalEngine.MatchBlockOutputToPort(wire.sourceBlockEGID, wire.sourcePortUsage, out exists); + startPortEGID = signalEngine.MatchBlockOutputToPort(src, wire.sourcePortUsage, out exists); if (!exists) throw new WireInvalidException("Wire start port not found"); this.endPort = wire.destinationPortUsage; this.startPort = wire.sourcePortUsage; diff --git a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs index 7002605..4a5547f 100644 --- a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs +++ b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs @@ -22,33 +22,29 @@ using GamecraftModdingAPI.Players; namespace GamecraftModdingAPI.Tests { +#if DEBUG // unused by design /// /// Modding API implemented as a standalone IPA Plugin. /// Ideally, GamecraftModdingAPI should be loaded by another mod; not itself /// - public class GamecraftModdingAPIPluginTest -#if DEBUG - : IllusionPlugin.IEnhancedPlugin -#endif + public class GamecraftModdingAPIPluginTest : IllusionPlugin.IEnhancedPlugin { private static Harmony harmony { get; set; } - public string[] Filter { get; } = new string[] { "Gamecraft", "GamecraftPreview" }; + public override string Name { get; } = Assembly.GetExecutingAssembly().GetName().Name; - public string Name { get; } = Assembly.GetExecutingAssembly().GetName().Name; - - public string Version { get; } = Assembly.GetExecutingAssembly().GetName().Version.ToString(); + public override string Version { get; } = Assembly.GetExecutingAssembly().GetName().Version.ToString(); public string HarmonyID { get; } = "org.git.exmods.modtainers.gamecraftmoddingapi"; - public void OnApplicationQuit() + public override void OnApplicationQuit() { GamecraftModdingAPI.Main.Shutdown(); } - public void OnApplicationStart() + public override void OnApplicationStart() { FileLog.Reset(); Harmony.DEBUG = true; @@ -387,16 +383,6 @@ namespace GamecraftModdingAPI.Tests } } - public void OnFixedUpdate() { } - - public void OnLateUpdate() { } - - public void OnLevelWasInitialized(int level) { } - - public void OnLevelWasLoaded(int level) { } - - public void OnUpdate() { } - [HarmonyPatch] public class MinimumSpecsPatch { @@ -411,4 +397,5 @@ namespace GamecraftModdingAPI.Tests } } } +#endif } -- 2.30.2 From c06ed340a255030be8480a7033c347a0c3f491bd Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Thu, 17 Sep 2020 23:08:26 +0200 Subject: [PATCH 101/252] Using the console block's material Progressed a lot --- GamecraftModdingAPI/Blocks/CustomBlock.cs | 46 +++++++++++++++++++++-- 1 file changed, 42 insertions(+), 4 deletions(-) diff --git a/GamecraftModdingAPI/Blocks/CustomBlock.cs b/GamecraftModdingAPI/Blocks/CustomBlock.cs index 9801e40..bc67fe9 100644 --- a/GamecraftModdingAPI/Blocks/CustomBlock.cs +++ b/GamecraftModdingAPI/Blocks/CustomBlock.cs @@ -13,6 +13,7 @@ using RobocraftX.Common; using RobocraftX.Schedulers; using Svelto.Tasks; using Svelto.Tasks.ExtraLean; +using Unity.Entities; using UnityEngine; using UnityEngine.AddressableAssets; @@ -112,7 +113,7 @@ namespace GamecraftModdingAPI.Blocks cubeCategory = CubeCategory.ConsoleBlock, inventoryCategory = InventoryCategory.Logic, ID = 500, - Path = "Assets/Cube.prefab", //Index out of range exception: Asset failed to load (wrong path) + Path = "Assets/Prefabs/Cube.prefab", //Index out of range exception: Asset failed to load (wrong path) SpriteName = "CTR_CommandBlock", CubeNameKey = "strConsoleBlock", SelectableFaces = new[] {0, 1, 2, 3, 4, 5}, @@ -131,19 +132,51 @@ namespace GamecraftModdingAPI.Blocks [HarmonyPatch] public static class GOPatch { + private static Material[] materials; public static void Prefix(uint prefabID, GameObject gameObject) { Console.WriteLine("ID: " + prefabID + " - Name: " + gameObject.name); if (gameObject.name == "Cube") + { + //Console.WriteLine("Length: " + gameObject.GetComponentsInChildren().Length); + if (materials != null) + gameObject.GetComponentsInChildren()[0].sharedMaterials = materials; ECSGPUIResourceManager.Instance.RegisterRuntimePrefabs( - new[] {new PrefabData {prefabId = 500, prefabName = "Assets/Cube.prefab"}}, - new List {gameObject}, 1).Complete(); + new[] {new PrefabData {prefabId = 500, prefabName = "Assets/Prefabs/Cube.prefab"}}, + new List {gameObject}).Complete(); + GPUInstancerAPI.AddInstancesToPrefabPrototypeAtRuntime(ECSGPUIResourceManager.Instance.prefabManager, + gameObject.GetComponent().prefabPrototype, new[] {gameObject}); + Console.WriteLine("Registered prefab to instancer"); + + var register = AccessTools.Method("RobocraftX.Common.ECSPhysicResourceManager:RegisterPrefab", + new[] {typeof(uint), typeof(GameObject), typeof(World), typeof(BlobAssetStore)}); + register.Invoke(ECSPhysicResourceManager.Instance, + new object[] {prefabID, gameObject, MGPatch.data.Item1, MGPatch.data.Item2}); + Console.WriteLine("Registered prefab to physics"); + } + else if (gameObject.name == "CTR_CommandBlock") + materials = gameObject.GetComponentsInChildren()[0].sharedMaterials; } public static MethodBase TargetMethod() { return AccessTools.Method("RobocraftX.Common.ECSGPUIResourceManager:RegisterPrefab", - new[] {typeof(uint), typeof(GameObject), typeof(uint)}); + new[] {typeof(uint), typeof(GameObject)}); + } + } + + [HarmonyPatch] + public static class MGPatch + { + internal static (World, BlobAssetStore) data; + public static void Prefix(World physicsWorld, BlobAssetStore blobStore) + { + data = (physicsWorld, blobStore); + } + + public static MethodBase TargetMethod() + { + return AccessTools.Method("RobocraftX.CR.MainGame.MainGameCompositionRoot:Init"); } } @@ -154,6 +187,11 @@ namespace GamecraftModdingAPI.Blocks while (!res.IsDone) yield return Yield.It; Console.WriteLine("Loaded custom catalog: " + res.Result.LocatorId); Addressables.AddResourceLocator(res.Result); + /*Console.WriteLine("Loading Cube asset..."); + var loadTask = Addressables.LoadAssetAsync("Assets/Cube.prefab"); + while (!loadTask.IsDone) yield return Yield.It; + Console.WriteLine("Exception: "+loadTask.OperationException); + Console.WriteLine("Result: " + loadTask.Result.name);*/ } } } \ No newline at end of file -- 2.30.2 From 1e9d1c8f81d1c9f1e3348b2087126df1b528125c Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Fri, 18 Sep 2020 21:19:39 +0200 Subject: [PATCH 102/252] Fix TextBlock.Text=null, most new blocks and others --- GamecraftModdingAPI/Block.cs | 7 +++- GamecraftModdingAPI/Blocks/BlockIDs.cs | 48 +++++++++++++++++++++++++ GamecraftModdingAPI/Blocks/TextBlock.cs | 1 + 3 files changed, 55 insertions(+), 1 deletion(-) diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index b901f81..2e4161a 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -439,7 +439,12 @@ namespace GamecraftModdingAPI //Lets improve that using delegates var block = New(Id.entityID, Id.groupID); - block.InitData = this.InitData; + if (this.InitData.Group != null) + { + block.InitData = this.InitData; + Placed += block.OnPlacedInit; //Reset InitData of new object + } + return block; } diff --git a/GamecraftModdingAPI/Blocks/BlockIDs.cs b/GamecraftModdingAPI/Blocks/BlockIDs.cs index 33f9522..06f7036 100644 --- a/GamecraftModdingAPI/Blocks/BlockIDs.cs +++ b/GamecraftModdingAPI/Blocks/BlockIDs.cs @@ -248,6 +248,54 @@ namespace GamecraftModdingAPI.Blocks PlasmaCannonBlock, QuantumRiflePickup = 300, QuantumRifleAmmoPickup, + AluminiumSlicedFraction, + AluminiumSlicedSlope, + AluminiumHalfPyramidLeft = 305, + AluminiumHalfPyramidRight, + AluminiumPyramidSliced, + AluminiumTubeCross, + AluminiumTubeT, + AluminiumPlateSquare, + AluminiumPlateCircle, + AluminiumPlateTriangle, //312 + OiledSlicedFraction = 314, + OiledSlicedSlope, + OiledHalfPyramidLeft, + OiledHalfPyramidRight, + OiledPyramidSliced, + GlassSlicedFraction, + GlassSlicedSlope, + GlassHalfPyramidLeft, + GlassHalfPyramidRight, + GlassPyramidSliced, + RubberSlicedFraction, + RubberSlicedSlope, + RubberHalfPyramidLeft, + RubberHalfPyramidRight, + RubberPyramidSliced, + WoodSlicedFraction, + WoodSlicedSlope, //330 + WoodHalfPyramidLeft, + WoodHalfPyramidRight, + WoodPyramidSliced, + OiledTubeCross = 339, + OiledTubeT, + GlassTubeT, + RubberTubeCross = 343, + RubberTubeT, + WoodTubeCross, + WoodTubeT, + OiledTubeCorner = 353, + GlassTubeCorner, + RubberTubeCorner, + WoodTubeCorner, + IronSlicedFraction = 366, + IronSlicedSlope, + IronHalfPyramidLeft, + IronHalfPyramidRight, + IronPyramidSliced, + IronTubeCross, + IronTubeT, MagmaRockCube=777, MagmaRockCubeSliced, MagmaRockSlope, diff --git a/GamecraftModdingAPI/Blocks/TextBlock.cs b/GamecraftModdingAPI/Blocks/TextBlock.cs index e4b4c73..ea5e089 100644 --- a/GamecraftModdingAPI/Blocks/TextBlock.cs +++ b/GamecraftModdingAPI/Blocks/TextBlock.cs @@ -33,6 +33,7 @@ namespace GamecraftModdingAPI.Blocks { BlockEngine.SetBlockInfo(this, (ref TextBlockDataStruct tbds, string val) => { + if (val == null) val = ""; tbds.textCurrent.Set(val); tbds.textStored.Set(val); }, value); -- 2.30.2 From d581ec598aed04cbdbb8b3bb42c338d9f8959206 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sat, 19 Sep 2020 00:13:05 +0200 Subject: [PATCH 103/252] Add the rest of the blocks --- GamecraftModdingAPI/Blocks/BlockIDs.cs | 45 ++++++++++++++++++++------ 1 file changed, 36 insertions(+), 9 deletions(-) diff --git a/GamecraftModdingAPI/Blocks/BlockIDs.cs b/GamecraftModdingAPI/Blocks/BlockIDs.cs index 06f7036..a9a8d3a 100644 --- a/GamecraftModdingAPI/Blocks/BlockIDs.cs +++ b/GamecraftModdingAPI/Blocks/BlockIDs.cs @@ -228,7 +228,7 @@ namespace GamecraftModdingAPI.Blocks ObjectiveHUD, GameStatsHUD, //231 GameOverBlock, - SFXBlockGameplay=240, + SFXBlockGameplay = 240, SFXBlock8Bit, SFXBlockInstrument, SFXBlockSciFi, @@ -278,25 +278,52 @@ namespace GamecraftModdingAPI.Blocks WoodHalfPyramidLeft, WoodHalfPyramidRight, WoodPyramidSliced, - OiledTubeCross = 339, - OiledTubeT, + HexNetSlicedFraction, + HexNetSlicedSlope, + HexNetHalfPyramidLeft, + HexNetHalfPyramidRight, + HexNetPyramidSliced, + OiledTubeCross, + OiledTubeT, //340 + GlassTubeCross, GlassTubeT, - RubberTubeCross = 343, + RubberTubeCross, RubberTubeT, WoodTubeCross, WoodTubeT, - OiledTubeCorner = 353, + HexNetTubeCross, + HexNetTubeT, + BouncyCube, + BouncySlicedCube, //350 + BouncySlope, + BouncyCorner, + OiledTubeCorner, GlassTubeCorner, RubberTubeCorner, WoodTubeCorner, - IronSlicedFraction = 366, + Basketball, + BowlingBall, + SoccerBall, + GolfBall, //360 + HockeyPuck, + PoolBall, + BouncyBall, + TennisBall, + UnlitCube, + IronSlicedFraction, IronSlicedSlope, IronHalfPyramidLeft, IronHalfPyramidRight, - IronPyramidSliced, + IronPyramidSliced, //370 IronTubeCross, IronTubeT, - MagmaRockCube=777, + SFXBlockMob = 374, + PointLight, + SpotLight, + SunLight, + AmbientLight, + UnlitGlowCube = 381, + MagmaRockCube = 777, MagmaRockCubeSliced, MagmaRockSlope, MagmaRockCorner, @@ -315,7 +342,7 @@ namespace GamecraftModdingAPI.Blocks HexNetSlopeRounded, HexNetCornerRounded, //794 MagmaRockBulgedInner, - HexNetCylinder=797, + HexNetCylinder = 797, HexNetHemisphere, HexNetSphere, HexNetTubeCorner //800 -- 2.30.2 From 9e6edc19bdae238a43c18d457bee9e744fcb472f Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Wed, 23 Sep 2020 15:31:54 -0400 Subject: [PATCH 104/252] Implement SFX block API and bump version --- GamecraftModdingAPI/Block.cs | 8 + GamecraftModdingAPI/Blocks/MusicBlock.cs | 2 +- GamecraftModdingAPI/Blocks/SfxBlock.cs | 209 ++++++++++++++++++ .../GamecraftModdingAPI.csproj | 2 +- 4 files changed, 219 insertions(+), 2 deletions(-) create mode 100644 GamecraftModdingAPI/Blocks/SfxBlock.cs diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index 2e4161a..97386a3 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -135,6 +135,14 @@ namespace GamecraftModdingAPI CommonExclusiveGroups.BUILD_BUILDINGSPAWN_BLOCK_GROUP } }, + { + typeof(SfxBlock), + new[] + { + CommonExclusiveGroups.BUILD_SIMPLESFX_BLOCK_GROUP, + CommonExclusiveGroups.BUILD_LOOPEDSFX_BLOCK_GROUP + } + }, {typeof(TextBlock), new[] {CommonExclusiveGroups.BUILD_TEXT_BLOCK_GROUP}}, {typeof(Timer), new[] {CommonExclusiveGroups.BUILD_TIMER_BLOCK_GROUP}} }; diff --git a/GamecraftModdingAPI/Blocks/MusicBlock.cs b/GamecraftModdingAPI/Blocks/MusicBlock.cs index 185913b..fc3c880 100644 --- a/GamecraftModdingAPI/Blocks/MusicBlock.cs +++ b/GamecraftModdingAPI/Blocks/MusicBlock.cs @@ -97,7 +97,7 @@ namespace GamecraftModdingAPI.Blocks { get { - Assert.Log("Block exists: " + Exists); + //Assert.Log("Block exists: " + Exists); return BlockEngine.GetBlockInfo(this, (MusicBlockDataEntityStruct msdes) => (ChannelType) msdes.channelType); } diff --git a/GamecraftModdingAPI/Blocks/SfxBlock.cs b/GamecraftModdingAPI/Blocks/SfxBlock.cs new file mode 100644 index 0000000..f7efe6d --- /dev/null +++ b/GamecraftModdingAPI/Blocks/SfxBlock.cs @@ -0,0 +1,209 @@ +using System; +using FMOD.Studio; +using FMODUnity; +using Gamecraft.Wires; +using RobocraftX.Blocks; +using RobocraftX.Common; +using Svelto.ECS; + +namespace GamecraftModdingAPI.Blocks +{ + public class SfxBlock : SignalingBlock + { + public SfxBlock(EGID id) : base(id) + { + } + + public SfxBlock(uint id) : base(new EGID(id, CommonExclusiveGroups.BUILD_SIMPLESFX_BLOCK_GROUP /* This could also be BUILD_LOOPEDSFX_BLOCK_GROUP */)) + { + } + + public float Volume + { + get + { + return BlockEngine.GetBlockInfo(this, (SoundSfxBlockDataEntityStruct obj) => obj.tweakableVolume); + } + + set + { + BlockEngine.SetBlockInfo(this, + (ref SoundSfxBlockDataEntityStruct obj, float val) => obj.tweakableVolume = val, value); + } + } + + public float Pitch + { + get + { + return BlockEngine.GetBlockInfo(this, (SoundSfxBlockDataEntityStruct obj) => obj.tweakablePitch); + } + + set + { + BlockEngine.SetBlockInfo(this, + (ref SoundSfxBlockDataEntityStruct obj, float val) => obj.tweakablePitch = val, value); + } + } + + public bool Is3D + { + get + { + return BlockEngine.GetBlockInfo(this, (SoundSfxBlockDataEntityStruct obj) => obj.is3D); + } + + set + { + BlockEngine.SetBlockInfo(this, + (ref SoundSfxBlockDataEntityStruct obj, bool val) => obj.is3D = val, value); + } + } + + public ChannelType ChannelType + { + get + { + return BlockEngine.GetBlockInfo(this, (SoundSfxBlockDataEntityStruct obj) => (ChannelType)obj.channelType); + } + + set + { + BlockEngine.SetBlockInfo(this, + (ref SoundSfxBlockDataEntityStruct obj, ChannelType val) => obj.tweakableVolume = (byte) val, value); + } + } + + public byte TrackIndex + { + get + { + return BlockEngine.GetBlockInfo(this, (SoundSfxBlockDataEntityStruct obj) => obj.soundEffectIndex); + } + + set + { + BlockEngine.SetBlockInfo(this, + (ref SoundSfxBlockDataEntityStruct obj, byte val) => obj.soundEffectIndex = val, value); + } + } + + // track + public Guid Track + { + get + { + return BlockEngine.GetBlockInfo(this, + (SoundSfxBlockDataEntityStruct obj) => obj.is3D ? obj.fmod3DEventPaths.Get(obj.soundEffectIndex) : obj.fmod2DEventPaths.Get(obj.soundEffectIndex)); + } + + set + { + BlockEngine.SetBlockInfo(this, (ref SoundSfxBlockDataEntityStruct obj, Guid val) => + { + for (byte i = 0; i < obj.fmod2DEventPaths.Count(); i++) + { + Guid track = obj.fmod2DEventPaths.Get(i); + if (track == val) + { + obj.soundEffectIndex = i; + obj.is3D = false; + return; + } + } + for (byte i = 0; i < obj.fmod3DEventPaths.Count(); i++) + { + Guid track = obj.fmod3DEventPaths.Get(i); + if (track == val) + { + obj.soundEffectIndex = i; + obj.is3D = true; + return; + } + } + }, value); + } + } + + // all tracks + public Guid[] Tracks2D + { + get + { + return BlockEngine.GetBlockInfo(this, (SoundSfxBlockDataEntityStruct obj) => + { + Guid[] tracks = new Guid[obj.fmod2DEventPaths.Count()]; + for (byte i = 0; i < tracks.Length; i++) + { + tracks[i] = obj.fmod2DEventPaths.Get(i); + } + return tracks; + }); + } + } + + public Guid[] Tracks3D + { + get + { + return BlockEngine.GetBlockInfo(this, (SoundSfxBlockDataEntityStruct obj) => + { + Guid[] tracks = new Guid[obj.fmod3DEventPaths.Count()]; + for (byte i = 0; i < tracks.Length; i++) + { + tracks[i] = obj.fmod2DEventPaths.Get(i); + } + return tracks; + }); + } + } + + public bool IsLooped + { + get + { + return BlockEngine.GetBlockInfo(this, (SoundSfxBlockDataEntityStruct obj) => obj.isLoopedBlock); + } + + set + { + BlockEngine.SetBlockInfo(this, + (ref SoundSfxBlockDataEntityStruct obj, bool val) => obj.isLoopedBlock = val, value); + } + } + + public bool IsPlaying + { + get + { + return BlockEngine.GetBlockInfo(this, + (SoundSfxBlockDataEntityStruct obj) => obj.isPlaying); + } + + set + { + BlockEngine.SetBlockInfo(this, (ref SoundSfxBlockDataEntityStruct obj, bool val) => + { + if (obj.isPlaying == val) return; + if (val) + { + // start playing + EventInstance inst = RuntimeManager.CreateInstance(obj.is3D ? obj.fmod3DEventPaths.Get(obj.soundEffectIndex) : obj.fmod2DEventPaths.Get(obj.soundEffectIndex)); + inst.setVolume(obj.tweakableVolume / 100f); + inst.start(); + obj.eventHandle = inst.handle; + } + else + { + // stop playing + EventInstance inst = default(EventInstance); + inst.handle = obj.eventHandle; + inst.stop(FMOD.Studio.STOP_MODE.ALLOWFADEOUT); + inst.release(); + } + obj.isPlaying = val; + }, value); + } + } + } +} \ No newline at end of file diff --git a/GamecraftModdingAPI/GamecraftModdingAPI.csproj b/GamecraftModdingAPI/GamecraftModdingAPI.csproj index 7a7fe1d..193a14f 100644 --- a/GamecraftModdingAPI/GamecraftModdingAPI.csproj +++ b/GamecraftModdingAPI/GamecraftModdingAPI.csproj @@ -2,7 +2,7 @@ net472 true - 1.5.0-preview + 1.6.0-preview Exmods GNU General Public Licence 3+ https://git.exmods.org/modtainers/GamecraftModdingAPI -- 2.30.2 From ee6a0e3af638efcf2c5df9b397e86fd17052a829 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Mon, 28 Sep 2020 03:10:59 +0200 Subject: [PATCH 105/252] Add support for getting the RGB of block colors Only works if the constructors are used --- GamecraftModdingAPI/Block.cs | 13 ++++--------- GamecraftModdingAPI/Blocks/BlockColor.cs | 16 +++++++++++++++- GamecraftModdingAPI/Blocks/BlockEngine.cs | 11 +++++------ 3 files changed, 24 insertions(+), 16 deletions(-) diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index 97386a3..f827e09 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -36,16 +36,11 @@ namespace GamecraftModdingAPI /// Place a new block at the given position. If scaled, position means the center of the block. The default block size is 0.2 in terms of position. /// Place blocks next to each other to connect them. /// The placed block will be a complete block with a placement grid and collision which will be saved along with the game. - /// - /// When placing multiple blocks, do not access properties immediately after creation as this - /// triggers a sync each time which can affect performance and may cause issues with the game. - /// You may either use AsyncUtils.WaitForSubmission() after placing all of the blocks - /// or simply access the block properties which will trigger the synchronization the first time a property is used. /// /// The block's type /// The block's color /// The block color's darkness (0-9) - 0 is default color - /// The block's position in the grid - default block size is 0.2 + /// The block's position - default block size is 0.2 /// The block's rotation in degrees /// The block's uniform scale - default scale is 1 (with 0.2 width) /// The block's non-uniform scale - 0 means is used @@ -66,7 +61,7 @@ namespace GamecraftModdingAPI /// The block's type /// The block's color /// The block color's darkness (0-9) - 0 is default color - /// The block's position in the grid - default block size is 0.2 + /// The block's position - default block size is 0.2 /// The block's rotation in degrees /// The block's uniform scale - default scale is 1 (with 0.2 width) /// The block's non-uniform scale - 0 means is used @@ -192,7 +187,7 @@ namespace GamecraftModdingAPI type); ILGenerator il = dynamic.GetILGenerator(); - il.DeclareLocal(type); + //il.DeclareLocal(type); il.Emit(OpCodes.Ldarg_0); //Load EGID and pass to constructor il.Emit(OpCodes.Newobj, ctor); //Call constructor //il.Emit(OpCodes.Stloc_0); - doesn't seem like we need these @@ -317,7 +312,7 @@ namespace GamecraftModdingAPI color.indexInPalette = (byte) (val.Color + val.Darkness * 10); color.overridePaletteColour = false; color.needsUpdate = true; - BlockEngine.SetBlockColorFromPalette(ref color); + color.paletteColour = BlockEngine.ConvertBlockColor(color.indexInPalette); }, value); } } diff --git a/GamecraftModdingAPI/Blocks/BlockColor.cs b/GamecraftModdingAPI/Blocks/BlockColor.cs index d7ada0d..46a5dc4 100644 --- a/GamecraftModdingAPI/Blocks/BlockColor.cs +++ b/GamecraftModdingAPI/Blocks/BlockColor.cs @@ -1,9 +1,13 @@ -namespace GamecraftModdingAPI.Blocks +using System; +using Unity.Mathematics; + +namespace GamecraftModdingAPI.Blocks { public struct BlockColor { public BlockColors Color; public byte Darkness; + public byte Index; public BlockColor(byte index) { @@ -14,17 +18,27 @@ } else { + if (index > 99) + throw new ArgumentOutOfRangeException(nameof(index), "Invalid color index. Must be 0-90 or 255."); Color = (BlockColors) (index % 10); Darkness = (byte) (index / 10); } + + Index = index; } public BlockColor(BlockColors color, byte darkness) { + if (darkness > 9) + throw new ArgumentOutOfRangeException(nameof(darkness), "Darkness must be 0-9 where 0 is default."); Color = color; Darkness = darkness; + if (color == BlockColors.Default) Index = byte.MaxValue; + else Index = (byte) (darkness * 10 + color); } + public float4 RGBA => Block.BlockEngine.ConvertBlockColor(Index); + public override string ToString() { return $"{nameof(Color)}: {Color}, {nameof(Darkness)}: {Darkness}"; diff --git a/GamecraftModdingAPI/Blocks/BlockEngine.cs b/GamecraftModdingAPI/Blocks/BlockEngine.cs index 2622d41..3a979fe 100644 --- a/GamecraftModdingAPI/Blocks/BlockEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlockEngine.cs @@ -13,6 +13,7 @@ using Svelto.ECS; using Svelto.ECS.Hybrid; using GamecraftModdingAPI.Engines; +using Unity.Mathematics; namespace GamecraftModdingAPI.Blocks { @@ -54,12 +55,10 @@ namespace GamecraftModdingAPI.Blocks return ret; } - public void SetBlockColorFromPalette(ref ColourParameterEntityStruct color) - { - ref var paletteEntry = ref entitiesDB.QueryEntity(color.indexInPalette, - CommonExclusiveGroups.COLOUR_PALETTE_GROUP); - color.paletteColour = paletteEntry.Colour; - } + public float4 ConvertBlockColor(byte index) => index == byte.MaxValue + ? new float4(-1f, -1f, -1f, -1f) + : entitiesDB.QueryEntity(index, + CommonExclusiveGroups.COLOUR_PALETTE_GROUP).Colour; public ref T GetBlockInfo(EGID blockID) where T : unmanaged, IEntityComponent { -- 2.30.2 From 58cfba443eb2a4ba41582335cea06f0638b837cd Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Wed, 30 Sep 2020 23:52:17 +0200 Subject: [PATCH 106/252] Add hotfix blocks and Player.LocalPlayer --- GamecraftModdingAPI/Blocks/BlockIDs.cs | 4 ++++ GamecraftModdingAPI/Player.cs | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/GamecraftModdingAPI/Blocks/BlockIDs.cs b/GamecraftModdingAPI/Blocks/BlockIDs.cs index a9a8d3a..d867ce0 100644 --- a/GamecraftModdingAPI/Blocks/BlockIDs.cs +++ b/GamecraftModdingAPI/Blocks/BlockIDs.cs @@ -323,6 +323,10 @@ namespace GamecraftModdingAPI.Blocks SunLight, AmbientLight, UnlitGlowCube = 381, + PointLightInvisible, + SpotLightInvisible, + UnlitSlope, + UnlitGlowSlope, MagmaRockCube = 777, MagmaRockCubeSliced, MagmaRockSlope, diff --git a/GamecraftModdingAPI/Player.cs b/GamecraftModdingAPI/Player.cs index 40dd385..a4b7064 100644 --- a/GamecraftModdingAPI/Player.cs +++ b/GamecraftModdingAPI/Player.cs @@ -17,6 +17,7 @@ namespace GamecraftModdingAPI { // static functionality private static PlayerEngine playerEngine = new PlayerEngine(); + private static Player localPlayer; /// /// Checks if the specified player exists. @@ -54,6 +55,19 @@ namespace GamecraftModdingAPI return (uint) playerEngine.GetAllPlayerCount(); } + /// + /// Returns the current player belonging to this client. + /// + public static Player LocalPlayer + { + get + { + if (localPlayer == null || localPlayer.Id != playerEngine.GetLocalPlayer()) + localPlayer = new Player(PlayerType.Local); + return localPlayer; + } + } + /// /// Initializes a new instance of the class. /// -- 2.30.2 From 92965404ce61e3d6bea7f4bcd05514c5656efbff Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Fri, 2 Oct 2020 01:54:59 +0200 Subject: [PATCH 107/252] Remove ScalingEngine.Setup() and add object ID to dict --- GamecraftModdingAPI/Block.cs | 5 +---- GamecraftModdingAPI/Blocks/ScalingEngine.cs | 9 +++------ GamecraftModdingAPI/Events/GameActivatedComposePatch.cs | 2 -- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index f827e09..f63e96c 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -120,6 +120,7 @@ namespace GamecraftModdingAPI {typeof(LogicGate), new [] {CommonExclusiveGroups.BUILD_LOGIC_BLOCK_GROUP}}, {typeof(Motor), new[] {CommonExclusiveGroups.BUILD_MOTOR_BLOCK_GROUP}}, {typeof(MusicBlock), new[] {CommonExclusiveGroups.BUILD_MUSIC_BLOCK_GROUP}}, + {typeof(ObjectIdentifier), new[]{CommonExclusiveGroups.BUILD_OBJID_BLOCK_GROUP}}, {typeof(Piston), new[] {CommonExclusiveGroups.BUILD_PISTON_BLOCK_GROUP}}, {typeof(Servo), new[] {CommonExclusiveGroups.BUILD_SERVO_BLOCK_GROUP}}, { @@ -460,9 +461,5 @@ namespace GamecraftModdingAPI } } #endif - internal static void Setup(World physicsWorld) - { - ScalingEngine.Setup(physicsWorld.EntityManager); - } } } \ No newline at end of file diff --git a/GamecraftModdingAPI/Blocks/ScalingEngine.cs b/GamecraftModdingAPI/Blocks/ScalingEngine.cs index a531865..fcbf900 100644 --- a/GamecraftModdingAPI/Blocks/ScalingEngine.cs +++ b/GamecraftModdingAPI/Blocks/ScalingEngine.cs @@ -27,10 +27,12 @@ namespace GamecraftModdingAPI.Blocks public string Name { get; } = "GamecraftModdingAPIScalingEngine"; public bool isRemovable { get; } = false; - private static EntityManager _entityManager; //Unity entity manager + private EntityManager _entityManager; //Unity entity manager public void UpdateCollision(EGID egid) { + if (_entityManager == default) + _entityManager = FullGameFields._physicsWorld.EntityManager; //Assuming the block exists var entity = entitiesDB.QueryEntity(egid).uecsEntity; var pes = new UECSPhysicsEntityCreationStruct(); @@ -38,11 +40,6 @@ namespace GamecraftModdingAPI.Blocks _entityManager.DestroyEntity(entity); } - internal void Setup(EntityManager entityManager) - { - _entityManager = entityManager; - } - [HarmonyPatch] public class PhysicsEnginePatch { diff --git a/GamecraftModdingAPI/Events/GameActivatedComposePatch.cs b/GamecraftModdingAPI/Events/GameActivatedComposePatch.cs index 4142fb3..c3a5fb5 100644 --- a/GamecraftModdingAPI/Events/GameActivatedComposePatch.cs +++ b/GamecraftModdingAPI/Events/GameActivatedComposePatch.cs @@ -31,8 +31,6 @@ namespace GamecraftModdingAPI.Events GameEngineManager.RegisterEngines(enginesRoot); // initialize AsyncUtils AsyncUtils.Setup(enginesRoot); - // initialize Block - Block.Setup(physicsWorld); // A new EnginesRoot is always created when ActivateGame is called // so all event emitters and handlers must be re-registered. EventManager.RegisterEngines(enginesRoot); -- 2.30.2 From f2ce03756411d82369fdd8118179fd9a2b265540 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Fri, 18 Sep 2020 21:19:39 +0200 Subject: [PATCH 108/252] Fix TextBlock.Text=null, most new blocks and others --- GamecraftModdingAPI/Block.cs | 7 +++- GamecraftModdingAPI/Blocks/BlockIDs.cs | 48 +++++++++++++++++++++++++ GamecraftModdingAPI/Blocks/TextBlock.cs | 1 + 3 files changed, 55 insertions(+), 1 deletion(-) diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index b901f81..2e4161a 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -439,7 +439,12 @@ namespace GamecraftModdingAPI //Lets improve that using delegates var block = New(Id.entityID, Id.groupID); - block.InitData = this.InitData; + if (this.InitData.Group != null) + { + block.InitData = this.InitData; + Placed += block.OnPlacedInit; //Reset InitData of new object + } + return block; } diff --git a/GamecraftModdingAPI/Blocks/BlockIDs.cs b/GamecraftModdingAPI/Blocks/BlockIDs.cs index 33f9522..06f7036 100644 --- a/GamecraftModdingAPI/Blocks/BlockIDs.cs +++ b/GamecraftModdingAPI/Blocks/BlockIDs.cs @@ -248,6 +248,54 @@ namespace GamecraftModdingAPI.Blocks PlasmaCannonBlock, QuantumRiflePickup = 300, QuantumRifleAmmoPickup, + AluminiumSlicedFraction, + AluminiumSlicedSlope, + AluminiumHalfPyramidLeft = 305, + AluminiumHalfPyramidRight, + AluminiumPyramidSliced, + AluminiumTubeCross, + AluminiumTubeT, + AluminiumPlateSquare, + AluminiumPlateCircle, + AluminiumPlateTriangle, //312 + OiledSlicedFraction = 314, + OiledSlicedSlope, + OiledHalfPyramidLeft, + OiledHalfPyramidRight, + OiledPyramidSliced, + GlassSlicedFraction, + GlassSlicedSlope, + GlassHalfPyramidLeft, + GlassHalfPyramidRight, + GlassPyramidSliced, + RubberSlicedFraction, + RubberSlicedSlope, + RubberHalfPyramidLeft, + RubberHalfPyramidRight, + RubberPyramidSliced, + WoodSlicedFraction, + WoodSlicedSlope, //330 + WoodHalfPyramidLeft, + WoodHalfPyramidRight, + WoodPyramidSliced, + OiledTubeCross = 339, + OiledTubeT, + GlassTubeT, + RubberTubeCross = 343, + RubberTubeT, + WoodTubeCross, + WoodTubeT, + OiledTubeCorner = 353, + GlassTubeCorner, + RubberTubeCorner, + WoodTubeCorner, + IronSlicedFraction = 366, + IronSlicedSlope, + IronHalfPyramidLeft, + IronHalfPyramidRight, + IronPyramidSliced, + IronTubeCross, + IronTubeT, MagmaRockCube=777, MagmaRockCubeSliced, MagmaRockSlope, diff --git a/GamecraftModdingAPI/Blocks/TextBlock.cs b/GamecraftModdingAPI/Blocks/TextBlock.cs index e4b4c73..ea5e089 100644 --- a/GamecraftModdingAPI/Blocks/TextBlock.cs +++ b/GamecraftModdingAPI/Blocks/TextBlock.cs @@ -33,6 +33,7 @@ namespace GamecraftModdingAPI.Blocks { BlockEngine.SetBlockInfo(this, (ref TextBlockDataStruct tbds, string val) => { + if (val == null) val = ""; tbds.textCurrent.Set(val); tbds.textStored.Set(val); }, value); -- 2.30.2 From 1a0c98dd67499ba8d6c55b9ce766286887977056 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sat, 19 Sep 2020 00:13:05 +0200 Subject: [PATCH 109/252] Add the rest of the blocks --- GamecraftModdingAPI/Blocks/BlockIDs.cs | 45 ++++++++++++++++++++------ 1 file changed, 36 insertions(+), 9 deletions(-) diff --git a/GamecraftModdingAPI/Blocks/BlockIDs.cs b/GamecraftModdingAPI/Blocks/BlockIDs.cs index 06f7036..a9a8d3a 100644 --- a/GamecraftModdingAPI/Blocks/BlockIDs.cs +++ b/GamecraftModdingAPI/Blocks/BlockIDs.cs @@ -228,7 +228,7 @@ namespace GamecraftModdingAPI.Blocks ObjectiveHUD, GameStatsHUD, //231 GameOverBlock, - SFXBlockGameplay=240, + SFXBlockGameplay = 240, SFXBlock8Bit, SFXBlockInstrument, SFXBlockSciFi, @@ -278,25 +278,52 @@ namespace GamecraftModdingAPI.Blocks WoodHalfPyramidLeft, WoodHalfPyramidRight, WoodPyramidSliced, - OiledTubeCross = 339, - OiledTubeT, + HexNetSlicedFraction, + HexNetSlicedSlope, + HexNetHalfPyramidLeft, + HexNetHalfPyramidRight, + HexNetPyramidSliced, + OiledTubeCross, + OiledTubeT, //340 + GlassTubeCross, GlassTubeT, - RubberTubeCross = 343, + RubberTubeCross, RubberTubeT, WoodTubeCross, WoodTubeT, - OiledTubeCorner = 353, + HexNetTubeCross, + HexNetTubeT, + BouncyCube, + BouncySlicedCube, //350 + BouncySlope, + BouncyCorner, + OiledTubeCorner, GlassTubeCorner, RubberTubeCorner, WoodTubeCorner, - IronSlicedFraction = 366, + Basketball, + BowlingBall, + SoccerBall, + GolfBall, //360 + HockeyPuck, + PoolBall, + BouncyBall, + TennisBall, + UnlitCube, + IronSlicedFraction, IronSlicedSlope, IronHalfPyramidLeft, IronHalfPyramidRight, - IronPyramidSliced, + IronPyramidSliced, //370 IronTubeCross, IronTubeT, - MagmaRockCube=777, + SFXBlockMob = 374, + PointLight, + SpotLight, + SunLight, + AmbientLight, + UnlitGlowCube = 381, + MagmaRockCube = 777, MagmaRockCubeSliced, MagmaRockSlope, MagmaRockCorner, @@ -315,7 +342,7 @@ namespace GamecraftModdingAPI.Blocks HexNetSlopeRounded, HexNetCornerRounded, //794 MagmaRockBulgedInner, - HexNetCylinder=797, + HexNetCylinder = 797, HexNetHemisphere, HexNetSphere, HexNetTubeCorner //800 -- 2.30.2 From 4dfa7b0f4e928b2a2c2d8bbeac6e34e4a68eb43d Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Wed, 23 Sep 2020 15:31:54 -0400 Subject: [PATCH 110/252] Implement SFX block API and bump version --- GamecraftModdingAPI/Block.cs | 8 + GamecraftModdingAPI/Blocks/MusicBlock.cs | 2 +- GamecraftModdingAPI/Blocks/SfxBlock.cs | 209 +++++++++++++++++++++++ 3 files changed, 218 insertions(+), 1 deletion(-) create mode 100644 GamecraftModdingAPI/Blocks/SfxBlock.cs diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index 2e4161a..97386a3 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -135,6 +135,14 @@ namespace GamecraftModdingAPI CommonExclusiveGroups.BUILD_BUILDINGSPAWN_BLOCK_GROUP } }, + { + typeof(SfxBlock), + new[] + { + CommonExclusiveGroups.BUILD_SIMPLESFX_BLOCK_GROUP, + CommonExclusiveGroups.BUILD_LOOPEDSFX_BLOCK_GROUP + } + }, {typeof(TextBlock), new[] {CommonExclusiveGroups.BUILD_TEXT_BLOCK_GROUP}}, {typeof(Timer), new[] {CommonExclusiveGroups.BUILD_TIMER_BLOCK_GROUP}} }; diff --git a/GamecraftModdingAPI/Blocks/MusicBlock.cs b/GamecraftModdingAPI/Blocks/MusicBlock.cs index 185913b..fc3c880 100644 --- a/GamecraftModdingAPI/Blocks/MusicBlock.cs +++ b/GamecraftModdingAPI/Blocks/MusicBlock.cs @@ -97,7 +97,7 @@ namespace GamecraftModdingAPI.Blocks { get { - Assert.Log("Block exists: " + Exists); + //Assert.Log("Block exists: " + Exists); return BlockEngine.GetBlockInfo(this, (MusicBlockDataEntityStruct msdes) => (ChannelType) msdes.channelType); } diff --git a/GamecraftModdingAPI/Blocks/SfxBlock.cs b/GamecraftModdingAPI/Blocks/SfxBlock.cs new file mode 100644 index 0000000..f7efe6d --- /dev/null +++ b/GamecraftModdingAPI/Blocks/SfxBlock.cs @@ -0,0 +1,209 @@ +using System; +using FMOD.Studio; +using FMODUnity; +using Gamecraft.Wires; +using RobocraftX.Blocks; +using RobocraftX.Common; +using Svelto.ECS; + +namespace GamecraftModdingAPI.Blocks +{ + public class SfxBlock : SignalingBlock + { + public SfxBlock(EGID id) : base(id) + { + } + + public SfxBlock(uint id) : base(new EGID(id, CommonExclusiveGroups.BUILD_SIMPLESFX_BLOCK_GROUP /* This could also be BUILD_LOOPEDSFX_BLOCK_GROUP */)) + { + } + + public float Volume + { + get + { + return BlockEngine.GetBlockInfo(this, (SoundSfxBlockDataEntityStruct obj) => obj.tweakableVolume); + } + + set + { + BlockEngine.SetBlockInfo(this, + (ref SoundSfxBlockDataEntityStruct obj, float val) => obj.tweakableVolume = val, value); + } + } + + public float Pitch + { + get + { + return BlockEngine.GetBlockInfo(this, (SoundSfxBlockDataEntityStruct obj) => obj.tweakablePitch); + } + + set + { + BlockEngine.SetBlockInfo(this, + (ref SoundSfxBlockDataEntityStruct obj, float val) => obj.tweakablePitch = val, value); + } + } + + public bool Is3D + { + get + { + return BlockEngine.GetBlockInfo(this, (SoundSfxBlockDataEntityStruct obj) => obj.is3D); + } + + set + { + BlockEngine.SetBlockInfo(this, + (ref SoundSfxBlockDataEntityStruct obj, bool val) => obj.is3D = val, value); + } + } + + public ChannelType ChannelType + { + get + { + return BlockEngine.GetBlockInfo(this, (SoundSfxBlockDataEntityStruct obj) => (ChannelType)obj.channelType); + } + + set + { + BlockEngine.SetBlockInfo(this, + (ref SoundSfxBlockDataEntityStruct obj, ChannelType val) => obj.tweakableVolume = (byte) val, value); + } + } + + public byte TrackIndex + { + get + { + return BlockEngine.GetBlockInfo(this, (SoundSfxBlockDataEntityStruct obj) => obj.soundEffectIndex); + } + + set + { + BlockEngine.SetBlockInfo(this, + (ref SoundSfxBlockDataEntityStruct obj, byte val) => obj.soundEffectIndex = val, value); + } + } + + // track + public Guid Track + { + get + { + return BlockEngine.GetBlockInfo(this, + (SoundSfxBlockDataEntityStruct obj) => obj.is3D ? obj.fmod3DEventPaths.Get(obj.soundEffectIndex) : obj.fmod2DEventPaths.Get(obj.soundEffectIndex)); + } + + set + { + BlockEngine.SetBlockInfo(this, (ref SoundSfxBlockDataEntityStruct obj, Guid val) => + { + for (byte i = 0; i < obj.fmod2DEventPaths.Count(); i++) + { + Guid track = obj.fmod2DEventPaths.Get(i); + if (track == val) + { + obj.soundEffectIndex = i; + obj.is3D = false; + return; + } + } + for (byte i = 0; i < obj.fmod3DEventPaths.Count(); i++) + { + Guid track = obj.fmod3DEventPaths.Get(i); + if (track == val) + { + obj.soundEffectIndex = i; + obj.is3D = true; + return; + } + } + }, value); + } + } + + // all tracks + public Guid[] Tracks2D + { + get + { + return BlockEngine.GetBlockInfo(this, (SoundSfxBlockDataEntityStruct obj) => + { + Guid[] tracks = new Guid[obj.fmod2DEventPaths.Count()]; + for (byte i = 0; i < tracks.Length; i++) + { + tracks[i] = obj.fmod2DEventPaths.Get(i); + } + return tracks; + }); + } + } + + public Guid[] Tracks3D + { + get + { + return BlockEngine.GetBlockInfo(this, (SoundSfxBlockDataEntityStruct obj) => + { + Guid[] tracks = new Guid[obj.fmod3DEventPaths.Count()]; + for (byte i = 0; i < tracks.Length; i++) + { + tracks[i] = obj.fmod2DEventPaths.Get(i); + } + return tracks; + }); + } + } + + public bool IsLooped + { + get + { + return BlockEngine.GetBlockInfo(this, (SoundSfxBlockDataEntityStruct obj) => obj.isLoopedBlock); + } + + set + { + BlockEngine.SetBlockInfo(this, + (ref SoundSfxBlockDataEntityStruct obj, bool val) => obj.isLoopedBlock = val, value); + } + } + + public bool IsPlaying + { + get + { + return BlockEngine.GetBlockInfo(this, + (SoundSfxBlockDataEntityStruct obj) => obj.isPlaying); + } + + set + { + BlockEngine.SetBlockInfo(this, (ref SoundSfxBlockDataEntityStruct obj, bool val) => + { + if (obj.isPlaying == val) return; + if (val) + { + // start playing + EventInstance inst = RuntimeManager.CreateInstance(obj.is3D ? obj.fmod3DEventPaths.Get(obj.soundEffectIndex) : obj.fmod2DEventPaths.Get(obj.soundEffectIndex)); + inst.setVolume(obj.tweakableVolume / 100f); + inst.start(); + obj.eventHandle = inst.handle; + } + else + { + // stop playing + EventInstance inst = default(EventInstance); + inst.handle = obj.eventHandle; + inst.stop(FMOD.Studio.STOP_MODE.ALLOWFADEOUT); + inst.release(); + } + obj.isPlaying = val; + }, value); + } + } + } +} \ No newline at end of file -- 2.30.2 From c9e71d84b4209acdd1ef2c2f6e1aa0ed0f16b8f0 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Mon, 28 Sep 2020 03:10:59 +0200 Subject: [PATCH 111/252] Add support for getting the RGB of block colors Only works if the constructors are used --- GamecraftModdingAPI/Block.cs | 13 ++++--------- GamecraftModdingAPI/Blocks/BlockColor.cs | 16 +++++++++++++++- GamecraftModdingAPI/Blocks/BlockEngine.cs | 11 +++++------ 3 files changed, 24 insertions(+), 16 deletions(-) diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index 97386a3..f827e09 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -36,16 +36,11 @@ namespace GamecraftModdingAPI /// Place a new block at the given position. If scaled, position means the center of the block. The default block size is 0.2 in terms of position. /// Place blocks next to each other to connect them. /// The placed block will be a complete block with a placement grid and collision which will be saved along with the game. - /// - /// When placing multiple blocks, do not access properties immediately after creation as this - /// triggers a sync each time which can affect performance and may cause issues with the game. - /// You may either use AsyncUtils.WaitForSubmission() after placing all of the blocks - /// or simply access the block properties which will trigger the synchronization the first time a property is used. /// /// The block's type /// The block's color /// The block color's darkness (0-9) - 0 is default color - /// The block's position in the grid - default block size is 0.2 + /// The block's position - default block size is 0.2 /// The block's rotation in degrees /// The block's uniform scale - default scale is 1 (with 0.2 width) /// The block's non-uniform scale - 0 means is used @@ -66,7 +61,7 @@ namespace GamecraftModdingAPI /// The block's type /// The block's color /// The block color's darkness (0-9) - 0 is default color - /// The block's position in the grid - default block size is 0.2 + /// The block's position - default block size is 0.2 /// The block's rotation in degrees /// The block's uniform scale - default scale is 1 (with 0.2 width) /// The block's non-uniform scale - 0 means is used @@ -192,7 +187,7 @@ namespace GamecraftModdingAPI type); ILGenerator il = dynamic.GetILGenerator(); - il.DeclareLocal(type); + //il.DeclareLocal(type); il.Emit(OpCodes.Ldarg_0); //Load EGID and pass to constructor il.Emit(OpCodes.Newobj, ctor); //Call constructor //il.Emit(OpCodes.Stloc_0); - doesn't seem like we need these @@ -317,7 +312,7 @@ namespace GamecraftModdingAPI color.indexInPalette = (byte) (val.Color + val.Darkness * 10); color.overridePaletteColour = false; color.needsUpdate = true; - BlockEngine.SetBlockColorFromPalette(ref color); + color.paletteColour = BlockEngine.ConvertBlockColor(color.indexInPalette); }, value); } } diff --git a/GamecraftModdingAPI/Blocks/BlockColor.cs b/GamecraftModdingAPI/Blocks/BlockColor.cs index d7ada0d..46a5dc4 100644 --- a/GamecraftModdingAPI/Blocks/BlockColor.cs +++ b/GamecraftModdingAPI/Blocks/BlockColor.cs @@ -1,9 +1,13 @@ -namespace GamecraftModdingAPI.Blocks +using System; +using Unity.Mathematics; + +namespace GamecraftModdingAPI.Blocks { public struct BlockColor { public BlockColors Color; public byte Darkness; + public byte Index; public BlockColor(byte index) { @@ -14,17 +18,27 @@ } else { + if (index > 99) + throw new ArgumentOutOfRangeException(nameof(index), "Invalid color index. Must be 0-90 or 255."); Color = (BlockColors) (index % 10); Darkness = (byte) (index / 10); } + + Index = index; } public BlockColor(BlockColors color, byte darkness) { + if (darkness > 9) + throw new ArgumentOutOfRangeException(nameof(darkness), "Darkness must be 0-9 where 0 is default."); Color = color; Darkness = darkness; + if (color == BlockColors.Default) Index = byte.MaxValue; + else Index = (byte) (darkness * 10 + color); } + public float4 RGBA => Block.BlockEngine.ConvertBlockColor(Index); + public override string ToString() { return $"{nameof(Color)}: {Color}, {nameof(Darkness)}: {Darkness}"; diff --git a/GamecraftModdingAPI/Blocks/BlockEngine.cs b/GamecraftModdingAPI/Blocks/BlockEngine.cs index 2622d41..3a979fe 100644 --- a/GamecraftModdingAPI/Blocks/BlockEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlockEngine.cs @@ -13,6 +13,7 @@ using Svelto.ECS; using Svelto.ECS.Hybrid; using GamecraftModdingAPI.Engines; +using Unity.Mathematics; namespace GamecraftModdingAPI.Blocks { @@ -54,12 +55,10 @@ namespace GamecraftModdingAPI.Blocks return ret; } - public void SetBlockColorFromPalette(ref ColourParameterEntityStruct color) - { - ref var paletteEntry = ref entitiesDB.QueryEntity(color.indexInPalette, - CommonExclusiveGroups.COLOUR_PALETTE_GROUP); - color.paletteColour = paletteEntry.Colour; - } + public float4 ConvertBlockColor(byte index) => index == byte.MaxValue + ? new float4(-1f, -1f, -1f, -1f) + : entitiesDB.QueryEntity(index, + CommonExclusiveGroups.COLOUR_PALETTE_GROUP).Colour; public ref T GetBlockInfo(EGID blockID) where T : unmanaged, IEntityComponent { -- 2.30.2 From 9e9f56881f9c3db0b86ab01d0ef3852b103549f9 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Wed, 30 Sep 2020 23:52:17 +0200 Subject: [PATCH 112/252] Add hotfix blocks and Player.LocalPlayer --- GamecraftModdingAPI/Blocks/BlockIDs.cs | 4 ++++ GamecraftModdingAPI/Player.cs | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/GamecraftModdingAPI/Blocks/BlockIDs.cs b/GamecraftModdingAPI/Blocks/BlockIDs.cs index a9a8d3a..d867ce0 100644 --- a/GamecraftModdingAPI/Blocks/BlockIDs.cs +++ b/GamecraftModdingAPI/Blocks/BlockIDs.cs @@ -323,6 +323,10 @@ namespace GamecraftModdingAPI.Blocks SunLight, AmbientLight, UnlitGlowCube = 381, + PointLightInvisible, + SpotLightInvisible, + UnlitSlope, + UnlitGlowSlope, MagmaRockCube = 777, MagmaRockCubeSliced, MagmaRockSlope, diff --git a/GamecraftModdingAPI/Player.cs b/GamecraftModdingAPI/Player.cs index 40dd385..a4b7064 100644 --- a/GamecraftModdingAPI/Player.cs +++ b/GamecraftModdingAPI/Player.cs @@ -17,6 +17,7 @@ namespace GamecraftModdingAPI { // static functionality private static PlayerEngine playerEngine = new PlayerEngine(); + private static Player localPlayer; /// /// Checks if the specified player exists. @@ -54,6 +55,19 @@ namespace GamecraftModdingAPI return (uint) playerEngine.GetAllPlayerCount(); } + /// + /// Returns the current player belonging to this client. + /// + public static Player LocalPlayer + { + get + { + if (localPlayer == null || localPlayer.Id != playerEngine.GetLocalPlayer()) + localPlayer = new Player(PlayerType.Local); + return localPlayer; + } + } + /// /// Initializes a new instance of the class. /// -- 2.30.2 From 64aace3bdec62ffffd303f5d7a761bb835871045 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Fri, 2 Oct 2020 01:54:59 +0200 Subject: [PATCH 113/252] Remove ScalingEngine.Setup() and add object ID to dict --- GamecraftModdingAPI/Block.cs | 5 +---- GamecraftModdingAPI/Blocks/ScalingEngine.cs | 9 +++------ GamecraftModdingAPI/Events/GameActivatedComposePatch.cs | 2 -- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index f827e09..f63e96c 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -120,6 +120,7 @@ namespace GamecraftModdingAPI {typeof(LogicGate), new [] {CommonExclusiveGroups.BUILD_LOGIC_BLOCK_GROUP}}, {typeof(Motor), new[] {CommonExclusiveGroups.BUILD_MOTOR_BLOCK_GROUP}}, {typeof(MusicBlock), new[] {CommonExclusiveGroups.BUILD_MUSIC_BLOCK_GROUP}}, + {typeof(ObjectIdentifier), new[]{CommonExclusiveGroups.BUILD_OBJID_BLOCK_GROUP}}, {typeof(Piston), new[] {CommonExclusiveGroups.BUILD_PISTON_BLOCK_GROUP}}, {typeof(Servo), new[] {CommonExclusiveGroups.BUILD_SERVO_BLOCK_GROUP}}, { @@ -460,9 +461,5 @@ namespace GamecraftModdingAPI } } #endif - internal static void Setup(World physicsWorld) - { - ScalingEngine.Setup(physicsWorld.EntityManager); - } } } \ No newline at end of file diff --git a/GamecraftModdingAPI/Blocks/ScalingEngine.cs b/GamecraftModdingAPI/Blocks/ScalingEngine.cs index a531865..fcbf900 100644 --- a/GamecraftModdingAPI/Blocks/ScalingEngine.cs +++ b/GamecraftModdingAPI/Blocks/ScalingEngine.cs @@ -27,10 +27,12 @@ namespace GamecraftModdingAPI.Blocks public string Name { get; } = "GamecraftModdingAPIScalingEngine"; public bool isRemovable { get; } = false; - private static EntityManager _entityManager; //Unity entity manager + private EntityManager _entityManager; //Unity entity manager public void UpdateCollision(EGID egid) { + if (_entityManager == default) + _entityManager = FullGameFields._physicsWorld.EntityManager; //Assuming the block exists var entity = entitiesDB.QueryEntity(egid).uecsEntity; var pes = new UECSPhysicsEntityCreationStruct(); @@ -38,11 +40,6 @@ namespace GamecraftModdingAPI.Blocks _entityManager.DestroyEntity(entity); } - internal void Setup(EntityManager entityManager) - { - _entityManager = entityManager; - } - [HarmonyPatch] public class PhysicsEnginePatch { diff --git a/GamecraftModdingAPI/Events/GameActivatedComposePatch.cs b/GamecraftModdingAPI/Events/GameActivatedComposePatch.cs index 4142fb3..c3a5fb5 100644 --- a/GamecraftModdingAPI/Events/GameActivatedComposePatch.cs +++ b/GamecraftModdingAPI/Events/GameActivatedComposePatch.cs @@ -31,8 +31,6 @@ namespace GamecraftModdingAPI.Events GameEngineManager.RegisterEngines(enginesRoot); // initialize AsyncUtils AsyncUtils.Setup(enginesRoot); - // initialize Block - Block.Setup(physicsWorld); // A new EnginesRoot is always created when ActivateGame is called // so all event emitters and handlers must be re-registered. EventManager.RegisterEngines(enginesRoot); -- 2.30.2 From abbb83da26e0a2899b128b29f44f84d33e16ac4e Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Fri, 2 Oct 2020 16:40:06 +0200 Subject: [PATCH 114/252] Chunk and cluster fixes and improvements & bump version Added Cluster.GetSimBodies() and SimBody.GetBlocks() Fixed some issues with IDs and bad handling of them --- GamecraftModdingAPI/Block.cs | 6 ++-- GamecraftModdingAPI/Blocks/BlockEngine.cs | 22 +++++++++++-- GamecraftModdingAPI/Cluster.cs | 33 +++++++++++++++++++ .../GamecraftModdingAPI.csproj | 6 +--- GamecraftModdingAPI/SimBody.cs | 14 ++++++-- 5 files changed, 69 insertions(+), 12 deletions(-) diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index f63e96c..186bf8d 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -372,11 +372,13 @@ namespace GamecraftModdingAPI /// Returns the rigid body of the chunk of blocks this one belongs to during simulation. /// Can be used to apply forces or move the block around while the simulation is running. /// - /// The SimBody of the chunk or null if the block doesn't exist. + /// The SimBody of the chunk or null if the block doesn't exist or not in simulation mode. public SimBody GetSimBody() { return BlockEngine.GetBlockInfo(this, - (GridConnectionsEntityStruct st) => new SimBody(st.machineRigidBodyId, st.clusterId)); + (GridConnectionsEntityStruct st) => st.machineRigidBodyId != uint.MaxValue + ? new SimBody(st.machineRigidBodyId, st.clusterId) + : null); } private void OnPlacedInit(object sender, BlockPlacedRemovedEventArgs e) diff --git a/GamecraftModdingAPI/Blocks/BlockEngine.cs b/GamecraftModdingAPI/Blocks/BlockEngine.cs index 3a979fe..929a65f 100644 --- a/GamecraftModdingAPI/Blocks/BlockEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlockEngine.cs @@ -218,7 +218,7 @@ namespace GamecraftModdingAPI.Blocks } } - return bodies.Select(id => new SimBody(id)).ToArray(); + return bodies.Select(id => new SimBody(id, cid)).ToArray(); } public EGID? FindBlockEGID(uint id) @@ -239,8 +239,8 @@ namespace GamecraftModdingAPI.Blocks foreach (var (coll, _) in groups) { foreach (var conn in coll) - { - if (conn.machineRigidBodyId == sbid) + { //Static blocks don't have a cluster ID but the cluster destruction manager should have one + if (conn.machineRigidBodyId == sbid && conn.clusterId != uint.MaxValue) return new Cluster(conn.clusterId); } } @@ -248,6 +248,22 @@ namespace GamecraftModdingAPI.Blocks return null; } + public Block[] GetBodyBlocks(uint sbid) + { + var groups = entitiesDB.QueryEntities(); + var set = new HashSet(); + foreach (var (coll, _) in groups) + { + foreach (var conn in coll) + { + if (conn.machineRigidBodyId == sbid) + set.Add(new Block(conn.ID)); + } + } + + return set.ToArray(); + } + #if DEBUG public EntitiesDB GetEntitiesDB() { diff --git a/GamecraftModdingAPI/Cluster.cs b/GamecraftModdingAPI/Cluster.cs index 074c26c..79b5822 100644 --- a/GamecraftModdingAPI/Cluster.cs +++ b/GamecraftModdingAPI/Cluster.cs @@ -6,6 +6,7 @@ namespace GamecraftModdingAPI { /// /// Represnts a cluster of blocks in time running mode, meaning blocks that are connected either directly or via joints. + /// Only exists if a cluster destruction manager is present. Static blocks like grass and dirt aren't part of a cluster. /// public class Cluster { @@ -37,5 +38,37 @@ namespace GamecraftModdingAPI get => Block.BlockEngine.GetBlockInfo(Id).healthMultiplier; set => Block.BlockEngine.GetBlockInfo(Id).healthMultiplier = value; } + + /// + /// Returns the simulation-time rigid bodies for the chunks in this cluster. + /// + /// An array of sim-bodies + public SimBody[] GetSimBodies() + { + return Block.BlockEngine.GetClusterBodies(Id.entityID); + } + + public override string ToString() + { + return $"{nameof(Id)}: {Id}"; + } + + protected bool Equals(Cluster other) + { + return Id.Equals(other.Id); + } + + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != this.GetType()) return false; + return Equals((Cluster) obj); + } + + public override int GetHashCode() + { + return Id.GetHashCode(); + } } } \ No newline at end of file diff --git a/GamecraftModdingAPI/GamecraftModdingAPI.csproj b/GamecraftModdingAPI/GamecraftModdingAPI.csproj index 8be57a7..c6a0f99 100644 --- a/GamecraftModdingAPI/GamecraftModdingAPI.csproj +++ b/GamecraftModdingAPI/GamecraftModdingAPI.csproj @@ -2,7 +2,7 @@ net472 true - 1.5.0 + 1.6.0 Exmods GNU General Public Licence 3+ https://git.exmods.org/modtainers/GamecraftModdingAPI @@ -445,10 +445,6 @@ ..\ref\Gamecraft_Data\Managed\RobocraftX_TextBlock.dll ..\..\ref\Gamecraft_Data\Managed\RobocraftX_TextBlock.dll - - ..\ref\Gamecraft_Data\Managed\RobocratX.SimulationCompositionRoot.dll - ..\..\ref\Gamecraft_Data\Managed\RobocratX.SimulationCompositionRoot.dll - ..\ref\Gamecraft_Data\Managed\SpawningPointCompositionRoot.dll ..\..\ref\Gamecraft_Data\Managed\SpawningPointCompositionRoot.dll diff --git a/GamecraftModdingAPI/SimBody.cs b/GamecraftModdingAPI/SimBody.cs index a3f6d55..42812d9 100644 --- a/GamecraftModdingAPI/SimBody.cs +++ b/GamecraftModdingAPI/SimBody.cs @@ -17,12 +17,13 @@ namespace GamecraftModdingAPI public EGID Id { get; } /// - /// The cluster this chunk belongs to, or null if the chunk doesn't exist. Get the SimBody from a Block if possible for good performance here. + /// The cluster this chunk belongs to, or null if no cluster destruction manager present or the chunk doesn't exist. + /// Get the SimBody from a Block if possible for good performance here. /// public Cluster Cluster => cluster ?? (cluster = clusterId == uint.MaxValue ? Block.BlockEngine.GetCluster(Id.entityID) : new Cluster(clusterId)); private Cluster cluster; - private uint clusterId; + private readonly uint clusterId = uint.MaxValue; public SimBody(EGID id) { @@ -120,6 +121,15 @@ namespace GamecraftModdingAPI return Block.BlockEngine.GetConnectedSimBodies(Id.entityID); } + /// + /// The blocks that form this rigid body. + /// + /// + public Block[] GetBlocks() + { + return Block.BlockEngine.GetBodyBlocks(Id.entityID); + } + private ref RigidBodyEntityStruct GetStruct() { return ref Block.BlockEngine.GetBlockInfo(Id); -- 2.30.2 From 4701b3577dc54cac8ee638a0d3ffc5c18ecf8f82 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Fri, 2 Oct 2020 17:06:06 +0200 Subject: [PATCH 115/252] Make BlockColor.Index a property and other fixes --- GamecraftModdingAPI/Blocks/BlockColor.cs | 9 ++++----- GamecraftModdingAPI/Blocks/TextBlock.cs | 3 ++- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/GamecraftModdingAPI/Blocks/BlockColor.cs b/GamecraftModdingAPI/Blocks/BlockColor.cs index 46a5dc4..bf22090 100644 --- a/GamecraftModdingAPI/Blocks/BlockColor.cs +++ b/GamecraftModdingAPI/Blocks/BlockColor.cs @@ -7,7 +7,10 @@ namespace GamecraftModdingAPI.Blocks { public BlockColors Color; public byte Darkness; - public byte Index; + + public byte Index => Color == BlockColors.Default + ? byte.MaxValue + : (byte) (Darkness * 10 + Color); public BlockColor(byte index) { @@ -23,8 +26,6 @@ namespace GamecraftModdingAPI.Blocks Color = (BlockColors) (index % 10); Darkness = (byte) (index / 10); } - - Index = index; } public BlockColor(BlockColors color, byte darkness) @@ -33,8 +34,6 @@ namespace GamecraftModdingAPI.Blocks throw new ArgumentOutOfRangeException(nameof(darkness), "Darkness must be 0-9 where 0 is default."); Color = color; Darkness = darkness; - if (color == BlockColors.Default) Index = byte.MaxValue; - else Index = (byte) (darkness * 10 + color); } public float4 RGBA => Block.BlockEngine.ConvertBlockColor(Index); diff --git a/GamecraftModdingAPI/Blocks/TextBlock.cs b/GamecraftModdingAPI/Blocks/TextBlock.cs index ea5e089..895494d 100644 --- a/GamecraftModdingAPI/Blocks/TextBlock.cs +++ b/GamecraftModdingAPI/Blocks/TextBlock.cs @@ -31,9 +31,9 @@ namespace GamecraftModdingAPI.Blocks set { + if (value == null) value = ""; BlockEngine.SetBlockInfo(this, (ref TextBlockDataStruct tbds, string val) => { - if (val == null) val = ""; tbds.textCurrent.Set(val); tbds.textStored.Set(val); }, value); @@ -51,6 +51,7 @@ namespace GamecraftModdingAPI.Blocks set { + if (value == null) value = ""; BlockEngine.SetBlockInfo(this, (ref TextBlockDataStruct tbds, string val) => tbds.textBlockID.Set(val), value); BlockEngine.SetBlockInfo(this, -- 2.30.2 From b0b496f22f40d0ff4a841cb77de2062c4072b58c Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Thu, 22 Oct 2020 02:34:59 +0200 Subject: [PATCH 116/252] Fix ConcurrentModificationException and some attempts --- GamecraftModdingAPI/Blocks/CustomBlock.cs | 170 ++++++++++++------ .../GamecraftModdingAPI.csproj | 4 + 2 files changed, 122 insertions(+), 52 deletions(-) diff --git a/GamecraftModdingAPI/Blocks/CustomBlock.cs b/GamecraftModdingAPI/Blocks/CustomBlock.cs index bc67fe9..b960101 100644 --- a/GamecraftModdingAPI/Blocks/CustomBlock.cs +++ b/GamecraftModdingAPI/Blocks/CustomBlock.cs @@ -9,13 +9,21 @@ using DataLoader; using GamecraftModdingAPI.Utility; using GPUInstancer; using HarmonyLib; +using RobocraftX.Blocks.Ghost; using RobocraftX.Common; using RobocraftX.Schedulers; +using Svelto.DataStructures; +using Svelto.ECS.Extensions.Unity; using Svelto.Tasks; using Svelto.Tasks.ExtraLean; using Unity.Entities; +using Unity.Entities.Conversion; +using Unity.Physics; using UnityEngine; using UnityEngine.AddressableAssets; +using BoxCollider = UnityEngine.BoxCollider; +using Collider = UnityEngine.Collider; +using Material = UnityEngine.Material; namespace GamecraftModdingAPI.Blocks { @@ -106,7 +114,116 @@ namespace GamecraftModdingAPI.Blocks /*var res = Addressables.LoadContentCatalogAsync("customCatalog.json"); while (!res.IsDone) yield return Yield.It;*/ + } + public static MethodBase TargetMethod() + { //General block registration + return AccessTools.Method("RobocraftX.Blocks.BlocksCompositionRoot:RegisterPartPrefabs"); + } + } + + [HarmonyPatch] + public static class RendererPatch + { + private static Material[] materials; + public static void Prefix(uint prefabID, GameObject gameObject) + { + Console.WriteLine("ID: " + prefabID + " - Name: " + gameObject.name); + if (gameObject.name == "Cube") + { + //Console.WriteLine("Length: " + gameObject.GetComponentsInChildren().Length); + if (materials != null) + gameObject.GetComponentsInChildren()[0].sharedMaterials = materials; + ECSGPUIResourceManager.Instance.RegisterRuntimePrefabs( + new[] {new PrefabData {prefabId = prefabID, prefabName = "Assets/Prefabs/Cube.prefab"}}, + new List {gameObject}).Complete(); + GPUInstancerAPI.AddInstancesToPrefabPrototypeAtRuntime(ECSGPUIResourceManager.Instance.prefabManager, + gameObject.GetComponent().prefabPrototype, new[] {gameObject}); + Console.WriteLine("Registered prefab to instancer"); + + /*var register = AccessTools.Method("RobocraftX.Common.ECSPhysicResourceManager:RegisterPrefab", + new[] {typeof(uint), typeof(GameObject), typeof(World), typeof(BlobAssetStore)}); + register.Invoke(ECSPhysicResourceManager.Instance, + new object[] {prefabID, gameObject, MGPatch.data.Item1, MGPatch.data.Item2});*/ + /*Console.WriteLine( + "Entity: " + ECSPhysicResourceManager.Instance.GetUECSPhysicEntityPrefab(prefabID)); + Console.WriteLine("Prefab ID: " + PrefabsID.DBIDMAP[500]); + PhysicsCollider componentData = MGPatch.data.Item1.EntityManager.GetComponentData(ECSPhysicResourceManager.Instance.GetUECSPhysicEntityPrefab(prefabID)); + Console.WriteLine("Collider valid: " + componentData.IsValid); + unsafe + { + Console.WriteLine("Collider type: " + componentData.ColliderPtr->Type); + CollisionFilter filter = componentData.Value.Value.Filter; + Console.WriteLine("Filter not empty: " + !filter.IsEmpty); + }*/ + //MGPatch.data.Item1.EntityManager.GetComponentData<>() + gameObject.AddComponent(); + gameObject.AddComponent(); + Console.WriteLine("Registered prefab to physics"); + } + else if (gameObject.name == "CTR_CommandBlock") + materials = gameObject.GetComponentsInChildren()[0].sharedMaterials; + } + + public static MethodBase TargetMethod() + { + return AccessTools.Method("RobocraftX.Common.ECSGPUIResourceManager:RegisterPrefab", + new[] {typeof(uint), typeof(GameObject)}); + } + } + + [HarmonyPatch] + public static class RMPatch + { + public static void Prefix(World physicsWorld, + GameObjectConversionSystem getExistingSystem, + FasterList gos, + List prefabData) + { + for (var index = 0; index < prefabData.Count; index++) + { + var data = prefabData[index]; + if (!data.prefabName.EndsWith("Cube.prefab")) continue; + //getExistingSystem.DeclareLinkedEntityGroup(gos[index]); + /*Entity entity = GameObjectConversionUtility.ConvertGameObjectHierarchy(gos[index], + GameObjectConversionSettings.FromWorld(physicsWorld, MGPatch.data.Item2));*/ + Console.WriteLine("Transform: " + gos[index].transform.childCount); + Entity primaryEntity = getExistingSystem.GetPrimaryEntity(gos[index]); + MultiListEnumerator entities = getExistingSystem.GetEntities(gos[index]); + Console.WriteLine("ID: " + data.prefabId + " - Name: " + data.prefabName); + Console.WriteLine("Primary entity: " + primaryEntity); + EntityManager entityManager = physicsWorld.EntityManager; + Console.WriteLine("Has collider: " + entityManager.HasComponent(primaryEntity)); + while (entities.MoveNext()) + { + Entity current = entities.Current; + Console.WriteLine("Entity " + current + " has collider: " + + entityManager.HasComponent(current)); + } + } + } + + public static MethodBase TargetMethod() + { + return AccessTools.Method("RobocraftX.Common.ECSResourceManagerUtility:RelinkEntities", + new[] + { + typeof(World), + typeof(GameObjectConversionSystem), + typeof(FasterList), + typeof(List) + }); + } + } + + [HarmonyPatch] + public static class MGPatch + { + internal static (World, BlobAssetStore) data; + public static void Prefix(World physicsWorld, BlobAssetStore blobStore, IDataDB dataDB) + { + data = (physicsWorld, blobStore); + var blocks = dataDB.GetValues(); blocks.Add("modded_ConsoleBlock", new CubeListData { cubeType = CubeType.Block, @@ -123,57 +240,6 @@ namespace GamecraftModdingAPI.Blocks }); } - public static MethodBase TargetMethod() - { //General block registration - return AccessTools.Method("RobocraftX.Blocks.BlocksCompositionRoot:RegisterPartPrefabs"); - } - } - - [HarmonyPatch] - public static class GOPatch - { - private static Material[] materials; - public static void Prefix(uint prefabID, GameObject gameObject) - { - Console.WriteLine("ID: " + prefabID + " - Name: " + gameObject.name); - if (gameObject.name == "Cube") - { - //Console.WriteLine("Length: " + gameObject.GetComponentsInChildren().Length); - if (materials != null) - gameObject.GetComponentsInChildren()[0].sharedMaterials = materials; - ECSGPUIResourceManager.Instance.RegisterRuntimePrefabs( - new[] {new PrefabData {prefabId = 500, prefabName = "Assets/Prefabs/Cube.prefab"}}, - new List {gameObject}).Complete(); - GPUInstancerAPI.AddInstancesToPrefabPrototypeAtRuntime(ECSGPUIResourceManager.Instance.prefabManager, - gameObject.GetComponent().prefabPrototype, new[] {gameObject}); - Console.WriteLine("Registered prefab to instancer"); - - var register = AccessTools.Method("RobocraftX.Common.ECSPhysicResourceManager:RegisterPrefab", - new[] {typeof(uint), typeof(GameObject), typeof(World), typeof(BlobAssetStore)}); - register.Invoke(ECSPhysicResourceManager.Instance, - new object[] {prefabID, gameObject, MGPatch.data.Item1, MGPatch.data.Item2}); - Console.WriteLine("Registered prefab to physics"); - } - else if (gameObject.name == "CTR_CommandBlock") - materials = gameObject.GetComponentsInChildren()[0].sharedMaterials; - } - - public static MethodBase TargetMethod() - { - return AccessTools.Method("RobocraftX.Common.ECSGPUIResourceManager:RegisterPrefab", - new[] {typeof(uint), typeof(GameObject)}); - } - } - - [HarmonyPatch] - public static class MGPatch - { - internal static (World, BlobAssetStore) data; - public static void Prefix(World physicsWorld, BlobAssetStore blobStore) - { - data = (physicsWorld, blobStore); - } - public static MethodBase TargetMethod() { return AccessTools.Method("RobocraftX.CR.MainGame.MainGameCompositionRoot:Init"); @@ -181,7 +247,7 @@ namespace GamecraftModdingAPI.Blocks } public static IEnumerator Prep() - { + { //TODO: Don't let the game load until this finishes Console.WriteLine("Loading custom catalog..."); var res = Addressables.LoadContentCatalogAsync("customCatalog.json"); while (!res.IsDone) yield return Yield.It; diff --git a/GamecraftModdingAPI/GamecraftModdingAPI.csproj b/GamecraftModdingAPI/GamecraftModdingAPI.csproj index 8be57a7..ee28a68 100644 --- a/GamecraftModdingAPI/GamecraftModdingAPI.csproj +++ b/GamecraftModdingAPI/GamecraftModdingAPI.csproj @@ -113,6 +113,10 @@ ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.GenericPhysicsBlocks.dll ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.GenericPhysicsBlocks.dll + + ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.LightBlock.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.LightBlock.dll + ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.LogicBlock.dll ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.LogicBlock.dll -- 2.30.2 From c6a1ea35cc946eb1456326f21ef5c73d51845588 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Tue, 27 Oct 2020 11:59:21 -0400 Subject: [PATCH 117/252] Add damped spring --- GamecraftModdingAPI/Block.cs | 1 + GamecraftModdingAPI/Blocks/DampedSpring.cs | 48 + .../GamecraftModdingAPI.csproj | 1267 +++++++++-------- 3 files changed, 691 insertions(+), 625 deletions(-) create mode 100644 GamecraftModdingAPI/Blocks/DampedSpring.cs diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index 186bf8d..408304d 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -139,6 +139,7 @@ namespace GamecraftModdingAPI CommonExclusiveGroups.BUILD_LOOPEDSFX_BLOCK_GROUP } }, + {typeof(DampedSpring), new [] {CommonExclusiveGroups.BUILD_DAMPEDSPRING_BLOCK_GROUP}}, {typeof(TextBlock), new[] {CommonExclusiveGroups.BUILD_TEXT_BLOCK_GROUP}}, {typeof(Timer), new[] {CommonExclusiveGroups.BUILD_TIMER_BLOCK_GROUP}} }; diff --git a/GamecraftModdingAPI/Blocks/DampedSpring.cs b/GamecraftModdingAPI/Blocks/DampedSpring.cs new file mode 100644 index 0000000..96e628d --- /dev/null +++ b/GamecraftModdingAPI/Blocks/DampedSpring.cs @@ -0,0 +1,48 @@ +using RobocraftX.Blocks; +using RobocraftX.Common; +using Svelto.ECS; + +namespace GamecraftModdingAPI.Blocks +{ + public class DampedSpring : Block + { + public DampedSpring(EGID id) : base(id) + { + } + + public DampedSpring(uint id) : base(new EGID(id, CommonExclusiveGroups.BUILD_DAMPEDSPRING_BLOCK_GROUP)) + { + } + + /// + /// The spring's maximum force. This is known as Stiffness in-game + /// + public float MaxForce + { + get => BlockEngine.GetBlockInfo(this, (DampedSpringReadOnlyStruct dsrs) => dsrs.maxForce); + + set => BlockEngine.SetBlockInfo(this, + (ref DampedSpringReadOnlyStruct dsrs, float val) => dsrs.maxForce = val, value); + } + + /// + /// Alias of MaxForce. + /// + public float Stiffness + { + get => MaxForce; + set => MaxForce = value; + } + + /// + /// The spring's maximum damping force. + /// + public float Damping + { + get => BlockEngine.GetBlockInfo(this, (LinearJointForcesReadOnlyStruct ljf) => ljf.dampingForceMagnitude); + + set => BlockEngine.SetBlockInfo(this, + (ref LinearJointForcesReadOnlyStruct ljf, float val) => ljf.dampingForceMagnitude = val, value); + } + } +} \ No newline at end of file diff --git a/GamecraftModdingAPI/GamecraftModdingAPI.csproj b/GamecraftModdingAPI/GamecraftModdingAPI.csproj index c6a0f99..88d16f8 100644 --- a/GamecraftModdingAPI/GamecraftModdingAPI.csproj +++ b/GamecraftModdingAPI/GamecraftModdingAPI.csproj @@ -2,7 +2,7 @@ net472 true - 1.6.0 + 1.7.0 Exmods GNU General Public Licence 3+ https://git.exmods.org/modtainers/GamecraftModdingAPI @@ -23,6 +23,7 @@ + @@ -33,630 +34,6 @@ ..\ref\Gamecraft_Data\Managed\IllusionPlugin.dll ..\..\ref\Gamecraft_Data\Managed\IllusionPlugin.dll - - ..\ref\Gamecraft_Data\Managed\Analytics.dll - ..\..\ref\Gamecraft_Data\Managed\Analytics.dll - - - ..\ref\Gamecraft_Data\Managed\Assembly-CSharp-firstpass.dll - ..\..\ref\Gamecraft_Data\Managed\Assembly-CSharp-firstpass.dll - - - ..\ref\Gamecraft_Data\Managed\Assembly-CSharp.dll - ..\..\ref\Gamecraft_Data\Managed\Assembly-CSharp.dll - - - ..\ref\Gamecraft_Data\Managed\Authentication.dll - ..\..\ref\Gamecraft_Data\Managed\Authentication.dll - - - ..\ref\Gamecraft_Data\Managed\Blocks.HUDFeedbackBlocks.dll - ..\..\ref\Gamecraft_Data\Managed\Blocks.HUDFeedbackBlocks.dll - - - ..\ref\Gamecraft_Data\Managed\CommandLine.dll - ..\..\ref\Gamecraft_Data\Managed\CommandLine.dll - - - ..\ref\Gamecraft_Data\Managed\CommandLineCompositionRoot.dll - ..\..\ref\Gamecraft_Data\Managed\CommandLineCompositionRoot.dll - - - ..\ref\Gamecraft_Data\Managed\ConsoleBlockComposotionRoot.dll - ..\..\ref\Gamecraft_Data\Managed\ConsoleBlockComposotionRoot.dll - - - ..\ref\Gamecraft_Data\Managed\ConsoleCommand.dll - ..\..\ref\Gamecraft_Data\Managed\ConsoleCommand.dll - - - ..\ref\Gamecraft_Data\Managed\DataLoader.dll - ..\..\ref\Gamecraft_Data\Managed\DataLoader.dll - - - ..\ref\Gamecraft_Data\Managed\DDNA.dll - ..\..\ref\Gamecraft_Data\Managed\DDNA.dll - - - ..\ref\Gamecraft_Data\Managed\FMOD.dll - ..\..\ref\Gamecraft_Data\Managed\FMOD.dll - - - ..\ref\Gamecraft_Data\Managed\FullGame.dll - ..\..\ref\Gamecraft_Data\Managed\FullGame.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.AudioBlocks.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.AudioBlocks.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.BlockCompositionRoot.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.BlockCompositionRoot.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.BlockEntityFactory.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.BlockEntityFactory.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.ConsoleBlock.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.ConsoleBlock.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.DamagingSurfaceBlock.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.DamagingSurfaceBlock.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.DestructionBlocks.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.DestructionBlocks.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.GenericPhysicsBlocks.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.GenericPhysicsBlocks.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.LogicBlock.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.LogicBlock.dll - - - ..\ref\Gamecraft_Data\Managed\GameCraft.Blocks.ProjectileBlock.dll - ..\..\ref\Gamecraft_Data\Managed\GameCraft.Blocks.ProjectileBlock.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.TextBlock.CompositionRoot.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.TextBlock.CompositionRoot.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.TimerBlock.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.TimerBlock.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.CharacterVulnerability.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.CharacterVulnerability.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.CharacterVulnerabilityGui.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.CharacterVulnerabilityGui.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.Damage.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Damage.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.Effects.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Effects.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.ExplosionFragments.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.ExplosionFragments.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.GraphicsSettings.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GraphicsSettings.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.ConsoleBlock.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.ConsoleBlock.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.HUDFeedbackBlocks.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.HUDFeedbackBlocks.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Tweaks.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Tweaks.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Wires.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Wires.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Wires.Mockup.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Wires.Mockup.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.InventoryTimeRunning.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.InventoryTimeRunning.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.JointBlocks.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.JointBlocks.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.Music.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Music.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.PerformanceWarnings.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.PerformanceWarnings.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.PickupBlck.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.PickupBlck.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.PickupsCommon.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.PickupsCommon.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.PopupMessage.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.PopupMessage.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.Projectiles.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Projectiles.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.Tweaks.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Tweaks.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.Tweaks.Mockup.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Tweaks.Mockup.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.VisualEffects.Decals.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.VisualEffects.Decals.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.VisualEffects.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.VisualEffects.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.Wires.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Wires.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.Wires.Mockup.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Wires.Mockup.dll - - - ..\ref\Gamecraft_Data\Managed\GameState.dll - ..\..\ref\Gamecraft_Data\Managed\GameState.dll - - - ..\ref\Gamecraft_Data\Managed\GPUInstancer.dll - ..\..\ref\Gamecraft_Data\Managed\GPUInstancer.dll - - - ..\ref\Gamecraft_Data\Managed\Havok.Physics.dll - ..\..\ref\Gamecraft_Data\Managed\Havok.Physics.dll - - - ..\ref\Gamecraft_Data\Managed\Havok.Physics.Hybrid.dll - ..\..\ref\Gamecraft_Data\Managed\Havok.Physics.Hybrid.dll - - - ..\ref\Gamecraft_Data\Managed\LZ4.dll - ..\..\ref\Gamecraft_Data\Managed\LZ4.dll - - - ..\ref\Gamecraft_Data\Managed\MultiplayerNetworking.dll - ..\..\ref\Gamecraft_Data\Managed\MultiplayerNetworking.dll - - - ..\ref\Gamecraft_Data\Managed\MultiplayerTest.dll - ..\..\ref\Gamecraft_Data\Managed\MultiplayerTest.dll - - - ..\ref\Gamecraft_Data\Managed\RCX.ScreenshotTaker.dll - ..\..\ref\Gamecraft_Data\Managed\RCX.ScreenshotTaker.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftECS.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftECS.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.AccountPreferences.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.AccountPreferences.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Blocks.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Blocks.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Blocks.Ghost.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Blocks.Ghost.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Blocks.Triggers.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Blocks.Triggers.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Building.BoxSelect.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Building.BoxSelect.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Building.Jobs.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Building.Jobs.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Character.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Character.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.ClusterToWireConversion.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.ClusterToWireConversion.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Common.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Common.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.ControlsScreen.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.ControlsScreen.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Crosshair.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Crosshair.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.FrontEnd.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.FrontEnd.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.BlockLabel.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.BlockLabel.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.DebugDisplay.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.DebugDisplay.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.RemoveBlock.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.RemoveBlock.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.ScaleGhost.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.ScaleGhost.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.GUIs.WorkshopPrefabs.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUIs.WorkshopPrefabs.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Input.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Input.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.MachineEditor.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.MachineEditor.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.MainGame.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.MainGame.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.MainSimulation.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.MainSimulation.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.MockCharacter.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.MockCharacter.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Multiplayer.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Multiplayer.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.MultiplayerInput.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.MultiplayerInput.dll - - - ..\ref\Gamecraft_Data\Managed\Robocraftx.ObjectIdBlocks.dll - ..\..\ref\Gamecraft_Data\Managed\Robocraftx.ObjectIdBlocks.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Party.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Party.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.PartyGui.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.PartyGui.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Physics.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Physics.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.PilotSeat.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.PilotSeat.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Player.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Player.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Rendering.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Rendering.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Rendering.Mock.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Rendering.Mock.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.SaveAndLoad.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.SaveAndLoad.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.SaveGameDialog.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.SaveGameDialog.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Serializers.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Serializers.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Services.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Services.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.SignalHandling.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.SignalHandling.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.StateSync.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.StateSync.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX_SpawnPoints.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX_SpawnPoints.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX_TextBlock.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX_TextBlock.dll - - - ..\ref\Gamecraft_Data\Managed\SpawningPointCompositionRoot.dll - ..\..\ref\Gamecraft_Data\Managed\SpawningPointCompositionRoot.dll - - - ..\ref\Gamecraft_Data\Managed\SpecializedDescriptors.dll - ..\..\ref\Gamecraft_Data\Managed\SpecializedDescriptors.dll - - - ..\ref\Gamecraft_Data\Managed\StringFormatter.dll - ..\..\ref\Gamecraft_Data\Managed\StringFormatter.dll - - - ..\ref\Gamecraft_Data\Managed\Svelto.Common_3.dll - ..\..\ref\Gamecraft_Data\Managed\Svelto.Common_3.dll - - - ..\ref\Gamecraft_Data\Managed\Svelto.ECS.dll - ..\..\ref\Gamecraft_Data\Managed\Svelto.ECS.dll - - - ..\ref\Gamecraft_Data\Managed\Svelto.Services.dll - ..\..\ref\Gamecraft_Data\Managed\Svelto.Services.dll - - - ..\ref\Gamecraft_Data\Managed\Svelto.Tasks.dll - ..\..\ref\Gamecraft_Data\Managed\Svelto.Tasks.dll - - - ..\ref\Gamecraft_Data\Managed\UltimateDecals.dll - ..\..\ref\Gamecraft_Data\Managed\UltimateDecals.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Addressables.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Addressables.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Animation.Curves.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Animation.Curves.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Animation.Curves.Hybrid.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Animation.Curves.Hybrid.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Animation.DefaultGraphPipeline.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Animation.DefaultGraphPipeline.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Animation.DefaultGraphPipeline.Hybrid.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Animation.DefaultGraphPipeline.Hybrid.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Animation.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Animation.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Animation.Graph.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Animation.Graph.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Animation.Hybrid.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Animation.Hybrid.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Build.SlimPlayerRuntime.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Build.SlimPlayerRuntime.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Burst.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Burst.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Collections.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Collections.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.DataFlowGraph.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.DataFlowGraph.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Deformations.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Deformations.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Entities.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Entities.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Entities.Hybrid.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Entities.Hybrid.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Jobs.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Jobs.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Mathematics.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Mathematics.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Mathematics.Extensions.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Mathematics.Extensions.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.MemoryProfiler.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.MemoryProfiler.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Physics.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Physics.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Physics.Hybrid.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Physics.Hybrid.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Platforms.Common.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Platforms.Common.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Postprocessing.Runtime.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Postprocessing.Runtime.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Properties.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Properties.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Properties.Reflection.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Properties.Reflection.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Properties.UI.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Properties.UI.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.RenderPipeline.Universal.ShaderLibrary.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipeline.Universal.ShaderLibrary.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Universal.Runtime.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Universal.Runtime.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Universal.Shaders.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Universal.Shaders.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.ResourceManager.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.ResourceManager.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Scenes.Hybrid.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Scenes.Hybrid.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.ScriptableBuildPipeline.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.ScriptableBuildPipeline.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Serialization.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Serialization.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.TextMeshPro.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.TextMeshPro.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Timeline.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Timeline.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Transforms.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Transforms.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Transforms.Hybrid.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Transforms.Hybrid.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.VisualEffectGraph.Runtime.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.VisualEffectGraph.Runtime.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.UI.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UI.dll - - - ..\ref\Gamecraft_Data\Managed\uREPL.dll - ..\..\ref\Gamecraft_Data\Managed\uREPL.dll - - - ..\ref\Gamecraft_Data\Managed\VisualProfiler.dll - ..\..\ref\Gamecraft_Data\Managed\VisualProfiler.dll - ..\ref\Gamecraft_Data\Managed\Accessibility.dll ..\..\ref\Gamecraft_Data\Managed\Accessibility.dll @@ -937,6 +314,646 @@ ..\ref\Gamecraft_Data\Managed\UnityEngine.XRModule.dll ..\..\ref\Gamecraft_Data\Managed\UnityEngine.XRModule.dll + + ..\ref\Gamecraft_Data\Managed\Analytics.dll + ..\..\ref\Gamecraft_Data\Managed\Analytics.dll + + + ..\ref\Gamecraft_Data\Managed\Assembly-CSharp-firstpass.dll + ..\..\ref\Gamecraft_Data\Managed\Assembly-CSharp-firstpass.dll + + + ..\ref\Gamecraft_Data\Managed\Assembly-CSharp.dll + ..\..\ref\Gamecraft_Data\Managed\Assembly-CSharp.dll + + + ..\ref\Gamecraft_Data\Managed\Authentication.dll + ..\..\ref\Gamecraft_Data\Managed\Authentication.dll + + + ..\ref\Gamecraft_Data\Managed\Blocks.HUDFeedbackBlocks.dll + ..\..\ref\Gamecraft_Data\Managed\Blocks.HUDFeedbackBlocks.dll + + + ..\ref\Gamecraft_Data\Managed\CommandLine.dll + ..\..\ref\Gamecraft_Data\Managed\CommandLine.dll + + + ..\ref\Gamecraft_Data\Managed\CommandLineCompositionRoot.dll + ..\..\ref\Gamecraft_Data\Managed\CommandLineCompositionRoot.dll + + + ..\ref\Gamecraft_Data\Managed\ConsoleBlockComposotionRoot.dll + ..\..\ref\Gamecraft_Data\Managed\ConsoleBlockComposotionRoot.dll + + + ..\ref\Gamecraft_Data\Managed\ConsoleCommand.dll + ..\..\ref\Gamecraft_Data\Managed\ConsoleCommand.dll + + + ..\ref\Gamecraft_Data\Managed\DataLoader.dll + ..\..\ref\Gamecraft_Data\Managed\DataLoader.dll + + + ..\ref\Gamecraft_Data\Managed\DDNA.dll + ..\..\ref\Gamecraft_Data\Managed\DDNA.dll + + + ..\ref\Gamecraft_Data\Managed\FMOD.dll + ..\..\ref\Gamecraft_Data\Managed\FMOD.dll + + + ..\ref\Gamecraft_Data\Managed\FullGame.dll + ..\..\ref\Gamecraft_Data\Managed\FullGame.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.AudioBlocks.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.AudioBlocks.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.BlockCompositionRoot.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.BlockCompositionRoot.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.BlockEntityFactory.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.BlockEntityFactory.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.ConsoleBlock.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.ConsoleBlock.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.DamagingSurfaceBlock.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.DamagingSurfaceBlock.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.DestructionBlocks.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.DestructionBlocks.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.GenericPhysicsBlocks.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.GenericPhysicsBlocks.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.LightBlock.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.LightBlock.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.LogicBlock.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.LogicBlock.dll + + + ..\ref\Gamecraft_Data\Managed\GameCraft.Blocks.ProjectileBlock.dll + ..\..\ref\Gamecraft_Data\Managed\GameCraft.Blocks.ProjectileBlock.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.TextBlock.CompositionRoot.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.TextBlock.CompositionRoot.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.TimerBlock.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.TimerBlock.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.CharacterVulnerability.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.CharacterVulnerability.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.CharacterVulnerabilityGui.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.CharacterVulnerabilityGui.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.Damage.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Damage.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.Effects.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Effects.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.ExplosionFragments.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.ExplosionFragments.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.GraphicsSettings.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GraphicsSettings.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.ConsoleBlock.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.ConsoleBlock.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.HUDFeedbackBlocks.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.HUDFeedbackBlocks.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Tweaks.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Tweaks.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Wires.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Wires.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Wires.Mockup.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Wires.Mockup.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.InventoryTimeRunning.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.InventoryTimeRunning.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.JointBlocks.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.JointBlocks.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.Music.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Music.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.PerformanceWarnings.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.PerformanceWarnings.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.PickupBlck.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.PickupBlck.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.PickupsCommon.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.PickupsCommon.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.PopupMessage.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.PopupMessage.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.Projectiles.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Projectiles.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.Tweaks.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Tweaks.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.Tweaks.Mockup.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Tweaks.Mockup.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.VisualEffects.Decals.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.VisualEffects.Decals.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.VisualEffects.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.VisualEffects.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.Wires.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Wires.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.Wires.Mockup.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Wires.Mockup.dll + + + ..\ref\Gamecraft_Data\Managed\GameState.dll + ..\..\ref\Gamecraft_Data\Managed\GameState.dll + + + ..\ref\Gamecraft_Data\Managed\GPUInstancer.dll + ..\..\ref\Gamecraft_Data\Managed\GPUInstancer.dll + + + ..\ref\Gamecraft_Data\Managed\Havok.Physics.dll + ..\..\ref\Gamecraft_Data\Managed\Havok.Physics.dll + + + ..\ref\Gamecraft_Data\Managed\Havok.Physics.Hybrid.dll + ..\..\ref\Gamecraft_Data\Managed\Havok.Physics.Hybrid.dll + + + ..\ref\Gamecraft_Data\Managed\IL3DN_FOG.dll + ..\..\ref\Gamecraft_Data\Managed\IL3DN_FOG.dll + + + ..\ref\Gamecraft_Data\Managed\LZ4.dll + ..\..\ref\Gamecraft_Data\Managed\LZ4.dll + + + ..\ref\Gamecraft_Data\Managed\MultiplayerNetworking.dll + ..\..\ref\Gamecraft_Data\Managed\MultiplayerNetworking.dll + + + ..\ref\Gamecraft_Data\Managed\MultiplayerTest.dll + ..\..\ref\Gamecraft_Data\Managed\MultiplayerTest.dll + + + ..\ref\Gamecraft_Data\Managed\RCX.ScreenshotTaker.dll + ..\..\ref\Gamecraft_Data\Managed\RCX.ScreenshotTaker.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftECS.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftECS.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.AccountPreferences.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.AccountPreferences.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.Blocks.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Blocks.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.Blocks.Ghost.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Blocks.Ghost.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.Blocks.Triggers.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Blocks.Triggers.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.Building.BoxSelect.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Building.BoxSelect.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.Building.Jobs.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Building.Jobs.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.Character.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Character.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.ClusterToWireConversion.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.ClusterToWireConversion.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.Common.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Common.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.ControlsScreen.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.ControlsScreen.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.Crosshair.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Crosshair.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.FrontEnd.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.FrontEnd.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.BlockLabel.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.BlockLabel.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.DebugDisplay.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.DebugDisplay.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.RemoveBlock.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.RemoveBlock.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.ScaleGhost.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.ScaleGhost.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.GUIs.WorkshopPrefabs.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUIs.WorkshopPrefabs.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.Input.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Input.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.MachineEditor.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.MachineEditor.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.MainGame.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.MainGame.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.MainSimulation.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.MainSimulation.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.MockCharacter.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.MockCharacter.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.Multiplayer.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Multiplayer.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.Multiplayer.GUI.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Multiplayer.GUI.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.MultiplayerInput.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.MultiplayerInput.dll + + + ..\ref\Gamecraft_Data\Managed\Robocraftx.ObjectIdBlocks.dll + ..\..\ref\Gamecraft_Data\Managed\Robocraftx.ObjectIdBlocks.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.Party.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Party.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.PartyGui.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.PartyGui.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.Physics.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Physics.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.PilotSeat.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.PilotSeat.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.Player.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Player.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.Rendering.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Rendering.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.Rendering.Mock.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Rendering.Mock.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.SaveAndLoad.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.SaveAndLoad.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.SaveGameDialog.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.SaveGameDialog.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.Serializers.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Serializers.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.Services.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Services.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.SignalHandling.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.SignalHandling.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.StateSync.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.StateSync.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX_SpawnPoints.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX_SpawnPoints.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX_TextBlock.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX_TextBlock.dll + + + ..\ref\Gamecraft_Data\Managed\RobocratX.SimulationMockCompositionRoot.dll + ..\..\ref\Gamecraft_Data\Managed\RobocratX.SimulationMockCompositionRoot.dll + + + ..\ref\Gamecraft_Data\Managed\SpawningPointCompositionRoot.dll + ..\..\ref\Gamecraft_Data\Managed\SpawningPointCompositionRoot.dll + + + ..\ref\Gamecraft_Data\Managed\SpecializedDescriptors.dll + ..\..\ref\Gamecraft_Data\Managed\SpecializedDescriptors.dll + + + ..\ref\Gamecraft_Data\Managed\StringFormatter.dll + ..\..\ref\Gamecraft_Data\Managed\StringFormatter.dll + + + ..\ref\Gamecraft_Data\Managed\Svelto.Common_3.dll + ..\..\ref\Gamecraft_Data\Managed\Svelto.Common_3.dll + + + ..\ref\Gamecraft_Data\Managed\Svelto.ECS.dll + ..\..\ref\Gamecraft_Data\Managed\Svelto.ECS.dll + + + ..\ref\Gamecraft_Data\Managed\Svelto.Services.dll + ..\..\ref\Gamecraft_Data\Managed\Svelto.Services.dll + + + ..\ref\Gamecraft_Data\Managed\Svelto.Tasks.dll + ..\..\ref\Gamecraft_Data\Managed\Svelto.Tasks.dll + + + ..\ref\Gamecraft_Data\Managed\UltimateDecals.dll + ..\..\ref\Gamecraft_Data\Managed\UltimateDecals.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Addressables.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Addressables.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Animation.Curves.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Animation.Curves.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Animation.Curves.Hybrid.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Animation.Curves.Hybrid.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Animation.DefaultGraphPipeline.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Animation.DefaultGraphPipeline.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Animation.DefaultGraphPipeline.Hybrid.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Animation.DefaultGraphPipeline.Hybrid.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Animation.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Animation.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Animation.Graph.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Animation.Graph.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Animation.Hybrid.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Animation.Hybrid.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Build.SlimPlayerRuntime.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Build.SlimPlayerRuntime.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Burst.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Burst.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Collections.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Collections.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.DataFlowGraph.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.DataFlowGraph.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Deformations.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Deformations.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Entities.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Entities.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Entities.Hybrid.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Entities.Hybrid.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Jobs.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Jobs.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Mathematics.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Mathematics.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Mathematics.Extensions.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Mathematics.Extensions.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.MemoryProfiler.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.MemoryProfiler.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Physics.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Physics.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Physics.Hybrid.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Physics.Hybrid.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Platforms.Common.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Platforms.Common.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Postprocessing.Runtime.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Postprocessing.Runtime.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Properties.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Properties.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Properties.Reflection.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Properties.Reflection.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Properties.UI.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Properties.UI.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.RenderPipeline.Universal.ShaderLibrary.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipeline.Universal.ShaderLibrary.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Universal.Runtime.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Universal.Runtime.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Universal.Shaders.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Universal.Shaders.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.ResourceManager.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.ResourceManager.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Scenes.Hybrid.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Scenes.Hybrid.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.ScriptableBuildPipeline.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.ScriptableBuildPipeline.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Serialization.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Serialization.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.TextMeshPro.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.TextMeshPro.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Timeline.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Timeline.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Transforms.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Transforms.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Transforms.Hybrid.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Transforms.Hybrid.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.VisualEffectGraph.Runtime.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.VisualEffectGraph.Runtime.dll + + + ..\ref\Gamecraft_Data\Managed\UnityEngine.UI.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UI.dll + + + ..\ref\Gamecraft_Data\Managed\uREPL.dll + ..\..\ref\Gamecraft_Data\Managed\uREPL.dll + + + ..\ref\Gamecraft_Data\Managed\VisualProfiler.dll + ..\..\ref\Gamecraft_Data\Managed\VisualProfiler.dll + \ No newline at end of file -- 2.30.2 From 0bd348bd47c2a94a5149d267a908f1750991aa5d Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Thu, 29 Oct 2020 00:37:47 +0100 Subject: [PATCH 118/252] Fix initial issues and add error on patch fail Fixed compilation and loading issues for 2020.10.27.17.13 --- Automation/gen_csproj.py | 0 GamecraftModdingAPI/Blocks/BlockColor.cs | 5 --- GamecraftModdingAPI/Blocks/BlockEngine.cs | 2 +- GamecraftModdingAPI/Blocks/PlacementEngine.cs | 4 +-- GamecraftModdingAPI/Blocks/RemovalEngine.cs | 5 ++- GamecraftModdingAPI/Input/FakeInput.cs | 4 +-- .../HotbarSlotSelectionHandlerEnginePatch.cs | 4 +-- GamecraftModdingAPI/Main.cs | 31 ++++++++++++++----- .../Tests/GamecraftModdingAPIPluginTest.cs | 5 --- 9 files changed, 33 insertions(+), 27 deletions(-) mode change 100644 => 100755 Automation/gen_csproj.py diff --git a/Automation/gen_csproj.py b/Automation/gen_csproj.py old mode 100644 new mode 100755 diff --git a/GamecraftModdingAPI/Blocks/BlockColor.cs b/GamecraftModdingAPI/Blocks/BlockColor.cs index 4461f91..bf22090 100644 --- a/GamecraftModdingAPI/Blocks/BlockColor.cs +++ b/GamecraftModdingAPI/Blocks/BlockColor.cs @@ -7,7 +7,6 @@ namespace GamecraftModdingAPI.Blocks { public BlockColors Color; public byte Darkness; - public byte Index; public byte Index => Color == BlockColors.Default ? byte.MaxValue @@ -27,8 +26,6 @@ namespace GamecraftModdingAPI.Blocks Color = (BlockColors) (index % 10); Darkness = (byte) (index / 10); } - - Index = index; } public BlockColor(BlockColors color, byte darkness) @@ -37,8 +34,6 @@ namespace GamecraftModdingAPI.Blocks throw new ArgumentOutOfRangeException(nameof(darkness), "Darkness must be 0-9 where 0 is default."); Color = color; Darkness = darkness; - if (color == BlockColors.Default) Index = byte.MaxValue; - else Index = (byte) (darkness * 10 + color); } public float4 RGBA => Block.BlockEngine.ConvertBlockColor(Index); diff --git a/GamecraftModdingAPI/Blocks/BlockEngine.cs b/GamecraftModdingAPI/Blocks/BlockEngine.cs index 929a65f..e39a3e8 100644 --- a/GamecraftModdingAPI/Blocks/BlockEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlockEngine.cs @@ -2,10 +2,10 @@ using System; using System.Collections.Generic; using System.Linq; +using Gamecraft.ColourPalette; using Gamecraft.Wires; using RobocraftX.Blocks; using RobocraftX.Common; -using RobocraftX.GUI.Hotbar.Colours; using RobocraftX.Physics; using RobocraftX.Scene.Simulation; using Svelto.DataStructures; diff --git a/GamecraftModdingAPI/Blocks/PlacementEngine.cs b/GamecraftModdingAPI/Blocks/PlacementEngine.cs index e111598..cb1cdee 100644 --- a/GamecraftModdingAPI/Blocks/PlacementEngine.cs +++ b/GamecraftModdingAPI/Blocks/PlacementEngine.cs @@ -70,9 +70,7 @@ namespace GamecraftModdingAPI.Blocks DBEntityStruct dbEntity = new DBEntityStruct {DBID = dbid}; BlockPlacementScaleEntityStruct placementScale = new BlockPlacementScaleEntityStruct { - blockPlacementHeight = uscale, blockPlacementWidth = uscale, desiredScaleFactor = uscale, - snapGridScale = uscale, - unitSnapOffset = 0, isUsingUnitSize = true + blockPlacementHeight = uscale, blockPlacementWidth = uscale, desiredScaleFactor = uscale }; EquippedColourStruct colour = new EquippedColourStruct {indexInPalette = color}; diff --git a/GamecraftModdingAPI/Blocks/RemovalEngine.cs b/GamecraftModdingAPI/Blocks/RemovalEngine.cs index 629fd7e..c27c339 100644 --- a/GamecraftModdingAPI/Blocks/RemovalEngine.cs +++ b/GamecraftModdingAPI/Blocks/RemovalEngine.cs @@ -20,8 +20,11 @@ namespace GamecraftModdingAPI.Blocks if (!entitiesDB.Exists(target)) return false; var connections = entitiesDB.QueryEntity(target); + var groups = entitiesDB.FindGroups(); + var connStructMapper = + entitiesDB.QueryNativeMappedEntities(groups); for (int i = connections.connections.Count() - 1; i >= 0; i--) - _connectionFactory.RemoveConnection(connections, i, entitiesDB); + _connectionFactory.RemoveConnection(connections, i, connStructMapper); _entityFunctions.RemoveEntity(target); return true; } diff --git a/GamecraftModdingAPI/Input/FakeInput.cs b/GamecraftModdingAPI/Input/FakeInput.cs index df6c3ce..8cab6f5 100644 --- a/GamecraftModdingAPI/Input/FakeInput.cs +++ b/GamecraftModdingAPI/Input/FakeInput.cs @@ -76,7 +76,7 @@ namespace GamecraftModdingAPI.Input case 9: currentInput.guiMask |= RobocraftX.Common.Input.GuiInput.Hotbar_9; break; default: break; } - if (commandLine) currentInput.guiMask |= RobocraftX.Common.Input.GuiInput.ToggleCommandLine; + //if (commandLine) currentInput.guiMask |= RobocraftX.Common.Input.GuiInput.ToggleCommandLine; - TODO if (escape) currentInput.guiMask |= RobocraftX.Common.Input.GuiInput.Escape; if (enter) currentInput.guiMask |= RobocraftX.Common.Input.GuiInput.Return; if (debug) currentInput.guiMask |= RobocraftX.Common.Input.GuiInput.ToggleDebugDisplay; @@ -125,7 +125,7 @@ namespace GamecraftModdingAPI.Input if (tertiary) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.TertiaryAction; if (primaryHeld) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.PrimaryActionHeld; if (secondaryHeld) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.SecondaryActionHeld; - if (toggleUnitGrid) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.ToggleUnitGrid; + //if (toggleUnitGrid) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.ToggleUnitGrid; if (ctrl) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.CtrlAction; if (toggleColourMode) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.ToggleColourMode; if (scaleBlockUp) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.ScaleBlockUp; diff --git a/GamecraftModdingAPI/Inventory/HotbarSlotSelectionHandlerEnginePatch.cs b/GamecraftModdingAPI/Inventory/HotbarSlotSelectionHandlerEnginePatch.cs index dd8a375..9a81f99 100644 --- a/GamecraftModdingAPI/Inventory/HotbarSlotSelectionHandlerEnginePatch.cs +++ b/GamecraftModdingAPI/Inventory/HotbarSlotSelectionHandlerEnginePatch.cs @@ -1,8 +1,6 @@ using System; using System.Reflection; -using RobocraftX.GUI; -using RobocraftX.GUI.Hotbar; using Svelto.ECS; using HarmonyLib; @@ -17,7 +15,7 @@ namespace GamecraftModdingAPI.Inventory public static BlockIDs EquippedPartID { get => (BlockIDs)selectedBlockInt; } - private static MethodInfo PatchedMethod { get; } = AccessTools.Method(AccessTools.TypeByName("RobocraftX.GUI.Hotbar.HotbarSlotSelectionHandlerEngine"), "ActivateSlotForCube", parameters: new Type[] { typeof(uint), typeof(int), typeof(ExclusiveGroupStruct) }); + private static MethodInfo PatchedMethod { get; } = AccessTools.Method("Gamecraft.GUI.Hotbar.Blocks.SyncHotbarSlotSelectedToEquipedPartEngine:ActivateSlotForCube", parameters: new Type[] { typeof(uint), typeof(int), typeof(ExclusiveGroupStruct) }); public static void Prefix(uint playerID, int selectedDBPartID, ExclusiveGroupStruct groupID) { diff --git a/GamecraftModdingAPI/Main.cs b/GamecraftModdingAPI/Main.cs index 4a8cf24..98fb6f6 100644 --- a/GamecraftModdingAPI/Main.cs +++ b/GamecraftModdingAPI/Main.cs @@ -1,17 +1,15 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Reflection; using GamecraftModdingAPI.Blocks; using HarmonyLib; +using RobocraftX; +using RobocraftX.Services; +using Svelto.Context; + using GamecraftModdingAPI.Utility; using GamecraftModdingAPI.Events; -using GamecraftModdingAPI.Players; using GamecraftModdingAPI.Tasks; -using uREPL; namespace GamecraftModdingAPI { @@ -46,7 +44,20 @@ namespace GamecraftModdingAPI Logging.MetaDebugLog($"Patching Gamecraft"); var currentAssembly = Assembly.GetExecutingAssembly(); harmony = new Harmony(currentAssembly.GetName().Name); - harmony.PatchAll(currentAssembly); + try + { + harmony.PatchAll(currentAssembly); + } + catch (Exception e) + { //Can't use ErrorBuilder or Logging.LogException (which eventually uses ErrorBuilder) yet + Logging.Log(e.ToString()); + Logging.LogWarning("Failed to patch Gamecraft. Attempting to patch to display error..."); + harmony.Patch(AccessTools.Method(typeof(FullGameCompositionRoot), "OnContextInitialized") + .MakeGenericMethod(typeof(UnityContext)), + new HarmonyMethod(((Action) OnPatchError).Method)); //Can't use lambdas here :( + return; + } + // init utility Logging.MetaDebugLog($"Initializing Utility"); #pragma warning disable 0612,0618 @@ -102,5 +113,11 @@ namespace GamecraftModdingAPI Logging.MetaLog($"{currentAssembly.GetName().Name} v{currentAssembly.GetName().Version} shutdown"); } } + + private static void OnPatchError() + { + ErrorBuilder.DisplayMustQuitError("Failed to patch Gamecraft!\n" + + "Make sure you're using the latest version of GamecraftModdingAPI or disable mods if the API isn't released yet."); + } } } diff --git a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs index 0cba023..e3a9c50 100644 --- a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs +++ b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs @@ -173,11 +173,6 @@ namespace GamecraftModdingAPI.Tests Logging.CommandLog("Finished in " + sw.ElapsedMilliseconds + "ms"); }) .Build(); - //With Sync(): 1135ms - //Without Sync(): 134ms - //Async: 348 794ms, doesn't freeze game - //Without Sync() but wait for submission: 530ms - //With Sync() at the end: 380ms Block b = null; CommandBuilder.Builder("moveBlockInSim", "Run in build mode first while looking at a block, then in sim to move it up") -- 2.30.2 From 1cb663b4d13b60565661f553221446ab2d026f95 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Mon, 9 Nov 2020 16:18:25 -0500 Subject: [PATCH 119/252] Fix build errors from beta hotfix 1 --- GamecraftModdingAPI/App/AppEngine.cs | 5 +- GamecraftModdingAPI/App/GameGameEngine.cs | 6 +- GamecraftModdingAPI/App/GameMenuEngine.cs | 10 +- GamecraftModdingAPI/Block.cs | 42 +- GamecraftModdingAPI/Blocks/BlockEngine.cs | 49 ++- GamecraftModdingAPI/Blocks/BlockEngineInit.cs | 4 +- GamecraftModdingAPI/Blocks/ConsoleBlock.cs | 2 +- GamecraftModdingAPI/Blocks/DampedSpring.cs | 2 +- GamecraftModdingAPI/Blocks/LogicGate.cs | 2 +- GamecraftModdingAPI/Blocks/Motor.cs | 2 +- GamecraftModdingAPI/Blocks/MusicBlock.cs | 2 +- .../Blocks/ObjectIdentifier.cs | 2 +- GamecraftModdingAPI/Blocks/Piston.cs | 2 +- GamecraftModdingAPI/Blocks/PlacementEngine.cs | 3 +- GamecraftModdingAPI/Blocks/Servo.cs | 2 +- GamecraftModdingAPI/Blocks/SfxBlock.cs | 2 +- GamecraftModdingAPI/Blocks/SignalEngine.cs | 44 +- GamecraftModdingAPI/Blocks/SpawnPoint.cs | 2 +- GamecraftModdingAPI/Blocks/TextBlock.cs | 2 +- GamecraftModdingAPI/Blocks/Timer.cs | 2 +- .../GamecraftModdingAPI.csproj | 413 +++++++++--------- GamecraftModdingAPI/Inventory/HotbarEngine.cs | 8 +- GamecraftModdingAPI/Players/PlayerEngine.cs | 8 +- GamecraftModdingAPI/Tests/TestRoot.cs | 2 +- 24 files changed, 330 insertions(+), 288 deletions(-) diff --git a/GamecraftModdingAPI/App/AppEngine.cs b/GamecraftModdingAPI/App/AppEngine.cs index 4f20b7e..9cc454d 100644 --- a/GamecraftModdingAPI/App/AppEngine.cs +++ b/GamecraftModdingAPI/App/AppEngine.cs @@ -46,11 +46,12 @@ namespace GamecraftModdingAPI.App public Game[] GetMyGames() { EntityCollection mgsevs = entitiesDB.QueryEntities(MyGamesScreenExclusiveGroups.MyGames); + var mgsevsB = mgsevs.ToBuffer().buffer; Game[] games = new Game[mgsevs.count]; for (int i = 0; i < mgsevs.count; i++) { - Utility.Logging.MetaDebugLog($"Found game named {mgsevs[i].GameName}"); - games[i] = new Game(mgsevs[i].ID); + Utility.Logging.MetaDebugLog($"Found game named {mgsevsB[i].GameName}"); + games[i] = new Game(mgsevsB[i].ID); } return games; } diff --git a/GamecraftModdingAPI/App/GameGameEngine.cs b/GamecraftModdingAPI/App/GameGameEngine.cs index a616df5..dea3821 100644 --- a/GamecraftModdingAPI/App/GameGameEngine.cs +++ b/GamecraftModdingAPI/App/GameGameEngine.cs @@ -52,7 +52,7 @@ namespace GamecraftModdingAPI.App { if (async) { - ExitCurrentGameAsync().RunOn(Lean.EveryFrameStepRunner_RUNS_IN_TIME_STOPPED_AND_RUNNING); + ExitCurrentGameAsync().RunOn(Lean.EveryFrameStepRunner_TimeRunningAndStopped); } else { @@ -102,14 +102,14 @@ namespace GamecraftModdingAPI.App if (filter == BlockIDs.Invalid) { foreach (var (blocks, _) in allBlocks) - foreach (var block in blocks) + foreach (var block in blocks.ToBuffer().buffer.ToManagedArray()) blockEGIDs.Add(block.ID); return blockEGIDs.ToArray(); } else { foreach (var (blocks, _) in allBlocks) - foreach (var block in blocks) + foreach (var block in blocks.ToBuffer().buffer.ToManagedArray()) if (block.DBID == (ulong) filter) blockEGIDs.Add(block.ID); return blockEGIDs.ToArray(); diff --git a/GamecraftModdingAPI/App/GameMenuEngine.cs b/GamecraftModdingAPI/App/GameMenuEngine.cs index 74bc42a..efcb73e 100644 --- a/GamecraftModdingAPI/App/GameMenuEngine.cs +++ b/GamecraftModdingAPI/App/GameMenuEngine.cs @@ -61,12 +61,13 @@ namespace GamecraftModdingAPI.App public uint HighestID() { EntityCollection games = entitiesDB.QueryEntities(MyGamesScreenExclusiveGroups.MyGames); + var gamesB = games.ToBuffer().buffer; uint max = 0; for (int i = 0; i < games.count; i++) { - if (games[i].ID.entityID > max) + if (gamesB[i].ID.entityID > max) { - max = games[i].ID.entityID; + max = gamesB[i].ID.entityID; } } return max; @@ -118,11 +119,12 @@ namespace GamecraftModdingAPI.App { EntityCollection entities = entitiesDB.QueryEntities(MyGamesScreenExclusiveGroups.GameSlotGuiEntities); + var entitiesB = entities.ToBuffer().buffer; for (int i = 0; i < entities.count; i++) { - if (entities[i].ID.entityID == id.entityID) + if (entitiesB[i].ID.entityID == id.entityID) { - return ref entities[i]; + return ref entitiesB[i]; } } MyGamesSlotEntityViewStruct[] defRef = new MyGamesSlotEntityViewStruct[1]; diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index 408304d..81d6439 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -116,32 +116,32 @@ namespace GamecraftModdingAPI private static Dictionary typeToGroup = new Dictionary { - {typeof(ConsoleBlock), new[] {CommonExclusiveGroups.BUILD_CONSOLE_BLOCK_GROUP}}, - {typeof(LogicGate), new [] {CommonExclusiveGroups.BUILD_LOGIC_BLOCK_GROUP}}, - {typeof(Motor), new[] {CommonExclusiveGroups.BUILD_MOTOR_BLOCK_GROUP}}, - {typeof(MusicBlock), new[] {CommonExclusiveGroups.BUILD_MUSIC_BLOCK_GROUP}}, - {typeof(ObjectIdentifier), new[]{CommonExclusiveGroups.BUILD_OBJID_BLOCK_GROUP}}, - {typeof(Piston), new[] {CommonExclusiveGroups.BUILD_PISTON_BLOCK_GROUP}}, - {typeof(Servo), new[] {CommonExclusiveGroups.BUILD_SERVO_BLOCK_GROUP}}, + {typeof(ConsoleBlock), new[] {CommonExclusiveGroups.CONSOLE_BLOCK_GROUP}}, + {typeof(LogicGate), new [] {CommonExclusiveGroups.LOGIC_BLOCK_GROUP}}, + {typeof(Motor), new[] {CommonExclusiveGroups.MOTOR_BLOCK_GROUP}}, + {typeof(MusicBlock), new[] {CommonExclusiveGroups.MUSIC_BLOCK_GROUP}}, + {typeof(ObjectIdentifier), new[]{CommonExclusiveGroups.OBJID_BLOCK_GROUP}}, + {typeof(Piston), new[] {CommonExclusiveGroups.PISTON_BLOCK_GROUP}}, + {typeof(Servo), new[] {CommonExclusiveGroups.SERVO_BLOCK_GROUP}}, { typeof(SpawnPoint), new[] { - CommonExclusiveGroups.BUILD_SPAWNPOINT_BLOCK_GROUP, - CommonExclusiveGroups.BUILD_BUILDINGSPAWN_BLOCK_GROUP + CommonExclusiveGroups.SPAWNPOINT_BLOCK_GROUP, + CommonExclusiveGroups.BUILDINGSPAWN_BLOCK_GROUP } }, { typeof(SfxBlock), new[] { - CommonExclusiveGroups.BUILD_SIMPLESFX_BLOCK_GROUP, - CommonExclusiveGroups.BUILD_LOOPEDSFX_BLOCK_GROUP + CommonExclusiveGroups.SIMPLESFX_BLOCK_GROUP, + CommonExclusiveGroups.LOOPEDSFX_BLOCK_GROUP } }, - {typeof(DampedSpring), new [] {CommonExclusiveGroups.BUILD_DAMPEDSPRING_BLOCK_GROUP}}, - {typeof(TextBlock), new[] {CommonExclusiveGroups.BUILD_TEXT_BLOCK_GROUP}}, - {typeof(Timer), new[] {CommonExclusiveGroups.BUILD_TIMER_BLOCK_GROUP}} + {typeof(DampedSpring), new [] {CommonExclusiveGroups.DAMPEDSPRING_BLOCK_GROUP}}, + {typeof(TextBlock), new[] {CommonExclusiveGroups.TEXT_BLOCK_GROUP}}, + {typeof(Timer), new[] {CommonExclusiveGroups.TIMER_BLOCK_GROUP}} }; /// @@ -312,8 +312,9 @@ namespace GamecraftModdingAPI BlockEngine.SetBlockInfo(this, (ref ColourParameterEntityStruct color, BlockColor val) => { color.indexInPalette = (byte) (val.Color + val.Darkness * 10); - color.overridePaletteColour = false; - color.needsUpdate = true; + //color.overridePaletteColour = false; + //color.needsUpdate = true; + color.hasNetworkChange = true; color.paletteColour = BlockEngine.ConvertBlockColor(color.indexInPalette); }, value); } @@ -324,14 +325,15 @@ namespace GamecraftModdingAPI /// public float4 CustomColor { - get => BlockEngine.GetBlockInfo(this, (ColourParameterEntityStruct st) => st.overriddenColour); + get => BlockEngine.GetBlockInfo(this, (ColourParameterEntityStruct st) => st.paletteColour); set { BlockEngine.SetBlockInfo(this, (ref ColourParameterEntityStruct color, float4 val) => { - color.overriddenColour = val; - color.overridePaletteColour = true; - color.needsUpdate = true; + color.paletteColour = val; + //color.overridePaletteColour = true; + //color.needsUpdate = true; + color.hasNetworkChange = true; }, value); } } diff --git a/GamecraftModdingAPI/Blocks/BlockEngine.cs b/GamecraftModdingAPI/Blocks/BlockEngine.cs index e39a3e8..5566525 100644 --- a/GamecraftModdingAPI/Blocks/BlockEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlockEngine.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using Gamecraft.ColourPalette; +using Gamecraft.TimeRunning; using Gamecraft.Wires; using RobocraftX.Blocks; using RobocraftX.Common; @@ -43,8 +44,14 @@ namespace GamecraftModdingAPI.Blocks FasterList cubes = new FasterList(10); var coll = entitiesDB.QueryEntities(); foreach (var (ecoll, _) in coll) - foreach (ref var conn in ecoll) - conn.isProcessed = false; + { + var ecollB = ecoll.ToBuffer(); + for(int i = 0; i < ecoll.count; i++) + { + ref var conn = ref ecollB.buffer[i]; + conn.isProcessed = false; + } + } ConnectedCubesUtility.TreeTraversal.GetConnectedCubes(entitiesDB, blockID, cubeStack, cubes, (in GridConnectionsEntityStruct g) => { return false; }); @@ -68,17 +75,17 @@ namespace GamecraftModdingAPI.Blocks return ref structHolder[0]; //Gets a default value automatically } - public ref T GetBlockInfoViewStruct(EGID blockID) where T : struct, INeedEGID, IEntityComponent + public ref T GetBlockInfoViewStruct(EGID blockID) where T : struct, INeedEGID, IEntityViewComponent { if (entitiesDB.Exists(blockID)) { // TODO: optimize by using EntitiesDB internal calls instead of iterating over everything - EntityCollection entities = entitiesDB.QueryEntities(blockID.groupID); + BT> entities = entitiesDB.QueryEntities(blockID.groupID).ToBuffer(); for (int i = 0; i < entities.count; i++) { - if (entities[i].ID == blockID) + if (entities.buffer[i].ID == blockID) { - return ref entities[i]; + return ref entities.buffer[i]; } } } @@ -160,12 +167,13 @@ namespace GamecraftModdingAPI.Blocks public SimBody[] GetSimBodiesFromID(byte id) { var ret = new FasterList(4); - if (!entitiesDB.HasAny(CommonExclusiveGroups.BUILD_OBJID_BLOCK_GROUP)) + if (!entitiesDB.HasAny(CommonExclusiveGroups.OBJID_BLOCK_GROUP)) return new SimBody[0]; - var oids = entitiesDB.QueryEntities(CommonExclusiveGroups.BUILD_OBJID_BLOCK_GROUP); - var connections = entitiesDB.QueryMappedEntities(CommonExclusiveGroups.BUILD_OBJID_BLOCK_GROUP); - foreach (ref ObjectIdEntityStruct oid in oids) + var oids = entitiesDB.QueryEntities(CommonExclusiveGroups.OBJID_BLOCK_GROUP).ToBuffer(); + var connections = entitiesDB.QueryMappedEntities(CommonExclusiveGroups.OBJID_BLOCK_GROUP); + for (int i = 0; i < oids.count; i++) { + ref ObjectIdEntityStruct oid = ref oids.buffer[i]; if (oid.objectId != id) continue; var rid = connections.Entity(oid.ID.entityID).machineRigidBodyId; foreach (var rb in ret) @@ -182,21 +190,26 @@ namespace GamecraftModdingAPI.Blocks public ObjectIdentifier[] GetObjectIDsFromID(byte id, bool sim) { var ret = new FasterList(4); - if (!entitiesDB.HasAny(CommonExclusiveGroups.BUILD_OBJID_BLOCK_GROUP)) + if (!entitiesDB.HasAny(CommonExclusiveGroups.OBJID_BLOCK_GROUP)) return new ObjectIdentifier[0]; - var oids = entitiesDB.QueryEntities(CommonExclusiveGroups.BUILD_OBJID_BLOCK_GROUP); - foreach (ref ObjectIdEntityStruct oid in oids) + var oids = entitiesDB.QueryEntities(CommonExclusiveGroups.OBJID_BLOCK_GROUP).ToBuffer(); + for (int i = 0; i < oids.count; i++) + { + ref ObjectIdEntityStruct oid = ref oids.buffer[i]; if (sim ? oid.simObjectId == id : oid.objectId == id) ret.Add(new ObjectIdentifier(oid.ID)); + } + return ret.ToArray(); } public SimBody[] GetConnectedSimBodies(uint id) { - var joints = entitiesDB.QueryEntities(MachineSimulationGroups.JOINTS_GROUP); + var joints = entitiesDB.QueryEntities(MachineSimulationGroups.JOINTS_GROUP).ToBuffer(); var list = new FasterList(4); - foreach (var joint in joints) + for (int i = 0; i < joints.count; i++) { + ref var joint = ref joints.buffer[i]; if (joint.jointState == JointState.Broken) continue; if (joint.connectedEntityA == id) list.Add(new SimBody(joint.connectedEntityB)); else if (joint.connectedEntityB == id) list.Add(new SimBody(joint.connectedEntityA)); @@ -211,7 +224,7 @@ namespace GamecraftModdingAPI.Blocks var bodies = new HashSet(); foreach (var (coll, _) in groups) { - foreach (var conn in coll) + foreach (var conn in coll.ToBuffer().buffer.ToManagedArray()) { if (conn.clusterId == cid) bodies.Add(conn.machineRigidBodyId); @@ -238,7 +251,7 @@ namespace GamecraftModdingAPI.Blocks var groups = entitiesDB.QueryEntities(); foreach (var (coll, _) in groups) { - foreach (var conn in coll) + foreach (var conn in coll.ToBuffer().buffer.ToManagedArray()) { //Static blocks don't have a cluster ID but the cluster destruction manager should have one if (conn.machineRigidBodyId == sbid && conn.clusterId != uint.MaxValue) return new Cluster(conn.clusterId); @@ -254,7 +267,7 @@ namespace GamecraftModdingAPI.Blocks var set = new HashSet(); foreach (var (coll, _) in groups) { - foreach (var conn in coll) + foreach (var conn in coll.ToBuffer().buffer.ToManagedArray()) { if (conn.machineRigidBodyId == sbid) set.Add(new Block(conn.ID)); diff --git a/GamecraftModdingAPI/Blocks/BlockEngineInit.cs b/GamecraftModdingAPI/Blocks/BlockEngineInit.cs index 70f713a..1bf6c15 100644 --- a/GamecraftModdingAPI/Blocks/BlockEngineInit.cs +++ b/GamecraftModdingAPI/Blocks/BlockEngineInit.cs @@ -14,10 +14,10 @@ namespace GamecraftModdingAPI.Blocks /// internal struct BlockInitData { - public FasterDictionary, ITypeSafeDictionary> Group; + public FasterDictionary Group; } - internal delegate FasterDictionary, ITypeSafeDictionary> GetInitGroup( + internal delegate FasterDictionary GetInitGroup( EntityComponentInitializer initializer); /// diff --git a/GamecraftModdingAPI/Blocks/ConsoleBlock.cs b/GamecraftModdingAPI/Blocks/ConsoleBlock.cs index c8982e4..e696fca 100644 --- a/GamecraftModdingAPI/Blocks/ConsoleBlock.cs +++ b/GamecraftModdingAPI/Blocks/ConsoleBlock.cs @@ -16,7 +16,7 @@ namespace GamecraftModdingAPI.Blocks { } - public ConsoleBlock(uint id): base(new EGID(id, CommonExclusiveGroups.BUILD_CONSOLE_BLOCK_GROUP)) + public ConsoleBlock(uint id): base(new EGID(id, CommonExclusiveGroups.CONSOLE_BLOCK_GROUP)) { } diff --git a/GamecraftModdingAPI/Blocks/DampedSpring.cs b/GamecraftModdingAPI/Blocks/DampedSpring.cs index 96e628d..5a5a936 100644 --- a/GamecraftModdingAPI/Blocks/DampedSpring.cs +++ b/GamecraftModdingAPI/Blocks/DampedSpring.cs @@ -10,7 +10,7 @@ namespace GamecraftModdingAPI.Blocks { } - public DampedSpring(uint id) : base(new EGID(id, CommonExclusiveGroups.BUILD_DAMPEDSPRING_BLOCK_GROUP)) + public DampedSpring(uint id) : base(new EGID(id, CommonExclusiveGroups.DAMPEDSPRING_BLOCK_GROUP)) { } diff --git a/GamecraftModdingAPI/Blocks/LogicGate.cs b/GamecraftModdingAPI/Blocks/LogicGate.cs index 124bc10..2ec4cef 100644 --- a/GamecraftModdingAPI/Blocks/LogicGate.cs +++ b/GamecraftModdingAPI/Blocks/LogicGate.cs @@ -9,7 +9,7 @@ namespace GamecraftModdingAPI.Blocks { } - public LogicGate(uint id) : base(new EGID(id, CommonExclusiveGroups.BUILD_LOGIC_BLOCK_GROUP)) + public LogicGate(uint id) : base(new EGID(id, CommonExclusiveGroups.LOGIC_BLOCK_GROUP)) { } } diff --git a/GamecraftModdingAPI/Blocks/Motor.cs b/GamecraftModdingAPI/Blocks/Motor.cs index 3c38a52..0a69d27 100644 --- a/GamecraftModdingAPI/Blocks/Motor.cs +++ b/GamecraftModdingAPI/Blocks/Motor.cs @@ -15,7 +15,7 @@ namespace GamecraftModdingAPI.Blocks { } - public Motor(uint id): base(new EGID(id, CommonExclusiveGroups.BUILD_MOTOR_BLOCK_GROUP)) + public Motor(uint id): base(new EGID(id, CommonExclusiveGroups.MOTOR_BLOCK_GROUP)) { } diff --git a/GamecraftModdingAPI/Blocks/MusicBlock.cs b/GamecraftModdingAPI/Blocks/MusicBlock.cs index fc3c880..6b99b6f 100644 --- a/GamecraftModdingAPI/Blocks/MusicBlock.cs +++ b/GamecraftModdingAPI/Blocks/MusicBlock.cs @@ -20,7 +20,7 @@ namespace GamecraftModdingAPI.Blocks { } - public MusicBlock(uint id) : base(new EGID(id, CommonExclusiveGroups.BUILD_MUSIC_BLOCK_GROUP)) + public MusicBlock(uint id) : base(new EGID(id, CommonExclusiveGroups.MUSIC_BLOCK_GROUP)) { } diff --git a/GamecraftModdingAPI/Blocks/ObjectIdentifier.cs b/GamecraftModdingAPI/Blocks/ObjectIdentifier.cs index 0dc835a..1233343 100644 --- a/GamecraftModdingAPI/Blocks/ObjectIdentifier.cs +++ b/GamecraftModdingAPI/Blocks/ObjectIdentifier.cs @@ -10,7 +10,7 @@ namespace GamecraftModdingAPI.Blocks { } - public ObjectIdentifier(uint id) : base(new EGID(id, CommonExclusiveGroups.BUILD_OBJID_BLOCK_GROUP)) + public ObjectIdentifier(uint id) : base(new EGID(id, CommonExclusiveGroups.OBJID_BLOCK_GROUP)) { } diff --git a/GamecraftModdingAPI/Blocks/Piston.cs b/GamecraftModdingAPI/Blocks/Piston.cs index c3f2497..04b3aeb 100644 --- a/GamecraftModdingAPI/Blocks/Piston.cs +++ b/GamecraftModdingAPI/Blocks/Piston.cs @@ -15,7 +15,7 @@ namespace GamecraftModdingAPI.Blocks { } - public Piston(uint id) : base(new EGID(id, CommonExclusiveGroups.BUILD_PISTON_BLOCK_GROUP)) + public Piston(uint id) : base(new EGID(id, CommonExclusiveGroups.PISTON_BLOCK_GROUP)) { } diff --git a/GamecraftModdingAPI/Blocks/PlacementEngine.cs b/GamecraftModdingAPI/Blocks/PlacementEngine.cs index cb1cdee..cf9a80f 100644 --- a/GamecraftModdingAPI/Blocks/PlacementEngine.cs +++ b/GamecraftModdingAPI/Blocks/PlacementEngine.cs @@ -16,6 +16,7 @@ using UnityEngine; using GamecraftModdingAPI.Utility; using GamecraftModdingAPI.Engines; using GamecraftModdingAPI.Players; +using RobocraftX.Rendering.GPUI; namespace GamecraftModdingAPI.Blocks { @@ -81,7 +82,7 @@ namespace GamecraftModdingAPI.Blocks structInitializer.Init(new ColourParameterEntityStruct { indexInPalette = colour.indexInPalette, - needsUpdate = true + hasNetworkChange = true }); uint prefabId = PrefabsID.GetPrefabId(dbid, 0); structInitializer.Init(new GFXPrefabEntityStructGPUI(prefabId)); diff --git a/GamecraftModdingAPI/Blocks/Servo.cs b/GamecraftModdingAPI/Blocks/Servo.cs index 1177fb6..606a48a 100644 --- a/GamecraftModdingAPI/Blocks/Servo.cs +++ b/GamecraftModdingAPI/Blocks/Servo.cs @@ -15,7 +15,7 @@ namespace GamecraftModdingAPI.Blocks { } - public Servo(uint id) : base(new EGID(id, CommonExclusiveGroups.BUILD_SERVO_BLOCK_GROUP)) + public Servo(uint id) : base(new EGID(id, CommonExclusiveGroups.SERVO_BLOCK_GROUP)) { } diff --git a/GamecraftModdingAPI/Blocks/SfxBlock.cs b/GamecraftModdingAPI/Blocks/SfxBlock.cs index f7efe6d..88d69d2 100644 --- a/GamecraftModdingAPI/Blocks/SfxBlock.cs +++ b/GamecraftModdingAPI/Blocks/SfxBlock.cs @@ -14,7 +14,7 @@ namespace GamecraftModdingAPI.Blocks { } - public SfxBlock(uint id) : base(new EGID(id, CommonExclusiveGroups.BUILD_SIMPLESFX_BLOCK_GROUP /* This could also be BUILD_LOOPEDSFX_BLOCK_GROUP */)) + public SfxBlock(uint id) : base(new EGID(id, CommonExclusiveGroups.SIMPLESFX_BLOCK_GROUP /* This could also be BUILD_LOOPEDSFX_BLOCK_GROUP */)) { } diff --git a/GamecraftModdingAPI/Blocks/SignalEngine.cs b/GamecraftModdingAPI/Blocks/SignalEngine.cs index 763a1a1..0980d79 100644 --- a/GamecraftModdingAPI/Blocks/SignalEngine.cs +++ b/GamecraftModdingAPI/Blocks/SignalEngine.cs @@ -115,7 +115,8 @@ namespace GamecraftModdingAPI.Blocks public bool SetSignal(uint signalID, float signal, bool input = true) { var array = GetSignalStruct(signalID, out uint index, input); - if (array.count > 0) array[index].valueAsFloat = signal; + var arrayB = array.ToBuffer(); + if (array.count > 0) arrayB.buffer[index].valueAsFloat = signal; return false; } @@ -128,9 +129,10 @@ namespace GamecraftModdingAPI.Blocks public float AddSignal(uint signalID, float signal, bool clamp = true, bool input = true) { var array = GetSignalStruct(signalID, out uint index, input); + var arrayB = array.ToBuffer(); if (array.count > 0) { - ref var channelData = ref array[index]; + ref var channelData = ref arrayB.buffer[index]; channelData.valueAsFloat += signal; if (clamp) { @@ -159,7 +161,8 @@ namespace GamecraftModdingAPI.Blocks public float GetSignal(uint signalID, bool input = true) { var array = GetSignalStruct(signalID, out uint index, input); - return array.count > 0 ? array[index].valueAsFloat : 0f; + var arrayB = array.ToBuffer(); + return array.count > 0 ? arrayB.buffer[index].valueAsFloat : 0f; } public uint[] GetSignalIDs(EGID blockID, bool input = true) @@ -244,13 +247,14 @@ namespace GamecraftModdingAPI.Blocks { ref PortEntityStruct port = ref entitiesDB.QueryEntity(portID); var wires = entitiesDB.QueryEntities(NamedExclusiveGroup.Group); + var wiresB = wires.ToBuffer().buffer; for (uint i = 0; i < wires.count; i++) { - if ((wires[i].destinationPortUsage == port.usage && wires[i].destinationBlockEGID == blockID) - || (wires[i].sourcePortUsage == port.usage && wires[i].sourceBlockEGID == blockID)) + if ((wiresB[i].destinationPortUsage == port.usage && wiresB[i].destinationBlockEGID == blockID) + || (wiresB[i].sourcePortUsage == port.usage && wiresB[i].sourceBlockEGID == blockID)) { exists = true; - return ref wires[i]; + return ref wiresB[i]; } } exists = false; @@ -286,6 +290,7 @@ namespace GamecraftModdingAPI.Blocks } EntityCollection wires = entitiesDB.QueryEntities(NamedExclusiveGroup.Group); + var wiresB = wires.ToBuffer().buffer; for (int endIndex = 0; endIndex < endPorts.Length; endIndex++) { PortEntityStruct endPES = entitiesDB.QueryEntity(endPorts[endIndex]); @@ -294,11 +299,11 @@ namespace GamecraftModdingAPI.Blocks PortEntityStruct startPES = entitiesDB.QueryEntity(startPorts[startIndex]); for (int w = 0; w < wires.count; w++) { - if ((wires[w].destinationPortUsage == endPES.usage && wires[w].destinationBlockEGID == endBlock) - && (wires[w].sourcePortUsage == startPES.usage && wires[w].sourceBlockEGID == startBlock)) + if ((wiresB[w].destinationPortUsage == endPES.usage && wiresB[w].destinationBlockEGID == endBlock) + && (wiresB[w].sourcePortUsage == startPES.usage && wiresB[w].sourceBlockEGID == startBlock)) { exists = true; - return ref wires[w]; + return ref wiresB[w]; } } } @@ -313,10 +318,11 @@ namespace GamecraftModdingAPI.Blocks { ref PortEntityStruct port = ref entitiesDB.QueryEntity(portID); var channels = entitiesDB.QueryEntities(NamedExclusiveGroup.Group); + var channelsB = channels.ToBuffer(); if (port.firstChannelIndexCachedInSim < channels.count) { exists = true; - return ref channels[port.firstChannelIndexCachedInSim]; + return ref channelsB.buffer[port.firstChannelIndexCachedInSim]; } exists = false; ChannelDataStruct[] defRef = new ChannelDataStruct[1]; @@ -327,8 +333,15 @@ namespace GamecraftModdingAPI.Blocks { var res = new FasterList(); foreach (var (coll, _) in entitiesDB.QueryEntities()) - foreach (ref BlockPortsStruct s in coll) - res.Add(s.ID); + { + var collB = coll.ToBuffer(); + for (int i = 0; i < coll.count; i++) + { + ref BlockPortsStruct s = ref collB.buffer[i]; + res.Add(s.ID); + } + } + return res.ToArray(); } @@ -358,15 +371,16 @@ namespace GamecraftModdingAPI.Blocks return result; } - private T[] Search(ExclusiveGroup group, Func isMatch) where T : struct, IEntityComponent + private T[] Search(ExclusiveGroup group, Func isMatch) where T : unmanaged, IEntityComponent { FasterList results = new FasterList(); EntityCollection components = entitiesDB.QueryEntities(group); + var componentsB = components.ToBuffer(); for (uint i = 0; i < components.count; i++) { - if (isMatch(components[i])) + if (isMatch(componentsB.buffer[i])) { - results.Add(components[i]); + results.Add(componentsB.buffer[i]); } } return results.ToArray(); diff --git a/GamecraftModdingAPI/Blocks/SpawnPoint.cs b/GamecraftModdingAPI/Blocks/SpawnPoint.cs index 7616acb..17bffd9 100644 --- a/GamecraftModdingAPI/Blocks/SpawnPoint.cs +++ b/GamecraftModdingAPI/Blocks/SpawnPoint.cs @@ -17,7 +17,7 @@ namespace GamecraftModdingAPI.Blocks { } - public SpawnPoint(uint id) : base(new EGID(id, CommonExclusiveGroups.BUILD_SPAWNPOINT_BLOCK_GROUP)) + public SpawnPoint(uint id) : base(new EGID(id, CommonExclusiveGroups.SPAWNPOINT_BLOCK_GROUP)) { } diff --git a/GamecraftModdingAPI/Blocks/TextBlock.cs b/GamecraftModdingAPI/Blocks/TextBlock.cs index e696dda..6fa5487 100644 --- a/GamecraftModdingAPI/Blocks/TextBlock.cs +++ b/GamecraftModdingAPI/Blocks/TextBlock.cs @@ -16,7 +16,7 @@ namespace GamecraftModdingAPI.Blocks { } - public TextBlock(uint id) : base(new EGID(id, CommonExclusiveGroups.BUILD_TEXT_BLOCK_GROUP)) + public TextBlock(uint id) : base(new EGID(id, CommonExclusiveGroups.TEXT_BLOCK_GROUP)) { } diff --git a/GamecraftModdingAPI/Blocks/Timer.cs b/GamecraftModdingAPI/Blocks/Timer.cs index 1aeecd9..0bbd302 100644 --- a/GamecraftModdingAPI/Blocks/Timer.cs +++ b/GamecraftModdingAPI/Blocks/Timer.cs @@ -17,7 +17,7 @@ namespace GamecraftModdingAPI.Blocks { } - public Timer(uint id) : base(new EGID(id, CommonExclusiveGroups.BUILD_TIMER_BLOCK_GROUP)) + public Timer(uint id) : base(new EGID(id, CommonExclusiveGroups.TIMER_BLOCK_GROUP)) { } diff --git a/GamecraftModdingAPI/GamecraftModdingAPI.csproj b/GamecraftModdingAPI/GamecraftModdingAPI.csproj index 59de2af..cdbb4d9 100644 --- a/GamecraftModdingAPI/GamecraftModdingAPI.csproj +++ b/GamecraftModdingAPI/GamecraftModdingAPI.csproj @@ -25,11 +25,16 @@ + - - ..\ref\GamecraftPreview_Data\Managed\Accessibility.dll - ..\..\ref\GamecraftPreview_Data\Managed\Accessibility.dll + + ..\ref\GamecraftPreview_Data\Managed\IllusionInjector.dll + ..\..\ref\GamecraftPreview_Data\Managed\IllusionInjector.dll + + + ..\ref\GamecraftPreview_Data\Managed\IllusionPlugin.dll + ..\..\ref\GamecraftPreview_Data\Managed\IllusionPlugin.dll ..\ref\GamecraftPreview_Data\Managed\Analytics.dll @@ -83,14 +88,14 @@ ..\ref\GamecraftPreview_Data\Managed\FMOD.dll ..\..\ref\GamecraftPreview_Data\Managed\FMOD.dll + + ..\ref\GamecraftPreview_Data\Managed\FullGame.dll + ..\..\ref\GamecraftPreview_Data\Managed\FullGame.dll + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.AudioBlocks.dll ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.AudioBlocks.dll - - ..\ref\GamecraftPreview_Data\Managed\Gamecraft.BlockCompositionRoot.dll - ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.BlockCompositionRoot.dll - ..\ref\GamecraftPreview_Data\Managed\Gamecraft.BlockEntityFactory.dll ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.BlockEntityFactory.dll @@ -135,6 +140,10 @@ ..\ref\GamecraftPreview_Data\Managed\Gamecraft.Blocks.TimerBlock.dll ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.Blocks.TimerBlock.dll + + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll + ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.CharacterVulnerability.dll ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.CharacterVulnerability.dll @@ -187,6 +196,10 @@ ..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.GameOptionsScreen.dll ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.GameOptionsScreen.dll + + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll + ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll + ..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.Hotbar.Blocks.dll ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.Hotbar.Blocks.dll @@ -243,66 +256,10 @@ ..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll - - ..\ref\GamecraftPreview_Data\Managed\FullGame.dll - ..\..\ref\GamecraftPreview_Data\Managed\FullGame.dll - - - ..\ref\GamecraftPreview_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll - ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll - - - ..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll - ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll - ..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUIs.Hotbar.BlueprintsHotbar.dll ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUIs.Hotbar.BlueprintsHotbar.dll - - ..\ref\GamecraftPreview_Data\Managed\IllusionInjector.dll - ..\..\ref\GamecraftPreview_Data\Managed\IllusionInjector.dll - - - ..\ref\GamecraftPreview_Data\Managed\RobocraftX.Common.dll - ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.Common.dll - - - ..\ref\GamecraftPreview_Data\Managed\RobocraftX.Input.dll - ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.Input.dll - - - ..\ref\GamecraftPreview_Data\Managed\RobocraftX.Rendering.dll - ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.Rendering.dll - - - ..\ref\GamecraftPreview_Data\Managed\Svelto.ECS.dll - ..\..\ref\GamecraftPreview_Data\Managed\Svelto.ECS.dll - - - ..\ref\GamecraftPreview_Data\Managed\Unity.DataFlowGraph.dll - ..\..\ref\GamecraftPreview_Data\Managed\Unity.DataFlowGraph.dll - - - ..\ref\GamecraftPreview_Data\Managed\Unity.Properties.UI.dll - ..\..\ref\GamecraftPreview_Data\Managed\Unity.Properties.UI.dll - - - ..\ref\GamecraftPreview_Data\Managed\Unity.Transforms.Hybrid.dll - ..\..\ref\GamecraftPreview_Data\Managed\Unity.Transforms.Hybrid.dll - - - ..\ref\GamecraftPreview_Data\Managed\UnityEngine.dll - ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.dll - - - ..\ref\GamecraftPreview_Data\Managed\UnityEngine.PhysicsModule.dll - ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.PhysicsModule.dll - - - ..\ref\GamecraftPreview_Data\Managed\UnityEngine.TLSModule.dll - ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.TLSModule.dll - ..\ref\GamecraftPreview_Data\Managed\Gamecraft.InventoryTimeRunning.dll ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.InventoryTimeRunning.dll @@ -379,18 +336,6 @@ ..\ref\GamecraftPreview_Data\Managed\Havok.Physics.Hybrid.dll ..\..\ref\GamecraftPreview_Data\Managed\Havok.Physics.Hybrid.dll - - ..\ref\GamecraftPreview_Data\Managed\IL3DN_FOG.dll - ..\..\ref\GamecraftPreview_Data\Managed\IL3DN_FOG.dll - - - ..\ref\GamecraftPreview_Data\Managed\IllusionPlugin.dll - ..\..\ref\GamecraftPreview_Data\Managed\IllusionPlugin.dll - - - ..\ref\GamecraftPreview_Data\Managed\JWT.dll - ..\..\ref\GamecraftPreview_Data\Managed\JWT.dll - ..\ref\GamecraftPreview_Data\Managed\LZ4.dll ..\..\ref\GamecraftPreview_Data\Managed\LZ4.dll @@ -407,18 +352,6 @@ ..\ref\GamecraftPreview_Data\Managed\MultiplayerTest.dll ..\..\ref\GamecraftPreview_Data\Managed\MultiplayerTest.dll - - ..\ref\GamecraftPreview_Data\Managed\netstandard.dll - ..\..\ref\GamecraftPreview_Data\Managed\netstandard.dll - - - ..\ref\GamecraftPreview_Data\Managed\Newtonsoft.Json.dll - ..\..\ref\GamecraftPreview_Data\Managed\Newtonsoft.Json.dll - - - ..\ref\GamecraftPreview_Data\Managed\Novell.Directory.Ldap.dll - ..\..\ref\GamecraftPreview_Data\Managed\Novell.Directory.Ldap.dll - ..\ref\GamecraftPreview_Data\Managed\RCX.ScreenshotTaker.dll ..\..\ref\GamecraftPreview_Data\Managed\RCX.ScreenshotTaker.dll @@ -467,6 +400,10 @@ ..\ref\GamecraftPreview_Data\Managed\RobocraftX.ClusterToWireConversion.dll ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.ClusterToWireConversion.dll + + ..\ref\GamecraftPreview_Data\Managed\RobocraftX.Common.dll + ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.Common.dll + ..\ref\GamecraftPreview_Data\Managed\RobocraftX.ControlsScreen.dll ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.ControlsScreen.dll @@ -523,6 +460,10 @@ ..\ref\GamecraftPreview_Data\Managed\RobocraftX.GUIs.WorkshopPrefabs.dll ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.GUIs.WorkshopPrefabs.dll + + ..\ref\GamecraftPreview_Data\Managed\RobocraftX.Input.dll + ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.Input.dll + ..\ref\GamecraftPreview_Data\Managed\RobocraftX.MachineEditor.dll ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.MachineEditor.dll @@ -579,6 +520,10 @@ ..\ref\GamecraftPreview_Data\Managed\RobocraftX.Player.dll ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.Player.dll + + ..\ref\GamecraftPreview_Data\Managed\RobocraftX.Rendering.dll + ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.Rendering.dll + ..\ref\GamecraftPreview_Data\Managed\RobocraftX.Rendering.Mock.dll ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.Rendering.Mock.dll @@ -631,9 +576,13 @@ ..\ref\GamecraftPreview_Data\Managed\StringFormatter.dll ..\..\ref\GamecraftPreview_Data\Managed\StringFormatter.dll - - ..\ref\GamecraftPreview_Data\Managed\Svelto.Common_3.dll - ..\..\ref\GamecraftPreview_Data\Managed\Svelto.Common_3.dll + + ..\ref\GamecraftPreview_Data\Managed\Svelto.Common.dll + ..\..\ref\GamecraftPreview_Data\Managed\Svelto.Common.dll + + + ..\ref\GamecraftPreview_Data\Managed\Svelto.ECS.dll + ..\..\ref\GamecraftPreview_Data\Managed\Svelto.ECS.dll ..\ref\GamecraftPreview_Data\Managed\Svelto.Services.dll @@ -643,114 +592,6 @@ ..\ref\GamecraftPreview_Data\Managed\Svelto.Tasks.dll ..\..\ref\GamecraftPreview_Data\Managed\Svelto.Tasks.dll - - ..\ref\GamecraftPreview_Data\Managed\Unity.Deformations.dll - ..\..\ref\GamecraftPreview_Data\Managed\Unity.Deformations.dll - - - ..\ref\GamecraftPreview_Data\Managed\Unity.Entities.dll - ..\..\ref\GamecraftPreview_Data\Managed\Unity.Entities.dll - - - ..\ref\GamecraftPreview_Data\Managed\Unity.Entities.Hybrid.dll - ..\..\ref\GamecraftPreview_Data\Managed\Unity.Entities.Hybrid.dll - - - ..\ref\GamecraftPreview_Data\Managed\Unity.Jobs.dll - ..\..\ref\GamecraftPreview_Data\Managed\Unity.Jobs.dll - - - ..\ref\GamecraftPreview_Data\Managed\Unity.Mathematics.dll - ..\..\ref\GamecraftPreview_Data\Managed\Unity.Mathematics.dll - - - ..\ref\GamecraftPreview_Data\Managed\Unity.Mathematics.Extensions.dll - ..\..\ref\GamecraftPreview_Data\Managed\Unity.Mathematics.Extensions.dll - - - ..\ref\GamecraftPreview_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll - ..\..\ref\GamecraftPreview_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll - - - ..\ref\GamecraftPreview_Data\Managed\Unity.MemoryProfiler.dll - ..\..\ref\GamecraftPreview_Data\Managed\Unity.MemoryProfiler.dll - - - ..\ref\GamecraftPreview_Data\Managed\Unity.Physics.dll - ..\..\ref\GamecraftPreview_Data\Managed\Unity.Physics.dll - - - ..\ref\GamecraftPreview_Data\Managed\Unity.Physics.Hybrid.dll - ..\..\ref\GamecraftPreview_Data\Managed\Unity.Physics.Hybrid.dll - - - ..\ref\GamecraftPreview_Data\Managed\Unity.Platforms.Common.dll - ..\..\ref\GamecraftPreview_Data\Managed\Unity.Platforms.Common.dll - - - ..\ref\GamecraftPreview_Data\Managed\Unity.Postprocessing.Runtime.dll - ..\..\ref\GamecraftPreview_Data\Managed\Unity.Postprocessing.Runtime.dll - - - ..\ref\GamecraftPreview_Data\Managed\Unity.Properties.dll - ..\..\ref\GamecraftPreview_Data\Managed\Unity.Properties.dll - - - ..\ref\GamecraftPreview_Data\Managed\Unity.Properties.Reflection.dll - ..\..\ref\GamecraftPreview_Data\Managed\Unity.Properties.Reflection.dll - - - ..\ref\GamecraftPreview_Data\Managed\Unity.RenderPipeline.Universal.ShaderLibrary.dll - ..\..\ref\GamecraftPreview_Data\Managed\Unity.RenderPipeline.Universal.ShaderLibrary.dll - - - ..\ref\GamecraftPreview_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll - ..\..\ref\GamecraftPreview_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll - - - ..\ref\GamecraftPreview_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll - ..\..\ref\GamecraftPreview_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll - - - ..\ref\GamecraftPreview_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll - ..\..\ref\GamecraftPreview_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll - - - ..\ref\GamecraftPreview_Data\Managed\Unity.RenderPipelines.Universal.Runtime.dll - ..\..\ref\GamecraftPreview_Data\Managed\Unity.RenderPipelines.Universal.Runtime.dll - - - ..\ref\GamecraftPreview_Data\Managed\Unity.RenderPipelines.Universal.Shaders.dll - ..\..\ref\GamecraftPreview_Data\Managed\Unity.RenderPipelines.Universal.Shaders.dll - - - ..\ref\GamecraftPreview_Data\Managed\Unity.ResourceManager.dll - ..\..\ref\GamecraftPreview_Data\Managed\Unity.ResourceManager.dll - - - ..\ref\GamecraftPreview_Data\Managed\Unity.Scenes.Hybrid.dll - ..\..\ref\GamecraftPreview_Data\Managed\Unity.Scenes.Hybrid.dll - - - ..\ref\GamecraftPreview_Data\Managed\Unity.ScriptableBuildPipeline.dll - ..\..\ref\GamecraftPreview_Data\Managed\Unity.ScriptableBuildPipeline.dll - - - ..\ref\GamecraftPreview_Data\Managed\Unity.Serialization.dll - ..\..\ref\GamecraftPreview_Data\Managed\Unity.Serialization.dll - - - ..\ref\GamecraftPreview_Data\Managed\Unity.TextMeshPro.dll - ..\..\ref\GamecraftPreview_Data\Managed\Unity.TextMeshPro.dll - - - ..\ref\GamecraftPreview_Data\Managed\Unity.Timeline.dll - ..\..\ref\GamecraftPreview_Data\Managed\Unity.Timeline.dll - - - ..\ref\GamecraftPreview_Data\Managed\Unity.Transforms.dll - ..\..\ref\GamecraftPreview_Data\Managed\Unity.Transforms.dll - ..\ref\GamecraftPreview_Data\Managed\UltimateDecals.dll ..\..\ref\GamecraftPreview_Data\Managed\UltimateDecals.dll @@ -795,14 +636,138 @@ ..\ref\GamecraftPreview_Data\Managed\Unity.Burst.dll ..\..\ref\GamecraftPreview_Data\Managed\Unity.Burst.dll - - ..\ref\GamecraftPreview_Data\Managed\Unity.Burst.Unsafe.dll - ..\..\ref\GamecraftPreview_Data\Managed\Unity.Burst.Unsafe.dll - ..\ref\GamecraftPreview_Data\Managed\Unity.Collections.dll ..\..\ref\GamecraftPreview_Data\Managed\Unity.Collections.dll + + ..\ref\GamecraftPreview_Data\Managed\Unity.Collections.LowLevel.ILSupport.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.Collections.LowLevel.ILSupport.dll + + + ..\ref\GamecraftPreview_Data\Managed\Unity.DataFlowGraph.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.DataFlowGraph.dll + + + ..\ref\GamecraftPreview_Data\Managed\Unity.Deformations.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.Deformations.dll + + + ..\ref\GamecraftPreview_Data\Managed\Unity.Entities.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.Entities.dll + + + ..\ref\GamecraftPreview_Data\Managed\Unity.Entities.Hybrid.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.Entities.Hybrid.dll + + + ..\ref\GamecraftPreview_Data\Managed\Unity.InternalAPIEngineBridge.002.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.InternalAPIEngineBridge.002.dll + + + ..\ref\GamecraftPreview_Data\Managed\Unity.Jobs.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.Jobs.dll + + + ..\ref\GamecraftPreview_Data\Managed\Unity.Mathematics.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.Mathematics.dll + + + ..\ref\GamecraftPreview_Data\Managed\Unity.Mathematics.Extensions.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.Mathematics.Extensions.dll + + + ..\ref\GamecraftPreview_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll + + + ..\ref\GamecraftPreview_Data\Managed\Unity.MemoryProfiler.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.MemoryProfiler.dll + + + ..\ref\GamecraftPreview_Data\Managed\Unity.Physics.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.Physics.dll + + + ..\ref\GamecraftPreview_Data\Managed\Unity.Physics.Hybrid.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.Physics.Hybrid.dll + + + ..\ref\GamecraftPreview_Data\Managed\Unity.Platforms.Common.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.Platforms.Common.dll + + + ..\ref\GamecraftPreview_Data\Managed\Unity.Postprocessing.Runtime.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.Postprocessing.Runtime.dll + + + ..\ref\GamecraftPreview_Data\Managed\Unity.Properties.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.Properties.dll + + + ..\ref\GamecraftPreview_Data\Managed\Unity.Properties.Reflection.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.Properties.Reflection.dll + + + ..\ref\GamecraftPreview_Data\Managed\Unity.Properties.UI.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.Properties.UI.dll + + + ..\ref\GamecraftPreview_Data\Managed\Unity.RenderPipeline.Universal.ShaderLibrary.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.RenderPipeline.Universal.ShaderLibrary.dll + + + ..\ref\GamecraftPreview_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll + + + ..\ref\GamecraftPreview_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll + + + ..\ref\GamecraftPreview_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll + + + ..\ref\GamecraftPreview_Data\Managed\Unity.RenderPipelines.Universal.Runtime.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.RenderPipelines.Universal.Runtime.dll + + + ..\ref\GamecraftPreview_Data\Managed\Unity.RenderPipelines.Universal.Shaders.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.RenderPipelines.Universal.Shaders.dll + + + ..\ref\GamecraftPreview_Data\Managed\Unity.ResourceManager.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.ResourceManager.dll + + + ..\ref\GamecraftPreview_Data\Managed\Unity.Scenes.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.Scenes.dll + + + ..\ref\GamecraftPreview_Data\Managed\Unity.ScriptableBuildPipeline.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.ScriptableBuildPipeline.dll + + + ..\ref\GamecraftPreview_Data\Managed\Unity.Serialization.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.Serialization.dll + + + ..\ref\GamecraftPreview_Data\Managed\Unity.TextMeshPro.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.TextMeshPro.dll + + + ..\ref\GamecraftPreview_Data\Managed\Unity.Timeline.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.Timeline.dll + + + ..\ref\GamecraftPreview_Data\Managed\Unity.Transforms.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.Transforms.dll + + + ..\ref\GamecraftPreview_Data\Managed\Unity.Transforms.Hybrid.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.Transforms.Hybrid.dll + ..\ref\GamecraftPreview_Data\Managed\Unity.VisualEffectGraph.Runtime.dll ..\..\ref\GamecraftPreview_Data\Managed\Unity.VisualEffectGraph.Runtime.dll @@ -859,6 +824,10 @@ ..\ref\GamecraftPreview_Data\Managed\UnityEngine.DirectorModule.dll ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.DirectorModule.dll + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.dll + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.DSPGraphModule.dll ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.DSPGraphModule.dll @@ -911,6 +880,10 @@ ..\ref\GamecraftPreview_Data\Managed\UnityEngine.Physics2DModule.dll ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.Physics2DModule.dll + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.PhysicsModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.PhysicsModule.dll + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.ProfilerModule.dll ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.ProfilerModule.dll @@ -963,6 +936,10 @@ ..\ref\GamecraftPreview_Data\Managed\UnityEngine.TilemapModule.dll ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.TilemapModule.dll + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.TLSModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.TLSModule.dll + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.UI.dll ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.UI.dll @@ -971,6 +948,10 @@ ..\ref\GamecraftPreview_Data\Managed\UnityEngine.UIElementsModule.dll ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.UIElementsModule.dll + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.UIElementsNativeModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.UIElementsNativeModule.dll + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.UIModule.dll ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.UIModule.dll @@ -1027,6 +1008,10 @@ ..\ref\GamecraftPreview_Data\Managed\UnityEngine.VideoModule.dll ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.VideoModule.dll + + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.VirtualTexturingModule.dll + ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.VirtualTexturingModule.dll + ..\ref\GamecraftPreview_Data\Managed\UnityEngine.VRModule.dll ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.VRModule.dll @@ -1047,6 +1032,30 @@ ..\ref\GamecraftPreview_Data\Managed\VisualProfiler.dll ..\..\ref\GamecraftPreview_Data\Managed\VisualProfiler.dll + + ..\ref\GamecraftPreview_Data\Managed\Accessibility.dll + ..\..\ref\GamecraftPreview_Data\Managed\Accessibility.dll + + + ..\ref\GamecraftPreview_Data\Managed\JWT.dll + ..\..\ref\GamecraftPreview_Data\Managed\JWT.dll + + + ..\ref\GamecraftPreview_Data\Managed\netstandard.dll + ..\..\ref\GamecraftPreview_Data\Managed\netstandard.dll + + + ..\ref\GamecraftPreview_Data\Managed\Newtonsoft.Json.dll + ..\..\ref\GamecraftPreview_Data\Managed\Newtonsoft.Json.dll + + + ..\ref\GamecraftPreview_Data\Managed\Novell.Directory.Ldap.dll + ..\..\ref\GamecraftPreview_Data\Managed\Novell.Directory.Ldap.dll + + + ..\ref\GamecraftPreview_Data\Managed\Unity.Burst.Unsafe.dll + ..\..\ref\GamecraftPreview_Data\Managed\Unity.Burst.Unsafe.dll + \ No newline at end of file diff --git a/GamecraftModdingAPI/Inventory/HotbarEngine.cs b/GamecraftModdingAPI/Inventory/HotbarEngine.cs index d5eb2d8..34cdf12 100644 --- a/GamecraftModdingAPI/Inventory/HotbarEngine.cs +++ b/GamecraftModdingAPI/Inventory/HotbarEngine.cs @@ -36,13 +36,13 @@ namespace GamecraftModdingAPI.Inventory public bool SelectBlock(int block, uint playerID, bool cubeSelectedByPick = false) { - var inputs = entitiesDB.QueryEntities(InputExclusiveGroups.LocalPlayers); + var inputs = entitiesDB.QueryEntities(InputExclusiveGroups.LocalPlayers).ToBuffer(); if (inputs.count == 0) return false; for (int i = 0; i < inputs.count; i++) { - if (inputs[i].ID.entityID == playerID) { - inputs[i].cubeSelectedByPick = cubeSelectedByPick; - inputs[i].selectedCube = block; + if (inputs.buffer[i].ID.entityID == playerID) { + inputs.buffer[i].cubeSelectedByPick = cubeSelectedByPick; + inputs.buffer[i].selectedCube = block; return true; } } diff --git a/GamecraftModdingAPI/Players/PlayerEngine.cs b/GamecraftModdingAPI/Players/PlayerEngine.cs index 6d461f2..e253eac 100644 --- a/GamecraftModdingAPI/Players/PlayerEngine.cs +++ b/GamecraftModdingAPI/Players/PlayerEngine.cs @@ -50,10 +50,10 @@ namespace GamecraftModdingAPI.Players public uint GetLocalPlayer() { if (!isReady) return uint.MaxValue; - var localPlayers = entitiesDB.QueryEntities(PlayersExclusiveGroups.LocalPlayers); + var localPlayers = entitiesDB.QueryEntities(PlayersExclusiveGroups.LocalPlayers).ToBuffer(); if (localPlayers.count > 0) { - return localPlayers[0].ID.entityID; + return localPlayers.buffer[0].ID.entityID; } return uint.MaxValue; } @@ -61,10 +61,10 @@ namespace GamecraftModdingAPI.Players public uint GetRemotePlayer() { if (!isReady) return uint.MaxValue; - var localPlayers = entitiesDB.QueryEntities(PlayersExclusiveGroups.RemotePlayers); + var localPlayers = entitiesDB.QueryEntities(PlayersExclusiveGroups.RemotePlayers).ToBuffer(); if (localPlayers.count > 0) { - return localPlayers[0].ID.entityID; + return localPlayers.buffer[0].ID.entityID; } return uint.MaxValue; } diff --git a/GamecraftModdingAPI/Tests/TestRoot.cs b/GamecraftModdingAPI/Tests/TestRoot.cs index 6acb51c..22f3035 100644 --- a/GamecraftModdingAPI/Tests/TestRoot.cs +++ b/GamecraftModdingAPI/Tests/TestRoot.cs @@ -65,7 +65,7 @@ namespace GamecraftModdingAPI.Tests _testsCountPassed = 0; _testsCountFailed = 0; // flow control - Game.Enter += (sender, args) => { GameTests().RunOn(RobocraftX.Schedulers.Lean.EveryFrameStepRunner_RUNS_IN_TIME_STOPPED_AND_RUNNING); }; + Game.Enter += (sender, args) => { GameTests().RunOn(RobocraftX.Schedulers.Lean.EveryFrameStepRunner_TimeRunningAndStopped); }; Game.Exit += (s, a) => state = "ReturningFromGame"; Client.EnterMenu += (sender, args) => { -- 2.30.2 From d891f12701eb45344fc8742a8285a7ba890ce6b2 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Mon, 9 Nov 2020 16:33:12 -0500 Subject: [PATCH 120/252] Fix harmony patch error due to fixed name --- .../Inventory/HotbarSlotSelectionHandlerEnginePatch.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GamecraftModdingAPI/Inventory/HotbarSlotSelectionHandlerEnginePatch.cs b/GamecraftModdingAPI/Inventory/HotbarSlotSelectionHandlerEnginePatch.cs index 9a81f99..a0ad5c1 100644 --- a/GamecraftModdingAPI/Inventory/HotbarSlotSelectionHandlerEnginePatch.cs +++ b/GamecraftModdingAPI/Inventory/HotbarSlotSelectionHandlerEnginePatch.cs @@ -15,7 +15,7 @@ namespace GamecraftModdingAPI.Inventory public static BlockIDs EquippedPartID { get => (BlockIDs)selectedBlockInt; } - private static MethodInfo PatchedMethod { get; } = AccessTools.Method("Gamecraft.GUI.Hotbar.Blocks.SyncHotbarSlotSelectedToEquipedPartEngine:ActivateSlotForCube", parameters: new Type[] { typeof(uint), typeof(int), typeof(ExclusiveGroupStruct) }); + private static MethodInfo PatchedMethod { get; } = AccessTools.Method("Gamecraft.GUI.Hotbar.Blocks.SyncHotbarSlotSelectedToEquippedPartEngine:ActivateSlotForCube", parameters: new Type[] { typeof(uint), typeof(int), typeof(ExclusiveGroupStruct) }); public static void Prefix(uint playerID, int selectedDBPartID, ExclusiveGroupStruct groupID) { -- 2.30.2 From 1a986056a12cca0d07ca4be7516922a3fe65208b Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Tue, 10 Nov 2020 16:37:20 +0100 Subject: [PATCH 121/252] Add new blocks and some blueprint/block group support --- GamecraftModdingAPI/Block.cs | 13 +++- GamecraftModdingAPI/BlockGroup.cs | 46 +++++++++++ GamecraftModdingAPI/Blocks/BlockIDs.cs | 2 + GamecraftModdingAPI/Blocks/BlueprintEngine.cs | 77 +++++++++++++++++++ GamecraftModdingAPI/Blueprint.cs | 20 +++++ GamecraftModdingAPI/Main.cs | 1 + 6 files changed, 158 insertions(+), 1 deletion(-) create mode 100644 GamecraftModdingAPI/BlockGroup.cs create mode 100644 GamecraftModdingAPI/Blocks/BlueprintEngine.cs create mode 100644 GamecraftModdingAPI/Blueprint.cs diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index 81d6439..862db3f 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -3,12 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Reflection.Emit; +using Gamecraft.Blocks.BlockGroups; using Svelto.ECS; using Svelto.ECS.EntityStructs; using RobocraftX.Common; using RobocraftX.Blocks; using Unity.Mathematics; -using Unity.Entities; using Gamecraft.Blocks.GUI; using GamecraftModdingAPI.Blocks; @@ -354,6 +354,17 @@ namespace GamecraftModdingAPI } } + /// + /// Returns the block group this block is a part of. Block groups can be placed using blueprints. + /// Returns null if not part of a group. + /// + public BlockGroup BlockGroup + { + get => BlockEngine.GetBlockInfo(this, + (BlockGroupEntityComponent bgec) => + bgec.currentBlockGroup == -1 ? null : new BlockGroup(bgec.currentBlockGroup, this)); + } + /// /// Whether the block exists. The other properties will return a default value if the block doesn't exist. /// If the block was just placed, then this will also return false but the properties will work correctly. diff --git a/GamecraftModdingAPI/BlockGroup.cs b/GamecraftModdingAPI/BlockGroup.cs new file mode 100644 index 0000000..2cd0f42 --- /dev/null +++ b/GamecraftModdingAPI/BlockGroup.cs @@ -0,0 +1,46 @@ +using Gamecraft.Blocks.BlockGroups; +using GamecraftModdingAPI.Blocks; +using GamecraftModdingAPI.Utility; + +namespace GamecraftModdingAPI +{ + /// + /// A group of blocks that can be selected together. The placed version of blueprints. + /// + public class BlockGroup + { + internal static BlueprintEngine _engine = new BlueprintEngine(); + public int Id { get; } + private Block _sourceBlock; + + internal BlockGroup(int id, Block block) + { + if (id == BlockGroupUtility.GROUP_UNASSIGNED) + throw new BlockException("Cannot create a block group for blocks without a group!"); + Id = id; + _sourceBlock = block; + } + + /// + /// Collects each block that is a part of this group. + /// + /// An array of blocks + public Block[] GetBlocks() + { + return _engine.GetBlocksFromGroup(_sourceBlock.Id); + } + + /// + /// Removes all of the blocks in this group from the world. + /// + public void Remove() + { + _engine.RemoveBlockGroup(Id); + } + + public static void Init() + { + GameEngineManager.AddGameEngine(_engine); + } + } +} \ No newline at end of file diff --git a/GamecraftModdingAPI/Blocks/BlockIDs.cs b/GamecraftModdingAPI/Blocks/BlockIDs.cs index d867ce0..1d55b29 100644 --- a/GamecraftModdingAPI/Blocks/BlockIDs.cs +++ b/GamecraftModdingAPI/Blocks/BlockIDs.cs @@ -327,6 +327,8 @@ namespace GamecraftModdingAPI.Blocks SpotLightInvisible, UnlitSlope, UnlitGlowSlope, + Fog, + Sky, MagmaRockCube = 777, MagmaRockCubeSliced, MagmaRockSlope, diff --git a/GamecraftModdingAPI/Blocks/BlueprintEngine.cs b/GamecraftModdingAPI/Blocks/BlueprintEngine.cs new file mode 100644 index 0000000..7f0a616 --- /dev/null +++ b/GamecraftModdingAPI/Blocks/BlueprintEngine.cs @@ -0,0 +1,77 @@ +using System.Reflection; +using Gamecraft.Blocks.BlockGroups; +using Gamecraft.GUI.Blueprints; +using GamecraftModdingAPI.Engines; +using HarmonyLib; +using RobocraftX.Blocks; +using Svelto.DataStructures; +using Svelto.ECS; +using Svelto.ECS.DataStructures; +using Unity.Collections; + +namespace GamecraftModdingAPI.Blocks +{ + public class BlueprintEngine : IApiEngine + { + private readonly MethodInfo getBlocksFromGroup = + AccessTools.Method("RobocraftX.CR.MachineEditing.PlaceBlockUtility:GetBlocksSharingBlockgroup"); + private readonly NativeDynamicArray selectedBlocksInGroup = new NativeDynamicArray(); + private readonly NativeHashSet removedConnections = new NativeHashSet(); + + private static NativeEntityRemove nativeRemove; + private static MachineGraphConnectionEntityFactory connectionFactory; + + public void Ready() + { + } + + public EntitiesDB entitiesDB { get; set; } + public void Dispose() + { + } + + public Block[] GetBlocksFromGroup(EGID blockID) + { + var list = new FasterList(); + object blockPos = null, blockRot = null; + getBlocksFromGroup.Invoke(null, new[] {blockID, selectedBlocksInGroup, entitiesDB, blockPos, blockRot}); + for (uint i = 0; i < selectedBlocksInGroup.Count(); i++) + list.Add(new Block(selectedBlocksInGroup.Get(i))); + selectedBlocksInGroup.FastClear(); + return list.ToArray(); + } + + public void RemoveBlockGroup(int id) + { + BlockGroupUtility.RemoveAllBlocksInBlockGroup(id, entitiesDB, removedConnections, nativeRemove, + connectionFactory, default).Complete(); + } + + public void SelectBlueprint(uint resourceID) + { + BlueprintUtil.SelectBlueprint(null, new BlueprintInventoryItemEntityStruct + { + blueprintResourceId = resourceID, + }); + } + + public string Name { get; } = "GamecraftModdingAPIBlueprintGameEngine"; + public bool isRemovable { get; } + + [HarmonyPatch] + private static class RemoveEnginePatch + { + public static void Prefix(IEntityFunctions entityFunctions, + MachineGraphConnectionEntityFactory machineGraphConnectionEntityFactory) + { + nativeRemove = entityFunctions.ToNativeRemove("GCAPI" + nameof(BlueprintEngine)); + connectionFactory = machineGraphConnectionEntityFactory; + } + + public static MethodBase TargetMethod() + { + return AccessTools.Constructor(AccessTools.TypeByName("RobocraftX.CR.MachineEditing.RemoveBlockEngine")); + } + } + } +} \ No newline at end of file diff --git a/GamecraftModdingAPI/Blueprint.cs b/GamecraftModdingAPI/Blueprint.cs new file mode 100644 index 0000000..de6d65e --- /dev/null +++ b/GamecraftModdingAPI/Blueprint.cs @@ -0,0 +1,20 @@ +using Gamecraft.GUI.Blueprints; + +namespace GamecraftModdingAPI +{ + /// + /// Represents a blueprint in the inventory. When placed it becomes a block group. + /// + public class Blueprint + { + public uint Id { get; } + + /*public static void SelectBlueprint(Blueprint blueprint) + { + BlueprintUtil.SelectBlueprint(null, new BlueprintInventoryItemEntityStruct + { + blueprintResourceId = blueprint.Id + }); + }*/ + } +} \ No newline at end of file diff --git a/GamecraftModdingAPI/Main.cs b/GamecraftModdingAPI/Main.cs index 98fb6f6..584ae90 100644 --- a/GamecraftModdingAPI/Main.cs +++ b/GamecraftModdingAPI/Main.cs @@ -83,6 +83,7 @@ namespace GamecraftModdingAPI // init object-oriented classes Player.Init(); Block.Init(); + BlockGroup.Init(); Wire.Init(); GameClient.Init(); AsyncUtils.Init(); -- 2.30.2 From 2179ba6386f96fe0a6f27491b7d668a3f0c2ed35 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Tue, 10 Nov 2020 19:28:36 +0100 Subject: [PATCH 122/252] Add support for setting and placing blueprints --- GamecraftModdingAPI/Blocks/BlueprintEngine.cs | 145 +++++++++++++++++- GamecraftModdingAPI/Blueprint.cs | 48 +++++- GamecraftModdingAPI/Utility/FullGameFields.cs | 9 ++ 3 files changed, 199 insertions(+), 3 deletions(-) diff --git a/GamecraftModdingAPI/Blocks/BlueprintEngine.cs b/GamecraftModdingAPI/Blocks/BlueprintEngine.cs index 7f0a616..f2f0bef 100644 --- a/GamecraftModdingAPI/Blocks/BlueprintEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlueprintEngine.cs @@ -1,13 +1,22 @@ -using System.Reflection; +using System; +using System.Reflection; using Gamecraft.Blocks.BlockGroups; using Gamecraft.GUI.Blueprints; using GamecraftModdingAPI.Engines; +using GamecraftModdingAPI.Utility; using HarmonyLib; using RobocraftX.Blocks; +using RobocraftX.Common; +using RobocraftX.CR.MachineEditing.BoxSelect; +using RobocraftX.CR.MachineEditing.BoxSelect.ClipboardOperations; using Svelto.DataStructures; using Svelto.ECS; using Svelto.ECS.DataStructures; +using Svelto.ECS.EntityStructs; +using Svelto.ECS.Serialization; using Unity.Collections; +using Unity.Mathematics; +using UnityEngine; namespace GamecraftModdingAPI.Blocks { @@ -18,8 +27,20 @@ namespace GamecraftModdingAPI.Blocks private readonly NativeDynamicArray selectedBlocksInGroup = new NativeDynamicArray(); private readonly NativeHashSet removedConnections = new NativeHashSet(); + private static readonly Type PlaceBlueprintUtilityType = + AccessTools.TypeByName("RobocraftX.CR.MachineEditing.PlaceBlueprintUtility"); + private static readonly FieldInfo LocalBlockMap = + AccessTools.DeclaredField(PlaceBlueprintUtilityType, "_localBlockMap"); + private static readonly MethodInfo BuildBlock = AccessTools.Method(PlaceBlueprintUtilityType, "BuildBlock"); + private static readonly MethodInfo BuildWires = AccessTools.Method(PlaceBlueprintUtilityType, "BuildWires"); + private static NativeEntityRemove nativeRemove; private static MachineGraphConnectionEntityFactory connectionFactory; + private static IEntityFunctions entityFunctions; + private static ClipboardSerializationDataResourceManager clipboardManager; + private static IEntitySerialization entitySerialization; + private static IEntityFactory entityFactory; + private static FasterList globalBlockMap; public void Ready() { @@ -55,6 +76,109 @@ namespace GamecraftModdingAPI.Blocks }); } + public uint CreateBlueprint() + { + uint index = clipboardManager.AllocateSerializationData(); + return index; + } + + public void ReplaceBlueprint(uint playerID, uint blueprintID, Block[] selected, float3 pos, quaternion rot) + { + var blockIDs = new EGID[selected.Length]; + for (var i = 0; i < selected.Length; i++) + { + var block = selected[i]; + blockIDs[i] = block.Id; + } + + var serializationData = clipboardManager.GetSerializationData(blueprintID); + SelectionSerializationUtility.ClearClipboard(playerID, entitiesDB, entityFunctions, serializationData.blueprintData); + if (selected.Length == 0) + return; + //ref BlockGroupTransformEntityComponent groupTransform = ref EntityNativeDBExtensions.QueryEntity(entitiesDb, (uint) local1.currentBlockGroup, BlockGroupExclusiveGroups.BlockGroupEntityGroup); + //ref ColliderAabb collider = ref EntityNativeDBExtensions.QueryEntity(entitiesDB, (uint) groupID, BlockGroupExclusiveGroups.BlockGroupEntityGroup); + //float3 bottomOffset = PlaceBlockUtility.GetBottomOffset(collider); + //var rootPosition = math.mul(groupTransform.blockGroupGridRotation, bottomOffset) + groupTransform.blockGroupGridPosition; + //var rootRotation = groupTransform.blockGroupGridRotation; + if (math.all(pos == default)) + pos = selected[0].Position; + if (math.all(rot.value == default)) + rot = Quaternion.Euler(selected[0].Rotation); + + clipboardManager.SetGhostSerialized(blueprintID, false); + SelectionSerializationUtility.CopySelectionToClipboard(playerID, entitiesDB, + serializationData.blueprintData, entitySerialization, entityFactory, blockIDs, + (uint) blockIDs.Length, pos, rot); + } + + public Block[] PlaceBlueprintBlocks(uint blueprintID, uint playerID, float3 pos, float3 rot) + { //RobocraftX.CR.MachineEditing.PlaceBlueprintUtility.PlaceBlocksFromSerialisedData + var serializationData = clipboardManager.GetSerializationData(blueprintID); + var blueprintData = serializationData.blueprintData; + blueprintData.dataPos = 0U; + uint selectionSize; + PositionEntityStruct selectionPosition; + RotationEntityStruct selectionRotation; + uint version; + BoxSelectSerializationUtilities.ReadClipboardHeader(blueprintData, out selectionSize, out selectionPosition, out selectionRotation, out version); + ((FasterList) LocalBlockMap.GetValue(null)).Clear(); + if (version <= 1U) + { + uint groupsCount; + BoxSelectSerializationUtilities.ReadBlockGroupData(blueprintData, out groupsCount); + for (int index = 0; (long) index < (long) groupsCount; ++index) + { + int nextFilterId = BlockGroupUtility.NextFilterId; + entitySerialization.DeserializeNewEntity(new EGID((uint) nextFilterId, BlockGroupExclusiveGroups.BlockGroupEntityGroup), blueprintData, 1); + } + } + int nextFilterId1 = BlockGroupUtility.NextFilterId; + entityFactory.BuildEntity(new EGID((uint) nextFilterId1, BlockGroupExclusiveGroups.BlockGroupEntityGroup)).Init(new BlockGroupTransformEntityComponent + { + blockGroupGridPosition = selectionPosition.position, + blockGroupGridRotation = selectionRotation.rotation + }); + var frot = Quaternion.Euler(rot); + var grid = new GridRotationStruct {position = pos, rotation = frot}; + var poss = new PositionEntityStruct {position = pos}; + var rots = new RotationEntityStruct {rotation = frot}; + for (int index = 0; (long) index < (long) selectionSize; ++index) + BuildBlock.Invoke(null, + new object[] + { + playerID, grid, poss, rots, selectionPosition, selectionRotation, blueprintData, + entitiesDB, entitySerialization, nextFilterId1 + }); + /* + uint playerId, in GridRotationStruct ghostParentGrid, + in PositionEntityStruct ghostParentPosition, in RotationEntityStruct ghostParentRotation, + in PositionEntityStruct selectionPosition, in RotationEntityStruct selectionRotation, + ISerializationData serializationData, EntitiesDB entitiesDb, + IEntitySerialization entitySerialization, int blockGroupId + */ + if (globalBlockMap == null) + globalBlockMap = FullGameFields._deserialisedBlockMap; + var placedBlocks = (FasterList) LocalBlockMap.GetValue(null); + globalBlockMap.Clear(); + globalBlockMap.AddRange(placedBlocks); + BuildWires.Invoke(null, + new object[] {playerID, blueprintData, entitySerialization, entitiesDB, entityFactory}); + var blocks = new Block[placedBlocks.count]; + for (int i = 0; i < blocks.Length; i++) + blocks[i] = new Block(placedBlocks[i]); + return blocks; + } + + public void InitBlueprint(uint blueprintID) + { + clipboardManager.IncrementRefCount(blueprintID); + } + + public void DisposeBlueprint(uint blueprintID) + { + clipboardManager.DecrementRefCount(blueprintID); + } + public string Name { get; } = "GamecraftModdingAPIBlueprintGameEngine"; public bool isRemovable { get; } @@ -66,6 +190,7 @@ namespace GamecraftModdingAPI.Blocks { nativeRemove = entityFunctions.ToNativeRemove("GCAPI" + nameof(BlueprintEngine)); connectionFactory = machineGraphConnectionEntityFactory; + BlueprintEngine.entityFunctions = entityFunctions; } public static MethodBase TargetMethod() @@ -73,5 +198,23 @@ namespace GamecraftModdingAPI.Blocks return AccessTools.Constructor(AccessTools.TypeByName("RobocraftX.CR.MachineEditing.RemoveBlockEngine")); } } + + [HarmonyPatch] + private static class SelectEnginePatch + { + public static void Prefix(ClipboardSerializationDataResourceManager clipboardSerializationDataResourceManager, + IEntitySerialization entitySerialization, + IEntityFactory entityFactory) + { + clipboardManager = clipboardSerializationDataResourceManager; + BlueprintEngine.entitySerialization = entitySerialization; + BlueprintEngine.entityFactory = entityFactory; + } + + public static MethodBase TargetMethod() + { + return AccessTools.Constructor(AccessTools.TypeByName("RobocraftX.CR.MachineEditing.SelectBlockEngine")); + } + } } } \ No newline at end of file diff --git a/GamecraftModdingAPI/Blueprint.cs b/GamecraftModdingAPI/Blueprint.cs index de6d65e..26876f6 100644 --- a/GamecraftModdingAPI/Blueprint.cs +++ b/GamecraftModdingAPI/Blueprint.cs @@ -1,13 +1,20 @@ -using Gamecraft.GUI.Blueprints; +using System; +using Unity.Mathematics; namespace GamecraftModdingAPI { /// /// Represents a blueprint in the inventory. When placed it becomes a block group. /// - public class Blueprint + public class Blueprint : IDisposable { public uint Id { get; } + + internal Blueprint(uint id) + { + Id = id; + BlockGroup._engine.InitBlueprint(id); + } /*public static void SelectBlueprint(Blueprint blueprint) { @@ -16,5 +23,42 @@ namespace GamecraftModdingAPI blueprintResourceId = blueprint.Id }); }*/ + + /// + /// Creates a new, empty blueprint. It will be deleted on disposal unless the game holds a reference to it. + /// + /// A blueprint that doesn't have any blocks + public static Blueprint Create() + { + return new Blueprint(BlockGroup._engine.CreateBlueprint()); + } + + /// + /// Set the blocks that the blueprint contains. + /// + /// The array of blocks to use + /// The anchor position of the blueprint + /// The rotation of the blueprint + public void SetStoredBlocks(Block[] blocks, float3 position = default, float3 rotation = default) + { + BlockGroup._engine.ReplaceBlueprint(Player.LocalPlayer.Id, Id, blocks, position, + quaternion.Euler(rotation)); + } + + /// + /// Places the blocks the blueprint contains at the specified position and rotation. + /// + /// The position of the blueprint + /// The rotation of the blueprint + /// An array of the placed blocks + public Block[] PlaceBlocks(float3 position, float3 rotation) + { + return BlockGroup._engine.PlaceBlueprintBlocks(Id, Player.LocalPlayer.Id, position, rotation); + } + + public void Dispose() + { + BlockGroup._engine.DisposeBlueprint(Id); + } } } \ No newline at end of file diff --git a/GamecraftModdingAPI/Utility/FullGameFields.cs b/GamecraftModdingAPI/Utility/FullGameFields.cs index 8fd8895..432103d 100644 --- a/GamecraftModdingAPI/Utility/FullGameFields.cs +++ b/GamecraftModdingAPI/Utility/FullGameFields.cs @@ -12,6 +12,7 @@ using RobocraftX.GUI; using RobocraftX.Multiplayer; using RobocraftX.Rendering; using Svelto.Context; +using Svelto.DataStructures; using Svelto.ECS; using Svelto.ECS.Schedulers.Unity; using UnityEngine; @@ -159,6 +160,14 @@ namespace GamecraftModdingAPI.Utility } } + public static FasterList _deserialisedBlockMap + { + get + { + return (FasterList) fgcr?.Field("_deserialisedBlockMap").GetValue(); + } + } + private static Traverse fgcr; public static void Init(FullGameCompositionRoot instance) -- 2.30.2 From f1376f5df6a4d01183f610391458df400826f973 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Tue, 10 Nov 2020 23:08:27 +0100 Subject: [PATCH 123/252] Replace ToManagedArray() and fix getting blocks from group --- GamecraftModdingAPI/App/GameGameEngine.cs | 21 ++++++++++--- GamecraftModdingAPI/BlockGroup.cs | 24 +++++++++++--- GamecraftModdingAPI/Blocks/BlockEngine.cs | 17 +++++++--- GamecraftModdingAPI/Blocks/BlueprintEngine.cs | 31 ++++++++++++------- 4 files changed, 68 insertions(+), 25 deletions(-) diff --git a/GamecraftModdingAPI/App/GameGameEngine.cs b/GamecraftModdingAPI/App/GameGameEngine.cs index dea3821..85fb672 100644 --- a/GamecraftModdingAPI/App/GameGameEngine.cs +++ b/GamecraftModdingAPI/App/GameGameEngine.cs @@ -102,16 +102,27 @@ namespace GamecraftModdingAPI.App if (filter == BlockIDs.Invalid) { foreach (var (blocks, _) in allBlocks) - foreach (var block in blocks.ToBuffer().buffer.ToManagedArray()) - blockEGIDs.Add(block.ID); + { + var buffer = blocks.ToBuffer().buffer; + for (int i = 0; i < buffer.capacity; i++) + blockEGIDs.Add(buffer[i].ID); + } + return blockEGIDs.ToArray(); } else { foreach (var (blocks, _) in allBlocks) - foreach (var block in blocks.ToBuffer().buffer.ToManagedArray()) - if (block.DBID == (ulong) filter) - blockEGIDs.Add(block.ID); + { + var array = blocks.ToBuffer().buffer; + for (var index = 0; index < array.capacity; index++) + { + var block = array[index]; + if (block.DBID == (ulong) filter) + blockEGIDs.Add(block.ID); + } + } + return blockEGIDs.ToArray(); } } diff --git a/GamecraftModdingAPI/BlockGroup.cs b/GamecraftModdingAPI/BlockGroup.cs index 2cd0f42..8d9e761 100644 --- a/GamecraftModdingAPI/BlockGroup.cs +++ b/GamecraftModdingAPI/BlockGroup.cs @@ -1,4 +1,7 @@ using Gamecraft.Blocks.BlockGroups; +using Unity.Mathematics; +using UnityEngine; + using GamecraftModdingAPI.Blocks; using GamecraftModdingAPI.Utility; @@ -11,23 +14,36 @@ namespace GamecraftModdingAPI { internal static BlueprintEngine _engine = new BlueprintEngine(); public int Id { get; } - private Block _sourceBlock; + private readonly Block sourceBlock; internal BlockGroup(int id, Block block) { if (id == BlockGroupUtility.GROUP_UNASSIGNED) throw new BlockException("Cannot create a block group for blocks without a group!"); Id = id; - _sourceBlock = block; + sourceBlock = block; } + + /// + /// The position of the block group. Calculated when GetBlocks() is used. + /// + public float3 Position { get; private set; } + + /// + /// The rotation of the block group. Calculated when GetBlocks() is used. + /// + public float3 Rotation { get; private set; } /// - /// Collects each block that is a part of this group. + /// Collects each block that is a part of this group. Also sets the position and rotation. /// /// An array of blocks public Block[] GetBlocks() { - return _engine.GetBlocksFromGroup(_sourceBlock.Id); + var ret = _engine.GetBlocksFromGroup(sourceBlock.Id, out var pos, out var rot); + Position = pos; + Rotation = ((Quaternion) rot).eulerAngles; + return ret; } /// diff --git a/GamecraftModdingAPI/Blocks/BlockEngine.cs b/GamecraftModdingAPI/Blocks/BlockEngine.cs index 5566525..9ce6d62 100644 --- a/GamecraftModdingAPI/Blocks/BlockEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlockEngine.cs @@ -12,9 +12,9 @@ using RobocraftX.Scene.Simulation; using Svelto.DataStructures; using Svelto.ECS; using Svelto.ECS.Hybrid; +using Unity.Mathematics; using GamecraftModdingAPI.Engines; -using Unity.Mathematics; namespace GamecraftModdingAPI.Blocks { @@ -224,8 +224,10 @@ namespace GamecraftModdingAPI.Blocks var bodies = new HashSet(); foreach (var (coll, _) in groups) { - foreach (var conn in coll.ToBuffer().buffer.ToManagedArray()) + var array = coll.ToBuffer().buffer; + for (var index = 0; index < array.capacity; index++) { + var conn = array[index]; if (conn.clusterId == cid) bodies.Add(conn.machineRigidBodyId); } @@ -251,8 +253,11 @@ namespace GamecraftModdingAPI.Blocks var groups = entitiesDB.QueryEntities(); foreach (var (coll, _) in groups) { - foreach (var conn in coll.ToBuffer().buffer.ToManagedArray()) - { //Static blocks don't have a cluster ID but the cluster destruction manager should have one + var array = coll.ToBuffer().buffer; + for (var index = 0; index < array.capacity; index++) + { + var conn = array[index]; + //Static blocks don't have a cluster ID but the cluster destruction manager should have one if (conn.machineRigidBodyId == sbid && conn.clusterId != uint.MaxValue) return new Cluster(conn.clusterId); } @@ -267,8 +272,10 @@ namespace GamecraftModdingAPI.Blocks var set = new HashSet(); foreach (var (coll, _) in groups) { - foreach (var conn in coll.ToBuffer().buffer.ToManagedArray()) + var array = coll.ToBuffer().buffer; + for (var index = 0; index < array.capacity; index++) { + var conn = array[index]; if (conn.machineRigidBodyId == sbid) set.Add(new Block(conn.ID)); } diff --git a/GamecraftModdingAPI/Blocks/BlueprintEngine.cs b/GamecraftModdingAPI/Blocks/BlueprintEngine.cs index f2f0bef..4104ae6 100644 --- a/GamecraftModdingAPI/Blocks/BlueprintEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlueprintEngine.cs @@ -17,6 +17,7 @@ using Svelto.ECS.Serialization; using Unity.Collections; using Unity.Mathematics; using UnityEngine; +using Allocator = Svelto.Common.Allocator; namespace GamecraftModdingAPI.Blocks { @@ -24,8 +25,9 @@ namespace GamecraftModdingAPI.Blocks { private readonly MethodInfo getBlocksFromGroup = AccessTools.Method("RobocraftX.CR.MachineEditing.PlaceBlockUtility:GetBlocksSharingBlockgroup"); - private readonly NativeDynamicArray selectedBlocksInGroup = new NativeDynamicArray(); - private readonly NativeHashSet removedConnections = new NativeHashSet(); + + private NativeDynamicArray selectedBlocksInGroup; + private NativeHashSet removedConnections = new NativeHashSet(); private static readonly Type PlaceBlueprintUtilityType = AccessTools.TypeByName("RobocraftX.CR.MachineEditing.PlaceBlueprintUtility"); @@ -44,22 +46,29 @@ namespace GamecraftModdingAPI.Blocks public void Ready() { + selectedBlocksInGroup = NativeDynamicArray.Alloc(Allocator.Persistent); } public EntitiesDB entitiesDB { get; set; } public void Dispose() { + selectedBlocksInGroup.Dispose(); } - public Block[] GetBlocksFromGroup(EGID blockID) + public Block[] GetBlocksFromGroup(EGID blockID, out float3 pos, out quaternion rot) { - var list = new FasterList(); - object blockPos = null, blockRot = null; - getBlocksFromGroup.Invoke(null, new[] {blockID, selectedBlocksInGroup, entitiesDB, blockPos, blockRot}); - for (uint i = 0; i < selectedBlocksInGroup.Count(); i++) - list.Add(new Block(selectedBlocksInGroup.Get(i))); + var blockPos = default(float3); + var blockRot = default(quaternion); + var parameters = new object[] {blockID, selectedBlocksInGroup, entitiesDB, blockPos, blockRot}; + getBlocksFromGroup.Invoke(null, parameters); + pos = (float3) parameters[3]; + rot = (quaternion) parameters[4]; + int count = selectedBlocksInGroup.Count(); + var ret = new Block[count]; + for (uint i = 0; i < count; i++) + ret[i] = new Block(selectedBlocksInGroup.Get(i)); selectedBlocksInGroup.FastClear(); - return list.ToArray(); + return ret; } public void RemoveBlockGroup(int id) @@ -195,7 +204,7 @@ namespace GamecraftModdingAPI.Blocks public static MethodBase TargetMethod() { - return AccessTools.Constructor(AccessTools.TypeByName("RobocraftX.CR.MachineEditing.RemoveBlockEngine")); + return AccessTools.GetDeclaredConstructors(AccessTools.TypeByName("RobocraftX.CR.MachineEditing.RemoveBlockEngine"))[0]; } } @@ -213,7 +222,7 @@ namespace GamecraftModdingAPI.Blocks public static MethodBase TargetMethod() { - return AccessTools.Constructor(AccessTools.TypeByName("RobocraftX.CR.MachineEditing.SelectBlockEngine")); + return AccessTools.GetDeclaredConstructors(AccessTools.TypeByName("RobocraftX.CR.MachineEditing.SelectBlockEngine"))[0]; } } } -- 2.30.2 From 4580ae3b66564dae86e66e6fe905eac683a37f0d Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Thu, 12 Nov 2020 02:39:58 +0100 Subject: [PATCH 124/252] Add ability to create & move block groups & other stuff Added a way to store block groups as blueprints Blocks can be added/removed from block groups, although it doesn't work well atm Added some patches to the test class in an attempt to debug an unrelated issue Added a command to test placing a block group Added a SelectedBlueprint property to the Player class --- GamecraftModdingAPI/Block.cs | 28 +++- GamecraftModdingAPI/BlockGroup.cs | 153 ++++++++++++++++-- .../Blocks/BlockEventsEngine.cs | 11 +- GamecraftModdingAPI/Blocks/BlueprintEngine.cs | 49 ++++-- GamecraftModdingAPI/Blocks/PlacementEngine.cs | 8 +- GamecraftModdingAPI/Blueprint.cs | 16 +- GamecraftModdingAPI/Player.cs | 13 +- .../Tests/GamecraftModdingAPIPluginTest.cs | 101 ++++++++++++ 8 files changed, 332 insertions(+), 47 deletions(-) diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index 862db3f..33a1623 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -240,6 +240,8 @@ namespace GamecraftModdingAPI set { MovementEngine.MoveBlock(Id, InitData, value); + if (blockGroup != null) + blockGroup.PosAndRotCalculated = false; } } @@ -252,6 +254,8 @@ namespace GamecraftModdingAPI set { RotationEngine.RotateBlock(Id, InitData, value); + if (blockGroup != null) + blockGroup.PosAndRotCalculated = false; } } @@ -354,15 +358,31 @@ namespace GamecraftModdingAPI } } + private BlockGroup blockGroup; /// /// Returns the block group this block is a part of. Block groups can be placed using blueprints. - /// Returns null if not part of a group. + /// Returns null if not part of a group.
+ /// Setting the group after the block has been initialized will not update everything properly. + /// You should only set this property on blocks newly placed by your code. ///
public BlockGroup BlockGroup { - get => BlockEngine.GetBlockInfo(this, - (BlockGroupEntityComponent bgec) => - bgec.currentBlockGroup == -1 ? null : new BlockGroup(bgec.currentBlockGroup, this)); + get + { + if (blockGroup != null) return blockGroup; + return blockGroup = BlockEngine.GetBlockInfo(this, + (BlockGroupEntityComponent bgec) => + bgec.currentBlockGroup == -1 ? null : new BlockGroup(bgec.currentBlockGroup, this)); + } + set + { + blockGroup?.RemoveInternal(this); + BlockEngine.SetBlockInfo(this, + (ref BlockGroupEntityComponent bgec, BlockGroup val) => bgec.currentBlockGroup = val?.Id ?? -1, + value); + value?.AddInternal(this); + blockGroup = value; + } } /// diff --git a/GamecraftModdingAPI/BlockGroup.cs b/GamecraftModdingAPI/BlockGroup.cs index 8d9e761..d660236 100644 --- a/GamecraftModdingAPI/BlockGroup.cs +++ b/GamecraftModdingAPI/BlockGroup.cs @@ -1,4 +1,8 @@ -using Gamecraft.Blocks.BlockGroups; +using System; +using System.Collections; +using System.Collections.Generic; + +using Gamecraft.Blocks.BlockGroups; using Unity.Mathematics; using UnityEngine; @@ -10,11 +14,14 @@ namespace GamecraftModdingAPI /// /// A group of blocks that can be selected together. The placed version of blueprints. /// - public class BlockGroup + public class BlockGroup : ICollection { internal static BlueprintEngine _engine = new BlueprintEngine(); public int Id { get; } private readonly Block sourceBlock; + private readonly List blocks; + private float3 position, rotation; + internal bool PosAndRotCalculated; internal BlockGroup(int id, Block block) { @@ -22,41 +29,155 @@ namespace GamecraftModdingAPI throw new BlockException("Cannot create a block group for blocks without a group!"); Id = id; sourceBlock = block; + blocks = new List(GetBlocks()); } /// - /// The position of the block group. Calculated when GetBlocks() is used. + /// The position of the block group (center). Recalculated if blocks have been added/removed since the last query. /// - public float3 Position { get; private set; } - + public float3 Position + { + get + { + if (!PosAndRotCalculated) + Refresh(); + return position; + } + set + { + var diff = value - position; + foreach (var block in blocks) + block.Position += diff; + if (!PosAndRotCalculated) //The condition can only be true if a block has been added/removed manually + Refresh(); //So the blocks array is up to date + else + position += diff; + } + } + /// - /// The rotation of the block group. Calculated when GetBlocks() is used. + /// The rotation of the block group. Recalculated if blocks have been added/removed since the last query. /// - public float3 Rotation { get; private set; } + public float3 Rotation + { + get + { + if (!PosAndRotCalculated) + Refresh(); + return rotation; + } + set + { + var diff = value - rotation; + var qdiff = Quaternion.Euler(diff); + foreach (var block in blocks) + { + block.Rotation += diff; + block.Position = qdiff * block.Position; + } + if (!PosAndRotCalculated) + Refresh(); + else + rotation += diff; + } + } + + /*/// + /// Removes all of the blocks in this group from the world. + /// + public void RemoveBlocks() + { + _engine.RemoveBlockGroup(Id); - TODO: Causes a hard crash + }*/ + + /// + /// Creates a new block group consisting of a single block. + /// You can add more blocks using the Add() method or by setting the BlockGroup property of the blocks.
+ /// Note that only newly placed blocks should be added to groups. + ///
+ /// The block to add + /// A new block group containing the given block + public static BlockGroup Create(Block block) + { + return new BlockGroup(_engine.CreateBlockGroup(default, default), block); + } /// /// Collects each block that is a part of this group. Also sets the position and rotation. /// /// An array of blocks - public Block[] GetBlocks() + private Block[] GetBlocks() { + if (!sourceBlock.Exists) return new[] {sourceBlock}; //The block must exist to get the others var ret = _engine.GetBlocksFromGroup(sourceBlock.Id, out var pos, out var rot); - Position = pos; - Rotation = ((Quaternion) rot).eulerAngles; + position = pos; + rotation = ((Quaternion) rot).eulerAngles; + PosAndRotCalculated = true; return ret; } - /// - /// Removes all of the blocks in this group from the world. - /// - public void Remove() + private void Refresh() { - _engine.RemoveBlockGroup(Id); + blocks.Clear(); + blocks.AddRange(GetBlocks()); } - public static void Init() + internal static void Init() { GameEngineManager.AddGameEngine(_engine); } + + public IEnumerator GetEnumerator() => blocks.GetEnumerator(); + IEnumerator IEnumerable.GetEnumerator() => blocks.GetEnumerator(); + + /// + /// Adds a block to the group. You should only add newly placed blocks + /// so that the game initializes the group membership properly. + /// + /// + /// + public void Add(Block item) + { + if (item == null) throw new NullReferenceException("Cannot add null to a block group"); + item.BlockGroup = this; //Calls AddInternal + } + + internal void AddInternal(Block item) => blocks.Add(item); + + /// + /// Removes all blocks from this group. + /// You should not remove blocks that have been initialized, only those that you placed recently. + /// + public void Clear() + { + while (blocks.Count > 0) + Remove(blocks[blocks.Count - 1]); + } + + public bool Contains(Block item) => blocks.Contains(item); + public void CopyTo(Block[] array, int arrayIndex) => blocks.CopyTo(array, arrayIndex); + + /// + /// Removes a block from this group. + /// You should not remove blocks that have been initialized, only those that you placed recently. + /// + /// + /// + /// + public bool Remove(Block item) + { + if (item == null) throw new NullReferenceException("Cannot remove null from a block group"); + bool ret = item.BlockGroup == this; + if (ret) + item.BlockGroup = null; //Calls RemoveInternal + return ret; + } + + internal void RemoveInternal(Block item) => blocks.Remove(item); + + public int Count => blocks.Count; + public bool IsReadOnly { get; } = false; + + public Block this[int index] => blocks[index]; //Setting is not supported, since the order doesn't matter } } \ No newline at end of file diff --git a/GamecraftModdingAPI/Blocks/BlockEventsEngine.cs b/GamecraftModdingAPI/Blocks/BlockEventsEngine.cs index 1e5ce21..d1c2639 100644 --- a/GamecraftModdingAPI/Blocks/BlockEventsEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlockEventsEngine.cs @@ -5,10 +5,11 @@ using Svelto.ECS; using GamecraftModdingAPI.Engines; using GamecraftModdingAPI.Utility; +using RobocraftX.Blocks; namespace GamecraftModdingAPI.Blocks { - public class BlockEventsEngine : IReactionaryEngine + public class BlockEventsEngine : IReactionaryEngine { public event EventHandler Placed; public event EventHandler Removed; @@ -27,20 +28,20 @@ namespace GamecraftModdingAPI.Blocks public bool isRemovable { get; } = false; private bool shouldAddRemove; - public void Add(ref DBEntityStruct entityComponent, EGID egid) + public void Add(ref BlockTagEntityStruct entityComponent, EGID egid) { if (!(shouldAddRemove = !shouldAddRemove)) return; ExceptionUtil.InvokeEvent(Placed, this, - new BlockPlacedRemovedEventArgs {ID = egid, Type = (BlockIDs) entityComponent.DBID}); + new BlockPlacedRemovedEventArgs {ID = egid}); } - public void Remove(ref DBEntityStruct entityComponent, EGID egid) + public void Remove(ref BlockTagEntityStruct entityComponent, EGID egid) { if (!(shouldAddRemove = !shouldAddRemove)) return; ExceptionUtil.InvokeEvent(Removed, this, - new BlockPlacedRemovedEventArgs {ID = egid, Type = (BlockIDs) entityComponent.DBID}); + new BlockPlacedRemovedEventArgs {ID = egid}); } } diff --git a/GamecraftModdingAPI/Blocks/BlueprintEngine.cs b/GamecraftModdingAPI/Blocks/BlueprintEngine.cs index 4104ae6..e46ad50 100644 --- a/GamecraftModdingAPI/Blocks/BlueprintEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlueprintEngine.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Reflection; using Gamecraft.Blocks.BlockGroups; using Gamecraft.GUI.Blueprints; @@ -21,7 +22,7 @@ using Allocator = Svelto.Common.Allocator; namespace GamecraftModdingAPI.Blocks { - public class BlueprintEngine : IApiEngine + public class BlueprintEngine : IFactoryEngine { private readonly MethodInfo getBlocksFromGroup = AccessTools.Method("RobocraftX.CR.MachineEditing.PlaceBlockUtility:GetBlocksSharingBlockgroup"); @@ -77,12 +78,29 @@ namespace GamecraftModdingAPI.Blocks connectionFactory, default).Complete(); } + public int CreateBlockGroup(float3 position, quaternion rotation) + { + int nextFilterId = BlockGroupUtility.NextFilterId; + Factory.BuildEntity((uint) nextFilterId, + BlockGroupExclusiveGroups.BlockGroupEntityGroup).Init(new BlockGroupTransformEntityComponent + { + blockGroupGridRotation = rotation, + blockGroupGridPosition = position + }); + return nextFilterId; + } + public void SelectBlueprint(uint resourceID) { - BlueprintUtil.SelectBlueprint(null, new BlueprintInventoryItemEntityStruct + if (resourceID == uint.MaxValue) + BlueprintUtil.UnselectBlueprint(entitiesDB); + else { - blueprintResourceId = resourceID, - }); + BlueprintUtil.SelectBlueprint(entitiesDB, new BlueprintInventoryItemEntityStruct + { + blueprintResourceId = resourceID, + }); + } } public uint CreateBlueprint() @@ -91,28 +109,27 @@ namespace GamecraftModdingAPI.Blocks return index; } - public void ReplaceBlueprint(uint playerID, uint blueprintID, Block[] selected, float3 pos, quaternion rot) + public void ReplaceBlueprint(uint playerID, uint blueprintID, ICollection selected, float3 pos, quaternion rot) { - var blockIDs = new EGID[selected.Length]; - for (var i = 0; i < selected.Length; i++) + var blockIDs = new EGID[selected.Count]; + using (var enumerator = selected.GetEnumerator()) { - var block = selected[i]; - blockIDs[i] = block.Id; + for (var i = 0; enumerator.MoveNext(); i++) + { + var block = enumerator.Current; + blockIDs[i] = block.Id; + } } var serializationData = clipboardManager.GetSerializationData(blueprintID); SelectionSerializationUtility.ClearClipboard(playerID, entitiesDB, entityFunctions, serializationData.blueprintData); - if (selected.Length == 0) + if (selected.Count == 0) return; //ref BlockGroupTransformEntityComponent groupTransform = ref EntityNativeDBExtensions.QueryEntity(entitiesDb, (uint) local1.currentBlockGroup, BlockGroupExclusiveGroups.BlockGroupEntityGroup); //ref ColliderAabb collider = ref EntityNativeDBExtensions.QueryEntity(entitiesDB, (uint) groupID, BlockGroupExclusiveGroups.BlockGroupEntityGroup); //float3 bottomOffset = PlaceBlockUtility.GetBottomOffset(collider); //var rootPosition = math.mul(groupTransform.blockGroupGridRotation, bottomOffset) + groupTransform.blockGroupGridPosition; //var rootRotation = groupTransform.blockGroupGridRotation; - if (math.all(pos == default)) - pos = selected[0].Position; - if (math.all(rot.value == default)) - rot = Quaternion.Euler(selected[0].Rotation); clipboardManager.SetGhostSerialized(blueprintID, false); SelectionSerializationUtility.CopySelectionToClipboard(playerID, entitiesDB, @@ -189,7 +206,7 @@ namespace GamecraftModdingAPI.Blocks } public string Name { get; } = "GamecraftModdingAPIBlueprintGameEngine"; - public bool isRemovable { get; } + public bool isRemovable { get; } = false; [HarmonyPatch] private static class RemoveEnginePatch @@ -225,5 +242,7 @@ namespace GamecraftModdingAPI.Blocks return AccessTools.GetDeclaredConstructors(AccessTools.TypeByName("RobocraftX.CR.MachineEditing.SelectBlockEngine"))[0]; } } + + public IEntityFactory Factory { get; set; } } } \ No newline at end of file diff --git a/GamecraftModdingAPI/Blocks/PlacementEngine.cs b/GamecraftModdingAPI/Blocks/PlacementEngine.cs index cf9a80f..5357e7f 100644 --- a/GamecraftModdingAPI/Blocks/PlacementEngine.cs +++ b/GamecraftModdingAPI/Blocks/PlacementEngine.cs @@ -53,15 +53,15 @@ namespace GamecraftModdingAPI.Blocks private EntityComponentInitializer BuildBlock(ushort block, byte color, float3 position, int uscale, float3 scale, float3 rot, uint playerId) { if (_blockEntityFactory == null) - throw new Exception("The factory is null."); + throw new BlockException("The factory is null."); if (uscale < 1) - throw new Exception("Scale needs to be at least 1"); + throw new BlockException("Scale needs to be at least 1"); if (scale.x < 4e-5) scale.x = uscale; if (scale.y < 4e-5) scale.y = uscale; if (scale.z < 4e-5) scale.z = uscale; uint dbid = block; - if (!PrefabsID.DBIDMAP.ContainsKey(dbid)) - throw new Exception("Block with ID " + dbid + " not found!"); + if (!PrefabsID.HasPrefabRegistered(dbid, 0)) + throw new BlockException("Block with ID " + dbid + " not found!"); //RobocraftX.CR.MachineEditing.PlaceBlockEngine ScalingEntityStruct scaling = new ScalingEntityStruct {scale = scale}; Quaternion rotQ = Quaternion.Euler(rot); diff --git a/GamecraftModdingAPI/Blueprint.cs b/GamecraftModdingAPI/Blueprint.cs index 26876f6..458c56c 100644 --- a/GamecraftModdingAPI/Blueprint.cs +++ b/GamecraftModdingAPI/Blueprint.cs @@ -1,5 +1,6 @@ using System; using Unity.Mathematics; +using UnityEngine; namespace GamecraftModdingAPI { @@ -35,16 +36,27 @@ namespace GamecraftModdingAPI /// /// Set the blocks that the blueprint contains. + /// Use the BlockGroup overload for automatically calculated position and rotation. /// /// The array of blocks to use /// The anchor position of the blueprint - /// The rotation of the blueprint - public void SetStoredBlocks(Block[] blocks, float3 position = default, float3 rotation = default) + /// The base rotation of the blueprint + public void StoreBlocks(Block[] blocks, float3 position, float3 rotation) { BlockGroup._engine.ReplaceBlueprint(Player.LocalPlayer.Id, Id, blocks, position, quaternion.Euler(rotation)); } + /// + /// Store the blocks from the given group in the blueprint with correct position and rotation for the blueprint. + /// + /// The block group to store + public void StoreBlocks(BlockGroup group) + { + BlockGroup._engine.ReplaceBlueprint(Player.LocalPlayer.Id, Id, group, group.Position, + Quaternion.Euler(group.Rotation)); + } + /// /// Places the blocks the blueprint contains at the specified position and rotation. /// diff --git a/GamecraftModdingAPI/Player.cs b/GamecraftModdingAPI/Player.cs index a4b7064..14892a3 100644 --- a/GamecraftModdingAPI/Player.cs +++ b/GamecraftModdingAPI/Player.cs @@ -1,5 +1,5 @@ using System; - +using Gamecraft.GUI.Blueprints; using Unity.Mathematics; using RobocraftX.Common; using RobocraftX.Common.Players; @@ -343,6 +343,17 @@ namespace GamecraftModdingAPI } } + /// + /// The player's selected blueprint in their hand. Set to null to clear. Dispose after usage. + /// + public Blueprint SelectedBlueprint + { + get => playerEngine.GetPlayerStruct(Id, out BlueprintInventoryItemEntityStruct biies) + ? new Blueprint(biies.blueprintResourceId) + : null; + set => BlockGroup._engine.SelectBlueprint(value?.Id ?? uint.MaxValue); + } + // object methods /// diff --git a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs index e3a9c50..c904ef7 100644 --- a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs +++ b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs @@ -1,24 +1,29 @@ using System; +using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; +using System.Reflection.Emit; using System.Text; using HarmonyLib; using IllusionInjector; // test +using GPUInstancer; using Svelto.ECS; using RobocraftX.Blocks; using RobocraftX.Common; using RobocraftX.SimulationModeState; using RobocraftX.FrontEnd; using Unity.Mathematics; +using UnityEngine; using GamecraftModdingAPI.Commands; using GamecraftModdingAPI.Events; using GamecraftModdingAPI.Utility; using GamecraftModdingAPI.Blocks; using GamecraftModdingAPI.Players; +using EventType = GamecraftModdingAPI.Events.EventType; namespace GamecraftModdingAPI.Tests { @@ -269,6 +274,20 @@ namespace GamecraftModdingAPI.Tests Logging.CommandLog("Health set to: " + val); }).Build(); + CommandBuilder.Builder("placeBlockGroup", "Places some blocks in a group") + .Action((float x, float y, float z) => + { + var pos = new float3(x, y, z); + var group = BlockGroup.Create(Block.PlaceNew(BlockIDs.AluminiumCube, pos, + color: BlockColors.Aqua)); + Block.PlaceNew(BlockIDs.AluminiumCube, pos += new float3(1, 0, 0), color: BlockColors.Blue) + .BlockGroup = group; + Block.PlaceNew(BlockIDs.AluminiumCube, pos += new float3(1, 0, 0), color: BlockColors.Green) + .BlockGroup = group; + Block.PlaceNew(BlockIDs.AluminiumCube, pos += new float3(1, 0, 0), color: BlockColors.Lime) + .BlockGroup = group; + }).Build(); + GameClient.SetDebugInfo("InstalledMods", InstalledMods); Block.Placed += (sender, args) => Logging.MetaDebugLog("Placed block " + args.Type + " with ID " + args.ID); @@ -391,6 +410,88 @@ namespace GamecraftModdingAPI.Tests return ((Action) MinimumSpecsCheck.CheckRequirementsMet).Method; } } + + [HarmonyPatch] + public class BugHuntPatch + { + public static MethodInfo method = + SymbolExtensions.GetMethodInfo(str => Console.WriteLine(str)); + + public static IEnumerable Transpiler(IEnumerable instructions) + { + int i = 0; + foreach (var instruction in instructions) + { + i++; + yield return instruction; //Return the instruction first + //stloc, dup, callvirt + if (instruction.opcode.Name.ToLower().StartsWith("stloc") + || instruction.opcode == OpCodes.Dup + || instruction.opcode == OpCodes.Callvirt) + { + yield return new CodeInstruction(OpCodes.Ldstr, + "Just ran the " + i + ". instruction ending with " + instruction.opcode.Name); + yield return new CodeInstruction(OpCodes.Call, method); + } + } + } + + public static MethodInfo TargetMethod() + { + return AccessTools.Method("RobocraftX.CR.MachineEditing.BoxSelect.CopySelectionEngine:GenerateThumbnail"); + } + } + + [HarmonyPatch] + public class BugHuntPatch2 + { + public static void Prefix(int width, float fieldOfView, Vector3 cameraDirection, Vector3 lightDirection) + { + Console.WriteLine("TakeThumbnail invoked with parameters: " + width + ", " + fieldOfView + ", " + + cameraDirection + ", " + lightDirection); + + GPUInstancerManager manager = GPUInstancerAPI.GetActiveManagers().Find(m => m is GPUInstancerPrefabManager); + Bounds instancesBounds = manager.ComputeInstancesBounds(2); + Console.WriteLine("Bounds: " + instancesBounds); + Console.WriteLine("Size: " + instancesBounds.size); + Console.WriteLine("Size.x < 0: " + (instancesBounds.size.x < 0)); + } + + public static void Postfix(Texture2D __result) + { + Console.WriteLine("TakeThumbnail returned: " + (__result == null ? null : __result.name)); + } + + private delegate Texture2D TakeThumbnailDel(int width, float fieldOfView, Vector3 cameraDirection, + Vector3 lightDirection); + + public static MethodInfo TargetMethod() + { + return ((TakeThumbnailDel) ThumbnailUtility.TakeThumbnail).Method; + } + } + + [HarmonyPatch] + public class BugHuntPatch3 + { + public static void Prefix(int width, int filterLayerMask, GPUInstancerManager manager, + Vector3 cameraPosition, Quaternion cameraRotation, float cameraFov, Vector3 lightDirection, + int cullingLayer) + { + Console.WriteLine("Inner TakeThumbnail invoked with parameters: " + width + ", " + filterLayerMask + + ", " + (manager != null ? manager.name : null) + ", " + cameraPosition + ", " + + cameraRotation + ", " + cameraFov + ", " + lightDirection + ", " + cullingLayer); + } + + private delegate Texture2D TakeThumbnailDel(int width, int filterLayerMask, GPUInstancerManager manager, + Vector3 cameraPosition, Quaternion cameraRotation, float cameraFov, Vector3 lightDirection, + int cullingLayer); + + public static MethodInfo TargetMethod() + { + return ((TakeThumbnailDel) ThumbnailUtility.TakeThumbnail).Method; + } + } } #endif } -- 2.30.2 From 987fbe673aca7f3a94c58c39626bd9839f1193ae Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Thu, 29 Oct 2020 00:37:47 +0100 Subject: [PATCH 125/252] Fix initial issues and add error on patch fail Fixed compilation and loading issues for 2020.10.27.17.13 --- Automation/gen_csproj.py | 0 GamecraftModdingAPI/Blocks/BlockEngine.cs | 2 +- GamecraftModdingAPI/Blocks/PlacementEngine.cs | 4 +-- GamecraftModdingAPI/Blocks/RemovalEngine.cs | 5 ++- GamecraftModdingAPI/Input/FakeInput.cs | 4 +-- .../HotbarSlotSelectionHandlerEnginePatch.cs | 4 +-- GamecraftModdingAPI/Main.cs | 31 ++++++++++++++----- .../Tests/GamecraftModdingAPIPluginTest.cs | 5 --- 8 files changed, 33 insertions(+), 22 deletions(-) mode change 100644 => 100755 Automation/gen_csproj.py diff --git a/Automation/gen_csproj.py b/Automation/gen_csproj.py old mode 100644 new mode 100755 diff --git a/GamecraftModdingAPI/Blocks/BlockEngine.cs b/GamecraftModdingAPI/Blocks/BlockEngine.cs index 929a65f..e39a3e8 100644 --- a/GamecraftModdingAPI/Blocks/BlockEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlockEngine.cs @@ -2,10 +2,10 @@ using System; using System.Collections.Generic; using System.Linq; +using Gamecraft.ColourPalette; using Gamecraft.Wires; using RobocraftX.Blocks; using RobocraftX.Common; -using RobocraftX.GUI.Hotbar.Colours; using RobocraftX.Physics; using RobocraftX.Scene.Simulation; using Svelto.DataStructures; diff --git a/GamecraftModdingAPI/Blocks/PlacementEngine.cs b/GamecraftModdingAPI/Blocks/PlacementEngine.cs index e111598..cb1cdee 100644 --- a/GamecraftModdingAPI/Blocks/PlacementEngine.cs +++ b/GamecraftModdingAPI/Blocks/PlacementEngine.cs @@ -70,9 +70,7 @@ namespace GamecraftModdingAPI.Blocks DBEntityStruct dbEntity = new DBEntityStruct {DBID = dbid}; BlockPlacementScaleEntityStruct placementScale = new BlockPlacementScaleEntityStruct { - blockPlacementHeight = uscale, blockPlacementWidth = uscale, desiredScaleFactor = uscale, - snapGridScale = uscale, - unitSnapOffset = 0, isUsingUnitSize = true + blockPlacementHeight = uscale, blockPlacementWidth = uscale, desiredScaleFactor = uscale }; EquippedColourStruct colour = new EquippedColourStruct {indexInPalette = color}; diff --git a/GamecraftModdingAPI/Blocks/RemovalEngine.cs b/GamecraftModdingAPI/Blocks/RemovalEngine.cs index 629fd7e..c27c339 100644 --- a/GamecraftModdingAPI/Blocks/RemovalEngine.cs +++ b/GamecraftModdingAPI/Blocks/RemovalEngine.cs @@ -20,8 +20,11 @@ namespace GamecraftModdingAPI.Blocks if (!entitiesDB.Exists(target)) return false; var connections = entitiesDB.QueryEntity(target); + var groups = entitiesDB.FindGroups(); + var connStructMapper = + entitiesDB.QueryNativeMappedEntities(groups); for (int i = connections.connections.Count() - 1; i >= 0; i--) - _connectionFactory.RemoveConnection(connections, i, entitiesDB); + _connectionFactory.RemoveConnection(connections, i, connStructMapper); _entityFunctions.RemoveEntity(target); return true; } diff --git a/GamecraftModdingAPI/Input/FakeInput.cs b/GamecraftModdingAPI/Input/FakeInput.cs index df6c3ce..8cab6f5 100644 --- a/GamecraftModdingAPI/Input/FakeInput.cs +++ b/GamecraftModdingAPI/Input/FakeInput.cs @@ -76,7 +76,7 @@ namespace GamecraftModdingAPI.Input case 9: currentInput.guiMask |= RobocraftX.Common.Input.GuiInput.Hotbar_9; break; default: break; } - if (commandLine) currentInput.guiMask |= RobocraftX.Common.Input.GuiInput.ToggleCommandLine; + //if (commandLine) currentInput.guiMask |= RobocraftX.Common.Input.GuiInput.ToggleCommandLine; - TODO if (escape) currentInput.guiMask |= RobocraftX.Common.Input.GuiInput.Escape; if (enter) currentInput.guiMask |= RobocraftX.Common.Input.GuiInput.Return; if (debug) currentInput.guiMask |= RobocraftX.Common.Input.GuiInput.ToggleDebugDisplay; @@ -125,7 +125,7 @@ namespace GamecraftModdingAPI.Input if (tertiary) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.TertiaryAction; if (primaryHeld) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.PrimaryActionHeld; if (secondaryHeld) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.SecondaryActionHeld; - if (toggleUnitGrid) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.ToggleUnitGrid; + //if (toggleUnitGrid) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.ToggleUnitGrid; if (ctrl) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.CtrlAction; if (toggleColourMode) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.ToggleColourMode; if (scaleBlockUp) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.ScaleBlockUp; diff --git a/GamecraftModdingAPI/Inventory/HotbarSlotSelectionHandlerEnginePatch.cs b/GamecraftModdingAPI/Inventory/HotbarSlotSelectionHandlerEnginePatch.cs index dd8a375..9a81f99 100644 --- a/GamecraftModdingAPI/Inventory/HotbarSlotSelectionHandlerEnginePatch.cs +++ b/GamecraftModdingAPI/Inventory/HotbarSlotSelectionHandlerEnginePatch.cs @@ -1,8 +1,6 @@ using System; using System.Reflection; -using RobocraftX.GUI; -using RobocraftX.GUI.Hotbar; using Svelto.ECS; using HarmonyLib; @@ -17,7 +15,7 @@ namespace GamecraftModdingAPI.Inventory public static BlockIDs EquippedPartID { get => (BlockIDs)selectedBlockInt; } - private static MethodInfo PatchedMethod { get; } = AccessTools.Method(AccessTools.TypeByName("RobocraftX.GUI.Hotbar.HotbarSlotSelectionHandlerEngine"), "ActivateSlotForCube", parameters: new Type[] { typeof(uint), typeof(int), typeof(ExclusiveGroupStruct) }); + private static MethodInfo PatchedMethod { get; } = AccessTools.Method("Gamecraft.GUI.Hotbar.Blocks.SyncHotbarSlotSelectedToEquipedPartEngine:ActivateSlotForCube", parameters: new Type[] { typeof(uint), typeof(int), typeof(ExclusiveGroupStruct) }); public static void Prefix(uint playerID, int selectedDBPartID, ExclusiveGroupStruct groupID) { diff --git a/GamecraftModdingAPI/Main.cs b/GamecraftModdingAPI/Main.cs index 4a8cf24..98fb6f6 100644 --- a/GamecraftModdingAPI/Main.cs +++ b/GamecraftModdingAPI/Main.cs @@ -1,17 +1,15 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Reflection; using GamecraftModdingAPI.Blocks; using HarmonyLib; +using RobocraftX; +using RobocraftX.Services; +using Svelto.Context; + using GamecraftModdingAPI.Utility; using GamecraftModdingAPI.Events; -using GamecraftModdingAPI.Players; using GamecraftModdingAPI.Tasks; -using uREPL; namespace GamecraftModdingAPI { @@ -46,7 +44,20 @@ namespace GamecraftModdingAPI Logging.MetaDebugLog($"Patching Gamecraft"); var currentAssembly = Assembly.GetExecutingAssembly(); harmony = new Harmony(currentAssembly.GetName().Name); - harmony.PatchAll(currentAssembly); + try + { + harmony.PatchAll(currentAssembly); + } + catch (Exception e) + { //Can't use ErrorBuilder or Logging.LogException (which eventually uses ErrorBuilder) yet + Logging.Log(e.ToString()); + Logging.LogWarning("Failed to patch Gamecraft. Attempting to patch to display error..."); + harmony.Patch(AccessTools.Method(typeof(FullGameCompositionRoot), "OnContextInitialized") + .MakeGenericMethod(typeof(UnityContext)), + new HarmonyMethod(((Action) OnPatchError).Method)); //Can't use lambdas here :( + return; + } + // init utility Logging.MetaDebugLog($"Initializing Utility"); #pragma warning disable 0612,0618 @@ -102,5 +113,11 @@ namespace GamecraftModdingAPI Logging.MetaLog($"{currentAssembly.GetName().Name} v{currentAssembly.GetName().Version} shutdown"); } } + + private static void OnPatchError() + { + ErrorBuilder.DisplayMustQuitError("Failed to patch Gamecraft!\n" + + "Make sure you're using the latest version of GamecraftModdingAPI or disable mods if the API isn't released yet."); + } } } diff --git a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs index 4a5547f..f0334aa 100644 --- a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs +++ b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs @@ -173,11 +173,6 @@ namespace GamecraftModdingAPI.Tests Logging.CommandLog("Finished in " + sw.ElapsedMilliseconds + "ms"); }) .Build(); - //With Sync(): 1135ms - //Without Sync(): 134ms - //Async: 348 794ms, doesn't freeze game - //Without Sync() but wait for submission: 530ms - //With Sync() at the end: 380ms Block b = null; CommandBuilder.Builder("moveBlockInSim", "Run in build mode first while looking at a block, then in sim to move it up") -- 2.30.2 From 08138e3589d5e7f69b75cdbd93a1786286655cba Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Mon, 9 Nov 2020 16:18:25 -0500 Subject: [PATCH 126/252] Fix build errors from beta hotfix 1 --- GamecraftModdingAPI/App/AppEngine.cs | 5 +- GamecraftModdingAPI/App/GameGameEngine.cs | 6 +-- GamecraftModdingAPI/App/GameMenuEngine.cs | 10 ++-- GamecraftModdingAPI/Block.cs | 42 ++++++++-------- GamecraftModdingAPI/Blocks/BlockEngine.cs | 49 ++++++++++++------- GamecraftModdingAPI/Blocks/BlockEngineInit.cs | 4 +- GamecraftModdingAPI/Blocks/ConsoleBlock.cs | 2 +- GamecraftModdingAPI/Blocks/DampedSpring.cs | 2 +- GamecraftModdingAPI/Blocks/LogicGate.cs | 2 +- GamecraftModdingAPI/Blocks/Motor.cs | 2 +- GamecraftModdingAPI/Blocks/MusicBlock.cs | 2 +- .../Blocks/ObjectIdentifier.cs | 2 +- GamecraftModdingAPI/Blocks/Piston.cs | 2 +- GamecraftModdingAPI/Blocks/PlacementEngine.cs | 3 +- GamecraftModdingAPI/Blocks/Servo.cs | 2 +- GamecraftModdingAPI/Blocks/SfxBlock.cs | 2 +- GamecraftModdingAPI/Blocks/SignalEngine.cs | 44 +++++++++++------ GamecraftModdingAPI/Blocks/SpawnPoint.cs | 2 +- GamecraftModdingAPI/Blocks/TextBlock.cs | 2 +- GamecraftModdingAPI/Blocks/Timer.cs | 2 +- GamecraftModdingAPI/Inventory/HotbarEngine.cs | 8 +-- GamecraftModdingAPI/Players/PlayerEngine.cs | 8 +-- GamecraftModdingAPI/Tests/TestRoot.cs | 2 +- 23 files changed, 119 insertions(+), 86 deletions(-) diff --git a/GamecraftModdingAPI/App/AppEngine.cs b/GamecraftModdingAPI/App/AppEngine.cs index 4f20b7e..9cc454d 100644 --- a/GamecraftModdingAPI/App/AppEngine.cs +++ b/GamecraftModdingAPI/App/AppEngine.cs @@ -46,11 +46,12 @@ namespace GamecraftModdingAPI.App public Game[] GetMyGames() { EntityCollection mgsevs = entitiesDB.QueryEntities(MyGamesScreenExclusiveGroups.MyGames); + var mgsevsB = mgsevs.ToBuffer().buffer; Game[] games = new Game[mgsevs.count]; for (int i = 0; i < mgsevs.count; i++) { - Utility.Logging.MetaDebugLog($"Found game named {mgsevs[i].GameName}"); - games[i] = new Game(mgsevs[i].ID); + Utility.Logging.MetaDebugLog($"Found game named {mgsevsB[i].GameName}"); + games[i] = new Game(mgsevsB[i].ID); } return games; } diff --git a/GamecraftModdingAPI/App/GameGameEngine.cs b/GamecraftModdingAPI/App/GameGameEngine.cs index a616df5..dea3821 100644 --- a/GamecraftModdingAPI/App/GameGameEngine.cs +++ b/GamecraftModdingAPI/App/GameGameEngine.cs @@ -52,7 +52,7 @@ namespace GamecraftModdingAPI.App { if (async) { - ExitCurrentGameAsync().RunOn(Lean.EveryFrameStepRunner_RUNS_IN_TIME_STOPPED_AND_RUNNING); + ExitCurrentGameAsync().RunOn(Lean.EveryFrameStepRunner_TimeRunningAndStopped); } else { @@ -102,14 +102,14 @@ namespace GamecraftModdingAPI.App if (filter == BlockIDs.Invalid) { foreach (var (blocks, _) in allBlocks) - foreach (var block in blocks) + foreach (var block in blocks.ToBuffer().buffer.ToManagedArray()) blockEGIDs.Add(block.ID); return blockEGIDs.ToArray(); } else { foreach (var (blocks, _) in allBlocks) - foreach (var block in blocks) + foreach (var block in blocks.ToBuffer().buffer.ToManagedArray()) if (block.DBID == (ulong) filter) blockEGIDs.Add(block.ID); return blockEGIDs.ToArray(); diff --git a/GamecraftModdingAPI/App/GameMenuEngine.cs b/GamecraftModdingAPI/App/GameMenuEngine.cs index 74bc42a..efcb73e 100644 --- a/GamecraftModdingAPI/App/GameMenuEngine.cs +++ b/GamecraftModdingAPI/App/GameMenuEngine.cs @@ -61,12 +61,13 @@ namespace GamecraftModdingAPI.App public uint HighestID() { EntityCollection games = entitiesDB.QueryEntities(MyGamesScreenExclusiveGroups.MyGames); + var gamesB = games.ToBuffer().buffer; uint max = 0; for (int i = 0; i < games.count; i++) { - if (games[i].ID.entityID > max) + if (gamesB[i].ID.entityID > max) { - max = games[i].ID.entityID; + max = gamesB[i].ID.entityID; } } return max; @@ -118,11 +119,12 @@ namespace GamecraftModdingAPI.App { EntityCollection entities = entitiesDB.QueryEntities(MyGamesScreenExclusiveGroups.GameSlotGuiEntities); + var entitiesB = entities.ToBuffer().buffer; for (int i = 0; i < entities.count; i++) { - if (entities[i].ID.entityID == id.entityID) + if (entitiesB[i].ID.entityID == id.entityID) { - return ref entities[i]; + return ref entitiesB[i]; } } MyGamesSlotEntityViewStruct[] defRef = new MyGamesSlotEntityViewStruct[1]; diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index 408304d..81d6439 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -116,32 +116,32 @@ namespace GamecraftModdingAPI private static Dictionary typeToGroup = new Dictionary { - {typeof(ConsoleBlock), new[] {CommonExclusiveGroups.BUILD_CONSOLE_BLOCK_GROUP}}, - {typeof(LogicGate), new [] {CommonExclusiveGroups.BUILD_LOGIC_BLOCK_GROUP}}, - {typeof(Motor), new[] {CommonExclusiveGroups.BUILD_MOTOR_BLOCK_GROUP}}, - {typeof(MusicBlock), new[] {CommonExclusiveGroups.BUILD_MUSIC_BLOCK_GROUP}}, - {typeof(ObjectIdentifier), new[]{CommonExclusiveGroups.BUILD_OBJID_BLOCK_GROUP}}, - {typeof(Piston), new[] {CommonExclusiveGroups.BUILD_PISTON_BLOCK_GROUP}}, - {typeof(Servo), new[] {CommonExclusiveGroups.BUILD_SERVO_BLOCK_GROUP}}, + {typeof(ConsoleBlock), new[] {CommonExclusiveGroups.CONSOLE_BLOCK_GROUP}}, + {typeof(LogicGate), new [] {CommonExclusiveGroups.LOGIC_BLOCK_GROUP}}, + {typeof(Motor), new[] {CommonExclusiveGroups.MOTOR_BLOCK_GROUP}}, + {typeof(MusicBlock), new[] {CommonExclusiveGroups.MUSIC_BLOCK_GROUP}}, + {typeof(ObjectIdentifier), new[]{CommonExclusiveGroups.OBJID_BLOCK_GROUP}}, + {typeof(Piston), new[] {CommonExclusiveGroups.PISTON_BLOCK_GROUP}}, + {typeof(Servo), new[] {CommonExclusiveGroups.SERVO_BLOCK_GROUP}}, { typeof(SpawnPoint), new[] { - CommonExclusiveGroups.BUILD_SPAWNPOINT_BLOCK_GROUP, - CommonExclusiveGroups.BUILD_BUILDINGSPAWN_BLOCK_GROUP + CommonExclusiveGroups.SPAWNPOINT_BLOCK_GROUP, + CommonExclusiveGroups.BUILDINGSPAWN_BLOCK_GROUP } }, { typeof(SfxBlock), new[] { - CommonExclusiveGroups.BUILD_SIMPLESFX_BLOCK_GROUP, - CommonExclusiveGroups.BUILD_LOOPEDSFX_BLOCK_GROUP + CommonExclusiveGroups.SIMPLESFX_BLOCK_GROUP, + CommonExclusiveGroups.LOOPEDSFX_BLOCK_GROUP } }, - {typeof(DampedSpring), new [] {CommonExclusiveGroups.BUILD_DAMPEDSPRING_BLOCK_GROUP}}, - {typeof(TextBlock), new[] {CommonExclusiveGroups.BUILD_TEXT_BLOCK_GROUP}}, - {typeof(Timer), new[] {CommonExclusiveGroups.BUILD_TIMER_BLOCK_GROUP}} + {typeof(DampedSpring), new [] {CommonExclusiveGroups.DAMPEDSPRING_BLOCK_GROUP}}, + {typeof(TextBlock), new[] {CommonExclusiveGroups.TEXT_BLOCK_GROUP}}, + {typeof(Timer), new[] {CommonExclusiveGroups.TIMER_BLOCK_GROUP}} }; /// @@ -312,8 +312,9 @@ namespace GamecraftModdingAPI BlockEngine.SetBlockInfo(this, (ref ColourParameterEntityStruct color, BlockColor val) => { color.indexInPalette = (byte) (val.Color + val.Darkness * 10); - color.overridePaletteColour = false; - color.needsUpdate = true; + //color.overridePaletteColour = false; + //color.needsUpdate = true; + color.hasNetworkChange = true; color.paletteColour = BlockEngine.ConvertBlockColor(color.indexInPalette); }, value); } @@ -324,14 +325,15 @@ namespace GamecraftModdingAPI /// public float4 CustomColor { - get => BlockEngine.GetBlockInfo(this, (ColourParameterEntityStruct st) => st.overriddenColour); + get => BlockEngine.GetBlockInfo(this, (ColourParameterEntityStruct st) => st.paletteColour); set { BlockEngine.SetBlockInfo(this, (ref ColourParameterEntityStruct color, float4 val) => { - color.overriddenColour = val; - color.overridePaletteColour = true; - color.needsUpdate = true; + color.paletteColour = val; + //color.overridePaletteColour = true; + //color.needsUpdate = true; + color.hasNetworkChange = true; }, value); } } diff --git a/GamecraftModdingAPI/Blocks/BlockEngine.cs b/GamecraftModdingAPI/Blocks/BlockEngine.cs index e39a3e8..5566525 100644 --- a/GamecraftModdingAPI/Blocks/BlockEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlockEngine.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using Gamecraft.ColourPalette; +using Gamecraft.TimeRunning; using Gamecraft.Wires; using RobocraftX.Blocks; using RobocraftX.Common; @@ -43,8 +44,14 @@ namespace GamecraftModdingAPI.Blocks FasterList cubes = new FasterList(10); var coll = entitiesDB.QueryEntities(); foreach (var (ecoll, _) in coll) - foreach (ref var conn in ecoll) - conn.isProcessed = false; + { + var ecollB = ecoll.ToBuffer(); + for(int i = 0; i < ecoll.count; i++) + { + ref var conn = ref ecollB.buffer[i]; + conn.isProcessed = false; + } + } ConnectedCubesUtility.TreeTraversal.GetConnectedCubes(entitiesDB, blockID, cubeStack, cubes, (in GridConnectionsEntityStruct g) => { return false; }); @@ -68,17 +75,17 @@ namespace GamecraftModdingAPI.Blocks return ref structHolder[0]; //Gets a default value automatically } - public ref T GetBlockInfoViewStruct(EGID blockID) where T : struct, INeedEGID, IEntityComponent + public ref T GetBlockInfoViewStruct(EGID blockID) where T : struct, INeedEGID, IEntityViewComponent { if (entitiesDB.Exists(blockID)) { // TODO: optimize by using EntitiesDB internal calls instead of iterating over everything - EntityCollection entities = entitiesDB.QueryEntities(blockID.groupID); + BT> entities = entitiesDB.QueryEntities(blockID.groupID).ToBuffer(); for (int i = 0; i < entities.count; i++) { - if (entities[i].ID == blockID) + if (entities.buffer[i].ID == blockID) { - return ref entities[i]; + return ref entities.buffer[i]; } } } @@ -160,12 +167,13 @@ namespace GamecraftModdingAPI.Blocks public SimBody[] GetSimBodiesFromID(byte id) { var ret = new FasterList(4); - if (!entitiesDB.HasAny(CommonExclusiveGroups.BUILD_OBJID_BLOCK_GROUP)) + if (!entitiesDB.HasAny(CommonExclusiveGroups.OBJID_BLOCK_GROUP)) return new SimBody[0]; - var oids = entitiesDB.QueryEntities(CommonExclusiveGroups.BUILD_OBJID_BLOCK_GROUP); - var connections = entitiesDB.QueryMappedEntities(CommonExclusiveGroups.BUILD_OBJID_BLOCK_GROUP); - foreach (ref ObjectIdEntityStruct oid in oids) + var oids = entitiesDB.QueryEntities(CommonExclusiveGroups.OBJID_BLOCK_GROUP).ToBuffer(); + var connections = entitiesDB.QueryMappedEntities(CommonExclusiveGroups.OBJID_BLOCK_GROUP); + for (int i = 0; i < oids.count; i++) { + ref ObjectIdEntityStruct oid = ref oids.buffer[i]; if (oid.objectId != id) continue; var rid = connections.Entity(oid.ID.entityID).machineRigidBodyId; foreach (var rb in ret) @@ -182,21 +190,26 @@ namespace GamecraftModdingAPI.Blocks public ObjectIdentifier[] GetObjectIDsFromID(byte id, bool sim) { var ret = new FasterList(4); - if (!entitiesDB.HasAny(CommonExclusiveGroups.BUILD_OBJID_BLOCK_GROUP)) + if (!entitiesDB.HasAny(CommonExclusiveGroups.OBJID_BLOCK_GROUP)) return new ObjectIdentifier[0]; - var oids = entitiesDB.QueryEntities(CommonExclusiveGroups.BUILD_OBJID_BLOCK_GROUP); - foreach (ref ObjectIdEntityStruct oid in oids) + var oids = entitiesDB.QueryEntities(CommonExclusiveGroups.OBJID_BLOCK_GROUP).ToBuffer(); + for (int i = 0; i < oids.count; i++) + { + ref ObjectIdEntityStruct oid = ref oids.buffer[i]; if (sim ? oid.simObjectId == id : oid.objectId == id) ret.Add(new ObjectIdentifier(oid.ID)); + } + return ret.ToArray(); } public SimBody[] GetConnectedSimBodies(uint id) { - var joints = entitiesDB.QueryEntities(MachineSimulationGroups.JOINTS_GROUP); + var joints = entitiesDB.QueryEntities(MachineSimulationGroups.JOINTS_GROUP).ToBuffer(); var list = new FasterList(4); - foreach (var joint in joints) + for (int i = 0; i < joints.count; i++) { + ref var joint = ref joints.buffer[i]; if (joint.jointState == JointState.Broken) continue; if (joint.connectedEntityA == id) list.Add(new SimBody(joint.connectedEntityB)); else if (joint.connectedEntityB == id) list.Add(new SimBody(joint.connectedEntityA)); @@ -211,7 +224,7 @@ namespace GamecraftModdingAPI.Blocks var bodies = new HashSet(); foreach (var (coll, _) in groups) { - foreach (var conn in coll) + foreach (var conn in coll.ToBuffer().buffer.ToManagedArray()) { if (conn.clusterId == cid) bodies.Add(conn.machineRigidBodyId); @@ -238,7 +251,7 @@ namespace GamecraftModdingAPI.Blocks var groups = entitiesDB.QueryEntities(); foreach (var (coll, _) in groups) { - foreach (var conn in coll) + foreach (var conn in coll.ToBuffer().buffer.ToManagedArray()) { //Static blocks don't have a cluster ID but the cluster destruction manager should have one if (conn.machineRigidBodyId == sbid && conn.clusterId != uint.MaxValue) return new Cluster(conn.clusterId); @@ -254,7 +267,7 @@ namespace GamecraftModdingAPI.Blocks var set = new HashSet(); foreach (var (coll, _) in groups) { - foreach (var conn in coll) + foreach (var conn in coll.ToBuffer().buffer.ToManagedArray()) { if (conn.machineRigidBodyId == sbid) set.Add(new Block(conn.ID)); diff --git a/GamecraftModdingAPI/Blocks/BlockEngineInit.cs b/GamecraftModdingAPI/Blocks/BlockEngineInit.cs index 70f713a..1bf6c15 100644 --- a/GamecraftModdingAPI/Blocks/BlockEngineInit.cs +++ b/GamecraftModdingAPI/Blocks/BlockEngineInit.cs @@ -14,10 +14,10 @@ namespace GamecraftModdingAPI.Blocks /// internal struct BlockInitData { - public FasterDictionary, ITypeSafeDictionary> Group; + public FasterDictionary Group; } - internal delegate FasterDictionary, ITypeSafeDictionary> GetInitGroup( + internal delegate FasterDictionary GetInitGroup( EntityComponentInitializer initializer); /// diff --git a/GamecraftModdingAPI/Blocks/ConsoleBlock.cs b/GamecraftModdingAPI/Blocks/ConsoleBlock.cs index c8982e4..e696fca 100644 --- a/GamecraftModdingAPI/Blocks/ConsoleBlock.cs +++ b/GamecraftModdingAPI/Blocks/ConsoleBlock.cs @@ -16,7 +16,7 @@ namespace GamecraftModdingAPI.Blocks { } - public ConsoleBlock(uint id): base(new EGID(id, CommonExclusiveGroups.BUILD_CONSOLE_BLOCK_GROUP)) + public ConsoleBlock(uint id): base(new EGID(id, CommonExclusiveGroups.CONSOLE_BLOCK_GROUP)) { } diff --git a/GamecraftModdingAPI/Blocks/DampedSpring.cs b/GamecraftModdingAPI/Blocks/DampedSpring.cs index 96e628d..5a5a936 100644 --- a/GamecraftModdingAPI/Blocks/DampedSpring.cs +++ b/GamecraftModdingAPI/Blocks/DampedSpring.cs @@ -10,7 +10,7 @@ namespace GamecraftModdingAPI.Blocks { } - public DampedSpring(uint id) : base(new EGID(id, CommonExclusiveGroups.BUILD_DAMPEDSPRING_BLOCK_GROUP)) + public DampedSpring(uint id) : base(new EGID(id, CommonExclusiveGroups.DAMPEDSPRING_BLOCK_GROUP)) { } diff --git a/GamecraftModdingAPI/Blocks/LogicGate.cs b/GamecraftModdingAPI/Blocks/LogicGate.cs index 124bc10..2ec4cef 100644 --- a/GamecraftModdingAPI/Blocks/LogicGate.cs +++ b/GamecraftModdingAPI/Blocks/LogicGate.cs @@ -9,7 +9,7 @@ namespace GamecraftModdingAPI.Blocks { } - public LogicGate(uint id) : base(new EGID(id, CommonExclusiveGroups.BUILD_LOGIC_BLOCK_GROUP)) + public LogicGate(uint id) : base(new EGID(id, CommonExclusiveGroups.LOGIC_BLOCK_GROUP)) { } } diff --git a/GamecraftModdingAPI/Blocks/Motor.cs b/GamecraftModdingAPI/Blocks/Motor.cs index 3c38a52..0a69d27 100644 --- a/GamecraftModdingAPI/Blocks/Motor.cs +++ b/GamecraftModdingAPI/Blocks/Motor.cs @@ -15,7 +15,7 @@ namespace GamecraftModdingAPI.Blocks { } - public Motor(uint id): base(new EGID(id, CommonExclusiveGroups.BUILD_MOTOR_BLOCK_GROUP)) + public Motor(uint id): base(new EGID(id, CommonExclusiveGroups.MOTOR_BLOCK_GROUP)) { } diff --git a/GamecraftModdingAPI/Blocks/MusicBlock.cs b/GamecraftModdingAPI/Blocks/MusicBlock.cs index fc3c880..6b99b6f 100644 --- a/GamecraftModdingAPI/Blocks/MusicBlock.cs +++ b/GamecraftModdingAPI/Blocks/MusicBlock.cs @@ -20,7 +20,7 @@ namespace GamecraftModdingAPI.Blocks { } - public MusicBlock(uint id) : base(new EGID(id, CommonExclusiveGroups.BUILD_MUSIC_BLOCK_GROUP)) + public MusicBlock(uint id) : base(new EGID(id, CommonExclusiveGroups.MUSIC_BLOCK_GROUP)) { } diff --git a/GamecraftModdingAPI/Blocks/ObjectIdentifier.cs b/GamecraftModdingAPI/Blocks/ObjectIdentifier.cs index 0dc835a..1233343 100644 --- a/GamecraftModdingAPI/Blocks/ObjectIdentifier.cs +++ b/GamecraftModdingAPI/Blocks/ObjectIdentifier.cs @@ -10,7 +10,7 @@ namespace GamecraftModdingAPI.Blocks { } - public ObjectIdentifier(uint id) : base(new EGID(id, CommonExclusiveGroups.BUILD_OBJID_BLOCK_GROUP)) + public ObjectIdentifier(uint id) : base(new EGID(id, CommonExclusiveGroups.OBJID_BLOCK_GROUP)) { } diff --git a/GamecraftModdingAPI/Blocks/Piston.cs b/GamecraftModdingAPI/Blocks/Piston.cs index c3f2497..04b3aeb 100644 --- a/GamecraftModdingAPI/Blocks/Piston.cs +++ b/GamecraftModdingAPI/Blocks/Piston.cs @@ -15,7 +15,7 @@ namespace GamecraftModdingAPI.Blocks { } - public Piston(uint id) : base(new EGID(id, CommonExclusiveGroups.BUILD_PISTON_BLOCK_GROUP)) + public Piston(uint id) : base(new EGID(id, CommonExclusiveGroups.PISTON_BLOCK_GROUP)) { } diff --git a/GamecraftModdingAPI/Blocks/PlacementEngine.cs b/GamecraftModdingAPI/Blocks/PlacementEngine.cs index cb1cdee..cf9a80f 100644 --- a/GamecraftModdingAPI/Blocks/PlacementEngine.cs +++ b/GamecraftModdingAPI/Blocks/PlacementEngine.cs @@ -16,6 +16,7 @@ using UnityEngine; using GamecraftModdingAPI.Utility; using GamecraftModdingAPI.Engines; using GamecraftModdingAPI.Players; +using RobocraftX.Rendering.GPUI; namespace GamecraftModdingAPI.Blocks { @@ -81,7 +82,7 @@ namespace GamecraftModdingAPI.Blocks structInitializer.Init(new ColourParameterEntityStruct { indexInPalette = colour.indexInPalette, - needsUpdate = true + hasNetworkChange = true }); uint prefabId = PrefabsID.GetPrefabId(dbid, 0); structInitializer.Init(new GFXPrefabEntityStructGPUI(prefabId)); diff --git a/GamecraftModdingAPI/Blocks/Servo.cs b/GamecraftModdingAPI/Blocks/Servo.cs index 1177fb6..606a48a 100644 --- a/GamecraftModdingAPI/Blocks/Servo.cs +++ b/GamecraftModdingAPI/Blocks/Servo.cs @@ -15,7 +15,7 @@ namespace GamecraftModdingAPI.Blocks { } - public Servo(uint id) : base(new EGID(id, CommonExclusiveGroups.BUILD_SERVO_BLOCK_GROUP)) + public Servo(uint id) : base(new EGID(id, CommonExclusiveGroups.SERVO_BLOCK_GROUP)) { } diff --git a/GamecraftModdingAPI/Blocks/SfxBlock.cs b/GamecraftModdingAPI/Blocks/SfxBlock.cs index f7efe6d..88d69d2 100644 --- a/GamecraftModdingAPI/Blocks/SfxBlock.cs +++ b/GamecraftModdingAPI/Blocks/SfxBlock.cs @@ -14,7 +14,7 @@ namespace GamecraftModdingAPI.Blocks { } - public SfxBlock(uint id) : base(new EGID(id, CommonExclusiveGroups.BUILD_SIMPLESFX_BLOCK_GROUP /* This could also be BUILD_LOOPEDSFX_BLOCK_GROUP */)) + public SfxBlock(uint id) : base(new EGID(id, CommonExclusiveGroups.SIMPLESFX_BLOCK_GROUP /* This could also be BUILD_LOOPEDSFX_BLOCK_GROUP */)) { } diff --git a/GamecraftModdingAPI/Blocks/SignalEngine.cs b/GamecraftModdingAPI/Blocks/SignalEngine.cs index 763a1a1..0980d79 100644 --- a/GamecraftModdingAPI/Blocks/SignalEngine.cs +++ b/GamecraftModdingAPI/Blocks/SignalEngine.cs @@ -115,7 +115,8 @@ namespace GamecraftModdingAPI.Blocks public bool SetSignal(uint signalID, float signal, bool input = true) { var array = GetSignalStruct(signalID, out uint index, input); - if (array.count > 0) array[index].valueAsFloat = signal; + var arrayB = array.ToBuffer(); + if (array.count > 0) arrayB.buffer[index].valueAsFloat = signal; return false; } @@ -128,9 +129,10 @@ namespace GamecraftModdingAPI.Blocks public float AddSignal(uint signalID, float signal, bool clamp = true, bool input = true) { var array = GetSignalStruct(signalID, out uint index, input); + var arrayB = array.ToBuffer(); if (array.count > 0) { - ref var channelData = ref array[index]; + ref var channelData = ref arrayB.buffer[index]; channelData.valueAsFloat += signal; if (clamp) { @@ -159,7 +161,8 @@ namespace GamecraftModdingAPI.Blocks public float GetSignal(uint signalID, bool input = true) { var array = GetSignalStruct(signalID, out uint index, input); - return array.count > 0 ? array[index].valueAsFloat : 0f; + var arrayB = array.ToBuffer(); + return array.count > 0 ? arrayB.buffer[index].valueAsFloat : 0f; } public uint[] GetSignalIDs(EGID blockID, bool input = true) @@ -244,13 +247,14 @@ namespace GamecraftModdingAPI.Blocks { ref PortEntityStruct port = ref entitiesDB.QueryEntity(portID); var wires = entitiesDB.QueryEntities(NamedExclusiveGroup.Group); + var wiresB = wires.ToBuffer().buffer; for (uint i = 0; i < wires.count; i++) { - if ((wires[i].destinationPortUsage == port.usage && wires[i].destinationBlockEGID == blockID) - || (wires[i].sourcePortUsage == port.usage && wires[i].sourceBlockEGID == blockID)) + if ((wiresB[i].destinationPortUsage == port.usage && wiresB[i].destinationBlockEGID == blockID) + || (wiresB[i].sourcePortUsage == port.usage && wiresB[i].sourceBlockEGID == blockID)) { exists = true; - return ref wires[i]; + return ref wiresB[i]; } } exists = false; @@ -286,6 +290,7 @@ namespace GamecraftModdingAPI.Blocks } EntityCollection wires = entitiesDB.QueryEntities(NamedExclusiveGroup.Group); + var wiresB = wires.ToBuffer().buffer; for (int endIndex = 0; endIndex < endPorts.Length; endIndex++) { PortEntityStruct endPES = entitiesDB.QueryEntity(endPorts[endIndex]); @@ -294,11 +299,11 @@ namespace GamecraftModdingAPI.Blocks PortEntityStruct startPES = entitiesDB.QueryEntity(startPorts[startIndex]); for (int w = 0; w < wires.count; w++) { - if ((wires[w].destinationPortUsage == endPES.usage && wires[w].destinationBlockEGID == endBlock) - && (wires[w].sourcePortUsage == startPES.usage && wires[w].sourceBlockEGID == startBlock)) + if ((wiresB[w].destinationPortUsage == endPES.usage && wiresB[w].destinationBlockEGID == endBlock) + && (wiresB[w].sourcePortUsage == startPES.usage && wiresB[w].sourceBlockEGID == startBlock)) { exists = true; - return ref wires[w]; + return ref wiresB[w]; } } } @@ -313,10 +318,11 @@ namespace GamecraftModdingAPI.Blocks { ref PortEntityStruct port = ref entitiesDB.QueryEntity(portID); var channels = entitiesDB.QueryEntities(NamedExclusiveGroup.Group); + var channelsB = channels.ToBuffer(); if (port.firstChannelIndexCachedInSim < channels.count) { exists = true; - return ref channels[port.firstChannelIndexCachedInSim]; + return ref channelsB.buffer[port.firstChannelIndexCachedInSim]; } exists = false; ChannelDataStruct[] defRef = new ChannelDataStruct[1]; @@ -327,8 +333,15 @@ namespace GamecraftModdingAPI.Blocks { var res = new FasterList(); foreach (var (coll, _) in entitiesDB.QueryEntities()) - foreach (ref BlockPortsStruct s in coll) - res.Add(s.ID); + { + var collB = coll.ToBuffer(); + for (int i = 0; i < coll.count; i++) + { + ref BlockPortsStruct s = ref collB.buffer[i]; + res.Add(s.ID); + } + } + return res.ToArray(); } @@ -358,15 +371,16 @@ namespace GamecraftModdingAPI.Blocks return result; } - private T[] Search(ExclusiveGroup group, Func isMatch) where T : struct, IEntityComponent + private T[] Search(ExclusiveGroup group, Func isMatch) where T : unmanaged, IEntityComponent { FasterList results = new FasterList(); EntityCollection components = entitiesDB.QueryEntities(group); + var componentsB = components.ToBuffer(); for (uint i = 0; i < components.count; i++) { - if (isMatch(components[i])) + if (isMatch(componentsB.buffer[i])) { - results.Add(components[i]); + results.Add(componentsB.buffer[i]); } } return results.ToArray(); diff --git a/GamecraftModdingAPI/Blocks/SpawnPoint.cs b/GamecraftModdingAPI/Blocks/SpawnPoint.cs index 7616acb..17bffd9 100644 --- a/GamecraftModdingAPI/Blocks/SpawnPoint.cs +++ b/GamecraftModdingAPI/Blocks/SpawnPoint.cs @@ -17,7 +17,7 @@ namespace GamecraftModdingAPI.Blocks { } - public SpawnPoint(uint id) : base(new EGID(id, CommonExclusiveGroups.BUILD_SPAWNPOINT_BLOCK_GROUP)) + public SpawnPoint(uint id) : base(new EGID(id, CommonExclusiveGroups.SPAWNPOINT_BLOCK_GROUP)) { } diff --git a/GamecraftModdingAPI/Blocks/TextBlock.cs b/GamecraftModdingAPI/Blocks/TextBlock.cs index 895494d..d7d620a 100644 --- a/GamecraftModdingAPI/Blocks/TextBlock.cs +++ b/GamecraftModdingAPI/Blocks/TextBlock.cs @@ -16,7 +16,7 @@ namespace GamecraftModdingAPI.Blocks { } - public TextBlock(uint id) : base(new EGID(id, CommonExclusiveGroups.BUILD_TEXT_BLOCK_GROUP)) + public TextBlock(uint id) : base(new EGID(id, CommonExclusiveGroups.TEXT_BLOCK_GROUP)) { } diff --git a/GamecraftModdingAPI/Blocks/Timer.cs b/GamecraftModdingAPI/Blocks/Timer.cs index 1aeecd9..0bbd302 100644 --- a/GamecraftModdingAPI/Blocks/Timer.cs +++ b/GamecraftModdingAPI/Blocks/Timer.cs @@ -17,7 +17,7 @@ namespace GamecraftModdingAPI.Blocks { } - public Timer(uint id) : base(new EGID(id, CommonExclusiveGroups.BUILD_TIMER_BLOCK_GROUP)) + public Timer(uint id) : base(new EGID(id, CommonExclusiveGroups.TIMER_BLOCK_GROUP)) { } diff --git a/GamecraftModdingAPI/Inventory/HotbarEngine.cs b/GamecraftModdingAPI/Inventory/HotbarEngine.cs index d5eb2d8..34cdf12 100644 --- a/GamecraftModdingAPI/Inventory/HotbarEngine.cs +++ b/GamecraftModdingAPI/Inventory/HotbarEngine.cs @@ -36,13 +36,13 @@ namespace GamecraftModdingAPI.Inventory public bool SelectBlock(int block, uint playerID, bool cubeSelectedByPick = false) { - var inputs = entitiesDB.QueryEntities(InputExclusiveGroups.LocalPlayers); + var inputs = entitiesDB.QueryEntities(InputExclusiveGroups.LocalPlayers).ToBuffer(); if (inputs.count == 0) return false; for (int i = 0; i < inputs.count; i++) { - if (inputs[i].ID.entityID == playerID) { - inputs[i].cubeSelectedByPick = cubeSelectedByPick; - inputs[i].selectedCube = block; + if (inputs.buffer[i].ID.entityID == playerID) { + inputs.buffer[i].cubeSelectedByPick = cubeSelectedByPick; + inputs.buffer[i].selectedCube = block; return true; } } diff --git a/GamecraftModdingAPI/Players/PlayerEngine.cs b/GamecraftModdingAPI/Players/PlayerEngine.cs index 6d461f2..e253eac 100644 --- a/GamecraftModdingAPI/Players/PlayerEngine.cs +++ b/GamecraftModdingAPI/Players/PlayerEngine.cs @@ -50,10 +50,10 @@ namespace GamecraftModdingAPI.Players public uint GetLocalPlayer() { if (!isReady) return uint.MaxValue; - var localPlayers = entitiesDB.QueryEntities(PlayersExclusiveGroups.LocalPlayers); + var localPlayers = entitiesDB.QueryEntities(PlayersExclusiveGroups.LocalPlayers).ToBuffer(); if (localPlayers.count > 0) { - return localPlayers[0].ID.entityID; + return localPlayers.buffer[0].ID.entityID; } return uint.MaxValue; } @@ -61,10 +61,10 @@ namespace GamecraftModdingAPI.Players public uint GetRemotePlayer() { if (!isReady) return uint.MaxValue; - var localPlayers = entitiesDB.QueryEntities(PlayersExclusiveGroups.RemotePlayers); + var localPlayers = entitiesDB.QueryEntities(PlayersExclusiveGroups.RemotePlayers).ToBuffer(); if (localPlayers.count > 0) { - return localPlayers[0].ID.entityID; + return localPlayers.buffer[0].ID.entityID; } return uint.MaxValue; } diff --git a/GamecraftModdingAPI/Tests/TestRoot.cs b/GamecraftModdingAPI/Tests/TestRoot.cs index 6acb51c..22f3035 100644 --- a/GamecraftModdingAPI/Tests/TestRoot.cs +++ b/GamecraftModdingAPI/Tests/TestRoot.cs @@ -65,7 +65,7 @@ namespace GamecraftModdingAPI.Tests _testsCountPassed = 0; _testsCountFailed = 0; // flow control - Game.Enter += (sender, args) => { GameTests().RunOn(RobocraftX.Schedulers.Lean.EveryFrameStepRunner_RUNS_IN_TIME_STOPPED_AND_RUNNING); }; + Game.Enter += (sender, args) => { GameTests().RunOn(RobocraftX.Schedulers.Lean.EveryFrameStepRunner_TimeRunningAndStopped); }; Game.Exit += (s, a) => state = "ReturningFromGame"; Client.EnterMenu += (sender, args) => { -- 2.30.2 From 8eec1358e936e6132d8a1edf350ec11a29290d68 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Mon, 9 Nov 2020 16:33:12 -0500 Subject: [PATCH 127/252] Fix harmony patch error due to fixed name --- .../Inventory/HotbarSlotSelectionHandlerEnginePatch.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GamecraftModdingAPI/Inventory/HotbarSlotSelectionHandlerEnginePatch.cs b/GamecraftModdingAPI/Inventory/HotbarSlotSelectionHandlerEnginePatch.cs index 9a81f99..a0ad5c1 100644 --- a/GamecraftModdingAPI/Inventory/HotbarSlotSelectionHandlerEnginePatch.cs +++ b/GamecraftModdingAPI/Inventory/HotbarSlotSelectionHandlerEnginePatch.cs @@ -15,7 +15,7 @@ namespace GamecraftModdingAPI.Inventory public static BlockIDs EquippedPartID { get => (BlockIDs)selectedBlockInt; } - private static MethodInfo PatchedMethod { get; } = AccessTools.Method("Gamecraft.GUI.Hotbar.Blocks.SyncHotbarSlotSelectedToEquipedPartEngine:ActivateSlotForCube", parameters: new Type[] { typeof(uint), typeof(int), typeof(ExclusiveGroupStruct) }); + private static MethodInfo PatchedMethod { get; } = AccessTools.Method("Gamecraft.GUI.Hotbar.Blocks.SyncHotbarSlotSelectedToEquippedPartEngine:ActivateSlotForCube", parameters: new Type[] { typeof(uint), typeof(int), typeof(ExclusiveGroupStruct) }); public static void Prefix(uint playerID, int selectedDBPartID, ExclusiveGroupStruct groupID) { -- 2.30.2 From 4f8feaa24ba942fe5d550621ad63553959994d89 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Tue, 10 Nov 2020 16:37:20 +0100 Subject: [PATCH 128/252] Add new blocks and some blueprint/block group support --- GamecraftModdingAPI/Block.cs | 13 +++- GamecraftModdingAPI/BlockGroup.cs | 46 +++++++++++ GamecraftModdingAPI/Blocks/BlockIDs.cs | 2 + GamecraftModdingAPI/Blocks/BlueprintEngine.cs | 77 +++++++++++++++++++ GamecraftModdingAPI/Blueprint.cs | 20 +++++ GamecraftModdingAPI/Main.cs | 1 + 6 files changed, 158 insertions(+), 1 deletion(-) create mode 100644 GamecraftModdingAPI/BlockGroup.cs create mode 100644 GamecraftModdingAPI/Blocks/BlueprintEngine.cs create mode 100644 GamecraftModdingAPI/Blueprint.cs diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index 81d6439..862db3f 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -3,12 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Reflection.Emit; +using Gamecraft.Blocks.BlockGroups; using Svelto.ECS; using Svelto.ECS.EntityStructs; using RobocraftX.Common; using RobocraftX.Blocks; using Unity.Mathematics; -using Unity.Entities; using Gamecraft.Blocks.GUI; using GamecraftModdingAPI.Blocks; @@ -354,6 +354,17 @@ namespace GamecraftModdingAPI } } + /// + /// Returns the block group this block is a part of. Block groups can be placed using blueprints. + /// Returns null if not part of a group. + /// + public BlockGroup BlockGroup + { + get => BlockEngine.GetBlockInfo(this, + (BlockGroupEntityComponent bgec) => + bgec.currentBlockGroup == -1 ? null : new BlockGroup(bgec.currentBlockGroup, this)); + } + /// /// Whether the block exists. The other properties will return a default value if the block doesn't exist. /// If the block was just placed, then this will also return false but the properties will work correctly. diff --git a/GamecraftModdingAPI/BlockGroup.cs b/GamecraftModdingAPI/BlockGroup.cs new file mode 100644 index 0000000..2cd0f42 --- /dev/null +++ b/GamecraftModdingAPI/BlockGroup.cs @@ -0,0 +1,46 @@ +using Gamecraft.Blocks.BlockGroups; +using GamecraftModdingAPI.Blocks; +using GamecraftModdingAPI.Utility; + +namespace GamecraftModdingAPI +{ + /// + /// A group of blocks that can be selected together. The placed version of blueprints. + /// + public class BlockGroup + { + internal static BlueprintEngine _engine = new BlueprintEngine(); + public int Id { get; } + private Block _sourceBlock; + + internal BlockGroup(int id, Block block) + { + if (id == BlockGroupUtility.GROUP_UNASSIGNED) + throw new BlockException("Cannot create a block group for blocks without a group!"); + Id = id; + _sourceBlock = block; + } + + /// + /// Collects each block that is a part of this group. + /// + /// An array of blocks + public Block[] GetBlocks() + { + return _engine.GetBlocksFromGroup(_sourceBlock.Id); + } + + /// + /// Removes all of the blocks in this group from the world. + /// + public void Remove() + { + _engine.RemoveBlockGroup(Id); + } + + public static void Init() + { + GameEngineManager.AddGameEngine(_engine); + } + } +} \ No newline at end of file diff --git a/GamecraftModdingAPI/Blocks/BlockIDs.cs b/GamecraftModdingAPI/Blocks/BlockIDs.cs index d867ce0..1d55b29 100644 --- a/GamecraftModdingAPI/Blocks/BlockIDs.cs +++ b/GamecraftModdingAPI/Blocks/BlockIDs.cs @@ -327,6 +327,8 @@ namespace GamecraftModdingAPI.Blocks SpotLightInvisible, UnlitSlope, UnlitGlowSlope, + Fog, + Sky, MagmaRockCube = 777, MagmaRockCubeSliced, MagmaRockSlope, diff --git a/GamecraftModdingAPI/Blocks/BlueprintEngine.cs b/GamecraftModdingAPI/Blocks/BlueprintEngine.cs new file mode 100644 index 0000000..7f0a616 --- /dev/null +++ b/GamecraftModdingAPI/Blocks/BlueprintEngine.cs @@ -0,0 +1,77 @@ +using System.Reflection; +using Gamecraft.Blocks.BlockGroups; +using Gamecraft.GUI.Blueprints; +using GamecraftModdingAPI.Engines; +using HarmonyLib; +using RobocraftX.Blocks; +using Svelto.DataStructures; +using Svelto.ECS; +using Svelto.ECS.DataStructures; +using Unity.Collections; + +namespace GamecraftModdingAPI.Blocks +{ + public class BlueprintEngine : IApiEngine + { + private readonly MethodInfo getBlocksFromGroup = + AccessTools.Method("RobocraftX.CR.MachineEditing.PlaceBlockUtility:GetBlocksSharingBlockgroup"); + private readonly NativeDynamicArray selectedBlocksInGroup = new NativeDynamicArray(); + private readonly NativeHashSet removedConnections = new NativeHashSet(); + + private static NativeEntityRemove nativeRemove; + private static MachineGraphConnectionEntityFactory connectionFactory; + + public void Ready() + { + } + + public EntitiesDB entitiesDB { get; set; } + public void Dispose() + { + } + + public Block[] GetBlocksFromGroup(EGID blockID) + { + var list = new FasterList(); + object blockPos = null, blockRot = null; + getBlocksFromGroup.Invoke(null, new[] {blockID, selectedBlocksInGroup, entitiesDB, blockPos, blockRot}); + for (uint i = 0; i < selectedBlocksInGroup.Count(); i++) + list.Add(new Block(selectedBlocksInGroup.Get(i))); + selectedBlocksInGroup.FastClear(); + return list.ToArray(); + } + + public void RemoveBlockGroup(int id) + { + BlockGroupUtility.RemoveAllBlocksInBlockGroup(id, entitiesDB, removedConnections, nativeRemove, + connectionFactory, default).Complete(); + } + + public void SelectBlueprint(uint resourceID) + { + BlueprintUtil.SelectBlueprint(null, new BlueprintInventoryItemEntityStruct + { + blueprintResourceId = resourceID, + }); + } + + public string Name { get; } = "GamecraftModdingAPIBlueprintGameEngine"; + public bool isRemovable { get; } + + [HarmonyPatch] + private static class RemoveEnginePatch + { + public static void Prefix(IEntityFunctions entityFunctions, + MachineGraphConnectionEntityFactory machineGraphConnectionEntityFactory) + { + nativeRemove = entityFunctions.ToNativeRemove("GCAPI" + nameof(BlueprintEngine)); + connectionFactory = machineGraphConnectionEntityFactory; + } + + public static MethodBase TargetMethod() + { + return AccessTools.Constructor(AccessTools.TypeByName("RobocraftX.CR.MachineEditing.RemoveBlockEngine")); + } + } + } +} \ No newline at end of file diff --git a/GamecraftModdingAPI/Blueprint.cs b/GamecraftModdingAPI/Blueprint.cs new file mode 100644 index 0000000..de6d65e --- /dev/null +++ b/GamecraftModdingAPI/Blueprint.cs @@ -0,0 +1,20 @@ +using Gamecraft.GUI.Blueprints; + +namespace GamecraftModdingAPI +{ + /// + /// Represents a blueprint in the inventory. When placed it becomes a block group. + /// + public class Blueprint + { + public uint Id { get; } + + /*public static void SelectBlueprint(Blueprint blueprint) + { + BlueprintUtil.SelectBlueprint(null, new BlueprintInventoryItemEntityStruct + { + blueprintResourceId = blueprint.Id + }); + }*/ + } +} \ No newline at end of file diff --git a/GamecraftModdingAPI/Main.cs b/GamecraftModdingAPI/Main.cs index 98fb6f6..584ae90 100644 --- a/GamecraftModdingAPI/Main.cs +++ b/GamecraftModdingAPI/Main.cs @@ -83,6 +83,7 @@ namespace GamecraftModdingAPI // init object-oriented classes Player.Init(); Block.Init(); + BlockGroup.Init(); Wire.Init(); GameClient.Init(); AsyncUtils.Init(); -- 2.30.2 From 1c4e2a0db215c6824500d685be7a9d3b4d70f99f Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Tue, 10 Nov 2020 19:28:36 +0100 Subject: [PATCH 129/252] Add support for setting and placing blueprints --- GamecraftModdingAPI/Blocks/BlueprintEngine.cs | 145 +++++++++++++++++- GamecraftModdingAPI/Blueprint.cs | 48 +++++- GamecraftModdingAPI/Utility/FullGameFields.cs | 9 ++ 3 files changed, 199 insertions(+), 3 deletions(-) diff --git a/GamecraftModdingAPI/Blocks/BlueprintEngine.cs b/GamecraftModdingAPI/Blocks/BlueprintEngine.cs index 7f0a616..f2f0bef 100644 --- a/GamecraftModdingAPI/Blocks/BlueprintEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlueprintEngine.cs @@ -1,13 +1,22 @@ -using System.Reflection; +using System; +using System.Reflection; using Gamecraft.Blocks.BlockGroups; using Gamecraft.GUI.Blueprints; using GamecraftModdingAPI.Engines; +using GamecraftModdingAPI.Utility; using HarmonyLib; using RobocraftX.Blocks; +using RobocraftX.Common; +using RobocraftX.CR.MachineEditing.BoxSelect; +using RobocraftX.CR.MachineEditing.BoxSelect.ClipboardOperations; using Svelto.DataStructures; using Svelto.ECS; using Svelto.ECS.DataStructures; +using Svelto.ECS.EntityStructs; +using Svelto.ECS.Serialization; using Unity.Collections; +using Unity.Mathematics; +using UnityEngine; namespace GamecraftModdingAPI.Blocks { @@ -18,8 +27,20 @@ namespace GamecraftModdingAPI.Blocks private readonly NativeDynamicArray selectedBlocksInGroup = new NativeDynamicArray(); private readonly NativeHashSet removedConnections = new NativeHashSet(); + private static readonly Type PlaceBlueprintUtilityType = + AccessTools.TypeByName("RobocraftX.CR.MachineEditing.PlaceBlueprintUtility"); + private static readonly FieldInfo LocalBlockMap = + AccessTools.DeclaredField(PlaceBlueprintUtilityType, "_localBlockMap"); + private static readonly MethodInfo BuildBlock = AccessTools.Method(PlaceBlueprintUtilityType, "BuildBlock"); + private static readonly MethodInfo BuildWires = AccessTools.Method(PlaceBlueprintUtilityType, "BuildWires"); + private static NativeEntityRemove nativeRemove; private static MachineGraphConnectionEntityFactory connectionFactory; + private static IEntityFunctions entityFunctions; + private static ClipboardSerializationDataResourceManager clipboardManager; + private static IEntitySerialization entitySerialization; + private static IEntityFactory entityFactory; + private static FasterList globalBlockMap; public void Ready() { @@ -55,6 +76,109 @@ namespace GamecraftModdingAPI.Blocks }); } + public uint CreateBlueprint() + { + uint index = clipboardManager.AllocateSerializationData(); + return index; + } + + public void ReplaceBlueprint(uint playerID, uint blueprintID, Block[] selected, float3 pos, quaternion rot) + { + var blockIDs = new EGID[selected.Length]; + for (var i = 0; i < selected.Length; i++) + { + var block = selected[i]; + blockIDs[i] = block.Id; + } + + var serializationData = clipboardManager.GetSerializationData(blueprintID); + SelectionSerializationUtility.ClearClipboard(playerID, entitiesDB, entityFunctions, serializationData.blueprintData); + if (selected.Length == 0) + return; + //ref BlockGroupTransformEntityComponent groupTransform = ref EntityNativeDBExtensions.QueryEntity(entitiesDb, (uint) local1.currentBlockGroup, BlockGroupExclusiveGroups.BlockGroupEntityGroup); + //ref ColliderAabb collider = ref EntityNativeDBExtensions.QueryEntity(entitiesDB, (uint) groupID, BlockGroupExclusiveGroups.BlockGroupEntityGroup); + //float3 bottomOffset = PlaceBlockUtility.GetBottomOffset(collider); + //var rootPosition = math.mul(groupTransform.blockGroupGridRotation, bottomOffset) + groupTransform.blockGroupGridPosition; + //var rootRotation = groupTransform.blockGroupGridRotation; + if (math.all(pos == default)) + pos = selected[0].Position; + if (math.all(rot.value == default)) + rot = Quaternion.Euler(selected[0].Rotation); + + clipboardManager.SetGhostSerialized(blueprintID, false); + SelectionSerializationUtility.CopySelectionToClipboard(playerID, entitiesDB, + serializationData.blueprintData, entitySerialization, entityFactory, blockIDs, + (uint) blockIDs.Length, pos, rot); + } + + public Block[] PlaceBlueprintBlocks(uint blueprintID, uint playerID, float3 pos, float3 rot) + { //RobocraftX.CR.MachineEditing.PlaceBlueprintUtility.PlaceBlocksFromSerialisedData + var serializationData = clipboardManager.GetSerializationData(blueprintID); + var blueprintData = serializationData.blueprintData; + blueprintData.dataPos = 0U; + uint selectionSize; + PositionEntityStruct selectionPosition; + RotationEntityStruct selectionRotation; + uint version; + BoxSelectSerializationUtilities.ReadClipboardHeader(blueprintData, out selectionSize, out selectionPosition, out selectionRotation, out version); + ((FasterList) LocalBlockMap.GetValue(null)).Clear(); + if (version <= 1U) + { + uint groupsCount; + BoxSelectSerializationUtilities.ReadBlockGroupData(blueprintData, out groupsCount); + for (int index = 0; (long) index < (long) groupsCount; ++index) + { + int nextFilterId = BlockGroupUtility.NextFilterId; + entitySerialization.DeserializeNewEntity(new EGID((uint) nextFilterId, BlockGroupExclusiveGroups.BlockGroupEntityGroup), blueprintData, 1); + } + } + int nextFilterId1 = BlockGroupUtility.NextFilterId; + entityFactory.BuildEntity(new EGID((uint) nextFilterId1, BlockGroupExclusiveGroups.BlockGroupEntityGroup)).Init(new BlockGroupTransformEntityComponent + { + blockGroupGridPosition = selectionPosition.position, + blockGroupGridRotation = selectionRotation.rotation + }); + var frot = Quaternion.Euler(rot); + var grid = new GridRotationStruct {position = pos, rotation = frot}; + var poss = new PositionEntityStruct {position = pos}; + var rots = new RotationEntityStruct {rotation = frot}; + for (int index = 0; (long) index < (long) selectionSize; ++index) + BuildBlock.Invoke(null, + new object[] + { + playerID, grid, poss, rots, selectionPosition, selectionRotation, blueprintData, + entitiesDB, entitySerialization, nextFilterId1 + }); + /* + uint playerId, in GridRotationStruct ghostParentGrid, + in PositionEntityStruct ghostParentPosition, in RotationEntityStruct ghostParentRotation, + in PositionEntityStruct selectionPosition, in RotationEntityStruct selectionRotation, + ISerializationData serializationData, EntitiesDB entitiesDb, + IEntitySerialization entitySerialization, int blockGroupId + */ + if (globalBlockMap == null) + globalBlockMap = FullGameFields._deserialisedBlockMap; + var placedBlocks = (FasterList) LocalBlockMap.GetValue(null); + globalBlockMap.Clear(); + globalBlockMap.AddRange(placedBlocks); + BuildWires.Invoke(null, + new object[] {playerID, blueprintData, entitySerialization, entitiesDB, entityFactory}); + var blocks = new Block[placedBlocks.count]; + for (int i = 0; i < blocks.Length; i++) + blocks[i] = new Block(placedBlocks[i]); + return blocks; + } + + public void InitBlueprint(uint blueprintID) + { + clipboardManager.IncrementRefCount(blueprintID); + } + + public void DisposeBlueprint(uint blueprintID) + { + clipboardManager.DecrementRefCount(blueprintID); + } + public string Name { get; } = "GamecraftModdingAPIBlueprintGameEngine"; public bool isRemovable { get; } @@ -66,6 +190,7 @@ namespace GamecraftModdingAPI.Blocks { nativeRemove = entityFunctions.ToNativeRemove("GCAPI" + nameof(BlueprintEngine)); connectionFactory = machineGraphConnectionEntityFactory; + BlueprintEngine.entityFunctions = entityFunctions; } public static MethodBase TargetMethod() @@ -73,5 +198,23 @@ namespace GamecraftModdingAPI.Blocks return AccessTools.Constructor(AccessTools.TypeByName("RobocraftX.CR.MachineEditing.RemoveBlockEngine")); } } + + [HarmonyPatch] + private static class SelectEnginePatch + { + public static void Prefix(ClipboardSerializationDataResourceManager clipboardSerializationDataResourceManager, + IEntitySerialization entitySerialization, + IEntityFactory entityFactory) + { + clipboardManager = clipboardSerializationDataResourceManager; + BlueprintEngine.entitySerialization = entitySerialization; + BlueprintEngine.entityFactory = entityFactory; + } + + public static MethodBase TargetMethod() + { + return AccessTools.Constructor(AccessTools.TypeByName("RobocraftX.CR.MachineEditing.SelectBlockEngine")); + } + } } } \ No newline at end of file diff --git a/GamecraftModdingAPI/Blueprint.cs b/GamecraftModdingAPI/Blueprint.cs index de6d65e..26876f6 100644 --- a/GamecraftModdingAPI/Blueprint.cs +++ b/GamecraftModdingAPI/Blueprint.cs @@ -1,13 +1,20 @@ -using Gamecraft.GUI.Blueprints; +using System; +using Unity.Mathematics; namespace GamecraftModdingAPI { /// /// Represents a blueprint in the inventory. When placed it becomes a block group. /// - public class Blueprint + public class Blueprint : IDisposable { public uint Id { get; } + + internal Blueprint(uint id) + { + Id = id; + BlockGroup._engine.InitBlueprint(id); + } /*public static void SelectBlueprint(Blueprint blueprint) { @@ -16,5 +23,42 @@ namespace GamecraftModdingAPI blueprintResourceId = blueprint.Id }); }*/ + + /// + /// Creates a new, empty blueprint. It will be deleted on disposal unless the game holds a reference to it. + /// + /// A blueprint that doesn't have any blocks + public static Blueprint Create() + { + return new Blueprint(BlockGroup._engine.CreateBlueprint()); + } + + /// + /// Set the blocks that the blueprint contains. + /// + /// The array of blocks to use + /// The anchor position of the blueprint + /// The rotation of the blueprint + public void SetStoredBlocks(Block[] blocks, float3 position = default, float3 rotation = default) + { + BlockGroup._engine.ReplaceBlueprint(Player.LocalPlayer.Id, Id, blocks, position, + quaternion.Euler(rotation)); + } + + /// + /// Places the blocks the blueprint contains at the specified position and rotation. + /// + /// The position of the blueprint + /// The rotation of the blueprint + /// An array of the placed blocks + public Block[] PlaceBlocks(float3 position, float3 rotation) + { + return BlockGroup._engine.PlaceBlueprintBlocks(Id, Player.LocalPlayer.Id, position, rotation); + } + + public void Dispose() + { + BlockGroup._engine.DisposeBlueprint(Id); + } } } \ No newline at end of file diff --git a/GamecraftModdingAPI/Utility/FullGameFields.cs b/GamecraftModdingAPI/Utility/FullGameFields.cs index 8fd8895..432103d 100644 --- a/GamecraftModdingAPI/Utility/FullGameFields.cs +++ b/GamecraftModdingAPI/Utility/FullGameFields.cs @@ -12,6 +12,7 @@ using RobocraftX.GUI; using RobocraftX.Multiplayer; using RobocraftX.Rendering; using Svelto.Context; +using Svelto.DataStructures; using Svelto.ECS; using Svelto.ECS.Schedulers.Unity; using UnityEngine; @@ -159,6 +160,14 @@ namespace GamecraftModdingAPI.Utility } } + public static FasterList _deserialisedBlockMap + { + get + { + return (FasterList) fgcr?.Field("_deserialisedBlockMap").GetValue(); + } + } + private static Traverse fgcr; public static void Init(FullGameCompositionRoot instance) -- 2.30.2 From 3dd61b5e4fa50d6d3b799d4c4f5e5658c9cf2de4 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Tue, 10 Nov 2020 23:08:27 +0100 Subject: [PATCH 130/252] Replace ToManagedArray() and fix getting blocks from group --- GamecraftModdingAPI/App/GameGameEngine.cs | 21 ++++++++++--- GamecraftModdingAPI/BlockGroup.cs | 24 +++++++++++--- GamecraftModdingAPI/Blocks/BlockEngine.cs | 17 +++++++--- GamecraftModdingAPI/Blocks/BlueprintEngine.cs | 31 ++++++++++++------- 4 files changed, 68 insertions(+), 25 deletions(-) diff --git a/GamecraftModdingAPI/App/GameGameEngine.cs b/GamecraftModdingAPI/App/GameGameEngine.cs index dea3821..85fb672 100644 --- a/GamecraftModdingAPI/App/GameGameEngine.cs +++ b/GamecraftModdingAPI/App/GameGameEngine.cs @@ -102,16 +102,27 @@ namespace GamecraftModdingAPI.App if (filter == BlockIDs.Invalid) { foreach (var (blocks, _) in allBlocks) - foreach (var block in blocks.ToBuffer().buffer.ToManagedArray()) - blockEGIDs.Add(block.ID); + { + var buffer = blocks.ToBuffer().buffer; + for (int i = 0; i < buffer.capacity; i++) + blockEGIDs.Add(buffer[i].ID); + } + return blockEGIDs.ToArray(); } else { foreach (var (blocks, _) in allBlocks) - foreach (var block in blocks.ToBuffer().buffer.ToManagedArray()) - if (block.DBID == (ulong) filter) - blockEGIDs.Add(block.ID); + { + var array = blocks.ToBuffer().buffer; + for (var index = 0; index < array.capacity; index++) + { + var block = array[index]; + if (block.DBID == (ulong) filter) + blockEGIDs.Add(block.ID); + } + } + return blockEGIDs.ToArray(); } } diff --git a/GamecraftModdingAPI/BlockGroup.cs b/GamecraftModdingAPI/BlockGroup.cs index 2cd0f42..8d9e761 100644 --- a/GamecraftModdingAPI/BlockGroup.cs +++ b/GamecraftModdingAPI/BlockGroup.cs @@ -1,4 +1,7 @@ using Gamecraft.Blocks.BlockGroups; +using Unity.Mathematics; +using UnityEngine; + using GamecraftModdingAPI.Blocks; using GamecraftModdingAPI.Utility; @@ -11,23 +14,36 @@ namespace GamecraftModdingAPI { internal static BlueprintEngine _engine = new BlueprintEngine(); public int Id { get; } - private Block _sourceBlock; + private readonly Block sourceBlock; internal BlockGroup(int id, Block block) { if (id == BlockGroupUtility.GROUP_UNASSIGNED) throw new BlockException("Cannot create a block group for blocks without a group!"); Id = id; - _sourceBlock = block; + sourceBlock = block; } + + /// + /// The position of the block group. Calculated when GetBlocks() is used. + /// + public float3 Position { get; private set; } + + /// + /// The rotation of the block group. Calculated when GetBlocks() is used. + /// + public float3 Rotation { get; private set; } /// - /// Collects each block that is a part of this group. + /// Collects each block that is a part of this group. Also sets the position and rotation. /// /// An array of blocks public Block[] GetBlocks() { - return _engine.GetBlocksFromGroup(_sourceBlock.Id); + var ret = _engine.GetBlocksFromGroup(sourceBlock.Id, out var pos, out var rot); + Position = pos; + Rotation = ((Quaternion) rot).eulerAngles; + return ret; } /// diff --git a/GamecraftModdingAPI/Blocks/BlockEngine.cs b/GamecraftModdingAPI/Blocks/BlockEngine.cs index 5566525..9ce6d62 100644 --- a/GamecraftModdingAPI/Blocks/BlockEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlockEngine.cs @@ -12,9 +12,9 @@ using RobocraftX.Scene.Simulation; using Svelto.DataStructures; using Svelto.ECS; using Svelto.ECS.Hybrid; +using Unity.Mathematics; using GamecraftModdingAPI.Engines; -using Unity.Mathematics; namespace GamecraftModdingAPI.Blocks { @@ -224,8 +224,10 @@ namespace GamecraftModdingAPI.Blocks var bodies = new HashSet(); foreach (var (coll, _) in groups) { - foreach (var conn in coll.ToBuffer().buffer.ToManagedArray()) + var array = coll.ToBuffer().buffer; + for (var index = 0; index < array.capacity; index++) { + var conn = array[index]; if (conn.clusterId == cid) bodies.Add(conn.machineRigidBodyId); } @@ -251,8 +253,11 @@ namespace GamecraftModdingAPI.Blocks var groups = entitiesDB.QueryEntities(); foreach (var (coll, _) in groups) { - foreach (var conn in coll.ToBuffer().buffer.ToManagedArray()) - { //Static blocks don't have a cluster ID but the cluster destruction manager should have one + var array = coll.ToBuffer().buffer; + for (var index = 0; index < array.capacity; index++) + { + var conn = array[index]; + //Static blocks don't have a cluster ID but the cluster destruction manager should have one if (conn.machineRigidBodyId == sbid && conn.clusterId != uint.MaxValue) return new Cluster(conn.clusterId); } @@ -267,8 +272,10 @@ namespace GamecraftModdingAPI.Blocks var set = new HashSet(); foreach (var (coll, _) in groups) { - foreach (var conn in coll.ToBuffer().buffer.ToManagedArray()) + var array = coll.ToBuffer().buffer; + for (var index = 0; index < array.capacity; index++) { + var conn = array[index]; if (conn.machineRigidBodyId == sbid) set.Add(new Block(conn.ID)); } diff --git a/GamecraftModdingAPI/Blocks/BlueprintEngine.cs b/GamecraftModdingAPI/Blocks/BlueprintEngine.cs index f2f0bef..4104ae6 100644 --- a/GamecraftModdingAPI/Blocks/BlueprintEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlueprintEngine.cs @@ -17,6 +17,7 @@ using Svelto.ECS.Serialization; using Unity.Collections; using Unity.Mathematics; using UnityEngine; +using Allocator = Svelto.Common.Allocator; namespace GamecraftModdingAPI.Blocks { @@ -24,8 +25,9 @@ namespace GamecraftModdingAPI.Blocks { private readonly MethodInfo getBlocksFromGroup = AccessTools.Method("RobocraftX.CR.MachineEditing.PlaceBlockUtility:GetBlocksSharingBlockgroup"); - private readonly NativeDynamicArray selectedBlocksInGroup = new NativeDynamicArray(); - private readonly NativeHashSet removedConnections = new NativeHashSet(); + + private NativeDynamicArray selectedBlocksInGroup; + private NativeHashSet removedConnections = new NativeHashSet(); private static readonly Type PlaceBlueprintUtilityType = AccessTools.TypeByName("RobocraftX.CR.MachineEditing.PlaceBlueprintUtility"); @@ -44,22 +46,29 @@ namespace GamecraftModdingAPI.Blocks public void Ready() { + selectedBlocksInGroup = NativeDynamicArray.Alloc(Allocator.Persistent); } public EntitiesDB entitiesDB { get; set; } public void Dispose() { + selectedBlocksInGroup.Dispose(); } - public Block[] GetBlocksFromGroup(EGID blockID) + public Block[] GetBlocksFromGroup(EGID blockID, out float3 pos, out quaternion rot) { - var list = new FasterList(); - object blockPos = null, blockRot = null; - getBlocksFromGroup.Invoke(null, new[] {blockID, selectedBlocksInGroup, entitiesDB, blockPos, blockRot}); - for (uint i = 0; i < selectedBlocksInGroup.Count(); i++) - list.Add(new Block(selectedBlocksInGroup.Get(i))); + var blockPos = default(float3); + var blockRot = default(quaternion); + var parameters = new object[] {blockID, selectedBlocksInGroup, entitiesDB, blockPos, blockRot}; + getBlocksFromGroup.Invoke(null, parameters); + pos = (float3) parameters[3]; + rot = (quaternion) parameters[4]; + int count = selectedBlocksInGroup.Count(); + var ret = new Block[count]; + for (uint i = 0; i < count; i++) + ret[i] = new Block(selectedBlocksInGroup.Get(i)); selectedBlocksInGroup.FastClear(); - return list.ToArray(); + return ret; } public void RemoveBlockGroup(int id) @@ -195,7 +204,7 @@ namespace GamecraftModdingAPI.Blocks public static MethodBase TargetMethod() { - return AccessTools.Constructor(AccessTools.TypeByName("RobocraftX.CR.MachineEditing.RemoveBlockEngine")); + return AccessTools.GetDeclaredConstructors(AccessTools.TypeByName("RobocraftX.CR.MachineEditing.RemoveBlockEngine"))[0]; } } @@ -213,7 +222,7 @@ namespace GamecraftModdingAPI.Blocks public static MethodBase TargetMethod() { - return AccessTools.Constructor(AccessTools.TypeByName("RobocraftX.CR.MachineEditing.SelectBlockEngine")); + return AccessTools.GetDeclaredConstructors(AccessTools.TypeByName("RobocraftX.CR.MachineEditing.SelectBlockEngine"))[0]; } } } -- 2.30.2 From d744aaab79ae1c9a02a84784d4358ef51720d1ee Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Thu, 12 Nov 2020 02:39:58 +0100 Subject: [PATCH 131/252] Add ability to create & move block groups & other stuff Added a way to store block groups as blueprints Blocks can be added/removed from block groups, although it doesn't work well atm Added some patches to the test class in an attempt to debug an unrelated issue Added a command to test placing a block group Added a SelectedBlueprint property to the Player class --- GamecraftModdingAPI/Block.cs | 28 +++- GamecraftModdingAPI/BlockGroup.cs | 153 ++++++++++++++++-- .../Blocks/BlockEventsEngine.cs | 11 +- GamecraftModdingAPI/Blocks/BlueprintEngine.cs | 49 ++++-- GamecraftModdingAPI/Blocks/PlacementEngine.cs | 8 +- GamecraftModdingAPI/Blueprint.cs | 16 +- GamecraftModdingAPI/Player.cs | 13 +- .../Tests/GamecraftModdingAPIPluginTest.cs | 101 ++++++++++++ 8 files changed, 332 insertions(+), 47 deletions(-) diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index 862db3f..33a1623 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -240,6 +240,8 @@ namespace GamecraftModdingAPI set { MovementEngine.MoveBlock(Id, InitData, value); + if (blockGroup != null) + blockGroup.PosAndRotCalculated = false; } } @@ -252,6 +254,8 @@ namespace GamecraftModdingAPI set { RotationEngine.RotateBlock(Id, InitData, value); + if (blockGroup != null) + blockGroup.PosAndRotCalculated = false; } } @@ -354,15 +358,31 @@ namespace GamecraftModdingAPI } } + private BlockGroup blockGroup; /// /// Returns the block group this block is a part of. Block groups can be placed using blueprints. - /// Returns null if not part of a group. + /// Returns null if not part of a group.
+ /// Setting the group after the block has been initialized will not update everything properly. + /// You should only set this property on blocks newly placed by your code. ///
public BlockGroup BlockGroup { - get => BlockEngine.GetBlockInfo(this, - (BlockGroupEntityComponent bgec) => - bgec.currentBlockGroup == -1 ? null : new BlockGroup(bgec.currentBlockGroup, this)); + get + { + if (blockGroup != null) return blockGroup; + return blockGroup = BlockEngine.GetBlockInfo(this, + (BlockGroupEntityComponent bgec) => + bgec.currentBlockGroup == -1 ? null : new BlockGroup(bgec.currentBlockGroup, this)); + } + set + { + blockGroup?.RemoveInternal(this); + BlockEngine.SetBlockInfo(this, + (ref BlockGroupEntityComponent bgec, BlockGroup val) => bgec.currentBlockGroup = val?.Id ?? -1, + value); + value?.AddInternal(this); + blockGroup = value; + } } /// diff --git a/GamecraftModdingAPI/BlockGroup.cs b/GamecraftModdingAPI/BlockGroup.cs index 8d9e761..d660236 100644 --- a/GamecraftModdingAPI/BlockGroup.cs +++ b/GamecraftModdingAPI/BlockGroup.cs @@ -1,4 +1,8 @@ -using Gamecraft.Blocks.BlockGroups; +using System; +using System.Collections; +using System.Collections.Generic; + +using Gamecraft.Blocks.BlockGroups; using Unity.Mathematics; using UnityEngine; @@ -10,11 +14,14 @@ namespace GamecraftModdingAPI /// /// A group of blocks that can be selected together. The placed version of blueprints. /// - public class BlockGroup + public class BlockGroup : ICollection { internal static BlueprintEngine _engine = new BlueprintEngine(); public int Id { get; } private readonly Block sourceBlock; + private readonly List blocks; + private float3 position, rotation; + internal bool PosAndRotCalculated; internal BlockGroup(int id, Block block) { @@ -22,41 +29,155 @@ namespace GamecraftModdingAPI throw new BlockException("Cannot create a block group for blocks without a group!"); Id = id; sourceBlock = block; + blocks = new List(GetBlocks()); } /// - /// The position of the block group. Calculated when GetBlocks() is used. + /// The position of the block group (center). Recalculated if blocks have been added/removed since the last query. /// - public float3 Position { get; private set; } - + public float3 Position + { + get + { + if (!PosAndRotCalculated) + Refresh(); + return position; + } + set + { + var diff = value - position; + foreach (var block in blocks) + block.Position += diff; + if (!PosAndRotCalculated) //The condition can only be true if a block has been added/removed manually + Refresh(); //So the blocks array is up to date + else + position += diff; + } + } + /// - /// The rotation of the block group. Calculated when GetBlocks() is used. + /// The rotation of the block group. Recalculated if blocks have been added/removed since the last query. /// - public float3 Rotation { get; private set; } + public float3 Rotation + { + get + { + if (!PosAndRotCalculated) + Refresh(); + return rotation; + } + set + { + var diff = value - rotation; + var qdiff = Quaternion.Euler(diff); + foreach (var block in blocks) + { + block.Rotation += diff; + block.Position = qdiff * block.Position; + } + if (!PosAndRotCalculated) + Refresh(); + else + rotation += diff; + } + } + + /*/// + /// Removes all of the blocks in this group from the world. + /// + public void RemoveBlocks() + { + _engine.RemoveBlockGroup(Id); - TODO: Causes a hard crash + }*/ + + /// + /// Creates a new block group consisting of a single block. + /// You can add more blocks using the Add() method or by setting the BlockGroup property of the blocks.
+ /// Note that only newly placed blocks should be added to groups. + ///
+ /// The block to add + /// A new block group containing the given block + public static BlockGroup Create(Block block) + { + return new BlockGroup(_engine.CreateBlockGroup(default, default), block); + } /// /// Collects each block that is a part of this group. Also sets the position and rotation. /// /// An array of blocks - public Block[] GetBlocks() + private Block[] GetBlocks() { + if (!sourceBlock.Exists) return new[] {sourceBlock}; //The block must exist to get the others var ret = _engine.GetBlocksFromGroup(sourceBlock.Id, out var pos, out var rot); - Position = pos; - Rotation = ((Quaternion) rot).eulerAngles; + position = pos; + rotation = ((Quaternion) rot).eulerAngles; + PosAndRotCalculated = true; return ret; } - /// - /// Removes all of the blocks in this group from the world. - /// - public void Remove() + private void Refresh() { - _engine.RemoveBlockGroup(Id); + blocks.Clear(); + blocks.AddRange(GetBlocks()); } - public static void Init() + internal static void Init() { GameEngineManager.AddGameEngine(_engine); } + + public IEnumerator GetEnumerator() => blocks.GetEnumerator(); + IEnumerator IEnumerable.GetEnumerator() => blocks.GetEnumerator(); + + /// + /// Adds a block to the group. You should only add newly placed blocks + /// so that the game initializes the group membership properly. + /// + /// + /// + public void Add(Block item) + { + if (item == null) throw new NullReferenceException("Cannot add null to a block group"); + item.BlockGroup = this; //Calls AddInternal + } + + internal void AddInternal(Block item) => blocks.Add(item); + + /// + /// Removes all blocks from this group. + /// You should not remove blocks that have been initialized, only those that you placed recently. + /// + public void Clear() + { + while (blocks.Count > 0) + Remove(blocks[blocks.Count - 1]); + } + + public bool Contains(Block item) => blocks.Contains(item); + public void CopyTo(Block[] array, int arrayIndex) => blocks.CopyTo(array, arrayIndex); + + /// + /// Removes a block from this group. + /// You should not remove blocks that have been initialized, only those that you placed recently. + /// + /// + /// + /// + public bool Remove(Block item) + { + if (item == null) throw new NullReferenceException("Cannot remove null from a block group"); + bool ret = item.BlockGroup == this; + if (ret) + item.BlockGroup = null; //Calls RemoveInternal + return ret; + } + + internal void RemoveInternal(Block item) => blocks.Remove(item); + + public int Count => blocks.Count; + public bool IsReadOnly { get; } = false; + + public Block this[int index] => blocks[index]; //Setting is not supported, since the order doesn't matter } } \ No newline at end of file diff --git a/GamecraftModdingAPI/Blocks/BlockEventsEngine.cs b/GamecraftModdingAPI/Blocks/BlockEventsEngine.cs index 1e5ce21..d1c2639 100644 --- a/GamecraftModdingAPI/Blocks/BlockEventsEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlockEventsEngine.cs @@ -5,10 +5,11 @@ using Svelto.ECS; using GamecraftModdingAPI.Engines; using GamecraftModdingAPI.Utility; +using RobocraftX.Blocks; namespace GamecraftModdingAPI.Blocks { - public class BlockEventsEngine : IReactionaryEngine + public class BlockEventsEngine : IReactionaryEngine { public event EventHandler Placed; public event EventHandler Removed; @@ -27,20 +28,20 @@ namespace GamecraftModdingAPI.Blocks public bool isRemovable { get; } = false; private bool shouldAddRemove; - public void Add(ref DBEntityStruct entityComponent, EGID egid) + public void Add(ref BlockTagEntityStruct entityComponent, EGID egid) { if (!(shouldAddRemove = !shouldAddRemove)) return; ExceptionUtil.InvokeEvent(Placed, this, - new BlockPlacedRemovedEventArgs {ID = egid, Type = (BlockIDs) entityComponent.DBID}); + new BlockPlacedRemovedEventArgs {ID = egid}); } - public void Remove(ref DBEntityStruct entityComponent, EGID egid) + public void Remove(ref BlockTagEntityStruct entityComponent, EGID egid) { if (!(shouldAddRemove = !shouldAddRemove)) return; ExceptionUtil.InvokeEvent(Removed, this, - new BlockPlacedRemovedEventArgs {ID = egid, Type = (BlockIDs) entityComponent.DBID}); + new BlockPlacedRemovedEventArgs {ID = egid}); } } diff --git a/GamecraftModdingAPI/Blocks/BlueprintEngine.cs b/GamecraftModdingAPI/Blocks/BlueprintEngine.cs index 4104ae6..e46ad50 100644 --- a/GamecraftModdingAPI/Blocks/BlueprintEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlueprintEngine.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Reflection; using Gamecraft.Blocks.BlockGroups; using Gamecraft.GUI.Blueprints; @@ -21,7 +22,7 @@ using Allocator = Svelto.Common.Allocator; namespace GamecraftModdingAPI.Blocks { - public class BlueprintEngine : IApiEngine + public class BlueprintEngine : IFactoryEngine { private readonly MethodInfo getBlocksFromGroup = AccessTools.Method("RobocraftX.CR.MachineEditing.PlaceBlockUtility:GetBlocksSharingBlockgroup"); @@ -77,12 +78,29 @@ namespace GamecraftModdingAPI.Blocks connectionFactory, default).Complete(); } + public int CreateBlockGroup(float3 position, quaternion rotation) + { + int nextFilterId = BlockGroupUtility.NextFilterId; + Factory.BuildEntity((uint) nextFilterId, + BlockGroupExclusiveGroups.BlockGroupEntityGroup).Init(new BlockGroupTransformEntityComponent + { + blockGroupGridRotation = rotation, + blockGroupGridPosition = position + }); + return nextFilterId; + } + public void SelectBlueprint(uint resourceID) { - BlueprintUtil.SelectBlueprint(null, new BlueprintInventoryItemEntityStruct + if (resourceID == uint.MaxValue) + BlueprintUtil.UnselectBlueprint(entitiesDB); + else { - blueprintResourceId = resourceID, - }); + BlueprintUtil.SelectBlueprint(entitiesDB, new BlueprintInventoryItemEntityStruct + { + blueprintResourceId = resourceID, + }); + } } public uint CreateBlueprint() @@ -91,28 +109,27 @@ namespace GamecraftModdingAPI.Blocks return index; } - public void ReplaceBlueprint(uint playerID, uint blueprintID, Block[] selected, float3 pos, quaternion rot) + public void ReplaceBlueprint(uint playerID, uint blueprintID, ICollection selected, float3 pos, quaternion rot) { - var blockIDs = new EGID[selected.Length]; - for (var i = 0; i < selected.Length; i++) + var blockIDs = new EGID[selected.Count]; + using (var enumerator = selected.GetEnumerator()) { - var block = selected[i]; - blockIDs[i] = block.Id; + for (var i = 0; enumerator.MoveNext(); i++) + { + var block = enumerator.Current; + blockIDs[i] = block.Id; + } } var serializationData = clipboardManager.GetSerializationData(blueprintID); SelectionSerializationUtility.ClearClipboard(playerID, entitiesDB, entityFunctions, serializationData.blueprintData); - if (selected.Length == 0) + if (selected.Count == 0) return; //ref BlockGroupTransformEntityComponent groupTransform = ref EntityNativeDBExtensions.QueryEntity(entitiesDb, (uint) local1.currentBlockGroup, BlockGroupExclusiveGroups.BlockGroupEntityGroup); //ref ColliderAabb collider = ref EntityNativeDBExtensions.QueryEntity(entitiesDB, (uint) groupID, BlockGroupExclusiveGroups.BlockGroupEntityGroup); //float3 bottomOffset = PlaceBlockUtility.GetBottomOffset(collider); //var rootPosition = math.mul(groupTransform.blockGroupGridRotation, bottomOffset) + groupTransform.blockGroupGridPosition; //var rootRotation = groupTransform.blockGroupGridRotation; - if (math.all(pos == default)) - pos = selected[0].Position; - if (math.all(rot.value == default)) - rot = Quaternion.Euler(selected[0].Rotation); clipboardManager.SetGhostSerialized(blueprintID, false); SelectionSerializationUtility.CopySelectionToClipboard(playerID, entitiesDB, @@ -189,7 +206,7 @@ namespace GamecraftModdingAPI.Blocks } public string Name { get; } = "GamecraftModdingAPIBlueprintGameEngine"; - public bool isRemovable { get; } + public bool isRemovable { get; } = false; [HarmonyPatch] private static class RemoveEnginePatch @@ -225,5 +242,7 @@ namespace GamecraftModdingAPI.Blocks return AccessTools.GetDeclaredConstructors(AccessTools.TypeByName("RobocraftX.CR.MachineEditing.SelectBlockEngine"))[0]; } } + + public IEntityFactory Factory { get; set; } } } \ No newline at end of file diff --git a/GamecraftModdingAPI/Blocks/PlacementEngine.cs b/GamecraftModdingAPI/Blocks/PlacementEngine.cs index cf9a80f..5357e7f 100644 --- a/GamecraftModdingAPI/Blocks/PlacementEngine.cs +++ b/GamecraftModdingAPI/Blocks/PlacementEngine.cs @@ -53,15 +53,15 @@ namespace GamecraftModdingAPI.Blocks private EntityComponentInitializer BuildBlock(ushort block, byte color, float3 position, int uscale, float3 scale, float3 rot, uint playerId) { if (_blockEntityFactory == null) - throw new Exception("The factory is null."); + throw new BlockException("The factory is null."); if (uscale < 1) - throw new Exception("Scale needs to be at least 1"); + throw new BlockException("Scale needs to be at least 1"); if (scale.x < 4e-5) scale.x = uscale; if (scale.y < 4e-5) scale.y = uscale; if (scale.z < 4e-5) scale.z = uscale; uint dbid = block; - if (!PrefabsID.DBIDMAP.ContainsKey(dbid)) - throw new Exception("Block with ID " + dbid + " not found!"); + if (!PrefabsID.HasPrefabRegistered(dbid, 0)) + throw new BlockException("Block with ID " + dbid + " not found!"); //RobocraftX.CR.MachineEditing.PlaceBlockEngine ScalingEntityStruct scaling = new ScalingEntityStruct {scale = scale}; Quaternion rotQ = Quaternion.Euler(rot); diff --git a/GamecraftModdingAPI/Blueprint.cs b/GamecraftModdingAPI/Blueprint.cs index 26876f6..458c56c 100644 --- a/GamecraftModdingAPI/Blueprint.cs +++ b/GamecraftModdingAPI/Blueprint.cs @@ -1,5 +1,6 @@ using System; using Unity.Mathematics; +using UnityEngine; namespace GamecraftModdingAPI { @@ -35,16 +36,27 @@ namespace GamecraftModdingAPI /// /// Set the blocks that the blueprint contains. + /// Use the BlockGroup overload for automatically calculated position and rotation. /// /// The array of blocks to use /// The anchor position of the blueprint - /// The rotation of the blueprint - public void SetStoredBlocks(Block[] blocks, float3 position = default, float3 rotation = default) + /// The base rotation of the blueprint + public void StoreBlocks(Block[] blocks, float3 position, float3 rotation) { BlockGroup._engine.ReplaceBlueprint(Player.LocalPlayer.Id, Id, blocks, position, quaternion.Euler(rotation)); } + /// + /// Store the blocks from the given group in the blueprint with correct position and rotation for the blueprint. + /// + /// The block group to store + public void StoreBlocks(BlockGroup group) + { + BlockGroup._engine.ReplaceBlueprint(Player.LocalPlayer.Id, Id, group, group.Position, + Quaternion.Euler(group.Rotation)); + } + /// /// Places the blocks the blueprint contains at the specified position and rotation. /// diff --git a/GamecraftModdingAPI/Player.cs b/GamecraftModdingAPI/Player.cs index a4b7064..14892a3 100644 --- a/GamecraftModdingAPI/Player.cs +++ b/GamecraftModdingAPI/Player.cs @@ -1,5 +1,5 @@ using System; - +using Gamecraft.GUI.Blueprints; using Unity.Mathematics; using RobocraftX.Common; using RobocraftX.Common.Players; @@ -343,6 +343,17 @@ namespace GamecraftModdingAPI } } + /// + /// The player's selected blueprint in their hand. Set to null to clear. Dispose after usage. + /// + public Blueprint SelectedBlueprint + { + get => playerEngine.GetPlayerStruct(Id, out BlueprintInventoryItemEntityStruct biies) + ? new Blueprint(biies.blueprintResourceId) + : null; + set => BlockGroup._engine.SelectBlueprint(value?.Id ?? uint.MaxValue); + } + // object methods /// diff --git a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs index f0334aa..fb806ea 100644 --- a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs +++ b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs @@ -1,24 +1,29 @@ using System; +using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; +using System.Reflection.Emit; using System.Text; using HarmonyLib; using IllusionInjector; // test +using GPUInstancer; using Svelto.ECS; using RobocraftX.Blocks; using RobocraftX.Common; using RobocraftX.SimulationModeState; using RobocraftX.FrontEnd; using Unity.Mathematics; +using UnityEngine; using GamecraftModdingAPI.Commands; using GamecraftModdingAPI.Events; using GamecraftModdingAPI.Utility; using GamecraftModdingAPI.Blocks; using GamecraftModdingAPI.Players; +using EventType = GamecraftModdingAPI.Events.EventType; namespace GamecraftModdingAPI.Tests { @@ -269,6 +274,20 @@ namespace GamecraftModdingAPI.Tests Logging.CommandLog("Health set to: " + val); }).Build(); + CommandBuilder.Builder("placeBlockGroup", "Places some blocks in a group") + .Action((float x, float y, float z) => + { + var pos = new float3(x, y, z); + var group = BlockGroup.Create(Block.PlaceNew(BlockIDs.AluminiumCube, pos, + color: BlockColors.Aqua)); + Block.PlaceNew(BlockIDs.AluminiumCube, pos += new float3(1, 0, 0), color: BlockColors.Blue) + .BlockGroup = group; + Block.PlaceNew(BlockIDs.AluminiumCube, pos += new float3(1, 0, 0), color: BlockColors.Green) + .BlockGroup = group; + Block.PlaceNew(BlockIDs.AluminiumCube, pos += new float3(1, 0, 0), color: BlockColors.Lime) + .BlockGroup = group; + }).Build(); + GameClient.SetDebugInfo("InstalledMods", InstalledMods); Block.Placed += (sender, args) => Logging.MetaDebugLog("Placed block " + args.Type + " with ID " + args.ID); @@ -391,6 +410,88 @@ namespace GamecraftModdingAPI.Tests return ((Action) MinimumSpecsCheck.CheckRequirementsMet).Method; } } + + [HarmonyPatch] + public class BugHuntPatch + { + public static MethodInfo method = + SymbolExtensions.GetMethodInfo(str => Console.WriteLine(str)); + + public static IEnumerable Transpiler(IEnumerable instructions) + { + int i = 0; + foreach (var instruction in instructions) + { + i++; + yield return instruction; //Return the instruction first + //stloc, dup, callvirt + if (instruction.opcode.Name.ToLower().StartsWith("stloc") + || instruction.opcode == OpCodes.Dup + || instruction.opcode == OpCodes.Callvirt) + { + yield return new CodeInstruction(OpCodes.Ldstr, + "Just ran the " + i + ". instruction ending with " + instruction.opcode.Name); + yield return new CodeInstruction(OpCodes.Call, method); + } + } + } + + public static MethodInfo TargetMethod() + { + return AccessTools.Method("RobocraftX.CR.MachineEditing.BoxSelect.CopySelectionEngine:GenerateThumbnail"); + } + } + + [HarmonyPatch] + public class BugHuntPatch2 + { + public static void Prefix(int width, float fieldOfView, Vector3 cameraDirection, Vector3 lightDirection) + { + Console.WriteLine("TakeThumbnail invoked with parameters: " + width + ", " + fieldOfView + ", " + + cameraDirection + ", " + lightDirection); + + GPUInstancerManager manager = GPUInstancerAPI.GetActiveManagers().Find(m => m is GPUInstancerPrefabManager); + Bounds instancesBounds = manager.ComputeInstancesBounds(2); + Console.WriteLine("Bounds: " + instancesBounds); + Console.WriteLine("Size: " + instancesBounds.size); + Console.WriteLine("Size.x < 0: " + (instancesBounds.size.x < 0)); + } + + public static void Postfix(Texture2D __result) + { + Console.WriteLine("TakeThumbnail returned: " + (__result == null ? null : __result.name)); + } + + private delegate Texture2D TakeThumbnailDel(int width, float fieldOfView, Vector3 cameraDirection, + Vector3 lightDirection); + + public static MethodInfo TargetMethod() + { + return ((TakeThumbnailDel) ThumbnailUtility.TakeThumbnail).Method; + } + } + + [HarmonyPatch] + public class BugHuntPatch3 + { + public static void Prefix(int width, int filterLayerMask, GPUInstancerManager manager, + Vector3 cameraPosition, Quaternion cameraRotation, float cameraFov, Vector3 lightDirection, + int cullingLayer) + { + Console.WriteLine("Inner TakeThumbnail invoked with parameters: " + width + ", " + filterLayerMask + + ", " + (manager != null ? manager.name : null) + ", " + cameraPosition + ", " + + cameraRotation + ", " + cameraFov + ", " + lightDirection + ", " + cullingLayer); + } + + private delegate Texture2D TakeThumbnailDel(int width, int filterLayerMask, GPUInstancerManager manager, + Vector3 cameraPosition, Quaternion cameraRotation, float cameraFov, Vector3 lightDirection, + int cullingLayer); + + public static MethodInfo TargetMethod() + { + return ((TakeThumbnailDel) ThumbnailUtility.TakeThumbnail).Method; + } + } } #endif } -- 2.30.2 From 64b42830a3aec0fa7f419ba1d6e4c8805e3ea563 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Fri, 13 Nov 2020 21:35:53 +0100 Subject: [PATCH 132/252] Blueprint fixes, bump version, add block copy support Fixed getting the selected blueprint Fixed block groups not being assigned to first block --- GamecraftModdingAPI/Block.cs | 26 + GamecraftModdingAPI/BlockGroup.cs | 4 +- .../Blocks/BlockCloneEngine.cs | 78 + GamecraftModdingAPI/Blocks/BlockEngine.cs | 2 +- GamecraftModdingAPI/Blocks/BlueprintEngine.cs | 13 +- .../GamecraftModdingAPI.csproj | 1384 +++++++++-------- GamecraftModdingAPI/Player.cs | 4 +- doxygen.conf | 2 +- 8 files changed, 857 insertions(+), 656 deletions(-) create mode 100644 GamecraftModdingAPI/Blocks/BlockCloneEngine.cs diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index 33a1623..59914fd 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -29,6 +29,7 @@ namespace GamecraftModdingAPI protected static readonly SignalEngine SignalEngine = new SignalEngine(); protected static readonly BlockEventsEngine BlockEventsEngine = new BlockEventsEngine(); protected static readonly ScalingEngine ScalingEngine = new ScalingEngine(); + protected static readonly BlockCloneEngine BlockCloneEngine = new BlockCloneEngine(); protected internal static readonly BlockEngine BlockEngine = new BlockEngine(); @@ -229,6 +230,7 @@ namespace GamecraftModdingAPI public EGID Id { get; } internal BlockEngine.BlockInitData InitData; + private EGID copiedFrom; /// /// The block's current position or zero if the block no longer exists. @@ -415,11 +417,34 @@ namespace GamecraftModdingAPI : null); } + /// + /// Creates a copy of the block in the game with the same basic properties and tweakable stats. + /// + /// + public T Copy() where T : Block + { + var block = PlaceNew(Type, Position, Rotation, Color.Color, Color.Darkness, UniformScale, Scale); + block.copiedFrom = Id; + if (Type == BlockIDs.ConsoleBlock + && (this is ConsoleBlock srcCB || (srcCB = Specialise()) != null) + && (block is ConsoleBlock dstCB || (dstCB = block.Specialise()) != null)) + { + //Console block properties are set by a separate engine in the game + dstCB.Arg1 = srcCB.Arg1; + dstCB.Arg2 = srcCB.Arg2; + dstCB.Arg3 = srcCB.Arg3; + dstCB.Command = srcCB.Command; + } + return block; + } + private void OnPlacedInit(object sender, BlockPlacedRemovedEventArgs e) { //Member method instead of lambda to avoid constantly creating delegates if (e.ID != Id) return; Placed -= OnPlacedInit; //And we can reference it InitData = default; //Remove initializer as it's no longer valid - if the block gets removed it shouldn't be used again + if (copiedFrom != EGID.Empty) + BlockCloneEngine.CopyBlockStats(copiedFrom, Id); } public override string ToString() @@ -462,6 +487,7 @@ namespace GamecraftModdingAPI GameEngineManager.AddGameEngine(BlockEventsEngine); GameEngineManager.AddGameEngine(ScalingEngine); GameEngineManager.AddGameEngine(SignalEngine); + GameEngineManager.AddGameEngine(BlockCloneEngine); Wire.signalEngine = SignalEngine; // requires same functionality, no need to duplicate the engine } diff --git a/GamecraftModdingAPI/BlockGroup.cs b/GamecraftModdingAPI/BlockGroup.cs index d660236..a82e776 100644 --- a/GamecraftModdingAPI/BlockGroup.cs +++ b/GamecraftModdingAPI/BlockGroup.cs @@ -99,7 +99,9 @@ namespace GamecraftModdingAPI /// A new block group containing the given block public static BlockGroup Create(Block block) { - return new BlockGroup(_engine.CreateBlockGroup(default, default), block); + var bg = new BlockGroup(_engine.CreateBlockGroup(default, default), block); + block.BlockGroup = bg; + return bg; } /// diff --git a/GamecraftModdingAPI/Blocks/BlockCloneEngine.cs b/GamecraftModdingAPI/Blocks/BlockCloneEngine.cs new file mode 100644 index 0000000..d4d16f1 --- /dev/null +++ b/GamecraftModdingAPI/Blocks/BlockCloneEngine.cs @@ -0,0 +1,78 @@ +using System; +using System.Reflection; +using GamecraftModdingAPI.Engines; +using HarmonyLib; +using RobocraftX.Blocks; +using RobocraftX.Character; +using RobocraftX.Common; +using RobocraftX.Common.Players; +using Svelto.DataStructures; +using Svelto.ECS; + +namespace GamecraftModdingAPI.Blocks +{ + public class BlockCloneEngine : IApiEngine + { + private static Type copyEngineType = + AccessTools.TypeByName("Gamecraft.GUI.Tweaks.Engines.CopyTweaksOnPickEngine"); + + private MethodBase copyFromBlock = AccessTools.Method(copyEngineType, "CopyTweaksFromBlock"); + private MethodBase copyToBlock = AccessTools.Method(copyEngineType, "ApplyTweaksToPlacedBlock"); + + public void Ready() + { + } + + public EntitiesDB entitiesDB { get; set; } + + public void Dispose() + { + } + + public void CopyBlockStats(EGID sourceID, EGID targetID) + { + var allCharacters = (LocalFasterReadOnlyList) CharacterExclusiveGroups.AllCharacters; + foreach (var ((pickedBlockColl, count), _) in entitiesDB.QueryEntities(allCharacters)) + { + for (int i = 0; i < count; ++i) + { + ref PickedBlockExtraDataStruct pickedBlock = ref pickedBlockColl[i]; + var oldStruct = pickedBlock; + pickedBlock.pickedBlockEntityID = sourceID; + pickedBlock.placedBlockEntityID = targetID; + pickedBlock.placedBlockTweaksCopied = false; + pickedBlock.placedBlockTweaksMustCopy = true; + if (entitiesDB.Exists(pickedBlock.pickedBlockEntityID) + && entitiesDB.Exists(pickedBlock.placedBlockEntityID)) + { + copyFromBlock.Invoke(Patch.instance, new object[] {pickedBlock.ID, pickedBlock}); + copyToBlock.Invoke(Patch.instance, new object[] {pickedBlock.ID, pickedBlock}); + pickedBlock.placedBlockTweaksMustCopy = false; + pickedBlock.placedBlockTweaksCopied = false; + } + + pickedBlock = oldStruct; //Make sure to not interfere with the game + } + } + } + + [HarmonyPatch] + private static class Patch + { + public static object instance; + + public static void Postfix(object __instance) + { + instance = __instance; + } + + public static MethodBase TargetMethod() + { + return AccessTools.GetDeclaredConstructors(copyEngineType)[0]; + } + } + + public string Name { get; } = "GamecraftModdingAPIBlockCloneGameEngine"; + public bool isRemovable { get; } = false; + } +} \ No newline at end of file diff --git a/GamecraftModdingAPI/Blocks/BlockEngine.cs b/GamecraftModdingAPI/Blocks/BlockEngine.cs index 9ce6d62..351d686 100644 --- a/GamecraftModdingAPI/Blocks/BlockEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlockEngine.cs @@ -8,7 +8,7 @@ using Gamecraft.Wires; using RobocraftX.Blocks; using RobocraftX.Common; using RobocraftX.Physics; -using RobocraftX.Scene.Simulation; + using Svelto.DataStructures; using Svelto.ECS; using Svelto.ECS.Hybrid; diff --git a/GamecraftModdingAPI/Blocks/BlueprintEngine.cs b/GamecraftModdingAPI/Blocks/BlueprintEngine.cs index e46ad50..1936a17 100644 --- a/GamecraftModdingAPI/Blocks/BlueprintEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlueprintEngine.cs @@ -95,12 +95,7 @@ namespace GamecraftModdingAPI.Blocks if (resourceID == uint.MaxValue) BlueprintUtil.UnselectBlueprint(entitiesDB); else - { - BlueprintUtil.SelectBlueprint(entitiesDB, new BlueprintInventoryItemEntityStruct - { - blueprintResourceId = resourceID, - }); - } + BlueprintUtil.SelectBlueprint(entitiesDB, resourceID, false, -1); } public uint CreateBlueprint() @@ -122,7 +117,7 @@ namespace GamecraftModdingAPI.Blocks } var serializationData = clipboardManager.GetSerializationData(blueprintID); - SelectionSerializationUtility.ClearClipboard(playerID, entitiesDB, entityFunctions, serializationData.blueprintData); + SelectionSerializationUtility.ClearClipboard(playerID, entitiesDB, entityFunctions, serializationData.blueprintData, -1); if (selected.Count == 0) return; //ref BlockGroupTransformEntityComponent groupTransform = ref EntityNativeDBExtensions.QueryEntity(entitiesDb, (uint) local1.currentBlockGroup, BlockGroupExclusiveGroups.BlockGroupEntityGroup); @@ -134,7 +129,7 @@ namespace GamecraftModdingAPI.Blocks clipboardManager.SetGhostSerialized(blueprintID, false); SelectionSerializationUtility.CopySelectionToClipboard(playerID, entitiesDB, serializationData.blueprintData, entitySerialization, entityFactory, blockIDs, - (uint) blockIDs.Length, pos, rot); + (uint) blockIDs.Length, pos, rot, -1); } public Block[] PlaceBlueprintBlocks(uint blueprintID, uint playerID, float3 pos, float3 rot) @@ -173,7 +168,7 @@ namespace GamecraftModdingAPI.Blocks new object[] { playerID, grid, poss, rots, selectionPosition, selectionRotation, blueprintData, - entitiesDB, entitySerialization, nextFilterId1 + entitySerialization, nextFilterId1 }); /* uint playerId, in GridRotationStruct ghostParentGrid, diff --git a/GamecraftModdingAPI/GamecraftModdingAPI.csproj b/GamecraftModdingAPI/GamecraftModdingAPI.csproj index 88d16f8..88002d0 100644 --- a/GamecraftModdingAPI/GamecraftModdingAPI.csproj +++ b/GamecraftModdingAPI/GamecraftModdingAPI.csproj @@ -2,7 +2,7 @@ net472 true - 1.7.0 + 1.8.0 Exmods GNU General Public Licence 3+ https://git.exmods.org/modtainers/GamecraftModdingAPI @@ -17,7 +17,7 @@ DEBUG;TEST;TRACE - + @@ -26,6 +26,310 @@ + + ..\ref\Gamecraft_Data\Managed\Accessibility.dll + ..\..\ref\Gamecraft_Data\Managed\Accessibility.dll + + + ..\ref\Gamecraft_Data\Managed\Analytics.dll + ..\..\ref\Gamecraft_Data\Managed\Analytics.dll + + + ..\ref\Gamecraft_Data\Managed\Assembly-CSharp-firstpass.dll + ..\..\ref\Gamecraft_Data\Managed\Assembly-CSharp-firstpass.dll + + + ..\ref\Gamecraft_Data\Managed\Assembly-CSharp.dll + ..\..\ref\Gamecraft_Data\Managed\Assembly-CSharp.dll + + + ..\ref\Gamecraft_Data\Managed\Authentication.dll + ..\..\ref\Gamecraft_Data\Managed\Authentication.dll + + + ..\ref\Gamecraft_Data\Managed\Blocks.HUDFeedbackBlocks.dll + ..\..\ref\Gamecraft_Data\Managed\Blocks.HUDFeedbackBlocks.dll + + + ..\ref\Gamecraft_Data\Managed\CommandLine.dll + ..\..\ref\Gamecraft_Data\Managed\CommandLine.dll + + + ..\ref\Gamecraft_Data\Managed\CommandLineCompositionRoot.dll + ..\..\ref\Gamecraft_Data\Managed\CommandLineCompositionRoot.dll + + + ..\ref\Gamecraft_Data\Managed\ConsoleBlockComposotionRoot.dll + ..\..\ref\Gamecraft_Data\Managed\ConsoleBlockComposotionRoot.dll + + + ..\ref\Gamecraft_Data\Managed\ConsoleCommand.dll + ..\..\ref\Gamecraft_Data\Managed\ConsoleCommand.dll + + + ..\ref\Gamecraft_Data\Managed\DataLoader.dll + ..\..\ref\Gamecraft_Data\Managed\DataLoader.dll + + + ..\ref\Gamecraft_Data\Managed\DDNA.dll + ..\..\ref\Gamecraft_Data\Managed\DDNA.dll + + + ..\ref\Gamecraft_Data\Managed\Facepunch.Steamworks.Win64.dll + ..\..\ref\Gamecraft_Data\Managed\Facepunch.Steamworks.Win64.dll + + + ..\ref\Gamecraft_Data\Managed\FMOD.dll + ..\..\ref\Gamecraft_Data\Managed\FMOD.dll + + + ..\ref\Gamecraft_Data\Managed\FullGame.dll + ..\..\ref\Gamecraft_Data\Managed\FullGame.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.AudioBlocks.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.AudioBlocks.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.BlockEntityFactory.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.BlockEntityFactory.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.BlockGroups.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.BlockGroups.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.ConsoleBlock.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.ConsoleBlock.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.DamagingSurfaceBlock.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.DamagingSurfaceBlock.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.DestructionBlocks.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.DestructionBlocks.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.GenericPhysicsBlocks.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.GenericPhysicsBlocks.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.LightBlock.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.LightBlock.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.LogicBlock.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.LogicBlock.dll + + + ..\ref\Gamecraft_Data\Managed\GameCraft.Blocks.ProjectileBlock.dll + ..\..\ref\Gamecraft_Data\Managed\GameCraft.Blocks.ProjectileBlock.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.TextBlock.CompositionRoot.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.TextBlock.CompositionRoot.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.TimerBlock.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.TimerBlock.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.CharacterVulnerability.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.CharacterVulnerability.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.CharacterVulnerabilityGui.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.CharacterVulnerabilityGui.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.ColourPalette.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.ColourPalette.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.Damage.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Damage.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.Effects.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Effects.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.ExplosionFragments.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.ExplosionFragments.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.GraphicsSettings.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GraphicsSettings.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.BlueprintInventory.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.BlueprintInventory.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.BlueprintInventoryMock.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.BlueprintInventoryMock.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Blueprints.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Blueprints.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.BlueprintSets.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.BlueprintSets.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.ConsoleBlock.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.ConsoleBlock.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.GameOptionsScreen.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.GameOptionsScreen.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Hotbar.Blocks.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Hotbar.Blocks.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Hotbar.Colours.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Hotbar.Colours.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.HUDFeedbackBlocks.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.HUDFeedbackBlocks.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.ModeBar.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.ModeBar.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.OptionsScreen.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.OptionsScreen.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.TabsBar.Blocks.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.TabsBar.Blocks.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.TabsBar.Blueprints.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.TabsBar.Blueprints.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.TabsBar.Colours.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.TabsBar.Colours.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.TabsBar.Common.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.TabsBar.Common.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.TimeModeClock.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.TimeModeClock.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Tweaks.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Tweaks.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Wires.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Wires.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Wires.Mockup.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Wires.Mockup.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.GUIs.Hotbar.BlueprintsHotbar.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUIs.Hotbar.BlueprintsHotbar.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.InventoryTimeRunning.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.InventoryTimeRunning.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.JointBlocks.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.JointBlocks.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.Music.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Music.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.PerformanceWarnings.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.PerformanceWarnings.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.PickupBlck.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.PickupBlck.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.PickupsCommon.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.PickupsCommon.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.PopupMessage.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.PopupMessage.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.Projectiles.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Projectiles.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.Tweaks.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Tweaks.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.Tweaks.Mockup.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Tweaks.Mockup.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.VisualEffects.Decals.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.VisualEffects.Decals.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.VisualEffects.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.VisualEffects.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.Wires.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Wires.dll + + + ..\ref\Gamecraft_Data\Managed\Gamecraft.Wires.Mockup.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Wires.Mockup.dll + + + ..\ref\Gamecraft_Data\Managed\GameState.dll + ..\..\ref\Gamecraft_Data\Managed\GameState.dll + + + ..\ref\Gamecraft_Data\Managed\GhostShark.Outline.dll + ..\..\ref\Gamecraft_Data\Managed\GhostShark.Outline.dll + + + ..\ref\Gamecraft_Data\Managed\GPUInstancer.dll + ..\..\ref\Gamecraft_Data\Managed\GPUInstancer.dll + + + ..\ref\Gamecraft_Data\Managed\Havok.Physics.dll + ..\..\ref\Gamecraft_Data\Managed\Havok.Physics.dll + + + ..\ref\Gamecraft_Data\Managed\Havok.Physics.Hybrid.dll + ..\..\ref\Gamecraft_Data\Managed\Havok.Physics.Hybrid.dll + ..\ref\Gamecraft_Data\Managed\IllusionInjector.dll ..\..\ref\Gamecraft_Data\Managed\IllusionInjector.dll @@ -34,22 +338,26 @@ ..\ref\Gamecraft_Data\Managed\IllusionPlugin.dll ..\..\ref\Gamecraft_Data\Managed\IllusionPlugin.dll - - ..\ref\Gamecraft_Data\Managed\Accessibility.dll - ..\..\ref\Gamecraft_Data\Managed\Accessibility.dll - - - ..\ref\Gamecraft_Data\Managed\Facepunch.Steamworks.Win64.dll - ..\..\ref\Gamecraft_Data\Managed\Facepunch.Steamworks.Win64.dll - ..\ref\Gamecraft_Data\Managed\JWT.dll ..\..\ref\Gamecraft_Data\Managed\JWT.dll + + ..\ref\Gamecraft_Data\Managed\LZ4.dll + ..\..\ref\Gamecraft_Data\Managed\LZ4.dll + ..\ref\Gamecraft_Data\Managed\mscorlib.dll ..\..\ref\Gamecraft_Data\Managed\mscorlib.dll + + ..\ref\Gamecraft_Data\Managed\MultiplayerNetworking.dll + ..\..\ref\Gamecraft_Data\Managed\MultiplayerNetworking.dll + + + ..\ref\Gamecraft_Data\Managed\MultiplayerTest.dll + ..\..\ref\Gamecraft_Data\Managed\MultiplayerTest.dll + ..\ref\Gamecraft_Data\Managed\netstandard.dll ..\..\ref\Gamecraft_Data\Managed\netstandard.dll @@ -62,6 +370,10 @@ ..\ref\Gamecraft_Data\Managed\Novell.Directory.Ldap.dll ..\..\ref\Gamecraft_Data\Managed\Novell.Directory.Ldap.dll + + ..\ref\Gamecraft_Data\Managed\RCX.ScreenshotTaker.dll + ..\..\ref\Gamecraft_Data\Managed\RCX.ScreenshotTaker.dll + ..\ref\Gamecraft_Data\Managed\Rewired_Core.dll ..\..\ref\Gamecraft_Data\Managed\Rewired_Core.dll @@ -70,10 +382,418 @@ ..\ref\Gamecraft_Data\Managed\Rewired_Windows.dll ..\..\ref\Gamecraft_Data\Managed\Rewired_Windows.dll + + ..\ref\Gamecraft_Data\Managed\RobocraftECS.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftECS.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.AccountPreferences.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.AccountPreferences.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.Blocks.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Blocks.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.Blocks.Ghost.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Blocks.Ghost.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.Blocks.Triggers.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Blocks.Triggers.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.Building.BoxSelect.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Building.BoxSelect.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.Building.Jobs.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Building.Jobs.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.Character.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Character.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.ClusterToWireConversion.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.ClusterToWireConversion.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.Common.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Common.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.ControlsScreen.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.ControlsScreen.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.Crosshair.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Crosshair.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.FrontEnd.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.FrontEnd.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.BlockLabel.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.BlockLabel.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.DebugDisplay.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.DebugDisplay.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.Hotbar.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.Hotbar.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.Inventory.BlocksInventory.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.Inventory.BlocksInventory.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.Inventory.ColourInventory.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.Inventory.ColourInventory.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.Inventory.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.Inventory.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.RemoveBlock.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.RemoveBlock.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.ScaleGhost.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.ScaleGhost.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.TabsBar.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.TabsBar.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.GUIs.WorkshopPrefabs.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUIs.WorkshopPrefabs.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.Input.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Input.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.MachineEditor.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.MachineEditor.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.MainGame.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.MainGame.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.MainSimulation.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.MainSimulation.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.MockCharacter.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.MockCharacter.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.Multiplayer.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Multiplayer.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.Multiplayer.GUI.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Multiplayer.GUI.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.MultiplayerInput.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.MultiplayerInput.dll + + + ..\ref\Gamecraft_Data\Managed\Robocraftx.ObjectIdBlocks.dll + ..\..\ref\Gamecraft_Data\Managed\Robocraftx.ObjectIdBlocks.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.Party.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Party.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.PartyGui.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.PartyGui.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.Physics.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Physics.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.PilotSeat.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.PilotSeat.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.Player.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Player.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.Rendering.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Rendering.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.Rendering.Mock.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Rendering.Mock.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.SaveAndLoad.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.SaveAndLoad.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.SaveGameDialog.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.SaveGameDialog.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.Serializers.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Serializers.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.Services.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Services.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.SignalHandling.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.SignalHandling.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX.StateSync.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.StateSync.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX_SpawnPoints.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX_SpawnPoints.dll + + + ..\ref\Gamecraft_Data\Managed\RobocraftX_TextBlock.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX_TextBlock.dll + + + ..\ref\Gamecraft_Data\Managed\RobocratX.SimulationMockCompositionRoot.dll + ..\..\ref\Gamecraft_Data\Managed\RobocratX.SimulationMockCompositionRoot.dll + + + ..\ref\Gamecraft_Data\Managed\SpawningPointCompositionRoot.dll + ..\..\ref\Gamecraft_Data\Managed\SpawningPointCompositionRoot.dll + + + ..\ref\Gamecraft_Data\Managed\SpecializedDescriptors.dll + ..\..\ref\Gamecraft_Data\Managed\SpecializedDescriptors.dll + + + ..\ref\Gamecraft_Data\Managed\StringFormatter.dll + ..\..\ref\Gamecraft_Data\Managed\StringFormatter.dll + + + ..\ref\Gamecraft_Data\Managed\Svelto.Common.dll + ..\..\ref\Gamecraft_Data\Managed\Svelto.Common.dll + + + ..\ref\Gamecraft_Data\Managed\Svelto.ECS.dll + ..\..\ref\Gamecraft_Data\Managed\Svelto.ECS.dll + + + ..\ref\Gamecraft_Data\Managed\Svelto.Services.dll + ..\..\ref\Gamecraft_Data\Managed\Svelto.Services.dll + + + ..\ref\Gamecraft_Data\Managed\Svelto.Tasks.dll + ..\..\ref\Gamecraft_Data\Managed\Svelto.Tasks.dll + + + ..\ref\Gamecraft_Data\Managed\UltimateDecals.dll + ..\..\ref\Gamecraft_Data\Managed\UltimateDecals.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Addressables.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Addressables.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Animation.Curves.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Animation.Curves.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Animation.Curves.Hybrid.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Animation.Curves.Hybrid.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Animation.DefaultGraphPipeline.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Animation.DefaultGraphPipeline.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Animation.DefaultGraphPipeline.Hybrid.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Animation.DefaultGraphPipeline.Hybrid.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Animation.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Animation.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Animation.Graph.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Animation.Graph.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Animation.Hybrid.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Animation.Hybrid.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Build.SlimPlayerRuntime.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Build.SlimPlayerRuntime.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Burst.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Burst.dll + ..\ref\Gamecraft_Data\Managed\Unity.Burst.Unsafe.dll ..\..\ref\Gamecraft_Data\Managed\Unity.Burst.Unsafe.dll + + ..\ref\Gamecraft_Data\Managed\Unity.Collections.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Collections.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Collections.LowLevel.ILSupport.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Collections.LowLevel.ILSupport.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.DataFlowGraph.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.DataFlowGraph.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Deformations.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Deformations.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Entities.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Entities.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Entities.Hybrid.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Entities.Hybrid.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.InternalAPIEngineBridge.002.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.InternalAPIEngineBridge.002.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Jobs.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Jobs.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Mathematics.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Mathematics.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Mathematics.Extensions.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Mathematics.Extensions.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.MemoryProfiler.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.MemoryProfiler.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Physics.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Physics.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Physics.Hybrid.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Physics.Hybrid.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Platforms.Common.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Platforms.Common.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Postprocessing.Runtime.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Postprocessing.Runtime.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Properties.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Properties.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Properties.Reflection.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Properties.Reflection.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Properties.UI.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Properties.UI.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.RenderPipeline.Universal.ShaderLibrary.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipeline.Universal.ShaderLibrary.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Universal.Runtime.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Universal.Runtime.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Universal.Shaders.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Universal.Shaders.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.ResourceManager.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.ResourceManager.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Scenes.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Scenes.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.ScriptableBuildPipeline.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.ScriptableBuildPipeline.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Serialization.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Serialization.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.TextMeshPro.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.TextMeshPro.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Timeline.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Timeline.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Transforms.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Transforms.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Transforms.Hybrid.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Transforms.Hybrid.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.VisualEffectGraph.Runtime.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.VisualEffectGraph.Runtime.dll + ..\ref\Gamecraft_Data\Managed\UnityEngine.AccessibilityModule.dll ..\..\ref\Gamecraft_Data\Managed\UnityEngine.AccessibilityModule.dll @@ -242,10 +962,18 @@ ..\ref\Gamecraft_Data\Managed\UnityEngine.TLSModule.dll ..\..\ref\Gamecraft_Data\Managed\UnityEngine.TLSModule.dll + + ..\ref\Gamecraft_Data\Managed\UnityEngine.UI.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UI.dll + ..\ref\Gamecraft_Data\Managed\UnityEngine.UIElementsModule.dll ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UIElementsModule.dll + + ..\ref\Gamecraft_Data\Managed\UnityEngine.UIElementsNativeModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UIElementsNativeModule.dll + ..\ref\Gamecraft_Data\Managed\UnityEngine.UIModule.dll ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UIModule.dll @@ -302,6 +1030,10 @@ ..\ref\Gamecraft_Data\Managed\UnityEngine.VideoModule.dll ..\..\ref\Gamecraft_Data\Managed\UnityEngine.VideoModule.dll + + ..\ref\Gamecraft_Data\Managed\UnityEngine.VirtualTexturingModule.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.VirtualTexturingModule.dll + ..\ref\Gamecraft_Data\Managed\UnityEngine.VRModule.dll ..\..\ref\Gamecraft_Data\Managed\UnityEngine.VRModule.dll @@ -314,638 +1046,6 @@ ..\ref\Gamecraft_Data\Managed\UnityEngine.XRModule.dll ..\..\ref\Gamecraft_Data\Managed\UnityEngine.XRModule.dll - - ..\ref\Gamecraft_Data\Managed\Analytics.dll - ..\..\ref\Gamecraft_Data\Managed\Analytics.dll - - - ..\ref\Gamecraft_Data\Managed\Assembly-CSharp-firstpass.dll - ..\..\ref\Gamecraft_Data\Managed\Assembly-CSharp-firstpass.dll - - - ..\ref\Gamecraft_Data\Managed\Assembly-CSharp.dll - ..\..\ref\Gamecraft_Data\Managed\Assembly-CSharp.dll - - - ..\ref\Gamecraft_Data\Managed\Authentication.dll - ..\..\ref\Gamecraft_Data\Managed\Authentication.dll - - - ..\ref\Gamecraft_Data\Managed\Blocks.HUDFeedbackBlocks.dll - ..\..\ref\Gamecraft_Data\Managed\Blocks.HUDFeedbackBlocks.dll - - - ..\ref\Gamecraft_Data\Managed\CommandLine.dll - ..\..\ref\Gamecraft_Data\Managed\CommandLine.dll - - - ..\ref\Gamecraft_Data\Managed\CommandLineCompositionRoot.dll - ..\..\ref\Gamecraft_Data\Managed\CommandLineCompositionRoot.dll - - - ..\ref\Gamecraft_Data\Managed\ConsoleBlockComposotionRoot.dll - ..\..\ref\Gamecraft_Data\Managed\ConsoleBlockComposotionRoot.dll - - - ..\ref\Gamecraft_Data\Managed\ConsoleCommand.dll - ..\..\ref\Gamecraft_Data\Managed\ConsoleCommand.dll - - - ..\ref\Gamecraft_Data\Managed\DataLoader.dll - ..\..\ref\Gamecraft_Data\Managed\DataLoader.dll - - - ..\ref\Gamecraft_Data\Managed\DDNA.dll - ..\..\ref\Gamecraft_Data\Managed\DDNA.dll - - - ..\ref\Gamecraft_Data\Managed\FMOD.dll - ..\..\ref\Gamecraft_Data\Managed\FMOD.dll - - - ..\ref\Gamecraft_Data\Managed\FullGame.dll - ..\..\ref\Gamecraft_Data\Managed\FullGame.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.AudioBlocks.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.AudioBlocks.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.BlockCompositionRoot.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.BlockCompositionRoot.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.BlockEntityFactory.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.BlockEntityFactory.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.ConsoleBlock.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.ConsoleBlock.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.DamagingSurfaceBlock.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.DamagingSurfaceBlock.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.DestructionBlocks.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.DestructionBlocks.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.GenericPhysicsBlocks.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.GenericPhysicsBlocks.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.LightBlock.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.LightBlock.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.LogicBlock.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.LogicBlock.dll - - - ..\ref\Gamecraft_Data\Managed\GameCraft.Blocks.ProjectileBlock.dll - ..\..\ref\Gamecraft_Data\Managed\GameCraft.Blocks.ProjectileBlock.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.TextBlock.CompositionRoot.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.TextBlock.CompositionRoot.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.TimerBlock.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.TimerBlock.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.CharacterVulnerability.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.CharacterVulnerability.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.CharacterVulnerabilityGui.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.CharacterVulnerabilityGui.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.Damage.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Damage.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.Effects.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Effects.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.ExplosionFragments.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.ExplosionFragments.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.GraphicsSettings.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GraphicsSettings.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.ConsoleBlock.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.ConsoleBlock.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.HUDFeedbackBlocks.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.HUDFeedbackBlocks.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Tweaks.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Tweaks.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Wires.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Wires.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Wires.Mockup.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Wires.Mockup.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.InventoryTimeRunning.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.InventoryTimeRunning.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.JointBlocks.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.JointBlocks.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.Music.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Music.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.PerformanceWarnings.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.PerformanceWarnings.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.PickupBlck.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.PickupBlck.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.PickupsCommon.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.PickupsCommon.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.PopupMessage.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.PopupMessage.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.Projectiles.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Projectiles.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.Tweaks.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Tweaks.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.Tweaks.Mockup.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Tweaks.Mockup.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.VisualEffects.Decals.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.VisualEffects.Decals.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.VisualEffects.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.VisualEffects.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.Wires.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Wires.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.Wires.Mockup.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Wires.Mockup.dll - - - ..\ref\Gamecraft_Data\Managed\GameState.dll - ..\..\ref\Gamecraft_Data\Managed\GameState.dll - - - ..\ref\Gamecraft_Data\Managed\GPUInstancer.dll - ..\..\ref\Gamecraft_Data\Managed\GPUInstancer.dll - - - ..\ref\Gamecraft_Data\Managed\Havok.Physics.dll - ..\..\ref\Gamecraft_Data\Managed\Havok.Physics.dll - - - ..\ref\Gamecraft_Data\Managed\Havok.Physics.Hybrid.dll - ..\..\ref\Gamecraft_Data\Managed\Havok.Physics.Hybrid.dll - - - ..\ref\Gamecraft_Data\Managed\IL3DN_FOG.dll - ..\..\ref\Gamecraft_Data\Managed\IL3DN_FOG.dll - - - ..\ref\Gamecraft_Data\Managed\LZ4.dll - ..\..\ref\Gamecraft_Data\Managed\LZ4.dll - - - ..\ref\Gamecraft_Data\Managed\MultiplayerNetworking.dll - ..\..\ref\Gamecraft_Data\Managed\MultiplayerNetworking.dll - - - ..\ref\Gamecraft_Data\Managed\MultiplayerTest.dll - ..\..\ref\Gamecraft_Data\Managed\MultiplayerTest.dll - - - ..\ref\Gamecraft_Data\Managed\RCX.ScreenshotTaker.dll - ..\..\ref\Gamecraft_Data\Managed\RCX.ScreenshotTaker.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftECS.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftECS.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.AccountPreferences.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.AccountPreferences.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Blocks.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Blocks.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Blocks.Ghost.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Blocks.Ghost.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Blocks.Triggers.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Blocks.Triggers.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Building.BoxSelect.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Building.BoxSelect.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Building.Jobs.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Building.Jobs.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Character.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Character.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.ClusterToWireConversion.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.ClusterToWireConversion.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Common.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Common.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.ControlsScreen.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.ControlsScreen.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Crosshair.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Crosshair.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.FrontEnd.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.FrontEnd.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.BlockLabel.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.BlockLabel.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.DebugDisplay.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.DebugDisplay.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.RemoveBlock.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.RemoveBlock.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.ScaleGhost.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.ScaleGhost.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.GUIs.WorkshopPrefabs.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUIs.WorkshopPrefabs.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Input.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Input.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.MachineEditor.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.MachineEditor.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.MainGame.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.MainGame.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.MainSimulation.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.MainSimulation.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.MockCharacter.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.MockCharacter.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Multiplayer.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Multiplayer.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Multiplayer.GUI.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Multiplayer.GUI.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.MultiplayerInput.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.MultiplayerInput.dll - - - ..\ref\Gamecraft_Data\Managed\Robocraftx.ObjectIdBlocks.dll - ..\..\ref\Gamecraft_Data\Managed\Robocraftx.ObjectIdBlocks.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Party.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Party.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.PartyGui.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.PartyGui.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Physics.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Physics.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.PilotSeat.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.PilotSeat.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Player.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Player.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Rendering.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Rendering.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Rendering.Mock.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Rendering.Mock.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.SaveAndLoad.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.SaveAndLoad.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.SaveGameDialog.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.SaveGameDialog.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Serializers.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Serializers.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Services.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Services.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.SignalHandling.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.SignalHandling.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.StateSync.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.StateSync.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX_SpawnPoints.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX_SpawnPoints.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX_TextBlock.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX_TextBlock.dll - - - ..\ref\Gamecraft_Data\Managed\RobocratX.SimulationMockCompositionRoot.dll - ..\..\ref\Gamecraft_Data\Managed\RobocratX.SimulationMockCompositionRoot.dll - - - ..\ref\Gamecraft_Data\Managed\SpawningPointCompositionRoot.dll - ..\..\ref\Gamecraft_Data\Managed\SpawningPointCompositionRoot.dll - - - ..\ref\Gamecraft_Data\Managed\SpecializedDescriptors.dll - ..\..\ref\Gamecraft_Data\Managed\SpecializedDescriptors.dll - - - ..\ref\Gamecraft_Data\Managed\StringFormatter.dll - ..\..\ref\Gamecraft_Data\Managed\StringFormatter.dll - - - ..\ref\Gamecraft_Data\Managed\Svelto.Common_3.dll - ..\..\ref\Gamecraft_Data\Managed\Svelto.Common_3.dll - - - ..\ref\Gamecraft_Data\Managed\Svelto.ECS.dll - ..\..\ref\Gamecraft_Data\Managed\Svelto.ECS.dll - - - ..\ref\Gamecraft_Data\Managed\Svelto.Services.dll - ..\..\ref\Gamecraft_Data\Managed\Svelto.Services.dll - - - ..\ref\Gamecraft_Data\Managed\Svelto.Tasks.dll - ..\..\ref\Gamecraft_Data\Managed\Svelto.Tasks.dll - - - ..\ref\Gamecraft_Data\Managed\UltimateDecals.dll - ..\..\ref\Gamecraft_Data\Managed\UltimateDecals.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Addressables.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Addressables.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Animation.Curves.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Animation.Curves.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Animation.Curves.Hybrid.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Animation.Curves.Hybrid.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Animation.DefaultGraphPipeline.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Animation.DefaultGraphPipeline.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Animation.DefaultGraphPipeline.Hybrid.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Animation.DefaultGraphPipeline.Hybrid.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Animation.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Animation.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Animation.Graph.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Animation.Graph.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Animation.Hybrid.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Animation.Hybrid.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Build.SlimPlayerRuntime.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Build.SlimPlayerRuntime.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Burst.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Burst.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Collections.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Collections.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.DataFlowGraph.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.DataFlowGraph.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Deformations.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Deformations.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Entities.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Entities.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Entities.Hybrid.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Entities.Hybrid.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Jobs.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Jobs.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Mathematics.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Mathematics.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Mathematics.Extensions.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Mathematics.Extensions.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.MemoryProfiler.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.MemoryProfiler.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Physics.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Physics.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Physics.Hybrid.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Physics.Hybrid.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Platforms.Common.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Platforms.Common.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Postprocessing.Runtime.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Postprocessing.Runtime.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Properties.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Properties.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Properties.Reflection.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Properties.Reflection.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Properties.UI.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Properties.UI.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.RenderPipeline.Universal.ShaderLibrary.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipeline.Universal.ShaderLibrary.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Universal.Runtime.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Universal.Runtime.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Universal.Shaders.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Universal.Shaders.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.ResourceManager.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.ResourceManager.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Scenes.Hybrid.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Scenes.Hybrid.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.ScriptableBuildPipeline.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.ScriptableBuildPipeline.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Serialization.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Serialization.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.TextMeshPro.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.TextMeshPro.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Timeline.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Timeline.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Transforms.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Transforms.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Transforms.Hybrid.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Transforms.Hybrid.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.VisualEffectGraph.Runtime.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.VisualEffectGraph.Runtime.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.UI.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UI.dll - ..\ref\Gamecraft_Data\Managed\uREPL.dll ..\..\ref\Gamecraft_Data\Managed\uREPL.dll diff --git a/GamecraftModdingAPI/Player.cs b/GamecraftModdingAPI/Player.cs index 14892a3..4778e02 100644 --- a/GamecraftModdingAPI/Player.cs +++ b/GamecraftModdingAPI/Player.cs @@ -348,8 +348,8 @@ namespace GamecraftModdingAPI /// public Blueprint SelectedBlueprint { - get => playerEngine.GetPlayerStruct(Id, out BlueprintInventoryItemEntityStruct biies) - ? new Blueprint(biies.blueprintResourceId) + get => playerEngine.GetPlayerStruct(Id, out LocalBlueprintInputStruct lbis) + ? new Blueprint(lbis.selectedBlueprintId) : null; set => BlockGroup._engine.SelectBlueprint(value?.Id ?? uint.MaxValue); } diff --git a/doxygen.conf b/doxygen.conf index bf447b4..4b1eaed 100644 --- a/doxygen.conf +++ b/doxygen.conf @@ -38,7 +38,7 @@ PROJECT_NAME = "GamecraftModdingAPI" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = "v1.5.0" +PROJECT_NUMBER = "v1.8.0" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a -- 2.30.2 From 680721256c101fc2ddeab01323ab89850e41fb72 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Fri, 13 Nov 2020 23:59:37 +0100 Subject: [PATCH 133/252] Add support for copying wires, some fixes and additions Removing blocks from groups when they are removed from the game Attempted to update graphics when changing blocks Disallowing changing the block group after creation, now that we can copy blocks --- GamecraftModdingAPI/Block.cs | 20 +++++++-- GamecraftModdingAPI/BlockGroup.cs | 28 ++++++++++-- .../Blocks/BlockCloneEngine.cs | 44 ++++++++++++++++--- GamecraftModdingAPI/Blocks/BlockEngine.cs | 11 +++++ GamecraftModdingAPI/Blocks/PlacementEngine.cs | 7 +++ 5 files changed, 97 insertions(+), 13 deletions(-) diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index 59914fd..0fecf40 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -244,6 +244,7 @@ namespace GamecraftModdingAPI MovementEngine.MoveBlock(Id, InitData, value); if (blockGroup != null) blockGroup.PosAndRotCalculated = false; + BlockEngine.UpdateDisplayedBlock(Id); } } @@ -258,6 +259,7 @@ namespace GamecraftModdingAPI RotationEngine.RotateBlock(Id, InitData, value); if (blockGroup != null) blockGroup.PosAndRotCalculated = false; + BlockEngine.UpdateDisplayedBlock(Id); } } @@ -273,6 +275,7 @@ namespace GamecraftModdingAPI BlockEngine.SetBlockInfo(this, (ref ScalingEntityStruct st, float3 val) => st.scale = val, value); if (!Exists) return; //UpdateCollision needs the block to exist ScalingEngine.UpdateCollision(Id); + BlockEngine.UpdateDisplayedBlock(Id); } } @@ -364,8 +367,10 @@ namespace GamecraftModdingAPI /// /// Returns the block group this block is a part of. Block groups can be placed using blueprints. /// Returns null if not part of a group.
- /// Setting the group after the block has been initialized will not update everything properly. - /// You should only set this property on blocks newly placed by your code. + /// Setting the group after the block has been initialized will not update everything properly, + /// so you can only set this property on blocks newly placed by your code.
+ /// To set it for existing blocks, you can use the Copy() method and set the property on the resulting block + /// (and remove this block). ///
public BlockGroup BlockGroup { @@ -378,6 +383,15 @@ namespace GamecraftModdingAPI } set { + if (Exists) + { + /*var copy = Copy(); + copy.BlockGroup = value; //It won't run this on the new instance as it won't 'exist' yet + Remove();*/ + Logging.LogWarning("Attempted to set group of existing block. This is not supported." + + " Copy the block and set the group of the resulting block."); + return; + } blockGroup?.RemoveInternal(this); BlockEngine.SetBlockInfo(this, (ref BlockGroupEntityComponent bgec, BlockGroup val) => bgec.currentBlockGroup = val?.Id ?? -1, @@ -418,7 +432,7 @@ namespace GamecraftModdingAPI } /// - /// Creates a copy of the block in the game with the same basic properties and tweakable stats. + /// Creates a copy of the block in the game with the same properties, stats and wires. /// /// public T Copy() where T : Block diff --git a/GamecraftModdingAPI/BlockGroup.cs b/GamecraftModdingAPI/BlockGroup.cs index a82e776..4a0d994 100644 --- a/GamecraftModdingAPI/BlockGroup.cs +++ b/GamecraftModdingAPI/BlockGroup.cs @@ -12,9 +12,9 @@ using GamecraftModdingAPI.Utility; namespace GamecraftModdingAPI { /// - /// A group of blocks that can be selected together. The placed version of blueprints. + /// A group of blocks that can be selected together. The placed version of blueprints. Dispose after usage. /// - public class BlockGroup : ICollection + public class BlockGroup : ICollection, IDisposable { internal static BlueprintEngine _engine = new BlueprintEngine(); public int Id { get; } @@ -30,8 +30,30 @@ namespace GamecraftModdingAPI Id = id; sourceBlock = block; blocks = new List(GetBlocks()); + Block.Removed += OnBlockRemoved; } - + + private void OnBlockRemoved(object sender, BlockPlacedRemovedEventArgs e) + { + //blocks.RemoveAll(block => block.Id == e.ID); - Allocation heavy + int index = -1; + for (int i = 0; i < blocks.Count; i++) + { + if (blocks[i].Id == e.ID) + { + index = i; + break; + } + } + + if (index != -1) blocks.RemoveAt(index); + } + + public void Dispose() + { + Block.Removed -= OnBlockRemoved; + } + /// /// The position of the block group (center). Recalculated if blocks have been added/removed since the last query. /// diff --git a/GamecraftModdingAPI/Blocks/BlockCloneEngine.cs b/GamecraftModdingAPI/Blocks/BlockCloneEngine.cs index d4d16f1..0acf44d 100644 --- a/GamecraftModdingAPI/Blocks/BlockCloneEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlockCloneEngine.cs @@ -1,5 +1,7 @@ using System; +using System.Collections.Generic; using System.Reflection; +using Gamecraft.Wires; using GamecraftModdingAPI.Engines; using HarmonyLib; using RobocraftX.Blocks; @@ -15,9 +17,15 @@ namespace GamecraftModdingAPI.Blocks { private static Type copyEngineType = AccessTools.TypeByName("Gamecraft.GUI.Tweaks.Engines.CopyTweaksOnPickEngine"); + private static Type copyWireEngineType = + AccessTools.TypeByName("Gamecraft.Wires.WireConnectionCopyOnPickEngine"); + private static Type createWireEngineType = + AccessTools.TypeByName("RobocraftX.GUI.Wires.WireConnectionCreateOnPlaceEngine"); private MethodBase copyFromBlock = AccessTools.Method(copyEngineType, "CopyTweaksFromBlock"); private MethodBase copyToBlock = AccessTools.Method(copyEngineType, "ApplyTweaksToPlacedBlock"); + private MethodBase copyWireFromBlock = AccessTools.Method(copyWireEngineType, "CopyWireInputsAndOutputs"); + private MethodBase copyWireToBlock = AccessTools.Method(createWireEngineType, "PlaceWiresOnPlaceNewCube"); public void Ready() { @@ -45,13 +53,23 @@ namespace GamecraftModdingAPI.Blocks if (entitiesDB.Exists(pickedBlock.pickedBlockEntityID) && entitiesDB.Exists(pickedBlock.placedBlockEntityID)) { - copyFromBlock.Invoke(Patch.instance, new object[] {pickedBlock.ID, pickedBlock}); - copyToBlock.Invoke(Patch.instance, new object[] {pickedBlock.ID, pickedBlock}); + copyFromBlock.Invoke(Patch.copyEngine, new object[] {pickedBlock.ID, pickedBlock}); + + uint playerID = Player.LocalPlayer.Id; + var parameters = new object[] {playerID, pickedBlock}; + copyWireFromBlock.Invoke(Patch.copyWireEngine, parameters); + pickedBlock = (PickedBlockExtraDataStruct) parameters[1]; //ref arg + + copyToBlock.Invoke(Patch.copyEngine, new object[] {pickedBlock.ID, pickedBlock}); + + ExclusiveGroupStruct group = WiresExclusiveGroups.WIRES_COPY_GROUP + playerID; + copyWireToBlock.Invoke(Patch.createWireEngine, new object[] {group, pickedBlock.ID}); + pickedBlock.placedBlockTweaksMustCopy = false; pickedBlock.placedBlockTweaksCopied = false; } - pickedBlock = oldStruct; //Make sure to not interfere with the game + pickedBlock = oldStruct; //Make sure to not interfere with the game - Although that might not be the case with the wire copying } } } @@ -59,16 +77,28 @@ namespace GamecraftModdingAPI.Blocks [HarmonyPatch] private static class Patch { - public static object instance; + public static object copyEngine; + public static object copyWireEngine; + public static object createWireEngine; public static void Postfix(object __instance) { - instance = __instance; + if (__instance.GetType() == copyEngineType) + copyEngine = __instance; + else if (__instance.GetType() == copyWireEngineType) + copyWireEngine = __instance; + else if (__instance.GetType() == createWireEngineType) + createWireEngine = __instance; } - public static MethodBase TargetMethod() + public static IEnumerable TargetMethods() { - return AccessTools.GetDeclaredConstructors(copyEngineType)[0]; + return new[] + { + AccessTools.GetDeclaredConstructors(copyEngineType)[0], + AccessTools.GetDeclaredConstructors(copyWireEngineType)[0], + AccessTools.GetDeclaredConstructors(createWireEngineType)[0] + }; } } diff --git a/GamecraftModdingAPI/Blocks/BlockEngine.cs b/GamecraftModdingAPI/Blocks/BlockEngine.cs index 351d686..2da04a3 100644 --- a/GamecraftModdingAPI/Blocks/BlockEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlockEngine.cs @@ -8,6 +8,8 @@ using Gamecraft.Wires; using RobocraftX.Blocks; using RobocraftX.Common; using RobocraftX.Physics; +using RobocraftX.Rendering; +using Svelto.ECS.EntityStructs; using Svelto.DataStructures; using Svelto.ECS; @@ -149,6 +151,15 @@ namespace GamecraftModdingAPI.Blocks } } + public void UpdateDisplayedBlock(EGID id) + { + if (!BlockExists(id)) return; + var pos = entitiesDB.QueryEntity(id); + var rot = entitiesDB.QueryEntity(id); + var scale = entitiesDB.QueryEntity(id); + entitiesDB.QueryEntity(id).matrix = float4x4.TRS(pos.position, rot.rotation, scale.scale); + } + public bool BlockExists(EGID blockID) { return entitiesDB.Exists(blockID); diff --git a/GamecraftModdingAPI/Blocks/PlacementEngine.cs b/GamecraftModdingAPI/Blocks/PlacementEngine.cs index 5357e7f..fab9c62 100644 --- a/GamecraftModdingAPI/Blocks/PlacementEngine.cs +++ b/GamecraftModdingAPI/Blocks/PlacementEngine.cs @@ -101,6 +101,13 @@ namespace GamecraftModdingAPI.Blocks loadedFromDisk = false, placedBy = playerId }); + + /*structInitializer.Init(new CollisionFilterOverride + { + belongsTo = 32U, + collidesWith = 239532U + });*/ + PrimaryRotationUtility.InitialisePrimaryDirection(rotation.rotation, ref structInitializer); EGID playerEGID = new EGID(playerId, CharacterExclusiveGroups.OnFootGroup); ref PickedBlockExtraDataStruct pickedBlock = ref entitiesDB.QueryEntity(playerEGID); -- 2.30.2 From f30dcd251fb291b21a44531d10e959f215e5bc12 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sat, 14 Nov 2020 02:52:16 +0100 Subject: [PATCH 134/252] Displaying blueprint before placing, enums, ToString()s Added support for getting the player's current building mode (build, color, config, blueprint) Added support for getting the current game's mode (building, playing, prefab etc.) --- GamecraftModdingAPI/App/CurrentGameMode.cs | 23 +++++++++ GamecraftModdingAPI/App/Game.cs | 12 +++++ GamecraftModdingAPI/BlockGroup.cs | 5 ++ GamecraftModdingAPI/Blocks/BlueprintEngine.cs | 47 +++++++++++++++++++ GamecraftModdingAPI/Blueprint.cs | 5 ++ GamecraftModdingAPI/Player.cs | 9 +++- .../Players/PlayerBuildingMode.cs | 10 ++++ 7 files changed, 109 insertions(+), 2 deletions(-) create mode 100644 GamecraftModdingAPI/App/CurrentGameMode.cs create mode 100644 GamecraftModdingAPI/Players/PlayerBuildingMode.cs diff --git a/GamecraftModdingAPI/App/CurrentGameMode.cs b/GamecraftModdingAPI/App/CurrentGameMode.cs new file mode 100644 index 0000000..84a6d78 --- /dev/null +++ b/GamecraftModdingAPI/App/CurrentGameMode.cs @@ -0,0 +1,23 @@ +namespace GamecraftModdingAPI.App +{ + public enum CurrentGameMode + { + None, + /// + /// Building a game + /// + Build, + /// + /// Playing a game + /// + Play, + /// + /// Viewing a prefab + /// + View, + /// + /// Viewing a tutorial + /// + Tutorial + } +} \ No newline at end of file diff --git a/GamecraftModdingAPI/App/Game.cs b/GamecraftModdingAPI/App/Game.cs index d6a4eff..3d73478 100644 --- a/GamecraftModdingAPI/App/Game.cs +++ b/GamecraftModdingAPI/App/Game.cs @@ -335,6 +335,18 @@ namespace GamecraftModdingAPI.App gameEngine.ToggleTimeMode(); } + /// + /// The mode of the game. + /// + public CurrentGameMode Mode + { + get + { + if (menuMode || !VerifyMode()) return CurrentGameMode.None; + return (CurrentGameMode) GameMode.CurrentMode; + } + } + /// /// Load the game save. /// This happens asynchronously, so when this method returns the game not loaded yet. diff --git a/GamecraftModdingAPI/BlockGroup.cs b/GamecraftModdingAPI/BlockGroup.cs index 4a0d994..eee660a 100644 --- a/GamecraftModdingAPI/BlockGroup.cs +++ b/GamecraftModdingAPI/BlockGroup.cs @@ -203,5 +203,10 @@ namespace GamecraftModdingAPI public bool IsReadOnly { get; } = false; public Block this[int index] => blocks[index]; //Setting is not supported, since the order doesn't matter + + public override string ToString() + { + return $"{nameof(Id)}: {Id}, {nameof(Position)}: {Position}, {nameof(Rotation)}: {Rotation}, {nameof(Count)}: {Count}"; + } } } \ No newline at end of file diff --git a/GamecraftModdingAPI/Blocks/BlueprintEngine.cs b/GamecraftModdingAPI/Blocks/BlueprintEngine.cs index 1936a17..619fda1 100644 --- a/GamecraftModdingAPI/Blocks/BlueprintEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlueprintEngine.cs @@ -36,6 +36,10 @@ namespace GamecraftModdingAPI.Blocks AccessTools.DeclaredField(PlaceBlueprintUtilityType, "_localBlockMap"); private static readonly MethodInfo BuildBlock = AccessTools.Method(PlaceBlueprintUtilityType, "BuildBlock"); private static readonly MethodInfo BuildWires = AccessTools.Method(PlaceBlueprintUtilityType, "BuildWires"); + private static readonly Type SerializeGhostBlueprintType = + AccessTools.TypeByName("RobocraftX.CR.MachineEditing.BoxSelect.SerializeGhostChildrenOnAddEngine"); + private static readonly MethodInfo SerializeGhostBlueprint = + AccessTools.Method(SerializeGhostBlueprintType, "SerializeClipboardGhostEntities"); private static NativeEntityRemove nativeRemove; private static MachineGraphConnectionEntityFactory connectionFactory; @@ -44,6 +48,8 @@ namespace GamecraftModdingAPI.Blocks private static IEntitySerialization entitySerialization; private static IEntityFactory entityFactory; private static FasterList globalBlockMap; + private static object SerializeGhostBlueprintInstance; + private static GhostChildEntityFactory BuildGhostBlueprintFactory; public void Ready() { @@ -130,6 +136,19 @@ namespace GamecraftModdingAPI.Blocks SelectionSerializationUtility.CopySelectionToClipboard(playerID, entitiesDB, serializationData.blueprintData, entitySerialization, entityFactory, blockIDs, (uint) blockIDs.Length, pos, rot, -1); + BuildGhostBlueprint(selected, pos, rot, playerID); + SerializeGhostBlueprint.Invoke(SerializeGhostBlueprintInstance, new object[] {playerID, blueprintID}); + + } + + private void BuildGhostBlueprint(ICollection blocks, float3 pos, quaternion rot, uint playerID) + { + GhostChildUtility.ClearGhostChildren(playerID, entitiesDB, entityFunctions); + foreach (var block in blocks) + { + GhostChildUtility.BuildGhostChild(in playerID, block.Id, in pos, in rot, entitiesDB, + BuildGhostBlueprintFactory, false); + } } public Block[] PlaceBlueprintBlocks(uint blueprintID, uint playerID, float3 pos, float3 rot) @@ -238,6 +257,34 @@ namespace GamecraftModdingAPI.Blocks } } + [HarmonyPatch] + private static class SerializeGhostBlueprintPatch + { + public static void Postfix(object __instance) + { + SerializeGhostBlueprintInstance = __instance; + } + + public static MethodBase TargetMethod() + { + return AccessTools.GetDeclaredConstructors(SerializeGhostBlueprintType)[0]; + } + } + + [HarmonyPatch] + private static class BuildGhostBlueprintPatch + { + public static void Postfix(GhostChildEntityFactory ghostChildEntityFactory) + { + BuildGhostBlueprintFactory = ghostChildEntityFactory; + } + + public static MethodBase TargetMethod() + { + return AccessTools.GetDeclaredConstructors(AccessTools.TypeByName("RobocraftX.CR.MachineEditing.BuildGhostChildForMultiblockPickEngine"))[0]; + } + } + public IEntityFactory Factory { get; set; } } } \ No newline at end of file diff --git a/GamecraftModdingAPI/Blueprint.cs b/GamecraftModdingAPI/Blueprint.cs index 458c56c..765de3d 100644 --- a/GamecraftModdingAPI/Blueprint.cs +++ b/GamecraftModdingAPI/Blueprint.cs @@ -72,5 +72,10 @@ namespace GamecraftModdingAPI { BlockGroup._engine.DisposeBlueprint(Id); } + + public override string ToString() + { + return $"{nameof(Id)}: {Id}"; + } } } \ No newline at end of file diff --git a/GamecraftModdingAPI/Player.cs b/GamecraftModdingAPI/Player.cs index 4778e02..0bed6a2 100644 --- a/GamecraftModdingAPI/Player.cs +++ b/GamecraftModdingAPI/Player.cs @@ -1,5 +1,4 @@ using System; -using Gamecraft.GUI.Blueprints; using Unity.Mathematics; using RobocraftX.Common; using RobocraftX.Common.Players; @@ -354,7 +353,13 @@ namespace GamecraftModdingAPI set => BlockGroup._engine.SelectBlueprint(value?.Id ?? uint.MaxValue); } - // object methods + /// + /// The player's mode in time stopped mode, determining what they place. + /// + public PlayerBuildingMode BuildingMode => (PlayerBuildingMode) playerEngine + .GetCharacterStruct(Id, out _).timeStoppedContext; + + // object methods /// /// Teleport the player to the specified coordinates. diff --git a/GamecraftModdingAPI/Players/PlayerBuildingMode.cs b/GamecraftModdingAPI/Players/PlayerBuildingMode.cs new file mode 100644 index 0000000..c7a5e37 --- /dev/null +++ b/GamecraftModdingAPI/Players/PlayerBuildingMode.cs @@ -0,0 +1,10 @@ +namespace GamecraftModdingAPI.Players +{ + public enum PlayerBuildingMode + { + BlockMode, + ColourMode, + ConfigMode, + BlueprintMode + } +} \ No newline at end of file -- 2.30.2 From 1f911b1d32dd498c69852f86d8eba4d4e941a11a Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sat, 14 Nov 2020 18:29:48 +0100 Subject: [PATCH 135/252] Fix move/rotate during init, add blueprint properties --- GamecraftModdingAPI/BlockGroup.cs | 8 ++-- GamecraftModdingAPI/Blocks/BlueprintEngine.cs | 14 ++++++- GamecraftModdingAPI/Blocks/MovementEngine.cs | 6 +-- GamecraftModdingAPI/Blocks/RotationEngine.cs | 6 +-- GamecraftModdingAPI/Blueprint.cs | 41 ++++++++++++++----- 5 files changed, 54 insertions(+), 21 deletions(-) diff --git a/GamecraftModdingAPI/BlockGroup.cs b/GamecraftModdingAPI/BlockGroup.cs index eee660a..6c600b2 100644 --- a/GamecraftModdingAPI/BlockGroup.cs +++ b/GamecraftModdingAPI/BlockGroup.cs @@ -115,7 +115,7 @@ namespace GamecraftModdingAPI /// /// Creates a new block group consisting of a single block. /// You can add more blocks using the Add() method or by setting the BlockGroup property of the blocks.
- /// Note that only newly placed blocks should be added to groups. + /// Note that only newly placed blocks can be added to groups. ///
/// The block to add /// A new block group containing the given block @@ -155,7 +155,7 @@ namespace GamecraftModdingAPI IEnumerator IEnumerable.GetEnumerator() => blocks.GetEnumerator(); /// - /// Adds a block to the group. You should only add newly placed blocks + /// Adds a block to the group. You can only add newly placed blocks /// so that the game initializes the group membership properly. /// /// @@ -170,7 +170,7 @@ namespace GamecraftModdingAPI /// /// Removes all blocks from this group. - /// You should not remove blocks that have been initialized, only those that you placed recently. + /// You cannot remove blocks that have been initialized, only those that you placed recently. /// public void Clear() { @@ -183,7 +183,7 @@ namespace GamecraftModdingAPI /// /// Removes a block from this group. - /// You should not remove blocks that have been initialized, only those that you placed recently. + /// You cannot remove blocks that have been initialized, only those that you placed recently. /// /// /// diff --git a/GamecraftModdingAPI/Blocks/BlueprintEngine.cs b/GamecraftModdingAPI/Blocks/BlueprintEngine.cs index 619fda1..ff22a4c 100644 --- a/GamecraftModdingAPI/Blocks/BlueprintEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlueprintEngine.cs @@ -209,6 +209,18 @@ namespace GamecraftModdingAPI.Blocks return blocks; } + public void GetBlueprintInfo(uint blueprintID, out float3 pos, out quaternion rot, out uint selectionSize) + { + var serializationData = clipboardManager.GetSerializationData(blueprintID); + var blueprintData = serializationData.blueprintData; + blueprintData.dataPos = 0U; + BoxSelectSerializationUtilities.ReadClipboardHeader(blueprintData, out selectionSize, out var posst, + out var rotst, out _); + blueprintData.dataPos = 0U; //Just to be sure, it gets reset when it's read anyway + pos = posst.position; + rot = rotst.rotation; + } + public void InitBlueprint(uint blueprintID) { clipboardManager.IncrementRefCount(blueprintID); @@ -280,7 +292,7 @@ namespace GamecraftModdingAPI.Blocks } public static MethodBase TargetMethod() - { + {RobocraftX.CR.MachineEditing.BuildGhostChildForMultiblockPickEngine return AccessTools.GetDeclaredConstructors(AccessTools.TypeByName("RobocraftX.CR.MachineEditing.BuildGhostChildForMultiblockPickEngine"))[0]; } } diff --git a/GamecraftModdingAPI/Blocks/MovementEngine.cs b/GamecraftModdingAPI/Blocks/MovementEngine.cs index a4ac0fa..fb3aa55 100644 --- a/GamecraftModdingAPI/Blocks/MovementEngine.cs +++ b/GamecraftModdingAPI/Blocks/MovementEngine.cs @@ -41,9 +41,9 @@ namespace GamecraftModdingAPI.Blocks { if (data.Group == null) return float3.zero; var init = new EntityComponentInitializer(blockID, data.Group); - init.Init(new PositionEntityStruct {position = vector}); - init.Init(new GridRotationStruct {position = vector}); - init.Init(new LocalTransformEntityStruct {position = vector}); + init.GetOrCreate().position = vector; + init.GetOrCreate().position = vector; + init.GetOrCreate().position = vector; return vector; } ref PositionEntityStruct posStruct = ref this.entitiesDB.QueryEntity(blockID); diff --git a/GamecraftModdingAPI/Blocks/RotationEngine.cs b/GamecraftModdingAPI/Blocks/RotationEngine.cs index ca97874..fbf8c98 100644 --- a/GamecraftModdingAPI/Blocks/RotationEngine.cs +++ b/GamecraftModdingAPI/Blocks/RotationEngine.cs @@ -41,9 +41,9 @@ namespace GamecraftModdingAPI.Blocks { if (data.Group == null) return float3.zero; var init = new EntityComponentInitializer(blockID, data.Group); - init.Init(new RotationEntityStruct {rotation = new Quaternion {eulerAngles = vector}}); - init.Init(new GridRotationStruct {rotation = new Quaternion {eulerAngles = vector}}); - init.Init(new LocalTransformEntityStruct {rotation = new Quaternion {eulerAngles = vector}}); + init.GetOrCreate().rotation = Quaternion.Euler(vector); + init.GetOrCreate().rotation = Quaternion.Euler(vector); + init.GetOrCreate().rotation = Quaternion.Euler(vector); return vector; } ref RotationEntityStruct rotStruct = ref this.entitiesDB.QueryEntity(blockID); diff --git a/GamecraftModdingAPI/Blueprint.cs b/GamecraftModdingAPI/Blueprint.cs index 765de3d..4d9dff0 100644 --- a/GamecraftModdingAPI/Blueprint.cs +++ b/GamecraftModdingAPI/Blueprint.cs @@ -15,15 +15,23 @@ namespace GamecraftModdingAPI { Id = id; BlockGroup._engine.InitBlueprint(id); + Refresh(); } - - /*public static void SelectBlueprint(Blueprint blueprint) - { - BlueprintUtil.SelectBlueprint(null, new BlueprintInventoryItemEntityStruct - { - blueprintResourceId = blueprint.Id - }); - }*/ + + /// + /// The center of the blueprint. Can only be set using the StoreBlocks() method. + /// + public float3 Position { get; private set; } + + /// + /// The rotation of the blueprint. Can only be set using the StoreBlocks() method. + /// + public float3 Rotation { get; private set; } + + /// + /// The amount of blocks in the blueprint. Gan only be set using the StoreBlocks() method. + /// + public uint BlockCount { get; private set; } /// /// Creates a new, empty blueprint. It will be deleted on disposal unless the game holds a reference to it. @@ -39,12 +47,13 @@ namespace GamecraftModdingAPI /// Use the BlockGroup overload for automatically calculated position and rotation. /// /// The array of blocks to use - /// The anchor position of the blueprint + /// The anchor (center) position of the blueprint /// The base rotation of the blueprint public void StoreBlocks(Block[] blocks, float3 position, float3 rotation) { BlockGroup._engine.ReplaceBlueprint(Player.LocalPlayer.Id, Id, blocks, position, quaternion.Euler(rotation)); + Refresh(); } /// @@ -55,6 +64,7 @@ namespace GamecraftModdingAPI { BlockGroup._engine.ReplaceBlueprint(Player.LocalPlayer.Id, Id, group, group.Position, Quaternion.Euler(group.Rotation)); + Refresh(); } /// @@ -68,6 +78,17 @@ namespace GamecraftModdingAPI return BlockGroup._engine.PlaceBlueprintBlocks(Id, Player.LocalPlayer.Id, position, rotation); } + /// + /// Updates the properties based on the blueprint data. Only necessary if the blueprint is changed from the game. + /// + public void Refresh() + { + BlockGroup._engine.GetBlueprintInfo(Id, out var pos, out var rot, out uint count); + Position = pos; + Rotation = ((Quaternion) rot).eulerAngles; + BlockCount = count; + } + public void Dispose() { BlockGroup._engine.DisposeBlueprint(Id); @@ -75,7 +96,7 @@ namespace GamecraftModdingAPI public override string ToString() { - return $"{nameof(Id)}: {Id}"; + return $"{nameof(Id)}: {Id}, {nameof(Position)}: {Position}, {nameof(Rotation)}: {Rotation}, {nameof(BlockCount)}: {BlockCount}"; } } } \ No newline at end of file -- 2.30.2 From fad3b5cbf4abb7aa7a714751de57b1cb242fc8bc Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sat, 14 Nov 2020 22:43:45 +0100 Subject: [PATCH 136/252] Fix picking block groups... --- GamecraftModdingAPI/Block.cs | 5 +- GamecraftModdingAPI/BlockGroup.cs | 12 ++- GamecraftModdingAPI/Blocks/BlueprintEngine.cs | 55 ++++++++----- GamecraftModdingAPI/Blocks/PlacementEngine.cs | 2 +- .../GamecraftModdingAPI.csproj | 2 +- .../Tests/GamecraftModdingAPIPluginTest.cs | 82 ------------------- doxygen.conf | 2 +- 7 files changed, 48 insertions(+), 112 deletions(-) diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index 0fecf40..d0ff657 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -365,7 +365,7 @@ namespace GamecraftModdingAPI private BlockGroup blockGroup; /// - /// Returns the block group this block is a part of. Block groups can be placed using blueprints. + /// Returns the block group this block is a part of. Block groups can also be placed using blueprints. /// Returns null if not part of a group.
/// Setting the group after the block has been initialized will not update everything properly, /// so you can only set this property on blocks newly placed by your code.
@@ -385,9 +385,6 @@ namespace GamecraftModdingAPI { if (Exists) { - /*var copy = Copy(); - copy.BlockGroup = value; //It won't run this on the new instance as it won't 'exist' yet - Remove();*/ Logging.LogWarning("Attempted to set group of existing block. This is not supported." + " Copy the block and set the group of the resulting block."); return; diff --git a/GamecraftModdingAPI/BlockGroup.cs b/GamecraftModdingAPI/BlockGroup.cs index 6c600b2..c1add9a 100644 --- a/GamecraftModdingAPI/BlockGroup.cs +++ b/GamecraftModdingAPI/BlockGroup.cs @@ -55,7 +55,7 @@ namespace GamecraftModdingAPI } /// - /// The position of the block group (center). Recalculated if blocks have been added/removed since the last query. + /// The position of the block group (center). Can only be used after initialization is complete. /// public float3 Position { @@ -78,7 +78,7 @@ namespace GamecraftModdingAPI } /// - /// The rotation of the block group. Recalculated if blocks have been added/removed since the last query. + /// The rotation of the block group. Can only be used after initialization is complete. /// public float3 Rotation { @@ -121,7 +121,7 @@ namespace GamecraftModdingAPI /// A new block group containing the given block public static BlockGroup Create(Block block) { - var bg = new BlockGroup(_engine.CreateBlockGroup(default, default), block); + var bg = new BlockGroup(_engine.CreateBlockGroup(block.Position, Quaternion.Euler(block.Rotation)), block); block.BlockGroup = bg; return bg; } @@ -166,7 +166,11 @@ namespace GamecraftModdingAPI item.BlockGroup = this; //Calls AddInternal } - internal void AddInternal(Block item) => blocks.Add(item); + internal void AddInternal(Block item) + { + blocks.Add(item); + _engine.AddBlockToGroup(item.Id, Id); + } /// /// Removes all blocks from this group. diff --git a/GamecraftModdingAPI/Blocks/BlueprintEngine.cs b/GamecraftModdingAPI/Blocks/BlueprintEngine.cs index ff22a4c..ddfb051 100644 --- a/GamecraftModdingAPI/Blocks/BlueprintEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlueprintEngine.cs @@ -29,7 +29,8 @@ namespace GamecraftModdingAPI.Blocks private NativeDynamicArray selectedBlocksInGroup; private NativeHashSet removedConnections = new NativeHashSet(); - + private int addingToBlockGroup = -1; + private static readonly Type PlaceBlueprintUtilityType = AccessTools.TypeByName("RobocraftX.CR.MachineEditing.PlaceBlueprintUtility"); private static readonly FieldInfo LocalBlockMap = @@ -50,13 +51,14 @@ namespace GamecraftModdingAPI.Blocks private static FasterList globalBlockMap; private static object SerializeGhostBlueprintInstance; private static GhostChildEntityFactory BuildGhostBlueprintFactory; - + public void Ready() { selectedBlocksInGroup = NativeDynamicArray.Alloc(Allocator.Persistent); } public EntitiesDB entitiesDB { get; set; } + public void Dispose() { selectedBlocksInGroup.Dispose(); @@ -96,6 +98,20 @@ namespace GamecraftModdingAPI.Blocks return nextFilterId; } + public void AddBlockToGroup(EGID blockID, int groupID) + { + if (globalBlockMap == null) + globalBlockMap = FullGameFields._deserialisedBlockMap; + if (groupID != addingToBlockGroup) + { + Logging.MetaDebugLog("Changing current block group from " + addingToBlockGroup + " to " + groupID); + addingToBlockGroup = groupID; + globalBlockMap.Clear(); + } + + globalBlockMap.Add(blockID); + } + public void SelectBlueprint(uint resourceID) { if (resourceID == uint.MaxValue) @@ -109,7 +125,7 @@ namespace GamecraftModdingAPI.Blocks uint index = clipboardManager.AllocateSerializationData(); return index; } - + public void ReplaceBlueprint(uint playerID, uint blueprintID, ICollection selected, float3 pos, quaternion rot) { var blockIDs = new EGID[selected.Count]; @@ -131,14 +147,14 @@ namespace GamecraftModdingAPI.Blocks //float3 bottomOffset = PlaceBlockUtility.GetBottomOffset(collider); //var rootPosition = math.mul(groupTransform.blockGroupGridRotation, bottomOffset) + groupTransform.blockGroupGridPosition; //var rootRotation = groupTransform.blockGroupGridRotation; - + clipboardManager.SetGhostSerialized(blueprintID, false); SelectionSerializationUtility.CopySelectionToClipboard(playerID, entitiesDB, serializationData.blueprintData, entitySerialization, entityFactory, blockIDs, (uint) blockIDs.Length, pos, rot, -1); BuildGhostBlueprint(selected, pos, rot, playerID); SerializeGhostBlueprint.Invoke(SerializeGhostBlueprintInstance, new object[] {playerID, blueprintID}); - + } private void BuildGhostBlueprint(ICollection blocks, float3 pos, quaternion rot, uint playerID) @@ -173,11 +189,12 @@ namespace GamecraftModdingAPI.Blocks } } int nextFilterId1 = BlockGroupUtility.NextFilterId; - entityFactory.BuildEntity(new EGID((uint) nextFilterId1, BlockGroupExclusiveGroups.BlockGroupEntityGroup)).Init(new BlockGroupTransformEntityComponent - { - blockGroupGridPosition = selectionPosition.position, - blockGroupGridRotation = selectionRotation.rotation - }); + entityFactory.BuildEntity(new EGID((uint) nextFilterId1, + BlockGroupExclusiveGroups.BlockGroupEntityGroup)).Init(new BlockGroupTransformEntityComponent + { + blockGroupGridPosition = selectionPosition.position, + blockGroupGridRotation = selectionRotation.rotation + }); var frot = Quaternion.Euler(rot); var grid = new GridRotationStruct {position = pos, rotation = frot}; var poss = new PositionEntityStruct {position = pos}; @@ -284,17 +301,17 @@ namespace GamecraftModdingAPI.Blocks } [HarmonyPatch] - private static class BuildGhostBlueprintPatch + private static class BuildGhostBlueprintPatch + { + public static void Postfix(GhostChildEntityFactory ghostChildEntityFactory) { - public static void Postfix(GhostChildEntityFactory ghostChildEntityFactory) - { - BuildGhostBlueprintFactory = ghostChildEntityFactory; - } + BuildGhostBlueprintFactory = ghostChildEntityFactory; + } - public static MethodBase TargetMethod() - {RobocraftX.CR.MachineEditing.BuildGhostChildForMultiblockPickEngine - return AccessTools.GetDeclaredConstructors(AccessTools.TypeByName("RobocraftX.CR.MachineEditing.BuildGhostChildForMultiblockPickEngine"))[0]; - } + public static MethodBase TargetMethod() + { + return AccessTools.GetDeclaredConstructors(AccessTools.TypeByName("RobocraftX.CR.MachineEditing.BuildGhostChildForMultiblockPickEngine"))[0]; + } } public IEntityFactory Factory { get; set; } diff --git a/GamecraftModdingAPI/Blocks/PlacementEngine.cs b/GamecraftModdingAPI/Blocks/PlacementEngine.cs index fab9c62..b0d1365 100644 --- a/GamecraftModdingAPI/Blocks/PlacementEngine.cs +++ b/GamecraftModdingAPI/Blocks/PlacementEngine.cs @@ -107,7 +107,7 @@ namespace GamecraftModdingAPI.Blocks belongsTo = 32U, collidesWith = 239532U });*/ - + PrimaryRotationUtility.InitialisePrimaryDirection(rotation.rotation, ref structInitializer); EGID playerEGID = new EGID(playerId, CharacterExclusiveGroups.OnFootGroup); ref PickedBlockExtraDataStruct pickedBlock = ref entitiesDB.QueryEntity(playerEGID); diff --git a/GamecraftModdingAPI/GamecraftModdingAPI.csproj b/GamecraftModdingAPI/GamecraftModdingAPI.csproj index 88002d0..3dabe64 100644 --- a/GamecraftModdingAPI/GamecraftModdingAPI.csproj +++ b/GamecraftModdingAPI/GamecraftModdingAPI.csproj @@ -2,7 +2,7 @@ net472 true - 1.8.0 + 1.7.0 Exmods GNU General Public Licence 3+ https://git.exmods.org/modtainers/GamecraftModdingAPI diff --git a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs index fb806ea..81a814c 100644 --- a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs +++ b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs @@ -410,88 +410,6 @@ namespace GamecraftModdingAPI.Tests return ((Action) MinimumSpecsCheck.CheckRequirementsMet).Method; } } - - [HarmonyPatch] - public class BugHuntPatch - { - public static MethodInfo method = - SymbolExtensions.GetMethodInfo(str => Console.WriteLine(str)); - - public static IEnumerable Transpiler(IEnumerable instructions) - { - int i = 0; - foreach (var instruction in instructions) - { - i++; - yield return instruction; //Return the instruction first - //stloc, dup, callvirt - if (instruction.opcode.Name.ToLower().StartsWith("stloc") - || instruction.opcode == OpCodes.Dup - || instruction.opcode == OpCodes.Callvirt) - { - yield return new CodeInstruction(OpCodes.Ldstr, - "Just ran the " + i + ". instruction ending with " + instruction.opcode.Name); - yield return new CodeInstruction(OpCodes.Call, method); - } - } - } - - public static MethodInfo TargetMethod() - { - return AccessTools.Method("RobocraftX.CR.MachineEditing.BoxSelect.CopySelectionEngine:GenerateThumbnail"); - } - } - - [HarmonyPatch] - public class BugHuntPatch2 - { - public static void Prefix(int width, float fieldOfView, Vector3 cameraDirection, Vector3 lightDirection) - { - Console.WriteLine("TakeThumbnail invoked with parameters: " + width + ", " + fieldOfView + ", " + - cameraDirection + ", " + lightDirection); - - GPUInstancerManager manager = GPUInstancerAPI.GetActiveManagers().Find(m => m is GPUInstancerPrefabManager); - Bounds instancesBounds = manager.ComputeInstancesBounds(2); - Console.WriteLine("Bounds: " + instancesBounds); - Console.WriteLine("Size: " + instancesBounds.size); - Console.WriteLine("Size.x < 0: " + (instancesBounds.size.x < 0)); - } - - public static void Postfix(Texture2D __result) - { - Console.WriteLine("TakeThumbnail returned: " + (__result == null ? null : __result.name)); - } - - private delegate Texture2D TakeThumbnailDel(int width, float fieldOfView, Vector3 cameraDirection, - Vector3 lightDirection); - - public static MethodInfo TargetMethod() - { - return ((TakeThumbnailDel) ThumbnailUtility.TakeThumbnail).Method; - } - } - - [HarmonyPatch] - public class BugHuntPatch3 - { - public static void Prefix(int width, int filterLayerMask, GPUInstancerManager manager, - Vector3 cameraPosition, Quaternion cameraRotation, float cameraFov, Vector3 lightDirection, - int cullingLayer) - { - Console.WriteLine("Inner TakeThumbnail invoked with parameters: " + width + ", " + filterLayerMask + - ", " + (manager != null ? manager.name : null) + ", " + cameraPosition + ", " + - cameraRotation + ", " + cameraFov + ", " + lightDirection + ", " + cullingLayer); - } - - private delegate Texture2D TakeThumbnailDel(int width, int filterLayerMask, GPUInstancerManager manager, - Vector3 cameraPosition, Quaternion cameraRotation, float cameraFov, Vector3 lightDirection, - int cullingLayer); - - public static MethodInfo TargetMethod() - { - return ((TakeThumbnailDel) ThumbnailUtility.TakeThumbnail).Method; - } - } } #endif } diff --git a/doxygen.conf b/doxygen.conf index 4b1eaed..9958d11 100644 --- a/doxygen.conf +++ b/doxygen.conf @@ -38,7 +38,7 @@ PROJECT_NAME = "GamecraftModdingAPI" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = "v1.8.0" +PROJECT_NUMBER = "v1.7.0" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a -- 2.30.2 From 404c47c7c01e7c13eb49117cda9ba83e59ca1897 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Wed, 18 Nov 2020 16:46:23 -0500 Subject: [PATCH 137/252] Bump version to 1.8.0 --- .../GamecraftModdingAPI.csproj | 129 +++++++++--------- doxygen.conf | 2 +- 2 files changed, 66 insertions(+), 65 deletions(-) diff --git a/GamecraftModdingAPI/GamecraftModdingAPI.csproj b/GamecraftModdingAPI/GamecraftModdingAPI.csproj index 3dabe64..b630e64 100644 --- a/GamecraftModdingAPI/GamecraftModdingAPI.csproj +++ b/GamecraftModdingAPI/GamecraftModdingAPI.csproj @@ -2,7 +2,7 @@ net472 true - 1.7.0 + 1.8.0 Exmods GNU General Public Licence 3+ https://git.exmods.org/modtainers/GamecraftModdingAPI @@ -24,11 +24,16 @@ + - - ..\ref\Gamecraft_Data\Managed\Accessibility.dll - ..\..\ref\Gamecraft_Data\Managed\Accessibility.dll + + ..\ref\Gamecraft_Data\Managed\IllusionInjector.dll + ..\..\ref\Gamecraft_Data\Managed\IllusionInjector.dll + + + ..\ref\Gamecraft_Data\Managed\IllusionPlugin.dll + ..\..\ref\Gamecraft_Data\Managed\IllusionPlugin.dll ..\ref\Gamecraft_Data\Managed\Analytics.dll @@ -74,10 +79,6 @@ ..\ref\Gamecraft_Data\Managed\DDNA.dll ..\..\ref\Gamecraft_Data\Managed\DDNA.dll - - ..\ref\Gamecraft_Data\Managed\Facepunch.Steamworks.Win64.dll - ..\..\ref\Gamecraft_Data\Managed\Facepunch.Steamworks.Win64.dll - ..\ref\Gamecraft_Data\Managed\FMOD.dll ..\..\ref\Gamecraft_Data\Managed\FMOD.dll @@ -330,26 +331,10 @@ ..\ref\Gamecraft_Data\Managed\Havok.Physics.Hybrid.dll ..\..\ref\Gamecraft_Data\Managed\Havok.Physics.Hybrid.dll - - ..\ref\Gamecraft_Data\Managed\IllusionInjector.dll - ..\..\ref\Gamecraft_Data\Managed\IllusionInjector.dll - - - ..\ref\Gamecraft_Data\Managed\IllusionPlugin.dll - ..\..\ref\Gamecraft_Data\Managed\IllusionPlugin.dll - - - ..\ref\Gamecraft_Data\Managed\JWT.dll - ..\..\ref\Gamecraft_Data\Managed\JWT.dll - ..\ref\Gamecraft_Data\Managed\LZ4.dll ..\..\ref\Gamecraft_Data\Managed\LZ4.dll - - ..\ref\Gamecraft_Data\Managed\mscorlib.dll - ..\..\ref\Gamecraft_Data\Managed\mscorlib.dll - ..\ref\Gamecraft_Data\Managed\MultiplayerNetworking.dll ..\..\ref\Gamecraft_Data\Managed\MultiplayerNetworking.dll @@ -358,30 +343,10 @@ ..\ref\Gamecraft_Data\Managed\MultiplayerTest.dll ..\..\ref\Gamecraft_Data\Managed\MultiplayerTest.dll - - ..\ref\Gamecraft_Data\Managed\netstandard.dll - ..\..\ref\Gamecraft_Data\Managed\netstandard.dll - - - ..\ref\Gamecraft_Data\Managed\Newtonsoft.Json.dll - ..\..\ref\Gamecraft_Data\Managed\Newtonsoft.Json.dll - - - ..\ref\Gamecraft_Data\Managed\Novell.Directory.Ldap.dll - ..\..\ref\Gamecraft_Data\Managed\Novell.Directory.Ldap.dll - ..\ref\Gamecraft_Data\Managed\RCX.ScreenshotTaker.dll ..\..\ref\Gamecraft_Data\Managed\RCX.ScreenshotTaker.dll - - ..\ref\Gamecraft_Data\Managed\Rewired_Core.dll - ..\..\ref\Gamecraft_Data\Managed\Rewired_Core.dll - - - ..\ref\Gamecraft_Data\Managed\Rewired_Windows.dll - ..\..\ref\Gamecraft_Data\Managed\Rewired_Windows.dll - ..\ref\Gamecraft_Data\Managed\RobocraftECS.dll ..\..\ref\Gamecraft_Data\Managed\RobocraftECS.dll @@ -654,18 +619,10 @@ ..\ref\Gamecraft_Data\Managed\Unity.Burst.dll ..\..\ref\Gamecraft_Data\Managed\Unity.Burst.dll - - ..\ref\Gamecraft_Data\Managed\Unity.Burst.Unsafe.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Burst.Unsafe.dll - ..\ref\Gamecraft_Data\Managed\Unity.Collections.dll ..\..\ref\Gamecraft_Data\Managed\Unity.Collections.dll - - ..\ref\Gamecraft_Data\Managed\Unity.Collections.LowLevel.ILSupport.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Collections.LowLevel.ILSupport.dll - ..\ref\Gamecraft_Data\Managed\Unity.DataFlowGraph.dll ..\..\ref\Gamecraft_Data\Managed\Unity.DataFlowGraph.dll @@ -794,6 +751,62 @@ ..\ref\Gamecraft_Data\Managed\Unity.VisualEffectGraph.Runtime.dll ..\..\ref\Gamecraft_Data\Managed\Unity.VisualEffectGraph.Runtime.dll + + ..\ref\Gamecraft_Data\Managed\UnityEngine.UI.dll + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UI.dll + + + ..\ref\Gamecraft_Data\Managed\uREPL.dll + ..\..\ref\Gamecraft_Data\Managed\uREPL.dll + + + ..\ref\Gamecraft_Data\Managed\VisualProfiler.dll + ..\..\ref\Gamecraft_Data\Managed\VisualProfiler.dll + + + ..\ref\Gamecraft_Data\Managed\Accessibility.dll + ..\..\ref\Gamecraft_Data\Managed\Accessibility.dll + + + ..\ref\Gamecraft_Data\Managed\Facepunch.Steamworks.Win64.dll + ..\..\ref\Gamecraft_Data\Managed\Facepunch.Steamworks.Win64.dll + + + ..\ref\Gamecraft_Data\Managed\JWT.dll + ..\..\ref\Gamecraft_Data\Managed\JWT.dll + + + ..\ref\Gamecraft_Data\Managed\mscorlib.dll + ..\..\ref\Gamecraft_Data\Managed\mscorlib.dll + + + ..\ref\Gamecraft_Data\Managed\netstandard.dll + ..\..\ref\Gamecraft_Data\Managed\netstandard.dll + + + ..\ref\Gamecraft_Data\Managed\Newtonsoft.Json.dll + ..\..\ref\Gamecraft_Data\Managed\Newtonsoft.Json.dll + + + ..\ref\Gamecraft_Data\Managed\Novell.Directory.Ldap.dll + ..\..\ref\Gamecraft_Data\Managed\Novell.Directory.Ldap.dll + + + ..\ref\Gamecraft_Data\Managed\Rewired_Core.dll + ..\..\ref\Gamecraft_Data\Managed\Rewired_Core.dll + + + ..\ref\Gamecraft_Data\Managed\Rewired_Windows.dll + ..\..\ref\Gamecraft_Data\Managed\Rewired_Windows.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Burst.Unsafe.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Burst.Unsafe.dll + + + ..\ref\Gamecraft_Data\Managed\Unity.Collections.LowLevel.ILSupport.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.Collections.LowLevel.ILSupport.dll + ..\ref\Gamecraft_Data\Managed\UnityEngine.AccessibilityModule.dll ..\..\ref\Gamecraft_Data\Managed\UnityEngine.AccessibilityModule.dll @@ -962,10 +975,6 @@ ..\ref\Gamecraft_Data\Managed\UnityEngine.TLSModule.dll ..\..\ref\Gamecraft_Data\Managed\UnityEngine.TLSModule.dll - - ..\ref\Gamecraft_Data\Managed\UnityEngine.UI.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UI.dll - ..\ref\Gamecraft_Data\Managed\UnityEngine.UIElementsModule.dll ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UIElementsModule.dll @@ -1046,14 +1055,6 @@ ..\ref\Gamecraft_Data\Managed\UnityEngine.XRModule.dll ..\..\ref\Gamecraft_Data\Managed\UnityEngine.XRModule.dll - - ..\ref\Gamecraft_Data\Managed\uREPL.dll - ..\..\ref\Gamecraft_Data\Managed\uREPL.dll - - - ..\ref\Gamecraft_Data\Managed\VisualProfiler.dll - ..\..\ref\Gamecraft_Data\Managed\VisualProfiler.dll - \ No newline at end of file diff --git a/doxygen.conf b/doxygen.conf index 9958d11..4b1eaed 100644 --- a/doxygen.conf +++ b/doxygen.conf @@ -38,7 +38,7 @@ PROJECT_NAME = "GamecraftModdingAPI" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = "v1.7.0" +PROJECT_NUMBER = "v1.8.0" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a -- 2.30.2 From ab1ae51ecec21b18d789188b17d78bddb4e321b4 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Fri, 11 Dec 2020 17:11:24 +0100 Subject: [PATCH 138/252] Update to Gamecraft 2020.11.30.16.02 --- GamecraftModdingAPI/Block.cs | 4 +- GamecraftModdingAPI/Blocks/BlockEngine.cs | 48 +++++++++++-------- GamecraftModdingAPI/Blocks/BlockIDs.cs | 4 ++ .../GamecraftModdingAPI.csproj | 42 ++-------------- GamecraftModdingAPI/Utility/FullGameFields.cs | 2 +- 5 files changed, 37 insertions(+), 63 deletions(-) diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index d0ff657..524847d 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -114,8 +114,8 @@ namespace GamecraftModdingAPI private static Dictionary> initializers = new Dictionary>(); - private static Dictionary typeToGroup = - new Dictionary + private static Dictionary typeToGroup = + new Dictionary { {typeof(ConsoleBlock), new[] {CommonExclusiveGroups.CONSOLE_BLOCK_GROUP}}, {typeof(LogicGate), new [] {CommonExclusiveGroups.LOGIC_BLOCK_GROUP}}, diff --git a/GamecraftModdingAPI/Blocks/BlockEngine.cs b/GamecraftModdingAPI/Blocks/BlockEngine.cs index 2da04a3..a365d54 100644 --- a/GamecraftModdingAPI/Blocks/BlockEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlockEngine.cs @@ -178,37 +178,43 @@ namespace GamecraftModdingAPI.Blocks public SimBody[] GetSimBodiesFromID(byte id) { var ret = new FasterList(4); - if (!entitiesDB.HasAny(CommonExclusiveGroups.OBJID_BLOCK_GROUP)) - return new SimBody[0]; - var oids = entitiesDB.QueryEntities(CommonExclusiveGroups.OBJID_BLOCK_GROUP).ToBuffer(); - var connections = entitiesDB.QueryMappedEntities(CommonExclusiveGroups.OBJID_BLOCK_GROUP); - for (int i = 0; i < oids.count; i++) + var oide = entitiesDB.QueryEntities(); + EGIDMapper? connections = null; + foreach (var ((oids, count), _) in oide) { - ref ObjectIdEntityStruct oid = ref oids.buffer[i]; - if (oid.objectId != id) continue; - var rid = connections.Entity(oid.ID.entityID).machineRigidBodyId; - foreach (var rb in ret) - { - if (rb.Id.entityID == rid) - goto DUPLICATE; //Multiple Object Identifiers on one rigid body + for (int i = 0; i < count; i++) + { + ref ObjectIdEntityStruct oid = ref oids[i]; + if (oid.objectId != id) continue; + if (!connections.HasValue) //Would need reflection to get the group from the build group otherwise + connections = entitiesDB.QueryMappedEntities(oid.ID.groupID); + var rid = connections.Value.Entity(oid.ID.entityID).machineRigidBodyId; + foreach (var rb in ret) + { + if (rb.Id.entityID == rid) + goto DUPLICATE; //Multiple Object Identifiers on one rigid body + } + + ret.Add(new SimBody(rid)); + DUPLICATE: ; } - ret.Add(new SimBody(rid)); - DUPLICATE: ; } + return ret.ToArray(); } public ObjectIdentifier[] GetObjectIDsFromID(byte id, bool sim) { var ret = new FasterList(4); - if (!entitiesDB.HasAny(CommonExclusiveGroups.OBJID_BLOCK_GROUP)) - return new ObjectIdentifier[0]; - var oids = entitiesDB.QueryEntities(CommonExclusiveGroups.OBJID_BLOCK_GROUP).ToBuffer(); - for (int i = 0; i < oids.count; i++) + var oide = entitiesDB.QueryEntities(); + foreach (var ((oids, count), _) in oide) { - ref ObjectIdEntityStruct oid = ref oids.buffer[i]; - if (sim ? oid.simObjectId == id : oid.objectId == id) - ret.Add(new ObjectIdentifier(oid.ID)); + for (int i = 0; i < count; i++) + { + ref ObjectIdEntityStruct oid = ref oids[i]; + if (sim ? oid.simObjectId == id : oid.objectId == id) + ret.Add(new ObjectIdentifier(oid.ID)); + } } return ret.ToArray(); diff --git a/GamecraftModdingAPI/Blocks/BlockIDs.cs b/GamecraftModdingAPI/Blocks/BlockIDs.cs index 1d55b29..9591ae2 100644 --- a/GamecraftModdingAPI/Blocks/BlockIDs.cs +++ b/GamecraftModdingAPI/Blocks/BlockIDs.cs @@ -329,6 +329,10 @@ namespace GamecraftModdingAPI.Blocks UnlitGlowSlope, Fog, Sky, + GridCube, + GridSlicedCube, + GridSlope, + GridCorner, MagmaRockCube = 777, MagmaRockCubeSliced, MagmaRockSlope, diff --git a/GamecraftModdingAPI/GamecraftModdingAPI.csproj b/GamecraftModdingAPI/GamecraftModdingAPI.csproj index 3dabe64..c76ebd9 100644 --- a/GamecraftModdingAPI/GamecraftModdingAPI.csproj +++ b/GamecraftModdingAPI/GamecraftModdingAPI.csproj @@ -618,34 +618,6 @@ ..\ref\Gamecraft_Data\Managed\Unity.Addressables.dll ..\..\ref\Gamecraft_Data\Managed\Unity.Addressables.dll - - ..\ref\Gamecraft_Data\Managed\Unity.Animation.Curves.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Animation.Curves.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Animation.Curves.Hybrid.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Animation.Curves.Hybrid.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Animation.DefaultGraphPipeline.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Animation.DefaultGraphPipeline.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Animation.DefaultGraphPipeline.Hybrid.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Animation.DefaultGraphPipeline.Hybrid.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Animation.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Animation.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Animation.Graph.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Animation.Graph.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Animation.Hybrid.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Animation.Hybrid.dll - ..\ref\Gamecraft_Data\Managed\Unity.Build.SlimPlayerRuntime.dll ..\..\ref\Gamecraft_Data\Managed\Unity.Build.SlimPlayerRuntime.dll @@ -666,10 +638,6 @@ ..\ref\Gamecraft_Data\Managed\Unity.Collections.LowLevel.ILSupport.dll ..\..\ref\Gamecraft_Data\Managed\Unity.Collections.LowLevel.ILSupport.dll - - ..\ref\Gamecraft_Data\Managed\Unity.DataFlowGraph.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.DataFlowGraph.dll - ..\ref\Gamecraft_Data\Managed\Unity.Deformations.dll ..\..\ref\Gamecraft_Data\Managed\Unity.Deformations.dll @@ -682,9 +650,9 @@ ..\ref\Gamecraft_Data\Managed\Unity.Entities.Hybrid.dll ..\..\ref\Gamecraft_Data\Managed\Unity.Entities.Hybrid.dll - - ..\ref\Gamecraft_Data\Managed\Unity.InternalAPIEngineBridge.002.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.InternalAPIEngineBridge.002.dll + + ..\ref\Gamecraft_Data\Managed\Unity.InternalAPIEngineBridge.012.dll + ..\..\ref\Gamecraft_Data\Managed\Unity.InternalAPIEngineBridge.012.dll ..\ref\Gamecraft_Data\Managed\Unity.Jobs.dll @@ -718,10 +686,6 @@ ..\ref\Gamecraft_Data\Managed\Unity.Platforms.Common.dll ..\..\ref\Gamecraft_Data\Managed\Unity.Platforms.Common.dll - - ..\ref\Gamecraft_Data\Managed\Unity.Postprocessing.Runtime.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Postprocessing.Runtime.dll - ..\ref\Gamecraft_Data\Managed\Unity.Properties.dll ..\..\ref\Gamecraft_Data\Managed\Unity.Properties.dll diff --git a/GamecraftModdingAPI/Utility/FullGameFields.cs b/GamecraftModdingAPI/Utility/FullGameFields.cs index 432103d..ccf80de 100644 --- a/GamecraftModdingAPI/Utility/FullGameFields.cs +++ b/GamecraftModdingAPI/Utility/FullGameFields.cs @@ -14,7 +14,7 @@ using RobocraftX.Rendering; using Svelto.Context; using Svelto.DataStructures; using Svelto.ECS; -using Svelto.ECS.Schedulers.Unity; +using Svelto.ECS.Schedulers; using UnityEngine; using Unity.Entities; using Unity.Physics.Systems; -- 2.30.2 From 432d6bcf969cedd3db1ea1b3670af0cae20c24cf Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sat, 12 Dec 2020 02:28:42 +0100 Subject: [PATCH 139/252] Use the same (physics) componentts and attempt to use custom material --- GamecraftModdingAPI/Blocks/CustomBlock.cs | 44 ++++++++++++++--------- 1 file changed, 28 insertions(+), 16 deletions(-) diff --git a/GamecraftModdingAPI/Blocks/CustomBlock.cs b/GamecraftModdingAPI/Blocks/CustomBlock.cs index b960101..7c5d6db 100644 --- a/GamecraftModdingAPI/Blocks/CustomBlock.cs +++ b/GamecraftModdingAPI/Blocks/CustomBlock.cs @@ -3,27 +3,22 @@ using System.Collections; using System.Collections.Generic; using System.Linq; using System.Reflection; -using System.Reflection.Emit; -using System.Text.Formatting; using DataLoader; -using GamecraftModdingAPI.Utility; using GPUInstancer; using HarmonyLib; -using RobocraftX.Blocks.Ghost; +using RobocraftX.Blocks; using RobocraftX.Common; -using RobocraftX.Schedulers; +using RobocraftX.Rendering; using Svelto.DataStructures; -using Svelto.ECS.Extensions.Unity; using Svelto.Tasks; -using Svelto.Tasks.ExtraLean; using Unity.Entities; using Unity.Entities.Conversion; using Unity.Physics; using UnityEngine; using UnityEngine.AddressableAssets; using BoxCollider = UnityEngine.BoxCollider; -using Collider = UnityEngine.Collider; using Material = UnityEngine.Material; +using Object = UnityEngine.Object; namespace GamecraftModdingAPI.Blocks { @@ -122,7 +117,7 @@ namespace GamecraftModdingAPI.Blocks } } - [HarmonyPatch] + /*[HarmonyPatch] public static class RendererPatch { private static Material[] materials; @@ -134,9 +129,16 @@ namespace GamecraftModdingAPI.Blocks //Console.WriteLine("Length: " + gameObject.GetComponentsInChildren().Length); if (materials != null) gameObject.GetComponentsInChildren()[0].sharedMaterials = materials; - ECSGPUIResourceManager.Instance.RegisterRuntimePrefabs( + /*ECSGPUIResourceManager.Instance.RegisterGhostsPrefabsAtRuntime( new[] {new PrefabData {prefabId = prefabID, prefabName = "Assets/Prefabs/Cube.prefab"}}, - new List {gameObject}).Complete(); + new List {gameObject});#1# + GameObject go = Object.Instantiate(gameObject); + go.SetActive(false); + AccessTools.Method("RobocraftX.Rendering.ECSGPUIResourceManager:RegisterNewPrefabAtRuntime") + .Invoke(ECSGPUIResourceManager.Instance, + new object[] {(uint) ((int) prefabID * 2 + 1), gameObject, true}); + //ECSGPUIResourceManager.Instance.RegisterNewPrefabAtRuntime((uint) ((int)prefabID * 2 + 1), gameObject, true); //.isOcclusionCulling = false; + UnityEngine.Object.Destroy(gameObject); GPUInstancerAPI.AddInstancesToPrefabPrototypeAtRuntime(ECSGPUIResourceManager.Instance.prefabManager, gameObject.GetComponent().prefabPrototype, new[] {gameObject}); Console.WriteLine("Registered prefab to instancer"); @@ -144,7 +146,7 @@ namespace GamecraftModdingAPI.Blocks /*var register = AccessTools.Method("RobocraftX.Common.ECSPhysicResourceManager:RegisterPrefab", new[] {typeof(uint), typeof(GameObject), typeof(World), typeof(BlobAssetStore)}); register.Invoke(ECSPhysicResourceManager.Instance, - new object[] {prefabID, gameObject, MGPatch.data.Item1, MGPatch.data.Item2});*/ + new object[] {prefabID, gameObject, MGPatch.data.Item1, MGPatch.data.Item2});#1# /*Console.WriteLine( "Entity: " + ECSPhysicResourceManager.Instance.GetUECSPhysicEntityPrefab(prefabID)); Console.WriteLine("Prefab ID: " + PrefabsID.DBIDMAP[500]); @@ -155,22 +157,23 @@ namespace GamecraftModdingAPI.Blocks Console.WriteLine("Collider type: " + componentData.ColliderPtr->Type); CollisionFilter filter = componentData.Value.Value.Filter; Console.WriteLine("Filter not empty: " + !filter.IsEmpty); - }*/ + }#1# //MGPatch.data.Item1.EntityManager.GetComponentData<>() gameObject.AddComponent(); gameObject.AddComponent(); Console.WriteLine("Registered prefab to physics"); + ECSGPUIResourceManager.Instance.RegisterGhostsPrefabsAtRuntime(); } else if (gameObject.name == "CTR_CommandBlock") materials = gameObject.GetComponentsInChildren()[0].sharedMaterials; } public static MethodBase TargetMethod() - { + {RobocraftX.Common.ECSGPUIResourceManager.RegisterPrefab return AccessTools.Method("RobocraftX.Common.ECSGPUIResourceManager:RegisterPrefab", new[] {typeof(uint), typeof(GameObject)}); } - } + }*/ [HarmonyPatch] public static class RMPatch @@ -180,6 +183,9 @@ namespace GamecraftModdingAPI.Blocks FasterList gos, List prefabData) { + Console.WriteLine("First game object data:\n" + gos[0].GetComponents() + .Select(c => c + " - " + c.name + " " + c.GetType()) + .Aggregate((a, b) => a + "\n" + b)); for (var index = 0; index < prefabData.Count; index++) { var data = prefabData[index]; @@ -200,12 +206,18 @@ namespace GamecraftModdingAPI.Blocks Console.WriteLine("Entity " + current + " has collider: " + entityManager.HasComponent(current)); } + + Console.WriteLine("Adding GPUI prefab"); + ((GPUInstancerPrefabManager) GPUInstancerManager.activeManagerList.Single(gim => + gim is GPUInstancerPrefabManager)) + .AddRuntimeRegisteredPrefab(gos[index].GetComponent()); + Console.WriteLine("Added GPUI prefab"); } } public static MethodBase TargetMethod() { - return AccessTools.Method("RobocraftX.Common.ECSResourceManagerUtility:RelinkEntities", + return AccessTools.Method("RobocraftX.Blocks.ECSResourceManagerUtility:RelinkEntities", new[] { typeof(World), -- 2.30.2 From 5dfb01ef0b10e3e3823031f7ab5dfb22e1968e6b Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sat, 12 Dec 2020 16:59:52 +0100 Subject: [PATCH 140/252] Use the console block's material again - IT WORKS It shows up in the inventory but crashes when selected --- GamecraftModdingAPI/Blocks/CustomBlock.cs | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/GamecraftModdingAPI/Blocks/CustomBlock.cs b/GamecraftModdingAPI/Blocks/CustomBlock.cs index 7c5d6db..2cf6b72 100644 --- a/GamecraftModdingAPI/Blocks/CustomBlock.cs +++ b/GamecraftModdingAPI/Blocks/CustomBlock.cs @@ -100,7 +100,9 @@ namespace GamecraftModdingAPI.Blocks } }*/ - public static void Prefix(ref Dictionary blocks) + private static Material[] materials; + + public static void Prefix(List prefabData, IList prefabs) { /*foreach (var block in blocks.Values.Cast()) { @@ -109,11 +111,25 @@ namespace GamecraftModdingAPI.Blocks /*var res = Addressables.LoadContentCatalogAsync("customCatalog.json"); while (!res.IsDone) yield return Yield.It;*/ + for (int i = 0; i < prefabData.Count; i++) + { + var gameObject = prefabs[i]; + switch (gameObject.name) + { + case "Cube": + gameObject.GetComponentsInChildren()[0].sharedMaterials = materials; + break; + case "CTR_CommandBlock": + materials = gameObject.GetComponentsInChildren()[0].sharedMaterials; + break; + } + } } public static MethodBase TargetMethod() { //General block registration - return AccessTools.Method("RobocraftX.Blocks.BlocksCompositionRoot:RegisterPartPrefabs"); + //return AccessTools.Method("RobocraftX.Blocks.BlocksCompositionRoot:RegisterPartPrefabs"); + return AccessTools.Method("RobocraftX.Rendering.ECSGPUIResourceManager:InitPreRegisteredPrefabs"); } } -- 2.30.2 From 78f0ea01620cbb590588380a7e3c4bb8bf359eaf Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sat, 12 Dec 2020 23:08:56 +0100 Subject: [PATCH 141/252] Use the intended method to create a CubeListData The block can be selected but not placed --- GamecraftModdingAPI/Blocks/CustomBlock.cs | 31 ++++++++++------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/GamecraftModdingAPI/Blocks/CustomBlock.cs b/GamecraftModdingAPI/Blocks/CustomBlock.cs index 2cf6b72..7a79345 100644 --- a/GamecraftModdingAPI/Blocks/CustomBlock.cs +++ b/GamecraftModdingAPI/Blocks/CustomBlock.cs @@ -111,9 +111,8 @@ namespace GamecraftModdingAPI.Blocks /*var res = Addressables.LoadContentCatalogAsync("customCatalog.json"); while (!res.IsDone) yield return Yield.It;*/ - for (int i = 0; i < prefabData.Count; i++) + foreach (var gameObject in prefabs) { - var gameObject = prefabs[i]; switch (gameObject.name) { case "Cube": @@ -251,21 +250,19 @@ namespace GamecraftModdingAPI.Blocks public static void Prefix(World physicsWorld, BlobAssetStore blobStore, IDataDB dataDB) { data = (physicsWorld, blobStore); - var blocks = dataDB.GetValues(); - blocks.Add("modded_ConsoleBlock", new CubeListData - { - cubeType = CubeType.Block, - cubeCategory = CubeCategory.ConsoleBlock, - inventoryCategory = InventoryCategory.Logic, - ID = 500, - Path = "Assets/Prefabs/Cube.prefab", //Index out of range exception: Asset failed to load (wrong path) - SpriteName = "CTR_CommandBlock", - CubeNameKey = "strConsoleBlock", - SelectableFaces = new[] {0, 1, 2, 3, 4, 5}, - GridScale = new[] {1, 1, 1}, - Mass = 1, - JointBreakAngle = 1 - }); + //RobocraftX.CR.MachineEditing.UpdateSelectedGhostBlockEngine.UpdateGhostBlock + var cld = (CubeListData) ((DataImplementor) dataDB).CreateDataObject("500", typeof(CubeListData), null); + cld.cubeType = CubeType.Block; + cld.cubeCategory = CubeCategory.General; + cld.inventoryCategory = InventoryCategory.Shapes; + cld.ID = 500; + cld.Path = "Assets/Prefabs/Cube.prefab"; //Index out of range exception: Asset failed to load (wrong path) + cld.SpriteName = "CTR_CommandBlock"; + cld.CubeNameKey = "strConsoleBlock"; + cld.SelectableFaces = new[] {0, 1, 2, 3, 4, 5}; + cld.GridScale = new[] {1, 1, 1}; + cld.Mass = 1; + cld.JointBreakAngle = 1; } public static MethodBase TargetMethod() -- 2.30.2 From 4e16f251ee6fdd74049a77a9d0f47827c0f4aa24 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sun, 13 Dec 2020 20:21:46 +0100 Subject: [PATCH 142/252] Don't use the intended method to create a CubeListData It adds it with its ID as key but the ID hasn't been set at that point It works until the second simulation start now --- GamecraftModdingAPI/Blocks/CustomBlock.cs | 37 +++++++++++++++-------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/GamecraftModdingAPI/Blocks/CustomBlock.cs b/GamecraftModdingAPI/Blocks/CustomBlock.cs index 7a79345..af8f374 100644 --- a/GamecraftModdingAPI/Blocks/CustomBlock.cs +++ b/GamecraftModdingAPI/Blocks/CustomBlock.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Linq; using System.Reflection; using DataLoader; +using GamecraftModdingAPI.Utility; using GPUInstancer; using HarmonyLib; using RobocraftX.Blocks; @@ -246,23 +247,33 @@ namespace GamecraftModdingAPI.Blocks [HarmonyPatch] public static class MGPatch { - internal static (World, BlobAssetStore) data; + internal static (World, BlobAssetStore) data; public static void Prefix(World physicsWorld, BlobAssetStore blobStore, IDataDB dataDB) { data = (physicsWorld, blobStore); //RobocraftX.CR.MachineEditing.UpdateSelectedGhostBlockEngine.UpdateGhostBlock - var cld = (CubeListData) ((DataImplementor) dataDB).CreateDataObject("500", typeof(CubeListData), null); - cld.cubeType = CubeType.Block; - cld.cubeCategory = CubeCategory.General; - cld.inventoryCategory = InventoryCategory.Shapes; - cld.ID = 500; - cld.Path = "Assets/Prefabs/Cube.prefab"; //Index out of range exception: Asset failed to load (wrong path) - cld.SpriteName = "CTR_CommandBlock"; - cld.CubeNameKey = "strConsoleBlock"; - cld.SelectableFaces = new[] {0, 1, 2, 3, 4, 5}; - cld.GridScale = new[] {1, 1, 1}; - cld.Mass = 1; - cld.JointBreakAngle = 1; + //var cld = (CubeListData) ((DataImplementor) dataDB).CreateDataObject("500", typeof(CubeListData), null); + var abd = dataDB.GetValue((int) BlockIDs.AluminiumCube); + var cld = new CubeListData + { + cubeType = CubeType.Block, + cubeCategory = CubeCategory.General, + inventoryCategory = InventoryCategory.Shapes, + ID = 500, + Path = "Assets/Prefabs/Cube.prefab", //Index out of range exception: Asset failed to load (wrong path) + SpriteName = "CTR_CommandBlock", + CubeNameKey = "strConsoleBlock", + SelectableFaces = new[] {0, 1, 2, 3, 4, 5}, + GridScale = new[] {1, 1, 1}, + Mass = 1, + JointBreakAngle = 1, + Material = abd.Material + }; + Console.WriteLine("Aluminium block data:\n" + abd); + Console.WriteLine("Material: " + abd.Material); + dataDB.GetValues().Add("500", cld); //The registration needs to happen after the ID has been set + dataDB.GetFasterValues().Add(500, cld); + //RobocraftX.ExplosionFragments.Engines.PlayFragmentExplodeEngine.PlayRigidBodyEffect } public static MethodBase TargetMethod() -- 2.30.2 From a7f6a1623144cdfd6c78b6a9a5252a9a6268b7cb Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Thu, 17 Dec 2020 02:34:36 +0100 Subject: [PATCH 143/252] Update to Gamecraft 2020.12.16.14.19 and custom block stuff - Fixed the crash on second time start - Tweaked more stuff about the block Breaking changes coming from FMOD 2.0: - Audio[int index] changed to Audio[PARAMETER_ID index] - Audio.Parameters removed --- GamecraftModdingAPI/Blocks/BlockEngine.cs | 2 +- GamecraftModdingAPI/Blocks/CustomBlock.cs | 12 +++++++-- GamecraftModdingAPI/Blocks/DampedSpring.cs | 8 +++--- GamecraftModdingAPI/Blocks/Piston.cs | 4 +-- GamecraftModdingAPI/Blocks/Servo.cs | 4 +-- GamecraftModdingAPI/Blocks/TextBlock.cs | 6 +---- .../GamecraftModdingAPI.csproj | 22 +++++++++++----- GamecraftModdingAPI/Utility/Audio.cs | 26 ++++--------------- 8 files changed, 40 insertions(+), 44 deletions(-) diff --git a/GamecraftModdingAPI/Blocks/BlockEngine.cs b/GamecraftModdingAPI/Blocks/BlockEngine.cs index a365d54..53a7254 100644 --- a/GamecraftModdingAPI/Blocks/BlockEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlockEngine.cs @@ -227,7 +227,7 @@ namespace GamecraftModdingAPI.Blocks for (int i = 0; i < joints.count; i++) { ref var joint = ref joints.buffer[i]; - if (joint.jointState == JointState.Broken) continue; + if (joint.isBroken) continue; if (joint.connectedEntityA == id) list.Add(new SimBody(joint.connectedEntityB)); else if (joint.connectedEntityB == id) list.Add(new SimBody(joint.connectedEntityA)); } diff --git a/GamecraftModdingAPI/Blocks/CustomBlock.cs b/GamecraftModdingAPI/Blocks/CustomBlock.cs index af8f374..2f33035 100644 --- a/GamecraftModdingAPI/Blocks/CustomBlock.cs +++ b/GamecraftModdingAPI/Blocks/CustomBlock.cs @@ -20,6 +20,7 @@ using UnityEngine.AddressableAssets; using BoxCollider = UnityEngine.BoxCollider; using Material = UnityEngine.Material; using Object = UnityEngine.Object; +using ScalingPermission = DataLoader.ScalingPermission; namespace GamecraftModdingAPI.Blocks { @@ -266,8 +267,15 @@ namespace GamecraftModdingAPI.Blocks SelectableFaces = new[] {0, 1, 2, 3, 4, 5}, GridScale = new[] {1, 1, 1}, Mass = 1, - JointBreakAngle = 1, - Material = abd.Material + Material = abd.Material, + scalingPermission = ScalingPermission.NonUniform, + SortIndex = 12, + DefaultColour = (byte) BlockColors.Lime, + Volume = 1f, + timeRunningCollision = TimeRunningCollision.Enabled, + IsIsolator = false, + EdgeConnectingFaces = new[] {0, 1, 2, 3, 4, 5}, + PointDataVolumeMultiplier = 1f }; Console.WriteLine("Aluminium block data:\n" + abd); Console.WriteLine("Material: " + abd.Material); diff --git a/GamecraftModdingAPI/Blocks/DampedSpring.cs b/GamecraftModdingAPI/Blocks/DampedSpring.cs index 5a5a936..51da25e 100644 --- a/GamecraftModdingAPI/Blocks/DampedSpring.cs +++ b/GamecraftModdingAPI/Blocks/DampedSpring.cs @@ -19,10 +19,10 @@ namespace GamecraftModdingAPI.Blocks /// public float MaxForce { - get => BlockEngine.GetBlockInfo(this, (DampedSpringReadOnlyStruct dsrs) => dsrs.maxForce); + get => BlockEngine.GetBlockInfo(this, (DampedSpringReadOnlyStruct dsrs) => dsrs.springFrequency); set => BlockEngine.SetBlockInfo(this, - (ref DampedSpringReadOnlyStruct dsrs, float val) => dsrs.maxForce = val, value); + (ref DampedSpringReadOnlyStruct dsrs, float val) => dsrs.springFrequency = val, value); } /// @@ -39,10 +39,10 @@ namespace GamecraftModdingAPI.Blocks /// public float Damping { - get => BlockEngine.GetBlockInfo(this, (LinearJointForcesReadOnlyStruct ljf) => ljf.dampingForceMagnitude); + get => BlockEngine.GetBlockInfo(this, (DampedSpringReadOnlyStruct ljf) => ljf.springDamping); set => BlockEngine.SetBlockInfo(this, - (ref LinearJointForcesReadOnlyStruct ljf, float val) => ljf.dampingForceMagnitude = val, value); + (ref DampedSpringReadOnlyStruct ljf, float val) => ljf.springDamping = val, value); } } } \ No newline at end of file diff --git a/GamecraftModdingAPI/Blocks/Piston.cs b/GamecraftModdingAPI/Blocks/Piston.cs index 04b3aeb..d05ac20 100644 --- a/GamecraftModdingAPI/Blocks/Piston.cs +++ b/GamecraftModdingAPI/Blocks/Piston.cs @@ -40,11 +40,11 @@ namespace GamecraftModdingAPI.Blocks ///
public float MaximumForce { - get => BlockEngine.GetBlockInfo(this, (PistonReadOnlyStruct st) => st.maxForce); + get => BlockEngine.GetBlockInfo(this, (PistonReadOnlyStruct st) => st.pistonVelocity); set { - BlockEngine.SetBlockInfo(this, (ref PistonReadOnlyStruct st, float val) => st.maxForce = val, value); + BlockEngine.SetBlockInfo(this, (ref PistonReadOnlyStruct st, float val) => st.pistonVelocity = val, value); } } } diff --git a/GamecraftModdingAPI/Blocks/Servo.cs b/GamecraftModdingAPI/Blocks/Servo.cs index 606a48a..a5dceec 100644 --- a/GamecraftModdingAPI/Blocks/Servo.cs +++ b/GamecraftModdingAPI/Blocks/Servo.cs @@ -52,11 +52,11 @@ namespace GamecraftModdingAPI.Blocks ///
public float MaximumForce { - get => BlockEngine.GetBlockInfo(this, (ServoReadOnlyStruct st) => st.maxForce); + get => BlockEngine.GetBlockInfo(this, (ServoReadOnlyStruct st) => st.servoVelocity); set { - BlockEngine.SetBlockInfo(this, (ref ServoReadOnlyStruct st, float val) => st.maxForce = val, value); + BlockEngine.SetBlockInfo(this, (ref ServoReadOnlyStruct st, float val) => st.servoVelocity = val, value); } } diff --git a/GamecraftModdingAPI/Blocks/TextBlock.cs b/GamecraftModdingAPI/Blocks/TextBlock.cs index d7d620a..3d46611 100644 --- a/GamecraftModdingAPI/Blocks/TextBlock.cs +++ b/GamecraftModdingAPI/Blocks/TextBlock.cs @@ -35,10 +35,8 @@ namespace GamecraftModdingAPI.Blocks BlockEngine.SetBlockInfo(this, (ref TextBlockDataStruct tbds, string val) => { tbds.textCurrent.Set(val); - tbds.textStored.Set(val); + tbds.textStored.Set(val, true); }, value); - BlockEngine.SetBlockInfo(this, - (ref TextBlockNetworkDataStruct st, string val) => st.newTextBlockStringContent.Set(val), value); } } @@ -54,8 +52,6 @@ namespace GamecraftModdingAPI.Blocks if (value == null) value = ""; BlockEngine.SetBlockInfo(this, (ref TextBlockDataStruct tbds, string val) => tbds.textBlockID.Set(val), value); - BlockEngine.SetBlockInfo(this, - (ref TextBlockNetworkDataStruct st, string val) => st.newTextBlockID.Set(val), value); } } } diff --git a/GamecraftModdingAPI/GamecraftModdingAPI.csproj b/GamecraftModdingAPI/GamecraftModdingAPI.csproj index c76ebd9..6324b9a 100644 --- a/GamecraftModdingAPI/GamecraftModdingAPI.csproj +++ b/GamecraftModdingAPI/GamecraftModdingAPI.csproj @@ -78,9 +78,9 @@ ..\ref\Gamecraft_Data\Managed\Facepunch.Steamworks.Win64.dll ..\..\ref\Gamecraft_Data\Managed\Facepunch.Steamworks.Win64.dll - - ..\ref\Gamecraft_Data\Managed\FMOD.dll - ..\..\ref\Gamecraft_Data\Managed\FMOD.dll + + ..\ref\Gamecraft_Data\Managed\FMODUnity.dll + ..\..\ref\Gamecraft_Data\Managed\FMODUnity.dll ..\ref\Gamecraft_Data\Managed\FullGame.dll @@ -266,6 +266,10 @@ ..\ref\Gamecraft_Data\Managed\Gamecraft.Music.dll ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Music.dll + + ..\ref\Gamecraft_Data\Managed\Gamecraft.NetStrings.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.NetStrings.dll + ..\ref\Gamecraft_Data\Managed\Gamecraft.PerformanceWarnings.dll ..\..\ref\Gamecraft_Data\Managed\Gamecraft.PerformanceWarnings.dll @@ -286,6 +290,10 @@ ..\ref\Gamecraft_Data\Managed\Gamecraft.Projectiles.dll ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Projectiles.dll + + ..\ref\Gamecraft_Data\Managed\Gamecraft.Serialization.dll + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Serialization.dll + ..\ref\Gamecraft_Data\Managed\Gamecraft.Tweaks.dll ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Tweaks.dll @@ -510,6 +518,10 @@ ..\ref\Gamecraft_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll + + ..\ref\Gamecraft_Data\Managed\RobocraftX.Multiplayer.Serializers.dll + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Multiplayer.Serializers.dll + ..\ref\Gamecraft_Data\Managed\RobocraftX.MultiplayerInput.dll ..\..\ref\Gamecraft_Data\Managed\RobocraftX.MultiplayerInput.dll @@ -554,10 +566,6 @@ ..\ref\Gamecraft_Data\Managed\RobocraftX.SaveGameDialog.dll ..\..\ref\Gamecraft_Data\Managed\RobocraftX.SaveGameDialog.dll - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Serializers.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Serializers.dll - ..\ref\Gamecraft_Data\Managed\RobocraftX.Services.dll ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Services.dll diff --git a/GamecraftModdingAPI/Utility/Audio.cs b/GamecraftModdingAPI/Utility/Audio.cs index 9d227a8..b2566f2 100644 --- a/GamecraftModdingAPI/Utility/Audio.cs +++ b/GamecraftModdingAPI/Utility/Audio.cs @@ -43,40 +43,24 @@ namespace GamecraftModdingAPI.Utility { get { - sound.getParameterValue(key, out float val, out float finalVal); + sound.getParameterByName(key, out float val, out float finalVal); return val; } - set => sound.setParameterValue(key, value); + set => sound.setParameterByName(key, value); } - public float this[int index] + public float this[PARAMETER_ID index] { get { - sound.getParameterValueByIndex(index, out float val, out float finalVal); + sound.getParameterByID(index, out float val, out float finalVal); return val; } - set => sound.setParameterValueByIndex(index, value); + set => sound.setParameterByID(index, value); } - public string[] Parameters - { - get - { - sound.getParameterCount(out int count); - string[] parameters = new string[count]; - for (int i = 0; i < count; i++) - { - sound.getParameterByIndex(i, out ParameterInstance param); - param.getDescription(out PARAMETER_DESCRIPTION desc); - parameters[i] = desc.name; - } - return parameters; - } - } - public float3 Position { get -- 2.30.2 From 712ece86dbf4c462da1e5ba49f2e99713e19a009 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Thu, 17 Dec 2020 20:20:46 +0100 Subject: [PATCH 144/252] Add custom block registration functionality and a test --- GamecraftModdingAPI/Block.cs | 2 +- GamecraftModdingAPI/Blocks/CustomBlock.cs | 328 +++++------------- .../Blocks/CustomBlockAttribute.cs | 85 +++++ .../Tests/GamecraftModdingAPIPluginTest.cs | 33 +- 4 files changed, 204 insertions(+), 244 deletions(-) create mode 100644 GamecraftModdingAPI/Blocks/CustomBlockAttribute.cs diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index 524847d..4aa0a30 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -213,7 +213,7 @@ namespace GamecraftModdingAPI throw new BlockTypeException("The block has the wrong group! The type is " + GetType() + " while the group is " + id.groupID); } - else if (type != typeof(Block)) + else if (type != typeof(Block) && !typeof(CustomBlock).IsAssignableFrom(type)) Logging.LogWarning($"Unknown block type! Add {type} to the dictionary."); } diff --git a/GamecraftModdingAPI/Blocks/CustomBlock.cs b/GamecraftModdingAPI/Blocks/CustomBlock.cs index 2f33035..331552c 100644 --- a/GamecraftModdingAPI/Blocks/CustomBlock.cs +++ b/GamecraftModdingAPI/Blocks/CustomBlock.cs @@ -1,9 +1,11 @@ using System; using System.Collections; using System.Collections.Generic; +using System.IO; using System.Linq; using System.Reflection; using DataLoader; +using GamecraftModdingAPI.App; using GamecraftModdingAPI.Utility; using GPUInstancer; using HarmonyLib; @@ -11,8 +13,8 @@ using RobocraftX.Blocks; using RobocraftX.Common; using RobocraftX.Rendering; using Svelto.DataStructures; +using Svelto.ECS; using Svelto.Tasks; -using Unity.Entities; using Unity.Entities.Conversion; using Unity.Physics; using UnityEngine; @@ -24,264 +26,113 @@ using ScalingPermission = DataLoader.ScalingPermission; namespace GamecraftModdingAPI.Blocks { - public class CustomBlock + public class CustomBlock : Block { private static ushort nextID = 500; - public static void RegisterCustomBlock(string path) + /// + /// Key: Prefab path + /// + private static Dictionary _customBlocks = new Dictionary(); + + private static bool _canRegister = true; + + /// + /// Register a custom block type. Call it as soon as possible (in OnApplicationStart()).
+ /// You need a Unity project with Addressables and Havok installed and need a prefab added as an addressable asset. + /// Build the addressables and the project and copy the catalog.json from StreamingAssets, you'll need to reference this file. + /// Also copy the asset files from the subfolder to the same path in the game. + ///
+ /// The custom block type + public static void RegisterCustomBlock() where T : CustomBlock { - var prefabData = new List(); - //category ID: - //0 - regular - //1 - joint - //2 - controller - uint prefabId = PrefabsID.FetchNewPrefabID(PrefabsID.GenerateDBID(0, nextID++)); - prefabData.Add(new PrefabData() - { - prefabName = path, - prefabId = prefabId - }); - var loadTask = Addressables.LoadAssetAsync(path); - AccessTools.Method("RobocraftX.Common.ECSGPUIResourceManager:RegisterPrefab") - .Invoke(ECSGPUIResourceManager.Instance, new object[] {prefabId, loadTask.Result, 1}); + if (!_canRegister) + throw new InvalidOperationException( + "It's too late to register custom blocks. Register it before the game starts loading."); + var type = typeof(T); + var attr = type.GetCustomAttribute(); + if (attr == null) + throw new ArgumentException("The custom block type is missing the CustomBlock annotation"); + string typeName = type.FullName ?? + throw new ArgumentException("The given block type doesn't have a concrete full name."); + if (!File.Exists(attr.Catalog)) + throw new FileNotFoundException("The specified catalog cannot be found for " + typeName); + _customBlocks.Add(attr.AssetPath, type); + Logging.MetaDebugLog("Registered custom block type " + typeName); } + public CustomBlock(EGID id) : base(id) + { + if (id.groupID != Group) + throw new BlockTypeException("The block is not a custom block! It has a group of " + id.groupID); + } + + public CustomBlock(uint id) : this(new EGID(id, Group)) + { + } + + public static ExclusiveGroup Group { get; } = new ExclusiveGroup("Custom block"); + [HarmonyPatch] public static class Patch { - /*public static IEnumerable Transpiler(IEnumerable instructions) - { - var list = new List(instructions); - try - { - *int index = -1; - CodeInstruction loadTask = null; - for (var i = 0; i < list.Count - 1; i++) - { - if (list[i].opcode == OpCodes.Ldfld - && ((string) list[i].operand).Contains("renderingWorld") - && list[i + 1].opcode == OpCodes.Brfalse_S) - index = i - 1; //It loads 'this' first - if (list[i].opcode == OpCodes.Ldflda - && ((string) list[i].operand).Contains("loadTask")) - loadTask = new CodeInstruction(list[i]); - }* - - var array = new[] - { - //Set Yield.It to be returned (current) - new CodeInstruction(OpCodes.Ldarg_0), // this - new CodeInstruction(OpCodes.Ldsfld, - typeof(Yield).GetField("It", BindingFlags.Public | BindingFlags.Static)), - new CodeInstruction(OpCodes.Stfld, "object RobocraftX.Common.ECSResourceManagerUtility/'d__0'::'<>2__current'"), - - //Set which yield return we're at (state) - new CodeInstruction(OpCodes.Ldarg_0), // this - new CodeInstruction(OpCodes.Ldc_I4_1), - //new CodeInstruction(OpCodes.Call, ((Action)AddInfo).Method) - }; - list.InsertRange(index, array); - * - IL_00ad: ldarg.0 // this - IL_00ae: ldsfld class [Svelto.Tasks]Svelto.Tasks.Yield [Svelto.Tasks]Svelto.Tasks.Yield::It - IL_00b3: stfld object RobocraftX.Common.ECSResourceManagerUtility/'d__0'::'<>2__current' - - IL_0072: ldarg.0 // this - IL_0073: ldnull - IL_0074: stfld object RobocraftX.Common.ECSResourceManagerUtility/'d__0'::'<>2__current' - IL_0079: ldarg.0 // this - IL_007a: ldc.i4.2 - IL_007b: stfld object RobocraftX.Common.ECSResourceManagerUtility/'d__0'::'<>1__state' - IL_0080: ldc.i4.1 - IL_0081: ret - * - yield break; - } - catch (Exception e) - { - Logging.LogWarning("Failed to inject AddInfo method for the debug display!\n" + e); - } - }*/ - private static Material[] materials; public static void Prefix(List prefabData, IList prefabs) { - /*foreach (var block in blocks.Values.Cast()) + for (var index = 0; index < prefabs.Count; index++) { - Console.WriteLine("Block info: " + block); - }*/ + if (prefabData[index].prefabName == "ConsoleBlock") + materials = prefabs[index].GetComponentsInChildren()[0].sharedMaterials; + } - /*var res = Addressables.LoadContentCatalogAsync("customCatalog.json"); - while (!res.IsDone) yield return Yield.It;*/ - foreach (var gameObject in prefabs) + for (var index = 0; index < prefabs.Count; index++) { - switch (gameObject.name) - { - case "Cube": - gameObject.GetComponentsInChildren()[0].sharedMaterials = materials; - break; - case "CTR_CommandBlock": - materials = gameObject.GetComponentsInChildren()[0].sharedMaterials; - break; - } + if (_customBlocks.ContainsKey(prefabData[index].prefabName)) //This is a custom block + prefabs[index].GetComponentsInChildren()[0].sharedMaterials = materials; } } public static MethodBase TargetMethod() { //General block registration - //return AccessTools.Method("RobocraftX.Blocks.BlocksCompositionRoot:RegisterPartPrefabs"); return AccessTools.Method("RobocraftX.Rendering.ECSGPUIResourceManager:InitPreRegisteredPrefabs"); } } - /*[HarmonyPatch] - public static class RendererPatch - { - private static Material[] materials; - public static void Prefix(uint prefabID, GameObject gameObject) - { - Console.WriteLine("ID: " + prefabID + " - Name: " + gameObject.name); - if (gameObject.name == "Cube") - { - //Console.WriteLine("Length: " + gameObject.GetComponentsInChildren().Length); - if (materials != null) - gameObject.GetComponentsInChildren()[0].sharedMaterials = materials; - /*ECSGPUIResourceManager.Instance.RegisterGhostsPrefabsAtRuntime( - new[] {new PrefabData {prefabId = prefabID, prefabName = "Assets/Prefabs/Cube.prefab"}}, - new List {gameObject});#1# - GameObject go = Object.Instantiate(gameObject); - go.SetActive(false); - AccessTools.Method("RobocraftX.Rendering.ECSGPUIResourceManager:RegisterNewPrefabAtRuntime") - .Invoke(ECSGPUIResourceManager.Instance, - new object[] {(uint) ((int) prefabID * 2 + 1), gameObject, true}); - //ECSGPUIResourceManager.Instance.RegisterNewPrefabAtRuntime((uint) ((int)prefabID * 2 + 1), gameObject, true); //.isOcclusionCulling = false; - UnityEngine.Object.Destroy(gameObject); - GPUInstancerAPI.AddInstancesToPrefabPrototypeAtRuntime(ECSGPUIResourceManager.Instance.prefabManager, - gameObject.GetComponent().prefabPrototype, new[] {gameObject}); - Console.WriteLine("Registered prefab to instancer"); - - /*var register = AccessTools.Method("RobocraftX.Common.ECSPhysicResourceManager:RegisterPrefab", - new[] {typeof(uint), typeof(GameObject), typeof(World), typeof(BlobAssetStore)}); - register.Invoke(ECSPhysicResourceManager.Instance, - new object[] {prefabID, gameObject, MGPatch.data.Item1, MGPatch.data.Item2});#1# - /*Console.WriteLine( - "Entity: " + ECSPhysicResourceManager.Instance.GetUECSPhysicEntityPrefab(prefabID)); - Console.WriteLine("Prefab ID: " + PrefabsID.DBIDMAP[500]); - PhysicsCollider componentData = MGPatch.data.Item1.EntityManager.GetComponentData(ECSPhysicResourceManager.Instance.GetUECSPhysicEntityPrefab(prefabID)); - Console.WriteLine("Collider valid: " + componentData.IsValid); - unsafe - { - Console.WriteLine("Collider type: " + componentData.ColliderPtr->Type); - CollisionFilter filter = componentData.Value.Value.Filter; - Console.WriteLine("Filter not empty: " + !filter.IsEmpty); - }#1# - //MGPatch.data.Item1.EntityManager.GetComponentData<>() - gameObject.AddComponent(); - gameObject.AddComponent(); - Console.WriteLine("Registered prefab to physics"); - ECSGPUIResourceManager.Instance.RegisterGhostsPrefabsAtRuntime(); - } - else if (gameObject.name == "CTR_CommandBlock") - materials = gameObject.GetComponentsInChildren()[0].sharedMaterials; - } - - public static MethodBase TargetMethod() - {RobocraftX.Common.ECSGPUIResourceManager.RegisterPrefab - return AccessTools.Method("RobocraftX.Common.ECSGPUIResourceManager:RegisterPrefab", - new[] {typeof(uint), typeof(GameObject)}); - } - }*/ - [HarmonyPatch] - public static class RMPatch + public static class CubeRegistrationPatch { - public static void Prefix(World physicsWorld, - GameObjectConversionSystem getExistingSystem, - FasterList gos, - List prefabData) + public static void Prefix(IDataDB dataDB) { - Console.WriteLine("First game object data:\n" + gos[0].GetComponents() - .Select(c => c + " - " + c.name + " " + c.GetType()) - .Aggregate((a, b) => a + "\n" + b)); - for (var index = 0; index < prefabData.Count; index++) + //var abd = dataDB.GetValue((int) BlockIDs.AluminiumCube); + foreach (var (key, type) in _customBlocks) { - var data = prefabData[index]; - if (!data.prefabName.EndsWith("Cube.prefab")) continue; - //getExistingSystem.DeclareLinkedEntityGroup(gos[index]); - /*Entity entity = GameObjectConversionUtility.ConvertGameObjectHierarchy(gos[index], - GameObjectConversionSettings.FromWorld(physicsWorld, MGPatch.data.Item2));*/ - Console.WriteLine("Transform: " + gos[index].transform.childCount); - Entity primaryEntity = getExistingSystem.GetPrimaryEntity(gos[index]); - MultiListEnumerator entities = getExistingSystem.GetEntities(gos[index]); - Console.WriteLine("ID: " + data.prefabId + " - Name: " + data.prefabName); - Console.WriteLine("Primary entity: " + primaryEntity); - EntityManager entityManager = physicsWorld.EntityManager; - Console.WriteLine("Has collider: " + entityManager.HasComponent(primaryEntity)); - while (entities.MoveNext()) - { - Entity current = entities.Current; - Console.WriteLine("Entity " + current + " has collider: " + - entityManager.HasComponent(current)); - } - - Console.WriteLine("Adding GPUI prefab"); - ((GPUInstancerPrefabManager) GPUInstancerManager.activeManagerList.Single(gim => - gim is GPUInstancerPrefabManager)) - .AddRuntimeRegisteredPrefab(gos[index].GetComponent()); - Console.WriteLine("Added GPUI prefab"); + var attr = type.GetCustomAttribute(); + var cld = new CubeListData + { //"Assets/Prefabs/Cube.prefab" - "CTR_CommandBlock" - "strConsoleBlock" + cubeType = attr.Type, + cubeCategory = attr.Category, + inventoryCategory = attr.InventoryCategory, + ID = nextID++, + Path = attr.AssetPath, //Index out of range exception: Asset failed to load (wrong path) + SpriteName = attr.SpriteName, + CubeNameKey = attr.NameKey, + CubeDescriptionKey = attr.DescKey, + SelectableFaces = new[] {0, 1, 2, 3, 4, 5}, + GridScale = new[] {5, 5, 5}, + Mass = attr.Mass, + Material = attr.Material, + scalingPermission = attr.ScalingPermission, + SortIndex = attr.SortIndex, + DefaultColour = attr.DefaultColor.Index, + Volume = attr.Volume, + EdgeConnectingFaces = new[] {0, 1, 2, 3, 4, 5}, + PointDataVolumeMultiplier = 1f + }; + dataDB.GetValues().Add(cld.ID.ToString(), cld); //The registration needs to happen after the ID has been set + dataDB.GetFasterValues().Add(cld.ID, cld); //So can't use the builtin method to create a CubeListData } - } - public static MethodBase TargetMethod() - { - return AccessTools.Method("RobocraftX.Blocks.ECSResourceManagerUtility:RelinkEntities", - new[] - { - typeof(World), - typeof(GameObjectConversionSystem), - typeof(FasterList), - typeof(List) - }); - } - } - - [HarmonyPatch] - public static class MGPatch - { - internal static (World, BlobAssetStore) data; - public static void Prefix(World physicsWorld, BlobAssetStore blobStore, IDataDB dataDB) - { - data = (physicsWorld, blobStore); - //RobocraftX.CR.MachineEditing.UpdateSelectedGhostBlockEngine.UpdateGhostBlock - //var cld = (CubeListData) ((DataImplementor) dataDB).CreateDataObject("500", typeof(CubeListData), null); - var abd = dataDB.GetValue((int) BlockIDs.AluminiumCube); - var cld = new CubeListData - { - cubeType = CubeType.Block, - cubeCategory = CubeCategory.General, - inventoryCategory = InventoryCategory.Shapes, - ID = 500, - Path = "Assets/Prefabs/Cube.prefab", //Index out of range exception: Asset failed to load (wrong path) - SpriteName = "CTR_CommandBlock", - CubeNameKey = "strConsoleBlock", - SelectableFaces = new[] {0, 1, 2, 3, 4, 5}, - GridScale = new[] {1, 1, 1}, - Mass = 1, - Material = abd.Material, - scalingPermission = ScalingPermission.NonUniform, - SortIndex = 12, - DefaultColour = (byte) BlockColors.Lime, - Volume = 1f, - timeRunningCollision = TimeRunningCollision.Enabled, - IsIsolator = false, - EdgeConnectingFaces = new[] {0, 1, 2, 3, 4, 5}, - PointDataVolumeMultiplier = 1f - }; - Console.WriteLine("Aluminium block data:\n" + abd); - Console.WriteLine("Material: " + abd.Material); - dataDB.GetValues().Add("500", cld); //The registration needs to happen after the ID has been set - dataDB.GetFasterValues().Add(500, cld); - //RobocraftX.ExplosionFragments.Engines.PlayFragmentExplodeEngine.PlayRigidBodyEffect + _canRegister = false; } public static MethodBase TargetMethod() @@ -292,16 +143,15 @@ namespace GamecraftModdingAPI.Blocks public static IEnumerator Prep() { //TODO: Don't let the game load until this finishes - Console.WriteLine("Loading custom catalog..."); - var res = Addressables.LoadContentCatalogAsync("customCatalog.json"); - while (!res.IsDone) yield return Yield.It; - Console.WriteLine("Loaded custom catalog: " + res.Result.LocatorId); - Addressables.AddResourceLocator(res.Result); - /*Console.WriteLine("Loading Cube asset..."); - var loadTask = Addressables.LoadAssetAsync("Assets/Cube.prefab"); - while (!loadTask.IsDone) yield return Yield.It; - Console.WriteLine("Exception: "+loadTask.OperationException); - Console.WriteLine("Result: " + loadTask.Result.name);*/ + foreach (var type in _customBlocks.Values) + { + var attr = type.GetCustomAttribute(); + Logging.Log("Loading custom block catalog " + attr.Catalog); + var res = Addressables.LoadContentCatalogAsync(attr.Catalog); + while (!res.IsDone) yield return Yield.It; + Logging.Log("Loaded custom block catalog: " + res.Result.LocatorId); + Addressables.AddResourceLocator(res.Result); + } } } } \ No newline at end of file diff --git a/GamecraftModdingAPI/Blocks/CustomBlockAttribute.cs b/GamecraftModdingAPI/Blocks/CustomBlockAttribute.cs new file mode 100644 index 0000000..7c7669f --- /dev/null +++ b/GamecraftModdingAPI/Blocks/CustomBlockAttribute.cs @@ -0,0 +1,85 @@ +using System; +using DataLoader; + +namespace GamecraftModdingAPI.Blocks +{ + [AttributeUsage(AttributeTargets.Class)] + public class CustomBlockAttribute : Attribute + { + /// + /// Custom block attribute necessary for configuration. + /// + /// File path to the catalog.json that holds asset references for the custom block + /// The path/address to the block's prefab specified in Unity + /// The translation key for the block's name + /// The path to the inventory sprite for the block, console block by default + /// The translation key for the block's description + public CustomBlockAttribute(string catalog, string assetPath, string nameKey, + string spriteName = "CTR_CommandBlock", string descKey = "") + { + Catalog = catalog; + AssetPath = assetPath; + SpriteName = spriteName; + NameKey = nameKey; + DescKey = descKey; + } + + /// + /// The location of the catalog.json file used to find assets for this block. + /// + public string Catalog { get; } + /// + /// The asset path/address for the block's prefab. + /// + public string AssetPath { get; } + /// + /// The name of the sprite used in the inventory. + /// + public string SpriteName { get; } + /// + /// The translation key for the block's name. + /// + public string NameKey { get; } + /// + /// The translation key for the block's description. + /// + public string DescKey { get; } + + /// + /// The block's type - block, joint, light. + /// + public CubeType Type { get; set; } = CubeType.Block; + /// + /// The block's category, so it's treated as a pre-existing functional block. + /// + public CubeCategory Category { get; set; } = CubeCategory.General; + /// + /// The block's inventory category. + /// + public InventoryCategory InventoryCategory { get; set; } = InventoryCategory.Shapes; + /// + /// The block's mass. + /// + public float Mass { get; set; } = 1f; + /// + /// The key of the material properties this block should use. + /// + public string Material { get; set; } = "Aluminium"; + /// + /// The scaling permission determining what scaling is allowed on this block. + /// + public ScalingPermission ScalingPermission { get; set; } + /// + /// The sort index in the inventory. + /// + public int SortIndex { get; set; } + /// + /// The default color of the block when placed. + /// + public BlockColor DefaultColor { get; set; } + /// + /// The volume of the block. + /// + public float Volume { get; set; } = 1f; + } +} \ No newline at end of file diff --git a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs index 268fdb2..02c7d2c 100644 --- a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs +++ b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; +using System.IO; using System.Linq; using System.Reflection; using System.Reflection.Emit; @@ -291,6 +292,13 @@ namespace GamecraftModdingAPI.Tests .BlockGroup = group; }).Build(); + CommandBuilder.Builder("placeCustomBlock", "Places a custom block, needs a custom catalog and assets.") + .Action((float x, float y, float z) => + { + Logging.CommandLog("Block placed: " + + Block.PlaceNew((BlockIDs) 500, new float3(0, 0, 0))); + }).Build(); + GameClient.SetDebugInfo("InstalledMods", InstalledMods); Block.Placed += (sender, args) => Logging.MetaDebugLog("Placed block " + args.Type + " with ID " + args.ID); @@ -361,11 +369,16 @@ namespace GamecraftModdingAPI.Tests Log.Output("Submitted: " + Window.selected.submittedCode); }) .Build(); - /*JObject o1 = JObject.Parse(File.ReadAllText(@"Gamecraft_Data\StreamingAssets\aa\Windows\catalog.json")); - JObject o2 = JObject.Parse(File.ReadAllText(@"customCatalog.json")); - o1.Merge(o2, new JsonMergeSettings {MergeArrayHandling = MergeArrayHandling.Union}); - File.WriteAllText(@"Gamecraft_Data\StreamingAssets\aa\Windows\catalog.json", o1.ToString());*/ CustomBlock.Prep().RunOn(ExtraLean.UIScheduler); + try + { + CustomBlock.RegisterCustomBlock(); + Logging.MetaDebugLog("Registered test custom block"); + } + catch (FileNotFoundException) + { + Logging.MetaDebugLog("Test custom block catalog not found"); + } #if TEST TestRoot.RunTests(); @@ -429,6 +442,18 @@ namespace GamecraftModdingAPI.Tests return ((Action) MinimumSpecsCheck.CheckRequirementsMet).Method; } } + + [CustomBlock("customCatalog.json", "Assets/Prefabs/Cube.prefab", "strAluminiumCube", SortIndex = 12)] + public class TestBlock : CustomBlock + { + public TestBlock(EGID id) : base(id) + { + } + + public TestBlock(uint id) : base(id) + { + } + } } #endif } -- 2.30.2 From 6a9073919771739c32c3eb1ea96b3cd23326b48b Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sat, 19 Dec 2020 21:43:49 +0100 Subject: [PATCH 145/252] Attempt to use custom cube category --- GamecraftModdingAPI/Blocks/CustomBlock.cs | 54 ++++++++++++------- GamecraftModdingAPI/Main.cs | 5 +- .../Tests/GamecraftModdingAPIPluginTest.cs | 1 - 3 files changed, 39 insertions(+), 21 deletions(-) diff --git a/GamecraftModdingAPI/Blocks/CustomBlock.cs b/GamecraftModdingAPI/Blocks/CustomBlock.cs index 331552c..15cfb15 100644 --- a/GamecraftModdingAPI/Blocks/CustomBlock.cs +++ b/GamecraftModdingAPI/Blocks/CustomBlock.cs @@ -2,27 +2,19 @@ using System.Collections; using System.Collections.Generic; using System.IO; -using System.Linq; using System.Reflection; -using DataLoader; -using GamecraftModdingAPI.App; -using GamecraftModdingAPI.Utility; -using GPUInstancer; using HarmonyLib; + +using DataLoader; using RobocraftX.Blocks; -using RobocraftX.Common; using RobocraftX.Rendering; -using Svelto.DataStructures; using Svelto.ECS; using Svelto.Tasks; -using Unity.Entities.Conversion; -using Unity.Physics; using UnityEngine; using UnityEngine.AddressableAssets; -using BoxCollider = UnityEngine.BoxCollider; using Material = UnityEngine.Material; -using Object = UnityEngine.Object; -using ScalingPermission = DataLoader.ScalingPermission; + +using GamecraftModdingAPI.Utility; namespace GamecraftModdingAPI.Blocks { @@ -62,18 +54,18 @@ namespace GamecraftModdingAPI.Blocks public CustomBlock(EGID id) : base(id) { - if (id.groupID != Group) - throw new BlockTypeException("The block is not a custom block! It has a group of " + id.groupID); + /*if (id.groupID != Group) + throw new BlockTypeException("The block is not a custom block! It has a group of " + id.groupID);*/ } - public CustomBlock(uint id) : this(new EGID(id, Group)) + public CustomBlock(uint id) : base(id) { } - public static ExclusiveGroup Group { get; } = new ExclusiveGroup("Custom block"); + //public static ExclusiveGroup Group { get; } = new ExclusiveGroup("Custom block"); [HarmonyPatch] - public static class Patch + public static class MaterialCopyPatch { private static Material[] materials; @@ -110,6 +102,7 @@ namespace GamecraftModdingAPI.Blocks var cld = new CubeListData { //"Assets/Prefabs/Cube.prefab" - "CTR_CommandBlock" - "strConsoleBlock" cubeType = attr.Type, + //cubeCategory = (CubeCategory) 1000, cubeCategory = attr.Category, inventoryCategory = attr.InventoryCategory, ID = nextID++, @@ -141,8 +134,24 @@ namespace GamecraftModdingAPI.Blocks } } - public static IEnumerator Prep() - { //TODO: Don't let the game load until this finishes + /*[HarmonyPatch] - The block has no collision even in simulation if using a custom category + private static class FactorySetupPatch + { + public static void Prefix(BlockEntityFactory __instance) + { + var builders = (Dictionary) + AccessTools.Field(__instance.GetType(), "_blockBuilders").GetValue(__instance); + builders.Add((CubeCategory) 1000, new BlockBuilder(Group)); + } + + public static MethodBase TargetMethod() + { + return AccessTools.Method(typeof(BlockEntityFactory), "ParseDataDB"); + } + }*/ + + internal static IEnumerator Prepare() + { //Should be pretty quick foreach (var type in _customBlocks.Values) { var attr = type.GetCustomAttribute(); @@ -153,5 +162,12 @@ namespace GamecraftModdingAPI.Blocks Addressables.AddResourceLocator(res.Result); } } + + /*internal static void OnBlockFactoryObtained(BlockEntityFactory factory) + { + var builders = (Dictionary) + AccessTools.Field(factory.GetType(), "_blockBuilders").GetValue(factory); + builders.Add((CubeCategory) 1000, new BlockBuilder(Group)); + }*/ } } \ No newline at end of file diff --git a/GamecraftModdingAPI/Main.cs b/GamecraftModdingAPI/Main.cs index 584ae90..775670f 100644 --- a/GamecraftModdingAPI/Main.cs +++ b/GamecraftModdingAPI/Main.cs @@ -1,12 +1,14 @@ using System; using System.Reflection; -using GamecraftModdingAPI.Blocks; using HarmonyLib; using RobocraftX; +using RobocraftX.Schedulers; using RobocraftX.Services; using Svelto.Context; +using Svelto.Tasks.ExtraLean; +using GamecraftModdingAPI.Blocks; using GamecraftModdingAPI.Utility; using GamecraftModdingAPI.Events; using GamecraftModdingAPI.Tasks; @@ -89,6 +91,7 @@ namespace GamecraftModdingAPI AsyncUtils.Init(); GamecraftModdingAPI.App.Client.Init(); GamecraftModdingAPI.App.Game.Init(); + CustomBlock.Prepare().RunOn(ExtraLean.UIScheduler); Logging.MetaLog($"{currentAssembly.GetName().Name} v{currentAssembly.GetName().Version} initialized"); } diff --git a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs index 02c7d2c..009c368 100644 --- a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs +++ b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs @@ -369,7 +369,6 @@ namespace GamecraftModdingAPI.Tests Log.Output("Submitted: " + Window.selected.submittedCode); }) .Build(); - CustomBlock.Prep().RunOn(ExtraLean.UIScheduler); try { CustomBlock.RegisterCustomBlock(); -- 2.30.2 From 879901f4b9efa95313e19f0ce5e2f0f4c830ec58 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sun, 20 Dec 2020 00:05:02 +0100 Subject: [PATCH 146/252] Add new block IDs, a property, 2 tests and fixes --- GamecraftModdingAPI/Block.cs | 2 +- GamecraftModdingAPI/Blocks/BlockIDs.cs | 26 +++++++++++----- GamecraftModdingAPI/Blocks/BlockTests.cs | 36 +++++++++++++++++----- GamecraftModdingAPI/Blocks/DampedSpring.cs | 11 +++++++ GamecraftModdingAPI/Tests/Assert.cs | 19 ++++++++++++ 5 files changed, 77 insertions(+), 17 deletions(-) diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index 4aa0a30..513ad5e 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -171,7 +171,7 @@ namespace GamecraftModdingAPI egid = new EGID(id, group.Value); if (typeToGroup.TryGetValue(type, out var gr) && gr.All(egs => egs != group.Value)) //If this subclass has a specific group, then use that - so Block should still work - throw new BlockTypeException($"Incompatible block type! Type {type.Name} belongs to group {gr.Select(g => g.ToString()).Aggregate((a, b) => a + ", " + b)} instead of {group.Value}"); + throw new BlockTypeException($"Incompatible block type! Type {type.Name} belongs to group {gr.Select(g => ((uint)g).ToString()).Aggregate((a, b) => a + ", " + b)} instead of {(uint)group.Value}"); } if (initializers.TryGetValue(type, out var func)) diff --git a/GamecraftModdingAPI/Blocks/BlockIDs.cs b/GamecraftModdingAPI/Blocks/BlockIDs.cs index 9591ae2..ff08b51 100644 --- a/GamecraftModdingAPI/Blocks/BlockIDs.cs +++ b/GamecraftModdingAPI/Blocks/BlockIDs.cs @@ -71,8 +71,9 @@ namespace GamecraftModdingAPI.Blocks GlassConeSegment, GlassCylinder, GlassSphere, - Lever, //63 - two IDs skipped - PlayerSpawn = 66, //Crashes without special handling + Lever, //63 + WoodenSlatsDoor = 65, + PlayerSpawn, //Crashes without special handling SmallSpawn, MediumSpawn, LargeSpawn, @@ -86,10 +87,17 @@ namespace GamecraftModdingAPI.Blocks DampedSpring, ServoPiston, StepperPiston, - PneumaticPiston, + PneumaticPiston, //80 PneumaticHinge, - PneumaticAxle, //82 - PilotSeat = 90, //Might crash + PneumaticAxle, + WindowedDoor, + Bench, + Chair, + Stool, + DampedHingeSpring, + PlainGlassDoor, + PlainWoodenDoor, + PilotSeat, //Might crash PassengerSeat, PilotControls, GrassCube, @@ -148,8 +156,9 @@ namespace GamecraftModdingAPI.Blocks WoodCylinder, WoodHemisphere, WoodSphere, - BrickCube, //149 - BrickSlicedCube = 151, + BrickCube, + DampedAxleSpring, //150 + BrickSlicedCube, BrickSlope, BrickCorner, ConcreteCube, @@ -355,6 +364,7 @@ namespace GamecraftModdingAPI.Blocks HexNetCylinder = 797, HexNetHemisphere, HexNetSphere, - HexNetTubeCorner //800 + HexNetTubeCorner, //800 + CenterOfMassBlock = 1346 } } \ No newline at end of file diff --git a/GamecraftModdingAPI/Blocks/BlockTests.cs b/GamecraftModdingAPI/Blocks/BlockTests.cs index 5447f6c..dbcd39e 100644 --- a/GamecraftModdingAPI/Blocks/BlockTests.cs +++ b/GamecraftModdingAPI/Blocks/BlockTests.cs @@ -1,6 +1,7 @@ using System; using Gamecraft.Wires; +using Unity.Mathematics; using GamecraftModdingAPI; using GamecraftModdingAPI.Tests; @@ -60,19 +61,31 @@ namespace GamecraftModdingAPI.Blocks Assert.Errorless(() => { b = newBlock.Specialise(); }, "Block.Specialize() raised an exception: ", "Block.Specialize() completed without issue."); if (!Assert.NotNull(b, "Block.Specialize() returned null, possibly because it failed silently.", "Specialized Piston is not null.")) return; if (!Assert.CloseTo(b.MaximumExtension, 1.01f, $"Piston.MaximumExtension {b.MaximumExtension} does not equal default value, possibly because it failed silently.", "Piston.MaximumExtension is close enough to default.")) return; - if (!Assert.CloseTo(b.MaximumForce, 750f, $"Piston.MaximumForce {b.MaximumForce} does not equal default value, possibly because it failed silently.", "Piston.MaximumForce is close enough to default.")) return; + if (!Assert.CloseTo(b.MaximumForce, 1.0f, $"Piston.MaximumForce {b.MaximumForce} does not equal default value, possibly because it failed silently.", "Piston.MaximumForce is close enough to default.")) return; } - [APITestCase(TestType.EditMode)] + [APITestCase(TestType.EditMode)] public static void TestServo() { - Block newBlock = Block.PlaceNew(BlockIDs.ServoAxle, Unity.Mathematics.float3.zero + 1); - Servo b = null; // Note: the assignment operation is a lambda, which slightly confuses the compiler - Assert.Errorless(() => { b = newBlock.Specialise(); }, "Block.Specialize() raised an exception: ", "Block.Specialize() completed without issue."); - if (!Assert.NotNull(b, "Block.Specialize() returned null, possibly because it failed silently.", "Specialized Servo is not null.")) return; - if (!Assert.CloseTo(b.MaximumAngle, 180f, $"Servo.MaximumAngle {b.MaximumAngle} does not equal default value, possibly because it failed silently.", "Servo.MaximumAngle is close enough to default.")) return; + Block newBlock = Block.PlaceNew(BlockIDs.ServoAxle, Unity.Mathematics.float3.zero + 1); + Servo b = null; // Note: the assignment operation is a lambda, which slightly confuses the compiler + Assert.Errorless(() => { b = newBlock.Specialise(); }, "Block.Specialize() raised an exception: ", "Block.Specialize() completed without issue."); + if (!Assert.NotNull(b, "Block.Specialize() returned null, possibly because it failed silently.", "Specialized Servo is not null.")) return; + if (!Assert.CloseTo(b.MaximumAngle, 180f, $"Servo.MaximumAngle {b.MaximumAngle} does not equal default value, possibly because it failed silently.", "Servo.MaximumAngle is close enough to default.")) return; if (!Assert.CloseTo(b.MinimumAngle, -180f, $"Servo.MinimumAngle {b.MinimumAngle} does not equal default value, possibly because it failed silently.", "Servo.MinimumAngle is close enough to default.")) return; - if (!Assert.CloseTo(b.MaximumForce, 750f, $"Servo.MaximumForce {b.MaximumForce} does not equal default value, possibly because it failed silently.", "Servo.MaximumForce is close enough to default.")) return; + if (!Assert.CloseTo(b.MaximumForce, 60f, $"Servo.MaximumForce {b.MaximumForce} does not equal default value, possibly because it failed silently.", "Servo.MaximumForce is close enough to default.")) return; + } + + [APITestCase(TestType.EditMode)] + public static void TestDampedSpring() + { + Block newBlock = Block.PlaceNew(BlockIDs.DampedSpring, Unity.Mathematics.float3.zero + 1); + DampedSpring b = null; // Note: the assignment operation is a lambda, which slightly confuses the compiler + Assert.Errorless(() => { b = newBlock.Specialise(); }, "Block.Specialize() raised an exception: ", "Block.Specialize() completed without issue."); + if (!Assert.NotNull(b, "Block.Specialize() returned null, possibly because it failed silently.", "Specialized DampedSpring is not null.")) return; + if (!Assert.CloseTo(b.Stiffness, 1.0f, $"DampedSpring.Stiffness {b.Stiffness} does not equal default value, possibly because it failed silently.", "DampedSpring.Stiffness is close enough to default.")) return; + if (!Assert.CloseTo(b.Damping, 0.1f, $"DampedSpring.Damping {b.Damping} does not equal default value, possibly because it failed silently.", "DampedSpring.Damping is close enough to default.")) return; + if (!Assert.CloseTo(b.MaxExtension, 0.3f, $"DampedSpring.MaxExtension {b.MaxExtension} does not equal default value, possibly because it failed silently.", "DampedSpring.MaxExtension is close enough to default.")) return; } [APITestCase(TestType.Game)] @@ -119,6 +132,13 @@ namespace GamecraftModdingAPI.Blocks if (!Assert.Errorless(() => { newWire = b.Connect(0, target, 0);})) return; if (!Assert.NotNull(newWire, "SignalingBlock.Connect(...) returned null, possible because it failed silently.", "SignalingBlock.Connect(...) returned a non-null value.")) return; } + + [APITestCase(TestType.EditMode)] + public static void TestSpecialiseError() + { + Block newBlock = Block.PlaceNew(BlockIDs.Bench, new float3(1, 1, 1)); + if (Assert.Errorful(() => newBlock.Specialise(), "Block.Specialise() was expected to error on a bench block.", "Block.Specialise() errored as expected for a bench block.")) return; + } } #endif } diff --git a/GamecraftModdingAPI/Blocks/DampedSpring.cs b/GamecraftModdingAPI/Blocks/DampedSpring.cs index 51da25e..20d28f2 100644 --- a/GamecraftModdingAPI/Blocks/DampedSpring.cs +++ b/GamecraftModdingAPI/Blocks/DampedSpring.cs @@ -44,5 +44,16 @@ namespace GamecraftModdingAPI.Blocks set => BlockEngine.SetBlockInfo(this, (ref DampedSpringReadOnlyStruct ljf, float val) => ljf.springDamping = val, value); } + + /// + /// The spring's maximum extension. + /// + public float MaxExtension + { + get => BlockEngine.GetBlockInfo(this, (DampedSpringReadOnlyStruct ljf) => ljf.maxExtent); + + set => BlockEngine.SetBlockInfo(this, + (ref DampedSpringReadOnlyStruct ljf, float val) => ljf.maxExtent = val, value); + } } } \ No newline at end of file diff --git a/GamecraftModdingAPI/Tests/Assert.cs b/GamecraftModdingAPI/Tests/Assert.cs index 78f0597..edc1392 100644 --- a/GamecraftModdingAPI/Tests/Assert.cs +++ b/GamecraftModdingAPI/Tests/Assert.cs @@ -119,6 +119,25 @@ namespace GamecraftModdingAPI.Tests return true; } + public static bool Errorful(Action tryThis, string err = null, string success = null) where T : Exception + { + if (err == null) err = $"{tryThis} was expected to error but completed without errors."; + if (success == null) success = $"{tryThis} completed with an expected error."; + try + { + tryThis(); + } + catch (T e) + { + TestRoot.TestsPassed = true; + Log(PASS + success + " " + e.GetType().Name + ": " + e.Message); + return true; + } + Log(FAIL + err); + TestRoot.TestsPassed = false; + return false; + } + public static bool CloseTo(float a, float b, string err = null, string success = null, float delta = float.Epsilon) { if (err == null) err = $"{a} is not within {delta} of {b}."; -- 2.30.2 From 1c014e36acb81b389782482788d54cee599f22a2 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Mon, 21 Dec 2020 16:31:57 -0500 Subject: [PATCH 147/252] Add IMGUI styling and initial OOP implementation --- GamecraftModdingAPI/Interface/IMGUI/Button.cs | 92 ++++++++++ .../Interface/IMGUI/Constants.cs | 168 ++++++++++++++++++ GamecraftModdingAPI/Interface/IMGUI/Group.cs | 157 ++++++++++++++++ .../Interface/IMGUI/IMGUIManager.cs | 94 ++++++++++ GamecraftModdingAPI/Interface/IMGUI/Image.cs | 58 ++++++ GamecraftModdingAPI/Interface/IMGUI/Label.cs | 59 ++++++ GamecraftModdingAPI/Interface/IMGUI/Text.cs | 109 ++++++++++++ .../Interface/IMGUI/UIElement.cs | 28 +++ GamecraftModdingAPI/Main.cs | 3 + .../Tests/GamecraftModdingAPIPluginTest.cs | 37 +++- 10 files changed, 803 insertions(+), 2 deletions(-) create mode 100644 GamecraftModdingAPI/Interface/IMGUI/Button.cs create mode 100644 GamecraftModdingAPI/Interface/IMGUI/Constants.cs create mode 100644 GamecraftModdingAPI/Interface/IMGUI/Group.cs create mode 100644 GamecraftModdingAPI/Interface/IMGUI/IMGUIManager.cs create mode 100644 GamecraftModdingAPI/Interface/IMGUI/Image.cs create mode 100644 GamecraftModdingAPI/Interface/IMGUI/Label.cs create mode 100644 GamecraftModdingAPI/Interface/IMGUI/Text.cs create mode 100644 GamecraftModdingAPI/Interface/IMGUI/UIElement.cs diff --git a/GamecraftModdingAPI/Interface/IMGUI/Button.cs b/GamecraftModdingAPI/Interface/IMGUI/Button.cs new file mode 100644 index 0000000..5a119f6 --- /dev/null +++ b/GamecraftModdingAPI/Interface/IMGUI/Button.cs @@ -0,0 +1,92 @@ +using System; +using Unity.Mathematics; +using UnityEngine; + +namespace GamecraftModdingAPI.Interface.IMGUI +{ + /// + /// A clickable button. + /// This wraps Unity's IMGUI Button. + /// + public class Button : UIElement + { + private bool automaticLayout = false; + + private string text; + + /// + /// The rectangular area that the button can use. + /// + public Rect Box { get; set; } = Rect.zero; + + /// + /// An event that fires when the button is clicked. + /// + public event EventHandler OnClick; + + public void OnGUI() + { + if (automaticLayout) + { + if (GUILayout.Button(text, Constants.Default.button)) + { + OnClick?.Invoke(this, true); + } + } + else + { + if (GUI.Button(Box, text, Constants.Default.button)) + { + OnClick?.Invoke(this, true); + } + } + } + + /// + /// The button's unique name. + /// + public string Name { get; private set; } + + /// + /// Whether to display the button. + /// + public bool Enabled { get; set; } = true; + + /// + /// Initialize a new button with automatic layout. + /// + /// The text to display on the button. + /// The button's name. + public Button(string text, string name = null) + { + automaticLayout = true; + this.text = text; + if (name == null) + { + this.Name = typeof(Button).FullName + "::" + text; + } + else + { + this.Name = name; + } + IMGUIManager.AddElement(this); + } + + /// + /// Initialize a new button. + /// + /// The text to display on the button. + /// Rectangular area for the button to use. + /// The button's name. + public Button(string text, Rect box, string name = null) : this(text, name) + { + automaticLayout = false; + this.Box = box; + } + + ~Button() + { + IMGUIManager.RemoveElement(this); + } + } +} \ No newline at end of file diff --git a/GamecraftModdingAPI/Interface/IMGUI/Constants.cs b/GamecraftModdingAPI/Interface/IMGUI/Constants.cs new file mode 100644 index 0000000..3e2fa8f --- /dev/null +++ b/GamecraftModdingAPI/Interface/IMGUI/Constants.cs @@ -0,0 +1,168 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Reflection; +using GamecraftModdingAPI.Utility; +using HarmonyLib; +using Svelto.Tasks; +using Svelto.Tasks.Lean; +using UnityEngine; +using UnityEngine.AddressableAssets; +using UnityEngine.ResourceManagement.AsyncOperations; + +namespace GamecraftModdingAPI.Interface.IMGUI +{ + /// + /// Convenient IMGUI values. + /// + public static class Constants + { + private static byte _defaultCompletion = 0; + private static GUISkin _default = null; + + /// + /// Best-effort imitation of Gamecraft's UI style. + /// + public static GUISkin Default + { + get + { + if (_defaultCompletion != 0) _default = BuildDefaultGUISkin(); + return _default; + } + } + + private static Font _riffic = null; + + private static Texture2D _blueBackground = null; + private static Texture2D _grayBackground = null; + private static Texture2D _whiteBackground = null; + private static Texture2D _textInputBackground = null; + private static Texture2D _areaBackground = null; + + internal static void Init() + { + LoadGUIAssets(); + } + + private static GUISkin BuildDefaultGUISkin() + { + _defaultCompletion = 0; + if (_riffic == null) return GUI.skin; + // build GUISkin + GUISkin gui = ScriptableObject.CreateInstance(); + gui.font = _riffic; + gui.settings.selectionColor = Color.white; + gui.settings.tripleClickSelectsLine = true; + // set properties off all UI elements + foreach (PropertyInfo p in typeof(GUISkin).GetProperties()) + { + // for a "scriptable" GUI system, it's ironic there's no better way to do this + if (p.GetValue(gui) is GUIStyle style) + { + style.richText = true; + style.alignment = TextAnchor.MiddleCenter; + style.fontSize = 30; + style.wordWrap = true; + style.border = new RectOffset(4, 4, 4, 4); + style.margin = new RectOffset(4, 4, 4, 4); + style.padding = new RectOffset(4, 4, 4, 4); + // normal state + style.normal.background = _blueBackground; + style.normal.textColor = Color.white; + // hover state + style.hover.background = _grayBackground; + style.hover.textColor = Color.white; + // focused + style.focused.background = _grayBackground; + style.focused.textColor = Color.white; + // clicking state + style.active.background = _whiteBackground; + style.active.textColor = Color.white; + + p.SetValue(gui, style); // probably unnecessary + } + } + // set element-specific styles + // label + gui.label.normal.background = null; + gui.label.hover.background = null; + gui.label.focused.background = null; + gui.label.active.background = null; + // text input + gui.textField.normal.background = _textInputBackground; + gui.textField.hover.background = _textInputBackground; + gui.textField.focused.background = _textInputBackground; + gui.textField.active.background = _textInputBackground; + // text area + gui.textArea.normal.background = _textInputBackground; + gui.textArea.hover.background = _textInputBackground; + gui.textArea.focused.background = _textInputBackground; + gui.textArea.active.background = _textInputBackground; + // window + gui.window.normal.background = _areaBackground; + gui.window.hover.background = _areaBackground; + gui.window.focused.background = _areaBackground; + gui.window.active.background = _areaBackground; + // box (also used by layout groups & areas) + gui.box.normal.background = _areaBackground; + gui.box.hover.background = _areaBackground; + gui.box.focused.background = _areaBackground; + gui.box.active.background = _areaBackground; + return gui; + } + + private static void LoadGUIAssets() + { + AsyncOperationHandle rifficHandle = Addressables.LoadAssetAsync("Assets/Art/Fonts/riffic-bold.ttf"); + rifficHandle.Completed += handle => + { + _riffic = handle.Result; + _defaultCompletion++; + }; + _blueBackground = new Texture2D(1, 1); + _blueBackground.SetPixel(0, 0, new Color(0.004f, 0.522f, 0.847f) /* Gamecraft Blue */); + _blueBackground.Apply(); + _grayBackground = new Texture2D(1, 1); + _grayBackground.SetPixel(0, 0, new Color(0.745f, 0.745f, 0.745f) /* Gray */); + _grayBackground.Apply(); + _whiteBackground = new Texture2D(1, 1); + _whiteBackground.SetPixel(0, 0, new Color(0.898f, 0.898f, 0.898f) /* Very light gray */); + _whiteBackground.Apply(); + _textInputBackground = new Texture2D(1, 1); + _textInputBackground.SetPixel(0, 0, new Color(0f, 0f, 0f, 0.25f) /* Translucent gray */); + _textInputBackground.Apply(); + _areaBackground = new Texture2D(1, 1); + _areaBackground.SetPixel(0, 0, new Color(0f, 0f, 0f, 0.25f) /* Translucent gray */); + _areaBackground.Apply(); + /* // this is actually gray (used for the loading screen) + AsyncOperationHandle backgroundHandle = + Addressables.LoadAssetAsync("Assets/Art/Textures/UI/FrontEndMap/RCX_Blue_Background_5k.jpg"); + backgroundHandle.Completed += handle => + { + _blueBackground = handle.Result; + _defaultCompletion++; + };*/ + _defaultCompletion++; + } + } + + [HarmonyPatch(typeof(FMODUnity.RuntimeManager), "PlayOneShot", new []{ typeof(Guid), typeof(Vector3)})] + public class FMODRuntimeManagerPlayOneShotPatch + { + public static void Prefix(Guid guid) + { + Logging.MetaLog($"Playing sound with guid '{guid.ToString()}'"); + } + } + + [HarmonyPatch(typeof(FMODUnity.RuntimeManager), "PlayOneShot", new []{ typeof(string), typeof(Vector3)})] + public class FMODRuntimeManagerPlayOneShotPatch2 + { + public static void Prefix(string path) + { + Logging.MetaLog($"Playing sound with str '{path}'"); + } + } +} \ No newline at end of file diff --git a/GamecraftModdingAPI/Interface/IMGUI/Group.cs b/GamecraftModdingAPI/Interface/IMGUI/Group.cs new file mode 100644 index 0000000..7033dee --- /dev/null +++ b/GamecraftModdingAPI/Interface/IMGUI/Group.cs @@ -0,0 +1,157 @@ +using System; +using GamecraftModdingAPI.Utility; +using Svelto.DataStructures; +using UnityEngine; + +namespace GamecraftModdingAPI.Interface.IMGUI +{ + /// + /// A group of elements. + /// This wraps Unity's GUILayout Area and GUI Group system. + /// + public class Group : UIElement + { + private bool automaticLayout; + + private FasterList elements = new FasterList(); + + /// + /// The rectangular area in the window that the UI group can use + /// + public Rect Box { get; set; } + + public void OnGUI() + { + /*if (Constants.Default == null) return; + if (Constants.Default.box == null) return;*/ + GUIStyle guiStyle = Constants.Default.box; + UIElement[] elems = elements.ToArrayFast(out uint count); + if (automaticLayout) + { + GUILayout.BeginArea(Box, guiStyle); + for (uint i = 0; i < count; i++) + { + /*try + { + if (elems[i].Enabled) + elems[i].OnGUI(); + } + catch (ArgumentException) + { + // ignore these, since this is (hopefully) just Unity being dumb + } + catch (Exception e) + { + Logging.MetaDebugLog($"Element '{elems[i].Name}' threw exception:\n{e.ToString()}"); + }*/ + if (elems[i].Enabled) + elems[i].OnGUI(); + } + GUILayout.EndArea(); + } + else + { + GUI.BeginGroup(Box, guiStyle); + for (uint i = 0; i < count; i++) + { + if (elems[i].Enabled) + elems[i].OnGUI(); + } + GUI.EndGroup(); + } + } + + /// + /// The group's unique name. + /// + public string Name { get; } + + /// + /// Whether to display the group and everything in it. + /// + public bool Enabled { set; get; } = true; + + /// + /// The amount of elements in the group. + /// + public int Length + { + get => elements.count; + } + + /// + /// Initializes a new instance of the class. + /// + /// The rectangular area to use in the window. + /// Name of the group. + /// Whether to use automatic UI layout. + public Group(Rect box, string name = null, bool automaticLayout = false) + { + Box = box; + if (name == null) + { + this.Name = typeof(Group).FullName + "::" + box.ToString().Replace(" ", ""); + } + else + { + this.Name = name; + } + this.automaticLayout = automaticLayout; + IMGUIManager.AddElement(this); + } + + /// + /// Add an element to the group. + /// + /// The element to add. + /// Index of the new element. + public int AddElement(UIElement element) + { + IMGUIManager.RemoveElement(element); // groups manage internal elements themselves + elements.Add(element); + return elements.count - 1; + } + + /// + /// Remove an element from the group. + /// + /// The element to remove. + /// Whether removal was successful. + public bool RemoveElement(UIElement element) + { + int index = IndexOf(element); + return RemoveAt(index); + } + + /// + /// Remove the element in a specific location. + /// + /// Index of the element. + /// Whether removal was successful. + public bool RemoveAt(int index) + { + if (index < 0 || index >= elements.count) return false; + IMGUIManager.AddElement(elements[index]); // re-add to global manager + elements.RemoveAt(index); + return true; + } + + /// + /// Get the index of an element. + /// + /// The element to search for. + /// The element's index, or -1 if not found. + public int IndexOf(UIElement element) + { + UIElement[] elems = elements.ToArrayFast(out uint count); + for (int i = 0; i < count; i++) + { + if (elems[i].Name == element.Name) + { + return i; + } + } + return -1; + } + } +} \ No newline at end of file diff --git a/GamecraftModdingAPI/Interface/IMGUI/IMGUIManager.cs b/GamecraftModdingAPI/Interface/IMGUI/IMGUIManager.cs new file mode 100644 index 0000000..f6048e7 --- /dev/null +++ b/GamecraftModdingAPI/Interface/IMGUI/IMGUIManager.cs @@ -0,0 +1,94 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using GamecraftModdingAPI.App; +using GamecraftModdingAPI.Utility; +using Rewired.Internal; +using Svelto.DataStructures; +using Svelto.Tasks; +using Svelto.Tasks.ExtraLean; +using Svelto.Tasks.ExtraLean.Unity; +using UnityEngine; + +namespace GamecraftModdingAPI.Interface.IMGUI +{ + public static class IMGUIManager + { + internal static OnGuiRunner ImguiScheduler = new OnGuiRunner("GamecraftModdingAPI_IMGUIScheduler"); + + private static FasterDictionary _activeElements = new FasterDictionary(); + + public static void AddElement(UIElement e) + { + if (!ExistsElement(e)) + { + _activeElements[e.Name] = e; + } + } + + public static bool ExistsElement(string name) + { + return _activeElements.ContainsKey(name); + } + + public static bool ExistsElement(UIElement element) + { + return ExistsElement(element.Name); + } + + public static bool RemoveElement(string name) + { + if (ExistsElement(name)) + { + return _activeElements.Remove(name); + } + + return false; + } + + public static bool RemoveElement(UIElement element) + { + return RemoveElement(element.Name); + } + + private static void OnGUI() + { + UIElement[] elements = _activeElements.GetValuesArray(out uint count); + for(uint i = 0; i < count; i++) + { + if (elements[i].Enabled) + elements[i].OnGUI(); + /*try + { + if (elements[i].Enabled) + elements[i].OnGUI(); + } + catch (ArgumentException) + { + // ignore these, since this is (hopefully) just Unity being dumb + } + catch (Exception e) + { + Logging.MetaDebugLog($"Element '{elements[i].Name}' threw exception:\n{e.ToString()}"); + }*/ + + } + } + + private static IEnumerator OnGUIAsync() + { + yield return (new Svelto.Tasks.Enumerators.WaitForSecondsEnumerator(5)).Continue(); // wait for some startup + while (true) + { + yield return Yield.It; + GUI.skin = Constants.Default; + OnGUI(); + } + } + + internal static void Init() + { + OnGUIAsync().RunOn(ImguiScheduler); + } + } +} \ No newline at end of file diff --git a/GamecraftModdingAPI/Interface/IMGUI/Image.cs b/GamecraftModdingAPI/Interface/IMGUI/Image.cs new file mode 100644 index 0000000..8c026ed --- /dev/null +++ b/GamecraftModdingAPI/Interface/IMGUI/Image.cs @@ -0,0 +1,58 @@ +using UnityEngine; + +namespace GamecraftModdingAPI.Interface.IMGUI +{ + public class Image : UIElement + { + private bool automaticLayout = false; + + public Texture Texture { get; set; } + + public Rect Box { get; set; } = Rect.zero; + + public void OnGUI() + { + //if (Texture == null) return; + if (automaticLayout) + { + GUILayout.Label(Texture, Constants.Default.label); + } + else + { + GUI.Label(Box, Texture, Constants.Default.label); + } + } + + public string Name { get; } + public bool Enabled { set; get; } = true; + + public Image(Texture texture = null, string name = null) + { + automaticLayout = true; + Texture = texture; + if (name == null) + { + if (texture == null) + { + this.Name = typeof(Image).FullName + "::" + texture; + } + else + { + this.Name = typeof(Image).FullName + "::" + texture.name + "(" + texture.width + "x" + texture.height + ")"; + } + + } + else + { + this.Name = name; + } + IMGUIManager.AddElement(this); + } + + public Image(Rect box, Texture texture = null, string name = null) : this(texture, name) + { + this.Box = box; + automaticLayout = false; + } + } +} \ No newline at end of file diff --git a/GamecraftModdingAPI/Interface/IMGUI/Label.cs b/GamecraftModdingAPI/Interface/IMGUI/Label.cs new file mode 100644 index 0000000..2fb54f7 --- /dev/null +++ b/GamecraftModdingAPI/Interface/IMGUI/Label.cs @@ -0,0 +1,59 @@ +using UnityEngine; + +namespace GamecraftModdingAPI.Interface.IMGUI +{ + /// + /// A simple text label. + /// This wraps Unity IMGUI's Label. + /// + public class Label : UIElement + { + private bool automaticLayout = false; + + /// + /// String to display on the label. + /// + public string Text { get; set; } + + /// + /// The rectangular area that the label can use. + /// + public Rect Box { get; set; } = Rect.zero; + + public void OnGUI() + { + if (automaticLayout) + { + GUILayout.Label(Text, Constants.Default.label); + } + else + { + GUI.Label(Box, Text, Constants.Default.label); + } + } + + public string Name { get; } + public bool Enabled { set; get; } = true; + + public Label(string initialText = null, string name = null) + { + automaticLayout = true; + Text = initialText; + if (name == null) + { + this.Name = typeof(Label).FullName + "::" + initialText; + } + else + { + this.Name = name; + } + IMGUIManager.AddElement(this); + } + + public Label(Rect box, string initialText = null, string name = null) : this(initialText, name) + { + this.Box = box; + automaticLayout = false; + } + } +} \ No newline at end of file diff --git a/GamecraftModdingAPI/Interface/IMGUI/Text.cs b/GamecraftModdingAPI/Interface/IMGUI/Text.cs new file mode 100644 index 0000000..1b94804 --- /dev/null +++ b/GamecraftModdingAPI/Interface/IMGUI/Text.cs @@ -0,0 +1,109 @@ +using System; +using UnityEngine; + +namespace GamecraftModdingAPI.Interface.IMGUI +{ + /// + /// A text input field. + /// This wraps Unity's IMGUI TextField and TextArea. + /// + public class Text : UIElement + { + private bool automaticLayout; + + /// + /// Whether the text input field is multiline (true -> TextArea) or not (false -> TextField). + /// + public bool Multiline { get; set; } + + private string text; + + /// + /// The rectangular area that the text field can use. + /// + public Rect Box { get; set; } = Rect.zero; + + /// + /// An event that fires whenever the text input is edited. + /// + public event EventHandler OnEdit; + + public void OnGUI() + { + string editedText = null; + if (automaticLayout) + { + if (Multiline) + { + editedText = GUILayout.TextArea(text, Constants.Default.textArea); + } + else + { + editedText = GUILayout.TextField(text, Constants.Default.textField); + } + } + else + { + if (Multiline) + { + editedText = GUI.TextArea(Box, text, Constants.Default.textArea); + } + else + { + editedText = GUI.TextField(Box, text, Constants.Default.textField); + } + } + + if (editedText != null && editedText != text) + { + OnEdit?.Invoke(this, editedText); + text = editedText; + } + } + + /// + /// The text field's unique name. + /// + public string Name { get; } + + /// + /// Whether to display the text field. + /// + public bool Enabled { set; get; } = true; + + /// + /// Initialize the text input field with automatic layout. + /// + /// Initial text in the input field. + /// The text field's name. + /// Allow multiple lines? + public Text(string initialText = null, string name = null, bool multiline = false) + { + this.Multiline = multiline; + automaticLayout = true; + text = initialText ?? ""; + if (name == null) + { + this.Name = typeof(Text).FullName + "::" + text; + } + else + { + this.Name = name; + } + IMGUIManager.AddElement(this); + } + + /// + /// Initialize the text input field. + /// + /// Rectangular area for the text field. + /// Initial text in the input field. + /// The text field's name. + /// Allow multiple lines? + public Text(Rect box, string initialText = null, string name = null, bool multiline = false) : this(initialText, name, multiline) + { + this.Box = box; + automaticLayout = false; + } + } +} \ No newline at end of file diff --git a/GamecraftModdingAPI/Interface/IMGUI/UIElement.cs b/GamecraftModdingAPI/Interface/IMGUI/UIElement.cs new file mode 100644 index 0000000..abaed6e --- /dev/null +++ b/GamecraftModdingAPI/Interface/IMGUI/UIElement.cs @@ -0,0 +1,28 @@ +using System; + +namespace GamecraftModdingAPI.Interface.IMGUI +{ + /// + /// GUI Element like a text field, button or picture. + /// This interface is used to wrap many elements from Unity's IMGUI system. + /// + public interface UIElement + { + /// + /// GUI operations to perform in the OnGUI scope. + /// This is basically equivalent to a MonoBehaviour's OnGUI method. + /// + void OnGUI(); + + /// + /// The element's name. + /// This should be unique for every instance of the class. + /// + string Name { get; } + + /// + /// Whether to display the UI element or not. + /// + bool Enabled { get; } + } +} \ No newline at end of file diff --git a/GamecraftModdingAPI/Main.cs b/GamecraftModdingAPI/Main.cs index 584ae90..d957a46 100644 --- a/GamecraftModdingAPI/Main.cs +++ b/GamecraftModdingAPI/Main.cs @@ -89,6 +89,9 @@ namespace GamecraftModdingAPI AsyncUtils.Init(); GamecraftModdingAPI.App.Client.Init(); GamecraftModdingAPI.App.Game.Init(); + // init UI + Interface.IMGUI.Constants.Init(); + Interface.IMGUI.IMGUIManager.Init(); Logging.MetaLog($"{currentAssembly.GetName().Name} v{currentAssembly.GetName().Version} initialized"); } diff --git a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs index 81a814c..e3abdca 100644 --- a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs +++ b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs @@ -5,7 +5,7 @@ using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Text; - +using GamecraftModdingAPI.App; using HarmonyLib; using IllusionInjector; // test @@ -22,8 +22,16 @@ using GamecraftModdingAPI.Commands; using GamecraftModdingAPI.Events; using GamecraftModdingAPI.Utility; using GamecraftModdingAPI.Blocks; +using GamecraftModdingAPI.Interface.IMGUI; using GamecraftModdingAPI.Players; +using UnityEngine.AddressableAssets; +using UnityEngine.AddressableAssets.ResourceLocators; +using UnityEngine.ResourceManagement.AsyncOperations; +using UnityEngine.ResourceManagement.ResourceLocations; +using UnityEngine.ResourceManagement.ResourceProviders; +using Debug = FMOD.Debug; using EventType = GamecraftModdingAPI.Events.EventType; +using Label = GamecraftModdingAPI.Interface.IMGUI.Label; namespace GamecraftModdingAPI.Tests { @@ -347,13 +355,38 @@ namespace GamecraftModdingAPI.Tests { Logging.Log("Compatible GamecraftScripting detected"); } + // Interface test + /*Interface.IMGUI.Group uiGroup = new Group(new Rect(20, 20, 200, 500), "GamecraftModdingAPI_UITestGroup", true); + Interface.IMGUI.Button button = new Button("TEST"); + button.OnClick += (b, __) => { Logging.MetaDebugLog($"Click on {((Interface.IMGUI.Button)b).Name}");}; + Interface.IMGUI.Button button2 = new Button("TEST2"); + button2.OnClick += (b, __) => { Logging.MetaDebugLog($"Click on {((Interface.IMGUI.Button)b).Name}");}; + Text uiText = new Text("This is text!", multiline: true); + uiText.OnEdit += (t, txt) => { Logging.MetaDebugLog($"Text in {((Text)t).Name} is now '{txt}'"); }; + Label uiLabel = new Label("Label!"); + Image uiImg = new Image(name:"Behold this texture!"); + uiImg.Enabled = false; + uiGroup.AddElement(button); + uiGroup.AddElement(button2); + uiGroup.AddElement(uiText); + uiGroup.AddElement(uiLabel); + uiGroup.AddElement(uiImg); + Addressables.LoadAssetAsync("Assets/Art/Textures/UI/FrontEndMap/RCX_Blue_Background_5k.jpg") + .Completed += + handle => + { + uiImg.Texture = handle.Result; + uiImg.Enabled = true; + Logging.MetaDebugLog($"Got blue bg asset {handle.Result}"); + }; + */ #if TEST TestRoot.RunTests(); #endif } - private string modsString; + private string modsString; private string InstalledMods() { if (modsString != null) return modsString; -- 2.30.2 From fdc47832f4b75a6d58187bab1dd9c61d90150c87 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sat, 26 Dec 2020 01:59:06 +0100 Subject: [PATCH 148/252] Store custom block IDs in save files --- GamecraftModdingAPI/Blocks/CustomBlock.cs | 33 ++++++++--- .../Blocks/CustomBlockEntityDescriptor.cs | 57 +++++++++++++++++++ GamecraftModdingAPI/Main.cs | 2 +- .../Utility/ApiExclusiveGroups.cs | 14 ++++- 4 files changed, 97 insertions(+), 9 deletions(-) create mode 100644 GamecraftModdingAPI/Blocks/CustomBlockEntityDescriptor.cs diff --git a/GamecraftModdingAPI/Blocks/CustomBlock.cs b/GamecraftModdingAPI/Blocks/CustomBlock.cs index 15cfb15..c72475e 100644 --- a/GamecraftModdingAPI/Blocks/CustomBlock.cs +++ b/GamecraftModdingAPI/Blocks/CustomBlock.cs @@ -6,10 +6,12 @@ using System.Reflection; using HarmonyLib; using DataLoader; -using RobocraftX.Blocks; using RobocraftX.Rendering; +using RobocraftX.Schedulers; using Svelto.ECS; +using Svelto.ECS.Experimental; using Svelto.Tasks; +using Svelto.Tasks.ExtraLean; using UnityEngine; using UnityEngine.AddressableAssets; using Material = UnityEngine.Material; @@ -18,13 +20,17 @@ using GamecraftModdingAPI.Utility; namespace GamecraftModdingAPI.Blocks { + /// + /// Experimental support for adding custom blocks to the game. + /// public class CustomBlock : Block { private static ushort nextID = 500; /// /// Key: Prefab path /// - private static Dictionary _customBlocks = new Dictionary(); + private static readonly Dictionary CustomBlocks = new Dictionary(); + private static readonly CustomBlockEngine Engine = new CustomBlockEngine(); private static bool _canRegister = true; @@ -48,7 +54,7 @@ namespace GamecraftModdingAPI.Blocks throw new ArgumentException("The given block type doesn't have a concrete full name."); if (!File.Exists(attr.Catalog)) throw new FileNotFoundException("The specified catalog cannot be found for " + typeName); - _customBlocks.Add(attr.AssetPath, type); + CustomBlocks.Add(attr.AssetPath, type); Logging.MetaDebugLog("Registered custom block type " + typeName); } @@ -79,7 +85,7 @@ namespace GamecraftModdingAPI.Blocks for (var index = 0; index < prefabs.Count; index++) { - if (_customBlocks.ContainsKey(prefabData[index].prefabName)) //This is a custom block + if (CustomBlocks.ContainsKey(prefabData[index].prefabName)) //This is a custom block prefabs[index].GetComponentsInChildren()[0].sharedMaterials = materials; } } @@ -96,7 +102,7 @@ namespace GamecraftModdingAPI.Blocks public static void Prefix(IDataDB dataDB) { //var abd = dataDB.GetValue((int) BlockIDs.AluminiumCube); - foreach (var (key, type) in _customBlocks) + foreach (var (key, type) in CustomBlocks) { var attr = type.GetCustomAttribute(); var cld = new CubeListData @@ -123,6 +129,7 @@ namespace GamecraftModdingAPI.Blocks }; dataDB.GetValues().Add(cld.ID.ToString(), cld); //The registration needs to happen after the ID has been set dataDB.GetFasterValues().Add(cld.ID, cld); //So can't use the builtin method to create a CubeListData + Engine.RegisterBlock((ushort) cld.ID, key); } _canRegister = false; @@ -150,9 +157,9 @@ namespace GamecraftModdingAPI.Blocks } }*/ - internal static IEnumerator Prepare() + private static IEnumerator Prepare() { //Should be pretty quick - foreach (var type in _customBlocks.Values) + foreach (var type in CustomBlocks.Values) { var attr = type.GetCustomAttribute(); Logging.Log("Loading custom block catalog " + attr.Catalog); @@ -163,11 +170,23 @@ namespace GamecraftModdingAPI.Blocks } } + internal new static void Init() + { + Prepare().RunOn(ExtraLean.UIScheduler); + GameEngineManager.AddGameEngine(Engine); + } + /*internal static void OnBlockFactoryObtained(BlockEntityFactory factory) { var builders = (Dictionary) AccessTools.Field(factory.GetType(), "_blockBuilders").GetValue(factory); builders.Add((CubeCategory) 1000, new BlockBuilder(Group)); }*/ + + internal struct DataStruct : IEntityComponent + { + public ECSString Name; + public ushort ID; + } } } \ No newline at end of file diff --git a/GamecraftModdingAPI/Blocks/CustomBlockEntityDescriptor.cs b/GamecraftModdingAPI/Blocks/CustomBlockEntityDescriptor.cs new file mode 100644 index 0000000..7e8ea6e --- /dev/null +++ b/GamecraftModdingAPI/Blocks/CustomBlockEntityDescriptor.cs @@ -0,0 +1,57 @@ +using System; +using GamecraftModdingAPI.Engines; +using GamecraftModdingAPI.Persistence; +using GamecraftModdingAPI.Utility; +using RobocraftX.Common; +using Svelto.ECS; +using Svelto.ECS.Experimental; +using Svelto.ECS.Serialization; + +namespace GamecraftModdingAPI.Blocks +{ + public class CustomBlockEngine : IFactoryEngine + { + public class CustomBlockEntityDescriptor : SerializableEntityDescriptor< + CustomBlockEntityDescriptor._CustomBlockDescriptor> + { + [HashName("GamecraftModdingAPICustomBlockV0")] + public class _CustomBlockDescriptor : IEntityDescriptor + { + public IComponentBuilder[] componentsToBuild { get; } = + { + new SerializableComponentBuilder( + ((int) SerializationType.Network, new DefaultSerializer()), + ((int) SerializationType.Storage, new DefaultSerializer())) + }; + } + } + + public void Ready() + { + SerializerManager.AddSerializer(new SimpleEntitySerializer(db => + { + var (coll, c) = db.QueryEntities(ApiExclusiveGroups.customBlockGroup); + var egids = new EGID[c]; + for (int i = 0; i < c; i++) + egids[i] = new EGID(coll[i].ID, ApiExclusiveGroups.customBlockGroup); + + return egids; + })); + } + + public EntitiesDB entitiesDB { get; set; } + public void Dispose() + { + } + + public void RegisterBlock(ushort id, string name) + { + Factory.BuildEntity(id, ApiExclusiveGroups.customBlockGroup) + .Init(new CustomBlock.DataStruct {Name = new ECSString(name), ID = id}); + } + + public string Name { get; } = "GamecraftModdingAPICustomBlockEngine"; + public bool isRemovable { get; } = false; + public IEntityFactory Factory { get; set; } + } +} \ No newline at end of file diff --git a/GamecraftModdingAPI/Main.cs b/GamecraftModdingAPI/Main.cs index 66e923e..36a0db4 100644 --- a/GamecraftModdingAPI/Main.cs +++ b/GamecraftModdingAPI/Main.cs @@ -91,7 +91,7 @@ namespace GamecraftModdingAPI AsyncUtils.Init(); GamecraftModdingAPI.App.Client.Init(); GamecraftModdingAPI.App.Game.Init(); - CustomBlock.Prepare().RunOn(ExtraLean.UIScheduler); + CustomBlock.Init(); // init UI Interface.IMGUI.Constants.Init(); Interface.IMGUI.IMGUIManager.Init(); diff --git a/GamecraftModdingAPI/Utility/ApiExclusiveGroups.cs b/GamecraftModdingAPI/Utility/ApiExclusiveGroups.cs index 19211e6..8dc052d 100644 --- a/GamecraftModdingAPI/Utility/ApiExclusiveGroups.cs +++ b/GamecraftModdingAPI/Utility/ApiExclusiveGroups.cs @@ -38,6 +38,18 @@ namespace GamecraftModdingAPI.Utility } return _versionGroup; } - } + } + + private static ExclusiveGroup _customBlockGroup; + + public static ExclusiveGroup customBlockGroup + { + get + { + if (_customBlockGroup == null) + _customBlockGroup = new ExclusiveGroup("GamecraftModdingAPI CustomBlockGroup"); + return _customBlockGroup; + } + } } } -- 2.30.2 From d954060a5ab268921fc1386fee0eaa8b2742a177 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sun, 27 Dec 2020 21:13:49 +0100 Subject: [PATCH 149/252] Add ability to change properties of existing blocks And not storing custom block data for now --- GamecraftModdingAPI/Blocks/CustomBlock.cs | 21 +++++++++-- ...tityDescriptor.cs => CustomBlockEngine.cs} | 35 +++++++++++-------- .../Tests/GamecraftModdingAPIPluginTest.cs | 4 +++ 3 files changed, 43 insertions(+), 17 deletions(-) rename GamecraftModdingAPI/Blocks/{CustomBlockEntityDescriptor.cs => CustomBlockEngine.cs} (57%) diff --git a/GamecraftModdingAPI/Blocks/CustomBlock.cs b/GamecraftModdingAPI/Blocks/CustomBlock.cs index c72475e..bafccc2 100644 --- a/GamecraftModdingAPI/Blocks/CustomBlock.cs +++ b/GamecraftModdingAPI/Blocks/CustomBlock.cs @@ -30,7 +30,9 @@ namespace GamecraftModdingAPI.Blocks /// Key: Prefab path ///
private static readonly Dictionary CustomBlocks = new Dictionary(); - private static readonly CustomBlockEngine Engine = new CustomBlockEngine(); + //private static readonly CustomBlockEngine Engine = new CustomBlockEngine(); + private static readonly List<(ushort id, Action action)> BlockChangeActions = + new List<(ushort, Action)>(); private static bool _canRegister = true; @@ -58,6 +60,16 @@ namespace GamecraftModdingAPI.Blocks Logging.MetaDebugLog("Registered custom block type " + typeName); } + /// + /// A low-level method for changing any property of an existing block. Use with caution. + /// + /// The block ID + /// An action that modifies a property of the block + public static void ChangeExistingBlock(ushort id, Action modifier) + { + BlockChangeActions.Add((id, modifier)); + } + public CustomBlock(EGID id) : base(id) { /*if (id.groupID != Group) @@ -129,9 +141,12 @@ namespace GamecraftModdingAPI.Blocks }; dataDB.GetValues().Add(cld.ID.ToString(), cld); //The registration needs to happen after the ID has been set dataDB.GetFasterValues().Add(cld.ID, cld); //So can't use the builtin method to create a CubeListData - Engine.RegisterBlock((ushort) cld.ID, key); + //Engine.RegisterBlock((ushort) cld.ID, key); - TODO } + foreach (var (id, action) in BlockChangeActions) + action(dataDB.GetValue(id)); + _canRegister = false; } @@ -173,7 +188,7 @@ namespace GamecraftModdingAPI.Blocks internal new static void Init() { Prepare().RunOn(ExtraLean.UIScheduler); - GameEngineManager.AddGameEngine(Engine); + //GameEngineManager.AddGameEngine(Engine); - TODO: Fix serialization and implement block ID update } /*internal static void OnBlockFactoryObtained(BlockEntityFactory factory) diff --git a/GamecraftModdingAPI/Blocks/CustomBlockEntityDescriptor.cs b/GamecraftModdingAPI/Blocks/CustomBlockEngine.cs similarity index 57% rename from GamecraftModdingAPI/Blocks/CustomBlockEntityDescriptor.cs rename to GamecraftModdingAPI/Blocks/CustomBlockEngine.cs index 7e8ea6e..bb1192b 100644 --- a/GamecraftModdingAPI/Blocks/CustomBlockEntityDescriptor.cs +++ b/GamecraftModdingAPI/Blocks/CustomBlockEngine.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using GamecraftModdingAPI.Engines; using GamecraftModdingAPI.Persistence; using GamecraftModdingAPI.Utility; @@ -9,10 +10,9 @@ using Svelto.ECS.Serialization; namespace GamecraftModdingAPI.Blocks { - public class CustomBlockEngine : IFactoryEngine + /*public class CustomBlockEngine : IFactoryEngine { - public class CustomBlockEntityDescriptor : SerializableEntityDescriptor< - CustomBlockEntityDescriptor._CustomBlockDescriptor> + public class CustomBlockEntityDescriptor : SerializableEntityDescriptor { [HashName("GamecraftModdingAPICustomBlockV0")] public class _CustomBlockDescriptor : IEntityDescriptor @@ -28,30 +28,37 @@ namespace GamecraftModdingAPI.Blocks public void Ready() { - SerializerManager.AddSerializer(new SimpleEntitySerializer(db => - { - var (coll, c) = db.QueryEntities(ApiExclusiveGroups.customBlockGroup); - var egids = new EGID[c]; - for (int i = 0; i < c; i++) - egids[i] = new EGID(coll[i].ID, ApiExclusiveGroups.customBlockGroup); + SerializerManager.AddSerializer( + new SimpleEntitySerializer(db => + { + var (coll, c) = db.QueryEntities(ApiExclusiveGroups.customBlockGroup); + var egids = new EGID[c]; + for (int i = 0; i < c; i++) + egids[i] = new EGID(coll[i].ID, ApiExclusiveGroups.customBlockGroup); - return egids; - })); + return egids; + })); + foreach (var (id, name) in _registeredBlocks) + { + Factory.BuildEntity(id, ApiExclusiveGroups.customBlockGroup) + .Init(new CustomBlock.DataStruct {Name = new ECSString(name), ID = id}); + } } public EntitiesDB entitiesDB { get; set; } + private List<(ushort id, string name)> _registeredBlocks = new List<(ushort, string)>(); + public void Dispose() { } public void RegisterBlock(ushort id, string name) { - Factory.BuildEntity(id, ApiExclusiveGroups.customBlockGroup) - .Init(new CustomBlock.DataStruct {Name = new ECSString(name), ID = id}); + _registeredBlocks.Add((id, name)); } public string Name { get; } = "GamecraftModdingAPICustomBlockEngine"; public bool isRemovable { get; } = false; public IEntityFactory Factory { get; set; } - } + }*/ } \ No newline at end of file diff --git a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs index dd96226..acb8bc4 100644 --- a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs +++ b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs @@ -36,6 +36,7 @@ using UnityEngine.ResourceManagement.ResourceProviders; using Debug = FMOD.Debug; using EventType = GamecraftModdingAPI.Events.EventType; using Label = GamecraftModdingAPI.Interface.IMGUI.Label; +using ScalingPermission = DataLoader.ScalingPermission; namespace GamecraftModdingAPI.Tests { @@ -412,6 +413,9 @@ namespace GamecraftModdingAPI.Tests { Logging.MetaDebugLog("Test custom block catalog not found"); } + + CustomBlock.ChangeExistingBlock((ushort) BlockIDs.TyreS, + cld => cld.scalingPermission = ScalingPermission.NonUniform); #if TEST TestRoot.RunTests(); #endif -- 2.30.2 From 0ef875b6b28372cd117d6f7cac88ec55d90a0ee2 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Sun, 27 Dec 2020 18:57:23 -0500 Subject: [PATCH 150/252] Document undocumented IMGUI element classes --- .../Interface/IMGUI/IMGUIManager.cs | 32 +++++++++++++++++++ GamecraftModdingAPI/Interface/IMGUI/Image.cs | 28 ++++++++++++++++ GamecraftModdingAPI/Interface/IMGUI/Label.cs | 18 +++++++++++ 3 files changed, 78 insertions(+) diff --git a/GamecraftModdingAPI/Interface/IMGUI/IMGUIManager.cs b/GamecraftModdingAPI/Interface/IMGUI/IMGUIManager.cs index f6048e7..e75f8f2 100644 --- a/GamecraftModdingAPI/Interface/IMGUI/IMGUIManager.cs +++ b/GamecraftModdingAPI/Interface/IMGUI/IMGUIManager.cs @@ -12,12 +12,22 @@ using UnityEngine; namespace GamecraftModdingAPI.Interface.IMGUI { + /// + /// Keeps track of UIElement instances. + /// This also handles displaying and processing them during the MonoBehaviour.OnGUI phase of screen updates. + /// Most of this functionality is handled implicitly by the included UIElement implementations, + /// but this is left as a public API so it can be expanded. + /// public static class IMGUIManager { internal static OnGuiRunner ImguiScheduler = new OnGuiRunner("GamecraftModdingAPI_IMGUIScheduler"); private static FasterDictionary _activeElements = new FasterDictionary(); + /// + /// Add an UIElement instance to be managed by IMGUIManager. + /// + /// The UIElement instance. public static void AddElement(UIElement e) { if (!ExistsElement(e)) @@ -26,16 +36,32 @@ namespace GamecraftModdingAPI.Interface.IMGUI } } + /// + /// Determine whether the UIElement instance is already tracked by IMGUIManager. + /// + /// The UIElement's unique name. + /// Whether the UIElement instance is already tracked by IMGUIManager (true) or not (false). public static bool ExistsElement(string name) { return _activeElements.ContainsKey(name); } + /// + /// Determine whether the UIElement instance is already tracked by IMGUIManager. + /// + /// The UIElement instance. + /// Whether the UIElement instance is already tracked by IMGUIManager (true) or not (false). public static bool ExistsElement(UIElement element) { return ExistsElement(element.Name); } + /// + /// Remove an UIElement instance from IMGUIManager. + /// The UIElement will become invisible and stop generating events. + /// + /// The UIElement's unique name. + /// Whether the UIElement instance existed in IMGUIManager (true) or not (false). public static bool RemoveElement(string name) { if (ExistsElement(name)) @@ -46,6 +72,12 @@ namespace GamecraftModdingAPI.Interface.IMGUI return false; } + /// + /// Remove an UIElement instance from IMGUIManager. + /// The UIElement will become invisible and stop generating events. + /// + /// The UIElement instance. + /// Whether the UIElement instance existed in IMGUIManager (true) or not (false). public static bool RemoveElement(UIElement element) { return RemoveElement(element.Name); diff --git a/GamecraftModdingAPI/Interface/IMGUI/Image.cs b/GamecraftModdingAPI/Interface/IMGUI/Image.cs index 8c026ed..b4fac9f 100644 --- a/GamecraftModdingAPI/Interface/IMGUI/Image.cs +++ b/GamecraftModdingAPI/Interface/IMGUI/Image.cs @@ -2,12 +2,22 @@ using UnityEngine; namespace GamecraftModdingAPI.Interface.IMGUI { + /// + /// An image. + /// This wraps Unity's IMGUI Label. + /// public class Image : UIElement { private bool automaticLayout = false; + /// + /// The image texture to display + /// public Texture Texture { get; set; } + /// + /// The rectangular area in the window that the image can use + /// public Rect Box { get; set; } = Rect.zero; public void OnGUI() @@ -23,9 +33,21 @@ namespace GamecraftModdingAPI.Interface.IMGUI } } + /// + /// The image element's unique name. + /// public string Name { get; } + + /// + /// Whether to display the image and everything in it. + /// public bool Enabled { set; get; } = true; + /// + /// Initializes a new instance of the class with automatic layout. + /// + /// Image to display. + /// The element's name. public Image(Texture texture = null, string name = null) { automaticLayout = true; @@ -49,6 +71,12 @@ namespace GamecraftModdingAPI.Interface.IMGUI IMGUIManager.AddElement(this); } + /// + /// Initializes a new instance of the class. + /// + /// Rectangular area for the image. + /// Image to display. + /// The element's name. public Image(Rect box, Texture texture = null, string name = null) : this(texture, name) { this.Box = box; diff --git a/GamecraftModdingAPI/Interface/IMGUI/Label.cs b/GamecraftModdingAPI/Interface/IMGUI/Label.cs index 2fb54f7..2483e3d 100644 --- a/GamecraftModdingAPI/Interface/IMGUI/Label.cs +++ b/GamecraftModdingAPI/Interface/IMGUI/Label.cs @@ -32,9 +32,21 @@ namespace GamecraftModdingAPI.Interface.IMGUI } } + /// + /// The label's unique name. + /// public string Name { get; } + + /// + /// Whether to display the label. + /// public bool Enabled { set; get; } = true; + /// + /// Initializes a new instance of the class with automatic layout. + /// + /// Initial string to display on the label. + /// The element's name. public Label(string initialText = null, string name = null) { automaticLayout = true; @@ -50,6 +62,12 @@ namespace GamecraftModdingAPI.Interface.IMGUI IMGUIManager.AddElement(this); } + /// + /// Initializes a new instance of the . + /// + /// Rectangular area for the label. + /// Initial string to display on the label. + /// The element's name. public Label(Rect box, string initialText = null, string name = null) : this(initialText, name) { this.Box = box; -- 2.30.2 From 37e3c6f71877705656fb45c6d9ff40479681c4ed Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Mon, 28 Dec 2020 13:47:08 -0500 Subject: [PATCH 151/252] Remove debug FMOD patches --- .../Interface/IMGUI/Constants.cs | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/GamecraftModdingAPI/Interface/IMGUI/Constants.cs b/GamecraftModdingAPI/Interface/IMGUI/Constants.cs index 3e2fa8f..42a7f18 100644 --- a/GamecraftModdingAPI/Interface/IMGUI/Constants.cs +++ b/GamecraftModdingAPI/Interface/IMGUI/Constants.cs @@ -147,22 +147,4 @@ namespace GamecraftModdingAPI.Interface.IMGUI _defaultCompletion++; } } - - [HarmonyPatch(typeof(FMODUnity.RuntimeManager), "PlayOneShot", new []{ typeof(Guid), typeof(Vector3)})] - public class FMODRuntimeManagerPlayOneShotPatch - { - public static void Prefix(Guid guid) - { - Logging.MetaLog($"Playing sound with guid '{guid.ToString()}'"); - } - } - - [HarmonyPatch(typeof(FMODUnity.RuntimeManager), "PlayOneShot", new []{ typeof(string), typeof(Vector3)})] - public class FMODRuntimeManagerPlayOneShotPatch2 - { - public static void Prefix(string path) - { - Logging.MetaLog($"Playing sound with str '{path}'"); - } - } } \ No newline at end of file -- 2.30.2 From a6b69d94c92d8139732ca3c9040903373d42340f Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sat, 10 Apr 2021 02:02:47 +0200 Subject: [PATCH 152/252] Start compatibility with Techblox Added some TODOs as well --- Automation/gen_csproj.py | 2 +- GamecraftModdingAPI/App/GameGameEngine.cs | 6 +- GamecraftModdingAPI/App/GameMenuEngine.cs | 12 +- GamecraftModdingAPI/Block.cs | 11 - .../Blocks/BlockCloneEngine.cs | 2 - GamecraftModdingAPI/Blocks/BlockEngine.cs | 6 +- GamecraftModdingAPI/Blocks/BlockEngineInit.cs | 2 +- GamecraftModdingAPI/Blocks/ConsoleBlock.cs | 75 - GamecraftModdingAPI/Blocks/CustomBlock.cs | 4 +- GamecraftModdingAPI/Blocks/MovementEngine.cs | 4 +- GamecraftModdingAPI/Blocks/PlacementEngine.cs | 42 +- GamecraftModdingAPI/Blocks/RotationEngine.cs | 4 +- GamecraftModdingAPI/Blocks/SignalEngine.cs | 4 +- .../GamecraftModdingAPI.csproj | 1730 +++++++++-------- .../Interface/IMGUI/IMGUIManager.cs | 9 +- .../Persistence/SimpleEntitySerializer.cs | 4 +- GamecraftModdingAPI/Players/PlayerEngine.cs | 4 +- 17 files changed, 942 insertions(+), 979 deletions(-) delete mode 100644 GamecraftModdingAPI/Blocks/ConsoleBlock.cs diff --git a/Automation/gen_csproj.py b/Automation/gen_csproj.py index d0f18c4..af00dd1 100755 --- a/Automation/gen_csproj.py +++ b/Automation/gen_csproj.py @@ -32,7 +32,7 @@ if __name__ == "__main__": args = parser.parse_args() print("Building Assembly references") - asmXml = buildReferencesXml("../ref/Gamecraft_Data/Managed") + asmXml = buildReferencesXml("../ref/TechbloxPreview_Data/Managed") # print(asmXml) with open("../GamecraftModdingAPI/GamecraftModdingAPI.csproj", "r") as xmlFile: diff --git a/GamecraftModdingAPI/App/GameGameEngine.cs b/GamecraftModdingAPI/App/GameGameEngine.cs index 85fb672..da270cc 100644 --- a/GamecraftModdingAPI/App/GameGameEngine.cs +++ b/GamecraftModdingAPI/App/GameGameEngine.cs @@ -13,6 +13,7 @@ using Svelto.Tasks.Lean; using GamecraftModdingAPI.Blocks; using GamecraftModdingAPI.Engines; using GamecraftModdingAPI.Utility; +using RobocraftX.Blocks; namespace GamecraftModdingAPI.App { @@ -97,7 +98,7 @@ namespace GamecraftModdingAPI.App public EGID[] GetAllBlocksInGame(BlockIDs filter = BlockIDs.Invalid) { - var allBlocks = entitiesDB.QueryEntities(); + var allBlocks = entitiesDB.QueryEntities(); List blockEGIDs = new List(); if (filter == BlockIDs.Invalid) { @@ -118,7 +119,8 @@ namespace GamecraftModdingAPI.App for (var index = 0; index < array.capacity; index++) { var block = array[index]; - if (block.DBID == (ulong) filter) + uint dbid = entitiesDB.QueryEntity(block.ID).DBID; + if (dbid == (ulong) filter) blockEGIDs.Add(block.ID); } } diff --git a/GamecraftModdingAPI/App/GameMenuEngine.cs b/GamecraftModdingAPI/App/GameMenuEngine.cs index efcb73e..67b159b 100644 --- a/GamecraftModdingAPI/App/GameMenuEngine.cs +++ b/GamecraftModdingAPI/App/GameMenuEngine.cs @@ -44,7 +44,7 @@ namespace GamecraftModdingAPI.App public bool CreateMyGame(EGID id, string path = "", uint thumbnailId = 0, string gameName = "", string creatorName = "", string description = "", long createdDate = 0L) { - EntityComponentInitializer eci = Factory.BuildEntity(id); + EntityInitializer eci = Factory.BuildEntity(id); eci.Init(new MyGameDataEntityStruct { SavedGamePath = new ECSString(path), @@ -93,7 +93,7 @@ namespace GamecraftModdingAPI.App { if (!ExistsGameInfo(id)) return false; GetGameInfo(id).GameName.Set(name); - GetGameViewInfo(id).MyGamesSlotComponent.GameName = StringUtil.SanitiseString(name); + //GetGameViewInfo(id).MyGamesSlotComponent.GameName = StringUtil.SanitiseString(name); - TODO: Input field struct return true; } @@ -101,7 +101,7 @@ namespace GamecraftModdingAPI.App { if (!ExistsGameInfo(id)) return false; GetGameInfo(id).GameDescription.Set(name); - GetGameViewInfo(id).MyGamesSlotComponent.GameDescription = StringUtil.SanitiseString(name); + //GetGameViewInfo(id).MyGamesSlotComponent.GameDescription = StringUtil.SanitiseString(name); - TODO return true; } @@ -115,7 +115,7 @@ namespace GamecraftModdingAPI.App return ref GetComponent(id); } - public ref MyGamesSlotEntityViewStruct GetGameViewInfo(EGID id) + /*public ref MyGamesSlotEntityViewStruct GetGameViewInfo(EGID id) { EntityCollection entities = entitiesDB.QueryEntities(MyGamesScreenExclusiveGroups.GameSlotGuiEntities); @@ -128,8 +128,8 @@ namespace GamecraftModdingAPI.App } } MyGamesSlotEntityViewStruct[] defRef = new MyGamesSlotEntityViewStruct[1]; - return ref defRef[0]; - } + return ref defRef[0]; - TODO: The struct is internal now + }*/ public ref T GetComponent(EGID id) where T: unmanaged, IEntityComponent { diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index 513ad5e..607213d 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -117,7 +117,6 @@ namespace GamecraftModdingAPI private static Dictionary typeToGroup = new Dictionary { - {typeof(ConsoleBlock), new[] {CommonExclusiveGroups.CONSOLE_BLOCK_GROUP}}, {typeof(LogicGate), new [] {CommonExclusiveGroups.LOGIC_BLOCK_GROUP}}, {typeof(Motor), new[] {CommonExclusiveGroups.MOTOR_BLOCK_GROUP}}, {typeof(MusicBlock), new[] {CommonExclusiveGroups.MUSIC_BLOCK_GROUP}}, @@ -436,16 +435,6 @@ namespace GamecraftModdingAPI { var block = PlaceNew(Type, Position, Rotation, Color.Color, Color.Darkness, UniformScale, Scale); block.copiedFrom = Id; - if (Type == BlockIDs.ConsoleBlock - && (this is ConsoleBlock srcCB || (srcCB = Specialise()) != null) - && (block is ConsoleBlock dstCB || (dstCB = block.Specialise()) != null)) - { - //Console block properties are set by a separate engine in the game - dstCB.Arg1 = srcCB.Arg1; - dstCB.Arg2 = srcCB.Arg2; - dstCB.Arg3 = srcCB.Arg3; - dstCB.Command = srcCB.Command; - } return block; } diff --git a/GamecraftModdingAPI/Blocks/BlockCloneEngine.cs b/GamecraftModdingAPI/Blocks/BlockCloneEngine.cs index 0acf44d..1c9c91c 100644 --- a/GamecraftModdingAPI/Blocks/BlockCloneEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlockCloneEngine.cs @@ -48,7 +48,6 @@ namespace GamecraftModdingAPI.Blocks var oldStruct = pickedBlock; pickedBlock.pickedBlockEntityID = sourceID; pickedBlock.placedBlockEntityID = targetID; - pickedBlock.placedBlockTweaksCopied = false; pickedBlock.placedBlockTweaksMustCopy = true; if (entitiesDB.Exists(pickedBlock.pickedBlockEntityID) && entitiesDB.Exists(pickedBlock.placedBlockEntityID)) @@ -66,7 +65,6 @@ namespace GamecraftModdingAPI.Blocks copyWireToBlock.Invoke(Patch.createWireEngine, new object[] {group, pickedBlock.ID}); pickedBlock.placedBlockTweaksMustCopy = false; - pickedBlock.placedBlockTweaksCopied = false; } pickedBlock = oldStruct; //Make sure to not interfere with the game - Although that might not be the case with the wire copying diff --git a/GamecraftModdingAPI/Blocks/BlockEngine.cs b/GamecraftModdingAPI/Blocks/BlockEngine.cs index 53a7254..46afb09 100644 --- a/GamecraftModdingAPI/Blocks/BlockEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlockEngine.cs @@ -114,7 +114,7 @@ namespace GamecraftModdingAPI.Blocks private U GetBlockInitInfo(Block block, Func getter, U def) where T : struct, IEntityComponent { if (block.InitData.Group == null) return def; - var initializer = new EntityComponentInitializer(block.Id, block.InitData.Group); + var initializer = new EntityInitializer(block.Id, block.InitData.Group); if (initializer.Has()) return getter(initializer.Get()); return def; @@ -143,7 +143,7 @@ namespace GamecraftModdingAPI.Blocks { if (block.InitData.Group != null) { - var initializer = new EntityComponentInitializer(block.Id, block.InitData.Group); + var initializer = new EntityInitializer(block.Id, block.InitData.Group); T component = initializer.Has() ? initializer.Get() : default; ref T structRef = ref component; setter(ref structRef, value); @@ -171,7 +171,7 @@ namespace GamecraftModdingAPI.Blocks return true; if (block.InitData.Group == null) return false; - var init = new EntityComponentInitializer(block.Id, block.InitData.Group); + var init = new EntityInitializer(block.Id, block.InitData.Group); return init.Has(); } diff --git a/GamecraftModdingAPI/Blocks/BlockEngineInit.cs b/GamecraftModdingAPI/Blocks/BlockEngineInit.cs index 1bf6c15..aaed6ef 100644 --- a/GamecraftModdingAPI/Blocks/BlockEngineInit.cs +++ b/GamecraftModdingAPI/Blocks/BlockEngineInit.cs @@ -18,7 +18,7 @@ namespace GamecraftModdingAPI.Blocks } internal delegate FasterDictionary GetInitGroup( - EntityComponentInitializer initializer); + EntityInitializer initializer); /// /// Accesses the group field of the initializer diff --git a/GamecraftModdingAPI/Blocks/ConsoleBlock.cs b/GamecraftModdingAPI/Blocks/ConsoleBlock.cs deleted file mode 100644 index e696fca..0000000 --- a/GamecraftModdingAPI/Blocks/ConsoleBlock.cs +++ /dev/null @@ -1,75 +0,0 @@ -using System; - -using RobocraftX.Blocks; -using RobocraftX.Common; -using Svelto.ECS; -using Unity.Mathematics; - -using GamecraftModdingAPI; -using GamecraftModdingAPI.Utility; - -namespace GamecraftModdingAPI.Blocks -{ - public class ConsoleBlock : SignalingBlock - { - public ConsoleBlock(EGID id): base(id) - { - } - - public ConsoleBlock(uint id): base(new EGID(id, CommonExclusiveGroups.CONSOLE_BLOCK_GROUP)) - { - } - - // custom console block properties - - /// - /// Setting a nonexistent command will crash the game when switching to simulation - /// - public string Command - { - get - { - return BlockEngine.GetBlockInfo(this, (ConsoleBlockEntityStruct st) => st.commandName); - } - - set - { - BlockEngine.SetBlockInfo(this, (ref ConsoleBlockEntityStruct st, string val) => st.commandName.Set(val), - value); - } - } - - public string Arg1 - { - get => BlockEngine.GetBlockInfo(this, (ConsoleBlockEntityStruct st) => st.arg1); - - set - { - BlockEngine.SetBlockInfo(this, (ref ConsoleBlockEntityStruct st, string val) => st.arg1.Set(val), - value); - } - } - - public string Arg2 - { - get => BlockEngine.GetBlockInfo(this, (ConsoleBlockEntityStruct st) => st.arg2); - - set - { - BlockEngine.SetBlockInfo(this, (ref ConsoleBlockEntityStruct st, string val) => st.arg2.Set(val), - value); - } - } - - public string Arg3 - { - get => BlockEngine.GetBlockInfo(this, (ConsoleBlockEntityStruct st) => st.arg3); - - set - { - BlockEngine.SetBlockInfo(this, (ref ConsoleBlockEntityStruct st, string val) => st.arg3.Set(val), - value); - } - } - } -} diff --git a/GamecraftModdingAPI/Blocks/CustomBlock.cs b/GamecraftModdingAPI/Blocks/CustomBlock.cs index bafccc2..62d8ce6 100644 --- a/GamecraftModdingAPI/Blocks/CustomBlock.cs +++ b/GamecraftModdingAPI/Blocks/CustomBlock.cs @@ -6,6 +6,7 @@ using System.Reflection; using HarmonyLib; using DataLoader; +using RobocraftX.Common; using RobocraftX.Rendering; using RobocraftX.Schedulers; using Svelto.ECS; @@ -130,8 +131,7 @@ namespace GamecraftModdingAPI.Blocks CubeDescriptionKey = attr.DescKey, SelectableFaces = new[] {0, 1, 2, 3, 4, 5}, GridScale = new[] {5, 5, 5}, - Mass = attr.Mass, - Material = attr.Material, + DefaultMaterialID = 0, //TODO: Material API scalingPermission = attr.ScalingPermission, SortIndex = attr.SortIndex, DefaultColour = attr.DefaultColor.Index, diff --git a/GamecraftModdingAPI/Blocks/MovementEngine.cs b/GamecraftModdingAPI/Blocks/MovementEngine.cs index fb3aa55..6a9b05e 100644 --- a/GamecraftModdingAPI/Blocks/MovementEngine.cs +++ b/GamecraftModdingAPI/Blocks/MovementEngine.cs @@ -40,7 +40,7 @@ namespace GamecraftModdingAPI.Blocks if (!entitiesDB.Exists(blockID)) { if (data.Group == null) return float3.zero; - var init = new EntityComponentInitializer(blockID, data.Group); + var init = new EntityInitializer(blockID, data.Group); init.GetOrCreate().position = vector; init.GetOrCreate().position = vector; init.GetOrCreate().position = vector; @@ -70,7 +70,7 @@ namespace GamecraftModdingAPI.Blocks if (!entitiesDB.Exists(blockID)) { if (data.Group == null) return float3.zero; - var init = new EntityComponentInitializer(blockID, data.Group); + var init = new EntityInitializer(blockID, data.Group); return init.Has() ? init.Get().position : float3.zero; } ref PositionEntityStruct posStruct = ref this.entitiesDB.QueryEntity(blockID); diff --git a/GamecraftModdingAPI/Blocks/PlacementEngine.cs b/GamecraftModdingAPI/Blocks/PlacementEngine.cs index b0d1365..506456b 100644 --- a/GamecraftModdingAPI/Blocks/PlacementEngine.cs +++ b/GamecraftModdingAPI/Blocks/PlacementEngine.cs @@ -38,10 +38,10 @@ namespace GamecraftModdingAPI.Blocks } public EntitiesDB entitiesDB { get; set; } - private static BlockEntityFactory _blockEntityFactory; //Injected from PlaceBlockEngine + private static BlockEntityFactory _blockEntityFactory; //Injected from PlaceSingleBlockEngine public EGID PlaceBlock(BlockIDs block, BlockColors color, byte darkness, float3 position, int uscale, - float3 scale, Player player, float3 rotation, out EntityComponentInitializer initializer) + float3 scale, Player player, float3 rotation, out EntityInitializer initializer) { //It appears that only the non-uniform scale has any visible effect, but if that's not given here it will be set to the uniform one if (darkness > 9) throw new Exception("That is too dark. Make sure to use 0-9 as darkness. (0 is default.)"); @@ -50,7 +50,7 @@ namespace GamecraftModdingAPI.Blocks return initializer.EGID; } - private EntityComponentInitializer BuildBlock(ushort block, byte color, float3 position, int uscale, float3 scale, float3 rot, uint playerId) + private EntityInitializer BuildBlock(ushort block, byte color, float3 position, int uscale, float3 scale, float3 rot, uint playerId) { if (_blockEntityFactory == null) throw new BlockException("The factory is null."); @@ -59,32 +59,34 @@ namespace GamecraftModdingAPI.Blocks if (scale.x < 4e-5) scale.x = uscale; if (scale.y < 4e-5) scale.y = uscale; if (scale.z < 4e-5) scale.z = uscale; - uint dbid = block; - if (!PrefabsID.HasPrefabRegistered(dbid, 0)) - throw new BlockException("Block with ID " + dbid + " not found!"); - //RobocraftX.CR.MachineEditing.PlaceBlockEngine + uint resourceId = (uint) PrefabsID.GenerateResourceID(0, block); + if (!PrefabsID.PrefabIDByResourceIDMap.ContainsKey(resourceId)) + throw new BlockException("Block with ID " + block + " not found!"); + //RobocraftX.CR.MachineEditing.PlaceSingleBlockEngine ScalingEntityStruct scaling = new ScalingEntityStruct {scale = scale}; Quaternion rotQ = Quaternion.Euler(rot); RotationEntityStruct rotation = new RotationEntityStruct {rotation = rotQ}; GridRotationStruct gridRotation = new GridRotationStruct {position = position, rotation = rotQ}; - DBEntityStruct dbEntity = new DBEntityStruct {DBID = dbid}; + DBEntityStruct dbEntity = new DBEntityStruct {DBID = block}; BlockPlacementScaleEntityStruct placementScale = new BlockPlacementScaleEntityStruct { blockPlacementHeight = uscale, blockPlacementWidth = uscale, desiredScaleFactor = uscale }; - EquippedColourStruct colour = new EquippedColourStruct {indexInPalette = color}; - EntityComponentInitializer - structInitializer = - _blockEntityFactory.Build(CommonExclusiveGroups.nextBlockEntityID, dbid); //The ghost block index is only used for triggers - if (colour.indexInPalette != byte.MaxValue) + EntityInitializer structInitializer = _blockEntityFactory.Build(CommonExclusiveGroups.nextBlockEntityID, block); //The ghost block index is only used for triggers + if (color != byte.MaxValue) structInitializer.Init(new ColourParameterEntityStruct { - indexInPalette = colour.indexInPalette, + indexInPalette = color, hasNetworkChange = true }); - uint prefabId = PrefabsID.GetPrefabId(dbid, 0); + structInitializer.Init(new CubeMaterialStruct + { + materialId = 0, //TODO + cosmeticallyPaintedOnly = true //TODO + }); + uint prefabId = PrefabsID.GetOrCreatePrefabID(block, 0, 0, false); //TODO structInitializer.Init(new GFXPrefabEntityStructGPUI(prefabId)); structInitializer.Init(new PhysicsPrefabEntityStruct(prefabId)); structInitializer.Init(dbEntity); @@ -99,16 +101,16 @@ namespace GamecraftModdingAPI.Blocks structInitializer.Init(new BlockPlacementInfoStruct() { loadedFromDisk = false, - placedBy = playerId + placedBy = playerId, + triggerAutoWiring = false //TODO }); - + /*structInitializer.Init(new CollisionFilterOverride { belongsTo = 32U, collidesWith = 239532U });*/ - PrimaryRotationUtility.InitialisePrimaryDirection(rotation.rotation, ref structInitializer); EGID playerEGID = new EGID(playerId, CharacterExclusiveGroups.OnFootGroup); ref PickedBlockExtraDataStruct pickedBlock = ref entitiesDB.QueryEntity(playerEGID); pickedBlock.placedBlockEntityID = structInitializer.EGID; @@ -118,7 +120,7 @@ namespace GamecraftModdingAPI.Blocks public string Name { get; } = "GamecraftModdingAPIPlacementGameEngine"; - public bool isRemovable => false; + public bool isRemovable => false; [HarmonyPatch] public class FactoryObtainerPatch @@ -131,7 +133,7 @@ namespace GamecraftModdingAPI.Blocks static MethodBase TargetMethod(Harmony instance) { - return AccessTools.TypeByName("RobocraftX.CR.MachineEditing.PlaceBlockEngine").GetConstructors()[0]; + return AccessTools.TypeByName("RobocraftX.CR.MachineEditing.PlaceSingleBlockEngine").GetConstructors()[0]; } } } diff --git a/GamecraftModdingAPI/Blocks/RotationEngine.cs b/GamecraftModdingAPI/Blocks/RotationEngine.cs index fbf8c98..3322b92 100644 --- a/GamecraftModdingAPI/Blocks/RotationEngine.cs +++ b/GamecraftModdingAPI/Blocks/RotationEngine.cs @@ -40,7 +40,7 @@ namespace GamecraftModdingAPI.Blocks if (!entitiesDB.Exists(blockID)) { if (data.Group == null) return float3.zero; - var init = new EntityComponentInitializer(blockID, data.Group); + var init = new EntityInitializer(blockID, data.Group); init.GetOrCreate().rotation = Quaternion.Euler(vector); init.GetOrCreate().rotation = Quaternion.Euler(vector); init.GetOrCreate().rotation = Quaternion.Euler(vector); @@ -77,7 +77,7 @@ namespace GamecraftModdingAPI.Blocks if (!entitiesDB.Exists(blockID)) { if (data.Group == null) return float3.zero; - var init = new EntityComponentInitializer(blockID, data.Group); + var init = new EntityInitializer(blockID, data.Group); return init.Has() ? (float3) ((Quaternion) init.Get().rotation).eulerAngles : float3.zero; diff --git a/GamecraftModdingAPI/Blocks/SignalEngine.cs b/GamecraftModdingAPI/Blocks/SignalEngine.cs index 0980d79..22865df 100644 --- a/GamecraftModdingAPI/Blocks/SignalEngine.cs +++ b/GamecraftModdingAPI/Blocks/SignalEngine.cs @@ -42,7 +42,7 @@ namespace GamecraftModdingAPI.Blocks public WireEntityStruct CreateNewWire(EGID startBlock, byte startPort, EGID endBlock, byte endPort) { EGID wireEGID = new EGID(WiresExclusiveGroups.NewWireEntityId, NamedExclusiveGroup.Group); - EntityComponentInitializer wireInitializer = Factory.BuildEntity(wireEGID); + EntityInitializer wireInitializer = Factory.BuildEntity(wireEGID); wireInitializer.Init(new WireEntityStruct { sourceBlockEGID = startBlock, @@ -399,7 +399,7 @@ namespace GamecraftModdingAPI.Blocks exists = false; return ref defRef[0]; } - EntityComponentInitializer initializer = new EntityComponentInitializer(block.Id, block.InitData.Group); + EntityInitializer initializer = new EntityInitializer(block.Id, block.InitData.Group); if (initializer.Has()) { exists = true; diff --git a/GamecraftModdingAPI/GamecraftModdingAPI.csproj b/GamecraftModdingAPI/GamecraftModdingAPI.csproj index 8b6404c..bd4135c 100644 --- a/GamecraftModdingAPI/GamecraftModdingAPI.csproj +++ b/GamecraftModdingAPI/GamecraftModdingAPI.csproj @@ -28,1012 +28,1060 @@ - ..\ref\Gamecraft_Data\Managed\IllusionInjector.dll - ..\..\ref\Gamecraft_Data\Managed\IllusionInjector.dll + ..\ref\TechbloxPreview_Data\Managed\IllusionInjector.dll + ..\..\ref\TechbloxPreview_Data\Managed\IllusionInjector.dll - ..\ref\Gamecraft_Data\Managed\IllusionPlugin.dll - ..\..\ref\Gamecraft_Data\Managed\IllusionPlugin.dll + ..\ref\TechbloxPreview_Data\Managed\IllusionPlugin.dll + ..\..\ref\TechbloxPreview_Data\Managed\IllusionPlugin.dll - ..\ref\Gamecraft_Data\Managed\Analytics.dll - ..\..\ref\Gamecraft_Data\Managed\Analytics.dll + ..\ref\TechbloxPreview_Data\Managed\Analytics.dll + ..\..\ref\TechbloxPreview_Data\Managed\Analytics.dll - ..\ref\Gamecraft_Data\Managed\Assembly-CSharp-firstpass.dll - ..\..\ref\Gamecraft_Data\Managed\Assembly-CSharp-firstpass.dll + ..\ref\TechbloxPreview_Data\Managed\Assembly-CSharp-firstpass.dll + ..\..\ref\TechbloxPreview_Data\Managed\Assembly-CSharp-firstpass.dll - ..\ref\Gamecraft_Data\Managed\Assembly-CSharp.dll - ..\..\ref\Gamecraft_Data\Managed\Assembly-CSharp.dll + ..\ref\TechbloxPreview_Data\Managed\Assembly-CSharp.dll + ..\..\ref\TechbloxPreview_Data\Managed\Assembly-CSharp.dll - - ..\ref\Gamecraft_Data\Managed\Authentication.dll - ..\..\ref\Gamecraft_Data\Managed\Authentication.dll + + ..\ref\TechbloxPreview_Data\Managed\BevelEffect.dll + ..\..\ref\TechbloxPreview_Data\Managed\BevelEffect.dll - ..\ref\Gamecraft_Data\Managed\Blocks.HUDFeedbackBlocks.dll - ..\..\ref\Gamecraft_Data\Managed\Blocks.HUDFeedbackBlocks.dll + ..\ref\TechbloxPreview_Data\Managed\Blocks.HUDFeedbackBlocks.dll + ..\..\ref\TechbloxPreview_Data\Managed\Blocks.HUDFeedbackBlocks.dll - ..\ref\Gamecraft_Data\Managed\CommandLine.dll - ..\..\ref\Gamecraft_Data\Managed\CommandLine.dll + ..\ref\TechbloxPreview_Data\Managed\CommandLine.dll + ..\..\ref\TechbloxPreview_Data\Managed\CommandLine.dll - ..\ref\Gamecraft_Data\Managed\CommandLineCompositionRoot.dll - ..\..\ref\Gamecraft_Data\Managed\CommandLineCompositionRoot.dll - - - ..\ref\Gamecraft_Data\Managed\ConsoleBlockComposotionRoot.dll - ..\..\ref\Gamecraft_Data\Managed\ConsoleBlockComposotionRoot.dll - - - ..\ref\Gamecraft_Data\Managed\ConsoleCommand.dll - ..\..\ref\Gamecraft_Data\Managed\ConsoleCommand.dll + ..\ref\TechbloxPreview_Data\Managed\CommandLineCompositionRoot.dll + ..\..\ref\TechbloxPreview_Data\Managed\CommandLineCompositionRoot.dll - ..\ref\Gamecraft_Data\Managed\DataLoader.dll - ..\..\ref\Gamecraft_Data\Managed\DataLoader.dll + ..\ref\TechbloxPreview_Data\Managed\DataLoader.dll + ..\..\ref\TechbloxPreview_Data\Managed\DataLoader.dll - ..\ref\Gamecraft_Data\Managed\DDNA.dll - ..\..\ref\Gamecraft_Data\Managed\DDNA.dll + ..\ref\TechbloxPreview_Data\Managed\DDNA.dll + ..\..\ref\TechbloxPreview_Data\Managed\DDNA.dll - ..\ref\Gamecraft_Data\Managed\FMODUnity.dll - ..\..\ref\Gamecraft_Data\Managed\FMODUnity.dll + ..\ref\TechbloxPreview_Data\Managed\FMODUnity.dll + ..\..\ref\TechbloxPreview_Data\Managed\FMODUnity.dll - - ..\ref\Gamecraft_Data\Managed\Facepunch.Steamworks.Win64.dll - ..\..\ref\Gamecraft_Data\Managed\Facepunch.Steamworks.Win64.dll + + ..\ref\TechbloxPreview_Data\Managed\FMODUnityResonance.dll + ..\..\ref\TechbloxPreview_Data\Managed\FMODUnityResonance.dll - ..\ref\Gamecraft_Data\Managed\FullGame.dll - ..\..\ref\Gamecraft_Data\Managed\FullGame.dll + ..\ref\TechbloxPreview_Data\Managed\FullGame.dll + ..\..\ref\TechbloxPreview_Data\Managed\FullGame.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.AudioBlocks.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.AudioBlocks.dll + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.AudioBlocks.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.AudioBlocks.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.BlockEntityFactory.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.BlockEntityFactory.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.BlockGroups.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.BlockGroups.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.ConsoleBlock.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.ConsoleBlock.dll + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.BlockEntityFactory.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.BlockEntityFactory.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.DamagingSurfaceBlock.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.DamagingSurfaceBlock.dll + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.DamagingSurfaceBlock.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.DamagingSurfaceBlock.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.DestructionBlocks.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.DestructionBlocks.dll + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.DestructionBlocks.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.DestructionBlocks.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.GenericPhysicsBlocks.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.GenericPhysicsBlocks.dll + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.GenericPhysicsBlocks.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.GenericPhysicsBlocks.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.LightBlock.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.LightBlock.dll + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.LightBlock.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.LightBlock.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.LogicBlock.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.LogicBlock.dll + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.LogicBlock.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.LogicBlock.dll - ..\ref\Gamecraft_Data\Managed\GameCraft.Blocks.ProjectileBlock.dll - ..\..\ref\Gamecraft_Data\Managed\GameCraft.Blocks.ProjectileBlock.dll + ..\ref\TechbloxPreview_Data\Managed\GameCraft.Blocks.ProjectileBlock.dll + ..\..\ref\TechbloxPreview_Data\Managed\GameCraft.Blocks.ProjectileBlock.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.TextBlock.CompositionRoot.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.TextBlock.CompositionRoot.dll + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.TextBlock.CompositionRoot.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.TextBlock.CompositionRoot.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.TimerBlock.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.TimerBlock.dll + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.TimerBlock.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.TimerBlock.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.CharacterVulnerability.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.CharacterVulnerability.dll + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.CharacterVulnerability.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.CharacterVulnerability.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.CharacterVulnerabilityGui.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.CharacterVulnerabilityGui.dll + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.CharacterVulnerabilityGui.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.CharacterVulnerabilityGui.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.ColourPalette.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.ColourPalette.dll + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.ColourPalette.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.ColourPalette.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.Damage.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Damage.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.Effects.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Effects.dll + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Damage.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Damage.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.ExplosionFragments.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.ExplosionFragments.dll + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.ExplosionFragments.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.ExplosionFragments.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.GraphicsSettings.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GraphicsSettings.dll + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GraphicsSettings.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GraphicsSettings.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.BlueprintInventory.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.BlueprintInventory.dll + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.BlueprintInventory.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.BlueprintInventory.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.BlueprintInventoryMock.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.BlueprintInventoryMock.dll + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.BlueprintInventoryMock.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.BlueprintInventoryMock.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Blueprints.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Blueprints.dll + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Blueprints.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Blueprints.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.BlueprintSets.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.BlueprintSets.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.ConsoleBlock.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.ConsoleBlock.dll + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.BlueprintSets.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.BlueprintSets.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.GameOptionsScreen.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.GameOptionsScreen.dll + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.GameOptionsScreen.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.GameOptionsScreen.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Hotbar.Blocks.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Hotbar.Blocks.dll + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Hotbar.Blocks.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Hotbar.Blocks.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Hotbar.BlueprintsHotbar.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Hotbar.BlueprintsHotbar.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Hotbar.Colours.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Hotbar.Colours.dll + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Hotbar.Colours.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Hotbar.Colours.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.HUDFeedbackBlocks.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.HUDFeedbackBlocks.dll + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.HUDFeedbackBlocks.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.HUDFeedbackBlocks.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.ModeBar.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.ModeBar.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.OptionsScreen.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.OptionsScreen.dll + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.ModeBar.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.ModeBar.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.TabsBar.Blocks.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.TabsBar.Blocks.dll + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Blocks.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Blocks.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.TabsBar.Blueprints.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.TabsBar.Blueprints.dll + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Blueprints.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Blueprints.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.TabsBar.Colours.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.TabsBar.Colours.dll + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Colours.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Colours.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.TabsBar.Common.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.TabsBar.Common.dll + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Common.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Common.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.TimeModeClock.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.TimeModeClock.dll + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TimeModeClock.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TimeModeClock.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Tweaks.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Tweaks.dll + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Tweaks.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Tweaks.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Wires.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Wires.dll + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Wires.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Wires.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Wires.Mockup.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.Wires.Mockup.dll + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Wires.Mockup.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Wires.Mockup.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.GUIs.Hotbar.BlueprintsHotbar.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUIs.Hotbar.BlueprintsHotbar.dll + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.InventoryTimeRunning.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.InventoryTimeRunning.dll + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.InventoryTimeRunning.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.InventoryTimeRunning.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.JointBlocks.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.JointBlocks.dll + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.JointBlocks.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.JointBlocks.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.Music.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Music.dll + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Music.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Music.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.NetStrings.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.NetStrings.dll + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.NetStrings.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.NetStrings.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.PerformanceWarnings.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.PerformanceWarnings.dll + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.PerformanceWarnings.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.PerformanceWarnings.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.BlockGroups.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.BlockGroups.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Effects.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Effects.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.OptionsScreen.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.OptionsScreen.dll - ..\ref\Gamecraft_Data\Managed\Gamecraft.PickupBlck.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.PickupBlck.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.PickupsCommon.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.PickupsCommon.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.PopupMessage.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.PopupMessage.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.Projectiles.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Projectiles.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.Serialization.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Serialization.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.Tweaks.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Tweaks.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.Tweaks.Mockup.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Tweaks.Mockup.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.VisualEffects.Decals.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.VisualEffects.Decals.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.VisualEffects.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.VisualEffects.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.Wires.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Wires.dll - - - ..\ref\Gamecraft_Data\Managed\Gamecraft.Wires.Mockup.dll - ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Wires.Mockup.dll - - - ..\ref\Gamecraft_Data\Managed\GameState.dll - ..\..\ref\Gamecraft_Data\Managed\GameState.dll - - - ..\ref\Gamecraft_Data\Managed\GhostShark.Outline.dll - ..\..\ref\Gamecraft_Data\Managed\GhostShark.Outline.dll - - - ..\ref\Gamecraft_Data\Managed\GPUInstancer.dll - ..\..\ref\Gamecraft_Data\Managed\GPUInstancer.dll - - - ..\ref\Gamecraft_Data\Managed\Havok.Physics.dll - ..\..\ref\Gamecraft_Data\Managed\Havok.Physics.dll + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.PickupBlck.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.PickupBlck.dll - ..\ref\Gamecraft_Data\Managed\Havok.Physics.Hybrid.dll - ..\..\ref\Gamecraft_Data\Managed\Havok.Physics.Hybrid.dll - - - ..\ref\Gamecraft_Data\Managed\LZ4.dll - ..\..\ref\Gamecraft_Data\Managed\LZ4.dll - - - ..\ref\Gamecraft_Data\Managed\MultiplayerNetworking.dll - ..\..\ref\Gamecraft_Data\Managed\MultiplayerNetworking.dll - - - ..\ref\Gamecraft_Data\Managed\MultiplayerTest.dll - ..\..\ref\Gamecraft_Data\Managed\MultiplayerTest.dll - - - ..\ref\Gamecraft_Data\Managed\RCX.ScreenshotTaker.dll - ..\..\ref\Gamecraft_Data\Managed\RCX.ScreenshotTaker.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftECS.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftECS.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.AccountPreferences.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.AccountPreferences.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Blocks.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Blocks.dll + ..\ref\TechbloxPreview_Data\Managed\Havok.Physics.Hybrid.dll + ..\..\ref\TechbloxPreview_Data\Managed\Havok.Physics.Hybrid.dll - ..\ref\Gamecraft_Data\Managed\RobocraftX.Blocks.Ghost.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Blocks.Ghost.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Blocks.Triggers.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Blocks.Triggers.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Building.BoxSelect.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Building.BoxSelect.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Building.Jobs.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Building.Jobs.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Character.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Character.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.ClusterToWireConversion.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.ClusterToWireConversion.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Common.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Common.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.ControlsScreen.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.ControlsScreen.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Crosshair.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Crosshair.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.FrontEnd.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.FrontEnd.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.BlockLabel.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.BlockLabel.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.DebugDisplay.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.DebugDisplay.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.Hotbar.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.Hotbar.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.Inventory.BlocksInventory.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.Inventory.BlocksInventory.dll + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Blocks.Ghost.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Blocks.Ghost.dll - ..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.Inventory.ColourInventory.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.Inventory.ColourInventory.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.Inventory.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.Inventory.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.RemoveBlock.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.RemoveBlock.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.ScaleGhost.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.ScaleGhost.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.TabsBar.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.TabsBar.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.GUIs.WorkshopPrefabs.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUIs.WorkshopPrefabs.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Input.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Input.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.MachineEditor.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.MachineEditor.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.MainGame.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.MainGame.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.MainSimulation.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.MainSimulation.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.MockCharacter.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.MockCharacter.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Multiplayer.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Multiplayer.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Multiplayer.GUI.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Multiplayer.GUI.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Multiplayer.Serializers.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Multiplayer.Serializers.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.MultiplayerInput.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.MultiplayerInput.dll + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.ColourInventory.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.ColourInventory.dll - ..\ref\Gamecraft_Data\Managed\Robocraftx.ObjectIdBlocks.dll - ..\..\ref\Gamecraft_Data\Managed\Robocraftx.ObjectIdBlocks.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Party.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Party.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.PartyGui.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.PartyGui.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Physics.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Physics.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.PilotSeat.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.PilotSeat.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Player.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Player.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Rendering.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Rendering.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Rendering.Mock.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Rendering.Mock.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.SaveAndLoad.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.SaveAndLoad.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.SaveGameDialog.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.SaveGameDialog.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.Services.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Services.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.SignalHandling.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.SignalHandling.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX.StateSync.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX.StateSync.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX_SpawnPoints.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX_SpawnPoints.dll - - - ..\ref\Gamecraft_Data\Managed\RobocraftX_TextBlock.dll - ..\..\ref\Gamecraft_Data\Managed\RobocraftX_TextBlock.dll - - - ..\ref\Gamecraft_Data\Managed\RobocratX.SimulationMockCompositionRoot.dll - ..\..\ref\Gamecraft_Data\Managed\RobocratX.SimulationMockCompositionRoot.dll - - - ..\ref\Gamecraft_Data\Managed\SpawningPointCompositionRoot.dll - ..\..\ref\Gamecraft_Data\Managed\SpawningPointCompositionRoot.dll - - - ..\ref\Gamecraft_Data\Managed\SpecializedDescriptors.dll - ..\..\ref\Gamecraft_Data\Managed\SpecializedDescriptors.dll + ..\ref\TechbloxPreview_Data\Managed\Robocraftx.ObjectIdBlocks.dll + ..\..\ref\TechbloxPreview_Data\Managed\Robocraftx.ObjectIdBlocks.dll - ..\ref\Gamecraft_Data\Managed\StringFormatter.dll - ..\..\ref\Gamecraft_Data\Managed\StringFormatter.dll + ..\ref\TechbloxPreview_Data\Managed\StringFormatter.dll + ..\..\ref\TechbloxPreview_Data\Managed\StringFormatter.dll - - ..\ref\Gamecraft_Data\Managed\Svelto.Common.dll - ..\..\ref\Gamecraft_Data\Managed\Svelto.Common.dll - - - ..\ref\Gamecraft_Data\Managed\Svelto.ECS.dll - ..\..\ref\Gamecraft_Data\Managed\Svelto.ECS.dll - - - ..\ref\Gamecraft_Data\Managed\Svelto.Services.dll - ..\..\ref\Gamecraft_Data\Managed\Svelto.Services.dll - - - ..\ref\Gamecraft_Data\Managed\Svelto.Tasks.dll - ..\..\ref\Gamecraft_Data\Managed\Svelto.Tasks.dll - - - ..\ref\Gamecraft_Data\Managed\UltimateDecals.dll - ..\..\ref\Gamecraft_Data\Managed\UltimateDecals.dll + + ..\ref\TechbloxPreview_Data\Managed\Techblox.FlyCam.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.FlyCam.dll - ..\ref\Gamecraft_Data\Managed\Unity.Addressables.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Addressables.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Build.SlimPlayerRuntime.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Build.SlimPlayerRuntime.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Burst.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Burst.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Collections.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Collections.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Collections.LowLevel.ILSupport.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Collections.LowLevel.ILSupport.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Deformations.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Deformations.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Entities.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Entities.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Entities.Hybrid.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Entities.Hybrid.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.InternalAPIEngineBridge.012.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.InternalAPIEngineBridge.012.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Jobs.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Jobs.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Mathematics.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Mathematics.dll + ..\ref\TechbloxPreview_Data\Managed\Unity.Addressables.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Addressables.dll - ..\ref\Gamecraft_Data\Managed\Unity.Mathematics.Extensions.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Mathematics.Extensions.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.MemoryProfiler.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.MemoryProfiler.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Physics.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Physics.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Physics.Hybrid.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Physics.Hybrid.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Platforms.Common.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Platforms.Common.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Properties.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Properties.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Properties.Reflection.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Properties.Reflection.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Properties.UI.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Properties.UI.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.RenderPipeline.Universal.ShaderLibrary.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipeline.Universal.ShaderLibrary.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Universal.Runtime.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Universal.Runtime.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Universal.Shaders.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Universal.Shaders.dll + ..\ref\TechbloxPreview_Data\Managed\Unity.Mathematics.Extensions.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Mathematics.Extensions.dll - ..\ref\Gamecraft_Data\Managed\Unity.ResourceManager.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.ResourceManager.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Scenes.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Scenes.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.ScriptableBuildPipeline.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.ScriptableBuildPipeline.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Serialization.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Serialization.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.TextMeshPro.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.TextMeshPro.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Timeline.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Timeline.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Transforms.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Transforms.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Transforms.Hybrid.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Transforms.Hybrid.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.VisualEffectGraph.Runtime.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.VisualEffectGraph.Runtime.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.UI.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UI.dll - - - ..\ref\Gamecraft_Data\Managed\uREPL.dll - ..\..\ref\Gamecraft_Data\Managed\uREPL.dll - - - ..\ref\Gamecraft_Data\Managed\VisualProfiler.dll - ..\..\ref\Gamecraft_Data\Managed\VisualProfiler.dll - - - ..\ref\Gamecraft_Data\Managed\Accessibility.dll - ..\..\ref\Gamecraft_Data\Managed\Accessibility.dll - - - ..\ref\Gamecraft_Data\Managed\Facepunch.Steamworks.Win64.dll - ..\..\ref\Gamecraft_Data\Managed\Facepunch.Steamworks.Win64.dll - - - ..\ref\Gamecraft_Data\Managed\JWT.dll - ..\..\ref\Gamecraft_Data\Managed\JWT.dll - - - ..\ref\Gamecraft_Data\Managed\mscorlib.dll - ..\..\ref\Gamecraft_Data\Managed\mscorlib.dll - - - ..\ref\Gamecraft_Data\Managed\netstandard.dll - ..\..\ref\Gamecraft_Data\Managed\netstandard.dll - - - ..\ref\Gamecraft_Data\Managed\Newtonsoft.Json.dll - ..\..\ref\Gamecraft_Data\Managed\Newtonsoft.Json.dll - - - ..\ref\Gamecraft_Data\Managed\Novell.Directory.Ldap.dll - ..\..\ref\Gamecraft_Data\Managed\Novell.Directory.Ldap.dll - - - ..\ref\Gamecraft_Data\Managed\Rewired_Core.dll - ..\..\ref\Gamecraft_Data\Managed\Rewired_Core.dll - - - ..\ref\Gamecraft_Data\Managed\Rewired_Windows.dll - ..\..\ref\Gamecraft_Data\Managed\Rewired_Windows.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Burst.Unsafe.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Burst.Unsafe.dll - - - ..\ref\Gamecraft_Data\Managed\Unity.Collections.LowLevel.ILSupport.dll - ..\..\ref\Gamecraft_Data\Managed\Unity.Collections.LowLevel.ILSupport.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.AccessibilityModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.AccessibilityModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.AIModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.AIModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.AndroidJNIModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.AndroidJNIModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.AnimationModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.AnimationModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.ARModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.ARModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.AssetBundleModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.AssetBundleModule.dll + ..\ref\TechbloxPreview_Data\Managed\Unity.ResourceManager.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.ResourceManager.dll - ..\ref\Gamecraft_Data\Managed\UnityEngine.AudioModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.AudioModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.ClothModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.ClothModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.ClusterInputModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.ClusterInputModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.ClusterRendererModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.ClusterRendererModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.CoreModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.CoreModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.CrashReportingModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.CrashReportingModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.DirectorModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.DirectorModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.DSPGraphModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.DSPGraphModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.GameCenterModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.GameCenterModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.GridModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.GridModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.HotReloadModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.HotReloadModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.ImageConversionModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.ImageConversionModule.dll + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.AudioModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.AudioModule.dll - ..\ref\Gamecraft_Data\Managed\UnityEngine.IMGUIModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.IMGUIModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.InputLegacyModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.InputLegacyModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.InputModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.InputModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.JSONSerializeModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.JSONSerializeModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.LocalizationModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.LocalizationModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.ParticleSystemModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.ParticleSystemModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.PerformanceReportingModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.PerformanceReportingModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.Physics2DModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.Physics2DModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.PhysicsModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.PhysicsModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.ProfilerModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.ProfilerModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.ScreenCaptureModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.ScreenCaptureModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.SharedInternalsModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.SharedInternalsModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.SpriteMaskModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.SpriteMaskModule.dll + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.IMGUIModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.IMGUIModule.dll - ..\ref\Gamecraft_Data\Managed\UnityEngine.SpriteShapeModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.SpriteShapeModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.StreamingModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.StreamingModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.SubstanceModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.SubstanceModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.SubsystemsModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.SubsystemsModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.TerrainModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.TerrainModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.TerrainPhysicsModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.TerrainPhysicsModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.TextCoreModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.TextCoreModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.TextRenderingModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.TextRenderingModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.TilemapModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.TilemapModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.TLSModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.TLSModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.UIElementsModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UIElementsModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.UIElementsNativeModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UIElementsNativeModule.dll - - - ..\ref\Gamecraft_Data\Managed\UnityEngine.UIModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UIModule.dll + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.SpriteShapeModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.SpriteShapeModule.dll - ..\ref\Gamecraft_Data\Managed\UnityEngine.UmbraModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UmbraModule.dll + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UmbraModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UmbraModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.PickupsCommon.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.PickupsCommon.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.PopupMessage.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.PopupMessage.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Projectiles.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Projectiles.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Serialization.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Serialization.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Tweaks.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Tweaks.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Tweaks.Mockup.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Tweaks.Mockup.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.VisualEffects.Decals.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.VisualEffects.Decals.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.VisualEffects.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.VisualEffects.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Wires.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Wires.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Wires.Mockup.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Wires.Mockup.dll + + + ..\ref\TechbloxPreview_Data\Managed\GameState.dll + ..\..\ref\TechbloxPreview_Data\Managed\GameState.dll + + + ..\ref\TechbloxPreview_Data\Managed\GhostShark.Outline.dll + ..\..\ref\TechbloxPreview_Data\Managed\GhostShark.Outline.dll + + + ..\ref\TechbloxPreview_Data\Managed\GPUInstancer.CrowdAnimations.dll + ..\..\ref\TechbloxPreview_Data\Managed\GPUInstancer.CrowdAnimations.dll + + + ..\ref\TechbloxPreview_Data\Managed\GPUInstancer.dll + ..\..\ref\TechbloxPreview_Data\Managed\GPUInstancer.dll + + + ..\ref\TechbloxPreview_Data\Managed\Havok.Physics.dll + ..\..\ref\TechbloxPreview_Data\Managed\Havok.Physics.dll + + + ..\ref\TechbloxPreview_Data\Managed\JWT.dll + ..\..\ref\TechbloxPreview_Data\Managed\JWT.dll + + + ..\ref\TechbloxPreview_Data\Managed\LZ4.dll + ..\..\ref\TechbloxPreview_Data\Managed\LZ4.dll + + + ..\ref\TechbloxPreview_Data\Managed\mscorlib.dll + ..\..\ref\TechbloxPreview_Data\Managed\mscorlib.dll + + + ..\ref\TechbloxPreview_Data\Managed\MultiplayerNetworking.dll + ..\..\ref\TechbloxPreview_Data\Managed\MultiplayerNetworking.dll + + + ..\ref\TechbloxPreview_Data\Managed\MultiplayerTest.dll + ..\..\ref\TechbloxPreview_Data\Managed\MultiplayerTest.dll + + + ..\ref\TechbloxPreview_Data\Managed\netstandard.dll + ..\..\ref\TechbloxPreview_Data\Managed\netstandard.dll + + + ..\ref\TechbloxPreview_Data\Managed\Newtonsoft.Json.dll + ..\..\ref\TechbloxPreview_Data\Managed\Newtonsoft.Json.dll + + + ..\ref\TechbloxPreview_Data\Managed\RCX.ScreenshotTaker.dll + ..\..\ref\TechbloxPreview_Data\Managed\RCX.ScreenshotTaker.dll + + + ..\ref\TechbloxPreview_Data\Managed\Rewired_Core.dll + ..\..\ref\TechbloxPreview_Data\Managed\Rewired_Core.dll + + + ..\ref\TechbloxPreview_Data\Managed\Rewired_Windows.dll + ..\..\ref\TechbloxPreview_Data\Managed\Rewired_Windows.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftECS.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftECS.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.AccountPreferences.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.AccountPreferences.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Blocks.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Blocks.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Blocks.Triggers.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Blocks.Triggers.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Building.BoxSelect.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Building.BoxSelect.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Building.Jobs.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Building.Jobs.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Character.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Character.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Common.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Common.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.ControlsScreen.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.ControlsScreen.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Crosshair.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Crosshair.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.FrontEnd.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.FrontEnd.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.BlockLabel.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.BlockLabel.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.DebugDisplay.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.DebugDisplay.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Hotbar.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Hotbar.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.BlocksInventory.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.BlocksInventory.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.RemoveBlock.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.RemoveBlock.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.ScaleGhost.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.ScaleGhost.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.TabsBar.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.TabsBar.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Input.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Input.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.MachineEditor.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.MachineEditor.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.MainGame.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.MainGame.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.MainSimulation.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.MainSimulation.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.MockCharacter.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.MockCharacter.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Multiplayer.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Multiplayer.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Multiplayer.GUI.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Multiplayer.GUI.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Multiplayer.Serializers.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Multiplayer.Serializers.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.MultiplayerInput.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.MultiplayerInput.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Party.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Party.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Physics.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Physics.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.PilotSeat.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.PilotSeat.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Player.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Player.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Rendering.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Rendering.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Rendering.Mock.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Rendering.Mock.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.SaveAndLoad.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.SaveAndLoad.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.SaveGameDialog.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.SaveGameDialog.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Services.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Services.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.SignalHandling.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.SignalHandling.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.SpawnPoints.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.SpawnPoints.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.StateSync.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.StateSync.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX_TextBlock.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX_TextBlock.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocratX.SimulationMockCompositionRoot.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocratX.SimulationMockCompositionRoot.dll + + + ..\ref\TechbloxPreview_Data\Managed\SpecializedDescriptors.dll + ..\..\ref\TechbloxPreview_Data\Managed\SpecializedDescriptors.dll + + + ..\ref\TechbloxPreview_Data\Managed\Svelto.Common.dll + ..\..\ref\TechbloxPreview_Data\Managed\Svelto.Common.dll + + + ..\ref\TechbloxPreview_Data\Managed\Svelto.ECS.dll + ..\..\ref\TechbloxPreview_Data\Managed\Svelto.ECS.dll + + + ..\ref\TechbloxPreview_Data\Managed\Svelto.Services.dll + ..\..\ref\TechbloxPreview_Data\Managed\Svelto.Services.dll + + + ..\ref\TechbloxPreview_Data\Managed\Svelto.Tasks.dll + ..\..\ref\TechbloxPreview_Data\Managed\Svelto.Tasks.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.AutoForward.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.AutoForward.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.Camera.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Camera.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.EngineBlock.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.EngineBlock.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.Environment.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Environment.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Hotbar.Materials.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Hotbar.Materials.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Inventory.Common.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Inventory.Common.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Inventory.Materials.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Inventory.Materials.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.MyGamesScreen.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.MyGamesScreen.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.TabsBar.Materials.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.TabsBar.Materials.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.InputCapture.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.InputCapture.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.MouseCursor.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.MouseCursor.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.SwitchAnimation.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.SwitchAnimation.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.WheelRigBlock.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.WheelRigBlock.dll + + + ..\ref\TechbloxPreview_Data\Managed\UniTask.Addressables.dll + ..\..\ref\TechbloxPreview_Data\Managed\UniTask.Addressables.dll + + + ..\ref\TechbloxPreview_Data\Managed\UniTask.dll + ..\..\ref\TechbloxPreview_Data\Managed\UniTask.dll + + + ..\ref\TechbloxPreview_Data\Managed\UniTask.DOTween.dll + ..\..\ref\TechbloxPreview_Data\Managed\UniTask.DOTween.dll + + + ..\ref\TechbloxPreview_Data\Managed\UniTask.Linq.dll + ..\..\ref\TechbloxPreview_Data\Managed\UniTask.Linq.dll + + + ..\ref\TechbloxPreview_Data\Managed\UniTask.TextMeshPro.dll + ..\..\ref\TechbloxPreview_Data\Managed\UniTask.TextMeshPro.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.Mdb.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.Mdb.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.Pdb.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.Pdb.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.Rocks.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.Rocks.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Burst.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Burst.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Unsafe.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Unsafe.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Collections.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Collections.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Collections.LowLevel.ILSupport.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Collections.LowLevel.ILSupport.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Deformations.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Deformations.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Entities.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Entities.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Entities.Hybrid.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Entities.Hybrid.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.InternalAPIEngineBridge.012.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.InternalAPIEngineBridge.012.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Jobs.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Jobs.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Mathematics.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Mathematics.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.MemoryProfiler.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.MemoryProfiler.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Physics.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Physics.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Physics.Hybrid.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Physics.Hybrid.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Platforms.Common.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Platforms.Common.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Properties.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Properties.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Properties.Reflection.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Properties.Reflection.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Properties.UI.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Properties.UI.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.HighDefinition.Config.Runtime.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.HighDefinition.Config.Runtime.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.HighDefinition.Runtime.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.HighDefinition.Runtime.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Scenes.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Scenes.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.ScriptableBuildPipeline.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.ScriptableBuildPipeline.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Serialization.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Serialization.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.TextMeshPro.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.TextMeshPro.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Timeline.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Timeline.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Transforms.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Transforms.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Transforms.Hybrid.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Transforms.Hybrid.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.VisualEffectGraph.Runtime.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.VisualEffectGraph.Runtime.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.AccessibilityModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.AccessibilityModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.AIModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.AIModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.AndroidJNIModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.AndroidJNIModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.AnimationModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.AnimationModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.ARModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.ARModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.AssetBundleModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.AssetBundleModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.ClothModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.ClothModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.ClusterInputModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.ClusterInputModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.ClusterRendererModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.ClusterRendererModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.CoreModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.CoreModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.CrashReportingModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.CrashReportingModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.DirectorModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.DirectorModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.DSPGraphModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.DSPGraphModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.GameCenterModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.GameCenterModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.GIModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.GIModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.GridModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.GridModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.HotReloadModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.HotReloadModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.ImageConversionModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.ImageConversionModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.InputLegacyModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.InputLegacyModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.InputModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.InputModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.JSONSerializeModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.JSONSerializeModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.LocalizationModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.LocalizationModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.ParticleSystemModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.ParticleSystemModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.PerformanceReportingModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.PerformanceReportingModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.Physics2DModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.Physics2DModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.PhysicsModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.PhysicsModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.ProfilerModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.ProfilerModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.ScreenCaptureModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.ScreenCaptureModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.SharedInternalsModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.SharedInternalsModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.SpriteMaskModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.SpriteMaskModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.StreamingModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.StreamingModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.SubstanceModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.SubstanceModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.SubsystemsModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.SubsystemsModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.TerrainModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.TerrainModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.TerrainPhysicsModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.TerrainPhysicsModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.TextCoreModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.TextCoreModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.TextRenderingModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.TextRenderingModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.TilemapModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.TilemapModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.TLSModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.TLSModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UI.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UI.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UIElementsModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UIElementsModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UIElementsNativeModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UIElementsNativeModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UIModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UIModule.dll - ..\ref\Gamecraft_Data\Managed\UnityEngine.UNETModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UNETModule.dll + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UNETModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UNETModule.dll - ..\ref\Gamecraft_Data\Managed\UnityEngine.UnityAnalyticsModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UnityAnalyticsModule.dll + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityAnalyticsModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityAnalyticsModule.dll - ..\ref\Gamecraft_Data\Managed\UnityEngine.UnityConnectModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UnityConnectModule.dll + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityConnectModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityConnectModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityCurlModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityCurlModule.dll - ..\ref\Gamecraft_Data\Managed\UnityEngine.UnityTestProtocolModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UnityTestProtocolModule.dll + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityTestProtocolModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityTestProtocolModule.dll - ..\ref\Gamecraft_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll - ..\ref\Gamecraft_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll - ..\ref\Gamecraft_Data\Managed\UnityEngine.UnityWebRequestModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UnityWebRequestModule.dll + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestModule.dll - ..\ref\Gamecraft_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll - ..\ref\Gamecraft_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll - ..\ref\Gamecraft_Data\Managed\UnityEngine.VehiclesModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.VehiclesModule.dll + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.VehiclesModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.VehiclesModule.dll - ..\ref\Gamecraft_Data\Managed\UnityEngine.VFXModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.VFXModule.dll + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.VFXModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.VFXModule.dll - ..\ref\Gamecraft_Data\Managed\UnityEngine.VideoModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.VideoModule.dll + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.VideoModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.VideoModule.dll - ..\ref\Gamecraft_Data\Managed\UnityEngine.VirtualTexturingModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.VirtualTexturingModule.dll + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.VirtualTexturingModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.VirtualTexturingModule.dll - ..\ref\Gamecraft_Data\Managed\UnityEngine.VRModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.VRModule.dll + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.VRModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.VRModule.dll - ..\ref\Gamecraft_Data\Managed\UnityEngine.WindModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.WindModule.dll + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.WindModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.WindModule.dll - ..\ref\Gamecraft_Data\Managed\UnityEngine.XRModule.dll - ..\..\ref\Gamecraft_Data\Managed\UnityEngine.XRModule.dll + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.XRModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.XRModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\uREPL.dll + ..\..\ref\TechbloxPreview_Data\Managed\uREPL.dll + + + ..\ref\TechbloxPreview_Data\Managed\VisualProfiler.dll + ..\..\ref\TechbloxPreview_Data\Managed\VisualProfiler.dll diff --git a/GamecraftModdingAPI/Interface/IMGUI/IMGUIManager.cs b/GamecraftModdingAPI/Interface/IMGUI/IMGUIManager.cs index e75f8f2..a4bb6d2 100644 --- a/GamecraftModdingAPI/Interface/IMGUI/IMGUIManager.cs +++ b/GamecraftModdingAPI/Interface/IMGUI/IMGUIManager.cs @@ -22,7 +22,7 @@ namespace GamecraftModdingAPI.Interface.IMGUI { internal static OnGuiRunner ImguiScheduler = new OnGuiRunner("GamecraftModdingAPI_IMGUIScheduler"); - private static FasterDictionary _activeElements = new FasterDictionary(); + private static Dictionary _activeElements = new Dictionary(); /// /// Add an UIElement instance to be managed by IMGUIManager. @@ -85,11 +85,10 @@ namespace GamecraftModdingAPI.Interface.IMGUI private static void OnGUI() { - UIElement[] elements = _activeElements.GetValuesArray(out uint count); - for(uint i = 0; i < count; i++) + foreach (var element in _activeElements.Values) { - if (elements[i].Enabled) - elements[i].OnGUI(); + if (element.Enabled) + element.OnGUI(); /*try { if (elements[i].Enabled) diff --git a/GamecraftModdingAPI/Persistence/SimpleEntitySerializer.cs b/GamecraftModdingAPI/Persistence/SimpleEntitySerializer.cs index 3e136ae..59fd9fd 100644 --- a/GamecraftModdingAPI/Persistence/SimpleEntitySerializer.cs +++ b/GamecraftModdingAPI/Persistence/SimpleEntitySerializer.cs @@ -23,9 +23,9 @@ namespace GamecraftModdingAPI.Persistence public EntitiesDB entitiesDB { set; protected get; } - public EntityComponentInitializer BuildDeserializedEntity(EGID egid, ISerializationData serializationData, ISerializableEntityDescriptor entityDescriptor, int serializationType, IEntitySerialization entitySerialization, IEntityFactory factory, bool enginesRootIsDeserializationOnly) + public EntityInitializer BuildDeserializedEntity(EGID egid, ISerializationData serializationData, ISerializableEntityDescriptor entityDescriptor, int serializationType, IEntitySerialization entitySerialization, IEntityFactory factory, bool enginesRootIsDeserializationOnly) { - EntityComponentInitializer esi = factory.BuildEntity(egid); + EntityInitializer esi = factory.BuildEntity(egid); entitySerialization.DeserializeEntityComponents(serializationData, entityDescriptor, ref esi, serializationType); return esi; } diff --git a/GamecraftModdingAPI/Players/PlayerEngine.cs b/GamecraftModdingAPI/Players/PlayerEngine.cs index e253eac..189b3a8 100644 --- a/GamecraftModdingAPI/Players/PlayerEngine.cs +++ b/GamecraftModdingAPI/Players/PlayerEngine.cs @@ -10,10 +10,10 @@ using RobocraftX.Common.Input; using RobocraftX.CR.MachineEditing.BoxSelect; using RobocraftX.Physics; using RobocraftX.Blocks.Ghost; -using RobocraftX.Character.Camera; -using RobocraftX.Character.Factories; using Gamecraft.GUI.HUDFeedbackBlocks; using Svelto.ECS; +using Techblox.Camera; +using Techblox.FlyCam; using Unity.Mathematics; using Unity.Physics; using UnityEngine; -- 2.30.2 From 2d41026a05a2604edfb3e2198d327497afdbfc1e Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sun, 11 Apr 2021 02:36:00 +0200 Subject: [PATCH 153/252] Turned the rest of the errors into TODOs --- GamecraftModdingAPI/Input/FakeInput.cs | 6 +++--- GamecraftModdingAPI/Inventory/HotbarEngine.cs | 4 ++-- GamecraftModdingAPI/Players/PlayerEngine.cs | 2 +- GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs | 4 ++-- GamecraftModdingAPI/Utility/AsyncUtilsEngine.cs | 5 +++-- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/GamecraftModdingAPI/Input/FakeInput.cs b/GamecraftModdingAPI/Input/FakeInput.cs index 8cab6f5..a8129a9 100644 --- a/GamecraftModdingAPI/Input/FakeInput.cs +++ b/GamecraftModdingAPI/Input/FakeInput.cs @@ -109,8 +109,8 @@ namespace GamecraftModdingAPI.Input } ref LocalInputEntityStruct currentInput = ref inputEngine.GetInputRef(playerID); //Utility.Logging.CommandLog($"Current sim frame {currentInput.frame}"); - // set inputs - if (toggleMode) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.ToggleTimeRunningMode; + // set inputs - TODO + /*if (toggleMode) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.ToggleTimeRunningMode; if (forward) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.Forward; if (backward) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.Backward; if (up) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.Up; @@ -134,7 +134,7 @@ namespace GamecraftModdingAPI.Input if (rotateBlockCounterclockwise) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.RotateBlockAnticlockwise; if (cutSelection) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.CutSelection; if (copySelection) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.CopySelection; - if (deleteSelection) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.DeleteSelection; + if (deleteSelection) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.DeleteSelection;*/ } public static void Init() diff --git a/GamecraftModdingAPI/Inventory/HotbarEngine.cs b/GamecraftModdingAPI/Inventory/HotbarEngine.cs index 34cdf12..ab9b7d2 100644 --- a/GamecraftModdingAPI/Inventory/HotbarEngine.cs +++ b/GamecraftModdingAPI/Inventory/HotbarEngine.cs @@ -41,8 +41,8 @@ namespace GamecraftModdingAPI.Inventory for (int i = 0; i < inputs.count; i++) { if (inputs.buffer[i].ID.entityID == playerID) { - inputs.buffer[i].cubeSelectedByPick = cubeSelectedByPick; - inputs.buffer[i].selectedCube = block; + /*inputs.buffer[i].cubeSelectedByPick = cubeSelectedByPick; - TODO + inputs.buffer[i].selectedCube = block;*/ return true; } } diff --git a/GamecraftModdingAPI/Players/PlayerEngine.cs b/GamecraftModdingAPI/Players/PlayerEngine.cs index 189b3a8..dfdb580 100644 --- a/GamecraftModdingAPI/Players/PlayerEngine.cs +++ b/GamecraftModdingAPI/Players/PlayerEngine.cs @@ -232,7 +232,7 @@ namespace GamecraftModdingAPI.Players EGID egid = new EGID(playerId, PlayerGroupFromEnum(type)); if (entitiesDB.Exists(egid)) { - return entitiesDB.QueryEntity(egid).lastPingTimeSinceLevelLoad; + //return entitiesDB.QueryEntity(egid).lastPingTimeSinceLevelLoad; - TODO } return null; } diff --git a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs index acb8bc4..919e639 100644 --- a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs +++ b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs @@ -242,7 +242,7 @@ namespace GamecraftModdingAPI.Tests } }).Build(); - CommandBuilder.Builder() + /*CommandBuilder.Builder() .Name("PlaceConsole") .Description("Place a bunch of console block with a given text - entering simulation with them crashes the game as the cmd doesn't exist") .Action((float x, float y, float z) => @@ -262,7 +262,7 @@ namespace GamecraftModdingAPI.Tests sw.Stop(); Logging.CommandLog($"Blocks placed in {sw.ElapsedMilliseconds} ms"); }) - .Build(); + .Build();*/ CommandBuilder.Builder() .Name("WireTest") diff --git a/GamecraftModdingAPI/Utility/AsyncUtilsEngine.cs b/GamecraftModdingAPI/Utility/AsyncUtilsEngine.cs index 56aab89..7b6ef1e 100644 --- a/GamecraftModdingAPI/Utility/AsyncUtilsEngine.cs +++ b/GamecraftModdingAPI/Utility/AsyncUtilsEngine.cs @@ -16,10 +16,11 @@ namespace GamecraftModdingAPI.Utility private IEnumerator WaitForSubmissionInternal(IEntityFunctions efu, IEntityFactory efa, EntitiesDB entitiesDB, TaskCompletionSource task) { - var waitEnumerator = new WaitForSubmissionEnumerator(efu, efa, entitiesDB); + /*var waitEnumerator = new WaitForSubmissionEnumerator(efu, efa, entitiesDB); while (waitEnumerator.MoveNext()) yield return null; - task.SetResult(null); + task.SetResult(null);*/ + yield break; //TODO } private IEnumerator WaitForNextFrameInternal(TaskCompletionSource task) -- 2.30.2 From 98e00de6420769bf23891839ac482e44ec5927ed Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Mon, 12 Apr 2021 17:37:51 +0200 Subject: [PATCH 154/252] Fix all startup errors --- GamecraftModdingAPI/Blocks/CustomBlock.cs | 2 +- .../Inventory/HotbarSlotSelectionHandlerEnginePatch.cs | 4 ++-- GamecraftModdingAPI/Main.cs | 2 +- GamecraftModdingAPI/Persistence/SaveGameEnginePatch.cs | 2 +- GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs | 6 +++--- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/GamecraftModdingAPI/Blocks/CustomBlock.cs b/GamecraftModdingAPI/Blocks/CustomBlock.cs index 62d8ce6..535ce7a 100644 --- a/GamecraftModdingAPI/Blocks/CustomBlock.cs +++ b/GamecraftModdingAPI/Blocks/CustomBlock.cs @@ -83,7 +83,7 @@ namespace GamecraftModdingAPI.Blocks //public static ExclusiveGroup Group { get; } = new ExclusiveGroup("Custom block"); - [HarmonyPatch] + //[HarmonyPatch] - TODO public static class MaterialCopyPatch { private static Material[] materials; diff --git a/GamecraftModdingAPI/Inventory/HotbarSlotSelectionHandlerEnginePatch.cs b/GamecraftModdingAPI/Inventory/HotbarSlotSelectionHandlerEnginePatch.cs index a0ad5c1..153d82c 100644 --- a/GamecraftModdingAPI/Inventory/HotbarSlotSelectionHandlerEnginePatch.cs +++ b/GamecraftModdingAPI/Inventory/HotbarSlotSelectionHandlerEnginePatch.cs @@ -15,9 +15,9 @@ namespace GamecraftModdingAPI.Inventory public static BlockIDs EquippedPartID { get => (BlockIDs)selectedBlockInt; } - private static MethodInfo PatchedMethod { get; } = AccessTools.Method("Gamecraft.GUI.Hotbar.Blocks.SyncHotbarSlotSelectedToEquippedPartEngine:ActivateSlotForCube", parameters: new Type[] { typeof(uint), typeof(int), typeof(ExclusiveGroupStruct) }); + private static MethodInfo PatchedMethod { get; } = AccessTools.Method("Gamecraft.GUI.Hotbar.Blocks.SyncHotbarSlotSelectedToEquippedPartEngine:ActivateSlotForCube", parameters: new Type[] { typeof(uint), typeof(int) }); - public static void Prefix(uint playerID, int selectedDBPartID, ExclusiveGroupStruct groupID) + public static void Prefix(uint playerID, int selectedDBPartID) { selectedBlockInt = selectedDBPartID; } diff --git a/GamecraftModdingAPI/Main.cs b/GamecraftModdingAPI/Main.cs index 36a0db4..bfb382e 100644 --- a/GamecraftModdingAPI/Main.cs +++ b/GamecraftModdingAPI/Main.cs @@ -123,7 +123,7 @@ namespace GamecraftModdingAPI private static void OnPatchError() { - ErrorBuilder.DisplayMustQuitError("Failed to patch Gamecraft!\n" + + ErrorBuilder.DisplayMustQuitError("Failed to patch Techblox!\n" + "Make sure you're using the latest version of GamecraftModdingAPI or disable mods if the API isn't released yet."); } } diff --git a/GamecraftModdingAPI/Persistence/SaveGameEnginePatch.cs b/GamecraftModdingAPI/Persistence/SaveGameEnginePatch.cs index a603fa2..0145c09 100644 --- a/GamecraftModdingAPI/Persistence/SaveGameEnginePatch.cs +++ b/GamecraftModdingAPI/Persistence/SaveGameEnginePatch.cs @@ -13,7 +13,7 @@ using HarmonyLib; namespace GamecraftModdingAPI.Persistence { - [HarmonyPatch] + //[HarmonyPatch] - TODO class SaveGameEnginePatch { private static readonly byte[] frameStart = Encoding.UTF8.GetBytes("\0\0\0GamecraftModdingAPI\0\0\0"); diff --git a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs index 919e639..bf7c0d6 100644 --- a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs +++ b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs @@ -47,7 +47,7 @@ namespace GamecraftModdingAPI.Tests /// Ideally, GamecraftModdingAPI should be loaded by another mod; not itself /// public class GamecraftModdingAPIPluginTest : IllusionPlugin.IEnhancedPlugin - { + { private static Harmony harmony { get; set; } @@ -73,7 +73,7 @@ namespace GamecraftModdingAPI.Tests //SteamInitPatch.ForcePassSteamCheck = true; // in case running in a VM //MinimumSpecsCheckPatch.ForcePassMinimumSpecCheck = true; - // disable some Gamecraft analytics + // disable some Techblox analytics //AnalyticsDisablerPatch.DisableAnalytics = true; // disable background music Logging.MetaDebugLog("Audio Mixers: " + string.Join(",", AudioTools.GetMixers())); @@ -144,7 +144,7 @@ namespace GamecraftModdingAPI.Tests { CommandBuilder.Builder() .Name("Exit") - .Description("Close Gamecraft immediately, without any prompts") + .Description("Close Techblox immediately, without any prompts") .Action(() => { UnityEngine.Application.Quit(); }) .Build(); -- 2.30.2 From 124ef410c737fe1f343e269ffc5666abe73817a7 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Tue, 13 Apr 2021 02:05:16 +0200 Subject: [PATCH 155/252] Attempt to bring console back and update block ID list --- GamecraftModdingAPI/Blocks/BlockIDs.cs | 487 +++++------------- GamecraftModdingAPI/Blocks/BlockTests.cs | 4 +- GamecraftModdingAPI/Blocks/CustomBlock.cs | 9 +- GamecraftModdingAPI/Input/FakeInput.cs | 8 +- GamecraftModdingAPI/Main.cs | 2 +- .../Tests/GamecraftModdingAPIPluginTest.cs | 40 +- 6 files changed, 176 insertions(+), 374 deletions(-) diff --git a/GamecraftModdingAPI/Blocks/BlockIDs.cs b/GamecraftModdingAPI/Blocks/BlockIDs.cs index ff08b51..07e4192 100644 --- a/GamecraftModdingAPI/Blocks/BlockIDs.cs +++ b/GamecraftModdingAPI/Blocks/BlockIDs.cs @@ -9,362 +9,145 @@ namespace GamecraftModdingAPI.Blocks /// Called "nothing" in Gamecraft. (DBID.NOTHING) /// Invalid = ushort.MaxValue, - AluminiumCube = 0, - AxleS, - HingeS = 3, - MotorS, - HingeM, - MotorM, - TyreM, - AxleM, - IronCube, - RubberCube, - OiledCube, - AluminiumConeSegment, //12 - AluminiumCorner, - AluminiumRoundedCorner, - AluminiumSlicedCube, - AluminiumRoundedSlicedCube, - AluminiumCylinder, - AluminiumPyramidSegment, - AluminiumSlope, - AluminiumRoundedSlope, - AluminiumSphere, - RubberConeSegment, //22 - RubberCorner, - RubberRoundedCorner, - RubberSlicedCube, - RubberRoundedSlicedCube, - RubberCylinder, - RubberPyramidSegment, - RubberSlope, - RubberRoundedSlope, - RubberSphere, - OiledConeSegment, //32 - OiledCorner, - OiledRoundedCorner, - OiledSlicedCube, - OiledRoundedSlicedCube, - OiledCylinder, - OiledPyramidSegment, - OiledSlope, - OiledRoundedSlope, - OiledSphere, - IronConeSegment, //42 - IronCorner, - IronRoundedCorner, - IronSlicedCube, - IronRoundedSlicedCube, - IronCylinder, - IronPyramidSegment, - IronSlope, - IronRoundedSlope, - IronSphere, - GlassCube, //52 - GlassSlicedCube, - GlassSlope, - GlassCorner, - GlassPyramidSegment, - GlassRoundedSlicedCube, - GlassRoundedSlope, - GlassRoundedCorner, - GlassConeSegment, - GlassCylinder, - GlassSphere, - Lever, //63 - WoodenSlatsDoor = 65, - PlayerSpawn, //Crashes without special handling - SmallSpawn, - MediumSpawn, - LargeSpawn, + Cube = 0, + Wedge, + QuarterPyramid, + Tetrahedron, + RoundedWedge, + RoundedQuarterPyramid, + RoundedTetrahedron, + NegativeQuarterPyramid, + NegativeTetrahedron, + RoundedNegativeQuarterPyramid, + RoundedNegativeTetrahedron, //10 + PlateCube, + PlateWedge, + PlateQuarterPyramid, + PlateTetrahedron, + Sphere, + Frame, + FrameS1, + FrameS2, + FrameS3, + FrameS4, //20 + FrameS5, + FrameWedge, + FrameWedgeS1, + FrameWedgeS2, + FrameWedgeS3, + FrameWedgeS4, + SideS0S1, + SideS0S2, + SideS0S3, + SideS0S4, //30 + SideS0S5, + SideS1S1, + SideS1S2, + SideS1S3, + SideS1S4, + SideS1S5, + SideS2S1, + SideS2S2, + SideS2S3, + SideS2S4, + SideS2S5, + WindscreenS1, //42 + WindscreenS2, + WindscreenS3, + WindscreenS4, + WindscreenS5, + CarWheelArch, + CarArchSmallFlare, + CarArchFlare, + CarArchExtrudedFlare, //50 + Cube1X1, + Cube1X2, + Cube1X3, + Cube1X4, + Cube1X6, + Cube2X2, + Cube2X3, + Cube2X4, + Cube2X6, + Wedge1X1, //60 + Wedge1X2, + Wedge1X3, + Wedge2X1, + Wedge2X2, + Wedge2X3, + RoundedWedge1X1, + RoundedWedge1X2, + RoundedWedge1X3, + RoundedWedge2X1, + RoundedWedge2X2, //70 + RoundedWedge2X3, + Plate1X1, + Plate1X2, + Plate1X3, + Plate1X4, + Plate2X2, + Plate2X3, + Plate2X4, + Plate3X3, + Plate3X4, //80 + Cube1X1S1, + Cube1X2S1, + Cube1X3S1, + Wedge1X1S1, + Wedge1X2S1, + Wedge1X3S1, + Wedge2X1S1, + Wedge2X2S1, + Wedge2X3S1, + Wedge3X1S1, //90 + Wedge3X2S1, + Wedge3X3S1, + NegativeTetrahedron1X1S1, + NegativeTetrahedron1X2S1, + NegativeTetrahedron1X3S1, + NegativeTetrahedron2X1S1, + NegativeTetrahedron2X2S1, + NegativeTetrahedron2X3S1, + NegativeTetrahedron3X1S1, + Axle, //100 + Hinge, BallJoint, UniversalJoint, - ServoAxle, - ServoHinge, - StepperAxle, - StepperHinge, TelescopicJoint, + HingeSpring, + AxleSpring, DampedSpring, - ServoPiston, - StepperPiston, - PneumaticPiston, //80 - PneumaticHinge, - PneumaticAxle, - WindowedDoor, - Bench, - Chair, - Stool, - DampedHingeSpring, - PlainGlassDoor, - PlainWoodenDoor, - PilotSeat, //Might crash + WheelRigNoSteering, + WheelRigWithSteering, + NegativeTetrahedron3X2S1, //110 + NegativeTetrahedron3X3S1, + Tetrahedron1X1S1, + Tetrahedron1X2S1, + Tetrahedron1X3S1, + Tetrahedron2X1S1, + Tetrahedron2X2S1, + Tetrahedron2X3S1, + Tetrahedron3X1S1, + Tetrahedron3X2S1, + Tetrahedron3X3S1, //120 + QuarterPyramid1X1S1, + QuarterPyramid1X2S1, + QuarterPyramid1X3S1, + QuarterPyramid2X1S1, + QuarterPyramid2X2S1, + QuarterPyramid2X3S1, + QuarterPyramid3X1S1, + QuarterPyramid3X2S1, + QuarterPyramid3X3S1, + PlateTriangle, //130 + PlateCircle, + PlateQtrCircle, + PlateRWedge, + PlateRTetrahedron, + DriverSeat = 150, PassengerSeat, - PilotControls, - GrassCube, - DirtCube, - GrassConeSegment, - GrassCorner, - GrassRoundedCorner, - GrassSlicedCube, - GrassRoundedSlicedCube, - GrassPyramidSegment, - GrassSlope, - GrassRoundedSlope, - DirtConeSegment, - DirtCorner, - DirtRoundedCorner, - DirtSlicedCube, - DirtRoundedSlicedCube, - DirtPyramidSegment, - DirtSlope, - DirtRoundedSlope, - RubberHemisphere, - AluminiumHemisphere, - GrassInnerCornerBulged, - DirtInnerCornerBulged, - IronHemisphere, - OiledHemisphere, - GlassHemisphere, - TyreS, - ThreeWaySwitch, - Dial, //120 - CharacterOnEnterTrigger, //Probably crashes - CharacterOnLeaveTrigger, - CharacterOnStayTrigger, - ObjectOnEnterTrigger, - ObjectOnLeaveTrigger, - ObjectOnStayTrigger, - Button, - Switch, - TextBlock, //Brings up a screen - ConsoleBlock, //Brings up a screen - Door, - GlassDoor, - PoweredDoor, - PoweredGlassDoor, - AluminiumTubeCorner, - IronTubeCorner, - WoodCube, - WoodSlicedCube, - WoodSlope, - WoodCorner, - WoodPyramidSegment, - WoodConeSegment, - WoodRoundedSlicedCube, - WoodRoundedSlope, - WoodRoundedCorner, - WoodCylinder, - WoodHemisphere, - WoodSphere, - BrickCube, - DampedAxleSpring, //150 - BrickSlicedCube, - BrickSlope, - BrickCorner, - ConcreteCube, - ConcreteSlicedCube, - ConcreteSlope, - ConcreteCorner, - RoadCarTyre, - OffRoadCarTyre, - RacingCarTyre, - BicycleTyre, - FrontBikeTyre, - RearBikeTyre, - ChopperBikeTyre, - TractorTyre, - MonsterTruckTyre, - MotocrossBikeTyre, - CartTyre, //168 - ObjectIdentifier, - ANDLogicBlock, - NANDLogicBlock, - NORLogicBlock, - NOTLogicBlock, - ORLogicBlock, - XNORLogicBlock, - XORLogicBlock, - AbsoluteMathsBlock, - AdderMathsBlock, - DividerMathsBlock, - SignMathsBlock, //180 - MaxMathsBlock, - MinMathsBlock, - MultiplierMathsBlock, - SubtractorMathsBlock, - SimpleConnector, - MeanMathsBlock, - Bit, - Counter, - Timer, - ObjectFilter, - PlayerFilter, - TeamFilter, - Number2Text, //193 - DestructionManager = 260, - ChunkHealthModifier, - ClusterHealthModifier, //262 - BeachTree1 = 200, - BeachTree2, - BeachTree3, - Rock1, - Rock2, - Rock3, - Rock4, - BirchTree1, - BirchTree2, - BirchTree3, - PineTree1, - PineTree2, - PineTree3, - Flower1, - Flower2, - Flower3, - Shrub1, - Shrub2, - Shrub3, - CliffCube, - CliffSlicedCorner, - CliffCornerA, - CliffCornerB, - CliffSlopeA, - CliffSlopeB, - GrassEdge, - GrassEdgeInnerCorner, - GrassEdgeCorner, - GrassEdgeSlope, - CentreHUD, - ObjectiveHUD, - GameStatsHUD, //231 - GameOverBlock, - SFXBlockGameplay = 240, - SFXBlock8Bit, - SFXBlockInstrument, - SFXBlockSciFi, - SFXBlockLoops, - SFXBlockVocal, - MovementConstrainer, //246 - RotationConstrainer, - AdvancedMovementDampener, - AdvancedRotationDampener, - Mover = 250, - Rotator, - MovementDampener, - RotationDampener, - AdvancedMover, - AdvancedRotator, - MusicBlock, //256 - PlasmaCannonBlock, - QuantumRiflePickup = 300, - QuantumRifleAmmoPickup, - AluminiumSlicedFraction, - AluminiumSlicedSlope, - AluminiumHalfPyramidLeft = 305, - AluminiumHalfPyramidRight, - AluminiumPyramidSliced, - AluminiumTubeCross, - AluminiumTubeT, - AluminiumPlateSquare, - AluminiumPlateCircle, - AluminiumPlateTriangle, //312 - OiledSlicedFraction = 314, - OiledSlicedSlope, - OiledHalfPyramidLeft, - OiledHalfPyramidRight, - OiledPyramidSliced, - GlassSlicedFraction, - GlassSlicedSlope, - GlassHalfPyramidLeft, - GlassHalfPyramidRight, - GlassPyramidSliced, - RubberSlicedFraction, - RubberSlicedSlope, - RubberHalfPyramidLeft, - RubberHalfPyramidRight, - RubberPyramidSliced, - WoodSlicedFraction, - WoodSlicedSlope, //330 - WoodHalfPyramidLeft, - WoodHalfPyramidRight, - WoodPyramidSliced, - HexNetSlicedFraction, - HexNetSlicedSlope, - HexNetHalfPyramidLeft, - HexNetHalfPyramidRight, - HexNetPyramidSliced, - OiledTubeCross, - OiledTubeT, //340 - GlassTubeCross, - GlassTubeT, - RubberTubeCross, - RubberTubeT, - WoodTubeCross, - WoodTubeT, - HexNetTubeCross, - HexNetTubeT, - BouncyCube, - BouncySlicedCube, //350 - BouncySlope, - BouncyCorner, - OiledTubeCorner, - GlassTubeCorner, - RubberTubeCorner, - WoodTubeCorner, - Basketball, - BowlingBall, - SoccerBall, - GolfBall, //360 - HockeyPuck, - PoolBall, - BouncyBall, - TennisBall, - UnlitCube, - IronSlicedFraction, - IronSlicedSlope, - IronHalfPyramidLeft, - IronHalfPyramidRight, - IronPyramidSliced, //370 - IronTubeCross, - IronTubeT, - SFXBlockMob = 374, - PointLight, - SpotLight, - SunLight, - AmbientLight, - UnlitGlowCube = 381, - PointLightInvisible, - SpotLightInvisible, - UnlitSlope, - UnlitGlowSlope, - Fog, - Sky, - GridCube, - GridSlicedCube, - GridSlope, - GridCorner, - MagmaRockCube = 777, - MagmaRockCubeSliced, - MagmaRockSlope, - MagmaRockCorner, - MagmaRockPyramidSegment, - MagmaRockConeSegment, - MagmaRockSlicedRounded, - MagmaRockSlopeRounded, - MagmaRockCornerRounded, - HexNetCube, - HexNetCubeSliced, - HexNetSlope, - HexNetCorner, - HexNetPyramidSegment, - HexNetConeSegment, - HexNetSlicedRounded, - HexNetSlopeRounded, - HexNetCornerRounded, //794 - MagmaRockBulgedInner, - HexNetCylinder = 797, - HexNetHemisphere, - HexNetSphere, - HexNetTubeCorner, //800 - CenterOfMassBlock = 1346 + Engine, + CarWheelWideProfile = 200, + CarWheel, } } \ No newline at end of file diff --git a/GamecraftModdingAPI/Blocks/BlockTests.cs b/GamecraftModdingAPI/Blocks/BlockTests.cs index dbcd39e..7aac012 100644 --- a/GamecraftModdingAPI/Blocks/BlockTests.cs +++ b/GamecraftModdingAPI/Blocks/BlockTests.cs @@ -19,14 +19,14 @@ namespace GamecraftModdingAPI.Blocks [APITestCase(TestType.EditMode)] public static void TestPlaceNew() { - Block newBlock = Block.PlaceNew(BlockIDs.AluminiumCube, Unity.Mathematics.float3.zero); + Block newBlock = Block.PlaceNew(BlockIDs.Cube, Unity.Mathematics.float3.zero); Assert.NotNull(newBlock.Id, "Newly placed block is missing Id. This should be populated when the block is placed.", "Newly placed block Id is not null, block successfully placed."); } [APITestCase(TestType.EditMode)] public static void TestInitProperty() { - Block newBlock = Block.PlaceNew(BlockIDs.AluminiumCube, Unity.Mathematics.float3.zero + 2); + Block newBlock = Block.PlaceNew(BlockIDs.Cube, Unity.Mathematics.float3.zero + 2); if (!Assert.CloseTo(newBlock.Position, (Unity.Mathematics.float3.zero + 2), $"Newly placed block at {newBlock.Position} is expected at {Unity.Mathematics.float3.zero + 2}.", "Newly placed block position matches.")) return; //Assert.Equal(newBlock.Exists, true, "Newly placed block does not exist, possibly because Sync() skipped/missed/failed.", "Newly placed block exists, Sync() successful."); } diff --git a/GamecraftModdingAPI/Blocks/CustomBlock.cs b/GamecraftModdingAPI/Blocks/CustomBlock.cs index 535ce7a..c979234 100644 --- a/GamecraftModdingAPI/Blocks/CustomBlock.cs +++ b/GamecraftModdingAPI/Blocks/CustomBlock.cs @@ -18,6 +18,7 @@ using UnityEngine.AddressableAssets; using Material = UnityEngine.Material; using GamecraftModdingAPI.Utility; +using ServiceLayer; namespace GamecraftModdingAPI.Blocks { @@ -114,7 +115,7 @@ namespace GamecraftModdingAPI.Blocks { public static void Prefix(IDataDB dataDB) { - //var abd = dataDB.GetValue((int) BlockIDs.AluminiumCube); + //var abd = dataDB.GetValue((int) BlockIDs.Cube); foreach (var (key, type) in CustomBlocks) { var attr = type.GetCustomAttribute(); @@ -146,6 +147,12 @@ namespace GamecraftModdingAPI.Blocks foreach (var (id, action) in BlockChangeActions) action(dataDB.GetValue(id)); + + /*foreach (var (key, value) in dataDB.GetValues()) + { + var data = (CubeListData) value; + Console.WriteLine($"ID: {key} - Name: {data.CubeNameKey}: {LocalizationService.Localize(data.CubeNameKey)}"); + }*/ _canRegister = false; } diff --git a/GamecraftModdingAPI/Input/FakeInput.cs b/GamecraftModdingAPI/Input/FakeInput.cs index a8129a9..1d5564d 100644 --- a/GamecraftModdingAPI/Input/FakeInput.cs +++ b/GamecraftModdingAPI/Input/FakeInput.cs @@ -53,7 +53,7 @@ namespace GamecraftModdingAPI.Input /// Select the hotbar page by number? /// Quicksave? /// Paste? - public static void GuiInput(uint playerID = uint.MaxValue, int hotbar = -1, bool commandLine = false, bool escape = false, bool enter = false, bool debug = false, bool next = false, bool previous = false, bool tab = false, bool colour = false, int hotbarPage = -1, bool quickSave = false, bool paste = false) + public static void GuiInput(uint playerID = uint.MaxValue, int hotbar = -1, bool escape = false, bool enter = false, bool debug = false, bool next = false, bool previous = false, bool tab = false, int hotbarPage = -1, bool quickSave = false, bool paste = false) { if (playerID == uint.MaxValue) { @@ -76,7 +76,6 @@ namespace GamecraftModdingAPI.Input case 9: currentInput.guiMask |= RobocraftX.Common.Input.GuiInput.Hotbar_9; break; default: break; } - //if (commandLine) currentInput.guiMask |= RobocraftX.Common.Input.GuiInput.ToggleCommandLine; - TODO if (escape) currentInput.guiMask |= RobocraftX.Common.Input.GuiInput.Escape; if (enter) currentInput.guiMask |= RobocraftX.Common.Input.GuiInput.Return; if (debug) currentInput.guiMask |= RobocraftX.Common.Input.GuiInput.ToggleDebugDisplay; @@ -97,6 +96,7 @@ namespace GamecraftModdingAPI.Input case 10: currentInput.guiMask |= RobocraftX.Common.Input.GuiInput.HotbarPage10; break; default: break; } + //RewiredConsts.Action if (quickSave) currentInput.guiMask |= RobocraftX.Common.Input.GuiInput.QuickSave; if (paste) currentInput.guiMask |= RobocraftX.Common.Input.GuiInput.PasteSelection; } @@ -118,8 +118,8 @@ namespace GamecraftModdingAPI.Input if (left) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.Left; if (right) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.Right; if (sprint) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.Sprint; - if (toggleFly) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.SwitchFlyMode; - if (alt) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.AltAction; + //if (toggleFly) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.SwitchFlyMode; + //if (alt) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.AltAction; if (primary) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.PrimaryAction; if (secondary) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.SecondaryAction; if (tertiary) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.TertiaryAction; diff --git a/GamecraftModdingAPI/Main.cs b/GamecraftModdingAPI/Main.cs index bfb382e..57349de 100644 --- a/GamecraftModdingAPI/Main.cs +++ b/GamecraftModdingAPI/Main.cs @@ -91,7 +91,7 @@ namespace GamecraftModdingAPI AsyncUtils.Init(); GamecraftModdingAPI.App.Client.Init(); GamecraftModdingAPI.App.Game.Init(); - CustomBlock.Init(); + //CustomBlock.Init(); // init UI Interface.IMGUI.Constants.Init(); Interface.IMGUI.IMGUIManager.Init(); diff --git a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs index bf7c0d6..410c0a5 100644 --- a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs +++ b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs @@ -26,8 +26,11 @@ using GamecraftModdingAPI.Commands; using GamecraftModdingAPI.Events; using GamecraftModdingAPI.Utility; using GamecraftModdingAPI.Blocks; +using GamecraftModdingAPI.Input; using GamecraftModdingAPI.Interface.IMGUI; using GamecraftModdingAPI.Players; +using RobocraftX.Common.Input; +using Svelto.DataStructures; using UnityEngine.AddressableAssets; using UnityEngine.AddressableAssets.ResourceLocators; using UnityEngine.ResourceManagement.AsyncOperations; @@ -171,7 +174,7 @@ namespace GamecraftModdingAPI.Tests .Description("Place a block of aluminium at the given coordinates") .Action((float x, float y, float z) => { - var block = Block.PlaceNew(BlockIDs.AluminiumCube, new float3(x, y, z)); + var block = Block.PlaceNew(BlockIDs.Cube, new float3(x, y, z)); Logging.CommandLog("Block placed with type: " + block.Type); }) .Build(); @@ -185,7 +188,7 @@ namespace GamecraftModdingAPI.Tests var sw = Stopwatch.StartNew(); for (int i = 0; i < 100; i++) for (int j = 0; j < 100; j++) - Block.PlaceNew(BlockIDs.AluminiumCube, new float3(x + i, y, z + j)); + Block.PlaceNew(BlockIDs.Cube, new float3(x + i, y, z + j)); //Block.Sync(); sw.Stop(); Logging.CommandLog("Finished in " + sw.ElapsedMilliseconds + "ms"); @@ -264,7 +267,7 @@ namespace GamecraftModdingAPI.Tests }) .Build();*/ - CommandBuilder.Builder() + /*CommandBuilder.Builder() .Name("WireTest") .Description("Place two blocks and then wire them together") .Action(() => @@ -275,7 +278,7 @@ namespace GamecraftModdingAPI.Tests Wire conn = notBlock.Connect(0, andBlock, 1); Logging.CommandLog(conn.ToString()); }) - .Build(); + .Build();*/ CommandBuilder.Builder("TestChunkHealth", "Sets the chunk looked at to the given health.") .Action((float val, float max) => @@ -291,13 +294,13 @@ namespace GamecraftModdingAPI.Tests .Action((float x, float y, float z) => { var pos = new float3(x, y, z); - var group = BlockGroup.Create(Block.PlaceNew(BlockIDs.AluminiumCube, pos, + var group = BlockGroup.Create(Block.PlaceNew(BlockIDs.Cube, pos, color: BlockColors.Aqua)); - Block.PlaceNew(BlockIDs.AluminiumCube, pos += new float3(1, 0, 0), color: BlockColors.Blue) + Block.PlaceNew(BlockIDs.Cube, pos += new float3(1, 0, 0), color: BlockColors.Blue) .BlockGroup = group; - Block.PlaceNew(BlockIDs.AluminiumCube, pos += new float3(1, 0, 0), color: BlockColors.Green) + Block.PlaceNew(BlockIDs.Cube, pos += new float3(1, 0, 0), color: BlockColors.Green) .BlockGroup = group; - Block.PlaceNew(BlockIDs.AluminiumCube, pos += new float3(1, 0, 0), color: BlockColors.Lime) + Block.PlaceNew(BlockIDs.Cube, pos += new float3(1, 0, 0), color: BlockColors.Lime) .BlockGroup = group; }).Build(); @@ -328,7 +331,7 @@ namespace GamecraftModdingAPI.Tests } }, "MoveLastBlock", "Move the most-recently-placed block, and any connected blocks by the given offset")); CommandManager.AddCommand(new SimpleCustomCommandEngine( - (x, y, z) => { Blocks.Placement.PlaceBlock(Blocks.BlockIDs.AluminiumCube, new Unity.Mathematics.float3(x, y, z)); }, + (x, y, z) => { Blocks.Placement.PlaceBlock(Blocks.BlockIDs.Cube, new Unity.Mathematics.float3(x, y, z)); }, "PlaceAluminium", "Place a block of aluminium at the given coordinates")); System.Random random = new System.Random(); // for command below CommandManager.AddCommand(new SimpleCustomCommandEngine( @@ -368,7 +371,7 @@ namespace GamecraftModdingAPI.Tests Logging.Log("Compatible GamecraftScripting detected"); } // Interface test - Interface.IMGUI.Group uiGroup = new Group(new Rect(20, 20, 200, 500), "GamecraftModdingAPI_UITestGroup", true); + /*Interface.IMGUI.Group uiGroup = new Group(new Rect(20, 20, 200, 500), "GamecraftModdingAPI_UITestGroup", true); Interface.IMGUI.Button button = new Button("TEST"); button.OnClick += (b, __) => { Logging.MetaDebugLog($"Click on {((Interface.IMGUI.Button)b).Name}");}; Interface.IMGUI.Button button2 = new Button("TEST2"); @@ -382,16 +385,16 @@ namespace GamecraftModdingAPI.Tests uiGroup.AddElement(button2); uiGroup.AddElement(uiText); uiGroup.AddElement(uiLabel); - uiGroup.AddElement(uiImg); + uiGroup.AddElement(uiImg);*/ - Addressables.LoadAssetAsync("Assets/Art/Textures/UI/FrontEndMap/RCX_Blue_Background_5k.jpg") + /*Addressables.LoadAssetAsync("Assets/Art/Textures/UI/FrontEndMap/RCX_Blue_Background_5k.jpg") .Completed += handle => { uiImg.Texture = handle.Result; uiImg.Enabled = true; Logging.MetaDebugLog($"Got blue bg asset {handle.Result}"); - }; + };*/ CommandBuilder.Builder("enableCompletions") @@ -414,8 +417,11 @@ namespace GamecraftModdingAPI.Tests Logging.MetaDebugLog("Test custom block catalog not found"); } - CustomBlock.ChangeExistingBlock((ushort) BlockIDs.TyreS, + CustomBlock.ChangeExistingBlock((ushort) BlockIDs.CarWheel, cld => cld.scalingPermission = ScalingPermission.NonUniform); + + /*((FasterList)AccessTools.Property(typeof(GuiInputMap), "GuiInputsButtonDown").GetValue(null)) + .Add(new GuiInputMap.GuiInputMapElement(RewiredConsts.Action.ToggleCommandLine, GuiIn))*/ #if TEST TestRoot.RunTests(); #endif @@ -465,6 +471,12 @@ namespace GamecraftModdingAPI.Tests } } + public override void OnUpdate() + { + if(UnityEngine.Input.GetKeyDown(KeyCode.Backslash)) + FakeInput.CustomInput(new LocalInputEntityStruct{commandLineToggleInput = true}); + } + [HarmonyPatch] public class MinimumSpecsPatch { -- 2.30.2 From 9a4ff858f3e9aad9197f7b470456541787951d84 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Fri, 16 Apr 2021 01:40:30 +0200 Subject: [PATCH 156/252] Improve color API and add material API --- GamecraftModdingAPI/Block.cs | 29 +++++++------ GamecraftModdingAPI/Blocks/BlockColor.cs | 42 +++++++++---------- GamecraftModdingAPI/Blocks/BlockMaterial.cs | 12 ++++++ GamecraftModdingAPI/Blocks/PlacementEngine.cs | 18 ++++---- .../Tests/GamecraftModdingAPIPluginTest.cs | 4 +- .../Utility/DebugInterfaceEngine.cs | 4 +- 6 files changed, 62 insertions(+), 47 deletions(-) create mode 100644 GamecraftModdingAPI/Blocks/BlockMaterial.cs diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index 607213d..daeeba3 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -40,18 +40,18 @@ namespace GamecraftModdingAPI /// /// The block's type /// The block's color - /// The block color's darkness (0-9) - 0 is default color + /// The block's material /// The block's position - default block size is 0.2 /// The block's rotation in degrees /// The block's uniform scale - default scale is 1 (with 0.2 width) /// The block's non-uniform scale - 0 means is used /// The player who placed the block /// The placed block or null if failed - public static Block PlaceNew(BlockIDs block, float3 position, - float3 rotation = default, BlockColors color = BlockColors.Default, byte darkness = 0, + public static Block PlaceNew(BlockIDs block, float3 position, float3 rotation = default, + BlockColors color = BlockColors.Default, BlockMaterial material = BlockMaterial.Default, int uscale = 1, float3 scale = default, Player player = null) { - return PlaceNew(block, position, rotation, color, darkness, uscale, scale, player); + return PlaceNew(block, position, rotation, color, material, uscale, scale, player); } /// @@ -61,7 +61,7 @@ namespace GamecraftModdingAPI /// /// The block's type /// The block's color - /// The block color's darkness (0-9) - 0 is default color + /// The block's materialr /// The block's position - default block size is 0.2 /// The block's rotation in degrees /// The block's uniform scale - default scale is 1 (with 0.2 width) @@ -69,12 +69,12 @@ namespace GamecraftModdingAPI /// The player who placed the block /// The placed block or null if failed public static T PlaceNew(BlockIDs block, float3 position, - float3 rotation = default, BlockColors color = BlockColors.Default, byte darkness = 0, + float3 rotation = default, BlockColor? color = null, BlockMaterial material = BlockMaterial.Default, int uscale = 1, float3 scale = default, Player player = null) where T : Block { if (PlacementEngine.IsInGame && GameState.IsBuildMode()) { - var egid = PlacementEngine.PlaceBlock(block, color, darkness, + var egid = PlacementEngine.PlaceBlock(block, color ?? BlockColors.Default, material, position, uscale, scale, player, rotation, out var initializer); var bl = New(egid.entityID, egid.groupID); bl.InitData.Group = BlockEngine.InitGroup(initializer); @@ -319,9 +319,7 @@ namespace GamecraftModdingAPI { BlockEngine.SetBlockInfo(this, (ref ColourParameterEntityStruct color, BlockColor val) => { - color.indexInPalette = (byte) (val.Color + val.Darkness * 10); - //color.overridePaletteColour = false; - //color.needsUpdate = true; + color.indexInPalette = val.Index; color.hasNetworkChange = true; color.paletteColour = BlockEngine.ConvertBlockColor(color.indexInPalette); }, value); @@ -339,13 +337,18 @@ namespace GamecraftModdingAPI BlockEngine.SetBlockInfo(this, (ref ColourParameterEntityStruct color, float4 val) => { color.paletteColour = val; - //color.overridePaletteColour = true; - //color.needsUpdate = true; color.hasNetworkChange = true; }, value); } } + public BlockMaterial Material + { + get => BlockEngine.GetBlockInfo(this, (CubeMaterialStruct cmst) => (BlockMaterial) cmst.materialId); + set => BlockEngine.SetBlockInfo(this, + (ref CubeMaterialStruct cmst, BlockMaterial val) => cmst.materialId = (byte) val, value); + } + /// /// The text displayed on the block if applicable, or null. /// Setting it is temporary to the session, it won't be saved. @@ -433,7 +436,7 @@ namespace GamecraftModdingAPI /// public T Copy() where T : Block { - var block = PlaceNew(Type, Position, Rotation, Color.Color, Color.Darkness, UniformScale, Scale); + var block = PlaceNew(Type, Position, Rotation, Color, Material, UniformScale, Scale); block.copiedFrom = Id; return block; } diff --git a/GamecraftModdingAPI/Blocks/BlockColor.cs b/GamecraftModdingAPI/Blocks/BlockColor.cs index bf22090..bb5fa4a 100644 --- a/GamecraftModdingAPI/Blocks/BlockColor.cs +++ b/GamecraftModdingAPI/Blocks/BlockColor.cs @@ -5,35 +5,35 @@ namespace GamecraftModdingAPI.Blocks { public struct BlockColor { - public BlockColors Color; - public byte Darkness; + public BlockColors Color => Index == byte.MaxValue + ? BlockColors.Default + : (BlockColors) (Index % 10); - public byte Index => Color == BlockColors.Default - ? byte.MaxValue - : (byte) (Darkness * 10 + Color); + public byte Darkness => (byte) (Index == byte.MaxValue + ? 0 + : Index / 10); + + public byte Index { get; } public BlockColor(byte index) { - if (index == byte.MaxValue) - { - Color = BlockColors.Default; - Darkness = 0; - } - else - { - if (index > 99) - throw new ArgumentOutOfRangeException(nameof(index), "Invalid color index. Must be 0-90 or 255."); - Color = (BlockColors) (index % 10); - Darkness = (byte) (index / 10); - } + if (index > 99 && index != byte.MaxValue) + throw new ArgumentOutOfRangeException(nameof(index), "Invalid color index. Must be 0-90 or 255."); + Index = index; } - public BlockColor(BlockColors color, byte darkness) + public BlockColor(BlockColors color, byte darkness = 0) { if (darkness > 9) throw new ArgumentOutOfRangeException(nameof(darkness), "Darkness must be 0-9 where 0 is default."); - Color = color; - Darkness = darkness; + if (color > BlockColors.Red) //Last valid color + throw new ArgumentOutOfRangeException(nameof(color), "Invalid color!"); + Index = (byte) (darkness * 10 + (byte) color); + } + + public static implicit operator BlockColor(BlockColors color) + { + return new BlockColor(color); } public float4 RGBA => Block.BlockEngine.ConvertBlockColor(Index); @@ -47,7 +47,7 @@ namespace GamecraftModdingAPI.Blocks /// /// Preset block colours /// - public enum BlockColors + public enum BlockColors : byte { Default = byte.MaxValue, White = 0, diff --git a/GamecraftModdingAPI/Blocks/BlockMaterial.cs b/GamecraftModdingAPI/Blocks/BlockMaterial.cs new file mode 100644 index 0000000..74d45bb --- /dev/null +++ b/GamecraftModdingAPI/Blocks/BlockMaterial.cs @@ -0,0 +1,12 @@ +namespace GamecraftModdingAPI.Blocks +{ + public enum BlockMaterial : byte + { + Default = byte.MaxValue, + SteelBodywork = 0, + RigidSteel, + CarbonFiber, + Plastic, + Wood + } +} \ No newline at end of file diff --git a/GamecraftModdingAPI/Blocks/PlacementEngine.cs b/GamecraftModdingAPI/Blocks/PlacementEngine.cs index 506456b..908eadf 100644 --- a/GamecraftModdingAPI/Blocks/PlacementEngine.cs +++ b/GamecraftModdingAPI/Blocks/PlacementEngine.cs @@ -40,17 +40,17 @@ namespace GamecraftModdingAPI.Blocks public EntitiesDB entitiesDB { get; set; } private static BlockEntityFactory _blockEntityFactory; //Injected from PlaceSingleBlockEngine - public EGID PlaceBlock(BlockIDs block, BlockColors color, byte darkness, float3 position, int uscale, + public EGID PlaceBlock(BlockIDs block, BlockColor color, BlockMaterial materialId, float3 position, int uscale, float3 scale, Player player, float3 rotation, out EntityInitializer initializer) { //It appears that only the non-uniform scale has any visible effect, but if that's not given here it will be set to the uniform one - if (darkness > 9) + if (color.Darkness > 9) throw new Exception("That is too dark. Make sure to use 0-9 as darkness. (0 is default.)"); - initializer = BuildBlock((ushort) block, (byte) (color + darkness * 10), position, uscale, scale, rotation, + initializer = BuildBlock((ushort) block, color.Index, (byte) materialId, position, uscale, scale, rotation, (player ?? new Player(PlayerType.Local)).Id); return initializer.EGID; } - private EntityInitializer BuildBlock(ushort block, byte color, float3 position, int uscale, float3 scale, float3 rot, uint playerId) + private EntityInitializer BuildBlock(ushort block, byte color, byte materialId, float3 position, int uscale, float3 scale, float3 rot, uint playerId) { if (_blockEntityFactory == null) throw new BlockException("The factory is null."); @@ -81,11 +81,11 @@ namespace GamecraftModdingAPI.Blocks indexInPalette = color, hasNetworkChange = true }); - structInitializer.Init(new CubeMaterialStruct - { - materialId = 0, //TODO - cosmeticallyPaintedOnly = true //TODO - }); + if (materialId != byte.MaxValue) + structInitializer.Init(new CubeMaterialStruct + { + materialId = materialId + }); uint prefabId = PrefabsID.GetOrCreatePrefabID(block, 0, 0, false); //TODO structInitializer.Init(new GFXPrefabEntityStructGPUI(prefabId)); structInitializer.Init(new PhysicsPrefabEntityStruct(prefabId)); diff --git a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs index 410c0a5..92b1d7a 100644 --- a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs +++ b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs @@ -224,8 +224,8 @@ namespace GamecraftModdingAPI.Tests float.Parse(s[1]), float.Parse(s[2]), float.Parse(s[3])); return; } - new Player(PlayerType.Local).GetBlockLookedAt().Color = - new BlockColor { Color = color }; + + new Player(PlayerType.Local).GetBlockLookedAt().Color = color; Logging.CommandLog("Colored block to " + color); }).Build(); diff --git a/GamecraftModdingAPI/Utility/DebugInterfaceEngine.cs b/GamecraftModdingAPI/Utility/DebugInterfaceEngine.cs index 0e4d023..9c14075 100644 --- a/GamecraftModdingAPI/Utility/DebugInterfaceEngine.cs +++ b/GamecraftModdingAPI/Utility/DebugInterfaceEngine.cs @@ -31,8 +31,8 @@ namespace GamecraftModdingAPI.Utility public void SetInfo(string id, Func contentGetter) => _extraInfo[id] = contentGetter; public bool RemoveInfo(string id) => _extraInfo.Remove(id); - public string Name { get; } = "GamecraftModdingAPIDebugInterfaceGameEngine"; - public bool isRemovable { get; } = true; + public string Name => "GamecraftModdingAPIDebugInterfaceGameEngine"; + public bool isRemovable => true; [HarmonyPatch] private class Patch -- 2.30.2 From 1f688195afb0a56fd88f470c28aca1db20e2e973 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Mon, 19 Apr 2021 03:13:00 +0200 Subject: [PATCH 157/252] Add support for flipped blocks and auto-wiring, other fixes --- GamecraftModdingAPI/Block.cs | 32 ++++++++++++++++--- GamecraftModdingAPI/Blocks/BlockEngine.cs | 12 +------ .../Blocks/BlockIdentifiers.cs | 5 +-- GamecraftModdingAPI/Blocks/PlacementEngine.cs | 13 ++++---- GamecraftModdingAPI/Inventory/HotbarEngine.cs | 19 +++++------ 5 files changed, 47 insertions(+), 34 deletions(-) diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index daeeba3..234ee6e 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -13,6 +13,7 @@ using Gamecraft.Blocks.GUI; using GamecraftModdingAPI.Blocks; using GamecraftModdingAPI.Utility; +using RobocraftX.Rendering.GPUI; namespace GamecraftModdingAPI { @@ -45,13 +46,15 @@ namespace GamecraftModdingAPI /// The block's rotation in degrees /// The block's uniform scale - default scale is 1 (with 0.2 width) /// The block's non-uniform scale - 0 means is used + /// Whether the block should be flipped + /// Whether the block should be auto-wired (if functional) /// The player who placed the block /// The placed block or null if failed public static Block PlaceNew(BlockIDs block, float3 position, float3 rotation = default, BlockColors color = BlockColors.Default, BlockMaterial material = BlockMaterial.Default, - int uscale = 1, float3 scale = default, Player player = null) + int uscale = 1, float3 scale = default, bool isFlipped = false, bool autoWire = false, Player player = null) { - return PlaceNew(block, position, rotation, color, material, uscale, scale, player); + return PlaceNew(block, position, rotation, color, material, uscale, scale, isFlipped, autoWire, player); } /// @@ -66,16 +69,19 @@ namespace GamecraftModdingAPI /// The block's rotation in degrees /// The block's uniform scale - default scale is 1 (with 0.2 width) /// The block's non-uniform scale - 0 means is used + /// Whether the block should be flipped + /// Whether the block should be auto-wired (if functional) /// The player who placed the block /// The placed block or null if failed public static T PlaceNew(BlockIDs block, float3 position, float3 rotation = default, BlockColor? color = null, BlockMaterial material = BlockMaterial.Default, - int uscale = 1, float3 scale = default, Player player = null) where T : Block + int uscale = 1, float3 scale = default, bool isFlipped = false, bool autoWire = false, Player player = null) + where T : Block { if (PlacementEngine.IsInGame && GameState.IsBuildMode()) { var egid = PlacementEngine.PlaceBlock(block, color ?? BlockColors.Default, material, - position, uscale, scale, player, rotation, out var initializer); + position, uscale, scale, player, rotation, isFlipped, autoWire, out var initializer); var bl = New(egid.entityID, egid.groupID); bl.InitData.Group = BlockEngine.InitGroup(initializer); Placed += bl.OnPlacedInit; @@ -293,6 +299,24 @@ namespace GamecraftModdingAPI } } + /** + * Whether the block is fipped. + */ + public bool Flipped + { + get => BlockEngine.GetBlockInfo(this, (ScalingEntityStruct st) => st.scale.x < 0); + set + { + BlockEngine.SetBlockInfo(this, (ref ScalingEntityStruct st, bool val) => + st.scale.x = math.abs(st.scale.x) * (val ? -1 : 1), value); + BlockEngine.SetBlockInfo(this, (ref GFXPrefabEntityStructGPUI st, bool val) => + { + uint prefabId = PrefabsID.GetOrCreatePrefabID((ushort) Type, (byte) Material, 0, value); + st.prefabID = prefabId; + }, value); + } + } + /// /// The block's type (ID). Returns BlockIDs.Invalid if the block doesn't exist anymore. /// diff --git a/GamecraftModdingAPI/Blocks/BlockEngine.cs b/GamecraftModdingAPI/Blocks/BlockEngine.cs index 46afb09..5eff5b2 100644 --- a/GamecraftModdingAPI/Blocks/BlockEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlockEngine.cs @@ -80,17 +80,7 @@ namespace GamecraftModdingAPI.Blocks public ref T GetBlockInfoViewStruct(EGID blockID) where T : struct, INeedEGID, IEntityViewComponent { if (entitiesDB.Exists(blockID)) - { - // TODO: optimize by using EntitiesDB internal calls instead of iterating over everything - BT> entities = entitiesDB.QueryEntities(blockID.groupID).ToBuffer(); - for (int i = 0; i < entities.count; i++) - { - if (entities.buffer[i].ID == blockID) - { - return ref entities.buffer[i]; - } - } - } + return ref entitiesDB.QueryEntity(blockID); T[] structHolder = new T[1]; //Create something that can be referenced return ref structHolder[0]; //Gets a default value automatically } diff --git a/GamecraftModdingAPI/Blocks/BlockIdentifiers.cs b/GamecraftModdingAPI/Blocks/BlockIdentifiers.cs index 0c3222b..bc426d5 100644 --- a/GamecraftModdingAPI/Blocks/BlockIdentifiers.cs +++ b/GamecraftModdingAPI/Blocks/BlockIdentifiers.cs @@ -2,6 +2,7 @@ using RobocraftX.Common; using HarmonyLib; +using Svelto.DataStructures; namespace GamecraftModdingAPI.Blocks { @@ -12,8 +13,8 @@ namespace GamecraftModdingAPI.Blocks { /// /// Blocks placed by the player - /// - TODO - //public static ExclusiveGroup OWNED_BLOCKS { get { return CommonExclusiveGroups.REAL_BLOCKS_GROUPS_DON_T_USE_IN_NEW_CODE; } } + /// + public static FasterReadOnlyList OWNED_BLOCKS { get { return CommonExclusiveGroups.REAL_BLOCKS_GROUPS_DON_T_USE_IN_NEW_CODE; } } /// /// Extra parts used in functional blocks diff --git a/GamecraftModdingAPI/Blocks/PlacementEngine.cs b/GamecraftModdingAPI/Blocks/PlacementEngine.cs index 908eadf..cbc49e2 100644 --- a/GamecraftModdingAPI/Blocks/PlacementEngine.cs +++ b/GamecraftModdingAPI/Blocks/PlacementEngine.cs @@ -2,6 +2,7 @@ using System; using System.Reflection; using DataLoader; +using Gamecraft.Wires; using HarmonyLib; using RobocraftX.Blocks; using RobocraftX.Blocks.Scaling; @@ -41,16 +42,16 @@ namespace GamecraftModdingAPI.Blocks private static BlockEntityFactory _blockEntityFactory; //Injected from PlaceSingleBlockEngine public EGID PlaceBlock(BlockIDs block, BlockColor color, BlockMaterial materialId, float3 position, int uscale, - float3 scale, Player player, float3 rotation, out EntityInitializer initializer) + float3 scale, Player player, float3 rotation, bool isFlipped, bool autoWire, out EntityInitializer initializer) { //It appears that only the non-uniform scale has any visible effect, but if that's not given here it will be set to the uniform one if (color.Darkness > 9) throw new Exception("That is too dark. Make sure to use 0-9 as darkness. (0 is default.)"); initializer = BuildBlock((ushort) block, color.Index, (byte) materialId, position, uscale, scale, rotation, - (player ?? new Player(PlayerType.Local)).Id); + isFlipped, autoWire, (player ?? new Player(PlayerType.Local)).Id); return initializer.EGID; } - private EntityInitializer BuildBlock(ushort block, byte color, byte materialId, float3 position, int uscale, float3 scale, float3 rot, uint playerId) + private EntityInitializer BuildBlock(ushort block, byte color, byte materialId, float3 position, int uscale, float3 scale, float3 rot, bool isFlipped, bool autoWire, uint playerId) { if (_blockEntityFactory == null) throw new BlockException("The factory is null."); @@ -63,7 +64,7 @@ namespace GamecraftModdingAPI.Blocks if (!PrefabsID.PrefabIDByResourceIDMap.ContainsKey(resourceId)) throw new BlockException("Block with ID " + block + " not found!"); //RobocraftX.CR.MachineEditing.PlaceSingleBlockEngine - ScalingEntityStruct scaling = new ScalingEntityStruct {scale = scale}; + ScalingEntityStruct scaling = new ScalingEntityStruct {scale = scale * (isFlipped ? -1 : 1)}; Quaternion rotQ = Quaternion.Euler(rot); RotationEntityStruct rotation = new RotationEntityStruct {rotation = rotQ}; GridRotationStruct gridRotation = new GridRotationStruct @@ -86,7 +87,7 @@ namespace GamecraftModdingAPI.Blocks { materialId = materialId }); - uint prefabId = PrefabsID.GetOrCreatePrefabID(block, 0, 0, false); //TODO + uint prefabId = PrefabsID.GetOrCreatePrefabID(block, materialId, 0, isFlipped); structInitializer.Init(new GFXPrefabEntityStructGPUI(prefabId)); structInitializer.Init(new PhysicsPrefabEntityStruct(prefabId)); structInitializer.Init(dbEntity); @@ -102,7 +103,7 @@ namespace GamecraftModdingAPI.Blocks { loadedFromDisk = false, placedBy = playerId, - triggerAutoWiring = false //TODO + triggerAutoWiring = autoWire && structInitializer.Has() }); /*structInitializer.Init(new CollisionFilterOverride diff --git a/GamecraftModdingAPI/Inventory/HotbarEngine.cs b/GamecraftModdingAPI/Inventory/HotbarEngine.cs index ab9b7d2..b20928b 100644 --- a/GamecraftModdingAPI/Inventory/HotbarEngine.cs +++ b/GamecraftModdingAPI/Inventory/HotbarEngine.cs @@ -11,6 +11,8 @@ using Svelto.ECS; using GamecraftModdingAPI.Blocks; using GamecraftModdingAPI.Utility; using GamecraftModdingAPI.Engines; +using RobocraftX.Blocks; +using Techblox.FlyCam; namespace GamecraftModdingAPI.Inventory { @@ -36,18 +38,13 @@ namespace GamecraftModdingAPI.Inventory public bool SelectBlock(int block, uint playerID, bool cubeSelectedByPick = false) { - var inputs = entitiesDB.QueryEntities(InputExclusiveGroups.LocalPlayers).ToBuffer(); - if (inputs.count == 0) return false; - for (int i = 0; i < inputs.count; i++) - { - if (inputs.buffer[i].ID.entityID == playerID) { - /*inputs.buffer[i].cubeSelectedByPick = cubeSelectedByPick; - TODO - inputs.buffer[i].selectedCube = block;*/ - return true; - } - } + if (!entitiesDB.TryQueryEntitiesAndIndex(playerID, Techblox.FlyCam.FlyCam.Group, + out var index, out var inputs)) + return false; + inputs[index].CubeSelectedByPick = cubeSelectedByPick; + inputs[index].SelectedDBPartID = block; // TODO: expose the rest of the input functionality - return false; + return true; } public uint GetLocalPlayerID() -- 2.30.2 From 677c8b0907601032cdbaecf2c8e6a371a3d84a8c Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Mon, 19 Apr 2021 19:32:14 +0200 Subject: [PATCH 158/252] Add constructor for placing block, remove most PlaceNew args --- GamecraftModdingAPI/Block.cs | 52 +++++++++++---- GamecraftModdingAPI/Blocks/PlacementEngine.cs | 64 ++++--------------- .../Tests/GamecraftModdingAPIPluginTest.cs | 15 ++--- 3 files changed, 59 insertions(+), 72 deletions(-) diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index 234ee6e..99574ff 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -50,11 +50,9 @@ namespace GamecraftModdingAPI /// Whether the block should be auto-wired (if functional) /// The player who placed the block /// The placed block or null if failed - public static Block PlaceNew(BlockIDs block, float3 position, float3 rotation = default, - BlockColors color = BlockColors.Default, BlockMaterial material = BlockMaterial.Default, - int uscale = 1, float3 scale = default, bool isFlipped = false, bool autoWire = false, Player player = null) + public static Block PlaceNew(BlockIDs block, float3 position, bool autoWire = false, Player player = null) { - return PlaceNew(block, position, rotation, color, material, uscale, scale, isFlipped, autoWire, player); + return PlaceNew(block, position, autoWire, player); } /// @@ -73,15 +71,13 @@ namespace GamecraftModdingAPI /// Whether the block should be auto-wired (if functional) /// The player who placed the block /// The placed block or null if failed - public static T PlaceNew(BlockIDs block, float3 position, - float3 rotation = default, BlockColor? color = null, BlockMaterial material = BlockMaterial.Default, - int uscale = 1, float3 scale = default, bool isFlipped = false, bool autoWire = false, Player player = null) + public static T PlaceNew(BlockIDs block, float3 position, bool autoWire = false, Player player = null) where T : Block { if (PlacementEngine.IsInGame && GameState.IsBuildMode()) { - var egid = PlacementEngine.PlaceBlock(block, color ?? BlockColors.Default, material, - position, uscale, scale, player, rotation, isFlipped, autoWire, out var initializer); + var initializer = PlacementEngine.PlaceBlock(block, position, player, autoWire); + var egid = initializer.EGID; var bl = New(egid.entityID, egid.groupID); bl.InitData.Group = BlockEngine.InitGroup(initializer); Placed += bl.OnPlacedInit; @@ -232,6 +228,23 @@ namespace GamecraftModdingAPI Id = BlockEngine.FindBlockEGID(id) ?? throw new BlockTypeException("Could not find the appropriate group for the block. The block probably doesn't exist or hasn't been submitted."); } + /// + /// Places a new block in the world. + /// + /// The block's type + /// The block's position (a block is 0.2 wide in terms of position) + /// Whether the block should be auto-wired (if functional) + /// The player who placed the block + public Block(BlockIDs type, float3 position, bool autoWire = false, Player player = null) + { + if (!PlacementEngine.IsInGame || !GameState.IsBuildMode()) + throw new BlockException("Blocks can only be placed in build mode."); + var initializer = PlacementEngine.PlaceBlock(type, position, player, autoWire); + Id = initializer.EGID; + InitData.Group = BlockEngine.InitGroup(initializer); + Placed += OnPlacedInit; + } + public EGID Id { get; } internal BlockEngine.BlockInitData InitData; @@ -277,6 +290,10 @@ namespace GamecraftModdingAPI get => BlockEngine.GetBlockInfo(this, (ScalingEntityStruct st) => st.scale); set { + int uscale = UniformScale; + if (value.x < 4e-5) value.x = uscale; + if (value.y < 4e-5) value.y = uscale; + if (value.z < 4e-5) value.z = uscale; BlockEngine.SetBlockInfo(this, (ref ScalingEntityStruct st, float3 val) => st.scale = val, value); if (!Exists) return; //UpdateCollision needs the block to exist ScalingEngine.UpdateCollision(Id); @@ -293,6 +310,7 @@ namespace GamecraftModdingAPI get => BlockEngine.GetBlockInfo(this, (UniformBlockScaleEntityStruct st) => st.scaleFactor); set { + if (value < 1) value = 1; BlockEngine.SetBlockInfo(this, (ref UniformBlockScaleEntityStruct st, int val) => st.scaleFactor = val, value); Scale = new float3(value, value, value); @@ -300,7 +318,7 @@ namespace GamecraftModdingAPI } /** - * Whether the block is fipped. + * Whether the block is flipped. */ public bool Flipped { @@ -342,7 +360,7 @@ namespace GamecraftModdingAPI set { BlockEngine.SetBlockInfo(this, (ref ColourParameterEntityStruct color, BlockColor val) => - { + { //TODO: Check if setting to 255 works color.indexInPalette = val.Index; color.hasNetworkChange = true; color.paletteColour = BlockEngine.ConvertBlockColor(color.indexInPalette); @@ -366,9 +384,12 @@ namespace GamecraftModdingAPI } } + /** + * The block's material. + */ public BlockMaterial Material { - get => BlockEngine.GetBlockInfo(this, (CubeMaterialStruct cmst) => (BlockMaterial) cmst.materialId); + get => BlockEngine.GetBlockInfo(this, (CubeMaterialStruct cmst) => (BlockMaterial) cmst.materialId, BlockMaterial.Default); set => BlockEngine.SetBlockInfo(this, (ref CubeMaterialStruct cmst, BlockMaterial val) => cmst.materialId = (byte) val, value); } @@ -460,7 +481,12 @@ namespace GamecraftModdingAPI /// public T Copy() where T : Block { - var block = PlaceNew(Type, Position, Rotation, Color, Material, UniformScale, Scale); + var block = PlaceNew(Type, Position); + block.Rotation = Rotation; + block.Color = Color; + block.Material = Material; + block.UniformScale = UniformScale; + block.Scale = Scale; block.copiedFrom = Id; return block; } diff --git a/GamecraftModdingAPI/Blocks/PlacementEngine.cs b/GamecraftModdingAPI/Blocks/PlacementEngine.cs index cbc49e2..1d01ae8 100644 --- a/GamecraftModdingAPI/Blocks/PlacementEngine.cs +++ b/GamecraftModdingAPI/Blocks/PlacementEngine.cs @@ -41,64 +41,27 @@ namespace GamecraftModdingAPI.Blocks public EntitiesDB entitiesDB { get; set; } private static BlockEntityFactory _blockEntityFactory; //Injected from PlaceSingleBlockEngine - public EGID PlaceBlock(BlockIDs block, BlockColor color, BlockMaterial materialId, float3 position, int uscale, - float3 scale, Player player, float3 rotation, bool isFlipped, bool autoWire, out EntityInitializer initializer) + public EntityInitializer PlaceBlock(BlockIDs block, float3 position, Player player, bool autoWire) { //It appears that only the non-uniform scale has any visible effect, but if that's not given here it will be set to the uniform one - if (color.Darkness > 9) - throw new Exception("That is too dark. Make sure to use 0-9 as darkness. (0 is default.)"); - initializer = BuildBlock((ushort) block, color.Index, (byte) materialId, position, uscale, scale, rotation, - isFlipped, autoWire, (player ?? new Player(PlayerType.Local)).Id); - return initializer.EGID; + return BuildBlock((ushort) block, position, autoWire, (player ?? Player.LocalPlayer).Id); } - private EntityInitializer BuildBlock(ushort block, byte color, byte materialId, float3 position, int uscale, float3 scale, float3 rot, bool isFlipped, bool autoWire, uint playerId) + private EntityInitializer BuildBlock(ushort block, float3 position, bool autoWire, uint playerId) { if (_blockEntityFactory == null) throw new BlockException("The factory is null."); - if (uscale < 1) - throw new BlockException("Scale needs to be at least 1"); - if (scale.x < 4e-5) scale.x = uscale; - if (scale.y < 4e-5) scale.y = uscale; - if (scale.z < 4e-5) scale.z = uscale; uint resourceId = (uint) PrefabsID.GenerateResourceID(0, block); if (!PrefabsID.PrefabIDByResourceIDMap.ContainsKey(resourceId)) throw new BlockException("Block with ID " + block + " not found!"); //RobocraftX.CR.MachineEditing.PlaceSingleBlockEngine - ScalingEntityStruct scaling = new ScalingEntityStruct {scale = scale * (isFlipped ? -1 : 1)}; - Quaternion rotQ = Quaternion.Euler(rot); - RotationEntityStruct rotation = new RotationEntityStruct {rotation = rotQ}; - GridRotationStruct gridRotation = new GridRotationStruct - {position = position, rotation = rotQ}; DBEntityStruct dbEntity = new DBEntityStruct {DBID = block}; - BlockPlacementScaleEntityStruct placementScale = new BlockPlacementScaleEntityStruct - { - blockPlacementHeight = uscale, blockPlacementWidth = uscale, desiredScaleFactor = uscale - }; EntityInitializer structInitializer = _blockEntityFactory.Build(CommonExclusiveGroups.nextBlockEntityID, block); //The ghost block index is only used for triggers - if (color != byte.MaxValue) - structInitializer.Init(new ColourParameterEntityStruct - { - indexInPalette = color, - hasNetworkChange = true - }); - if (materialId != byte.MaxValue) - structInitializer.Init(new CubeMaterialStruct - { - materialId = materialId - }); - uint prefabId = PrefabsID.GetOrCreatePrefabID(block, materialId, 0, isFlipped); + uint prefabId = PrefabsID.GetOrCreatePrefabID(block, (byte) BlockMaterial.SteelBodywork, 0, false); structInitializer.Init(new GFXPrefabEntityStructGPUI(prefabId)); structInitializer.Init(new PhysicsPrefabEntityStruct(prefabId)); structInitializer.Init(dbEntity); structInitializer.Init(new PositionEntityStruct {position = position}); - structInitializer.Init(rotation); - structInitializer.Init(scaling); - structInitializer.Init(gridRotation); - structInitializer.Init(new UniformBlockScaleEntityStruct - { - scaleFactor = placementScale.desiredScaleFactor - }); structInitializer.Init(new BlockPlacementInfoStruct() { loadedFromDisk = false, @@ -106,20 +69,19 @@ namespace GamecraftModdingAPI.Blocks triggerAutoWiring = autoWire && structInitializer.Has() }); - /*structInitializer.Init(new CollisionFilterOverride + foreach (var group in CharacterExclusiveGroups.AllCharacters) { - belongsTo = 32U, - collidesWith = 239532U - });*/ - - EGID playerEGID = new EGID(playerId, CharacterExclusiveGroups.OnFootGroup); - ref PickedBlockExtraDataStruct pickedBlock = ref entitiesDB.QueryEntity(playerEGID); - pickedBlock.placedBlockEntityID = structInitializer.EGID; - pickedBlock.placedBlockWasAPickedBlock = false; + EGID playerEGID = new EGID(playerId, group); + if (!entitiesDB.TryQueryEntitiesAndIndex(playerEGID, out uint index, + out var array)) continue; + ref PickedBlockExtraDataStruct pickedBlock = ref array[index]; + pickedBlock.placedBlockEntityID = structInitializer.EGID; + pickedBlock.placedBlockWasAPickedBlock = false; + } return structInitializer; } - public string Name { get; } = "GamecraftModdingAPIPlacementGameEngine"; + public string Name => "GamecraftModdingAPIPlacementGameEngine"; public bool isRemovable => false; diff --git a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs index 92b1d7a..973cd4a 100644 --- a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs +++ b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs @@ -294,14 +294,13 @@ namespace GamecraftModdingAPI.Tests .Action((float x, float y, float z) => { var pos = new float3(x, y, z); - var group = BlockGroup.Create(Block.PlaceNew(BlockIDs.Cube, pos, - color: BlockColors.Aqua)); - Block.PlaceNew(BlockIDs.Cube, pos += new float3(1, 0, 0), color: BlockColors.Blue) - .BlockGroup = group; - Block.PlaceNew(BlockIDs.Cube, pos += new float3(1, 0, 0), color: BlockColors.Green) - .BlockGroup = group; - Block.PlaceNew(BlockIDs.Cube, pos += new float3(1, 0, 0), color: BlockColors.Lime) - .BlockGroup = group; + var group = BlockGroup.Create(new Block(BlockIDs.Cube, pos) {Color = BlockColors.Aqua}); + new Block(BlockIDs.Cube, pos += new float3(1, 0, 0)) + {Color = BlockColors.Blue, BlockGroup = group}; + new Block(BlockIDs.Cube, pos += new float3(1, 0, 0)) + {Color = BlockColors.Green, BlockGroup = group}; + new Block(BlockIDs.Cube, pos + new float3(1, 0, 0)) + {Color = BlockColors.Lime, BlockGroup = group}; }).Build(); CommandBuilder.Builder("placeCustomBlock", "Places a custom block, needs a custom catalog and assets.") -- 2.30.2 From cc4850a0730821d031528fbf675867c532793d2b Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Tue, 20 Apr 2021 01:23:39 +0200 Subject: [PATCH 159/252] Fix fake input --- GamecraftModdingAPI/Input/FakeInput.cs | 58 ++++++++++++------- GamecraftModdingAPI/Input/FakeInputEngine.cs | 45 +++++++++++--- .../Tests/GamecraftModdingAPIPluginTest.cs | 7 ++- 3 files changed, 78 insertions(+), 32 deletions(-) diff --git a/GamecraftModdingAPI/Input/FakeInput.cs b/GamecraftModdingAPI/Input/FakeInput.cs index 1d5564d..031a841 100644 --- a/GamecraftModdingAPI/Input/FakeInput.cs +++ b/GamecraftModdingAPI/Input/FakeInput.cs @@ -12,27 +12,41 @@ namespace GamecraftModdingAPI.Input { private static readonly FakeInputEngine inputEngine = new FakeInputEngine(); - /// - /// Customize the player input. - /// - /// The custom input. - /// The player. Omit this to use the local player. - public static void CustomInput(LocalInputEntityStruct input, uint playerID = uint.MaxValue) + /// + /// Customize the local input. + /// + /// The custom input. + public static void CustomInput(LocalInputEntityStruct input) { - if (playerID == uint.MaxValue) - { - playerID = inputEngine.GetLocalPlayerID(); - } - inputEngine.SendCustomInput(input, playerID); + inputEngine.SendCustomInput(input); } - public static LocalInputEntityStruct GetInput(uint playerID = uint.MaxValue) + /// + /// Customize the player input. + /// + /// The custom input. + /// The player. Omit this to use the local player. + public static void CustomPlayerInput(LocalPlayerInputEntityStruct input, uint playerID = uint.MaxValue) { if (playerID == uint.MaxValue) - { - playerID = inputEngine.GetLocalPlayerID(); - } - return inputEngine.GetInput(playerID); + { + playerID = inputEngine.GetLocalPlayerID(); + } + inputEngine.SendCustomPlayerInput(input, playerID); + } + + public static LocalInputEntityStruct GetInput() + { + return inputEngine.GetInput(); + } + + public static LocalPlayerInputEntityStruct GetPlayerInput(uint playerID = uint.MaxValue) + { + if (playerID == uint.MaxValue) + { + playerID = inputEngine.GetLocalPlayerID(); + } + return inputEngine.GetPlayerInput(playerID); } /// @@ -59,7 +73,7 @@ namespace GamecraftModdingAPI.Input { playerID = inputEngine.GetLocalPlayerID(); } - ref LocalInputEntityStruct currentInput = ref inputEngine.GetInputRef(playerID); + ref LocalInputEntityStruct currentInput = ref inputEngine.GetInputRef(); //Utility.Logging.CommandLog($"Current sim frame {currentInput.frame}"); // set inputs switch(hotbar) @@ -107,10 +121,10 @@ namespace GamecraftModdingAPI.Input { playerID = inputEngine.GetLocalPlayerID(); } - ref LocalInputEntityStruct currentInput = ref inputEngine.GetInputRef(playerID); - //Utility.Logging.CommandLog($"Current sim frame {currentInput.frame}"); - // set inputs - TODO - /*if (toggleMode) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.ToggleTimeRunningMode; + ref LocalPlayerInputEntityStruct currentInput = ref inputEngine.GetPlayerInputRef(playerID); + //Utility.Logging.CommandLog($"Current sim frame {currentInput.frame}"); + // set inputs + if (toggleMode) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.ToggleTimeRunningMode; if (forward) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.Forward; if (backward) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.Backward; if (up) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.Up; @@ -134,7 +148,7 @@ namespace GamecraftModdingAPI.Input if (rotateBlockCounterclockwise) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.RotateBlockAnticlockwise; if (cutSelection) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.CutSelection; if (copySelection) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.CopySelection; - if (deleteSelection) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.DeleteSelection;*/ + if (deleteSelection) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.DeleteSelection; } public static void Init() diff --git a/GamecraftModdingAPI/Input/FakeInputEngine.cs b/GamecraftModdingAPI/Input/FakeInputEngine.cs index 11d5f3a..9b85c97 100644 --- a/GamecraftModdingAPI/Input/FakeInputEngine.cs +++ b/GamecraftModdingAPI/Input/FakeInputEngine.cs @@ -1,5 +1,6 @@ using System; +using RobocraftX.Common; using RobocraftX.Common.Input; using RobocraftX.Players; using Svelto.ECS; @@ -29,9 +30,9 @@ namespace GamecraftModdingAPI.Input IsReady = true; } - public bool SendCustomInput(LocalInputEntityStruct input, uint playerID, bool remote = false) + public bool SendCustomInput(LocalInputEntityStruct input) { - EGID egid = new EGID(playerID, remote ? InputExclusiveGroups.RemotePlayers : InputExclusiveGroups.LocalPlayers); + EGID egid = CommonExclusiveGroups.GameStateEGID; if (entitiesDB.Exists(egid)) { ref LocalInputEntityStruct ies = ref entitiesDB.QueryEntity(egid); @@ -41,22 +42,50 @@ namespace GamecraftModdingAPI.Input else return false; } - public LocalInputEntityStruct GetInput(uint playerID, bool remote = false) + public bool SendCustomPlayerInput(LocalPlayerInputEntityStruct input, uint playerID, bool remote = false) { EGID egid = new EGID(playerID, remote ? InputExclusiveGroups.RemotePlayers : InputExclusiveGroups.LocalPlayers); - if (entitiesDB.Exists(egid)) + if (entitiesDB.Exists(egid)) { - return entitiesDB.QueryEntity(egid); + ref LocalPlayerInputEntityStruct ies = ref entitiesDB.QueryEntity(egid); + ies = input; + return true; } - else return default(LocalInputEntityStruct); + else return false; } - public ref LocalInputEntityStruct GetInputRef(uint playerID, bool remote = false) + public LocalInputEntityStruct GetInput() { - EGID egid = new EGID(playerID, remote ? InputExclusiveGroups.RemotePlayers : InputExclusiveGroups.LocalPlayers); + EGID egid = CommonExclusiveGroups.GameStateEGID; + if (entitiesDB.Exists(egid)) + { + return entitiesDB.QueryEntity(egid); + } + else return default(LocalInputEntityStruct); + } + + public LocalPlayerInputEntityStruct GetPlayerInput(uint playerID, bool remote = false) + { + EGID egid = new EGID(playerID, remote ? InputExclusiveGroups.RemotePlayers : InputExclusiveGroups.LocalPlayers); + if (entitiesDB.Exists(egid)) + { + return entitiesDB.QueryEntity(egid); + } + else return default; + } + + public ref LocalInputEntityStruct GetInputRef() + { + EGID egid = CommonExclusiveGroups.GameStateEGID; return ref entitiesDB.QueryEntity(egid); } + public ref LocalPlayerInputEntityStruct GetPlayerInputRef(uint playerID, bool remote = false) + { + EGID egid = new EGID(playerID, remote ? InputExclusiveGroups.RemotePlayers : InputExclusiveGroups.LocalPlayers); + return ref entitiesDB.QueryEntity(egid); + } + public uint GetLocalPlayerID() { return LocalPlayerIDUtility.GetLocalPlayerID(entitiesDB); diff --git a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs index 973cd4a..126fd7d 100644 --- a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs +++ b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs @@ -472,8 +472,11 @@ namespace GamecraftModdingAPI.Tests public override void OnUpdate() { - if(UnityEngine.Input.GetKeyDown(KeyCode.Backslash)) - FakeInput.CustomInput(new LocalInputEntityStruct{commandLineToggleInput = true}); + if (UnityEngine.Input.GetKeyDown(KeyCode.End)) + { + Console.WriteLine("Pressed button to toggle console"); + FakeInput.CustomInput(new LocalInputEntityStruct {commandLineToggleInput = true}); + } } [HarmonyPatch] -- 2.30.2 From 6a2459b3e79600c2e40594cab080b665bef9d6a2 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sat, 24 Apr 2021 03:41:37 +0200 Subject: [PATCH 160/252] Attempts to bring console commands back (test) --- .../Tests/GamecraftModdingAPIPluginTest.cs | 115 ++++++++++++++++++ 1 file changed, 115 insertions(+) diff --git a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs index 126fd7d..218e310 100644 --- a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs +++ b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs @@ -29,8 +29,15 @@ using GamecraftModdingAPI.Blocks; using GamecraftModdingAPI.Input; using GamecraftModdingAPI.Interface.IMGUI; using GamecraftModdingAPI.Players; +using GamecraftModdingAPI.Tasks; using RobocraftX.Common.Input; +using RobocraftX.CR.MainGame; +using RobocraftX.GUI.CommandLine; +using RobocraftX.Multiplayer; +using RobocraftX.StateSync; +using Svelto.Context; using Svelto.DataStructures; +using Svelto.Services; using UnityEngine.AddressableAssets; using UnityEngine.AddressableAssets.ResourceLocators; using UnityEngine.ResourceManagement.AsyncOperations; @@ -493,6 +500,114 @@ namespace GamecraftModdingAPI.Tests } } + [HarmonyPatch] + public static class MainGamePatch + { + public static void Postfix(Transform mainGameTransform) + { + //CommandLineCompositionRoot.Init(mainGameTransform).RunOn(Scheduler.extraLeanRunner); - uREPL C# compilation not supported anymore + } + + public static MethodInfo TargetMethod() + { + return AccessTools.Method(typeof(MainGameCompositionRoot), "Init"); + } + } + + [HarmonyPatch] + public static class MainGamePatch2 + { + public static void Postfix(UnityContext contextHolder, + Action reloadGame, MultiplayerInitParameters multiplayerParameters, + StateSyncRegistrationHelper stateSyncReg) + { + /*CommandLineCompositionRoot.Compose(contextHolder, stateSyncReg.enginesRoot, reloadGame, multiplayerParameters, + stateSyncReg); - uREPL C# compilation not supported anymore */ + var enginesRoot = stateSyncReg.enginesRoot; + var entityFunctions = enginesRoot.GenerateEntityFunctions(); + var entityFactory = enginesRoot.GenerateEntityFactory(); + var entitySerializer = enginesRoot.GenerateEntitySerializer(); + enginesRoot.AddEngine((IEngine) Activator.CreateInstance( + AccessTools.TypeByName("RobocraftX.GUI.CommandLine.ExecuteSetGravityCommandEngine"))); + enginesRoot.AddEngine((IEngine) Activator.CreateInstance( + AccessTools.TypeByName("RobocraftX.GUI.CommandLine.ExecuteSetPhysicsPrecisionCommandEngine"))); + enginesRoot.AddEngine((IEngine) Activator.CreateInstance( + AccessTools.TypeByName("RobocraftX.GUI.CommandLine.ExecuteSetPhysicsFrequencyCommandEngine"))); + enginesRoot.AddEngine((IEngine) Activator.CreateInstance( + AccessTools.TypeByName( + "RobocraftX.GUI.CommandLine.ExecuteClearAllPartsCommandEngine"), + entityFunctions)); + enginesRoot.AddEngine((IEngine) Activator.CreateInstance( + AccessTools.TypeByName("RobocraftX.GUI.CommandLine.ExecuteHelpCommandEngine"))); + enginesRoot.AddEngine((IEngine) Activator.CreateInstance( + AccessTools.TypeByName( + "RobocraftX.GUI.CommandLine.ExecuteSetLinearRestingThresholdCommandEngine"))); + enginesRoot.AddEngine((IEngine) Activator.CreateInstance( + AccessTools.TypeByName( + "RobocraftX.GUI.CommandLine.ExecuteSetAngularRestingThresholdCommandEngine"))); + enginesRoot.AddEngine((IEngine) Activator.CreateInstance( + AccessTools.TypeByName("RobocraftX.GUI.CommandLine.ExecuteEnableVisualProfilerCommandEngine"))); + enginesRoot.AddEngine((IEngine) Activator.CreateInstance( + AccessTools.TypeByName("RobocraftX.GUI.CommandLine.ExecuteSetNetworkJitterFramesEngine"))); + enginesRoot.AddEngine((IEngine) Activator.CreateInstance( + AccessTools.TypeByName("RobocraftX.GUI.CommandLine.ExecuteSetSendConnectedEntitiesCommandEngine"))); + enginesRoot.AddEngine((IEngine) Activator.CreateInstance( + AccessTools.TypeByName("RobocraftX.GUI.CommandLine.ExecuteSetMaxSimFramesEngine"))); + enginesRoot.AddEngine((IEngine) Activator.CreateInstance( + AccessTools.TypeByName("RobocraftX.GUI.CommandLine.SetDebugDisplayExtraInfoCommandEngine"))); + enginesRoot.AddEngine((IEngine) Activator.CreateInstance( + AccessTools.TypeByName("RobocraftX.GUI.CommandLine.SetNetSyncBandwidthLimitCommandEngine"))); + enginesRoot.AddEngine((IEngine) Activator.CreateInstance( + AccessTools.TypeByName("RobocraftX.GUI.CommandLine.ThrowExceptionCommandEngine"))); + enginesRoot.AddEngine((IEngine) Activator.CreateInstance( + AccessTools.TypeByName("RobocraftX.GUI.CommandLine.SetPriorityCommandEngine"))); + enginesRoot.AddEngine((IEngine) Activator.CreateInstance( + AccessTools.TypeByName("RobocraftX.GUI.CommandLine.TeleportCharacterCommandEngine"), + entityFactory)); + enginesRoot.AddEngine((IEngine) Activator.CreateInstance( + AccessTools.TypeByName("RobocraftX.GUI.CommandLine.ChangeTextBlockTextCommandEngine"))); + enginesRoot.AddEngine((IEngine) Activator.CreateInstance( + AccessTools.TypeByName("RobocraftX.GUI.CommandLine.SetCharacterRunSpeedCommandEngine"))); + enginesRoot.AddEngine((IEngine) Activator.CreateInstance( + AccessTools.TypeByName("RobocraftX.GUI.CommandLine.SetCameraZoomDistanceCommandEngine"))); + enginesRoot.AddEngine((IEngine) Activator.CreateInstance( + AccessTools.TypeByName("RobocraftX.GUI.CommandLine.EditLightingSettingsCommandEngine"))); + enginesRoot.AddEngine((IEngine) Activator.CreateInstance( + AccessTools.TypeByName("RobocraftX.GUI.CommandLine.EditSkySettingsCommandEngine"))); + enginesRoot.AddEngine((IEngine) Activator.CreateInstance( + AccessTools.TypeByName("RobocraftX.GUI.CommandLine.EditFogSettingsCommandEngine"))); + enginesRoot.AddEngine((IEngine) Activator.CreateInstance( + AccessTools.TypeByName("RobocraftX.GUI.CommandLine.TeleportCharacterImplementationEngine"), + entityFunctions)); + enginesRoot.AddEngine((IEngine) Activator.CreateInstance( + AccessTools.TypeByName("RobocraftX.GUI.CommandLine.ExecuteConnectToServerCommandEngine"), + entityFunctions, entitySerializer, reloadGame, multiplayerParameters)); + enginesRoot.AddEngine((IEngine) Activator.CreateInstance( + AccessTools.TypeByName("RobocraftX.GUI.CommandLine.SetInputBroadcastCommandEngine"))); + enginesRoot.AddEngine((IEngine) Activator.CreateInstance( + AccessTools.TypeByName("RobocraftX.GUI.CommandLine.ExecuteSetJointInertiaTensorCommandEngine"))); + enginesRoot.AddEngine( + (IEngine) Activator.CreateInstance( + AccessTools.TypeByName("RobocraftX.GUI.CommandLine.CommandLineInputEngine"))); + stateSyncReg.AddDeterministicEngine( + (IDeterministicEngine) Activator.CreateInstance( + AccessTools.TypeByName("RobocraftX.GUI.CommandLine.ExecuteCommandEngine"))); + enginesRoot.AddEngine( + (IEngine) Activator.CreateInstance( + AccessTools.TypeByName("RobocraftX.GUI.CommandLine.ChangeTeamCommandEngine"))); + enginesRoot.AddEngine((IEngine) Activator.CreateInstance( + AccessTools.TypeByName("RobocraftX.GUI.CommandLine.DamageCharacterCommandEngine"), entityFactory)); + enginesRoot.AddEngine((IEngine) Activator.CreateInstance( + AccessTools.TypeByName("RobocraftX.GUI.CommandLine.DisableCharacterDamageCommandEngine"))); + } + + public static MethodInfo TargetMethod() + { + return AccessTools.Method(typeof(MainGameCompositionRoot), "DeterministicCompose") + .MakeGenericMethod(typeof(UnityContext)); + } + } + [CustomBlock("customCatalog.json", "Assets/Prefabs/Cube.prefab", "strAluminiumCube", SortIndex = 12)] public class TestBlock : CustomBlock { -- 2.30.2 From eb7a09ed2226a231ded572b57386e795e20ad8eb Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sun, 25 Apr 2021 02:06:47 +0200 Subject: [PATCH 161/252] Fixes, move command patch out of the test class Removed some command line engines that shouldn't be registered Fixed registering custom commands - registering it with the existing ones --- GamecraftModdingAPI/Commands/CommandPatch.cs | 103 ++++++++++++++--- .../Tests/GamecraftModdingAPIPluginTest.cs | 108 ------------------ 2 files changed, 85 insertions(+), 126 deletions(-) diff --git a/GamecraftModdingAPI/Commands/CommandPatch.cs b/GamecraftModdingAPI/Commands/CommandPatch.cs index ab90e6e..bf9f186 100644 --- a/GamecraftModdingAPI/Commands/CommandPatch.cs +++ b/GamecraftModdingAPI/Commands/CommandPatch.cs @@ -1,38 +1,105 @@ -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System; using System.Reflection; using HarmonyLib; using Svelto.Context; using Svelto.ECS; -using RobocraftX; - -using GamecraftModdingAPI.Utility; +using RobocraftX.CR.MainGame; +using RobocraftX.Multiplayer; +using RobocraftX.StateSync; namespace GamecraftModdingAPI.Commands { /// - /// Patch of RobocraftX.GUI.CommandLine.CommandLineCompositionRoot.Compose() + /// Patch of RobocraftX.CR.MainGame.MainGameCompositionRoot.DeterministicCompose() + /// Initializes existing and custom commands /// - // TODO: fix [HarmonyPatch] - //[HarmonyPatch(typeof(RobocraftX.GUI.CommandLine.CommandLineCompositionRoot))] - //[HarmonyPatch("Compose")] - //[HarmonyPatch("Compose", new Type[] { typeof(UnityContext), typeof(EnginesRoot), typeof(World), typeof(Action), typeof(MultiplayerInitParameters), typeof(StateSyncRegistrationHelper)})] static class CommandPatch { - public static void Postfix(EnginesRoot enginesRoot) + public static void Postfix(Action reloadGame, MultiplayerInitParameters multiplayerParameters, + StateSyncRegistrationHelper stateSyncReg) { - // When a game is loaded, register the command engines + /*CommandLineCompositionRoot.Compose(contextHolder, stateSyncReg.enginesRoot, reloadGame, multiplayerParameters, + stateSyncReg); - uREPL C# compilation not supported anymore */ + var enginesRoot = stateSyncReg.enginesRoot; + var entityFunctions = enginesRoot.GenerateEntityFunctions(); + var entityFactory = enginesRoot.GenerateEntityFactory(); + var entitySerializer = enginesRoot.GenerateEntitySerializer(); + enginesRoot.AddEngine((IEngine) Activator.CreateInstance( + AccessTools.TypeByName("RobocraftX.GUI.CommandLine.ExecuteSetGravityCommandEngine"))); + enginesRoot.AddEngine((IEngine) Activator.CreateInstance( + AccessTools.TypeByName("RobocraftX.GUI.CommandLine.ExecuteSetPhysicsPrecisionCommandEngine"))); + enginesRoot.AddEngine((IEngine) Activator.CreateInstance( + AccessTools.TypeByName("RobocraftX.GUI.CommandLine.ExecuteSetPhysicsFrequencyCommandEngine"))); + enginesRoot.AddEngine((IEngine) Activator.CreateInstance( + AccessTools.TypeByName( + "RobocraftX.GUI.CommandLine.ExecuteClearAllPartsCommandEngine"), + entityFunctions)); + enginesRoot.AddEngine((IEngine) Activator.CreateInstance( + AccessTools.TypeByName("RobocraftX.GUI.CommandLine.ExecuteHelpCommandEngine"))); + enginesRoot.AddEngine((IEngine) Activator.CreateInstance( + AccessTools.TypeByName( + "RobocraftX.GUI.CommandLine.ExecuteSetLinearRestingThresholdCommandEngine"))); + enginesRoot.AddEngine((IEngine) Activator.CreateInstance( + AccessTools.TypeByName( + "RobocraftX.GUI.CommandLine.ExecuteSetAngularRestingThresholdCommandEngine"))); + enginesRoot.AddEngine((IEngine) Activator.CreateInstance( + AccessTools.TypeByName("RobocraftX.GUI.CommandLine.ExecuteEnableVisualProfilerCommandEngine"))); + enginesRoot.AddEngine((IEngine) Activator.CreateInstance( + AccessTools.TypeByName("RobocraftX.GUI.CommandLine.ExecuteSetNetworkJitterFramesEngine"))); + enginesRoot.AddEngine((IEngine) Activator.CreateInstance( + AccessTools.TypeByName("RobocraftX.GUI.CommandLine.ExecuteSetSendConnectedEntitiesCommandEngine"))); + enginesRoot.AddEngine((IEngine) Activator.CreateInstance( + AccessTools.TypeByName("RobocraftX.GUI.CommandLine.ExecuteSetMaxSimFramesEngine"))); + enginesRoot.AddEngine((IEngine) Activator.CreateInstance( + AccessTools.TypeByName("RobocraftX.GUI.CommandLine.SetDebugDisplayExtraInfoCommandEngine"))); + enginesRoot.AddEngine((IEngine) Activator.CreateInstance( + AccessTools.TypeByName("RobocraftX.GUI.CommandLine.SetNetSyncBandwidthLimitCommandEngine"))); + enginesRoot.AddEngine((IEngine) Activator.CreateInstance( + AccessTools.TypeByName("RobocraftX.GUI.CommandLine.ThrowExceptionCommandEngine"))); + enginesRoot.AddEngine((IEngine) Activator.CreateInstance( + AccessTools.TypeByName("RobocraftX.GUI.CommandLine.SetPriorityCommandEngine"))); + enginesRoot.AddEngine((IEngine) Activator.CreateInstance( + AccessTools.TypeByName("RobocraftX.GUI.CommandLine.TeleportCharacterCommandEngine"), + entityFactory)); + enginesRoot.AddEngine((IEngine) Activator.CreateInstance( + AccessTools.TypeByName("RobocraftX.GUI.CommandLine.ChangeTextBlockTextCommandEngine"))); + enginesRoot.AddEngine((IEngine) Activator.CreateInstance( + AccessTools.TypeByName("RobocraftX.GUI.CommandLine.SetCharacterRunSpeedCommandEngine"))); + enginesRoot.AddEngine((IEngine) Activator.CreateInstance( + AccessTools.TypeByName("RobocraftX.GUI.CommandLine.SetCameraZoomDistanceCommandEngine"))); + enginesRoot.AddEngine((IEngine) Activator.CreateInstance( + AccessTools.TypeByName("RobocraftX.GUI.CommandLine.EditLightingSettingsCommandEngine"))); + enginesRoot.AddEngine((IEngine) Activator.CreateInstance( + AccessTools.TypeByName("RobocraftX.GUI.CommandLine.EditSkySettingsCommandEngine"))); + enginesRoot.AddEngine((IEngine) Activator.CreateInstance( + AccessTools.TypeByName("RobocraftX.GUI.CommandLine.EditFogSettingsCommandEngine"))); + enginesRoot.AddEngine((IEngine) Activator.CreateInstance( + AccessTools.TypeByName("RobocraftX.GUI.CommandLine.TeleportCharacterImplementationEngine"), + entityFunctions)); + enginesRoot.AddEngine((IEngine) Activator.CreateInstance( + AccessTools.TypeByName("RobocraftX.GUI.CommandLine.ExecuteConnectToServerCommandEngine"), + entityFunctions, entitySerializer, reloadGame, multiplayerParameters)); + enginesRoot.AddEngine((IEngine) Activator.CreateInstance( + AccessTools.TypeByName("RobocraftX.GUI.CommandLine.SetInputBroadcastCommandEngine"))); + enginesRoot.AddEngine((IEngine) Activator.CreateInstance( + AccessTools.TypeByName("RobocraftX.GUI.CommandLine.ExecuteSetJointInertiaTensorCommandEngine"))); + enginesRoot.AddEngine( + (IEngine) Activator.CreateInstance( + AccessTools.TypeByName("RobocraftX.GUI.CommandLine.ChangeTeamCommandEngine"))); + enginesRoot.AddEngine((IEngine) Activator.CreateInstance( + AccessTools.TypeByName("RobocraftX.GUI.CommandLine.DamageCharacterCommandEngine"), entityFactory)); + enginesRoot.AddEngine((IEngine) Activator.CreateInstance( + AccessTools.TypeByName("RobocraftX.GUI.CommandLine.DisableCharacterDamageCommandEngine"))); + CommandManager.RegisterEngines(enginesRoot); } - public static MethodBase TargetMethod(Harmony instance) + public static MethodInfo TargetMethod() { - return typeof(RobocraftX.GUI.CommandLine.CommandLineCompositionRoot).GetMethod("Compose").MakeGenericMethod(typeof(object)); - //return func.Method; + return AccessTools.Method(typeof(MainGameCompositionRoot), "DeterministicCompose") + .MakeGenericMethod(typeof(UnityContext)); } } -} +} \ No newline at end of file diff --git a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs index 218e310..75079a8 100644 --- a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs +++ b/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs @@ -500,114 +500,6 @@ namespace GamecraftModdingAPI.Tests } } - [HarmonyPatch] - public static class MainGamePatch - { - public static void Postfix(Transform mainGameTransform) - { - //CommandLineCompositionRoot.Init(mainGameTransform).RunOn(Scheduler.extraLeanRunner); - uREPL C# compilation not supported anymore - } - - public static MethodInfo TargetMethod() - { - return AccessTools.Method(typeof(MainGameCompositionRoot), "Init"); - } - } - - [HarmonyPatch] - public static class MainGamePatch2 - { - public static void Postfix(UnityContext contextHolder, - Action reloadGame, MultiplayerInitParameters multiplayerParameters, - StateSyncRegistrationHelper stateSyncReg) - { - /*CommandLineCompositionRoot.Compose(contextHolder, stateSyncReg.enginesRoot, reloadGame, multiplayerParameters, - stateSyncReg); - uREPL C# compilation not supported anymore */ - var enginesRoot = stateSyncReg.enginesRoot; - var entityFunctions = enginesRoot.GenerateEntityFunctions(); - var entityFactory = enginesRoot.GenerateEntityFactory(); - var entitySerializer = enginesRoot.GenerateEntitySerializer(); - enginesRoot.AddEngine((IEngine) Activator.CreateInstance( - AccessTools.TypeByName("RobocraftX.GUI.CommandLine.ExecuteSetGravityCommandEngine"))); - enginesRoot.AddEngine((IEngine) Activator.CreateInstance( - AccessTools.TypeByName("RobocraftX.GUI.CommandLine.ExecuteSetPhysicsPrecisionCommandEngine"))); - enginesRoot.AddEngine((IEngine) Activator.CreateInstance( - AccessTools.TypeByName("RobocraftX.GUI.CommandLine.ExecuteSetPhysicsFrequencyCommandEngine"))); - enginesRoot.AddEngine((IEngine) Activator.CreateInstance( - AccessTools.TypeByName( - "RobocraftX.GUI.CommandLine.ExecuteClearAllPartsCommandEngine"), - entityFunctions)); - enginesRoot.AddEngine((IEngine) Activator.CreateInstance( - AccessTools.TypeByName("RobocraftX.GUI.CommandLine.ExecuteHelpCommandEngine"))); - enginesRoot.AddEngine((IEngine) Activator.CreateInstance( - AccessTools.TypeByName( - "RobocraftX.GUI.CommandLine.ExecuteSetLinearRestingThresholdCommandEngine"))); - enginesRoot.AddEngine((IEngine) Activator.CreateInstance( - AccessTools.TypeByName( - "RobocraftX.GUI.CommandLine.ExecuteSetAngularRestingThresholdCommandEngine"))); - enginesRoot.AddEngine((IEngine) Activator.CreateInstance( - AccessTools.TypeByName("RobocraftX.GUI.CommandLine.ExecuteEnableVisualProfilerCommandEngine"))); - enginesRoot.AddEngine((IEngine) Activator.CreateInstance( - AccessTools.TypeByName("RobocraftX.GUI.CommandLine.ExecuteSetNetworkJitterFramesEngine"))); - enginesRoot.AddEngine((IEngine) Activator.CreateInstance( - AccessTools.TypeByName("RobocraftX.GUI.CommandLine.ExecuteSetSendConnectedEntitiesCommandEngine"))); - enginesRoot.AddEngine((IEngine) Activator.CreateInstance( - AccessTools.TypeByName("RobocraftX.GUI.CommandLine.ExecuteSetMaxSimFramesEngine"))); - enginesRoot.AddEngine((IEngine) Activator.CreateInstance( - AccessTools.TypeByName("RobocraftX.GUI.CommandLine.SetDebugDisplayExtraInfoCommandEngine"))); - enginesRoot.AddEngine((IEngine) Activator.CreateInstance( - AccessTools.TypeByName("RobocraftX.GUI.CommandLine.SetNetSyncBandwidthLimitCommandEngine"))); - enginesRoot.AddEngine((IEngine) Activator.CreateInstance( - AccessTools.TypeByName("RobocraftX.GUI.CommandLine.ThrowExceptionCommandEngine"))); - enginesRoot.AddEngine((IEngine) Activator.CreateInstance( - AccessTools.TypeByName("RobocraftX.GUI.CommandLine.SetPriorityCommandEngine"))); - enginesRoot.AddEngine((IEngine) Activator.CreateInstance( - AccessTools.TypeByName("RobocraftX.GUI.CommandLine.TeleportCharacterCommandEngine"), - entityFactory)); - enginesRoot.AddEngine((IEngine) Activator.CreateInstance( - AccessTools.TypeByName("RobocraftX.GUI.CommandLine.ChangeTextBlockTextCommandEngine"))); - enginesRoot.AddEngine((IEngine) Activator.CreateInstance( - AccessTools.TypeByName("RobocraftX.GUI.CommandLine.SetCharacterRunSpeedCommandEngine"))); - enginesRoot.AddEngine((IEngine) Activator.CreateInstance( - AccessTools.TypeByName("RobocraftX.GUI.CommandLine.SetCameraZoomDistanceCommandEngine"))); - enginesRoot.AddEngine((IEngine) Activator.CreateInstance( - AccessTools.TypeByName("RobocraftX.GUI.CommandLine.EditLightingSettingsCommandEngine"))); - enginesRoot.AddEngine((IEngine) Activator.CreateInstance( - AccessTools.TypeByName("RobocraftX.GUI.CommandLine.EditSkySettingsCommandEngine"))); - enginesRoot.AddEngine((IEngine) Activator.CreateInstance( - AccessTools.TypeByName("RobocraftX.GUI.CommandLine.EditFogSettingsCommandEngine"))); - enginesRoot.AddEngine((IEngine) Activator.CreateInstance( - AccessTools.TypeByName("RobocraftX.GUI.CommandLine.TeleportCharacterImplementationEngine"), - entityFunctions)); - enginesRoot.AddEngine((IEngine) Activator.CreateInstance( - AccessTools.TypeByName("RobocraftX.GUI.CommandLine.ExecuteConnectToServerCommandEngine"), - entityFunctions, entitySerializer, reloadGame, multiplayerParameters)); - enginesRoot.AddEngine((IEngine) Activator.CreateInstance( - AccessTools.TypeByName("RobocraftX.GUI.CommandLine.SetInputBroadcastCommandEngine"))); - enginesRoot.AddEngine((IEngine) Activator.CreateInstance( - AccessTools.TypeByName("RobocraftX.GUI.CommandLine.ExecuteSetJointInertiaTensorCommandEngine"))); - enginesRoot.AddEngine( - (IEngine) Activator.CreateInstance( - AccessTools.TypeByName("RobocraftX.GUI.CommandLine.CommandLineInputEngine"))); - stateSyncReg.AddDeterministicEngine( - (IDeterministicEngine) Activator.CreateInstance( - AccessTools.TypeByName("RobocraftX.GUI.CommandLine.ExecuteCommandEngine"))); - enginesRoot.AddEngine( - (IEngine) Activator.CreateInstance( - AccessTools.TypeByName("RobocraftX.GUI.CommandLine.ChangeTeamCommandEngine"))); - enginesRoot.AddEngine((IEngine) Activator.CreateInstance( - AccessTools.TypeByName("RobocraftX.GUI.CommandLine.DamageCharacterCommandEngine"), entityFactory)); - enginesRoot.AddEngine((IEngine) Activator.CreateInstance( - AccessTools.TypeByName("RobocraftX.GUI.CommandLine.DisableCharacterDamageCommandEngine"))); - } - - public static MethodInfo TargetMethod() - { - return AccessTools.Method(typeof(MainGameCompositionRoot), "DeterministicCompose") - .MakeGenericMethod(typeof(UnityContext)); - } - } - [CustomBlock("customCatalog.json", "Assets/Prefabs/Cube.prefab", "strAluminiumCube", SortIndex = 12)] public class TestBlock : CustomBlock { -- 2.30.2 From 55b38f1678c9df281b8a913f3f424b5d54fd94a7 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Mon, 26 Apr 2021 03:12:22 +0200 Subject: [PATCH 162/252] Start working on FlyCam and create an overcomplicated struct Just some native code that's totally unnecessary --- GamecraftModdingAPI/FlyCam.cs | 26 ++++++ GamecraftModdingAPI/OptionalRef.cs | 99 +++++++++++++++++++++ GamecraftModdingAPI/Players/FlyCamEngine.cs | 28 ++++++ 3 files changed, 153 insertions(+) create mode 100644 GamecraftModdingAPI/FlyCam.cs create mode 100644 GamecraftModdingAPI/OptionalRef.cs create mode 100644 GamecraftModdingAPI/Players/FlyCamEngine.cs diff --git a/GamecraftModdingAPI/FlyCam.cs b/GamecraftModdingAPI/FlyCam.cs new file mode 100644 index 0000000..15a6aa5 --- /dev/null +++ b/GamecraftModdingAPI/FlyCam.cs @@ -0,0 +1,26 @@ +using GamecraftModdingAPI.Players; +using Svelto.ECS.EntityStructs; +using Unity.Mathematics; + +namespace GamecraftModdingAPI +{ + public class FlyCam + { + private static FlyCamEngine Engine; + + public uint Id { get; } + + public FlyCam(uint id) => Id = id; + + public unsafe float3 Position + { + get => Engine.GetComponent(Id).Map(pos => &pos->position); + set => Engine.GetComponent(Id).Map(pos => &pos->position).Set(value); + } + + public static void Init() + { + Engine = new FlyCamEngine(); + } + } +} \ No newline at end of file diff --git a/GamecraftModdingAPI/OptionalRef.cs b/GamecraftModdingAPI/OptionalRef.cs new file mode 100644 index 0000000..a1b09cd --- /dev/null +++ b/GamecraftModdingAPI/OptionalRef.cs @@ -0,0 +1,99 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Expressions; +using GamecraftModdingAPI.Blocks; +using Svelto.DataStructures; +using Svelto.ECS; + +namespace GamecraftModdingAPI +{ + public struct OptionalRef where T : unmanaged + { + private bool exists; + private NB array; + private uint index; + + private unsafe T* pointer; + + public OptionalRef(NB array, uint index) + { + exists = true; + this.array = array; + this.index = index; + unsafe + { + pointer = null; + } + } + + public OptionalRef(ref T value) + { + unsafe + { + fixed(T* p = &value) pointer = p; + } + + exists = true; + array = default; + index = default; + } + + public ref T Get() + { + unsafe + { + if (pointer != null && exists) + return ref *pointer; + } + + if (exists) + return ref array[index]; + throw new InvalidOperationException("Calling Get() on an empty OptionalRef"); + } + + public T Value + { + get + { + unsafe + { + if (pointer != null && exists) + return *pointer; + } + + if (exists) + return array[index]; + return default; + } + } + + public unsafe void Set(T value) //Can't use properties because it complains that you can't set struct members + { + if (pointer != null && exists) + *pointer = value; + } + + public bool Exists => exists; + + public static implicit operator T(OptionalRef opt) => opt.Value; + + public static implicit operator bool(OptionalRef opt) => opt.exists; + + public delegate ref TR Mapper(ref T component) where TR : unmanaged; + public unsafe delegate TR* PMapper(T* component) where TR : unmanaged; + + /*public OptionalRef Map(Mapper mapper) where TR : unmanaged => + exists ? new OptionalRef(ref mapper(ref Get())) : new OptionalRef();*/ + + /*public OptionalRef Map(Expression> expression) where TR : unmanaged + { + if (expression.Body.NodeType == ExpressionType.MemberAccess) + Console.WriteLine(((MemberExpression) expression.Body).Member); + }*/ + + public unsafe OptionalRef Map(PMapper mapper) where TR : unmanaged => + exists ? new OptionalRef(ref *mapper(pointer)) : new OptionalRef(); + } +} \ No newline at end of file diff --git a/GamecraftModdingAPI/Players/FlyCamEngine.cs b/GamecraftModdingAPI/Players/FlyCamEngine.cs new file mode 100644 index 0000000..b8f8cf4 --- /dev/null +++ b/GamecraftModdingAPI/Players/FlyCamEngine.cs @@ -0,0 +1,28 @@ +using GamecraftModdingAPI.Engines; +using Svelto.ECS; +using Techblox.FlyCam; + +namespace GamecraftModdingAPI.Players +{ + public class FlyCamEngine : IApiEngine + { + public void Ready() + { + } + + public EntitiesDB entitiesDB { get; set; } + public void Dispose() + { + } + + public string Name => "TechbloxModdingAPIFlyCamEngine"; + public bool isRemovable => false; + + public OptionalRef GetComponent(uint id) where T : unmanaged, IEntityComponent + { + if (entitiesDB.TryQueryEntitiesAndIndex(id, Techblox.FlyCam.FlyCam.Group, out uint index, out var array)) + return new OptionalRef(array, index); + return new OptionalRef(); + } + } +} \ No newline at end of file -- 2.30.2 From 6e03847ab0764dab84b413177147dd7d5c684767 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Tue, 27 Apr 2021 01:52:54 +0200 Subject: [PATCH 163/252] FlyCam additions, improve struct Added property to get the camera from the player Removed pointer magic --- GamecraftModdingAPI/FlyCam.cs | 103 ++++++++++++++++++++- GamecraftModdingAPI/OptionalRef.cs | 99 -------------------- GamecraftModdingAPI/Player.cs | 5 + GamecraftModdingAPI/Utility/OptionalRef.cs | 60 ++++++++++++ 4 files changed, 163 insertions(+), 104 deletions(-) delete mode 100644 GamecraftModdingAPI/OptionalRef.cs create mode 100644 GamecraftModdingAPI/Utility/OptionalRef.cs diff --git a/GamecraftModdingAPI/FlyCam.cs b/GamecraftModdingAPI/FlyCam.cs index 15a6aa5..be9955f 100644 --- a/GamecraftModdingAPI/FlyCam.cs +++ b/GamecraftModdingAPI/FlyCam.cs @@ -1,26 +1,119 @@ using GamecraftModdingAPI.Players; +using GamecraftModdingAPI.Utility; + +using RobocraftX.Physics; using Svelto.ECS.EntityStructs; +using Techblox.FlyCam; using Unity.Mathematics; +using UnityEngine; namespace GamecraftModdingAPI { public class FlyCam { - private static FlyCamEngine Engine; + private static FlyCamEngine Engine = new FlyCamEngine(); public uint Id { get; } public FlyCam(uint id) => Id = id; - public unsafe float3 Position + /// + /// The local player's camera. + /// + public static FlyCam LocalCamera => new FlyCam(Player.LocalPlayer.Id); + + /// + /// The current position of the camera. + /// + public float3 Position { - get => Engine.GetComponent(Id).Map(pos => &pos->position); - set => Engine.GetComponent(Id).Map(pos => &pos->position).Set(value); + get => Engine.GetComponent(Id).Get().position; + set + { + Engine.GetComponent(Id).Get().position = value; + Engine.GetComponent(Id).Get().position = value; + } + } + + /// + /// The current rotation of the camera. + /// + public float3 Rotation + { + get => ((Quaternion) Engine.GetComponent(Id).Get().rotation).eulerAngles; + set + { + Engine.GetComponent(Id).Get().rotation = Quaternion.Euler(value); + Engine.GetComponent(Id).Get().rotation = Quaternion.Euler(value); + } + } + + /// + /// The current direction the camera is moving. + /// + public float3 MovementDirection + { + get => Engine.GetComponent(Id).Get().movementDirection; + set => Engine.GetComponent(Id).Get().movementDirection = value; + } + + /// + /// Whether the camera (player) is sprinting. + /// + public bool Sprinting + { + get => Engine.GetComponent(Id).Get().sprinting; + set => Engine.GetComponent(Id).Get().sprinting = value; + } + + /// + /// The speed setting of the camera. + /// + public float Speed + { + get => Engine.GetComponent(Id).Get().speed; + set => Engine.GetComponent(Id).Get().speed = value; + } + + /// + /// The multiplier setting to use when sprinting. + /// + public float SpeedSprintMultiplier + { + get => Engine.GetComponent(Id).Get().speedSprintMultiplier; + set => Engine.GetComponent(Id).Get().speedSprintMultiplier = value; + } + + /// + /// The acceleration setting of the camera. + /// + public float Acceleration + { + get => Engine.GetComponent(Id).Get().acceleration; + set => Engine.GetComponent(Id).Get().acceleration = value; + } + + /// + /// The current velocity of the camera. + /// + public float3 Velocity + { + get => Engine.GetComponent(Id).Get().velocity; + set => Engine.GetComponent(Id).Get().velocity = value; + } + + /// + /// The current angular velocity of the camera. + /// + public float3 AngularVelocity + { + get => Engine.GetComponent(Id).Get().angularVelocity; + set => Engine.GetComponent(Id).Get().angularVelocity = value; } public static void Init() { - Engine = new FlyCamEngine(); + GameEngineManager.AddGameEngine(Engine); } } } \ No newline at end of file diff --git a/GamecraftModdingAPI/OptionalRef.cs b/GamecraftModdingAPI/OptionalRef.cs deleted file mode 100644 index a1b09cd..0000000 --- a/GamecraftModdingAPI/OptionalRef.cs +++ /dev/null @@ -1,99 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using GamecraftModdingAPI.Blocks; -using Svelto.DataStructures; -using Svelto.ECS; - -namespace GamecraftModdingAPI -{ - public struct OptionalRef where T : unmanaged - { - private bool exists; - private NB array; - private uint index; - - private unsafe T* pointer; - - public OptionalRef(NB array, uint index) - { - exists = true; - this.array = array; - this.index = index; - unsafe - { - pointer = null; - } - } - - public OptionalRef(ref T value) - { - unsafe - { - fixed(T* p = &value) pointer = p; - } - - exists = true; - array = default; - index = default; - } - - public ref T Get() - { - unsafe - { - if (pointer != null && exists) - return ref *pointer; - } - - if (exists) - return ref array[index]; - throw new InvalidOperationException("Calling Get() on an empty OptionalRef"); - } - - public T Value - { - get - { - unsafe - { - if (pointer != null && exists) - return *pointer; - } - - if (exists) - return array[index]; - return default; - } - } - - public unsafe void Set(T value) //Can't use properties because it complains that you can't set struct members - { - if (pointer != null && exists) - *pointer = value; - } - - public bool Exists => exists; - - public static implicit operator T(OptionalRef opt) => opt.Value; - - public static implicit operator bool(OptionalRef opt) => opt.exists; - - public delegate ref TR Mapper(ref T component) where TR : unmanaged; - public unsafe delegate TR* PMapper(T* component) where TR : unmanaged; - - /*public OptionalRef Map(Mapper mapper) where TR : unmanaged => - exists ? new OptionalRef(ref mapper(ref Get())) : new OptionalRef();*/ - - /*public OptionalRef Map(Expression> expression) where TR : unmanaged - { - if (expression.Body.NodeType == ExpressionType.MemberAccess) - Console.WriteLine(((MemberExpression) expression.Body).Member); - }*/ - - public unsafe OptionalRef Map(PMapper mapper) where TR : unmanaged => - exists ? new OptionalRef(ref *mapper(pointer)) : new OptionalRef(); - } -} \ No newline at end of file diff --git a/GamecraftModdingAPI/Player.cs b/GamecraftModdingAPI/Player.cs index 0bed6a2..8b204d0 100644 --- a/GamecraftModdingAPI/Player.cs +++ b/GamecraftModdingAPI/Player.cs @@ -414,6 +414,11 @@ namespace GamecraftModdingAPI return playerEngine.GetSelectedBlocks(Id); } + /// + /// The camera of this player used when building. + /// + public FlyCam BuildCamera => new FlyCam(Id); + public bool Equals(Player other) { if (ReferenceEquals(null, other)) return false; diff --git a/GamecraftModdingAPI/Utility/OptionalRef.cs b/GamecraftModdingAPI/Utility/OptionalRef.cs new file mode 100644 index 0000000..4ac293d --- /dev/null +++ b/GamecraftModdingAPI/Utility/OptionalRef.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Expressions; +using GamecraftModdingAPI.Blocks; +using Svelto.DataStructures; +using Svelto.ECS; + +namespace GamecraftModdingAPI +{ + public struct OptionalRef where T : unmanaged + { + private bool exists; + private NB array; + private uint index; + + public OptionalRef(NB array, uint index) + { + exists = true; + this.array = array; + this.index = index; + } + + public OptionalRef(ref T value) + { + exists = true; + array = default; + index = default; + } + + public ref T Get(T def = default) + { + if (exists) + return ref array[index]; + return ref CompRefCache._default; + } + + public bool Exists => exists; + + public static implicit operator T(OptionalRef opt) => opt.Get(); + + public static implicit operator bool(OptionalRef opt) => opt.exists; + + /*public delegate ref TR Mapper(ref T component) where TR : unmanaged; + public unsafe delegate TR* PMapper(T* component) where TR : unmanaged; + + public unsafe OptionalRef Map(PMapper mapper) where TR : unmanaged => + exists ? new OptionalRef(ref *mapper(pointer)) : new OptionalRef();*/ + + /// + /// Creates an instance of a struct T that can be referenced. + /// + /// The struct type to cache + private struct CompRefCache where T : unmanaged + { + public static T _default; + } + } +} \ No newline at end of file -- 2.30.2 From df6a2e84e156a3dd12c483ecdc5a22a26bd7e46e Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Fri, 30 Apr 2021 22:36:54 +0200 Subject: [PATCH 164/252] Update to Techblox 2021.04.29.18.37 --- GamecraftModdingAPI/Block.cs | 1 + GamecraftModdingAPI/Blocks/BlockEngine.cs | 6 +++--- GamecraftModdingAPI/Blocks/BlockEngineInit.cs | 1 + GamecraftModdingAPI/Blocks/CustomBlock.cs | 2 +- GamecraftModdingAPI/Blocks/MovementEngine.cs | 4 ++-- GamecraftModdingAPI/Blocks/RotationEngine.cs | 4 ++-- GamecraftModdingAPI/Blocks/SignalEngine.cs | 2 +- 7 files changed, 11 insertions(+), 9 deletions(-) diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index 99574ff..e4c50cd 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -80,6 +80,7 @@ namespace GamecraftModdingAPI var egid = initializer.EGID; var bl = New(egid.entityID, egid.groupID); bl.InitData.Group = BlockEngine.InitGroup(initializer); + bl.InitData.Reference = initializer.reference; Placed += bl.OnPlacedInit; return bl; } diff --git a/GamecraftModdingAPI/Blocks/BlockEngine.cs b/GamecraftModdingAPI/Blocks/BlockEngine.cs index 5eff5b2..e0291c0 100644 --- a/GamecraftModdingAPI/Blocks/BlockEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlockEngine.cs @@ -104,7 +104,7 @@ namespace GamecraftModdingAPI.Blocks private U GetBlockInitInfo(Block block, Func getter, U def) where T : struct, IEntityComponent { if (block.InitData.Group == null) return def; - var initializer = new EntityInitializer(block.Id, block.InitData.Group); + var initializer = new EntityInitializer(block.Id, block.InitData.Group, block.InitData.Reference); if (initializer.Has()) return getter(initializer.Get()); return def; @@ -133,7 +133,7 @@ namespace GamecraftModdingAPI.Blocks { if (block.InitData.Group != null) { - var initializer = new EntityInitializer(block.Id, block.InitData.Group); + var initializer = new EntityInitializer(block.Id, block.InitData.Group, block.InitData.Reference); T component = initializer.Has() ? initializer.Get() : default; ref T structRef = ref component; setter(ref structRef, value); @@ -161,7 +161,7 @@ namespace GamecraftModdingAPI.Blocks return true; if (block.InitData.Group == null) return false; - var init = new EntityInitializer(block.Id, block.InitData.Group); + var init = new EntityInitializer(block.Id, block.InitData.Group, block.InitData.Reference); return init.Has(); } diff --git a/GamecraftModdingAPI/Blocks/BlockEngineInit.cs b/GamecraftModdingAPI/Blocks/BlockEngineInit.cs index aaed6ef..ac7f3c4 100644 --- a/GamecraftModdingAPI/Blocks/BlockEngineInit.cs +++ b/GamecraftModdingAPI/Blocks/BlockEngineInit.cs @@ -15,6 +15,7 @@ namespace GamecraftModdingAPI.Blocks internal struct BlockInitData { public FasterDictionary Group; + public EntityReference Reference; } internal delegate FasterDictionary GetInitGroup( diff --git a/GamecraftModdingAPI/Blocks/CustomBlock.cs b/GamecraftModdingAPI/Blocks/CustomBlock.cs index c979234..7c82fe1 100644 --- a/GamecraftModdingAPI/Blocks/CustomBlock.cs +++ b/GamecraftModdingAPI/Blocks/CustomBlock.cs @@ -131,7 +131,7 @@ namespace GamecraftModdingAPI.Blocks CubeNameKey = attr.NameKey, CubeDescriptionKey = attr.DescKey, SelectableFaces = new[] {0, 1, 2, 3, 4, 5}, - GridScale = new[] {5, 5, 5}, + GridScale = new[] {5f, 5, 5}, DefaultMaterialID = 0, //TODO: Material API scalingPermission = attr.ScalingPermission, SortIndex = attr.SortIndex, diff --git a/GamecraftModdingAPI/Blocks/MovementEngine.cs b/GamecraftModdingAPI/Blocks/MovementEngine.cs index 6a9b05e..87a7259 100644 --- a/GamecraftModdingAPI/Blocks/MovementEngine.cs +++ b/GamecraftModdingAPI/Blocks/MovementEngine.cs @@ -40,7 +40,7 @@ namespace GamecraftModdingAPI.Blocks if (!entitiesDB.Exists(blockID)) { if (data.Group == null) return float3.zero; - var init = new EntityInitializer(blockID, data.Group); + var init = new EntityInitializer(blockID, data.Group, data.Reference); init.GetOrCreate().position = vector; init.GetOrCreate().position = vector; init.GetOrCreate().position = vector; @@ -70,7 +70,7 @@ namespace GamecraftModdingAPI.Blocks if (!entitiesDB.Exists(blockID)) { if (data.Group == null) return float3.zero; - var init = new EntityInitializer(blockID, data.Group); + var init = new EntityInitializer(blockID, data.Group, data.Reference); return init.Has() ? init.Get().position : float3.zero; } ref PositionEntityStruct posStruct = ref this.entitiesDB.QueryEntity(blockID); diff --git a/GamecraftModdingAPI/Blocks/RotationEngine.cs b/GamecraftModdingAPI/Blocks/RotationEngine.cs index 3322b92..2d8d1db 100644 --- a/GamecraftModdingAPI/Blocks/RotationEngine.cs +++ b/GamecraftModdingAPI/Blocks/RotationEngine.cs @@ -40,7 +40,7 @@ namespace GamecraftModdingAPI.Blocks if (!entitiesDB.Exists(blockID)) { if (data.Group == null) return float3.zero; - var init = new EntityInitializer(blockID, data.Group); + var init = new EntityInitializer(blockID, data.Group, data.Reference); init.GetOrCreate().rotation = Quaternion.Euler(vector); init.GetOrCreate().rotation = Quaternion.Euler(vector); init.GetOrCreate().rotation = Quaternion.Euler(vector); @@ -77,7 +77,7 @@ namespace GamecraftModdingAPI.Blocks if (!entitiesDB.Exists(blockID)) { if (data.Group == null) return float3.zero; - var init = new EntityInitializer(blockID, data.Group); + var init = new EntityInitializer(blockID, data.Group, data.Reference); return init.Has() ? (float3) ((Quaternion) init.Get().rotation).eulerAngles : float3.zero; diff --git a/GamecraftModdingAPI/Blocks/SignalEngine.cs b/GamecraftModdingAPI/Blocks/SignalEngine.cs index 22865df..8329a3b 100644 --- a/GamecraftModdingAPI/Blocks/SignalEngine.cs +++ b/GamecraftModdingAPI/Blocks/SignalEngine.cs @@ -399,7 +399,7 @@ namespace GamecraftModdingAPI.Blocks exists = false; return ref defRef[0]; } - EntityInitializer initializer = new EntityInitializer(block.Id, block.InitData.Group); + EntityInitializer initializer = new EntityInitializer(block.Id, block.InitData.Group, block.InitData.Reference); if (initializer.Has()) { exists = true; -- 2.30.2 From 807470e289c2b13d2e3169d907261acf40d52e06 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sat, 1 May 2021 00:38:27 +0200 Subject: [PATCH 165/252] Add new block types and improve listing them Now it prints them ordered and mostly suitable to be used in code (it only needs a couple replaces) --- GamecraftModdingAPI/Blocks/BlockIDs.cs | 121 +++++++--------------- GamecraftModdingAPI/Blocks/CustomBlock.cs | 9 +- 2 files changed, 47 insertions(+), 83 deletions(-) diff --git a/GamecraftModdingAPI/Blocks/BlockIDs.cs b/GamecraftModdingAPI/Blocks/BlockIDs.cs index 07e4192..5c44f11 100644 --- a/GamecraftModdingAPI/Blocks/BlockIDs.cs +++ b/GamecraftModdingAPI/Blocks/BlockIDs.cs @@ -19,8 +19,8 @@ namespace GamecraftModdingAPI.Blocks NegativeQuarterPyramid, NegativeTetrahedron, RoundedNegativeQuarterPyramid, - RoundedNegativeTetrahedron, //10 - PlateCube, + RoundedNegativeTetrahedron, + Plate, PlateWedge, PlateQuarterPyramid, PlateTetrahedron, @@ -29,7 +29,7 @@ namespace GamecraftModdingAPI.Blocks FrameS1, FrameS2, FrameS3, - FrameS4, //20 + FrameS4, FrameS5, FrameWedge, FrameWedgeS1, @@ -39,7 +39,7 @@ namespace GamecraftModdingAPI.Blocks SideS0S1, SideS0S2, SideS0S3, - SideS0S4, //30 + SideS0S4, SideS0S5, SideS1S1, SideS1S2, @@ -51,7 +51,7 @@ namespace GamecraftModdingAPI.Blocks SideS2S3, SideS2S4, SideS2S5, - WindscreenS1, //42 + WindscreenS1, WindscreenS2, WindscreenS3, WindscreenS4, @@ -59,94 +59,53 @@ namespace GamecraftModdingAPI.Blocks CarWheelArch, CarArchSmallFlare, CarArchFlare, - CarArchExtrudedFlare, //50 - Cube1X1, - Cube1X2, - Cube1X3, - Cube1X4, - Cube1X6, - Cube2X2, - Cube2X3, - Cube2X4, - Cube2X6, - Wedge1X1, //60 - Wedge1X2, - Wedge1X3, - Wedge2X1, - Wedge2X2, - Wedge2X3, - RoundedWedge1X1, - RoundedWedge1X2, - RoundedWedge1X3, - RoundedWedge2X1, - RoundedWedge2X2, //70 - RoundedWedge2X3, - Plate1X1, - Plate1X2, - Plate1X3, - Plate1X4, - Plate2X2, - Plate2X3, - Plate2X4, - Plate3X3, - Plate3X4, //80 - Cube1X1S1, - Cube1X2S1, - Cube1X3S1, - Wedge1X1S1, - Wedge1X2S1, - Wedge1X3S1, - Wedge2X1S1, - Wedge2X2S1, - Wedge2X3S1, - Wedge3X1S1, //90 - Wedge3X2S1, - Wedge3X3S1, - NegativeTetrahedron1X1S1, - NegativeTetrahedron1X2S1, - NegativeTetrahedron1X3S1, - NegativeTetrahedron2X1S1, - NegativeTetrahedron2X2S1, - NegativeTetrahedron2X3S1, - NegativeTetrahedron3X1S1, - Axle, //100 + CarArchExtrudedFlare, + Axle = 100, Hinge, BallJoint, UniversalJoint, TelescopicJoint, - HingeSpring, - AxleSpring, + DampedHingeSpring, + DampedAxleSpring, DampedSpring, WheelRigNoSteering, WheelRigWithSteering, - NegativeTetrahedron3X2S1, //110 - NegativeTetrahedron3X3S1, - Tetrahedron1X1S1, - Tetrahedron1X2S1, - Tetrahedron1X3S1, - Tetrahedron2X1S1, - Tetrahedron2X2S1, - Tetrahedron2X3S1, - Tetrahedron3X1S1, - Tetrahedron3X2S1, - Tetrahedron3X3S1, //120 - QuarterPyramid1X1S1, - QuarterPyramid1X2S1, - QuarterPyramid1X3S1, - QuarterPyramid2X1S1, - QuarterPyramid2X2S1, - QuarterPyramid2X3S1, - QuarterPyramid3X1S1, - QuarterPyramid3X2S1, - QuarterPyramid3X3S1, - PlateTriangle, //130 + PlateTriangle = 130, PlateCircle, - PlateQtrCircle, + PlateQuarterCircle, PlateRWedge, PlateRTetrahedron, - DriverSeat = 150, + Cone, + ConeSegment, + DoubleSliced, + HalfDoubleSliced, + EighthPyramid, + Hemisphere, + WideCylinder, + WideCylinderBend, + WideCylinderT, + WideCylinderCross, + WideCylinderCorner, + NarrowCylinder, + NarrowCylinderBend, + NarrowCylinderT, + NarrowCylinderCross, + DriverSeat, PassengerSeat, Engine, + NarrowCylinderCorner, + PlateWideCylinder, + PlateNarrowCylinder, + PlateNegativeTetrahedron, + PlateNegativeQuarterPyramid, + PlateRoundedNegativeTetrahedron, + PlateRoundedNegativeQuarterPyramid, + HeadlampSquare, + HeadlampCircle, + HeadlampWedge, + WideCylinderDiagonal, + NarrowCylinderDiagonal, + HeadlampTetrahedron, CarWheelWideProfile = 200, CarWheel, } diff --git a/GamecraftModdingAPI/Blocks/CustomBlock.cs b/GamecraftModdingAPI/Blocks/CustomBlock.cs index 7c82fe1..3567afd 100644 --- a/GamecraftModdingAPI/Blocks/CustomBlock.cs +++ b/GamecraftModdingAPI/Blocks/CustomBlock.cs @@ -2,6 +2,7 @@ using System.Collections; using System.Collections.Generic; using System.IO; +using System.Linq; using System.Reflection; using HarmonyLib; @@ -148,10 +149,14 @@ namespace GamecraftModdingAPI.Blocks foreach (var (id, action) in BlockChangeActions) action(dataDB.GetValue(id)); - /*foreach (var (key, value) in dataDB.GetValues()) + /*ushort lastKey = ushort.MaxValue; + foreach (var (key, value) in dataDB.GetValues() + .OrderBy(kv=>ushort.Parse(kv.Key))) { var data = (CubeListData) value; - Console.WriteLine($"ID: {key} - Name: {data.CubeNameKey}: {LocalizationService.Localize(data.CubeNameKey)}"); + ushort currentKey = ushort.Parse(key); + Console.WriteLine($"{LocalizationService.Localize(data.CubeNameKey)}{(currentKey != lastKey + 1 ? $" = {key}" : "")},"); + lastKey = currentKey; }*/ _canRegister = false; -- 2.30.2 From a6f52070eef5d74e9e183268151b3b6a0e4706c5 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sun, 2 May 2021 01:08:25 +0200 Subject: [PATCH 166/252] Rename to TechbloxModdingAPI --- GamecraftModdingAPI.sln | 2 +- .../App/AppCallbacksTest.cs | 4 +- .../App/AppEngine.cs | 7 ++-- .../App/AppExceptions.cs | 2 +- .../App/Client.cs | 11 +++--- .../App/ClientAlertTest.cs | 4 +- .../App/CurrentGameMode.cs | 2 +- .../App/Game.cs | 16 ++++---- .../App/GameBuildSimEventEngine.cs | 7 ++-- .../App/GameGameEngine.cs | 9 ++--- .../App/GameMenuEngine.cs | 7 ++-- .../App/StateSyncRegPatch.cs | 2 +- .../App/UserPrompts.cs | 2 +- .../Block.cs | 9 ++--- .../BlockGroup.cs | 7 ++-- .../Blocks/BlockCloneEngine.cs | 4 +- .../Blocks/BlockColor.cs | 2 +- .../Blocks/BlockEngine.cs | 5 +-- .../Blocks/BlockEngineInit.cs | 2 +- .../Blocks/BlockEventsEngine.cs | 7 ++-- .../Blocks/BlockExceptions.cs | 4 +- .../Blocks/BlockIDs.cs | 2 +- .../Blocks/BlockIdentifiers.cs | 2 +- .../Blocks/BlockMaterial.cs | 2 +- .../Blocks/BlockTests.cs | 20 +++++----- .../Blocks/BlueprintEngine.cs | 6 +-- .../Blocks/CustomBlock.cs | 5 +-- .../Blocks/CustomBlockAttribute.cs | 2 +- .../Blocks/CustomBlockEngine.cs | 8 ++-- .../Blocks/DampedSpring.cs | 2 +- .../Blocks/LogicGate.cs | 2 +- .../Blocks/Motor.cs | 4 +- .../Blocks/MovementEngine.cs | 7 ++-- .../Blocks/MusicBlock.cs | 8 ++-- .../Blocks/ObjectIdentifier.cs | 2 +- .../Blocks/Piston.cs | 4 +- .../Blocks/PlacementEngine.cs | 9 ++--- .../Blocks/RemovalEngine.cs | 7 ++-- .../Blocks/RotationEngine.cs | 7 ++-- .../Blocks/ScalingEngine.cs | 7 ++-- .../Blocks/Servo.cs | 4 +- .../Blocks/SfxBlock.cs | 2 +- .../Blocks/SignalEngine.cs | 5 +-- .../Blocks/SignalingBlock.cs | 6 +-- .../Blocks/SpawnPoint.cs | 6 +-- .../Blocks/TextBlock.cs | 6 +-- .../Blocks/Timer.cs | 6 +-- .../Blocks/Wire.cs | 4 +- .../Blueprint.cs | 2 +- .../Cluster.cs | 2 +- .../Commands/CommandBuilder.cs | 5 +-- .../Commands/CommandEngineFactory.cs | 2 +- .../Commands/CommandExceptions.cs | 2 +- .../Commands/CommandManager.cs | 5 +-- .../Commands/CommandPatch.cs | 2 +- .../Commands/CommandRegistrationHelper.cs | 2 +- .../Commands/ExistingCommands.cs | 2 +- .../Commands/ICustomCommandEngine.cs | 6 +-- .../Commands/SimpleCustomCommandEngine.cs | 9 ++--- .../Commands/SimpleCustomCommandEngine1.cs | 9 ++--- .../Commands/SimpleCustomCommandEngine2.cs | 9 ++--- .../Commands/SimpleCustomCommandEngine3.cs | 9 ++--- .../Engines/IApiEngine.cs | 4 +- .../Engines/IFactoryEngine.cs | 4 +- .../Engines/IReactionaryEngine.cs | 4 +- ...terministicStepComposeEngineGroupsPatch.cs | 4 +- .../Events/EmitterBuilder.cs | 2 +- .../Events/EventEngineFactory.cs | 2 +- .../Events/EventExceptions.cs | 2 +- .../Events/EventManager.cs | 7 ++-- .../Events/EventType.cs | 2 +- .../Events/GameActivatedComposePatch.cs | 5 +-- .../Events/GameReloadedPatch.cs | 4 +- .../Events/GameStateBuildEmitterEngine.cs | 5 +-- .../GameStateSimulationEmitterEngine.cs | 5 +-- .../Events/GameSwitchedToPatch.cs | 4 +- .../Events/HandlerBuilder.cs | 2 +- .../Events/IEventEmitterEngine.cs | 5 +-- .../Events/IEventHandlerEngine.cs | 5 +-- .../Events/MenuActivatedPatch.cs | 5 +-- .../Events/MenuSwitchedToPatch.cs | 5 +-- .../Events/ModEventEntityDescriptor.cs | 2 +- .../Events/ModEventEntityStruct.cs | 2 +- .../Events/SimpleEventEmitterEngine.cs | 4 +- .../Events/SimpleEventHandlerEngine.cs | 5 +-- .../FlyCam.cs | 7 ++-- .../GamecraftModdingAPIException.cs | 2 +- .../Input/FakeInput.cs | 5 +-- .../Input/FakeInputEngine.cs | 6 +-- .../Interface/IMGUI/Button.cs | 2 +- .../Interface/IMGUI/Constants.cs | 4 +- .../Interface/IMGUI/Group.cs | 6 +-- .../Interface/IMGUI/IMGUIManager.cs | 6 +-- .../Interface/IMGUI/Image.cs | 6 +-- .../Interface/IMGUI/Label.cs | 6 +-- .../Interface/IMGUI/Text.cs | 2 +- .../Interface/IMGUI/UIElement.cs | 2 +- .../Inventory/Hotbar.cs | 7 ++-- .../Inventory/HotbarEngine.cs | 8 ++-- .../HotbarSlotSelectionHandlerEnginePatch.cs | 4 +- .../Main.cs | 28 ++++++------- .../DeserializeFromDiskEntitiesEnginePatch.cs | 4 +- .../Persistence/IEntitySerializer.cs | 4 +- .../SaveAndLoadCompositionRootPatch.cs | 2 +- .../Persistence/SaveGameEnginePatch.cs | 7 ++-- .../Persistence/SerializerManager.cs | 5 +-- .../Persistence/SimpleEntitySerializer.cs | 2 +- .../Player.cs | 13 +++---- .../Players/FlyCamEngine.cs | 4 +- .../Players/PlayerBuildingMode.cs | 2 +- .../Players/PlayerEngine.cs | 5 +-- .../Players/PlayerExceptions.cs | 2 +- .../Players/PlayerTests.cs | 6 +-- .../Players/PlayerType.cs | 2 +- .../SimBody.cs | 2 +- .../Tasks/ISchedulable.cs | 2 +- .../Tasks/Once.cs | 2 +- .../Tasks/Repeatable.cs | 2 +- .../Tasks/Scheduler.cs | 2 +- .../TechbloxModdingAPI.csproj | 1 + .../Tests/APITestAttributes.cs | 2 +- .../Tests/Assert.cs | 2 +- .../Tests/GamecraftModdingAPIPluginTest.cs | 39 +++++++++---------- .../Tests/TestRoot.cs | 13 +++---- .../Tests/TestTest.cs | 2 +- .../Utility/ApiExclusiveGroups.cs | 8 ++-- .../Utility/AsyncUtils.cs | 2 +- .../Utility/AsyncUtilsEngine.cs | 5 +-- .../Utility/Audio.cs | 2 +- .../Utility/AudioTools.cs | 2 +- .../Utility/DebugInterfaceEngine.cs | 8 ++-- .../Utility/Dependency.cs | 2 +- .../Utility/ExceptionUtil.cs | 4 +- .../Utility/FullGameFields.cs | 2 +- .../Utility/GameClient.cs | 4 +- .../Utility/GameEngineManager.cs | 5 +-- .../Utility/GameState.cs | 2 +- .../Utility/GameStateEngine.cs | 5 +-- .../Utility/Logging.cs | 2 +- .../Utility/MenuEngineManager.cs | 5 +-- .../Utility/OptionalRef.cs | 4 +- .../Utility/VersionTracking.cs | 7 ++-- 142 files changed, 334 insertions(+), 378 deletions(-) rename {GamecraftModdingAPI => TechbloxModdingAPI}/App/AppCallbacksTest.cs (93%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/App/AppEngine.cs (92%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/App/AppExceptions.cs (95%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/App/Client.cs (94%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/App/ClientAlertTest.cs (95%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/App/CurrentGameMode.cs (91%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/App/Game.cs (96%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/App/GameBuildSimEventEngine.cs (91%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/App/GameGameEngine.cs (96%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/App/GameMenuEngine.cs (97%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/App/StateSyncRegPatch.cs (93%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/App/UserPrompts.cs (96%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Block.cs (99%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/BlockGroup.cs (98%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Blocks/BlockCloneEngine.cs (98%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Blocks/BlockColor.cs (97%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Blocks/BlockEngine.cs (99%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Blocks/BlockEngineInit.cs (98%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Blocks/BlockEventsEngine.cs (92%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Blocks/BlockExceptions.cs (93%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Blocks/BlockIDs.cs (98%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Blocks/BlockIdentifiers.cs (97%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Blocks/BlockMaterial.cs (82%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Blocks/BlockTests.cs (97%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Blocks/BlueprintEngine.cs (99%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Blocks/CustomBlock.cs (99%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Blocks/CustomBlockAttribute.cs (98%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Blocks/CustomBlockEngine.cs (94%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Blocks/DampedSpring.cs (97%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Blocks/LogicGate.cs (88%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Blocks/Motor.cs (95%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Blocks/MovementEngine.cs (96%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Blocks/MusicBlock.cs (97%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Blocks/ObjectIdentifier.cs (97%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Blocks/Piston.cs (94%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Blocks/PlacementEngine.cs (96%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Blocks/RemovalEngine.cs (94%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Blocks/RotationEngine.cs (97%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Blocks/ScalingEngine.cs (93%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Blocks/Servo.cs (96%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Blocks/SfxBlock.cs (99%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Blocks/SignalEngine.cs (99%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Blocks/SignalingBlock.cs (98%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Blocks/SpawnPoint.cs (95%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Blocks/TextBlock.cs (93%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Blocks/Timer.cs (95%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Blocks/Wire.cs (99%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Blueprint.cs (99%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Cluster.cs (98%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Commands/CommandBuilder.cs (99%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Commands/CommandEngineFactory.cs (88%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Commands/CommandExceptions.cs (97%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Commands/CommandManager.cs (96%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Commands/CommandPatch.cs (99%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Commands/CommandRegistrationHelper.cs (98%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Commands/ExistingCommands.cs (96%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Commands/ICustomCommandEngine.cs (85%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Commands/SimpleCustomCommandEngine.cs (87%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Commands/SimpleCustomCommandEngine1.cs (86%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Commands/SimpleCustomCommandEngine2.cs (86%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Commands/SimpleCustomCommandEngine3.cs (86%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Engines/IApiEngine.cs (83%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Engines/IFactoryEngine.cs (88%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Engines/IReactionaryEngine.cs (86%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Events/DeterministicStepComposeEngineGroupsPatch.cs (95%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Events/EmitterBuilder.cs (98%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Events/EventEngineFactory.cs (98%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Events/EventExceptions.cs (96%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Events/EventManager.cs (96%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Events/EventType.cs (92%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Events/GameActivatedComposePatch.cs (96%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Events/GameReloadedPatch.cs (87%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Events/GameStateBuildEmitterEngine.cs (95%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Events/GameStateSimulationEmitterEngine.cs (95%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Events/GameSwitchedToPatch.cs (90%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Events/HandlerBuilder.cs (99%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Events/IEventEmitterEngine.cs (86%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Events/IEventHandlerEngine.cs (84%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Events/MenuActivatedPatch.cs (95%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Events/MenuSwitchedToPatch.cs (90%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Events/ModEventEntityDescriptor.cs (90%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Events/ModEventEntityStruct.cs (92%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Events/SimpleEventEmitterEngine.cs (96%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Events/SimpleEventHandlerEngine.cs (98%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/FlyCam.cs (97%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/GamecraftModdingAPIException.cs (94%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Input/FakeInput.cs (99%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Input/FakeInputEngine.cs (96%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Interface/IMGUI/Button.cs (98%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Interface/IMGUI/Constants.cs (98%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Interface/IMGUI/Group.cs (96%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Interface/IMGUI/IMGUIManager.cs (97%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Interface/IMGUI/Image.cs (89%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Interface/IMGUI/Label.cs (88%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Interface/IMGUI/Text.cs (98%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Interface/IMGUI/UIElement.cs (94%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Inventory/Hotbar.cs (92%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Inventory/HotbarEngine.cs (88%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Inventory/HotbarSlotSelectionHandlerEnginePatch.cs (90%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Main.cs (87%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Persistence/DeserializeFromDiskEntitiesEnginePatch.cs (97%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Persistence/IEntitySerializer.cs (94%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Persistence/SaveAndLoadCompositionRootPatch.cs (90%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Persistence/SaveGameEnginePatch.cs (94%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Persistence/SerializerManager.cs (96%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Persistence/SimpleEntitySerializer.cs (98%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Player.cs (97%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Players/FlyCamEngine.cs (90%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Players/PlayerBuildingMode.cs (75%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Players/PlayerEngine.cs (99%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Players/PlayerExceptions.cs (92%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Players/PlayerTests.cs (94%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Players/PlayerType.cs (70%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/SimBody.cs (99%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Tasks/ISchedulable.cs (92%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Tasks/Once.cs (96%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Tasks/Repeatable.cs (98%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Tasks/Scheduler.cs (98%) rename GamecraftModdingAPI/GamecraftModdingAPI.csproj => TechbloxModdingAPI/TechbloxModdingAPI.csproj (99%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Tests/APITestAttributes.cs (97%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Tests/Assert.cs (99%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Tests/GamecraftModdingAPIPluginTest.cs (94%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Tests/TestRoot.cs (96%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Tests/TestTest.cs (96%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Utility/ApiExclusiveGroups.cs (74%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Utility/AsyncUtils.cs (95%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Utility/AsyncUtilsEngine.cs (96%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Utility/Audio.cs (97%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Utility/AudioTools.cs (98%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Utility/DebugInterfaceEngine.cs (94%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Utility/Dependency.cs (98%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Utility/ExceptionUtil.cs (92%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Utility/FullGameFields.cs (98%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Utility/GameClient.cs (93%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Utility/GameEngineManager.cs (96%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Utility/GameState.cs (97%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Utility/GameStateEngine.cs (92%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Utility/Logging.cs (99%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Utility/MenuEngineManager.cs (96%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Utility/OptionalRef.cs (96%) rename {GamecraftModdingAPI => TechbloxModdingAPI}/Utility/VersionTracking.cs (96%) diff --git a/GamecraftModdingAPI.sln b/GamecraftModdingAPI.sln index 6482776..2191746 100644 --- a/GamecraftModdingAPI.sln +++ b/GamecraftModdingAPI.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.29411.108 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GamecraftModdingAPI", "GamecraftModdingAPI\GamecraftModdingAPI.csproj", "{7FD5A7D8-4F3E-426A-B07D-7DC70442A4DF}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TechbloxModdingAPI", "TechbloxModdingAPI\TechbloxModdingAPI.csproj", "{7FD5A7D8-4F3E-426A-B07D-7DC70442A4DF}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/GamecraftModdingAPI/App/AppCallbacksTest.cs b/TechbloxModdingAPI/App/AppCallbacksTest.cs similarity index 93% rename from GamecraftModdingAPI/App/AppCallbacksTest.cs rename to TechbloxModdingAPI/App/AppCallbacksTest.cs index 041ac50..c1e184b 100644 --- a/GamecraftModdingAPI/App/AppCallbacksTest.cs +++ b/TechbloxModdingAPI/App/AppCallbacksTest.cs @@ -1,8 +1,8 @@ using System; -using GamecraftModdingAPI.Tests; +using TechbloxModdingAPI.Tests; -namespace GamecraftModdingAPI.App +namespace TechbloxModdingAPI.App { #if TEST /// diff --git a/GamecraftModdingAPI/App/AppEngine.cs b/TechbloxModdingAPI/App/AppEngine.cs similarity index 92% rename from GamecraftModdingAPI/App/AppEngine.cs rename to TechbloxModdingAPI/App/AppEngine.cs index 9cc454d..d14f932 100644 --- a/GamecraftModdingAPI/App/AppEngine.cs +++ b/TechbloxModdingAPI/App/AppEngine.cs @@ -3,11 +3,10 @@ using RobocraftX.GUI.MyGamesScreen; using RobocraftX.GUI; using Svelto.ECS; +using TechbloxModdingAPI.Engines; +using TechbloxModdingAPI.Utility; -using GamecraftModdingAPI.Engines; -using GamecraftModdingAPI.Utility; - -namespace GamecraftModdingAPI.App +namespace TechbloxModdingAPI.App { public class AppEngine : IFactoryEngine { diff --git a/GamecraftModdingAPI/App/AppExceptions.cs b/TechbloxModdingAPI/App/AppExceptions.cs similarity index 95% rename from GamecraftModdingAPI/App/AppExceptions.cs rename to TechbloxModdingAPI/App/AppExceptions.cs index 2e67695..b3393cb 100644 --- a/GamecraftModdingAPI/App/AppExceptions.cs +++ b/TechbloxModdingAPI/App/AppExceptions.cs @@ -1,7 +1,7 @@ using System; using System.Runtime.Serialization; -namespace GamecraftModdingAPI.App +namespace TechbloxModdingAPI.App { public class AppException : GamecraftModdingAPIException { diff --git a/GamecraftModdingAPI/App/Client.cs b/TechbloxModdingAPI/App/Client.cs similarity index 94% rename from GamecraftModdingAPI/App/Client.cs rename to TechbloxModdingAPI/App/Client.cs index ca5dcfa..4887448 100644 --- a/GamecraftModdingAPI/App/Client.cs +++ b/TechbloxModdingAPI/App/Client.cs @@ -4,11 +4,10 @@ using HarmonyLib; using RobocraftX.Services; using UnityEngine; - -using GamecraftModdingAPI.Utility; using RobocraftX.Common; +using TechbloxModdingAPI.Utility; -namespace GamecraftModdingAPI.App +namespace TechbloxModdingAPI.App { /// /// The Gamecraft application that is running this code right now. @@ -111,13 +110,13 @@ namespace GamecraftModdingAPI.App // this would have been so much simpler if this didn't involve a bunch of internal fields & classes Type errorHandler = AccessTools.TypeByName("RobocraftX.Services.ErrorHandler"); Type errorHandle = AccessTools.TypeByName("RobocraftX.Services.ErrorHandle"); - ErrorHandlerInstanceGetter = (Func) AccessTools.Method("GamecraftModdingAPI.App.Client:GenInstanceGetter") + ErrorHandlerInstanceGetter = (Func) AccessTools.Method("TechbloxModdingAPI.App.Client:GenInstanceGetter") .MakeGenericMethod(errorHandler) .Invoke(null, new object[0]); - EnqueueError = (Action) AccessTools.Method("GamecraftModdingAPI.App.Client:GenEnqueueError") + EnqueueError = (Action) AccessTools.Method("TechbloxModdingAPI.App.Client:GenEnqueueError") .MakeGenericMethod(errorHandler, errorHandle) .Invoke(null, new object[0]); - /*HandleErrorClosed = (Action) AccessTools.Method("GamecraftModdingAPI.App.Client:GenHandlePopupClosed") + /*HandleErrorClosed = (Action) AccessTools.Method("TechbloxModdingAPI.App.Client:GenHandlePopupClosed") .MakeGenericMethod(errorHandler) .Invoke(null, new object[0]);*/ // register engines diff --git a/GamecraftModdingAPI/App/ClientAlertTest.cs b/TechbloxModdingAPI/App/ClientAlertTest.cs similarity index 95% rename from GamecraftModdingAPI/App/ClientAlertTest.cs rename to TechbloxModdingAPI/App/ClientAlertTest.cs index 23ced76..20d8201 100644 --- a/GamecraftModdingAPI/App/ClientAlertTest.cs +++ b/TechbloxModdingAPI/App/ClientAlertTest.cs @@ -3,9 +3,9 @@ using HarmonyLib; using RobocraftX.Services; -using GamecraftModdingAPI.Tests; +using TechbloxModdingAPI.Tests; -namespace GamecraftModdingAPI.App +namespace TechbloxModdingAPI.App { #if TEST /// diff --git a/GamecraftModdingAPI/App/CurrentGameMode.cs b/TechbloxModdingAPI/App/CurrentGameMode.cs similarity index 91% rename from GamecraftModdingAPI/App/CurrentGameMode.cs rename to TechbloxModdingAPI/App/CurrentGameMode.cs index 84a6d78..85b3e09 100644 --- a/GamecraftModdingAPI/App/CurrentGameMode.cs +++ b/TechbloxModdingAPI/App/CurrentGameMode.cs @@ -1,4 +1,4 @@ -namespace GamecraftModdingAPI.App +namespace TechbloxModdingAPI.App { public enum CurrentGameMode { diff --git a/GamecraftModdingAPI/App/Game.cs b/TechbloxModdingAPI/App/Game.cs similarity index 96% rename from GamecraftModdingAPI/App/Game.cs rename to TechbloxModdingAPI/App/Game.cs index 3d73478..a3099eb 100644 --- a/GamecraftModdingAPI/App/Game.cs +++ b/TechbloxModdingAPI/App/Game.cs @@ -7,12 +7,12 @@ using RobocraftX.GUI.MyGamesScreen; using RobocraftX.StateSync; using Svelto.ECS; -using GamecraftModdingAPI; -using GamecraftModdingAPI.Blocks; -using GamecraftModdingAPI.Tasks; -using GamecraftModdingAPI.Utility; +using TechbloxModdingAPI; +using TechbloxModdingAPI.Blocks; +using TechbloxModdingAPI.Tasks; +using TechbloxModdingAPI.Utility; -namespace GamecraftModdingAPI.App +namespace TechbloxModdingAPI.App { /// /// An in-game save. @@ -33,7 +33,7 @@ namespace GamecraftModdingAPI.App private bool hasId = false; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// Menu identifier. public Game(uint id) : this(new EGID(id, MyGamesScreenExclusiveGroups.MyGames)) @@ -41,7 +41,7 @@ namespace GamecraftModdingAPI.App } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// Menu identifier. public Game(EGID id) @@ -54,7 +54,7 @@ namespace GamecraftModdingAPI.App } /// - /// Initializes a new instance of the class without id. + /// Initializes a new instance of the class without id. /// This is assumed to be the current game. /// public Game() diff --git a/GamecraftModdingAPI/App/GameBuildSimEventEngine.cs b/TechbloxModdingAPI/App/GameBuildSimEventEngine.cs similarity index 91% rename from GamecraftModdingAPI/App/GameBuildSimEventEngine.cs rename to TechbloxModdingAPI/App/GameBuildSimEventEngine.cs index 4c9a536..f4b5766 100644 --- a/GamecraftModdingAPI/App/GameBuildSimEventEngine.cs +++ b/TechbloxModdingAPI/App/GameBuildSimEventEngine.cs @@ -4,11 +4,10 @@ using RobocraftX.Common; using RobocraftX.StateSync; using Svelto.ECS; using Unity.Jobs; +using TechbloxModdingAPI.Engines; +using TechbloxModdingAPI.Utility; -using GamecraftModdingAPI.Engines; -using GamecraftModdingAPI.Utility; - -namespace GamecraftModdingAPI.App +namespace TechbloxModdingAPI.App { public class GameBuildSimEventEngine : IApiEngine, IUnorderedInitializeOnTimeRunningModeEntered, IUnorderedInitializeOnTimeStoppedModeEntered { diff --git a/GamecraftModdingAPI/App/GameGameEngine.cs b/TechbloxModdingAPI/App/GameGameEngine.cs similarity index 96% rename from GamecraftModdingAPI/App/GameGameEngine.cs rename to TechbloxModdingAPI/App/GameGameEngine.cs index da270cc..d5a2f60 100644 --- a/GamecraftModdingAPI/App/GameGameEngine.cs +++ b/TechbloxModdingAPI/App/GameGameEngine.cs @@ -9,13 +9,12 @@ using RobocraftX.SimulationModeState; using Svelto.ECS; using Svelto.Tasks; using Svelto.Tasks.Lean; - -using GamecraftModdingAPI.Blocks; -using GamecraftModdingAPI.Engines; -using GamecraftModdingAPI.Utility; using RobocraftX.Blocks; +using TechbloxModdingAPI.Blocks; +using TechbloxModdingAPI.Engines; +using TechbloxModdingAPI.Utility; -namespace GamecraftModdingAPI.App +namespace TechbloxModdingAPI.App { public class GameGameEngine : IApiEngine { diff --git a/GamecraftModdingAPI/App/GameMenuEngine.cs b/TechbloxModdingAPI/App/GameMenuEngine.cs similarity index 97% rename from GamecraftModdingAPI/App/GameMenuEngine.cs rename to TechbloxModdingAPI/App/GameMenuEngine.cs index 67b159b..9fce3b7 100644 --- a/GamecraftModdingAPI/App/GameMenuEngine.cs +++ b/TechbloxModdingAPI/App/GameMenuEngine.cs @@ -7,12 +7,11 @@ using RobocraftX.GUI; using RobocraftX.GUI.MyGamesScreen; using Svelto.ECS; using Svelto.ECS.Experimental; - -using GamecraftModdingAPI.Engines; -using GamecraftModdingAPI.Utility; using Svelto.DataStructures; +using TechbloxModdingAPI.Engines; +using TechbloxModdingAPI.Utility; -namespace GamecraftModdingAPI.App +namespace TechbloxModdingAPI.App { public class GameMenuEngine : IFactoryEngine { diff --git a/GamecraftModdingAPI/App/StateSyncRegPatch.cs b/TechbloxModdingAPI/App/StateSyncRegPatch.cs similarity index 93% rename from GamecraftModdingAPI/App/StateSyncRegPatch.cs rename to TechbloxModdingAPI/App/StateSyncRegPatch.cs index 9c2ce68..87842d2 100644 --- a/GamecraftModdingAPI/App/StateSyncRegPatch.cs +++ b/TechbloxModdingAPI/App/StateSyncRegPatch.cs @@ -6,7 +6,7 @@ using RobocraftX.StateSync; using HarmonyLib; -namespace GamecraftModdingAPI.App +namespace TechbloxModdingAPI.App { [HarmonyPatch] class StateSyncRegPatch diff --git a/GamecraftModdingAPI/App/UserPrompts.cs b/TechbloxModdingAPI/App/UserPrompts.cs similarity index 96% rename from GamecraftModdingAPI/App/UserPrompts.cs rename to TechbloxModdingAPI/App/UserPrompts.cs index 26a9395..7548055 100644 --- a/GamecraftModdingAPI/App/UserPrompts.cs +++ b/TechbloxModdingAPI/App/UserPrompts.cs @@ -3,7 +3,7 @@ using HarmonyLib; using RobocraftX.Services; -namespace GamecraftModdingAPI.App +namespace TechbloxModdingAPI.App { public class DualChoicePrompt : MultiChoiceError { diff --git a/GamecraftModdingAPI/Block.cs b/TechbloxModdingAPI/Block.cs similarity index 99% rename from GamecraftModdingAPI/Block.cs rename to TechbloxModdingAPI/Block.cs index e4c50cd..4729a91 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/TechbloxModdingAPI/Block.cs @@ -10,16 +10,15 @@ using RobocraftX.Common; using RobocraftX.Blocks; using Unity.Mathematics; using Gamecraft.Blocks.GUI; - -using GamecraftModdingAPI.Blocks; -using GamecraftModdingAPI.Utility; using RobocraftX.Rendering.GPUI; +using TechbloxModdingAPI.Blocks; +using TechbloxModdingAPI.Utility; -namespace GamecraftModdingAPI +namespace TechbloxModdingAPI { /// /// A single (perhaps scaled) block. Properties may return default values if the block is removed and then setting them is ignored. - /// For specific block type operations, use the specialised block classes in the GamecraftModdingAPI.Blocks namespace. + /// For specific block type operations, use the specialised block classes in the TechbloxModdingAPI.Blocks namespace. /// public class Block : IEquatable, IEquatable { diff --git a/GamecraftModdingAPI/BlockGroup.cs b/TechbloxModdingAPI/BlockGroup.cs similarity index 98% rename from GamecraftModdingAPI/BlockGroup.cs rename to TechbloxModdingAPI/BlockGroup.cs index c1add9a..5361445 100644 --- a/GamecraftModdingAPI/BlockGroup.cs +++ b/TechbloxModdingAPI/BlockGroup.cs @@ -5,11 +5,10 @@ using System.Collections.Generic; using Gamecraft.Blocks.BlockGroups; using Unity.Mathematics; using UnityEngine; +using TechbloxModdingAPI.Blocks; +using TechbloxModdingAPI.Utility; -using GamecraftModdingAPI.Blocks; -using GamecraftModdingAPI.Utility; - -namespace GamecraftModdingAPI +namespace TechbloxModdingAPI { /// /// A group of blocks that can be selected together. The placed version of blueprints. Dispose after usage. diff --git a/GamecraftModdingAPI/Blocks/BlockCloneEngine.cs b/TechbloxModdingAPI/Blocks/BlockCloneEngine.cs similarity index 98% rename from GamecraftModdingAPI/Blocks/BlockCloneEngine.cs rename to TechbloxModdingAPI/Blocks/BlockCloneEngine.cs index 1c9c91c..8703953 100644 --- a/GamecraftModdingAPI/Blocks/BlockCloneEngine.cs +++ b/TechbloxModdingAPI/Blocks/BlockCloneEngine.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.Reflection; using Gamecraft.Wires; -using GamecraftModdingAPI.Engines; using HarmonyLib; using RobocraftX.Blocks; using RobocraftX.Character; @@ -10,8 +9,9 @@ using RobocraftX.Common; using RobocraftX.Common.Players; using Svelto.DataStructures; using Svelto.ECS; +using TechbloxModdingAPI.Engines; -namespace GamecraftModdingAPI.Blocks +namespace TechbloxModdingAPI.Blocks { public class BlockCloneEngine : IApiEngine { diff --git a/GamecraftModdingAPI/Blocks/BlockColor.cs b/TechbloxModdingAPI/Blocks/BlockColor.cs similarity index 97% rename from GamecraftModdingAPI/Blocks/BlockColor.cs rename to TechbloxModdingAPI/Blocks/BlockColor.cs index bb5fa4a..33363a2 100644 --- a/GamecraftModdingAPI/Blocks/BlockColor.cs +++ b/TechbloxModdingAPI/Blocks/BlockColor.cs @@ -1,7 +1,7 @@ using System; using Unity.Mathematics; -namespace GamecraftModdingAPI.Blocks +namespace TechbloxModdingAPI.Blocks { public struct BlockColor { diff --git a/GamecraftModdingAPI/Blocks/BlockEngine.cs b/TechbloxModdingAPI/Blocks/BlockEngine.cs similarity index 99% rename from GamecraftModdingAPI/Blocks/BlockEngine.cs rename to TechbloxModdingAPI/Blocks/BlockEngine.cs index e0291c0..956871b 100644 --- a/GamecraftModdingAPI/Blocks/BlockEngine.cs +++ b/TechbloxModdingAPI/Blocks/BlockEngine.cs @@ -15,10 +15,9 @@ using Svelto.DataStructures; using Svelto.ECS; using Svelto.ECS.Hybrid; using Unity.Mathematics; +using TechbloxModdingAPI.Engines; -using GamecraftModdingAPI.Engines; - -namespace GamecraftModdingAPI.Blocks +namespace TechbloxModdingAPI.Blocks { /// /// Engine for executing general block actions diff --git a/GamecraftModdingAPI/Blocks/BlockEngineInit.cs b/TechbloxModdingAPI/Blocks/BlockEngineInit.cs similarity index 98% rename from GamecraftModdingAPI/Blocks/BlockEngineInit.cs rename to TechbloxModdingAPI/Blocks/BlockEngineInit.cs index ac7f3c4..b9b9eae 100644 --- a/GamecraftModdingAPI/Blocks/BlockEngineInit.cs +++ b/TechbloxModdingAPI/Blocks/BlockEngineInit.cs @@ -5,7 +5,7 @@ using Svelto.DataStructures; using Svelto.ECS; using Svelto.ECS.Internal; -namespace GamecraftModdingAPI.Blocks +namespace TechbloxModdingAPI.Blocks { public partial class BlockEngine { diff --git a/GamecraftModdingAPI/Blocks/BlockEventsEngine.cs b/TechbloxModdingAPI/Blocks/BlockEventsEngine.cs similarity index 92% rename from GamecraftModdingAPI/Blocks/BlockEventsEngine.cs rename to TechbloxModdingAPI/Blocks/BlockEventsEngine.cs index d1c2639..f89768b 100644 --- a/GamecraftModdingAPI/Blocks/BlockEventsEngine.cs +++ b/TechbloxModdingAPI/Blocks/BlockEventsEngine.cs @@ -2,12 +2,11 @@ using System; using RobocraftX.Common; using Svelto.ECS; - -using GamecraftModdingAPI.Engines; -using GamecraftModdingAPI.Utility; using RobocraftX.Blocks; +using TechbloxModdingAPI.Engines; +using TechbloxModdingAPI.Utility; -namespace GamecraftModdingAPI.Blocks +namespace TechbloxModdingAPI.Blocks { public class BlockEventsEngine : IReactionaryEngine { diff --git a/GamecraftModdingAPI/Blocks/BlockExceptions.cs b/TechbloxModdingAPI/Blocks/BlockExceptions.cs similarity index 93% rename from GamecraftModdingAPI/Blocks/BlockExceptions.cs rename to TechbloxModdingAPI/Blocks/BlockExceptions.cs index 9949424..409bb02 100644 --- a/GamecraftModdingAPI/Blocks/BlockExceptions.cs +++ b/TechbloxModdingAPI/Blocks/BlockExceptions.cs @@ -1,8 +1,8 @@ using System; -using GamecraftModdingAPI; +using TechbloxModdingAPI; -namespace GamecraftModdingAPI.Blocks +namespace TechbloxModdingAPI.Blocks { public class BlockException : GamecraftModdingAPIException { diff --git a/GamecraftModdingAPI/Blocks/BlockIDs.cs b/TechbloxModdingAPI/Blocks/BlockIDs.cs similarity index 98% rename from GamecraftModdingAPI/Blocks/BlockIDs.cs rename to TechbloxModdingAPI/Blocks/BlockIDs.cs index 5c44f11..30fa76f 100644 --- a/GamecraftModdingAPI/Blocks/BlockIDs.cs +++ b/TechbloxModdingAPI/Blocks/BlockIDs.cs @@ -1,4 +1,4 @@ -namespace GamecraftModdingAPI.Blocks +namespace TechbloxModdingAPI.Blocks { /// /// Possible block types diff --git a/GamecraftModdingAPI/Blocks/BlockIdentifiers.cs b/TechbloxModdingAPI/Blocks/BlockIdentifiers.cs similarity index 97% rename from GamecraftModdingAPI/Blocks/BlockIdentifiers.cs rename to TechbloxModdingAPI/Blocks/BlockIdentifiers.cs index bc426d5..10305dc 100644 --- a/GamecraftModdingAPI/Blocks/BlockIdentifiers.cs +++ b/TechbloxModdingAPI/Blocks/BlockIdentifiers.cs @@ -4,7 +4,7 @@ using RobocraftX.Common; using HarmonyLib; using Svelto.DataStructures; -namespace GamecraftModdingAPI.Blocks +namespace TechbloxModdingAPI.Blocks { /// /// ExclusiveGroups and IDs used with blocks diff --git a/GamecraftModdingAPI/Blocks/BlockMaterial.cs b/TechbloxModdingAPI/Blocks/BlockMaterial.cs similarity index 82% rename from GamecraftModdingAPI/Blocks/BlockMaterial.cs rename to TechbloxModdingAPI/Blocks/BlockMaterial.cs index 74d45bb..723bd63 100644 --- a/GamecraftModdingAPI/Blocks/BlockMaterial.cs +++ b/TechbloxModdingAPI/Blocks/BlockMaterial.cs @@ -1,4 +1,4 @@ -namespace GamecraftModdingAPI.Blocks +namespace TechbloxModdingAPI.Blocks { public enum BlockMaterial : byte { diff --git a/GamecraftModdingAPI/Blocks/BlockTests.cs b/TechbloxModdingAPI/Blocks/BlockTests.cs similarity index 97% rename from GamecraftModdingAPI/Blocks/BlockTests.cs rename to TechbloxModdingAPI/Blocks/BlockTests.cs index 7aac012..7a96c27 100644 --- a/GamecraftModdingAPI/Blocks/BlockTests.cs +++ b/TechbloxModdingAPI/Blocks/BlockTests.cs @@ -3,11 +3,11 @@ using Gamecraft.Wires; using Unity.Mathematics; -using GamecraftModdingAPI; -using GamecraftModdingAPI.Tests; -using GamecraftModdingAPI.Utility; +using TechbloxModdingAPI; +using TechbloxModdingAPI.Tests; +using TechbloxModdingAPI.Utility; -namespace GamecraftModdingAPI.Blocks +namespace TechbloxModdingAPI.Blocks { #if TEST /// @@ -31,7 +31,7 @@ namespace GamecraftModdingAPI.Blocks //Assert.Equal(newBlock.Exists, true, "Newly placed block does not exist, possibly because Sync() skipped/missed/failed.", "Newly placed block exists, Sync() successful."); } - [APITestCase(TestType.EditMode)] + /*[APITestCase(TestType.EditMode)] public static void TestTextBlock() { TextBlock textBlock = null; // Note: the assignment operation is a lambda, which slightly confuses the compiler @@ -74,7 +74,7 @@ namespace GamecraftModdingAPI.Blocks if (!Assert.CloseTo(b.MaximumAngle, 180f, $"Servo.MaximumAngle {b.MaximumAngle} does not equal default value, possibly because it failed silently.", "Servo.MaximumAngle is close enough to default.")) return; if (!Assert.CloseTo(b.MinimumAngle, -180f, $"Servo.MinimumAngle {b.MinimumAngle} does not equal default value, possibly because it failed silently.", "Servo.MinimumAngle is close enough to default.")) return; if (!Assert.CloseTo(b.MaximumForce, 60f, $"Servo.MaximumForce {b.MaximumForce} does not equal default value, possibly because it failed silently.", "Servo.MaximumForce is close enough to default.")) return; - } + }*/ [APITestCase(TestType.EditMode)] public static void TestDampedSpring() @@ -88,7 +88,7 @@ namespace GamecraftModdingAPI.Blocks if (!Assert.CloseTo(b.MaxExtension, 0.3f, $"DampedSpring.MaxExtension {b.MaxExtension} does not equal default value, possibly because it failed silently.", "DampedSpring.MaxExtension is close enough to default.")) return; } - [APITestCase(TestType.Game)] + /*[APITestCase(TestType.Game)] public static void TestMusicBlock1() { Block newBlock = Block.PlaceNew(BlockIDs.MusicBlock, Unity.Mathematics.float3.zero + 2); @@ -131,14 +131,14 @@ namespace GamecraftModdingAPI.Blocks Wire newWire = null; if (!Assert.Errorless(() => { newWire = b.Connect(0, target, 0);})) return; if (!Assert.NotNull(newWire, "SignalingBlock.Connect(...) returned null, possible because it failed silently.", "SignalingBlock.Connect(...) returned a non-null value.")) return; - } + }*/ - [APITestCase(TestType.EditMode)] + /*[APITestCase(TestType.EditMode)] public static void TestSpecialiseError() { Block newBlock = Block.PlaceNew(BlockIDs.Bench, new float3(1, 1, 1)); if (Assert.Errorful(() => newBlock.Specialise(), "Block.Specialise() was expected to error on a bench block.", "Block.Specialise() errored as expected for a bench block.")) return; - } + }*/ } #endif } diff --git a/GamecraftModdingAPI/Blocks/BlueprintEngine.cs b/TechbloxModdingAPI/Blocks/BlueprintEngine.cs similarity index 99% rename from GamecraftModdingAPI/Blocks/BlueprintEngine.cs rename to TechbloxModdingAPI/Blocks/BlueprintEngine.cs index ddfb051..19e0afc 100644 --- a/GamecraftModdingAPI/Blocks/BlueprintEngine.cs +++ b/TechbloxModdingAPI/Blocks/BlueprintEngine.cs @@ -3,8 +3,6 @@ using System.Collections.Generic; using System.Reflection; using Gamecraft.Blocks.BlockGroups; using Gamecraft.GUI.Blueprints; -using GamecraftModdingAPI.Engines; -using GamecraftModdingAPI.Utility; using HarmonyLib; using RobocraftX.Blocks; using RobocraftX.Common; @@ -15,12 +13,14 @@ using Svelto.ECS; using Svelto.ECS.DataStructures; using Svelto.ECS.EntityStructs; using Svelto.ECS.Serialization; +using TechbloxModdingAPI.Engines; +using TechbloxModdingAPI.Utility; using Unity.Collections; using Unity.Mathematics; using UnityEngine; using Allocator = Svelto.Common.Allocator; -namespace GamecraftModdingAPI.Blocks +namespace TechbloxModdingAPI.Blocks { public class BlueprintEngine : IFactoryEngine { diff --git a/GamecraftModdingAPI/Blocks/CustomBlock.cs b/TechbloxModdingAPI/Blocks/CustomBlock.cs similarity index 99% rename from GamecraftModdingAPI/Blocks/CustomBlock.cs rename to TechbloxModdingAPI/Blocks/CustomBlock.cs index 3567afd..4027c31 100644 --- a/GamecraftModdingAPI/Blocks/CustomBlock.cs +++ b/TechbloxModdingAPI/Blocks/CustomBlock.cs @@ -17,11 +17,10 @@ using Svelto.Tasks.ExtraLean; using UnityEngine; using UnityEngine.AddressableAssets; using Material = UnityEngine.Material; - -using GamecraftModdingAPI.Utility; using ServiceLayer; +using TechbloxModdingAPI.Utility; -namespace GamecraftModdingAPI.Blocks +namespace TechbloxModdingAPI.Blocks { /// /// Experimental support for adding custom blocks to the game. diff --git a/GamecraftModdingAPI/Blocks/CustomBlockAttribute.cs b/TechbloxModdingAPI/Blocks/CustomBlockAttribute.cs similarity index 98% rename from GamecraftModdingAPI/Blocks/CustomBlockAttribute.cs rename to TechbloxModdingAPI/Blocks/CustomBlockAttribute.cs index 7c7669f..b4a11f6 100644 --- a/GamecraftModdingAPI/Blocks/CustomBlockAttribute.cs +++ b/TechbloxModdingAPI/Blocks/CustomBlockAttribute.cs @@ -1,7 +1,7 @@ using System; using DataLoader; -namespace GamecraftModdingAPI.Blocks +namespace TechbloxModdingAPI.Blocks { [AttributeUsage(AttributeTargets.Class)] public class CustomBlockAttribute : Attribute diff --git a/GamecraftModdingAPI/Blocks/CustomBlockEngine.cs b/TechbloxModdingAPI/Blocks/CustomBlockEngine.cs similarity index 94% rename from GamecraftModdingAPI/Blocks/CustomBlockEngine.cs rename to TechbloxModdingAPI/Blocks/CustomBlockEngine.cs index bb1192b..ef3c1e5 100644 --- a/GamecraftModdingAPI/Blocks/CustomBlockEngine.cs +++ b/TechbloxModdingAPI/Blocks/CustomBlockEngine.cs @@ -1,14 +1,14 @@ using System; using System.Collections.Generic; -using GamecraftModdingAPI.Engines; -using GamecraftModdingAPI.Persistence; -using GamecraftModdingAPI.Utility; +using TechbloxModdingAPI.Engines; +using TechbloxModdingAPI.Persistence; +using TechbloxModdingAPI.Utility; using RobocraftX.Common; using Svelto.ECS; using Svelto.ECS.Experimental; using Svelto.ECS.Serialization; -namespace GamecraftModdingAPI.Blocks +namespace TechbloxModdingAPI.Blocks { /*public class CustomBlockEngine : IFactoryEngine { diff --git a/GamecraftModdingAPI/Blocks/DampedSpring.cs b/TechbloxModdingAPI/Blocks/DampedSpring.cs similarity index 97% rename from GamecraftModdingAPI/Blocks/DampedSpring.cs rename to TechbloxModdingAPI/Blocks/DampedSpring.cs index 20d28f2..34c7543 100644 --- a/GamecraftModdingAPI/Blocks/DampedSpring.cs +++ b/TechbloxModdingAPI/Blocks/DampedSpring.cs @@ -2,7 +2,7 @@ using RobocraftX.Blocks; using RobocraftX.Common; using Svelto.ECS; -namespace GamecraftModdingAPI.Blocks +namespace TechbloxModdingAPI.Blocks { public class DampedSpring : Block { diff --git a/GamecraftModdingAPI/Blocks/LogicGate.cs b/TechbloxModdingAPI/Blocks/LogicGate.cs similarity index 88% rename from GamecraftModdingAPI/Blocks/LogicGate.cs rename to TechbloxModdingAPI/Blocks/LogicGate.cs index 2ec4cef..50a819c 100644 --- a/GamecraftModdingAPI/Blocks/LogicGate.cs +++ b/TechbloxModdingAPI/Blocks/LogicGate.cs @@ -1,7 +1,7 @@ using RobocraftX.Common; using Svelto.ECS; -namespace GamecraftModdingAPI.Blocks +namespace TechbloxModdingAPI.Blocks { public class LogicGate : SignalingBlock { diff --git a/GamecraftModdingAPI/Blocks/Motor.cs b/TechbloxModdingAPI/Blocks/Motor.cs similarity index 95% rename from GamecraftModdingAPI/Blocks/Motor.cs rename to TechbloxModdingAPI/Blocks/Motor.cs index 0a69d27..6b1e500 100644 --- a/GamecraftModdingAPI/Blocks/Motor.cs +++ b/TechbloxModdingAPI/Blocks/Motor.cs @@ -5,9 +5,9 @@ using RobocraftX.Common; using Svelto.ECS; using Unity.Mathematics; -using GamecraftModdingAPI.Utility; +using TechbloxModdingAPI.Utility; -namespace GamecraftModdingAPI.Blocks +namespace TechbloxModdingAPI.Blocks { public class Motor : SignalingBlock { diff --git a/GamecraftModdingAPI/Blocks/MovementEngine.cs b/TechbloxModdingAPI/Blocks/MovementEngine.cs similarity index 96% rename from GamecraftModdingAPI/Blocks/MovementEngine.cs rename to TechbloxModdingAPI/Blocks/MovementEngine.cs index 87a7259..b01b714 100644 --- a/GamecraftModdingAPI/Blocks/MovementEngine.cs +++ b/TechbloxModdingAPI/Blocks/MovementEngine.cs @@ -4,11 +4,10 @@ using Svelto.ECS; using Svelto.ECS.EntityStructs; using Unity.Transforms; using Unity.Mathematics; +using TechbloxModdingAPI.Engines; +using TechbloxModdingAPI.Utility; -using GamecraftModdingAPI.Utility; -using GamecraftModdingAPI.Engines; - -namespace GamecraftModdingAPI.Blocks +namespace TechbloxModdingAPI.Blocks { /// /// Engine which executes block movement actions diff --git a/GamecraftModdingAPI/Blocks/MusicBlock.cs b/TechbloxModdingAPI/Blocks/MusicBlock.cs similarity index 97% rename from GamecraftModdingAPI/Blocks/MusicBlock.cs rename to TechbloxModdingAPI/Blocks/MusicBlock.cs index 6b99b6f..30ca5ab 100644 --- a/GamecraftModdingAPI/Blocks/MusicBlock.cs +++ b/TechbloxModdingAPI/Blocks/MusicBlock.cs @@ -8,11 +8,11 @@ using RobocraftX.Blocks; using Svelto.ECS; using Unity.Mathematics; -using GamecraftModdingAPI; -using GamecraftModdingAPI.Tests; -using GamecraftModdingAPI.Utility; +using TechbloxModdingAPI; +using TechbloxModdingAPI.Tests; +using TechbloxModdingAPI.Utility; -namespace GamecraftModdingAPI.Blocks +namespace TechbloxModdingAPI.Blocks { public class MusicBlock : SignalingBlock { diff --git a/GamecraftModdingAPI/Blocks/ObjectIdentifier.cs b/TechbloxModdingAPI/Blocks/ObjectIdentifier.cs similarity index 97% rename from GamecraftModdingAPI/Blocks/ObjectIdentifier.cs rename to TechbloxModdingAPI/Blocks/ObjectIdentifier.cs index 1233343..67e250e 100644 --- a/GamecraftModdingAPI/Blocks/ObjectIdentifier.cs +++ b/TechbloxModdingAPI/Blocks/ObjectIdentifier.cs @@ -2,7 +2,7 @@ using RobocraftX.Common; using Svelto.ECS; -namespace GamecraftModdingAPI.Blocks +namespace TechbloxModdingAPI.Blocks { public class ObjectIdentifier : Block { diff --git a/GamecraftModdingAPI/Blocks/Piston.cs b/TechbloxModdingAPI/Blocks/Piston.cs similarity index 94% rename from GamecraftModdingAPI/Blocks/Piston.cs rename to TechbloxModdingAPI/Blocks/Piston.cs index d05ac20..b5953ee 100644 --- a/GamecraftModdingAPI/Blocks/Piston.cs +++ b/TechbloxModdingAPI/Blocks/Piston.cs @@ -4,10 +4,10 @@ using RobocraftX.Blocks; using Svelto.ECS; using Unity.Mathematics; -using GamecraftModdingAPI.Utility; +using TechbloxModdingAPI.Utility; using RobocraftX.Common; -namespace GamecraftModdingAPI.Blocks +namespace TechbloxModdingAPI.Blocks { public class Piston : SignalingBlock { diff --git a/GamecraftModdingAPI/Blocks/PlacementEngine.cs b/TechbloxModdingAPI/Blocks/PlacementEngine.cs similarity index 96% rename from GamecraftModdingAPI/Blocks/PlacementEngine.cs rename to TechbloxModdingAPI/Blocks/PlacementEngine.cs index 1d01ae8..38e27f1 100644 --- a/GamecraftModdingAPI/Blocks/PlacementEngine.cs +++ b/TechbloxModdingAPI/Blocks/PlacementEngine.cs @@ -13,13 +13,12 @@ using Svelto.ECS; using Svelto.ECS.EntityStructs; using Unity.Mathematics; using UnityEngine; - -using GamecraftModdingAPI.Utility; -using GamecraftModdingAPI.Engines; -using GamecraftModdingAPI.Players; +using TechbloxModdingAPI.Players; using RobocraftX.Rendering.GPUI; +using TechbloxModdingAPI.Engines; +using TechbloxModdingAPI.Utility; -namespace GamecraftModdingAPI.Blocks +namespace TechbloxModdingAPI.Blocks { /// /// Engine which executes block placement actions diff --git a/GamecraftModdingAPI/Blocks/RemovalEngine.cs b/TechbloxModdingAPI/Blocks/RemovalEngine.cs similarity index 94% rename from GamecraftModdingAPI/Blocks/RemovalEngine.cs rename to TechbloxModdingAPI/Blocks/RemovalEngine.cs index c27c339..08216fc 100644 --- a/GamecraftModdingAPI/Blocks/RemovalEngine.cs +++ b/TechbloxModdingAPI/Blocks/RemovalEngine.cs @@ -4,11 +4,10 @@ using HarmonyLib; using RobocraftX.Blocks; using RobocraftX.Common; using Svelto.ECS; +using TechbloxModdingAPI.Engines; +using TechbloxModdingAPI.Utility; -using GamecraftModdingAPI.Utility; -using GamecraftModdingAPI.Engines; - -namespace GamecraftModdingAPI.Blocks +namespace TechbloxModdingAPI.Blocks { public class RemovalEngine : IApiEngine { diff --git a/GamecraftModdingAPI/Blocks/RotationEngine.cs b/TechbloxModdingAPI/Blocks/RotationEngine.cs similarity index 97% rename from GamecraftModdingAPI/Blocks/RotationEngine.cs rename to TechbloxModdingAPI/Blocks/RotationEngine.cs index 2d8d1db..1f35d17 100644 --- a/GamecraftModdingAPI/Blocks/RotationEngine.cs +++ b/TechbloxModdingAPI/Blocks/RotationEngine.cs @@ -4,11 +4,10 @@ using Svelto.ECS; using Svelto.ECS.EntityStructs; using Unity.Mathematics; using UnityEngine; +using TechbloxModdingAPI.Engines; +using TechbloxModdingAPI.Utility; -using GamecraftModdingAPI.Utility; -using GamecraftModdingAPI.Engines; - -namespace GamecraftModdingAPI.Blocks +namespace TechbloxModdingAPI.Blocks { /// /// Engine which executes block movement actions diff --git a/GamecraftModdingAPI/Blocks/ScalingEngine.cs b/TechbloxModdingAPI/Blocks/ScalingEngine.cs similarity index 93% rename from GamecraftModdingAPI/Blocks/ScalingEngine.cs rename to TechbloxModdingAPI/Blocks/ScalingEngine.cs index fcbf900..81131e6 100644 --- a/GamecraftModdingAPI/Blocks/ScalingEngine.cs +++ b/TechbloxModdingAPI/Blocks/ScalingEngine.cs @@ -5,11 +5,10 @@ using RobocraftX.Common; using RobocraftX.UECS; using Svelto.ECS; using Unity.Entities; +using TechbloxModdingAPI.Engines; +using TechbloxModdingAPI.Utility; -using GamecraftModdingAPI.Engines; -using GamecraftModdingAPI.Utility; - -namespace GamecraftModdingAPI.Blocks +namespace TechbloxModdingAPI.Blocks { public class ScalingEngine : IApiEngine { diff --git a/GamecraftModdingAPI/Blocks/Servo.cs b/TechbloxModdingAPI/Blocks/Servo.cs similarity index 96% rename from GamecraftModdingAPI/Blocks/Servo.cs rename to TechbloxModdingAPI/Blocks/Servo.cs index a5dceec..12232de 100644 --- a/GamecraftModdingAPI/Blocks/Servo.cs +++ b/TechbloxModdingAPI/Blocks/Servo.cs @@ -5,9 +5,9 @@ using RobocraftX.Common; using Svelto.ECS; using Unity.Mathematics; -using GamecraftModdingAPI.Utility; +using TechbloxModdingAPI.Utility; -namespace GamecraftModdingAPI.Blocks +namespace TechbloxModdingAPI.Blocks { public class Servo : SignalingBlock { diff --git a/GamecraftModdingAPI/Blocks/SfxBlock.cs b/TechbloxModdingAPI/Blocks/SfxBlock.cs similarity index 99% rename from GamecraftModdingAPI/Blocks/SfxBlock.cs rename to TechbloxModdingAPI/Blocks/SfxBlock.cs index 88d69d2..c72d37a 100644 --- a/GamecraftModdingAPI/Blocks/SfxBlock.cs +++ b/TechbloxModdingAPI/Blocks/SfxBlock.cs @@ -6,7 +6,7 @@ using RobocraftX.Blocks; using RobocraftX.Common; using Svelto.ECS; -namespace GamecraftModdingAPI.Blocks +namespace TechbloxModdingAPI.Blocks { public class SfxBlock : SignalingBlock { diff --git a/GamecraftModdingAPI/Blocks/SignalEngine.cs b/TechbloxModdingAPI/Blocks/SignalEngine.cs similarity index 99% rename from GamecraftModdingAPI/Blocks/SignalEngine.cs rename to TechbloxModdingAPI/Blocks/SignalEngine.cs index 8329a3b..3b1cf6a 100644 --- a/GamecraftModdingAPI/Blocks/SignalEngine.cs +++ b/TechbloxModdingAPI/Blocks/SignalEngine.cs @@ -2,10 +2,9 @@ using Svelto.ECS; using Svelto.DataStructures; using Gamecraft.Wires; +using TechbloxModdingAPI.Engines; -using GamecraftModdingAPI.Engines; - -namespace GamecraftModdingAPI.Blocks +namespace TechbloxModdingAPI.Blocks { /// /// Engine which executes signal actions diff --git a/GamecraftModdingAPI/Blocks/SignalingBlock.cs b/TechbloxModdingAPI/Blocks/SignalingBlock.cs similarity index 98% rename from GamecraftModdingAPI/Blocks/SignalingBlock.cs rename to TechbloxModdingAPI/Blocks/SignalingBlock.cs index a137b98..b18521a 100644 --- a/GamecraftModdingAPI/Blocks/SignalingBlock.cs +++ b/TechbloxModdingAPI/Blocks/SignalingBlock.cs @@ -4,10 +4,10 @@ using Gamecraft.Wires; using Svelto.ECS; using Unity.Mathematics; -using GamecraftModdingAPI; -using GamecraftModdingAPI.Utility; +using TechbloxModdingAPI; +using TechbloxModdingAPI.Utility; -namespace GamecraftModdingAPI.Blocks +namespace TechbloxModdingAPI.Blocks { /// /// Common implementation for blocks that support wiring. diff --git a/GamecraftModdingAPI/Blocks/SpawnPoint.cs b/TechbloxModdingAPI/Blocks/SpawnPoint.cs similarity index 95% rename from GamecraftModdingAPI/Blocks/SpawnPoint.cs rename to TechbloxModdingAPI/Blocks/SpawnPoint.cs index 17bffd9..ac6c014 100644 --- a/GamecraftModdingAPI/Blocks/SpawnPoint.cs +++ b/TechbloxModdingAPI/Blocks/SpawnPoint.cs @@ -6,10 +6,10 @@ using Gamecraft.CharacterVulnerability; using Svelto.ECS; using Unity.Mathematics; -using GamecraftModdingAPI; -using GamecraftModdingAPI.Utility; +using TechbloxModdingAPI; +using TechbloxModdingAPI.Utility; -namespace GamecraftModdingAPI.Blocks +namespace TechbloxModdingAPI.Blocks { public class SpawnPoint : Block { diff --git a/GamecraftModdingAPI/Blocks/TextBlock.cs b/TechbloxModdingAPI/Blocks/TextBlock.cs similarity index 93% rename from GamecraftModdingAPI/Blocks/TextBlock.cs rename to TechbloxModdingAPI/Blocks/TextBlock.cs index 3d46611..0e33b75 100644 --- a/GamecraftModdingAPI/Blocks/TextBlock.cs +++ b/TechbloxModdingAPI/Blocks/TextBlock.cs @@ -5,10 +5,10 @@ using RobocraftX.Common; using Svelto.ECS; using Unity.Mathematics; -using GamecraftModdingAPI; -using GamecraftModdingAPI.Utility; +using TechbloxModdingAPI; +using TechbloxModdingAPI.Utility; -namespace GamecraftModdingAPI.Blocks +namespace TechbloxModdingAPI.Blocks { public class TextBlock : SignalingBlock { diff --git a/GamecraftModdingAPI/Blocks/Timer.cs b/TechbloxModdingAPI/Blocks/Timer.cs similarity index 95% rename from GamecraftModdingAPI/Blocks/Timer.cs rename to TechbloxModdingAPI/Blocks/Timer.cs index 0bbd302..6337864 100644 --- a/GamecraftModdingAPI/Blocks/Timer.cs +++ b/TechbloxModdingAPI/Blocks/Timer.cs @@ -6,10 +6,10 @@ using Gamecraft.Blocks.TimerBlock; using Svelto.ECS; using Unity.Mathematics; -using GamecraftModdingAPI; -using GamecraftModdingAPI.Utility; +using TechbloxModdingAPI; +using TechbloxModdingAPI.Utility; -namespace GamecraftModdingAPI.Blocks +namespace TechbloxModdingAPI.Blocks { public class Timer : SignalingBlock { diff --git a/GamecraftModdingAPI/Blocks/Wire.cs b/TechbloxModdingAPI/Blocks/Wire.cs similarity index 99% rename from GamecraftModdingAPI/Blocks/Wire.cs rename to TechbloxModdingAPI/Blocks/Wire.cs index e58a625..289dee7 100644 --- a/GamecraftModdingAPI/Blocks/Wire.cs +++ b/TechbloxModdingAPI/Blocks/Wire.cs @@ -4,9 +4,9 @@ using Gamecraft.Wires; using Svelto.ECS; using Svelto.ECS.Experimental; -using GamecraftModdingAPI.Utility; +using TechbloxModdingAPI.Utility; -namespace GamecraftModdingAPI.Blocks +namespace TechbloxModdingAPI.Blocks { public class Wire { diff --git a/GamecraftModdingAPI/Blueprint.cs b/TechbloxModdingAPI/Blueprint.cs similarity index 99% rename from GamecraftModdingAPI/Blueprint.cs rename to TechbloxModdingAPI/Blueprint.cs index 4d9dff0..2724e5a 100644 --- a/GamecraftModdingAPI/Blueprint.cs +++ b/TechbloxModdingAPI/Blueprint.cs @@ -2,7 +2,7 @@ using Unity.Mathematics; using UnityEngine; -namespace GamecraftModdingAPI +namespace TechbloxModdingAPI { /// /// Represents a blueprint in the inventory. When placed it becomes a block group. diff --git a/GamecraftModdingAPI/Cluster.cs b/TechbloxModdingAPI/Cluster.cs similarity index 98% rename from GamecraftModdingAPI/Cluster.cs rename to TechbloxModdingAPI/Cluster.cs index 79b5822..11b995c 100644 --- a/GamecraftModdingAPI/Cluster.cs +++ b/TechbloxModdingAPI/Cluster.cs @@ -2,7 +2,7 @@ using RobocraftX.Common; using Svelto.ECS; -namespace GamecraftModdingAPI +namespace TechbloxModdingAPI { /// /// Represnts a cluster of blocks in time running mode, meaning blocks that are connected either directly or via joints. diff --git a/GamecraftModdingAPI/Commands/CommandBuilder.cs b/TechbloxModdingAPI/Commands/CommandBuilder.cs similarity index 99% rename from GamecraftModdingAPI/Commands/CommandBuilder.cs rename to TechbloxModdingAPI/Commands/CommandBuilder.cs index 7bd5ed9..1a34f45 100644 --- a/GamecraftModdingAPI/Commands/CommandBuilder.cs +++ b/TechbloxModdingAPI/Commands/CommandBuilder.cs @@ -1,10 +1,9 @@ using System; using Svelto.ECS; +using TechbloxModdingAPI.Utility; -using GamecraftModdingAPI.Utility; - -namespace GamecraftModdingAPI.Commands +namespace TechbloxModdingAPI.Commands { /// /// Custom Command builder. diff --git a/GamecraftModdingAPI/Commands/CommandEngineFactory.cs b/TechbloxModdingAPI/Commands/CommandEngineFactory.cs similarity index 88% rename from GamecraftModdingAPI/Commands/CommandEngineFactory.cs rename to TechbloxModdingAPI/Commands/CommandEngineFactory.cs index ddcdcb8..07e9a67 100644 --- a/GamecraftModdingAPI/Commands/CommandEngineFactory.cs +++ b/TechbloxModdingAPI/Commands/CommandEngineFactory.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace GamecraftModdingAPI.Commands +namespace TechbloxModdingAPI.Commands { /// /// UNIMPLEMENTED! diff --git a/GamecraftModdingAPI/Commands/CommandExceptions.cs b/TechbloxModdingAPI/Commands/CommandExceptions.cs similarity index 97% rename from GamecraftModdingAPI/Commands/CommandExceptions.cs rename to TechbloxModdingAPI/Commands/CommandExceptions.cs index 39502a7..4141a9f 100644 --- a/GamecraftModdingAPI/Commands/CommandExceptions.cs +++ b/TechbloxModdingAPI/Commands/CommandExceptions.cs @@ -1,5 +1,5 @@ using System; -namespace GamecraftModdingAPI.Commands +namespace TechbloxModdingAPI.Commands { public class CommandException : GamecraftModdingAPIException { diff --git a/GamecraftModdingAPI/Commands/CommandManager.cs b/TechbloxModdingAPI/Commands/CommandManager.cs similarity index 96% rename from GamecraftModdingAPI/Commands/CommandManager.cs rename to TechbloxModdingAPI/Commands/CommandManager.cs index 876d634..e275ace 100644 --- a/GamecraftModdingAPI/Commands/CommandManager.cs +++ b/TechbloxModdingAPI/Commands/CommandManager.cs @@ -5,10 +5,9 @@ using System.Text; using System.Threading.Tasks; using Svelto.ECS; +using TechbloxModdingAPI.Utility; -using GamecraftModdingAPI.Utility; - -namespace GamecraftModdingAPI.Commands +namespace TechbloxModdingAPI.Commands { /// /// Keeps track of custom commands diff --git a/GamecraftModdingAPI/Commands/CommandPatch.cs b/TechbloxModdingAPI/Commands/CommandPatch.cs similarity index 99% rename from GamecraftModdingAPI/Commands/CommandPatch.cs rename to TechbloxModdingAPI/Commands/CommandPatch.cs index bf9f186..d098948 100644 --- a/GamecraftModdingAPI/Commands/CommandPatch.cs +++ b/TechbloxModdingAPI/Commands/CommandPatch.cs @@ -8,7 +8,7 @@ using RobocraftX.CR.MainGame; using RobocraftX.Multiplayer; using RobocraftX.StateSync; -namespace GamecraftModdingAPI.Commands +namespace TechbloxModdingAPI.Commands { /// /// Patch of RobocraftX.CR.MainGame.MainGameCompositionRoot.DeterministicCompose() diff --git a/GamecraftModdingAPI/Commands/CommandRegistrationHelper.cs b/TechbloxModdingAPI/Commands/CommandRegistrationHelper.cs similarity index 98% rename from GamecraftModdingAPI/Commands/CommandRegistrationHelper.cs rename to TechbloxModdingAPI/Commands/CommandRegistrationHelper.cs index 5cb9069..633bf75 100644 --- a/GamecraftModdingAPI/Commands/CommandRegistrationHelper.cs +++ b/TechbloxModdingAPI/Commands/CommandRegistrationHelper.cs @@ -7,7 +7,7 @@ using System.Threading.Tasks; using uREPL; using RobocraftX.CommandLine.Custom; -namespace GamecraftModdingAPI.Commands +namespace TechbloxModdingAPI.Commands { /// /// Convenient methods for registering commands to Gamecraft. diff --git a/GamecraftModdingAPI/Commands/ExistingCommands.cs b/TechbloxModdingAPI/Commands/ExistingCommands.cs similarity index 96% rename from GamecraftModdingAPI/Commands/ExistingCommands.cs rename to TechbloxModdingAPI/Commands/ExistingCommands.cs index 60bd900..35dd199 100644 --- a/GamecraftModdingAPI/Commands/ExistingCommands.cs +++ b/TechbloxModdingAPI/Commands/ExistingCommands.cs @@ -2,7 +2,7 @@ using uREPL; -namespace GamecraftModdingAPI.Commands +namespace TechbloxModdingAPI.Commands { public static class ExistingCommands { diff --git a/GamecraftModdingAPI/Commands/ICustomCommandEngine.cs b/TechbloxModdingAPI/Commands/ICustomCommandEngine.cs similarity index 85% rename from GamecraftModdingAPI/Commands/ICustomCommandEngine.cs rename to TechbloxModdingAPI/Commands/ICustomCommandEngine.cs index 1704e84..afb0237 100644 --- a/GamecraftModdingAPI/Commands/ICustomCommandEngine.cs +++ b/TechbloxModdingAPI/Commands/ICustomCommandEngine.cs @@ -6,10 +6,10 @@ using System.Threading.Tasks; using Svelto.ECS; -using GamecraftModdingAPI.Utility; -using GamecraftModdingAPI.Engines; +using TechbloxModdingAPI.Utility; +using TechbloxModdingAPI.Engines; -namespace GamecraftModdingAPI.Commands +namespace TechbloxModdingAPI.Commands { /// /// Engine interface to handle command operations. diff --git a/GamecraftModdingAPI/Commands/SimpleCustomCommandEngine.cs b/TechbloxModdingAPI/Commands/SimpleCustomCommandEngine.cs similarity index 87% rename from GamecraftModdingAPI/Commands/SimpleCustomCommandEngine.cs rename to TechbloxModdingAPI/Commands/SimpleCustomCommandEngine.cs index 2ce60a9..87e0960 100644 --- a/GamecraftModdingAPI/Commands/SimpleCustomCommandEngine.cs +++ b/TechbloxModdingAPI/Commands/SimpleCustomCommandEngine.cs @@ -5,10 +5,9 @@ using System.Text; using System.Threading.Tasks; using Svelto.ECS; +using TechbloxModdingAPI.Utility; -using GamecraftModdingAPI.Utility; - -namespace GamecraftModdingAPI.Commands +namespace TechbloxModdingAPI.Commands { /// /// A simple implementation of ICustomCommandEngine sufficient for most commands. @@ -37,13 +36,13 @@ namespace GamecraftModdingAPI.Commands public void Dispose() { - GamecraftModdingAPI.Utility.Logging.MetaDebugLog($"Unregistering SimpleCustomCommandEngine {this.Name}"); + Logging.MetaDebugLog($"Unregistering SimpleCustomCommandEngine {this.Name}"); CommandRegistrationHelper.Unregister(this.Name); } public void Ready() { - GamecraftModdingAPI.Utility.Logging.MetaDebugLog($"Registering SimpleCustomCommandEngine {this.Name}"); + Logging.MetaDebugLog($"Registering SimpleCustomCommandEngine {this.Name}"); CommandRegistrationHelper.Register(this.Name, this.InvokeCatchError, this.Description); } diff --git a/GamecraftModdingAPI/Commands/SimpleCustomCommandEngine1.cs b/TechbloxModdingAPI/Commands/SimpleCustomCommandEngine1.cs similarity index 86% rename from GamecraftModdingAPI/Commands/SimpleCustomCommandEngine1.cs rename to TechbloxModdingAPI/Commands/SimpleCustomCommandEngine1.cs index bac16ef..ef3bb02 100644 --- a/GamecraftModdingAPI/Commands/SimpleCustomCommandEngine1.cs +++ b/TechbloxModdingAPI/Commands/SimpleCustomCommandEngine1.cs @@ -5,10 +5,9 @@ using System.Text; using System.Threading.Tasks; using Svelto.ECS; +using TechbloxModdingAPI.Utility; -using GamecraftModdingAPI.Utility; - -namespace GamecraftModdingAPI.Commands +namespace TechbloxModdingAPI.Commands { /// /// A simple implementation of ICustomCommandEngine sufficient for most commands. @@ -28,13 +27,13 @@ namespace GamecraftModdingAPI.Commands public void Dispose() { - GamecraftModdingAPI.Utility.Logging.MetaDebugLog($"Unregistering SimpleCustomCommandEngine {this.Name}"); + Logging.MetaDebugLog($"Unregistering SimpleCustomCommandEngine {this.Name}"); CommandRegistrationHelper.Unregister(this.Name); } public void Ready() { - GamecraftModdingAPI.Utility.Logging.MetaDebugLog($"Registering SimpleCustomCommandEngine {this.Name}"); + Logging.MetaDebugLog($"Registering SimpleCustomCommandEngine {this.Name}"); CommandRegistrationHelper.Register(this.Name, this.InvokeCatchError, this.Description); } diff --git a/GamecraftModdingAPI/Commands/SimpleCustomCommandEngine2.cs b/TechbloxModdingAPI/Commands/SimpleCustomCommandEngine2.cs similarity index 86% rename from GamecraftModdingAPI/Commands/SimpleCustomCommandEngine2.cs rename to TechbloxModdingAPI/Commands/SimpleCustomCommandEngine2.cs index 4b2b38d..8127861 100644 --- a/GamecraftModdingAPI/Commands/SimpleCustomCommandEngine2.cs +++ b/TechbloxModdingAPI/Commands/SimpleCustomCommandEngine2.cs @@ -5,10 +5,9 @@ using System.Text; using System.Threading.Tasks; using Svelto.ECS; +using TechbloxModdingAPI.Utility; -using GamecraftModdingAPI.Utility; - -namespace GamecraftModdingAPI.Commands +namespace TechbloxModdingAPI.Commands { /// /// A simple implementation of ICustomCommandEngine sufficient for most commands. @@ -28,13 +27,13 @@ namespace GamecraftModdingAPI.Commands public void Dispose() { - GamecraftModdingAPI.Utility.Logging.MetaDebugLog($"Unregistering SimpleCustomCommandEngine {this.Name}"); + Logging.MetaDebugLog($"Unregistering SimpleCustomCommandEngine {this.Name}"); CommandRegistrationHelper.Unregister(this.Name); } public void Ready() { - GamecraftModdingAPI.Utility.Logging.MetaDebugLog($"Registering SimpleCustomCommandEngine {this.Name}"); + Logging.MetaDebugLog($"Registering SimpleCustomCommandEngine {this.Name}"); CommandRegistrationHelper.Register(this.Name, this.InvokeCatchError, this.Description); } diff --git a/GamecraftModdingAPI/Commands/SimpleCustomCommandEngine3.cs b/TechbloxModdingAPI/Commands/SimpleCustomCommandEngine3.cs similarity index 86% rename from GamecraftModdingAPI/Commands/SimpleCustomCommandEngine3.cs rename to TechbloxModdingAPI/Commands/SimpleCustomCommandEngine3.cs index c9c942e..9b2f6b1 100644 --- a/GamecraftModdingAPI/Commands/SimpleCustomCommandEngine3.cs +++ b/TechbloxModdingAPI/Commands/SimpleCustomCommandEngine3.cs @@ -5,10 +5,9 @@ using System.Text; using System.Threading.Tasks; using Svelto.ECS; +using TechbloxModdingAPI.Utility; -using GamecraftModdingAPI.Utility; - -namespace GamecraftModdingAPI.Commands +namespace TechbloxModdingAPI.Commands { /// /// A simple implementation of ICustomCommandEngine sufficient for most commands. @@ -28,13 +27,13 @@ namespace GamecraftModdingAPI.Commands public void Dispose() { - GamecraftModdingAPI.Utility.Logging.MetaDebugLog($"Unregistering SimpleCustomCommandEngine {this.Name}"); + Logging.MetaDebugLog($"Unregistering SimpleCustomCommandEngine {this.Name}"); CommandRegistrationHelper.Unregister(this.Name); } public void Ready() { - GamecraftModdingAPI.Utility.Logging.MetaDebugLog($"Registering SimpleCustomCommandEngine {this.Name}"); + Logging.MetaDebugLog($"Registering SimpleCustomCommandEngine {this.Name}"); CommandRegistrationHelper.Register(this.Name, this.InvokeCatchError, this.Description); } diff --git a/GamecraftModdingAPI/Engines/IApiEngine.cs b/TechbloxModdingAPI/Engines/IApiEngine.cs similarity index 83% rename from GamecraftModdingAPI/Engines/IApiEngine.cs rename to TechbloxModdingAPI/Engines/IApiEngine.cs index 210c13d..6a8519a 100644 --- a/GamecraftModdingAPI/Engines/IApiEngine.cs +++ b/TechbloxModdingAPI/Engines/IApiEngine.cs @@ -6,10 +6,10 @@ using System.Threading.Tasks; using Svelto.ECS; -namespace GamecraftModdingAPI.Engines +namespace TechbloxModdingAPI.Engines { /// - /// Base engine interface used by all GamecraftModdingAPI engines + /// Base engine interface used by all TechbloxModdingAPI engines /// public interface IApiEngine : IEngine, IQueryingEntitiesEngine, IDisposable { diff --git a/GamecraftModdingAPI/Engines/IFactoryEngine.cs b/TechbloxModdingAPI/Engines/IFactoryEngine.cs similarity index 88% rename from GamecraftModdingAPI/Engines/IFactoryEngine.cs rename to TechbloxModdingAPI/Engines/IFactoryEngine.cs index 3e9c23e..d03b4e3 100644 --- a/GamecraftModdingAPI/Engines/IFactoryEngine.cs +++ b/TechbloxModdingAPI/Engines/IFactoryEngine.cs @@ -6,9 +6,9 @@ using System.Threading.Tasks; using Svelto.ECS; -using GamecraftModdingAPI.Utility; +using TechbloxModdingAPI.Utility; -namespace GamecraftModdingAPI.Engines +namespace TechbloxModdingAPI.Engines { /// /// Engine interface to create a ModEventEntityStruct in entitiesDB when Emit() is called. diff --git a/GamecraftModdingAPI/Engines/IReactionaryEngine.cs b/TechbloxModdingAPI/Engines/IReactionaryEngine.cs similarity index 86% rename from GamecraftModdingAPI/Engines/IReactionaryEngine.cs rename to TechbloxModdingAPI/Engines/IReactionaryEngine.cs index 9381605..d627866 100644 --- a/GamecraftModdingAPI/Engines/IReactionaryEngine.cs +++ b/TechbloxModdingAPI/Engines/IReactionaryEngine.cs @@ -7,9 +7,9 @@ using System.Threading.Tasks; using Svelto.ECS; using Svelto.ECS.Internal; -using GamecraftModdingAPI.Events; +using TechbloxModdingAPI.Events; -namespace GamecraftModdingAPI.Engines +namespace TechbloxModdingAPI.Engines { /// /// Engine interface to handle ModEventEntityStruct events emitted by IEventEmitterEngines. diff --git a/GamecraftModdingAPI/Events/DeterministicStepComposeEngineGroupsPatch.cs b/TechbloxModdingAPI/Events/DeterministicStepComposeEngineGroupsPatch.cs similarity index 95% rename from GamecraftModdingAPI/Events/DeterministicStepComposeEngineGroupsPatch.cs rename to TechbloxModdingAPI/Events/DeterministicStepComposeEngineGroupsPatch.cs index 9f16955..cf00ae0 100644 --- a/GamecraftModdingAPI/Events/DeterministicStepComposeEngineGroupsPatch.cs +++ b/TechbloxModdingAPI/Events/DeterministicStepComposeEngineGroupsPatch.cs @@ -10,9 +10,9 @@ using Svelto.ECS; using RobocraftX.Common; using RobocraftX.StateSync; -using GamecraftModdingAPI.Utility; +using TechbloxModdingAPI.Utility; -namespace GamecraftModdingAPI.Events +namespace TechbloxModdingAPI.Events { /// /// Patch of RobocraftX.StateSync.DeterministicStepCompositionRoot.ComposeEnginesGroups(...) diff --git a/GamecraftModdingAPI/Events/EmitterBuilder.cs b/TechbloxModdingAPI/Events/EmitterBuilder.cs similarity index 98% rename from GamecraftModdingAPI/Events/EmitterBuilder.cs rename to TechbloxModdingAPI/Events/EmitterBuilder.cs index c6a6879..1e5a2c2 100644 --- a/GamecraftModdingAPI/Events/EmitterBuilder.cs +++ b/TechbloxModdingAPI/Events/EmitterBuilder.cs @@ -2,7 +2,7 @@ using Svelto.ECS; -namespace GamecraftModdingAPI.Events +namespace TechbloxModdingAPI.Events { [Obsolete] public class EmitterBuilder diff --git a/GamecraftModdingAPI/Events/EventEngineFactory.cs b/TechbloxModdingAPI/Events/EventEngineFactory.cs similarity index 98% rename from GamecraftModdingAPI/Events/EventEngineFactory.cs rename to TechbloxModdingAPI/Events/EventEngineFactory.cs index 7981303..7361053 100644 --- a/GamecraftModdingAPI/Events/EventEngineFactory.cs +++ b/TechbloxModdingAPI/Events/EventEngineFactory.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; using Svelto.ECS; -namespace GamecraftModdingAPI.Events +namespace TechbloxModdingAPI.Events { /// /// Convenient factories for mod event engines diff --git a/GamecraftModdingAPI/Events/EventExceptions.cs b/TechbloxModdingAPI/Events/EventExceptions.cs similarity index 96% rename from GamecraftModdingAPI/Events/EventExceptions.cs rename to TechbloxModdingAPI/Events/EventExceptions.cs index b4458bc..a796752 100644 --- a/GamecraftModdingAPI/Events/EventExceptions.cs +++ b/TechbloxModdingAPI/Events/EventExceptions.cs @@ -1,5 +1,5 @@ using System; -namespace GamecraftModdingAPI.Events +namespace TechbloxModdingAPI.Events { public class EventException : GamecraftModdingAPIException { diff --git a/GamecraftModdingAPI/Events/EventManager.cs b/TechbloxModdingAPI/Events/EventManager.cs similarity index 96% rename from GamecraftModdingAPI/Events/EventManager.cs rename to TechbloxModdingAPI/Events/EventManager.cs index f021e9f..05b92cf 100644 --- a/GamecraftModdingAPI/Events/EventManager.cs +++ b/TechbloxModdingAPI/Events/EventManager.cs @@ -5,16 +5,15 @@ using System.Text; using System.Threading.Tasks; using Svelto.ECS; +using TechbloxModdingAPI.Utility; -using GamecraftModdingAPI.Utility; - -namespace GamecraftModdingAPI.Events +namespace TechbloxModdingAPI.Events { /// /// Keeps track of event handlers and emitters. /// This is used to add, remove and get API event handlers and emitters. /// - [Obsolete("This will be removed in an upcoming update. Use the new C# event architecture from GamecraftModdingAPI.App")] + [Obsolete("This will be removed in an upcoming update. Use the new C# event architecture from TechbloxModdingAPI.App")] public static class EventManager { private static Dictionary _eventEmitters = new Dictionary(); diff --git a/GamecraftModdingAPI/Events/EventType.cs b/TechbloxModdingAPI/Events/EventType.cs similarity index 92% rename from GamecraftModdingAPI/Events/EventType.cs rename to TechbloxModdingAPI/Events/EventType.cs index 468e214..3f826cc 100644 --- a/GamecraftModdingAPI/Events/EventType.cs +++ b/TechbloxModdingAPI/Events/EventType.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace GamecraftModdingAPI.Events +namespace TechbloxModdingAPI.Events { /// /// Built-in event types. diff --git a/GamecraftModdingAPI/Events/GameActivatedComposePatch.cs b/TechbloxModdingAPI/Events/GameActivatedComposePatch.cs similarity index 96% rename from GamecraftModdingAPI/Events/GameActivatedComposePatch.cs rename to TechbloxModdingAPI/Events/GameActivatedComposePatch.cs index c3a5fb5..62b5666 100644 --- a/GamecraftModdingAPI/Events/GameActivatedComposePatch.cs +++ b/TechbloxModdingAPI/Events/GameActivatedComposePatch.cs @@ -9,10 +9,9 @@ using HarmonyLib; using RobocraftX.CR.MainGame; using Svelto.ECS; using Unity.Entities; +using TechbloxModdingAPI.Utility; -using GamecraftModdingAPI.Utility; - -namespace GamecraftModdingAPI.Events +namespace TechbloxModdingAPI.Events { /// /// Patch of RobocraftX.FullGameCompositionRoot.ActivateGame() diff --git a/GamecraftModdingAPI/Events/GameReloadedPatch.cs b/TechbloxModdingAPI/Events/GameReloadedPatch.cs similarity index 87% rename from GamecraftModdingAPI/Events/GameReloadedPatch.cs rename to TechbloxModdingAPI/Events/GameReloadedPatch.cs index 7228084..5deb9ee 100644 --- a/GamecraftModdingAPI/Events/GameReloadedPatch.cs +++ b/TechbloxModdingAPI/Events/GameReloadedPatch.cs @@ -7,9 +7,9 @@ using System.Threading.Tasks; using HarmonyLib; using RobocraftX; -using GamecraftModdingAPI.Utility; +using TechbloxModdingAPI.Utility; -namespace GamecraftModdingAPI.Events +namespace TechbloxModdingAPI.Events { /// /// Patch of RobocraftX.FullGameCompositionRoot.ReloadGame() diff --git a/GamecraftModdingAPI/Events/GameStateBuildEmitterEngine.cs b/TechbloxModdingAPI/Events/GameStateBuildEmitterEngine.cs similarity index 95% rename from GamecraftModdingAPI/Events/GameStateBuildEmitterEngine.cs rename to TechbloxModdingAPI/Events/GameStateBuildEmitterEngine.cs index 725f544..29fb418 100644 --- a/GamecraftModdingAPI/Events/GameStateBuildEmitterEngine.cs +++ b/TechbloxModdingAPI/Events/GameStateBuildEmitterEngine.cs @@ -4,10 +4,9 @@ using Unity.Jobs; using RobocraftX.SimulationModeState; using RobocraftX.StateSync; using Svelto.ECS; +using TechbloxModdingAPI.Utility; -using GamecraftModdingAPI.Utility; - -namespace GamecraftModdingAPI.Events +namespace TechbloxModdingAPI.Events { /// /// Event emitter engine for switching to to build mode. diff --git a/GamecraftModdingAPI/Events/GameStateSimulationEmitterEngine.cs b/TechbloxModdingAPI/Events/GameStateSimulationEmitterEngine.cs similarity index 95% rename from GamecraftModdingAPI/Events/GameStateSimulationEmitterEngine.cs rename to TechbloxModdingAPI/Events/GameStateSimulationEmitterEngine.cs index 6e6e2ce..add45d5 100644 --- a/GamecraftModdingAPI/Events/GameStateSimulationEmitterEngine.cs +++ b/TechbloxModdingAPI/Events/GameStateSimulationEmitterEngine.cs @@ -4,10 +4,9 @@ using Unity.Jobs; using RobocraftX.SimulationModeState; using RobocraftX.StateSync; using Svelto.ECS; +using TechbloxModdingAPI.Utility; -using GamecraftModdingAPI.Utility; - -namespace GamecraftModdingAPI.Events +namespace TechbloxModdingAPI.Events { /// /// Event emitter engine for switching to simulation mode. diff --git a/GamecraftModdingAPI/Events/GameSwitchedToPatch.cs b/TechbloxModdingAPI/Events/GameSwitchedToPatch.cs similarity index 90% rename from GamecraftModdingAPI/Events/GameSwitchedToPatch.cs rename to TechbloxModdingAPI/Events/GameSwitchedToPatch.cs index dbd63c0..f45eb0b 100644 --- a/GamecraftModdingAPI/Events/GameSwitchedToPatch.cs +++ b/TechbloxModdingAPI/Events/GameSwitchedToPatch.cs @@ -10,9 +10,9 @@ using RobocraftX; using RobocraftX.CR.MainGame; using Svelto.ECS; -using GamecraftModdingAPI.Utility; +using TechbloxModdingAPI.Utility; -namespace GamecraftModdingAPI.Events +namespace TechbloxModdingAPI.Events { /// /// Patch of RobocraftX.FullGameCompositionRoot.ActivateGame() diff --git a/GamecraftModdingAPI/Events/HandlerBuilder.cs b/TechbloxModdingAPI/Events/HandlerBuilder.cs similarity index 99% rename from GamecraftModdingAPI/Events/HandlerBuilder.cs rename to TechbloxModdingAPI/Events/HandlerBuilder.cs index 10f3290..f726d0a 100644 --- a/GamecraftModdingAPI/Events/HandlerBuilder.cs +++ b/TechbloxModdingAPI/Events/HandlerBuilder.cs @@ -2,7 +2,7 @@ using Svelto.ECS; -namespace GamecraftModdingAPI.Events +namespace TechbloxModdingAPI.Events { [Obsolete] public class HandlerBuilder diff --git a/GamecraftModdingAPI/Events/IEventEmitterEngine.cs b/TechbloxModdingAPI/Events/IEventEmitterEngine.cs similarity index 86% rename from GamecraftModdingAPI/Events/IEventEmitterEngine.cs rename to TechbloxModdingAPI/Events/IEventEmitterEngine.cs index 8917cef..1ae89d2 100644 --- a/GamecraftModdingAPI/Events/IEventEmitterEngine.cs +++ b/TechbloxModdingAPI/Events/IEventEmitterEngine.cs @@ -5,10 +5,9 @@ using System.Text; using System.Threading.Tasks; using Svelto.ECS; +using TechbloxModdingAPI.Engines; -using GamecraftModdingAPI.Engines; - -namespace GamecraftModdingAPI.Events +namespace TechbloxModdingAPI.Events { /// /// Engine interface to create a ModEventEntityStruct in entitiesDB when a specific event occurs. diff --git a/GamecraftModdingAPI/Events/IEventHandlerEngine.cs b/TechbloxModdingAPI/Events/IEventHandlerEngine.cs similarity index 84% rename from GamecraftModdingAPI/Events/IEventHandlerEngine.cs rename to TechbloxModdingAPI/Events/IEventHandlerEngine.cs index 228adb8..003b6c5 100644 --- a/GamecraftModdingAPI/Events/IEventHandlerEngine.cs +++ b/TechbloxModdingAPI/Events/IEventHandlerEngine.cs @@ -6,10 +6,9 @@ using System.Threading.Tasks; using Svelto.ECS; using Svelto.ECS.Internal; +using TechbloxModdingAPI.Engines; -using GamecraftModdingAPI.Engines; - -namespace GamecraftModdingAPI.Events +namespace TechbloxModdingAPI.Events { /// /// Engine interface to handle ModEventEntityStruct events emitted by IEventEmitterEngines. diff --git a/GamecraftModdingAPI/Events/MenuActivatedPatch.cs b/TechbloxModdingAPI/Events/MenuActivatedPatch.cs similarity index 95% rename from GamecraftModdingAPI/Events/MenuActivatedPatch.cs rename to TechbloxModdingAPI/Events/MenuActivatedPatch.cs index 382bac4..64aa57f 100644 --- a/GamecraftModdingAPI/Events/MenuActivatedPatch.cs +++ b/TechbloxModdingAPI/Events/MenuActivatedPatch.cs @@ -7,10 +7,9 @@ using System.Threading.Tasks; using HarmonyLib; using RobocraftX; using Svelto.ECS; +using TechbloxModdingAPI.Utility; -using GamecraftModdingAPI.Utility; - -namespace GamecraftModdingAPI.Events +namespace TechbloxModdingAPI.Events { /// /// Patch of RobocraftX.FullGameCompositionRoot.ActivateMenu() diff --git a/GamecraftModdingAPI/Events/MenuSwitchedToPatch.cs b/TechbloxModdingAPI/Events/MenuSwitchedToPatch.cs similarity index 90% rename from GamecraftModdingAPI/Events/MenuSwitchedToPatch.cs rename to TechbloxModdingAPI/Events/MenuSwitchedToPatch.cs index 30b84da..c8fec0a 100644 --- a/GamecraftModdingAPI/Events/MenuSwitchedToPatch.cs +++ b/TechbloxModdingAPI/Events/MenuSwitchedToPatch.cs @@ -7,10 +7,9 @@ using System.Threading.Tasks; using HarmonyLib; using RobocraftX; using Svelto.ECS; +using TechbloxModdingAPI.Utility; -using GamecraftModdingAPI.Utility; - -namespace GamecraftModdingAPI.Events +namespace TechbloxModdingAPI.Events { /// /// Patch of RobocraftX.FullGameCompositionRoot.SwitchToMenu() diff --git a/GamecraftModdingAPI/Events/ModEventEntityDescriptor.cs b/TechbloxModdingAPI/Events/ModEventEntityDescriptor.cs similarity index 90% rename from GamecraftModdingAPI/Events/ModEventEntityDescriptor.cs rename to TechbloxModdingAPI/Events/ModEventEntityDescriptor.cs index 5172d9c..a4b2235 100644 --- a/GamecraftModdingAPI/Events/ModEventEntityDescriptor.cs +++ b/TechbloxModdingAPI/Events/ModEventEntityDescriptor.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; using Svelto.ECS; -namespace GamecraftModdingAPI.Events +namespace TechbloxModdingAPI.Events { /// /// EntityDescriptor for creating ModEventEntityStructs diff --git a/GamecraftModdingAPI/Events/ModEventEntityStruct.cs b/TechbloxModdingAPI/Events/ModEventEntityStruct.cs similarity index 92% rename from GamecraftModdingAPI/Events/ModEventEntityStruct.cs rename to TechbloxModdingAPI/Events/ModEventEntityStruct.cs index cc945ec..9b92bf3 100644 --- a/GamecraftModdingAPI/Events/ModEventEntityStruct.cs +++ b/TechbloxModdingAPI/Events/ModEventEntityStruct.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; using Svelto.ECS; -namespace GamecraftModdingAPI.Events +namespace TechbloxModdingAPI.Events { /// /// The event entity struct diff --git a/GamecraftModdingAPI/Events/SimpleEventEmitterEngine.cs b/TechbloxModdingAPI/Events/SimpleEventEmitterEngine.cs similarity index 96% rename from GamecraftModdingAPI/Events/SimpleEventEmitterEngine.cs rename to TechbloxModdingAPI/Events/SimpleEventEmitterEngine.cs index 0ea8170..f80eda1 100644 --- a/GamecraftModdingAPI/Events/SimpleEventEmitterEngine.cs +++ b/TechbloxModdingAPI/Events/SimpleEventEmitterEngine.cs @@ -5,9 +5,9 @@ using System.Text; using System.Threading.Tasks; using Svelto.ECS; -using GamecraftModdingAPI.Utility; +using TechbloxModdingAPI.Utility; -namespace GamecraftModdingAPI.Events +namespace TechbloxModdingAPI.Events { /// /// A simple implementation of IEventEmitterEngine sufficient for most uses diff --git a/GamecraftModdingAPI/Events/SimpleEventHandlerEngine.cs b/TechbloxModdingAPI/Events/SimpleEventHandlerEngine.cs similarity index 98% rename from GamecraftModdingAPI/Events/SimpleEventHandlerEngine.cs rename to TechbloxModdingAPI/Events/SimpleEventHandlerEngine.cs index ebce21d..7cfd979 100644 --- a/GamecraftModdingAPI/Events/SimpleEventHandlerEngine.cs +++ b/TechbloxModdingAPI/Events/SimpleEventHandlerEngine.cs @@ -5,10 +5,9 @@ using System.Text; using System.Threading.Tasks; using Svelto.ECS; +using TechbloxModdingAPI.Utility; -using GamecraftModdingAPI.Utility; - -namespace GamecraftModdingAPI.Events +namespace TechbloxModdingAPI.Events { /// /// A simple implementation of IEventHandlerEngine sufficient for most uses diff --git a/GamecraftModdingAPI/FlyCam.cs b/TechbloxModdingAPI/FlyCam.cs similarity index 97% rename from GamecraftModdingAPI/FlyCam.cs rename to TechbloxModdingAPI/FlyCam.cs index be9955f..b72b174 100644 --- a/GamecraftModdingAPI/FlyCam.cs +++ b/TechbloxModdingAPI/FlyCam.cs @@ -1,13 +1,12 @@ -using GamecraftModdingAPI.Players; -using GamecraftModdingAPI.Utility; - using RobocraftX.Physics; using Svelto.ECS.EntityStructs; using Techblox.FlyCam; +using TechbloxModdingAPI.Players; +using TechbloxModdingAPI.Utility; using Unity.Mathematics; using UnityEngine; -namespace GamecraftModdingAPI +namespace TechbloxModdingAPI { public class FlyCam { diff --git a/GamecraftModdingAPI/GamecraftModdingAPIException.cs b/TechbloxModdingAPI/GamecraftModdingAPIException.cs similarity index 94% rename from GamecraftModdingAPI/GamecraftModdingAPIException.cs rename to TechbloxModdingAPI/GamecraftModdingAPIException.cs index bc944aa..0b4f7d5 100644 --- a/GamecraftModdingAPI/GamecraftModdingAPIException.cs +++ b/TechbloxModdingAPI/GamecraftModdingAPIException.cs @@ -1,7 +1,7 @@ using System; using System.Runtime.Serialization; -namespace GamecraftModdingAPI +namespace TechbloxModdingAPI { public class GamecraftModdingAPIException : Exception { diff --git a/GamecraftModdingAPI/Input/FakeInput.cs b/TechbloxModdingAPI/Input/FakeInput.cs similarity index 99% rename from GamecraftModdingAPI/Input/FakeInput.cs rename to TechbloxModdingAPI/Input/FakeInput.cs index 031a841..6104a4e 100644 --- a/GamecraftModdingAPI/Input/FakeInput.cs +++ b/TechbloxModdingAPI/Input/FakeInput.cs @@ -3,10 +3,9 @@ using RobocraftX.Common; using RobocraftX.Common.Input; using Svelto.ECS; +using TechbloxModdingAPI.Utility; -using GamecraftModdingAPI.Utility; - -namespace GamecraftModdingAPI.Input +namespace TechbloxModdingAPI.Input { public static class FakeInput { diff --git a/GamecraftModdingAPI/Input/FakeInputEngine.cs b/TechbloxModdingAPI/Input/FakeInputEngine.cs similarity index 96% rename from GamecraftModdingAPI/Input/FakeInputEngine.cs rename to TechbloxModdingAPI/Input/FakeInputEngine.cs index 9b85c97..0a41fb2 100644 --- a/GamecraftModdingAPI/Input/FakeInputEngine.cs +++ b/TechbloxModdingAPI/Input/FakeInputEngine.cs @@ -5,10 +5,10 @@ using RobocraftX.Common.Input; using RobocraftX.Players; using Svelto.ECS; -using GamecraftModdingAPI.Utility; -using GamecraftModdingAPI.Engines; +using TechbloxModdingAPI.Utility; +using TechbloxModdingAPI.Engines; -namespace GamecraftModdingAPI.Input +namespace TechbloxModdingAPI.Input { public class FakeInputEngine : IApiEngine { diff --git a/GamecraftModdingAPI/Interface/IMGUI/Button.cs b/TechbloxModdingAPI/Interface/IMGUI/Button.cs similarity index 98% rename from GamecraftModdingAPI/Interface/IMGUI/Button.cs rename to TechbloxModdingAPI/Interface/IMGUI/Button.cs index 5a119f6..de8e7cc 100644 --- a/GamecraftModdingAPI/Interface/IMGUI/Button.cs +++ b/TechbloxModdingAPI/Interface/IMGUI/Button.cs @@ -2,7 +2,7 @@ using System; using Unity.Mathematics; using UnityEngine; -namespace GamecraftModdingAPI.Interface.IMGUI +namespace TechbloxModdingAPI.Interface.IMGUI { /// /// A clickable button. diff --git a/GamecraftModdingAPI/Interface/IMGUI/Constants.cs b/TechbloxModdingAPI/Interface/IMGUI/Constants.cs similarity index 98% rename from GamecraftModdingAPI/Interface/IMGUI/Constants.cs rename to TechbloxModdingAPI/Interface/IMGUI/Constants.cs index 42a7f18..a34d8fe 100644 --- a/GamecraftModdingAPI/Interface/IMGUI/Constants.cs +++ b/TechbloxModdingAPI/Interface/IMGUI/Constants.cs @@ -3,7 +3,7 @@ using System.Collections; using System.Collections.Generic; using System.Globalization; using System.Reflection; -using GamecraftModdingAPI.Utility; +using TechbloxModdingAPI.Utility; using HarmonyLib; using Svelto.Tasks; using Svelto.Tasks.Lean; @@ -11,7 +11,7 @@ using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.ResourceManagement.AsyncOperations; -namespace GamecraftModdingAPI.Interface.IMGUI +namespace TechbloxModdingAPI.Interface.IMGUI { /// /// Convenient IMGUI values. diff --git a/GamecraftModdingAPI/Interface/IMGUI/Group.cs b/TechbloxModdingAPI/Interface/IMGUI/Group.cs similarity index 96% rename from GamecraftModdingAPI/Interface/IMGUI/Group.cs rename to TechbloxModdingAPI/Interface/IMGUI/Group.cs index 7033dee..bbbbdf1 100644 --- a/GamecraftModdingAPI/Interface/IMGUI/Group.cs +++ b/TechbloxModdingAPI/Interface/IMGUI/Group.cs @@ -1,9 +1,9 @@ using System; -using GamecraftModdingAPI.Utility; +using TechbloxModdingAPI.Utility; using Svelto.DataStructures; using UnityEngine; -namespace GamecraftModdingAPI.Interface.IMGUI +namespace TechbloxModdingAPI.Interface.IMGUI { /// /// A group of elements. @@ -80,7 +80,7 @@ namespace GamecraftModdingAPI.Interface.IMGUI } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The rectangular area to use in the window. /// Name of the group. diff --git a/GamecraftModdingAPI/Interface/IMGUI/IMGUIManager.cs b/TechbloxModdingAPI/Interface/IMGUI/IMGUIManager.cs similarity index 97% rename from GamecraftModdingAPI/Interface/IMGUI/IMGUIManager.cs rename to TechbloxModdingAPI/Interface/IMGUI/IMGUIManager.cs index a4bb6d2..d4f3bb7 100644 --- a/GamecraftModdingAPI/Interface/IMGUI/IMGUIManager.cs +++ b/TechbloxModdingAPI/Interface/IMGUI/IMGUIManager.cs @@ -1,8 +1,8 @@ using System; using System.Collections; using System.Collections.Generic; -using GamecraftModdingAPI.App; -using GamecraftModdingAPI.Utility; +using TechbloxModdingAPI.App; +using TechbloxModdingAPI.Utility; using Rewired.Internal; using Svelto.DataStructures; using Svelto.Tasks; @@ -10,7 +10,7 @@ using Svelto.Tasks.ExtraLean; using Svelto.Tasks.ExtraLean.Unity; using UnityEngine; -namespace GamecraftModdingAPI.Interface.IMGUI +namespace TechbloxModdingAPI.Interface.IMGUI { /// /// Keeps track of UIElement instances. diff --git a/GamecraftModdingAPI/Interface/IMGUI/Image.cs b/TechbloxModdingAPI/Interface/IMGUI/Image.cs similarity index 89% rename from GamecraftModdingAPI/Interface/IMGUI/Image.cs rename to TechbloxModdingAPI/Interface/IMGUI/Image.cs index b4fac9f..2bea1f4 100644 --- a/GamecraftModdingAPI/Interface/IMGUI/Image.cs +++ b/TechbloxModdingAPI/Interface/IMGUI/Image.cs @@ -1,6 +1,6 @@ using UnityEngine; -namespace GamecraftModdingAPI.Interface.IMGUI +namespace TechbloxModdingAPI.Interface.IMGUI { /// /// An image. @@ -44,7 +44,7 @@ namespace GamecraftModdingAPI.Interface.IMGUI public bool Enabled { set; get; } = true; /// - /// Initializes a new instance of the class with automatic layout. + /// Initializes a new instance of the class with automatic layout. /// /// Image to display. /// The element's name. @@ -72,7 +72,7 @@ namespace GamecraftModdingAPI.Interface.IMGUI } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// Rectangular area for the image. /// Image to display. diff --git a/GamecraftModdingAPI/Interface/IMGUI/Label.cs b/TechbloxModdingAPI/Interface/IMGUI/Label.cs similarity index 88% rename from GamecraftModdingAPI/Interface/IMGUI/Label.cs rename to TechbloxModdingAPI/Interface/IMGUI/Label.cs index 2483e3d..960a6ca 100644 --- a/GamecraftModdingAPI/Interface/IMGUI/Label.cs +++ b/TechbloxModdingAPI/Interface/IMGUI/Label.cs @@ -1,6 +1,6 @@ using UnityEngine; -namespace GamecraftModdingAPI.Interface.IMGUI +namespace TechbloxModdingAPI.Interface.IMGUI { /// /// A simple text label. @@ -43,7 +43,7 @@ namespace GamecraftModdingAPI.Interface.IMGUI public bool Enabled { set; get; } = true; /// - /// Initializes a new instance of the class with automatic layout. + /// Initializes a new instance of the class with automatic layout. /// /// Initial string to display on the label. /// The element's name. @@ -63,7 +63,7 @@ namespace GamecraftModdingAPI.Interface.IMGUI } /// - /// Initializes a new instance of the . + /// Initializes a new instance of the . /// /// Rectangular area for the label. /// Initial string to display on the label. diff --git a/GamecraftModdingAPI/Interface/IMGUI/Text.cs b/TechbloxModdingAPI/Interface/IMGUI/Text.cs similarity index 98% rename from GamecraftModdingAPI/Interface/IMGUI/Text.cs rename to TechbloxModdingAPI/Interface/IMGUI/Text.cs index 1b94804..bdf6738 100644 --- a/GamecraftModdingAPI/Interface/IMGUI/Text.cs +++ b/TechbloxModdingAPI/Interface/IMGUI/Text.cs @@ -1,7 +1,7 @@ using System; using UnityEngine; -namespace GamecraftModdingAPI.Interface.IMGUI +namespace TechbloxModdingAPI.Interface.IMGUI { /// /// A text input field. diff --git a/GamecraftModdingAPI/Interface/IMGUI/UIElement.cs b/TechbloxModdingAPI/Interface/IMGUI/UIElement.cs similarity index 94% rename from GamecraftModdingAPI/Interface/IMGUI/UIElement.cs rename to TechbloxModdingAPI/Interface/IMGUI/UIElement.cs index abaed6e..dd66af6 100644 --- a/GamecraftModdingAPI/Interface/IMGUI/UIElement.cs +++ b/TechbloxModdingAPI/Interface/IMGUI/UIElement.cs @@ -1,6 +1,6 @@ using System; -namespace GamecraftModdingAPI.Interface.IMGUI +namespace TechbloxModdingAPI.Interface.IMGUI { /// /// GUI Element like a text field, button or picture. diff --git a/GamecraftModdingAPI/Inventory/Hotbar.cs b/TechbloxModdingAPI/Inventory/Hotbar.cs similarity index 92% rename from GamecraftModdingAPI/Inventory/Hotbar.cs rename to TechbloxModdingAPI/Inventory/Hotbar.cs index 838c554..92bca86 100644 --- a/GamecraftModdingAPI/Inventory/Hotbar.cs +++ b/TechbloxModdingAPI/Inventory/Hotbar.cs @@ -2,12 +2,11 @@ using RobocraftX.Common.Input; using RobocraftX.Multiplayer.Input; - -using GamecraftModdingAPI.Blocks; -using GamecraftModdingAPI.Utility; using HarmonyLib; +using TechbloxModdingAPI.Blocks; +using TechbloxModdingAPI.Utility; -namespace GamecraftModdingAPI.Inventory +namespace TechbloxModdingAPI.Inventory { public static class Hotbar { diff --git a/GamecraftModdingAPI/Inventory/HotbarEngine.cs b/TechbloxModdingAPI/Inventory/HotbarEngine.cs similarity index 88% rename from GamecraftModdingAPI/Inventory/HotbarEngine.cs rename to TechbloxModdingAPI/Inventory/HotbarEngine.cs index b20928b..764f535 100644 --- a/GamecraftModdingAPI/Inventory/HotbarEngine.cs +++ b/TechbloxModdingAPI/Inventory/HotbarEngine.cs @@ -8,13 +8,13 @@ using RobocraftX.Common.Input; using RobocraftX.Common.Players; using Svelto.ECS; -using GamecraftModdingAPI.Blocks; -using GamecraftModdingAPI.Utility; -using GamecraftModdingAPI.Engines; +using TechbloxModdingAPI.Blocks; +using TechbloxModdingAPI.Utility; using RobocraftX.Blocks; using Techblox.FlyCam; +using TechbloxModdingAPI.Engines; -namespace GamecraftModdingAPI.Inventory +namespace TechbloxModdingAPI.Inventory { public class HotbarEngine : IApiEngine { diff --git a/GamecraftModdingAPI/Inventory/HotbarSlotSelectionHandlerEnginePatch.cs b/TechbloxModdingAPI/Inventory/HotbarSlotSelectionHandlerEnginePatch.cs similarity index 90% rename from GamecraftModdingAPI/Inventory/HotbarSlotSelectionHandlerEnginePatch.cs rename to TechbloxModdingAPI/Inventory/HotbarSlotSelectionHandlerEnginePatch.cs index 153d82c..1a068f0 100644 --- a/GamecraftModdingAPI/Inventory/HotbarSlotSelectionHandlerEnginePatch.cs +++ b/TechbloxModdingAPI/Inventory/HotbarSlotSelectionHandlerEnginePatch.cs @@ -4,9 +4,9 @@ using System.Reflection; using Svelto.ECS; using HarmonyLib; -using GamecraftModdingAPI.Blocks; +using TechbloxModdingAPI.Blocks; -namespace GamecraftModdingAPI.Inventory +namespace TechbloxModdingAPI.Inventory { [HarmonyPatch] public class HotbarSlotSelectionHandlerEnginePatch diff --git a/GamecraftModdingAPI/Main.cs b/TechbloxModdingAPI/Main.cs similarity index 87% rename from GamecraftModdingAPI/Main.cs rename to TechbloxModdingAPI/Main.cs index 57349de..b81e127 100644 --- a/GamecraftModdingAPI/Main.cs +++ b/TechbloxModdingAPI/Main.cs @@ -7,16 +7,16 @@ using RobocraftX.Schedulers; using RobocraftX.Services; using Svelto.Context; using Svelto.Tasks.ExtraLean; +using TechbloxModdingAPI.App; +using TechbloxModdingAPI.Blocks; +using TechbloxModdingAPI.Events; +using TechbloxModdingAPI.Tasks; +using TechbloxModdingAPI.Utility; -using GamecraftModdingAPI.Blocks; -using GamecraftModdingAPI.Utility; -using GamecraftModdingAPI.Events; -using GamecraftModdingAPI.Tasks; - -namespace GamecraftModdingAPI +namespace TechbloxModdingAPI { /// - /// The main class of the GamecraftModdingAPI. + /// The main class of the TechbloxModdingAPI. /// Use this to initialize the API before calling it. /// public static class Main @@ -30,7 +30,7 @@ namespace GamecraftModdingAPI private static int referenceCount = 0; /// - /// Initializes the GamecraftModdingAPI. + /// Initializes the TechbloxModdingAPI. /// Call this as soon as possible after Gamecraft starts up. /// Ideally, this should be called from your main Plugin class's OnApplicationStart() method. /// @@ -40,7 +40,7 @@ namespace GamecraftModdingAPI if (referenceCount > 1) { return; } if (IsInitialized) { - Logging.LogWarning("GamecraftModdingAPI.Main.Init() called but API is already initialized!"); + Logging.LogWarning("TechbloxModdingAPI.Main.Init() called but API is already initialized!"); return; } Logging.MetaDebugLog($"Patching Gamecraft"); @@ -89,8 +89,8 @@ namespace GamecraftModdingAPI Wire.Init(); GameClient.Init(); AsyncUtils.Init(); - GamecraftModdingAPI.App.Client.Init(); - GamecraftModdingAPI.App.Game.Init(); + Client.Init(); + Game.Init(); //CustomBlock.Init(); // init UI Interface.IMGUI.Constants.Init(); @@ -99,7 +99,7 @@ namespace GamecraftModdingAPI } /// - /// Shuts down & cleans up the GamecraftModdingAPI. + /// Shuts down & cleans up the TechbloxModdingAPI. /// Call this as late as possible before Gamecraft quits. /// Ideally, this should be called from your main Plugin class's OnApplicationQuit() method. /// @@ -110,7 +110,7 @@ namespace GamecraftModdingAPI { if (!IsInitialized) { - Logging.LogWarning("GamecraftModdingAPI.Main.Shutdown() called but API is not initialized!"); + Logging.LogWarning("TechbloxModdingAPI.Main.Shutdown() called but API is not initialized!"); return; } Scheduler.Dispose(); @@ -124,7 +124,7 @@ namespace GamecraftModdingAPI private static void OnPatchError() { ErrorBuilder.DisplayMustQuitError("Failed to patch Techblox!\n" + - "Make sure you're using the latest version of GamecraftModdingAPI or disable mods if the API isn't released yet."); + "Make sure you're using the latest version of TechbloxModdingAPI or disable mods if the API isn't released yet."); } } } diff --git a/GamecraftModdingAPI/Persistence/DeserializeFromDiskEntitiesEnginePatch.cs b/TechbloxModdingAPI/Persistence/DeserializeFromDiskEntitiesEnginePatch.cs similarity index 97% rename from GamecraftModdingAPI/Persistence/DeserializeFromDiskEntitiesEnginePatch.cs rename to TechbloxModdingAPI/Persistence/DeserializeFromDiskEntitiesEnginePatch.cs index 0ff675f..f436e56 100644 --- a/GamecraftModdingAPI/Persistence/DeserializeFromDiskEntitiesEnginePatch.cs +++ b/TechbloxModdingAPI/Persistence/DeserializeFromDiskEntitiesEnginePatch.cs @@ -8,9 +8,9 @@ using Svelto.ECS; using Svelto.ECS.Serialization; using HarmonyLib; -using GamecraftModdingAPI.Utility; +using TechbloxModdingAPI.Utility; -namespace GamecraftModdingAPI.Persistence +namespace TechbloxModdingAPI.Persistence { [HarmonyPatch] class DeserializeFromDiskEntitiesEnginePatch diff --git a/GamecraftModdingAPI/Persistence/IEntitySerializer.cs b/TechbloxModdingAPI/Persistence/IEntitySerializer.cs similarity index 94% rename from GamecraftModdingAPI/Persistence/IEntitySerializer.cs rename to TechbloxModdingAPI/Persistence/IEntitySerializer.cs index 5c4fb85..e7fcd5c 100644 --- a/GamecraftModdingAPI/Persistence/IEntitySerializer.cs +++ b/TechbloxModdingAPI/Persistence/IEntitySerializer.cs @@ -3,9 +3,9 @@ using Svelto.ECS; using Svelto.ECS.Serialization; -using GamecraftModdingAPI.Utility; +using TechbloxModdingAPI.Utility; -namespace GamecraftModdingAPI.Persistence +namespace TechbloxModdingAPI.Persistence { /// /// Entity serializer and deserializer interface for storing and retrieving data in a Gamecraft save file (GameSave.GC). diff --git a/GamecraftModdingAPI/Persistence/SaveAndLoadCompositionRootPatch.cs b/TechbloxModdingAPI/Persistence/SaveAndLoadCompositionRootPatch.cs similarity index 90% rename from GamecraftModdingAPI/Persistence/SaveAndLoadCompositionRootPatch.cs rename to TechbloxModdingAPI/Persistence/SaveAndLoadCompositionRootPatch.cs index 58f5708..b3ae6de 100644 --- a/GamecraftModdingAPI/Persistence/SaveAndLoadCompositionRootPatch.cs +++ b/TechbloxModdingAPI/Persistence/SaveAndLoadCompositionRootPatch.cs @@ -5,7 +5,7 @@ using Svelto.ECS; using HarmonyLib; -namespace GamecraftModdingAPI.Persistence +namespace TechbloxModdingAPI.Persistence { [HarmonyPatch(typeof(SaveAndLoadCompositionRoot), "Compose")] class SaveAndLoadCompositionRootPatch diff --git a/GamecraftModdingAPI/Persistence/SaveGameEnginePatch.cs b/TechbloxModdingAPI/Persistence/SaveGameEnginePatch.cs similarity index 94% rename from GamecraftModdingAPI/Persistence/SaveGameEnginePatch.cs rename to TechbloxModdingAPI/Persistence/SaveGameEnginePatch.cs index 0145c09..74edddf 100644 --- a/GamecraftModdingAPI/Persistence/SaveGameEnginePatch.cs +++ b/TechbloxModdingAPI/Persistence/SaveGameEnginePatch.cs @@ -7,11 +7,10 @@ using RobocraftX.SaveAndLoad; using Svelto.DataStructures; using Svelto.ECS; using Svelto.ECS.Serialization; - -using GamecraftModdingAPI.Utility; using HarmonyLib; +using TechbloxModdingAPI.Utility; -namespace GamecraftModdingAPI.Persistence +namespace TechbloxModdingAPI.Persistence { //[HarmonyPatch] - TODO class SaveGameEnginePatch @@ -30,7 +29,7 @@ namespace GamecraftModdingAPI.Persistence BinaryBufferWriter bbw = new BinaryBufferWriter(serializationData.data.ToArrayFast(out uint buffLen), serializationData.dataPos); uint originalPos = serializationData.dataPos; Logging.MetaDebugLog($"dataPos: {originalPos}"); - // Add frame start so it's easier to find GamecraftModdingAPI-serialized components + // Add frame start so it's easier to find TechbloxModdingAPI-serialized components for (int i = 0; i < frameStart.Length; i++) { bbw.Write(frameStart[i]); diff --git a/GamecraftModdingAPI/Persistence/SerializerManager.cs b/TechbloxModdingAPI/Persistence/SerializerManager.cs similarity index 96% rename from GamecraftModdingAPI/Persistence/SerializerManager.cs rename to TechbloxModdingAPI/Persistence/SerializerManager.cs index 161662b..6177d7c 100644 --- a/GamecraftModdingAPI/Persistence/SerializerManager.cs +++ b/TechbloxModdingAPI/Persistence/SerializerManager.cs @@ -4,10 +4,9 @@ using System.Linq; using Svelto.ECS; using Svelto.ECS.Serialization; +using TechbloxModdingAPI.Utility; -using GamecraftModdingAPI.Utility; - -namespace GamecraftModdingAPI.Persistence +namespace TechbloxModdingAPI.Persistence { /// /// Keeps track of serializers. diff --git a/GamecraftModdingAPI/Persistence/SimpleEntitySerializer.cs b/TechbloxModdingAPI/Persistence/SimpleEntitySerializer.cs similarity index 98% rename from GamecraftModdingAPI/Persistence/SimpleEntitySerializer.cs rename to TechbloxModdingAPI/Persistence/SimpleEntitySerializer.cs index 59fd9fd..7f605c3 100644 --- a/GamecraftModdingAPI/Persistence/SimpleEntitySerializer.cs +++ b/TechbloxModdingAPI/Persistence/SimpleEntitySerializer.cs @@ -5,7 +5,7 @@ using Svelto.ECS.Serialization; using RobocraftX.Common; -namespace GamecraftModdingAPI.Persistence +namespace TechbloxModdingAPI.Persistence { /// /// Simple entity serializer sufficient for simple entity components. diff --git a/GamecraftModdingAPI/Player.cs b/TechbloxModdingAPI/Player.cs similarity index 97% rename from GamecraftModdingAPI/Player.cs rename to TechbloxModdingAPI/Player.cs index 8b204d0..2c6b122 100644 --- a/GamecraftModdingAPI/Player.cs +++ b/TechbloxModdingAPI/Player.cs @@ -3,11 +3,10 @@ using Unity.Mathematics; using RobocraftX.Common; using RobocraftX.Common.Players; using Svelto.ECS; +using TechbloxModdingAPI.Blocks; +using TechbloxModdingAPI.Players; -using GamecraftModdingAPI.Players; -using GamecraftModdingAPI.Blocks; - -namespace GamecraftModdingAPI +namespace TechbloxModdingAPI { /// /// An in-game player character. Any Leo you see is a player. @@ -68,7 +67,7 @@ namespace GamecraftModdingAPI } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The player's unique identifier. public Player(uint id) @@ -82,7 +81,7 @@ namespace GamecraftModdingAPI } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The player type. Chooses the first available player matching the criteria. public Player(PlayerType player) @@ -252,7 +251,7 @@ namespace GamecraftModdingAPI } /// - /// Whether this is damageable. + /// Whether this is damageable. /// /// true if damageable; otherwise, false. public bool Damageable diff --git a/GamecraftModdingAPI/Players/FlyCamEngine.cs b/TechbloxModdingAPI/Players/FlyCamEngine.cs similarity index 90% rename from GamecraftModdingAPI/Players/FlyCamEngine.cs rename to TechbloxModdingAPI/Players/FlyCamEngine.cs index b8f8cf4..0b98071 100644 --- a/GamecraftModdingAPI/Players/FlyCamEngine.cs +++ b/TechbloxModdingAPI/Players/FlyCamEngine.cs @@ -1,8 +1,8 @@ -using GamecraftModdingAPI.Engines; using Svelto.ECS; using Techblox.FlyCam; +using TechbloxModdingAPI.Engines; -namespace GamecraftModdingAPI.Players +namespace TechbloxModdingAPI.Players { public class FlyCamEngine : IApiEngine { diff --git a/GamecraftModdingAPI/Players/PlayerBuildingMode.cs b/TechbloxModdingAPI/Players/PlayerBuildingMode.cs similarity index 75% rename from GamecraftModdingAPI/Players/PlayerBuildingMode.cs rename to TechbloxModdingAPI/Players/PlayerBuildingMode.cs index c7a5e37..383e1af 100644 --- a/GamecraftModdingAPI/Players/PlayerBuildingMode.cs +++ b/TechbloxModdingAPI/Players/PlayerBuildingMode.cs @@ -1,4 +1,4 @@ -namespace GamecraftModdingAPI.Players +namespace TechbloxModdingAPI.Players { public enum PlayerBuildingMode { diff --git a/GamecraftModdingAPI/Players/PlayerEngine.cs b/TechbloxModdingAPI/Players/PlayerEngine.cs similarity index 99% rename from GamecraftModdingAPI/Players/PlayerEngine.cs rename to TechbloxModdingAPI/Players/PlayerEngine.cs index dfdb580..cc24650 100644 --- a/GamecraftModdingAPI/Players/PlayerEngine.cs +++ b/TechbloxModdingAPI/Players/PlayerEngine.cs @@ -17,13 +17,12 @@ using Techblox.FlyCam; using Unity.Mathematics; using Unity.Physics; using UnityEngine; - -using GamecraftModdingAPI.Engines; using HarmonyLib; using RobocraftX.Common; using Svelto.ECS.DataStructures; +using TechbloxModdingAPI.Engines; -namespace GamecraftModdingAPI.Players +namespace TechbloxModdingAPI.Players { internal class PlayerEngine : IApiEngine, IFactoryEngine { diff --git a/GamecraftModdingAPI/Players/PlayerExceptions.cs b/TechbloxModdingAPI/Players/PlayerExceptions.cs similarity index 92% rename from GamecraftModdingAPI/Players/PlayerExceptions.cs rename to TechbloxModdingAPI/Players/PlayerExceptions.cs index 94312b9..d5bba55 100644 --- a/GamecraftModdingAPI/Players/PlayerExceptions.cs +++ b/TechbloxModdingAPI/Players/PlayerExceptions.cs @@ -1,5 +1,5 @@ using System; -namespace GamecraftModdingAPI.Players +namespace TechbloxModdingAPI.Players { public class PlayerException : GamecraftModdingAPIException { diff --git a/GamecraftModdingAPI/Players/PlayerTests.cs b/TechbloxModdingAPI/Players/PlayerTests.cs similarity index 94% rename from GamecraftModdingAPI/Players/PlayerTests.cs rename to TechbloxModdingAPI/Players/PlayerTests.cs index 1af7992..8086d96 100644 --- a/GamecraftModdingAPI/Players/PlayerTests.cs +++ b/TechbloxModdingAPI/Players/PlayerTests.cs @@ -2,10 +2,10 @@ using Unity.Mathematics; -using GamecraftModdingAPI; -using GamecraftModdingAPI.Tests; +using TechbloxModdingAPI; +using TechbloxModdingAPI.Tests; -namespace GamecraftModdingAPI.Players +namespace TechbloxModdingAPI.Players { #if TEST /// diff --git a/GamecraftModdingAPI/Players/PlayerType.cs b/TechbloxModdingAPI/Players/PlayerType.cs similarity index 70% rename from GamecraftModdingAPI/Players/PlayerType.cs rename to TechbloxModdingAPI/Players/PlayerType.cs index 0b4966c..3e2214f 100644 --- a/GamecraftModdingAPI/Players/PlayerType.cs +++ b/TechbloxModdingAPI/Players/PlayerType.cs @@ -1,5 +1,5 @@ using System; -namespace GamecraftModdingAPI.Players +namespace TechbloxModdingAPI.Players { public enum PlayerType { diff --git a/GamecraftModdingAPI/SimBody.cs b/TechbloxModdingAPI/SimBody.cs similarity index 99% rename from GamecraftModdingAPI/SimBody.cs rename to TechbloxModdingAPI/SimBody.cs index 42812d9..dd7429e 100644 --- a/GamecraftModdingAPI/SimBody.cs +++ b/TechbloxModdingAPI/SimBody.cs @@ -7,7 +7,7 @@ using Gamecraft.Damage; using RobocraftX.Common; using RobocraftX.Physics; -namespace GamecraftModdingAPI +namespace TechbloxModdingAPI { /// /// A rigid body (like a chunk of connected blocks) during simulation. diff --git a/GamecraftModdingAPI/Tasks/ISchedulable.cs b/TechbloxModdingAPI/Tasks/ISchedulable.cs similarity index 92% rename from GamecraftModdingAPI/Tasks/ISchedulable.cs rename to TechbloxModdingAPI/Tasks/ISchedulable.cs index 0b04a3e..679e999 100644 --- a/GamecraftModdingAPI/Tasks/ISchedulable.cs +++ b/TechbloxModdingAPI/Tasks/ISchedulable.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; using Svelto.Tasks; -namespace GamecraftModdingAPI.Tasks +namespace TechbloxModdingAPI.Tasks { /// /// Interface for asynchronous tasks diff --git a/GamecraftModdingAPI/Tasks/Once.cs b/TechbloxModdingAPI/Tasks/Once.cs similarity index 96% rename from GamecraftModdingAPI/Tasks/Once.cs rename to TechbloxModdingAPI/Tasks/Once.cs index 52651e6..807dae7 100644 --- a/GamecraftModdingAPI/Tasks/Once.cs +++ b/TechbloxModdingAPI/Tasks/Once.cs @@ -7,7 +7,7 @@ using System.Threading.Tasks; using Svelto.Tasks; using Svelto.Tasks.Enumerators; -namespace GamecraftModdingAPI.Tasks +namespace TechbloxModdingAPI.Tasks { /// /// An asynchronous task to be performed once. diff --git a/GamecraftModdingAPI/Tasks/Repeatable.cs b/TechbloxModdingAPI/Tasks/Repeatable.cs similarity index 98% rename from GamecraftModdingAPI/Tasks/Repeatable.cs rename to TechbloxModdingAPI/Tasks/Repeatable.cs index 0b9982e..0cafe48 100644 --- a/GamecraftModdingAPI/Tasks/Repeatable.cs +++ b/TechbloxModdingAPI/Tasks/Repeatable.cs @@ -7,7 +7,7 @@ using System.Threading.Tasks; using Svelto.Tasks; using Svelto.Tasks.Enumerators; -namespace GamecraftModdingAPI.Tasks +namespace TechbloxModdingAPI.Tasks { /// /// An asynchronous repeating task. diff --git a/GamecraftModdingAPI/Tasks/Scheduler.cs b/TechbloxModdingAPI/Tasks/Scheduler.cs similarity index 98% rename from GamecraftModdingAPI/Tasks/Scheduler.cs rename to TechbloxModdingAPI/Tasks/Scheduler.cs index 803bd2f..af47d1d 100644 --- a/GamecraftModdingAPI/Tasks/Scheduler.cs +++ b/TechbloxModdingAPI/Tasks/Scheduler.cs @@ -7,7 +7,7 @@ using System.Threading.Tasks; using Svelto.Tasks.Lean; using Svelto.Tasks.ExtraLean; -namespace GamecraftModdingAPI.Tasks +namespace TechbloxModdingAPI.Tasks { /// /// Asynchronous task scheduling for ISchedulables. diff --git a/GamecraftModdingAPI/GamecraftModdingAPI.csproj b/TechbloxModdingAPI/TechbloxModdingAPI.csproj similarity index 99% rename from GamecraftModdingAPI/GamecraftModdingAPI.csproj rename to TechbloxModdingAPI/TechbloxModdingAPI.csproj index bd4135c..4624c80 100644 --- a/GamecraftModdingAPI/GamecraftModdingAPI.csproj +++ b/TechbloxModdingAPI/TechbloxModdingAPI.csproj @@ -8,6 +8,7 @@ https://git.exmods.org/modtainers/GamecraftModdingAPI en-CA true + GamecraftModdingAPI diff --git a/GamecraftModdingAPI/Tests/APITestAttributes.cs b/TechbloxModdingAPI/Tests/APITestAttributes.cs similarity index 97% rename from GamecraftModdingAPI/Tests/APITestAttributes.cs rename to TechbloxModdingAPI/Tests/APITestAttributes.cs index cf9da49..0ebe81d 100644 --- a/GamecraftModdingAPI/Tests/APITestAttributes.cs +++ b/TechbloxModdingAPI/Tests/APITestAttributes.cs @@ -1,5 +1,5 @@ using System; -namespace GamecraftModdingAPI.Tests +namespace TechbloxModdingAPI.Tests { /// /// Test type. diff --git a/GamecraftModdingAPI/Tests/Assert.cs b/TechbloxModdingAPI/Tests/Assert.cs similarity index 99% rename from GamecraftModdingAPI/Tests/Assert.cs rename to TechbloxModdingAPI/Tests/Assert.cs index edc1392..f71b132 100644 --- a/GamecraftModdingAPI/Tests/Assert.cs +++ b/TechbloxModdingAPI/Tests/Assert.cs @@ -5,7 +5,7 @@ using System.Runtime.CompilerServices; using Unity.Mathematics; -namespace GamecraftModdingAPI.Tests +namespace TechbloxModdingAPI.Tests { /// /// API test system assertion utilities. diff --git a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs b/TechbloxModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs similarity index 94% rename from GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs rename to TechbloxModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs index 75079a8..292f769 100644 --- a/GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs +++ b/TechbloxModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs @@ -6,7 +6,7 @@ using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Text; -using GamecraftModdingAPI.App; +using TechbloxModdingAPI.App; using HarmonyLib; using IllusionInjector; // test @@ -21,15 +21,8 @@ using UnityEngine; using RobocraftX.Schedulers; using Svelto.Tasks.ExtraLean; using uREPL; - -using GamecraftModdingAPI.Commands; -using GamecraftModdingAPI.Events; -using GamecraftModdingAPI.Utility; -using GamecraftModdingAPI.Blocks; -using GamecraftModdingAPI.Input; -using GamecraftModdingAPI.Interface.IMGUI; -using GamecraftModdingAPI.Players; -using GamecraftModdingAPI.Tasks; +using TechbloxModdingAPI.Interface.IMGUI; +using TechbloxModdingAPI.Tasks; using RobocraftX.Common.Input; using RobocraftX.CR.MainGame; using RobocraftX.GUI.CommandLine; @@ -38,23 +31,29 @@ using RobocraftX.StateSync; using Svelto.Context; using Svelto.DataStructures; using Svelto.Services; +using TechbloxModdingAPI.Blocks; +using TechbloxModdingAPI.Commands; +using TechbloxModdingAPI.Events; +using TechbloxModdingAPI.Input; +using TechbloxModdingAPI.Players; +using TechbloxModdingAPI.Utility; using UnityEngine.AddressableAssets; using UnityEngine.AddressableAssets.ResourceLocators; using UnityEngine.ResourceManagement.AsyncOperations; using UnityEngine.ResourceManagement.ResourceLocations; using UnityEngine.ResourceManagement.ResourceProviders; using Debug = FMOD.Debug; -using EventType = GamecraftModdingAPI.Events.EventType; -using Label = GamecraftModdingAPI.Interface.IMGUI.Label; +using EventType = TechbloxModdingAPI.Events.EventType; +using Label = TechbloxModdingAPI.Interface.IMGUI.Label; using ScalingPermission = DataLoader.ScalingPermission; -namespace GamecraftModdingAPI.Tests +namespace TechbloxModdingAPI.Tests { #if DEBUG // unused by design /// /// Modding API implemented as a standalone IPA Plugin. - /// Ideally, GamecraftModdingAPI should be loaded by another mod; not itself + /// Ideally, TechbloxModdingAPI should be loaded by another mod; not itself /// public class GamecraftModdingAPIPluginTest : IllusionPlugin.IEnhancedPlugin { @@ -69,14 +68,14 @@ namespace GamecraftModdingAPI.Tests public override void OnApplicationQuit() { - GamecraftModdingAPI.Main.Shutdown(); + Main.Shutdown(); } public override void OnApplicationStart() { FileLog.Reset(); Harmony.DEBUG = true; - GamecraftModdingAPI.Main.Init(); + Main.Init(); Logging.MetaDebugLog($"Version group id {(uint)ApiExclusiveGroups.versionGroup}"); // in case Steam is not installed/running // this will crash the game slightly later during startup @@ -173,7 +172,7 @@ namespace GamecraftModdingAPI.Tests foreach (var block in Block.GetLastPlacedBlock().GetConnectedCubes()) block.Position += new Unity.Mathematics.float3(x, y, z); else - GamecraftModdingAPI.Utility.Logging.CommandLogError("Blocks can only be moved in Build mode!"); + Logging.CommandLogError("Blocks can only be moved in Build mode!"); }).Build(); CommandBuilder.Builder() @@ -328,12 +327,12 @@ namespace GamecraftModdingAPI.Tests "SetFOV", "Set the player camera's field of view")); CommandManager.AddCommand(new SimpleCustomCommandEngine( (x, y, z) => { - bool success = GamecraftModdingAPI.Blocks.Movement.MoveConnectedBlocks( - GamecraftModdingAPI.Blocks.BlockIdentifiers.LatestBlockID, + bool success = TechbloxModdingAPI.Blocks.Movement.MoveConnectedBlocks( + TechbloxModdingAPI.Blocks.BlockIdentifiers.LatestBlockID, new Unity.Mathematics.float3(x, y, z)); if (!success) { - GamecraftModdingAPI.Utility.Logging.CommandLogError("Blocks can only be moved in Build mode!"); + TechbloxModdingAPI.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( diff --git a/GamecraftModdingAPI/Tests/TestRoot.cs b/TechbloxModdingAPI/Tests/TestRoot.cs similarity index 96% rename from GamecraftModdingAPI/Tests/TestRoot.cs rename to TechbloxModdingAPI/Tests/TestRoot.cs index 22f3035..878fdda 100644 --- a/GamecraftModdingAPI/Tests/TestRoot.cs +++ b/TechbloxModdingAPI/Tests/TestRoot.cs @@ -8,12 +8,11 @@ using Svelto.Tasks; using Svelto.Tasks.Lean; using Svelto.Tasks.Enumerators; using UnityEngine; +using TechbloxModdingAPI.App; +using TechbloxModdingAPI.Tasks; +using TechbloxModdingAPI.Utility; -using GamecraftModdingAPI.App; -using GamecraftModdingAPI.Tasks; -using GamecraftModdingAPI.Utility; - -namespace GamecraftModdingAPI.Tests +namespace TechbloxModdingAPI.Tests { /// /// API test system root class. @@ -276,7 +275,7 @@ namespace GamecraftModdingAPI.Tests /// /// Runs the tests. /// - /// Assembly to search for tests. When set to null, this uses the GamecraftModdingAPI assembly. + /// Assembly to search for tests. When set to null, this uses the TechbloxModdingAPI assembly. public static void RunTests(Assembly asm = null) { if (asm == null) asm = Assembly.GetExecutingAssembly(); @@ -285,7 +284,7 @@ namespace GamecraftModdingAPI.Tests // log metadata Assert.Log($"Unity {Application.unityVersion}"); Assert.Log($"Gamecraft {Application.version}"); - Assert.Log($"GamecraftModdingAPI {Assembly.GetExecutingAssembly().GetName().Version}"); + Assert.Log($"TechbloxModdingAPI {Assembly.GetExecutingAssembly().GetName().Version}"); Assert.Log($"Testing {asm.GetName().Name} {asm.GetName().Version}"); Assert.Log($"START: --- {DateTime.Now.ToString()} --- ({testTypes.Count} tests classes detected)"); StartUp(); diff --git a/GamecraftModdingAPI/Tests/TestTest.cs b/TechbloxModdingAPI/Tests/TestTest.cs similarity index 96% rename from GamecraftModdingAPI/Tests/TestTest.cs rename to TechbloxModdingAPI/Tests/TestTest.cs index 02eeda0..5e0ed46 100644 --- a/GamecraftModdingAPI/Tests/TestTest.cs +++ b/TechbloxModdingAPI/Tests/TestTest.cs @@ -4,7 +4,7 @@ using System.Reflection; using HarmonyLib; -namespace GamecraftModdingAPI.Tests +namespace TechbloxModdingAPI.Tests { #if TEST /// diff --git a/GamecraftModdingAPI/Utility/ApiExclusiveGroups.cs b/TechbloxModdingAPI/Utility/ApiExclusiveGroups.cs similarity index 74% rename from GamecraftModdingAPI/Utility/ApiExclusiveGroups.cs rename to TechbloxModdingAPI/Utility/ApiExclusiveGroups.cs index 8dc052d..a451673 100644 --- a/GamecraftModdingAPI/Utility/ApiExclusiveGroups.cs +++ b/TechbloxModdingAPI/Utility/ApiExclusiveGroups.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; using Svelto.ECS; -namespace GamecraftModdingAPI.Utility +namespace TechbloxModdingAPI.Utility { public static class ApiExclusiveGroups { @@ -18,7 +18,7 @@ namespace GamecraftModdingAPI.Utility { if (_eventsExclusiveGroup == null) { - _eventsExclusiveGroup = new ExclusiveGroup("GamecraftModdingAPI EventGroup"); + _eventsExclusiveGroup = new ExclusiveGroup("TechbloxModdingAPI EventGroup"); } return _eventsExclusiveGroup; } @@ -34,7 +34,7 @@ namespace GamecraftModdingAPI.Utility { if (_versionGroup == null) { - _versionGroup = new ExclusiveGroup("GamecraftModdingAPI VersionGroup"); + _versionGroup = new ExclusiveGroup("TechbloxModdingAPI VersionGroup"); } return _versionGroup; } @@ -47,7 +47,7 @@ namespace GamecraftModdingAPI.Utility get { if (_customBlockGroup == null) - _customBlockGroup = new ExclusiveGroup("GamecraftModdingAPI CustomBlockGroup"); + _customBlockGroup = new ExclusiveGroup("TechbloxModdingAPI CustomBlockGroup"); return _customBlockGroup; } } diff --git a/GamecraftModdingAPI/Utility/AsyncUtils.cs b/TechbloxModdingAPI/Utility/AsyncUtils.cs similarity index 95% rename from GamecraftModdingAPI/Utility/AsyncUtils.cs rename to TechbloxModdingAPI/Utility/AsyncUtils.cs index 8fed9ee..4894515 100644 --- a/GamecraftModdingAPI/Utility/AsyncUtils.cs +++ b/TechbloxModdingAPI/Utility/AsyncUtils.cs @@ -2,7 +2,7 @@ using Svelto.ECS; -namespace GamecraftModdingAPI.Utility +namespace TechbloxModdingAPI.Utility { public static class AsyncUtils { diff --git a/GamecraftModdingAPI/Utility/AsyncUtilsEngine.cs b/TechbloxModdingAPI/Utility/AsyncUtilsEngine.cs similarity index 96% rename from GamecraftModdingAPI/Utility/AsyncUtilsEngine.cs rename to TechbloxModdingAPI/Utility/AsyncUtilsEngine.cs index 7b6ef1e..b9e6ad3 100644 --- a/GamecraftModdingAPI/Utility/AsyncUtilsEngine.cs +++ b/TechbloxModdingAPI/Utility/AsyncUtilsEngine.cs @@ -4,10 +4,9 @@ using System.Threading.Tasks; using RobocraftX.Schedulers; using Svelto.ECS; using Svelto.Tasks.ExtraLean; +using TechbloxModdingAPI.Engines; -using GamecraftModdingAPI.Engines; - -namespace GamecraftModdingAPI.Utility +namespace TechbloxModdingAPI.Utility { public class AsyncUtilsEngine : IApiEngine { diff --git a/GamecraftModdingAPI/Utility/Audio.cs b/TechbloxModdingAPI/Utility/Audio.cs similarity index 97% rename from GamecraftModdingAPI/Utility/Audio.cs rename to TechbloxModdingAPI/Utility/Audio.cs index b2566f2..71b7f66 100644 --- a/GamecraftModdingAPI/Utility/Audio.cs +++ b/TechbloxModdingAPI/Utility/Audio.cs @@ -6,7 +6,7 @@ using FMODUnity; using RobocraftX.Common.Audio; using Unity.Mathematics; -namespace GamecraftModdingAPI.Utility +namespace TechbloxModdingAPI.Utility { public class Audio { diff --git a/GamecraftModdingAPI/Utility/AudioTools.cs b/TechbloxModdingAPI/Utility/AudioTools.cs similarity index 98% rename from GamecraftModdingAPI/Utility/AudioTools.cs rename to TechbloxModdingAPI/Utility/AudioTools.cs index 4d4af0d..6f78feb 100644 --- a/GamecraftModdingAPI/Utility/AudioTools.cs +++ b/TechbloxModdingAPI/Utility/AudioTools.cs @@ -7,7 +7,7 @@ using System.Threading.Tasks; using FMODUnity; using FMOD.Studio; -namespace GamecraftModdingAPI.Utility +namespace TechbloxModdingAPI.Utility { /// /// Common operations on audio objects diff --git a/GamecraftModdingAPI/Utility/DebugInterfaceEngine.cs b/TechbloxModdingAPI/Utility/DebugInterfaceEngine.cs similarity index 94% rename from GamecraftModdingAPI/Utility/DebugInterfaceEngine.cs rename to TechbloxModdingAPI/Utility/DebugInterfaceEngine.cs index 9c14075..24d59b3 100644 --- a/GamecraftModdingAPI/Utility/DebugInterfaceEngine.cs +++ b/TechbloxModdingAPI/Utility/DebugInterfaceEngine.cs @@ -5,15 +5,15 @@ using System.Reflection; using System.Reflection.Emit; using System.Text; using System.Text.Formatting; -using GamecraftModdingAPI.Blocks; -using GamecraftModdingAPI.Engines; -using GamecraftModdingAPI.Players; +using TechbloxModdingAPI.Blocks; +using TechbloxModdingAPI.Players; using HarmonyLib; using RobocraftX.GUI.Debug; using Svelto.ECS; using Svelto.ECS.Experimental; +using TechbloxModdingAPI.Engines; -namespace GamecraftModdingAPI.Utility +namespace TechbloxModdingAPI.Utility { public class DebugInterfaceEngine : IApiEngine { diff --git a/GamecraftModdingAPI/Utility/Dependency.cs b/TechbloxModdingAPI/Utility/Dependency.cs similarity index 98% rename from GamecraftModdingAPI/Utility/Dependency.cs rename to TechbloxModdingAPI/Utility/Dependency.cs index c7dd64d..3f33277 100644 --- a/GamecraftModdingAPI/Utility/Dependency.cs +++ b/TechbloxModdingAPI/Utility/Dependency.cs @@ -3,7 +3,7 @@ using IllusionInjector; using IllusionPlugin; -namespace GamecraftModdingAPI.Utility +namespace TechbloxModdingAPI.Utility { /// /// Simple plugin interaction operations diff --git a/GamecraftModdingAPI/Utility/ExceptionUtil.cs b/TechbloxModdingAPI/Utility/ExceptionUtil.cs similarity index 92% rename from GamecraftModdingAPI/Utility/ExceptionUtil.cs rename to TechbloxModdingAPI/Utility/ExceptionUtil.cs index 63d0fef..0809e43 100644 --- a/GamecraftModdingAPI/Utility/ExceptionUtil.cs +++ b/TechbloxModdingAPI/Utility/ExceptionUtil.cs @@ -1,7 +1,7 @@ using System; -using GamecraftModdingAPI.Events; +using TechbloxModdingAPI.Events; -namespace GamecraftModdingAPI.Utility +namespace TechbloxModdingAPI.Utility { public static class ExceptionUtil { diff --git a/GamecraftModdingAPI/Utility/FullGameFields.cs b/TechbloxModdingAPI/Utility/FullGameFields.cs similarity index 98% rename from GamecraftModdingAPI/Utility/FullGameFields.cs rename to TechbloxModdingAPI/Utility/FullGameFields.cs index ccf80de..e27f501 100644 --- a/GamecraftModdingAPI/Utility/FullGameFields.cs +++ b/TechbloxModdingAPI/Utility/FullGameFields.cs @@ -19,7 +19,7 @@ using UnityEngine; using Unity.Entities; using Unity.Physics.Systems; -namespace GamecraftModdingAPI.Utility +namespace TechbloxModdingAPI.Utility { /// /// Public access to the private variables in RobocraftX.FullGameCompositionRoot diff --git a/GamecraftModdingAPI/Utility/GameClient.cs b/TechbloxModdingAPI/Utility/GameClient.cs similarity index 93% rename from GamecraftModdingAPI/Utility/GameClient.cs rename to TechbloxModdingAPI/Utility/GameClient.cs index 98d8ccb..f63b270 100644 --- a/GamecraftModdingAPI/Utility/GameClient.cs +++ b/TechbloxModdingAPI/Utility/GameClient.cs @@ -1,7 +1,7 @@ using System; -using GamecraftModdingAPI.Blocks; +using TechbloxModdingAPI.Blocks; -namespace GamecraftModdingAPI.Utility +namespace TechbloxModdingAPI.Utility { public static class GameClient { diff --git a/GamecraftModdingAPI/Utility/GameEngineManager.cs b/TechbloxModdingAPI/Utility/GameEngineManager.cs similarity index 96% rename from GamecraftModdingAPI/Utility/GameEngineManager.cs rename to TechbloxModdingAPI/Utility/GameEngineManager.cs index cc4973f..603170c 100644 --- a/GamecraftModdingAPI/Utility/GameEngineManager.cs +++ b/TechbloxModdingAPI/Utility/GameEngineManager.cs @@ -5,10 +5,9 @@ using System.Text; using System.Threading.Tasks; using Svelto.ECS; +using TechbloxModdingAPI.Engines; -using GamecraftModdingAPI.Engines; - -namespace GamecraftModdingAPI.Utility +namespace TechbloxModdingAPI.Utility { /// /// Keeps track of custom game-modifying engines diff --git a/GamecraftModdingAPI/Utility/GameState.cs b/TechbloxModdingAPI/Utility/GameState.cs similarity index 97% rename from GamecraftModdingAPI/Utility/GameState.cs rename to TechbloxModdingAPI/Utility/GameState.cs index ed096c4..50dfb83 100644 --- a/GamecraftModdingAPI/Utility/GameState.cs +++ b/TechbloxModdingAPI/Utility/GameState.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace GamecraftModdingAPI.Utility +namespace TechbloxModdingAPI.Utility { /// /// Utility to get the state of the current Gamecraft game diff --git a/GamecraftModdingAPI/Utility/GameStateEngine.cs b/TechbloxModdingAPI/Utility/GameStateEngine.cs similarity index 92% rename from GamecraftModdingAPI/Utility/GameStateEngine.cs rename to TechbloxModdingAPI/Utility/GameStateEngine.cs index be20ba1..3861d00 100644 --- a/GamecraftModdingAPI/Utility/GameStateEngine.cs +++ b/TechbloxModdingAPI/Utility/GameStateEngine.cs @@ -6,10 +6,9 @@ using System.Text; using System.Threading.Tasks; using RobocraftX.SimulationModeState; +using TechbloxModdingAPI.Engines; -using GamecraftModdingAPI.Engines; - -namespace GamecraftModdingAPI.Utility +namespace TechbloxModdingAPI.Utility { class GameStateEngine : IApiEngine { diff --git a/GamecraftModdingAPI/Utility/Logging.cs b/TechbloxModdingAPI/Utility/Logging.cs similarity index 99% rename from GamecraftModdingAPI/Utility/Logging.cs rename to TechbloxModdingAPI/Utility/Logging.cs index 80ef323..d28fd76 100644 --- a/GamecraftModdingAPI/Utility/Logging.cs +++ b/TechbloxModdingAPI/Utility/Logging.cs @@ -6,7 +6,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace GamecraftModdingAPI.Utility +namespace TechbloxModdingAPI.Utility { /// /// Utility class to access Gamecraft's built-in logging capabilities. diff --git a/GamecraftModdingAPI/Utility/MenuEngineManager.cs b/TechbloxModdingAPI/Utility/MenuEngineManager.cs similarity index 96% rename from GamecraftModdingAPI/Utility/MenuEngineManager.cs rename to TechbloxModdingAPI/Utility/MenuEngineManager.cs index 9be203d..c3dd29c 100644 --- a/GamecraftModdingAPI/Utility/MenuEngineManager.cs +++ b/TechbloxModdingAPI/Utility/MenuEngineManager.cs @@ -5,10 +5,9 @@ using System.Text; using System.Threading.Tasks; using Svelto.ECS; +using TechbloxModdingAPI.Engines; -using GamecraftModdingAPI.Engines; - -namespace GamecraftModdingAPI.Utility +namespace TechbloxModdingAPI.Utility { /// /// Keeps track of custom menu-modifying engines diff --git a/GamecraftModdingAPI/Utility/OptionalRef.cs b/TechbloxModdingAPI/Utility/OptionalRef.cs similarity index 96% rename from GamecraftModdingAPI/Utility/OptionalRef.cs rename to TechbloxModdingAPI/Utility/OptionalRef.cs index 4ac293d..7210d22 100644 --- a/GamecraftModdingAPI/Utility/OptionalRef.cs +++ b/TechbloxModdingAPI/Utility/OptionalRef.cs @@ -3,11 +3,11 @@ using System.Collections; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; -using GamecraftModdingAPI.Blocks; +using TechbloxModdingAPI.Blocks; using Svelto.DataStructures; using Svelto.ECS; -namespace GamecraftModdingAPI +namespace TechbloxModdingAPI { public struct OptionalRef where T : unmanaged { diff --git a/GamecraftModdingAPI/Utility/VersionTracking.cs b/TechbloxModdingAPI/Utility/VersionTracking.cs similarity index 96% rename from GamecraftModdingAPI/Utility/VersionTracking.cs rename to TechbloxModdingAPI/Utility/VersionTracking.cs index 32b86dc..82d39d3 100644 --- a/GamecraftModdingAPI/Utility/VersionTracking.cs +++ b/TechbloxModdingAPI/Utility/VersionTracking.cs @@ -4,11 +4,10 @@ using System.Reflection; using RobocraftX.Common; using Svelto.ECS; using Svelto.ECS.Serialization; +using TechbloxModdingAPI.Events; +using TechbloxModdingAPI.Persistence; -using GamecraftModdingAPI.Persistence; -using GamecraftModdingAPI.Events; - -namespace GamecraftModdingAPI.Utility +namespace TechbloxModdingAPI.Utility { /// /// Tracks the API version the current game was built for. -- 2.30.2 From c914b5b393ffe841dbf3feb3db46dfb69be414eb Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sun, 2 May 2021 01:56:20 +0200 Subject: [PATCH 167/252] Renamed all references of Gamecraft to Techblox Except those that actually refer to the game's code --- ...ftModdingAPI.sln => TechbloxModdingAPI.sln | 0 TechbloxModdingAPI/App/AppEngine.cs | 2 +- TechbloxModdingAPI/App/AppExceptions.cs | 2 +- TechbloxModdingAPI/App/Client.cs | 8 +++--- TechbloxModdingAPI/App/Game.cs | 2 +- .../App/GameBuildSimEventEngine.cs | 2 +- TechbloxModdingAPI/App/GameGameEngine.cs | 2 +- TechbloxModdingAPI/App/GameMenuEngine.cs | 2 +- TechbloxModdingAPI/Blocks/BlockCloneEngine.cs | 2 +- TechbloxModdingAPI/Blocks/BlockEngine.cs | 2 +- .../Blocks/BlockEventsEngine.cs | 2 +- TechbloxModdingAPI/Blocks/BlockExceptions.cs | 2 +- TechbloxModdingAPI/Blocks/BlockIDs.cs | 2 +- TechbloxModdingAPI/Blocks/BlueprintEngine.cs | 2 +- .../Blocks/CustomBlockEngine.cs | 4 +-- TechbloxModdingAPI/Blocks/MovementEngine.cs | 2 +- TechbloxModdingAPI/Blocks/PlacementEngine.cs | 2 +- TechbloxModdingAPI/Blocks/RemovalEngine.cs | 2 +- TechbloxModdingAPI/Blocks/RotationEngine.cs | 2 +- TechbloxModdingAPI/Blocks/ScalingEngine.cs | 2 +- TechbloxModdingAPI/Blocks/SignalEngine.cs | 2 +- .../Commands/CommandExceptions.cs | 2 +- .../Commands/CommandRegistrationHelper.cs | 2 +- TechbloxModdingAPI/Events/EventExceptions.cs | 2 +- .../Events/GameActivatedComposePatch.cs | 6 ++-- .../Events/GameStateBuildEmitterEngine.cs | 2 +- .../GameStateSimulationEmitterEngine.cs | 2 +- .../Events/MenuActivatedPatch.cs | 4 +-- .../Events/MenuSwitchedToPatch.cs | 2 +- .../GamecraftModdingAPIException.cs | 10 +++---- TechbloxModdingAPI/Input/FakeInputEngine.cs | 2 +- .../Interface/IMGUI/Constants.cs | 6 ++-- .../Interface/IMGUI/IMGUIManager.cs | 2 +- TechbloxModdingAPI/Inventory/HotbarEngine.cs | 2 +- TechbloxModdingAPI/Main.cs | 20 ++++++------- .../DeserializeFromDiskEntitiesEnginePatch.cs | 2 +- .../Persistence/IEntitySerializer.cs | 2 +- .../Persistence/SaveGameEnginePatch.cs | 2 +- .../Persistence/SerializerManager.cs | 2 +- TechbloxModdingAPI/Players/PlayerEngine.cs | 2 +- .../Players/PlayerExceptions.cs | 2 +- TechbloxModdingAPI/Tasks/Scheduler.cs | 6 ++-- TechbloxModdingAPI/TechbloxModdingAPI.csproj | 1 - .../Tests/GamecraftModdingAPIPluginTest.cs | 12 ++++---- TechbloxModdingAPI/Tests/TestRoot.cs | 4 +-- .../Utility/AsyncUtilsEngine.cs | 2 +- .../Utility/DebugInterfaceEngine.cs | 2 +- TechbloxModdingAPI/Utility/GameState.cs | 4 +-- TechbloxModdingAPI/Utility/GameStateEngine.cs | 2 +- TechbloxModdingAPI/Utility/Logging.cs | 28 +++++++++---------- TechbloxModdingAPI/Utility/VersionTracking.cs | 4 +-- 51 files changed, 94 insertions(+), 95 deletions(-) rename GamecraftModdingAPI.sln => TechbloxModdingAPI.sln (100%) diff --git a/GamecraftModdingAPI.sln b/TechbloxModdingAPI.sln similarity index 100% rename from GamecraftModdingAPI.sln rename to TechbloxModdingAPI.sln diff --git a/TechbloxModdingAPI/App/AppEngine.cs b/TechbloxModdingAPI/App/AppEngine.cs index d14f932..74c0d22 100644 --- a/TechbloxModdingAPI/App/AppEngine.cs +++ b/TechbloxModdingAPI/App/AppEngine.cs @@ -16,7 +16,7 @@ namespace TechbloxModdingAPI.App public IEntityFactory Factory { set; private get; } - public string Name => "GamecraftModdingAPIAppEngine"; + public string Name => "TechbloxModdingAPIAppEngine"; public bool isRemovable => false; diff --git a/TechbloxModdingAPI/App/AppExceptions.cs b/TechbloxModdingAPI/App/AppExceptions.cs index b3393cb..dfe3afe 100644 --- a/TechbloxModdingAPI/App/AppExceptions.cs +++ b/TechbloxModdingAPI/App/AppExceptions.cs @@ -3,7 +3,7 @@ using System.Runtime.Serialization; namespace TechbloxModdingAPI.App { - public class AppException : GamecraftModdingAPIException + public class AppException : TechbloxModdingAPIException { public AppException() { diff --git a/TechbloxModdingAPI/App/Client.cs b/TechbloxModdingAPI/App/Client.cs index 4887448..420f004 100644 --- a/TechbloxModdingAPI/App/Client.cs +++ b/TechbloxModdingAPI/App/Client.cs @@ -10,7 +10,7 @@ using TechbloxModdingAPI.Utility; namespace TechbloxModdingAPI.App { /// - /// The Gamecraft application that is running this code right now. + /// The Techblox application that is running this code right now. /// public class Client { @@ -42,7 +42,7 @@ namespace TechbloxModdingAPI.App } /// - /// Gamecraft build version string. + /// Techblox build version string. /// Usually this is in the form YYYY.mm.DD.HH.MM.SS /// /// The version. @@ -75,7 +75,7 @@ namespace TechbloxModdingAPI.App } /// - /// Whether Gamecraft is in the Main Menu + /// Whether Techblox is in the Main Menu /// /// true if in menu; false when loading or in a game. public bool InMenu @@ -85,7 +85,7 @@ namespace TechbloxModdingAPI.App /// /// Open a popup which prompts the user to click a button. - /// This reuses Gamecraft's error dialog popup + /// This reuses Techblox's error dialog popup /// /// The popup to display. Use an instance of SingleChoicePrompt or DualChoicePrompt. public void PromptUser(Error popup) diff --git a/TechbloxModdingAPI/App/Game.cs b/TechbloxModdingAPI/App/Game.cs index a3099eb..252171d 100644 --- a/TechbloxModdingAPI/App/Game.cs +++ b/TechbloxModdingAPI/App/Game.cs @@ -118,7 +118,7 @@ namespace TechbloxModdingAPI.App /// /// An event that fires right before a game returns to the main menu. - /// At this point, Gamecraft is transitioning state so many things are invalid/unstable here. + /// At this point, Techblox is transitioning state so many things are invalid/unstable here. /// public static event EventHandler Exit { diff --git a/TechbloxModdingAPI/App/GameBuildSimEventEngine.cs b/TechbloxModdingAPI/App/GameBuildSimEventEngine.cs index f4b5766..f710d6f 100644 --- a/TechbloxModdingAPI/App/GameBuildSimEventEngine.cs +++ b/TechbloxModdingAPI/App/GameBuildSimEventEngine.cs @@ -15,7 +15,7 @@ namespace TechbloxModdingAPI.App public event EventHandler BuildMode; - public string Name => "GamecraftModdingAPIBuildSimEventGameEngine"; + public string Name => "TechbloxModdingAPIBuildSimEventGameEngine"; public bool isRemovable => false; diff --git a/TechbloxModdingAPI/App/GameGameEngine.cs b/TechbloxModdingAPI/App/GameGameEngine.cs index d5a2f60..1ed4d48 100644 --- a/TechbloxModdingAPI/App/GameGameEngine.cs +++ b/TechbloxModdingAPI/App/GameGameEngine.cs @@ -22,7 +22,7 @@ namespace TechbloxModdingAPI.App public event EventHandler ExitGame; - public string Name => "GamecraftModdingAPIGameInfoMenuEngine"; + public string Name => "TechbloxModdingAPIGameInfoMenuEngine"; public bool isRemovable => false; diff --git a/TechbloxModdingAPI/App/GameMenuEngine.cs b/TechbloxModdingAPI/App/GameMenuEngine.cs index 9fce3b7..3357984 100644 --- a/TechbloxModdingAPI/App/GameMenuEngine.cs +++ b/TechbloxModdingAPI/App/GameMenuEngine.cs @@ -17,7 +17,7 @@ namespace TechbloxModdingAPI.App { public IEntityFactory Factory { set; private get; } - public string Name => "GamecraftModdingAPIGameInfoGameEngine"; + public string Name => "TechbloxModdingAPIGameInfoGameEngine"; public bool isRemovable => false; diff --git a/TechbloxModdingAPI/Blocks/BlockCloneEngine.cs b/TechbloxModdingAPI/Blocks/BlockCloneEngine.cs index 8703953..e1501e8 100644 --- a/TechbloxModdingAPI/Blocks/BlockCloneEngine.cs +++ b/TechbloxModdingAPI/Blocks/BlockCloneEngine.cs @@ -100,7 +100,7 @@ namespace TechbloxModdingAPI.Blocks } } - public string Name { get; } = "GamecraftModdingAPIBlockCloneGameEngine"; + public string Name { get; } = "TechbloxModdingAPIBlockCloneGameEngine"; public bool isRemovable { get; } = false; } } \ No newline at end of file diff --git a/TechbloxModdingAPI/Blocks/BlockEngine.cs b/TechbloxModdingAPI/Blocks/BlockEngine.cs index 956871b..404e72a 100644 --- a/TechbloxModdingAPI/Blocks/BlockEngine.cs +++ b/TechbloxModdingAPI/Blocks/BlockEngine.cs @@ -24,7 +24,7 @@ namespace TechbloxModdingAPI.Blocks /// public partial class BlockEngine : IApiEngine { - public string Name { get; } = "GamecraftModdingAPIBlockGameEngine"; + public string Name { get; } = "TechbloxModdingAPIBlockGameEngine"; public EntitiesDB entitiesDB { set; private get; } diff --git a/TechbloxModdingAPI/Blocks/BlockEventsEngine.cs b/TechbloxModdingAPI/Blocks/BlockEventsEngine.cs index f89768b..3b77075 100644 --- a/TechbloxModdingAPI/Blocks/BlockEventsEngine.cs +++ b/TechbloxModdingAPI/Blocks/BlockEventsEngine.cs @@ -23,7 +23,7 @@ namespace TechbloxModdingAPI.Blocks { } - public string Name { get; } = "GamecraftModdingAPIBlockEventsEngine"; + public string Name { get; } = "TechbloxModdingAPIBlockEventsEngine"; public bool isRemovable { get; } = false; private bool shouldAddRemove; diff --git a/TechbloxModdingAPI/Blocks/BlockExceptions.cs b/TechbloxModdingAPI/Blocks/BlockExceptions.cs index 409bb02..4029185 100644 --- a/TechbloxModdingAPI/Blocks/BlockExceptions.cs +++ b/TechbloxModdingAPI/Blocks/BlockExceptions.cs @@ -4,7 +4,7 @@ using TechbloxModdingAPI; namespace TechbloxModdingAPI.Blocks { - public class BlockException : GamecraftModdingAPIException + public class BlockException : TechbloxModdingAPIException { public BlockException() { diff --git a/TechbloxModdingAPI/Blocks/BlockIDs.cs b/TechbloxModdingAPI/Blocks/BlockIDs.cs index 30fa76f..fcb3e41 100644 --- a/TechbloxModdingAPI/Blocks/BlockIDs.cs +++ b/TechbloxModdingAPI/Blocks/BlockIDs.cs @@ -6,7 +6,7 @@ namespace TechbloxModdingAPI.Blocks public enum BlockIDs : ushort { /// - /// Called "nothing" in Gamecraft. (DBID.NOTHING) + /// Called "nothing" in Techblox. (DBID.NOTHING) /// Invalid = ushort.MaxValue, Cube = 0, diff --git a/TechbloxModdingAPI/Blocks/BlueprintEngine.cs b/TechbloxModdingAPI/Blocks/BlueprintEngine.cs index 19e0afc..a6f65f3 100644 --- a/TechbloxModdingAPI/Blocks/BlueprintEngine.cs +++ b/TechbloxModdingAPI/Blocks/BlueprintEngine.cs @@ -248,7 +248,7 @@ namespace TechbloxModdingAPI.Blocks clipboardManager.DecrementRefCount(blueprintID); } - public string Name { get; } = "GamecraftModdingAPIBlueprintGameEngine"; + public string Name { get; } = "TechbloxModdingAPIBlueprintGameEngine"; public bool isRemovable { get; } = false; [HarmonyPatch] diff --git a/TechbloxModdingAPI/Blocks/CustomBlockEngine.cs b/TechbloxModdingAPI/Blocks/CustomBlockEngine.cs index ef3c1e5..b8132a2 100644 --- a/TechbloxModdingAPI/Blocks/CustomBlockEngine.cs +++ b/TechbloxModdingAPI/Blocks/CustomBlockEngine.cs @@ -14,7 +14,7 @@ namespace TechbloxModdingAPI.Blocks { public class CustomBlockEntityDescriptor : SerializableEntityDescriptor { - [HashName("GamecraftModdingAPICustomBlockV0")] + [HashName("TechbloxModdingAPICustomBlockV0")] public class _CustomBlockDescriptor : IEntityDescriptor { public IComponentBuilder[] componentsToBuild { get; } = @@ -57,7 +57,7 @@ namespace TechbloxModdingAPI.Blocks _registeredBlocks.Add((id, name)); } - public string Name { get; } = "GamecraftModdingAPICustomBlockEngine"; + public string Name { get; } = "TechbloxModdingAPICustomBlockEngine"; public bool isRemovable { get; } = false; public IEntityFactory Factory { get; set; } }*/ diff --git a/TechbloxModdingAPI/Blocks/MovementEngine.cs b/TechbloxModdingAPI/Blocks/MovementEngine.cs index b01b714..aeeac20 100644 --- a/TechbloxModdingAPI/Blocks/MovementEngine.cs +++ b/TechbloxModdingAPI/Blocks/MovementEngine.cs @@ -14,7 +14,7 @@ namespace TechbloxModdingAPI.Blocks /// public class MovementEngine : IApiEngine { - public string Name { get; } = "GamecraftModdingAPIMovementGameEngine"; + public string Name { get; } = "TechbloxModdingAPIMovementGameEngine"; public EntitiesDB entitiesDB { set; private get; } diff --git a/TechbloxModdingAPI/Blocks/PlacementEngine.cs b/TechbloxModdingAPI/Blocks/PlacementEngine.cs index 38e27f1..afd5574 100644 --- a/TechbloxModdingAPI/Blocks/PlacementEngine.cs +++ b/TechbloxModdingAPI/Blocks/PlacementEngine.cs @@ -80,7 +80,7 @@ namespace TechbloxModdingAPI.Blocks return structInitializer; } - public string Name => "GamecraftModdingAPIPlacementGameEngine"; + public string Name => "TechbloxModdingAPIPlacementGameEngine"; public bool isRemovable => false; diff --git a/TechbloxModdingAPI/Blocks/RemovalEngine.cs b/TechbloxModdingAPI/Blocks/RemovalEngine.cs index 08216fc..858cb8f 100644 --- a/TechbloxModdingAPI/Blocks/RemovalEngine.cs +++ b/TechbloxModdingAPI/Blocks/RemovalEngine.cs @@ -38,7 +38,7 @@ namespace TechbloxModdingAPI.Blocks { } - public string Name { get; } = "GamecraftModdingAPIRemovalGameEngine"; + public string Name { get; } = "TechbloxModdingAPIRemovalGameEngine"; public bool isRemovable => false; diff --git a/TechbloxModdingAPI/Blocks/RotationEngine.cs b/TechbloxModdingAPI/Blocks/RotationEngine.cs index 1f35d17..cef4691 100644 --- a/TechbloxModdingAPI/Blocks/RotationEngine.cs +++ b/TechbloxModdingAPI/Blocks/RotationEngine.cs @@ -14,7 +14,7 @@ namespace TechbloxModdingAPI.Blocks /// public class RotationEngine : IApiEngine { - public string Name { get; } = "GamecraftModdingAPIRotationGameEngine"; + public string Name { get; } = "TechbloxModdingAPIRotationGameEngine"; public EntitiesDB entitiesDB { set; private get; } diff --git a/TechbloxModdingAPI/Blocks/ScalingEngine.cs b/TechbloxModdingAPI/Blocks/ScalingEngine.cs index 81131e6..7485f7e 100644 --- a/TechbloxModdingAPI/Blocks/ScalingEngine.cs +++ b/TechbloxModdingAPI/Blocks/ScalingEngine.cs @@ -23,7 +23,7 @@ namespace TechbloxModdingAPI.Blocks { } - public string Name { get; } = "GamecraftModdingAPIScalingEngine"; + public string Name { get; } = "TechbloxModdingAPIScalingEngine"; public bool isRemovable { get; } = false; private EntityManager _entityManager; //Unity entity manager diff --git a/TechbloxModdingAPI/Blocks/SignalEngine.cs b/TechbloxModdingAPI/Blocks/SignalEngine.cs index 3b1cf6a..6e40af1 100644 --- a/TechbloxModdingAPI/Blocks/SignalEngine.cs +++ b/TechbloxModdingAPI/Blocks/SignalEngine.cs @@ -16,7 +16,7 @@ namespace TechbloxModdingAPI.Blocks public const float HIGH = 1.0f; public const float ZERO = 0.0f; - public string Name { get; } = "GamecraftModdingAPISignalGameEngine"; + public string Name { get; } = "TechbloxModdingAPISignalGameEngine"; public EntitiesDB entitiesDB { set; private get; } diff --git a/TechbloxModdingAPI/Commands/CommandExceptions.cs b/TechbloxModdingAPI/Commands/CommandExceptions.cs index 4141a9f..b860093 100644 --- a/TechbloxModdingAPI/Commands/CommandExceptions.cs +++ b/TechbloxModdingAPI/Commands/CommandExceptions.cs @@ -1,7 +1,7 @@ using System; namespace TechbloxModdingAPI.Commands { - public class CommandException : GamecraftModdingAPIException + public class CommandException : TechbloxModdingAPIException { public CommandException() : base() {} diff --git a/TechbloxModdingAPI/Commands/CommandRegistrationHelper.cs b/TechbloxModdingAPI/Commands/CommandRegistrationHelper.cs index 633bf75..850322a 100644 --- a/TechbloxModdingAPI/Commands/CommandRegistrationHelper.cs +++ b/TechbloxModdingAPI/Commands/CommandRegistrationHelper.cs @@ -10,7 +10,7 @@ using RobocraftX.CommandLine.Custom; namespace TechbloxModdingAPI.Commands { /// - /// Convenient methods for registering commands to Gamecraft. + /// Convenient methods for registering commands to Techblox. /// All methods register to the command line and console block by default. /// public static class CommandRegistrationHelper diff --git a/TechbloxModdingAPI/Events/EventExceptions.cs b/TechbloxModdingAPI/Events/EventExceptions.cs index a796752..1b1d5b3 100644 --- a/TechbloxModdingAPI/Events/EventExceptions.cs +++ b/TechbloxModdingAPI/Events/EventExceptions.cs @@ -1,7 +1,7 @@ using System; namespace TechbloxModdingAPI.Events { - public class EventException : GamecraftModdingAPIException + public class EventException : TechbloxModdingAPIException { public EventException() { diff --git a/TechbloxModdingAPI/Events/GameActivatedComposePatch.cs b/TechbloxModdingAPI/Events/GameActivatedComposePatch.cs index 62b5666..8a32f37 100644 --- a/TechbloxModdingAPI/Events/GameActivatedComposePatch.cs +++ b/TechbloxModdingAPI/Events/GameActivatedComposePatch.cs @@ -34,18 +34,18 @@ namespace TechbloxModdingAPI.Events // so all event emitters and handlers must be re-registered. EventManager.RegisterEngines(enginesRoot); Logging.Log("Dispatching Game Activated event"); - EventManager.GetEventEmitter("GamecraftModdingAPIGameActivatedEventEmitter").Emit(); + EventManager.GetEventEmitter("TechbloxModdingAPIGameActivatedEventEmitter").Emit(); if (IsGameSwitching) { IsGameSwitching = false; Logging.Log("Dispatching Game Switched To event"); - EventManager.GetEventEmitter("GamecraftModdingAPIGameSwitchedToEventEmitter").Emit(); + EventManager.GetEventEmitter("TechbloxModdingAPIGameSwitchedToEventEmitter").Emit(); } if (IsGameReloading) { IsGameReloading = false; Logging.Log("Dispatching Game Reloaded event"); - EventManager.GetEventEmitter("GamecraftModdingAPIGameReloadedEventEmitter").Emit(); + EventManager.GetEventEmitter("TechbloxModdingAPIGameReloadedEventEmitter").Emit(); } } diff --git a/TechbloxModdingAPI/Events/GameStateBuildEmitterEngine.cs b/TechbloxModdingAPI/Events/GameStateBuildEmitterEngine.cs index 29fb418..8dd5d8b 100644 --- a/TechbloxModdingAPI/Events/GameStateBuildEmitterEngine.cs +++ b/TechbloxModdingAPI/Events/GameStateBuildEmitterEngine.cs @@ -14,7 +14,7 @@ namespace TechbloxModdingAPI.Events [Obsolete] public class GameStateBuildEmitterEngine : IEventEmitterEngine, IUnorderedInitializeOnTimeStoppedModeEntered { - public string Name { get; } = "GamecraftModdingAPIGameStateBuildEventEmitter" ; + public string Name { get; } = "TechbloxModdingAPIGameStateBuildEventEmitter" ; public EntitiesDB entitiesDB { set; private get; } diff --git a/TechbloxModdingAPI/Events/GameStateSimulationEmitterEngine.cs b/TechbloxModdingAPI/Events/GameStateSimulationEmitterEngine.cs index add45d5..c682812 100644 --- a/TechbloxModdingAPI/Events/GameStateSimulationEmitterEngine.cs +++ b/TechbloxModdingAPI/Events/GameStateSimulationEmitterEngine.cs @@ -14,7 +14,7 @@ namespace TechbloxModdingAPI.Events [Obsolete] public class GameStateSimulationEmitterEngine : IEventEmitterEngine, IUnorderedInitializeOnTimeRunningModeEntered { - public string Name { get; } = "GamecraftModdingAPIGameStateSimulationEventEmitter" ; + public string Name { get; } = "TechbloxModdingAPIGameStateSimulationEventEmitter" ; public EntitiesDB entitiesDB { set; private get; } diff --git a/TechbloxModdingAPI/Events/MenuActivatedPatch.cs b/TechbloxModdingAPI/Events/MenuActivatedPatch.cs index 64aa57f..0951752 100644 --- a/TechbloxModdingAPI/Events/MenuActivatedPatch.cs +++ b/TechbloxModdingAPI/Events/MenuActivatedPatch.cs @@ -33,10 +33,10 @@ namespace TechbloxModdingAPI.Events FullGameFields.Init(__instance); //Application.Application.SetFullGameCompositionRoot(__instance); Logging.Log("Dispatching App Init event"); - EventManager.GetEventEmitter("GamecraftModdingAPIApplicationInitializedEventEmitter").Emit(); + EventManager.GetEventEmitter("TechbloxModdingAPIApplicationInitializedEventEmitter").Emit(); } Logging.Log("Dispatching Menu Activated event"); - EventManager.GetEventEmitter("GamecraftModdingAPIMenuActivatedEventEmitter").Emit(); + EventManager.GetEventEmitter("TechbloxModdingAPIMenuActivatedEventEmitter").Emit(); } } } diff --git a/TechbloxModdingAPI/Events/MenuSwitchedToPatch.cs b/TechbloxModdingAPI/Events/MenuSwitchedToPatch.cs index c8fec0a..23c4b77 100644 --- a/TechbloxModdingAPI/Events/MenuSwitchedToPatch.cs +++ b/TechbloxModdingAPI/Events/MenuSwitchedToPatch.cs @@ -22,7 +22,7 @@ namespace TechbloxModdingAPI.Events { // Event emitters and handlers should already be registered by MenuActivated event Logging.Log("Dispatching Menu Switched To event"); - EventManager.GetEventEmitter("GamecraftModdingAPIMenuSwitchedToEventEmitter").Emit(); + EventManager.GetEventEmitter("TechbloxModdingAPIMenuSwitchedToEventEmitter").Emit(); } } } diff --git a/TechbloxModdingAPI/GamecraftModdingAPIException.cs b/TechbloxModdingAPI/GamecraftModdingAPIException.cs index 0b4f7d5..3a1b73f 100644 --- a/TechbloxModdingAPI/GamecraftModdingAPIException.cs +++ b/TechbloxModdingAPI/GamecraftModdingAPIException.cs @@ -3,21 +3,21 @@ using System.Runtime.Serialization; namespace TechbloxModdingAPI { - public class GamecraftModdingAPIException : Exception + public class TechbloxModdingAPIException : Exception { - public GamecraftModdingAPIException() + public TechbloxModdingAPIException() { } - public GamecraftModdingAPIException(string message) : base(message) + public TechbloxModdingAPIException(string message) : base(message) { } - public GamecraftModdingAPIException(string message, Exception innerException) : base(message, innerException) + public TechbloxModdingAPIException(string message, Exception innerException) : base(message, innerException) { } - protected GamecraftModdingAPIException(SerializationInfo info, StreamingContext context) : base(info, context) + protected TechbloxModdingAPIException(SerializationInfo info, StreamingContext context) : base(info, context) { } } diff --git a/TechbloxModdingAPI/Input/FakeInputEngine.cs b/TechbloxModdingAPI/Input/FakeInputEngine.cs index 0a41fb2..7d2efb7 100644 --- a/TechbloxModdingAPI/Input/FakeInputEngine.cs +++ b/TechbloxModdingAPI/Input/FakeInputEngine.cs @@ -12,7 +12,7 @@ namespace TechbloxModdingAPI.Input { public class FakeInputEngine : IApiEngine { - public string Name { get; } = "GamecraftModdingAPIFakeInputEngine"; + public string Name { get; } = "TechbloxModdingAPIFakeInputEngine"; public EntitiesDB entitiesDB { set; private get; } diff --git a/TechbloxModdingAPI/Interface/IMGUI/Constants.cs b/TechbloxModdingAPI/Interface/IMGUI/Constants.cs index a34d8fe..a966a5f 100644 --- a/TechbloxModdingAPI/Interface/IMGUI/Constants.cs +++ b/TechbloxModdingAPI/Interface/IMGUI/Constants.cs @@ -22,9 +22,9 @@ namespace TechbloxModdingAPI.Interface.IMGUI private static GUISkin _default = null; /// - /// Best-effort imitation of Gamecraft's UI style. + /// Best-effort imitation of Techblox's UI style. /// - public static GUISkin Default + public static GUISkin Default //TODO: Update to Techblox style { get { @@ -122,7 +122,7 @@ namespace TechbloxModdingAPI.Interface.IMGUI _defaultCompletion++; }; _blueBackground = new Texture2D(1, 1); - _blueBackground.SetPixel(0, 0, new Color(0.004f, 0.522f, 0.847f) /* Gamecraft Blue */); + _blueBackground.SetPixel(0, 0, new Color(0.004f, 0.522f, 0.847f) /* Techblox Blue */); _blueBackground.Apply(); _grayBackground = new Texture2D(1, 1); _grayBackground.SetPixel(0, 0, new Color(0.745f, 0.745f, 0.745f) /* Gray */); diff --git a/TechbloxModdingAPI/Interface/IMGUI/IMGUIManager.cs b/TechbloxModdingAPI/Interface/IMGUI/IMGUIManager.cs index d4f3bb7..8b3c865 100644 --- a/TechbloxModdingAPI/Interface/IMGUI/IMGUIManager.cs +++ b/TechbloxModdingAPI/Interface/IMGUI/IMGUIManager.cs @@ -20,7 +20,7 @@ namespace TechbloxModdingAPI.Interface.IMGUI /// public static class IMGUIManager { - internal static OnGuiRunner ImguiScheduler = new OnGuiRunner("GamecraftModdingAPI_IMGUIScheduler"); + internal static OnGuiRunner ImguiScheduler = new OnGuiRunner("TechbloxModdingAPI_IMGUIScheduler"); private static Dictionary _activeElements = new Dictionary(); diff --git a/TechbloxModdingAPI/Inventory/HotbarEngine.cs b/TechbloxModdingAPI/Inventory/HotbarEngine.cs index 764f535..66f8c78 100644 --- a/TechbloxModdingAPI/Inventory/HotbarEngine.cs +++ b/TechbloxModdingAPI/Inventory/HotbarEngine.cs @@ -18,7 +18,7 @@ namespace TechbloxModdingAPI.Inventory { public class HotbarEngine : IApiEngine { - public string Name { get; } = "GamecraftModdingAPIHotbarGameEngine"; + public string Name { get; } = "TechbloxModdingAPIHotbarGameEngine"; public EntitiesDB entitiesDB { set; private get; } diff --git a/TechbloxModdingAPI/Main.cs b/TechbloxModdingAPI/Main.cs index b81e127..da66884 100644 --- a/TechbloxModdingAPI/Main.cs +++ b/TechbloxModdingAPI/Main.cs @@ -31,7 +31,7 @@ namespace TechbloxModdingAPI /// /// Initializes the TechbloxModdingAPI. - /// Call this as soon as possible after Gamecraft starts up. + /// Call this as soon as possible after Techblox starts up. /// Ideally, this should be called from your main Plugin class's OnApplicationStart() method. /// public static void Init() @@ -43,7 +43,7 @@ namespace TechbloxModdingAPI Logging.LogWarning("TechbloxModdingAPI.Main.Init() called but API is already initialized!"); return; } - Logging.MetaDebugLog($"Patching Gamecraft"); + Logging.MetaDebugLog($"Patching Techblox"); var currentAssembly = Assembly.GetExecutingAssembly(); harmony = new Harmony(currentAssembly.GetName().Name); try @@ -53,7 +53,7 @@ namespace TechbloxModdingAPI catch (Exception e) { //Can't use ErrorBuilder or Logging.LogException (which eventually uses ErrorBuilder) yet Logging.Log(e.ToString()); - Logging.LogWarning("Failed to patch Gamecraft. Attempting to patch to display error..."); + Logging.LogWarning("Failed to patch Techblox. Attempting to patch to display error..."); harmony.Patch(AccessTools.Method(typeof(FullGameCompositionRoot), "OnContextInitialized") .MakeGenericMethod(typeof(UnityContext)), new HarmonyMethod(((Action) OnPatchError).Method)); //Can't use lambdas here :( @@ -67,12 +67,12 @@ namespace TechbloxModdingAPI Utility.VersionTracking.Init(); // create default event emitters Logging.MetaDebugLog($"Initializing Events"); - EventManager.AddEventEmitter(new SimpleEventEmitterEngine(EventType.ApplicationInitialized, "GamecraftModdingAPIApplicationInitializedEventEmitter", false)); - EventManager.AddEventEmitter(new SimpleEventEmitterEngine(EventType.Menu, "GamecraftModdingAPIMenuActivatedEventEmitter", false)); - EventManager.AddEventEmitter(new SimpleEventEmitterEngine(EventType.MenuSwitchedTo, "GamecraftModdingAPIMenuSwitchedToEventEmitter", false)); - EventManager.AddEventEmitter(new SimpleEventEmitterEngine(EventType.Game, "GamecraftModdingAPIGameActivatedEventEmitter", false)); - EventManager.AddEventEmitter(new SimpleEventEmitterEngine(EventType.GameReloaded, "GamecraftModdingAPIGameReloadedEventEmitter", false)); - EventManager.AddEventEmitter(new SimpleEventEmitterEngine(EventType.GameSwitchedTo, "GamecraftModdingAPIGameSwitchedToEventEmitter", false)); + EventManager.AddEventEmitter(new SimpleEventEmitterEngine(EventType.ApplicationInitialized, "TechbloxModdingAPIApplicationInitializedEventEmitter", false)); + EventManager.AddEventEmitter(new SimpleEventEmitterEngine(EventType.Menu, "TechbloxModdingAPIMenuActivatedEventEmitter", false)); + EventManager.AddEventEmitter(new SimpleEventEmitterEngine(EventType.MenuSwitchedTo, "TechbloxModdingAPIMenuSwitchedToEventEmitter", false)); + EventManager.AddEventEmitter(new SimpleEventEmitterEngine(EventType.Game, "TechbloxModdingAPIGameActivatedEventEmitter", false)); + EventManager.AddEventEmitter(new SimpleEventEmitterEngine(EventType.GameReloaded, "TechbloxModdingAPIGameReloadedEventEmitter", false)); + EventManager.AddEventEmitter(new SimpleEventEmitterEngine(EventType.GameSwitchedTo, "TechbloxModdingAPIGameSwitchedToEventEmitter", false)); EventManager.AddEventEmitter(GameHostTransitionDeterministicGroupEnginePatch.buildEngine); EventManager.AddEventEmitter(GameHostTransitionDeterministicGroupEnginePatch.simEngine); #pragma warning restore 0612,0618 @@ -100,7 +100,7 @@ namespace TechbloxModdingAPI /// /// Shuts down & cleans up the TechbloxModdingAPI. - /// Call this as late as possible before Gamecraft quits. + /// Call this as late as possible before Techblox quits. /// Ideally, this should be called from your main Plugin class's OnApplicationQuit() method. /// public static void Shutdown() diff --git a/TechbloxModdingAPI/Persistence/DeserializeFromDiskEntitiesEnginePatch.cs b/TechbloxModdingAPI/Persistence/DeserializeFromDiskEntitiesEnginePatch.cs index f436e56..d998f0e 100644 --- a/TechbloxModdingAPI/Persistence/DeserializeFromDiskEntitiesEnginePatch.cs +++ b/TechbloxModdingAPI/Persistence/DeserializeFromDiskEntitiesEnginePatch.cs @@ -17,7 +17,7 @@ namespace TechbloxModdingAPI.Persistence { internal static EntitiesDB entitiesDB = null; - private static readonly byte[] frameStart = Encoding.UTF8.GetBytes("\0\0\0GamecraftModdingAPI\0\0\0"); + private static readonly byte[] frameStart = Encoding.UTF8.GetBytes("\0\0\0TechbloxModdingAPI\0\0\0"); public static void Prefix(ref ISerializationData ____serializationData, ref FasterList ____bytesStream, ref IEntitySerialization ____entitySerializer, bool ____spawnBlocksOnly) { diff --git a/TechbloxModdingAPI/Persistence/IEntitySerializer.cs b/TechbloxModdingAPI/Persistence/IEntitySerializer.cs index e7fcd5c..0d6e599 100644 --- a/TechbloxModdingAPI/Persistence/IEntitySerializer.cs +++ b/TechbloxModdingAPI/Persistence/IEntitySerializer.cs @@ -8,7 +8,7 @@ using TechbloxModdingAPI.Utility; namespace TechbloxModdingAPI.Persistence { /// - /// Entity serializer and deserializer interface for storing and retrieving data in a Gamecraft save file (GameSave.GC). + /// Entity serializer and deserializer interface for storing and retrieving data in a Techblox save file (GameSave.GC). /// public interface IEntitySerializer : IDeserializationFactory, IQueryingEntitiesEngine { diff --git a/TechbloxModdingAPI/Persistence/SaveGameEnginePatch.cs b/TechbloxModdingAPI/Persistence/SaveGameEnginePatch.cs index 74edddf..9371e9b 100644 --- a/TechbloxModdingAPI/Persistence/SaveGameEnginePatch.cs +++ b/TechbloxModdingAPI/Persistence/SaveGameEnginePatch.cs @@ -15,7 +15,7 @@ namespace TechbloxModdingAPI.Persistence //[HarmonyPatch] - TODO class SaveGameEnginePatch { - private static readonly byte[] frameStart = Encoding.UTF8.GetBytes("\0\0\0GamecraftModdingAPI\0\0\0"); + private static readonly byte[] frameStart = Encoding.UTF8.GetBytes("\0\0\0TechbloxModdingAPI\0\0\0"); public static void Postfix(ref ISerializationData serializationData, EntitiesDB entitiesDB, IEntitySerialization entitySerializer) { diff --git a/TechbloxModdingAPI/Persistence/SerializerManager.cs b/TechbloxModdingAPI/Persistence/SerializerManager.cs index 6177d7c..04079cf 100644 --- a/TechbloxModdingAPI/Persistence/SerializerManager.cs +++ b/TechbloxModdingAPI/Persistence/SerializerManager.cs @@ -11,7 +11,7 @@ namespace TechbloxModdingAPI.Persistence /// /// Keeps track of serializers. /// This is used to add and retrieve serializers. - /// Added IEntitySerializations are used in serializing and deserializing Gamecraft save files (GameSave.GC). + /// Added IEntitySerializations are used in serializing and deserializing Techblox save files (GameSave.GC). /// public static class SerializerManager { diff --git a/TechbloxModdingAPI/Players/PlayerEngine.cs b/TechbloxModdingAPI/Players/PlayerEngine.cs index cc24650..d71c3ee 100644 --- a/TechbloxModdingAPI/Players/PlayerEngine.cs +++ b/TechbloxModdingAPI/Players/PlayerEngine.cs @@ -26,7 +26,7 @@ namespace TechbloxModdingAPI.Players { internal class PlayerEngine : IApiEngine, IFactoryEngine { - public string Name { get; } = "GamecraftModdingAPIPlayerGameEngine"; + public string Name { get; } = "TechbloxModdingAPIPlayerGameEngine"; public EntitiesDB entitiesDB { set; private get; } diff --git a/TechbloxModdingAPI/Players/PlayerExceptions.cs b/TechbloxModdingAPI/Players/PlayerExceptions.cs index d5bba55..20dbea6 100644 --- a/TechbloxModdingAPI/Players/PlayerExceptions.cs +++ b/TechbloxModdingAPI/Players/PlayerExceptions.cs @@ -1,7 +1,7 @@ using System; namespace TechbloxModdingAPI.Players { - public class PlayerException : GamecraftModdingAPIException + public class PlayerException : TechbloxModdingAPIException { public PlayerException() { diff --git a/TechbloxModdingAPI/Tasks/Scheduler.cs b/TechbloxModdingAPI/Tasks/Scheduler.cs index af47d1d..764e9b7 100644 --- a/TechbloxModdingAPI/Tasks/Scheduler.cs +++ b/TechbloxModdingAPI/Tasks/Scheduler.cs @@ -32,9 +32,9 @@ namespace TechbloxModdingAPI.Tasks } } - public static readonly Svelto.Tasks.ExtraLean.Unity.UpdateMonoRunner extraLeanRunner = new Svelto.Tasks.ExtraLean.Unity.UpdateMonoRunner("GamecraftModdingAPIExtraLean"); + public static readonly Svelto.Tasks.ExtraLean.Unity.UpdateMonoRunner extraLeanRunner = new Svelto.Tasks.ExtraLean.Unity.UpdateMonoRunner("TechbloxModdingAPIExtraLean"); - public static readonly Svelto.Tasks.Lean.Unity.UpdateMonoRunner leanRunner = new Svelto.Tasks.Lean.Unity.UpdateMonoRunner("GamecraftModdingAPILean"); + public static readonly Svelto.Tasks.Lean.Unity.UpdateMonoRunner leanRunner = new Svelto.Tasks.Lean.Unity.UpdateMonoRunner("TechbloxModdingAPILean"); /// /// Schedule a task to run asynchronously. @@ -42,7 +42,7 @@ namespace TechbloxModdingAPI.Tasks /// /// The task to run /// Schedule toRun on an extra lean runner? - /// Schedule toRun on Gamecraft's built-in UI task runner? + /// Schedule toRun on Techblox's built-in UI task runner? public static void Schedule(ISchedulable toRun, bool extraLean = false, bool ui = false) { if (extraLean) diff --git a/TechbloxModdingAPI/TechbloxModdingAPI.csproj b/TechbloxModdingAPI/TechbloxModdingAPI.csproj index 4624c80..bd4135c 100644 --- a/TechbloxModdingAPI/TechbloxModdingAPI.csproj +++ b/TechbloxModdingAPI/TechbloxModdingAPI.csproj @@ -8,7 +8,6 @@ https://git.exmods.org/modtainers/GamecraftModdingAPI en-CA true - GamecraftModdingAPI diff --git a/TechbloxModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs b/TechbloxModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs index 292f769..2274600 100644 --- a/TechbloxModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs +++ b/TechbloxModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs @@ -55,7 +55,7 @@ namespace TechbloxModdingAPI.Tests /// Modding API implemented as a standalone IPA Plugin. /// Ideally, TechbloxModdingAPI should be loaded by another mod; not itself /// - public class GamecraftModdingAPIPluginTest : IllusionPlugin.IEnhancedPlugin + public class TechbloxModdingAPIPluginTest : IllusionPlugin.IEnhancedPlugin { private static Harmony harmony { get; set; } @@ -64,7 +64,7 @@ namespace TechbloxModdingAPI.Tests public override string Version { get; } = Assembly.GetExecutingAssembly().GetName().Version.ToString(); - public string HarmonyID { get; } = "org.git.exmods.modtainers.gamecraftmoddingapi"; + public string HarmonyID { get; } = "org.git.exmods.modtainers.techbloxmoddingapi"; public override void OnApplicationQuit() { @@ -367,16 +367,16 @@ namespace TechbloxModdingAPI.Tests } // dependency test - if (Dependency.Hell("GamecraftScripting", new Version("0.0.1.0"))) + if (Dependency.Hell("TechbloxScripting", new Version("0.0.1.0"))) { - Logging.LogWarning("You're in GamecraftScripting dependency hell"); + Logging.LogWarning("You're in TechbloxScripting dependency hell"); } else { - Logging.Log("Compatible GamecraftScripting detected"); + Logging.Log("Compatible TechbloxScripting detected"); } // Interface test - /*Interface.IMGUI.Group uiGroup = new Group(new Rect(20, 20, 200, 500), "GamecraftModdingAPI_UITestGroup", true); + /*Interface.IMGUI.Group uiGroup = new Group(new Rect(20, 20, 200, 500), "TechbloxModdingAPI_UITestGroup", true); Interface.IMGUI.Button button = new Button("TEST"); button.OnClick += (b, __) => { Logging.MetaDebugLog($"Click on {((Interface.IMGUI.Button)b).Name}");}; Interface.IMGUI.Button button2 = new Button("TEST2"); diff --git a/TechbloxModdingAPI/Tests/TestRoot.cs b/TechbloxModdingAPI/Tests/TestRoot.cs index 878fdda..9085470 100644 --- a/TechbloxModdingAPI/Tests/TestRoot.cs +++ b/TechbloxModdingAPI/Tests/TestRoot.cs @@ -21,7 +21,7 @@ namespace TechbloxModdingAPI.Tests { public static bool AutoShutdown = true; - public const string ReportFile = "GamecraftModdingAPI_tests.log"; + public const string ReportFile = "TechbloxModdingAPI_tests.log"; private static bool _testsPassed = false; @@ -283,7 +283,7 @@ namespace TechbloxModdingAPI.Tests Logging.MetaLog("Starting test run"); // log metadata Assert.Log($"Unity {Application.unityVersion}"); - Assert.Log($"Gamecraft {Application.version}"); + Assert.Log($"Techblox {Application.version}"); Assert.Log($"TechbloxModdingAPI {Assembly.GetExecutingAssembly().GetName().Version}"); Assert.Log($"Testing {asm.GetName().Name} {asm.GetName().Version}"); Assert.Log($"START: --- {DateTime.Now.ToString()} --- ({testTypes.Count} tests classes detected)"); diff --git a/TechbloxModdingAPI/Utility/AsyncUtilsEngine.cs b/TechbloxModdingAPI/Utility/AsyncUtilsEngine.cs index b9e6ad3..ee18ced 100644 --- a/TechbloxModdingAPI/Utility/AsyncUtilsEngine.cs +++ b/TechbloxModdingAPI/Utility/AsyncUtilsEngine.cs @@ -57,7 +57,7 @@ namespace TechbloxModdingAPI.Utility { } - public string Name { get; } = "GamecraftModdingAPIAsyncUtilsGameEngine"; + public string Name { get; } = "TechbloxModdingAPIAsyncUtilsGameEngine"; public bool isRemovable { get; } = false; } } \ No newline at end of file diff --git a/TechbloxModdingAPI/Utility/DebugInterfaceEngine.cs b/TechbloxModdingAPI/Utility/DebugInterfaceEngine.cs index 24d59b3..7f9d97c 100644 --- a/TechbloxModdingAPI/Utility/DebugInterfaceEngine.cs +++ b/TechbloxModdingAPI/Utility/DebugInterfaceEngine.cs @@ -31,7 +31,7 @@ namespace TechbloxModdingAPI.Utility public void SetInfo(string id, Func contentGetter) => _extraInfo[id] = contentGetter; public bool RemoveInfo(string id) => _extraInfo.Remove(id); - public string Name => "GamecraftModdingAPIDebugInterfaceGameEngine"; + public string Name => "TechbloxModdingAPIDebugInterfaceGameEngine"; public bool isRemovable => true; [HarmonyPatch] diff --git a/TechbloxModdingAPI/Utility/GameState.cs b/TechbloxModdingAPI/Utility/GameState.cs index 50dfb83..79a72fe 100644 --- a/TechbloxModdingAPI/Utility/GameState.cs +++ b/TechbloxModdingAPI/Utility/GameState.cs @@ -7,7 +7,7 @@ using System.Threading.Tasks; namespace TechbloxModdingAPI.Utility { /// - /// Utility to get the state of the current Gamecraft game + /// Utility to get the state of the current Techblox game /// public static class GameState { @@ -34,7 +34,7 @@ namespace TechbloxModdingAPI.Utility /// /// Is a game loaded? /// - /// Whether Gamecraft has a game open (false = Main Menu) + /// Whether Techblox has a game open (false = Main Menu) public static bool IsInGame() { return gameEngine.IsInGame; diff --git a/TechbloxModdingAPI/Utility/GameStateEngine.cs b/TechbloxModdingAPI/Utility/GameStateEngine.cs index 3861d00..936a8ef 100644 --- a/TechbloxModdingAPI/Utility/GameStateEngine.cs +++ b/TechbloxModdingAPI/Utility/GameStateEngine.cs @@ -12,7 +12,7 @@ namespace TechbloxModdingAPI.Utility { class GameStateEngine : IApiEngine { - public string Name { get; } = "GamecraftModdingAPIGameStateGameEngine"; + public string Name { get; } = "TechbloxModdingAPIGameStateGameEngine"; public EntitiesDB entitiesDB { set; private get; } diff --git a/TechbloxModdingAPI/Utility/Logging.cs b/TechbloxModdingAPI/Utility/Logging.cs index d28fd76..8a26759 100644 --- a/TechbloxModdingAPI/Utility/Logging.cs +++ b/TechbloxModdingAPI/Utility/Logging.cs @@ -9,8 +9,8 @@ using System.Threading.Tasks; namespace TechbloxModdingAPI.Utility { /// - /// Utility class to access Gamecraft's built-in logging capabilities. - /// The log is saved to %APPDATA%\..\LocalLow\FreeJam\Gamecraft\Player.Log + /// Utility class to access Techblox's built-in logging capabilities. + /// The log is saved to %APPDATA%\..\LocalLow\FreeJam\Techblox\Player.Log /// public static class Logging { @@ -21,7 +21,7 @@ namespace TechbloxModdingAPI.Utility } /// - /// Write a regular message to Gamecraft's log + /// Write a regular message to Techblox's log /// /// The object to log [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -37,7 +37,7 @@ namespace TechbloxModdingAPI.Utility } /// - /// Write a debug message to Gamecraft's log + /// Write a debug message to Techblox's log /// /// The object to log [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -53,7 +53,7 @@ namespace TechbloxModdingAPI.Utility } /// - /// Write a debug message and object to Gamecraft's log + /// Write a debug message and object to Techblox's log /// The reason this method exists in Svelto.Console is beyond my understanding /// /// The type of the extra debug object @@ -72,7 +72,7 @@ namespace TechbloxModdingAPI.Utility } /// - /// Write an error message to Gamecraft's log + /// Write an error message to Techblox's log /// /// The object to log /// The extra data to pass to the ILogger @@ -83,7 +83,7 @@ namespace TechbloxModdingAPI.Utility } /// - /// Write an exception to Gamecraft's log and to the screen and exit game + /// Write an exception to Techblox's log and to the screen and exit game /// /// The exception to log /// The extra data to pass to the ILogger. @@ -95,7 +95,7 @@ namespace TechbloxModdingAPI.Utility } /// - /// Write an exception message to Gamecraft's log and to the screen and exit game + /// Write an exception message to Techblox's log and to the screen and exit game /// /// The object to log /// The exception to log @@ -114,7 +114,7 @@ namespace TechbloxModdingAPI.Utility } /// - /// Write a warning message to Gamecraft's log + /// Write a warning message to Techblox's log /// /// The object to log [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -144,7 +144,7 @@ namespace TechbloxModdingAPI.Utility // descriptive logging /// - /// Write a descriptive message to Gamecraft's log only when the API is a Debug build + /// Write a descriptive message to Techblox's log only when the API is a Debug build /// /// The object to log [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -156,7 +156,7 @@ namespace TechbloxModdingAPI.Utility } /// - /// Write a descriptive message to Gamecraft's log including the current time and the calling method's name + /// Write a descriptive message to Techblox's log including the current time and the calling method's name /// /// The object to log [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -169,7 +169,7 @@ namespace TechbloxModdingAPI.Utility // CLI logging /// - /// Write a message to Gamecraft's command line + /// Write a message to Techblox's command line /// /// The object to log [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -185,7 +185,7 @@ namespace TechbloxModdingAPI.Utility } /// - /// Write an error message to Gamecraft's command line + /// Write an error message to Techblox's command line /// /// The object to log [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -201,7 +201,7 @@ namespace TechbloxModdingAPI.Utility } /// - /// Write a warning message to Gamecraft's command line + /// Write a warning message to Techblox's command line /// /// The object to log [MethodImpl(MethodImplOptions.AggressiveInlining)] diff --git a/TechbloxModdingAPI/Utility/VersionTracking.cs b/TechbloxModdingAPI/Utility/VersionTracking.cs index 82d39d3..01da552 100644 --- a/TechbloxModdingAPI/Utility/VersionTracking.cs +++ b/TechbloxModdingAPI/Utility/VersionTracking.cs @@ -61,7 +61,7 @@ namespace TechbloxModdingAPI.Utility [Obsolete] internal class VersionTrackingEngine : IEventEmitterEngine { - public string Name { get; } = "GamecraftModdingAPIVersionTrackingGameEngine"; + public string Name { get; } = "TechbloxModdingAPIVersionTrackingGameEngine"; public EntitiesDB entitiesDB { set; private get; } @@ -104,7 +104,7 @@ namespace TechbloxModdingAPI.Utility [Obsolete] public class ModVersionDescriptor: SerializableEntityDescriptor { - [HashName("GamecraftModdingAPIVersionV0")] + [HashName("TechbloxModdingAPIVersionV0")] public class _ModVersionDescriptor : IEntityDescriptor { public IComponentBuilder[] componentsToBuild { get; } = new IComponentBuilder[]{ -- 2.30.2 From 5172b13b7c33dc4b064bd91808766b224f909de7 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sun, 2 May 2021 02:08:22 +0200 Subject: [PATCH 168/252] Update readme and version --- README.md | 22 ++++++++++---------- TechbloxModdingAPI/TechbloxModdingAPI.csproj | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index fd3bf5a..a4c0457 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ -# GamecraftModdingAPI +# TechbloxModdingAPI -Unofficial Gamecraft modding API for interfacing Gamecraft from mods. +Unofficial Techblox modding API for interfacing Techblox from mods. -The GamecraftModdingAPI aims to simplify the mods in two ways: +The TechbloxModdingAPI aims to simplify the mods in two ways: - *Ease-of-Use* The API provides convenient ways to do common tasks such as moving blocks and adding commands. All of the Harmony patching is done for you, so you can focus on writing your mod instead of reading swathes of undocumented code. - *Stability* The API aims to be reliable and consistent between versions. -This means your code won't break when the GamecraftModdingAPI or Gamecraft updates. +This means your code won't break when the TechbloxModdingAPI or Techblox updates. For more info, please check out the [official documentation](https://mod.exmods.org). @@ -16,16 +16,16 @@ For more support, join the ExMods [Discord](https://discord.exmods.org). [Please follow the official mod installation guide](https://www.exmods.org/guides/install.html) or use GCMM. ## Development -To get started, create a symbolic link called `ref` in the root of the project, or one folder higher, linking to the Gamecraft install folder. -This will allow your IDE to resolve references to Gamecraft files for building and IDE tools. +To get started, create a symbolic link called `ref` in the root of the project, or one folder higher, linking to the Techblox install folder. +This will allow your IDE to resolve references to Techblox files for building and IDE tools. -GamecraftModdingAPI version numbers follow the [Semantic Versioning guidelines](https://semver.org/). +TechbloxModdingAPI version numbers follow the [Semantic Versioning guidelines](https://semver.org/). ## External Libraries -GamecraftModdingAPI includes [Harmony](https://github.com/pardeike/Harmony) to modify the behaviour of existing Gamecraft code. +TechbloxModdingAPI includes [Harmony](https://github.com/pardeike/Harmony) to modify the behaviour of existing Techblox code. # Disclaimer -This API is an unofficial modification of Gamecraft software, and is not endorsed or supported by FreeJam or Gamecraft. -The GamecraftModdingAPI developer(s) claim no rights on the Gamecraft code referenced within this project. -All code contained in this project is licensed under the [GNU Public License v3](https://git.exmods.org/modtainers/GamecraftModdingAPI/src/branch/master/LICENSE). +This API is an unofficial modification of Techblox software, and is not endorsed or supported by FreeJam or Techblox. +The TechbloxModdingAPI developer(s) claim no rights on the Techblox code referenced within this project. +All code contained in this project is licensed under the [GNU Public License v3](https://git.exmods.org/modtainers/TechbloxModdingAPI/src/branch/master/LICENSE). diff --git a/TechbloxModdingAPI/TechbloxModdingAPI.csproj b/TechbloxModdingAPI/TechbloxModdingAPI.csproj index bd4135c..4fc1b02 100644 --- a/TechbloxModdingAPI/TechbloxModdingAPI.csproj +++ b/TechbloxModdingAPI/TechbloxModdingAPI.csproj @@ -2,7 +2,7 @@ net472 true - 1.8.0 + 2.0.0 Exmods GNU General Public Licence 3+ https://git.exmods.org/modtainers/GamecraftModdingAPI -- 2.30.2 From 62afd3b7805dd19ea6b9ce69bbef9245258561ef Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Mon, 3 May 2021 00:17:49 +0200 Subject: [PATCH 169/252] Some file renames that were missing --- ...craftModdingAPIException.cs => TechbloxModdingAPIException.cs} | 0 ...aftModdingAPIPluginTest.cs => TechbloxModdingAPIPluginTest.cs} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename TechbloxModdingAPI/{GamecraftModdingAPIException.cs => TechbloxModdingAPIException.cs} (100%) rename TechbloxModdingAPI/Tests/{GamecraftModdingAPIPluginTest.cs => TechbloxModdingAPIPluginTest.cs} (100%) diff --git a/TechbloxModdingAPI/GamecraftModdingAPIException.cs b/TechbloxModdingAPI/TechbloxModdingAPIException.cs similarity index 100% rename from TechbloxModdingAPI/GamecraftModdingAPIException.cs rename to TechbloxModdingAPI/TechbloxModdingAPIException.cs diff --git a/TechbloxModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs b/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs similarity index 100% rename from TechbloxModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs rename to TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs -- 2.30.2 From aea3ef36238e22d6c78cf5e5ee376f82de3bcd3c Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Mon, 3 May 2021 01:25:26 +0200 Subject: [PATCH 170/252] Remove AsyncUtils, fix FlyCam and GetThingLookedAt() --- .../Events/GameActivatedComposePatch.cs | 2 - TechbloxModdingAPI/Main.cs | 2 +- TechbloxModdingAPI/Player.cs | 8 +-- TechbloxModdingAPI/Players/PlayerEngine.cs | 8 +-- TechbloxModdingAPI/Utility/AsyncUtils.cs | 35 ----------- .../Utility/AsyncUtilsEngine.cs | 63 ------------------- 6 files changed, 9 insertions(+), 109 deletions(-) delete mode 100644 TechbloxModdingAPI/Utility/AsyncUtils.cs delete mode 100644 TechbloxModdingAPI/Utility/AsyncUtilsEngine.cs diff --git a/TechbloxModdingAPI/Events/GameActivatedComposePatch.cs b/TechbloxModdingAPI/Events/GameActivatedComposePatch.cs index 8a32f37..3ee1143 100644 --- a/TechbloxModdingAPI/Events/GameActivatedComposePatch.cs +++ b/TechbloxModdingAPI/Events/GameActivatedComposePatch.cs @@ -28,8 +28,6 @@ namespace TechbloxModdingAPI.Events { // register custom game engines GameEngineManager.RegisterEngines(enginesRoot); - // initialize AsyncUtils - AsyncUtils.Setup(enginesRoot); // A new EnginesRoot is always created when ActivateGame is called // so all event emitters and handlers must be re-registered. EventManager.RegisterEngines(enginesRoot); diff --git a/TechbloxModdingAPI/Main.cs b/TechbloxModdingAPI/Main.cs index da66884..d6d6d3e 100644 --- a/TechbloxModdingAPI/Main.cs +++ b/TechbloxModdingAPI/Main.cs @@ -84,11 +84,11 @@ namespace TechbloxModdingAPI Input.FakeInput.Init(); // init object-oriented classes Player.Init(); + FlyCam.Init(); Block.Init(); BlockGroup.Init(); Wire.Init(); GameClient.Init(); - AsyncUtils.Init(); Client.Init(); Game.Init(); //CustomBlock.Init(); diff --git a/TechbloxModdingAPI/Player.cs b/TechbloxModdingAPI/Player.cs index 2c6b122..01b5c24 100644 --- a/TechbloxModdingAPI/Player.cs +++ b/TechbloxModdingAPI/Player.cs @@ -386,8 +386,8 @@ namespace TechbloxModdingAPI public Block GetBlockLookedAt(float maxDistance = -1f) { var egid = playerEngine.GetThingLookedAt(Id, maxDistance); - return egid.HasValue && egid.Value.groupID != CommonExclusiveGroups.SIMULATION_BODIES_GROUP - ? new Block(egid.Value) + return egid != EGID.Empty && egid.groupID != CommonExclusiveGroups.SIMULATION_BODIES_GROUP + ? new Block(egid) : null; } @@ -399,8 +399,8 @@ namespace TechbloxModdingAPI public SimBody GetSimBodyLookedAt(float maxDistance = -1f) { var egid = playerEngine.GetThingLookedAt(Id, maxDistance); - return egid.HasValue && egid.Value.groupID == CommonExclusiveGroups.SIMULATION_BODIES_GROUP - ? new SimBody(egid.Value) + return egid != EGID.Empty && egid.groupID == CommonExclusiveGroups.SIMULATION_BODIES_GROUP + ? new SimBody(egid) : null; } diff --git a/TechbloxModdingAPI/Players/PlayerEngine.cs b/TechbloxModdingAPI/Players/PlayerEngine.cs index d71c3ee..f0c8a11 100644 --- a/TechbloxModdingAPI/Players/PlayerEngine.cs +++ b/TechbloxModdingAPI/Players/PlayerEngine.cs @@ -438,20 +438,20 @@ namespace TechbloxModdingAPI.Players return false; } - public EGID? GetThingLookedAt(uint playerId, float maxDistance = -1f) + public EGID GetThingLookedAt(uint playerId, float maxDistance = -1f) { if (!entitiesDB.TryQueryMappedEntities( CameraExclusiveGroups.CameraGroup, out var mapper)) - return null; + return EGID.Empty; mapper.TryGetEntity(playerId, out CharacterCameraRayCastEntityStruct rayCast); float distance = maxDistance < 0 ? GhostBlockUtils.GetBuildInteractionDistance(entitiesDB, rayCast, GhostBlockUtils.GhostCastMethod.GhostCastProportionalToBlockSize) : maxDistance; if (rayCast.hit && rayCast.distance <= distance) - return rayCast.hitEgid; + return rayCast.hitEgid; //May be EGID.Empty - return null; + return EGID.Empty; } public unsafe Block[] GetSelectedBlocks(uint playerid) diff --git a/TechbloxModdingAPI/Utility/AsyncUtils.cs b/TechbloxModdingAPI/Utility/AsyncUtils.cs deleted file mode 100644 index 4894515..0000000 --- a/TechbloxModdingAPI/Utility/AsyncUtils.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Threading.Tasks; - -using Svelto.ECS; - -namespace TechbloxModdingAPI.Utility -{ - public static class AsyncUtils - { - private static AsyncUtilsEngine gameEngine = new AsyncUtilsEngine(); - - /// - /// Waits for entity submission asynchronously. - /// Use after placing a block or otherwise creating things in the game to access their properties. - /// - public static async Task WaitForSubmission() - { - await gameEngine.WaitForSubmission(); - } - - public static async Task WaitForNextFrame() - { - await gameEngine.WaitForNextFrame(); - } - - public static void Setup(EnginesRoot enginesRoot) - { - gameEngine.Setup(enginesRoot.GenerateEntityFunctions(), enginesRoot.GenerateEntityFactory()); - } - - public static void Init() - { - GameEngineManager.AddGameEngine(gameEngine); - } - } -} \ No newline at end of file diff --git a/TechbloxModdingAPI/Utility/AsyncUtilsEngine.cs b/TechbloxModdingAPI/Utility/AsyncUtilsEngine.cs deleted file mode 100644 index ee18ced..0000000 --- a/TechbloxModdingAPI/Utility/AsyncUtilsEngine.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System.Collections; -using System.Threading.Tasks; - -using RobocraftX.Schedulers; -using Svelto.ECS; -using Svelto.Tasks.ExtraLean; -using TechbloxModdingAPI.Engines; - -namespace TechbloxModdingAPI.Utility -{ - public class AsyncUtilsEngine : IApiEngine - { - private IEntityFunctions _efu; - private IEntityFactory _efa; - private IEnumerator WaitForSubmissionInternal(IEntityFunctions efu, IEntityFactory efa, - EntitiesDB entitiesDB, TaskCompletionSource task) - { - /*var waitEnumerator = new WaitForSubmissionEnumerator(efu, efa, entitiesDB); - while (waitEnumerator.MoveNext()) - yield return null; - task.SetResult(null);*/ - yield break; //TODO - } - - private IEnumerator WaitForNextFrameInternal(TaskCompletionSource task) - { - yield return null; - task.SetResult(null); - } - - public Task WaitForSubmission() - { - var task = new TaskCompletionSource(); - WaitForSubmissionInternal(_efu, _efa, entitiesDB, task).RunOn(ExtraLean.EveryFrameStepRunner_TimeStopped); - return task.Task; - } - - public Task WaitForNextFrame() - { - var task = new TaskCompletionSource(); - WaitForNextFrameInternal(task).RunOn(ExtraLean.EveryFrameStepRunner_TimeStopped); - return task.Task; - } - - public void Setup(IEntityFunctions efu, IEntityFactory efa) - { - _efu = efu; - _efa = efa; - } - - public void Ready() - { - } - - public EntitiesDB entitiesDB { get; set; } - public void Dispose() - { - } - - public string Name { get; } = "TechbloxModdingAPIAsyncUtilsGameEngine"; - public bool isRemovable { get; } = false; - } -} \ No newline at end of file -- 2.30.2 From 78ee3b3bcdd33c46341d16cb187b296e3e6cc148 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Mon, 10 May 2021 01:38:15 +0200 Subject: [PATCH 171/252] Fix block type check on placement --- TechbloxModdingAPI/Blocks/PlacementEngine.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/TechbloxModdingAPI/Blocks/PlacementEngine.cs b/TechbloxModdingAPI/Blocks/PlacementEngine.cs index afd5574..5e1b97c 100644 --- a/TechbloxModdingAPI/Blocks/PlacementEngine.cs +++ b/TechbloxModdingAPI/Blocks/PlacementEngine.cs @@ -49,8 +49,7 @@ namespace TechbloxModdingAPI.Blocks { if (_blockEntityFactory == null) throw new BlockException("The factory is null."); - uint resourceId = (uint) PrefabsID.GenerateResourceID(0, block); - if (!PrefabsID.PrefabIDByResourceIDMap.ContainsKey(resourceId)) + if(!FullGameFields._dataDb.ContainsKey(block)) throw new BlockException("Block with ID " + block + " not found!"); //RobocraftX.CR.MachineEditing.PlaceSingleBlockEngine DBEntityStruct dbEntity = new DBEntityStruct {DBID = block}; -- 2.30.2 From 2d99d1d4783171c9751850a00de0cb355697e35b Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Mon, 10 May 2021 02:04:59 +0200 Subject: [PATCH 172/252] Generalize optional references and init data Added extension methods to query data from ECS objects Added base class for ECS objects Added support for representing in-construction ECS objects with an OptionalRef --- TechbloxModdingAPI/Block.cs | 10 ++-- TechbloxModdingAPI/Blocks/BlockEngine.cs | 19 ++++--- .../BlockEngineInit.cs => EcsObjectBase.cs} | 30 +++++++---- TechbloxModdingAPI/Utility/ApiExtensions.cs | 53 +++++++++++++++++++ TechbloxModdingAPI/Utility/OptionalRef.cs | 40 ++++++++++---- 5 files changed, 120 insertions(+), 32 deletions(-) rename TechbloxModdingAPI/{Blocks/BlockEngineInit.cs => EcsObjectBase.cs} (58%) create mode 100644 TechbloxModdingAPI/Utility/ApiExtensions.cs diff --git a/TechbloxModdingAPI/Block.cs b/TechbloxModdingAPI/Block.cs index 4729a91..f99ca28 100644 --- a/TechbloxModdingAPI/Block.cs +++ b/TechbloxModdingAPI/Block.cs @@ -20,7 +20,7 @@ namespace TechbloxModdingAPI /// A single (perhaps scaled) block. Properties may return default values if the block is removed and then setting them is ignored. /// For specific block type operations, use the specialised block classes in the TechbloxModdingAPI.Blocks namespace. /// - public class Block : IEquatable, IEquatable + public class Block : EcsObjectBase, IEquatable, IEquatable { protected static readonly PlacementEngine PlacementEngine = new PlacementEngine(); protected static readonly MovementEngine MovementEngine = new MovementEngine(); @@ -78,8 +78,7 @@ namespace TechbloxModdingAPI var initializer = PlacementEngine.PlaceBlock(block, position, player, autoWire); var egid = initializer.EGID; var bl = New(egid.entityID, egid.groupID); - bl.InitData.Group = BlockEngine.InitGroup(initializer); - bl.InitData.Reference = initializer.reference; + bl.InitData = initializer; Placed += bl.OnPlacedInit; return bl; } @@ -241,13 +240,12 @@ namespace TechbloxModdingAPI throw new BlockException("Blocks can only be placed in build mode."); var initializer = PlacementEngine.PlaceBlock(type, position, player, autoWire); Id = initializer.EGID; - InitData.Group = BlockEngine.InitGroup(initializer); + InitData = initializer; Placed += OnPlacedInit; } - public EGID Id { get; } + public override EGID Id { get; } - internal BlockEngine.BlockInitData InitData; private EGID copiedFrom; /// diff --git a/TechbloxModdingAPI/Blocks/BlockEngine.cs b/TechbloxModdingAPI/Blocks/BlockEngine.cs index 404e72a..7bade49 100644 --- a/TechbloxModdingAPI/Blocks/BlockEngine.cs +++ b/TechbloxModdingAPI/Blocks/BlockEngine.cs @@ -9,6 +9,7 @@ using RobocraftX.Blocks; using RobocraftX.Common; using RobocraftX.Physics; using RobocraftX.Rendering; +using RobocraftX.Rendering.GPUI; using Svelto.ECS.EntityStructs; using Svelto.DataStructures; @@ -16,6 +17,7 @@ using Svelto.ECS; using Svelto.ECS.Hybrid; using Unity.Mathematics; using TechbloxModdingAPI.Engines; +using TechbloxModdingAPI.Utility; namespace TechbloxModdingAPI.Blocks { @@ -68,14 +70,13 @@ namespace TechbloxModdingAPI.Blocks : entitiesDB.QueryEntity(index, CommonExclusiveGroups.COLOUR_PALETTE_GROUP).Colour; - public ref T GetBlockInfo(EGID blockID) where T : unmanaged, IEntityComponent + public OptionalRef GetBlockInfo(EGID blockID) where T : unmanaged, IEntityComponent { - if (entitiesDB.Exists(blockID)) - return ref entitiesDB.QueryEntity(blockID); - T[] structHolder = new T[1]; //Create something that can be referenced - return ref structHolder[0]; //Gets a default value automatically + return entitiesDB.TryQueryEntitiesAndIndex(blockID, out uint index, out var array) + ? new OptionalRef(array, index) + : new OptionalRef(); } - + public ref T GetBlockInfoViewStruct(EGID blockID) where T : struct, INeedEGID, IEntityViewComponent { if (entitiesDB.Exists(blockID)) @@ -149,6 +150,12 @@ namespace TechbloxModdingAPI.Blocks entitiesDB.QueryEntity(id).matrix = float4x4.TRS(pos.position, rot.rotation, scale.scale); } + internal void UpdatePrefab(Block block, ushort type, byte material, bool flipped) + { + uint pid = PrefabsID.GetOrCreatePrefabID(type, material, 0, flipped); + entitiesDB.QueryEntityOrDefault() + } + public bool BlockExists(EGID blockID) { return entitiesDB.Exists(blockID); diff --git a/TechbloxModdingAPI/Blocks/BlockEngineInit.cs b/TechbloxModdingAPI/EcsObjectBase.cs similarity index 58% rename from TechbloxModdingAPI/Blocks/BlockEngineInit.cs rename to TechbloxModdingAPI/EcsObjectBase.cs index b9b9eae..c96cf25 100644 --- a/TechbloxModdingAPI/Blocks/BlockEngineInit.cs +++ b/TechbloxModdingAPI/EcsObjectBase.cs @@ -1,33 +1,43 @@ -using System; +using System; using System.Linq.Expressions; - using Svelto.DataStructures; using Svelto.ECS; using Svelto.ECS.Internal; +using TechbloxModdingAPI.Blocks; -namespace TechbloxModdingAPI.Blocks +namespace TechbloxModdingAPI { - public partial class BlockEngine + public abstract class EcsObjectBase { + public abstract EGID Id { get; } //Abstract to support the 'place' Block constructor + + protected internal EcsInitData InitData; + /// /// Holds information needed to construct a component initializer /// - internal struct BlockInitData + protected internal struct EcsInitData { - public FasterDictionary Group; - public EntityReference Reference; + private FasterDictionary group; + private EntityReference reference; + + public static implicit operator EcsInitData(EntityInitializer initializer) => new EcsInitData + {group = GetInitGroup(initializer), reference = initializer.reference}; + + public EntityInitializer Initializer(EGID id) => new EntityInitializer(id, group, reference); + public bool Valid => group != null; } - internal delegate FasterDictionary GetInitGroup( + private delegate FasterDictionary GetInitGroupFunc( EntityInitializer initializer); /// /// Accesses the group field of the initializer /// - internal GetInitGroup InitGroup = CreateAccessor("_group"); + private static GetInitGroupFunc GetInitGroup = CreateAccessor("_group"); //https://stackoverflow.com/questions/55878525/unit-testing-ref-structs-with-private-fields-via-reflection - internal static TDelegate CreateAccessor(string memberName) where TDelegate : Delegate + private static TDelegate CreateAccessor(string memberName) where TDelegate : Delegate { var invokeMethod = typeof(TDelegate).GetMethod("Invoke"); if (invokeMethod == null) diff --git a/TechbloxModdingAPI/Utility/ApiExtensions.cs b/TechbloxModdingAPI/Utility/ApiExtensions.cs new file mode 100644 index 0000000..3da1a67 --- /dev/null +++ b/TechbloxModdingAPI/Utility/ApiExtensions.cs @@ -0,0 +1,53 @@ +using Svelto.ECS; +using TechbloxModdingAPI.Blocks; + +namespace TechbloxModdingAPI.Utility +{ + public static class ApiExtensions + { + /// + /// Attempts to query an entity and returns an optional that contains the result if succeeded. + /// + /// The entities DB + /// The EGID to query + /// The component type to query + /// An optional that contains the result on success or is empty if not found + public static OptionalRef QueryEntityOptional(this EntitiesDB entitiesDB, EGID egid) + where T : unmanaged, IEntityComponent + { + return entitiesDB.TryQueryEntitiesAndIndex(egid, out uint index, out var array) + ? new OptionalRef(array, index) + : new OptionalRef(); + } + + /// + /// Attempts to query an entity and returns the result or a dummy value that can be modified. + /// + /// + /// + /// + /// + public static OptionalRef QueryEntityOptional(this EntitiesDB entitiesDB, EcsObjectBase obj) + where T : unmanaged, IEntityComponent + { + var opt = QueryEntityOptional(entitiesDB, obj.Id); + return opt ? opt : new OptionalRef(obj); + } + + /// + /// Attempts to query an entity and returns the result or a dummy value that can be modified. + /// + /// + /// + /// + /// + public static ref T QueryEntityOrDefault(this EntitiesDB entitiesDB, EcsObjectBase obj) + where T : unmanaged, IEntityComponent + { + var opt = QueryEntityOptional(entitiesDB, obj.Id); + if (opt) return ref opt.Get(); + if (obj.InitData.Valid) return ref obj.InitData.Initializer(obj.Id).GetOrCreate(); + return ref opt.Get(); //Default value + } + } +} \ No newline at end of file diff --git a/TechbloxModdingAPI/Utility/OptionalRef.cs b/TechbloxModdingAPI/Utility/OptionalRef.cs index 7210d22..2323431 100644 --- a/TechbloxModdingAPI/Utility/OptionalRef.cs +++ b/TechbloxModdingAPI/Utility/OptionalRef.cs @@ -9,31 +9,51 @@ using Svelto.ECS; namespace TechbloxModdingAPI { - public struct OptionalRef where T : unmanaged + public ref struct OptionalRef where T : unmanaged, IEntityComponent { private bool exists; private NB array; private uint index; + private EntityInitializer initializer; public OptionalRef(NB array, uint index) { exists = true; this.array = array; this.index = index; + initializer = default; } - - public OptionalRef(ref T value) + + /// + /// Wraps the initializer data, if present. + /// + /// The object with the initializer + public OptionalRef(EcsObjectBase obj) { - exists = true; + if (obj.InitData.Valid) + { + initializer = obj.InitData.Initializer(obj.Id); + exists = true; + } + else + { + initializer = default; + exists = false; + } array = default; index = default; } - public ref T Get(T def = default) + /// + /// Returns the value or a default value if empty. Supports objects that are being initialized. + /// + /// The value or the default value + public ref T Get() { - if (exists) + if (!exists) return ref CompRefCache.Default; + if (initializer.EGID == EGID.Empty) return ref array[index]; - return ref CompRefCache._default; + return ref initializer.GetOrCreate(); } public bool Exists => exists; @@ -51,10 +71,10 @@ namespace TechbloxModdingAPI /// /// Creates an instance of a struct T that can be referenced. /// - /// The struct type to cache - private struct CompRefCache where T : unmanaged + /// The struct type to cache + private struct CompRefCache where TR : unmanaged { - public static T _default; + public static TR Default; } } } \ No newline at end of file -- 2.30.2 From 61184145a914ef360350f4df7263709cee19c5c9 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Mon, 10 May 2021 22:45:07 +0200 Subject: [PATCH 173/252] Start using new extension methods, code cleanup Removed all of the different block property getter methods --- TechbloxModdingAPI/Block.cs | 8 +- TechbloxModdingAPI/Blocks/BlockEngine.cs | 83 +-------------------- TechbloxModdingAPI/Blocks/MovementEngine.cs | 44 ++++------- TechbloxModdingAPI/Blocks/RotationEngine.cs | 61 ++++++--------- TechbloxModdingAPI/Blocks/SignalEngine.cs | 38 +++------- 5 files changed, 55 insertions(+), 179 deletions(-) diff --git a/TechbloxModdingAPI/Block.cs b/TechbloxModdingAPI/Block.cs index f99ca28..0e97a03 100644 --- a/TechbloxModdingAPI/Block.cs +++ b/TechbloxModdingAPI/Block.cs @@ -254,10 +254,10 @@ namespace TechbloxModdingAPI /// public float3 Position { - get => MovementEngine.GetPosition(Id, InitData); + get => MovementEngine.GetPosition(this); set { - MovementEngine.MoveBlock(Id, InitData, value); + MovementEngine.MoveBlock(this, value); if (blockGroup != null) blockGroup.PosAndRotCalculated = false; BlockEngine.UpdateDisplayedBlock(Id); @@ -269,10 +269,10 @@ namespace TechbloxModdingAPI /// public float3 Rotation { - get => RotationEngine.GetRotation(Id, InitData); + get => RotationEngine.GetRotation(this); set { - RotationEngine.RotateBlock(Id, InitData, value); + RotationEngine.RotateBlock(this, value); if (blockGroup != null) blockGroup.PosAndRotCalculated = false; BlockEngine.UpdateDisplayedBlock(Id); diff --git a/TechbloxModdingAPI/Blocks/BlockEngine.cs b/TechbloxModdingAPI/Blocks/BlockEngine.cs index 7bade49..935e3a1 100644 --- a/TechbloxModdingAPI/Blocks/BlockEngine.cs +++ b/TechbloxModdingAPI/Blocks/BlockEngine.cs @@ -70,75 +70,9 @@ namespace TechbloxModdingAPI.Blocks : entitiesDB.QueryEntity(index, CommonExclusiveGroups.COLOUR_PALETTE_GROUP).Colour; - public OptionalRef GetBlockInfo(EGID blockID) where T : unmanaged, IEntityComponent + public OptionalRef GetBlockInfo(Block block) where T : unmanaged, IEntityComponent { - return entitiesDB.TryQueryEntitiesAndIndex(blockID, out uint index, out var array) - ? new OptionalRef(array, index) - : new OptionalRef(); - } - - public ref T GetBlockInfoViewStruct(EGID blockID) where T : struct, INeedEGID, IEntityViewComponent - { - if (entitiesDB.Exists(blockID)) - return ref entitiesDB.QueryEntity(blockID); - T[] structHolder = new T[1]; //Create something that can be referenced - return ref structHolder[0]; //Gets a default value automatically - } - - public U GetBlockInfo(Block block, Func getter, - U def = default) where T : unmanaged, IEntityComponent - { - if (entitiesDB.Exists(block.Id)) - return getter(entitiesDB.QueryEntity(block.Id)); - return GetBlockInitInfo(block, getter, def); - } - - public U GetBlockInfoViewStruct(Block block, Func getter, - U def = default) where T : struct, IEntityViewComponent - { - if (entitiesDB.Exists(block.Id)) - return getter(entitiesDB.QueryEntity(block.Id)); - return GetBlockInitInfo(block, getter, def); - } - - private U GetBlockInitInfo(Block block, Func getter, U def) where T : struct, IEntityComponent - { - if (block.InitData.Group == null) return def; - var initializer = new EntityInitializer(block.Id, block.InitData.Group, block.InitData.Reference); - if (initializer.Has()) - return getter(initializer.Get()); - return def; - } - - public delegate void Setter(ref T component, U value) where T : struct, IEntityComponent; - - public void SetBlockInfoViewStruct(Block block, Setter setter, U value) where T : struct, IEntityViewComponent - { - if (entitiesDB.Exists(block.Id)) - setter(ref entitiesDB.QueryEntity(block.Id), value); - else - SetBlockInitInfo(block, setter, value); - } - - public void SetBlockInfo(Block block, Setter setter, U value) where T : unmanaged, IEntityComponent - { - if (entitiesDB.Exists(block.Id)) - setter(ref entitiesDB.QueryEntity(block.Id), value); - else - SetBlockInitInfo(block, setter, value); - } - - private void SetBlockInitInfo(Block block, Setter setter, U value) - where T : struct, IEntityComponent - { - if (block.InitData.Group != null) - { - var initializer = new EntityInitializer(block.Id, block.InitData.Group, block.InitData.Reference); - T component = initializer.Has() ? initializer.Get() : default; - ref T structRef = ref component; - setter(ref structRef, value); - initializer.Init(structRef); - } + return entitiesDB.QueryEntityOptional(block); } public void UpdateDisplayedBlock(EGID id) @@ -153,7 +87,8 @@ namespace TechbloxModdingAPI.Blocks internal void UpdatePrefab(Block block, ushort type, byte material, bool flipped) { uint pid = PrefabsID.GetOrCreatePrefabID(type, material, 0, flipped); - entitiesDB.QueryEntityOrDefault() + entitiesDB.QueryEntityOrDefault(block).prefabID = pid; + entitiesDB.QueryEntityOrDefault(block) = new PhysicsPrefabEntityStruct(pid); } public bool BlockExists(EGID blockID) @@ -161,16 +96,6 @@ namespace TechbloxModdingAPI.Blocks return entitiesDB.Exists(blockID); } - public bool GetBlockInfoExists(Block block) where T : struct, IEntityComponent - { - if (entitiesDB.Exists(block.Id)) - return true; - if (block.InitData.Group == null) - return false; - var init = new EntityInitializer(block.Id, block.InitData.Group, block.InitData.Reference); - return init.Has(); - } - public SimBody[] GetSimBodiesFromID(byte id) { var ret = new FasterList(4); diff --git a/TechbloxModdingAPI/Blocks/MovementEngine.cs b/TechbloxModdingAPI/Blocks/MovementEngine.cs index aeeac20..7ecf934 100644 --- a/TechbloxModdingAPI/Blocks/MovementEngine.cs +++ b/TechbloxModdingAPI/Blocks/MovementEngine.cs @@ -34,21 +34,12 @@ namespace TechbloxModdingAPI.Blocks // implementations for Movement static class - internal float3 MoveBlock(EGID blockID, BlockEngine.BlockInitData data, float3 vector) + internal float3 MoveBlock(Block block, float3 vector) { - if (!entitiesDB.Exists(blockID)) - { - if (data.Group == null) return float3.zero; - var init = new EntityInitializer(blockID, data.Group, data.Reference); - init.GetOrCreate().position = vector; - init.GetOrCreate().position = vector; - init.GetOrCreate().position = vector; - return vector; - } - ref PositionEntityStruct posStruct = ref this.entitiesDB.QueryEntity(blockID); - ref GridRotationStruct gridStruct = ref this.entitiesDB.QueryEntity(blockID); - ref LocalTransformEntityStruct transStruct = ref this.entitiesDB.QueryEntity(blockID); - ref UECSPhysicsEntityStruct phyStruct = ref this.entitiesDB.QueryEntity(blockID); + ref PositionEntityStruct posStruct = ref this.entitiesDB.QueryEntityOrDefault(block); + ref GridRotationStruct gridStruct = ref this.entitiesDB.QueryEntityOrDefault(block); + ref LocalTransformEntityStruct transStruct = ref this.entitiesDB.QueryEntityOrDefault(block); + ref UECSPhysicsEntityStruct phyStruct = ref this.entitiesDB.QueryEntityOrDefault(block); // main (persistent) position posStruct.position = vector; // placement grid position @@ -56,24 +47,21 @@ namespace TechbloxModdingAPI.Blocks // rendered position transStruct.position = vector; // collision position - FullGameFields._physicsWorld.EntityManager.SetComponentData(phyStruct.uecsEntity, new Translation - { - Value = posStruct.position - }); - entitiesDB.QueryEntity(blockID).isProcessed = false; + if (phyStruct.ID != EGID.Empty) + { //It exists + FullGameFields._physicsWorld.EntityManager.SetComponentData(phyStruct.uecsEntity, new Translation + { + Value = posStruct.position + }); + } + + entitiesDB.QueryEntityOrDefault(block).isProcessed = false; return posStruct.position; } - internal float3 GetPosition(EGID blockID, BlockEngine.BlockInitData data) + internal float3 GetPosition(Block block) { - if (!entitiesDB.Exists(blockID)) - { - if (data.Group == null) return float3.zero; - var init = new EntityInitializer(blockID, data.Group, data.Reference); - return init.Has() ? init.Get().position : float3.zero; - } - ref PositionEntityStruct posStruct = ref this.entitiesDB.QueryEntity(blockID); - return posStruct.position; + return entitiesDB.QueryEntityOrDefault(block).position; } } } diff --git a/TechbloxModdingAPI/Blocks/RotationEngine.cs b/TechbloxModdingAPI/Blocks/RotationEngine.cs index cef4691..b1e54e5 100644 --- a/TechbloxModdingAPI/Blocks/RotationEngine.cs +++ b/TechbloxModdingAPI/Blocks/RotationEngine.cs @@ -34,55 +34,38 @@ namespace TechbloxModdingAPI.Blocks // implementations for Rotation static class - internal float3 RotateBlock(EGID blockID, BlockEngine.BlockInitData data, Vector3 vector) + internal float3 RotateBlock(Block block, Vector3 vector) { - if (!entitiesDB.Exists(blockID)) - { - if (data.Group == null) return float3.zero; - var init = new EntityInitializer(blockID, data.Group, data.Reference); - init.GetOrCreate().rotation = Quaternion.Euler(vector); - init.GetOrCreate().rotation = Quaternion.Euler(vector); - init.GetOrCreate().rotation = Quaternion.Euler(vector); - return vector; - } - ref RotationEntityStruct rotStruct = ref this.entitiesDB.QueryEntity(blockID); - ref GridRotationStruct gridStruct = ref this.entitiesDB.QueryEntity(blockID); - ref LocalTransformEntityStruct transStruct = ref this.entitiesDB.QueryEntity(blockID); - ref UECSPhysicsEntityStruct phyStruct = ref this.entitiesDB.QueryEntity(blockID); - // main (persistent) position + ref RotationEntityStruct rotStruct = ref this.entitiesDB.QueryEntityOrDefault(block); + ref GridRotationStruct gridStruct = ref this.entitiesDB.QueryEntityOrDefault(block); + ref LocalTransformEntityStruct transStruct = ref this.entitiesDB.QueryEntityOrDefault(block); + ref UECSPhysicsEntityStruct phyStruct = ref this.entitiesDB.QueryEntityOrDefault(block); + // main (persistent) rotation Quaternion newRotation = rotStruct.rotation; newRotation.eulerAngles = vector; rotStruct.rotation = newRotation; // placement grid rotation - Quaternion newGridRotation = gridStruct.rotation; - newGridRotation.eulerAngles = vector; - gridStruct.rotation = newGridRotation; - // rendered position - Quaternion newTransRotation = rotStruct.rotation; - newTransRotation.eulerAngles = vector; - transStruct.rotation = newTransRotation; - // collision position - FullGameFields._physicsWorld.EntityManager.SetComponentData(phyStruct.uecsEntity, new Unity.Transforms.Rotation - { - Value = rotStruct.rotation - }); - entitiesDB.QueryEntity(blockID).isProcessed = false; + gridStruct.rotation = newRotation; + // rendered rotation + transStruct.rotation = newRotation; + // collision rotation + if (phyStruct.ID != EGID.Empty) + { //It exists + FullGameFields._physicsWorld.EntityManager.SetComponentData(phyStruct.uecsEntity, + new Unity.Transforms.Rotation + { + Value = rotStruct.rotation + }); + } + + entitiesDB.QueryEntityOrDefault(block).isProcessed = false; return ((Quaternion)rotStruct.rotation).eulerAngles; } - internal float3 GetRotation(EGID blockID, BlockEngine.BlockInitData data) + internal float3 GetRotation(Block block) { - if (!entitiesDB.Exists(blockID)) - { - if (data.Group == null) return float3.zero; - var init = new EntityInitializer(blockID, data.Group, data.Reference); - return init.Has() - ? (float3) ((Quaternion) init.Get().rotation).eulerAngles - : float3.zero; - } - - ref RotationEntityStruct rotStruct = ref entitiesDB.QueryEntity(blockID); + ref RotationEntityStruct rotStruct = ref entitiesDB.QueryEntityOrDefault(block); return ((Quaternion) rotStruct.rotation).eulerAngles; } } diff --git a/TechbloxModdingAPI/Blocks/SignalEngine.cs b/TechbloxModdingAPI/Blocks/SignalEngine.cs index 6e40af1..f486463 100644 --- a/TechbloxModdingAPI/Blocks/SignalEngine.cs +++ b/TechbloxModdingAPI/Blocks/SignalEngine.cs @@ -3,6 +3,7 @@ using Svelto.ECS; using Svelto.DataStructures; using Gamecraft.Wires; using TechbloxModdingAPI.Engines; +using TechbloxModdingAPI.Utility; namespace TechbloxModdingAPI.Blocks { @@ -87,8 +88,8 @@ namespace TechbloxModdingAPI.Blocks public ref PortEntityStruct GetPortByOffset(Block block, byte portNumber, bool input) { - BlockPortsStruct bps = GetFromDbOrInitData(block, block.Id, out bool exists); - if (!exists) + var bps = entitiesDB.QueryEntityOptional(block); + if (!bps) { throw new BlockException("Block does not exist"); } @@ -208,8 +209,9 @@ namespace TechbloxModdingAPI.Blocks public EGID MatchBlockInputToPort(Block block, byte portUsage, out bool exists) { - BlockPortsStruct ports = GetFromDbOrInitData(block, block.Id, out exists); - return new EGID(ports.firstInputID + portUsage, NamedExclusiveGroup.Group); + var ports = entitiesDB.QueryEntityOptional(block); + exists = ports; + return new EGID(ports.Get().firstInputID + portUsage, NamedExclusiveGroup.Group); } public EGID MatchBlockInputToPort(EGID block, byte portUsage, out bool exists) @@ -226,8 +228,9 @@ namespace TechbloxModdingAPI.Blocks public EGID MatchBlockOutputToPort(Block block, byte portUsage, out bool exists) { - BlockPortsStruct ports = GetFromDbOrInitData(block, block.Id, out exists); - return new EGID(ports.firstOutputID + portUsage, NamedExclusiveGroup.Group); + var ports = entitiesDB.QueryEntityOptional(block); + exists = ports; + return new EGID(ports.Get().firstOutputID + portUsage, NamedExclusiveGroup.Group); } public EGID MatchBlockOutputToPort(EGID block, byte portUsage, out bool exists) @@ -385,29 +388,6 @@ namespace TechbloxModdingAPI.Blocks return results.ToArray(); } - private ref T GetFromDbOrInitData(Block block, EGID id, out bool exists) where T : unmanaged, IEntityComponent - { - T[] defRef = new T[1]; - if (entitiesDB.Exists(id)) - { - exists = true; - return ref entitiesDB.QueryEntity(id); - } - if (block == null || block.InitData.Group == null) - { - exists = false; - return ref defRef[0]; - } - EntityInitializer initializer = new EntityInitializer(block.Id, block.InitData.Group, block.InitData.Reference); - if (initializer.Has()) - { - exists = true; - return ref initializer.Get(); - } - exists = false; - return ref defRef[0]; - } - private EntityCollection GetSignalStruct(uint signalID, out uint index, bool input = true) { ExclusiveGroup group = input -- 2.30.2 From d238c97906eb56dbd3aa0561bdfa2f3d6363289d Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Mon, 10 May 2021 23:08:15 +0200 Subject: [PATCH 174/252] Remove block info getters and setters Regex is great GetBlockInfo\(this, \((\w+) (\w+)\) ?=> ?\2(.+)\); GetBlockInfo<$1>(this)$3; SetBlockInfo\(this, \(ref (\w+) (\w+), \w+ (\w+)\) ?=> \2(.*) = \3,\s*value\); GetBlockInfo<$1>(this)$4 = value; --- TechbloxModdingAPI/Block.cs | 13 ++++++------ TechbloxModdingAPI/Blocks/BlockEngine.cs | 7 ++++++- TechbloxModdingAPI/Blocks/DampedSpring.cs | 6 +++--- TechbloxModdingAPI/Blocks/Motor.cs | 12 +++++------ TechbloxModdingAPI/Blocks/MusicBlock.cs | 4 ++-- TechbloxModdingAPI/Blocks/ObjectIdentifier.cs | 4 ++-- TechbloxModdingAPI/Blocks/Piston.cs | 9 ++++----- TechbloxModdingAPI/Blocks/Servo.cs | 16 +++++++-------- TechbloxModdingAPI/Blocks/SfxBlock.cs | 10 +++++----- TechbloxModdingAPI/Blocks/SignalingBlock.cs | 4 ++-- TechbloxModdingAPI/Blocks/SpawnPoint.cs | 16 +++++++-------- TechbloxModdingAPI/Blocks/TextBlock.cs | 6 +++--- TechbloxModdingAPI/Blocks/Timer.cs | 20 ++++++++----------- 13 files changed, 63 insertions(+), 64 deletions(-) diff --git a/TechbloxModdingAPI/Block.cs b/TechbloxModdingAPI/Block.cs index 0e97a03..b2d400d 100644 --- a/TechbloxModdingAPI/Block.cs +++ b/TechbloxModdingAPI/Block.cs @@ -285,14 +285,14 @@ namespace TechbloxModdingAPI /// public float3 Scale { - get => BlockEngine.GetBlockInfo(this, (ScalingEntityStruct st) => st.scale); + get => BlockEngine.GetBlockInfo(this).scale; set { int uscale = UniformScale; if (value.x < 4e-5) value.x = uscale; if (value.y < 4e-5) value.y = uscale; if (value.z < 4e-5) value.z = uscale; - BlockEngine.SetBlockInfo(this, (ref ScalingEntityStruct st, float3 val) => st.scale = val, value); + BlockEngine.GetBlockInfo(this).scale = value; if (!Exists) return; //UpdateCollision needs the block to exist ScalingEngine.UpdateCollision(Id); BlockEngine.UpdateDisplayedBlock(Id); @@ -305,12 +305,11 @@ namespace TechbloxModdingAPI /// public int UniformScale { - get => BlockEngine.GetBlockInfo(this, (UniformBlockScaleEntityStruct st) => st.scaleFactor); + get => BlockEngine.GetBlockInfo(this).scaleFactor; set { if (value < 1) value = 1; - BlockEngine.SetBlockInfo(this, (ref UniformBlockScaleEntityStruct st, int val) => st.scaleFactor = val, - value); + BlockEngine.GetBlockInfo(this).scaleFactor = value; Scale = new float3(value, value, value); } } @@ -320,7 +319,7 @@ namespace TechbloxModdingAPI */ public bool Flipped { - get => BlockEngine.GetBlockInfo(this, (ScalingEntityStruct st) => st.scale.x < 0); + get => BlockEngine.GetBlockInfo(this).scale.x < 0; set { BlockEngine.SetBlockInfo(this, (ref ScalingEntityStruct st, bool val) => @@ -371,7 +370,7 @@ namespace TechbloxModdingAPI /// public float4 CustomColor { - get => BlockEngine.GetBlockInfo(this, (ColourParameterEntityStruct st) => st.paletteColour); + get => BlockEngine.GetBlockInfo(this).paletteColour; set { BlockEngine.SetBlockInfo(this, (ref ColourParameterEntityStruct color, float4 val) => diff --git a/TechbloxModdingAPI/Blocks/BlockEngine.cs b/TechbloxModdingAPI/Blocks/BlockEngine.cs index 935e3a1..80e14f3 100644 --- a/TechbloxModdingAPI/Blocks/BlockEngine.cs +++ b/TechbloxModdingAPI/Blocks/BlockEngine.cs @@ -70,11 +70,16 @@ namespace TechbloxModdingAPI.Blocks : entitiesDB.QueryEntity(index, CommonExclusiveGroups.COLOUR_PALETTE_GROUP).Colour; - public OptionalRef GetBlockInfo(Block block) where T : unmanaged, IEntityComponent + public OptionalRef GetBlockInfoOptional(Block block) where T : unmanaged, IEntityComponent { return entitiesDB.QueryEntityOptional(block); } + public ref T GetBlockInfo(Block block) where T : unmanaged, IEntityComponent + { + return ref entitiesDB.QueryEntityOrDefault(block); + } + public void UpdateDisplayedBlock(EGID id) { if (!BlockExists(id)) return; diff --git a/TechbloxModdingAPI/Blocks/DampedSpring.cs b/TechbloxModdingAPI/Blocks/DampedSpring.cs index 34c7543..3c92f72 100644 --- a/TechbloxModdingAPI/Blocks/DampedSpring.cs +++ b/TechbloxModdingAPI/Blocks/DampedSpring.cs @@ -19,7 +19,7 @@ namespace TechbloxModdingAPI.Blocks /// public float MaxForce { - get => BlockEngine.GetBlockInfo(this, (DampedSpringReadOnlyStruct dsrs) => dsrs.springFrequency); + get => BlockEngine.GetBlockInfo(this).springFrequency; set => BlockEngine.SetBlockInfo(this, (ref DampedSpringReadOnlyStruct dsrs, float val) => dsrs.springFrequency = val, value); @@ -39,7 +39,7 @@ namespace TechbloxModdingAPI.Blocks /// public float Damping { - get => BlockEngine.GetBlockInfo(this, (DampedSpringReadOnlyStruct ljf) => ljf.springDamping); + get => BlockEngine.GetBlockInfo(this).springDamping; set => BlockEngine.SetBlockInfo(this, (ref DampedSpringReadOnlyStruct ljf, float val) => ljf.springDamping = val, value); @@ -50,7 +50,7 @@ namespace TechbloxModdingAPI.Blocks /// public float MaxExtension { - get => BlockEngine.GetBlockInfo(this, (DampedSpringReadOnlyStruct ljf) => ljf.maxExtent); + get => BlockEngine.GetBlockInfo(this).maxExtent; set => BlockEngine.SetBlockInfo(this, (ref DampedSpringReadOnlyStruct ljf, float val) => ljf.maxExtent = val, value); diff --git a/TechbloxModdingAPI/Blocks/Motor.cs b/TechbloxModdingAPI/Blocks/Motor.cs index 6b1e500..46ed9e4 100644 --- a/TechbloxModdingAPI/Blocks/Motor.cs +++ b/TechbloxModdingAPI/Blocks/Motor.cs @@ -28,12 +28,12 @@ namespace TechbloxModdingAPI.Blocks { get { - return BlockEngine.GetBlockInfo(this, (MotorReadOnlyStruct st) => st.maxVelocity); + return BlockEngine.GetBlockInfo(this).maxVelocity; } set { - BlockEngine.SetBlockInfo(this, (ref MotorReadOnlyStruct st, float val) => st.maxVelocity = val, value); + BlockEngine.GetBlockInfo(this).maxVelocity = value; } } @@ -44,12 +44,12 @@ namespace TechbloxModdingAPI.Blocks { get { - return BlockEngine.GetBlockInfo(this, (MotorReadOnlyStruct st) => st.maxForce); + return BlockEngine.GetBlockInfo(this).maxForce; } set { - BlockEngine.SetBlockInfo(this, (ref MotorReadOnlyStruct st, float val) => st.maxForce = val, value); + BlockEngine.GetBlockInfo(this).maxForce = value; } } @@ -60,12 +60,12 @@ namespace TechbloxModdingAPI.Blocks { get { - return BlockEngine.GetBlockInfo(this, (MotorReadOnlyStruct st) => st.reverse); + return BlockEngine.GetBlockInfo(this).reverse; } set { - BlockEngine.SetBlockInfo(this, (ref MotorReadOnlyStruct st, bool val) => st.reverse = val, value); + BlockEngine.GetBlockInfo(this).reverse = value; } } } diff --git a/TechbloxModdingAPI/Blocks/MusicBlock.cs b/TechbloxModdingAPI/Blocks/MusicBlock.cs index 30ca5ab..ea4aeca 100644 --- a/TechbloxModdingAPI/Blocks/MusicBlock.cs +++ b/TechbloxModdingAPI/Blocks/MusicBlock.cs @@ -28,7 +28,7 @@ namespace TechbloxModdingAPI.Blocks { get { - return BlockEngine.GetBlockInfo(this, (MusicBlockDataEntityStruct st) => st.trackIndx); + return BlockEngine.GetBlockInfo(this).trackIndx; } set @@ -83,7 +83,7 @@ namespace TechbloxModdingAPI.Blocks { get { - return BlockEngine.GetBlockInfo(this, (MusicBlockDataEntityStruct msdes) => msdes.tweakableVolume); + return BlockEngine.GetBlockInfo(this).tweakableVolume; } set diff --git a/TechbloxModdingAPI/Blocks/ObjectIdentifier.cs b/TechbloxModdingAPI/Blocks/ObjectIdentifier.cs index 67e250e..fe2d657 100644 --- a/TechbloxModdingAPI/Blocks/ObjectIdentifier.cs +++ b/TechbloxModdingAPI/Blocks/ObjectIdentifier.cs @@ -16,7 +16,7 @@ namespace TechbloxModdingAPI.Blocks public char Identifier { - get => (char) BlockEngine.GetBlockInfo(this, (ObjectIdEntityStruct st) => st.objectId + 'A'); + get => (char) BlockEngine.GetBlockInfo(this).objectId + 'A'; set { BlockEngine.SetBlockInfo(this, (ref ObjectIdEntityStruct st, char val) => @@ -32,7 +32,7 @@ namespace TechbloxModdingAPI.Blocks /// public byte SimID { - get => BlockEngine.GetBlockInfo(this, (ObjectIdEntityStruct st) => st.simObjectId); + get => BlockEngine.GetBlockInfo(this).simObjectId; } /// diff --git a/TechbloxModdingAPI/Blocks/Piston.cs b/TechbloxModdingAPI/Blocks/Piston.cs index b5953ee..9c1b98a 100644 --- a/TechbloxModdingAPI/Blocks/Piston.cs +++ b/TechbloxModdingAPI/Blocks/Piston.cs @@ -26,12 +26,11 @@ namespace TechbloxModdingAPI.Blocks /// public float MaximumExtension { - get => BlockEngine.GetBlockInfo(this, (PistonReadOnlyStruct st) => st.maxDeviation); + get => BlockEngine.GetBlockInfo(this).maxDeviation; set { - BlockEngine.SetBlockInfo(this, (ref PistonReadOnlyStruct st, float val) => st.maxDeviation = val, - value); + BlockEngine.GetBlockInfo(this).maxDeviation = value; } } @@ -40,11 +39,11 @@ namespace TechbloxModdingAPI.Blocks /// public float MaximumForce { - get => BlockEngine.GetBlockInfo(this, (PistonReadOnlyStruct st) => st.pistonVelocity); + get => BlockEngine.GetBlockInfo(this).pistonVelocity; set { - BlockEngine.SetBlockInfo(this, (ref PistonReadOnlyStruct st, float val) => st.pistonVelocity = val, value); + BlockEngine.GetBlockInfo(this).pistonVelocity = value; } } } diff --git a/TechbloxModdingAPI/Blocks/Servo.cs b/TechbloxModdingAPI/Blocks/Servo.cs index 12232de..cdbd87b 100644 --- a/TechbloxModdingAPI/Blocks/Servo.cs +++ b/TechbloxModdingAPI/Blocks/Servo.cs @@ -26,11 +26,11 @@ namespace TechbloxModdingAPI.Blocks /// public float MinimumAngle { - get => BlockEngine.GetBlockInfo(this, (ServoReadOnlyStruct st) => st.minDeviation); + get => BlockEngine.GetBlockInfo(this).minDeviation; set { - BlockEngine.SetBlockInfo(this, (ref ServoReadOnlyStruct st, float val) => st.minDeviation = val, value); + BlockEngine.GetBlockInfo(this).minDeviation = value; } } @@ -39,11 +39,11 @@ namespace TechbloxModdingAPI.Blocks /// public float MaximumAngle { - get => BlockEngine.GetBlockInfo(this, (ServoReadOnlyStruct st) => st.maxDeviation); + get => BlockEngine.GetBlockInfo(this).maxDeviation; set { - BlockEngine.SetBlockInfo(this, (ref ServoReadOnlyStruct st, float val) => st.maxDeviation = val, value); + BlockEngine.GetBlockInfo(this).maxDeviation = value; } } @@ -52,11 +52,11 @@ namespace TechbloxModdingAPI.Blocks /// public float MaximumForce { - get => BlockEngine.GetBlockInfo(this, (ServoReadOnlyStruct st) => st.servoVelocity); + get => BlockEngine.GetBlockInfo(this).servoVelocity; set { - BlockEngine.SetBlockInfo(this, (ref ServoReadOnlyStruct st, float val) => st.servoVelocity = val, value); + BlockEngine.GetBlockInfo(this).servoVelocity = value; } } @@ -65,11 +65,11 @@ namespace TechbloxModdingAPI.Blocks /// public bool Reverse { - get => BlockEngine.GetBlockInfo(this, (ServoReadOnlyStruct st) => st.reverse); + get => BlockEngine.GetBlockInfo(this).reverse; set { - BlockEngine.SetBlockInfo(this, (ref ServoReadOnlyStruct st, bool val) => st.reverse = val, value); + BlockEngine.GetBlockInfo(this).reverse = value; } } } diff --git a/TechbloxModdingAPI/Blocks/SfxBlock.cs b/TechbloxModdingAPI/Blocks/SfxBlock.cs index c72d37a..45453fb 100644 --- a/TechbloxModdingAPI/Blocks/SfxBlock.cs +++ b/TechbloxModdingAPI/Blocks/SfxBlock.cs @@ -22,7 +22,7 @@ namespace TechbloxModdingAPI.Blocks { get { - return BlockEngine.GetBlockInfo(this, (SoundSfxBlockDataEntityStruct obj) => obj.tweakableVolume); + return BlockEngine.GetBlockInfo(this).tweakableVolume; } set @@ -36,7 +36,7 @@ namespace TechbloxModdingAPI.Blocks { get { - return BlockEngine.GetBlockInfo(this, (SoundSfxBlockDataEntityStruct obj) => obj.tweakablePitch); + return BlockEngine.GetBlockInfo(this).tweakablePitch; } set @@ -50,7 +50,7 @@ namespace TechbloxModdingAPI.Blocks { get { - return BlockEngine.GetBlockInfo(this, (SoundSfxBlockDataEntityStruct obj) => obj.is3D); + return BlockEngine.GetBlockInfo(this).is3D; } set @@ -78,7 +78,7 @@ namespace TechbloxModdingAPI.Blocks { get { - return BlockEngine.GetBlockInfo(this, (SoundSfxBlockDataEntityStruct obj) => obj.soundEffectIndex); + return BlockEngine.GetBlockInfo(this).soundEffectIndex; } set @@ -162,7 +162,7 @@ namespace TechbloxModdingAPI.Blocks { get { - return BlockEngine.GetBlockInfo(this, (SoundSfxBlockDataEntityStruct obj) => obj.isLoopedBlock); + return BlockEngine.GetBlockInfo(this).isLoopedBlock; } set diff --git a/TechbloxModdingAPI/Blocks/SignalingBlock.cs b/TechbloxModdingAPI/Blocks/SignalingBlock.cs index b18521a..293e00d 100644 --- a/TechbloxModdingAPI/Blocks/SignalingBlock.cs +++ b/TechbloxModdingAPI/Blocks/SignalingBlock.cs @@ -67,7 +67,7 @@ namespace TechbloxModdingAPI.Blocks /// public uint InputCount { - get => BlockEngine.GetBlockInfo(this, (BlockPortsStruct st) => st.inputCount); + get => BlockEngine.GetBlockInfo(this).inputCount; } /// @@ -75,7 +75,7 @@ namespace TechbloxModdingAPI.Blocks /// public uint OutputCount { - get => BlockEngine.GetBlockInfo(this, (BlockPortsStruct st) => st.outputCount); + get => BlockEngine.GetBlockInfo(this).outputCount; } /// diff --git a/TechbloxModdingAPI/Blocks/SpawnPoint.cs b/TechbloxModdingAPI/Blocks/SpawnPoint.cs index ac6c014..0c5c75a 100644 --- a/TechbloxModdingAPI/Blocks/SpawnPoint.cs +++ b/TechbloxModdingAPI/Blocks/SpawnPoint.cs @@ -28,11 +28,11 @@ namespace TechbloxModdingAPI.Blocks /// public uint Lives { - get => BlockEngine.GetBlockInfo(this, (SpawnPointStatsEntityStruct st) => st.lives); + get => BlockEngine.GetBlockInfo(this).lives; set { - BlockEngine.SetBlockInfo(this, (ref SpawnPointStatsEntityStruct st, uint val) => st.lives = val, value); + BlockEngine.GetBlockInfo(this).lives = value; } } @@ -41,11 +41,11 @@ namespace TechbloxModdingAPI.Blocks /// public bool Damageable { - get => BlockEngine.GetBlockInfo(this, (SpawnPointStatsEntityStruct st) => st.canTakeDamage); + get => BlockEngine.GetBlockInfo(this).canTakeDamage; set { - BlockEngine.SetBlockInfo(this, (ref SpawnPointStatsEntityStruct st, bool val) => st.canTakeDamage = val, value); + BlockEngine.GetBlockInfo(this).canTakeDamage = value; } } @@ -54,11 +54,11 @@ namespace TechbloxModdingAPI.Blocks /// public bool GameOverEnabled { - get => BlockEngine.GetBlockInfo(this, (SpawnPointStatsEntityStruct st) => st.gameOverScreen); + get => BlockEngine.GetBlockInfo(this).gameOverScreen; set { - BlockEngine.SetBlockInfo(this, (ref SpawnPointStatsEntityStruct st, bool val) => st.gameOverScreen = val, value); + BlockEngine.GetBlockInfo(this).gameOverScreen = value; } } @@ -67,11 +67,11 @@ namespace TechbloxModdingAPI.Blocks /// public byte Team { - get => BlockEngine.GetBlockInfo(this, (SpawnPointIdsEntityStruct st) => st.teamId); + get => BlockEngine.GetBlockInfo(this).teamId; set { - BlockEngine.SetBlockInfo(this, (ref SpawnPointIdsEntityStruct st, byte val) => st.teamId = val, value); + BlockEngine.GetBlockInfo(this).teamId = value; } } } diff --git a/TechbloxModdingAPI/Blocks/TextBlock.cs b/TechbloxModdingAPI/Blocks/TextBlock.cs index 0e33b75..c3ee1b0 100644 --- a/TechbloxModdingAPI/Blocks/TextBlock.cs +++ b/TechbloxModdingAPI/Blocks/TextBlock.cs @@ -26,8 +26,8 @@ namespace TechbloxModdingAPI.Blocks /// The text block's current text. /// public string Text - { - get => BlockEngine.GetBlockInfo(this, (TextBlockDataStruct st) => st.textCurrent); + { + get => BlockEngine.GetBlockInfo(this).textCurrent; set { @@ -45,7 +45,7 @@ namespace TechbloxModdingAPI.Blocks /// public string TextBlockId { - get => BlockEngine.GetBlockInfo(this, (TextBlockDataStruct st) => st.textBlockID); + get => BlockEngine.GetBlockInfo(this).textBlockID; set { diff --git a/TechbloxModdingAPI/Blocks/Timer.cs b/TechbloxModdingAPI/Blocks/Timer.cs index 6337864..9803258 100644 --- a/TechbloxModdingAPI/Blocks/Timer.cs +++ b/TechbloxModdingAPI/Blocks/Timer.cs @@ -28,12 +28,11 @@ namespace TechbloxModdingAPI.Blocks /// public float Start { - get => BlockEngine.GetBlockInfo(this, (TimerBlockDataStruct st) => st.startTime); + get => BlockEngine.GetBlockInfo(this).startTime; set { - BlockEngine.SetBlockInfo(this, (ref TimerBlockDataStruct tbds, float val) => tbds.startTime = val, - value); + BlockEngine.GetBlockInfo(this).startTime = value; } } @@ -42,12 +41,11 @@ namespace TechbloxModdingAPI.Blocks /// public float End { - get => BlockEngine.GetBlockInfo(this, (TimerBlockDataStruct st) => st.endTime); + get => BlockEngine.GetBlockInfo(this).endTime; set { - BlockEngine.SetBlockInfo(this, (ref TimerBlockDataStruct tbds, float val) => tbds.endTime = val, - value); + BlockEngine.GetBlockInfo(this).endTime = value; } } @@ -56,12 +54,11 @@ namespace TechbloxModdingAPI.Blocks /// public bool DisplayMilliseconds { - get => BlockEngine.GetBlockInfo(this, (TimerBlockDataStruct st) => st.outputFormatHasMS); + get => BlockEngine.GetBlockInfo(this).outputFormatHasMS; set { - BlockEngine.SetBlockInfo(this, (ref TimerBlockDataStruct tbds, bool val) => tbds.outputFormatHasMS = val, - value); + BlockEngine.GetBlockInfo(this).outputFormatHasMS = value; } } @@ -70,12 +67,11 @@ namespace TechbloxModdingAPI.Blocks /// public int CurrentTime { - get => BlockEngine.GetBlockInfo(this, (TimerBlockLabelCacheEntityStruct st) => st.timeLastRenderFrameMS); + get => BlockEngine.GetBlockInfo(this).timeLastRenderFrameMS; set { - BlockEngine.SetBlockInfo(this, (ref TimerBlockLabelCacheEntityStruct tbds, int val) => tbds.timeLastRenderFrameMS = val, - value); + BlockEngine.GetBlockInfo(this).timeLastRenderFrameMS = value; } } } -- 2.30.2 From 858a5c9b5c4c8494b562548194ac4bf5bff3aa75 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Tue, 11 May 2021 00:56:46 +0200 Subject: [PATCH 175/252] Fix remaining errors, add support for managed entity DB --- TechbloxModdingAPI/Block.cs | 77 +++++----- TechbloxModdingAPI/Blocks/BlockEngine.cs | 10 ++ TechbloxModdingAPI/Blocks/DampedSpring.cs | 9 +- TechbloxModdingAPI/Blocks/MusicBlock.cs | 88 +++++------ TechbloxModdingAPI/Blocks/ObjectIdentifier.cs | 9 +- TechbloxModdingAPI/Blocks/SfxBlock.cs | 137 +++++++++--------- TechbloxModdingAPI/Blocks/SignalingBlock.cs | 1 - TechbloxModdingAPI/Blocks/TextBlock.cs | 11 +- TechbloxModdingAPI/Cluster.cs | 16 +- TechbloxModdingAPI/Players/FlyCamEngine.cs | 1 + TechbloxModdingAPI/SimBody.cs | 20 +-- .../Utility/ManagedApiExtensions.cs | 55 +++++++ ...piExtensions.cs => NativeApiExtensions.cs} | 5 +- TechbloxModdingAPI/Utility/OptionalRef.cs | 76 ++++++---- 14 files changed, 282 insertions(+), 233 deletions(-) create mode 100644 TechbloxModdingAPI/Utility/ManagedApiExtensions.cs rename TechbloxModdingAPI/Utility/{ApiExtensions.cs => NativeApiExtensions.cs} (92%) diff --git a/TechbloxModdingAPI/Block.cs b/TechbloxModdingAPI/Block.cs index b2d400d..5181723 100644 --- a/TechbloxModdingAPI/Block.cs +++ b/TechbloxModdingAPI/Block.cs @@ -322,13 +322,9 @@ namespace TechbloxModdingAPI get => BlockEngine.GetBlockInfo(this).scale.x < 0; set { - BlockEngine.SetBlockInfo(this, (ref ScalingEntityStruct st, bool val) => - st.scale.x = math.abs(st.scale.x) * (val ? -1 : 1), value); - BlockEngine.SetBlockInfo(this, (ref GFXPrefabEntityStructGPUI st, bool val) => - { - uint prefabId = PrefabsID.GetOrCreatePrefabID((ushort) Type, (byte) Material, 0, value); - st.prefabID = prefabId; - }, value); + var st = BlockEngine.GetBlockInfo(this); + st.scale.x = math.abs(st.scale.x) * (value ? -1 : 1); + BlockEngine.UpdatePrefab(this, (ushort) Type, (byte) Material, value); } } @@ -339,7 +335,8 @@ namespace TechbloxModdingAPI { get { - return BlockEngine.GetBlockInfo(this, (DBEntityStruct st) => (BlockIDs) st.DBID, BlockIDs.Invalid); + var opt = BlockEngine.GetBlockInfoOptional(this); + return opt ? (BlockIDs) opt.Get().DBID : BlockIDs.Invalid; } } @@ -350,18 +347,16 @@ namespace TechbloxModdingAPI { get { - byte index = BlockEngine.GetBlockInfo(this, (ColourParameterEntityStruct st) => st.indexInPalette, - byte.MaxValue); - return new BlockColor(index); + var opt = BlockEngine.GetBlockInfoOptional(this); + return new BlockColor(opt ? opt.Get().indexInPalette : byte.MaxValue); } set { - BlockEngine.SetBlockInfo(this, (ref ColourParameterEntityStruct color, BlockColor val) => - { //TODO: Check if setting to 255 works - color.indexInPalette = val.Index; - color.hasNetworkChange = true; - color.paletteColour = BlockEngine.ConvertBlockColor(color.indexInPalette); - }, value); + //TODO: Check if setting to 255 works + var color = BlockEngine.GetBlockInfo(this); + color.indexInPalette = value.Index; + color.hasNetworkChange = true; + color.paletteColour = BlockEngine.ConvertBlockColor(color.indexInPalette); } } @@ -373,11 +368,9 @@ namespace TechbloxModdingAPI get => BlockEngine.GetBlockInfo(this).paletteColour; set { - BlockEngine.SetBlockInfo(this, (ref ColourParameterEntityStruct color, float4 val) => - { - color.paletteColour = val; - color.hasNetworkChange = true; - }, value); + ref var color = ref BlockEngine.GetBlockInfo(this); + color.paletteColour = value; + color.hasNetworkChange = true; } } @@ -386,9 +379,16 @@ namespace TechbloxModdingAPI */ public BlockMaterial Material { - get => BlockEngine.GetBlockInfo(this, (CubeMaterialStruct cmst) => (BlockMaterial) cmst.materialId, BlockMaterial.Default); - set => BlockEngine.SetBlockInfo(this, - (ref CubeMaterialStruct cmst, BlockMaterial val) => cmst.materialId = (byte) val, value); + get + { + var opt = BlockEngine.GetBlockInfoOptional(this); + return opt ? (BlockMaterial) opt.Get().materialId : BlockMaterial.Default; + } + set + { + BlockEngine.GetBlockInfo(this).materialId = (byte) value; + BlockEngine.UpdatePrefab(this, (ushort) Type, (byte) value, Flipped); //TODO: Test default + } } /// @@ -397,13 +397,11 @@ namespace TechbloxModdingAPI /// public string Label { - get => BlockEngine.GetBlockInfoViewStruct(this, (TextLabelEntityViewStruct st) => st.textLabelComponent?.text); + get => BlockEngine.GetBlockInfoViewComponent(this).textLabelComponent?.text; set { - BlockEngine.SetBlockInfoViewStruct(this, (ref TextLabelEntityViewStruct text, string val) => - { - if (text.textLabelComponent != null) text.textLabelComponent.text = val; - }, value); + var comp = BlockEngine.GetBlockInfoViewComponent(this).textLabelComponent; + if (comp != null) comp.text = value; } } @@ -421,9 +419,8 @@ namespace TechbloxModdingAPI get { if (blockGroup != null) return blockGroup; - return blockGroup = BlockEngine.GetBlockInfo(this, - (BlockGroupEntityComponent bgec) => - bgec.currentBlockGroup == -1 ? null : new BlockGroup(bgec.currentBlockGroup, this)); + var bgec = BlockEngine.GetBlockInfo(this); + return blockGroup = bgec.currentBlockGroup == -1 ? null : new BlockGroup(bgec.currentBlockGroup, this); } set { @@ -434,9 +431,7 @@ namespace TechbloxModdingAPI return; } blockGroup?.RemoveInternal(this); - BlockEngine.SetBlockInfo(this, - (ref BlockGroupEntityComponent bgec, BlockGroup val) => bgec.currentBlockGroup = val?.Id ?? -1, - value); + BlockEngine.GetBlockInfo(this).currentBlockGroup = value?.Id ?? -1; value?.AddInternal(this); blockGroup = value; } @@ -466,10 +461,10 @@ namespace TechbloxModdingAPI /// The SimBody of the chunk or null if the block doesn't exist or not in simulation mode. public SimBody GetSimBody() { - return BlockEngine.GetBlockInfo(this, - (GridConnectionsEntityStruct st) => st.machineRigidBodyId != uint.MaxValue - ? new SimBody(st.machineRigidBodyId, st.clusterId) - : null); + var st = BlockEngine.GetBlockInfo(this); + return st.machineRigidBodyId != uint.MaxValue + ? new SimBody(st.machineRigidBodyId, st.clusterId) + : null; } /// @@ -555,7 +550,7 @@ namespace TechbloxModdingAPI //Lets improve that using delegates var block = New(Id.entityID, Id.groupID); - if (this.InitData.Group != null) + if (this.InitData.Valid) { block.InitData = this.InitData; Placed += block.OnPlacedInit; //Reset InitData of new object diff --git a/TechbloxModdingAPI/Blocks/BlockEngine.cs b/TechbloxModdingAPI/Blocks/BlockEngine.cs index 80e14f3..c23ee8d 100644 --- a/TechbloxModdingAPI/Blocks/BlockEngine.cs +++ b/TechbloxModdingAPI/Blocks/BlockEngine.cs @@ -80,6 +80,16 @@ namespace TechbloxModdingAPI.Blocks return ref entitiesDB.QueryEntityOrDefault(block); } + internal ref T GetBlockInfo(EcsObjectBase obj) where T : unmanaged, IEntityComponent + { + return ref entitiesDB.QueryEntityOrDefault(obj); + } + + public ref T GetBlockInfoViewComponent(Block block) where T : struct, IEntityViewComponent + { + return ref entitiesDB.QueryEntityOrDefault(block); + } + public void UpdateDisplayedBlock(EGID id) { if (!BlockExists(id)) return; diff --git a/TechbloxModdingAPI/Blocks/DampedSpring.cs b/TechbloxModdingAPI/Blocks/DampedSpring.cs index 3c92f72..4623d6d 100644 --- a/TechbloxModdingAPI/Blocks/DampedSpring.cs +++ b/TechbloxModdingAPI/Blocks/DampedSpring.cs @@ -21,8 +21,7 @@ namespace TechbloxModdingAPI.Blocks { get => BlockEngine.GetBlockInfo(this).springFrequency; - set => BlockEngine.SetBlockInfo(this, - (ref DampedSpringReadOnlyStruct dsrs, float val) => dsrs.springFrequency = val, value); + set => BlockEngine.GetBlockInfo(this).springFrequency = value; } /// @@ -41,8 +40,7 @@ namespace TechbloxModdingAPI.Blocks { get => BlockEngine.GetBlockInfo(this).springDamping; - set => BlockEngine.SetBlockInfo(this, - (ref DampedSpringReadOnlyStruct ljf, float val) => ljf.springDamping = val, value); + set => BlockEngine.GetBlockInfo(this).springDamping = value; } /// @@ -52,8 +50,7 @@ namespace TechbloxModdingAPI.Blocks { get => BlockEngine.GetBlockInfo(this).maxExtent; - set => BlockEngine.SetBlockInfo(this, - (ref DampedSpringReadOnlyStruct ljf, float val) => ljf.maxExtent = val, value); + set => BlockEngine.GetBlockInfo(this).maxExtent = value; } } } \ No newline at end of file diff --git a/TechbloxModdingAPI/Blocks/MusicBlock.cs b/TechbloxModdingAPI/Blocks/MusicBlock.cs index ea4aeca..51e96ee 100644 --- a/TechbloxModdingAPI/Blocks/MusicBlock.cs +++ b/TechbloxModdingAPI/Blocks/MusicBlock.cs @@ -33,8 +33,7 @@ namespace TechbloxModdingAPI.Blocks set { - BlockEngine.SetBlockInfo(this, - (ref MusicBlockDataEntityStruct msdes, byte val) => msdes.trackIndx = val, value); + BlockEngine.GetBlockInfo(this).trackIndx = value; } } @@ -42,24 +41,22 @@ namespace TechbloxModdingAPI.Blocks { get { - return BlockEngine.GetBlockInfo(this, - (MusicBlockDataEntityStruct msdes) => msdes.fmod2DEventPaths.Get(msdes.trackIndx)); + var msdes = BlockEngine.GetBlockInfo(this); + return msdes.fmod2DEventPaths.Get(msdes.trackIndx); } set { - BlockEngine.SetBlockInfo(this, (ref MusicBlockDataEntityStruct msdes, Guid val) => + ref var msdes = ref BlockEngine.GetBlockInfo(this); + for (byte i = 0; i < msdes.fmod2DEventPaths.Count(); i++) { - for (byte i = 0; i < msdes.fmod2DEventPaths.Count(); i++) + Guid track = msdes.fmod2DEventPaths.Get(i); + if (track == value) { - Guid track = msdes.fmod2DEventPaths.Get(i); - if (track == val) - { - msdes.trackIndx = i; - break; - } + msdes.trackIndx = i; + break; } - }, value); + } } } @@ -67,15 +64,13 @@ namespace TechbloxModdingAPI.Blocks { get { - return BlockEngine.GetBlockInfo(this, (MusicBlockDataEntityStruct msdes) => + var msdes = BlockEngine.GetBlockInfo(this); + Guid[] tracks = new Guid[msdes.fmod2DEventPaths.Count()]; + for (byte i = 0; i < tracks.Length; i++) { - Guid[] tracks = new Guid[msdes.fmod2DEventPaths.Count()]; - for (byte i = 0; i < tracks.Length; i++) - { - tracks[i] = msdes.fmod2DEventPaths.Get(i); - } - return tracks; - }); + tracks[i] = msdes.fmod2DEventPaths.Get(i); + } + return tracks; } } @@ -88,8 +83,7 @@ namespace TechbloxModdingAPI.Blocks set { - BlockEngine.SetBlockInfo(this, - (ref MusicBlockDataEntityStruct msdes, float val) => msdes.tweakableVolume = val, value); + BlockEngine.GetBlockInfo(this).tweakableVolume = value; } } @@ -98,14 +92,12 @@ namespace TechbloxModdingAPI.Blocks get { //Assert.Log("Block exists: " + Exists); - return BlockEngine.GetBlockInfo(this, - (MusicBlockDataEntityStruct msdes) => (ChannelType) msdes.channelType); + return (ChannelType) BlockEngine.GetBlockInfo(this).channelType; } set { - BlockEngine.SetBlockInfo(this, - (ref MusicBlockDataEntityStruct msdes, ChannelType val) => msdes.channelType = (byte) val, value); + BlockEngine.GetBlockInfo(this).channelType = (byte) value; } } @@ -113,33 +105,31 @@ namespace TechbloxModdingAPI.Blocks { get { - return BlockEngine.GetBlockInfo(this, - (MusicBlockDataEntityStruct msdes) => msdes.isPlaying); + return BlockEngine.GetBlockInfo(this).isPlaying; } set { - BlockEngine.SetBlockInfo(this, (ref MusicBlockDataEntityStruct msdes, bool val) => + ref var msdes = ref BlockEngine.GetBlockInfo(this); + if (msdes.isPlaying == value) return; + if (value) { - if (msdes.isPlaying == val) return; - if (val) - { - // start playing - EventInstance inst = RuntimeManager.CreateInstance(msdes.fmod2DEventPaths.Get(msdes.trackIndx)); - inst.setVolume(msdes.tweakableVolume / 100f); - inst.start(); - msdes.eventHandle = inst.handle; - } - else - { - // stop playing - EventInstance inst = default(EventInstance); - inst.handle = msdes.eventHandle; - inst.stop(FMOD.Studio.STOP_MODE.ALLOWFADEOUT); - inst.release(); - } - msdes.isPlaying = val; - }, value); + // start playing + EventInstance inst = RuntimeManager.CreateInstance(msdes.fmod2DEventPaths.Get(msdes.trackIndx)); + inst.setVolume(msdes.tweakableVolume / 100f); + inst.start(); + msdes.eventHandle = inst.handle; + } + else + { + // stop playing + EventInstance inst = default(EventInstance); + inst.handle = msdes.eventHandle; + inst.stop(FMOD.Studio.STOP_MODE.ALLOWFADEOUT); + inst.release(); + } + + msdes.isPlaying = value; } } } diff --git a/TechbloxModdingAPI/Blocks/ObjectIdentifier.cs b/TechbloxModdingAPI/Blocks/ObjectIdentifier.cs index fe2d657..046054b 100644 --- a/TechbloxModdingAPI/Blocks/ObjectIdentifier.cs +++ b/TechbloxModdingAPI/Blocks/ObjectIdentifier.cs @@ -16,14 +16,11 @@ namespace TechbloxModdingAPI.Blocks public char Identifier { - get => (char) BlockEngine.GetBlockInfo(this).objectId + 'A'; + get => (char) (BlockEngine.GetBlockInfo(this).objectId + 'A'); set { - BlockEngine.SetBlockInfo(this, (ref ObjectIdEntityStruct st, char val) => - { - st.objectId = (byte) (val - 'A'); - Label = val + ""; //The label isn't updated automatically - }, value); + BlockEngine.GetBlockInfo(this).objectId = (byte) (value - 'A'); + Label = value + ""; //The label isn't updated automatically } } diff --git a/TechbloxModdingAPI/Blocks/SfxBlock.cs b/TechbloxModdingAPI/Blocks/SfxBlock.cs index 45453fb..6b6ab36 100644 --- a/TechbloxModdingAPI/Blocks/SfxBlock.cs +++ b/TechbloxModdingAPI/Blocks/SfxBlock.cs @@ -27,8 +27,7 @@ namespace TechbloxModdingAPI.Blocks set { - BlockEngine.SetBlockInfo(this, - (ref SoundSfxBlockDataEntityStruct obj, float val) => obj.tweakableVolume = val, value); + BlockEngine.GetBlockInfo(this).tweakableVolume = value; } } @@ -41,8 +40,7 @@ namespace TechbloxModdingAPI.Blocks set { - BlockEngine.SetBlockInfo(this, - (ref SoundSfxBlockDataEntityStruct obj, float val) => obj.tweakablePitch = val, value); + BlockEngine.GetBlockInfo(this).tweakablePitch = value; } } @@ -55,8 +53,7 @@ namespace TechbloxModdingAPI.Blocks set { - BlockEngine.SetBlockInfo(this, - (ref SoundSfxBlockDataEntityStruct obj, bool val) => obj.is3D = val, value); + BlockEngine.GetBlockInfo(this).is3D = value; } } @@ -64,13 +61,12 @@ namespace TechbloxModdingAPI.Blocks { get { - return BlockEngine.GetBlockInfo(this, (SoundSfxBlockDataEntityStruct obj) => (ChannelType)obj.channelType); + return (ChannelType) BlockEngine.GetBlockInfo(this).channelType; } set { - BlockEngine.SetBlockInfo(this, - (ref SoundSfxBlockDataEntityStruct obj, ChannelType val) => obj.tweakableVolume = (byte) val, value); + BlockEngine.GetBlockInfo(this).channelType = (byte) value; } } @@ -83,8 +79,7 @@ namespace TechbloxModdingAPI.Blocks set { - BlockEngine.SetBlockInfo(this, - (ref SoundSfxBlockDataEntityStruct obj, byte val) => obj.soundEffectIndex = val, value); + BlockEngine.GetBlockInfo(this).soundEffectIndex = value; } } @@ -93,35 +88,36 @@ namespace TechbloxModdingAPI.Blocks { get { - return BlockEngine.GetBlockInfo(this, - (SoundSfxBlockDataEntityStruct obj) => obj.is3D ? obj.fmod3DEventPaths.Get(obj.soundEffectIndex) : obj.fmod2DEventPaths.Get(obj.soundEffectIndex)); + var obj = BlockEngine.GetBlockInfo(this); + return obj.is3D + ? obj.fmod3DEventPaths.Get(obj.soundEffectIndex) + : obj.fmod2DEventPaths.Get(obj.soundEffectIndex); } set { - BlockEngine.SetBlockInfo(this, (ref SoundSfxBlockDataEntityStruct obj, Guid val) => + var obj = BlockEngine.GetBlockInfo(this); + for (byte i = 0; i < obj.fmod2DEventPaths.Count(); i++) { - for (byte i = 0; i < obj.fmod2DEventPaths.Count(); i++) + Guid track = obj.fmod2DEventPaths.Get(i); + if (track == value) { - Guid track = obj.fmod2DEventPaths.Get(i); - if (track == val) - { - obj.soundEffectIndex = i; - obj.is3D = false; - return; - } + obj.soundEffectIndex = i; + obj.is3D = false; + return; } - for (byte i = 0; i < obj.fmod3DEventPaths.Count(); i++) + } + + for (byte i = 0; i < obj.fmod3DEventPaths.Count(); i++) + { + Guid track = obj.fmod3DEventPaths.Get(i); + if (track == value) { - Guid track = obj.fmod3DEventPaths.Get(i); - if (track == val) - { - obj.soundEffectIndex = i; - obj.is3D = true; - return; - } + obj.soundEffectIndex = i; + obj.is3D = true; + return; } - }, value); + } } } @@ -130,31 +126,29 @@ namespace TechbloxModdingAPI.Blocks { get { - return BlockEngine.GetBlockInfo(this, (SoundSfxBlockDataEntityStruct obj) => + var obj = BlockEngine.GetBlockInfo(this); + Guid[] tracks = new Guid[obj.fmod2DEventPaths.Count()]; + for (byte i = 0; i < tracks.Length; i++) { - Guid[] tracks = new Guid[obj.fmod2DEventPaths.Count()]; - for (byte i = 0; i < tracks.Length; i++) - { - tracks[i] = obj.fmod2DEventPaths.Get(i); - } - return tracks; - }); + tracks[i] = obj.fmod2DEventPaths.Get(i); + } + + return tracks; } } - + public Guid[] Tracks3D { get { - return BlockEngine.GetBlockInfo(this, (SoundSfxBlockDataEntityStruct obj) => + var obj = BlockEngine.GetBlockInfo(this); + Guid[] tracks = new Guid[obj.fmod3DEventPaths.Count()]; + for (byte i = 0; i < tracks.Length; i++) { - Guid[] tracks = new Guid[obj.fmod3DEventPaths.Count()]; - for (byte i = 0; i < tracks.Length; i++) - { - tracks[i] = obj.fmod2DEventPaths.Get(i); - } - return tracks; - }); + tracks[i] = obj.fmod2DEventPaths.Get(i); + } + + return tracks; } } @@ -167,8 +161,7 @@ namespace TechbloxModdingAPI.Blocks set { - BlockEngine.SetBlockInfo(this, - (ref SoundSfxBlockDataEntityStruct obj, bool val) => obj.isLoopedBlock = val, value); + BlockEngine.GetBlockInfo(this).isLoopedBlock = value; } } @@ -176,33 +169,33 @@ namespace TechbloxModdingAPI.Blocks { get { - return BlockEngine.GetBlockInfo(this, - (SoundSfxBlockDataEntityStruct obj) => obj.isPlaying); + return BlockEngine.GetBlockInfo(this).isPlaying; } set { - BlockEngine.SetBlockInfo(this, (ref SoundSfxBlockDataEntityStruct obj, bool val) => + var obj = BlockEngine.GetBlockInfo(this); + if (obj.isPlaying == value) return; + if (value) { - if (obj.isPlaying == val) return; - if (val) - { - // start playing - EventInstance inst = RuntimeManager.CreateInstance(obj.is3D ? obj.fmod3DEventPaths.Get(obj.soundEffectIndex) : obj.fmod2DEventPaths.Get(obj.soundEffectIndex)); - inst.setVolume(obj.tweakableVolume / 100f); - inst.start(); - obj.eventHandle = inst.handle; - } - else - { - // stop playing - EventInstance inst = default(EventInstance); - inst.handle = obj.eventHandle; - inst.stop(FMOD.Studio.STOP_MODE.ALLOWFADEOUT); - inst.release(); - } - obj.isPlaying = val; - }, value); + // start playing + EventInstance inst = RuntimeManager.CreateInstance(obj.is3D + ? obj.fmod3DEventPaths.Get(obj.soundEffectIndex) + : obj.fmod2DEventPaths.Get(obj.soundEffectIndex)); + inst.setVolume(obj.tweakableVolume / 100f); + inst.start(); + obj.eventHandle = inst.handle; + } + else + { + // stop playing + EventInstance inst = default(EventInstance); + inst.handle = obj.eventHandle; + inst.stop(FMOD.Studio.STOP_MODE.ALLOWFADEOUT); + inst.release(); + } + + obj.isPlaying = value; } } } diff --git a/TechbloxModdingAPI/Blocks/SignalingBlock.cs b/TechbloxModdingAPI/Blocks/SignalingBlock.cs index 293e00d..45b5aa6 100644 --- a/TechbloxModdingAPI/Blocks/SignalingBlock.cs +++ b/TechbloxModdingAPI/Blocks/SignalingBlock.cs @@ -109,7 +109,6 @@ namespace TechbloxModdingAPI.Blocks /// The localized port name. public string PortName(byte port, bool input) { - BlockPortsStruct bps = BlockEngine.GetBlockInfo(this, (BlockPortsStruct a) => a); PortEntityStruct pes = SignalEngine.GetPortByOffset(this, port, input); return pes.portNameLocalised; } diff --git a/TechbloxModdingAPI/Blocks/TextBlock.cs b/TechbloxModdingAPI/Blocks/TextBlock.cs index c3ee1b0..99c753a 100644 --- a/TechbloxModdingAPI/Blocks/TextBlock.cs +++ b/TechbloxModdingAPI/Blocks/TextBlock.cs @@ -32,11 +32,9 @@ namespace TechbloxModdingAPI.Blocks set { if (value == null) value = ""; - BlockEngine.SetBlockInfo(this, (ref TextBlockDataStruct tbds, string val) => - { - tbds.textCurrent.Set(val); - tbds.textStored.Set(val, true); - }, value); + var tbds = BlockEngine.GetBlockInfo(this); + tbds.textCurrent.Set(value); + tbds.textStored.Set(value, true); } } @@ -50,8 +48,7 @@ namespace TechbloxModdingAPI.Blocks set { if (value == null) value = ""; - BlockEngine.SetBlockInfo(this, (ref TextBlockDataStruct tbds, string val) => - tbds.textBlockID.Set(val), value); + BlockEngine.GetBlockInfo(this).textBlockID.Set(value); } } } diff --git a/TechbloxModdingAPI/Cluster.cs b/TechbloxModdingAPI/Cluster.cs index 11b995c..2544194 100644 --- a/TechbloxModdingAPI/Cluster.cs +++ b/TechbloxModdingAPI/Cluster.cs @@ -8,9 +8,9 @@ namespace TechbloxModdingAPI /// Represnts a cluster of blocks in time running mode, meaning blocks that are connected either directly or via joints. /// Only exists if a cluster destruction manager is present. Static blocks like grass and dirt aren't part of a cluster. /// - public class Cluster + public class Cluster : EcsObjectBase { - public EGID Id { get; } + public override EGID Id { get; } public Cluster(EGID id) { @@ -23,20 +23,20 @@ namespace TechbloxModdingAPI public float InitialHealth { - get => Block.BlockEngine.GetBlockInfo(Id).initialHealth; - set => Block.BlockEngine.GetBlockInfo(Id).initialHealth = value; + get => Block.BlockEngine.GetBlockInfo(this).initialHealth; + set => Block.BlockEngine.GetBlockInfo(this).initialHealth = value; } public float CurrentHealth { - get => Block.BlockEngine.GetBlockInfo(Id).currentHealth; - set => Block.BlockEngine.GetBlockInfo(Id).currentHealth = value; + get => Block.BlockEngine.GetBlockInfo(this).currentHealth; + set => Block.BlockEngine.GetBlockInfo(this).currentHealth = value; } public float HealthMultiplier { - get => Block.BlockEngine.GetBlockInfo(Id).healthMultiplier; - set => Block.BlockEngine.GetBlockInfo(Id).healthMultiplier = value; + get => Block.BlockEngine.GetBlockInfo(this).healthMultiplier; + set => Block.BlockEngine.GetBlockInfo(this).healthMultiplier = value; } /// diff --git a/TechbloxModdingAPI/Players/FlyCamEngine.cs b/TechbloxModdingAPI/Players/FlyCamEngine.cs index 0b98071..cd52363 100644 --- a/TechbloxModdingAPI/Players/FlyCamEngine.cs +++ b/TechbloxModdingAPI/Players/FlyCamEngine.cs @@ -1,6 +1,7 @@ using Svelto.ECS; using Techblox.FlyCam; using TechbloxModdingAPI.Engines; +using TechbloxModdingAPI.Utility; namespace TechbloxModdingAPI.Players { diff --git a/TechbloxModdingAPI/SimBody.cs b/TechbloxModdingAPI/SimBody.cs index dd7429e..55c6a9e 100644 --- a/TechbloxModdingAPI/SimBody.cs +++ b/TechbloxModdingAPI/SimBody.cs @@ -12,9 +12,9 @@ namespace TechbloxModdingAPI /// /// A rigid body (like a chunk of connected blocks) during simulation. /// - public class SimBody : IEquatable, IEquatable + public class SimBody : EcsObjectBase, IEquatable, IEquatable { - public EGID Id { get; } + public override EGID Id { get; } /// /// The cluster this chunk belongs to, or null if no cluster destruction manager present or the chunk doesn't exist. @@ -92,26 +92,26 @@ namespace TechbloxModdingAPI public float InitialHealth { - get => Block.BlockEngine.GetBlockInfo(Id).initialHealth; - set => Block.BlockEngine.GetBlockInfo(Id).initialHealth = value; + get => Block.BlockEngine.GetBlockInfo(this).initialHealth; + set => Block.BlockEngine.GetBlockInfo(this).initialHealth = value; } public float CurrentHealth { - get => Block.BlockEngine.GetBlockInfo(Id).currentHealth; - set => Block.BlockEngine.GetBlockInfo(Id).currentHealth = value; + get => Block.BlockEngine.GetBlockInfo(this).currentHealth; + set => Block.BlockEngine.GetBlockInfo(this).currentHealth = value; } public float HealthMultiplier { - get => Block.BlockEngine.GetBlockInfo(Id).healthMultiplier; - set => Block.BlockEngine.GetBlockInfo(Id).healthMultiplier = value; + get => Block.BlockEngine.GetBlockInfo(this).healthMultiplier; + set => Block.BlockEngine.GetBlockInfo(this).healthMultiplier = value; } /// /// Whether the body can be moved or static. /// - public bool Static => Block.BlockEngine.GetBlockInfo(Id).isStatic; //Setting it doesn't have any effect + public bool Static => Block.BlockEngine.GetBlockInfo(this).isStatic; //Setting it doesn't have any effect /// /// The rigid bodies connected to this one via functional joints (broken ones don't count). @@ -132,7 +132,7 @@ namespace TechbloxModdingAPI private ref RigidBodyEntityStruct GetStruct() { - return ref Block.BlockEngine.GetBlockInfo(Id); + return ref Block.BlockEngine.GetBlockInfo(this); } public override string ToString() diff --git a/TechbloxModdingAPI/Utility/ManagedApiExtensions.cs b/TechbloxModdingAPI/Utility/ManagedApiExtensions.cs new file mode 100644 index 0000000..2616ab7 --- /dev/null +++ b/TechbloxModdingAPI/Utility/ManagedApiExtensions.cs @@ -0,0 +1,55 @@ +using Svelto.ECS; +using Svelto.ECS.Hybrid; +using TechbloxModdingAPI.Blocks; + +namespace TechbloxModdingAPI.Utility +{ + public static class ManagedApiExtensions + { + /// + /// Attempts to query an entity and returns an optional that contains the result if succeeded. + /// This overload does not take initializer data into account. + /// + /// The entities DB + /// The EGID to query + /// The component type to query + /// An optional that contains the result on success or is empty if not found + public static OptionalRef QueryEntityOptional(this EntitiesDB entitiesDB, EGID egid) + where T : struct, IEntityViewComponent + { + return entitiesDB.TryQueryEntitiesAndIndex(egid, out uint index, out var array) + ? new OptionalRef(array, index) + : new OptionalRef(); + } + + /// + /// Attempts to query an entity and returns the result or a dummy value that can be modified. + /// + /// + /// + /// + /// + public static OptionalRef QueryEntityOptional(this EntitiesDB entitiesDB, EcsObjectBase obj) + where T : struct, IEntityViewComponent + { + var opt = QueryEntityOptional(entitiesDB, obj.Id); + return opt ? opt : new OptionalRef(obj, true); + } + + /// + /// Attempts to query an entity and returns the result or a dummy value that can be modified. + /// + /// + /// + /// + /// + public static ref T QueryEntityOrDefault(this EntitiesDB entitiesDB, EcsObjectBase obj) + where T : struct, IEntityViewComponent + { + var opt = QueryEntityOptional(entitiesDB, obj.Id); + if (opt) return ref opt.Get(); + if (obj.InitData.Valid) return ref obj.InitData.Initializer(obj.Id).GetOrCreate(); + return ref opt.Get(); //Default value + } + } +} \ No newline at end of file diff --git a/TechbloxModdingAPI/Utility/ApiExtensions.cs b/TechbloxModdingAPI/Utility/NativeApiExtensions.cs similarity index 92% rename from TechbloxModdingAPI/Utility/ApiExtensions.cs rename to TechbloxModdingAPI/Utility/NativeApiExtensions.cs index 3da1a67..701e42f 100644 --- a/TechbloxModdingAPI/Utility/ApiExtensions.cs +++ b/TechbloxModdingAPI/Utility/NativeApiExtensions.cs @@ -3,10 +3,11 @@ using TechbloxModdingAPI.Blocks; namespace TechbloxModdingAPI.Utility { - public static class ApiExtensions + public static class NativeApiExtensions { /// /// Attempts to query an entity and returns an optional that contains the result if succeeded. + /// This overload does not take initializer data into account. /// /// The entities DB /// The EGID to query @@ -31,7 +32,7 @@ namespace TechbloxModdingAPI.Utility where T : unmanaged, IEntityComponent { var opt = QueryEntityOptional(entitiesDB, obj.Id); - return opt ? opt : new OptionalRef(obj); + return opt ? opt : new OptionalRef(obj, true); } /// diff --git a/TechbloxModdingAPI/Utility/OptionalRef.cs b/TechbloxModdingAPI/Utility/OptionalRef.cs index 2323431..c5cfb83 100644 --- a/TechbloxModdingAPI/Utility/OptionalRef.cs +++ b/TechbloxModdingAPI/Utility/OptionalRef.cs @@ -1,44 +1,53 @@ using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using TechbloxModdingAPI.Blocks; +using System.Runtime.InteropServices; using Svelto.DataStructures; using Svelto.ECS; -namespace TechbloxModdingAPI +namespace TechbloxModdingAPI.Utility { - public ref struct OptionalRef where T : unmanaged, IEntityComponent + [StructLayout(LayoutKind.Explicit)] //Make the array and managedArray fields take up the same space + public ref struct OptionalRef where T : struct, IEntityComponent { - private bool exists; - private NB array; - private uint index; - private EntityInitializer initializer; + [FieldOffset(0)] private readonly State state; + [FieldOffset(1)] private readonly uint index; + [FieldOffset(5)] private NB array; + [FieldOffset(5)] private MB managedArray; + [FieldOffset(1)] private readonly EntityInitializer initializer; + //The possible fields are: (index && (array || managedArray)) || initializer public OptionalRef(NB array, uint index) { - exists = true; + state = State.Native; this.array = array; this.index = index; initializer = default; } - + + public OptionalRef(MB array, uint index) + { + state = State.Managed; + managedArray = array; + this.index = index; + initializer = default; + this.array = default; + } + /// /// Wraps the initializer data, if present. /// /// The object with the initializer - public OptionalRef(EcsObjectBase obj) + /// Whether the struct is unmanaged + public OptionalRef(EcsObjectBase obj, bool unmanaged) { if (obj.InitData.Valid) { initializer = obj.InitData.Initializer(obj.Id); - exists = true; + state = (unmanaged ? State.Native : State.Managed) | State.Initializer; } else { initializer = default; - exists = false; + state = State.Empty; } array = default; index = default; @@ -50,31 +59,36 @@ namespace TechbloxModdingAPI /// The value or the default value public ref T Get() { - if (!exists) return ref CompRefCache.Default; - if (initializer.EGID == EGID.Empty) - return ref array[index]; - return ref initializer.GetOrCreate(); + if (state == State.Empty) return ref CompRefCache.Default; + if ((state & State.Initializer) != State.Empty) return ref initializer.GetOrCreate(); + if ((state & State.Native) != State.Empty) return ref array[index]; + return ref managedArray[index]; } - public bool Exists => exists; + public bool Exists => state != State.Empty; public static implicit operator T(OptionalRef opt) => opt.Get(); - public static implicit operator bool(OptionalRef opt) => opt.exists; - - /*public delegate ref TR Mapper(ref T component) where TR : unmanaged; - public unsafe delegate TR* PMapper(T* component) where TR : unmanaged; - - public unsafe OptionalRef Map(PMapper mapper) where TR : unmanaged => - exists ? new OptionalRef(ref *mapper(pointer)) : new OptionalRef();*/ + public static implicit operator bool(OptionalRef opt) => opt.state != State.Empty; /// /// Creates an instance of a struct T that can be referenced. /// - /// The struct type to cache - private struct CompRefCache where TR : unmanaged + internal struct CompRefCache { - public static TR Default; + public static T Default; + } + + /// + /// A byte that holds state in its bits. + /// + [Flags] + private enum State : byte + { + Empty, + Native, + Managed, + Initializer = 4 } } } \ No newline at end of file -- 2.30.2 From 3eef859095a289b29bd5ce61faec2302926efdc2 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Tue, 11 May 2021 22:56:36 +0200 Subject: [PATCH 176/252] Update gen_csproj script and references --- Automation/gen_csproj.py | 8 ++++---- TechbloxModdingAPI/TechbloxModdingAPI.csproj | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Automation/gen_csproj.py b/Automation/gen_csproj.py index af00dd1..515bcda 100755 --- a/Automation/gen_csproj.py +++ b/Automation/gen_csproj.py @@ -27,7 +27,7 @@ def buildReferencesXml(path): return "\n \n" + "".join(result) + " \n" if __name__ == "__main__": - parser = argparse.ArgumentParser(description="Generate GamecraftModdingAPI.csproj") + parser = argparse.ArgumentParser(description="Generate TechbloxModdingAPI.csproj") # TODO (maybe?): add params for custom csproj read and write locations args = parser.parse_args() @@ -35,8 +35,8 @@ if __name__ == "__main__": asmXml = buildReferencesXml("../ref/TechbloxPreview_Data/Managed") # print(asmXml) - with open("../GamecraftModdingAPI/GamecraftModdingAPI.csproj", "r") as xmlFile: - print("Parsing GamecraftModdingAPI.csproj") + with open("../TechbloxModdingAPI/TechbloxModdingAPI.csproj", "r") as xmlFile: + print("Parsing TechbloxModdingAPI.csproj") fileStr = xmlFile.read() # print(fileStr) depsStart = re.search(r"\ + + + + \ No newline at end of file diff --git a/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs b/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs index 03d03a5..8f5298f 100644 --- a/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs +++ b/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs @@ -13,6 +13,7 @@ using RobocraftX.Common.Input; using TechbloxModdingAPI.Blocks; using TechbloxModdingAPI.Commands; using TechbloxModdingAPI.Input; +using TechbloxModdingAPI.Interface.IMGUI; using TechbloxModdingAPI.Players; using TechbloxModdingAPI.Utility; @@ -210,10 +211,10 @@ namespace TechbloxModdingAPI.Tests Logging.Log("Compatible TechbloxScripting detected"); } // Interface test - /*Interface.IMGUI.Group uiGroup = new Group(new Rect(20, 20, 200, 500), "TechbloxModdingAPI_UITestGroup", true); - Interface.IMGUI.Button button = new Button("TEST"); + /*Group uiGroup = new Group(new Rect(20, 20, 200, 500), "TechbloxModdingAPI_UITestGroup", true); + var button = new Button("TEST"); button.OnClick += (b, __) => { Logging.MetaDebugLog($"Click on {((Interface.IMGUI.Button)b).Name}");}; - Interface.IMGUI.Button button2 = new Button("TEST2"); + var button2 = new Button("TEST2"); button2.OnClick += (b, __) => { Logging.MetaDebugLog($"Click on {((Interface.IMGUI.Button)b).Name}");}; Text uiText = new Text("This is text!", multiline: true); uiText.OnEdit += (t, txt) => { Logging.MetaDebugLog($"Text in {((Text)t).Name} is now '{txt}'"); }; diff --git a/TechbloxModdingAPI/Tests/TestRoot.cs b/TechbloxModdingAPI/Tests/TestRoot.cs index 2ac7c62..7177818 100644 --- a/TechbloxModdingAPI/Tests/TestRoot.cs +++ b/TechbloxModdingAPI/Tests/TestRoot.cs @@ -66,7 +66,7 @@ namespace TechbloxModdingAPI.Tests // flow control Game.Enter += (sender, args) => { GameTests().RunOn(RobocraftX.Schedulers.Lean.EveryFrameStepRunner_TimeRunningAndStopped); }; Game.Exit += (s, a) => state = "ReturningFromGame"; - Client.EnterMenu += (sender, args) => + Client.EnterMenu += (sender, args) => { if (state == "EnteringMenu") { diff --git a/TechbloxModdingAPI/Utility/ExceptionUtil.cs b/TechbloxModdingAPI/Utility/ExceptionUtil.cs index 0809e43..d11508b 100644 --- a/TechbloxModdingAPI/Utility/ExceptionUtil.cs +++ b/TechbloxModdingAPI/Utility/ExceptionUtil.cs @@ -6,7 +6,7 @@ namespace TechbloxModdingAPI.Utility public static class ExceptionUtil { /// - /// Invokes an event in a try-catch block to avoid propagating exceptions. + /// Invokes an event with a null-check. /// /// The event to emit, can be null /// Event sender @@ -14,16 +14,30 @@ namespace TechbloxModdingAPI.Utility /// Type of the event arguments public static void InvokeEvent(EventHandler handler, object sender, T args) { - try + handler?.Invoke(sender, args); + } + + /// + /// Wraps the event handler in a try-catch block to avoid propagating exceptions. + /// + /// The handler to wrap (not null) + /// Type of the event arguments + /// The wrapped handler + public static EventHandler WrapHandler(EventHandler handler) + { + return (sender, e) => { - handler?.Invoke(sender, args); - } - catch (Exception e) - { - EventRuntimeException wrappedException = - new EventRuntimeException($"EventHandler with arg type {typeof(T).Name} threw an exception", e); - Logging.LogWarning(wrappedException.ToString()); - } + try + { + handler(sender, e); + } + catch (Exception e1) + { + EventRuntimeException wrappedException = + new EventRuntimeException($"EventHandler with arg type {typeof(T).Name} threw an exception", e1); + Logging.LogWarning(wrappedException.ToString()); + } + }; } } } \ No newline at end of file diff --git a/TechbloxModdingAPI/Utility/GameEngineManager.cs b/TechbloxModdingAPI/Utility/GameEngineManager.cs index 603170c..fc51861 100644 --- a/TechbloxModdingAPI/Utility/GameEngineManager.cs +++ b/TechbloxModdingAPI/Utility/GameEngineManager.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; +using RobocraftX.StateSync; using Svelto.ECS; using TechbloxModdingAPI.Engines; @@ -60,18 +61,20 @@ namespace TechbloxModdingAPI.Utility } } - public static void RegisterEngines(EnginesRoot enginesRoot) + public static void RegisterEngines(StateSyncRegistrationHelper helper) { + var enginesRoot = helper.enginesRoot; _lastEngineRoot = enginesRoot; - IEntityFactory factory = enginesRoot.GenerateEntityFactory(); + IEntityFactory factory = enginesRoot.GenerateEntityFactory(); foreach (var key in _gameEngines.Keys) { Logging.MetaDebugLog($"Registering Game IApiEngine {_gameEngines[key].Name}"); - enginesRoot.AddEngine(_gameEngines[key]); - if (typeof(IFactoryEngine).IsAssignableFrom(_gameEngines[key].GetType())) - { - ((IFactoryEngine)_gameEngines[key]).Factory = factory; - } + if (_gameEngines[key] is IDeterministicEngine detEngine) + helper.AddDeterministicEngine(detEngine); + else + enginesRoot.AddEngine(_gameEngines[key]); + if (_gameEngines[key] is IFactoryEngine factEngine) + factEngine.Factory = factory; } } } diff --git a/TechbloxModdingAPI/Utility/MenuEngineManager.cs b/TechbloxModdingAPI/Utility/MenuEngineManager.cs index c3dd29c..3260563 100644 --- a/TechbloxModdingAPI/Utility/MenuEngineManager.cs +++ b/TechbloxModdingAPI/Utility/MenuEngineManager.cs @@ -69,9 +69,9 @@ namespace TechbloxModdingAPI.Utility { Logging.MetaDebugLog($"Registering Menu IApiEngine {_menuEngines[key].Name}"); enginesRoot.AddEngine(_menuEngines[key]); - if (typeof(IFactoryEngine).IsAssignableFrom(_menuEngines[key].GetType())) + if (_menuEngines[key] is IFactoryEngine factEngine) { - ((IFactoryEngine)_menuEngines[key]).Factory = factory; + factEngine.Factory = factory; } } } -- 2.30.2 From 220eb02a1996c38d3c2924ce9f13b692e520e0ed Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Tue, 25 May 2021 01:20:46 +0200 Subject: [PATCH 192/252] Return descriptions with command names, selected block/color fix --- TechbloxModdingAPI/Commands/ExistingCommands.cs | 15 ++++++--------- TechbloxModdingAPI/FlyCam.cs | 13 +++++++++++++ TechbloxModdingAPI/Player.cs | 4 ++-- TechbloxModdingAPI/Players/FlyCamEngine.cs | 12 ++++++++++++ 4 files changed, 33 insertions(+), 11 deletions(-) diff --git a/TechbloxModdingAPI/Commands/ExistingCommands.cs b/TechbloxModdingAPI/Commands/ExistingCommands.cs index 35dd199..dfd3921 100644 --- a/TechbloxModdingAPI/Commands/ExistingCommands.cs +++ b/TechbloxModdingAPI/Commands/ExistingCommands.cs @@ -1,4 +1,4 @@ -using System; +using System.Linq; using uREPL; @@ -27,16 +27,13 @@ namespace TechbloxModdingAPI.Commands } public static bool Exists(string commandName) - { + { return RuntimeCommands.HasRegistered(commandName); } - public static string[] GetCommandNames() - { - var keys = RuntimeCommands.table.Keys; - string[] res = new string[keys.Count]; - keys.CopyTo(res, 0); - return res; - } + public static (string Name, string Description)[] GetCommandNamesAndDescriptions() + { + return RuntimeCommands.table.Values.Select(command => (command.name, command.description)).ToArray(); + } } } diff --git a/TechbloxModdingAPI/FlyCam.cs b/TechbloxModdingAPI/FlyCam.cs index 201fd0a..edf0691 100644 --- a/TechbloxModdingAPI/FlyCam.cs +++ b/TechbloxModdingAPI/FlyCam.cs @@ -2,6 +2,7 @@ using RobocraftX.Physics; using Svelto.ECS; using Svelto.ECS.EntityStructs; using Techblox.FlyCam; +using TechbloxModdingAPI.Blocks; using TechbloxModdingAPI.Players; using TechbloxModdingAPI.Utility; using Unity.Mathematics; @@ -111,6 +112,18 @@ namespace TechbloxModdingAPI set => Engine.GetComponent(this).angularVelocity = value; } + /// + /// The player's selected block ID in their hand. + /// + /// The selected block. + public BlockIDs SelectedBlock => (BlockIDs)Engine.GetSelectedBlock(this); + + /// + /// The player's selected block color in their hand. + /// + /// The selected block's color. + public BlockColor SelectedColor => new BlockColor(Engine.GetSelectedColor(this)); + public static void Init() { GameEngineManager.AddGameEngine(Engine); diff --git a/TechbloxModdingAPI/Player.cs b/TechbloxModdingAPI/Player.cs index a5e5dc5..7d37f9b 100644 --- a/TechbloxModdingAPI/Player.cs +++ b/TechbloxModdingAPI/Player.cs @@ -313,7 +313,7 @@ namespace TechbloxModdingAPI { get { - return (BlockIDs)playerEngine.GetSelectedBlock(Id); + return BuildCamera.SelectedBlock; } } @@ -325,7 +325,7 @@ namespace TechbloxModdingAPI { get { - return new BlockColor(playerEngine.GetSelectedColor(Id)); + return BuildCamera.SelectedColor; } } diff --git a/TechbloxModdingAPI/Players/FlyCamEngine.cs b/TechbloxModdingAPI/Players/FlyCamEngine.cs index 2db12e5..7cad252 100644 --- a/TechbloxModdingAPI/Players/FlyCamEngine.cs +++ b/TechbloxModdingAPI/Players/FlyCamEngine.cs @@ -23,5 +23,17 @@ namespace TechbloxModdingAPI.Players { return ref entitiesDB.QueryEntityOrDefault(cam); } + + public ushort GetSelectedBlock(FlyCam cam) + { + var oc = entitiesDB.QueryEntityOptional(cam); + return oc ? (ushort) oc.Get().SelectedDBPartID : ushort.MaxValue; + } + + public byte GetSelectedColor(FlyCam cam) + { + var oc = entitiesDB.QueryEntityOptional(cam); + return oc ? oc.Get().indexInPalette : (byte) 255; + } } } \ No newline at end of file -- 2.30.2 From 5bfd0b7f1092c5410be5d28d573c67c411e652e7 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Fri, 28 May 2021 02:12:54 +0200 Subject: [PATCH 193/252] Integrate FlyCam class into Player Using QueryEntityOptional directly with the player properties Character structs are camera structs in build mode The FlyCam rotation is not updated in build mode, only the camera is --- TechbloxModdingAPI/FlyCam.cs | 132 -------- TechbloxModdingAPI/Main.cs | 1 - TechbloxModdingAPI/Player.FlyCamSettings.cs | 51 +++ TechbloxModdingAPI/Player.cs | 183 +++++----- TechbloxModdingAPI/Players/FlyCamEngine.cs | 39 --- .../Players/PlayerBuildingMode.cs | 3 +- TechbloxModdingAPI/Players/PlayerEngine.cs | 319 ++---------------- TechbloxModdingAPI/TechbloxModdingAPI.csproj | 1 + 8 files changed, 163 insertions(+), 566 deletions(-) delete mode 100644 TechbloxModdingAPI/FlyCam.cs create mode 100644 TechbloxModdingAPI/Player.FlyCamSettings.cs delete mode 100644 TechbloxModdingAPI/Players/FlyCamEngine.cs diff --git a/TechbloxModdingAPI/FlyCam.cs b/TechbloxModdingAPI/FlyCam.cs deleted file mode 100644 index edf0691..0000000 --- a/TechbloxModdingAPI/FlyCam.cs +++ /dev/null @@ -1,132 +0,0 @@ -using RobocraftX.Physics; -using Svelto.ECS; -using Svelto.ECS.EntityStructs; -using Techblox.FlyCam; -using TechbloxModdingAPI.Blocks; -using TechbloxModdingAPI.Players; -using TechbloxModdingAPI.Utility; -using Unity.Mathematics; -using UnityEngine; - -namespace TechbloxModdingAPI -{ - public class FlyCam : EcsObjectBase - { - private static FlyCamEngine Engine = new FlyCamEngine(); - - public override EGID Id { get; } - - public FlyCam(uint id) => Id = new EGID(id, Techblox.FlyCam.FlyCam.Group); - - /// - /// The local player's camera. - /// - public static FlyCam LocalCamera => new FlyCam(Player.LocalPlayer.Id); - - /// - /// The current position of the camera. - /// - public float3 Position - { - get => Engine.GetComponent(this).position; - set - { - Engine.GetComponent(this).position = value; - Engine.GetComponent(this).position = value; - } - } - - /// - /// The current rotation of the camera. - /// - public float3 Rotation - { - get => ((Quaternion) Engine.GetComponent(this).rotation).eulerAngles; - set - { - Engine.GetComponent(this).rotation = Quaternion.Euler(value); - Engine.GetComponent(this).rotation = Quaternion.Euler(value); - } - } - - /// - /// The current direction the camera is moving. - /// - public float3 MovementDirection - { - get => Engine.GetComponent(this).movementDirection; - set => Engine.GetComponent(this).movementDirection = value; - } - - /// - /// Whether the camera (player) is sprinting. - /// - public bool Sprinting - { - get => Engine.GetComponent(this).sprinting; - set => Engine.GetComponent(this).sprinting = value; - } - - /// - /// The speed setting of the camera. - /// - public float Speed - { - get => Engine.GetComponent(this).speed; - set => Engine.GetComponent(this).speed = value; - } - - /// - /// The multiplier setting to use when sprinting. - /// - public float SpeedSprintMultiplier - { - get => Engine.GetComponent(this).speedSprintMultiplier; - set => Engine.GetComponent(this).speedSprintMultiplier = value; - } - - /// - /// The acceleration setting of the camera. - /// - public float Acceleration - { - get => Engine.GetComponent(this).acceleration; - set => Engine.GetComponent(this).acceleration = value; - } - - /// - /// The current velocity of the camera. - /// - public float3 Velocity - { - get => Engine.GetComponent(this).velocity; - set => Engine.GetComponent(this).velocity = value; - } - - /// - /// The current angular velocity of the camera. - /// - public float3 AngularVelocity - { - get => Engine.GetComponent(this).angularVelocity; - set => Engine.GetComponent(this).angularVelocity = value; - } - - /// - /// The player's selected block ID in their hand. - /// - /// The selected block. - public BlockIDs SelectedBlock => (BlockIDs)Engine.GetSelectedBlock(this); - - /// - /// The player's selected block color in their hand. - /// - /// The selected block's color. - public BlockColor SelectedColor => new BlockColor(Engine.GetSelectedColor(this)); - - public static void Init() - { - GameEngineManager.AddGameEngine(Engine); - } - } -} \ No newline at end of file diff --git a/TechbloxModdingAPI/Main.cs b/TechbloxModdingAPI/Main.cs index af25bde..a390021 100644 --- a/TechbloxModdingAPI/Main.cs +++ b/TechbloxModdingAPI/Main.cs @@ -71,7 +71,6 @@ namespace TechbloxModdingAPI Input.FakeInput.Init(); // init object-oriented classes Player.Init(); - FlyCam.Init(); Block.Init(); BlockGroup.Init(); Wire.Init(); diff --git a/TechbloxModdingAPI/Player.FlyCamSettings.cs b/TechbloxModdingAPI/Player.FlyCamSettings.cs new file mode 100644 index 0000000..b947477 --- /dev/null +++ b/TechbloxModdingAPI/Player.FlyCamSettings.cs @@ -0,0 +1,51 @@ +using RobocraftX.Physics; +using Svelto.ECS; +using Svelto.ECS.EntityStructs; +using Techblox.FlyCam; +using TechbloxModdingAPI.Blocks; +using TechbloxModdingAPI.Players; +using TechbloxModdingAPI.Utility; +using Unity.Mathematics; +using UnityEngine; + +namespace TechbloxModdingAPI +{ + public partial class Player + { + /// + /// Whether the camera (player) is sprinting. + /// + public bool Sprinting + { + get => playerEngine.GetCharacterStruct(Id).Get().sprinting; + set => playerEngine.GetCharacterStruct(Id).Get().sprinting = value; + } + + /// + /// The speed setting of the camera. + /// + public float Speed + { + get => playerEngine.GetCharacterStruct(Id).Get().speed; + set => playerEngine.GetCharacterStruct(Id).Get().speed = value; + } + + /// + /// The multiplier setting to use when sprinting. + /// + public float SpeedSprintMultiplier + { + get => playerEngine.GetCharacterStruct(Id).Get().speedSprintMultiplier; + set => playerEngine.GetCharacterStruct(Id).Get().speedSprintMultiplier = value; + } + + /// + /// The acceleration setting of the camera. + /// + public float Acceleration + { + get => playerEngine.GetCharacterStruct(Id).Get().acceleration; + set => playerEngine.GetCharacterStruct(Id).Get().acceleration = value; + } + } +} \ No newline at end of file diff --git a/TechbloxModdingAPI/Player.cs b/TechbloxModdingAPI/Player.cs index 7d37f9b..02e28f5 100644 --- a/TechbloxModdingAPI/Player.cs +++ b/TechbloxModdingAPI/Player.cs @@ -1,17 +1,23 @@ using System; +using RobocraftX.Character; using Unity.Mathematics; using RobocraftX.Common; using RobocraftX.Common.Players; +using RobocraftX.Physics; using Svelto.ECS; +using Techblox.Camera; +using Techblox.FlyCam; using TechbloxModdingAPI.Blocks; using TechbloxModdingAPI.Players; +using TechbloxModdingAPI.Utility; +using UnityEngine; namespace TechbloxModdingAPI { /// /// An in-game player character. Any Leo you see is a player. /// - public class Player : IEquatable, IEquatable + public partial class Player : IEquatable, IEquatable { // static functionality private static PlayerEngine playerEngine = new PlayerEngine(); @@ -123,50 +129,33 @@ namespace TechbloxModdingAPI /// The position. public float3 Position { - get - { - return playerEngine.GetLocation(Id); - } - - set - { - playerEngine.SetLocation(Id, value, false); - } - } + get => playerEngine.GetCharacterStruct(Id).Get().position; + set => playerEngine.SetLocation(Id, value, false); + } /// /// The player's current rotation. /// /// The rotation. public float3 Rotation - { - get - { - return playerEngine.GetRotation(Id); - } - - set - { - playerEngine.SetRotation(Id, value); - } - } + { + get => ((Quaternion) (GameState.IsBuildMode() + ? playerEngine.GetCameraStruct(Id).Get().rotation + : playerEngine.GetCharacterStruct(Id).Get().rotation)).eulerAngles; + set => _ = GameState.IsBuildMode() + ? playerEngine.GetCameraStruct(Id).Get().rotation = quaternion.Euler(value) + : playerEngine.GetCharacterStruct(Id).Get().rotation = quaternion.Euler(value); + } /// /// The player's current velocity. /// /// The velocity. public float3 Velocity - { - get - { - return playerEngine.GetLinearVelocity(Id); - } - - set - { - playerEngine.SetLinearVelocity(Id, value); - } - } + { + get => playerEngine.GetCharacterStruct(Id).Get().velocity; + set => playerEngine.GetCharacterStruct(Id).Get().velocity = value; + } /// /// The player's current angular velocity. @@ -174,36 +163,18 @@ namespace TechbloxModdingAPI /// The angular velocity. public float3 AngularVelocity { - get - { - return playerEngine.GetAngularVelocity(Id); - } - - set - { - playerEngine.SetAngularVelocity(Id, value); - } + get => playerEngine.GetCharacterStruct(Id).Get().angularVelocity; + set => playerEngine.GetCharacterStruct(Id).Get().angularVelocity = value; } /// /// The player's mass. /// /// The mass. - public float Mass - { - get - { - return 1f / playerEngine.GetMass(Id).InverseMass; - } + public float Mass => + 1f / playerEngine.GetCharacterStruct(Id).Get().physicsMass.InverseMass; - // FIXME: Setting mass doesn't do anything - /*set - { - playerEngine.SetInverseMass(Id, 1f / value); - }*/ - } - - private float _ping = -1f; + private float _ping = -1f; /// /// The player's latest network ping time. @@ -213,10 +184,10 @@ namespace TechbloxModdingAPI { get { - float? temp = playerEngine.GetLastPingTime(Id, Type); - if (temp.HasValue) + var opt = playerEngine.GetPlayerStruct(Id, Type); + if (opt) { - _ping = temp.Value; + _ping = opt.Get().lastPingTimeSinceLevelLoad ?? _ping; } return _ping; } @@ -227,14 +198,15 @@ namespace TechbloxModdingAPI /// /// The initial health. public float InitialHealth - { - get => playerEngine.GetInitialHealth(Id); + { + get + { + var opt = playerEngine.GetCharacterStruct(Id); + return opt ? opt.Get().initialHealth : -1f; + } - set - { - playerEngine.SetInitialHealth(Id, value); - } - } + set => playerEngine.GetCharacterStruct(Id).Get().initialHealth = value; + } /// /// The player's current health in Simulation (aka Time Running) mode. @@ -242,12 +214,13 @@ namespace TechbloxModdingAPI /// The current health. public float CurrentHealth { - get => playerEngine.GetCurrentHealth(Id); + get + { + var opt = playerEngine.GetCharacterStruct(Id); + return opt ? opt.Get().currentHealth : -1f; + } - set - { - playerEngine.DamagePlayer(Id, CurrentHealth - value); - } + set => playerEngine.GetCharacterStruct(Id).Get().currentHealth = value; } /// @@ -255,14 +228,20 @@ namespace TechbloxModdingAPI /// /// true if damageable; otherwise, false. public bool Damageable - { - get => playerEngine.GetDamageable(Id); + { + get + { + var opt = playerEngine.GetCharacterStruct(Id); + return opt.Get().canTakeDamageStat; + } - set - { - playerEngine.SetDamageable(Id, value); - } - } + set + { + ref var healthStruct = ref playerEngine.GetCharacterStruct(Id).Get(); + healthStruct.canTakeDamage = value; + healthStruct.canTakeDamageStat = value; + } + } /// /// The player's lives when initially entering Simulation (aka Time Running) mode. @@ -270,9 +249,13 @@ namespace TechbloxModdingAPI /// The initial lives. public uint InitialLives { - get => playerEngine.GetInitialLives(Id); + get + { + var opt = playerEngine.GetCharacterStruct(Id); + return opt ? opt.Get().initialLives : uint.MaxValue; + } - set => playerEngine.SetInitialLives(Id, value); + set => playerEngine.GetCharacterStruct(Id).Get().initialLives = value; } /// @@ -281,19 +264,23 @@ namespace TechbloxModdingAPI /// The current lives. public uint CurrentLives { - get => playerEngine.GetCurrentLives(Id); + get + { + var opt = playerEngine.GetCharacterStruct(Id); + return opt ? opt.Get().currentLives : uint.MaxValue; + } - set => playerEngine.SetCurrentLives(Id, value); + set => playerEngine.GetCharacterStruct(Id).Get().currentLives = value; } - /// + /*/// /// Whether the Game Over screen is displayed for the player. /// /// true if game over; otherwise, false. public bool GameOver { get => playerEngine.GetGameOverScreen(Id); - } + }*/ /// /// Whether the player is dead. @@ -313,7 +300,8 @@ namespace TechbloxModdingAPI { get { - return BuildCamera.SelectedBlock; + var optstruct = playerEngine.GetCharacterStruct(Id); + return optstruct ? (BlockIDs) optstruct.Get().SelectedDBPartID : BlockIDs.Invalid; } } @@ -325,7 +313,8 @@ namespace TechbloxModdingAPI { get { - return BuildCamera.SelectedColor; + var optstruct = playerEngine.GetCharacterStruct(Id); + return optstruct ? new BlockColor(optstruct.Get().indexInPalette) : BlockColors.Default; } } @@ -337,7 +326,8 @@ namespace TechbloxModdingAPI { get { - return new BlockColor(playerEngine.GetSelectedColor(Id)); + var optstruct = playerEngine.GetCharacterStruct(Id); + return optstruct ? new BlockColor(optstruct.Get().indexInPalette) : BlockColors.Default; } } @@ -346,9 +336,11 @@ namespace TechbloxModdingAPI /// public Blueprint SelectedBlueprint { - get => playerEngine.GetPlayerStruct(Id, out LocalBlueprintInputStruct lbis) - ? new Blueprint(lbis.selectedBlueprintId) - : null; + get + { + var lbiso = playerEngine.GetPlayerStruct(Id, Type); + return lbiso ? new Blueprint(lbiso.Get().selectedBlueprintId) : null; + } set => BlockGroup._engine.SelectBlueprint(value?.Id ?? uint.MaxValue); } @@ -356,7 +348,7 @@ namespace TechbloxModdingAPI /// The player's mode in time stopped mode, determining what they place. /// public PlayerBuildingMode BuildingMode => (PlayerBuildingMode) playerEngine - .GetCharacterStruct(Id, out _).timeStoppedContext; + .GetCharacterStruct(Id).Get().timeStoppedContext; // object methods @@ -373,7 +365,7 @@ namespace TechbloxModdingAPI float3 location = new float3(x, y, z); if (relative) { - location += playerEngine.GetLocation(Id); + location += Position; } playerEngine.SetLocation(Id, location, exitSeat: exitSeat); } @@ -395,7 +387,7 @@ namespace TechbloxModdingAPI /// Returns the rigid body the player is currently looking at during simulation. /// /// The maximum distance from the player (default is the player's building reach) - /// The block or null if not found + /// The body or null if not found public SimBody GetSimBodyLookedAt(float maxDistance = -1f) { var egid = playerEngine.GetThingLookedAt(Id, maxDistance); @@ -413,11 +405,6 @@ namespace TechbloxModdingAPI return playerEngine.GetSelectedBlocks(Id); } - /// - /// The camera of this player used when building. - /// - public FlyCam BuildCamera => new FlyCam(Id); - public bool Equals(Player other) { if (ReferenceEquals(null, other)) return false; diff --git a/TechbloxModdingAPI/Players/FlyCamEngine.cs b/TechbloxModdingAPI/Players/FlyCamEngine.cs deleted file mode 100644 index 7cad252..0000000 --- a/TechbloxModdingAPI/Players/FlyCamEngine.cs +++ /dev/null @@ -1,39 +0,0 @@ -using Svelto.ECS; -using Techblox.FlyCam; -using TechbloxModdingAPI.Engines; -using TechbloxModdingAPI.Utility; - -namespace TechbloxModdingAPI.Players -{ - public class FlyCamEngine : IApiEngine - { - public void Ready() - { - } - - public EntitiesDB entitiesDB { get; set; } - public void Dispose() - { - } - - public string Name => "TechbloxModdingAPIFlyCamEngine"; - public bool isRemovable => false; - - public ref T GetComponent(FlyCam cam) where T : unmanaged, IEntityComponent - { - return ref entitiesDB.QueryEntityOrDefault(cam); - } - - public ushort GetSelectedBlock(FlyCam cam) - { - var oc = entitiesDB.QueryEntityOptional(cam); - return oc ? (ushort) oc.Get().SelectedDBPartID : ushort.MaxValue; - } - - public byte GetSelectedColor(FlyCam cam) - { - var oc = entitiesDB.QueryEntityOptional(cam); - return oc ? oc.Get().indexInPalette : (byte) 255; - } - } -} \ No newline at end of file diff --git a/TechbloxModdingAPI/Players/PlayerBuildingMode.cs b/TechbloxModdingAPI/Players/PlayerBuildingMode.cs index 383e1af..5e75555 100644 --- a/TechbloxModdingAPI/Players/PlayerBuildingMode.cs +++ b/TechbloxModdingAPI/Players/PlayerBuildingMode.cs @@ -5,6 +5,7 @@ BlockMode, ColourMode, ConfigMode, - BlueprintMode + BlueprintMode, + MaterialMode } } \ No newline at end of file diff --git a/TechbloxModdingAPI/Players/PlayerEngine.cs b/TechbloxModdingAPI/Players/PlayerEngine.cs index b4df628..f5fbb26 100644 --- a/TechbloxModdingAPI/Players/PlayerEngine.cs +++ b/TechbloxModdingAPI/Players/PlayerEngine.cs @@ -21,6 +21,7 @@ using HarmonyLib; using RobocraftX.Common; using Svelto.ECS.DataStructures; using TechbloxModdingAPI.Engines; +using TechbloxModdingAPI.Utility; namespace TechbloxModdingAPI.Players { @@ -98,17 +99,6 @@ namespace TechbloxModdingAPI.Players || entitiesDB.Exists(playerId, PlayersExclusiveGroups.RemotePlayers); } - public float3 GetLocation(uint playerId) - { - if (entitiesDB == null) return float3.zero; - ref var rbes = ref GetCharacterStruct(playerId, out bool exists); - if (exists) - { - return rbes.position; - } - return float3.zero; - } - public bool SetLocation(uint playerId, float3 location, bool exitSeat = true) { if (entitiesDB == null) return false; @@ -131,233 +121,6 @@ namespace TechbloxModdingAPI.Players return false; } - public float3 GetRotation(uint playerId) - { - if (entitiesDB == null) return float3.zero; - ref var rbes = ref GetCharacterStruct(playerId, out bool exists); - if (exists) - { - return ((Quaternion) rbes.rotation).eulerAngles; - } - return default(float3); - } - - public bool SetRotation(uint playerId, float3 value) - { - if (entitiesDB == null) return false; - ref var rbes = ref GetCharacterStruct(playerId, out bool exists); - if (exists) - { - Quaternion q = rbes.rotation; - q.eulerAngles = value; - rbes.rotation = q; - return true; - } - return false; - } - - public float3 GetLinearVelocity(uint playerId) - { - if (entitiesDB == null) return float3.zero; - ref var rbes = ref GetCharacterStruct(playerId, out bool exists); - if (exists) - { - return rbes.velocity; - } - return float3.zero; - } - - public bool SetLinearVelocity(uint playerId, float3 value) - { - if (entitiesDB == null) return false; - ref var rbes = ref GetCharacterStruct(playerId, out bool exists); - if (exists) - { - rbes.velocity = value; - return true; - } - return false; - } - - public float3 GetAngularVelocity(uint playerId) - { - if (entitiesDB == null) return float3.zero; - ref var rbes = ref GetCharacterStruct(playerId, out bool exists); - if (exists) - { - return rbes.angularVelocity; - } - return float3.zero; - } - - public bool SetAngularVelocity(uint playerId, float3 value) - { - if (entitiesDB == null) return false; - ref var rbes = ref GetCharacterStruct(playerId, out bool exists); - if (exists) - { - rbes.angularVelocity = value; - return true; - } - return false; - } - - public PhysicsMass GetMass(uint playerId) - { - if (entitiesDB == null) return default(PhysicsMass); - ref var rbes = ref GetCharacterStruct(playerId, out bool exists); - if (exists) - { - return rbes.physicsMass; - } - return default(PhysicsMass); - } - - public bool SetInverseMass(uint playerId, float inverseMass) - { - if (entitiesDB == null) return false; - ref var rbes = ref GetCharacterStruct(playerId, out bool exists); - if (exists) - { - rbes.physicsMass.InverseInertia = inverseMass; - return true; - } - return false; - } - - public float? GetLastPingTime(uint playerId, PlayerType type) - { - if (entitiesDB == null) return null; - EGID egid = new EGID(playerId, PlayerGroupFromEnum(type)); - if (entitiesDB.Exists(egid)) - { - //return entitiesDB.QueryEntity(egid).lastPingTimeSinceLevelLoad; - TODO - } - return null; - } - - public float GetInitialHealth(uint playerId) - { - if (entitiesDB == null) return 0; - ref var c = ref GetCharacterStruct(playerId, out bool exists); - if (exists) - { - return c.initialHealth; - } - return -1f; - } - - public bool SetInitialHealth(uint playerId, float val) - { - if (entitiesDB == null) return false; - ref var c = ref GetCharacterStruct(playerId, out bool exists); - if (exists) - { - c.initialHealth = val; - return true; - } - return false; - } - - public float GetCurrentHealth(uint playerId) - { - if (entitiesDB == null) return 0; - ref var c = ref GetCharacterStruct(playerId, out bool exists); - if (exists) - { - return c.currentHealth; - } - return -1f; - } - - public bool SetCurrentHealth(uint playerId, float val) - { - if (entitiesDB == null) return false; - ref var c = ref GetCharacterStruct(playerId, out bool exists); - if (exists) - { - c.currentHealth = val; - return true; - } - return false; - } - - public bool DamagePlayer(uint playerId, float amount) - { - if (entitiesDB == null) return false; - return SetCurrentHealth(playerId, GetCurrentHealth(playerId) - amount); - } - - public bool GetDamageable(uint playerId) - { - if (entitiesDB == null) return false; - ref var c = ref GetCharacterStruct(playerId, out bool exists); - if (exists) - { - return c.canTakeDamageStat; - } - return false; - } - - public bool SetDamageable(uint playerId, bool val) - { - if (entitiesDB == null) return false; - ref var ches = ref GetCharacterStruct(playerId, out bool exists); - if (exists) - { - ches.canTakeDamage = val; - ches.canTakeDamage = val; - return true; - } - return false; - } - - public uint GetInitialLives(uint playerId) - { - if (entitiesDB == null) return 0; - ref var c = ref GetCharacterStruct(playerId, out bool exists); - if (exists) - { - return c.initialLives; - } - return uint.MaxValue; - } - - public bool SetInitialLives(uint playerId, uint val) - { - if (entitiesDB == null) return false; - ref var c = ref GetCharacterStruct(playerId, out bool exists); - if (exists) - { - c.initialLives = val; - return true; - } - return false; - } - - public uint GetCurrentLives(uint playerId) - { - if (entitiesDB == null) return 0; - ref var c = ref GetCharacterStruct(playerId, out bool exists); - if (exists) - { - return c.currentLives; - } - return uint.MaxValue; - } - - public bool SetCurrentLives(uint playerId, uint val) - { - if (entitiesDB == null) return false; - ref var c = ref GetCharacterStruct(playerId, out bool exists); - if (exists) - { - c.currentLives = val; - return true; - } - return false; - } - public bool GetGameOverScreen(uint playerId) { if (entitiesDB == null) return false; @@ -372,78 +135,44 @@ namespace TechbloxModdingAPI.Players return entitiesDB.Exists(playerId, CharacterExclusiveGroups.DeadCharacters); } - public int GetSelectedBlock(uint playerId) - { - if (entitiesDB == null) return 0; - ref var c = ref GetCharacterStruct(playerId, out bool exists); - if (exists) - { - return c.SelectedDBPartID; - } - return ushort.MaxValue; - } - - public byte GetSelectedColor(uint playerId) - { - if (entitiesDB == null) return 0; - ref var c = ref GetCharacterStruct(playerId, out bool exists); - if (exists) - { - return c.indexInPalette; - } - return 255; - } - // reusable methods [MethodImpl(MethodImplOptions.AggressiveInlining)] - private ExclusiveGroup PlayerGroupFromEnum(PlayerType type) + public OptionalRef GetCharacterStruct(uint playerId) where T : unmanaged, IEntityComponent { - return type == PlayerType.Local ? PlayersExclusiveGroups.LocalPlayers : PlayersExclusiveGroups.RemotePlayers; + if (GameState.IsBuildMode()) + return entitiesDB.QueryEntityOptional(new EGID(playerId, Techblox.FlyCam.FlyCam.Group)); + + var characterGroups = CharacterExclusiveGroups.AllCharacters; + for (int i = 0; i < characterGroups.count; i++) + { + EGID egid = new EGID(playerId, characterGroups[i]); + var opt = entitiesDB.QueryEntityOptional(egid); + if (opt.Exists) + return opt; + } + + return new OptionalRef(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public ref T GetCharacterStruct(uint playerId, out bool exists) where T : unmanaged, IEntityComponent + public OptionalRef GetPlayerStruct(uint playerId, PlayerType type) where T : unmanaged, IEntityComponent { - var characterGroups = CharacterExclusiveGroups.AllCharacters; - for (int i = 0; i < characterGroups.count; i++) - { - EGID egid = new EGID(playerId, characterGroups[i]); - if (entitiesDB.Exists(egid)) - { - exists = true; - return ref entitiesDB.QueryEntity(egid); - } - } - - exists = false; - T[] arr = new T[1]; - return ref arr[0]; //Return default value + var playerGroup = type == PlayerType.Local ? PlayersExclusiveGroups.LocalPlayers : PlayersExclusiveGroups.RemotePlayers; + EGID egid = new EGID(playerId, playerGroup); + return entitiesDB.QueryEntityOptional(egid); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public bool GetPlayerStruct(uint playerId, out T s) where T : unmanaged, IEntityComponent + public OptionalRef GetCameraStruct(uint playerId) where T : unmanaged, IEntityComponent { - var playerGroups = PlayersExclusiveGroups.AllPlayers; - for (int i = 0; i < playerGroups.count; i++) - { - EGID egid = new EGID(playerId, playerGroups[i]); - if (entitiesDB.Exists(egid)) - { - s = entitiesDB.QueryEntity(egid); - return true; - } - } - s = default; - return false; + return entitiesDB.QueryEntityOptional(new EGID(playerId, CameraExclusiveGroups.CameraGroup)); } public EGID GetThingLookedAt(uint playerId, float maxDistance = -1f) { - if (!entitiesDB.TryQueryMappedEntities( - CameraExclusiveGroups.CameraGroup, out var mapper)) - return EGID.Empty; - mapper.TryGetEntity(playerId, out CharacterCameraRayCastEntityStruct rayCast); + var opt = GetCameraStruct(playerId); + if (!opt) return EGID.Empty; + CharacterCameraRayCastEntityStruct rayCast = opt; float distance = maxDistance < 0 ? GhostBlockUtils.GetBuildInteractionDistance(entitiesDB, rayCast, GhostBlockUtils.GhostCastMethod.GhostCastProportionalToBlockSize) diff --git a/TechbloxModdingAPI/TechbloxModdingAPI.csproj b/TechbloxModdingAPI/TechbloxModdingAPI.csproj index 8af0a13..ca99746 100644 --- a/TechbloxModdingAPI/TechbloxModdingAPI.csproj +++ b/TechbloxModdingAPI/TechbloxModdingAPI.csproj @@ -8,6 +8,7 @@ https://git.exmods.org/modtainers/GamecraftModdingAPI en-CA true + 8 -- 2.30.2 From b8fd14d9348a965bf42732d6bb16386e34bdf074 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Fri, 28 May 2021 02:52:42 +0200 Subject: [PATCH 194/252] Move speed settings to Player and make it work with players Probably --- TechbloxModdingAPI/Player.FlyCamSettings.cs | 51 ------------------- TechbloxModdingAPI/Player.cs | 55 ++++++++++++++++++++- 2 files changed, 54 insertions(+), 52 deletions(-) delete mode 100644 TechbloxModdingAPI/Player.FlyCamSettings.cs diff --git a/TechbloxModdingAPI/Player.FlyCamSettings.cs b/TechbloxModdingAPI/Player.FlyCamSettings.cs deleted file mode 100644 index b947477..0000000 --- a/TechbloxModdingAPI/Player.FlyCamSettings.cs +++ /dev/null @@ -1,51 +0,0 @@ -using RobocraftX.Physics; -using Svelto.ECS; -using Svelto.ECS.EntityStructs; -using Techblox.FlyCam; -using TechbloxModdingAPI.Blocks; -using TechbloxModdingAPI.Players; -using TechbloxModdingAPI.Utility; -using Unity.Mathematics; -using UnityEngine; - -namespace TechbloxModdingAPI -{ - public partial class Player - { - /// - /// Whether the camera (player) is sprinting. - /// - public bool Sprinting - { - get => playerEngine.GetCharacterStruct(Id).Get().sprinting; - set => playerEngine.GetCharacterStruct(Id).Get().sprinting = value; - } - - /// - /// The speed setting of the camera. - /// - public float Speed - { - get => playerEngine.GetCharacterStruct(Id).Get().speed; - set => playerEngine.GetCharacterStruct(Id).Get().speed = value; - } - - /// - /// The multiplier setting to use when sprinting. - /// - public float SpeedSprintMultiplier - { - get => playerEngine.GetCharacterStruct(Id).Get().speedSprintMultiplier; - set => playerEngine.GetCharacterStruct(Id).Get().speedSprintMultiplier = value; - } - - /// - /// The acceleration setting of the camera. - /// - public float Acceleration - { - get => playerEngine.GetCharacterStruct(Id).Get().acceleration; - set => playerEngine.GetCharacterStruct(Id).Get().acceleration = value; - } - } -} \ No newline at end of file diff --git a/TechbloxModdingAPI/Player.cs b/TechbloxModdingAPI/Player.cs index 02e28f5..9bab382 100644 --- a/TechbloxModdingAPI/Player.cs +++ b/TechbloxModdingAPI/Player.cs @@ -1,5 +1,6 @@ using System; using RobocraftX.Character; +using RobocraftX.Character.Movement; using Unity.Mathematics; using RobocraftX.Common; using RobocraftX.Common.Players; @@ -17,7 +18,7 @@ namespace TechbloxModdingAPI /// /// An in-game player character. Any Leo you see is a player. /// - public partial class Player : IEquatable, IEquatable + public class Player : IEquatable, IEquatable { // static functionality private static PlayerEngine playerEngine = new PlayerEngine(); @@ -350,6 +351,58 @@ namespace TechbloxModdingAPI public PlayerBuildingMode BuildingMode => (PlayerBuildingMode) playerEngine .GetCharacterStruct(Id).Get().timeStoppedContext; + /// + /// Whether the player is sprinting. + /// + public bool Sprinting + { + get => GameState.IsBuildMode() + ? playerEngine.GetCharacterStruct(Id).Get().sprinting + : playerEngine.GetCharacterStruct(Id).Get().isSprinting; + set => _ = GameState.IsBuildMode() + ? playerEngine.GetCharacterStruct(Id).Get().sprinting = value + : playerEngine.GetCharacterStruct(Id).Get().isSprinting = value; + } + + /// + /// Movement speed setting. Build mode (camera) and simulation mode settings are separate. + /// + public float SpeedSetting + { + get => GameState.IsBuildMode() + ? playerEngine.GetCharacterStruct(Id).Get().speed + : playerEngine.GetCharacterStruct(Id).Get().moveSpeed; + set => _ = GameState.IsBuildMode() + ? playerEngine.GetCharacterStruct(Id).Get().speed = value + : playerEngine.GetCharacterStruct(Id).Get().moveSpeed = value; + } + + /// + /// The multiplier setting to use when sprinting. Build mode (camera) and simulation mode settings are separate. + /// + public float SpeedSprintMultiplierSetting + { + get => GameState.IsBuildMode() + ? playerEngine.GetCharacterStruct(Id).Get().speedSprintMultiplier + : playerEngine.GetCharacterStruct(Id).Get().sprintSpeedMultiplier; + set => _ = GameState.IsBuildMode() + ? playerEngine.GetCharacterStruct(Id).Get().speedSprintMultiplier = value + : playerEngine.GetCharacterStruct(Id).Get().sprintSpeedMultiplier = value; + } + + /// + /// The acceleration setting of the player. Build mode (camera) and simulation mode settings are separate. + /// + public float AccelerationSetting + { + get => GameState.IsBuildMode() + ? playerEngine.GetCharacterStruct(Id).Get().acceleration + : playerEngine.GetCharacterStruct(Id).Get().acceleration; + set => _ = GameState.IsBuildMode() + ? playerEngine.GetCharacterStruct(Id).Get().acceleration = value + : playerEngine.GetCharacterStruct(Id).Get().acceleration = value; + } + // object methods /// -- 2.30.2 From 94c0c1370b0ca8c793b14687b3993d154eb2e949 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sun, 30 May 2021 01:34:30 +0200 Subject: [PATCH 195/252] Removed 2 non-OOP classes and fixed fly cam teleport Remvoed Hotbar and GameClient since their functions are also implemented in OOP classes Added static methods to add/remove persistent debug info Made some patches and other things internal Added support for FlyCams in SetLocation --- TechbloxModdingAPI/App/Game.cs | 59 +++++++++++++------ .../Blocks/Engines/PlacementEngine.cs | 2 +- .../Blocks/Engines/RemovalEngine.cs | 2 +- .../Blocks/Engines/ScalingEngine.cs | 2 +- TechbloxModdingAPI/Inventory/Hotbar.cs | 46 --------------- TechbloxModdingAPI/Inventory/HotbarEngine.cs | 55 ----------------- .../HotbarSlotSelectionHandlerEnginePatch.cs | 2 +- TechbloxModdingAPI/Main.cs | 3 - .../Persistence/SerializerManager.cs | 2 +- TechbloxModdingAPI/Players/PlayerEngine.cs | 40 +++++++------ .../Tests/TechbloxModdingAPIPluginTest.cs | 4 +- TechbloxModdingAPI/Utility/GameClient.cs | 30 ---------- 12 files changed, 69 insertions(+), 178 deletions(-) delete mode 100644 TechbloxModdingAPI/Inventory/Hotbar.cs delete mode 100644 TechbloxModdingAPI/Inventory/HotbarEngine.cs delete mode 100644 TechbloxModdingAPI/Utility/GameClient.cs diff --git a/TechbloxModdingAPI/App/Game.cs b/TechbloxModdingAPI/App/Game.cs index 4630ed9..1d37945 100644 --- a/TechbloxModdingAPI/App/Game.cs +++ b/TechbloxModdingAPI/App/Game.cs @@ -396,19 +396,20 @@ namespace TechbloxModdingAPI.App /// /// Add information to the in-game debug display. - /// When this object is garbage collected, this debug info is automatically removed. + /// When this object is garbage collected, this debug info is automatically removed. + /// The provided getter function is called each frame so make sure it returns quickly. /// /// Debug info identifier. - /// Content getter. - public void AddDebugInfo(string id, Func contentGetter) + /// A function that returns the current information. + public void AddDebugInfo(string id, Func contentGetter) { - if (!VerifyMode()) return; - if (menuMode) - { - throw new GameNotFoundException("Game object references a menu item but AddDebugInfo only works on the currently-loaded game"); - } - debugOverlayEngine.SetInfo(id, contentGetter); - debugIds.Add(id); + if (!VerifyMode()) return; + if (menuMode) + { + throw new GameNotFoundException("Game object references a menu item but AddDebugInfo only works on the currently-loaded game"); + } + debugOverlayEngine.SetInfo("game_" + id, contentGetter); + debugIds.Add(id); } /// @@ -418,14 +419,36 @@ namespace TechbloxModdingAPI.App /// Debug info identifier. public bool RemoveDebugInfo(string id) { - if (!VerifyMode()) return false; - if (menuMode) - { - throw new GameNotFoundException("Game object references a menu item but RemoveDebugInfo only works on the currently-loaded game"); - } - if (!debugIds.Contains(id)) return false; - debugOverlayEngine.RemoveInfo(id); - return debugIds.Remove(id); + if (!VerifyMode()) return false; + if (menuMode) + { + throw new GameNotFoundException("Game object references a menu item but RemoveDebugInfo only works on the currently-loaded game"); + } + if (!debugIds.Contains(id)) return false; + debugOverlayEngine.RemoveInfo("game_" + id); + return debugIds.Remove(id); + } + + /// + /// Add information to the in-game debug display. + /// This debug info will be present for all games until it is manually removed. + /// The provided getter function is called each frame so make sure it returns quickly. + /// + /// Debug info identifier. + /// A function that returns the current information. + public static void AddPersistentDebugInfo(string id, Func contentGetter) + { + debugOverlayEngine.SetInfo("persistent_" + id, contentGetter); + } + + /// + /// Remove persistent information from the in-game debug display. + /// + /// true, if debug info was removed, false otherwise. + /// Debug info identifier. + public static bool RemovePersistentDebugInfo(string id) + { + return debugOverlayEngine.RemoveInfo("persistent_" + id); } /// diff --git a/TechbloxModdingAPI/Blocks/Engines/PlacementEngine.cs b/TechbloxModdingAPI/Blocks/Engines/PlacementEngine.cs index b076d96..196df83 100644 --- a/TechbloxModdingAPI/Blocks/Engines/PlacementEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/PlacementEngine.cs @@ -113,7 +113,7 @@ namespace TechbloxModdingAPI.Blocks.Engines public bool isRemovable => false; [HarmonyPatch] - public class FactoryObtainerPatch + class FactoryObtainerPatch { static void Postfix(BlockEntityFactory blockEntityFactory, IEntityFactory entityFactory) { diff --git a/TechbloxModdingAPI/Blocks/Engines/RemovalEngine.cs b/TechbloxModdingAPI/Blocks/Engines/RemovalEngine.cs index 4d4897f..b753d3f 100644 --- a/TechbloxModdingAPI/Blocks/Engines/RemovalEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/RemovalEngine.cs @@ -44,7 +44,7 @@ namespace TechbloxModdingAPI.Blocks.Engines public bool isRemovable => false; [HarmonyPatch] - public class FactoryObtainerPatch + class FactoryObtainerPatch { static void Postfix(IEntityFunctions entityFunctions, MachineGraphConnectionEntityFactory machineGraphConnectionEntityFactory) diff --git a/TechbloxModdingAPI/Blocks/Engines/ScalingEngine.cs b/TechbloxModdingAPI/Blocks/Engines/ScalingEngine.cs index 5ab84f2..9ca77f0 100644 --- a/TechbloxModdingAPI/Blocks/Engines/ScalingEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/ScalingEngine.cs @@ -41,7 +41,7 @@ namespace TechbloxModdingAPI.Blocks.Engines } [HarmonyPatch] - public class PhysicsEnginePatch + class PhysicsEnginePatch { static void Postfix(IReactOnAddAndRemove __instance) { diff --git a/TechbloxModdingAPI/Inventory/Hotbar.cs b/TechbloxModdingAPI/Inventory/Hotbar.cs deleted file mode 100644 index 92bca86..0000000 --- a/TechbloxModdingAPI/Inventory/Hotbar.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System; - -using RobocraftX.Common.Input; -using RobocraftX.Multiplayer.Input; -using HarmonyLib; -using TechbloxModdingAPI.Blocks; -using TechbloxModdingAPI.Utility; - -namespace TechbloxModdingAPI.Inventory -{ - public static class Hotbar - { - private static readonly HotbarEngine hotbarEngine = new HotbarEngine(); - - /// - /// Switch the block in the player's hand - /// - /// The block to switch to. - /// The player. Omit this to use the local player. - public static void EquipBlock(BlockIDs block, uint playerID = uint.MaxValue) - { - if (playerID == uint.MaxValue) - { - playerID = hotbarEngine.GetLocalPlayerID(); - } - hotbarEngine.SelectBlock((int) block, playerID); - // cubeSelectedByPick = true will crash the game - // (this would be equivalent to mouse middle click pick block action) - // reason: the game expects a Dictionary entry for the tweaked stats - } - - /// - /// Gets the block in the player's hand - /// - /// The equipped block. - public static BlockIDs GetEquippedBlock() - { - return HotbarSlotSelectionHandlerEnginePatch.EquippedPartID; - } - - public static void Init() - { - GameEngineManager.AddGameEngine(hotbarEngine); - } - } -} diff --git a/TechbloxModdingAPI/Inventory/HotbarEngine.cs b/TechbloxModdingAPI/Inventory/HotbarEngine.cs deleted file mode 100644 index 66f8c78..0000000 --- a/TechbloxModdingAPI/Inventory/HotbarEngine.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System; - -using RobocraftX.Character; -using RobocraftX.GUI.Hotbar; -using RobocraftX.Players; -using RobocraftX.Common; -using RobocraftX.Common.Input; -using RobocraftX.Common.Players; -using Svelto.ECS; - -using TechbloxModdingAPI.Blocks; -using TechbloxModdingAPI.Utility; -using RobocraftX.Blocks; -using Techblox.FlyCam; -using TechbloxModdingAPI.Engines; - -namespace TechbloxModdingAPI.Inventory -{ - public class HotbarEngine : IApiEngine - { - public string Name { get; } = "TechbloxModdingAPIHotbarGameEngine"; - - public EntitiesDB entitiesDB { set; private get; } - - public bool isRemovable => false; - - public bool IsInGame = false; - - public void Dispose() - { - IsInGame = false; - } - - public void Ready() - { - IsInGame = true; - } - - public bool SelectBlock(int block, uint playerID, bool cubeSelectedByPick = false) - { - if (!entitiesDB.TryQueryEntitiesAndIndex(playerID, Techblox.FlyCam.FlyCam.Group, - out var index, out var inputs)) - return false; - inputs[index].CubeSelectedByPick = cubeSelectedByPick; - inputs[index].SelectedDBPartID = block; - // TODO: expose the rest of the input functionality - return true; - } - - public uint GetLocalPlayerID() - { - return LocalPlayerIDUtility.GetLocalPlayerID(entitiesDB); - } - } -} diff --git a/TechbloxModdingAPI/Inventory/HotbarSlotSelectionHandlerEnginePatch.cs b/TechbloxModdingAPI/Inventory/HotbarSlotSelectionHandlerEnginePatch.cs index 1a068f0..79c6d5a 100644 --- a/TechbloxModdingAPI/Inventory/HotbarSlotSelectionHandlerEnginePatch.cs +++ b/TechbloxModdingAPI/Inventory/HotbarSlotSelectionHandlerEnginePatch.cs @@ -9,7 +9,7 @@ using TechbloxModdingAPI.Blocks; namespace TechbloxModdingAPI.Inventory { [HarmonyPatch] - public class HotbarSlotSelectionHandlerEnginePatch + class HotbarSlotSelectionHandlerEnginePatch { private static int selectedBlockInt = 0; diff --git a/TechbloxModdingAPI/Main.cs b/TechbloxModdingAPI/Main.cs index a390021..610aa8e 100644 --- a/TechbloxModdingAPI/Main.cs +++ b/TechbloxModdingAPI/Main.cs @@ -65,8 +65,6 @@ namespace TechbloxModdingAPI Utility.GameState.Init(); // init block implementors Logging.MetaDebugLog($"Initializing Blocks"); - // init inventory - Inventory.Hotbar.Init(); // init input Input.FakeInput.Init(); // init object-oriented classes @@ -75,7 +73,6 @@ namespace TechbloxModdingAPI BlockGroup.Init(); Wire.Init(); Logging.MetaDebugLog($"Initializing Client"); - GameClient.Init(); Client.Init(); Game.Init(); // init UI diff --git a/TechbloxModdingAPI/Persistence/SerializerManager.cs b/TechbloxModdingAPI/Persistence/SerializerManager.cs index 04079cf..fe11320 100644 --- a/TechbloxModdingAPI/Persistence/SerializerManager.cs +++ b/TechbloxModdingAPI/Persistence/SerializerManager.cs @@ -58,7 +58,7 @@ namespace TechbloxModdingAPI.Persistence return _serializers.Count; } - public static void RegisterSerializers(EnginesRoot enginesRoot) + internal static void RegisterSerializers(EnginesRoot enginesRoot) { _lastEnginesRoot = enginesRoot; IEntitySerialization ies = enginesRoot.GenerateEntitySerializer(); diff --git a/TechbloxModdingAPI/Players/PlayerEngine.cs b/TechbloxModdingAPI/Players/PlayerEngine.cs index f5fbb26..506c55d 100644 --- a/TechbloxModdingAPI/Players/PlayerEngine.cs +++ b/TechbloxModdingAPI/Players/PlayerEngine.cs @@ -102,23 +102,17 @@ namespace TechbloxModdingAPI.Players public bool SetLocation(uint playerId, float3 location, bool exitSeat = true) { if (entitiesDB == null) return false; - var characterGroups = CharacterExclusiveGroups.AllCharacters; - for (int i = 0; i < characterGroups.count; i++) - { - EGID egid = new EGID(playerId, characterGroups[i]); - if (entitiesDB.Exists(egid)) - { - ref RigidBodyEntityStruct rbes = ref entitiesDB.QueryEntity(egid); - if (characterGroups[i] == CharacterExclusiveGroups.InPilotSeatGroup && exitSeat) - { - entitiesDB.QueryEntity(egid).instantExit = true; - entitiesDB.PublishEntityChange(egid); - } - rbes.position = location; - return true; - } - } - return false; + var rbesOpt = GetCharacterStruct(playerId, out var group); + if (!rbesOpt) + return false; + if (group == CharacterExclusiveGroups.InPilotSeatGroup && exitSeat) + { + EGID egid = new EGID(playerId, group); + entitiesDB.QueryEntity(egid).instantExit = true; + entitiesDB.PublishEntityChange(egid); + } + rbesOpt.Get().position = location; + return true; } public bool GetGameOverScreen(uint playerId) @@ -137,9 +131,14 @@ namespace TechbloxModdingAPI.Players // reusable methods - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public OptionalRef GetCharacterStruct(uint playerId) where T : unmanaged, IEntityComponent + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public OptionalRef GetCharacterStruct(uint playerId) where T : unmanaged, IEntityComponent => + GetCharacterStruct(playerId, out _); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public OptionalRef GetCharacterStruct(uint playerId, out ExclusiveGroupStruct group) where T : unmanaged, IEntityComponent { + group = default; if (GameState.IsBuildMode()) return entitiesDB.QueryEntityOptional(new EGID(playerId, Techblox.FlyCam.FlyCam.Group)); @@ -149,7 +148,10 @@ namespace TechbloxModdingAPI.Players EGID egid = new EGID(playerId, characterGroups[i]); var opt = entitiesDB.QueryEntityOptional(egid); if (opt.Exists) + { + group = characterGroups[i]; return opt; + } } return new OptionalRef(); diff --git a/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs b/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs index 8f5298f..f618211 100644 --- a/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs +++ b/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs @@ -25,7 +25,7 @@ namespace TechbloxModdingAPI.Tests /// Modding API implemented as a standalone IPA Plugin. /// Ideally, TechbloxModdingAPI should be loaded by another mod; not itself /// - public class TechbloxModdingAPIPluginTest : IllusionPlugin.IEnhancedPlugin + class TechbloxModdingAPIPluginTest : IllusionPlugin.IEnhancedPlugin { private static Harmony harmony { get; set; } @@ -194,7 +194,7 @@ namespace TechbloxModdingAPI.Tests Game.CurrentGame().ToggleTimeMode(); }).Build(); - GameClient.SetDebugInfo("InstalledMods", InstalledMods); + Game.AddPersistentDebugInfo("InstalledMods", InstalledMods); Block.Placed += (sender, args) => Logging.MetaDebugLog("Placed block " + args.Block); Block.Removed += (sender, args) => diff --git a/TechbloxModdingAPI/Utility/GameClient.cs b/TechbloxModdingAPI/Utility/GameClient.cs deleted file mode 100644 index f63b270..0000000 --- a/TechbloxModdingAPI/Utility/GameClient.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using TechbloxModdingAPI.Blocks; - -namespace TechbloxModdingAPI.Utility -{ - public static class GameClient - { - private static DebugInterfaceEngine _engine = new DebugInterfaceEngine(); - - /// - /// Saves the extra information to be displayed on the debug view. - /// The provided getter function is called each time the view updates so make sure it returns quickly. - /// - /// A global ID for the custom information - /// A function that returns the current information - public static void SetDebugInfo(string id, Func contentGetter) => _engine.SetInfo(id, contentGetter); - - /// - /// Removes an information provided by a plugin. - /// - /// The ID of the custom information - /// - public static bool RemoveDebugInfo(string id) => _engine.RemoveInfo(id); - - public static void Init() - { - GameEngineManager.AddGameEngine(_engine); - } - } -} \ No newline at end of file -- 2.30.2 From b31eaa20c08c3abaab1f6021594726e19167dc99 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sun, 30 May 2021 02:12:38 +0200 Subject: [PATCH 196/252] Check if block type is correct --- TechbloxModdingAPI/Block.cs | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/TechbloxModdingAPI/Block.cs b/TechbloxModdingAPI/Block.cs index ed4e2aa..9d71d24 100644 --- a/TechbloxModdingAPI/Block.cs +++ b/TechbloxModdingAPI/Block.cs @@ -87,23 +87,27 @@ namespace TechbloxModdingAPI remove => BlockEventsEngine.Removed -= value; } - internal static readonly Dictionary> GroupToConstructor = - new Dictionary> + private static readonly Dictionary Constructor, Type Type)> GroupToConstructor = + new Dictionary, Type)> { - {CommonExclusiveGroups.DAMPEDSPRING_BLOCK_GROUP, id => new DampedSpring(id)}, - {CommonExclusiveGroups.ENGINE_BLOCK_BUILD_GROUP, id => new Engine(id)} + {CommonExclusiveGroups.DAMPEDSPRING_BLOCK_GROUP, (id => new DampedSpring(id), typeof(DampedSpring))}, + {CommonExclusiveGroups.ENGINE_BLOCK_BUILD_GROUP, (id => new Engine(id), typeof(Engine))} }; internal static Block New(EGID egid) { return GroupToConstructor.ContainsKey(egid.groupID) - ? GroupToConstructor[egid.groupID](egid) + ? GroupToConstructor[egid.groupID].Constructor(egid) : new Block(egid); } public Block(EGID id) { - Id = id; //TODO: Check if block type is correct + Id = id; + Type expectedType; + if (GroupToConstructor.ContainsKey(id.groupID) && + !GetType().IsAssignableFrom(expectedType = GroupToConstructor[id.groupID].Type)) + throw new BlockSpecializationException($"Incorrect block type! Expected: {expectedType} Actual: {GetType()}"); } /// @@ -111,11 +115,11 @@ namespace TechbloxModdingAPI /// It will throw an exception if the block doesn't exist. /// Use the EGID constructor where possible or subclasses of Block as those specify the group. /// - public Block(uint id) + public Block(uint id) : this(BlockEngine.FindBlockEGID(id) + ?? throw new BlockTypeException( + "Could not find the appropriate group for the block." + + " The block probably doesn't exist or hasn't been submitted.")) { - Id = BlockEngine.FindBlockEGID(id) - ?? throw new BlockTypeException("Could not find the appropriate group for the block." + - " The block probably doesn't exist or hasn't been submitted."); } /// -- 2.30.2 From 06cb911ea34722d5539482e712a538912f9626b8 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Mon, 31 May 2021 17:59:25 -0400 Subject: [PATCH 197/252] Update IMGUI to something roughly TB-like --- .../Interface/IMGUI/Constants.cs | 66 +++++++++---------- .../Tests/TechbloxModdingAPIPluginTest.cs | 2 +- 2 files changed, 32 insertions(+), 36 deletions(-) diff --git a/TechbloxModdingAPI/Interface/IMGUI/Constants.cs b/TechbloxModdingAPI/Interface/IMGUI/Constants.cs index a966a5f..02564a6 100644 --- a/TechbloxModdingAPI/Interface/IMGUI/Constants.cs +++ b/TechbloxModdingAPI/Interface/IMGUI/Constants.cs @@ -33,7 +33,7 @@ namespace TechbloxModdingAPI.Interface.IMGUI } } - private static Font _riffic = null; + private static Font _font = null; private static Texture2D _blueBackground = null; private static Texture2D _grayBackground = null; @@ -49,12 +49,13 @@ namespace TechbloxModdingAPI.Interface.IMGUI private static GUISkin BuildDefaultGUISkin() { _defaultCompletion = 0; - if (_riffic == null) return GUI.skin; + //if (_font == null) return GUI.skin; // build GUISkin GUISkin gui = ScriptableObject.CreateInstance(); - gui.font = _riffic; + gui.font = _font; gui.settings.selectionColor = Color.white; gui.settings.tripleClickSelectsLine = true; + Color textColour = new Color(0.706f, 0.706f, 0.706f); // set properties off all UI elements foreach (PropertyInfo p in typeof(GUISkin).GetProperties()) { @@ -63,29 +64,30 @@ namespace TechbloxModdingAPI.Interface.IMGUI { style.richText = true; style.alignment = TextAnchor.MiddleCenter; - style.fontSize = 30; + style.fontSize = 16; style.wordWrap = true; style.border = new RectOffset(4, 4, 4, 4); style.margin = new RectOffset(4, 4, 4, 4); style.padding = new RectOffset(4, 4, 4, 4); // normal state - style.normal.background = _blueBackground; - style.normal.textColor = Color.white; + style.normal.background = _grayBackground; + style.normal.textColor = textColour; // hover state style.hover.background = _grayBackground; - style.hover.textColor = Color.white; + style.hover.textColor = textColour; // focused style.focused.background = _grayBackground; - style.focused.textColor = Color.white; + style.focused.textColor = textColour; // clicking state style.active.background = _whiteBackground; - style.active.textColor = Color.white; + style.active.textColor = textColour; p.SetValue(gui, style); // probably unnecessary } } // set element-specific styles // label + gui.label.fontSize = 20; gui.label.normal.background = null; gui.label.hover.background = null; gui.label.focused.background = null; @@ -115,35 +117,29 @@ namespace TechbloxModdingAPI.Interface.IMGUI private static void LoadGUIAssets() { - AsyncOperationHandle rifficHandle = Addressables.LoadAssetAsync("Assets/Art/Fonts/riffic-bold.ttf"); - rifficHandle.Completed += handle => + /*AsyncOperationHandle fontHandle = Addressables.LoadAssetAsync("Assets/Plugins/TextMesh Pro/Fonts/LiberationSans.ttf"); + fontHandle.Completed += handle => { - _riffic = handle.Result; - _defaultCompletion++; - }; - _blueBackground = new Texture2D(1, 1); - _blueBackground.SetPixel(0, 0, new Color(0.004f, 0.522f, 0.847f) /* Techblox Blue */); - _blueBackground.Apply(); - _grayBackground = new Texture2D(1, 1); - _grayBackground.SetPixel(0, 0, new Color(0.745f, 0.745f, 0.745f) /* Gray */); - _grayBackground.Apply(); - _whiteBackground = new Texture2D(1, 1); - _whiteBackground.SetPixel(0, 0, new Color(0.898f, 0.898f, 0.898f) /* Very light gray */); - _whiteBackground.Apply(); - _textInputBackground = new Texture2D(1, 1); - _textInputBackground.SetPixel(0, 0, new Color(0f, 0f, 0f, 0.25f) /* Translucent gray */); - _textInputBackground.Apply(); - _areaBackground = new Texture2D(1, 1); - _areaBackground.SetPixel(0, 0, new Color(0f, 0f, 0f, 0.25f) /* Translucent gray */); - _areaBackground.Apply(); - /* // this is actually gray (used for the loading screen) - AsyncOperationHandle backgroundHandle = - Addressables.LoadAssetAsync("Assets/Art/Textures/UI/FrontEndMap/RCX_Blue_Background_5k.jpg"); - backgroundHandle.Completed += handle => - { - _blueBackground = handle.Result; + _font = handle.Result; _defaultCompletion++; };*/ + _font = Resources.Load("Assets/Plugins/TextMesh Pro/Fonts/LiberationSans.ttf"); + // TODO generate larger textures with borders on them so it actually looks more like Techblox + _blueBackground = new Texture2D(1, 1); + _blueBackground.SetPixel(0, 0, new Color(0.004f, 0.522f, 0.847f) /* Gamecraft Blue, unused */); + _blueBackground.Apply(); + _grayBackground = new Texture2D(1, 1); + _grayBackground.SetPixel(0, 0, new Color(0.11f, 0.11f, 0.11f, 1f) /* Very dark gray */); + _grayBackground.Apply(); + _whiteBackground = new Texture2D(1, 1); + _whiteBackground.SetPixel(0, 0, new Color(0.961f, 0.961f, 0.961f) /* Very light gray */); + _whiteBackground.Apply(); + _textInputBackground = new Texture2D(1, 1); + _textInputBackground.SetPixel(0, 0, new Color(0.961f, 0.961f, 0.961f) /* Very light gray */); + _textInputBackground.Apply(); + _areaBackground = new Texture2D(1, 1); + _areaBackground.SetPixel(0, 0, new Color(0.051f, 0.051f, 0.051f, 1f) /* Very very dark gray */); + _areaBackground.Apply(); _defaultCompletion++; } } diff --git a/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs b/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs index f618211..d938482 100644 --- a/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs +++ b/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs @@ -216,7 +216,7 @@ namespace TechbloxModdingAPI.Tests button.OnClick += (b, __) => { Logging.MetaDebugLog($"Click on {((Interface.IMGUI.Button)b).Name}");}; var button2 = new Button("TEST2"); button2.OnClick += (b, __) => { Logging.MetaDebugLog($"Click on {((Interface.IMGUI.Button)b).Name}");}; - Text uiText = new Text("This is text!", multiline: true); + Text uiText = new Text("", multiline: true); uiText.OnEdit += (t, txt) => { Logging.MetaDebugLog($"Text in {((Text)t).Name} is now '{txt}'"); }; Label uiLabel = new Label("Label!"); Image uiImg = new Image(name:"Behold this texture!"); -- 2.30.2 From c1c226ef2a4221d6f35f9f45f3c5da181a576747 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Fri, 4 Jun 2021 23:07:06 +0200 Subject: [PATCH 198/252] Added support for setting default color/material and static blocks Also fixed setting game name/description When setting the block color or material to default it will look up the default value to use Blocks can now be set to be static so they don't fall or move at all --- TechbloxModdingAPI/App/GameMenuEngine.cs | 25 +++++++---------- TechbloxModdingAPI/Block.cs | 27 +++++++++++++++---- .../Blocks/Engines/PlacementEngine.cs | 6 ----- .../Interface/IMGUI/Constants.cs | 2 +- .../Tests/TechbloxModdingAPIPluginTest.cs | 9 +++++++ 5 files changed, 41 insertions(+), 28 deletions(-) diff --git a/TechbloxModdingAPI/App/GameMenuEngine.cs b/TechbloxModdingAPI/App/GameMenuEngine.cs index 3357984..4738507 100644 --- a/TechbloxModdingAPI/App/GameMenuEngine.cs +++ b/TechbloxModdingAPI/App/GameMenuEngine.cs @@ -92,7 +92,7 @@ namespace TechbloxModdingAPI.App { if (!ExistsGameInfo(id)) return false; GetGameInfo(id).GameName.Set(name); - //GetGameViewInfo(id).MyGamesSlotComponent.GameName = StringUtil.SanitiseString(name); - TODO: Input field struct + GetGameViewInfo(id).MyGamesSlotComponent.GameName = StringUtil.SanitiseString(name); return true; } @@ -100,7 +100,7 @@ namespace TechbloxModdingAPI.App { if (!ExistsGameInfo(id)) return false; GetGameInfo(id).GameDescription.Set(name); - //GetGameViewInfo(id).MyGamesSlotComponent.GameDescription = StringUtil.SanitiseString(name); - TODO + GetGameViewInfo(id).MyGamesSlotComponent.GameDescription = StringUtil.SanitiseString(name); return true; } @@ -114,21 +114,14 @@ namespace TechbloxModdingAPI.App return ref GetComponent(id); } - /*public ref MyGamesSlotEntityViewStruct GetGameViewInfo(EGID id) + public dynamic GetGameViewInfo(EGID id) { - EntityCollection entities = - entitiesDB.QueryEntities(MyGamesScreenExclusiveGroups.GameSlotGuiEntities); - var entitiesB = entities.ToBuffer().buffer; - for (int i = 0; i < entities.count; i++) - { - if (entitiesB[i].ID.entityID == id.entityID) - { - return ref entitiesB[i]; - } - } - MyGamesSlotEntityViewStruct[] defRef = new MyGamesSlotEntityViewStruct[1]; - return ref defRef[0]; - TODO: The struct is internal now - }*/ + dynamic structOptional = AccessTools.Method("TechbloxModdingAPI.Utility.NativeApiExtensions:QueryEntityOptional", new []{typeof(EntitiesDB), typeof(EGID)}) + .MakeGenericMethod(AccessTools.TypeByName("RobocraftX.GUI.MyGamesScreen.MyGamesSlotEntityViewStruct")) + .Invoke(null, new object[] {entitiesDB, new EGID(id.entityID, MyGamesScreenExclusiveGroups.GameSlotGuiEntities)}); + if (structOptional == null) throw new Exception("Could not get game slot entity"); + return structOptional ? structOptional : null; + } public ref T GetComponent(EGID id) where T: unmanaged, IEntityComponent { diff --git a/TechbloxModdingAPI/Block.cs b/TechbloxModdingAPI/Block.cs index 9d71d24..c264c17 100644 --- a/TechbloxModdingAPI/Block.cs +++ b/TechbloxModdingAPI/Block.cs @@ -248,11 +248,14 @@ namespace TechbloxModdingAPI } set { - //TODO: Check if setting to 255 works + if (value.Color == BlockColors.Default) + value = new BlockColor(FullGameFields._dataDb.TryGetValue((int) Type, out CubeListData cld) + ? cld.DefaultColour + : throw new BlockTypeException("Unknown block type! Could not set default color.")); ref var color = ref BlockEngine.GetBlockInfo(this); color.indexInPalette = value.Index; color.hasNetworkChange = true; - color.paletteColour = BlockEngine.ConvertBlockColor(color.indexInPalette); + color.paletteColour = BlockEngine.ConvertBlockColor(color.indexInPalette); //Setting to 255 results in black } } @@ -282,10 +285,15 @@ namespace TechbloxModdingAPI } set { - if (!FullGameFields._dataDb.ContainsKey((byte) value)) + byte val = (byte) value; + if (value == BlockMaterial.Default) + val = FullGameFields._dataDb.TryGetValue((int) Type, out CubeListData cld) + ? cld.DefaultMaterialID + : throw new BlockTypeException("Unknown block type! Could not set default material."); + if (!FullGameFields._dataDb.ContainsKey(val)) throw new BlockException($"Block material {value} does not exist!"); - BlockEngine.GetBlockInfo(this).materialId = (byte) value; - BlockEngine.UpdatePrefab(this, (byte) value, Flipped); //TODO: Test default + BlockEngine.GetBlockInfo(this).materialId = val; + BlockEngine.UpdatePrefab(this, val, Flipped); //The default causes the screen to go black } } @@ -336,6 +344,15 @@ namespace TechbloxModdingAPI } } + /// + /// Whether the block should be static in simulation. If set, it cannot be moved. The effect is temporary, it will not be saved with the block. + /// + public bool Static + { + get => BlockEngine.GetBlockInfo(this).staticIfUnconnected; + set => BlockEngine.GetBlockInfo(this).staticIfUnconnected = value; + } + /// /// Whether the block exists. The other properties will return a default value if the block doesn't exist. /// If the block was just placed, then this will also return false but the properties will work correctly. diff --git a/TechbloxModdingAPI/Blocks/Engines/PlacementEngine.cs b/TechbloxModdingAPI/Blocks/Engines/PlacementEngine.cs index 196df83..b2e5659 100644 --- a/TechbloxModdingAPI/Blocks/Engines/PlacementEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/PlacementEngine.cs @@ -77,12 +77,6 @@ namespace TechbloxModdingAPI.Blocks.Engines triggerAutoWiring = autoWire && structInitializer.Has() }); - - /*structInitializer.Init(new OverrideStaticComponent() - { //TODO - staticIfUnconnected = true - });*/ - int nextFilterId = BlockGroupUtility.NextFilterId; structInitializer.Init(new BlockGroupEntityComponent { diff --git a/TechbloxModdingAPI/Interface/IMGUI/Constants.cs b/TechbloxModdingAPI/Interface/IMGUI/Constants.cs index 02564a6..ecb292a 100644 --- a/TechbloxModdingAPI/Interface/IMGUI/Constants.cs +++ b/TechbloxModdingAPI/Interface/IMGUI/Constants.cs @@ -24,7 +24,7 @@ namespace TechbloxModdingAPI.Interface.IMGUI /// /// Best-effort imitation of Techblox's UI style. /// - public static GUISkin Default //TODO: Update to Techblox style + public static GUISkin Default { get { diff --git a/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs b/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs index d938482..319ec76 100644 --- a/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs +++ b/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs @@ -194,6 +194,15 @@ namespace TechbloxModdingAPI.Tests Game.CurrentGame().ToggleTimeMode(); }).Build(); + CommandBuilder.Builder("testColorBlock", "Tests coloring a block to default color") + .Action(() => Player.LocalPlayer.GetBlockLookedAt().Color = BlockColors.Default).Build(); + CommandBuilder.Builder("testMaterialBlock", "Tests materialing a block to default material") + .Action(() => Player.LocalPlayer.GetBlockLookedAt().Material = BlockMaterial.Default).Build(); + CommandBuilder.Builder("testGameName", "Tests changing the game name") + .Action(() => Game.CurrentGame().Name = "Test").Build(); + CommandBuilder.Builder("makeBlockStatic", "Makes a block you look at static") + .Action(() => Player.LocalPlayer.GetBlockLookedAt().Static = true).Build(); + Game.AddPersistentDebugInfo("InstalledMods", InstalledMods); Block.Placed += (sender, args) => Logging.MetaDebugLog("Placed block " + args.Block); -- 2.30.2 From 99f077a917bfad88e5b5ea19f8b6a12abbfa89d4 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Wed, 9 Jun 2021 20:11:31 +0200 Subject: [PATCH 199/252] Update to Techblox 2021.06.08.16.19 Added check for time mode toggle to avoid crashing the game Added support for having the ref folder outside the solution in gen_csproj.py Removed BlockIdentifiers class Added check for invalid player ID when placing blocks Resolved compilation errors --- Automation/gen_csproj.py | 9 +- TechbloxModdingAPI/App/GameGameEngine.cs | 4 +- TechbloxModdingAPI/Block.cs | 4 +- TechbloxModdingAPI/Blocks/BlockIdentifiers.cs | 43 ----- TechbloxModdingAPI/Blocks/DampedSpring.cs | 12 +- TechbloxModdingAPI/Blocks/Engine.cs | 6 +- .../Blocks/Engines/BlueprintEngine.cs | 7 +- .../Blocks/Engines/PlacementEngine.cs | 7 +- .../Blocks/Engines/RemovalEngine.cs | 1 + TechbloxModdingAPI/Input/FakeInput.cs | 46 ++---- TechbloxModdingAPI/Input/FakeInputEngine.cs | 18 +- TechbloxModdingAPI/Interface/IMGUI/Group.cs | 6 +- .../DeserializeFromDiskEntitiesEnginePatch.cs | 2 +- .../Persistence/SaveGameEnginePatch.cs | 2 +- .../Persistence/SimpleEntitySerializer.cs | 4 +- TechbloxModdingAPI/Player.cs | 24 +-- TechbloxModdingAPI/Players/PlayerEngine.cs | 20 +-- TechbloxModdingAPI/TechbloxModdingAPI.csproj | 156 +++++++++++------- .../Tests/TechbloxModdingAPIPluginTest.cs | 2 +- 19 files changed, 181 insertions(+), 192 deletions(-) delete mode 100644 TechbloxModdingAPI/Blocks/BlockIdentifiers.cs diff --git a/Automation/gen_csproj.py b/Automation/gen_csproj.py index 515bcda..9d5dfbc 100755 --- a/Automation/gen_csproj.py +++ b/Automation/gen_csproj.py @@ -3,15 +3,22 @@ import argparse from pathlib import Path, PurePath import re +import os DLL_EXCLUSIONS_REGEX = r"(System|Microsoft|Mono|IronPython|DiscordRPC)\." def getAssemblyReferences(path): asmDir = Path(path) result = list() + addedPath = "" + if not asmDir.exists(): + addedPath = "../" + asmDir = Path(addedPath + path) for child in asmDir.iterdir(): if child.is_file() and re.search(DLL_EXCLUSIONS_REGEX, str(child), re.I) is None and str(child).lower().endswith(".dll"): - result.append(str(child).replace("\\", "/")) + childstr = str(child) + childstr = os.path.relpath(childstr, addedPath).replace("\\", "/") + result.append(childstr) return result def buildReferencesXml(path): diff --git a/TechbloxModdingAPI/App/GameGameEngine.cs b/TechbloxModdingAPI/App/GameGameEngine.cs index 1ed4d48..eceee8b 100644 --- a/TechbloxModdingAPI/App/GameGameEngine.cs +++ b/TechbloxModdingAPI/App/GameGameEngine.cs @@ -91,7 +91,9 @@ namespace TechbloxModdingAPI.App } public void ToggleTimeMode() - { + { + if (!entitiesDB.FoundInGroups()) + throw new AppStateException("At least one block must exist in the world to enter simulation"); TimeRunningModeUtil.ToggleTimeRunningState(entitiesDB); } diff --git a/TechbloxModdingAPI/Block.cs b/TechbloxModdingAPI/Block.cs index c264c17..efea216 100644 --- a/TechbloxModdingAPI/Block.cs +++ b/TechbloxModdingAPI/Block.cs @@ -9,6 +9,7 @@ using RobocraftX.Common; using RobocraftX.Blocks; using Unity.Mathematics; using Gamecraft.Blocks.GUI; +using HarmonyLib; using TechbloxModdingAPI.Blocks; using TechbloxModdingAPI.Blocks.Engines; @@ -65,7 +66,8 @@ namespace TechbloxModdingAPI /// The block object or null if doesn't exist public static Block GetLastPlacedBlock() { - EGID? egid = BlockEngine.FindBlockEGID(BlockIdentifiers.LatestBlockID); + uint lastBlockID = (uint) AccessTools.Field(typeof(CommonExclusiveGroups), "_nextBlockEntityID").GetValue(null) - 1; + EGID? egid = BlockEngine.FindBlockEGID(lastBlockID); return egid.HasValue ? New(egid.Value) : null; } diff --git a/TechbloxModdingAPI/Blocks/BlockIdentifiers.cs b/TechbloxModdingAPI/Blocks/BlockIdentifiers.cs deleted file mode 100644 index 10305dc..0000000 --- a/TechbloxModdingAPI/Blocks/BlockIdentifiers.cs +++ /dev/null @@ -1,43 +0,0 @@ -using Svelto.ECS; -using RobocraftX.Common; - -using HarmonyLib; -using Svelto.DataStructures; - -namespace TechbloxModdingAPI.Blocks -{ - /// - /// ExclusiveGroups and IDs used with blocks - /// - public static class BlockIdentifiers - { - /// - /// Blocks placed by the player - /// - public static FasterReadOnlyList OWNED_BLOCKS { get { return CommonExclusiveGroups.REAL_BLOCKS_GROUPS_DON_T_USE_IN_NEW_CODE; } } - - /// - /// Extra parts used in functional blocks - /// - public static ExclusiveGroup FUNCTIONAL_BLOCK_PARTS { get { return CommonExclusiveGroups.FUNCTIONAL_BLOCK_PART_GROUP; } } - - /// - /// Blocks which are disabled in Simulation mode - /// - public static ExclusiveGroup SIM_BLOCKS_DISABLED { get { return CommonExclusiveGroups.DISABLED_JOINTS_IN_SIM_GROUP; } } - - //public static ExclusiveGroup SPAWN_POINTS { get { return CommonExclusiveGroups.SPAWN_POINTS_GROUP; } } - - //public static ExclusiveGroup SPAWN_POINTS_DISABLED { get { return CommonExclusiveGroups.SPAWN_POINTS_DISABLED_GROUP; } } - - /// - /// The ID of the most recently placed block - /// - public static uint LatestBlockID { - get - { //Need the private field as the property increments itself - return ((uint) AccessTools.Field(typeof(CommonExclusiveGroups), "_nextBlockEntityID").GetValue(null)) - 1; - } - } - } -} diff --git a/TechbloxModdingAPI/Blocks/DampedSpring.cs b/TechbloxModdingAPI/Blocks/DampedSpring.cs index 7009940..afff30b 100644 --- a/TechbloxModdingAPI/Blocks/DampedSpring.cs +++ b/TechbloxModdingAPI/Blocks/DampedSpring.cs @@ -15,13 +15,13 @@ namespace TechbloxModdingAPI.Blocks } /// - /// The spring frequency. + /// The spring's stiffness. /// - public float SpringFrequency + public float Stiffness { - get => BlockEngine.GetBlockInfo(this).springFrequency; + get => BlockEngine.GetBlockInfo(this).stiffness; - set => BlockEngine.GetBlockInfo(this).springFrequency = value; + set => BlockEngine.GetBlockInfo(this).stiffness = value; } /// @@ -29,9 +29,9 @@ namespace TechbloxModdingAPI.Blocks /// public float Damping { - get => BlockEngine.GetBlockInfo(this).springDamping; + get => BlockEngine.GetBlockInfo(this).damping; - set => BlockEngine.GetBlockInfo(this).springDamping = value; + set => BlockEngine.GetBlockInfo(this).damping = value; } /// diff --git a/TechbloxModdingAPI/Blocks/Engine.cs b/TechbloxModdingAPI/Blocks/Engine.cs index 8396e66..08a8f33 100644 --- a/TechbloxModdingAPI/Blocks/Engine.cs +++ b/TechbloxModdingAPI/Blocks/Engine.cs @@ -20,10 +20,10 @@ namespace TechbloxModdingAPI.Blocks set => BlockEngine.GetBlockInfo(this).engineOn = value; } - public int TorqueDirection + public float CurrentTorque { - get => BlockEngine.GetBlockInfo(this).torqueDirection; - set => BlockEngine.GetBlockInfo(this).torqueDirection = value; + get => BlockEngine.GetBlockInfo(this).currentTorque; + set => BlockEngine.GetBlockInfo(this).currentTorque = value; } public int CurrentGear diff --git a/TechbloxModdingAPI/Blocks/Engines/BlueprintEngine.cs b/TechbloxModdingAPI/Blocks/Engines/BlueprintEngine.cs index c6ba686..4bc5f5d 100644 --- a/TechbloxModdingAPI/Blocks/Engines/BlueprintEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/BlueprintEngine.cs @@ -12,6 +12,7 @@ using Svelto.DataStructures; using Svelto.ECS; using Svelto.ECS.DataStructures; using Svelto.ECS.EntityStructs; +using Svelto.ECS.Native; using Svelto.ECS.Serialization; using TechbloxModdingAPI.Engines; using TechbloxModdingAPI.Utility; @@ -160,10 +161,14 @@ namespace TechbloxModdingAPI.Blocks.Engines private void BuildGhostBlueprint(ICollection blocks, float3 pos, quaternion rot, uint playerID) { GhostChildUtility.ClearGhostChildren(playerID, entitiesDB, entityFunctions); + var bssesopt = entitiesDB.QueryEntityOptional(new EGID(playerID, + BoxSelectExclusiveGroups.BoxSelectVolumeExclusiveGroup)); + if (!bssesopt) + return; foreach (var block in blocks) { GhostChildUtility.BuildGhostChild(in playerID, block.Id, in pos, in rot, entitiesDB, - BuildGhostBlueprintFactory, false); + BuildGhostBlueprintFactory, false, bssesopt.Get().buildingDroneReference); } } diff --git a/TechbloxModdingAPI/Blocks/Engines/PlacementEngine.cs b/TechbloxModdingAPI/Blocks/Engines/PlacementEngine.cs index b2e5659..9ce7d84 100644 --- a/TechbloxModdingAPI/Blocks/Engines/PlacementEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/PlacementEngine.cs @@ -7,6 +7,7 @@ using HarmonyLib; using RobocraftX.Blocks; using RobocraftX.Character; using RobocraftX.Common; +using RobocraftX.CR.MachineEditing.BoxSelect; using RobocraftX.Rendering; using RobocraftX.Rendering.GPUI; using Svelto.ECS; @@ -70,10 +71,14 @@ namespace TechbloxModdingAPI.Blocks.Engines }); structInitializer.Init(new UniformBlockScaleEntityStruct {scaleFactor = 1}); structInitializer.Get().materialId = (byte) BlockMaterial.SteelBodywork; + var bssesopt = entitiesDB.QueryEntityOptional(new EGID(playerId, + BoxSelectExclusiveGroups.BoxSelectVolumeExclusiveGroup)); + if (!bssesopt) + throw new BlockException("Invalid player ID specified for block placement"); structInitializer.Init(new BlockPlacementInfoStruct { loadedFromDisk = false, - placedBy = playerId, + placedByBuildingDrone = bssesopt.Get().buildingDroneReference, triggerAutoWiring = autoWire && structInitializer.Has() }); diff --git a/TechbloxModdingAPI/Blocks/Engines/RemovalEngine.cs b/TechbloxModdingAPI/Blocks/Engines/RemovalEngine.cs index b753d3f..4322d5e 100644 --- a/TechbloxModdingAPI/Blocks/Engines/RemovalEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/RemovalEngine.cs @@ -4,6 +4,7 @@ using HarmonyLib; using RobocraftX.Blocks; using RobocraftX.Common; using Svelto.ECS; +using Svelto.ECS.Native; using TechbloxModdingAPI.Engines; using TechbloxModdingAPI.Utility; diff --git a/TechbloxModdingAPI/Input/FakeInput.cs b/TechbloxModdingAPI/Input/FakeInput.cs index 6104a4e..a3d068a 100644 --- a/TechbloxModdingAPI/Input/FakeInput.cs +++ b/TechbloxModdingAPI/Input/FakeInput.cs @@ -15,7 +15,7 @@ namespace TechbloxModdingAPI.Input /// Customize the local input. /// /// The custom input. - public static void CustomInput(LocalInputEntityStruct input) + public static void CustomInput(LocalCosmeticInputEntityComponent input) { inputEngine.SendCustomInput(input); } @@ -34,7 +34,7 @@ namespace TechbloxModdingAPI.Input inputEngine.SendCustomPlayerInput(input, playerID); } - public static LocalInputEntityStruct GetInput() + public static LocalCosmeticInputEntityComponent GetInput() { return inputEngine.GetInput(); } @@ -48,31 +48,23 @@ namespace TechbloxModdingAPI.Input return inputEngine.GetPlayerInput(playerID); } - /// - /// Fake a GUI input. + /// + /// Fake a GUI input. /// Omit any parameter you do not want to affect. /// Parameters that end with "?" don't do anything... yet. - /// - /// The player. Omit this to use the local player. - /// Select the hotbar slot by number. - /// Toggle the command line? - /// Open escape menu? - /// Page return? - /// Toggle debug display? - /// Select next? - /// Select previous? - /// Tab? - /// Toggle to hotbar colour mode? - /// Select the hotbar page by number? - /// Quicksave? - /// Paste? - public static void GuiInput(uint playerID = uint.MaxValue, int hotbar = -1, bool escape = false, bool enter = false, bool debug = false, bool next = false, bool previous = false, bool tab = false, int hotbarPage = -1, bool quickSave = false, bool paste = false) + /// + /// Select the hotbar slot by number. + /// Toggle the command line? + /// Open escape menu? + /// Page return? + /// Toggle debug display? + /// Toggle to hotbar colour mode? + /// Select the hotbar page by number? + /// Quicksave? + /// Paste? + public static void GuiInput(int hotbar = -1, bool escape = false, bool enter = false, bool debug = false, int hotbarPage = -1, bool quickSave = false, bool paste = false) { - if (playerID == uint.MaxValue) - { - playerID = inputEngine.GetLocalPlayerID(); - } - ref LocalInputEntityStruct currentInput = ref inputEngine.GetInputRef(); + ref LocalCosmeticInputEntityComponent currentInput = ref inputEngine.GetInputRef(); //Utility.Logging.CommandLog($"Current sim frame {currentInput.frame}"); // set inputs switch(hotbar) @@ -92,9 +84,6 @@ namespace TechbloxModdingAPI.Input if (escape) currentInput.guiMask |= RobocraftX.Common.Input.GuiInput.Escape; if (enter) currentInput.guiMask |= RobocraftX.Common.Input.GuiInput.Return; if (debug) currentInput.guiMask |= RobocraftX.Common.Input.GuiInput.ToggleDebugDisplay; - if (next) currentInput.guiMask |= RobocraftX.Common.Input.GuiInput.SelectNext; - if (previous) currentInput.guiMask |= RobocraftX.Common.Input.GuiInput.SelectPrev; - if (tab) currentInput.guiMask |= RobocraftX.Common.Input.GuiInput.Tab; switch (hotbarPage) { case 1: currentInput.guiMask |= RobocraftX.Common.Input.GuiInput.HotbarPage1; break; @@ -107,11 +96,10 @@ namespace TechbloxModdingAPI.Input case 8: currentInput.guiMask |= RobocraftX.Common.Input.GuiInput.HotbarPage8; break; case 9: currentInput.guiMask |= RobocraftX.Common.Input.GuiInput.HotbarPage9; break; case 10: currentInput.guiMask |= RobocraftX.Common.Input.GuiInput.HotbarPage10; break; - default: break; } //RewiredConsts.Action if (quickSave) currentInput.guiMask |= RobocraftX.Common.Input.GuiInput.QuickSave; - if (paste) currentInput.guiMask |= RobocraftX.Common.Input.GuiInput.PasteSelection; + if (paste) currentInput.guiMask |= RobocraftX.Common.Input.GuiInput.SelectLastCopiedBlueprint; } public static void ActionInput(uint playerID = uint.MaxValue, bool toggleMode = false, bool forward = false, bool backward = false, bool up = false, bool down = false, bool left = false, bool right = false, bool sprint = false, bool toggleFly = false, bool alt = false, bool primary = false, bool secondary = false, bool tertiary = false, bool primaryHeld = false, bool secondaryHeld = false, bool toggleUnitGrid = false, bool ctrl = false, bool toggleColourMode = false, bool scaleBlockUp = false, bool scaleBlockDown = false, bool rotateBlockClockwise = false, bool rotateBlockCounterclockwise = false, bool cutSelection = false, bool copySelection = false, bool deleteSelection = false) diff --git a/TechbloxModdingAPI/Input/FakeInputEngine.cs b/TechbloxModdingAPI/Input/FakeInputEngine.cs index 7d2efb7..7b4528c 100644 --- a/TechbloxModdingAPI/Input/FakeInputEngine.cs +++ b/TechbloxModdingAPI/Input/FakeInputEngine.cs @@ -30,12 +30,12 @@ namespace TechbloxModdingAPI.Input IsReady = true; } - public bool SendCustomInput(LocalInputEntityStruct input) + public bool SendCustomInput(LocalCosmeticInputEntityComponent input) { EGID egid = CommonExclusiveGroups.GameStateEGID; - if (entitiesDB.Exists(egid)) + if (entitiesDB.Exists(egid)) { - ref LocalInputEntityStruct ies = ref entitiesDB.QueryEntity(egid); + ref LocalCosmeticInputEntityComponent ies = ref entitiesDB.QueryEntity(egid); ies = input; return true; } @@ -54,14 +54,14 @@ namespace TechbloxModdingAPI.Input else return false; } - public LocalInputEntityStruct GetInput() + public LocalCosmeticInputEntityComponent GetInput() { EGID egid = CommonExclusiveGroups.GameStateEGID; - if (entitiesDB.Exists(egid)) + if (entitiesDB.Exists(egid)) { - return entitiesDB.QueryEntity(egid); + return entitiesDB.QueryEntity(egid); } - else return default(LocalInputEntityStruct); + else return default(LocalCosmeticInputEntityComponent); } public LocalPlayerInputEntityStruct GetPlayerInput(uint playerID, bool remote = false) @@ -74,10 +74,10 @@ namespace TechbloxModdingAPI.Input else return default; } - public ref LocalInputEntityStruct GetInputRef() + public ref LocalCosmeticInputEntityComponent GetInputRef() { EGID egid = CommonExclusiveGroups.GameStateEGID; - return ref entitiesDB.QueryEntity(egid); + return ref entitiesDB.QueryEntity(egid); } public ref LocalPlayerInputEntityStruct GetPlayerInputRef(uint playerID, bool remote = false) diff --git a/TechbloxModdingAPI/Interface/IMGUI/Group.cs b/TechbloxModdingAPI/Interface/IMGUI/Group.cs index bbbbdf1..b1dcccc 100644 --- a/TechbloxModdingAPI/Interface/IMGUI/Group.cs +++ b/TechbloxModdingAPI/Interface/IMGUI/Group.cs @@ -25,7 +25,7 @@ namespace TechbloxModdingAPI.Interface.IMGUI /*if (Constants.Default == null) return; if (Constants.Default.box == null) return;*/ GUIStyle guiStyle = Constants.Default.box; - UIElement[] elems = elements.ToArrayFast(out uint count); + UIElement[] elems = elements.ToArrayFast(out int count); if (automaticLayout) { GUILayout.BeginArea(Box, guiStyle); @@ -132,7 +132,7 @@ namespace TechbloxModdingAPI.Interface.IMGUI { if (index < 0 || index >= elements.count) return false; IMGUIManager.AddElement(elements[index]); // re-add to global manager - elements.RemoveAt(index); + elements.RemoveAt((uint) index); return true; } @@ -143,7 +143,7 @@ namespace TechbloxModdingAPI.Interface.IMGUI /// The element's index, or -1 if not found. public int IndexOf(UIElement element) { - UIElement[] elems = elements.ToArrayFast(out uint count); + UIElement[] elems = elements.ToArrayFast(out int count); for (int i = 0; i < count; i++) { if (elems[i].Name == element.Name) diff --git a/TechbloxModdingAPI/Persistence/DeserializeFromDiskEntitiesEnginePatch.cs b/TechbloxModdingAPI/Persistence/DeserializeFromDiskEntitiesEnginePatch.cs index d998f0e..166f744 100644 --- a/TechbloxModdingAPI/Persistence/DeserializeFromDiskEntitiesEnginePatch.cs +++ b/TechbloxModdingAPI/Persistence/DeserializeFromDiskEntitiesEnginePatch.cs @@ -26,7 +26,7 @@ namespace TechbloxModdingAPI.Persistence SerializerManager.RegisterSerializers(SaveAndLoadCompositionRootPatch.currentEnginesRoot); uint originalPos = ____serializationData.dataPos; Logging.MetaDebugLog($"dataPos: {originalPos}"); - BinaryBufferReader bbr = new BinaryBufferReader(____bytesStream.ToArrayFast(out uint count), ____serializationData.dataPos); + BinaryBufferReader bbr = new BinaryBufferReader(____bytesStream.ToArrayFast(out int count), ____serializationData.dataPos); byte[] frameBuffer = new byte[frameStart.Length]; Logging.MetaDebugLog($"serial data count: {____serializationData.data.count} capacity: {____serializationData.data.capacity}"); int i = 0; diff --git a/TechbloxModdingAPI/Persistence/SaveGameEnginePatch.cs b/TechbloxModdingAPI/Persistence/SaveGameEnginePatch.cs index 9371e9b..4386d3a 100644 --- a/TechbloxModdingAPI/Persistence/SaveGameEnginePatch.cs +++ b/TechbloxModdingAPI/Persistence/SaveGameEnginePatch.cs @@ -26,7 +26,7 @@ namespace TechbloxModdingAPI.Persistence return; } serializationData.data.ExpandBy((uint)frameStart.Length); - BinaryBufferWriter bbw = new BinaryBufferWriter(serializationData.data.ToArrayFast(out uint buffLen), serializationData.dataPos); + BinaryBufferWriter bbw = new BinaryBufferWriter(serializationData.data.ToArrayFast(out int buffLen), serializationData.dataPos); uint originalPos = serializationData.dataPos; Logging.MetaDebugLog($"dataPos: {originalPos}"); // Add frame start so it's easier to find TechbloxModdingAPI-serialized components diff --git a/TechbloxModdingAPI/Persistence/SimpleEntitySerializer.cs b/TechbloxModdingAPI/Persistence/SimpleEntitySerializer.cs index 7f605c3..10e7ce1 100644 --- a/TechbloxModdingAPI/Persistence/SimpleEntitySerializer.cs +++ b/TechbloxModdingAPI/Persistence/SimpleEntitySerializer.cs @@ -32,7 +32,7 @@ namespace TechbloxModdingAPI.Persistence public bool Deserialize(ref ISerializationData serializationData, IEntitySerialization entitySerializer) { - BinaryBufferReader bbr = new BinaryBufferReader(serializationData.data.ToArrayFast(out uint count), serializationData.dataPos); + BinaryBufferReader bbr = new BinaryBufferReader(serializationData.data.ToArrayFast(out int count), serializationData.dataPos); uint entityCount = bbr.ReadUint(); serializationData.dataPos = bbr.Position; for (uint i = 0; i < entityCount; i++) @@ -47,7 +47,7 @@ namespace TechbloxModdingAPI.Persistence public bool Serialize(ref ISerializationData serializationData, EntitiesDB entitiesDB, IEntitySerialization entitySerializer) { serializationData.data.ExpandBy(4u); - BinaryBufferWriter bbw = new BinaryBufferWriter(serializationData.data.ToArrayFast(out uint count), serializationData.dataPos); + BinaryBufferWriter bbw = new BinaryBufferWriter(serializationData.data.ToArrayFast(out int count), serializationData.dataPos); EGID[] toSerialize = getEntitiesToSerialize(entitiesDB); bbw.Write((uint)toSerialize.Length); serializationData.dataPos = bbw.Position; diff --git a/TechbloxModdingAPI/Player.cs b/TechbloxModdingAPI/Player.cs index 9bab382..de38b9b 100644 --- a/TechbloxModdingAPI/Player.cs +++ b/TechbloxModdingAPI/Player.cs @@ -6,8 +6,8 @@ using RobocraftX.Common; using RobocraftX.Common.Players; using RobocraftX.Physics; using Svelto.ECS; +using Techblox.BuildingDrone; using Techblox.Camera; -using Techblox.FlyCam; using TechbloxModdingAPI.Blocks; using TechbloxModdingAPI.Players; using TechbloxModdingAPI.Utility; @@ -141,10 +141,10 @@ namespace TechbloxModdingAPI public float3 Rotation { get => ((Quaternion) (GameState.IsBuildMode() - ? playerEngine.GetCameraStruct(Id).Get().rotation + ? playerEngine.GetCameraStruct(Id).Get().rotation : playerEngine.GetCharacterStruct(Id).Get().rotation)).eulerAngles; set => _ = GameState.IsBuildMode() - ? playerEngine.GetCameraStruct(Id).Get().rotation = quaternion.Euler(value) + ? playerEngine.GetCameraStruct(Id).Get().rotation = quaternion.Euler(value) : playerEngine.GetCharacterStruct(Id).Get().rotation = quaternion.Euler(value); } @@ -349,7 +349,7 @@ namespace TechbloxModdingAPI /// The player's mode in time stopped mode, determining what they place. /// public PlayerBuildingMode BuildingMode => (PlayerBuildingMode) playerEngine - .GetCharacterStruct(Id).Get().timeStoppedContext; + .GetCharacterStruct(Id).Get().timeStoppedContext; /// /// Whether the player is sprinting. @@ -357,10 +357,10 @@ namespace TechbloxModdingAPI public bool Sprinting { get => GameState.IsBuildMode() - ? playerEngine.GetCharacterStruct(Id).Get().sprinting + ? playerEngine.GetCharacterStruct(Id).Get().sprinting : playerEngine.GetCharacterStruct(Id).Get().isSprinting; set => _ = GameState.IsBuildMode() - ? playerEngine.GetCharacterStruct(Id).Get().sprinting = value + ? playerEngine.GetCharacterStruct(Id).Get().sprinting = value : playerEngine.GetCharacterStruct(Id).Get().isSprinting = value; } @@ -370,10 +370,10 @@ namespace TechbloxModdingAPI public float SpeedSetting { get => GameState.IsBuildMode() - ? playerEngine.GetCharacterStruct(Id).Get().speed + ? playerEngine.GetCharacterStruct(Id).Get().speed : playerEngine.GetCharacterStruct(Id).Get().moveSpeed; set => _ = GameState.IsBuildMode() - ? playerEngine.GetCharacterStruct(Id).Get().speed = value + ? playerEngine.GetCharacterStruct(Id).Get().speed = value : playerEngine.GetCharacterStruct(Id).Get().moveSpeed = value; } @@ -383,10 +383,10 @@ namespace TechbloxModdingAPI public float SpeedSprintMultiplierSetting { get => GameState.IsBuildMode() - ? playerEngine.GetCharacterStruct(Id).Get().speedSprintMultiplier + ? playerEngine.GetCharacterStruct(Id).Get().speedSprintMultiplier : playerEngine.GetCharacterStruct(Id).Get().sprintSpeedMultiplier; set => _ = GameState.IsBuildMode() - ? playerEngine.GetCharacterStruct(Id).Get().speedSprintMultiplier = value + ? playerEngine.GetCharacterStruct(Id).Get().speedSprintMultiplier = value : playerEngine.GetCharacterStruct(Id).Get().sprintSpeedMultiplier = value; } @@ -396,10 +396,10 @@ namespace TechbloxModdingAPI public float AccelerationSetting { get => GameState.IsBuildMode() - ? playerEngine.GetCharacterStruct(Id).Get().acceleration + ? playerEngine.GetCharacterStruct(Id).Get().acceleration : playerEngine.GetCharacterStruct(Id).Get().acceleration; set => _ = GameState.IsBuildMode() - ? playerEngine.GetCharacterStruct(Id).Get().acceleration = value + ? playerEngine.GetCharacterStruct(Id).Get().acceleration = value : playerEngine.GetCharacterStruct(Id).Get().acceleration = value; } diff --git a/TechbloxModdingAPI/Players/PlayerEngine.cs b/TechbloxModdingAPI/Players/PlayerEngine.cs index 506c55d..aad3612 100644 --- a/TechbloxModdingAPI/Players/PlayerEngine.cs +++ b/TechbloxModdingAPI/Players/PlayerEngine.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Reflection; -using System.Runtime.CompilerServices; +using System.Runtime.CompilerServices; using RobocraftX.Character; using RobocraftX.Character.Movement; @@ -13,13 +10,10 @@ using RobocraftX.Blocks.Ghost; using Gamecraft.GUI.HUDFeedbackBlocks; using Svelto.ECS; using Techblox.Camera; -using Techblox.FlyCam; using Unity.Mathematics; -using Unity.Physics; -using UnityEngine; -using HarmonyLib; -using RobocraftX.Common; using Svelto.ECS.DataStructures; +using Techblox.BuildingDrone; + using TechbloxModdingAPI.Engines; using TechbloxModdingAPI.Utility; @@ -140,7 +134,7 @@ namespace TechbloxModdingAPI.Players { group = default; if (GameState.IsBuildMode()) - return entitiesDB.QueryEntityOptional(new EGID(playerId, Techblox.FlyCam.FlyCam.Group)); + return entitiesDB.QueryEntityOptional(new EGID(playerId, LocalBuildingDrone.BuildGroup)); var characterGroups = CharacterExclusiveGroups.AllCharacters; for (int i = 0; i < characterGroups.count; i++) @@ -167,14 +161,14 @@ namespace TechbloxModdingAPI.Players public OptionalRef GetCameraStruct(uint playerId) where T : unmanaged, IEntityComponent { - return entitiesDB.QueryEntityOptional(new EGID(playerId, CameraExclusiveGroups.CameraGroup)); + return entitiesDB.QueryEntityOptional(new EGID(playerId, CameraExclusiveGroups.PhysicCameraGroup)); } public EGID GetThingLookedAt(uint playerId, float maxDistance = -1f) { - var opt = GetCameraStruct(playerId); + var opt = GetCameraStruct(playerId); if (!opt) return EGID.Empty; - CharacterCameraRayCastEntityStruct rayCast = opt; + PhysicCameraRayCastEntityStruct rayCast = opt; float distance = maxDistance < 0 ? GhostBlockUtils.GetBuildInteractionDistance(entitiesDB, rayCast, GhostBlockUtils.GhostCastMethod.GhostCastProportionalToBlockSize) diff --git a/TechbloxModdingAPI/TechbloxModdingAPI.csproj b/TechbloxModdingAPI/TechbloxModdingAPI.csproj index ca99746..2de8b34 100644 --- a/TechbloxModdingAPI/TechbloxModdingAPI.csproj +++ b/TechbloxModdingAPI/TechbloxModdingAPI.csproj @@ -72,6 +72,10 @@ ..\ref\TechbloxPreview_Data\Managed\DDNA.dll ..\..\ref\TechbloxPreview_Data\Managed\DDNA.dll + + ..\ref\TechbloxPreview_Data\Managed\EOSSDK.dll + ..\..\ref\TechbloxPreview_Data\Managed\EOSSDK.dll + ..\ref\TechbloxPreview_Data\Managed\FMODUnity.dll ..\..\ref\TechbloxPreview_Data\Managed\FMODUnity.dll @@ -92,6 +96,10 @@ ..\ref\TechbloxPreview_Data\Managed\Gamecraft.BlockEntityFactory.dll ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.BlockEntityFactory.dll + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.BlockGroups.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.BlockGroups.dll + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.DamagingSurfaceBlock.dll ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.DamagingSurfaceBlock.dll @@ -144,6 +152,10 @@ ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Damage.dll ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Damage.dll + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Effects.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Effects.dll + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.ExplosionFragments.dll ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.ExplosionFragments.dll @@ -196,6 +208,10 @@ ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.ModeBar.dll ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.ModeBar.dll + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.OptionsScreen.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.OptionsScreen.dll + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Blocks.dll ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Blocks.dll @@ -252,74 +268,10 @@ ..\ref\TechbloxPreview_Data\Managed\Gamecraft.PerformanceWarnings.dll ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.PerformanceWarnings.dll - - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.BlockGroups.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.BlockGroups.dll - - - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Effects.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Effects.dll - - - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.OptionsScreen.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.OptionsScreen.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.PickupBlck.dll ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.PickupBlck.dll - - ..\ref\TechbloxPreview_Data\Managed\Havok.Physics.Hybrid.dll - ..\..\ref\TechbloxPreview_Data\Managed\Havok.Physics.Hybrid.dll - - - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Blocks.Ghost.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Blocks.Ghost.dll - - - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.ColourInventory.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.ColourInventory.dll - - - ..\ref\TechbloxPreview_Data\Managed\Robocraftx.ObjectIdBlocks.dll - ..\..\ref\TechbloxPreview_Data\Managed\Robocraftx.ObjectIdBlocks.dll - - - ..\ref\TechbloxPreview_Data\Managed\StringFormatter.dll - ..\..\ref\TechbloxPreview_Data\Managed\StringFormatter.dll - - - ..\ref\TechbloxPreview_Data\Managed\Techblox.FlyCam.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.FlyCam.dll - - - ..\ref\TechbloxPreview_Data\Managed\Unity.Addressables.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Addressables.dll - - - ..\ref\TechbloxPreview_Data\Managed\Unity.Mathematics.Extensions.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Mathematics.Extensions.dll - - - ..\ref\TechbloxPreview_Data\Managed\Unity.ResourceManager.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.ResourceManager.dll - - - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.AudioModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.AudioModule.dll - - - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.IMGUIModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.IMGUIModule.dll - - - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.SpriteShapeModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.SpriteShapeModule.dll - - - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UmbraModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UmbraModule.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.PickupsCommon.dll ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.PickupsCommon.dll @@ -380,6 +332,10 @@ ..\ref\TechbloxPreview_Data\Managed\Havok.Physics.dll ..\..\ref\TechbloxPreview_Data\Managed\Havok.Physics.dll + + ..\ref\TechbloxPreview_Data\Managed\Havok.Physics.Hybrid.dll + ..\..\ref\TechbloxPreview_Data\Managed\Havok.Physics.Hybrid.dll + ..\ref\TechbloxPreview_Data\Managed\JWT.dll ..\..\ref\TechbloxPreview_Data\Managed\JWT.dll @@ -432,6 +388,10 @@ ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Blocks.dll ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Blocks.dll + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Blocks.Ghost.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Blocks.Ghost.dll + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Blocks.Triggers.dll ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Blocks.Triggers.dll @@ -484,6 +444,10 @@ ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.BlocksInventory.dll ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.BlocksInventory.dll + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.ColourInventory.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.ColourInventory.dll + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.dll ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.dll @@ -540,6 +504,10 @@ ..\ref\TechbloxPreview_Data\Managed\RobocraftX.MultiplayerInput.dll ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.MultiplayerInput.dll + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.ObjectIdBlocks.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.ObjectIdBlocks.dll + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Party.dll ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Party.dll @@ -600,6 +568,10 @@ ..\ref\TechbloxPreview_Data\Managed\SpecializedDescriptors.dll ..\..\ref\TechbloxPreview_Data\Managed\SpecializedDescriptors.dll + + ..\ref\TechbloxPreview_Data\Managed\StringFormatter.dll + ..\..\ref\TechbloxPreview_Data\Managed\StringFormatter.dll + ..\ref\TechbloxPreview_Data\Managed\Svelto.Common.dll ..\..\ref\TechbloxPreview_Data\Managed\Svelto.Common.dll @@ -620,6 +592,14 @@ ..\ref\TechbloxPreview_Data\Managed\Techblox.AutoForward.dll ..\..\ref\TechbloxPreview_Data\Managed\Techblox.AutoForward.dll + + ..\ref\TechbloxPreview_Data\Managed\Techblox.Backend.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Backend.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.BuildingDrone.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.BuildingDrone.dll + ..\ref\TechbloxPreview_Data\Managed\Techblox.Camera.dll ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Camera.dll @@ -632,6 +612,10 @@ ..\ref\TechbloxPreview_Data\Managed\Techblox.Environment.dll ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Environment.dll + + ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.dll + ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Hotbar.Materials.dll ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Hotbar.Materials.dll @@ -644,10 +628,22 @@ ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Inventory.Materials.dll ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Inventory.Materials.dll + + ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Login.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Login.dll + ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.MyGamesScreen.dll ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.MyGamesScreen.dll + + ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Notifications.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Notifications.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Notifications.MockUps.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Notifications.MockUps.dll + ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.TabsBar.Materials.dll ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.TabsBar.Materials.dll @@ -660,6 +656,10 @@ ..\ref\TechbloxPreview_Data\Managed\Techblox.Pointer.dll ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Pointer.dll + + ..\ref\TechbloxPreview_Data\Managed\Techblox.Services.Eos.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Services.Eos.dll + ..\ref\TechbloxPreview_Data\Managed\Techblox.SwitchAnimation.dll ..\..\ref\TechbloxPreview_Data\Managed\Techblox.SwitchAnimation.dll @@ -688,6 +688,10 @@ ..\ref\TechbloxPreview_Data\Managed\UniTask.TextMeshPro.dll ..\..\ref\TechbloxPreview_Data\Managed\UniTask.TextMeshPro.dll + + ..\ref\TechbloxPreview_Data\Managed\Unity.Addressables.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Addressables.dll + ..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.dll ..\..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.dll @@ -744,6 +748,10 @@ ..\ref\TechbloxPreview_Data\Managed\Unity.Mathematics.dll ..\..\ref\TechbloxPreview_Data\Managed\Unity.Mathematics.dll + + ..\ref\TechbloxPreview_Data\Managed\Unity.Mathematics.Extensions.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Mathematics.Extensions.dll + ..\ref\TechbloxPreview_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll ..\..\ref\TechbloxPreview_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll @@ -796,6 +804,10 @@ ..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll ..\..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll + + ..\ref\TechbloxPreview_Data\Managed\Unity.ResourceManager.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.ResourceManager.dll + ..\ref\TechbloxPreview_Data\Managed\Unity.Scenes.dll ..\..\ref\TechbloxPreview_Data\Managed\Unity.Scenes.dll @@ -852,6 +864,10 @@ ..\ref\TechbloxPreview_Data\Managed\UnityEngine.AssetBundleModule.dll ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.AssetBundleModule.dll + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.AudioModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.AudioModule.dll + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.ClothModule.dll ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.ClothModule.dll @@ -904,6 +920,10 @@ ..\ref\TechbloxPreview_Data\Managed\UnityEngine.ImageConversionModule.dll ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.ImageConversionModule.dll + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.IMGUIModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.IMGUIModule.dll + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.InputLegacyModule.dll ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.InputLegacyModule.dll @@ -956,6 +976,10 @@ ..\ref\TechbloxPreview_Data\Managed\UnityEngine.SpriteMaskModule.dll ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.SpriteMaskModule.dll + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.SpriteShapeModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.SpriteShapeModule.dll + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.StreamingModule.dll ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.StreamingModule.dll @@ -1008,6 +1032,10 @@ ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UIModule.dll ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UIModule.dll + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UmbraModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UmbraModule.dll + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UNETModule.dll ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UNETModule.dll diff --git a/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs b/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs index 319ec76..8ed3050 100644 --- a/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs +++ b/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs @@ -267,7 +267,7 @@ namespace TechbloxModdingAPI.Tests if (UnityEngine.Input.GetKeyDown(KeyCode.End)) { Console.WriteLine("Pressed button to toggle console"); - FakeInput.CustomInput(new LocalInputEntityStruct {commandLineToggleInput = true}); + FakeInput.CustomInput(new LocalCosmeticInputEntityComponent {commandLineToggleInput = true}); } } -- 2.30.2 From 0b2ffef0d3793bc479fcc046d1059a93ff512c67 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Wed, 9 Jun 2021 22:03:15 +0200 Subject: [PATCH 200/252] Update block IDs --- TechbloxModdingAPI/Blocks/BlockIDs.cs | 52 +++++++++++++++---- TechbloxModdingAPI/Blocks/BlockTests.cs | 2 +- .../Tests/TechbloxModdingAPIPluginTest.cs | 29 +++++++++++ 3 files changed, 71 insertions(+), 12 deletions(-) diff --git a/TechbloxModdingAPI/Blocks/BlockIDs.cs b/TechbloxModdingAPI/Blocks/BlockIDs.cs index fcb3e41..8d1d443 100644 --- a/TechbloxModdingAPI/Blocks/BlockIDs.cs +++ b/TechbloxModdingAPI/Blocks/BlockIDs.cs @@ -36,11 +36,8 @@ namespace TechbloxModdingAPI.Blocks FrameWedgeS2, FrameWedgeS3, FrameWedgeS4, - SideS0S1, - SideS0S2, - SideS0S3, - SideS0S4, - SideS0S5, + SideS0S3 = 29, + SideS0S5 = 31, SideS1S1, SideS1S2, SideS1S3, @@ -51,11 +48,8 @@ namespace TechbloxModdingAPI.Blocks SideS2S3, SideS2S4, SideS2S5, - WindscreenS1, - WindscreenS2, - WindscreenS3, - WindscreenS4, - WindscreenS5, + WindscreenS3 = 44, + WindscreenS5 = 46, CarWheelArch, CarArchSmallFlare, CarArchFlare, @@ -106,7 +100,43 @@ namespace TechbloxModdingAPI.Blocks WideCylinderDiagonal, NarrowCylinderDiagonal, HeadlampTetrahedron, - CarWheelWideProfile = 200, + GoKartEngine, + Screen5X2Y2Z, + Screen5X2Y3Z, + Screen5X2Y5Z, + Screen9X2Y2Z, + Screen9X3Y2Z, + Screen9X2Y3Z, + Screen9X3Y3Z, + Screen9X2Y5Z, + Screen9X3Y5Z, + Screen11X3Y2Z, + Screen11X3Y3Z, + Screen11X3Y5Z, + Window6X2Y2Z, + Window6X3Y2Z, + Window6X2Y2ZS1, + Window6X3Y2ZS1, + Window6X2Y2ZS2, + Window6X3Y2ZS2, + Window6X2Y2ZS4, + Window6X3Y2ZS4, + FrameSquare, + FrameSkewedSquare, + FrameTriangle, + FrameSkewedTriangle, + GlassFrameSquare, + GlassFrameSkewedSquare, + GlassFrameTriangle, + GlassFrameSkewedTriangle, + GlassPlate, + GlassPlateTriangle, + GoKartWheelRigNoSteering, + GoKartWheelRigWithSteering, + GoKartSeat, + CarWheelWideProfile, CarWheel, + GoKartWheelWideProfile, + GoKartWheel, } } \ No newline at end of file diff --git a/TechbloxModdingAPI/Blocks/BlockTests.cs b/TechbloxModdingAPI/Blocks/BlockTests.cs index f69315e..42e8910 100644 --- a/TechbloxModdingAPI/Blocks/BlockTests.cs +++ b/TechbloxModdingAPI/Blocks/BlockTests.cs @@ -140,7 +140,7 @@ namespace TechbloxModdingAPI.Blocks Block newBlock = Block.PlaceNew(BlockIDs.DampedSpring, Unity.Mathematics.float3.zero + 1); DampedSpring b = null; // Note: the assignment operation is a lambda, which slightly confuses the compiler Assert.Errorless(() => { b = (DampedSpring) newBlock; }, "Casting block to DampedSpring raised an exception: ", "Casting block to DampedSpring completed without issue."); - if (!Assert.CloseTo(b.SpringFrequency, 30f, $"DampedSpring.SpringFrequency {b.SpringFrequency} does not equal default value, possibly because it failed silently.", "DampedSpring.SpringFrequency is close enough to default.")) return; + if (!Assert.CloseTo(b.Stiffness, 30f, $"DampedSpring.Stiffness {b.Stiffness} does not equal default value, possibly because it failed silently.", "DampedSpring.Stiffness is close enough to default.")) return; if (!Assert.CloseTo(b.Damping, 30f, $"DampedSpring.Damping {b.Damping} does not equal default value, possibly because it failed silently.", "DampedSpring.Damping is close enough to default.")) return; if (!Assert.CloseTo(b.MaxExtension, 0.3f, $"DampedSpring.MaxExtension {b.MaxExtension} does not equal default value, possibly because it failed silently.", "DampedSpring.MaxExtension is close enough to default.")) return; } diff --git a/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs b/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs index 8ed3050..6a06e42 100644 --- a/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs +++ b/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs @@ -1,7 +1,11 @@ using System; +using System.Collections.Generic; using System.Diagnostics; +using System.Linq; using System.Reflection; using System.Text; +using System.Text.RegularExpressions; +using DataLoader; using TechbloxModdingAPI.App; using HarmonyLib; using IllusionInjector; @@ -10,6 +14,7 @@ using RobocraftX.FrontEnd; using Unity.Mathematics; using UnityEngine; using RobocraftX.Common.Input; +using ServiceLayer; using TechbloxModdingAPI.Blocks; using TechbloxModdingAPI.Commands; using TechbloxModdingAPI.Input; @@ -247,6 +252,30 @@ namespace TechbloxModdingAPI.Tests /*((FasterList)AccessTools.Property(typeof(GuiInputMap), "GuiInputsButtonDown").GetValue(null)) .Add(new GuiInputMap.GuiInputMapElement(RewiredConsts.Action.ToggleCommandLine, GuiIn))*/ + + /*Game.Enter += (sender, e) => + { + ushort lastKey = ushort.MaxValue; + foreach (var kv in FullGameFields._dataDb.GetValues() + .OrderBy(kv=>ushort.Parse(kv.Key))) + { + var data = (CubeListData) kv.Value; + ushort currentKey = ushort.Parse(kv.Key); + var toReplace = new Dictionary + { + {"Scalable", ""}, {"Qtr", "Quarter"}, {"RNeg", "Rounded Negative"}, + {"Neg", "Negative"}, {"Tetra", "Tetrahedron"}, + {"RWedge", "Rounded Wedge"}, {"RTetra", "Rounded Tetrahedron"} + }; + string name = LocalizationService.Localize(data.CubeNameKey).Replace(" ", ""); + foreach (var rkv in toReplace) + { + name = Regex.Replace(name, "([^A-Za-z])" + rkv.Key + "([^A-Za-z])", "$1" + rkv.Value + "$2"); + } + Console.WriteLine($"{name}{(currentKey != lastKey + 1 ? $" = {currentKey}" : "")},"); + lastKey = currentKey; + } + };*/ #if TEST TestRoot.RunTests(); #endif -- 2.30.2 From 52ccbe4dad8090f5be8f524e833c4779273f9c27 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Thu, 10 Jun 2021 23:57:06 +0200 Subject: [PATCH 201/252] Fix tests and add new materials --- TechbloxModdingAPI/Blocks/BlockMaterial.cs | 10 +++++++++- TechbloxModdingAPI/Blocks/BlockTests.cs | 5 +++-- TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs | 3 --- .../DeserializeFromDiskEntitiesEnginePatch.cs | 2 +- .../Tests/TechbloxModdingAPIPluginTest.cs | 6 ++++++ 5 files changed, 19 insertions(+), 7 deletions(-) diff --git a/TechbloxModdingAPI/Blocks/BlockMaterial.cs b/TechbloxModdingAPI/Blocks/BlockMaterial.cs index 6d00823..7093066 100644 --- a/TechbloxModdingAPI/Blocks/BlockMaterial.cs +++ b/TechbloxModdingAPI/Blocks/BlockMaterial.cs @@ -7,6 +7,14 @@ namespace TechbloxModdingAPI.Blocks RigidSteel, CarbonFiber, Plastic, - Wood = 6 + Wood = 6, + RigidSteelPainted, + RigidSteelRustedPaint, + RigidSteelHeavyRust, + SteelBodyworkMetallicPaint, + SteelBodyworkRustedPaint, + SteelBodyworkHeavyRust, + WoodVarnishedDark, + Chrome } } \ No newline at end of file diff --git a/TechbloxModdingAPI/Blocks/BlockTests.cs b/TechbloxModdingAPI/Blocks/BlockTests.cs index 42e8910..536a819 100644 --- a/TechbloxModdingAPI/Blocks/BlockTests.cs +++ b/TechbloxModdingAPI/Blocks/BlockTests.cs @@ -72,6 +72,7 @@ namespace TechbloxModdingAPI.Blocks public static IEnumerator TestBlockProperties() { //Uses the result of the previous test case var blocks = Game.CurrentGame().GetBlocksInGame(); + yield return Yield.It; for (var index = 0; index < blocks.Length; index++) { if (index % 50 == 0) yield return Yield.It; //The material or flipped status can only be changed 130 times per submission @@ -140,8 +141,8 @@ namespace TechbloxModdingAPI.Blocks Block newBlock = Block.PlaceNew(BlockIDs.DampedSpring, Unity.Mathematics.float3.zero + 1); DampedSpring b = null; // Note: the assignment operation is a lambda, which slightly confuses the compiler Assert.Errorless(() => { b = (DampedSpring) newBlock; }, "Casting block to DampedSpring raised an exception: ", "Casting block to DampedSpring completed without issue."); - if (!Assert.CloseTo(b.Stiffness, 30f, $"DampedSpring.Stiffness {b.Stiffness} does not equal default value, possibly because it failed silently.", "DampedSpring.Stiffness is close enough to default.")) return; - if (!Assert.CloseTo(b.Damping, 30f, $"DampedSpring.Damping {b.Damping} does not equal default value, possibly because it failed silently.", "DampedSpring.Damping is close enough to default.")) return; + if (!Assert.CloseTo(b.Stiffness, 1f, $"DampedSpring.Stiffness {b.Stiffness} does not equal default value, possibly because it failed silently.", "DampedSpring.Stiffness is close enough to default.")) return; + if (!Assert.CloseTo(b.Damping, 0.1f, $"DampedSpring.Damping {b.Damping} does not equal default value, possibly because it failed silently.", "DampedSpring.Damping is close enough to default.")) return; if (!Assert.CloseTo(b.MaxExtension, 0.3f, $"DampedSpring.MaxExtension {b.MaxExtension} does not equal default value, possibly because it failed silently.", "DampedSpring.MaxExtension is close enough to default.")) return; } diff --git a/TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs b/TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs index 39ab2fb..26be582 100644 --- a/TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs @@ -117,9 +117,6 @@ namespace TechbloxModdingAPI.Blocks.Engines if (block.Exists) entitiesDB.PublishEntityChange(block.Id); //Phyiscs prefab: prefabAssetID, set on block creation from the CubeListData - /*Console.WriteLine("Materials:\n" + FullGameFields._dataDb.GetValues() - .Select(kv => $"{kv.Key}: {((MaterialPropertiesData) kv.Value).Name}") - .Aggregate((a, b) => a + "\n" + b));*/ } public bool BlockExists(EGID blockID) diff --git a/TechbloxModdingAPI/Persistence/DeserializeFromDiskEntitiesEnginePatch.cs b/TechbloxModdingAPI/Persistence/DeserializeFromDiskEntitiesEnginePatch.cs index 166f744..6219ed1 100644 --- a/TechbloxModdingAPI/Persistence/DeserializeFromDiskEntitiesEnginePatch.cs +++ b/TechbloxModdingAPI/Persistence/DeserializeFromDiskEntitiesEnginePatch.cs @@ -12,7 +12,7 @@ using TechbloxModdingAPI.Utility; namespace TechbloxModdingAPI.Persistence { - [HarmonyPatch] + //[HarmonyPatch] - TODO class DeserializeFromDiskEntitiesEnginePatch { internal static EntitiesDB entitiesDB = null; diff --git a/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs b/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs index 6a06e42..5bd3a7f 100644 --- a/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs +++ b/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs @@ -276,6 +276,12 @@ namespace TechbloxModdingAPI.Tests lastKey = currentKey; } };*/ + /*Game.Enter += (sender, e) => + { + Console.WriteLine("Materials:\n" + FullGameFields._dataDb.GetValues() + .Select(kv => $"{kv.Key}: {((MaterialPropertiesData) kv.Value).Name}") + .Aggregate((a, b) => a + "\n" + b)); + };*/ #if TEST TestRoot.RunTests(); #endif -- 2.30.2 From 76faa69c741924f83139b2490851247f82299fdf Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Fri, 11 Jun 2021 19:51:32 +0200 Subject: [PATCH 202/252] Add support for enabling the screenshot taker, even in sim --- TechbloxModdingAPI/App/AppEngine.cs | 1 - TechbloxModdingAPI/App/Game.cs | 9 +++++++++ TechbloxModdingAPI/App/GameGameEngine.cs | 10 ++++++++++ .../Tests/TechbloxModdingAPIPluginTest.cs | 6 ++++++ 4 files changed, 25 insertions(+), 1 deletion(-) diff --git a/TechbloxModdingAPI/App/AppEngine.cs b/TechbloxModdingAPI/App/AppEngine.cs index 74c0d22..741c576 100644 --- a/TechbloxModdingAPI/App/AppEngine.cs +++ b/TechbloxModdingAPI/App/AppEngine.cs @@ -1,7 +1,6 @@ using System; using RobocraftX.GUI.MyGamesScreen; -using RobocraftX.GUI; using Svelto.ECS; using TechbloxModdingAPI.Engines; using TechbloxModdingAPI.Utility; diff --git a/TechbloxModdingAPI/App/Game.cs b/TechbloxModdingAPI/App/Game.cs index 1d37945..e543270 100644 --- a/TechbloxModdingAPI/App/Game.cs +++ b/TechbloxModdingAPI/App/Game.cs @@ -473,6 +473,15 @@ namespace TechbloxModdingAPI.App return blocks; } + /// + /// Enable the screenshot taker for updating the game's screenshot. Breaks the pause menu in a new save. + /// + public void EnableScreenshotTaker() + { + if (!VerifyMode()) return; + gameEngine.EnableScreenshotTaker(); + } + ~Game() { foreach (string id in debugIds) diff --git a/TechbloxModdingAPI/App/GameGameEngine.cs b/TechbloxModdingAPI/App/GameGameEngine.cs index eceee8b..51c53c8 100644 --- a/TechbloxModdingAPI/App/GameGameEngine.cs +++ b/TechbloxModdingAPI/App/GameGameEngine.cs @@ -10,6 +10,7 @@ using Svelto.ECS; using Svelto.Tasks; using Svelto.Tasks.Lean; using RobocraftX.Blocks; +using RobocraftX.ScreenshotTaker; using TechbloxModdingAPI.Blocks; using TechbloxModdingAPI.Engines; using TechbloxModdingAPI.Utility; @@ -129,5 +130,14 @@ namespace TechbloxModdingAPI.App return blockEGIDs.ToArray(); } } + + public void EnableScreenshotTaker() + { + ref var local = ref entitiesDB.QueryEntity(ScreenshotTakerEgids.ScreenshotTaker); + if (local.enabled) + return; + local.enabled = true; + entitiesDB.PublishEntityChange(ScreenshotTakerEgids.ScreenshotTaker); + } } } diff --git a/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs b/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs index 5bd3a7f..222331f 100644 --- a/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs +++ b/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs @@ -282,6 +282,12 @@ namespace TechbloxModdingAPI.Tests .Select(kv => $"{kv.Key}: {((MaterialPropertiesData) kv.Value).Name}") .Aggregate((a, b) => a + "\n" + b)); };*/ + + CommandBuilder.Builder("takeScreenshot", "Enables the screenshot taker") + .Action(() => + { + Game.CurrentGame().EnableScreenshotTaker(); + }).Build(); #if TEST TestRoot.RunTests(); #endif -- 2.30.2 From 74d5a5c6b167e9d93235caa8401068ae43294691 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Wed, 23 Jun 2021 01:58:01 +0200 Subject: [PATCH 203/252] Fix default values getting changed and add test --- TechbloxModdingAPI/Blocks/BlockTests.cs | 19 +++++++++++ .../Tests/TechbloxModdingAPIPluginTest.cs | 34 ++++++++++++++++--- TechbloxModdingAPI/Utility/OptionalRef.cs | 3 +- 3 files changed, 50 insertions(+), 6 deletions(-) diff --git a/TechbloxModdingAPI/Blocks/BlockTests.cs b/TechbloxModdingAPI/Blocks/BlockTests.cs index 536a819..f920631 100644 --- a/TechbloxModdingAPI/Blocks/BlockTests.cs +++ b/TechbloxModdingAPI/Blocks/BlockTests.cs @@ -135,6 +135,25 @@ namespace TechbloxModdingAPI.Blocks Assert.Pass("Setting all possible properties of all registered API block types succeeded."); } + [APITestCase(TestType.EditMode)] + public static IEnumerator TestDefaultValue() + { + for (int i = 0; i < 2; i++) + { //Tests shared defaults + var block = Block.PlaceNew(BlockIDs.Cube, 1); + while (!block.Exists) + yield return Yield.It; + block.Remove(); + while (block.Exists) + yield return Yield.It; + if(!Assert.Equal(block.Position, default, + $"Block position default value {block.Position} is incorrect, should be 0.", + $"Block position default value {block.Position} matches default.")) + yield break; + block.Position = 4; + } + } + [APITestCase(TestType.EditMode)] public static void TestDampedSpring() { diff --git a/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs b/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs index 222331f..b98990b 100644 --- a/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs +++ b/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs @@ -1,11 +1,8 @@ using System; using System.Collections.Generic; using System.Diagnostics; -using System.Linq; using System.Reflection; using System.Text; -using System.Text.RegularExpressions; -using DataLoader; using TechbloxModdingAPI.App; using HarmonyLib; using IllusionInjector; @@ -14,12 +11,13 @@ using RobocraftX.FrontEnd; using Unity.Mathematics; using UnityEngine; using RobocraftX.Common.Input; -using ServiceLayer; +using Svelto.Tasks; +using Svelto.Tasks.Lean; using TechbloxModdingAPI.Blocks; using TechbloxModdingAPI.Commands; using TechbloxModdingAPI.Input; -using TechbloxModdingAPI.Interface.IMGUI; using TechbloxModdingAPI.Players; +using TechbloxModdingAPI.Tasks; using TechbloxModdingAPI.Utility; namespace TechbloxModdingAPI.Tests @@ -288,6 +286,32 @@ namespace TechbloxModdingAPI.Tests { Game.CurrentGame().EnableScreenshotTaker(); }).Build(); + + CommandBuilder.Builder("testPositionDefault", "Tests the Block.Position property's default value.") + .Action(() => + { + IEnumerator Loop() + { + for (int i = 0; i < 2; i++) + { + Console.WriteLine("A"); + var block = Block.PlaceNew(BlockIDs.Cube, 1); + Console.WriteLine("B"); + while (!block.Exists) + yield return Yield.It; + Console.WriteLine("C"); + block.Remove(); + Console.WriteLine("D"); + while (block.Exists) + yield return Yield.It; + Console.WriteLine("E - Pos: " + block.Position); + block.Position = 4; + Console.WriteLine("F - Pos: " + block.Position); + } + } + + Loop().RunOn(Scheduler.leanRunner); + }).Build(); #if TEST TestRoot.RunTests(); #endif diff --git a/TechbloxModdingAPI/Utility/OptionalRef.cs b/TechbloxModdingAPI/Utility/OptionalRef.cs index 8bcbe28..2410f1b 100644 --- a/TechbloxModdingAPI/Utility/OptionalRef.cs +++ b/TechbloxModdingAPI/Utility/OptionalRef.cs @@ -58,6 +58,7 @@ namespace TechbloxModdingAPI.Utility /// The value or the default value public ref T Get() { + CompRefCache.Default = default; //The default value can be changed by mods if (state == State.Empty) return ref CompRefCache.Default; if ((state & State.Initializer) != State.Empty) return ref initializer.GetOrCreate(); if ((state & State.Native) != State.Empty) return ref array[index]; @@ -73,7 +74,7 @@ namespace TechbloxModdingAPI.Utility /// /// Creates an instance of a struct T that can be referenced. /// - internal struct CompRefCache + private struct CompRefCache { public static T Default; } -- 2.30.2 From 2a1676ce0f11a64168fb254038611879c77a4864 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Thu, 1 Jul 2021 15:41:58 +0200 Subject: [PATCH 204/252] Update block ID list --- TechbloxModdingAPI/Blocks/BlockIDs.cs | 52 +++++++++++++-------------- 1 file changed, 24 insertions(+), 28 deletions(-) diff --git a/TechbloxModdingAPI/Blocks/BlockIDs.cs b/TechbloxModdingAPI/Blocks/BlockIDs.cs index 8d1d443..8c54140 100644 --- a/TechbloxModdingAPI/Blocks/BlockIDs.cs +++ b/TechbloxModdingAPI/Blocks/BlockIDs.cs @@ -25,32 +25,7 @@ namespace TechbloxModdingAPI.Blocks PlateQuarterPyramid, PlateTetrahedron, Sphere, - Frame, - FrameS1, - FrameS2, - FrameS3, - FrameS4, - FrameS5, - FrameWedge, - FrameWedgeS1, - FrameWedgeS2, - FrameWedgeS3, - FrameWedgeS4, - SideS0S3 = 29, - SideS0S5 = 31, - SideS1S1, - SideS1S2, - SideS1S3, - SideS1S4, - SideS1S5, - SideS2S1, - SideS2S2, - SideS2S3, - SideS2S4, - SideS2S5, - WindscreenS3 = 44, - WindscreenS5 = 46, - CarWheelArch, + CarWheelArch = 47, CarArchSmallFlare, CarArchFlare, CarArchExtrudedFlare, @@ -67,8 +42,8 @@ namespace TechbloxModdingAPI.Blocks PlateTriangle = 130, PlateCircle, PlateQuarterCircle, - PlateRWedge, - PlateRTetrahedron, + PlateRoundedWedge, + PlateRoundedTetrahedron, Cone, ConeSegment, DoubleSliced, @@ -138,5 +113,26 @@ namespace TechbloxModdingAPI.Blocks CarWheel, GoKartWheelWideProfile, GoKartWheel, + ANDLogicGate, + ORLogicGate, + NOTLogicGate, + NANDLogicGate, + NORLogicGate, + XORLogicGate, + XNORLogicGate, + AdderMathBlock, + SubtractorMathBlock, + MultiplierMathBlock, + DividerMathBlock, + InverterMathBlock, + AverageMathBlock, + AbsoluteMathBlock, + MinMathBlock, + MaxMathBlock, + SimpleConnector, + Motor, + AxleServo, + HingeServo, + Piston, } } \ No newline at end of file -- 2.30.2 From ece71c45a659a72291a33691876ec35217e435f1 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Thu, 22 Jul 2021 22:19:35 +0200 Subject: [PATCH 205/252] Update to Techblox 2021.07.21.16.17 --- TechbloxModdingAPI/Blocks/BlockIDs.cs | 17 +++++ TechbloxModdingAPI/Commands/CommandPatch.cs | 72 ------------------- .../Commands/CommandRegistrationHelper.cs | 11 --- TechbloxModdingAPI/TechbloxModdingAPI.csproj | 48 +++++++++++-- 4 files changed, 59 insertions(+), 89 deletions(-) diff --git a/TechbloxModdingAPI/Blocks/BlockIDs.cs b/TechbloxModdingAPI/Blocks/BlockIDs.cs index 8c54140..3538104 100644 --- a/TechbloxModdingAPI/Blocks/BlockIDs.cs +++ b/TechbloxModdingAPI/Blocks/BlockIDs.cs @@ -134,5 +134,22 @@ namespace TechbloxModdingAPI.Blocks AxleServo, HingeServo, Piston, + Button, + Switch, + Dial, + Lever, + ThreeWaySwitch, + EqualsMathBlock, + LessThanMathBlock, + LessThanOrEqualMathBlock, + GreaterThanMathBlock, + GreaterThanOrEqualMathBlock, + HatchbackWheelRigNoSteering, + HatchbackWheelRigWithSteering, + HatchbackEngine, + HatchbackWheel, + HatchbackWheelArch, + HatchbackArchSmallFlare, + HatchbackArchFlare } } \ No newline at end of file diff --git a/TechbloxModdingAPI/Commands/CommandPatch.cs b/TechbloxModdingAPI/Commands/CommandPatch.cs index 6beb7f7..169891a 100644 --- a/TechbloxModdingAPI/Commands/CommandPatch.cs +++ b/TechbloxModdingAPI/Commands/CommandPatch.cs @@ -23,78 +23,6 @@ namespace TechbloxModdingAPI.Commands /*CommandLineCompositionRoot.Compose(contextHolder, stateSyncReg.enginesRoot, reloadGame, multiplayerParameters, stateSyncReg); - uREPL C# compilation not supported anymore */ var enginesRoot = stateSyncReg.enginesRoot; - 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( - AccessTools.TypeByName("RobocraftX.GUI.CommandLine.ExecuteSetPhysicsPrecisionCommandEngine"))); - enginesRoot.AddEngine((IEngine) Activator.CreateInstance( - AccessTools.TypeByName("RobocraftX.GUI.CommandLine.ExecuteSetPhysicsFrequencyCommandEngine"))); - enginesRoot.AddEngine((IEngine) Activator.CreateInstance( - AccessTools.TypeByName( - "RobocraftX.GUI.CommandLine.ExecuteClearAllPartsCommandEngine"), - entityFunctions)); - enginesRoot.AddEngine((IEngine) Activator.CreateInstance( - AccessTools.TypeByName("RobocraftX.GUI.CommandLine.ExecuteHelpCommandEngine"))); - enginesRoot.AddEngine((IEngine) Activator.CreateInstance( - AccessTools.TypeByName( - "RobocraftX.GUI.CommandLine.ExecuteSetLinearRestingThresholdCommandEngine"))); - enginesRoot.AddEngine((IEngine) Activator.CreateInstance( - AccessTools.TypeByName( - "RobocraftX.GUI.CommandLine.ExecuteSetAngularRestingThresholdCommandEngine"))); - enginesRoot.AddEngine((IEngine) Activator.CreateInstance( - AccessTools.TypeByName("RobocraftX.GUI.CommandLine.ExecuteEnableVisualProfilerCommandEngine"))); - enginesRoot.AddEngine((IEngine) Activator.CreateInstance( - AccessTools.TypeByName("RobocraftX.GUI.CommandLine.ExecuteSetNetworkJitterFramesEngine"))); - enginesRoot.AddEngine((IEngine) Activator.CreateInstance( - AccessTools.TypeByName("RobocraftX.GUI.CommandLine.ExecuteSetSendConnectedEntitiesCommandEngine"))); - enginesRoot.AddEngine((IEngine) Activator.CreateInstance( - AccessTools.TypeByName("RobocraftX.GUI.CommandLine.ExecuteSetMaxSimFramesEngine"))); - enginesRoot.AddEngine((IEngine) Activator.CreateInstance( - AccessTools.TypeByName("RobocraftX.GUI.CommandLine.SetDebugDisplayExtraInfoCommandEngine"))); - enginesRoot.AddEngine((IEngine) Activator.CreateInstance( - AccessTools.TypeByName("RobocraftX.GUI.CommandLine.SetNetSyncBandwidthLimitCommandEngine"))); - enginesRoot.AddEngine((IEngine) Activator.CreateInstance( - AccessTools.TypeByName("RobocraftX.GUI.CommandLine.ThrowExceptionCommandEngine"))); - enginesRoot.AddEngine((IEngine) Activator.CreateInstance( - AccessTools.TypeByName("RobocraftX.GUI.CommandLine.SetPriorityCommandEngine"))); - enginesRoot.AddEngine((IEngine) Activator.CreateInstance( - AccessTools.TypeByName("RobocraftX.GUI.CommandLine.TeleportCharacterCommandEngine"), - entityFactory)); - enginesRoot.AddEngine((IEngine) Activator.CreateInstance( - AccessTools.TypeByName("RobocraftX.GUI.CommandLine.ChangeTextBlockTextCommandEngine"))); - enginesRoot.AddEngine((IEngine) Activator.CreateInstance( - AccessTools.TypeByName("RobocraftX.GUI.CommandLine.SetCharacterRunSpeedCommandEngine"))); - enginesRoot.AddEngine((IEngine) Activator.CreateInstance( - AccessTools.TypeByName("RobocraftX.GUI.CommandLine.SetCameraZoomDistanceCommandEngine"))); - enginesRoot.AddEngine((IEngine) Activator.CreateInstance( - AccessTools.TypeByName("RobocraftX.GUI.CommandLine.EditLightingSettingsCommandEngine"))); - enginesRoot.AddEngine((IEngine) Activator.CreateInstance( - AccessTools.TypeByName("RobocraftX.GUI.CommandLine.EditSkySettingsCommandEngine"))); - enginesRoot.AddEngine((IEngine) Activator.CreateInstance( - AccessTools.TypeByName("RobocraftX.GUI.CommandLine.EditFogSettingsCommandEngine"))); - enginesRoot.AddEngine((IEngine) Activator.CreateInstance( - AccessTools.TypeByName("RobocraftX.GUI.CommandLine.TeleportCharacterImplementationEngine"), - entityFunctions)); - enginesRoot.AddEngine((IEngine) Activator.CreateInstance( - AccessTools.TypeByName("RobocraftX.GUI.CommandLine.ExecuteConnectToServerCommandEngine"), - entityFunctions, entitySerializer, reloadGame, multiplayerParameters)); - enginesRoot.AddEngine((IEngine) Activator.CreateInstance( - AccessTools.TypeByName("RobocraftX.GUI.CommandLine.SetInputBroadcastCommandEngine"))); - enginesRoot.AddEngine((IEngine) Activator.CreateInstance( - AccessTools.TypeByName("RobocraftX.GUI.CommandLine.ExecuteSetJointInertiaTensorCommandEngine"))); - enginesRoot.AddEngine( - (IEngine) Activator.CreateInstance( - AccessTools.TypeByName("RobocraftX.GUI.CommandLine.ChangeTeamCommandEngine"))); - enginesRoot.AddEngine((IEngine) Activator.CreateInstance( - 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); } diff --git a/TechbloxModdingAPI/Commands/CommandRegistrationHelper.cs b/TechbloxModdingAPI/Commands/CommandRegistrationHelper.cs index 850322a..18f3a25 100644 --- a/TechbloxModdingAPI/Commands/CommandRegistrationHelper.cs +++ b/TechbloxModdingAPI/Commands/CommandRegistrationHelper.cs @@ -5,7 +5,6 @@ using System.Text; using System.Threading.Tasks; using uREPL; -using RobocraftX.CommandLine.Custom; namespace TechbloxModdingAPI.Commands { @@ -18,8 +17,6 @@ namespace TechbloxModdingAPI.Commands public static void Register(string name, Action action, string desc, bool noConsole = false) { RuntimeCommands.Register(name, action, desc); - if (noConsole) { return; } - ConsoleCommands.Register(name, action, desc); } public static void Register(string name, Action action, string desc, bool noConsole = false) @@ -40,29 +37,21 @@ namespace TechbloxModdingAPI.Commands public static void Register(string name, Action action, string desc, bool noConsole = false) { RuntimeCommands.Register(name, action, desc); - if (noConsole) { return; } - ConsoleCommands.Register(name, action, desc); } public static void Register(string name, Action action, string desc, bool noConsole = false) { RuntimeCommands.Register(name, action, desc); - if (noConsole) { return; } - ConsoleCommands.Register(name, action, desc); } public static void Register(string name, Action action, string desc, bool noConsole = false) { RuntimeCommands.Register(name, action, desc); - if (noConsole) { return; } - ConsoleCommands.Register(name, action, desc); } public static void Unregister(string name, bool noConsole = false) { RuntimeCommands.Unregister(name); - if (noConsole) { return; } - ConsoleCommands.Unregister(name); } public static void Call(string name) diff --git a/TechbloxModdingAPI/TechbloxModdingAPI.csproj b/TechbloxModdingAPI/TechbloxModdingAPI.csproj index 2de8b34..2aca43c 100644 --- a/TechbloxModdingAPI/TechbloxModdingAPI.csproj +++ b/TechbloxModdingAPI/TechbloxModdingAPI.csproj @@ -56,13 +56,13 @@ ..\ref\TechbloxPreview_Data\Managed\Blocks.HUDFeedbackBlocks.dll ..\..\ref\TechbloxPreview_Data\Managed\Blocks.HUDFeedbackBlocks.dll - - ..\ref\TechbloxPreview_Data\Managed\CommandLine.dll - ..\..\ref\TechbloxPreview_Data\Managed\CommandLine.dll + + ..\ref\TechbloxPreview_Data\Managed\Boxophobic.TheVehetationEngine.Runtime.dll + ..\..\ref\TechbloxPreview_Data\Managed\Boxophobic.TheVehetationEngine.Runtime.dll - - ..\ref\TechbloxPreview_Data\Managed\CommandLineCompositionRoot.dll - ..\..\ref\TechbloxPreview_Data\Managed\CommandLineCompositionRoot.dll + + ..\ref\TechbloxPreview_Data\Managed\Boxophobic.Utils.Scripts.dll + ..\..\ref\TechbloxPreview_Data\Managed\Boxophobic.Utils.Scripts.dll ..\ref\TechbloxPreview_Data\Managed\DataLoader.dll @@ -580,6 +580,10 @@ ..\ref\TechbloxPreview_Data\Managed\Svelto.ECS.dll ..\..\ref\TechbloxPreview_Data\Managed\Svelto.ECS.dll + + ..\ref\TechbloxPreview_Data\Managed\Svelto.ECS.GUI.dll + ..\..\ref\TechbloxPreview_Data\Managed\Svelto.ECS.GUI.dll + ..\ref\TechbloxPreview_Data\Managed\Svelto.Services.dll ..\..\ref\TechbloxPreview_Data\Managed\Svelto.Services.dll @@ -596,6 +600,10 @@ ..\ref\TechbloxPreview_Data\Managed\Techblox.Backend.dll ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Backend.dll + + ..\ref\TechbloxPreview_Data\Managed\Techblox.Building.Rules.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Building.Rules.dll + ..\ref\TechbloxPreview_Data\Managed\Techblox.BuildingDrone.dll ..\..\ref\TechbloxPreview_Data\Managed\Techblox.BuildingDrone.dll @@ -604,6 +612,10 @@ ..\ref\TechbloxPreview_Data\Managed\Techblox.Camera.dll ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Camera.dll + + ..\ref\TechbloxPreview_Data\Managed\Techblox.ContextSensitiveTextHint.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.ContextSensitiveTextHint.dll + ..\ref\TechbloxPreview_Data\Managed\Techblox.EngineBlock.dll ..\..\ref\TechbloxPreview_Data\Managed\Techblox.EngineBlock.dll @@ -612,6 +624,18 @@ ..\ref\TechbloxPreview_Data\Managed\Techblox.Environment.dll ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Environment.dll + + ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Building.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Building.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.BuildRules.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.BuildRules.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.BuildRules.MockUps.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.BuildRules.MockUps.dll + ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.dll ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.dll @@ -656,6 +680,10 @@ ..\ref\TechbloxPreview_Data\Managed\Techblox.Pointer.dll ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Pointer.dll + + ..\ref\TechbloxPreview_Data\Managed\Techblox.SaveGamesConversion.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.SaveGamesConversion.dll + ..\ref\TechbloxPreview_Data\Managed\Techblox.Services.Eos.dll ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Services.Eos.dll @@ -784,6 +812,14 @@ ..\ref\TechbloxPreview_Data\Managed\Unity.Properties.UI.dll ..\..\ref\TechbloxPreview_Data\Managed\Unity.Properties.UI.dll + + ..\ref\TechbloxPreview_Data\Managed\Unity.Recorder.Base.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Recorder.Base.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Recorder.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Recorder.dll + ..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll ..\..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll -- 2.30.2 From 49c3b60963e499263e7695b830ca1689051deaa0 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Thu, 29 Jul 2021 00:08:57 +0200 Subject: [PATCH 206/252] Get wire looked at, block class generation --- CodeGenerator/BlockClassGenerator.cs | 68 + CodeGenerator/CodeGenerator.csproj | 1176 +++++++++++++++++ CodeGenerator/Program.cs | 16 + CodeGenerator/Properties/AssemblyInfo.cs | 35 + TechbloxModdingAPI.sln | 8 + TechbloxModdingAPI/App/GameGameEngine.cs | 2 - TechbloxModdingAPI/Blocks/LogicGate.cs | 16 + TechbloxModdingAPI/Blocks/Piston.cs | 50 + TechbloxModdingAPI/Blocks/Servo.cs | 71 + TechbloxModdingAPI/Player.cs | 17 +- .../Tests/TechbloxModdingAPIPluginTest.cs | 15 + 11 files changed, 1471 insertions(+), 3 deletions(-) create mode 100644 CodeGenerator/BlockClassGenerator.cs create mode 100644 CodeGenerator/CodeGenerator.csproj create mode 100644 CodeGenerator/Program.cs create mode 100644 CodeGenerator/Properties/AssemblyInfo.cs create mode 100644 TechbloxModdingAPI/Blocks/LogicGate.cs create mode 100644 TechbloxModdingAPI/Blocks/Piston.cs create mode 100644 TechbloxModdingAPI/Blocks/Servo.cs diff --git a/CodeGenerator/BlockClassGenerator.cs b/CodeGenerator/BlockClassGenerator.cs new file mode 100644 index 0000000..82c3206 --- /dev/null +++ b/CodeGenerator/BlockClassGenerator.cs @@ -0,0 +1,68 @@ +using System.CodeDom; +using System.CodeDom.Compiler; +using System.IO; +using System.Linq; +using RobocraftX.Common; + +namespace CodeGenerator +{ + public class BlockClassGenerator + { + public void Generate(string name, string group) + { + if (group is null) + { + group = GetGroup(name) + "_BLOCK_GROUP"; + if (typeof(CommonExclusiveGroups).GetFields().All(field => field.Name != group)) + group = GetGroup(name) + "_BLOCK_BUILD_GROUP"; + } + + var codeUnit = new CodeCompileUnit(); + var ns = new CodeNamespace("TechbloxModdingAPI.Blocks"); + ns.Imports.Add(new CodeNamespaceImport("RobocraftX.Common")); + ns.Imports.Add(new CodeNamespaceImport("Svelto.ECS")); + var cl = new CodeTypeDeclaration(name); + cl.Members.Add(new CodeConstructor + { + Parameters = {new CodeParameterDeclarationExpression("EGID", "egid")}, + Comments = { new CodeCommentStatement($"{name} constructor", true)} + }); + cl.Members.Add(new CodeConstructor + { + Parameters = + { + new CodeParameterDeclarationExpression(typeof(uint), "id") + }, + Comments = {new CodeCommentStatement($"{name} constructor", true)}, + BaseConstructorArgs = + { + new CodeObjectCreateExpression("EGID", new CodeVariableReferenceExpression("id"), + new CodeFieldReferenceExpression(new CodeTypeReferenceExpression("CommonExclusiveGroups"), + group)) + } + }); + ns.Types.Add(cl); + codeUnit.Namespaces.Add(ns); + + var provider = CodeDomProvider.CreateProvider("CSharp"); + using (var sw = new StreamWriter($"{name}.cs")) + { + provider.GenerateCodeFromCompileUnit(codeUnit, sw, new CodeGeneratorOptions {BracingStyle = "C"}); + } + } + + private static string GetGroup(string name) + { + var ret = ""; + foreach (var ch in name) + { + if (char.IsUpper(ch) && ret.Length > 0) + ret += "_" + ch; + else + ret += char.ToUpper(ch); + } + + return ret; + } + } +} \ No newline at end of file diff --git a/CodeGenerator/CodeGenerator.csproj b/CodeGenerator/CodeGenerator.csproj new file mode 100644 index 0000000..826623c --- /dev/null +++ b/CodeGenerator/CodeGenerator.csproj @@ -0,0 +1,1176 @@ + + + + + Debug + AnyCPU + {0EBB6400-95A7-4A3D-B2ED-BF31E364CC10} + Exe + Properties + CodeGenerator + CodeGenerator + v4.7.2 + 512 + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + ..\ref\TechbloxPreview_Data\Managed\IllusionInjector.dll + ..\..\ref\TechbloxPreview_Data\Managed\IllusionInjector.dll + + + ..\ref\TechbloxPreview_Data\Managed\IllusionPlugin.dll + ..\..\ref\TechbloxPreview_Data\Managed\IllusionPlugin.dll + + + ..\ref\TechbloxPreview_Data\Managed\Analytics.dll + ..\..\ref\TechbloxPreview_Data\Managed\Analytics.dll + + + ..\ref\TechbloxPreview_Data\Managed\Assembly-CSharp-firstpass.dll + ..\..\ref\TechbloxPreview_Data\Managed\Assembly-CSharp-firstpass.dll + + + ..\ref\TechbloxPreview_Data\Managed\Assembly-CSharp.dll + ..\..\ref\TechbloxPreview_Data\Managed\Assembly-CSharp.dll + + + ..\ref\TechbloxPreview_Data\Managed\BevelEffect.dll + ..\..\ref\TechbloxPreview_Data\Managed\BevelEffect.dll + + + ..\ref\TechbloxPreview_Data\Managed\Blocks.HUDFeedbackBlocks.dll + ..\..\ref\TechbloxPreview_Data\Managed\Blocks.HUDFeedbackBlocks.dll + + + ..\ref\TechbloxPreview_Data\Managed\Boxophobic.TheVehetationEngine.Runtime.dll + ..\..\ref\TechbloxPreview_Data\Managed\Boxophobic.TheVehetationEngine.Runtime.dll + + + ..\ref\TechbloxPreview_Data\Managed\Boxophobic.Utils.Scripts.dll + ..\..\ref\TechbloxPreview_Data\Managed\Boxophobic.Utils.Scripts.dll + + + ..\ref\TechbloxPreview_Data\Managed\DataLoader.dll + ..\..\ref\TechbloxPreview_Data\Managed\DataLoader.dll + + + ..\ref\TechbloxPreview_Data\Managed\DDNA.dll + ..\..\ref\TechbloxPreview_Data\Managed\DDNA.dll + + + ..\ref\TechbloxPreview_Data\Managed\EOSSDK.dll + ..\..\ref\TechbloxPreview_Data\Managed\EOSSDK.dll + + + ..\ref\TechbloxPreview_Data\Managed\FMODUnity.dll + ..\..\ref\TechbloxPreview_Data\Managed\FMODUnity.dll + + + ..\ref\TechbloxPreview_Data\Managed\FMODUnityResonance.dll + ..\..\ref\TechbloxPreview_Data\Managed\FMODUnityResonance.dll + + + ..\ref\TechbloxPreview_Data\Managed\FullGame.dll + ..\..\ref\TechbloxPreview_Data\Managed\FullGame.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.AudioBlocks.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.AudioBlocks.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.BlockEntityFactory.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.BlockEntityFactory.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.BlockGroups.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.BlockGroups.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.DamagingSurfaceBlock.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.DamagingSurfaceBlock.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.DestructionBlocks.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.DestructionBlocks.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.GenericPhysicsBlocks.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.GenericPhysicsBlocks.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.LightBlock.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.LightBlock.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.LogicBlock.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.LogicBlock.dll + + + ..\ref\TechbloxPreview_Data\Managed\GameCraft.Blocks.ProjectileBlock.dll + ..\..\ref\TechbloxPreview_Data\Managed\GameCraft.Blocks.ProjectileBlock.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.TextBlock.CompositionRoot.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.TextBlock.CompositionRoot.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.TimerBlock.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.TimerBlock.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.CharacterVulnerability.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.CharacterVulnerability.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.CharacterVulnerabilityGui.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.CharacterVulnerabilityGui.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.ColourPalette.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.ColourPalette.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Damage.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Damage.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Effects.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Effects.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.ExplosionFragments.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.ExplosionFragments.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GraphicsSettings.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GraphicsSettings.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.BlueprintInventory.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.BlueprintInventory.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.BlueprintInventoryMock.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.BlueprintInventoryMock.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Blueprints.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Blueprints.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.BlueprintSets.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.BlueprintSets.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.GameOptionsScreen.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.GameOptionsScreen.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Hotbar.Blocks.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Hotbar.Blocks.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Hotbar.BlueprintsHotbar.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Hotbar.BlueprintsHotbar.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Hotbar.Colours.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Hotbar.Colours.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.HUDFeedbackBlocks.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.HUDFeedbackBlocks.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.ModeBar.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.ModeBar.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.OptionsScreen.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.OptionsScreen.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Blocks.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Blocks.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Blueprints.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Blueprints.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Colours.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Colours.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Common.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Common.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TimeModeClock.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TimeModeClock.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Tweaks.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Tweaks.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Wires.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Wires.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Wires.Mockup.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Wires.Mockup.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.InventoryTimeRunning.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.InventoryTimeRunning.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.JointBlocks.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.JointBlocks.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Music.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Music.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.NetStrings.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.NetStrings.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.PerformanceWarnings.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.PerformanceWarnings.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.PickupBlck.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.PickupBlck.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.PickupsCommon.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.PickupsCommon.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.PopupMessage.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.PopupMessage.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Projectiles.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Projectiles.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Serialization.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Serialization.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Tweaks.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Tweaks.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Tweaks.Mockup.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Tweaks.Mockup.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.VisualEffects.Decals.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.VisualEffects.Decals.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.VisualEffects.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.VisualEffects.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Wires.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Wires.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Wires.Mockup.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Wires.Mockup.dll + + + ..\ref\TechbloxPreview_Data\Managed\GameState.dll + ..\..\ref\TechbloxPreview_Data\Managed\GameState.dll + + + ..\ref\TechbloxPreview_Data\Managed\GhostShark.Outline.dll + ..\..\ref\TechbloxPreview_Data\Managed\GhostShark.Outline.dll + + + ..\ref\TechbloxPreview_Data\Managed\GPUInstancer.CrowdAnimations.dll + ..\..\ref\TechbloxPreview_Data\Managed\GPUInstancer.CrowdAnimations.dll + + + ..\ref\TechbloxPreview_Data\Managed\GPUInstancer.dll + ..\..\ref\TechbloxPreview_Data\Managed\GPUInstancer.dll + + + ..\ref\TechbloxPreview_Data\Managed\Havok.Physics.dll + ..\..\ref\TechbloxPreview_Data\Managed\Havok.Physics.dll + + + ..\ref\TechbloxPreview_Data\Managed\Havok.Physics.Hybrid.dll + ..\..\ref\TechbloxPreview_Data\Managed\Havok.Physics.Hybrid.dll + + + ..\ref\TechbloxPreview_Data\Managed\JWT.dll + ..\..\ref\TechbloxPreview_Data\Managed\JWT.dll + + + ..\ref\TechbloxPreview_Data\Managed\LZ4.dll + ..\..\ref\TechbloxPreview_Data\Managed\LZ4.dll + + + ..\ref\TechbloxPreview_Data\Managed\mscorlib.dll + ..\..\ref\TechbloxPreview_Data\Managed\mscorlib.dll + + + ..\ref\TechbloxPreview_Data\Managed\MultiplayerNetworking.dll + ..\..\ref\TechbloxPreview_Data\Managed\MultiplayerNetworking.dll + + + ..\ref\TechbloxPreview_Data\Managed\MultiplayerTest.dll + ..\..\ref\TechbloxPreview_Data\Managed\MultiplayerTest.dll + + + ..\ref\TechbloxPreview_Data\Managed\netstandard.dll + ..\..\ref\TechbloxPreview_Data\Managed\netstandard.dll + + + ..\ref\TechbloxPreview_Data\Managed\Newtonsoft.Json.dll + ..\..\ref\TechbloxPreview_Data\Managed\Newtonsoft.Json.dll + + + ..\ref\TechbloxPreview_Data\Managed\RCX.ScreenshotTaker.dll + ..\..\ref\TechbloxPreview_Data\Managed\RCX.ScreenshotTaker.dll + + + ..\ref\TechbloxPreview_Data\Managed\Rewired_Core.dll + ..\..\ref\TechbloxPreview_Data\Managed\Rewired_Core.dll + + + ..\ref\TechbloxPreview_Data\Managed\Rewired_Windows.dll + ..\..\ref\TechbloxPreview_Data\Managed\Rewired_Windows.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftECS.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftECS.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.AccountPreferences.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.AccountPreferences.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Blocks.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Blocks.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Blocks.Ghost.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Blocks.Ghost.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Blocks.Triggers.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Blocks.Triggers.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Building.BoxSelect.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Building.BoxSelect.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Building.Jobs.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Building.Jobs.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Character.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Character.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Common.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Common.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.ControlsScreen.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.ControlsScreen.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Crosshair.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Crosshair.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.FrontEnd.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.FrontEnd.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.BlockLabel.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.BlockLabel.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.DebugDisplay.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.DebugDisplay.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Hotbar.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Hotbar.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.BlocksInventory.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.BlocksInventory.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.ColourInventory.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.ColourInventory.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.PauseMenu.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.PauseMenu.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.ScaleGhost.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.ScaleGhost.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.TabsBar.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.TabsBar.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Input.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Input.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.MachineEditor.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.MachineEditor.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.MainGame.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.MainGame.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.MainSimulation.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.MainSimulation.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.MockCharacter.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.MockCharacter.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Multiplayer.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Multiplayer.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Multiplayer.GUI.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Multiplayer.GUI.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Multiplayer.Serializers.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Multiplayer.Serializers.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.MultiplayerInput.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.MultiplayerInput.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.ObjectIdBlocks.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.ObjectIdBlocks.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Party.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Party.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Physics.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Physics.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.PilotSeat.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.PilotSeat.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Player.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Player.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Rendering.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Rendering.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Rendering.Mock.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Rendering.Mock.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.SaveAndLoad.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.SaveAndLoad.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.SaveGameDialog.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.SaveGameDialog.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Services.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Services.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.SignalHandling.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.SignalHandling.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.SpawnPoints.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.SpawnPoints.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.StateSync.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.StateSync.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX_TextBlock.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX_TextBlock.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocratX.SimulationMockCompositionRoot.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocratX.SimulationMockCompositionRoot.dll + + + ..\ref\TechbloxPreview_Data\Managed\SpecializedDescriptors.dll + ..\..\ref\TechbloxPreview_Data\Managed\SpecializedDescriptors.dll + + + ..\ref\TechbloxPreview_Data\Managed\StringFormatter.dll + ..\..\ref\TechbloxPreview_Data\Managed\StringFormatter.dll + + + ..\ref\TechbloxPreview_Data\Managed\Svelto.Common.dll + ..\..\ref\TechbloxPreview_Data\Managed\Svelto.Common.dll + + + ..\ref\TechbloxPreview_Data\Managed\Svelto.ECS.dll + ..\..\ref\TechbloxPreview_Data\Managed\Svelto.ECS.dll + + + ..\ref\TechbloxPreview_Data\Managed\Svelto.ECS.GUI.dll + ..\..\ref\TechbloxPreview_Data\Managed\Svelto.ECS.GUI.dll + + + ..\ref\TechbloxPreview_Data\Managed\Svelto.Services.dll + ..\..\ref\TechbloxPreview_Data\Managed\Svelto.Services.dll + + + ..\ref\TechbloxPreview_Data\Managed\Svelto.Tasks.dll + ..\..\ref\TechbloxPreview_Data\Managed\Svelto.Tasks.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.AutoForward.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.AutoForward.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.Backend.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Backend.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.Building.Rules.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Building.Rules.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.BuildingDrone.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.BuildingDrone.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.Camera.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Camera.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.ContextSensitiveTextHint.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.ContextSensitiveTextHint.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.EngineBlock.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.EngineBlock.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.Environment.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Environment.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Building.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Building.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.BuildRules.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.BuildRules.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.BuildRules.MockUps.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.BuildRules.MockUps.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Hotbar.Materials.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Hotbar.Materials.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Inventory.Common.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Inventory.Common.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Inventory.Materials.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Inventory.Materials.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Login.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Login.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.MyGamesScreen.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.MyGamesScreen.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Notifications.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Notifications.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Notifications.MockUps.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Notifications.MockUps.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.TabsBar.Materials.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.TabsBar.Materials.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.InputCapture.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.InputCapture.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.Pointer.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Pointer.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.SaveGamesConversion.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.SaveGamesConversion.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.Services.Eos.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Services.Eos.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.SwitchAnimation.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.SwitchAnimation.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.WheelRigBlock.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.WheelRigBlock.dll + + + ..\ref\TechbloxPreview_Data\Managed\UniTask.Addressables.dll + ..\..\ref\TechbloxPreview_Data\Managed\UniTask.Addressables.dll + + + ..\ref\TechbloxPreview_Data\Managed\UniTask.dll + ..\..\ref\TechbloxPreview_Data\Managed\UniTask.dll + + + ..\ref\TechbloxPreview_Data\Managed\UniTask.DOTween.dll + ..\..\ref\TechbloxPreview_Data\Managed\UniTask.DOTween.dll + + + ..\ref\TechbloxPreview_Data\Managed\UniTask.Linq.dll + ..\..\ref\TechbloxPreview_Data\Managed\UniTask.Linq.dll + + + ..\ref\TechbloxPreview_Data\Managed\UniTask.TextMeshPro.dll + ..\..\ref\TechbloxPreview_Data\Managed\UniTask.TextMeshPro.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Addressables.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Addressables.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.Mdb.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.Mdb.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.Pdb.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.Pdb.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.Rocks.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.Rocks.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Burst.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Burst.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Unsafe.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Unsafe.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Collections.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Collections.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Collections.LowLevel.ILSupport.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Collections.LowLevel.ILSupport.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Deformations.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Deformations.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Entities.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Entities.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Entities.Hybrid.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Entities.Hybrid.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.InternalAPIEngineBridge.012.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.InternalAPIEngineBridge.012.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Jobs.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Jobs.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Mathematics.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Mathematics.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Mathematics.Extensions.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Mathematics.Extensions.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.MemoryProfiler.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.MemoryProfiler.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Physics.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Physics.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Physics.Hybrid.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Physics.Hybrid.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Platforms.Common.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Platforms.Common.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Properties.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Properties.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Properties.Reflection.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Properties.Reflection.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Properties.UI.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Properties.UI.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Recorder.Base.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Recorder.Base.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Recorder.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Recorder.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.HighDefinition.Config.Runtime.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.HighDefinition.Config.Runtime.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.HighDefinition.Runtime.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.HighDefinition.Runtime.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.ResourceManager.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.ResourceManager.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Scenes.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Scenes.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.ScriptableBuildPipeline.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.ScriptableBuildPipeline.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Serialization.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Serialization.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.TextMeshPro.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.TextMeshPro.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Timeline.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Timeline.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Transforms.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Transforms.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Transforms.Hybrid.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Transforms.Hybrid.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.VisualEffectGraph.Runtime.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.VisualEffectGraph.Runtime.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.AccessibilityModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.AccessibilityModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.AIModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.AIModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.AndroidJNIModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.AndroidJNIModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.AnimationModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.AnimationModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.ARModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.ARModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.AssetBundleModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.AssetBundleModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.AudioModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.AudioModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.ClothModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.ClothModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.ClusterInputModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.ClusterInputModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.ClusterRendererModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.ClusterRendererModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.CoreModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.CoreModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.CrashReportingModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.CrashReportingModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.DirectorModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.DirectorModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.DSPGraphModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.DSPGraphModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.GameCenterModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.GameCenterModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.GIModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.GIModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.GridModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.GridModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.HotReloadModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.HotReloadModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.ImageConversionModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.ImageConversionModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.IMGUIModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.IMGUIModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.InputLegacyModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.InputLegacyModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.InputModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.InputModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.JSONSerializeModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.JSONSerializeModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.LocalizationModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.LocalizationModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.ParticleSystemModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.ParticleSystemModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.PerformanceReportingModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.PerformanceReportingModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.Physics2DModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.Physics2DModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.PhysicsModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.PhysicsModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.ProfilerModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.ProfilerModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.ScreenCaptureModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.ScreenCaptureModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.SharedInternalsModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.SharedInternalsModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.SpriteMaskModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.SpriteMaskModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.SpriteShapeModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.SpriteShapeModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.StreamingModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.StreamingModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.SubstanceModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.SubstanceModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.SubsystemsModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.SubsystemsModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.TerrainModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.TerrainModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.TerrainPhysicsModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.TerrainPhysicsModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.TextCoreModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.TextCoreModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.TextRenderingModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.TextRenderingModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.TilemapModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.TilemapModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.TLSModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.TLSModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UI.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UI.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UIElementsModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UIElementsModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UIElementsNativeModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UIElementsNativeModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UIModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UIModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UmbraModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UmbraModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UNETModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UNETModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityAnalyticsModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityAnalyticsModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityConnectModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityConnectModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityCurlModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityCurlModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityTestProtocolModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityTestProtocolModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.VehiclesModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.VehiclesModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.VFXModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.VFXModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.VideoModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.VideoModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.VirtualTexturingModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.VirtualTexturingModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.VRModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.VRModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.WindModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.WindModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.XRModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.XRModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\uREPL.dll + ..\..\ref\TechbloxPreview_Data\Managed\uREPL.dll + + + ..\ref\TechbloxPreview_Data\Managed\VisualProfiler.dll + ..\..\ref\TechbloxPreview_Data\Managed\VisualProfiler.dll + + + + + + diff --git a/CodeGenerator/Program.cs b/CodeGenerator/Program.cs new file mode 100644 index 0000000..15a7e1c --- /dev/null +++ b/CodeGenerator/Program.cs @@ -0,0 +1,16 @@ +using System.CodeDom; +using System.CodeDom.Compiler; +using System.IO; + +namespace CodeGenerator +{ + internal class Program + { + public static void Main(string[] args) + { + var bcg = new BlockClassGenerator(); + bcg.Generate("TestBlock", "TEST_BLOCK"); + bcg.Generate("Engine", null); + } + } +} \ No newline at end of file diff --git a/CodeGenerator/Properties/AssemblyInfo.cs b/CodeGenerator/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..18681a4 --- /dev/null +++ b/CodeGenerator/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("CodeGenerator")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("CodeGenerator")] +[assembly: AssemblyCopyright("Copyright © ExMods 2021")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("0EBB6400-95A7-4A3D-B2ED-BF31E364CC10")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file diff --git a/TechbloxModdingAPI.sln b/TechbloxModdingAPI.sln index 2191746..999cac5 100644 --- a/TechbloxModdingAPI.sln +++ b/TechbloxModdingAPI.sln @@ -5,6 +5,8 @@ VisualStudioVersion = 16.0.29411.108 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TechbloxModdingAPI", "TechbloxModdingAPI\TechbloxModdingAPI.csproj", "{7FD5A7D8-4F3E-426A-B07D-7DC70442A4DF}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeGenerator", "CodeGenerator\CodeGenerator.csproj", "{0EBB6400-95A7-4A3D-B2ED-BF31E364CC10}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -18,6 +20,12 @@ Global {7FD5A7D8-4F3E-426A-B07D-7DC70442A4DF}.Release|Any CPU.Build.0 = Release|Any CPU {7FD5A7D8-4F3E-426A-B07D-7DC70442A4DF}.Test|Any CPU.ActiveCfg = Test|Any CPU {7FD5A7D8-4F3E-426A-B07D-7DC70442A4DF}.Test|Any CPU.Build.0 = Test|Any CPU + {0EBB6400-95A7-4A3D-B2ED-BF31E364CC10}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0EBB6400-95A7-4A3D-B2ED-BF31E364CC10}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0EBB6400-95A7-4A3D-B2ED-BF31E364CC10}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0EBB6400-95A7-4A3D-B2ED-BF31E364CC10}.Release|Any CPU.Build.0 = Release|Any CPU + {0EBB6400-95A7-4A3D-B2ED-BF31E364CC10}.Test|Any CPU.ActiveCfg = Debug|Any CPU + {0EBB6400-95A7-4A3D-B2ED-BF31E364CC10}.Test|Any CPU.Build.0 = Debug|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/TechbloxModdingAPI/App/GameGameEngine.cs b/TechbloxModdingAPI/App/GameGameEngine.cs index 51c53c8..8ae2aa3 100644 --- a/TechbloxModdingAPI/App/GameGameEngine.cs +++ b/TechbloxModdingAPI/App/GameGameEngine.cs @@ -1,8 +1,6 @@ using System; using System.Collections.Generic; -using HarmonyLib; -using RobocraftX; using RobocraftX.Common; using RobocraftX.Schedulers; using RobocraftX.SimulationModeState; diff --git a/TechbloxModdingAPI/Blocks/LogicGate.cs b/TechbloxModdingAPI/Blocks/LogicGate.cs new file mode 100644 index 0000000..50a819c --- /dev/null +++ b/TechbloxModdingAPI/Blocks/LogicGate.cs @@ -0,0 +1,16 @@ +using RobocraftX.Common; +using Svelto.ECS; + +namespace TechbloxModdingAPI.Blocks +{ + public class LogicGate : SignalingBlock + { + public LogicGate(EGID id) : base(id) + { + } + + public LogicGate(uint id) : base(new EGID(id, CommonExclusiveGroups.LOGIC_BLOCK_GROUP)) + { + } + } +} \ No newline at end of file diff --git a/TechbloxModdingAPI/Blocks/Piston.cs b/TechbloxModdingAPI/Blocks/Piston.cs new file mode 100644 index 0000000..22ee052 --- /dev/null +++ b/TechbloxModdingAPI/Blocks/Piston.cs @@ -0,0 +1,50 @@ +using System; + +using RobocraftX.Blocks; +using Svelto.ECS; +using Unity.Mathematics; + +using TechbloxModdingAPI.Utility; +using RobocraftX.Common; + +namespace TechbloxModdingAPI.Blocks +{ + public class Piston : SignalingBlock + { + public Piston(EGID id) : base(id) + { + } + + public Piston(uint id) : base(new EGID(id, CommonExclusiveGroups.PISTON_BLOCK_GROUP)) + { + } + + // custom piston properties + + /// + /// The piston's max extension distance. + /// + public float MaximumExtension + { + get => BlockEngine.GetBlockInfo(this).maxDeviation; + + set + { + BlockEngine.GetBlockInfo(this).maxDeviation = value; + } + } + + /// + /// The piston's max extension force. + /// + public float MaximumForce + { + get => BlockEngine.GetBlockInfo(this).pistonVelocity; + + set + { + BlockEngine.GetBlockInfo(this).pistonVelocity = value; + } + } + } +} diff --git a/TechbloxModdingAPI/Blocks/Servo.cs b/TechbloxModdingAPI/Blocks/Servo.cs new file mode 100644 index 0000000..613ab65 --- /dev/null +++ b/TechbloxModdingAPI/Blocks/Servo.cs @@ -0,0 +1,71 @@ +using RobocraftX.Blocks; +using RobocraftX.Common; +using Svelto.ECS; + +namespace TechbloxModdingAPI.Blocks +{ + public class Servo : SignalingBlock + { + public Servo(EGID id) : base(id) + { + } + + public Servo(uint id) : base(new EGID(id, CommonExclusiveGroups.SERVO_BLOCK_GROUP)) + { + } + + // custom servo properties + + /// + /// The servo's minimum angle. + /// + public float MinimumAngle + { + get => BlockEngine.GetBlockInfo(this).minDeviation; + + set + { + BlockEngine.GetBlockInfo(this).minDeviation = value; + } + } + + /// + /// The servo's maximum angle. + /// + public float MaximumAngle + { + get => BlockEngine.GetBlockInfo(this).maxDeviation; + + set + { + BlockEngine.GetBlockInfo(this).maxDeviation = value; + } + } + + /// + /// The servo's maximum force. + /// + public float MaximumForce + { + get => BlockEngine.GetBlockInfo(this).servoVelocity; + + set + { + BlockEngine.GetBlockInfo(this).servoVelocity = value; + } + } + + /// + /// The servo's direction. + /// + public bool Reverse + { + get => BlockEngine.GetBlockInfo(this).reverse; + + set + { + BlockEngine.GetBlockInfo(this).reverse = value; + } + } + } +} diff --git a/TechbloxModdingAPI/Player.cs b/TechbloxModdingAPI/Player.cs index de38b9b..811056e 100644 --- a/TechbloxModdingAPI/Player.cs +++ b/TechbloxModdingAPI/Player.cs @@ -4,6 +4,7 @@ using RobocraftX.Character.Movement; using Unity.Mathematics; using RobocraftX.Common; using RobocraftX.Common.Players; +using RobocraftX.GUI.Wires; using RobocraftX.Physics; using Svelto.ECS; using Techblox.BuildingDrone; @@ -432,8 +433,9 @@ namespace TechbloxModdingAPI { var egid = playerEngine.GetThingLookedAt(Id, maxDistance); return egid != EGID.Empty && egid.groupID != CommonExclusiveGroups.SIMULATION_BODIES_GROUP + && egid.groupID != WiresGUIExclusiveGroups.WireGroup ? Block.New(egid) - : null; + : null; } /// @@ -449,6 +451,19 @@ namespace TechbloxModdingAPI : null; } + /// + /// Returns the wire the player is currently looking at in build mode. + /// + /// The maximum distance from the player (default is the player's building reach) + /// The wire or null if not found + public Wire GetWireLookedAt(float maxDistance = -1f) + { + var egid = playerEngine.GetThingLookedAt(Id, maxDistance); + return egid != EGID.Empty && egid.groupID == WiresGUIExclusiveGroups.WireGroup + ? new Wire(egid) + : null; + } + /// /// Returns the blocks that are in the player's current selection. /// diff --git a/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs b/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs index b98990b..eb9bda4 100644 --- a/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs +++ b/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs @@ -312,6 +312,21 @@ namespace TechbloxModdingAPI.Tests Loop().RunOn(Scheduler.leanRunner); }).Build(); + + CommandBuilder.Builder("importAssetBundle") + .Action(() => + { + Logging.CommandLog("Importing asset bundle..."); + var ab = AssetBundle.LoadFromFile( + @"filepath"); + Logging.CommandLog("Imported asset bundle: " + ab); + var assets = ab.LoadAllAssets(); + Logging.CommandLog("Loaded " + assets.Length + " assets"); + foreach (var asset in assets) + { + Logging.CommandLog(asset); + } + }).Build(); #if TEST TestRoot.RunTests(); #endif -- 2.30.2 From 3351993936877391a61fab47f1ad7bdf3c3e0b9e Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Thu, 29 Jul 2021 01:04:27 +0200 Subject: [PATCH 207/252] Automatically generate properties, fixes, engine class --- CodeGenerator/BlockClassGenerator.cs | 35 ++++- TechbloxModdingAPI/Blocks/Engine.cs | 217 ++++++++++++++++++++++++--- 2 files changed, 231 insertions(+), 21 deletions(-) diff --git a/CodeGenerator/BlockClassGenerator.cs b/CodeGenerator/BlockClassGenerator.cs index 82c3206..5a2e748 100644 --- a/CodeGenerator/BlockClassGenerator.cs +++ b/CodeGenerator/BlockClassGenerator.cs @@ -3,6 +3,8 @@ using System.CodeDom.Compiler; using System.IO; using System.Linq; using RobocraftX.Common; +using Svelto.ECS; +using Techblox.EngineBlock; namespace CodeGenerator { @@ -22,10 +24,12 @@ namespace CodeGenerator ns.Imports.Add(new CodeNamespaceImport("RobocraftX.Common")); ns.Imports.Add(new CodeNamespaceImport("Svelto.ECS")); var cl = new CodeTypeDeclaration(name); + cl.BaseTypes.Add(new CodeTypeReference("Block")); cl.Members.Add(new CodeConstructor { Parameters = {new CodeParameterDeclarationExpression("EGID", "egid")}, - Comments = { new CodeCommentStatement($"{name} constructor", true)} + Comments = {new CodeCommentStatement($"{name} constructor", true)}, + BaseConstructorArgs = {new CodeVariableReferenceExpression("egid")} }); cl.Members.Add(new CodeConstructor { @@ -41,6 +45,7 @@ namespace CodeGenerator group)) } }); + GenerateProperties(cl); ns.Types.Add(cl); codeUnit.Namespaces.Add(ns); @@ -64,5 +69,33 @@ namespace CodeGenerator return ret; } + + private void GenerateProperties(CodeTypeDeclaration cl) where T : IEntityComponent + { + var type = typeof(T); + foreach (var field in type.GetFields()) + { + var propName = char.ToUpper(field.Name[0]) + field.Name.Substring(1); + var structFieldReference = new CodeFieldReferenceExpression(new CodeMethodInvokeExpression( + new CodeMethodReferenceExpression(new CodeSnippetExpression("BlockEngine"), + "GetBlockInfo", new CodeTypeReference(type)), + new CodeThisReferenceExpression()), field.Name); + cl.Members.Add(new CodeMemberProperty + { + Name = propName, + HasGet = true, + HasSet = true, + GetStatements = + { + new CodeMethodReturnStatement(structFieldReference) + }, + SetStatements = + { + new CodeAssignStatement(structFieldReference, new CodePropertySetValueReferenceExpression()) + }, + Type = new CodeTypeReference(field.FieldType) + }); + } + } } } \ No newline at end of file diff --git a/TechbloxModdingAPI/Blocks/Engine.cs b/TechbloxModdingAPI/Blocks/Engine.cs index 08a8f33..05c09e6 100644 --- a/TechbloxModdingAPI/Blocks/Engine.cs +++ b/TechbloxModdingAPI/Blocks/Engine.cs @@ -1,35 +1,212 @@ -using RobocraftX.Common; -using Svelto.ECS; -using Techblox.EngineBlock; +//------------------------------------------------------------------------------ +// +// Ezt a kódot eszköz generálta. +// Futásidejű verzió:4.0.30319.42000 +// +// Ennek a fájlnak a módosítása helytelen viselkedést eredményezhet, és elvész, ha +// a kódot újragenerálják. +// +//------------------------------------------------------------------------------ namespace TechbloxModdingAPI.Blocks { - public class Engine : SignalingBlock + using RobocraftX.Common; + using Svelto.ECS; + + + public class Engine : Block { - public Engine(EGID id) : base(id) + + /// Engine constructor + private Engine(EGID egid) : + base(egid) { } - - public Engine(uint id) : base(new EGID(id, CommonExclusiveGroups.ENGINE_BLOCK_BUILD_GROUP)) + + /// Engine constructor + private Engine(uint id) : + base(new EGID(id, CommonExclusiveGroups.ENGINE_BLOCK_BUILD_GROUP)) { } - - public bool On + + private bool EngineOn { - get => BlockEngine.GetBlockInfo(this).engineOn; - set => BlockEngine.GetBlockInfo(this).engineOn = value; + get + { + return BlockEngine.GetBlockInfo(this).engineOn; + } + set + { + BlockEngine.GetBlockInfo(this).engineOn = value; + } } - - public float CurrentTorque + + private int CurrentGear { - get => BlockEngine.GetBlockInfo(this).currentTorque; - set => BlockEngine.GetBlockInfo(this).currentTorque = value; + get + { + return BlockEngine.GetBlockInfo(this).currentGear; + } + set + { + BlockEngine.GetBlockInfo(this).currentGear = value; + } } - - public int CurrentGear + + private float GearChangeCountdown { - get => BlockEngine.GetBlockInfo(this).currentGear; - set => BlockEngine.GetBlockInfo(this).currentGear = value; + get + { + return BlockEngine.GetBlockInfo(this).gearChangeCountdown; + } + set + { + BlockEngine.GetBlockInfo(this).gearChangeCountdown = value; + } + } + + private float CurrentRpmAV + { + get + { + return BlockEngine.GetBlockInfo(this).currentRpmAV; + } + set + { + BlockEngine.GetBlockInfo(this).currentRpmAV = value; + } + } + + private float CurrentRpmLV + { + get + { + return BlockEngine.GetBlockInfo(this).currentRpmLV; + } + set + { + BlockEngine.GetBlockInfo(this).currentRpmLV = value; + } + } + + private float TargetRpmAV + { + get + { + return BlockEngine.GetBlockInfo(this).targetRpmAV; + } + set + { + BlockEngine.GetBlockInfo(this).targetRpmAV = value; + } + } + + private float TargetRpmLV + { + get + { + return BlockEngine.GetBlockInfo(this).targetRpmLV; + } + set + { + BlockEngine.GetBlockInfo(this).targetRpmLV = value; + } + } + + private float CurrentTorque + { + get + { + return BlockEngine.GetBlockInfo(this).currentTorque; + } + set + { + BlockEngine.GetBlockInfo(this).currentTorque = value; + } + } + + private float TotalWheelVelocityAV + { + get + { + return BlockEngine.GetBlockInfo(this).totalWheelVelocityAV; + } + set + { + BlockEngine.GetBlockInfo(this).totalWheelVelocityAV = value; + } + } + + private float TotalWheelVelocityLV + { + get + { + return BlockEngine.GetBlockInfo(this).totalWheelVelocityLV; + } + set + { + BlockEngine.GetBlockInfo(this).totalWheelVelocityLV = value; + } + } + + private int TotalWheelCount + { + get + { + return BlockEngine.GetBlockInfo(this).totalWheelCount; + } + set + { + BlockEngine.GetBlockInfo(this).totalWheelCount = value; + } + } + + private bool LastGearUpInput + { + get + { + return BlockEngine.GetBlockInfo(this).lastGearUpInput; + } + set + { + BlockEngine.GetBlockInfo(this).lastGearUpInput = value; + } + } + + private bool LastGearDownInput + { + get + { + return BlockEngine.GetBlockInfo(this).lastGearDownInput; + } + set + { + BlockEngine.GetBlockInfo(this).lastGearDownInput = value; + } + } + + private float ManualToAutoGearCoolOffCounter + { + get + { + return BlockEngine.GetBlockInfo(this).manualToAutoGearCoolOffCounter; + } + set + { + BlockEngine.GetBlockInfo(this).manualToAutoGearCoolOffCounter = value; + } + } + + private float Load + { + get + { + return BlockEngine.GetBlockInfo(this).load; + } + set + { + BlockEngine.GetBlockInfo(this).load = value; + } } } -} \ No newline at end of file +} -- 2.30.2 From c0eae774212f18708822359795165dc7d3eab917 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Wed, 11 Aug 2021 23:44:26 +0200 Subject: [PATCH 208/252] Finish code generator (mostly) Made the generated members public and final Removed the comment from the start of the files Generating the files directly into the project folder Added comments describing the generated constructors and properties Using SignalingBlock as a base class Added support for renaming properties Added support for getting the name from the tweakable stat name Added/updated functional block classes --- CodeGenerator/BlockClassGenerator.cs | 69 ++++-- CodeGenerator/Program.cs | 35 ++- TechbloxModdingAPI/Blocks/DampedSpring.cs | 80 ++++--- TechbloxModdingAPI/Blocks/Engine.cs | 249 +++++++++++++++++++--- TechbloxModdingAPI/Blocks/LogicGate.cs | 24 ++- TechbloxModdingAPI/Blocks/Piston.cs | 93 ++++---- TechbloxModdingAPI/Blocks/Seat.cs | 56 +++++ TechbloxModdingAPI/Blocks/Servo.cs | 183 +++++++++++----- TechbloxModdingAPI/Blocks/WheelRig.cs | 101 +++++++++ TechbloxModdingAPI/Utility/OptionalRef.cs | 1 - 10 files changed, 716 insertions(+), 175 deletions(-) create mode 100644 TechbloxModdingAPI/Blocks/Seat.cs create mode 100644 TechbloxModdingAPI/Blocks/WheelRig.cs diff --git a/CodeGenerator/BlockClassGenerator.cs b/CodeGenerator/BlockClassGenerator.cs index 5a2e748..c2307a0 100644 --- a/CodeGenerator/BlockClassGenerator.cs +++ b/CodeGenerator/BlockClassGenerator.cs @@ -1,7 +1,11 @@ +using System; using System.CodeDom; using System.CodeDom.Compiler; +using System.Collections.Generic; using System.IO; using System.Linq; +using System.Reflection; +using Gamecraft.Tweaks; using RobocraftX.Common; using Svelto.ECS; using Techblox.EngineBlock; @@ -10,7 +14,7 @@ namespace CodeGenerator { public class BlockClassGenerator { - public void Generate(string name, string group) + public void Generate(string name, string group = null, Dictionary renames = null, params Type[] types) { if (group is null) { @@ -19,17 +23,25 @@ namespace CodeGenerator group = GetGroup(name) + "_BLOCK_BUILD_GROUP"; } + if (!group.Contains(".")) + group = "CommonExclusiveGroups." + group; + var codeUnit = new CodeCompileUnit(); var ns = new CodeNamespace("TechbloxModdingAPI.Blocks"); ns.Imports.Add(new CodeNamespaceImport("RobocraftX.Common")); ns.Imports.Add(new CodeNamespaceImport("Svelto.ECS")); var cl = new CodeTypeDeclaration(name); - cl.BaseTypes.Add(new CodeTypeReference("Block")); + //cl.BaseTypes.Add(baseClass != null ? new CodeTypeReference(baseClass) : new CodeTypeReference("Block")); + cl.BaseTypes.Add(new CodeTypeReference("SignalingBlock")); cl.Members.Add(new CodeConstructor { Parameters = {new CodeParameterDeclarationExpression("EGID", "egid")}, - Comments = {new CodeCommentStatement($"{name} constructor", true)}, - BaseConstructorArgs = {new CodeVariableReferenceExpression("egid")} + Comments = + { + _start, new CodeCommentStatement($"Constructs a(n) {name} object representing an existing block.", true), _end + }, + BaseConstructorArgs = {new CodeVariableReferenceExpression("egid")}, + Attributes = MemberAttributes.Public | MemberAttributes.Final }); cl.Members.Add(new CodeConstructor { @@ -37,23 +49,33 @@ namespace CodeGenerator { new CodeParameterDeclarationExpression(typeof(uint), "id") }, - Comments = {new CodeCommentStatement($"{name} constructor", true)}, + Comments = + { + _start, new CodeCommentStatement($"Constructs a(n) {name} object representing an existing block.", true), _end + }, BaseConstructorArgs = { new CodeObjectCreateExpression("EGID", new CodeVariableReferenceExpression("id"), - new CodeFieldReferenceExpression(new CodeTypeReferenceExpression("CommonExclusiveGroups"), - group)) - } + new CodeVariableReferenceExpression(group)) + }, + Attributes = MemberAttributes.Public | MemberAttributes.Final }); - GenerateProperties(cl); + foreach (var type in types) + { + GenerateProperties(cl, type, name, renames); + } ns.Types.Add(cl); codeUnit.Namespaces.Add(ns); var provider = CodeDomProvider.CreateProvider("CSharp"); - using (var sw = new StreamWriter($"{name}.cs")) + var path = $@"..\..\..\TechbloxModdingAPI\Blocks\{name}.cs"; + using (var sw = new StreamWriter(path)) { provider.GenerateCodeFromCompileUnit(codeUnit, sw, new CodeGeneratorOptions {BracingStyle = "C"}); } + + File.WriteAllLines(path, + File.ReadAllLines(path).SkipWhile(line => line.StartsWith("//") || line.Length == 0)); } private static string GetGroup(string name) @@ -70,12 +92,22 @@ namespace CodeGenerator return ret; } - private void GenerateProperties(CodeTypeDeclaration cl) where T : IEntityComponent + private void GenerateProperties(CodeTypeDeclaration cl, Type type, string baseClass, + Dictionary renames) { - var type = typeof(T); + if (!typeof(IEntityComponent).IsAssignableFrom(type)) + throw new ArgumentException("Type must be an entity component"); foreach (var field in type.GetFields()) { - var propName = char.ToUpper(field.Name[0]) + field.Name.Substring(1); + var attr = field.GetCustomAttribute(); + if (renames == null || !renames.TryGetValue(field.Name, out var propName)) + { + propName = field.Name; + if (attr != null) + propName = attr.propertyName; + } + + propName = char.ToUpper(propName[0]) + propName.Substring(1); var structFieldReference = new CodeFieldReferenceExpression(new CodeMethodInvokeExpression( new CodeMethodReferenceExpression(new CodeSnippetExpression("BlockEngine"), "GetBlockInfo", new CodeTypeReference(type)), @@ -93,9 +125,18 @@ namespace CodeGenerator { new CodeAssignStatement(structFieldReference, new CodePropertySetValueReferenceExpression()) }, - Type = new CodeTypeReference(field.FieldType) + Type = new CodeTypeReference(field.FieldType), + Attributes = MemberAttributes.Public | MemberAttributes.Final, + Comments = + { + _start, new CodeCommentStatement($"Gets or sets the {baseClass}'s {propName} property." + + $" {(attr != null ? "Tweakable stat." : "May not be saved.")}", true), _end + } }); } } + + private static readonly CodeCommentStatement _start = new CodeCommentStatement("", true); + private static readonly CodeCommentStatement _end = new CodeCommentStatement("", true); } } \ No newline at end of file diff --git a/CodeGenerator/Program.cs b/CodeGenerator/Program.cs index 15a7e1c..0af44ab 100644 --- a/CodeGenerator/Program.cs +++ b/CodeGenerator/Program.cs @@ -1,6 +1,8 @@ -using System.CodeDom; -using System.CodeDom.Compiler; -using System.IO; +using System.Collections.Generic; +using RobocraftX.Blocks; +using RobocraftX.PilotSeat; +using Techblox.EngineBlock; +using Techblox.WheelRigBlock; namespace CodeGenerator { @@ -9,8 +11,31 @@ namespace CodeGenerator public static void Main(string[] args) { var bcg = new BlockClassGenerator(); - bcg.Generate("TestBlock", "TEST_BLOCK"); - bcg.Generate("Engine", null); + bcg.Generate("Engine", null, new Dictionary + { + { "engineOn", "On" } + }, typeof(EngineBlockComponent), // Simulation time properties + typeof(EngineBlockTweakableComponent), typeof(EngineBlockReadonlyComponent)); + bcg.Generate("DampedSpring", "DAMPEDSPRING_BLOCK_GROUP", new Dictionary + { + {"maxExtent", "MaxExtension"} + }, + typeof(TweakableJointDampingComponent), typeof(DampedSpringReadOnlyStruct)); + bcg.Generate("LogicGate", "LOGIC_BLOCK_GROUP"); + bcg.Generate("Servo", types: typeof(ServoReadOnlyStruct), renames: new Dictionary + { + {"minDeviation", "MinimumAngle"}, + {"maxDeviation", "MaximumAngle"}, + {"servoVelocity", "MaximumForce"} + }); + bcg.Generate("WheelRig", "WHEELRIG_BLOCK_BUILD_GROUP", null, + typeof(WheelRigTweakableStruct), typeof(WheelRigReadOnlyStruct), + typeof(WheelRigSteerableTweakableStruct), typeof(WheelRigSteerableReadOnlyStruct)); + bcg.Generate("Seat", "RobocraftX.PilotSeat.SeatGroups.PILOTSEAT_BLOCK_BUILD_GROUP", null, typeof(SeatFollowCamComponent), typeof(SeatReadOnlySettingsComponent)); + bcg.Generate("Piston", null, new Dictionary + { + {"pistonVelocity", "MaximumForce"} + }, typeof(PistonReadOnlyStruct)); } } } \ No newline at end of file diff --git a/TechbloxModdingAPI/Blocks/DampedSpring.cs b/TechbloxModdingAPI/Blocks/DampedSpring.cs index afff30b..9408f31 100644 --- a/TechbloxModdingAPI/Blocks/DampedSpring.cs +++ b/TechbloxModdingAPI/Blocks/DampedSpring.cs @@ -1,47 +1,71 @@ -using RobocraftX.Blocks; -using RobocraftX.Common; -using Svelto.ECS; - namespace TechbloxModdingAPI.Blocks { - public class DampedSpring : Block + using RobocraftX.Common; + using Svelto.ECS; + + + public class DampedSpring : SignalingBlock { - public DampedSpring(EGID id) : base(id) - { - } - - public DampedSpring(uint id) : base(new EGID(id, CommonExclusiveGroups.DAMPEDSPRING_BLOCK_GROUP)) - { - } - + /// - /// The spring's stiffness. + /// Constructs a(n) DampedSpring object representing an existing block. + /// + public DampedSpring(EGID egid) : + base(egid) + { + } + + /// + /// Constructs a(n) DampedSpring object representing an existing block. + /// + public DampedSpring(uint id) : + base(new EGID(id, CommonExclusiveGroups.DAMPEDSPRING_BLOCK_GROUP)) + { + } + + /// + /// Gets or sets the DampedSpring's Stiffness property. Tweakable stat. /// public float Stiffness { - get => BlockEngine.GetBlockInfo(this).stiffness; - - set => BlockEngine.GetBlockInfo(this).stiffness = value; + get + { + return BlockEngine.GetBlockInfo(this).stiffness; + } + set + { + BlockEngine.GetBlockInfo(this).stiffness = value; + } } - + /// - /// The spring's maximum damping force. + /// Gets or sets the DampedSpring's Damping property. Tweakable stat. /// public float Damping { - get => BlockEngine.GetBlockInfo(this).damping; - - set => BlockEngine.GetBlockInfo(this).damping = value; + get + { + return BlockEngine.GetBlockInfo(this).damping; + } + set + { + BlockEngine.GetBlockInfo(this).damping = value; + } } - + /// - /// The spring's maximum extension. + /// Gets or sets the DampedSpring's MaxExtension property. Tweakable stat. /// public float MaxExtension { - get => BlockEngine.GetBlockInfo(this).maxExtent; - - set => BlockEngine.GetBlockInfo(this).maxExtent = value; + get + { + return BlockEngine.GetBlockInfo(this).maxExtent; + } + set + { + BlockEngine.GetBlockInfo(this).maxExtent = value; + } } } -} \ No newline at end of file +} diff --git a/TechbloxModdingAPI/Blocks/Engine.cs b/TechbloxModdingAPI/Blocks/Engine.cs index 05c09e6..bb87ba8 100644 --- a/TechbloxModdingAPI/Blocks/Engine.cs +++ b/TechbloxModdingAPI/Blocks/Engine.cs @@ -1,35 +1,32 @@ -//------------------------------------------------------------------------------ -// -// Ezt a kódot eszköz generálta. -// Futásidejű verzió:4.0.30319.42000 -// -// Ennek a fájlnak a módosítása helytelen viselkedést eredményezhet, és elvész, ha -// a kódot újragenerálják. -// -//------------------------------------------------------------------------------ - namespace TechbloxModdingAPI.Blocks { using RobocraftX.Common; using Svelto.ECS; - public class Engine : Block + public class Engine : SignalingBlock { - /// Engine constructor - private Engine(EGID egid) : + /// + /// Constructs a(n) Engine object representing an existing block. + /// + public Engine(EGID egid) : base(egid) { } - /// Engine constructor - private Engine(uint id) : + /// + /// Constructs a(n) Engine object representing an existing block. + /// + public Engine(uint id) : base(new EGID(id, CommonExclusiveGroups.ENGINE_BLOCK_BUILD_GROUP)) { } - private bool EngineOn + /// + /// Gets or sets the Engine's On property. May not be saved. + /// + public bool On { get { @@ -41,7 +38,10 @@ namespace TechbloxModdingAPI.Blocks } } - private int CurrentGear + /// + /// Gets or sets the Engine's CurrentGear property. May not be saved. + /// + public int CurrentGear { get { @@ -53,7 +53,10 @@ namespace TechbloxModdingAPI.Blocks } } - private float GearChangeCountdown + /// + /// Gets or sets the Engine's GearChangeCountdown property. May not be saved. + /// + public float GearChangeCountdown { get { @@ -65,7 +68,10 @@ namespace TechbloxModdingAPI.Blocks } } - private float CurrentRpmAV + /// + /// Gets or sets the Engine's CurrentRpmAV property. May not be saved. + /// + public float CurrentRpmAV { get { @@ -77,7 +83,10 @@ namespace TechbloxModdingAPI.Blocks } } - private float CurrentRpmLV + /// + /// Gets or sets the Engine's CurrentRpmLV property. May not be saved. + /// + public float CurrentRpmLV { get { @@ -89,7 +98,10 @@ namespace TechbloxModdingAPI.Blocks } } - private float TargetRpmAV + /// + /// Gets or sets the Engine's TargetRpmAV property. May not be saved. + /// + public float TargetRpmAV { get { @@ -101,7 +113,10 @@ namespace TechbloxModdingAPI.Blocks } } - private float TargetRpmLV + /// + /// Gets or sets the Engine's TargetRpmLV property. May not be saved. + /// + public float TargetRpmLV { get { @@ -113,7 +128,10 @@ namespace TechbloxModdingAPI.Blocks } } - private float CurrentTorque + /// + /// Gets or sets the Engine's CurrentTorque property. May not be saved. + /// + public float CurrentTorque { get { @@ -125,7 +143,10 @@ namespace TechbloxModdingAPI.Blocks } } - private float TotalWheelVelocityAV + /// + /// Gets or sets the Engine's TotalWheelVelocityAV property. May not be saved. + /// + public float TotalWheelVelocityAV { get { @@ -137,7 +158,10 @@ namespace TechbloxModdingAPI.Blocks } } - private float TotalWheelVelocityLV + /// + /// Gets or sets the Engine's TotalWheelVelocityLV property. May not be saved. + /// + public float TotalWheelVelocityLV { get { @@ -149,7 +173,10 @@ namespace TechbloxModdingAPI.Blocks } } - private int TotalWheelCount + /// + /// Gets or sets the Engine's TotalWheelCount property. May not be saved. + /// + public int TotalWheelCount { get { @@ -161,7 +188,10 @@ namespace TechbloxModdingAPI.Blocks } } - private bool LastGearUpInput + /// + /// Gets or sets the Engine's LastGearUpInput property. May not be saved. + /// + public bool LastGearUpInput { get { @@ -173,7 +203,10 @@ namespace TechbloxModdingAPI.Blocks } } - private bool LastGearDownInput + /// + /// Gets or sets the Engine's LastGearDownInput property. May not be saved. + /// + public bool LastGearDownInput { get { @@ -185,7 +218,10 @@ namespace TechbloxModdingAPI.Blocks } } - private float ManualToAutoGearCoolOffCounter + /// + /// Gets or sets the Engine's ManualToAutoGearCoolOffCounter property. May not be saved. + /// + public float ManualToAutoGearCoolOffCounter { get { @@ -197,7 +233,10 @@ namespace TechbloxModdingAPI.Blocks } } - private float Load + /// + /// Gets or sets the Engine's Load property. May not be saved. + /// + public float Load { get { @@ -208,5 +247,155 @@ namespace TechbloxModdingAPI.Blocks BlockEngine.GetBlockInfo(this).load = value; } } + + /// + /// Gets or sets the Engine's Power property. Tweakable stat. + /// + public float Power + { + get + { + return BlockEngine.GetBlockInfo(this).power; + } + set + { + BlockEngine.GetBlockInfo(this).power = value; + } + } + + /// + /// Gets or sets the Engine's AutomaticGears property. Tweakable stat. + /// + public bool AutomaticGears + { + get + { + return BlockEngine.GetBlockInfo(this).automaticGears; + } + set + { + BlockEngine.GetBlockInfo(this).automaticGears = value; + } + } + + /// + /// Gets or sets the Engine's GearChangeTime property. May not be saved. + /// + public float GearChangeTime + { + get + { + return BlockEngine.GetBlockInfo(this).gearChangeTime; + } + set + { + BlockEngine.GetBlockInfo(this).gearChangeTime = value; + } + } + + /// + /// Gets or sets the Engine's MinRpm property. May not be saved. + /// + public float MinRpm + { + get + { + return BlockEngine.GetBlockInfo(this).minRpm; + } + set + { + BlockEngine.GetBlockInfo(this).minRpm = value; + } + } + + /// + /// Gets or sets the Engine's MaxRpm property. May not be saved. + /// + public float MaxRpm + { + get + { + return BlockEngine.GetBlockInfo(this).maxRpm; + } + set + { + BlockEngine.GetBlockInfo(this).maxRpm = value; + } + } + + /// + /// Gets or sets the Engine's GearDownRpms property. May not be saved. + /// + public Svelto.ECS.DataStructures.NativeDynamicArray GearDownRpms + { + get + { + return BlockEngine.GetBlockInfo(this).gearDownRpms; + } + set + { + BlockEngine.GetBlockInfo(this).gearDownRpms = value; + } + } + + /// + /// Gets or sets the Engine's GearUpRpm property. May not be saved. + /// + public float GearUpRpm + { + get + { + return BlockEngine.GetBlockInfo(this).gearUpRpm; + } + set + { + BlockEngine.GetBlockInfo(this).gearUpRpm = value; + } + } + + /// + /// Gets or sets the Engine's MaxRpmChange property. May not be saved. + /// + public float MaxRpmChange + { + get + { + return BlockEngine.GetBlockInfo(this).maxRpmChange; + } + set + { + BlockEngine.GetBlockInfo(this).maxRpmChange = value; + } + } + + /// + /// Gets or sets the Engine's ManualToAutoGearCoolOffTime property. May not be saved. + /// + public float ManualToAutoGearCoolOffTime + { + get + { + return BlockEngine.GetBlockInfo(this).manualToAutoGearCoolOffTime; + } + set + { + BlockEngine.GetBlockInfo(this).manualToAutoGearCoolOffTime = value; + } + } + + /// + /// Gets or sets the Engine's EngineBlockDataId property. May not be saved. + /// + public int EngineBlockDataId + { + get + { + return BlockEngine.GetBlockInfo(this).engineBlockDataId; + } + set + { + BlockEngine.GetBlockInfo(this).engineBlockDataId = value; + } + } } } diff --git a/TechbloxModdingAPI/Blocks/LogicGate.cs b/TechbloxModdingAPI/Blocks/LogicGate.cs index 50a819c..05cc3bf 100644 --- a/TechbloxModdingAPI/Blocks/LogicGate.cs +++ b/TechbloxModdingAPI/Blocks/LogicGate.cs @@ -1,16 +1,26 @@ -using RobocraftX.Common; -using Svelto.ECS; - namespace TechbloxModdingAPI.Blocks { + using RobocraftX.Common; + using Svelto.ECS; + + public class LogicGate : SignalingBlock { - public LogicGate(EGID id) : base(id) + + /// + /// Constructs a(n) LogicGate object representing an existing block. + /// + public LogicGate(EGID egid) : + base(egid) { } - - public LogicGate(uint id) : base(new EGID(id, CommonExclusiveGroups.LOGIC_BLOCK_GROUP)) + + /// + /// Constructs a(n) LogicGate object representing an existing block. + /// + public LogicGate(uint id) : + base(new EGID(id, CommonExclusiveGroups.LOGIC_BLOCK_GROUP)) { } } -} \ No newline at end of file +} diff --git a/TechbloxModdingAPI/Blocks/Piston.cs b/TechbloxModdingAPI/Blocks/Piston.cs index 22ee052..c351d59 100644 --- a/TechbloxModdingAPI/Blocks/Piston.cs +++ b/TechbloxModdingAPI/Blocks/Piston.cs @@ -1,49 +1,70 @@ -using System; - -using RobocraftX.Blocks; -using Svelto.ECS; -using Unity.Mathematics; - -using TechbloxModdingAPI.Utility; -using RobocraftX.Common; - namespace TechbloxModdingAPI.Blocks { - public class Piston : SignalingBlock + using RobocraftX.Common; + using Svelto.ECS; + + + public class Piston : SignalingBlock { - public Piston(EGID id) : base(id) - { - } - - public Piston(uint id) : base(new EGID(id, CommonExclusiveGroups.PISTON_BLOCK_GROUP)) - { - } - - // custom piston properties - + /// - /// The piston's max extension distance. + /// Constructs a(n) Piston object representing an existing block. /// - public float MaximumExtension + public Piston(EGID egid) : + base(egid) { - get => BlockEngine.GetBlockInfo(this).maxDeviation; - - set - { - BlockEngine.GetBlockInfo(this).maxDeviation = value; - } - } - - /// - /// The piston's max extension force. + } + + /// + /// Constructs a(n) Piston object representing an existing block. + /// + public Piston(uint id) : + base(new EGID(id, CommonExclusiveGroups.PISTON_BLOCK_GROUP)) + { + } + + /// + /// Gets or sets the Piston's MaximumForce property. Tweakable stat. /// public float MaximumForce - { - get => BlockEngine.GetBlockInfo(this).pistonVelocity; - + { + get + { + return BlockEngine.GetBlockInfo(this).pistonVelocity; + } set { - BlockEngine.GetBlockInfo(this).pistonVelocity = value; + BlockEngine.GetBlockInfo(this).pistonVelocity = value; + } + } + + /// + /// Gets or sets the Piston's MaxExtension property. Tweakable stat. + /// + public float MaxExtension + { + get + { + return BlockEngine.GetBlockInfo(this).maxDeviation; + } + set + { + BlockEngine.GetBlockInfo(this).maxDeviation = value; + } + } + + /// + /// Gets or sets the Piston's InputIsExtension property. Tweakable stat. + /// + public bool InputIsExtension + { + get + { + return BlockEngine.GetBlockInfo(this).hasProportionalInput; + } + set + { + BlockEngine.GetBlockInfo(this).hasProportionalInput = value; } } } diff --git a/TechbloxModdingAPI/Blocks/Seat.cs b/TechbloxModdingAPI/Blocks/Seat.cs new file mode 100644 index 0000000..e06077f --- /dev/null +++ b/TechbloxModdingAPI/Blocks/Seat.cs @@ -0,0 +1,56 @@ +namespace TechbloxModdingAPI.Blocks +{ + using RobocraftX.Common; + using Svelto.ECS; + + + public class Seat : SignalingBlock + { + + /// + /// Constructs a(n) Seat object representing an existing block. + /// + public Seat(EGID egid) : + base(egid) + { + } + + /// + /// Constructs a(n) Seat object representing an existing block. + /// + public Seat(uint id) : + base(new EGID(id, RobocraftX.PilotSeat.SeatGroups.PILOTSEAT_BLOCK_BUILD_GROUP)) + { + } + + /// + /// Gets or sets the Seat's FollowCam property. Tweakable stat. + /// + public bool FollowCam + { + get + { + return BlockEngine.GetBlockInfo(this).followCam; + } + set + { + BlockEngine.GetBlockInfo(this).followCam = value; + } + } + + /// + /// Gets or sets the Seat's CharacterColliderHeight property. May not be saved. + /// + public float CharacterColliderHeight + { + get + { + return BlockEngine.GetBlockInfo(this).characterColliderHeight; + } + set + { + BlockEngine.GetBlockInfo(this).characterColliderHeight = value; + } + } + } +} diff --git a/TechbloxModdingAPI/Blocks/Servo.cs b/TechbloxModdingAPI/Blocks/Servo.cs index 613ab65..89bd194 100644 --- a/TechbloxModdingAPI/Blocks/Servo.cs +++ b/TechbloxModdingAPI/Blocks/Servo.cs @@ -1,71 +1,146 @@ -using RobocraftX.Blocks; -using RobocraftX.Common; -using Svelto.ECS; - namespace TechbloxModdingAPI.Blocks { - public class Servo : SignalingBlock + using RobocraftX.Common; + using Svelto.ECS; + + + public class Servo : SignalingBlock { - public Servo(EGID id) : base(id) - { - } - - public Servo(uint id) : base(new EGID(id, CommonExclusiveGroups.SERVO_BLOCK_GROUP)) - { - } - - // custom servo properties - + /// - /// The servo's minimum angle. + /// Constructs a(n) Servo object representing an existing block. /// - public float MinimumAngle + public Servo(EGID egid) : + base(egid) { - get => BlockEngine.GetBlockInfo(this).minDeviation; - - set - { - BlockEngine.GetBlockInfo(this).minDeviation = value; - } - } - - /// - /// The servo's maximum angle. - /// - public float MaximumAngle - { - get => BlockEngine.GetBlockInfo(this).maxDeviation; - - set - { - BlockEngine.GetBlockInfo(this).maxDeviation = value; - } } - - /// - /// The servo's maximum force. + + /// + /// Constructs a(n) Servo object representing an existing block. + /// + public Servo(uint id) : + base(new EGID(id, CommonExclusiveGroups.SERVO_BLOCK_GROUP)) + { + } + + /// + /// Gets or sets the Servo's MaximumForce property. Tweakable stat. /// public float MaximumForce { - get => BlockEngine.GetBlockInfo(this).servoVelocity; - - set - { - BlockEngine.GetBlockInfo(this).servoVelocity = value; - } + get + { + return BlockEngine.GetBlockInfo(this).servoVelocity; + } + set + { + BlockEngine.GetBlockInfo(this).servoVelocity = value; + } } - - /// - /// The servo's direction. + + /// + /// Gets or sets the Servo's MinimumAngle property. Tweakable stat. + /// + public float MinimumAngle + { + get + { + return BlockEngine.GetBlockInfo(this).minDeviation; + } + set + { + BlockEngine.GetBlockInfo(this).minDeviation = value; + } + } + + /// + /// Gets or sets the Servo's MaximumAngle property. Tweakable stat. + /// + public float MaximumAngle + { + get + { + return BlockEngine.GetBlockInfo(this).maxDeviation; + } + set + { + BlockEngine.GetBlockInfo(this).maxDeviation = value; + } + } + + /// + /// Gets or sets the Servo's Reverse property. Tweakable stat. /// public bool Reverse { - get => BlockEngine.GetBlockInfo(this).reverse; - - set - { - BlockEngine.GetBlockInfo(this).reverse = value; - } + get + { + return BlockEngine.GetBlockInfo(this).reverse; + } + set + { + BlockEngine.GetBlockInfo(this).reverse = value; + } + } + + /// + /// Gets or sets the Servo's InputIsAngle property. Tweakable stat. + /// + public bool InputIsAngle + { + get + { + return BlockEngine.GetBlockInfo(this).hasProportionalInput; + } + set + { + BlockEngine.GetBlockInfo(this).hasProportionalInput = value; + } + } + + /// + /// Gets or sets the Servo's DirectionVector property. May not be saved. + /// + public Unity.Mathematics.float3 DirectionVector + { + get + { + return BlockEngine.GetBlockInfo(this).directionVector; + } + set + { + BlockEngine.GetBlockInfo(this).directionVector = value; + } + } + + /// + /// Gets or sets the Servo's RotationAxis property. May not be saved. + /// + public Unity.Mathematics.float3 RotationAxis + { + get + { + return BlockEngine.GetBlockInfo(this).rotationAxis; + } + set + { + BlockEngine.GetBlockInfo(this).rotationAxis = value; + } + } + + /// + /// Gets or sets the Servo's ForceAxis property. May not be saved. + /// + public Unity.Mathematics.float3 ForceAxis + { + get + { + return BlockEngine.GetBlockInfo(this).forceAxis; + } + set + { + BlockEngine.GetBlockInfo(this).forceAxis = value; + } } } } diff --git a/TechbloxModdingAPI/Blocks/WheelRig.cs b/TechbloxModdingAPI/Blocks/WheelRig.cs new file mode 100644 index 0000000..1eb4c0b --- /dev/null +++ b/TechbloxModdingAPI/Blocks/WheelRig.cs @@ -0,0 +1,101 @@ +namespace TechbloxModdingAPI.Blocks +{ + using RobocraftX.Common; + using Svelto.ECS; + + + public class WheelRig : SignalingBlock + { + + /// + /// Constructs a(n) WheelRig object representing an existing block. + /// + public WheelRig(EGID egid) : + base(egid) + { + } + + /// + /// Constructs a(n) WheelRig object representing an existing block. + /// + public WheelRig(uint id) : + base(new EGID(id, CommonExclusiveGroups.WHEELRIG_BLOCK_BUILD_GROUP)) + { + } + + /// + /// Gets or sets the WheelRig's BrakingStrength property. Tweakable stat. + /// + public float BrakingStrength + { + get + { + return BlockEngine.GetBlockInfo(this).brakingStrength; + } + set + { + BlockEngine.GetBlockInfo(this).brakingStrength = value; + } + } + + /// + /// Gets or sets the WheelRig's MaxVelocity property. May not be saved. + /// + public float MaxVelocity + { + get + { + return BlockEngine.GetBlockInfo(this).maxVelocity; + } + set + { + BlockEngine.GetBlockInfo(this).maxVelocity = value; + } + } + + /// + /// Gets or sets the WheelRig's SteerAngle property. Tweakable stat. + /// + public float SteerAngle + { + get + { + return BlockEngine.GetBlockInfo(this).steerAngle; + } + set + { + BlockEngine.GetBlockInfo(this).steerAngle = value; + } + } + + /// + /// Gets or sets the WheelRig's VelocityForMinAngle property. May not be saved. + /// + public float VelocityForMinAngle + { + get + { + return BlockEngine.GetBlockInfo(this).velocityForMinAngle; + } + set + { + BlockEngine.GetBlockInfo(this).velocityForMinAngle = value; + } + } + + /// + /// Gets or sets the WheelRig's MinSteerAngleFactor property. May not be saved. + /// + public float MinSteerAngleFactor + { + get + { + return BlockEngine.GetBlockInfo(this).minSteerAngleFactor; + } + set + { + BlockEngine.GetBlockInfo(this).minSteerAngleFactor = value; + } + } + } +} diff --git a/TechbloxModdingAPI/Utility/OptionalRef.cs b/TechbloxModdingAPI/Utility/OptionalRef.cs index 2410f1b..79f7175 100644 --- a/TechbloxModdingAPI/Utility/OptionalRef.cs +++ b/TechbloxModdingAPI/Utility/OptionalRef.cs @@ -1,5 +1,4 @@ using System; -using System.Runtime.InteropServices; using Svelto.DataStructures; using Svelto.ECS; -- 2.30.2 From 9693341d7ae370c84b2c58d9ad6121474403154e Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Thu, 12 Aug 2021 00:34:39 +0200 Subject: [PATCH 209/252] Add block types, run tests, remove unintended properties --- TechbloxModdingAPI/Block.cs | 11 ++++++++++- TechbloxModdingAPI/Blocks/Engine.cs | 25 +++---------------------- TechbloxModdingAPI/Blocks/WheelRig.cs | 5 +++++ 3 files changed, 18 insertions(+), 23 deletions(-) diff --git a/TechbloxModdingAPI/Block.cs b/TechbloxModdingAPI/Block.cs index efea216..d4dead6 100644 --- a/TechbloxModdingAPI/Block.cs +++ b/TechbloxModdingAPI/Block.cs @@ -10,6 +10,7 @@ using RobocraftX.Blocks; using Unity.Mathematics; using Gamecraft.Blocks.GUI; using HarmonyLib; +using RobocraftX.PilotSeat; using TechbloxModdingAPI.Blocks; using TechbloxModdingAPI.Blocks.Engines; @@ -93,7 +94,13 @@ namespace TechbloxModdingAPI new Dictionary, Type)> { {CommonExclusiveGroups.DAMPEDSPRING_BLOCK_GROUP, (id => new DampedSpring(id), typeof(DampedSpring))}, - {CommonExclusiveGroups.ENGINE_BLOCK_BUILD_GROUP, (id => new Engine(id), typeof(Engine))} + {CommonExclusiveGroups.ENGINE_BLOCK_BUILD_GROUP, (id => new Engine(id), typeof(Engine))}, + {CommonExclusiveGroups.LOGIC_BLOCK_GROUP, (id => new LogicGate(id), typeof(LogicGate))}, + {CommonExclusiveGroups.PISTON_BLOCK_GROUP, (id => new Piston(id), typeof(Piston))}, + {SeatGroups.PASSENGER_BLOCK_BUILD_GROUP, (id => new Seat(id), typeof(Seat))}, + {SeatGroups.PILOTSEAT_BLOCK_BUILD_GROUP, (id => new Seat(id), typeof(Seat))}, + {CommonExclusiveGroups.SERVO_BLOCK_GROUP, (id => new Servo(id), typeof(Servo))}, + {CommonExclusiveGroups.WHEELRIG_BLOCK_BUILD_GROUP, (id => new WheelRig(id), typeof(WheelRig))} }; internal static Block New(EGID egid) @@ -340,6 +347,8 @@ namespace TechbloxModdingAPI return; } blockGroup?.RemoveInternal(this); + if (!InitData.Valid) + return; BlockEngine.GetBlockInfo(this).currentBlockGroup = (int?) value?.Id.entityID ?? -1; value?.AddInternal(this); blockGroup = value; diff --git a/TechbloxModdingAPI/Blocks/Engine.cs b/TechbloxModdingAPI/Blocks/Engine.cs index bb87ba8..6140b11 100644 --- a/TechbloxModdingAPI/Blocks/Engine.cs +++ b/TechbloxModdingAPI/Blocks/Engine.cs @@ -324,17 +324,13 @@ namespace TechbloxModdingAPI.Blocks } /// - /// Gets or sets the Engine's GearDownRpms property. May not be saved. + /// Gets the Engine's GearDownRpms property. May not be saved. /// - public Svelto.ECS.DataStructures.NativeDynamicArray GearDownRpms + public float[] GearDownRpms { get { - return BlockEngine.GetBlockInfo(this).gearDownRpms; - } - set - { - BlockEngine.GetBlockInfo(this).gearDownRpms = value; + return BlockEngine.GetBlockInfo(this).gearDownRpms.ToManagedArray(); } } @@ -382,20 +378,5 @@ namespace TechbloxModdingAPI.Blocks BlockEngine.GetBlockInfo(this).manualToAutoGearCoolOffTime = value; } } - - /// - /// Gets or sets the Engine's EngineBlockDataId property. May not be saved. - /// - public int EngineBlockDataId - { - get - { - return BlockEngine.GetBlockInfo(this).engineBlockDataId; - } - set - { - BlockEngine.GetBlockInfo(this).engineBlockDataId = value; - } - } } } diff --git a/TechbloxModdingAPI/Blocks/WheelRig.cs b/TechbloxModdingAPI/Blocks/WheelRig.cs index 1eb4c0b..28ba739 100644 --- a/TechbloxModdingAPI/Blocks/WheelRig.cs +++ b/TechbloxModdingAPI/Blocks/WheelRig.cs @@ -1,3 +1,5 @@ +using TechbloxModdingAPI.Tests; + namespace TechbloxModdingAPI.Blocks { using RobocraftX.Common; @@ -56,6 +58,7 @@ namespace TechbloxModdingAPI.Blocks /// /// Gets or sets the WheelRig's SteerAngle property. Tweakable stat. /// + [TestValue(0f)] // Can be 0 for no steer variant public float SteerAngle { get @@ -71,6 +74,7 @@ namespace TechbloxModdingAPI.Blocks /// /// Gets or sets the WheelRig's VelocityForMinAngle property. May not be saved. /// + [TestValue(0f)] public float VelocityForMinAngle { get @@ -86,6 +90,7 @@ namespace TechbloxModdingAPI.Blocks /// /// Gets or sets the WheelRig's MinSteerAngleFactor property. May not be saved. /// + [TestValue(0f)] public float MinSteerAngleFactor { get -- 2.30.2 From 77d5e59ef6012660c26db5c6b161488554851b00 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Thu, 12 Aug 2021 00:44:23 +0200 Subject: [PATCH 210/252] Add Motor class --- CodeGenerator/Program.cs | 1 + TechbloxModdingAPI/Blocks/Motor.cs | 71 ++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 TechbloxModdingAPI/Blocks/Motor.cs diff --git a/CodeGenerator/Program.cs b/CodeGenerator/Program.cs index 0af44ab..0e9dea5 100644 --- a/CodeGenerator/Program.cs +++ b/CodeGenerator/Program.cs @@ -36,6 +36,7 @@ namespace CodeGenerator { {"pistonVelocity", "MaximumForce"} }, typeof(PistonReadOnlyStruct)); + bcg.Generate("Motor", null, null, typeof(MotorReadOnlyStruct)); } } } \ No newline at end of file diff --git a/TechbloxModdingAPI/Blocks/Motor.cs b/TechbloxModdingAPI/Blocks/Motor.cs new file mode 100644 index 0000000..233d5f6 --- /dev/null +++ b/TechbloxModdingAPI/Blocks/Motor.cs @@ -0,0 +1,71 @@ +namespace TechbloxModdingAPI.Blocks +{ + using RobocraftX.Common; + using Svelto.ECS; + + + public class Motor : SignalingBlock + { + + /// + /// Constructs a(n) Motor object representing an existing block. + /// + public Motor(EGID egid) : + base(egid) + { + } + + /// + /// Constructs a(n) Motor object representing an existing block. + /// + public Motor(uint id) : + base(new EGID(id, CommonExclusiveGroups.MOTOR_BLOCK_GROUP)) + { + } + + /// + /// Gets or sets the Motor's TopSpeed property. Tweakable stat. + /// + public float TopSpeed + { + get + { + return BlockEngine.GetBlockInfo(this).maxVelocity; + } + set + { + BlockEngine.GetBlockInfo(this).maxVelocity = value; + } + } + + /// + /// Gets or sets the Motor's Torque property. Tweakable stat. + /// + public float Torque + { + get + { + return BlockEngine.GetBlockInfo(this).maxForce; + } + set + { + BlockEngine.GetBlockInfo(this).maxForce = value; + } + } + + /// + /// Gets or sets the Motor's Reverse property. Tweakable stat. + /// + public bool Reverse + { + get + { + return BlockEngine.GetBlockInfo(this).reverse; + } + set + { + BlockEngine.GetBlockInfo(this).reverse = value; + } + } + } +} -- 2.30.2 From 033ebdb86dcc072f3a434a899799d1eb72267524 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Fri, 3 Sep 2021 01:30:15 +0200 Subject: [PATCH 211/252] Fix looking at wires, reduce Wire code Also added two port name properties directly to the wires Also added support for converting OptionalRefs to Nullables --- TechbloxModdingAPI/Block.cs | 6 +- .../Blocks/Engines/SignalEngine.cs | 76 +++---- TechbloxModdingAPI/Blocks/SignalingBlock.cs | 9 +- TechbloxModdingAPI/Blocks/Wire.cs | 198 +++++++----------- TechbloxModdingAPI/Player.cs | 3 +- TechbloxModdingAPI/Utility/OptionalRef.cs | 1 + 6 files changed, 117 insertions(+), 176 deletions(-) diff --git a/TechbloxModdingAPI/Block.cs b/TechbloxModdingAPI/Block.cs index d4dead6..3ace802 100644 --- a/TechbloxModdingAPI/Block.cs +++ b/TechbloxModdingAPI/Block.cs @@ -103,11 +103,13 @@ namespace TechbloxModdingAPI {CommonExclusiveGroups.WHEELRIG_BLOCK_BUILD_GROUP, (id => new WheelRig(id), typeof(WheelRig))} }; - internal static Block New(EGID egid) + internal static Block New(EGID egid, bool signaling = false) { return GroupToConstructor.ContainsKey(egid.groupID) ? GroupToConstructor[egid.groupID].Constructor(egid) - : new Block(egid); + : signaling + ? new SignalingBlock(egid) + : new Block(egid); } public Block(EGID id) diff --git a/TechbloxModdingAPI/Blocks/Engines/SignalEngine.cs b/TechbloxModdingAPI/Blocks/Engines/SignalEngine.cs index b5d2083..ee2e42b 100644 --- a/TechbloxModdingAPI/Blocks/Engines/SignalEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/SignalEngine.cs @@ -208,48 +208,35 @@ namespace TechbloxModdingAPI.Blocks.Engines } return outputs; } - - public EGID MatchBlockInputToPort(Block block, byte portUsage, out bool exists) + + public OptionalRef MatchBlockIOToPort(Block block, byte portUsage, bool output) { - var ports = entitiesDB.QueryEntityOptional(block); - exists = ports; - return new EGID(ports.Get().firstInputID + portUsage, NamedExclusiveGroup.Group); + return MatchBlockIOToPort(block.Id, portUsage, output); } - public EGID MatchBlockInputToPort(EGID block, byte portUsage, out bool exists) + public OptionalRef MatchBlockIOToPort(EGID block, byte portUsage, bool output) { if (!entitiesDB.Exists(block)) - { - exists = false; return default; - } - exists = true; + var group = output + ? NamedExclusiveGroup.Group + : NamedExclusiveGroup.Group; BlockPortsStruct ports = entitiesDB.QueryEntity(block); - return new EGID(ports.firstInputID + portUsage, NamedExclusiveGroup.Group); - } - - public EGID MatchBlockOutputToPort(Block block, byte portUsage, out bool exists) - { - var ports = entitiesDB.QueryEntityOptional(block); - exists = ports; - return new EGID(ports.Get().firstOutputID + portUsage, NamedExclusiveGroup.Group); - } - - public EGID MatchBlockOutputToPort(EGID block, byte portUsage, out bool exists) - { - if (!entitiesDB.Exists(block)) - { - exists = false; + if (!entitiesDB.TryQueryMappedEntities(group, out var mapper)) return default; + for (uint i = 0; i < (output ? ports.outputCount : ports.inputCount); ++i) + { + uint entityID = (output ? ports.firstOutputID : ports.firstInputID) + i; + if (!mapper.TryGetArrayAndEntityIndex(entityID, out var index, out var array) || + array[index].usage != portUsage) continue; + return new OptionalRef(array, index); } - exists = true; - BlockPortsStruct ports = entitiesDB.QueryEntity(block); - return new EGID(ports.firstOutputID + portUsage, NamedExclusiveGroup.Group); + + return default; } - public ref WireEntityStruct MatchPortToWire(EGID portID, EGID blockID, out bool exists) + public ref WireEntityStruct MatchPortToWire(PortEntityStruct port, EGID blockID, out bool exists) { - ref PortEntityStruct port = ref entitiesDB.QueryEntity(portID); var wires = entitiesDB.QueryEntities(NamedExclusiveGroup.Group); var wiresB = wires.ToBuffer().buffer; for (uint i = 0; i < wires.count; i++) @@ -266,8 +253,7 @@ namespace TechbloxModdingAPI.Blocks.Engines return ref defRef[0]; } - public ref WireEntityStruct MatchBlocksToWire(EGID startBlock, EGID endBlock, out bool exists, byte startPort = byte.MaxValue, - byte endPort = byte.MaxValue) + public EGID MatchBlocksToWire(EGID startBlock, EGID endBlock, byte startPort = byte.MaxValue, byte endPort = byte.MaxValue) { EGID[] startPorts; if (startPort == byte.MaxValue) @@ -306,31 +292,23 @@ namespace TechbloxModdingAPI.Blocks.Engines if ((wiresB[w].destinationPortUsage == endPES.usage && wiresB[w].destinationBlockEGID == endBlock) && (wiresB[w].sourcePortUsage == startPES.usage && wiresB[w].sourceBlockEGID == startBlock)) { - exists = true; - return ref wiresB[w]; + return wiresB[w].ID; } } } } - - exists = false; - WireEntityStruct[] defRef = new WireEntityStruct[1]; - return ref defRef[0]; + + return EGID.Empty; } - public ref ChannelDataStruct GetChannelDataStruct(EGID portID, out bool exists) - { - ref PortEntityStruct port = ref entitiesDB.QueryEntity(portID); + public OptionalRef GetChannelDataStruct(EGID portID) + { + var port = GetPort(portID); var channels = entitiesDB.QueryEntities(NamedExclusiveGroup.Group); var channelsB = channels.ToBuffer(); - if (port.firstChannelIndexCachedInSim < channels.count) - { - exists = true; - return ref channelsB.buffer[port.firstChannelIndexCachedInSim]; - } - exists = false; - ChannelDataStruct[] defRef = new ChannelDataStruct[1]; - return ref defRef[0]; + return port.firstChannelIndexCachedInSim < channels.count + ? new OptionalRef(channelsB.buffer, port.firstChannelIndexCachedInSim) + : default; } public EGID[] GetElectricBlocks() diff --git a/TechbloxModdingAPI/Blocks/SignalingBlock.cs b/TechbloxModdingAPI/Blocks/SignalingBlock.cs index 45b5aa6..7ae6e6a 100644 --- a/TechbloxModdingAPI/Blocks/SignalingBlock.cs +++ b/TechbloxModdingAPI/Blocks/SignalingBlock.cs @@ -46,9 +46,9 @@ namespace TechbloxModdingAPI.Blocks /// The connected wire. /// Port identifier. /// Whether the port has a wire connected to it. - protected ref WireEntityStruct GetConnectedWire(EGID portId, out bool connected) + protected ref WireEntityStruct GetConnectedWire(PortEntityStruct port, out bool connected) { - return ref SignalEngine.MatchPortToWire(portId, Id, out connected); + return ref SignalEngine.MatchPortToWire(port, Id, out connected); } /// @@ -56,10 +56,9 @@ namespace TechbloxModdingAPI.Blocks /// /// The channel data. /// Port identifier. - /// Whether the channel actually exists. - protected ref ChannelDataStruct GetChannelData(EGID portId, out bool exists) + protected OptionalRef GetChannelData(EGID portId) { - return ref SignalEngine.GetChannelDataStruct(portId, out exists); + return SignalEngine.GetChannelDataStruct(portId); } /// diff --git a/TechbloxModdingAPI/Blocks/Wire.cs b/TechbloxModdingAPI/Blocks/Wire.cs index 10b880d..f46ca48 100644 --- a/TechbloxModdingAPI/Blocks/Wire.cs +++ b/TechbloxModdingAPI/Blocks/Wire.cs @@ -43,14 +43,12 @@ namespace TechbloxModdingAPI.Blocks /// The wire, where the end of the wire is the block port specified, or null if does not exist. public static Wire ConnectedToInputPort(SignalingBlock end, byte endPort) { - EGID port = signalEngine.MatchBlockInputToPort(end, endPort, out bool exists); - if (!exists) return null; - WireEntityStruct wire = signalEngine.MatchPortToWire(port, end.Id, out exists); - if (exists) - { - return new Wire(Block.New(wire.sourceBlockEGID), end, wire.sourcePortUsage, endPort); - } - return null; + var port = signalEngine.MatchBlockIOToPort(end, endPort, false); + if (!port) return null; + WireEntityStruct wire = signalEngine.MatchPortToWire(port, end.Id, out var exists); + return exists + ? new Wire(wire.sourceBlockEGID, end.Id, wire.sourcePortUsage, endPort, wire.ID, false) + : null; } /// @@ -62,18 +60,16 @@ namespace TechbloxModdingAPI.Blocks /// The wire, where the start of the wire is the block port specified, or null if does not exist. public static Wire ConnectedToOutputPort(SignalingBlock start, byte startPort) { - EGID port = signalEngine.MatchBlockOutputToPort(start, startPort, out bool exists); - if (!exists) return null; - WireEntityStruct wire = signalEngine.MatchPortToWire(port, start.Id, out exists); - if (exists) - { - return new Wire(start, Block.New(wire.destinationBlockEGID), startPort, wire.destinationPortUsage); - } - return null; + var port = signalEngine.MatchBlockIOToPort(start, startPort, true); + if (!port) return null; + WireEntityStruct wire = signalEngine.MatchPortToWire(port, start.Id, out var exists); + return exists + ? new Wire(start.Id, wire.destinationBlockEGID, startPort, wire.destinationPortUsage, wire.ID, false) + : null; } /// - /// Construct a wire object from an existing connection. + /// Construct a wire object froam n existing connection. /// /// Starting block ID. /// Ending block ID. @@ -84,40 +80,25 @@ namespace TechbloxModdingAPI.Blocks { startBlockEGID = start.Id; endBlockEGID = end.Id; + bool flipped = false; // find block ports - WireEntityStruct wire = signalEngine.MatchBlocksToWire(start.Id, end.Id, out bool exists, startPort, endPort); - if (exists) + EGID wire = signalEngine.MatchBlocksToWire(start.Id, end.Id, startPort, endPort); + if (wire == EGID.Empty) { - wireEGID = wire.ID; - endPortEGID = signalEngine.MatchBlockInputToPort(end, wire.destinationPortUsage, out exists); - if (!exists) throw new WireInvalidException("Wire end port not found"); - startPortEGID = signalEngine.MatchBlockOutputToPort(start, wire.sourcePortUsage, out exists); - if (!exists) throw new WireInvalidException("Wire start port not found"); - inputToOutput = false; - endPort = wire.destinationPortUsage; - startPort = wire.sourcePortUsage; + // flip I/O around and try again + wire = signalEngine.MatchBlocksToWire(end.Id, start.Id, endPort, startPort); + flipped = true; + // NB: start and end are handled exactly as they're received as params. + // This makes wire traversal easier, but makes logic in this class a bit more complex + } + + if (wire != EGID.Empty) + { + Construct(start.Id, end.Id, startPort, endPort, wire, flipped); } else { - // flip I/O around and try again - wire = signalEngine.MatchBlocksToWire(end.Id, start.Id, out exists, endPort, startPort); - if (exists) - { - wireEGID = wire.ID; - endPortEGID = signalEngine.MatchBlockOutputToPort(end, wire.sourcePortUsage, out exists); - if (!exists) throw new WireInvalidException("Wire end port not found"); - startPortEGID = signalEngine.MatchBlockInputToPort(start, wire.destinationPortUsage, out exists); - if (!exists) throw new WireInvalidException("Wire start port not found"); - inputToOutput = true; // end is actually the source - // NB: start and end are handled exactly as they're received as params. - // This makes wire traversal easier, but makes logic in this class a bit more complex - endPort = wire.sourcePortUsage; - startPort = wire.destinationPortUsage; - } - else - { - throw new WireInvalidException("Wire not found"); - } + throw new WireInvalidException("Wire not found"); } } @@ -131,25 +112,25 @@ namespace TechbloxModdingAPI.Blocks /// The wire ID. /// Whether the wire direction goes input -> output (true) or output -> input (false, preferred). public Wire(Block start, Block end, byte startPort, byte endPort, EGID wire, bool inputToOutput) + : this(start.Id, end.Id, startPort, endPort, wire, inputToOutput) { - this.startBlockEGID = start.Id; - this.endBlockEGID = end.Id; + } + + private Wire(EGID startBlock, EGID endBlock, byte startPort, byte endPort, EGID wire, bool inputToOutput) + { + Construct(startBlock, endBlock, startPort, endPort, wire, inputToOutput); + } + + private void Construct(EGID startBlock, EGID endBlock, byte startPort, byte endPort, EGID wire, bool inputToOutput) + { + this.startBlockEGID = startBlock; + this.endBlockEGID = endBlock; this.inputToOutput = inputToOutput; this.wireEGID = wire; - if (inputToOutput) - { - endPortEGID = signalEngine.MatchBlockOutputToPort(start, startPort, out bool exists); - if (!exists) throw new WireInvalidException("Wire end port not found"); - startPortEGID = signalEngine.MatchBlockInputToPort(end, endPort, out exists); - if (!exists) throw new WireInvalidException("Wire start port not found"); - } - else - { - endPortEGID = signalEngine.MatchBlockInputToPort(end, endPort, out bool exists); - if (!exists) throw new WireInvalidException("Wire end port not found"); - startPortEGID = signalEngine.MatchBlockOutputToPort(start, startPort, out exists); - if (!exists) throw new WireInvalidException("Wire start port not found"); - } + endPortEGID = signalEngine.MatchBlockIOToPort(startBlock, startPort, inputToOutput).Nullable()?.ID ?? EGID.Empty; + if (endPortEGID == EGID.Empty) throw new WireInvalidException("Wire end port not found"); + startPortEGID = signalEngine.MatchBlockIOToPort(endBlock, endPort, !inputToOutput).Nullable()?.ID ?? EGID.Empty; + if (startPortEGID == EGID.Empty) throw new WireInvalidException("Wire start port not found"); this.startPort = startPort; this.endPort = endPort; } @@ -160,31 +141,14 @@ namespace TechbloxModdingAPI.Blocks /// The wire ID. public Wire(EGID wireEgid) { - this.wireEGID = wireEgid; WireEntityStruct wire = signalEngine.GetWire(wireEGID); - this.startBlockEGID = wire.sourceBlockEGID; - this.endBlockEGID = wire.destinationBlockEGID; - this.inputToOutput = false; - endPortEGID = signalEngine.MatchBlockInputToPort(wire.destinationBlockEGID, wire.destinationPortUsage, out bool exists); - if (!exists) throw new WireInvalidException("Wire end port not found"); - startPortEGID = signalEngine.MatchBlockOutputToPort(wire.sourceBlockEGID, wire.sourcePortUsage, out exists); - if (!exists) throw new WireInvalidException("Wire start port not found"); - this.endPort = wire.destinationPortUsage; - this.startPort = wire.sourcePortUsage; + Construct(wire.sourceBlockEGID, wire.destinationBlockEGID, wire.sourcePortUsage, wire.destinationPortUsage, + wireEgid, false); } - internal Wire(WireEntityStruct wire, SignalingBlock src, SignalingBlock dest) + private Wire(WireEntityStruct wire, SignalingBlock src, SignalingBlock dest) + : this(src, dest, wire.sourcePortUsage, wire.destinationPortUsage, wire.ID, false) { - this.wireEGID = wire.ID; - this.startBlockEGID = wire.sourceBlockEGID; - this.endBlockEGID = wire.destinationBlockEGID; - inputToOutput = false; - endPortEGID = signalEngine.MatchBlockInputToPort(dest, wire.destinationPortUsage, out bool exists); - if (!exists) throw new WireInvalidException("Wire end port not found"); - startPortEGID = signalEngine.MatchBlockOutputToPort(src, wire.sourcePortUsage, out exists); - if (!exists) throw new WireInvalidException("Wire start port not found"); - this.endPort = wire.destinationPortUsage; - this.startPort = wire.sourcePortUsage; } /// @@ -202,16 +166,12 @@ namespace TechbloxModdingAPI.Blocks { get { - ref ChannelDataStruct cds = ref signalEngine.GetChannelDataStruct(startPortEGID, out bool exists); - if (!exists) return 0f; - return cds.valueAsFloat; + return signalEngine.GetChannelDataStruct(startPortEGID).Get().valueAsFloat; } set { - ref ChannelDataStruct cds = ref signalEngine.GetChannelDataStruct(startPortEGID, out bool exists); - if (!exists) return; - cds.valueAsFloat = value; + signalEngine.GetChannelDataStruct(startPortEGID).Get().valueAsFloat = value; } } @@ -222,16 +182,12 @@ namespace TechbloxModdingAPI.Blocks { get { - ref ChannelDataStruct cds = ref signalEngine.GetChannelDataStruct(startPortEGID, out bool exists); - if (!exists) return ""; - return cds.valueAsEcsString; + return signalEngine.GetChannelDataStruct(startPortEGID).Get().valueAsEcsString; } set { - ref ChannelDataStruct cds = ref signalEngine.GetChannelDataStruct(startPortEGID, out bool exists); - if (!exists) return; - cds.valueAsEcsString.Set(value); + signalEngine.GetChannelDataStruct(startPortEGID).Get().valueAsEcsString.Set(value); } } @@ -242,16 +198,12 @@ namespace TechbloxModdingAPI.Blocks { get { - ref ChannelDataStruct cds = ref signalEngine.GetChannelDataStruct(startPortEGID, out bool exists); - if (!exists) return default; - return cds.valueAsEcsString; + return signalEngine.GetChannelDataStruct(startPortEGID).Get().valueAsEcsString; } set { - ref ChannelDataStruct cds = ref signalEngine.GetChannelDataStruct(startPortEGID, out bool exists); - if (!exists) return; - cds.valueAsEcsString = value; + signalEngine.GetChannelDataStruct(startPortEGID).Get().valueAsEcsString = value; } } @@ -263,16 +215,12 @@ namespace TechbloxModdingAPI.Blocks { get { - ref ChannelDataStruct cds = ref signalEngine.GetChannelDataStruct(startPortEGID, out bool exists); - if (!exists) return uint.MaxValue; - return cds.valueAsID; + return signalEngine.GetChannelDataStruct(startPortEGID).Get().valueAsID; } - + set { - ref ChannelDataStruct cds = ref signalEngine.GetChannelDataStruct(startPortEGID, out bool exists); - if (!exists) return; - cds.valueAsID = value; + signalEngine.GetChannelDataStruct(startPortEGID).Get().valueAsID = value; } } @@ -281,7 +229,7 @@ namespace TechbloxModdingAPI.Blocks /// public SignalingBlock Start { - get => new SignalingBlock(startBlockEGID); + get => (SignalingBlock)Block.New(startBlockEGID); } /// @@ -291,13 +239,21 @@ namespace TechbloxModdingAPI.Blocks { get => startPort; } + + /// + /// The display name of the start port. + /// + public string StartPortName + { + get => signalEngine.GetPort(startPortEGID).portNameLocalised; + } /// /// The block at the end of the wire. /// public SignalingBlock End { - get => new SignalingBlock(endBlockEGID); + get => (SignalingBlock)Block.New(endBlockEGID); } /// @@ -308,6 +264,14 @@ namespace TechbloxModdingAPI.Blocks get => endPort; } + /// + /// The display name of the end port. + /// + public string EndPortName + { + get => signalEngine.GetPort(endPortEGID).portNameLocalised; + } + /// /// Create a copy of the wire object where the direction of the wire is guaranteed to be from a block output to a block input. /// This is simply a different memory configuration and does not affect the in-game wire (which is always output -> input). @@ -329,15 +293,11 @@ namespace TechbloxModdingAPI.Blocks { inputToOutput = false; // swap inputs and outputs - EGID temp = endBlockEGID; - endBlockEGID = startBlockEGID; - startBlockEGID = temp; - temp = endPortEGID; + (endBlockEGID, startBlockEGID) = (startBlockEGID, endBlockEGID); + var tempPort = endPortEGID; endPortEGID = startPortEGID; - startPortEGID = temp; - byte tempPortNumber = endPort; - endPort = startPort; - startPort = tempPortNumber; + startPortEGID = tempPort; + (endPort, startPort) = (startPort, endPort); } } @@ -345,7 +305,7 @@ namespace TechbloxModdingAPI.Blocks { if (signalEngine.Exists(wireEGID)) { - return $"{nameof(Id)}: {Id}, Start{nameof(Start.Id)}: {Start.Id}, End{nameof(End.Id)}: {End.Id}, ({Start.Type}::{StartPort} aka {Start.PortName(StartPort, inputToOutput)}) -> ({End.Type}::{EndPort} aka {End.PortName(EndPort, !inputToOutput)})"; + return $"{nameof(Id)}: {Id}, Start{nameof(Start.Id)}: {Start.Id}, End{nameof(End.Id)}: {End.Id}, ({Start.Type}::{StartPort} aka {(StartPort != byte.MaxValue ? Start.PortName(StartPort, inputToOutput) : "")}) -> ({End.Type}::{EndPort} aka {(EndPort != byte.MaxValue ? End.PortName(EndPort, !inputToOutput) : "")})"; } return $"{nameof(Id)}: {Id}, Start{nameof(Start.Id)}: {Start.Id}, End{nameof(End.Id)}: {End.Id}, ({Start.Type}::{StartPort} -> {End.Type}::{EndPort})"; } diff --git a/TechbloxModdingAPI/Player.cs b/TechbloxModdingAPI/Player.cs index 811056e..a98f67f 100644 --- a/TechbloxModdingAPI/Player.cs +++ b/TechbloxModdingAPI/Player.cs @@ -1,4 +1,5 @@ using System; +using Gamecraft.Wires; using RobocraftX.Character; using RobocraftX.Character.Movement; using Unity.Mathematics; @@ -460,7 +461,7 @@ namespace TechbloxModdingAPI { var egid = playerEngine.GetThingLookedAt(Id, maxDistance); return egid != EGID.Empty && egid.groupID == WiresGUIExclusiveGroups.WireGroup - ? new Wire(egid) + ? new Wire(new EGID(egid.entityID, NamedExclusiveGroup.Group)) : null; } diff --git a/TechbloxModdingAPI/Utility/OptionalRef.cs b/TechbloxModdingAPI/Utility/OptionalRef.cs index 79f7175..c83e0da 100644 --- a/TechbloxModdingAPI/Utility/OptionalRef.cs +++ b/TechbloxModdingAPI/Utility/OptionalRef.cs @@ -65,6 +65,7 @@ namespace TechbloxModdingAPI.Utility } public bool Exists => state != State.Empty; + public T? Nullable() => this ? Get() : default; public static implicit operator T(OptionalRef opt) => opt.Get(); -- 2.30.2 From 63295f82c97b7f5683a53401f6e9bf18f527e449 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Tue, 7 Sep 2021 23:15:03 +0200 Subject: [PATCH 212/252] Update to Techblox 2021.09.03.10.36 Removed old dependencies, including uREPL Added new block IDs Implemented basic command handling to support existing mod commands --- TechbloxModdingAPI/App/Game.cs | 8 ++- TechbloxModdingAPI/App/GameMenuEngine.cs | 7 ++- TechbloxModdingAPI/Block.cs | 2 +- TechbloxModdingAPI/Blocks/BlockIDs.cs | 15 ++++- .../Blocks/Engines/MovementEngine.cs | 2 +- .../Blocks/Engines/RemovalEngine.cs | 5 +- .../Blocks/Engines/RotationEngine.cs | 2 +- .../Blocks/Engines/SignalEngine.cs | 2 +- TechbloxModdingAPI/Blocks/Wire.cs | 12 ++-- .../Commands/CommandRegistrationHelper.cs | 20 +++---- TechbloxModdingAPI/Commands/CustomCommands.cs | 57 +++++++++++++++++++ .../Commands/ExistingCommands.cs | 14 ++--- TechbloxModdingAPI/Player.cs | 6 +- TechbloxModdingAPI/Players/PlayerEngine.cs | 6 +- TechbloxModdingAPI/TechbloxModdingAPI.csproj | 48 ++++++++++++---- .../Tests/TechbloxModdingAPIPluginTest.cs | 5 +- TechbloxModdingAPI/Utility/Logging.cs | 6 +- 17 files changed, 157 insertions(+), 60 deletions(-) create mode 100644 TechbloxModdingAPI/Commands/CustomCommands.cs diff --git a/TechbloxModdingAPI/App/Game.cs b/TechbloxModdingAPI/App/Game.cs index e543270..18e62bd 100644 --- a/TechbloxModdingAPI/App/Game.cs +++ b/TechbloxModdingAPI/App/Game.cs @@ -232,7 +232,9 @@ namespace TechbloxModdingAPI.App else { // this likely breaks things - GameMode.SaveGameDetails = new SaveGameDetails(GameMode.SaveGameDetails.Name, value, GameMode.SaveGameDetails.WorkshopId); + GameMode.SaveGameDetails = new SaveGameDetails(GameMode.SaveGameDetails.Id, + GameMode.SaveGameDetails.SaveMode, GameMode.SaveGameDetails.Name, value, + GameMode.SaveGameDetails.WorkshopId); } } } @@ -262,7 +264,9 @@ namespace TechbloxModdingAPI.App else { // this likely breaks things - GameMode.SaveGameDetails = new SaveGameDetails(GameMode.SaveGameDetails.Name, GameMode.SaveGameDetails.Folder, value); + GameMode.SaveGameDetails = new SaveGameDetails(GameMode.SaveGameDetails.Id, + GameMode.SaveGameDetails.SaveMode, GameMode.SaveGameDetails.Name, + GameMode.SaveGameDetails.Folder, value); } } } diff --git a/TechbloxModdingAPI/App/GameMenuEngine.cs b/TechbloxModdingAPI/App/GameMenuEngine.cs index 4738507..86f622b 100644 --- a/TechbloxModdingAPI/App/GameMenuEngine.cs +++ b/TechbloxModdingAPI/App/GameMenuEngine.cs @@ -7,7 +7,7 @@ using RobocraftX.GUI; using RobocraftX.GUI.MyGamesScreen; using Svelto.ECS; using Svelto.ECS.Experimental; -using Svelto.DataStructures; +using Techblox.Services.Machines; using TechbloxModdingAPI.Engines; using TechbloxModdingAPI.Utility; @@ -82,9 +82,10 @@ namespace TechbloxModdingAPI.App public bool EnterGame(string gameName, string path, ulong workshopId = 0uL, bool autoEnterSim = false) { GameMode.CurrentMode = autoEnterSim ? RCXMode.Play : RCXMode.Build; - GameMode.SaveGameDetails = new SaveGameDetails(gameName, path, workshopId); + GameMode.SaveGameDetails = new SaveGameDetails(MachineStorageId.CreateNew().ToString(), + SaveGameMode.NewSave, gameName, path, workshopId); // the private FullGameCompositionRoot.SwitchToGame() method gets passed to menu items for this reason - AccessTools.Method(typeof(FullGameCompositionRoot), "SwitchToGame").Invoke(FullGameFields.Instance, new object[0]); + AccessTools.Method(typeof(FullGameCompositionRoot), "SwitchToGame").Invoke(FullGameFields.Instance, Array.Empty()); return true; } diff --git a/TechbloxModdingAPI/Block.cs b/TechbloxModdingAPI/Block.cs index 3ace802..e64fab7 100644 --- a/TechbloxModdingAPI/Block.cs +++ b/TechbloxModdingAPI/Block.cs @@ -417,7 +417,7 @@ namespace TechbloxModdingAPI if (e.ID != Id) return; Placed -= OnPlacedInit; //And we can reference it InitData = default; //Remove initializer as it's no longer valid - if the block gets removed it shouldn't be used again - if (copiedFrom != EGID.Empty) + if (copiedFrom != default) BlockCloneEngine.CopyBlockStats(copiedFrom, Id); } diff --git a/TechbloxModdingAPI/Blocks/BlockIDs.cs b/TechbloxModdingAPI/Blocks/BlockIDs.cs index 3538104..415e7ec 100644 --- a/TechbloxModdingAPI/Blocks/BlockIDs.cs +++ b/TechbloxModdingAPI/Blocks/BlockIDs.cs @@ -150,6 +150,19 @@ namespace TechbloxModdingAPI.Blocks HatchbackWheel, HatchbackWheelArch, HatchbackArchSmallFlare, - HatchbackArchFlare + HatchbackArchFlare, + TruckWheel = 246, + HatchbackWheelWideProfile, + TruckWheelRigWithSteering = 249, + TruckWheelRigNoSteering, + HatchbackDriverSeat, + HatchbackPassengerSeat, + FormulaEngine, + TruckWheelDouble = 261, + TruckWheelArch, + TruckArchSingleFlare, + FormulaWheel = 270, + FormulaWheelRear, + FormulaSeat = 277 } } \ No newline at end of file diff --git a/TechbloxModdingAPI/Blocks/Engines/MovementEngine.cs b/TechbloxModdingAPI/Blocks/Engines/MovementEngine.cs index 48e3a23..9351623 100644 --- a/TechbloxModdingAPI/Blocks/Engines/MovementEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/MovementEngine.cs @@ -48,7 +48,7 @@ namespace TechbloxModdingAPI.Blocks.Engines // rendered position transStruct.position = vector; // collision position - if (phyStruct.ID != EGID.Empty) + if (phyStruct.ID != default) { //It exists FullGameFields._physicsWorld.EntityManager.SetComponentData(phyStruct.uecsEntity, new Translation { diff --git a/TechbloxModdingAPI/Blocks/Engines/RemovalEngine.cs b/TechbloxModdingAPI/Blocks/Engines/RemovalEngine.cs index 4322d5e..4a0ea5b 100644 --- a/TechbloxModdingAPI/Blocks/Engines/RemovalEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/RemovalEngine.cs @@ -3,6 +3,7 @@ using System.Reflection; using HarmonyLib; using RobocraftX.Blocks; using RobocraftX.Common; +using Svelto.Common; using Svelto.ECS; using Svelto.ECS.Native; @@ -22,8 +23,8 @@ namespace TechbloxModdingAPI.Blocks.Engines return false; var connections = entitiesDB.QueryEntity(target); var groups = entitiesDB.FindGroups(); - var connStructMapper = - entitiesDB.QueryNativeMappedEntities(groups); + using var connStructMapper = + entitiesDB.QueryNativeMappedEntities(groups, Allocator.Temp); for (int i = connections.connections.Count() - 1; i >= 0; i--) _connectionFactory.RemoveConnection(connections, i, connStructMapper); _entityFunctions.RemoveEntity(target); diff --git a/TechbloxModdingAPI/Blocks/Engines/RotationEngine.cs b/TechbloxModdingAPI/Blocks/Engines/RotationEngine.cs index 12a8b56..b2be508 100644 --- a/TechbloxModdingAPI/Blocks/Engines/RotationEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/RotationEngine.cs @@ -50,7 +50,7 @@ namespace TechbloxModdingAPI.Blocks.Engines // rendered rotation transStruct.rotation = newRotation; // collision rotation - if (phyStruct.ID != EGID.Empty) + if (phyStruct.ID != default) { //It exists FullGameFields._physicsWorld.EntityManager.SetComponentData(phyStruct.uecsEntity, new Unity.Transforms.Rotation diff --git a/TechbloxModdingAPI/Blocks/Engines/SignalEngine.cs b/TechbloxModdingAPI/Blocks/Engines/SignalEngine.cs index ee2e42b..3c2e1cb 100644 --- a/TechbloxModdingAPI/Blocks/Engines/SignalEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/SignalEngine.cs @@ -298,7 +298,7 @@ namespace TechbloxModdingAPI.Blocks.Engines } } - return EGID.Empty; + return default; } public OptionalRef GetChannelDataStruct(EGID portID) diff --git a/TechbloxModdingAPI/Blocks/Wire.cs b/TechbloxModdingAPI/Blocks/Wire.cs index f46ca48..4413b4f 100644 --- a/TechbloxModdingAPI/Blocks/Wire.cs +++ b/TechbloxModdingAPI/Blocks/Wire.cs @@ -83,7 +83,7 @@ namespace TechbloxModdingAPI.Blocks bool flipped = false; // find block ports EGID wire = signalEngine.MatchBlocksToWire(start.Id, end.Id, startPort, endPort); - if (wire == EGID.Empty) + if (wire == default) { // flip I/O around and try again wire = signalEngine.MatchBlocksToWire(end.Id, start.Id, endPort, startPort); @@ -92,7 +92,7 @@ namespace TechbloxModdingAPI.Blocks // This makes wire traversal easier, but makes logic in this class a bit more complex } - if (wire != EGID.Empty) + if (wire != default) { Construct(start.Id, end.Id, startPort, endPort, wire, flipped); } @@ -127,10 +127,10 @@ namespace TechbloxModdingAPI.Blocks this.endBlockEGID = endBlock; this.inputToOutput = inputToOutput; this.wireEGID = wire; - endPortEGID = signalEngine.MatchBlockIOToPort(startBlock, startPort, inputToOutput).Nullable()?.ID ?? EGID.Empty; - if (endPortEGID == EGID.Empty) throw new WireInvalidException("Wire end port not found"); - startPortEGID = signalEngine.MatchBlockIOToPort(endBlock, endPort, !inputToOutput).Nullable()?.ID ?? EGID.Empty; - if (startPortEGID == EGID.Empty) throw new WireInvalidException("Wire start port not found"); + endPortEGID = signalEngine.MatchBlockIOToPort(startBlock, startPort, inputToOutput).Nullable()?.ID ?? default; + if (endPortEGID == default) throw new WireInvalidException("Wire end port not found"); + startPortEGID = signalEngine.MatchBlockIOToPort(endBlock, endPort, !inputToOutput).Nullable()?.ID ?? default; + if (startPortEGID == default) throw new WireInvalidException("Wire start port not found"); this.startPort = startPort; this.endPort = endPort; } diff --git a/TechbloxModdingAPI/Commands/CommandRegistrationHelper.cs b/TechbloxModdingAPI/Commands/CommandRegistrationHelper.cs index 18f3a25..e33b232 100644 --- a/TechbloxModdingAPI/Commands/CommandRegistrationHelper.cs +++ b/TechbloxModdingAPI/Commands/CommandRegistrationHelper.cs @@ -4,8 +4,6 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -using uREPL; - namespace TechbloxModdingAPI.Commands { /// @@ -16,7 +14,7 @@ namespace TechbloxModdingAPI.Commands { public static void Register(string name, Action action, string desc, bool noConsole = false) { - RuntimeCommands.Register(name, action, desc); + CustomCommands.Register(name, action, desc); } public static void Register(string name, Action action, string desc, bool noConsole = false) @@ -36,42 +34,42 @@ namespace TechbloxModdingAPI.Commands public static void Register(string name, Action action, string desc, bool noConsole = false) { - RuntimeCommands.Register(name, action, desc); + CustomCommands.Register(name, action, desc); } public static void Register(string name, Action action, string desc, bool noConsole = false) { - RuntimeCommands.Register(name, action, desc); + CustomCommands.Register(name, action, desc); } public static void Register(string name, Action action, string desc, bool noConsole = false) { - RuntimeCommands.Register(name, action, desc); + CustomCommands.Register(name, action, desc); } public static void Unregister(string name, bool noConsole = false) { - RuntimeCommands.Unregister(name); + CustomCommands.Unregister(name); } public static void Call(string name) { - RuntimeCommands.Call(name); + CustomCommands.Call(name); } public static void Call(string name, Param0 param0) { - RuntimeCommands.Call(name, param0); + CustomCommands.Call(name, param0); } public static void Call(string name, Param0 param0, Param1 param1) { - RuntimeCommands.Call(name, param0, param1); + CustomCommands.Call(name, param0, param1); } public static void Call(string name, Param0 param0, Param1 param1, Param2 param2) { - RuntimeCommands.Call(name, param0, param1, param2); + CustomCommands.Call(name, param0, param1, param2); } } } diff --git a/TechbloxModdingAPI/Commands/CustomCommands.cs b/TechbloxModdingAPI/Commands/CustomCommands.cs new file mode 100644 index 0000000..0cacff8 --- /dev/null +++ b/TechbloxModdingAPI/Commands/CustomCommands.cs @@ -0,0 +1,57 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.InteropServices; + +namespace TechbloxModdingAPI.Commands +{ + internal static class CustomCommands + { + public struct CommandData + { + public string Name; + public string Description; + public Delegate Action; + } + + private static Dictionary _commands = new Dictionary(); + public static void Register(string name, Delegate action, string desc) + { + _commands.Add(name, new CommandData + { + Name = name, + Description = desc, + Action = action + }); + } + + public static void Call(string name, params object[] args) + { + if (_commands.TryGetValue(name, out var command)) + { + var paramz = command.Action.Method.GetParameters(); + if (paramz.Length > args.Length) + throw new CommandParameterMissingException( + $"This command requires {paramz.Length} arguments, {args.Length} given"); + for (var index = 0; index < paramz.Length; index++) + { + args[index] = Convert.ChangeType(args[index], paramz[index].ParameterType); + } + + command.Action.DynamicInvoke(args); + } + else + throw new CommandNotFoundException($"Command {name} does not exist!"); + } + + public static void Unregister(string name) + { + _commands.Remove(name); + } + + public static bool Exists(string name) => _commands.ContainsKey(name); + + public static ReadOnlyDictionary GetAllCommandData() => + new ReadOnlyDictionary(_commands); + } +} \ No newline at end of file diff --git a/TechbloxModdingAPI/Commands/ExistingCommands.cs b/TechbloxModdingAPI/Commands/ExistingCommands.cs index dfd3921..dd61cc8 100644 --- a/TechbloxModdingAPI/Commands/ExistingCommands.cs +++ b/TechbloxModdingAPI/Commands/ExistingCommands.cs @@ -1,39 +1,37 @@ using System.Linq; -using uREPL; - namespace TechbloxModdingAPI.Commands { public static class ExistingCommands { public static void Call(string commandName) { - RuntimeCommands.Call(commandName); + CustomCommands.Call(commandName); } public static void Call(string commandName, Arg0 arg0) { - RuntimeCommands.Call(commandName, arg0); + CustomCommands.Call(commandName, arg0); } public static void Call(string commandName, Arg0 arg0, Arg1 arg1) { - RuntimeCommands.Call(commandName, arg0, arg1); + CustomCommands.Call(commandName, arg0, arg1); } public static void Call(string commandName, Arg0 arg0, Arg1 arg1, Arg2 arg2) { - RuntimeCommands.Call(commandName, arg0, arg1, arg2); + CustomCommands.Call(commandName, arg0, arg1, arg2); } public static bool Exists(string commandName) { - return RuntimeCommands.HasRegistered(commandName); + return CustomCommands.Exists(commandName); } public static (string Name, string Description)[] GetCommandNamesAndDescriptions() { - return RuntimeCommands.table.Values.Select(command => (command.name, command.description)).ToArray(); + return CustomCommands.GetAllCommandData().Values.Select(command => (command.Name, command.Description)).ToArray(); } } } diff --git a/TechbloxModdingAPI/Player.cs b/TechbloxModdingAPI/Player.cs index a98f67f..67d36ca 100644 --- a/TechbloxModdingAPI/Player.cs +++ b/TechbloxModdingAPI/Player.cs @@ -433,7 +433,7 @@ namespace TechbloxModdingAPI public Block GetBlockLookedAt(float maxDistance = -1f) { var egid = playerEngine.GetThingLookedAt(Id, maxDistance); - return egid != EGID.Empty && egid.groupID != CommonExclusiveGroups.SIMULATION_BODIES_GROUP + return egid != default && egid.groupID != CommonExclusiveGroups.SIMULATION_BODIES_GROUP && egid.groupID != WiresGUIExclusiveGroups.WireGroup ? Block.New(egid) : null; @@ -447,7 +447,7 @@ namespace TechbloxModdingAPI public SimBody GetSimBodyLookedAt(float maxDistance = -1f) { var egid = playerEngine.GetThingLookedAt(Id, maxDistance); - return egid != EGID.Empty && egid.groupID == CommonExclusiveGroups.SIMULATION_BODIES_GROUP + return egid != default && egid.groupID == CommonExclusiveGroups.SIMULATION_BODIES_GROUP ? new SimBody(egid) : null; } @@ -460,7 +460,7 @@ namespace TechbloxModdingAPI public Wire GetWireLookedAt(float maxDistance = -1f) { var egid = playerEngine.GetThingLookedAt(Id, maxDistance); - return egid != EGID.Empty && egid.groupID == WiresGUIExclusiveGroups.WireGroup + return egid != default && egid.groupID == WiresGUIExclusiveGroups.WireGroup ? new Wire(new EGID(egid.entityID, NamedExclusiveGroup.Group)) : null; } diff --git a/TechbloxModdingAPI/Players/PlayerEngine.cs b/TechbloxModdingAPI/Players/PlayerEngine.cs index aad3612..bb13308 100644 --- a/TechbloxModdingAPI/Players/PlayerEngine.cs +++ b/TechbloxModdingAPI/Players/PlayerEngine.cs @@ -167,16 +167,16 @@ namespace TechbloxModdingAPI.Players public EGID GetThingLookedAt(uint playerId, float maxDistance = -1f) { var opt = GetCameraStruct(playerId); - if (!opt) return EGID.Empty; + if (!opt) return default; PhysicCameraRayCastEntityStruct rayCast = opt; float distance = maxDistance < 0 ? GhostBlockUtils.GetBuildInteractionDistance(entitiesDB, rayCast, GhostBlockUtils.GhostCastMethod.GhostCastProportionalToBlockSize) : maxDistance; if (rayCast.hit && rayCast.distance <= distance) - return rayCast.hitEgid; //May be EGID.Empty + return rayCast.hitEgid; //May be EGID.Empty (default) - return EGID.Empty; + return default; } public unsafe Block[] GetSelectedBlocks(uint playerid) diff --git a/TechbloxModdingAPI/TechbloxModdingAPI.csproj b/TechbloxModdingAPI/TechbloxModdingAPI.csproj index 2aca43c..015c897 100644 --- a/TechbloxModdingAPI/TechbloxModdingAPI.csproj +++ b/TechbloxModdingAPI/TechbloxModdingAPI.csproj @@ -72,6 +72,10 @@ ..\ref\TechbloxPreview_Data\Managed\DDNA.dll ..\..\ref\TechbloxPreview_Data\Managed\DDNA.dll + + ..\ref\TechbloxPreview_Data\Managed\EasyButtons.dll + ..\..\ref\TechbloxPreview_Data\Managed\EasyButtons.dll + ..\ref\TechbloxPreview_Data\Managed\EOSSDK.dll ..\..\ref\TechbloxPreview_Data\Managed\EOSSDK.dll @@ -524,10 +528,6 @@ ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Player.dll ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Player.dll - - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Rendering.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Rendering.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Rendering.Mock.dll ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Rendering.Mock.dll @@ -660,10 +660,6 @@ ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.MyGamesScreen.dll ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.MyGamesScreen.dll - - ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Notifications.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Notifications.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Notifications.MockUps.dll ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Notifications.MockUps.dll @@ -680,6 +676,26 @@ ..\ref\TechbloxPreview_Data\Managed\Techblox.Pointer.dll ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Pointer.dll + + ..\ref\TechbloxPreview_Data\Managed\Techblox.Rendering.Common.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Rendering.Common.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.Rendering.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Rendering.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.Rendering.DOTS.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Rendering.DOTS.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.Rendering.GPUI.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Rendering.GPUI.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.Rendering.Unity.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Rendering.Unity.dll + ..\ref\TechbloxPreview_Data\Managed\Techblox.SaveGamesConversion.dll ..\..\ref\TechbloxPreview_Data\Managed\Techblox.SaveGamesConversion.dll @@ -688,6 +704,10 @@ ..\ref\TechbloxPreview_Data\Managed\Techblox.Services.Eos.dll ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Services.Eos.dll + + ..\ref\TechbloxPreview_Data\Managed\Techblox.Services.Storage.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Services.Storage.dll + ..\ref\TechbloxPreview_Data\Managed\Techblox.SwitchAnimation.dll ..\..\ref\TechbloxPreview_Data\Managed\Techblox.SwitchAnimation.dll @@ -820,6 +840,10 @@ ..\ref\TechbloxPreview_Data\Managed\Unity.Recorder.dll ..\..\ref\TechbloxPreview_Data\Managed\Unity.Recorder.dll + + ..\ref\TechbloxPreview_Data\Managed\Unity.Rendering.Hybrid.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Rendering.Hybrid.dll + ..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll ..\..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll @@ -1140,14 +1164,14 @@ ..\ref\TechbloxPreview_Data\Managed\UnityEngine.XRModule.dll ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.XRModule.dll - - ..\ref\TechbloxPreview_Data\Managed\uREPL.dll - ..\..\ref\TechbloxPreview_Data\Managed\uREPL.dll - ..\ref\TechbloxPreview_Data\Managed\VisualProfiler.dll ..\..\ref\TechbloxPreview_Data\Managed\VisualProfiler.dll + + ..\ref\TechbloxPreview_Data\Managed\Whinarn.UnityMeshSimplifier.Runtime.dll + ..\..\ref\TechbloxPreview_Data\Managed\Whinarn.UnityMeshSimplifier.Runtime.dll + diff --git a/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs b/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs index eb9bda4..f6dba81 100644 --- a/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs +++ b/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs @@ -354,14 +354,15 @@ namespace TechbloxModdingAPI.Tests [HarmonyPatch] public class MinimumSpecsPatch { - public static bool Prefix() + public static bool Prefix(ref bool __result) { + __result = true; return false; } public static MethodInfo TargetMethod() { - return ((Action) MinimumSpecsCheck.CheckRequirementsMet).Method; + return ((Func) MinimumSpecsCheck.CheckRequirementsMet).Method; } } } diff --git a/TechbloxModdingAPI/Utility/Logging.cs b/TechbloxModdingAPI/Utility/Logging.cs index 0788ce6..0147eff 100644 --- a/TechbloxModdingAPI/Utility/Logging.cs +++ b/TechbloxModdingAPI/Utility/Logging.cs @@ -163,7 +163,7 @@ namespace TechbloxModdingAPI.Utility [MethodImpl(MethodImplOptions.AggressiveInlining)] public static void CommandLog(string msg) { - uREPL.Log.Output(msg); + Log(msg); } /// @@ -179,7 +179,7 @@ namespace TechbloxModdingAPI.Utility [MethodImpl(MethodImplOptions.AggressiveInlining)] public static void CommandLogError(string msg) { - uREPL.Log.Error(msg); + LogError(msg); } /// @@ -195,7 +195,7 @@ namespace TechbloxModdingAPI.Utility [MethodImpl(MethodImplOptions.AggressiveInlining)] public static void CommandLogWarning(string msg) { - uREPL.Log.Warn(msg); + LogWarning(msg); } } -- 2.30.2 From aa947eaba1d3cafc716e59fe041ff8168080a533 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sat, 2 Oct 2021 00:01:47 +0200 Subject: [PATCH 213/252] Update to Techblox 2021.09.27.15.17 Fixed block name print regex Made Game.WorkshopId obsolete as it's removed from the game Fixed removing blocks --- TechbloxModdingAPI/App/Game.cs | 21 +++---------------- TechbloxModdingAPI/App/GameMenuEngine.cs | 4 ++-- TechbloxModdingAPI/Blocks/BlockIDs.cs | 6 +++++- .../Blocks/Engines/RemovalEngine.cs | 4 ++-- .../Tests/TechbloxModdingAPIPluginTest.cs | 2 +- 5 files changed, 13 insertions(+), 24 deletions(-) diff --git a/TechbloxModdingAPI/App/Game.cs b/TechbloxModdingAPI/App/Game.cs index 18e62bd..5a9cccc 100644 --- a/TechbloxModdingAPI/App/Game.cs +++ b/TechbloxModdingAPI/App/Game.cs @@ -233,8 +233,7 @@ namespace TechbloxModdingAPI.App { // this likely breaks things GameMode.SaveGameDetails = new SaveGameDetails(GameMode.SaveGameDetails.Id, - GameMode.SaveGameDetails.SaveMode, GameMode.SaveGameDetails.Name, value, - GameMode.SaveGameDetails.WorkshopId); + GameMode.SaveGameDetails.SaveMode, GameMode.SaveGameDetails.Name, value); } } } @@ -244,30 +243,16 @@ namespace TechbloxModdingAPI.App /// In most cases this is invalid and returns 0, so this can be ignored. /// /// The workshop identifier. + [Obsolete] public ulong WorkshopId { get { - if (!VerifyMode()) return 0uL; - if (menuMode) return 0uL; // MyGames don't have workshop IDs - return GameMode.SaveGameDetails.WorkshopId; + return 0uL; // Not supported anymore } set { - VerifyMode(); - if (menuMode) - { - // MyGames don't have workshop IDs - // menuEngine.GetGameInfo(EGID).GameName.Set(value); - } - else - { - // this likely breaks things - GameMode.SaveGameDetails = new SaveGameDetails(GameMode.SaveGameDetails.Id, - GameMode.SaveGameDetails.SaveMode, GameMode.SaveGameDetails.Name, - GameMode.SaveGameDetails.Folder, value); - } } } diff --git a/TechbloxModdingAPI/App/GameMenuEngine.cs b/TechbloxModdingAPI/App/GameMenuEngine.cs index 86f622b..9d8e448 100644 --- a/TechbloxModdingAPI/App/GameMenuEngine.cs +++ b/TechbloxModdingAPI/App/GameMenuEngine.cs @@ -79,11 +79,11 @@ namespace TechbloxModdingAPI.App return EnterGame(mgdes.GameName, mgdes.SavedGamePath); } - public bool EnterGame(string gameName, string path, ulong workshopId = 0uL, bool autoEnterSim = false) + public bool EnterGame(string gameName, string path, bool autoEnterSim = false) { GameMode.CurrentMode = autoEnterSim ? RCXMode.Play : RCXMode.Build; GameMode.SaveGameDetails = new SaveGameDetails(MachineStorageId.CreateNew().ToString(), - SaveGameMode.NewSave, gameName, path, workshopId); + SaveGameMode.NewSave, gameName, path); // the private FullGameCompositionRoot.SwitchToGame() method gets passed to menu items for this reason AccessTools.Method(typeof(FullGameCompositionRoot), "SwitchToGame").Invoke(FullGameFields.Instance, Array.Empty()); return true; diff --git a/TechbloxModdingAPI/Blocks/BlockIDs.cs b/TechbloxModdingAPI/Blocks/BlockIDs.cs index 415e7ec..09016aa 100644 --- a/TechbloxModdingAPI/Blocks/BlockIDs.cs +++ b/TechbloxModdingAPI/Blocks/BlockIDs.cs @@ -163,6 +163,10 @@ namespace TechbloxModdingAPI.Blocks TruckArchSingleFlare, FormulaWheel = 270, FormulaWheelRear, - FormulaSeat = 277 + FormulaSeat = 277, + MonsterTruckWheel = 285, + MonsterTruckEngine = 290, + MonsterTruckWheelRigNoSteering = 350, + MonsterTruckWheelRigWithSteering, } } \ No newline at end of file diff --git a/TechbloxModdingAPI/Blocks/Engines/RemovalEngine.cs b/TechbloxModdingAPI/Blocks/Engines/RemovalEngine.cs index 4a0ea5b..7999443 100644 --- a/TechbloxModdingAPI/Blocks/Engines/RemovalEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/RemovalEngine.cs @@ -23,8 +23,8 @@ namespace TechbloxModdingAPI.Blocks.Engines return false; var connections = entitiesDB.QueryEntity(target); var groups = entitiesDB.FindGroups(); - using var connStructMapper = - entitiesDB.QueryNativeMappedEntities(groups, Allocator.Temp); + using var connStructMapper = //The allocator needs to be persistent because that's what is used in the Dispose() method + entitiesDB.QueryNativeMappedEntities(groups, Allocator.Persistent); for (int i = connections.connections.Count() - 1; i >= 0; i--) _connectionFactory.RemoveConnection(connections, i, connStructMapper); _entityFunctions.RemoveEntity(target); diff --git a/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs b/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs index f6dba81..32ef656 100644 --- a/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs +++ b/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs @@ -268,7 +268,7 @@ namespace TechbloxModdingAPI.Tests string name = LocalizationService.Localize(data.CubeNameKey).Replace(" ", ""); foreach (var rkv in toReplace) { - name = Regex.Replace(name, "([^A-Za-z])" + rkv.Key + "([^A-Za-z])", "$1" + rkv.Value + "$2"); + name = Regex.Replace(name, rkv.Key + "([A-Z]|$)", rkv.Value + "$1"); } Console.WriteLine($"{name}{(currentKey != lastKey + 1 ? $" = {currentKey}" : "")},"); lastKey = currentKey; -- 2.30.2 From 8a03277d842133328357d0565310daae956c44d7 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sat, 2 Oct 2021 03:50:20 +0200 Subject: [PATCH 214/252] Added block placement in sim and ECS object tracking ECS objects are stored in a newly created weak dictionary so that events can be called on them and possibly other things can be done with them --- TechbloxModdingAPI/Block.cs | 11 +- TechbloxModdingAPI/EcsObjectBase.cs | 39 ++++- .../Tests/TechbloxModdingAPIPluginTest.cs | 2 +- TechbloxModdingAPI/Utility/WeakDictionary.cs | 138 ++++++++++++++++++ 4 files changed, 180 insertions(+), 10 deletions(-) create mode 100644 TechbloxModdingAPI/Utility/WeakDictionary.cs diff --git a/TechbloxModdingAPI/Block.cs b/TechbloxModdingAPI/Block.cs index e64fab7..44bbc92 100644 --- a/TechbloxModdingAPI/Block.cs +++ b/TechbloxModdingAPI/Block.cs @@ -45,10 +45,12 @@ namespace TechbloxModdingAPI /// The block's position - default block size is 0.2 /// Whether the block should be auto-wired (if functional) /// The player who placed the block + /// /// The placed block or null if failed - public static Block PlaceNew(BlockIDs block, float3 position, bool autoWire = false, Player player = null) + public static Block PlaceNew(BlockIDs block, float3 position, bool autoWire = false, Player player = null, + bool force = false) { - if (PlacementEngine.IsInGame && GameState.IsBuildMode()) + if (PlacementEngine.IsInGame && (GameState.IsBuildMode() || force)) { var initializer = PlacementEngine.PlaceBlock(block, position, player, autoWire); var egid = initializer.EGID; @@ -140,9 +142,10 @@ namespace TechbloxModdingAPI /// The block's position (a block is 0.2 wide in terms of position) /// Whether the block should be auto-wired (if functional) /// The player who placed the block - public Block(BlockIDs type, float3 position, bool autoWire = false, Player player = null) + /// Place even if not in build mode + public Block(BlockIDs type, float3 position, bool autoWire = false, Player player = null, bool force = false) { - if (!PlacementEngine.IsInGame || !GameState.IsBuildMode()) + if (!PlacementEngine.IsInGame || !GameState.IsBuildMode() && !force) throw new BlockException("Blocks can only be placed in build mode."); var initializer = PlacementEngine.PlaceBlock(type, position, player, autoWire); Id = initializer.EGID; diff --git a/TechbloxModdingAPI/EcsObjectBase.cs b/TechbloxModdingAPI/EcsObjectBase.cs index c96cf25..6a4db65 100644 --- a/TechbloxModdingAPI/EcsObjectBase.cs +++ b/TechbloxModdingAPI/EcsObjectBase.cs @@ -1,18 +1,45 @@ using System; +using System.Collections.Generic; using System.Linq.Expressions; using Svelto.DataStructures; using Svelto.ECS; using Svelto.ECS.Internal; -using TechbloxModdingAPI.Blocks; +using TechbloxModdingAPI.Utility; namespace TechbloxModdingAPI { public abstract class EcsObjectBase { public abstract EGID Id { get; } //Abstract to support the 'place' Block constructor - + + private static readonly Dictionary> _instances = + new Dictionary>(); + + private static readonly WeakDictionary _noInstance = + new WeakDictionary(); + + internal static WeakDictionary GetInstances(Type type) + { + return _instances.TryGetValue(type, out var dict) ? dict : null; + } + + protected EcsObjectBase() + { + if (!_instances.TryGetValue(GetType(), out var dict)) + { + dict = new WeakDictionary(); + _instances.Add(GetType(), dict); + } + + // ReSharper disable once VirtualMemberCallInConstructor + // The ID should not depend on the constructor + dict.Add(Id, this); + } + + #region ECS initializer stuff + protected internal EcsInitData InitData; - + /// /// Holds information needed to construct a component initializer /// @@ -22,7 +49,7 @@ namespace TechbloxModdingAPI private EntityReference reference; public static implicit operator EcsInitData(EntityInitializer initializer) => new EcsInitData - {group = GetInitGroup(initializer), reference = initializer.reference}; + { group = GetInitGroup(initializer), reference = initializer.reference }; public EntityInitializer Initializer(EGID id) => new EntityInitializer(id, group, reference); public bool Valid => group != null; @@ -56,8 +83,10 @@ namespace TechbloxModdingAPI returnExpr = Expression.ConvertChecked(memberExpr, invokeMethod.ReturnType); var lambda = - Expression.Lambda(returnExpr, $"Access{paramType.Name}_{memberName}", new[] {objParam}); + Expression.Lambda(returnExpr, $"Access{paramType.Name}_{memberName}", new[] { objParam }); return lambda.Compile(); } + + #endregion } } \ No newline at end of file diff --git a/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs b/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs index 32ef656..dd1d2b3 100644 --- a/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs +++ b/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs @@ -91,7 +91,7 @@ namespace TechbloxModdingAPI.Tests .Description("Place a block of aluminium at the given coordinates") .Action((float x, float y, float z) => { - var block = Block.PlaceNew(BlockIDs.Cube, new float3(x, y, z)); + var block = Block.PlaceNew(BlockIDs.Cube, new float3(x, y, z), force: true); Logging.CommandLog("Block placed with type: " + block.Type); }) .Build(); diff --git a/TechbloxModdingAPI/Utility/WeakDictionary.cs b/TechbloxModdingAPI/Utility/WeakDictionary.cs new file mode 100644 index 0000000..287b044 --- /dev/null +++ b/TechbloxModdingAPI/Utility/WeakDictionary.cs @@ -0,0 +1,138 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; + +namespace TechbloxModdingAPI.Utility +{ + public class WeakDictionary : IDictionary where TValue : class + { + private Dictionary> _dictionary = new Dictionary>(); + + public IEnumerator> GetEnumerator() + { + using var enumerator = _dictionary.GetEnumerator(); + while (enumerator.MoveNext()) + { + if (enumerator.Current.Value.TryGetTarget(out var value)) + yield return new KeyValuePair(enumerator.Current.Key, value); + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(KeyValuePair item) + { + Add(item.Key, item.Value); + } + + public void Clear() + { + _dictionary.Clear(); + } + + public bool Contains(KeyValuePair item) + { + return TryGetValue(item.Key, out var value) && item.Value == value; + } + + public void CopyTo(KeyValuePair[] array, int arrayIndex) + { + throw new System.NotImplementedException(); + } + + public bool Remove(KeyValuePair item) + { + return Contains(item) && Remove(item.Key); + } + + public int Count => _dictionary.Count; + public bool IsReadOnly => false; + + public bool ContainsKey(TKey key) + { + return _dictionary.ContainsKey(key); + } + + public void Add(TKey key, TValue value) + { + _dictionary.Add(key, new WeakReference(value)); + } + + public bool Remove(TKey key) + { + return _dictionary.Remove(key); + } + + public bool TryGetValue(TKey key, out TValue value) + { + value = null; + return _dictionary.TryGetValue(key, out var reference) && reference.TryGetTarget(out value); + } + + public TValue this[TKey key] + { + get => TryGetValue(key, out var value) + ? value + : throw new KeyNotFoundException($"Key {key} not found in WeakDictionary."); + set => _dictionary[key] = new WeakReference(value); + } + + public ICollection Keys => _dictionary.Keys; + public ICollection Values => new ValueCollection(this); + + public class ValueCollection : ICollection, IReadOnlyCollection + { + private WeakDictionary _dictionary; + internal ValueCollection(WeakDictionary dictionary) + { + _dictionary = dictionary; + } + + public IEnumerator GetEnumerator() + { + using var enumerator = _dictionary.GetEnumerator(); + while (enumerator.MoveNext()) + { + yield return enumerator.Current.Value; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(TValue item) + { + throw new NotSupportedException("The value collection is read only."); + } + + public void Clear() + { + throw new NotSupportedException("The value collection is read only."); + } + + public bool Contains(TValue item) + { + return _dictionary.Any(kv => kv.Value == item); + } + + public void CopyTo(TValue[] array, int arrayIndex) + { + throw new NotImplementedException(); + } + + public bool Remove(TValue item) + { + throw new NotSupportedException("The value collection is read only."); + } + + public int Count => _dictionary.Count; + public bool IsReadOnly => true; + } + } +} \ No newline at end of file -- 2.30.2 From 4bd636b8edf75c9032e1f1e4e3a51d6acf39ab83 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Fri, 8 Oct 2021 03:58:01 +0200 Subject: [PATCH 215/252] Add wrapped event handler, using the existing ECS object instances - Added a wrapper class that handles the individual wrapping of event handlers to individually handle exceptions - now it tracks the wrapped event handlers so it can unregister them properly - Fixed an exception that happened when two ECS objects were created with the same EGID - Added support for returning an existing ECS object if it exists instead of always creating a new one - Added a parameter to the entity query extension methods to override the group of the ECS object (could be used for the player properties) --- TechbloxModdingAPI/App/AppEngine.cs | 8 +-- TechbloxModdingAPI/App/Client.cs | 4 +- TechbloxModdingAPI/App/Game.cs | 8 +-- .../App/GameBuildSimEventEngine.cs | 8 +-- TechbloxModdingAPI/App/GameGameEngine.cs | 8 +-- TechbloxModdingAPI/Block.cs | 28 +++++++--- .../Blocks/Engines/BlockEventsEngine.cs | 12 ++--- TechbloxModdingAPI/Blocks/Wire.cs | 6 +-- TechbloxModdingAPI/EcsObjectBase.cs | 22 +++++++- TechbloxModdingAPI/Player.cs | 7 +-- TechbloxModdingAPI/SimBody.cs | 5 +- TechbloxModdingAPI/Utility/ExceptionUtil.cs | 43 --------------- .../Utility/ManagedApiExtensions.cs | 35 ++++++------ .../Utility/NativeApiExtensions.cs | 32 ++++++----- TechbloxModdingAPI/Utility/WrappedHandler.cs | 53 +++++++++++++++++++ 15 files changed, 164 insertions(+), 115 deletions(-) delete mode 100644 TechbloxModdingAPI/Utility/ExceptionUtil.cs create mode 100644 TechbloxModdingAPI/Utility/WrappedHandler.cs diff --git a/TechbloxModdingAPI/App/AppEngine.cs b/TechbloxModdingAPI/App/AppEngine.cs index 741c576..3f89f26 100644 --- a/TechbloxModdingAPI/App/AppEngine.cs +++ b/TechbloxModdingAPI/App/AppEngine.cs @@ -9,9 +9,9 @@ namespace TechbloxModdingAPI.App { public class AppEngine : IFactoryEngine { - public event EventHandler EnterMenu; + public WrappedHandler EnterMenu; - public event EventHandler ExitMenu; + public WrappedHandler ExitMenu; public IEntityFactory Factory { set; private get; } @@ -24,13 +24,13 @@ namespace TechbloxModdingAPI.App public void Dispose() { IsInMenu = false; - ExceptionUtil.InvokeEvent(ExitMenu, this, new MenuEventArgs { }); + ExitMenu.Invoke(this, new MenuEventArgs { }); } public void Ready() { IsInMenu = true; - ExceptionUtil.InvokeEvent(EnterMenu, this, new MenuEventArgs { }); + EnterMenu.Invoke(this, new MenuEventArgs { }); } // app functionality diff --git a/TechbloxModdingAPI/App/Client.cs b/TechbloxModdingAPI/App/Client.cs index 9d636eb..026b1a2 100644 --- a/TechbloxModdingAPI/App/Client.cs +++ b/TechbloxModdingAPI/App/Client.cs @@ -28,7 +28,7 @@ namespace TechbloxModdingAPI.App /// public static event EventHandler EnterMenu { - add => appEngine.EnterMenu += ExceptionUtil.WrapHandler(value); + add => appEngine.EnterMenu += value; remove => appEngine.EnterMenu -= value; } @@ -37,7 +37,7 @@ namespace TechbloxModdingAPI.App /// public static event EventHandler ExitMenu { - add => appEngine.ExitMenu += ExceptionUtil.WrapHandler(value); + add => appEngine.ExitMenu += value; remove => appEngine.ExitMenu -= value; } diff --git a/TechbloxModdingAPI/App/Game.cs b/TechbloxModdingAPI/App/Game.cs index 5a9cccc..ad7ba33 100644 --- a/TechbloxModdingAPI/App/Game.cs +++ b/TechbloxModdingAPI/App/Game.cs @@ -93,7 +93,7 @@ namespace TechbloxModdingAPI.App /// public static event EventHandler Simulate { - add => buildSimEventEngine.SimulationMode += ExceptionUtil.WrapHandler(value); + add => buildSimEventEngine.SimulationMode += value; remove => buildSimEventEngine.SimulationMode -= value; } @@ -103,7 +103,7 @@ namespace TechbloxModdingAPI.App /// public static event EventHandler Edit { - add => buildSimEventEngine.BuildMode += ExceptionUtil.WrapHandler(value); + add => buildSimEventEngine.BuildMode += value; remove => buildSimEventEngine.BuildMode -= value; } @@ -112,7 +112,7 @@ namespace TechbloxModdingAPI.App /// public static event EventHandler Enter { - add => gameEngine.EnterGame += ExceptionUtil.WrapHandler(value); + add => gameEngine.EnterGame += value; remove => gameEngine.EnterGame -= value; } @@ -122,7 +122,7 @@ namespace TechbloxModdingAPI.App /// public static event EventHandler Exit { - add => gameEngine.ExitGame += ExceptionUtil.WrapHandler(value); + add => gameEngine.ExitGame += value; remove => gameEngine.ExitGame -= value; } diff --git a/TechbloxModdingAPI/App/GameBuildSimEventEngine.cs b/TechbloxModdingAPI/App/GameBuildSimEventEngine.cs index f710d6f..d4697ff 100644 --- a/TechbloxModdingAPI/App/GameBuildSimEventEngine.cs +++ b/TechbloxModdingAPI/App/GameBuildSimEventEngine.cs @@ -11,9 +11,9 @@ namespace TechbloxModdingAPI.App { public class GameBuildSimEventEngine : IApiEngine, IUnorderedInitializeOnTimeRunningModeEntered, IUnorderedInitializeOnTimeStoppedModeEntered { - public event EventHandler SimulationMode; + public WrappedHandler SimulationMode; - public event EventHandler BuildMode; + public WrappedHandler BuildMode; public string Name => "TechbloxModdingAPIBuildSimEventGameEngine"; @@ -27,13 +27,13 @@ namespace TechbloxModdingAPI.App public JobHandle OnInitializeTimeRunningMode(JobHandle inputDeps) { - ExceptionUtil.InvokeEvent(SimulationMode, this, new GameEventArgs { GameName = GameMode.SaveGameDetails.Name, GamePath = GameMode.SaveGameDetails.Folder }); + SimulationMode.Invoke(this, new GameEventArgs { GameName = GameMode.SaveGameDetails.Name, GamePath = GameMode.SaveGameDetails.Folder }); return inputDeps; } public JobHandle OnInitializeTimeStoppedMode(JobHandle inputDeps) { - ExceptionUtil.InvokeEvent(BuildMode, this, new GameEventArgs { GameName = GameMode.SaveGameDetails.Name, GamePath = GameMode.SaveGameDetails.Folder }); + BuildMode.Invoke(this, new GameEventArgs { GameName = GameMode.SaveGameDetails.Name, GamePath = GameMode.SaveGameDetails.Folder }); return inputDeps; } } diff --git a/TechbloxModdingAPI/App/GameGameEngine.cs b/TechbloxModdingAPI/App/GameGameEngine.cs index 8ae2aa3..a773d61 100644 --- a/TechbloxModdingAPI/App/GameGameEngine.cs +++ b/TechbloxModdingAPI/App/GameGameEngine.cs @@ -17,9 +17,9 @@ namespace TechbloxModdingAPI.App { public class GameGameEngine : IApiEngine { - public event EventHandler EnterGame; + public WrappedHandler EnterGame; - public event EventHandler ExitGame; + public WrappedHandler ExitGame; public string Name => "TechbloxModdingAPIGameInfoMenuEngine"; @@ -29,13 +29,13 @@ namespace TechbloxModdingAPI.App public void Dispose() { - ExceptionUtil.InvokeEvent(ExitGame, this, new GameEventArgs { GameName = GameMode.SaveGameDetails.Name, GamePath = GameMode.SaveGameDetails.Folder }); + ExitGame.Invoke(this, new GameEventArgs { GameName = GameMode.SaveGameDetails.Name, GamePath = GameMode.SaveGameDetails.Folder }); IsInGame = false; } public void Ready() { - ExceptionUtil.InvokeEvent(EnterGame, this, new GameEventArgs { GameName = GameMode.SaveGameDetails.Name, GamePath = GameMode.SaveGameDetails.Folder }); + EnterGame.Invoke(this, new GameEventArgs { GameName = GameMode.SaveGameDetails.Name, GamePath = GameMode.SaveGameDetails.Folder }); IsInGame = true; } diff --git a/TechbloxModdingAPI/Block.cs b/TechbloxModdingAPI/Block.cs index 44bbc92..2cd995b 100644 --- a/TechbloxModdingAPI/Block.cs +++ b/TechbloxModdingAPI/Block.cs @@ -78,8 +78,8 @@ namespace TechbloxModdingAPI /// An event that fires each time a block is placed. /// public static event EventHandler Placed - { - add => BlockEventsEngine.Placed += ExceptionUtil.WrapHandler(value); + { //TODO: Rename and add instance version in 3.0 + add => BlockEventsEngine.Placed += value; remove => BlockEventsEngine.Placed -= value; } @@ -88,7 +88,7 @@ namespace TechbloxModdingAPI /// public static event EventHandler Removed { - add => BlockEventsEngine.Removed += ExceptionUtil.WrapHandler(value); + add => BlockEventsEngine.Removed += value; remove => BlockEventsEngine.Removed -= value; } @@ -105,13 +105,25 @@ namespace TechbloxModdingAPI {CommonExclusiveGroups.WHEELRIG_BLOCK_BUILD_GROUP, (id => new WheelRig(id), typeof(WheelRig))} }; + /// + /// Returns a correctly typed instance of this block. The instances are shared for a specific block. + /// If an instance is no longer referenced a new instance is returned. + /// + /// The EGID of the block + /// Whether the block is definitely a signaling block + /// internal static Block New(EGID egid, bool signaling = false) { - return GroupToConstructor.ContainsKey(egid.groupID) - ? GroupToConstructor[egid.groupID].Constructor(egid) - : signaling - ? new SignalingBlock(egid) - : new Block(egid); + if (egid == default) return null; + if (GroupToConstructor.ContainsKey(egid.groupID)) + { + var (constructor, type) = GroupToConstructor[egid.groupID]; + return GetInstance(egid, constructor, type); + } + + return signaling + ? GetInstance(egid, e => new SignalingBlock(e)) + : GetInstance(egid, e => new Block(e)); } public Block(EGID id) diff --git a/TechbloxModdingAPI/Blocks/Engines/BlockEventsEngine.cs b/TechbloxModdingAPI/Blocks/Engines/BlockEventsEngine.cs index 776f162..4da3f65 100644 --- a/TechbloxModdingAPI/Blocks/Engines/BlockEventsEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/BlockEventsEngine.cs @@ -10,8 +10,8 @@ namespace TechbloxModdingAPI.Blocks.Engines { public class BlockEventsEngine : IReactionaryEngine { - public event EventHandler Placed; - public event EventHandler Removed; + public WrappedHandler Placed; + public WrappedHandler Removed; public void Ready() { @@ -31,16 +31,14 @@ namespace TechbloxModdingAPI.Blocks.Engines { if (!(shouldAddRemove = !shouldAddRemove)) return; - ExceptionUtil.InvokeEvent(Placed, this, - new BlockPlacedRemovedEventArgs {ID = egid}); + Placed.Invoke(this, new BlockPlacedRemovedEventArgs {ID = egid}); } public void Remove(ref BlockTagEntityStruct entityComponent, EGID egid) { if (!(shouldAddRemove = !shouldAddRemove)) return; - ExceptionUtil.InvokeEvent(Removed, this, - new BlockPlacedRemovedEventArgs {ID = egid}); + Removed.Invoke(this, new BlockPlacedRemovedEventArgs {ID = egid}); } } @@ -49,6 +47,6 @@ namespace TechbloxModdingAPI.Blocks.Engines public EGID ID; private Block block; - public Block Block => block ?? (block = Block.New(ID)); + public Block Block => block ??= Block.New(ID); } } \ No newline at end of file diff --git a/TechbloxModdingAPI/Blocks/Wire.cs b/TechbloxModdingAPI/Blocks/Wire.cs index 4413b4f..0c66557 100644 --- a/TechbloxModdingAPI/Blocks/Wire.cs +++ b/TechbloxModdingAPI/Blocks/Wire.cs @@ -8,7 +8,7 @@ using TechbloxModdingAPI.Blocks.Engines; namespace TechbloxModdingAPI.Blocks { - public class Wire + public class Wire : EcsObjectBase { internal static SignalEngine signalEngine; @@ -154,7 +154,7 @@ namespace TechbloxModdingAPI.Blocks /// /// The wire's in-game id. /// - public EGID Id + public override EGID Id { get => wireEGID; } @@ -279,7 +279,7 @@ namespace TechbloxModdingAPI.Blocks /// A copy of the wire object. public Wire OutputToInputCopy() { - return new Wire(wireEGID); + return GetInstance(wireEGID, egid => new Wire(egid)); } /// diff --git a/TechbloxModdingAPI/EcsObjectBase.cs b/TechbloxModdingAPI/EcsObjectBase.cs index 6a4db65..f01561a 100644 --- a/TechbloxModdingAPI/EcsObjectBase.cs +++ b/TechbloxModdingAPI/EcsObjectBase.cs @@ -23,6 +23,22 @@ namespace TechbloxModdingAPI return _instances.TryGetValue(type, out var dict) ? dict : null; } + /// + /// Returns a cached instance if there's an actively used instance of the object already. + /// Objects still get garbage collected and then they will be removed from the cache. + /// + /// The EGID of the entity + /// The constructor to construct the object + /// The object type + /// + internal static T GetInstance(EGID egid, Func constructor, Type type = null) where T : EcsObjectBase + { + var instances = GetInstances(type ?? typeof(T)); + if (instances == null || !instances.TryGetValue(egid, out var instance)) + return constructor(egid); // It will be added by the constructor + return (T)instance; + } + protected EcsObjectBase() { if (!_instances.TryGetValue(GetType(), out var dict)) @@ -31,9 +47,11 @@ namespace TechbloxModdingAPI _instances.Add(GetType(), dict); } - // ReSharper disable once VirtualMemberCallInConstructor + // ReSharper disable VirtualMemberCallInConstructor // The ID should not depend on the constructor - dict.Add(Id, this); + if (!dict.ContainsKey(Id)) // Multiple instances may be created + dict.Add(Id, this); + // ReSharper enable VirtualMemberCallInConstructor } #region ECS initializer stuff diff --git a/TechbloxModdingAPI/Player.cs b/TechbloxModdingAPI/Player.cs index 67d36ca..3dad9ea 100644 --- a/TechbloxModdingAPI/Player.cs +++ b/TechbloxModdingAPI/Player.cs @@ -21,7 +21,7 @@ namespace TechbloxModdingAPI /// An in-game player character. Any Leo you see is a player. /// public class Player : IEquatable, IEquatable - { + { //TODO: Inherit EcsObjectBase and make Id an EGID, useful for caching // static functionality private static PlayerEngine playerEngine = new PlayerEngine(); private static Player localPlayer; @@ -448,7 +448,7 @@ namespace TechbloxModdingAPI { var egid = playerEngine.GetThingLookedAt(Id, maxDistance); return egid != default && egid.groupID == CommonExclusiveGroups.SIMULATION_BODIES_GROUP - ? new SimBody(egid) + ? EcsObjectBase.GetInstance(egid, e => new SimBody(e)) : null; } @@ -461,7 +461,8 @@ namespace TechbloxModdingAPI { var egid = playerEngine.GetThingLookedAt(Id, maxDistance); return egid != default && egid.groupID == WiresGUIExclusiveGroups.WireGroup - ? new Wire(new EGID(egid.entityID, NamedExclusiveGroup.Group)) + ? EcsObjectBase.GetInstance(new EGID(egid.entityID, NamedExclusiveGroup.Group), + e => new Wire(e)) : null; } diff --git a/TechbloxModdingAPI/SimBody.cs b/TechbloxModdingAPI/SimBody.cs index 55c6a9e..2f2f8b6 100644 --- a/TechbloxModdingAPI/SimBody.cs +++ b/TechbloxModdingAPI/SimBody.cs @@ -20,7 +20,10 @@ namespace TechbloxModdingAPI /// The cluster this chunk belongs to, or null if no cluster destruction manager present or the chunk doesn't exist. /// Get the SimBody from a Block if possible for good performance here. /// - public Cluster Cluster => cluster ?? (cluster = clusterId == uint.MaxValue ? Block.BlockEngine.GetCluster(Id.entityID) : new Cluster(clusterId)); + public Cluster Cluster => cluster ??= clusterId == uint.MaxValue // Return cluster or if it's null then set it + ? Block.BlockEngine.GetCluster(Id.entityID) // If we don't have a clusterId set then get it from the game + : GetInstance(new EGID(clusterId, CommonExclusiveGroups.SIMULATION_CLUSTERS_GROUP), + egid => new Cluster(egid)); // Otherwise get the cluster from the ID private Cluster cluster; private readonly uint clusterId = uint.MaxValue; diff --git a/TechbloxModdingAPI/Utility/ExceptionUtil.cs b/TechbloxModdingAPI/Utility/ExceptionUtil.cs deleted file mode 100644 index d11508b..0000000 --- a/TechbloxModdingAPI/Utility/ExceptionUtil.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; -using TechbloxModdingAPI.Events; - -namespace TechbloxModdingAPI.Utility -{ - public static class ExceptionUtil - { - /// - /// Invokes an event with a null-check. - /// - /// The event to emit, can be null - /// Event sender - /// Event arguments - /// Type of the event arguments - public static void InvokeEvent(EventHandler handler, object sender, T args) - { - handler?.Invoke(sender, args); - } - - /// - /// Wraps the event handler in a try-catch block to avoid propagating exceptions. - /// - /// The handler to wrap (not null) - /// Type of the event arguments - /// The wrapped handler - public static EventHandler WrapHandler(EventHandler handler) - { - return (sender, e) => - { - try - { - handler(sender, e); - } - catch (Exception e1) - { - EventRuntimeException wrappedException = - new EventRuntimeException($"EventHandler with arg type {typeof(T).Name} threw an exception", e1); - Logging.LogWarning(wrappedException.ToString()); - } - }; - } - } -} \ No newline at end of file diff --git a/TechbloxModdingAPI/Utility/ManagedApiExtensions.cs b/TechbloxModdingAPI/Utility/ManagedApiExtensions.cs index 2616ab7..6829b2d 100644 --- a/TechbloxModdingAPI/Utility/ManagedApiExtensions.cs +++ b/TechbloxModdingAPI/Utility/ManagedApiExtensions.cs @@ -1,6 +1,5 @@ using Svelto.ECS; using Svelto.ECS.Hybrid; -using TechbloxModdingAPI.Blocks; namespace TechbloxModdingAPI.Utility { @@ -23,32 +22,36 @@ namespace TechbloxModdingAPI.Utility } /// - /// Attempts to query an entity and returns the result or a dummy value that can be modified. + /// Attempts to query an entity and returns the result in an optional reference. /// - /// - /// - /// - /// - public static OptionalRef QueryEntityOptional(this EntitiesDB entitiesDB, EcsObjectBase obj) + /// The entities DB to query from + /// The ECS object to query + /// The group of the entity if the object can have multiple + /// The component to query + /// A reference to the component or a dummy value + public static OptionalRef QueryEntityOptional(this EntitiesDB entitiesDB, EcsObjectBase obj, ExclusiveGroupStruct group = default) where T : struct, IEntityViewComponent { - var opt = QueryEntityOptional(entitiesDB, obj.Id); - return opt ? opt : new OptionalRef(obj, true); + EGID id = group == ExclusiveGroupStruct.Invalid ? obj.Id : new EGID(obj.Id.entityID, group); + var opt = QueryEntityOptional(entitiesDB, id); + return opt ? opt : new OptionalRef(obj, false); } /// /// Attempts to query an entity and returns the result or a dummy value that can be modified. /// - /// - /// - /// - /// - public static ref T QueryEntityOrDefault(this EntitiesDB entitiesDB, EcsObjectBase obj) + /// The entities DB to query from + /// The ECS object to query + /// The group of the entity if the object can have multiple + /// The component to query + /// A reference to the component or a dummy value + public static ref T QueryEntityOrDefault(this EntitiesDB entitiesDB, EcsObjectBase obj, ExclusiveGroupStruct group = default) where T : struct, IEntityViewComponent { - var opt = QueryEntityOptional(entitiesDB, obj.Id); + EGID id = group == ExclusiveGroupStruct.Invalid ? obj.Id : new EGID(obj.Id.entityID, group); + var opt = QueryEntityOptional(entitiesDB, id); if (opt) return ref opt.Get(); - if (obj.InitData.Valid) return ref obj.InitData.Initializer(obj.Id).GetOrCreate(); + if (obj.InitData.Valid) return ref obj.InitData.Initializer(id).GetOrCreate(); return ref opt.Get(); //Default value } } diff --git a/TechbloxModdingAPI/Utility/NativeApiExtensions.cs b/TechbloxModdingAPI/Utility/NativeApiExtensions.cs index adc9ee5..8ccb251 100644 --- a/TechbloxModdingAPI/Utility/NativeApiExtensions.cs +++ b/TechbloxModdingAPI/Utility/NativeApiExtensions.cs @@ -21,32 +21,36 @@ namespace TechbloxModdingAPI.Utility } /// - /// Attempts to query an entity and returns the result or a dummy value that can be modified. + /// Attempts to query an entity and returns the result in an optional reference. /// - /// - /// - /// - /// - public static OptionalRef QueryEntityOptional(this EntitiesDB entitiesDB, EcsObjectBase obj) + /// The entities DB to query from + /// The ECS object to query + /// The group of the entity if the object can have multiple + /// The component to query + /// A reference to the component or a dummy value + public static OptionalRef QueryEntityOptional(this EntitiesDB entitiesDB, EcsObjectBase obj, ExclusiveGroupStruct group = default) where T : unmanaged, IEntityComponent { - var opt = QueryEntityOptional(entitiesDB, obj.Id); + EGID id = group == ExclusiveGroupStruct.Invalid ? obj.Id : new EGID(obj.Id.entityID, group); + var opt = QueryEntityOptional(entitiesDB, id); return opt ? opt : new OptionalRef(obj, true); } /// /// Attempts to query an entity and returns the result or a dummy value that can be modified. /// - /// - /// - /// - /// - public static ref T QueryEntityOrDefault(this EntitiesDB entitiesDB, EcsObjectBase obj) + /// The entities DB to query from + /// The ECS object to query + /// The group of the entity if the object can have multiple + /// The component to query + /// A reference to the component or a dummy value + public static ref T QueryEntityOrDefault(this EntitiesDB entitiesDB, EcsObjectBase obj, ExclusiveGroupStruct group = default) where T : unmanaged, IEntityComponent { - var opt = QueryEntityOptional(entitiesDB, obj.Id); + EGID id = group == ExclusiveGroupStruct.Invalid ? obj.Id : new EGID(obj.Id.entityID, group); + var opt = QueryEntityOptional(entitiesDB, id); if (opt) return ref opt.Get(); - if (obj.InitData.Valid) return ref obj.InitData.Initializer(obj.Id).GetOrCreate(); + if (obj.InitData.Valid) return ref obj.InitData.Initializer(id).GetOrCreate(); return ref opt.Get(); //Default value } } diff --git a/TechbloxModdingAPI/Utility/WrappedHandler.cs b/TechbloxModdingAPI/Utility/WrappedHandler.cs new file mode 100644 index 0000000..57ff3ba --- /dev/null +++ b/TechbloxModdingAPI/Utility/WrappedHandler.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using TechbloxModdingAPI.Events; + +namespace TechbloxModdingAPI.Utility +{ + /// + /// Wraps the event handler in a try-catch block to avoid propagating exceptions. + /// + /// The event arguments type + public struct WrappedHandler + { + private EventHandler eventHandler; + + /// + /// Store wrappers so we can unregister them properly + /// + private static Dictionary, EventHandler> wrappers = + new Dictionary, EventHandler>(); + + public static WrappedHandler operator +(WrappedHandler original, EventHandler added) + { + EventHandler wrapped = (sender, e) => + { + try + { + added(sender, e); + } + catch (Exception e1) + { + EventRuntimeException wrappedException = + new EventRuntimeException($"EventHandler with arg type {typeof(T).Name} threw an exception", + e1); + Logging.LogWarning(wrappedException.ToString()); + } + }; + wrappers.Add(added, wrapped); + return new WrappedHandler { eventHandler = original.eventHandler + wrapped }; + } + + public static WrappedHandler operator -(WrappedHandler original, EventHandler removed) + { + if (!wrappers.TryGetValue(removed, out var wrapped)) return original; + wrappers.Remove(removed); + return new WrappedHandler { eventHandler = original.eventHandler - wrapped }; + } + + public void Invoke(object sender, T args) + { + eventHandler?.Invoke(sender, args); + } + } +} \ No newline at end of file -- 2.30.2 From 6204b226d17a936906ca46eb2ecf4d22b81d56f7 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Mon, 11 Oct 2021 01:26:35 +0200 Subject: [PATCH 216/252] Seat events, and everything needed to get there - Added support for seat enter and exit events and a test for them - Added support for entering and exiting seat from code - Changed the Id property of ECS objects to non-abstract, requiring it in the constructor, so that the Player class can inherit EcsObjectBase - Added a weird constructor to EcsObjectBase that allows running code to determine the object Id - Added interface for engines that receive entity functions - Exposed the entity submission scheduler and removed it from FullGameFields because it moved from there - Made the Game.Enter event only fire after the first entity submission so the game is fully initialized and the local player exists - Added all seat groups to the dictionary --- TechbloxModdingAPI/App/GameGameEngine.cs | 63 +++++++++---------- TechbloxModdingAPI/Block.cs | 28 +++++---- TechbloxModdingAPI/BlockGroup.cs | 5 +- TechbloxModdingAPI/Blocks/Wire.cs | 25 ++++---- TechbloxModdingAPI/Cluster.cs | 5 +- TechbloxModdingAPI/EcsObjectBase.cs | 26 +++++--- TechbloxModdingAPI/Engines/EnginePatches.cs | 3 + TechbloxModdingAPI/Engines/IFunEngine.cs | 9 +++ TechbloxModdingAPI/Player.Events.cs | 30 +++++++++ TechbloxModdingAPI/Player.cs | 59 +++++++++++------ TechbloxModdingAPI/Players/PlayerEngine.cs | 44 ++++++++++--- .../Players/PlayerEventsEngine.cs | 33 ++++++++++ TechbloxModdingAPI/Players/PlayerTests.cs | 35 ++++++++++- TechbloxModdingAPI/SimBody.cs | 5 +- .../Tests/TechbloxModdingAPIPluginTest.cs | 8 +++ TechbloxModdingAPI/Utility/FullGameFields.cs | 8 --- .../Utility/GameEngineManager.cs | 11 ++-- .../Utility/MenuEngineManager.cs | 15 +++-- 18 files changed, 284 insertions(+), 128 deletions(-) create mode 100644 TechbloxModdingAPI/Engines/IFunEngine.cs create mode 100644 TechbloxModdingAPI/Player.Events.cs create mode 100644 TechbloxModdingAPI/Players/PlayerEventsEngine.cs diff --git a/TechbloxModdingAPI/App/GameGameEngine.cs b/TechbloxModdingAPI/App/GameGameEngine.cs index a773d61..9ec648e 100644 --- a/TechbloxModdingAPI/App/GameGameEngine.cs +++ b/TechbloxModdingAPI/App/GameGameEngine.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using RobocraftX.Common; using RobocraftX.Schedulers; @@ -11,6 +10,7 @@ using RobocraftX.Blocks; using RobocraftX.ScreenshotTaker; using TechbloxModdingAPI.Blocks; using TechbloxModdingAPI.Engines; +using TechbloxModdingAPI.Tasks; using TechbloxModdingAPI.Utility; namespace TechbloxModdingAPI.App @@ -35,6 +35,12 @@ namespace TechbloxModdingAPI.App public void Ready() { + EnteringGame().RunOn(Scheduler.leanRunner); + } + + private IEnumerator EnteringGame() + { + yield return new WaitForSubmissionEnumerator(GameLoadedEnginePatch.Scheduler).Continue(); EnterGame.Invoke(this, new GameEventArgs { GameName = GameMode.SaveGameDetails.Name, GamePath = GameMode.SaveGameDetails.Folder }); IsInGame = true; } @@ -96,40 +102,29 @@ namespace TechbloxModdingAPI.App TimeRunningModeUtil.ToggleTimeRunningState(entitiesDB); } - public EGID[] GetAllBlocksInGame(BlockIDs filter = BlockIDs.Invalid) - { - var allBlocks = entitiesDB.QueryEntities(); - List blockEGIDs = new List(); - if (filter == BlockIDs.Invalid) - { - foreach (var (blocks, _) in allBlocks) - { - var buffer = blocks.ToBuffer().buffer; - for (int i = 0; i < buffer.capacity; i++) - blockEGIDs.Add(buffer[i].ID); - } + public EGID[] GetAllBlocksInGame(BlockIDs filter = BlockIDs.Invalid) + { + var allBlocks = entitiesDB.QueryEntities(); + List blockEGIDs = new List(); + foreach (var (blocks, _) in allBlocks) + { + var (buffer, count) = blocks.ToBuffer(); + for (int i = 0; i < count; i++) + { + uint dbid; + if (filter == BlockIDs.Invalid) + dbid = (uint)filter; + else + dbid = entitiesDB.QueryEntity(buffer[i].ID).DBID; + if (dbid == (ulong)filter) + blockEGIDs.Add(buffer[i].ID); + } + } - return blockEGIDs.ToArray(); - } - else - { - foreach (var (blocks, _) in allBlocks) - { - var array = blocks.ToBuffer().buffer; - for (var index = 0; index < array.capacity; index++) - { - var block = array[index]; - uint dbid = entitiesDB.QueryEntity(block.ID).DBID; - if (dbid == (ulong) filter) - blockEGIDs.Add(block.ID); - } - } + return blockEGIDs.ToArray(); + } - return blockEGIDs.ToArray(); - } - } - - public void EnableScreenshotTaker() + public void EnableScreenshotTaker() { ref var local = ref entitiesDB.QueryEntity(ScreenshotTakerEgids.ScreenshotTaker); if (local.enabled) diff --git a/TechbloxModdingAPI/Block.cs b/TechbloxModdingAPI/Block.cs index 2cd995b..d94817f 100644 --- a/TechbloxModdingAPI/Block.cs +++ b/TechbloxModdingAPI/Block.cs @@ -99,12 +99,16 @@ namespace TechbloxModdingAPI {CommonExclusiveGroups.ENGINE_BLOCK_BUILD_GROUP, (id => new Engine(id), typeof(Engine))}, {CommonExclusiveGroups.LOGIC_BLOCK_GROUP, (id => new LogicGate(id), typeof(LogicGate))}, {CommonExclusiveGroups.PISTON_BLOCK_GROUP, (id => new Piston(id), typeof(Piston))}, - {SeatGroups.PASSENGER_BLOCK_BUILD_GROUP, (id => new Seat(id), typeof(Seat))}, - {SeatGroups.PILOTSEAT_BLOCK_BUILD_GROUP, (id => new Seat(id), typeof(Seat))}, {CommonExclusiveGroups.SERVO_BLOCK_GROUP, (id => new Servo(id), typeof(Servo))}, {CommonExclusiveGroups.WHEELRIG_BLOCK_BUILD_GROUP, (id => new WheelRig(id), typeof(WheelRig))} }; + static Block() + { + foreach (var group in SeatGroups.SEATS_BLOCK_GROUPS) // Adds driver and passenger seats, occupied and unoccupied + GroupToConstructor.Add(group, (id => new Seat(id), typeof(Seat))); + } + /// /// Returns a correctly typed instance of this block. The instances are shared for a specific block. /// If an instance is no longer referenced a new instance is returned. @@ -126,9 +130,8 @@ namespace TechbloxModdingAPI : GetInstance(egid, e => new Block(e)); } - public Block(EGID id) + public Block(EGID id) : base(id) { - Id = id; Type expectedType; if (GroupToConstructor.ContainsKey(id.groupID) && !GetType().IsAssignableFrom(expectedType = GroupToConstructor[id.groupID].Type)) @@ -156,17 +159,18 @@ namespace TechbloxModdingAPI /// The player who placed the block /// Place even if not in build mode public Block(BlockIDs type, float3 position, bool autoWire = false, Player player = null, bool force = false) + : base(block => + { + if (!PlacementEngine.IsInGame || !GameState.IsBuildMode() && !force) + throw new BlockException("Blocks can only be placed in build mode."); + var initializer = PlacementEngine.PlaceBlock(type, position, player, autoWire); + block.InitData = initializer; + Placed += ((Block)block).OnPlacedInit; + return initializer.EGID; + }) { - if (!PlacementEngine.IsInGame || !GameState.IsBuildMode() && !force) - throw new BlockException("Blocks can only be placed in build mode."); - var initializer = PlacementEngine.PlaceBlock(type, position, player, autoWire); - Id = initializer.EGID; - InitData = initializer; - Placed += OnPlacedInit; } - public override EGID Id { get; } - private EGID copiedFrom; /// diff --git a/TechbloxModdingAPI/BlockGroup.cs b/TechbloxModdingAPI/BlockGroup.cs index 39233e8..b8943b8 100644 --- a/TechbloxModdingAPI/BlockGroup.cs +++ b/TechbloxModdingAPI/BlockGroup.cs @@ -19,17 +19,16 @@ namespace TechbloxModdingAPI public class BlockGroup : EcsObjectBase, ICollection, IDisposable { internal static BlueprintEngine _engine = new BlueprintEngine(); - public override EGID Id { get; } private readonly Block sourceBlock; private readonly List blocks; private float3 position, rotation; internal bool PosAndRotCalculated; - internal BlockGroup(int id, Block block) + internal BlockGroup(int id, Block block) : base(new EGID((uint)id, + BlockGroupExclusiveGroups.BlockGroupEntityGroup)) { if (id == BlockGroupUtility.GROUP_UNASSIGNED) throw new BlockException("Cannot create a block group for blocks without a group!"); - Id = new EGID((uint) id, BlockGroupExclusiveGroups.BlockGroupEntityGroup); sourceBlock = block; blocks = new List(GetBlocks()); Block.Removed += OnBlockRemoved; diff --git a/TechbloxModdingAPI/Blocks/Wire.cs b/TechbloxModdingAPI/Blocks/Wire.cs index 0c66557..e59312d 100644 --- a/TechbloxModdingAPI/Blocks/Wire.cs +++ b/TechbloxModdingAPI/Blocks/Wire.cs @@ -76,10 +76,11 @@ namespace TechbloxModdingAPI.Blocks /// Starting port number, or guess if omitted. /// Ending port number, or guess if omitted. /// Guessing failed or wire does not exist. - public Wire(Block start, Block end, byte startPort = Byte.MaxValue, byte endPort = Byte.MaxValue) + public Wire(Block start, Block end, byte startPort = Byte.MaxValue, byte endPort = Byte.MaxValue) : base(ecs => { - startBlockEGID = start.Id; - endBlockEGID = end.Id; + var th = (Wire)ecs; + th.startBlockEGID = start.Id; + th.endBlockEGID = end.Id; bool flipped = false; // find block ports EGID wire = signalEngine.MatchBlocksToWire(start.Id, end.Id, startPort, endPort); @@ -94,12 +95,16 @@ namespace TechbloxModdingAPI.Blocks if (wire != default) { - Construct(start.Id, end.Id, startPort, endPort, wire, flipped); + th.Construct(start.Id, end.Id, startPort, endPort, wire, flipped); } else { throw new WireInvalidException("Wire not found"); } + + return th.wireEGID; + }) + { } /// @@ -116,7 +121,7 @@ namespace TechbloxModdingAPI.Blocks { } - private Wire(EGID startBlock, EGID endBlock, byte startPort, byte endPort, EGID wire, bool inputToOutput) + private Wire(EGID startBlock, EGID endBlock, byte startPort, byte endPort, EGID wire, bool inputToOutput) : base(wire) { Construct(startBlock, endBlock, startPort, endPort, wire, inputToOutput); } @@ -139,7 +144,7 @@ namespace TechbloxModdingAPI.Blocks /// Construct a wire object from an existing wire connection. /// /// The wire ID. - public Wire(EGID wireEgid) + public Wire(EGID wireEgid) : base(wireEgid) { WireEntityStruct wire = signalEngine.GetWire(wireEGID); Construct(wire.sourceBlockEGID, wire.destinationBlockEGID, wire.sourcePortUsage, wire.destinationPortUsage, @@ -151,14 +156,6 @@ namespace TechbloxModdingAPI.Blocks { } - /// - /// The wire's in-game id. - /// - public override EGID Id - { - get => wireEGID; - } - /// /// The wire's signal value, as a float. /// diff --git a/TechbloxModdingAPI/Cluster.cs b/TechbloxModdingAPI/Cluster.cs index 2544194..f88cec9 100644 --- a/TechbloxModdingAPI/Cluster.cs +++ b/TechbloxModdingAPI/Cluster.cs @@ -10,11 +10,8 @@ namespace TechbloxModdingAPI /// public class Cluster : EcsObjectBase { - public override EGID Id { get; } - - public Cluster(EGID id) + public Cluster(EGID id) : base(id) { - Id = id; } public Cluster(uint id) : this(new EGID(id, CommonExclusiveGroups.SIMULATION_CLUSTERS_GROUP)) diff --git a/TechbloxModdingAPI/EcsObjectBase.cs b/TechbloxModdingAPI/EcsObjectBase.cs index f01561a..9698eaa 100644 --- a/TechbloxModdingAPI/EcsObjectBase.cs +++ b/TechbloxModdingAPI/EcsObjectBase.cs @@ -10,8 +10,8 @@ namespace TechbloxModdingAPI { public abstract class EcsObjectBase { - public abstract EGID Id { get; } //Abstract to support the 'place' Block constructor - + public EGID Id { get; } + private static readonly Dictionary> _instances = new Dictionary>(); @@ -39,7 +39,19 @@ namespace TechbloxModdingAPI return (T)instance; } - protected EcsObjectBase() + protected EcsObjectBase(EGID id) + { + if (!_instances.TryGetValue(GetType(), out var dict)) + { + dict = new WeakDictionary(); + _instances.Add(GetType(), dict); + } + if (!dict.ContainsKey(id)) // Multiple instances may be created + dict.Add(id, this); + Id = id; + } + + protected EcsObjectBase(Func initializer) { if (!_instances.TryGetValue(GetType(), out var dict)) { @@ -47,11 +59,9 @@ namespace TechbloxModdingAPI _instances.Add(GetType(), dict); } - // ReSharper disable VirtualMemberCallInConstructor - // The ID should not depend on the constructor - if (!dict.ContainsKey(Id)) // Multiple instances may be created - dict.Add(Id, this); - // ReSharper enable VirtualMemberCallInConstructor + var id = initializer(this); + if (!dict.ContainsKey(id)) // Multiple instances may be created + dict.Add(id, this); } #region ECS initializer stuff diff --git a/TechbloxModdingAPI/Engines/EnginePatches.cs b/TechbloxModdingAPI/Engines/EnginePatches.cs index f5774d9..8b6e6a5 100644 --- a/TechbloxModdingAPI/Engines/EnginePatches.cs +++ b/TechbloxModdingAPI/Engines/EnginePatches.cs @@ -5,6 +5,7 @@ using RobocraftX.CR.MainGame; using RobocraftX.FrontEnd; using RobocraftX.StateSync; using Svelto.ECS; +using Svelto.ECS.Schedulers; using TechbloxModdingAPI.Utility; namespace TechbloxModdingAPI.Engines @@ -12,10 +13,12 @@ namespace TechbloxModdingAPI.Engines [HarmonyPatch] class GameLoadedEnginePatch { + public static EntitiesSubmissionScheduler Scheduler { get; private set; } public static void Postfix(StateSyncRegistrationHelper stateSyncReg) { // register all game engines, including deterministic GameEngineManager.RegisterEngines(stateSyncReg); + Scheduler = stateSyncReg.enginesRoot.scheduler; } public static MethodBase TargetMethod() diff --git a/TechbloxModdingAPI/Engines/IFunEngine.cs b/TechbloxModdingAPI/Engines/IFunEngine.cs new file mode 100644 index 0000000..d9ee7fe --- /dev/null +++ b/TechbloxModdingAPI/Engines/IFunEngine.cs @@ -0,0 +1,9 @@ +using Svelto.ECS; + +namespace TechbloxModdingAPI.Engines +{ + public interface IFunEngine : IApiEngine + { + public IEntityFunctions Functions { set; } + } +} \ No newline at end of file diff --git a/TechbloxModdingAPI/Player.Events.cs b/TechbloxModdingAPI/Player.Events.cs new file mode 100644 index 0000000..1a07c36 --- /dev/null +++ b/TechbloxModdingAPI/Player.Events.cs @@ -0,0 +1,30 @@ +using System; +using Svelto.ECS; +using TechbloxModdingAPI.Blocks; +using TechbloxModdingAPI.Utility; + +namespace TechbloxModdingAPI +{ + public partial class Player + { + internal WrappedHandler seatEntered; + public event EventHandler SeatEntered + { + add => seatEntered += value; + remove => seatEntered -= value; + } + + internal WrappedHandler seatExited; + public event EventHandler SeatExited + { + add => seatExited += value; + remove => seatExited -= value; + } + } + + public struct PlayerSeatEventArgs + { + public EGID SeatId; + public Seat Seat => (Seat)Block.New(SeatId); + } +} \ No newline at end of file diff --git a/TechbloxModdingAPI/Player.cs b/TechbloxModdingAPI/Player.cs index 3dad9ea..4f5607a 100644 --- a/TechbloxModdingAPI/Player.cs +++ b/TechbloxModdingAPI/Player.cs @@ -20,10 +20,11 @@ namespace TechbloxModdingAPI /// /// An in-game player character. Any Leo you see is a player. /// - public class Player : IEquatable, IEquatable - { //TODO: Inherit EcsObjectBase and make Id an EGID, useful for caching + public partial class Player : EcsObjectBase, IEquatable, IEquatable + { // static functionality private static PlayerEngine playerEngine = new PlayerEngine(); + private static PlayerEventsEngine playerEventsEngine = new PlayerEventsEngine(); private static Player localPlayer; /// @@ -79,7 +80,7 @@ namespace TechbloxModdingAPI /// Initializes a new instance of the class. /// /// The player's unique identifier. - public Player(uint id) + public Player(uint id) : base(new EGID(id, CharacterExclusiveGroups.OnFootGroup)) { this.Id = id; if (!Exists(id)) @@ -93,22 +94,31 @@ namespace TechbloxModdingAPI /// Initializes a new instance of the class. /// /// The player type. Chooses the first available player matching the criteria. - public Player(PlayerType player) + public Player(PlayerType player) : base(ecs => { - switch (player) - { - case PlayerType.Local: - this.Id = playerEngine.GetLocalPlayer(); - break; - case PlayerType.Remote: - this.Id = playerEngine.GetRemotePlayer(); - break; - } - if (this.Id == uint.MaxValue) - { - throw new PlayerNotFoundException($"No player of {player} type exists"); - } - this.Type = player; + uint id; + switch (player) + { + case PlayerType.Local: + id = playerEngine.GetLocalPlayer(); + break; + case PlayerType.Remote: + id = playerEngine.GetRemotePlayer(); + break; + default: + id = uint.MaxValue; + break; + } + + if (id == uint.MaxValue) + { + throw new PlayerNotFoundException($"No player of {player} type exists"); + } + + return new EGID(id, CharacterExclusiveGroups.OnFootGroup); + }) + { + this.Type = player; } // object fields & properties @@ -124,7 +134,7 @@ namespace TechbloxModdingAPI /// The player's unique identifier. /// /// The identifier. - public uint Id { get; } + public new uint Id { get; } /// /// The player's current position. @@ -424,6 +434,16 @@ namespace TechbloxModdingAPI } playerEngine.SetLocation(Id, location, exitSeat: exitSeat); } + + public void EnterSeat(Seat seat) + { + playerEngine.EnterSeat(Id, seat.Id); + } + + public void ExitSeat() + { + playerEngine.ExitSeat(Id); + } /// /// Returns the block the player is currently looking at in build mode. @@ -507,6 +527,7 @@ namespace TechbloxModdingAPI internal static void Init() { Utility.GameEngineManager.AddGameEngine(playerEngine); + Utility.GameEngineManager.AddGameEngine(playerEventsEngine); } } } diff --git a/TechbloxModdingAPI/Players/PlayerEngine.cs b/TechbloxModdingAPI/Players/PlayerEngine.cs index bb13308..0dc2298 100644 --- a/TechbloxModdingAPI/Players/PlayerEngine.cs +++ b/TechbloxModdingAPI/Players/PlayerEngine.cs @@ -1,4 +1,5 @@ -using System.Runtime.CompilerServices; +using System; +using System.Runtime.CompilerServices; using RobocraftX.Character; using RobocraftX.Character.Movement; @@ -8,10 +9,13 @@ using RobocraftX.CR.MachineEditing.BoxSelect; using RobocraftX.Physics; using RobocraftX.Blocks.Ghost; using Gamecraft.GUI.HUDFeedbackBlocks; +using RobocraftX.Blocks; +using RobocraftX.PilotSeat; using Svelto.ECS; using Techblox.Camera; using Unity.Mathematics; using Svelto.ECS.DataStructures; +using Svelto.ECS.EntityStructs; using Techblox.BuildingDrone; using TechbloxModdingAPI.Engines; @@ -19,7 +23,7 @@ using TechbloxModdingAPI.Utility; namespace TechbloxModdingAPI.Players { - internal class PlayerEngine : IApiEngine, IFactoryEngine + internal class PlayerEngine : IFunEngine { public string Name { get; } = "TechbloxModdingAPIPlayerGameEngine"; @@ -27,7 +31,7 @@ namespace TechbloxModdingAPI.Players public bool isRemovable => false; - public IEntityFactory Factory { set; private get; } + public IEntityFunctions Functions { get; set; } private bool isReady = false; @@ -101,9 +105,7 @@ namespace TechbloxModdingAPI.Players return false; if (group == CharacterExclusiveGroups.InPilotSeatGroup && exitSeat) { - EGID egid = new EGID(playerId, group); - entitiesDB.QueryEntity(egid).instantExit = true; - entitiesDB.PublishEntityChange(egid); + ExitSeat(playerId); } rbesOpt.Get().position = location; return true; @@ -183,12 +185,12 @@ namespace TechbloxModdingAPI.Players { if (!entitiesDB.Exists(playerid, BoxSelectExclusiveGroups.BoxSelectVolumeExclusiveGroup)) - return new Block[0]; + return Array.Empty(); var state = entitiesDB.QueryEntity(playerid, BoxSelectExclusiveGroups.BoxSelectVolumeExclusiveGroup); var blocks = entitiesDB.QueryEntity(playerid, BoxSelectExclusiveGroups.BoxSelectVolumeExclusiveGroup); - if (!state.active) return new Block[0]; + if (!state.active) return Array.Empty(); var pointer = (EGID*) blocks.selectedBlocks.ToPointer(); var ret = new Block[blocks.count]; for (int j = 0; j < blocks.count; j++) @@ -199,5 +201,31 @@ namespace TechbloxModdingAPI.Players return ret; } + + public void EnterSeat(uint playerId, EGID seatId) + { + PilotSeatGroupUtils.SwapTagTo(Functions, seatId); + var opt = GetCharacterStruct(playerId, out var group); + if (!opt) return; + ref CharacterPilotSeatEntityStruct charSeat = ref opt.Get(); + var charId = new EGID(playerId, group); + charSeat.pilotSeatEntity = entitiesDB.GetEntityReference(seatId); + charSeat.entryPositionOffset = + entitiesDB.QueryEntity(charId).position - + entitiesDB.QueryEntity(seatId).position; + ref var seat = ref entitiesDB.QueryEntity(seatId); + seat.occupyingCharacter = entitiesDB.GetEntityReference(charId); + charSeat.followCam = entitiesDB.QueryEntity(seatId).followCam; + Functions.SwapEntityGroup(charId, CharacterExclusiveGroups.InPilotSeatGroup); + } + + public void ExitSeat(uint playerId) + { + EGID egid = new EGID(playerId, CharacterExclusiveGroups.InPilotSeatGroup); + var opt = entitiesDB.QueryEntityOptional(egid); + if (!opt) return; + opt.Get().instantExit = true; + entitiesDB.PublishEntityChange(egid); + } } } diff --git a/TechbloxModdingAPI/Players/PlayerEventsEngine.cs b/TechbloxModdingAPI/Players/PlayerEventsEngine.cs new file mode 100644 index 0000000..2c80f24 --- /dev/null +++ b/TechbloxModdingAPI/Players/PlayerEventsEngine.cs @@ -0,0 +1,33 @@ +using RobocraftX.Character; +using RobocraftX.Character.Movement; +using Svelto.ECS; +using TechbloxModdingAPI.Engines; + +namespace TechbloxModdingAPI.Players +{ + public class PlayerEventsEngine : IApiEngine, IReactOnSwap + { + public void Ready() + { + } + + public EntitiesDB entitiesDB { get; set; } + public void Dispose() + { + } + + public string Name => "TechbloxModdingAPIPlayerEventsEngine"; + public bool isRemovable => false; + + public void MovedTo(ref CharacterPilotSeatEntityStruct entityComponent, ExclusiveGroupStruct previousGroup, EGID egid) + { + var seatId = entityComponent.pilotSeatEntity.ToEGID(entitiesDB); + var player = EcsObjectBase.GetInstance(new EGID(egid.entityID, CharacterExclusiveGroups.OnFootGroup), + e => new Player(e.entityID)); + if (previousGroup == CharacterExclusiveGroups.InPilotSeatGroup) + player.seatExited.Invoke(this, new PlayerSeatEventArgs { SeatId = seatId}); + else if (egid.groupID == CharacterExclusiveGroups.InPilotSeatGroup) + player.seatEntered.Invoke(this, new PlayerSeatEventArgs { SeatId = seatId }); + } + } +} \ No newline at end of file diff --git a/TechbloxModdingAPI/Players/PlayerTests.cs b/TechbloxModdingAPI/Players/PlayerTests.cs index 8086d96..c974518 100644 --- a/TechbloxModdingAPI/Players/PlayerTests.cs +++ b/TechbloxModdingAPI/Players/PlayerTests.cs @@ -1,8 +1,11 @@ -using System; +using System.Collections.Generic; +using Svelto.Tasks; +using Svelto.Tasks.Enumerators; using Unity.Mathematics; -using TechbloxModdingAPI; +using TechbloxModdingAPI.App; +using TechbloxModdingAPI.Blocks; using TechbloxModdingAPI.Tests; namespace TechbloxModdingAPI.Players @@ -30,6 +33,34 @@ namespace TechbloxModdingAPI.Players if (!Assert.Errorless(() => { p.Position = float3.zero + 1; }, "Player.Position = origin+1 errored: ", "Player moved to origin+1.")) return; Assert.CloseTo(p.Position, float3.zero + 1, "Player is not close to origin+1 despite being teleported there.", "Player.Position is at origin+1."); } + + [APITestCase(TestType.Game)] + public static void SeatEventTestBuild() + { + Player.LocalPlayer.SeatEntered += Assert.CallsBack("SeatEntered"); + Player.LocalPlayer.SeatExited += Assert.CallsBack("SeatExited"); + Block.PlaceNew(BlockIDs.DriverSeat, -1f); + } + + [APITestCase(TestType.SimulationMode)] + public static IEnumerator SeatEventTestSim() + { + var seats = Game.CurrentGame().GetBlocksInGame(BlockIDs.DriverSeat); + if (seats.Length == 0) + { + Assert.Fail("No driver seat found!"); + yield break; + } + + if (seats[0] is Seat seat) + Assert.Errorless(() => Player.LocalPlayer.EnterSeat(seat), "Failed to enter seat.", + "Entered seat successfully."); + else + Assert.Fail("Found a seat that is not a seat!"); + yield return new WaitForSecondsEnumerator(1).Continue(); + Assert.Errorless(() => Player.LocalPlayer.ExitSeat(), "Failed to exit seat.", + "Exited seat successfully."); + } [APITestCase(TestType.Menu)] public static void InvalidStateTest() diff --git a/TechbloxModdingAPI/SimBody.cs b/TechbloxModdingAPI/SimBody.cs index 2f2f8b6..bb05005 100644 --- a/TechbloxModdingAPI/SimBody.cs +++ b/TechbloxModdingAPI/SimBody.cs @@ -14,8 +14,6 @@ namespace TechbloxModdingAPI /// public class SimBody : EcsObjectBase, IEquatable, IEquatable { - public override EGID Id { get; } - /// /// The cluster this chunk belongs to, or null if no cluster destruction manager present or the chunk doesn't exist. /// Get the SimBody from a Block if possible for good performance here. @@ -28,9 +26,8 @@ namespace TechbloxModdingAPI private Cluster cluster; private readonly uint clusterId = uint.MaxValue; - public SimBody(EGID id) + public SimBody(EGID id) : base(id) { - Id = id; } public SimBody(uint id) : this(new EGID(id, CommonExclusiveGroups.SIMULATION_BODIES_GROUP)) diff --git a/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs b/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs index dd1d2b3..4c648eb 100644 --- a/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs +++ b/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs @@ -58,6 +58,14 @@ namespace TechbloxModdingAPI.Tests // debug/test handlers Client.EnterMenu += (sender, args) => throw new Exception("Test handler always throws an exception!"); + Client.EnterMenu += (sender, args) => Console.WriteLine("EnterMenu handler after erroring handler"); + Game.Enter += (s, a) => + { + Player.LocalPlayer.SeatEntered += (sender, args) => + Console.WriteLine($"Player {Player.LocalPlayer} entered seat {args.Seat}"); + Player.LocalPlayer.SeatExited += (sender, args) => + Console.WriteLine($"Player {Player.LocalPlayer} exited seat {args.Seat}"); + }; // debug/test commands if (Dependency.Hell("ExtraCommands")) diff --git a/TechbloxModdingAPI/Utility/FullGameFields.cs b/TechbloxModdingAPI/Utility/FullGameFields.cs index e27f501..0a4dd1d 100644 --- a/TechbloxModdingAPI/Utility/FullGameFields.cs +++ b/TechbloxModdingAPI/Utility/FullGameFields.cs @@ -72,14 +72,6 @@ namespace TechbloxModdingAPI.Utility } } - public static SimpleEntitiesSubmissionScheduler _mainGameSubmissionScheduler - { - get - { - return (SimpleEntitiesSubmissionScheduler)fgcr?.Field("_sub").Field("_mainGameSubmissionScheduler").GetValue(); - } - } - public static BuildPhysicsWorld _physicsWorldSystem { get diff --git a/TechbloxModdingAPI/Utility/GameEngineManager.cs b/TechbloxModdingAPI/Utility/GameEngineManager.cs index fc51861..16bf4e2 100644 --- a/TechbloxModdingAPI/Utility/GameEngineManager.cs +++ b/TechbloxModdingAPI/Utility/GameEngineManager.cs @@ -26,10 +26,10 @@ namespace TechbloxModdingAPI.Utility { Logging.MetaDebugLog($"Registering Game IApiEngine {engine.Name}"); _lastEngineRoot.AddEngine(engine); - if (typeof(IFactoryEngine).IsAssignableFrom(engine.GetType())) - { - ((IFactoryEngine)engine).Factory = _lastEngineRoot.GenerateEntityFactory(); - } + if (engine is IFactoryEngine factoryEngine) + factoryEngine.Factory = _lastEngineRoot.GenerateEntityFactory(); + if (engine is IFunEngine funEngine) + funEngine.Functions = _lastEngineRoot.GenerateEntityFunctions(); } } @@ -66,6 +66,7 @@ namespace TechbloxModdingAPI.Utility var enginesRoot = helper.enginesRoot; _lastEngineRoot = enginesRoot; IEntityFactory factory = enginesRoot.GenerateEntityFactory(); + IEntityFunctions functions = enginesRoot.GenerateEntityFunctions(); foreach (var key in _gameEngines.Keys) { Logging.MetaDebugLog($"Registering Game IApiEngine {_gameEngines[key].Name}"); @@ -75,6 +76,8 @@ namespace TechbloxModdingAPI.Utility enginesRoot.AddEngine(_gameEngines[key]); if (_gameEngines[key] is IFactoryEngine factEngine) factEngine.Factory = factory; + if (_gameEngines[key] is IFunEngine funEngine) + funEngine.Functions = functions; } } } diff --git a/TechbloxModdingAPI/Utility/MenuEngineManager.cs b/TechbloxModdingAPI/Utility/MenuEngineManager.cs index 3260563..4358ca8 100644 --- a/TechbloxModdingAPI/Utility/MenuEngineManager.cs +++ b/TechbloxModdingAPI/Utility/MenuEngineManager.cs @@ -26,10 +26,10 @@ namespace TechbloxModdingAPI.Utility { Logging.MetaDebugLog($"Registering Menu IApiEngine {engine.Name}"); _lastEngineRoot.AddEngine(engine); - if (typeof(IFactoryEngine).IsAssignableFrom(engine.GetType())) - { - ((IFactoryEngine)engine).Factory = _lastEngineRoot.GenerateEntityFactory(); - } + if (engine is IFactoryEngine factoryEngine) + factoryEngine.Factory = _lastEngineRoot.GenerateEntityFactory(); + if (engine is IFunEngine funEngine) + funEngine.Functions = _lastEngineRoot.GenerateEntityFunctions(); } } @@ -65,14 +65,13 @@ namespace TechbloxModdingAPI.Utility { _lastEngineRoot = enginesRoot; IEntityFactory factory = enginesRoot.GenerateEntityFactory(); + IEntityFunctions functions = enginesRoot.GenerateEntityFunctions(); foreach (var key in _menuEngines.Keys) { Logging.MetaDebugLog($"Registering Menu IApiEngine {_menuEngines[key].Name}"); enginesRoot.AddEngine(_menuEngines[key]); - if (_menuEngines[key] is IFactoryEngine factEngine) - { - factEngine.Factory = factory; - } + if (_menuEngines[key] is IFactoryEngine factEngine) factEngine.Factory = factory; + if(_menuEngines[key] is IFunEngine funEngine) funEngine.Functions = functions; } } } -- 2.30.2 From 619a5003cf9e1b771ee857895dec68d80cd53cfa Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Thu, 4 Nov 2021 20:45:21 +0100 Subject: [PATCH 217/252] Update to Techblox 2021.11.03.15.56 Save game details were changed, they may not work properly Game mode change event no longer sends game data, needs fixing --- TechbloxModdingAPI/App/Game.cs | 22 +--- .../App/GameBuildSimEventEngine.cs | 4 +- TechbloxModdingAPI/App/GameGameEngine.cs | 10 +- TechbloxModdingAPI/App/GameMenuEngine.cs | 15 ++- TechbloxModdingAPI/Block.cs | 9 +- TechbloxModdingAPI/Blocks/BlockIDs.cs | 120 +++++++++++++++++- TechbloxModdingAPI/Blocks/BlockMaterial.cs | 17 ++- .../Blocks/Engines/BlueprintEngine.cs | 75 +++++++++++ TechbloxModdingAPI/Commands/CommandPatch.cs | 5 +- TechbloxModdingAPI/Player.cs | 2 +- TechbloxModdingAPI/TechbloxModdingAPI.csproj | 68 +++++++++- .../Tests/TechbloxModdingAPIPluginTest.cs | 16 ++- .../Utility/NativeApiExtensions.cs | 5 + 13 files changed, 321 insertions(+), 47 deletions(-) diff --git a/TechbloxModdingAPI/App/Game.cs b/TechbloxModdingAPI/App/Game.cs index ad7ba33..56854b6 100644 --- a/TechbloxModdingAPI/App/Game.cs +++ b/TechbloxModdingAPI/App/Game.cs @@ -165,7 +165,7 @@ namespace TechbloxModdingAPI.App { if (!VerifyMode()) return null; if (menuMode) return menuEngine.GetGameInfo(EGID).GameName; - return GameMode.SaveGameDetails.Name; + return gameEngine.GetGameData().saveName; } set @@ -174,11 +174,7 @@ namespace TechbloxModdingAPI.App if (menuMode) { menuEngine.SetGameName(EGID, value); - } - else - { - GameMode.SaveGameDetails.Name = value; - } + } // Save details are directly saved from user input or not changed at all when in game } } @@ -201,11 +197,7 @@ namespace TechbloxModdingAPI.App if (menuMode) { menuEngine.SetGameDescription(EGID, value); - } - else - { - // No description exists in-game - } + } // No description exists in-game } } @@ -219,7 +211,7 @@ namespace TechbloxModdingAPI.App { if (!VerifyMode()) return null; if (menuMode) return menuEngine.GetGameInfo(EGID).SavedGamePath; - return GameMode.SaveGameDetails.Folder; + return gameEngine.GetGameData().gameID; } set @@ -229,12 +221,6 @@ namespace TechbloxModdingAPI.App { menuEngine.GetGameInfo(EGID).SavedGamePath.Set(value); } - else - { - // this likely breaks things - GameMode.SaveGameDetails = new SaveGameDetails(GameMode.SaveGameDetails.Id, - GameMode.SaveGameDetails.SaveMode, GameMode.SaveGameDetails.Name, value); - } } } diff --git a/TechbloxModdingAPI/App/GameBuildSimEventEngine.cs b/TechbloxModdingAPI/App/GameBuildSimEventEngine.cs index d4697ff..67e6769 100644 --- a/TechbloxModdingAPI/App/GameBuildSimEventEngine.cs +++ b/TechbloxModdingAPI/App/GameBuildSimEventEngine.cs @@ -27,13 +27,13 @@ namespace TechbloxModdingAPI.App public JobHandle OnInitializeTimeRunningMode(JobHandle inputDeps) { - SimulationMode.Invoke(this, new GameEventArgs { GameName = GameMode.SaveGameDetails.Name, GamePath = GameMode.SaveGameDetails.Folder }); + SimulationMode.Invoke(this, new GameEventArgs { GameName = "", GamePath = "" }); // TODO return inputDeps; } public JobHandle OnInitializeTimeStoppedMode(JobHandle inputDeps) { - BuildMode.Invoke(this, new GameEventArgs { GameName = GameMode.SaveGameDetails.Name, GamePath = GameMode.SaveGameDetails.Folder }); + BuildMode.Invoke(this, new GameEventArgs { GameName = "", GamePath = "" }); return inputDeps; } } diff --git a/TechbloxModdingAPI/App/GameGameEngine.cs b/TechbloxModdingAPI/App/GameGameEngine.cs index 9ec648e..f1ec8e7 100644 --- a/TechbloxModdingAPI/App/GameGameEngine.cs +++ b/TechbloxModdingAPI/App/GameGameEngine.cs @@ -8,6 +8,7 @@ using Svelto.Tasks; using Svelto.Tasks.Lean; using RobocraftX.Blocks; using RobocraftX.ScreenshotTaker; +using Techblox.GameSelection; using TechbloxModdingAPI.Blocks; using TechbloxModdingAPI.Engines; using TechbloxModdingAPI.Tasks; @@ -29,7 +30,7 @@ namespace TechbloxModdingAPI.App public void Dispose() { - ExitGame.Invoke(this, new GameEventArgs { GameName = GameMode.SaveGameDetails.Name, GamePath = GameMode.SaveGameDetails.Folder }); + ExitGame.Invoke(this, new GameEventArgs { GameName = GetGameData().saveName, GamePath = GetGameData().gameID }); IsInGame = false; } @@ -41,7 +42,7 @@ namespace TechbloxModdingAPI.App private IEnumerator EnteringGame() { yield return new WaitForSubmissionEnumerator(GameLoadedEnginePatch.Scheduler).Continue(); - EnterGame.Invoke(this, new GameEventArgs { GameName = GameMode.SaveGameDetails.Name, GamePath = GameMode.SaveGameDetails.Folder }); + EnterGame.Invoke(this, new GameEventArgs { GameName = GetGameData().saveName, GamePath = GetGameData().gameID }); IsInGame = true; } @@ -132,5 +133,10 @@ namespace TechbloxModdingAPI.App local.enabled = true; entitiesDB.PublishEntityChange(ScreenshotTakerEgids.ScreenshotTaker); } + + public GameSelectionComponent GetGameData() + { + return entitiesDB.QueryEntity(GameSelectionConstants.GameSelectionEGID); + } } } diff --git a/TechbloxModdingAPI/App/GameMenuEngine.cs b/TechbloxModdingAPI/App/GameMenuEngine.cs index 9d8e448..2f65016 100644 --- a/TechbloxModdingAPI/App/GameMenuEngine.cs +++ b/TechbloxModdingAPI/App/GameMenuEngine.cs @@ -7,9 +7,10 @@ using RobocraftX.GUI; using RobocraftX.GUI.MyGamesScreen; using Svelto.ECS; using Svelto.ECS.Experimental; -using Techblox.Services.Machines; +using Techblox.GameSelection; using TechbloxModdingAPI.Engines; using TechbloxModdingAPI.Utility; +using GameMode = RobocraftX.Common.GameMode; namespace TechbloxModdingAPI.App { @@ -82,10 +83,16 @@ namespace TechbloxModdingAPI.App public bool EnterGame(string gameName, string path, bool autoEnterSim = false) { GameMode.CurrentMode = autoEnterSim ? RCXMode.Play : RCXMode.Build; - GameMode.SaveGameDetails = new SaveGameDetails(MachineStorageId.CreateNew().ToString(), - SaveGameMode.NewSave, gameName, path); + var data = new GameSelectionData + { + gameMode = Techblox.GameSelection.GameMode.PlayGame, + gameType = GameType.MachineEditor, + saveName = gameName, + saveType = SaveType.ExistingSave, + gameID = path + }; // the private FullGameCompositionRoot.SwitchToGame() method gets passed to menu items for this reason - AccessTools.Method(typeof(FullGameCompositionRoot), "SwitchToGame").Invoke(FullGameFields.Instance, Array.Empty()); + AccessTools.Method(typeof(FullGameCompositionRoot), "SwitchToGame").Invoke(FullGameFields.Instance, new object[]{data}); return true; } diff --git a/TechbloxModdingAPI/Block.cs b/TechbloxModdingAPI/Block.cs index d94817f..c2f8dd8 100644 --- a/TechbloxModdingAPI/Block.cs +++ b/TechbloxModdingAPI/Block.cs @@ -74,6 +74,11 @@ namespace TechbloxModdingAPI return egid.HasValue ? New(egid.Value) : null; } + /*public static Block CreateGhostBlock() + { + return BlockGroup._engine.BuildGhostChild(); + }*/ + /// /// An event that fires each time a block is placed. /// @@ -381,8 +386,8 @@ namespace TechbloxModdingAPI /// public bool Static { - get => BlockEngine.GetBlockInfo(this).staticIfUnconnected; - set => BlockEngine.GetBlockInfo(this).staticIfUnconnected = value; + get => false; + set { } } /// diff --git a/TechbloxModdingAPI/Blocks/BlockIDs.cs b/TechbloxModdingAPI/Blocks/BlockIDs.cs index 09016aa..e454c40 100644 --- a/TechbloxModdingAPI/Blocks/BlockIDs.cs +++ b/TechbloxModdingAPI/Blocks/BlockIDs.cs @@ -151,22 +151,128 @@ namespace TechbloxModdingAPI.Blocks HatchbackWheelArch, HatchbackArchSmallFlare, HatchbackArchFlare, - TruckWheel = 246, + CeilingStripLight, + CardboardBox, + BarrierRail, + BarrierRailEnd, + TruckWheel, HatchbackWheelWideProfile, TruckWheelRigWithSteering = 249, TruckWheelRigNoSteering, HatchbackDriverSeat, HatchbackPassengerSeat, FormulaEngine, - TruckWheelDouble = 261, + SmallGrass, + SmallGrassRoad, + GrassBridge, + SmallGrassTurn, + MediumGrassTurn, + LargeGrassTurn, + ExtraLargeGrassTurn, + TruckWheelDouble, TruckWheelArch, TruckArchSingleFlare, - FormulaWheel = 270, + WoodenDoorWithWindow, + TyreBarrierCorner, + TyreBarrierEdge, + TyreBarrierCenter, + AppleTree, + AppleForestTree, + FormulaWheel, FormulaWheelRear, - FormulaSeat = 277, - MonsterTruckWheel = 285, - MonsterTruckEngine = 290, - MonsterTruckWheelRigNoSteering = 350, + AppleSapling, + GrassHill, + GrassHillInnerCorner, + GrassHillOuterCorner, + GrassRoadHill, + FormulaSeat, + SmallDirt, + SmallDirtRoad, + SmallDirtTurn, + MediumDirtTurn, + LargeDirtTurn, + ExtraLargeDirtTurn, + SmallGrid, + MonsterTruckWheel, + SmallGrassGridStart, + SmallGrassRumbleStripRoad, + SmallGrassRumbleStripEndRoad, + SmallGrassStartLine, + MonsterTruckEngine, + DirtHill, + DirtHillInnerCorner, + DirtHillOuterCorner, + BuildingWindowEdge, + BuildingWindowCorner, + BuildingWindowStraight, + BuildingWindowTJunction, + BuildingWindowCross, + BuildingWindowEdgeSill, + BuildingWindowCornerSill, + BuildingWindowTJunctionSill, + Broadleaf, + ForestBroadleaf, + AzaleaBush, + AzaleaFlowers1, + AzaleaFlowers2, + TreeStump1, + TreeStump2, + FieldJuniper, + ForestJuniper, + JuniperSapling, + JuniperSeedling, + FieldRedMaple, + RedMapleForest1, + RedMapleForest2, + RedMapleSapling, + FieldWhiteSpruce, + ForestWhiteSpruce, + WhiteSpruceSapling, + GirderBase, + GirderStraight, + GirderDiagonal, + GirderCorner, + PostBase, + PostStraight, + PostLShape, + PostTJunction, + PostCross, + PostCorner, + PostDiagonal, + DirtRock1, + DirtRock2, + DirtRock3, + DirtRock4, + DirtRoadHill, + WoodenPalette, + ElderberryBush, + BarrelCactus, + KnapweedFlower, + MarigoldFlowers, + TrampledBushyBluestep, + RoughGrass, + DogRose, + WesternSwordFern, + BackyardGrass, + ThickGrass, + FireExtinguisher, + DirtLowRamp, + DirtTabletopRamp, + MonsterTruckWheelRigNoSteering, MonsterTruckWheelRigWithSteering, + MeadowCloudyDayAtmosphere, + BarrierRailDiagonal, + DirtHighRamp, + GrassRock1, + GrassRock2, + GrassRock3, + GrassRock4, + GreenFieldsSunnyDayAtmosphere, + RedMountainsDawnAtmosphere, + HighFantasySunriseAtmosphere, + /// + /// The grid block used by the world editor, named Small Grid like the other one + /// + SmallGridInWorldEditor } } \ No newline at end of file diff --git a/TechbloxModdingAPI/Blocks/BlockMaterial.cs b/TechbloxModdingAPI/Blocks/BlockMaterial.cs index 7093066..777845a 100644 --- a/TechbloxModdingAPI/Blocks/BlockMaterial.cs +++ b/TechbloxModdingAPI/Blocks/BlockMaterial.cs @@ -15,6 +15,21 @@ namespace TechbloxModdingAPI.Blocks SteelBodyworkRustedPaint, SteelBodyworkHeavyRust, WoodVarnishedDark, - Chrome + Chrome, + FenceChainLink, + ConcreteUnpainted, + Grid9x9, + CeramicTileFloor, + PlasticBumpy, + PlasticDustySmeared, + AluminiumGarageDoor, + SteelRigidScratched, + AluminiumBrushedTinted, + AluminiumSheetStained, + ConcretePaintedGrooves, + PlasticSpecklySatin, + SteelBodyworkPaintedChipped, + WoodPainted, + WoodRoughGrungy, } } \ No newline at end of file diff --git a/TechbloxModdingAPI/Blocks/Engines/BlueprintEngine.cs b/TechbloxModdingAPI/Blocks/Engines/BlueprintEngine.cs index 4bc5f5d..51b9f4c 100644 --- a/TechbloxModdingAPI/Blocks/Engines/BlueprintEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/BlueprintEngine.cs @@ -5,15 +5,20 @@ using Gamecraft.Blocks.BlockGroups; using Gamecraft.GUI.Blueprints; using HarmonyLib; using RobocraftX.Blocks; +using RobocraftX.Blocks.Ghost; using RobocraftX.Common; using RobocraftX.CR.MachineEditing.BoxSelect; using RobocraftX.CR.MachineEditing.BoxSelect.ClipboardOperations; +using RobocraftX.Physics; +using RobocraftX.Rendering; +using RobocraftX.Rendering.GPUI; using Svelto.DataStructures; using Svelto.ECS; using Svelto.ECS.DataStructures; using Svelto.ECS.EntityStructs; using Svelto.ECS.Native; using Svelto.ECS.Serialization; +using Techblox.Blocks; using TechbloxModdingAPI.Engines; using TechbloxModdingAPI.Utility; using Unity.Collections; @@ -252,6 +257,76 @@ namespace TechbloxModdingAPI.Blocks.Engines { clipboardManager.DecrementRefCount(blueprintID); } + + + //GhostChildUtility.BuildGhostChild + public Block BuildGhostChild() + { + var sourceId = new EGID(Player.LocalPlayer.Id, GHOST_BLOCKS_ENABLED.Group); + var positionEntityStruct = entitiesDB.QueryEntity(sourceId); + var rotationEntityStruct = entitiesDB.QueryEntity(sourceId); + var scalingEntityStruct = entitiesDB.QueryEntity(sourceId); + var dbStruct = entitiesDB.QueryEntity(sourceId); + var colliderStruct = entitiesDB.QueryEntity(sourceId); + var colorStruct = entitiesDB.QueryEntity(sourceId); + uint ghostChildBlockId = CommonExclusiveGroups.GetNewGhostChildBlockID(); + var ghostEntityReference = GhostBlockUtils.GetGhostEntityReference(sourceId.entityID, entitiesDB); + var entityInitializer = BuildGhostBlueprintFactory.Build( + new EGID(ghostChildBlockId, BoxSelectExclusiveGroups.GhostChildEntitiesExclusiveGroup), /*dbStruct.DBID*/ (uint)BlockIDs.Cube); + entityInitializer.Init(dbStruct); + entityInitializer.Init(new GFXPrefabEntityStructGPUI( + PrefabsID.GetOrCreatePrefabID((ushort)entityInitializer.Get().prefabAssetID, + entitiesDB.QueryEntity(sourceId).materialId, 7, + FlippedBlockUtils.IsFlipped(in scalingEntityStruct.scale)), true)); + entityInitializer.Init(entitiesDB.QueryEntity(sourceId)); + entityInitializer.Init(new GhostParentEntityStruct + { + ghostBlockParentEntityReference = ghostEntityReference, + ownerMustSerializeOnAdd = false + }); + entityInitializer.Init(colorStruct); + entityInitializer.Init(colliderStruct); + entityInitializer.Init(new RigidBodyEntityStruct + { + position = positionEntityStruct.position, + rotation = rotationEntityStruct.rotation + }); + entityInitializer.Init(new ScalingEntityStruct + { + scale = scalingEntityStruct.scale + }); + entityInitializer.Init(new LocalTransformEntityStruct + { + position = positionEntityStruct.position, + rotation = rotationEntityStruct.rotation + }); + entityInitializer.Init(new RotationEntityStruct + { + rotation = rotationEntityStruct.rotation + }); + entityInitializer.Init(new PositionEntityStruct + { + position = positionEntityStruct.position + }); + entityInitializer.Init(new SkewComponent + { + skewMatrix = entitiesDB.QueryEntity(sourceId).skewMatrix + }); + entityInitializer.Init(new BlockPlacementInfoStruct + { + placedByBuildingDrone = entitiesDB + .QueryEntityOptional(new EGID(Player.LocalPlayer.Id, + BoxSelectExclusiveGroups.BoxSelectVolumeExclusiveGroup)).Get().buildingDroneReference + }); + entityInitializer.Init(new GridRotationStruct + { + position = float3.zero, + rotation = quaternion.identity + }); + var block = Block.New(entityInitializer.EGID); + block.InitData = entityInitializer; + return block; + } public string Name { get; } = "TechbloxModdingAPIBlueprintGameEngine"; public bool isRemovable { get; } = false; diff --git a/TechbloxModdingAPI/Commands/CommandPatch.cs b/TechbloxModdingAPI/Commands/CommandPatch.cs index 169891a..b928c1d 100644 --- a/TechbloxModdingAPI/Commands/CommandPatch.cs +++ b/TechbloxModdingAPI/Commands/CommandPatch.cs @@ -12,13 +12,12 @@ namespace TechbloxModdingAPI.Commands { /// /// Patch of RobocraftX.CR.MainGame.MainGameCompositionRoot.DeterministicCompose() - /// Initializes existing and custom commands + /// Initializes custom commands /// [HarmonyPatch] static class CommandPatch { - public static void Postfix(Action reloadGame, MultiplayerInitParameters multiplayerParameters, - StateSyncRegistrationHelper stateSyncReg) + public static void Postfix(StateSyncRegistrationHelper stateSyncReg) { /*CommandLineCompositionRoot.Compose(contextHolder, stateSyncReg.enginesRoot, reloadGame, multiplayerParameters, stateSyncReg); - uREPL C# compilation not supported anymore */ diff --git a/TechbloxModdingAPI/Player.cs b/TechbloxModdingAPI/Player.cs index 4f5607a..b3b0536 100644 --- a/TechbloxModdingAPI/Player.cs +++ b/TechbloxModdingAPI/Player.cs @@ -314,7 +314,7 @@ namespace TechbloxModdingAPI get { var optstruct = playerEngine.GetCharacterStruct(Id); - return optstruct ? (BlockIDs) optstruct.Get().SelectedDBPartID : BlockIDs.Invalid; + return optstruct ? (BlockIDs) optstruct.Get().selectedDBPartID : BlockIDs.Invalid; } } diff --git a/TechbloxModdingAPI/TechbloxModdingAPI.csproj b/TechbloxModdingAPI/TechbloxModdingAPI.csproj index 015c897..95927f8 100644 --- a/TechbloxModdingAPI/TechbloxModdingAPI.csproj +++ b/TechbloxModdingAPI/TechbloxModdingAPI.csproj @@ -116,10 +116,6 @@ ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.GenericPhysicsBlocks.dll ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.GenericPhysicsBlocks.dll - - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.LightBlock.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.LightBlock.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.LogicBlock.dll ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.LogicBlock.dll @@ -480,6 +476,10 @@ ..\ref\TechbloxPreview_Data\Managed\RobocraftX.MainGame.dll ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.MainGame.dll + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.MainGameMock.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.MainGameMock.dll + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.MainSimulation.dll ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.MainSimulation.dll @@ -592,6 +592,10 @@ ..\ref\TechbloxPreview_Data\Managed\Svelto.Tasks.dll ..\..\ref\TechbloxPreview_Data\Managed\Svelto.Tasks.dll + + ..\ref\TechbloxPreview_Data\Managed\Techblox.AtmosphereBlock.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.AtmosphereBlock.dll + ..\ref\TechbloxPreview_Data\Managed\Techblox.AutoForward.dll ..\..\ref\TechbloxPreview_Data\Managed\Techblox.AutoForward.dll @@ -600,6 +604,10 @@ ..\ref\TechbloxPreview_Data\Managed\Techblox.Backend.dll ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Backend.dll + + ..\ref\TechbloxPreview_Data\Managed\Techblox.Blocks.LightBlock.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Blocks.LightBlock.dll + ..\ref\TechbloxPreview_Data\Managed\Techblox.Building.Rules.dll ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Building.Rules.dll @@ -624,6 +632,22 @@ ..\ref\TechbloxPreview_Data\Managed\Techblox.Environment.dll ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Environment.dll + + ..\ref\TechbloxPreview_Data\Managed\Techblox.EnvironmentBlocks.BuildingEnvironment.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.EnvironmentBlocks.BuildingEnvironment.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.EnvironmentBlocks.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.EnvironmentBlocks.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.EnvironmentBlocks.SimulationWorldEnvironment.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.EnvironmentBlocks.SimulationWorldEnvironment.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.GameSelection.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GameSelection.dll + ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Building.dll ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Building.dll @@ -640,6 +664,18 @@ ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.dll ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.dll + + ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.GamePortal.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.GamePortal.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.GamePortal.MockUps.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.GamePortal.MockUps.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Hotbar.Landscapes.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Hotbar.Landscapes.dll + ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Hotbar.Materials.dll ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Hotbar.Materials.dll @@ -648,6 +684,10 @@ ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Inventory.Common.dll ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Inventory.Common.dll + + ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Inventory.Landscapes.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Inventory.Landscapes.dll + ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Inventory.Materials.dll ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Inventory.Materials.dll @@ -656,6 +696,14 @@ ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Login.dll ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Login.dll + + ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Mocks.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Mocks.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Mocks.DynamicListBuild.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Mocks.DynamicListBuild.dll + ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.MyGamesScreen.dll ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.MyGamesScreen.dll @@ -664,6 +712,10 @@ ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Notifications.MockUps.dll ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Notifications.MockUps.dll + + ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.TabsBar.Landscapes.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.TabsBar.Landscapes.dll + ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.TabsBar.Materials.dll ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.TabsBar.Materials.dll @@ -676,6 +728,10 @@ ..\ref\TechbloxPreview_Data\Managed\Techblox.Pointer.dll ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Pointer.dll + + ..\ref\TechbloxPreview_Data\Managed\Techblox.ProceduralReflectionProbes.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.ProceduralReflectionProbes.dll + ..\ref\TechbloxPreview_Data\Managed\Techblox.Rendering.Common.dll ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Rendering.Common.dll @@ -704,6 +760,10 @@ ..\ref\TechbloxPreview_Data\Managed\Techblox.Services.Eos.dll ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Services.Eos.dll + + ..\ref\TechbloxPreview_Data\Managed\Techblox.Services.GameDetails.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Services.GameDetails.dll + ..\ref\TechbloxPreview_Data\Managed\Techblox.Services.Storage.dll ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Services.Storage.dll diff --git a/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs b/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs index 4c648eb..1557f53 100644 --- a/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs +++ b/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs @@ -49,7 +49,7 @@ namespace TechbloxModdingAPI.Tests FileLog.Reset(); Harmony.DEBUG = true; Main.Init(); - Logging.MetaDebugLog($"Version group id {(uint)ApiExclusiveGroups.versionGroup}"); + Logging.MetaDebugLog($"Version group id {ApiExclusiveGroups.versionGroup}"); // disable background music Logging.MetaDebugLog("Audio Mixers: " + string.Join(",", AudioTools.GetMixers())); //AudioTools.SetVolume(0.0f, "Music"); // The game now sets this from settings again after this is called :( @@ -273,7 +273,9 @@ namespace TechbloxModdingAPI.Tests {"Neg", "Negative"}, {"Tetra", "Tetrahedron"}, {"RWedge", "Rounded Wedge"}, {"RTetra", "Rounded Tetrahedron"} }; - string name = LocalizationService.Localize(data.CubeNameKey).Replace(" ", ""); + string name = LocalizationService.Localize(data.CubeNameKey).Split(' ').Select(str => + str.Length > 0 ? char.ToUpper(str[0]) + str.Substring(1) : str).Aggregate((a, b) => a + b) + .Replace("-", ""); foreach (var rkv in toReplace) { name = Regex.Replace(name, rkv.Key + "([A-Z]|$)", rkv.Value + "$1"); @@ -284,8 +286,16 @@ namespace TechbloxModdingAPI.Tests };*/ /*Game.Enter += (sender, e) => { + ushort lastKey = ushort.MaxValue; Console.WriteLine("Materials:\n" + FullGameFields._dataDb.GetValues() - .Select(kv => $"{kv.Key}: {((MaterialPropertiesData) kv.Value).Name}") + .OrderBy(kv => ushort.Parse(kv.Key)) + .Select(kv => + { + ushort currentKey = ushort.Parse(kv.Key); + string result = $"{((MaterialPropertiesData)kv.Value).Name}{(currentKey != lastKey + 1 ? $" = {kv.Key}" : "")},"; + lastKey = currentKey; + return result; + }) .Aggregate((a, b) => a + "\n" + b)); };*/ diff --git a/TechbloxModdingAPI/Utility/NativeApiExtensions.cs b/TechbloxModdingAPI/Utility/NativeApiExtensions.cs index 8ccb251..ff5ca45 100644 --- a/TechbloxModdingAPI/Utility/NativeApiExtensions.cs +++ b/TechbloxModdingAPI/Utility/NativeApiExtensions.cs @@ -51,6 +51,11 @@ namespace TechbloxModdingAPI.Utility var opt = QueryEntityOptional(entitiesDB, id); if (opt) return ref opt.Get(); if (obj.InitData.Valid) return ref obj.InitData.Initializer(id).GetOrCreate(); + /*if (!obj.InitData.Valid) return ref opt.Get(); //Default value + var init = obj.InitData.Initializer(id); + // Do not create the component if missing, as that can trigger Add() listeners that, in some cases, may be + // invalid if (ab)using the classes in an unusual way - TODO: Check entity descriptor or something + if (init.Has()) return ref init.Get();*/ return ref opt.Get(); //Default value } } -- 2.30.2 From f53d0b63e7bada44db801bf0f86b16dc12a855c7 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sat, 6 Nov 2021 04:10:00 +0100 Subject: [PATCH 218/252] Fix issues uncovered by the tests - Fixed the game enter API - Fixed ToggleTimeMode() placing the player underground by using the full switch animation - Fixed the menu enter/exit events only firing once due to the game keeping the menu loaded - Moved everything from AppEngine to GameMenuEngine for consistency - Reimplemented the Block.Static property, it should actually work again too - Made the block property test only use blocks placed during the previous test, improved error handling and temporarily disabled testing the Material and the Flipped properties as they cause the game to crash --- TechbloxModdingAPI/App/AppEngine.cs | 18 ----- TechbloxModdingAPI/App/Client.cs | 23 +++--- TechbloxModdingAPI/App/Game.cs | 2 +- TechbloxModdingAPI/App/GameGameEngine.cs | 3 +- TechbloxModdingAPI/App/GameMenuEngine.cs | 81 ++++++++++++++++--- TechbloxModdingAPI/Block.cs | 4 +- TechbloxModdingAPI/Blocks/BlockTests.cs | 32 ++++++-- .../Tests/TechbloxModdingAPIPluginTest.cs | 4 +- 8 files changed, 115 insertions(+), 52 deletions(-) diff --git a/TechbloxModdingAPI/App/AppEngine.cs b/TechbloxModdingAPI/App/AppEngine.cs index 3f89f26..e4f5dcb 100644 --- a/TechbloxModdingAPI/App/AppEngine.cs +++ b/TechbloxModdingAPI/App/AppEngine.cs @@ -40,23 +40,5 @@ namespace TechbloxModdingAPI.App get; private set; } = false; - - public Game[] GetMyGames() - { - EntityCollection mgsevs = entitiesDB.QueryEntities(MyGamesScreenExclusiveGroups.MyGames); - var mgsevsB = mgsevs.ToBuffer().buffer; - Game[] games = new Game[mgsevs.count]; - for (int i = 0; i < mgsevs.count; i++) - { - Utility.Logging.MetaDebugLog($"Found game named {mgsevsB[i].GameName}"); - games[i] = new Game(mgsevsB[i].ID); - } - return games; - } - } - - public struct MenuEventArgs - { - } } diff --git a/TechbloxModdingAPI/App/Client.cs b/TechbloxModdingAPI/App/Client.cs index 026b1a2..6fe4b4e 100644 --- a/TechbloxModdingAPI/App/Client.cs +++ b/TechbloxModdingAPI/App/Client.cs @@ -14,22 +14,19 @@ namespace TechbloxModdingAPI.App /// public class Client { - // extensible engine - protected static AppEngine appEngine = new AppEngine(); - - protected static Func ErrorHandlerInstanceGetter; + protected static Func ErrorHandlerInstanceGetter; protected static Action EnqueueError; protected static Action HandleErrorClosed; - /// + /// /// An event that fires whenever the main menu is loaded. /// public static event EventHandler EnterMenu { - add => appEngine.EnterMenu += value; - remove => appEngine.EnterMenu -= value; + add => Game.menuEngine.EnterMenu += value; + remove => Game.menuEngine.EnterMenu -= value; } /// @@ -37,8 +34,8 @@ namespace TechbloxModdingAPI.App /// public static event EventHandler ExitMenu { - add => appEngine.ExitMenu += value; - remove => appEngine.ExitMenu -= value; + add => Game.menuEngine.ExitMenu += value; + remove => Game.menuEngine.ExitMenu -= value; } /// @@ -69,8 +66,8 @@ namespace TechbloxModdingAPI.App { get { - if (!appEngine.IsInMenu) return new Game[0]; - return appEngine.GetMyGames(); + if (!Game.menuEngine.IsInMenu) return Array.Empty(); + return Game.menuEngine.GetMyGames(); } } @@ -80,7 +77,7 @@ namespace TechbloxModdingAPI.App /// true if in menu; false when loading or in a game. public bool InMenu { - get => appEngine.IsInMenu; + get => Game.menuEngine.IsInMenu; } /// @@ -119,8 +116,6 @@ namespace TechbloxModdingAPI.App /*HandleErrorClosed = (Action) AccessTools.Method("TechbloxModdingAPI.App.Client:GenHandlePopupClosed") .MakeGenericMethod(errorHandler) .Invoke(null, new object[0]);*/ - // register engines - MenuEngineManager.AddMenuEngine(appEngine); } // Creating delegates once is faster than reflection every time diff --git a/TechbloxModdingAPI/App/Game.cs b/TechbloxModdingAPI/App/Game.cs index 56854b6..7f52965 100644 --- a/TechbloxModdingAPI/App/Game.cs +++ b/TechbloxModdingAPI/App/Game.cs @@ -23,7 +23,7 @@ namespace TechbloxModdingAPI.App { // extensible engines protected static GameGameEngine gameEngine = new GameGameEngine(); - protected static GameMenuEngine menuEngine = new GameMenuEngine(); + protected internal static GameMenuEngine menuEngine = new GameMenuEngine(); protected static DebugInterfaceEngine debugOverlayEngine = new DebugInterfaceEngine(); protected static GameBuildSimEventEngine buildSimEventEngine = new GameBuildSimEventEngine(); diff --git a/TechbloxModdingAPI/App/GameGameEngine.cs b/TechbloxModdingAPI/App/GameGameEngine.cs index f1ec8e7..2c6e177 100644 --- a/TechbloxModdingAPI/App/GameGameEngine.cs +++ b/TechbloxModdingAPI/App/GameGameEngine.cs @@ -8,6 +8,7 @@ using Svelto.Tasks; using Svelto.Tasks.Lean; using RobocraftX.Blocks; using RobocraftX.ScreenshotTaker; +using Techblox.Environment.Transition; using Techblox.GameSelection; using TechbloxModdingAPI.Blocks; using TechbloxModdingAPI.Engines; @@ -100,7 +101,7 @@ namespace TechbloxModdingAPI.App { if (!entitiesDB.FoundInGroups()) throw new AppStateException("At least one block must exist in the world to enter simulation"); - TimeRunningModeUtil.ToggleTimeRunningState(entitiesDB); + SwitchAnimationUtil.Start(entitiesDB); } public EGID[] GetAllBlocksInGame(BlockIDs filter = BlockIDs.Invalid) diff --git a/TechbloxModdingAPI/App/GameMenuEngine.cs b/TechbloxModdingAPI/App/GameMenuEngine.cs index 2f65016..ac24e3a 100644 --- a/TechbloxModdingAPI/App/GameMenuEngine.cs +++ b/TechbloxModdingAPI/App/GameMenuEngine.cs @@ -1,8 +1,10 @@ using System; +using System.Reflection; using HarmonyLib; using RobocraftX; using RobocraftX.Common; +using RobocraftX.FrontEnd; using RobocraftX.GUI; using RobocraftX.GUI.MyGamesScreen; using Svelto.ECS; @@ -16,6 +18,9 @@ namespace TechbloxModdingAPI.App { public class GameMenuEngine : IFactoryEngine { + public WrappedHandler EnterMenu; + + public WrappedHandler ExitMenu; public IEntityFactory Factory { set; private get; } public string Name => "TechbloxModdingAPIGameInfoGameEngine"; @@ -24,23 +29,43 @@ namespace TechbloxModdingAPI.App public EntitiesDB entitiesDB { set; private get; } + public GameMenuEngine() + { + MenuEnteredEnginePatch.EnteredExitedMenu = () => + { + if (IsInMenu) + EnterMenu.Invoke(this, new MenuEventArgs { }); + else + ExitMenu.Invoke(this, new MenuEventArgs { }); + }; + } + public void Dispose() { - IsInMenu = false; } public void Ready() { - IsInMenu = true; + MenuEnteredEnginePatch.IsInMenu = true; // At first it uses ActivateMenu(), then GoToMenu() which is patched + MenuEnteredEnginePatch.EnteredExitedMenu(); } // game functionality - public bool IsInMenu + public bool IsInMenu => MenuEnteredEnginePatch.IsInMenu; + + public Game[] GetMyGames() { - get; - private set; - } = false; + EntityCollection mgsevs = entitiesDB.QueryEntities(MyGamesScreenExclusiveGroups.MyGames); + var mgsevsB = mgsevs.ToBuffer().buffer; + Game[] games = new Game[mgsevs.count]; + for (int i = 0; i < mgsevs.count; i++) + { + Utility.Logging.MetaDebugLog($"Found game named {mgsevsB[i].GameName}"); + games[i] = new Game(mgsevsB[i].ID); + } + return games; + } public bool CreateMyGame(EGID id, string path = "", uint thumbnailId = 0, string gameName = "", string creatorName = "", string description = "", long createdDate = 0L) { @@ -77,10 +102,10 @@ namespace TechbloxModdingAPI.App { if (!ExistsGameInfo(id)) return false; ref MyGameDataEntityStruct mgdes = ref GetGameInfo(id); - return EnterGame(mgdes.GameName, mgdes.SavedGamePath); + return EnterGame(mgdes.GameName, mgdes.FileId); } - public bool EnterGame(string gameName, string path, bool autoEnterSim = false) + public bool EnterGame(string gameName, string fileId, bool autoEnterSim = false) { GameMode.CurrentMode = autoEnterSim ? RCXMode.Play : RCXMode.Build; var data = new GameSelectionData @@ -89,7 +114,8 @@ namespace TechbloxModdingAPI.App gameType = GameType.MachineEditor, saveName = gameName, saveType = SaveType.ExistingSave, - gameID = path + gameID = "GAMEID_Road_Track", //TODO: Expose to the API + userContentID = fileId }; // the private FullGameCompositionRoot.SwitchToGame() method gets passed to menu items for this reason AccessTools.Method(typeof(FullGameCompositionRoot), "SwitchToGame").Invoke(FullGameFields.Instance, new object[]{data}); @@ -138,4 +164,41 @@ namespace TechbloxModdingAPI.App } internal class MyGameDataEntityDescriptor_DamnItFJWhyDidYouMakeThisInternal : GenericEntityDescriptor { } + + [HarmonyPatch] + static class MenuEnteredEnginePatch + { + internal static bool IsInMenu; + internal static Action EnteredExitedMenu; + public static void Postfix() + { + IsInMenu = true; + EnteredExitedMenu(); + } + + public static MethodBase TargetMethod() + { + return AccessTools.Method(typeof(FullGameCompositionRoot), "GoToMenu"); + } + } + + [HarmonyPatch] + static class MenuExitedEnginePatch + { + public static void Prefix() + { + MenuEnteredEnginePatch.IsInMenu = false; + MenuEnteredEnginePatch.EnteredExitedMenu(); + } + + public static MethodBase TargetMethod() + { + return AccessTools.Method(typeof(FullGameCompositionRoot), "SwitchToGame"); + } + } + + public struct MenuEventArgs + { + + } } diff --git a/TechbloxModdingAPI/Block.cs b/TechbloxModdingAPI/Block.cs index c2f8dd8..0d730c5 100644 --- a/TechbloxModdingAPI/Block.cs +++ b/TechbloxModdingAPI/Block.cs @@ -386,8 +386,8 @@ namespace TechbloxModdingAPI /// public bool Static { - get => false; - set { } + get => BlockEngine.GetBlockInfo(this).isStatic; + set => BlockEngine.GetBlockInfo(this).isStatic = value; } /// diff --git a/TechbloxModdingAPI/Blocks/BlockTests.cs b/TechbloxModdingAPI/Blocks/BlockTests.cs index f920631..198011c 100644 --- a/TechbloxModdingAPI/Blocks/BlockTests.cs +++ b/TechbloxModdingAPI/Blocks/BlockTests.cs @@ -46,16 +46,20 @@ namespace TechbloxModdingAPI.Blocks "Block ID enum matches the known block types."); } + private static Block[] blocks; // Store placed blocks as some blocks are already present as the workshop and the game save [APITestCase(TestType.EditMode)] public static void TestBlockIDs() { float3 pos = new float3(); - foreach (BlockIDs id in Enum.GetValues(typeof(BlockIDs))) + var values = Enum.GetValues(typeof(BlockIDs)); + blocks = new Block[values.Length - 1]; // Minus the invalid ID + int i = 0; + foreach (BlockIDs id in values) { if (id == BlockIDs.Invalid) continue; try { - Block.PlaceNew(id, pos); + blocks[i++] = Block.PlaceNew(id, pos); pos += 0.2f; } catch (Exception e) @@ -71,8 +75,9 @@ namespace TechbloxModdingAPI.Blocks [APITestCase(TestType.EditMode)] public static IEnumerator TestBlockProperties() { //Uses the result of the previous test case - var blocks = Game.CurrentGame().GetBlocksInGame(); yield return Yield.It; + if (blocks is null) + yield break; for (var index = 0; index < blocks.Length; index++) { if (index % 50 == 0) yield return Yield.It; //The material or flipped status can only be changed 130 times per submission @@ -80,6 +85,7 @@ namespace TechbloxModdingAPI.Blocks if (!block.Exists) continue; foreach (var property in block.GetType().GetProperties()) { + if (property.Name == "Material" || property.Name == "Flipped") continue; // TODO: Crashes in game //Includes specialised block properties if (property.SetMethod == null) continue; var testValues = new (Type, object, Predicate)[] @@ -121,8 +127,24 @@ namespace TechbloxModdingAPI.Blocks yield break; } - property.SetValue(block, valueToUse); - object got = property.GetValue(block); + try + { + property.SetValue(block, valueToUse); + } + catch (Exception e) + { + Assert.Fail($"Failed to set property {block.GetType().Name}.{property.Name} to {valueToUse}\n{e}"); + } + object got; + try + { + got = property.GetValue(block); + } + catch (Exception e) + { + Assert.Fail($"Failed to get property {block.GetType().Name}.{property.Name}\n{e}"); + continue; + } var attr = property.GetCustomAttribute(); if (!predicateToUse(got) && (attr == null || !Equals(attr.PossibleValue, got))) { diff --git a/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs b/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs index 1557f53..75d0cc4 100644 --- a/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs +++ b/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs @@ -215,10 +215,10 @@ namespace TechbloxModdingAPI.Tests .Action(() => Player.LocalPlayer.GetBlockLookedAt().Static = true).Build(); Game.AddPersistentDebugInfo("InstalledMods", InstalledMods); - Block.Placed += (sender, args) => + /*Block.Placed += (sender, args) => Logging.MetaDebugLog("Placed block " + args.Block); Block.Removed += (sender, args) => - Logging.MetaDebugLog("Removed block " + args.Block); + Logging.MetaDebugLog("Removed block " + args.Block);*/ } // dependency test -- 2.30.2 From e3a7961be47a6bd222cb5c69a91d1a49b3689139 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Thu, 25 Nov 2021 01:48:06 +0100 Subject: [PATCH 219/252] Made the Game.Enter event only fire once loading finishes and fixed player building mode Also attempted to fix material changing and updating the rendered block --- TechbloxModdingAPI/App/GameGameEngine.cs | 31 ++++++++------ TechbloxModdingAPI/Block.cs | 5 ++- TechbloxModdingAPI/Blocks/BlockTests.cs | 8 ++++ .../Blocks/Engines/BlockEngine.cs | 41 ++++++++++++++++--- TechbloxModdingAPI/Player.cs | 9 +++- .../Players/PlayerBuildingMode.cs | 3 +- 6 files changed, 76 insertions(+), 21 deletions(-) diff --git a/TechbloxModdingAPI/App/GameGameEngine.cs b/TechbloxModdingAPI/App/GameGameEngine.cs index 2c6e177..2bed201 100644 --- a/TechbloxModdingAPI/App/GameGameEngine.cs +++ b/TechbloxModdingAPI/App/GameGameEngine.cs @@ -7,17 +7,17 @@ using Svelto.ECS; using Svelto.Tasks; using Svelto.Tasks.Lean; using RobocraftX.Blocks; +using RobocraftX.Common.Loading; using RobocraftX.ScreenshotTaker; using Techblox.Environment.Transition; using Techblox.GameSelection; using TechbloxModdingAPI.Blocks; using TechbloxModdingAPI.Engines; -using TechbloxModdingAPI.Tasks; using TechbloxModdingAPI.Utility; namespace TechbloxModdingAPI.App { - public class GameGameEngine : IApiEngine + public class GameGameEngine : IApiEngine, IReactOnAddAndRemove { public WrappedHandler EnterGame; @@ -26,9 +26,11 @@ namespace TechbloxModdingAPI.App public string Name => "TechbloxModdingAPIGameInfoMenuEngine"; public bool isRemovable => false; - + public EntitiesDB entitiesDB { set; private get; } + private bool enteredGame; + public void Dispose() { ExitGame.Invoke(this, new GameEventArgs { GameName = GetGameData().saveName, GamePath = GetGameData().gameID }); @@ -37,14 +39,7 @@ namespace TechbloxModdingAPI.App public void Ready() { - EnteringGame().RunOn(Scheduler.leanRunner); - } - - private IEnumerator EnteringGame() - { - yield return new WaitForSubmissionEnumerator(GameLoadedEnginePatch.Scheduler).Continue(); - EnterGame.Invoke(this, new GameEventArgs { GameName = GetGameData().saveName, GamePath = GetGameData().gameID }); - IsInGame = true; + enteredGame = true; } // game functionality @@ -139,5 +134,17 @@ namespace TechbloxModdingAPI.App { return entitiesDB.QueryEntity(GameSelectionConstants.GameSelectionEGID); } - } + + public void Add(ref LoadingActionEntityStruct entityComponent, EGID egid) + { + } + + public void Remove(ref LoadingActionEntityStruct entityComponent, EGID egid) + { // Finished loading + if (!enteredGame) return; + EnterGame.Invoke(this, new GameEventArgs { GameName = GetGameData().saveName, GamePath = GetGameData().gameID }); + IsInGame = true; + enteredGame = false; + } + } } diff --git a/TechbloxModdingAPI/Block.cs b/TechbloxModdingAPI/Block.cs index 0d730c5..ec1147a 100644 --- a/TechbloxModdingAPI/Block.cs +++ b/TechbloxModdingAPI/Block.cs @@ -327,7 +327,10 @@ namespace TechbloxModdingAPI : throw new BlockTypeException("Unknown block type! Could not set default material."); if (!FullGameFields._dataDb.ContainsKey(val)) throw new BlockException($"Block material {value} does not exist!"); - BlockEngine.GetBlockInfo(this).materialId = val; + ref var comp = ref BlockEngine.GetBlockInfo(this); + if (comp.materialId == val) + return; + comp.materialId = val; BlockEngine.UpdatePrefab(this, val, Flipped); //The default causes the screen to go black } } diff --git a/TechbloxModdingAPI/Blocks/BlockTests.cs b/TechbloxModdingAPI/Blocks/BlockTests.cs index 198011c..4bc29db 100644 --- a/TechbloxModdingAPI/Blocks/BlockTests.cs +++ b/TechbloxModdingAPI/Blocks/BlockTests.cs @@ -5,7 +5,9 @@ using System.Reflection; using DataLoader; using Svelto.Tasks; +using Svelto.Tasks.Enumerators; using Unity.Mathematics; +using UnityEngine; using TechbloxModdingAPI.App; using TechbloxModdingAPI.Tests; @@ -86,6 +88,12 @@ namespace TechbloxModdingAPI.Blocks foreach (var property in block.GetType().GetProperties()) { if (property.Name == "Material" || property.Name == "Flipped") continue; // TODO: Crashes in game + if (property.Name == "Material" || property.Name == "Flipped") + { + Console.WriteLine("Block type: "+block.Type); + Console.WriteLine("Will set " + property.Name); + yield return new WaitForSecondsEnumerator(1).Continue(); + } //Includes specialised block properties if (property.SetMethod == null) continue; var testValues = new (Type, object, Predicate)[] diff --git a/TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs b/TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs index 26be582..c7c84cf 100644 --- a/TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs @@ -1,5 +1,7 @@ using System.Collections.Generic; using System.Linq; +using System.Reflection; +using HarmonyLib; using Gamecraft.ColourPalette; using Gamecraft.TimeRunning; @@ -11,8 +13,8 @@ using RobocraftX.Rendering; using RobocraftX.Rendering.GPUI; using Svelto.DataStructures; using Svelto.ECS; -using Svelto.ECS.EntityStructs; using Svelto.ECS.Hybrid; +using Techblox.BuildingDrone; using Unity.Mathematics; using TechbloxModdingAPI.Engines; @@ -92,10 +94,7 @@ namespace TechbloxModdingAPI.Blocks.Engines public void UpdateDisplayedBlock(EGID id) { if (!BlockExists(id)) return; - var pos = entitiesDB.QueryEntity(id); - var rot = entitiesDB.QueryEntity(id); - var scale = entitiesDB.QueryEntity(id); - entitiesDB.QueryEntity(id).matrix = float4x4.TRS(pos.position, rot.rotation, scale.scale); + RenderingPatch.UpdateBlocks(); } internal void UpdatePrefab(Block block, byte material, bool flipped) @@ -115,7 +114,17 @@ namespace TechbloxModdingAPI.Blocks.Engines PrefabsID.GetOrCreatePrefabID((ushort) prefabAssetID, material, 1, flipped); entitiesDB.QueryEntityOrDefault(block).prefabID = prefabId; if (block.Exists) + { + entitiesDB.PublishEntityChange(block.Id); entitiesDB.PublishEntityChange(block.Id); + + ref BuildingActionComponent local = + ref entitiesDB.QueryEntity(BuildingDroneUtility + .GetLocalBuildingDrone(entitiesDB).ToEGID(entitiesDB)); + local.buildAction = BuildAction.ChangeMaterial; + local.targetPosition = block.Position; + this.entitiesDB.PublishEntityChange(local.ID); + } //Phyiscs prefab: prefabAssetID, set on block creation from the CubeListData } @@ -239,5 +248,27 @@ namespace TechbloxModdingAPI.Blocks.Engines return entitiesDB; } #endif + + [HarmonyPatch] + public static class RenderingPatch + { + private static ComputeRenderingEntitiesMatricesEngine Engine; + + public static void Postfix(ComputeRenderingEntitiesMatricesEngine __instance) + { + Engine = __instance; + } + + public static MethodBase TargetMethod() + { + return typeof(ComputeRenderingEntitiesMatricesEngine).GetConstructors()[0]; + } + + public static void UpdateBlocks() + { + var data = new RenderingDataStruct(); + Engine.Add(ref data, new EGID(0, CommonExclusiveGroups.BUTTON_BLOCK_GROUP)); + } + } } } \ No newline at end of file diff --git a/TechbloxModdingAPI/Player.cs b/TechbloxModdingAPI/Player.cs index b3b0536..2ce88f1 100644 --- a/TechbloxModdingAPI/Player.cs +++ b/TechbloxModdingAPI/Player.cs @@ -360,8 +360,8 @@ namespace TechbloxModdingAPI /// /// The player's mode in time stopped mode, determining what they place. /// - public PlayerBuildingMode BuildingMode => (PlayerBuildingMode) playerEngine - .GetCharacterStruct(Id).Get().timeStoppedContext; + public PlayerBuildingMode BuildingMode => (PlayerBuildingMode)Math.Log((double)playerEngine + .GetCharacterStruct(Id).Get().timeStoppedContext, 2); // It's a bit field in game now /// /// Whether the player is sprinting. @@ -522,6 +522,11 @@ namespace TechbloxModdingAPI return (int) Id; } + public override string ToString() + { + return $"{nameof(Type)}: {Type}, {nameof(Id)}: {Id}, {nameof(Position)}: {Position}, {nameof(Rotation)}: {Rotation}, {nameof(Mass)}: {Mass}"; + } + // internal methods internal static void Init() diff --git a/TechbloxModdingAPI/Players/PlayerBuildingMode.cs b/TechbloxModdingAPI/Players/PlayerBuildingMode.cs index 5e75555..7bc25a8 100644 --- a/TechbloxModdingAPI/Players/PlayerBuildingMode.cs +++ b/TechbloxModdingAPI/Players/PlayerBuildingMode.cs @@ -6,6 +6,7 @@ ColourMode, ConfigMode, BlueprintMode, - MaterialMode + MaterialMode, + LandscapeMode } } \ No newline at end of file -- 2.30.2 From ef1b3de1a1b521a30557e4db85b41db2f0816838 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Wed, 15 Dec 2021 00:16:51 +0100 Subject: [PATCH 220/252] Remove preview from references --- Automation/gen_csproj.py | 2 +- CodeGenerator/CodeGenerator.csproj | 1120 ++++++++-------- TechbloxModdingAPI/TechbloxModdingAPI.csproj | 1204 +++++++++--------- 3 files changed, 1163 insertions(+), 1163 deletions(-) diff --git a/Automation/gen_csproj.py b/Automation/gen_csproj.py index 9d5dfbc..c70b002 100755 --- a/Automation/gen_csproj.py +++ b/Automation/gen_csproj.py @@ -39,7 +39,7 @@ if __name__ == "__main__": args = parser.parse_args() print("Building Assembly references") - asmXml = buildReferencesXml("../ref/TechbloxPreview_Data/Managed") + asmXml = buildReferencesXml("../ref/Techblox_Data/Managed") # print(asmXml) with open("../TechbloxModdingAPI/TechbloxModdingAPI.csproj", "r") as xmlFile: diff --git a/CodeGenerator/CodeGenerator.csproj b/CodeGenerator/CodeGenerator.csproj index 826623c..f657a48 100644 --- a/CodeGenerator/CodeGenerator.csproj +++ b/CodeGenerator/CodeGenerator.csproj @@ -44,1124 +44,1124 @@ - ..\ref\TechbloxPreview_Data\Managed\IllusionInjector.dll - ..\..\ref\TechbloxPreview_Data\Managed\IllusionInjector.dll + ..\ref\Techblox_Data\Managed\IllusionInjector.dll + ..\..\ref\Techblox_Data\Managed\IllusionInjector.dll - ..\ref\TechbloxPreview_Data\Managed\IllusionPlugin.dll - ..\..\ref\TechbloxPreview_Data\Managed\IllusionPlugin.dll + ..\ref\Techblox_Data\Managed\IllusionPlugin.dll + ..\..\ref\Techblox_Data\Managed\IllusionPlugin.dll - ..\ref\TechbloxPreview_Data\Managed\Analytics.dll - ..\..\ref\TechbloxPreview_Data\Managed\Analytics.dll + ..\ref\Techblox_Data\Managed\Analytics.dll + ..\..\ref\Techblox_Data\Managed\Analytics.dll - ..\ref\TechbloxPreview_Data\Managed\Assembly-CSharp-firstpass.dll - ..\..\ref\TechbloxPreview_Data\Managed\Assembly-CSharp-firstpass.dll + ..\ref\Techblox_Data\Managed\Assembly-CSharp-firstpass.dll + ..\..\ref\Techblox_Data\Managed\Assembly-CSharp-firstpass.dll - ..\ref\TechbloxPreview_Data\Managed\Assembly-CSharp.dll - ..\..\ref\TechbloxPreview_Data\Managed\Assembly-CSharp.dll + ..\ref\Techblox_Data\Managed\Assembly-CSharp.dll + ..\..\ref\Techblox_Data\Managed\Assembly-CSharp.dll - ..\ref\TechbloxPreview_Data\Managed\BevelEffect.dll - ..\..\ref\TechbloxPreview_Data\Managed\BevelEffect.dll + ..\ref\Techblox_Data\Managed\BevelEffect.dll + ..\..\ref\Techblox_Data\Managed\BevelEffect.dll - ..\ref\TechbloxPreview_Data\Managed\Blocks.HUDFeedbackBlocks.dll - ..\..\ref\TechbloxPreview_Data\Managed\Blocks.HUDFeedbackBlocks.dll + ..\ref\Techblox_Data\Managed\Blocks.HUDFeedbackBlocks.dll + ..\..\ref\Techblox_Data\Managed\Blocks.HUDFeedbackBlocks.dll - ..\ref\TechbloxPreview_Data\Managed\Boxophobic.TheVehetationEngine.Runtime.dll - ..\..\ref\TechbloxPreview_Data\Managed\Boxophobic.TheVehetationEngine.Runtime.dll + ..\ref\Techblox_Data\Managed\Boxophobic.TheVehetationEngine.Runtime.dll + ..\..\ref\Techblox_Data\Managed\Boxophobic.TheVehetationEngine.Runtime.dll - ..\ref\TechbloxPreview_Data\Managed\Boxophobic.Utils.Scripts.dll - ..\..\ref\TechbloxPreview_Data\Managed\Boxophobic.Utils.Scripts.dll + ..\ref\Techblox_Data\Managed\Boxophobic.Utils.Scripts.dll + ..\..\ref\Techblox_Data\Managed\Boxophobic.Utils.Scripts.dll - ..\ref\TechbloxPreview_Data\Managed\DataLoader.dll - ..\..\ref\TechbloxPreview_Data\Managed\DataLoader.dll + ..\ref\Techblox_Data\Managed\DataLoader.dll + ..\..\ref\Techblox_Data\Managed\DataLoader.dll - ..\ref\TechbloxPreview_Data\Managed\DDNA.dll - ..\..\ref\TechbloxPreview_Data\Managed\DDNA.dll + ..\ref\Techblox_Data\Managed\DDNA.dll + ..\..\ref\Techblox_Data\Managed\DDNA.dll - ..\ref\TechbloxPreview_Data\Managed\EOSSDK.dll - ..\..\ref\TechbloxPreview_Data\Managed\EOSSDK.dll + ..\ref\Techblox_Data\Managed\EOSSDK.dll + ..\..\ref\Techblox_Data\Managed\EOSSDK.dll - ..\ref\TechbloxPreview_Data\Managed\FMODUnity.dll - ..\..\ref\TechbloxPreview_Data\Managed\FMODUnity.dll + ..\ref\Techblox_Data\Managed\FMODUnity.dll + ..\..\ref\Techblox_Data\Managed\FMODUnity.dll - ..\ref\TechbloxPreview_Data\Managed\FMODUnityResonance.dll - ..\..\ref\TechbloxPreview_Data\Managed\FMODUnityResonance.dll + ..\ref\Techblox_Data\Managed\FMODUnityResonance.dll + ..\..\ref\Techblox_Data\Managed\FMODUnityResonance.dll - ..\ref\TechbloxPreview_Data\Managed\FullGame.dll - ..\..\ref\TechbloxPreview_Data\Managed\FullGame.dll + ..\ref\Techblox_Data\Managed\FullGame.dll + ..\..\ref\Techblox_Data\Managed\FullGame.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.AudioBlocks.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.AudioBlocks.dll + ..\ref\Techblox_Data\Managed\Gamecraft.AudioBlocks.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.AudioBlocks.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.BlockEntityFactory.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.BlockEntityFactory.dll + ..\ref\Techblox_Data\Managed\Gamecraft.BlockEntityFactory.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.BlockEntityFactory.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.BlockGroups.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.BlockGroups.dll + ..\ref\Techblox_Data\Managed\Gamecraft.BlockGroups.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.BlockGroups.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.DamagingSurfaceBlock.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.DamagingSurfaceBlock.dll + ..\ref\Techblox_Data\Managed\Gamecraft.Blocks.DamagingSurfaceBlock.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.Blocks.DamagingSurfaceBlock.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.DestructionBlocks.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.DestructionBlocks.dll + ..\ref\Techblox_Data\Managed\Gamecraft.Blocks.DestructionBlocks.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.Blocks.DestructionBlocks.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.GenericPhysicsBlocks.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.GenericPhysicsBlocks.dll + ..\ref\Techblox_Data\Managed\Gamecraft.Blocks.GenericPhysicsBlocks.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.Blocks.GenericPhysicsBlocks.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.LightBlock.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.LightBlock.dll + ..\ref\Techblox_Data\Managed\Gamecraft.Blocks.LightBlock.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.Blocks.LightBlock.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.LogicBlock.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.LogicBlock.dll + ..\ref\Techblox_Data\Managed\Gamecraft.Blocks.LogicBlock.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.Blocks.LogicBlock.dll - ..\ref\TechbloxPreview_Data\Managed\GameCraft.Blocks.ProjectileBlock.dll - ..\..\ref\TechbloxPreview_Data\Managed\GameCraft.Blocks.ProjectileBlock.dll + ..\ref\Techblox_Data\Managed\GameCraft.Blocks.ProjectileBlock.dll + ..\..\ref\Techblox_Data\Managed\GameCraft.Blocks.ProjectileBlock.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.TextBlock.CompositionRoot.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.TextBlock.CompositionRoot.dll + ..\ref\Techblox_Data\Managed\Gamecraft.Blocks.TextBlock.CompositionRoot.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.Blocks.TextBlock.CompositionRoot.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.TimerBlock.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.TimerBlock.dll + ..\ref\Techblox_Data\Managed\Gamecraft.Blocks.TimerBlock.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.Blocks.TimerBlock.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll + ..\ref\Techblox_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.CharacterVulnerability.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.CharacterVulnerability.dll + ..\ref\Techblox_Data\Managed\Gamecraft.CharacterVulnerability.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.CharacterVulnerability.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.CharacterVulnerabilityGui.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.CharacterVulnerabilityGui.dll + ..\ref\Techblox_Data\Managed\Gamecraft.CharacterVulnerabilityGui.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.CharacterVulnerabilityGui.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.ColourPalette.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.ColourPalette.dll + ..\ref\Techblox_Data\Managed\Gamecraft.ColourPalette.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.ColourPalette.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Damage.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Damage.dll + ..\ref\Techblox_Data\Managed\Gamecraft.Damage.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.Damage.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Effects.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Effects.dll + ..\ref\Techblox_Data\Managed\Gamecraft.Effects.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.Effects.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.ExplosionFragments.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.ExplosionFragments.dll + ..\ref\Techblox_Data\Managed\Gamecraft.ExplosionFragments.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.ExplosionFragments.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GraphicsSettings.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GraphicsSettings.dll + ..\ref\Techblox_Data\Managed\Gamecraft.GraphicsSettings.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GraphicsSettings.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.BlueprintInventory.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.BlueprintInventory.dll + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.BlueprintInventory.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.BlueprintInventory.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.BlueprintInventoryMock.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.BlueprintInventoryMock.dll + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.BlueprintInventoryMock.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.BlueprintInventoryMock.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Blueprints.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Blueprints.dll + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.Blueprints.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.Blueprints.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.BlueprintSets.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.BlueprintSets.dll + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.BlueprintSets.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.BlueprintSets.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.GameOptionsScreen.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.GameOptionsScreen.dll + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.GameOptionsScreen.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.GameOptionsScreen.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Hotbar.Blocks.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Hotbar.Blocks.dll + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.Blocks.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.Blocks.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Hotbar.BlueprintsHotbar.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Hotbar.BlueprintsHotbar.dll + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.BlueprintsHotbar.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.BlueprintsHotbar.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Hotbar.Colours.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Hotbar.Colours.dll + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.Colours.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.Colours.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.HUDFeedbackBlocks.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.HUDFeedbackBlocks.dll + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.HUDFeedbackBlocks.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.HUDFeedbackBlocks.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.ModeBar.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.ModeBar.dll + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.ModeBar.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.ModeBar.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.OptionsScreen.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.OptionsScreen.dll + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.OptionsScreen.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.OptionsScreen.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Blocks.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Blocks.dll + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Blocks.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Blocks.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Blueprints.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Blueprints.dll + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Blueprints.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Blueprints.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Colours.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Colours.dll + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Colours.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Colours.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Common.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Common.dll + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Common.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Common.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TimeModeClock.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TimeModeClock.dll + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.TimeModeClock.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.TimeModeClock.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Tweaks.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Tweaks.dll + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.Tweaks.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.Tweaks.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Wires.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Wires.dll + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.Wires.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.Wires.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Wires.Mockup.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Wires.Mockup.dll + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.Wires.Mockup.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.Wires.Mockup.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.InventoryTimeRunning.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.InventoryTimeRunning.dll + ..\ref\Techblox_Data\Managed\Gamecraft.InventoryTimeRunning.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.InventoryTimeRunning.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.JointBlocks.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.JointBlocks.dll + ..\ref\Techblox_Data\Managed\Gamecraft.JointBlocks.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.JointBlocks.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Music.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Music.dll + ..\ref\Techblox_Data\Managed\Gamecraft.Music.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.Music.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.NetStrings.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.NetStrings.dll + ..\ref\Techblox_Data\Managed\Gamecraft.NetStrings.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.NetStrings.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.PerformanceWarnings.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.PerformanceWarnings.dll + ..\ref\Techblox_Data\Managed\Gamecraft.PerformanceWarnings.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.PerformanceWarnings.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.PickupBlck.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.PickupBlck.dll + ..\ref\Techblox_Data\Managed\Gamecraft.PickupBlck.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.PickupBlck.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.PickupsCommon.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.PickupsCommon.dll + ..\ref\Techblox_Data\Managed\Gamecraft.PickupsCommon.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.PickupsCommon.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.PopupMessage.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.PopupMessage.dll + ..\ref\Techblox_Data\Managed\Gamecraft.PopupMessage.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.PopupMessage.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Projectiles.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Projectiles.dll + ..\ref\Techblox_Data\Managed\Gamecraft.Projectiles.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.Projectiles.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Serialization.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Serialization.dll + ..\ref\Techblox_Data\Managed\Gamecraft.Serialization.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.Serialization.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Tweaks.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Tweaks.dll + ..\ref\Techblox_Data\Managed\Gamecraft.Tweaks.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.Tweaks.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Tweaks.Mockup.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Tweaks.Mockup.dll + ..\ref\Techblox_Data\Managed\Gamecraft.Tweaks.Mockup.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.Tweaks.Mockup.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.VisualEffects.Decals.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.VisualEffects.Decals.dll + ..\ref\Techblox_Data\Managed\Gamecraft.VisualEffects.Decals.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.VisualEffects.Decals.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.VisualEffects.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.VisualEffects.dll + ..\ref\Techblox_Data\Managed\Gamecraft.VisualEffects.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.VisualEffects.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Wires.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Wires.dll + ..\ref\Techblox_Data\Managed\Gamecraft.Wires.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.Wires.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Wires.Mockup.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Wires.Mockup.dll + ..\ref\Techblox_Data\Managed\Gamecraft.Wires.Mockup.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.Wires.Mockup.dll - ..\ref\TechbloxPreview_Data\Managed\GameState.dll - ..\..\ref\TechbloxPreview_Data\Managed\GameState.dll + ..\ref\Techblox_Data\Managed\GameState.dll + ..\..\ref\Techblox_Data\Managed\GameState.dll - ..\ref\TechbloxPreview_Data\Managed\GhostShark.Outline.dll - ..\..\ref\TechbloxPreview_Data\Managed\GhostShark.Outline.dll + ..\ref\Techblox_Data\Managed\GhostShark.Outline.dll + ..\..\ref\Techblox_Data\Managed\GhostShark.Outline.dll - ..\ref\TechbloxPreview_Data\Managed\GPUInstancer.CrowdAnimations.dll - ..\..\ref\TechbloxPreview_Data\Managed\GPUInstancer.CrowdAnimations.dll + ..\ref\Techblox_Data\Managed\GPUInstancer.CrowdAnimations.dll + ..\..\ref\Techblox_Data\Managed\GPUInstancer.CrowdAnimations.dll - ..\ref\TechbloxPreview_Data\Managed\GPUInstancer.dll - ..\..\ref\TechbloxPreview_Data\Managed\GPUInstancer.dll + ..\ref\Techblox_Data\Managed\GPUInstancer.dll + ..\..\ref\Techblox_Data\Managed\GPUInstancer.dll - ..\ref\TechbloxPreview_Data\Managed\Havok.Physics.dll - ..\..\ref\TechbloxPreview_Data\Managed\Havok.Physics.dll + ..\ref\Techblox_Data\Managed\Havok.Physics.dll + ..\..\ref\Techblox_Data\Managed\Havok.Physics.dll - ..\ref\TechbloxPreview_Data\Managed\Havok.Physics.Hybrid.dll - ..\..\ref\TechbloxPreview_Data\Managed\Havok.Physics.Hybrid.dll + ..\ref\Techblox_Data\Managed\Havok.Physics.Hybrid.dll + ..\..\ref\Techblox_Data\Managed\Havok.Physics.Hybrid.dll - ..\ref\TechbloxPreview_Data\Managed\JWT.dll - ..\..\ref\TechbloxPreview_Data\Managed\JWT.dll + ..\ref\Techblox_Data\Managed\JWT.dll + ..\..\ref\Techblox_Data\Managed\JWT.dll - ..\ref\TechbloxPreview_Data\Managed\LZ4.dll - ..\..\ref\TechbloxPreview_Data\Managed\LZ4.dll + ..\ref\Techblox_Data\Managed\LZ4.dll + ..\..\ref\Techblox_Data\Managed\LZ4.dll - ..\ref\TechbloxPreview_Data\Managed\mscorlib.dll - ..\..\ref\TechbloxPreview_Data\Managed\mscorlib.dll + ..\ref\Techblox_Data\Managed\mscorlib.dll + ..\..\ref\Techblox_Data\Managed\mscorlib.dll - ..\ref\TechbloxPreview_Data\Managed\MultiplayerNetworking.dll - ..\..\ref\TechbloxPreview_Data\Managed\MultiplayerNetworking.dll + ..\ref\Techblox_Data\Managed\MultiplayerNetworking.dll + ..\..\ref\Techblox_Data\Managed\MultiplayerNetworking.dll - ..\ref\TechbloxPreview_Data\Managed\MultiplayerTest.dll - ..\..\ref\TechbloxPreview_Data\Managed\MultiplayerTest.dll + ..\ref\Techblox_Data\Managed\MultiplayerTest.dll + ..\..\ref\Techblox_Data\Managed\MultiplayerTest.dll - ..\ref\TechbloxPreview_Data\Managed\netstandard.dll - ..\..\ref\TechbloxPreview_Data\Managed\netstandard.dll + ..\ref\Techblox_Data\Managed\netstandard.dll + ..\..\ref\Techblox_Data\Managed\netstandard.dll - ..\ref\TechbloxPreview_Data\Managed\Newtonsoft.Json.dll - ..\..\ref\TechbloxPreview_Data\Managed\Newtonsoft.Json.dll + ..\ref\Techblox_Data\Managed\Newtonsoft.Json.dll + ..\..\ref\Techblox_Data\Managed\Newtonsoft.Json.dll - ..\ref\TechbloxPreview_Data\Managed\RCX.ScreenshotTaker.dll - ..\..\ref\TechbloxPreview_Data\Managed\RCX.ScreenshotTaker.dll + ..\ref\Techblox_Data\Managed\RCX.ScreenshotTaker.dll + ..\..\ref\Techblox_Data\Managed\RCX.ScreenshotTaker.dll - ..\ref\TechbloxPreview_Data\Managed\Rewired_Core.dll - ..\..\ref\TechbloxPreview_Data\Managed\Rewired_Core.dll + ..\ref\Techblox_Data\Managed\Rewired_Core.dll + ..\..\ref\Techblox_Data\Managed\Rewired_Core.dll - ..\ref\TechbloxPreview_Data\Managed\Rewired_Windows.dll - ..\..\ref\TechbloxPreview_Data\Managed\Rewired_Windows.dll + ..\ref\Techblox_Data\Managed\Rewired_Windows.dll + ..\..\ref\Techblox_Data\Managed\Rewired_Windows.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftECS.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftECS.dll + ..\ref\Techblox_Data\Managed\RobocraftECS.dll + ..\..\ref\Techblox_Data\Managed\RobocraftECS.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.AccountPreferences.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.AccountPreferences.dll + ..\ref\Techblox_Data\Managed\RobocraftX.AccountPreferences.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.AccountPreferences.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Blocks.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Blocks.dll + ..\ref\Techblox_Data\Managed\RobocraftX.Blocks.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.Blocks.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Blocks.Ghost.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Blocks.Ghost.dll + ..\ref\Techblox_Data\Managed\RobocraftX.Blocks.Ghost.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.Blocks.Ghost.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Blocks.Triggers.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Blocks.Triggers.dll + ..\ref\Techblox_Data\Managed\RobocraftX.Blocks.Triggers.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.Blocks.Triggers.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Building.BoxSelect.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Building.BoxSelect.dll + ..\ref\Techblox_Data\Managed\RobocraftX.Building.BoxSelect.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.Building.BoxSelect.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Building.Jobs.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Building.Jobs.dll + ..\ref\Techblox_Data\Managed\RobocraftX.Building.Jobs.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.Building.Jobs.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Character.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Character.dll + ..\ref\Techblox_Data\Managed\RobocraftX.Character.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.Character.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Common.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Common.dll + ..\ref\Techblox_Data\Managed\RobocraftX.Common.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.Common.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.ControlsScreen.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.ControlsScreen.dll + ..\ref\Techblox_Data\Managed\RobocraftX.ControlsScreen.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.ControlsScreen.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Crosshair.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Crosshair.dll + ..\ref\Techblox_Data\Managed\RobocraftX.Crosshair.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.Crosshair.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.FrontEnd.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.FrontEnd.dll + ..\ref\Techblox_Data\Managed\RobocraftX.FrontEnd.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.FrontEnd.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.BlockLabel.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.BlockLabel.dll + ..\ref\Techblox_Data\Managed\RobocraftX.GUI.BlockLabel.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.BlockLabel.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.DebugDisplay.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.DebugDisplay.dll + ..\ref\Techblox_Data\Managed\RobocraftX.GUI.DebugDisplay.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.DebugDisplay.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.dll + ..\ref\Techblox_Data\Managed\RobocraftX.GUI.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Hotbar.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Hotbar.dll + ..\ref\Techblox_Data\Managed\RobocraftX.GUI.Hotbar.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.Hotbar.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.BlocksInventory.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.BlocksInventory.dll + ..\ref\Techblox_Data\Managed\RobocraftX.GUI.Inventory.BlocksInventory.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.Inventory.BlocksInventory.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.ColourInventory.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.ColourInventory.dll + ..\ref\Techblox_Data\Managed\RobocraftX.GUI.Inventory.ColourInventory.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.Inventory.ColourInventory.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.dll + ..\ref\Techblox_Data\Managed\RobocraftX.GUI.Inventory.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.Inventory.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.PauseMenu.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.PauseMenu.dll + ..\ref\Techblox_Data\Managed\RobocraftX.GUI.PauseMenu.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.PauseMenu.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.ScaleGhost.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.ScaleGhost.dll + ..\ref\Techblox_Data\Managed\RobocraftX.GUI.ScaleGhost.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.ScaleGhost.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.TabsBar.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.TabsBar.dll + ..\ref\Techblox_Data\Managed\RobocraftX.GUI.TabsBar.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.TabsBar.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Input.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Input.dll + ..\ref\Techblox_Data\Managed\RobocraftX.Input.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.Input.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.MachineEditor.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.MachineEditor.dll + ..\ref\Techblox_Data\Managed\RobocraftX.MachineEditor.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.MachineEditor.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.MainGame.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.MainGame.dll + ..\ref\Techblox_Data\Managed\RobocraftX.MainGame.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.MainGame.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.MainSimulation.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.MainSimulation.dll + ..\ref\Techblox_Data\Managed\RobocraftX.MainSimulation.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.MainSimulation.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.MockCharacter.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.MockCharacter.dll + ..\ref\Techblox_Data\Managed\RobocraftX.MockCharacter.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.MockCharacter.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Multiplayer.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Multiplayer.dll + ..\ref\Techblox_Data\Managed\RobocraftX.Multiplayer.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.Multiplayer.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Multiplayer.GUI.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Multiplayer.GUI.dll + ..\ref\Techblox_Data\Managed\RobocraftX.Multiplayer.GUI.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.Multiplayer.GUI.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll + ..\ref\Techblox_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Multiplayer.Serializers.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Multiplayer.Serializers.dll + ..\ref\Techblox_Data\Managed\RobocraftX.Multiplayer.Serializers.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.Multiplayer.Serializers.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.MultiplayerInput.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.MultiplayerInput.dll + ..\ref\Techblox_Data\Managed\RobocraftX.MultiplayerInput.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.MultiplayerInput.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.ObjectIdBlocks.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.ObjectIdBlocks.dll + ..\ref\Techblox_Data\Managed\RobocraftX.ObjectIdBlocks.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.ObjectIdBlocks.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Party.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Party.dll + ..\ref\Techblox_Data\Managed\RobocraftX.Party.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.Party.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Physics.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Physics.dll + ..\ref\Techblox_Data\Managed\RobocraftX.Physics.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.Physics.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.PilotSeat.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.PilotSeat.dll + ..\ref\Techblox_Data\Managed\RobocraftX.PilotSeat.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.PilotSeat.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Player.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Player.dll + ..\ref\Techblox_Data\Managed\RobocraftX.Player.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.Player.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Rendering.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Rendering.dll + ..\ref\Techblox_Data\Managed\RobocraftX.Rendering.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.Rendering.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Rendering.Mock.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Rendering.Mock.dll + ..\ref\Techblox_Data\Managed\RobocraftX.Rendering.Mock.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.Rendering.Mock.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.SaveAndLoad.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.SaveAndLoad.dll + ..\ref\Techblox_Data\Managed\RobocraftX.SaveAndLoad.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.SaveAndLoad.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.SaveGameDialog.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.SaveGameDialog.dll + ..\ref\Techblox_Data\Managed\RobocraftX.SaveGameDialog.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.SaveGameDialog.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Services.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Services.dll + ..\ref\Techblox_Data\Managed\RobocraftX.Services.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.Services.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.SignalHandling.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.SignalHandling.dll + ..\ref\Techblox_Data\Managed\RobocraftX.SignalHandling.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.SignalHandling.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.SpawnPoints.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.SpawnPoints.dll + ..\ref\Techblox_Data\Managed\RobocraftX.SpawnPoints.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.SpawnPoints.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.StateSync.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.StateSync.dll + ..\ref\Techblox_Data\Managed\RobocraftX.StateSync.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.StateSync.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX_TextBlock.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX_TextBlock.dll + ..\ref\Techblox_Data\Managed\RobocraftX_TextBlock.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX_TextBlock.dll - ..\ref\TechbloxPreview_Data\Managed\RobocratX.SimulationMockCompositionRoot.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocratX.SimulationMockCompositionRoot.dll + ..\ref\Techblox_Data\Managed\RobocratX.SimulationMockCompositionRoot.dll + ..\..\ref\Techblox_Data\Managed\RobocratX.SimulationMockCompositionRoot.dll - ..\ref\TechbloxPreview_Data\Managed\SpecializedDescriptors.dll - ..\..\ref\TechbloxPreview_Data\Managed\SpecializedDescriptors.dll + ..\ref\Techblox_Data\Managed\SpecializedDescriptors.dll + ..\..\ref\Techblox_Data\Managed\SpecializedDescriptors.dll - ..\ref\TechbloxPreview_Data\Managed\StringFormatter.dll - ..\..\ref\TechbloxPreview_Data\Managed\StringFormatter.dll + ..\ref\Techblox_Data\Managed\StringFormatter.dll + ..\..\ref\Techblox_Data\Managed\StringFormatter.dll - ..\ref\TechbloxPreview_Data\Managed\Svelto.Common.dll - ..\..\ref\TechbloxPreview_Data\Managed\Svelto.Common.dll + ..\ref\Techblox_Data\Managed\Svelto.Common.dll + ..\..\ref\Techblox_Data\Managed\Svelto.Common.dll - ..\ref\TechbloxPreview_Data\Managed\Svelto.ECS.dll - ..\..\ref\TechbloxPreview_Data\Managed\Svelto.ECS.dll + ..\ref\Techblox_Data\Managed\Svelto.ECS.dll + ..\..\ref\Techblox_Data\Managed\Svelto.ECS.dll - ..\ref\TechbloxPreview_Data\Managed\Svelto.ECS.GUI.dll - ..\..\ref\TechbloxPreview_Data\Managed\Svelto.ECS.GUI.dll + ..\ref\Techblox_Data\Managed\Svelto.ECS.GUI.dll + ..\..\ref\Techblox_Data\Managed\Svelto.ECS.GUI.dll - ..\ref\TechbloxPreview_Data\Managed\Svelto.Services.dll - ..\..\ref\TechbloxPreview_Data\Managed\Svelto.Services.dll + ..\ref\Techblox_Data\Managed\Svelto.Services.dll + ..\..\ref\Techblox_Data\Managed\Svelto.Services.dll - ..\ref\TechbloxPreview_Data\Managed\Svelto.Tasks.dll - ..\..\ref\TechbloxPreview_Data\Managed\Svelto.Tasks.dll + ..\ref\Techblox_Data\Managed\Svelto.Tasks.dll + ..\..\ref\Techblox_Data\Managed\Svelto.Tasks.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.AutoForward.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.AutoForward.dll + ..\ref\Techblox_Data\Managed\Techblox.AutoForward.dll + ..\..\ref\Techblox_Data\Managed\Techblox.AutoForward.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.Backend.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Backend.dll + ..\ref\Techblox_Data\Managed\Techblox.Backend.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Backend.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.Building.Rules.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Building.Rules.dll + ..\ref\Techblox_Data\Managed\Techblox.Building.Rules.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Building.Rules.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.BuildingDrone.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.BuildingDrone.dll + ..\ref\Techblox_Data\Managed\Techblox.BuildingDrone.dll + ..\..\ref\Techblox_Data\Managed\Techblox.BuildingDrone.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.Camera.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Camera.dll + ..\ref\Techblox_Data\Managed\Techblox.Camera.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Camera.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.ContextSensitiveTextHint.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.ContextSensitiveTextHint.dll + ..\ref\Techblox_Data\Managed\Techblox.ContextSensitiveTextHint.dll + ..\..\ref\Techblox_Data\Managed\Techblox.ContextSensitiveTextHint.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.EngineBlock.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.EngineBlock.dll + ..\ref\Techblox_Data\Managed\Techblox.EngineBlock.dll + ..\..\ref\Techblox_Data\Managed\Techblox.EngineBlock.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.Environment.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Environment.dll + ..\ref\Techblox_Data\Managed\Techblox.Environment.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Environment.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Building.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Building.dll + ..\ref\Techblox_Data\Managed\Techblox.GUI.Building.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Building.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.BuildRules.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.BuildRules.dll + ..\ref\Techblox_Data\Managed\Techblox.GUI.BuildRules.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.BuildRules.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.BuildRules.MockUps.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.BuildRules.MockUps.dll + ..\ref\Techblox_Data\Managed\Techblox.GUI.BuildRules.MockUps.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.BuildRules.MockUps.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.dll + ..\ref\Techblox_Data\Managed\Techblox.GUI.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Hotbar.Materials.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Hotbar.Materials.dll + ..\ref\Techblox_Data\Managed\Techblox.GUI.Hotbar.Materials.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Hotbar.Materials.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Inventory.Common.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Inventory.Common.dll + ..\ref\Techblox_Data\Managed\Techblox.GUI.Inventory.Common.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Inventory.Common.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Inventory.Materials.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Inventory.Materials.dll + ..\ref\Techblox_Data\Managed\Techblox.GUI.Inventory.Materials.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Inventory.Materials.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Login.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Login.dll + ..\ref\Techblox_Data\Managed\Techblox.GUI.Login.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Login.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.MyGamesScreen.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.MyGamesScreen.dll + ..\ref\Techblox_Data\Managed\Techblox.GUI.MyGamesScreen.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.MyGamesScreen.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Notifications.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Notifications.dll + ..\ref\Techblox_Data\Managed\Techblox.GUI.Notifications.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Notifications.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Notifications.MockUps.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Notifications.MockUps.dll + ..\ref\Techblox_Data\Managed\Techblox.GUI.Notifications.MockUps.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Notifications.MockUps.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.TabsBar.Materials.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.TabsBar.Materials.dll + ..\ref\Techblox_Data\Managed\Techblox.GUI.TabsBar.Materials.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.TabsBar.Materials.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.InputCapture.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.InputCapture.dll + ..\ref\Techblox_Data\Managed\Techblox.InputCapture.dll + ..\..\ref\Techblox_Data\Managed\Techblox.InputCapture.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.Pointer.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Pointer.dll + ..\ref\Techblox_Data\Managed\Techblox.Pointer.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Pointer.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.SaveGamesConversion.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.SaveGamesConversion.dll + ..\ref\Techblox_Data\Managed\Techblox.SaveGamesConversion.dll + ..\..\ref\Techblox_Data\Managed\Techblox.SaveGamesConversion.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.Services.Eos.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Services.Eos.dll + ..\ref\Techblox_Data\Managed\Techblox.Services.Eos.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Services.Eos.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.SwitchAnimation.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.SwitchAnimation.dll + ..\ref\Techblox_Data\Managed\Techblox.SwitchAnimation.dll + ..\..\ref\Techblox_Data\Managed\Techblox.SwitchAnimation.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.WheelRigBlock.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.WheelRigBlock.dll + ..\ref\Techblox_Data\Managed\Techblox.WheelRigBlock.dll + ..\..\ref\Techblox_Data\Managed\Techblox.WheelRigBlock.dll - ..\ref\TechbloxPreview_Data\Managed\UniTask.Addressables.dll - ..\..\ref\TechbloxPreview_Data\Managed\UniTask.Addressables.dll + ..\ref\Techblox_Data\Managed\UniTask.Addressables.dll + ..\..\ref\Techblox_Data\Managed\UniTask.Addressables.dll - ..\ref\TechbloxPreview_Data\Managed\UniTask.dll - ..\..\ref\TechbloxPreview_Data\Managed\UniTask.dll + ..\ref\Techblox_Data\Managed\UniTask.dll + ..\..\ref\Techblox_Data\Managed\UniTask.dll - ..\ref\TechbloxPreview_Data\Managed\UniTask.DOTween.dll - ..\..\ref\TechbloxPreview_Data\Managed\UniTask.DOTween.dll + ..\ref\Techblox_Data\Managed\UniTask.DOTween.dll + ..\..\ref\Techblox_Data\Managed\UniTask.DOTween.dll - ..\ref\TechbloxPreview_Data\Managed\UniTask.Linq.dll - ..\..\ref\TechbloxPreview_Data\Managed\UniTask.Linq.dll + ..\ref\Techblox_Data\Managed\UniTask.Linq.dll + ..\..\ref\Techblox_Data\Managed\UniTask.Linq.dll - ..\ref\TechbloxPreview_Data\Managed\UniTask.TextMeshPro.dll - ..\..\ref\TechbloxPreview_Data\Managed\UniTask.TextMeshPro.dll + ..\ref\Techblox_Data\Managed\UniTask.TextMeshPro.dll + ..\..\ref\Techblox_Data\Managed\UniTask.TextMeshPro.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Addressables.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Addressables.dll + ..\ref\Techblox_Data\Managed\Unity.Addressables.dll + ..\..\ref\Techblox_Data\Managed\Unity.Addressables.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.dll + ..\ref\Techblox_Data\Managed\Unity.Burst.Cecil.dll + ..\..\ref\Techblox_Data\Managed\Unity.Burst.Cecil.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.Mdb.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.Mdb.dll + ..\ref\Techblox_Data\Managed\Unity.Burst.Cecil.Mdb.dll + ..\..\ref\Techblox_Data\Managed\Unity.Burst.Cecil.Mdb.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.Pdb.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.Pdb.dll + ..\ref\Techblox_Data\Managed\Unity.Burst.Cecil.Pdb.dll + ..\..\ref\Techblox_Data\Managed\Unity.Burst.Cecil.Pdb.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.Rocks.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.Rocks.dll + ..\ref\Techblox_Data\Managed\Unity.Burst.Cecil.Rocks.dll + ..\..\ref\Techblox_Data\Managed\Unity.Burst.Cecil.Rocks.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Burst.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Burst.dll + ..\ref\Techblox_Data\Managed\Unity.Burst.dll + ..\..\ref\Techblox_Data\Managed\Unity.Burst.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Unsafe.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Unsafe.dll + ..\ref\Techblox_Data\Managed\Unity.Burst.Unsafe.dll + ..\..\ref\Techblox_Data\Managed\Unity.Burst.Unsafe.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Collections.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Collections.dll + ..\ref\Techblox_Data\Managed\Unity.Collections.dll + ..\..\ref\Techblox_Data\Managed\Unity.Collections.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Collections.LowLevel.ILSupport.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Collections.LowLevel.ILSupport.dll + ..\ref\Techblox_Data\Managed\Unity.Collections.LowLevel.ILSupport.dll + ..\..\ref\Techblox_Data\Managed\Unity.Collections.LowLevel.ILSupport.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Deformations.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Deformations.dll + ..\ref\Techblox_Data\Managed\Unity.Deformations.dll + ..\..\ref\Techblox_Data\Managed\Unity.Deformations.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Entities.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Entities.dll + ..\ref\Techblox_Data\Managed\Unity.Entities.dll + ..\..\ref\Techblox_Data\Managed\Unity.Entities.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Entities.Hybrid.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Entities.Hybrid.dll + ..\ref\Techblox_Data\Managed\Unity.Entities.Hybrid.dll + ..\..\ref\Techblox_Data\Managed\Unity.Entities.Hybrid.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.InternalAPIEngineBridge.012.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.InternalAPIEngineBridge.012.dll + ..\ref\Techblox_Data\Managed\Unity.InternalAPIEngineBridge.012.dll + ..\..\ref\Techblox_Data\Managed\Unity.InternalAPIEngineBridge.012.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Jobs.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Jobs.dll + ..\ref\Techblox_Data\Managed\Unity.Jobs.dll + ..\..\ref\Techblox_Data\Managed\Unity.Jobs.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Mathematics.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Mathematics.dll + ..\ref\Techblox_Data\Managed\Unity.Mathematics.dll + ..\..\ref\Techblox_Data\Managed\Unity.Mathematics.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Mathematics.Extensions.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Mathematics.Extensions.dll + ..\ref\Techblox_Data\Managed\Unity.Mathematics.Extensions.dll + ..\..\ref\Techblox_Data\Managed\Unity.Mathematics.Extensions.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll + ..\ref\Techblox_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll + ..\..\ref\Techblox_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.MemoryProfiler.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.MemoryProfiler.dll + ..\ref\Techblox_Data\Managed\Unity.MemoryProfiler.dll + ..\..\ref\Techblox_Data\Managed\Unity.MemoryProfiler.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Physics.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Physics.dll + ..\ref\Techblox_Data\Managed\Unity.Physics.dll + ..\..\ref\Techblox_Data\Managed\Unity.Physics.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Physics.Hybrid.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Physics.Hybrid.dll + ..\ref\Techblox_Data\Managed\Unity.Physics.Hybrid.dll + ..\..\ref\Techblox_Data\Managed\Unity.Physics.Hybrid.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Platforms.Common.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Platforms.Common.dll + ..\ref\Techblox_Data\Managed\Unity.Platforms.Common.dll + ..\..\ref\Techblox_Data\Managed\Unity.Platforms.Common.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Properties.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Properties.dll + ..\ref\Techblox_Data\Managed\Unity.Properties.dll + ..\..\ref\Techblox_Data\Managed\Unity.Properties.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Properties.Reflection.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Properties.Reflection.dll + ..\ref\Techblox_Data\Managed\Unity.Properties.Reflection.dll + ..\..\ref\Techblox_Data\Managed\Unity.Properties.Reflection.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Properties.UI.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Properties.UI.dll + ..\ref\Techblox_Data\Managed\Unity.Properties.UI.dll + ..\..\ref\Techblox_Data\Managed\Unity.Properties.UI.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Recorder.Base.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Recorder.Base.dll + ..\ref\Techblox_Data\Managed\Unity.Recorder.Base.dll + ..\..\ref\Techblox_Data\Managed\Unity.Recorder.Base.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Recorder.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Recorder.dll + ..\ref\Techblox_Data\Managed\Unity.Recorder.dll + ..\..\ref\Techblox_Data\Managed\Unity.Recorder.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll + ..\ref\Techblox_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll + ..\..\ref\Techblox_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll + ..\ref\Techblox_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll + ..\..\ref\Techblox_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.HighDefinition.Config.Runtime.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.HighDefinition.Config.Runtime.dll + ..\ref\Techblox_Data\Managed\Unity.RenderPipelines.HighDefinition.Config.Runtime.dll + ..\..\ref\Techblox_Data\Managed\Unity.RenderPipelines.HighDefinition.Config.Runtime.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.HighDefinition.Runtime.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.HighDefinition.Runtime.dll + ..\ref\Techblox_Data\Managed\Unity.RenderPipelines.HighDefinition.Runtime.dll + ..\..\ref\Techblox_Data\Managed\Unity.RenderPipelines.HighDefinition.Runtime.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll + ..\ref\Techblox_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll + ..\..\ref\Techblox_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.ResourceManager.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.ResourceManager.dll + ..\ref\Techblox_Data\Managed\Unity.ResourceManager.dll + ..\..\ref\Techblox_Data\Managed\Unity.ResourceManager.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Scenes.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Scenes.dll + ..\ref\Techblox_Data\Managed\Unity.Scenes.dll + ..\..\ref\Techblox_Data\Managed\Unity.Scenes.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.ScriptableBuildPipeline.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.ScriptableBuildPipeline.dll + ..\ref\Techblox_Data\Managed\Unity.ScriptableBuildPipeline.dll + ..\..\ref\Techblox_Data\Managed\Unity.ScriptableBuildPipeline.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Serialization.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Serialization.dll + ..\ref\Techblox_Data\Managed\Unity.Serialization.dll + ..\..\ref\Techblox_Data\Managed\Unity.Serialization.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.TextMeshPro.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.TextMeshPro.dll + ..\ref\Techblox_Data\Managed\Unity.TextMeshPro.dll + ..\..\ref\Techblox_Data\Managed\Unity.TextMeshPro.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Timeline.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Timeline.dll + ..\ref\Techblox_Data\Managed\Unity.Timeline.dll + ..\..\ref\Techblox_Data\Managed\Unity.Timeline.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Transforms.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Transforms.dll + ..\ref\Techblox_Data\Managed\Unity.Transforms.dll + ..\..\ref\Techblox_Data\Managed\Unity.Transforms.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Transforms.Hybrid.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Transforms.Hybrid.dll + ..\ref\Techblox_Data\Managed\Unity.Transforms.Hybrid.dll + ..\..\ref\Techblox_Data\Managed\Unity.Transforms.Hybrid.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.VisualEffectGraph.Runtime.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.VisualEffectGraph.Runtime.dll + ..\ref\Techblox_Data\Managed\Unity.VisualEffectGraph.Runtime.dll + ..\..\ref\Techblox_Data\Managed\Unity.VisualEffectGraph.Runtime.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.AccessibilityModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.AccessibilityModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.AccessibilityModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.AccessibilityModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.AIModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.AIModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.AIModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.AIModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.AndroidJNIModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.AndroidJNIModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.AndroidJNIModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.AndroidJNIModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.AnimationModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.AnimationModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.AnimationModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.AnimationModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.ARModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.ARModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.ARModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.ARModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.AssetBundleModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.AssetBundleModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.AssetBundleModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.AssetBundleModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.AudioModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.AudioModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.AudioModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.AudioModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.ClothModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.ClothModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.ClothModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.ClothModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.ClusterInputModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.ClusterInputModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.ClusterInputModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.ClusterInputModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.ClusterRendererModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.ClusterRendererModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.ClusterRendererModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.ClusterRendererModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.CoreModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.CoreModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.CoreModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.CoreModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.CrashReportingModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.CrashReportingModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.CrashReportingModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.CrashReportingModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.DirectorModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.DirectorModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.DirectorModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.DirectorModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.dll + ..\ref\Techblox_Data\Managed\UnityEngine.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.DSPGraphModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.DSPGraphModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.DSPGraphModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.DSPGraphModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.GameCenterModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.GameCenterModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.GameCenterModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.GameCenterModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.GIModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.GIModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.GIModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.GIModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.GridModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.GridModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.GridModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.GridModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.HotReloadModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.HotReloadModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.HotReloadModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.HotReloadModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.ImageConversionModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.ImageConversionModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.ImageConversionModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.ImageConversionModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.IMGUIModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.IMGUIModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.IMGUIModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.IMGUIModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.InputLegacyModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.InputLegacyModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.InputLegacyModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.InputLegacyModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.InputModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.InputModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.InputModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.InputModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.JSONSerializeModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.JSONSerializeModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.JSONSerializeModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.JSONSerializeModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.LocalizationModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.LocalizationModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.LocalizationModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.LocalizationModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.ParticleSystemModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.ParticleSystemModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.ParticleSystemModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.ParticleSystemModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.PerformanceReportingModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.PerformanceReportingModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.PerformanceReportingModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.PerformanceReportingModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.Physics2DModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.Physics2DModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.Physics2DModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.Physics2DModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.PhysicsModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.PhysicsModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.PhysicsModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.PhysicsModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.ProfilerModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.ProfilerModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.ProfilerModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.ProfilerModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.ScreenCaptureModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.ScreenCaptureModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.ScreenCaptureModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.ScreenCaptureModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.SharedInternalsModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.SharedInternalsModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.SharedInternalsModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.SharedInternalsModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.SpriteMaskModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.SpriteMaskModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.SpriteMaskModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.SpriteMaskModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.SpriteShapeModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.SpriteShapeModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.SpriteShapeModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.SpriteShapeModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.StreamingModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.StreamingModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.StreamingModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.StreamingModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.SubstanceModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.SubstanceModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.SubstanceModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.SubstanceModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.SubsystemsModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.SubsystemsModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.SubsystemsModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.SubsystemsModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.TerrainModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.TerrainModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.TerrainModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.TerrainModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.TerrainPhysicsModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.TerrainPhysicsModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.TerrainPhysicsModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.TerrainPhysicsModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.TextCoreModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.TextCoreModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.TextCoreModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.TextCoreModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.TextRenderingModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.TextRenderingModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.TextRenderingModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.TextRenderingModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.TilemapModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.TilemapModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.TilemapModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.TilemapModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.TLSModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.TLSModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.TLSModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.TLSModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UI.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UI.dll + ..\ref\Techblox_Data\Managed\UnityEngine.UI.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.UI.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UIElementsModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UIElementsModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.UIElementsModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.UIElementsModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UIElementsNativeModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UIElementsNativeModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.UIElementsNativeModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.UIElementsNativeModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UIModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UIModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.UIModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.UIModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UmbraModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UmbraModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.UmbraModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.UmbraModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UNETModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UNETModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.UNETModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.UNETModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityAnalyticsModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityAnalyticsModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.UnityAnalyticsModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.UnityAnalyticsModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityConnectModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityConnectModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.UnityConnectModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.UnityConnectModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityCurlModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityCurlModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.UnityCurlModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.UnityCurlModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityTestProtocolModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityTestProtocolModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.UnityTestProtocolModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.UnityTestProtocolModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.VehiclesModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.VehiclesModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.VehiclesModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.VehiclesModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.VFXModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.VFXModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.VFXModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.VFXModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.VideoModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.VideoModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.VideoModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.VideoModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.VirtualTexturingModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.VirtualTexturingModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.VirtualTexturingModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.VirtualTexturingModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.VRModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.VRModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.VRModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.VRModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.WindModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.WindModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.WindModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.WindModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.XRModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.XRModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.XRModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.XRModule.dll - ..\ref\TechbloxPreview_Data\Managed\uREPL.dll - ..\..\ref\TechbloxPreview_Data\Managed\uREPL.dll + ..\ref\Techblox_Data\Managed\uREPL.dll + ..\..\ref\Techblox_Data\Managed\uREPL.dll - ..\ref\TechbloxPreview_Data\Managed\VisualProfiler.dll - ..\..\ref\TechbloxPreview_Data\Managed\VisualProfiler.dll + ..\ref\Techblox_Data\Managed\VisualProfiler.dll + ..\..\ref\Techblox_Data\Managed\VisualProfiler.dll diff --git a/TechbloxModdingAPI/TechbloxModdingAPI.csproj b/TechbloxModdingAPI/TechbloxModdingAPI.csproj index 95927f8..cf3a157 100644 --- a/TechbloxModdingAPI/TechbloxModdingAPI.csproj +++ b/TechbloxModdingAPI/TechbloxModdingAPI.csproj @@ -29,1208 +29,1208 @@ - ..\ref\TechbloxPreview_Data\Managed\IllusionInjector.dll - ..\..\ref\TechbloxPreview_Data\Managed\IllusionInjector.dll + ..\ref\Techblox_Data\Managed\IllusionInjector.dll + ..\..\ref\Techblox_Data\Managed\IllusionInjector.dll - ..\ref\TechbloxPreview_Data\Managed\IllusionPlugin.dll - ..\..\ref\TechbloxPreview_Data\Managed\IllusionPlugin.dll + ..\ref\Techblox_Data\Managed\IllusionPlugin.dll + ..\..\ref\Techblox_Data\Managed\IllusionPlugin.dll - ..\ref\TechbloxPreview_Data\Managed\Analytics.dll - ..\..\ref\TechbloxPreview_Data\Managed\Analytics.dll + ..\ref\Techblox_Data\Managed\Analytics.dll + ..\..\ref\Techblox_Data\Managed\Analytics.dll - ..\ref\TechbloxPreview_Data\Managed\Assembly-CSharp-firstpass.dll - ..\..\ref\TechbloxPreview_Data\Managed\Assembly-CSharp-firstpass.dll + ..\ref\Techblox_Data\Managed\Assembly-CSharp-firstpass.dll + ..\..\ref\Techblox_Data\Managed\Assembly-CSharp-firstpass.dll - ..\ref\TechbloxPreview_Data\Managed\Assembly-CSharp.dll - ..\..\ref\TechbloxPreview_Data\Managed\Assembly-CSharp.dll + ..\ref\Techblox_Data\Managed\Assembly-CSharp.dll + ..\..\ref\Techblox_Data\Managed\Assembly-CSharp.dll - ..\ref\TechbloxPreview_Data\Managed\BevelEffect.dll - ..\..\ref\TechbloxPreview_Data\Managed\BevelEffect.dll + ..\ref\Techblox_Data\Managed\BevelEffect.dll + ..\..\ref\Techblox_Data\Managed\BevelEffect.dll - ..\ref\TechbloxPreview_Data\Managed\Blocks.HUDFeedbackBlocks.dll - ..\..\ref\TechbloxPreview_Data\Managed\Blocks.HUDFeedbackBlocks.dll + ..\ref\Techblox_Data\Managed\Blocks.HUDFeedbackBlocks.dll + ..\..\ref\Techblox_Data\Managed\Blocks.HUDFeedbackBlocks.dll - ..\ref\TechbloxPreview_Data\Managed\Boxophobic.TheVehetationEngine.Runtime.dll - ..\..\ref\TechbloxPreview_Data\Managed\Boxophobic.TheVehetationEngine.Runtime.dll + ..\ref\Techblox_Data\Managed\Boxophobic.TheVehetationEngine.Runtime.dll + ..\..\ref\Techblox_Data\Managed\Boxophobic.TheVehetationEngine.Runtime.dll - ..\ref\TechbloxPreview_Data\Managed\Boxophobic.Utils.Scripts.dll - ..\..\ref\TechbloxPreview_Data\Managed\Boxophobic.Utils.Scripts.dll + ..\ref\Techblox_Data\Managed\Boxophobic.Utils.Scripts.dll + ..\..\ref\Techblox_Data\Managed\Boxophobic.Utils.Scripts.dll - ..\ref\TechbloxPreview_Data\Managed\DataLoader.dll - ..\..\ref\TechbloxPreview_Data\Managed\DataLoader.dll + ..\ref\Techblox_Data\Managed\DataLoader.dll + ..\..\ref\Techblox_Data\Managed\DataLoader.dll - ..\ref\TechbloxPreview_Data\Managed\DDNA.dll - ..\..\ref\TechbloxPreview_Data\Managed\DDNA.dll + ..\ref\Techblox_Data\Managed\DDNA.dll + ..\..\ref\Techblox_Data\Managed\DDNA.dll - ..\ref\TechbloxPreview_Data\Managed\EasyButtons.dll - ..\..\ref\TechbloxPreview_Data\Managed\EasyButtons.dll + ..\ref\Techblox_Data\Managed\EasyButtons.dll + ..\..\ref\Techblox_Data\Managed\EasyButtons.dll - ..\ref\TechbloxPreview_Data\Managed\EOSSDK.dll - ..\..\ref\TechbloxPreview_Data\Managed\EOSSDK.dll + ..\ref\Techblox_Data\Managed\EOSSDK.dll + ..\..\ref\Techblox_Data\Managed\EOSSDK.dll - ..\ref\TechbloxPreview_Data\Managed\FMODUnity.dll - ..\..\ref\TechbloxPreview_Data\Managed\FMODUnity.dll + ..\ref\Techblox_Data\Managed\FMODUnity.dll + ..\..\ref\Techblox_Data\Managed\FMODUnity.dll - ..\ref\TechbloxPreview_Data\Managed\FMODUnityResonance.dll - ..\..\ref\TechbloxPreview_Data\Managed\FMODUnityResonance.dll + ..\ref\Techblox_Data\Managed\FMODUnityResonance.dll + ..\..\ref\Techblox_Data\Managed\FMODUnityResonance.dll - ..\ref\TechbloxPreview_Data\Managed\FullGame.dll - ..\..\ref\TechbloxPreview_Data\Managed\FullGame.dll + ..\ref\Techblox_Data\Managed\FullGame.dll + ..\..\ref\Techblox_Data\Managed\FullGame.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.AudioBlocks.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.AudioBlocks.dll + ..\ref\Techblox_Data\Managed\Gamecraft.AudioBlocks.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.AudioBlocks.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.BlockEntityFactory.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.BlockEntityFactory.dll + ..\ref\Techblox_Data\Managed\Gamecraft.BlockEntityFactory.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.BlockEntityFactory.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.BlockGroups.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.BlockGroups.dll + ..\ref\Techblox_Data\Managed\Gamecraft.BlockGroups.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.BlockGroups.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.DamagingSurfaceBlock.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.DamagingSurfaceBlock.dll + ..\ref\Techblox_Data\Managed\Gamecraft.Blocks.DamagingSurfaceBlock.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.Blocks.DamagingSurfaceBlock.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.DestructionBlocks.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.DestructionBlocks.dll + ..\ref\Techblox_Data\Managed\Gamecraft.Blocks.DestructionBlocks.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.Blocks.DestructionBlocks.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.GenericPhysicsBlocks.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.GenericPhysicsBlocks.dll + ..\ref\Techblox_Data\Managed\Gamecraft.Blocks.GenericPhysicsBlocks.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.Blocks.GenericPhysicsBlocks.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.LogicBlock.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.LogicBlock.dll + ..\ref\Techblox_Data\Managed\Gamecraft.Blocks.LogicBlock.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.Blocks.LogicBlock.dll - ..\ref\TechbloxPreview_Data\Managed\GameCraft.Blocks.ProjectileBlock.dll - ..\..\ref\TechbloxPreview_Data\Managed\GameCraft.Blocks.ProjectileBlock.dll + ..\ref\Techblox_Data\Managed\GameCraft.Blocks.ProjectileBlock.dll + ..\..\ref\Techblox_Data\Managed\GameCraft.Blocks.ProjectileBlock.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.TextBlock.CompositionRoot.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.TextBlock.CompositionRoot.dll + ..\ref\Techblox_Data\Managed\Gamecraft.Blocks.TextBlock.CompositionRoot.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.Blocks.TextBlock.CompositionRoot.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.TimerBlock.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.TimerBlock.dll + ..\ref\Techblox_Data\Managed\Gamecraft.Blocks.TimerBlock.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.Blocks.TimerBlock.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll + ..\ref\Techblox_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.CharacterVulnerability.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.CharacterVulnerability.dll + ..\ref\Techblox_Data\Managed\Gamecraft.CharacterVulnerability.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.CharacterVulnerability.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.CharacterVulnerabilityGui.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.CharacterVulnerabilityGui.dll + ..\ref\Techblox_Data\Managed\Gamecraft.CharacterVulnerabilityGui.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.CharacterVulnerabilityGui.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.ColourPalette.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.ColourPalette.dll + ..\ref\Techblox_Data\Managed\Gamecraft.ColourPalette.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.ColourPalette.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Damage.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Damage.dll + ..\ref\Techblox_Data\Managed\Gamecraft.Damage.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.Damage.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Effects.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Effects.dll + ..\ref\Techblox_Data\Managed\Gamecraft.Effects.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.Effects.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.ExplosionFragments.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.ExplosionFragments.dll + ..\ref\Techblox_Data\Managed\Gamecraft.ExplosionFragments.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.ExplosionFragments.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GraphicsSettings.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GraphicsSettings.dll + ..\ref\Techblox_Data\Managed\Gamecraft.GraphicsSettings.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GraphicsSettings.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.BlueprintInventory.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.BlueprintInventory.dll + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.BlueprintInventory.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.BlueprintInventory.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.BlueprintInventoryMock.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.BlueprintInventoryMock.dll + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.BlueprintInventoryMock.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.BlueprintInventoryMock.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Blueprints.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Blueprints.dll + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.Blueprints.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.Blueprints.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.BlueprintSets.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.BlueprintSets.dll + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.BlueprintSets.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.BlueprintSets.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.GameOptionsScreen.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.GameOptionsScreen.dll + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.GameOptionsScreen.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.GameOptionsScreen.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Hotbar.Blocks.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Hotbar.Blocks.dll + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.Blocks.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.Blocks.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Hotbar.BlueprintsHotbar.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Hotbar.BlueprintsHotbar.dll + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.BlueprintsHotbar.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.BlueprintsHotbar.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Hotbar.Colours.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Hotbar.Colours.dll + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.Colours.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.Colours.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.HUDFeedbackBlocks.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.HUDFeedbackBlocks.dll + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.HUDFeedbackBlocks.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.HUDFeedbackBlocks.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.ModeBar.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.ModeBar.dll + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.ModeBar.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.ModeBar.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.OptionsScreen.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.OptionsScreen.dll + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.OptionsScreen.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.OptionsScreen.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Blocks.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Blocks.dll + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Blocks.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Blocks.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Blueprints.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Blueprints.dll + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Blueprints.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Blueprints.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Colours.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Colours.dll + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Colours.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Colours.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Common.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Common.dll + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Common.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Common.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TimeModeClock.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TimeModeClock.dll + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.TimeModeClock.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.TimeModeClock.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Tweaks.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Tweaks.dll + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.Tweaks.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.Tweaks.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Wires.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Wires.dll + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.Wires.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.Wires.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Wires.Mockup.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Wires.Mockup.dll + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.Wires.Mockup.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.Wires.Mockup.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.InventoryTimeRunning.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.InventoryTimeRunning.dll + ..\ref\Techblox_Data\Managed\Gamecraft.InventoryTimeRunning.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.InventoryTimeRunning.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.JointBlocks.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.JointBlocks.dll + ..\ref\Techblox_Data\Managed\Gamecraft.JointBlocks.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.JointBlocks.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Music.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Music.dll + ..\ref\Techblox_Data\Managed\Gamecraft.Music.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.Music.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.NetStrings.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.NetStrings.dll + ..\ref\Techblox_Data\Managed\Gamecraft.NetStrings.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.NetStrings.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.PerformanceWarnings.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.PerformanceWarnings.dll + ..\ref\Techblox_Data\Managed\Gamecraft.PerformanceWarnings.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.PerformanceWarnings.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.PickupBlck.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.PickupBlck.dll + ..\ref\Techblox_Data\Managed\Gamecraft.PickupBlck.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.PickupBlck.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.PickupsCommon.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.PickupsCommon.dll + ..\ref\Techblox_Data\Managed\Gamecraft.PickupsCommon.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.PickupsCommon.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.PopupMessage.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.PopupMessage.dll + ..\ref\Techblox_Data\Managed\Gamecraft.PopupMessage.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.PopupMessage.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Projectiles.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Projectiles.dll + ..\ref\Techblox_Data\Managed\Gamecraft.Projectiles.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.Projectiles.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Serialization.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Serialization.dll + ..\ref\Techblox_Data\Managed\Gamecraft.Serialization.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.Serialization.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Tweaks.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Tweaks.dll + ..\ref\Techblox_Data\Managed\Gamecraft.Tweaks.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.Tweaks.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Tweaks.Mockup.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Tweaks.Mockup.dll + ..\ref\Techblox_Data\Managed\Gamecraft.Tweaks.Mockup.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.Tweaks.Mockup.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.VisualEffects.Decals.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.VisualEffects.Decals.dll + ..\ref\Techblox_Data\Managed\Gamecraft.VisualEffects.Decals.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.VisualEffects.Decals.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.VisualEffects.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.VisualEffects.dll + ..\ref\Techblox_Data\Managed\Gamecraft.VisualEffects.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.VisualEffects.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Wires.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Wires.dll + ..\ref\Techblox_Data\Managed\Gamecraft.Wires.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.Wires.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Wires.Mockup.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Wires.Mockup.dll + ..\ref\Techblox_Data\Managed\Gamecraft.Wires.Mockup.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.Wires.Mockup.dll - ..\ref\TechbloxPreview_Data\Managed\GameState.dll - ..\..\ref\TechbloxPreview_Data\Managed\GameState.dll + ..\ref\Techblox_Data\Managed\GameState.dll + ..\..\ref\Techblox_Data\Managed\GameState.dll - ..\ref\TechbloxPreview_Data\Managed\GhostShark.Outline.dll - ..\..\ref\TechbloxPreview_Data\Managed\GhostShark.Outline.dll + ..\ref\Techblox_Data\Managed\GhostShark.Outline.dll + ..\..\ref\Techblox_Data\Managed\GhostShark.Outline.dll - ..\ref\TechbloxPreview_Data\Managed\GPUInstancer.CrowdAnimations.dll - ..\..\ref\TechbloxPreview_Data\Managed\GPUInstancer.CrowdAnimations.dll + ..\ref\Techblox_Data\Managed\GPUInstancer.CrowdAnimations.dll + ..\..\ref\Techblox_Data\Managed\GPUInstancer.CrowdAnimations.dll - ..\ref\TechbloxPreview_Data\Managed\GPUInstancer.dll - ..\..\ref\TechbloxPreview_Data\Managed\GPUInstancer.dll + ..\ref\Techblox_Data\Managed\GPUInstancer.dll + ..\..\ref\Techblox_Data\Managed\GPUInstancer.dll - ..\ref\TechbloxPreview_Data\Managed\Havok.Physics.dll - ..\..\ref\TechbloxPreview_Data\Managed\Havok.Physics.dll + ..\ref\Techblox_Data\Managed\Havok.Physics.dll + ..\..\ref\Techblox_Data\Managed\Havok.Physics.dll - ..\ref\TechbloxPreview_Data\Managed\Havok.Physics.Hybrid.dll - ..\..\ref\TechbloxPreview_Data\Managed\Havok.Physics.Hybrid.dll + ..\ref\Techblox_Data\Managed\Havok.Physics.Hybrid.dll + ..\..\ref\Techblox_Data\Managed\Havok.Physics.Hybrid.dll - ..\ref\TechbloxPreview_Data\Managed\JWT.dll - ..\..\ref\TechbloxPreview_Data\Managed\JWT.dll + ..\ref\Techblox_Data\Managed\JWT.dll + ..\..\ref\Techblox_Data\Managed\JWT.dll - ..\ref\TechbloxPreview_Data\Managed\LZ4.dll - ..\..\ref\TechbloxPreview_Data\Managed\LZ4.dll + ..\ref\Techblox_Data\Managed\LZ4.dll + ..\..\ref\Techblox_Data\Managed\LZ4.dll - ..\ref\TechbloxPreview_Data\Managed\mscorlib.dll - ..\..\ref\TechbloxPreview_Data\Managed\mscorlib.dll + ..\ref\Techblox_Data\Managed\mscorlib.dll + ..\..\ref\Techblox_Data\Managed\mscorlib.dll - ..\ref\TechbloxPreview_Data\Managed\MultiplayerNetworking.dll - ..\..\ref\TechbloxPreview_Data\Managed\MultiplayerNetworking.dll + ..\ref\Techblox_Data\Managed\MultiplayerNetworking.dll + ..\..\ref\Techblox_Data\Managed\MultiplayerNetworking.dll - ..\ref\TechbloxPreview_Data\Managed\MultiplayerTest.dll - ..\..\ref\TechbloxPreview_Data\Managed\MultiplayerTest.dll + ..\ref\Techblox_Data\Managed\MultiplayerTest.dll + ..\..\ref\Techblox_Data\Managed\MultiplayerTest.dll - ..\ref\TechbloxPreview_Data\Managed\netstandard.dll - ..\..\ref\TechbloxPreview_Data\Managed\netstandard.dll + ..\ref\Techblox_Data\Managed\netstandard.dll + ..\..\ref\Techblox_Data\Managed\netstandard.dll - ..\ref\TechbloxPreview_Data\Managed\Newtonsoft.Json.dll - ..\..\ref\TechbloxPreview_Data\Managed\Newtonsoft.Json.dll + ..\ref\Techblox_Data\Managed\Newtonsoft.Json.dll + ..\..\ref\Techblox_Data\Managed\Newtonsoft.Json.dll - ..\ref\TechbloxPreview_Data\Managed\RCX.ScreenshotTaker.dll - ..\..\ref\TechbloxPreview_Data\Managed\RCX.ScreenshotTaker.dll + ..\ref\Techblox_Data\Managed\RCX.ScreenshotTaker.dll + ..\..\ref\Techblox_Data\Managed\RCX.ScreenshotTaker.dll - ..\ref\TechbloxPreview_Data\Managed\Rewired_Core.dll - ..\..\ref\TechbloxPreview_Data\Managed\Rewired_Core.dll + ..\ref\Techblox_Data\Managed\Rewired_Core.dll + ..\..\ref\Techblox_Data\Managed\Rewired_Core.dll - ..\ref\TechbloxPreview_Data\Managed\Rewired_Windows.dll - ..\..\ref\TechbloxPreview_Data\Managed\Rewired_Windows.dll + ..\ref\Techblox_Data\Managed\Rewired_Windows.dll + ..\..\ref\Techblox_Data\Managed\Rewired_Windows.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftECS.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftECS.dll + ..\ref\Techblox_Data\Managed\RobocraftECS.dll + ..\..\ref\Techblox_Data\Managed\RobocraftECS.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.AccountPreferences.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.AccountPreferences.dll + ..\ref\Techblox_Data\Managed\RobocraftX.AccountPreferences.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.AccountPreferences.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Blocks.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Blocks.dll + ..\ref\Techblox_Data\Managed\RobocraftX.Blocks.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.Blocks.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Blocks.Ghost.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Blocks.Ghost.dll + ..\ref\Techblox_Data\Managed\RobocraftX.Blocks.Ghost.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.Blocks.Ghost.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Blocks.Triggers.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Blocks.Triggers.dll + ..\ref\Techblox_Data\Managed\RobocraftX.Blocks.Triggers.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.Blocks.Triggers.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Building.BoxSelect.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Building.BoxSelect.dll + ..\ref\Techblox_Data\Managed\RobocraftX.Building.BoxSelect.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.Building.BoxSelect.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Building.Jobs.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Building.Jobs.dll + ..\ref\Techblox_Data\Managed\RobocraftX.Building.Jobs.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.Building.Jobs.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Character.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Character.dll + ..\ref\Techblox_Data\Managed\RobocraftX.Character.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.Character.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Common.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Common.dll + ..\ref\Techblox_Data\Managed\RobocraftX.Common.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.Common.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.ControlsScreen.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.ControlsScreen.dll + ..\ref\Techblox_Data\Managed\RobocraftX.ControlsScreen.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.ControlsScreen.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Crosshair.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Crosshair.dll + ..\ref\Techblox_Data\Managed\RobocraftX.Crosshair.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.Crosshair.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.FrontEnd.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.FrontEnd.dll + ..\ref\Techblox_Data\Managed\RobocraftX.FrontEnd.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.FrontEnd.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.BlockLabel.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.BlockLabel.dll + ..\ref\Techblox_Data\Managed\RobocraftX.GUI.BlockLabel.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.BlockLabel.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.DebugDisplay.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.DebugDisplay.dll + ..\ref\Techblox_Data\Managed\RobocraftX.GUI.DebugDisplay.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.DebugDisplay.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.dll + ..\ref\Techblox_Data\Managed\RobocraftX.GUI.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Hotbar.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Hotbar.dll + ..\ref\Techblox_Data\Managed\RobocraftX.GUI.Hotbar.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.Hotbar.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.BlocksInventory.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.BlocksInventory.dll + ..\ref\Techblox_Data\Managed\RobocraftX.GUI.Inventory.BlocksInventory.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.Inventory.BlocksInventory.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.ColourInventory.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.ColourInventory.dll + ..\ref\Techblox_Data\Managed\RobocraftX.GUI.Inventory.ColourInventory.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.Inventory.ColourInventory.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.dll + ..\ref\Techblox_Data\Managed\RobocraftX.GUI.Inventory.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.Inventory.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.PauseMenu.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.PauseMenu.dll + ..\ref\Techblox_Data\Managed\RobocraftX.GUI.PauseMenu.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.PauseMenu.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.ScaleGhost.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.ScaleGhost.dll + ..\ref\Techblox_Data\Managed\RobocraftX.GUI.ScaleGhost.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.ScaleGhost.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.TabsBar.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.TabsBar.dll + ..\ref\Techblox_Data\Managed\RobocraftX.GUI.TabsBar.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.TabsBar.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Input.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Input.dll + ..\ref\Techblox_Data\Managed\RobocraftX.Input.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.Input.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.MachineEditor.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.MachineEditor.dll + ..\ref\Techblox_Data\Managed\RobocraftX.MachineEditor.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.MachineEditor.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.MainGame.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.MainGame.dll + ..\ref\Techblox_Data\Managed\RobocraftX.MainGame.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.MainGame.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.MainGameMock.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.MainGameMock.dll + ..\ref\Techblox_Data\Managed\RobocraftX.MainGameMock.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.MainGameMock.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.MainSimulation.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.MainSimulation.dll + ..\ref\Techblox_Data\Managed\RobocraftX.MainSimulation.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.MainSimulation.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.MockCharacter.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.MockCharacter.dll + ..\ref\Techblox_Data\Managed\RobocraftX.MockCharacter.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.MockCharacter.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Multiplayer.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Multiplayer.dll + ..\ref\Techblox_Data\Managed\RobocraftX.Multiplayer.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.Multiplayer.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Multiplayer.GUI.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Multiplayer.GUI.dll + ..\ref\Techblox_Data\Managed\RobocraftX.Multiplayer.GUI.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.Multiplayer.GUI.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll + ..\ref\Techblox_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Multiplayer.Serializers.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Multiplayer.Serializers.dll + ..\ref\Techblox_Data\Managed\RobocraftX.Multiplayer.Serializers.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.Multiplayer.Serializers.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.MultiplayerInput.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.MultiplayerInput.dll + ..\ref\Techblox_Data\Managed\RobocraftX.MultiplayerInput.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.MultiplayerInput.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.ObjectIdBlocks.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.ObjectIdBlocks.dll + ..\ref\Techblox_Data\Managed\RobocraftX.ObjectIdBlocks.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.ObjectIdBlocks.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Party.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Party.dll + ..\ref\Techblox_Data\Managed\RobocraftX.Party.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.Party.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Physics.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Physics.dll + ..\ref\Techblox_Data\Managed\RobocraftX.Physics.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.Physics.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.PilotSeat.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.PilotSeat.dll + ..\ref\Techblox_Data\Managed\RobocraftX.PilotSeat.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.PilotSeat.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Player.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Player.dll + ..\ref\Techblox_Data\Managed\RobocraftX.Player.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.Player.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Rendering.Mock.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Rendering.Mock.dll + ..\ref\Techblox_Data\Managed\RobocraftX.Rendering.Mock.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.Rendering.Mock.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.SaveAndLoad.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.SaveAndLoad.dll + ..\ref\Techblox_Data\Managed\RobocraftX.SaveAndLoad.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.SaveAndLoad.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.SaveGameDialog.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.SaveGameDialog.dll + ..\ref\Techblox_Data\Managed\RobocraftX.SaveGameDialog.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.SaveGameDialog.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Services.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Services.dll + ..\ref\Techblox_Data\Managed\RobocraftX.Services.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.Services.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.SignalHandling.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.SignalHandling.dll + ..\ref\Techblox_Data\Managed\RobocraftX.SignalHandling.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.SignalHandling.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.SpawnPoints.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.SpawnPoints.dll + ..\ref\Techblox_Data\Managed\RobocraftX.SpawnPoints.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.SpawnPoints.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.StateSync.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.StateSync.dll + ..\ref\Techblox_Data\Managed\RobocraftX.StateSync.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.StateSync.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX_TextBlock.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX_TextBlock.dll + ..\ref\Techblox_Data\Managed\RobocraftX_TextBlock.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX_TextBlock.dll - ..\ref\TechbloxPreview_Data\Managed\RobocratX.SimulationMockCompositionRoot.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocratX.SimulationMockCompositionRoot.dll + ..\ref\Techblox_Data\Managed\RobocratX.SimulationMockCompositionRoot.dll + ..\..\ref\Techblox_Data\Managed\RobocratX.SimulationMockCompositionRoot.dll - ..\ref\TechbloxPreview_Data\Managed\SpecializedDescriptors.dll - ..\..\ref\TechbloxPreview_Data\Managed\SpecializedDescriptors.dll + ..\ref\Techblox_Data\Managed\SpecializedDescriptors.dll + ..\..\ref\Techblox_Data\Managed\SpecializedDescriptors.dll - ..\ref\TechbloxPreview_Data\Managed\StringFormatter.dll - ..\..\ref\TechbloxPreview_Data\Managed\StringFormatter.dll + ..\ref\Techblox_Data\Managed\StringFormatter.dll + ..\..\ref\Techblox_Data\Managed\StringFormatter.dll - ..\ref\TechbloxPreview_Data\Managed\Svelto.Common.dll - ..\..\ref\TechbloxPreview_Data\Managed\Svelto.Common.dll + ..\ref\Techblox_Data\Managed\Svelto.Common.dll + ..\..\ref\Techblox_Data\Managed\Svelto.Common.dll - ..\ref\TechbloxPreview_Data\Managed\Svelto.ECS.dll - ..\..\ref\TechbloxPreview_Data\Managed\Svelto.ECS.dll + ..\ref\Techblox_Data\Managed\Svelto.ECS.dll + ..\..\ref\Techblox_Data\Managed\Svelto.ECS.dll - ..\ref\TechbloxPreview_Data\Managed\Svelto.ECS.GUI.dll - ..\..\ref\TechbloxPreview_Data\Managed\Svelto.ECS.GUI.dll + ..\ref\Techblox_Data\Managed\Svelto.ECS.GUI.dll + ..\..\ref\Techblox_Data\Managed\Svelto.ECS.GUI.dll - ..\ref\TechbloxPreview_Data\Managed\Svelto.Services.dll - ..\..\ref\TechbloxPreview_Data\Managed\Svelto.Services.dll + ..\ref\Techblox_Data\Managed\Svelto.Services.dll + ..\..\ref\Techblox_Data\Managed\Svelto.Services.dll - ..\ref\TechbloxPreview_Data\Managed\Svelto.Tasks.dll - ..\..\ref\TechbloxPreview_Data\Managed\Svelto.Tasks.dll + ..\ref\Techblox_Data\Managed\Svelto.Tasks.dll + ..\..\ref\Techblox_Data\Managed\Svelto.Tasks.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.AtmosphereBlock.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.AtmosphereBlock.dll + ..\ref\Techblox_Data\Managed\Techblox.AtmosphereBlock.dll + ..\..\ref\Techblox_Data\Managed\Techblox.AtmosphereBlock.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.AutoForward.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.AutoForward.dll + ..\ref\Techblox_Data\Managed\Techblox.AutoForward.dll + ..\..\ref\Techblox_Data\Managed\Techblox.AutoForward.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.Backend.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Backend.dll + ..\ref\Techblox_Data\Managed\Techblox.Backend.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Backend.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.Blocks.LightBlock.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Blocks.LightBlock.dll + ..\ref\Techblox_Data\Managed\Techblox.Blocks.LightBlock.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Blocks.LightBlock.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.Building.Rules.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Building.Rules.dll + ..\ref\Techblox_Data\Managed\Techblox.Building.Rules.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Building.Rules.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.BuildingDrone.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.BuildingDrone.dll + ..\ref\Techblox_Data\Managed\Techblox.BuildingDrone.dll + ..\..\ref\Techblox_Data\Managed\Techblox.BuildingDrone.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.Camera.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Camera.dll + ..\ref\Techblox_Data\Managed\Techblox.Camera.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Camera.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.ContextSensitiveTextHint.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.ContextSensitiveTextHint.dll + ..\ref\Techblox_Data\Managed\Techblox.ContextSensitiveTextHint.dll + ..\..\ref\Techblox_Data\Managed\Techblox.ContextSensitiveTextHint.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.EngineBlock.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.EngineBlock.dll + ..\ref\Techblox_Data\Managed\Techblox.EngineBlock.dll + ..\..\ref\Techblox_Data\Managed\Techblox.EngineBlock.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.Environment.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Environment.dll + ..\ref\Techblox_Data\Managed\Techblox.Environment.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Environment.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.EnvironmentBlocks.BuildingEnvironment.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.EnvironmentBlocks.BuildingEnvironment.dll + ..\ref\Techblox_Data\Managed\Techblox.EnvironmentBlocks.BuildingEnvironment.dll + ..\..\ref\Techblox_Data\Managed\Techblox.EnvironmentBlocks.BuildingEnvironment.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.EnvironmentBlocks.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.EnvironmentBlocks.dll + ..\ref\Techblox_Data\Managed\Techblox.EnvironmentBlocks.dll + ..\..\ref\Techblox_Data\Managed\Techblox.EnvironmentBlocks.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.EnvironmentBlocks.SimulationWorldEnvironment.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.EnvironmentBlocks.SimulationWorldEnvironment.dll + ..\ref\Techblox_Data\Managed\Techblox.EnvironmentBlocks.SimulationWorldEnvironment.dll + ..\..\ref\Techblox_Data\Managed\Techblox.EnvironmentBlocks.SimulationWorldEnvironment.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.GameSelection.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GameSelection.dll + ..\ref\Techblox_Data\Managed\Techblox.GameSelection.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GameSelection.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Building.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Building.dll + ..\ref\Techblox_Data\Managed\Techblox.GUI.Building.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Building.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.BuildRules.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.BuildRules.dll + ..\ref\Techblox_Data\Managed\Techblox.GUI.BuildRules.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.BuildRules.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.BuildRules.MockUps.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.BuildRules.MockUps.dll + ..\ref\Techblox_Data\Managed\Techblox.GUI.BuildRules.MockUps.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.BuildRules.MockUps.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.dll + ..\ref\Techblox_Data\Managed\Techblox.GUI.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.GamePortal.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.GamePortal.dll + ..\ref\Techblox_Data\Managed\Techblox.GUI.GamePortal.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.GamePortal.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.GamePortal.MockUps.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.GamePortal.MockUps.dll + ..\ref\Techblox_Data\Managed\Techblox.GUI.GamePortal.MockUps.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.GamePortal.MockUps.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Hotbar.Landscapes.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Hotbar.Landscapes.dll + ..\ref\Techblox_Data\Managed\Techblox.GUI.Hotbar.Landscapes.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Hotbar.Landscapes.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Hotbar.Materials.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Hotbar.Materials.dll + ..\ref\Techblox_Data\Managed\Techblox.GUI.Hotbar.Materials.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Hotbar.Materials.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Inventory.Common.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Inventory.Common.dll + ..\ref\Techblox_Data\Managed\Techblox.GUI.Inventory.Common.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Inventory.Common.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Inventory.Landscapes.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Inventory.Landscapes.dll + ..\ref\Techblox_Data\Managed\Techblox.GUI.Inventory.Landscapes.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Inventory.Landscapes.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Inventory.Materials.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Inventory.Materials.dll + ..\ref\Techblox_Data\Managed\Techblox.GUI.Inventory.Materials.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Inventory.Materials.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Login.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Login.dll + ..\ref\Techblox_Data\Managed\Techblox.GUI.Login.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Login.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Mocks.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Mocks.dll + ..\ref\Techblox_Data\Managed\Techblox.GUI.Mocks.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Mocks.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Mocks.DynamicListBuild.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Mocks.DynamicListBuild.dll + ..\ref\Techblox_Data\Managed\Techblox.GUI.Mocks.DynamicListBuild.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Mocks.DynamicListBuild.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.MyGamesScreen.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.MyGamesScreen.dll + ..\ref\Techblox_Data\Managed\Techblox.GUI.MyGamesScreen.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.MyGamesScreen.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Notifications.MockUps.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Notifications.MockUps.dll + ..\ref\Techblox_Data\Managed\Techblox.GUI.Notifications.MockUps.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Notifications.MockUps.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.TabsBar.Landscapes.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.TabsBar.Landscapes.dll + ..\ref\Techblox_Data\Managed\Techblox.GUI.TabsBar.Landscapes.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.TabsBar.Landscapes.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.TabsBar.Materials.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.TabsBar.Materials.dll + ..\ref\Techblox_Data\Managed\Techblox.GUI.TabsBar.Materials.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.TabsBar.Materials.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.InputCapture.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.InputCapture.dll + ..\ref\Techblox_Data\Managed\Techblox.InputCapture.dll + ..\..\ref\Techblox_Data\Managed\Techblox.InputCapture.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.Pointer.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Pointer.dll + ..\ref\Techblox_Data\Managed\Techblox.Pointer.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Pointer.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.ProceduralReflectionProbes.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.ProceduralReflectionProbes.dll + ..\ref\Techblox_Data\Managed\Techblox.ProceduralReflectionProbes.dll + ..\..\ref\Techblox_Data\Managed\Techblox.ProceduralReflectionProbes.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.Rendering.Common.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Rendering.Common.dll + ..\ref\Techblox_Data\Managed\Techblox.Rendering.Common.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Rendering.Common.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.Rendering.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Rendering.dll + ..\ref\Techblox_Data\Managed\Techblox.Rendering.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Rendering.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.Rendering.DOTS.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Rendering.DOTS.dll + ..\ref\Techblox_Data\Managed\Techblox.Rendering.DOTS.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Rendering.DOTS.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.Rendering.GPUI.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Rendering.GPUI.dll + ..\ref\Techblox_Data\Managed\Techblox.Rendering.GPUI.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Rendering.GPUI.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.Rendering.Unity.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Rendering.Unity.dll + ..\ref\Techblox_Data\Managed\Techblox.Rendering.Unity.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Rendering.Unity.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.SaveGamesConversion.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.SaveGamesConversion.dll + ..\ref\Techblox_Data\Managed\Techblox.SaveGamesConversion.dll + ..\..\ref\Techblox_Data\Managed\Techblox.SaveGamesConversion.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.Services.Eos.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Services.Eos.dll + ..\ref\Techblox_Data\Managed\Techblox.Services.Eos.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Services.Eos.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.Services.GameDetails.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Services.GameDetails.dll + ..\ref\Techblox_Data\Managed\Techblox.Services.GameDetails.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Services.GameDetails.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.Services.Storage.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Services.Storage.dll + ..\ref\Techblox_Data\Managed\Techblox.Services.Storage.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Services.Storage.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.SwitchAnimation.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.SwitchAnimation.dll + ..\ref\Techblox_Data\Managed\Techblox.SwitchAnimation.dll + ..\..\ref\Techblox_Data\Managed\Techblox.SwitchAnimation.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.WheelRigBlock.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.WheelRigBlock.dll + ..\ref\Techblox_Data\Managed\Techblox.WheelRigBlock.dll + ..\..\ref\Techblox_Data\Managed\Techblox.WheelRigBlock.dll - ..\ref\TechbloxPreview_Data\Managed\UniTask.Addressables.dll - ..\..\ref\TechbloxPreview_Data\Managed\UniTask.Addressables.dll + ..\ref\Techblox_Data\Managed\UniTask.Addressables.dll + ..\..\ref\Techblox_Data\Managed\UniTask.Addressables.dll - ..\ref\TechbloxPreview_Data\Managed\UniTask.dll - ..\..\ref\TechbloxPreview_Data\Managed\UniTask.dll + ..\ref\Techblox_Data\Managed\UniTask.dll + ..\..\ref\Techblox_Data\Managed\UniTask.dll - ..\ref\TechbloxPreview_Data\Managed\UniTask.DOTween.dll - ..\..\ref\TechbloxPreview_Data\Managed\UniTask.DOTween.dll + ..\ref\Techblox_Data\Managed\UniTask.DOTween.dll + ..\..\ref\Techblox_Data\Managed\UniTask.DOTween.dll - ..\ref\TechbloxPreview_Data\Managed\UniTask.Linq.dll - ..\..\ref\TechbloxPreview_Data\Managed\UniTask.Linq.dll + ..\ref\Techblox_Data\Managed\UniTask.Linq.dll + ..\..\ref\Techblox_Data\Managed\UniTask.Linq.dll - ..\ref\TechbloxPreview_Data\Managed\UniTask.TextMeshPro.dll - ..\..\ref\TechbloxPreview_Data\Managed\UniTask.TextMeshPro.dll + ..\ref\Techblox_Data\Managed\UniTask.TextMeshPro.dll + ..\..\ref\Techblox_Data\Managed\UniTask.TextMeshPro.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Addressables.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Addressables.dll + ..\ref\Techblox_Data\Managed\Unity.Addressables.dll + ..\..\ref\Techblox_Data\Managed\Unity.Addressables.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.dll + ..\ref\Techblox_Data\Managed\Unity.Burst.Cecil.dll + ..\..\ref\Techblox_Data\Managed\Unity.Burst.Cecil.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.Mdb.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.Mdb.dll + ..\ref\Techblox_Data\Managed\Unity.Burst.Cecil.Mdb.dll + ..\..\ref\Techblox_Data\Managed\Unity.Burst.Cecil.Mdb.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.Pdb.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.Pdb.dll + ..\ref\Techblox_Data\Managed\Unity.Burst.Cecil.Pdb.dll + ..\..\ref\Techblox_Data\Managed\Unity.Burst.Cecil.Pdb.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.Rocks.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.Rocks.dll + ..\ref\Techblox_Data\Managed\Unity.Burst.Cecil.Rocks.dll + ..\..\ref\Techblox_Data\Managed\Unity.Burst.Cecil.Rocks.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Burst.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Burst.dll + ..\ref\Techblox_Data\Managed\Unity.Burst.dll + ..\..\ref\Techblox_Data\Managed\Unity.Burst.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Unsafe.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Unsafe.dll + ..\ref\Techblox_Data\Managed\Unity.Burst.Unsafe.dll + ..\..\ref\Techblox_Data\Managed\Unity.Burst.Unsafe.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Collections.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Collections.dll + ..\ref\Techblox_Data\Managed\Unity.Collections.dll + ..\..\ref\Techblox_Data\Managed\Unity.Collections.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Collections.LowLevel.ILSupport.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Collections.LowLevel.ILSupport.dll + ..\ref\Techblox_Data\Managed\Unity.Collections.LowLevel.ILSupport.dll + ..\..\ref\Techblox_Data\Managed\Unity.Collections.LowLevel.ILSupport.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Deformations.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Deformations.dll + ..\ref\Techblox_Data\Managed\Unity.Deformations.dll + ..\..\ref\Techblox_Data\Managed\Unity.Deformations.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Entities.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Entities.dll + ..\ref\Techblox_Data\Managed\Unity.Entities.dll + ..\..\ref\Techblox_Data\Managed\Unity.Entities.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Entities.Hybrid.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Entities.Hybrid.dll + ..\ref\Techblox_Data\Managed\Unity.Entities.Hybrid.dll + ..\..\ref\Techblox_Data\Managed\Unity.Entities.Hybrid.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.InternalAPIEngineBridge.012.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.InternalAPIEngineBridge.012.dll + ..\ref\Techblox_Data\Managed\Unity.InternalAPIEngineBridge.012.dll + ..\..\ref\Techblox_Data\Managed\Unity.InternalAPIEngineBridge.012.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Jobs.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Jobs.dll + ..\ref\Techblox_Data\Managed\Unity.Jobs.dll + ..\..\ref\Techblox_Data\Managed\Unity.Jobs.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Mathematics.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Mathematics.dll + ..\ref\Techblox_Data\Managed\Unity.Mathematics.dll + ..\..\ref\Techblox_Data\Managed\Unity.Mathematics.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Mathematics.Extensions.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Mathematics.Extensions.dll + ..\ref\Techblox_Data\Managed\Unity.Mathematics.Extensions.dll + ..\..\ref\Techblox_Data\Managed\Unity.Mathematics.Extensions.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll + ..\ref\Techblox_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll + ..\..\ref\Techblox_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.MemoryProfiler.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.MemoryProfiler.dll + ..\ref\Techblox_Data\Managed\Unity.MemoryProfiler.dll + ..\..\ref\Techblox_Data\Managed\Unity.MemoryProfiler.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Physics.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Physics.dll + ..\ref\Techblox_Data\Managed\Unity.Physics.dll + ..\..\ref\Techblox_Data\Managed\Unity.Physics.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Physics.Hybrid.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Physics.Hybrid.dll + ..\ref\Techblox_Data\Managed\Unity.Physics.Hybrid.dll + ..\..\ref\Techblox_Data\Managed\Unity.Physics.Hybrid.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Platforms.Common.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Platforms.Common.dll + ..\ref\Techblox_Data\Managed\Unity.Platforms.Common.dll + ..\..\ref\Techblox_Data\Managed\Unity.Platforms.Common.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Properties.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Properties.dll + ..\ref\Techblox_Data\Managed\Unity.Properties.dll + ..\..\ref\Techblox_Data\Managed\Unity.Properties.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Properties.Reflection.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Properties.Reflection.dll + ..\ref\Techblox_Data\Managed\Unity.Properties.Reflection.dll + ..\..\ref\Techblox_Data\Managed\Unity.Properties.Reflection.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Properties.UI.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Properties.UI.dll + ..\ref\Techblox_Data\Managed\Unity.Properties.UI.dll + ..\..\ref\Techblox_Data\Managed\Unity.Properties.UI.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Recorder.Base.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Recorder.Base.dll + ..\ref\Techblox_Data\Managed\Unity.Recorder.Base.dll + ..\..\ref\Techblox_Data\Managed\Unity.Recorder.Base.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Recorder.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Recorder.dll + ..\ref\Techblox_Data\Managed\Unity.Recorder.dll + ..\..\ref\Techblox_Data\Managed\Unity.Recorder.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Rendering.Hybrid.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Rendering.Hybrid.dll + ..\ref\Techblox_Data\Managed\Unity.Rendering.Hybrid.dll + ..\..\ref\Techblox_Data\Managed\Unity.Rendering.Hybrid.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll + ..\ref\Techblox_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll + ..\..\ref\Techblox_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll + ..\ref\Techblox_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll + ..\..\ref\Techblox_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.HighDefinition.Config.Runtime.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.HighDefinition.Config.Runtime.dll + ..\ref\Techblox_Data\Managed\Unity.RenderPipelines.HighDefinition.Config.Runtime.dll + ..\..\ref\Techblox_Data\Managed\Unity.RenderPipelines.HighDefinition.Config.Runtime.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.HighDefinition.Runtime.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.HighDefinition.Runtime.dll + ..\ref\Techblox_Data\Managed\Unity.RenderPipelines.HighDefinition.Runtime.dll + ..\..\ref\Techblox_Data\Managed\Unity.RenderPipelines.HighDefinition.Runtime.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll + ..\ref\Techblox_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll + ..\..\ref\Techblox_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.ResourceManager.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.ResourceManager.dll + ..\ref\Techblox_Data\Managed\Unity.ResourceManager.dll + ..\..\ref\Techblox_Data\Managed\Unity.ResourceManager.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Scenes.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Scenes.dll + ..\ref\Techblox_Data\Managed\Unity.Scenes.dll + ..\..\ref\Techblox_Data\Managed\Unity.Scenes.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.ScriptableBuildPipeline.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.ScriptableBuildPipeline.dll + ..\ref\Techblox_Data\Managed\Unity.ScriptableBuildPipeline.dll + ..\..\ref\Techblox_Data\Managed\Unity.ScriptableBuildPipeline.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Serialization.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Serialization.dll + ..\ref\Techblox_Data\Managed\Unity.Serialization.dll + ..\..\ref\Techblox_Data\Managed\Unity.Serialization.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.TextMeshPro.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.TextMeshPro.dll + ..\ref\Techblox_Data\Managed\Unity.TextMeshPro.dll + ..\..\ref\Techblox_Data\Managed\Unity.TextMeshPro.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Timeline.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Timeline.dll + ..\ref\Techblox_Data\Managed\Unity.Timeline.dll + ..\..\ref\Techblox_Data\Managed\Unity.Timeline.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Transforms.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Transforms.dll + ..\ref\Techblox_Data\Managed\Unity.Transforms.dll + ..\..\ref\Techblox_Data\Managed\Unity.Transforms.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Transforms.Hybrid.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Transforms.Hybrid.dll + ..\ref\Techblox_Data\Managed\Unity.Transforms.Hybrid.dll + ..\..\ref\Techblox_Data\Managed\Unity.Transforms.Hybrid.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.VisualEffectGraph.Runtime.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.VisualEffectGraph.Runtime.dll + ..\ref\Techblox_Data\Managed\Unity.VisualEffectGraph.Runtime.dll + ..\..\ref\Techblox_Data\Managed\Unity.VisualEffectGraph.Runtime.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.AccessibilityModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.AccessibilityModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.AccessibilityModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.AccessibilityModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.AIModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.AIModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.AIModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.AIModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.AndroidJNIModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.AndroidJNIModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.AndroidJNIModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.AndroidJNIModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.AnimationModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.AnimationModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.AnimationModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.AnimationModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.ARModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.ARModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.ARModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.ARModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.AssetBundleModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.AssetBundleModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.AssetBundleModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.AssetBundleModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.AudioModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.AudioModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.AudioModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.AudioModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.ClothModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.ClothModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.ClothModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.ClothModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.ClusterInputModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.ClusterInputModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.ClusterInputModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.ClusterInputModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.ClusterRendererModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.ClusterRendererModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.ClusterRendererModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.ClusterRendererModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.CoreModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.CoreModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.CoreModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.CoreModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.CrashReportingModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.CrashReportingModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.CrashReportingModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.CrashReportingModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.DirectorModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.DirectorModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.DirectorModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.DirectorModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.dll + ..\ref\Techblox_Data\Managed\UnityEngine.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.DSPGraphModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.DSPGraphModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.DSPGraphModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.DSPGraphModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.GameCenterModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.GameCenterModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.GameCenterModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.GameCenterModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.GIModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.GIModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.GIModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.GIModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.GridModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.GridModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.GridModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.GridModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.HotReloadModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.HotReloadModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.HotReloadModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.HotReloadModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.ImageConversionModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.ImageConversionModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.ImageConversionModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.ImageConversionModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.IMGUIModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.IMGUIModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.IMGUIModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.IMGUIModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.InputLegacyModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.InputLegacyModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.InputLegacyModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.InputLegacyModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.InputModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.InputModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.InputModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.InputModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.JSONSerializeModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.JSONSerializeModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.JSONSerializeModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.JSONSerializeModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.LocalizationModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.LocalizationModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.LocalizationModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.LocalizationModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.ParticleSystemModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.ParticleSystemModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.ParticleSystemModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.ParticleSystemModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.PerformanceReportingModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.PerformanceReportingModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.PerformanceReportingModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.PerformanceReportingModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.Physics2DModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.Physics2DModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.Physics2DModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.Physics2DModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.PhysicsModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.PhysicsModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.PhysicsModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.PhysicsModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.ProfilerModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.ProfilerModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.ProfilerModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.ProfilerModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.ScreenCaptureModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.ScreenCaptureModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.ScreenCaptureModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.ScreenCaptureModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.SharedInternalsModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.SharedInternalsModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.SharedInternalsModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.SharedInternalsModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.SpriteMaskModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.SpriteMaskModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.SpriteMaskModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.SpriteMaskModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.SpriteShapeModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.SpriteShapeModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.SpriteShapeModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.SpriteShapeModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.StreamingModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.StreamingModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.StreamingModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.StreamingModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.SubstanceModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.SubstanceModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.SubstanceModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.SubstanceModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.SubsystemsModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.SubsystemsModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.SubsystemsModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.SubsystemsModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.TerrainModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.TerrainModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.TerrainModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.TerrainModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.TerrainPhysicsModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.TerrainPhysicsModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.TerrainPhysicsModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.TerrainPhysicsModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.TextCoreModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.TextCoreModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.TextCoreModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.TextCoreModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.TextRenderingModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.TextRenderingModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.TextRenderingModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.TextRenderingModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.TilemapModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.TilemapModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.TilemapModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.TilemapModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.TLSModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.TLSModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.TLSModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.TLSModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UI.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UI.dll + ..\ref\Techblox_Data\Managed\UnityEngine.UI.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.UI.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UIElementsModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UIElementsModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.UIElementsModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.UIElementsModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UIElementsNativeModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UIElementsNativeModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.UIElementsNativeModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.UIElementsNativeModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UIModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UIModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.UIModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.UIModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UmbraModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UmbraModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.UmbraModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.UmbraModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UNETModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UNETModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.UNETModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.UNETModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityAnalyticsModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityAnalyticsModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.UnityAnalyticsModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.UnityAnalyticsModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityConnectModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityConnectModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.UnityConnectModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.UnityConnectModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityCurlModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityCurlModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.UnityCurlModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.UnityCurlModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityTestProtocolModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityTestProtocolModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.UnityTestProtocolModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.UnityTestProtocolModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.VehiclesModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.VehiclesModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.VehiclesModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.VehiclesModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.VFXModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.VFXModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.VFXModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.VFXModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.VideoModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.VideoModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.VideoModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.VideoModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.VirtualTexturingModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.VirtualTexturingModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.VirtualTexturingModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.VirtualTexturingModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.VRModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.VRModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.VRModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.VRModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.WindModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.WindModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.WindModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.WindModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.XRModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.XRModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.XRModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.XRModule.dll - ..\ref\TechbloxPreview_Data\Managed\VisualProfiler.dll - ..\..\ref\TechbloxPreview_Data\Managed\VisualProfiler.dll + ..\ref\Techblox_Data\Managed\VisualProfiler.dll + ..\..\ref\Techblox_Data\Managed\VisualProfiler.dll - ..\ref\TechbloxPreview_Data\Managed\Whinarn.UnityMeshSimplifier.Runtime.dll - ..\..\ref\TechbloxPreview_Data\Managed\Whinarn.UnityMeshSimplifier.Runtime.dll + ..\ref\Techblox_Data\Managed\Whinarn.UnityMeshSimplifier.Runtime.dll + ..\..\ref\Techblox_Data\Managed\Whinarn.UnityMeshSimplifier.Runtime.dll -- 2.30.2 From 5c1fe34f46629fb341fd7acea982c0cb3f249293 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Wed, 15 Dec 2021 02:13:55 +0100 Subject: [PATCH 221/252] Bump version and restore displayed block fix attempt It doesn't work but anyway Also remove parameter that allowed placing blocks in sim --- Automation/bump_version.py | 10 +++++----- TechbloxModdingAPI/Block.cs | 11 ++++------- TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs | 8 +++++++- TechbloxModdingAPI/TechbloxModdingAPI.csproj | 2 +- .../Tests/TechbloxModdingAPIPluginTest.cs | 2 +- doxygen.conf | 2 +- 6 files changed, 19 insertions(+), 16 deletions(-) diff --git a/Automation/bump_version.py b/Automation/bump_version.py index d3de051..a6d07b2 100755 --- a/Automation/bump_version.py +++ b/Automation/bump_version.py @@ -5,7 +5,7 @@ import re # this assumes a mostly semver-complient version number if __name__ == "__main__": - parser = argparse.ArgumentParser(description="Increment GamecraftModdingAPI version") + parser = argparse.ArgumentParser(description="Increment TechbloxModdingAPI version") parser.add_argument('version', metavar="VN", type=str, help="The version number to increment, or the index of the number (zero-indexed).") args = parser.parse_args() @@ -28,12 +28,12 @@ if __name__ == "__main__": old_version = "" new_version = "" - with open("../GamecraftModdingAPI/GamecraftModdingAPI.csproj", "r") as xmlFile: - print("Parsing GamecraftModdingAPI.csproj") + with open("../TechbloxModdingAPI/TechbloxModdingAPI.csproj", "r") as xmlFile: + print("Parsing TechbloxModdingAPI.csproj") fileStr = xmlFile.read() versionMatch = re.search(r"(.+)", fileStr) if versionMatch is None: - print("Unable to find version number in GamecraftModdingAPI.csproj") + print("Unable to find version number in TechbloxModdingAPI.csproj") exit(1) old_version = versionMatch.group(1) versionList = old_version.split(".") @@ -53,7 +53,7 @@ if __name__ == "__main__": print(new_version) newFileContents = fileStr.replace(""+old_version+"", ""+new_version+"") - with open("../GamecraftModdingAPI/GamecraftModdingAPI.csproj", "w") as xmlFile: + with open("../TechbloxModdingAPI/TechbloxModdingAPI.csproj", "w") as xmlFile: print("Writing new version to project file") xmlFile.write(newFileContents) diff --git a/TechbloxModdingAPI/Block.cs b/TechbloxModdingAPI/Block.cs index ec1147a..d752584 100644 --- a/TechbloxModdingAPI/Block.cs +++ b/TechbloxModdingAPI/Block.cs @@ -45,12 +45,10 @@ namespace TechbloxModdingAPI /// The block's position - default block size is 0.2 /// Whether the block should be auto-wired (if functional) /// The player who placed the block - /// /// The placed block or null if failed - public static Block PlaceNew(BlockIDs block, float3 position, bool autoWire = false, Player player = null, - bool force = false) + public static Block PlaceNew(BlockIDs block, float3 position, bool autoWire = false, Player player = null) { - if (PlacementEngine.IsInGame && (GameState.IsBuildMode() || force)) + if (PlacementEngine.IsInGame && GameState.IsBuildMode()) { var initializer = PlacementEngine.PlaceBlock(block, position, player, autoWire); var egid = initializer.EGID; @@ -162,11 +160,10 @@ namespace TechbloxModdingAPI /// The block's position (a block is 0.2 wide in terms of position) /// Whether the block should be auto-wired (if functional) /// The player who placed the block - /// Place even if not in build mode - public Block(BlockIDs type, float3 position, bool autoWire = false, Player player = null, bool force = false) + public Block(BlockIDs type, float3 position, bool autoWire = false, Player player = null) : base(block => { - if (!PlacementEngine.IsInGame || !GameState.IsBuildMode() && !force) + if (!PlacementEngine.IsInGame || !GameState.IsBuildMode()) throw new BlockException("Blocks can only be placed in build mode."); var initializer = PlacementEngine.PlaceBlock(type, position, player, autoWire); block.InitData = initializer; diff --git a/TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs b/TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs index c7c84cf..c305f93 100644 --- a/TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs @@ -13,6 +13,7 @@ using RobocraftX.Rendering; using RobocraftX.Rendering.GPUI; using Svelto.DataStructures; using Svelto.ECS; +using Svelto.ECS.EntityStructs; using Svelto.ECS.Hybrid; using Techblox.BuildingDrone; using Unity.Mathematics; @@ -94,7 +95,12 @@ namespace TechbloxModdingAPI.Blocks.Engines public void UpdateDisplayedBlock(EGID id) { if (!BlockExists(id)) return; - RenderingPatch.UpdateBlocks(); + var pos = entitiesDB.QueryEntity(id); + var rot = entitiesDB.QueryEntity(id); + var scale = entitiesDB.QueryEntity(id); + var skew = entitiesDB.QueryEntity(id); + entitiesDB.QueryEntity(id).matrix = + math.mul(float4x4.TRS(pos.position, rot.rotation, scale.scale), skew.skewMatrix); } internal void UpdatePrefab(Block block, byte material, bool flipped) diff --git a/TechbloxModdingAPI/TechbloxModdingAPI.csproj b/TechbloxModdingAPI/TechbloxModdingAPI.csproj index cf3a157..6fe520b 100644 --- a/TechbloxModdingAPI/TechbloxModdingAPI.csproj +++ b/TechbloxModdingAPI/TechbloxModdingAPI.csproj @@ -2,7 +2,7 @@ net472 true - 2.0.0 + 2.1.0 Exmods GNU General Public Licence 3+ https://git.exmods.org/modtainers/GamecraftModdingAPI diff --git a/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs b/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs index 75d0cc4..754d588 100644 --- a/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs +++ b/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs @@ -99,7 +99,7 @@ namespace TechbloxModdingAPI.Tests .Description("Place a block of aluminium at the given coordinates") .Action((float x, float y, float z) => { - var block = Block.PlaceNew(BlockIDs.Cube, new float3(x, y, z), force: true); + var block = Block.PlaceNew(BlockIDs.Cube, new float3(x, y, z)); Logging.CommandLog("Block placed with type: " + block.Type); }) .Build(); diff --git a/doxygen.conf b/doxygen.conf index 2747deb..4a0bdd5 100644 --- a/doxygen.conf +++ b/doxygen.conf @@ -38,7 +38,7 @@ PROJECT_NAME = "TechbloxModdingAPI" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = "v2.0.0" +PROJECT_NUMBER = "v2.1.0" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a -- 2.30.2 From 2a1782cd82ba73a394563c3c86ecb77dd650a9b9 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Wed, 15 Dec 2021 03:46:38 +0100 Subject: [PATCH 222/252] Start updating to 2021.12.14.17.00 A bunch of errors still --- Automation/gen_csproj.py | 2 +- TechbloxModdingAPI/App/CurrentGameMode.cs | 14 +- TechbloxModdingAPI/App/Game.cs | 6 +- TechbloxModdingAPI/App/GameGameEngine.cs | 2 +- TechbloxModdingAPI/App/GameMenuEngine.cs | 7 +- TechbloxModdingAPI/Block.cs | 9 +- .../Blocks/Engines/BlockCloneEngine.cs | 2 +- .../Blocks/Engines/MovementEngine.cs | 1 - .../Blocks/Engines/PlacementEngine.cs | 3 +- .../Blocks/Engines/SignalEngine.cs | 34 +- TechbloxModdingAPI/Input/FakeInput.cs | 2 +- .../Persistence/SaveGameEnginePatch.cs | 12 +- .../Persistence/SimpleEntitySerializer.cs | 2 +- TechbloxModdingAPI/Player.cs | 2 +- TechbloxModdingAPI/Tasks/Scheduler.cs | 4 +- TechbloxModdingAPI/TechbloxModdingAPI.csproj | 1344 +++++++++-------- TechbloxModdingAPI/Tests/TestRoot.cs | 2 +- TechbloxModdingAPI/Utility/FullGameFields.cs | 8 - 18 files changed, 779 insertions(+), 677 deletions(-) diff --git a/Automation/gen_csproj.py b/Automation/gen_csproj.py index 9d5dfbc..bcfd712 100755 --- a/Automation/gen_csproj.py +++ b/Automation/gen_csproj.py @@ -39,7 +39,7 @@ if __name__ == "__main__": args = parser.parse_args() print("Building Assembly references") - asmXml = buildReferencesXml("../ref/TechbloxPreview_Data/Managed") + asmXml = buildReferencesXml("../ref_preview/TechbloxPreview_Data/Managed") # print(asmXml) with open("../TechbloxModdingAPI/TechbloxModdingAPI.csproj", "r") as xmlFile: diff --git a/TechbloxModdingAPI/App/CurrentGameMode.cs b/TechbloxModdingAPI/App/CurrentGameMode.cs index 85b3e09..211b552 100644 --- a/TechbloxModdingAPI/App/CurrentGameMode.cs +++ b/TechbloxModdingAPI/App/CurrentGameMode.cs @@ -1,23 +1,27 @@ -namespace TechbloxModdingAPI.App +using System; + +namespace TechbloxModdingAPI.App { public enum CurrentGameMode { None, /// - /// Building a game + /// Building a world /// Build, /// - /// Playing a game + /// Playing on a map /// Play, /// - /// Viewing a prefab + /// Viewing a prefab (doesn't exist anymore) /// + [Obsolete] View, /// - /// Viewing a tutorial + /// Viewing a tutorial (doesn't exist anymore) /// + [Obsolete] Tutorial } } \ No newline at end of file diff --git a/TechbloxModdingAPI/App/Game.cs b/TechbloxModdingAPI/App/Game.cs index 7f52965..aac7cb5 100644 --- a/TechbloxModdingAPI/App/Game.cs +++ b/TechbloxModdingAPI/App/Game.cs @@ -2,12 +2,10 @@ using System.Collections.Generic; using System.Runtime.CompilerServices; -using RobocraftX.Common; using RobocraftX.GUI.MyGamesScreen; -using RobocraftX.StateSync; using Svelto.ECS; +using Techblox.GameSelection; -using TechbloxModdingAPI; using TechbloxModdingAPI.Blocks; using TechbloxModdingAPI.Tasks; using TechbloxModdingAPI.Utility; @@ -318,7 +316,7 @@ namespace TechbloxModdingAPI.App get { if (menuMode || !VerifyMode()) return CurrentGameMode.None; - return (CurrentGameMode) GameMode.CurrentMode; + return gameEngine.GetGameData().gameMode == GameMode.CreateWorld ? CurrentGameMode.Build : CurrentGameMode.Play; } } diff --git a/TechbloxModdingAPI/App/GameGameEngine.cs b/TechbloxModdingAPI/App/GameGameEngine.cs index 2bed201..147606e 100644 --- a/TechbloxModdingAPI/App/GameGameEngine.cs +++ b/TechbloxModdingAPI/App/GameGameEngine.cs @@ -54,7 +54,7 @@ namespace TechbloxModdingAPI.App { if (async) { - ExitCurrentGameAsync().RunOn(Lean.EveryFrameStepRunner_TimeRunningAndStopped); + ExitCurrentGameAsync().RunOn(ClientLean.EveryFrameStepRunner_TimeRunningAndStopped); } else { diff --git a/TechbloxModdingAPI/App/GameMenuEngine.cs b/TechbloxModdingAPI/App/GameMenuEngine.cs index ac24e3a..f356a0d 100644 --- a/TechbloxModdingAPI/App/GameMenuEngine.cs +++ b/TechbloxModdingAPI/App/GameMenuEngine.cs @@ -3,16 +3,14 @@ using System.Reflection; using HarmonyLib; using RobocraftX; -using RobocraftX.Common; -using RobocraftX.FrontEnd; using RobocraftX.GUI; using RobocraftX.GUI.MyGamesScreen; using Svelto.ECS; using Svelto.ECS.Experimental; using Techblox.GameSelection; + using TechbloxModdingAPI.Engines; using TechbloxModdingAPI.Utility; -using GameMode = RobocraftX.Common.GameMode; namespace TechbloxModdingAPI.App { @@ -107,11 +105,10 @@ namespace TechbloxModdingAPI.App public bool EnterGame(string gameName, string fileId, bool autoEnterSim = false) { - GameMode.CurrentMode = autoEnterSim ? RCXMode.Play : RCXMode.Build; var data = new GameSelectionData { gameMode = Techblox.GameSelection.GameMode.PlayGame, - gameType = GameType.MachineEditor, + isOnline = false, saveName = gameName, saveType = SaveType.ExistingSave, gameID = "GAMEID_Road_Track", //TODO: Expose to the API diff --git a/TechbloxModdingAPI/Block.cs b/TechbloxModdingAPI/Block.cs index ec1147a..ccc02ab 100644 --- a/TechbloxModdingAPI/Block.cs +++ b/TechbloxModdingAPI/Block.cs @@ -8,9 +8,10 @@ using Svelto.ECS.EntityStructs; using RobocraftX.Common; using RobocraftX.Blocks; using Unity.Mathematics; -using Gamecraft.Blocks.GUI; using HarmonyLib; using RobocraftX.PilotSeat; +using RobocraftX.Rendering; +using Techblox.BlockLabels; using TechbloxModdingAPI.Blocks; using TechbloxModdingAPI.Blocks.Engines; @@ -342,11 +343,9 @@ namespace TechbloxModdingAPI [TestValue(null)] public string Label { - get => BlockEngine.GetBlockInfoViewComponent(this).textLabelComponent?.text; + get => BlockEngine.GetBlockInfo(this).ToString(); //TODO: Block labels set - { - var comp = BlockEngine.GetBlockInfoViewComponent(this).textLabelComponent; - if (comp != null) comp.text = value; + { //TODO } } diff --git a/TechbloxModdingAPI/Blocks/Engines/BlockCloneEngine.cs b/TechbloxModdingAPI/Blocks/Engines/BlockCloneEngine.cs index 01f2d05..a8cd39e 100644 --- a/TechbloxModdingAPI/Blocks/Engines/BlockCloneEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/BlockCloneEngine.cs @@ -60,7 +60,7 @@ namespace TechbloxModdingAPI.Blocks.Engines copyToBlock.Invoke(Patch.copyEngine, new object[] {pickedBlock.ID, pickedBlock}); - ExclusiveGroupStruct group = WiresExclusiveGroups.WIRES_COPY_GROUP + playerID; + ExclusiveGroupStruct group = BuildModeWiresGroups.WIRES_COPY_GROUP + playerID; copyWireToBlock.Invoke(Patch.createWireEngine, new object[] {group, pickedBlock.ID}); pickedBlock.placedBlockTweaksMustCopy = false; diff --git a/TechbloxModdingAPI/Blocks/Engines/MovementEngine.cs b/TechbloxModdingAPI/Blocks/Engines/MovementEngine.cs index 9351623..07bfbe6 100644 --- a/TechbloxModdingAPI/Blocks/Engines/MovementEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/MovementEngine.cs @@ -1,5 +1,4 @@ using RobocraftX.Common; -using RobocraftX.UECS; using Svelto.ECS; using Svelto.ECS.EntityStructs; using Unity.Mathematics; diff --git a/TechbloxModdingAPI/Blocks/Engines/PlacementEngine.cs b/TechbloxModdingAPI/Blocks/Engines/PlacementEngine.cs index 9ce7d84..f4ea4c0 100644 --- a/TechbloxModdingAPI/Blocks/Engines/PlacementEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/PlacementEngine.cs @@ -54,7 +54,8 @@ namespace TechbloxModdingAPI.Blocks.Engines //RobocraftX.CR.MachineEditing.PlaceSingleBlockEngine DBEntityStruct dbEntity = new DBEntityStruct {DBID = block}; - EntityInitializer structInitializer = _blockEntityFactory.Build(CommonExclusiveGroups.nextBlockEntityID, block); //The ghost block index is only used for triggers + //TODO: Test + EntityInitializer structInitializer = _blockEntityFactory.Build(CommonExclusiveGroups.blockIDGeneratorClient.Next(), block); //The ghost block index is only used for triggers uint prefabAssetID = structInitializer.Has() ? structInitializer.Get().prefabAssetID : throw new BlockException("Prefab asset ID not found!"); //Set by the game diff --git a/TechbloxModdingAPI/Blocks/Engines/SignalEngine.cs b/TechbloxModdingAPI/Blocks/Engines/SignalEngine.cs index 3c2e1cb..a612ea2 100644 --- a/TechbloxModdingAPI/Blocks/Engines/SignalEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/SignalEngine.cs @@ -43,7 +43,7 @@ namespace TechbloxModdingAPI.Blocks.Engines public WireEntityStruct CreateNewWire(EGID startBlock, byte startPort, EGID endBlock, byte endPort) { - EGID wireEGID = new EGID(WiresExclusiveGroups.NewWireEntityId, NamedExclusiveGroup.Group); + EGID wireEGID = new EGID(BuildModeWiresGroups.NewWireEntityId, BuildModeWiresGroups.WiresGroup.Group); EntityInitializer wireInitializer = Factory.BuildEntity(wireEGID); wireInitializer.Init(new WireEntityStruct { @@ -77,8 +77,8 @@ namespace TechbloxModdingAPI.Blocks.Engines public ref PortEntityStruct GetPortByOffset(BlockPortsStruct bps, byte portNumber, bool input) { ExclusiveGroup group = input - ? NamedExclusiveGroup.Group - : NamedExclusiveGroup.Group; + ? NamedExclusiveGroup.Group + : NamedExclusiveGroup.Group; uint id = (input ? bps.firstInputID : bps.firstOutputID) + portNumber; EGID egid = new EGID(id, group); if (!entitiesDB.Exists(egid)) @@ -193,7 +193,7 @@ namespace TechbloxModdingAPI.Blocks.Engines EGID[] inputs = new EGID[ports.inputCount]; for (uint i = 0; i < ports.inputCount; i++) { - inputs[i] = new EGID(i + ports.firstInputID, NamedExclusiveGroup.Group); + inputs[i] = new EGID(i + ports.firstInputID, NamedExclusiveGroup.Group); } return inputs; } @@ -204,7 +204,7 @@ namespace TechbloxModdingAPI.Blocks.Engines EGID[] outputs = new EGID[ports.outputCount]; for (uint i = 0; i < ports.outputCount; i++) { - outputs[i] = new EGID(i + ports.firstOutputID, NamedExclusiveGroup.Group); + outputs[i] = new EGID(i + ports.firstOutputID, NamedExclusiveGroup.Group); } return outputs; } @@ -219,8 +219,8 @@ namespace TechbloxModdingAPI.Blocks.Engines if (!entitiesDB.Exists(block)) return default; var group = output - ? NamedExclusiveGroup.Group - : NamedExclusiveGroup.Group; + ? NamedExclusiveGroup.Group + : NamedExclusiveGroup.Group; BlockPortsStruct ports = entitiesDB.QueryEntity(block); if (!entitiesDB.TryQueryMappedEntities(group, out var mapper)) return default; @@ -237,7 +237,7 @@ namespace TechbloxModdingAPI.Blocks.Engines public ref WireEntityStruct MatchPortToWire(PortEntityStruct port, EGID blockID, out bool exists) { - var wires = entitiesDB.QueryEntities(NamedExclusiveGroup.Group); + var wires = entitiesDB.QueryEntities(NamedExclusiveGroup.Group); var wiresB = wires.ToBuffer().buffer; for (uint i = 0; i < wires.count; i++) { @@ -264,7 +264,7 @@ namespace TechbloxModdingAPI.Blocks.Engines else { BlockPortsStruct ports = entitiesDB.QueryEntity(startBlock); - startPorts = new EGID[] {new EGID(ports.firstOutputID + startPort, NamedExclusiveGroup.Group) }; + startPorts = new EGID[] {new EGID(ports.firstOutputID + startPort, NamedExclusiveGroup.Group) }; } EGID[] endPorts; @@ -276,10 +276,10 @@ namespace TechbloxModdingAPI.Blocks.Engines else { BlockPortsStruct ports = entitiesDB.QueryEntity(endBlock); - endPorts = new EGID[] {new EGID(ports.firstInputID + endPort, NamedExclusiveGroup.Group) }; + endPorts = new EGID[] {new EGID(ports.firstInputID + endPort, NamedExclusiveGroup.Group) }; } - EntityCollection wires = entitiesDB.QueryEntities(NamedExclusiveGroup.Group); + EntityCollection wires = entitiesDB.QueryEntities(NamedExclusiveGroup.Group); var wiresB = wires.ToBuffer().buffer; for (int endIndex = 0; endIndex < endPorts.Length; endIndex++) { @@ -304,7 +304,7 @@ namespace TechbloxModdingAPI.Blocks.Engines public OptionalRef GetChannelDataStruct(EGID portID) { var port = GetPort(portID); - var channels = entitiesDB.QueryEntities(NamedExclusiveGroup.Group); + var channels = entitiesDB.QueryEntities(NamedExclusiveGroup.Group); var channelsB = channels.ToBuffer(); return port.firstChannelIndexCachedInSim < channels.count ? new OptionalRef(channelsB.buffer, port.firstChannelIndexCachedInSim) @@ -329,7 +329,7 @@ namespace TechbloxModdingAPI.Blocks.Engines public EGID[] WiredToInput(EGID block, byte port) { - WireEntityStruct[] wireEntityStructs = Search(NamedExclusiveGroup.Group, + WireEntityStruct[] wireEntityStructs = Search(NamedExclusiveGroup.Group, (WireEntityStruct wes) => wes.destinationPortUsage == port && wes.destinationBlockEGID == block); EGID[] result = new EGID[wireEntityStructs.Length]; for (uint i = 0; i < wireEntityStructs.Length; i++) @@ -342,7 +342,7 @@ namespace TechbloxModdingAPI.Blocks.Engines public EGID[] WiredToOutput(EGID block, byte port) { - WireEntityStruct[] wireEntityStructs = Search(NamedExclusiveGroup.Group, + WireEntityStruct[] wireEntityStructs = Search(NamedExclusiveGroup.Group, (WireEntityStruct wes) => wes.sourcePortUsage == port && wes.sourceBlockEGID == block); EGID[] result = new EGID[wireEntityStructs.Length]; for (uint i = 0; i < wireEntityStructs.Length; i++) @@ -371,13 +371,13 @@ namespace TechbloxModdingAPI.Blocks.Engines private EntityCollection GetSignalStruct(uint signalID, out uint index, bool input = true) { ExclusiveGroup group = input - ? NamedExclusiveGroup.Group - : NamedExclusiveGroup.Group; + ? NamedExclusiveGroup.Group + : NamedExclusiveGroup.Group; if (entitiesDB.Exists(signalID, group)) { index = entitiesDB.QueryEntity(signalID, group).anyChannelIndex; var channelData = - entitiesDB.QueryEntities(NamedExclusiveGroup.Group); + entitiesDB.QueryEntities(NamedExclusiveGroup.Group); return channelData; } diff --git a/TechbloxModdingAPI/Input/FakeInput.cs b/TechbloxModdingAPI/Input/FakeInput.cs index a3d068a..6beb63f 100644 --- a/TechbloxModdingAPI/Input/FakeInput.cs +++ b/TechbloxModdingAPI/Input/FakeInput.cs @@ -111,7 +111,7 @@ namespace TechbloxModdingAPI.Input ref LocalPlayerInputEntityStruct currentInput = ref inputEngine.GetPlayerInputRef(playerID); //Utility.Logging.CommandLog($"Current sim frame {currentInput.frame}"); // set inputs - if (toggleMode) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.ToggleTimeRunningMode; + if (toggleMode) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.ToggleTimeRunningModeTest; //TODO: Test, play if (forward) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.Forward; if (backward) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.Backward; if (up) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.Up; diff --git a/TechbloxModdingAPI/Persistence/SaveGameEnginePatch.cs b/TechbloxModdingAPI/Persistence/SaveGameEnginePatch.cs index 4386d3a..06f4a1a 100644 --- a/TechbloxModdingAPI/Persistence/SaveGameEnginePatch.cs +++ b/TechbloxModdingAPI/Persistence/SaveGameEnginePatch.cs @@ -25,7 +25,7 @@ namespace TechbloxModdingAPI.Persistence Logging.MetaDebugLog("Skipping component serialization: no serializers registered!"); return; } - serializationData.data.ExpandBy((uint)frameStart.Length); + serializationData.data.IncreaseCapacityBy((uint)frameStart.Length); BinaryBufferWriter bbw = new BinaryBufferWriter(serializationData.data.ToArrayFast(out int buffLen), serializationData.dataPos); uint originalPos = serializationData.dataPos; Logging.MetaDebugLog($"dataPos: {originalPos}"); @@ -35,14 +35,14 @@ namespace TechbloxModdingAPI.Persistence bbw.Write(frameStart[i]); } Logging.MetaDebugLog($"dataPos (after frame start): {bbw.Position}"); - serializationData.data.ExpandBy(4u); + serializationData.data.IncreaseCapacityBy(4u); bbw.Write((uint)SerializerManager.GetSerializersCount()); string[] serializerKeys = SerializerManager.GetSerializerNames(); for (uint c = 0; c < serializerKeys.Length; c++) { Logging.MetaDebugLog($"dataPos (loop start): {bbw.Position}"); // write component info - serializationData.data.ExpandBy(4u + (uint)serializerKeys[c].Length); + serializationData.data.IncreaseCapacityBy(4u + (uint)serializerKeys[c].Length); bbw.Write((uint)serializerKeys[c].Length); Logging.MetaDebugLog($"dataPos (now): {bbw.Position}"); byte[] nameBytes = Encoding.UTF8.GetBytes(serializerKeys[c]); @@ -51,7 +51,7 @@ namespace TechbloxModdingAPI.Persistence bbw.Write(nameBytes[i]); } Logging.MetaDebugLog($"dataPos (now): {bbw.Position}"); - serializationData.data.ExpandBy(4u); + serializationData.data.IncreaseCapacityBy(4u); serializationData.dataPos = bbw.Position + 4u; Logging.MetaDebugLog($"dataPos (now): {bbw.Position}"); Logging.MetaDebugLog($"dataPos (appears to be): {serializationData.dataPos}"); @@ -73,8 +73,8 @@ namespace TechbloxModdingAPI.Persistence } public static MethodBase TargetMethod() - { - return typeof(SaveGameEngine).GetMethod("SerializeGameToBuffer"); + { + return AccessTools.TypeByName("RobocraftX.SaveAndLoad.SaveGameEngine").GetMethod("SerializeGameToBuffer"); } } } diff --git a/TechbloxModdingAPI/Persistence/SimpleEntitySerializer.cs b/TechbloxModdingAPI/Persistence/SimpleEntitySerializer.cs index 10e7ce1..57f787a 100644 --- a/TechbloxModdingAPI/Persistence/SimpleEntitySerializer.cs +++ b/TechbloxModdingAPI/Persistence/SimpleEntitySerializer.cs @@ -46,7 +46,7 @@ namespace TechbloxModdingAPI.Persistence public bool Serialize(ref ISerializationData serializationData, EntitiesDB entitiesDB, IEntitySerialization entitySerializer) { - serializationData.data.ExpandBy(4u); + serializationData.data.IncreaseCapacityBy(4u); BinaryBufferWriter bbw = new BinaryBufferWriter(serializationData.data.ToArrayFast(out int count), serializationData.dataPos); EGID[] toSerialize = getEntitiesToSerialize(entitiesDB); bbw.Write((uint)toSerialize.Length); diff --git a/TechbloxModdingAPI/Player.cs b/TechbloxModdingAPI/Player.cs index 2ce88f1..f4386db 100644 --- a/TechbloxModdingAPI/Player.cs +++ b/TechbloxModdingAPI/Player.cs @@ -481,7 +481,7 @@ namespace TechbloxModdingAPI { var egid = playerEngine.GetThingLookedAt(Id, maxDistance); return egid != default && egid.groupID == WiresGUIExclusiveGroups.WireGroup - ? EcsObjectBase.GetInstance(new EGID(egid.entityID, NamedExclusiveGroup.Group), + ? EcsObjectBase.GetInstance(new EGID(egid.entityID, BuildModeWiresGroups.WiresGroup.Group), e => new Wire(e)) : null; } diff --git a/TechbloxModdingAPI/Tasks/Scheduler.cs b/TechbloxModdingAPI/Tasks/Scheduler.cs index 764e9b7..5ad842e 100644 --- a/TechbloxModdingAPI/Tasks/Scheduler.cs +++ b/TechbloxModdingAPI/Tasks/Scheduler.cs @@ -20,7 +20,7 @@ namespace TechbloxModdingAPI.Tasks { get { - return RobocraftX.Schedulers.Lean.UIScheduler; + return RobocraftX.Schedulers.ClientLean.UIScheduler; } } @@ -28,7 +28,7 @@ namespace TechbloxModdingAPI.Tasks { get { - return RobocraftX.Schedulers.ExtraLean.UIScheduler; + return RobocraftX.Schedulers.ClientExtraLean.UIScheduler; } } diff --git a/TechbloxModdingAPI/TechbloxModdingAPI.csproj b/TechbloxModdingAPI/TechbloxModdingAPI.csproj index 95927f8..7d5cab8 100644 --- a/TechbloxModdingAPI/TechbloxModdingAPI.csproj +++ b/TechbloxModdingAPI/TechbloxModdingAPI.csproj @@ -37,1205 +37,1317 @@ ..\..\ref\TechbloxPreview_Data\Managed\IllusionPlugin.dll - ..\ref\TechbloxPreview_Data\Managed\Analytics.dll - ..\..\ref\TechbloxPreview_Data\Managed\Analytics.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Analytics.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Analytics.dll - ..\ref\TechbloxPreview_Data\Managed\Assembly-CSharp-firstpass.dll - ..\..\ref\TechbloxPreview_Data\Managed\Assembly-CSharp-firstpass.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Assembly-CSharp-firstpass.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Assembly-CSharp-firstpass.dll - ..\ref\TechbloxPreview_Data\Managed\Assembly-CSharp.dll - ..\..\ref\TechbloxPreview_Data\Managed\Assembly-CSharp.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Assembly-CSharp.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Assembly-CSharp.dll + + + ..\ref_preview\TechbloxPreview_Data\Managed\AWSSDK.Core.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\AWSSDK.Core.dll + + + ..\ref_preview\TechbloxPreview_Data\Managed\AWSSDK.GameLift.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\AWSSDK.GameLift.dll - ..\ref\TechbloxPreview_Data\Managed\BevelEffect.dll - ..\..\ref\TechbloxPreview_Data\Managed\BevelEffect.dll + ..\ref_preview\TechbloxPreview_Data\Managed\BevelEffect.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\BevelEffect.dll - ..\ref\TechbloxPreview_Data\Managed\Blocks.HUDFeedbackBlocks.dll - ..\..\ref\TechbloxPreview_Data\Managed\Blocks.HUDFeedbackBlocks.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Blocks.HUDFeedbackBlocks.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Blocks.HUDFeedbackBlocks.dll - ..\ref\TechbloxPreview_Data\Managed\Boxophobic.TheVehetationEngine.Runtime.dll - ..\..\ref\TechbloxPreview_Data\Managed\Boxophobic.TheVehetationEngine.Runtime.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Boxophobic.TheVehetationEngine.Runtime.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Boxophobic.TheVehetationEngine.Runtime.dll - ..\ref\TechbloxPreview_Data\Managed\Boxophobic.Utils.Scripts.dll - ..\..\ref\TechbloxPreview_Data\Managed\Boxophobic.Utils.Scripts.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Boxophobic.Utils.Scripts.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Boxophobic.Utils.Scripts.dll - ..\ref\TechbloxPreview_Data\Managed\DataLoader.dll - ..\..\ref\TechbloxPreview_Data\Managed\DataLoader.dll + ..\ref_preview\TechbloxPreview_Data\Managed\DataLoader.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\DataLoader.dll - ..\ref\TechbloxPreview_Data\Managed\DDNA.dll - ..\..\ref\TechbloxPreview_Data\Managed\DDNA.dll + ..\ref_preview\TechbloxPreview_Data\Managed\DDNA.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\DDNA.dll - ..\ref\TechbloxPreview_Data\Managed\EasyButtons.dll - ..\..\ref\TechbloxPreview_Data\Managed\EasyButtons.dll + ..\ref_preview\TechbloxPreview_Data\Managed\EasyButtons.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\EasyButtons.dll - ..\ref\TechbloxPreview_Data\Managed\EOSSDK.dll - ..\..\ref\TechbloxPreview_Data\Managed\EOSSDK.dll + ..\ref_preview\TechbloxPreview_Data\Managed\EOSSDK.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\EOSSDK.dll + + + ..\ref_preview\TechbloxPreview_Data\Managed\Facepunch.Steamworks.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Facepunch.Steamworks.dll - ..\ref\TechbloxPreview_Data\Managed\FMODUnity.dll - ..\..\ref\TechbloxPreview_Data\Managed\FMODUnity.dll + ..\ref_preview\TechbloxPreview_Data\Managed\FMODUnity.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\FMODUnity.dll - ..\ref\TechbloxPreview_Data\Managed\FMODUnityResonance.dll - ..\..\ref\TechbloxPreview_Data\Managed\FMODUnityResonance.dll + ..\ref_preview\TechbloxPreview_Data\Managed\FMODUnityResonance.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\FMODUnityResonance.dll - ..\ref\TechbloxPreview_Data\Managed\FullGame.dll - ..\..\ref\TechbloxPreview_Data\Managed\FullGame.dll + ..\ref_preview\TechbloxPreview_Data\Managed\FullGame.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\FullGame.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.AudioBlocks.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.AudioBlocks.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.AudioBlocks.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.AudioBlocks.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.BlockEntityFactory.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.BlockEntityFactory.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.BlockEntityFactory.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.BlockEntityFactory.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.BlockGroups.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.BlockGroups.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.BlockGroups.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.BlockGroups.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.DamagingSurfaceBlock.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.DamagingSurfaceBlock.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.Blocks.DamagingSurfaceBlock.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.Blocks.DamagingSurfaceBlock.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.DestructionBlocks.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.DestructionBlocks.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.Blocks.DestructionBlocks.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.Blocks.DestructionBlocks.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.GenericPhysicsBlocks.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.GenericPhysicsBlocks.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.Blocks.GenericPhysicsBlocks.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.Blocks.GenericPhysicsBlocks.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.LogicBlock.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.LogicBlock.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.Blocks.LogicBlock.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.Blocks.LogicBlock.dll - ..\ref\TechbloxPreview_Data\Managed\GameCraft.Blocks.ProjectileBlock.dll - ..\..\ref\TechbloxPreview_Data\Managed\GameCraft.Blocks.ProjectileBlock.dll - - - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.TextBlock.CompositionRoot.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.TextBlock.CompositionRoot.dll - - - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.TimerBlock.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.TimerBlock.dll + ..\ref_preview\TechbloxPreview_Data\Managed\GameCraft.Blocks.ProjectileBlock.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\GameCraft.Blocks.ProjectileBlock.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.CharacterVulnerability.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.CharacterVulnerability.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.CharacterVulnerability.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.CharacterVulnerability.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.CharacterVulnerabilityGui.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.CharacterVulnerabilityGui.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.CharacterVulnerabilityGui.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.CharacterVulnerabilityGui.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.ColourPalette.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.ColourPalette.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.ColourPalette.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.ColourPalette.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Damage.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Damage.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.Damage.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.Damage.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Effects.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Effects.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.Effects.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.Effects.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.ExplosionFragments.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.ExplosionFragments.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.ExplosionFragments.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.ExplosionFragments.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GraphicsSettings.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GraphicsSettings.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.GraphicsSettings.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.GraphicsSettings.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.BlueprintInventory.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.BlueprintInventory.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.GUI.BlueprintInventory.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.GUI.BlueprintInventory.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.BlueprintInventoryMock.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.BlueprintInventoryMock.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.GUI.BlueprintInventoryMock.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.GUI.BlueprintInventoryMock.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Blueprints.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Blueprints.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.GUI.Blueprints.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.GUI.Blueprints.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.BlueprintSets.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.BlueprintSets.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.GUI.BlueprintSets.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.GUI.BlueprintSets.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.GameOptionsScreen.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.GameOptionsScreen.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.GUI.GameOptionsScreen.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.GUI.GameOptionsScreen.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Hotbar.Blocks.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Hotbar.Blocks.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.GUI.Hotbar.Blocks.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.GUI.Hotbar.Blocks.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Hotbar.BlueprintsHotbar.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Hotbar.BlueprintsHotbar.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.GUI.Hotbar.BlueprintsHotbar.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.GUI.Hotbar.BlueprintsHotbar.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Hotbar.Colours.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Hotbar.Colours.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.GUI.Hotbar.Colours.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.GUI.Hotbar.Colours.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.HUDFeedbackBlocks.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.HUDFeedbackBlocks.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.GUI.HUDFeedbackBlocks.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.GUI.HUDFeedbackBlocks.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.ModeBar.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.ModeBar.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.GUI.ModeBar.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.GUI.ModeBar.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.OptionsScreen.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.OptionsScreen.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.GUI.OptionsScreen.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.GUI.OptionsScreen.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Blocks.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Blocks.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Blocks.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Blocks.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Blueprints.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Blueprints.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Blueprints.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Blueprints.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Colours.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Colours.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Colours.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Colours.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Common.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Common.dll - - - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TimeModeClock.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TimeModeClock.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Common.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Common.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Tweaks.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Tweaks.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.GUI.Tweaks.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.GUI.Tweaks.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Wires.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Wires.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.GUI.Wires.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.GUI.Wires.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Wires.Mockup.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Wires.Mockup.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.GUI.Wires.Mockup.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.GUI.Wires.Mockup.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.InventoryTimeRunning.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.InventoryTimeRunning.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.InventoryTimeRunning.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.InventoryTimeRunning.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.JointBlocks.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.JointBlocks.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.JointBlocks.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.JointBlocks.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Music.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Music.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.Music.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.Music.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.NetStrings.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.NetStrings.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.NetStrings.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.NetStrings.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.PerformanceWarnings.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.PerformanceWarnings.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.PerformanceWarnings.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.PerformanceWarnings.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.PickupBlck.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.PickupBlck.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.PickupBlck.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.PickupBlck.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.PickupsCommon.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.PickupsCommon.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.PickupsCommon.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.PickupsCommon.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.PopupMessage.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.PopupMessage.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.PopupMessage.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.PopupMessage.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Projectiles.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Projectiles.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.Projectiles.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.Projectiles.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Serialization.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Serialization.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.Serialization.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.Serialization.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Tweaks.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Tweaks.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.Tweaks.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.Tweaks.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Tweaks.Mockup.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Tweaks.Mockup.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.Tweaks.Mockup.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.Tweaks.Mockup.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.VisualEffects.Decals.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.VisualEffects.Decals.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.VisualEffects.Decals.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.VisualEffects.Decals.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.VisualEffects.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.VisualEffects.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.VisualEffects.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.VisualEffects.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Wires.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Wires.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.Wires.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.Wires.dll - ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Wires.Mockup.dll - ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Wires.Mockup.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.Wires.Mockup.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Gamecraft.Wires.Mockup.dll + + + ..\ref_preview\TechbloxPreview_Data\Managed\GameLiftServerSDKNet45.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\GameLiftServerSDKNet45.dll - ..\ref\TechbloxPreview_Data\Managed\GameState.dll - ..\..\ref\TechbloxPreview_Data\Managed\GameState.dll + ..\ref_preview\TechbloxPreview_Data\Managed\GameState.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\GameState.dll - ..\ref\TechbloxPreview_Data\Managed\GhostShark.Outline.dll - ..\..\ref\TechbloxPreview_Data\Managed\GhostShark.Outline.dll + ..\ref_preview\TechbloxPreview_Data\Managed\GhostShark.Outline.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\GhostShark.Outline.dll + + + ..\ref_preview\TechbloxPreview_Data\Managed\Google.Protobuf.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Google.Protobuf.dll - ..\ref\TechbloxPreview_Data\Managed\GPUInstancer.CrowdAnimations.dll - ..\..\ref\TechbloxPreview_Data\Managed\GPUInstancer.CrowdAnimations.dll + ..\ref_preview\TechbloxPreview_Data\Managed\GPUInstancer.CrowdAnimations.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\GPUInstancer.CrowdAnimations.dll - ..\ref\TechbloxPreview_Data\Managed\GPUInstancer.dll - ..\..\ref\TechbloxPreview_Data\Managed\GPUInstancer.dll + ..\ref_preview\TechbloxPreview_Data\Managed\GPUInstancer.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\GPUInstancer.dll - ..\ref\TechbloxPreview_Data\Managed\Havok.Physics.dll - ..\..\ref\TechbloxPreview_Data\Managed\Havok.Physics.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Havok.Physics.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Havok.Physics.dll - ..\ref\TechbloxPreview_Data\Managed\Havok.Physics.Hybrid.dll - ..\..\ref\TechbloxPreview_Data\Managed\Havok.Physics.Hybrid.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Havok.Physics.Hybrid.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Havok.Physics.Hybrid.dll - ..\ref\TechbloxPreview_Data\Managed\JWT.dll - ..\..\ref\TechbloxPreview_Data\Managed\JWT.dll + ..\ref_preview\TechbloxPreview_Data\Managed\JWT.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\JWT.dll + + + ..\ref_preview\TechbloxPreview_Data\Managed\log4net.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\log4net.dll - ..\ref\TechbloxPreview_Data\Managed\LZ4.dll - ..\..\ref\TechbloxPreview_Data\Managed\LZ4.dll + ..\ref_preview\TechbloxPreview_Data\Managed\LZ4.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\LZ4.dll - ..\ref\TechbloxPreview_Data\Managed\mscorlib.dll - ..\..\ref\TechbloxPreview_Data\Managed\mscorlib.dll + ..\ref_preview\TechbloxPreview_Data\Managed\mscorlib.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\mscorlib.dll - ..\ref\TechbloxPreview_Data\Managed\MultiplayerNetworking.dll - ..\..\ref\TechbloxPreview_Data\Managed\MultiplayerNetworking.dll - - - ..\ref\TechbloxPreview_Data\Managed\MultiplayerTest.dll - ..\..\ref\TechbloxPreview_Data\Managed\MultiplayerTest.dll + ..\ref_preview\TechbloxPreview_Data\Managed\MultiplayerNetworking.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\MultiplayerNetworking.dll - ..\ref\TechbloxPreview_Data\Managed\netstandard.dll - ..\..\ref\TechbloxPreview_Data\Managed\netstandard.dll + ..\ref_preview\TechbloxPreview_Data\Managed\netstandard.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\netstandard.dll - ..\ref\TechbloxPreview_Data\Managed\Newtonsoft.Json.dll - ..\..\ref\TechbloxPreview_Data\Managed\Newtonsoft.Json.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Newtonsoft.Json.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Newtonsoft.Json.dll - ..\ref\TechbloxPreview_Data\Managed\RCX.ScreenshotTaker.dll - ..\..\ref\TechbloxPreview_Data\Managed\RCX.ScreenshotTaker.dll + ..\ref_preview\TechbloxPreview_Data\Managed\RCX.ScreenshotTaker.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\RCX.ScreenshotTaker.dll - ..\ref\TechbloxPreview_Data\Managed\Rewired_Core.dll - ..\..\ref\TechbloxPreview_Data\Managed\Rewired_Core.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Rewired_Core.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Rewired_Core.dll - ..\ref\TechbloxPreview_Data\Managed\Rewired_Windows.dll - ..\..\ref\TechbloxPreview_Data\Managed\Rewired_Windows.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Rewired_Windows.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Rewired_Windows.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftECS.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftECS.dll + ..\ref_preview\TechbloxPreview_Data\Managed\RobocraftECS.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\RobocraftECS.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.AccountPreferences.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.AccountPreferences.dll + ..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.AccountPreferences.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.AccountPreferences.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Blocks.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Blocks.dll + ..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.Blocks.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.Blocks.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Blocks.Ghost.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Blocks.Ghost.dll + ..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.Blocks.Ghost.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.Blocks.Ghost.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Blocks.Triggers.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Blocks.Triggers.dll + ..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.Blocks.Triggers.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.Blocks.Triggers.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Building.BoxSelect.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Building.BoxSelect.dll + ..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.Building.BoxSelect.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.Building.BoxSelect.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Building.Jobs.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Building.Jobs.dll + ..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.Building.Jobs.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.Building.Jobs.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Character.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Character.dll + ..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.Character.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.Character.dll + + + ..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.Character.Weapons.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.Character.Weapons.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Common.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Common.dll + ..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.Common.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.Common.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.ControlsScreen.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.ControlsScreen.dll + ..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.ControlsScreen.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.ControlsScreen.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Crosshair.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Crosshair.dll + ..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.Crosshair.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.Crosshair.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.FrontEnd.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.FrontEnd.dll - - - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.BlockLabel.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.BlockLabel.dll + ..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.FrontEnd.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.FrontEnd.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.DebugDisplay.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.DebugDisplay.dll + ..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.GUI.DebugDisplay.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.GUI.DebugDisplay.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.dll + ..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.GUI.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.GUI.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Hotbar.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Hotbar.dll + ..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.GUI.Hotbar.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.GUI.Hotbar.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.BlocksInventory.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.BlocksInventory.dll + ..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.BlocksInventory.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.BlocksInventory.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.ColourInventory.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.ColourInventory.dll + ..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.ColourInventory.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.ColourInventory.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.dll + ..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.PauseMenu.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.PauseMenu.dll + ..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.GUI.PauseMenu.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.GUI.PauseMenu.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.ScaleGhost.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.ScaleGhost.dll + ..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.GUI.ScaleGhost.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.GUI.ScaleGhost.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.TabsBar.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.TabsBar.dll + ..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.GUI.TabsBar.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.GUI.TabsBar.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Input.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Input.dll + ..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.Input.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.Input.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.MachineEditor.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.MachineEditor.dll + ..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.MachineEditor.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.MachineEditor.dll + + + ..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.MachineEditorMock.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.MachineEditorMock.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.MainGame.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.MainGame.dll + ..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.MainGame.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.MainGame.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.MainGameMock.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.MainGameMock.dll + ..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.MainGameMock.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.MainGameMock.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.MainSimulation.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.MainSimulation.dll + ..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.MainSimulation.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.MainSimulation.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.MockCharacter.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.MockCharacter.dll + ..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.MockCharacter.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.MockCharacter.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Multiplayer.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Multiplayer.dll - - - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Multiplayer.GUI.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Multiplayer.GUI.dll + ..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.Multiplayer.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.Multiplayer.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll + ..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Multiplayer.Serializers.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Multiplayer.Serializers.dll + ..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.Multiplayer.Serializers.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.Multiplayer.Serializers.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.MultiplayerInput.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.MultiplayerInput.dll + ..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.MultiplayerInput.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.MultiplayerInput.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.ObjectIdBlocks.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.ObjectIdBlocks.dll - - - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Party.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Party.dll + ..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.ObjectIdBlocks.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.ObjectIdBlocks.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Physics.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Physics.dll + ..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.Physics.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.Physics.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.PilotSeat.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.PilotSeat.dll + ..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.PilotSeat.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.PilotSeat.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Player.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Player.dll + ..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.Player.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.Player.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Rendering.Mock.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Rendering.Mock.dll + ..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.Rendering.Mock.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.Rendering.Mock.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.SaveAndLoad.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.SaveAndLoad.dll + ..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.SaveAndLoad.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.SaveAndLoad.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.SaveGameDialog.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.SaveGameDialog.dll + ..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.SaveGameDialog.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.SaveGameDialog.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Services.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Services.dll + ..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.Services.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.Services.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.SignalHandling.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.SignalHandling.dll + ..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.SignalHandling.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.SignalHandling.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.SpawnPoints.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.SpawnPoints.dll + ..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.SpawnPoints.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.SpawnPoints.dll - ..\ref\TechbloxPreview_Data\Managed\RobocraftX.StateSync.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.StateSync.dll + ..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.StateSync.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.StateSync.dll - - ..\ref\TechbloxPreview_Data\Managed\RobocraftX_TextBlock.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX_TextBlock.dll + + ..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.StateSync.Mock.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\RobocraftX.StateSync.Mock.dll - ..\ref\TechbloxPreview_Data\Managed\RobocratX.SimulationMockCompositionRoot.dll - ..\..\ref\TechbloxPreview_Data\Managed\RobocratX.SimulationMockCompositionRoot.dll + ..\ref_preview\TechbloxPreview_Data\Managed\RobocratX.SimulationMockCompositionRoot.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\RobocratX.SimulationMockCompositionRoot.dll + + + ..\ref_preview\TechbloxPreview_Data\Managed\ShaderVariantsGenerationTool.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\ShaderVariantsGenerationTool.dll - ..\ref\TechbloxPreview_Data\Managed\SpecializedDescriptors.dll - ..\..\ref\TechbloxPreview_Data\Managed\SpecializedDescriptors.dll + ..\ref_preview\TechbloxPreview_Data\Managed\SpecializedDescriptors.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\SpecializedDescriptors.dll - ..\ref\TechbloxPreview_Data\Managed\StringFormatter.dll - ..\..\ref\TechbloxPreview_Data\Managed\StringFormatter.dll + ..\ref_preview\TechbloxPreview_Data\Managed\StringFormatter.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\StringFormatter.dll - ..\ref\TechbloxPreview_Data\Managed\Svelto.Common.dll - ..\..\ref\TechbloxPreview_Data\Managed\Svelto.Common.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Svelto.Common.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Svelto.Common.dll - ..\ref\TechbloxPreview_Data\Managed\Svelto.ECS.dll - ..\..\ref\TechbloxPreview_Data\Managed\Svelto.ECS.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Svelto.ECS.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Svelto.ECS.dll - ..\ref\TechbloxPreview_Data\Managed\Svelto.ECS.GUI.dll - ..\..\ref\TechbloxPreview_Data\Managed\Svelto.ECS.GUI.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Svelto.ECS.GUI.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Svelto.ECS.GUI.dll - ..\ref\TechbloxPreview_Data\Managed\Svelto.Services.dll - ..\..\ref\TechbloxPreview_Data\Managed\Svelto.Services.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Svelto.Services.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Svelto.Services.dll - ..\ref\TechbloxPreview_Data\Managed\Svelto.Tasks.dll - ..\..\ref\TechbloxPreview_Data\Managed\Svelto.Tasks.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Svelto.Tasks.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Svelto.Tasks.dll + + + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.AdditionalParts.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.AdditionalParts.dll + + + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.Anticheat.Client.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.Anticheat.Client.dll + + + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.Anticheat.Common.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.Anticheat.Common.dll + + + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.Anticheat.Server.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.Anticheat.Server.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.AtmosphereBlock.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.AtmosphereBlock.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.AtmosphereBlock.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.AtmosphereBlock.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.AutoForward.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.AutoForward.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.AutoForward.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.AutoForward.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.Backend.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Backend.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.Backend.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.Backend.dll + + + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.BitBlock.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.BitBlock.dll + + + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.BlockColours.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.BlockColours.dll + + + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.BlockLabels.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.BlockLabels.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.Blocks.LightBlock.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Blocks.LightBlock.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.Blocks.LightBlock.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.Blocks.LightBlock.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.Building.Rules.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Building.Rules.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.Building.Rules.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.Building.Rules.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.BuildingDrone.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.BuildingDrone.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.BuildingDrone.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.BuildingDrone.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.Camera.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Camera.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.Camera.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.Camera.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.ContextSensitiveTextHint.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.ContextSensitiveTextHint.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.ContextSensitiveTextHint.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.ContextSensitiveTextHint.dll + + + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.ECSResourceManagers.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.ECSResourceManagers.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.EngineBlock.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.EngineBlock.dll - - - ..\ref\TechbloxPreview_Data\Managed\Techblox.Environment.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Environment.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.EngineBlock.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.EngineBlock.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.EnvironmentBlocks.BuildingEnvironment.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.EnvironmentBlocks.BuildingEnvironment.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.EnvironmentBlocks.BuildingEnvironment.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.EnvironmentBlocks.BuildingEnvironment.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.EnvironmentBlocks.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.EnvironmentBlocks.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.EnvironmentBlocks.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.EnvironmentBlocks.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.EnvironmentBlocks.SimulationWorldEnvironment.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.EnvironmentBlocks.SimulationWorldEnvironment.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.EnvironmentBlocks.SimulationWorldEnvironment.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.EnvironmentBlocks.SimulationWorldEnvironment.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.GameSelection.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GameSelection.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.GameSelection.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.GameSelection.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Building.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Building.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.GUI.Building.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.GUI.Building.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.BuildRules.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.BuildRules.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.GUI.BuildRules.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.GUI.BuildRules.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.BuildRules.MockUps.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.BuildRules.MockUps.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.GUI.BuildRules.MockUps.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.GUI.BuildRules.MockUps.dll + + + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.GUI.Commands.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.GUI.Commands.dll + + + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.GUI.Controls.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.GUI.Controls.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.GUI.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.GUI.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.GamePortal.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.GamePortal.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.GUI.GamePortal.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.GUI.GamePortal.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.GamePortal.MockUps.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.GamePortal.MockUps.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.GUI.GamePortal.MockUps.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.GUI.GamePortal.MockUps.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Hotbar.Landscapes.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Hotbar.Landscapes.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.GUI.Hotbar.Landscapes.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.GUI.Hotbar.Landscapes.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Hotbar.Materials.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Hotbar.Materials.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.GUI.Hotbar.Materials.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.GUI.Hotbar.Materials.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Inventory.Common.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Inventory.Common.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.GUI.Inventory.Common.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.GUI.Inventory.Common.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Inventory.Landscapes.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Inventory.Landscapes.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.GUI.Inventory.Landscapes.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.GUI.Inventory.Landscapes.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Inventory.Materials.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Inventory.Materials.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.GUI.Inventory.Materials.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.GUI.Inventory.Materials.dll + + + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.GUI.LoadingBar.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.GUI.LoadingBar.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Login.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Login.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.GUI.Login.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.GUI.Login.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Mocks.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Mocks.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.GUI.Mocks.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.GUI.Mocks.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Mocks.DynamicListBuild.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Mocks.DynamicListBuild.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.GUI.Mocks.DynamicListBuild.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.GUI.Mocks.DynamicListBuild.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.MyGamesScreen.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.MyGamesScreen.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.GUI.MyGamesScreen.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.GUI.MyGamesScreen.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Notifications.MockUps.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Notifications.MockUps.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.GUI.Notifications.MockUps.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.GUI.Notifications.MockUps.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.TabsBar.Landscapes.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.TabsBar.Landscapes.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.GUI.TabsBar.Landscapes.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.GUI.TabsBar.Landscapes.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.TabsBar.Materials.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.TabsBar.Materials.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.GUI.TabsBar.Materials.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.GUI.TabsBar.Materials.dll + + + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.GUI.Toggle.MockUps.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.GUI.Toggle.MockUps.dll + + + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.GUI.UsernameDisplay.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.GUI.UsernameDisplay.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.InputCapture.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.InputCapture.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.InputCapture.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.InputCapture.dll + + + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.MachineSimulationPreprocessing.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.MachineSimulationPreprocessing.dll + + + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.MachineSpawning.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.MachineSpawning.dll + + + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.Matchmaking.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.Matchmaking.dll + + + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.Multiplayer.UsernameMessages.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.Multiplayer.UsernameMessages.dll + + + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.PlayUX.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.PlayUX.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.Pointer.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Pointer.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.Pointer.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.Pointer.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.ProceduralReflectionProbes.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.ProceduralReflectionProbes.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.ProceduralReflectionProbes.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.ProceduralReflectionProbes.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.Rendering.Common.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Rendering.Common.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.Rendering.Common.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.Rendering.Common.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.Rendering.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Rendering.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.Rendering.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.Rendering.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.Rendering.DOTS.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Rendering.DOTS.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.Rendering.DOTS.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.Rendering.DOTS.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.Rendering.GPUI.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Rendering.GPUI.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.Rendering.GPUI.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.Rendering.GPUI.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.Rendering.Unity.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Rendering.Unity.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.Rendering.Unity.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.Rendering.Unity.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.SaveGamesConversion.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.SaveGamesConversion.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.SaveGamesConversion.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.SaveGamesConversion.dll + + + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.Server.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.Server.dll + + + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.Services.Anticheat.Client.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.Services.Anticheat.Client.dll + + + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.Services.Anticheat.Server.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.Services.Anticheat.Server.dll + + + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.Services.Eos.Common.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.Services.Eos.Common.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.Services.Eos.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Services.Eos.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.Services.Eos.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.Services.Eos.dll + + + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.Services.Eos.Server.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.Services.Eos.Server.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.Services.GameDetails.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Services.GameDetails.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.Services.GameDetails.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.Services.GameDetails.dll + + + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.Services.Matchmaking.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.Services.Matchmaking.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.Services.Storage.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Services.Storage.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.Services.Storage.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.Services.Storage.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.SwitchAnimation.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.SwitchAnimation.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.SwitchAnimation.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.SwitchAnimation.dll + + + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.TextBlock.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.TextBlock.dll + + + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.TimerBlock.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.TimerBlock.dll - ..\ref\TechbloxPreview_Data\Managed\Techblox.WheelRigBlock.dll - ..\..\ref\TechbloxPreview_Data\Managed\Techblox.WheelRigBlock.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Techblox.WheelRigBlock.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Techblox.WheelRigBlock.dll - ..\ref\TechbloxPreview_Data\Managed\UniTask.Addressables.dll - ..\..\ref\TechbloxPreview_Data\Managed\UniTask.Addressables.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UniTask.Addressables.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UniTask.Addressables.dll - ..\ref\TechbloxPreview_Data\Managed\UniTask.dll - ..\..\ref\TechbloxPreview_Data\Managed\UniTask.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UniTask.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UniTask.dll - ..\ref\TechbloxPreview_Data\Managed\UniTask.DOTween.dll - ..\..\ref\TechbloxPreview_Data\Managed\UniTask.DOTween.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UniTask.DOTween.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UniTask.DOTween.dll - ..\ref\TechbloxPreview_Data\Managed\UniTask.Linq.dll - ..\..\ref\TechbloxPreview_Data\Managed\UniTask.Linq.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UniTask.Linq.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UniTask.Linq.dll - ..\ref\TechbloxPreview_Data\Managed\UniTask.TextMeshPro.dll - ..\..\ref\TechbloxPreview_Data\Managed\UniTask.TextMeshPro.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UniTask.TextMeshPro.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UniTask.TextMeshPro.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Addressables.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Addressables.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Unity.Addressables.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Unity.Addressables.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.Mdb.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.Mdb.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.Mdb.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.Mdb.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.Pdb.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.Pdb.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.Pdb.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.Pdb.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.Rocks.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.Rocks.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.Rocks.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.Rocks.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Burst.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Burst.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Unity.Burst.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Unity.Burst.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Unsafe.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Unsafe.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Unity.Burst.Unsafe.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Unity.Burst.Unsafe.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Collections.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Collections.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Unity.Collections.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Unity.Collections.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Collections.LowLevel.ILSupport.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Collections.LowLevel.ILSupport.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Unity.Collections.LowLevel.ILSupport.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Unity.Collections.LowLevel.ILSupport.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Deformations.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Deformations.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Unity.Deformations.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Unity.Deformations.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Entities.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Entities.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Unity.Entities.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Unity.Entities.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Entities.Hybrid.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Entities.Hybrid.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Unity.Entities.Hybrid.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Unity.Entities.Hybrid.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.InternalAPIEngineBridge.012.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.InternalAPIEngineBridge.012.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Unity.InternalAPIEngineBridge.012.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Unity.InternalAPIEngineBridge.012.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Jobs.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Jobs.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Unity.Jobs.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Unity.Jobs.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Mathematics.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Mathematics.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Unity.Mathematics.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Unity.Mathematics.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Mathematics.Extensions.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Mathematics.Extensions.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Unity.Mathematics.Extensions.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Unity.Mathematics.Extensions.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.MemoryProfiler.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.MemoryProfiler.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Unity.MemoryProfiler.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Unity.MemoryProfiler.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Physics.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Physics.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Unity.Physics.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Unity.Physics.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Physics.Hybrid.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Physics.Hybrid.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Unity.Physics.Hybrid.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Unity.Physics.Hybrid.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Platforms.Common.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Platforms.Common.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Unity.Platforms.Common.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Unity.Platforms.Common.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Properties.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Properties.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Unity.Properties.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Unity.Properties.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Properties.Reflection.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Properties.Reflection.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Unity.Properties.Reflection.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Unity.Properties.Reflection.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Properties.UI.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Properties.UI.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Unity.Properties.UI.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Unity.Properties.UI.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Recorder.Base.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Recorder.Base.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Unity.Recorder.Base.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Unity.Recorder.Base.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Recorder.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Recorder.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Unity.Recorder.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Unity.Recorder.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Rendering.Hybrid.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Rendering.Hybrid.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Unity.Rendering.Hybrid.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Unity.Rendering.Hybrid.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.HighDefinition.Config.Runtime.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.HighDefinition.Config.Runtime.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Unity.RenderPipelines.HighDefinition.Config.Runtime.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Unity.RenderPipelines.HighDefinition.Config.Runtime.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.HighDefinition.Runtime.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.HighDefinition.Runtime.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Unity.RenderPipelines.HighDefinition.Runtime.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Unity.RenderPipelines.HighDefinition.Runtime.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.ResourceManager.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.ResourceManager.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Unity.ResourceManager.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Unity.ResourceManager.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Scenes.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Scenes.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Unity.Scenes.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Unity.Scenes.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.ScriptableBuildPipeline.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.ScriptableBuildPipeline.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Unity.ScriptableBuildPipeline.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Unity.ScriptableBuildPipeline.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Serialization.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Serialization.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Unity.Serialization.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Unity.Serialization.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.TextMeshPro.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.TextMeshPro.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Unity.TextMeshPro.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Unity.TextMeshPro.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Timeline.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Timeline.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Unity.Timeline.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Unity.Timeline.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Transforms.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Transforms.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Unity.Transforms.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Unity.Transforms.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.Transforms.Hybrid.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.Transforms.Hybrid.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Unity.Transforms.Hybrid.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Unity.Transforms.Hybrid.dll - ..\ref\TechbloxPreview_Data\Managed\Unity.VisualEffectGraph.Runtime.dll - ..\..\ref\TechbloxPreview_Data\Managed\Unity.VisualEffectGraph.Runtime.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Unity.VisualEffectGraph.Runtime.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Unity.VisualEffectGraph.Runtime.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.AccessibilityModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.AccessibilityModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.AccessibilityModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.AccessibilityModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.AIModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.AIModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.AIModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.AIModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.AndroidJNIModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.AndroidJNIModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.AndroidJNIModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.AndroidJNIModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.AnimationModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.AnimationModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.AnimationModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.AnimationModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.ARModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.ARModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.ARModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.ARModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.AssetBundleModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.AssetBundleModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.AssetBundleModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.AssetBundleModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.AudioModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.AudioModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.AudioModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.AudioModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.ClothModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.ClothModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.ClothModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.ClothModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.ClusterInputModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.ClusterInputModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.ClusterInputModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.ClusterInputModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.ClusterRendererModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.ClusterRendererModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.ClusterRendererModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.ClusterRendererModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.CoreModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.CoreModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.CoreModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.CoreModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.CrashReportingModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.CrashReportingModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.CrashReportingModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.CrashReportingModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.DirectorModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.DirectorModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.DirectorModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.DirectorModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.DSPGraphModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.DSPGraphModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.DSPGraphModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.DSPGraphModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.GameCenterModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.GameCenterModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.GameCenterModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.GameCenterModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.GIModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.GIModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.GIModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.GIModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.GridModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.GridModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.GridModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.GridModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.HotReloadModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.HotReloadModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.HotReloadModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.HotReloadModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.ImageConversionModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.ImageConversionModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.ImageConversionModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.ImageConversionModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.IMGUIModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.IMGUIModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.IMGUIModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.IMGUIModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.InputLegacyModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.InputLegacyModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.InputLegacyModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.InputLegacyModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.InputModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.InputModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.InputModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.InputModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.JSONSerializeModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.JSONSerializeModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.JSONSerializeModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.JSONSerializeModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.LocalizationModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.LocalizationModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.LocalizationModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.LocalizationModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.ParticleSystemModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.ParticleSystemModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.ParticleSystemModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.ParticleSystemModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.PerformanceReportingModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.PerformanceReportingModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.PerformanceReportingModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.PerformanceReportingModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.Physics2DModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.Physics2DModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.Physics2DModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.Physics2DModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.PhysicsModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.PhysicsModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.PhysicsModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.PhysicsModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.ProfilerModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.ProfilerModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.ProfilerModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.ProfilerModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.ScreenCaptureModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.ScreenCaptureModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.ScreenCaptureModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.ScreenCaptureModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.SharedInternalsModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.SharedInternalsModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.SharedInternalsModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.SharedInternalsModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.SpriteMaskModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.SpriteMaskModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.SpriteMaskModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.SpriteMaskModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.SpriteShapeModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.SpriteShapeModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.SpriteShapeModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.SpriteShapeModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.StreamingModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.StreamingModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.StreamingModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.StreamingModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.SubstanceModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.SubstanceModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.SubstanceModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.SubstanceModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.SubsystemsModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.SubsystemsModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.SubsystemsModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.SubsystemsModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.TerrainModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.TerrainModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.TerrainModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.TerrainModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.TerrainPhysicsModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.TerrainPhysicsModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.TerrainPhysicsModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.TerrainPhysicsModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.TextCoreModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.TextCoreModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.TextCoreModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.TextCoreModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.TextRenderingModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.TextRenderingModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.TextRenderingModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.TextRenderingModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.TilemapModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.TilemapModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.TilemapModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.TilemapModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.TLSModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.TLSModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.TLSModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.TLSModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UI.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UI.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.UI.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.UI.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UIElementsModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UIElementsModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.UIElementsModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.UIElementsModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UIElementsNativeModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UIElementsNativeModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.UIElementsNativeModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.UIElementsNativeModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UIModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UIModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.UIModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.UIModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UmbraModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UmbraModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.UmbraModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.UmbraModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UNETModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UNETModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.UNETModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.UNETModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityAnalyticsModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityAnalyticsModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.UnityAnalyticsModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.UnityAnalyticsModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityConnectModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityConnectModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.UnityConnectModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.UnityConnectModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityCurlModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityCurlModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.UnityCurlModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.UnityCurlModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityTestProtocolModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityTestProtocolModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.UnityTestProtocolModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.UnityTestProtocolModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.VehiclesModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.VehiclesModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.VehiclesModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.VehiclesModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.VFXModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.VFXModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.VFXModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.VFXModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.VideoModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.VideoModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.VideoModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.VideoModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.VirtualTexturingModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.VirtualTexturingModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.VirtualTexturingModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.VirtualTexturingModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.VRModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.VRModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.VRModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.VRModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.WindModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.WindModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.WindModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.WindModule.dll - ..\ref\TechbloxPreview_Data\Managed\UnityEngine.XRModule.dll - ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.XRModule.dll + ..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.XRModule.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\UnityEngine.XRModule.dll - ..\ref\TechbloxPreview_Data\Managed\VisualProfiler.dll - ..\..\ref\TechbloxPreview_Data\Managed\VisualProfiler.dll + ..\ref_preview\TechbloxPreview_Data\Managed\VisualProfiler.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\VisualProfiler.dll + + + ..\ref_preview\TechbloxPreview_Data\Managed\websocket-sharp.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\websocket-sharp.dll - ..\ref\TechbloxPreview_Data\Managed\Whinarn.UnityMeshSimplifier.Runtime.dll - ..\..\ref\TechbloxPreview_Data\Managed\Whinarn.UnityMeshSimplifier.Runtime.dll + ..\ref_preview\TechbloxPreview_Data\Managed\Whinarn.UnityMeshSimplifier.Runtime.dll + ..\..\ref_preview\TechbloxPreview_Data\Managed\Whinarn.UnityMeshSimplifier.Runtime.dll - + \ No newline at end of file diff --git a/TechbloxModdingAPI/Tests/TestRoot.cs b/TechbloxModdingAPI/Tests/TestRoot.cs index 7177818..bd5dc01 100644 --- a/TechbloxModdingAPI/Tests/TestRoot.cs +++ b/TechbloxModdingAPI/Tests/TestRoot.cs @@ -64,7 +64,7 @@ namespace TechbloxModdingAPI.Tests _testsCountPassed = 0; _testsCountFailed = 0; // flow control - Game.Enter += (sender, args) => { GameTests().RunOn(RobocraftX.Schedulers.Lean.EveryFrameStepRunner_TimeRunningAndStopped); }; + Game.Enter += (sender, args) => { GameTests().RunOn(RobocraftX.Schedulers.ClientLean.EveryFrameStepRunner_TimeRunningAndStopped); }; Game.Exit += (s, a) => state = "ReturningFromGame"; Client.EnterMenu += (sender, args) => { diff --git a/TechbloxModdingAPI/Utility/FullGameFields.cs b/TechbloxModdingAPI/Utility/FullGameFields.cs index 0a4dd1d..7ab1978 100644 --- a/TechbloxModdingAPI/Utility/FullGameFields.cs +++ b/TechbloxModdingAPI/Utility/FullGameFields.cs @@ -104,14 +104,6 @@ namespace TechbloxModdingAPI.Utility } } - public static PhysicsUtility _physicsUtility - { - get - { - return (PhysicsUtility)fgcr?.Field("_physicsUtility").GetValue(); - } - } - /*public static UnityEntitySubmissionScheduler _frontEndSubmissionScheduler { get -- 2.30.2 From f817becc6e6660f178dedecabf78a442b3b97c4b Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Thu, 16 Dec 2021 21:13:45 +0100 Subject: [PATCH 223/252] Resolve all compile-time and patching errors, remove anticheat in singleplayer --- TechbloxModdingAPI/App/GameMenuEngine.cs | 2 +- TechbloxModdingAPI/Blocks/Engine.cs | 5 +- .../Blocks/Engines/BlueprintEngine.cs | 6 ++- .../Blocks/Engines/MovementEngine.cs | 5 +- .../Blocks/Engines/RotationEngine.cs | 6 +-- .../Blocks/Engines/ScalingEngine.cs | 14 +++--- TechbloxModdingAPI/Commands/CommandPatch.cs | 34 -------------- TechbloxModdingAPI/Engines/EnginePatches.cs | 24 +++++++++- TechbloxModdingAPI/Main.cs | 46 +++++++++++++++++-- TechbloxModdingAPI/Player.cs | 9 +--- TechbloxModdingAPI/Players/PlayerEngine.cs | 8 ++++ .../Tests/TechbloxModdingAPIPluginTest.cs | 9 ---- TechbloxModdingAPI/Utility/FullGameFields.cs | 16 ++----- 13 files changed, 99 insertions(+), 85 deletions(-) delete mode 100644 TechbloxModdingAPI/Commands/CommandPatch.cs diff --git a/TechbloxModdingAPI/App/GameMenuEngine.cs b/TechbloxModdingAPI/App/GameMenuEngine.cs index f356a0d..276bda8 100644 --- a/TechbloxModdingAPI/App/GameMenuEngine.cs +++ b/TechbloxModdingAPI/App/GameMenuEngine.cs @@ -175,7 +175,7 @@ namespace TechbloxModdingAPI.App public static MethodBase TargetMethod() { - return AccessTools.Method(typeof(FullGameCompositionRoot), "GoToMenu"); + return AccessTools.Method(typeof(FullGameCompositionRoot), "SwitchToMenu"); } } diff --git a/TechbloxModdingAPI/Blocks/Engine.cs b/TechbloxModdingAPI/Blocks/Engine.cs index 6140b11..9684108 100644 --- a/TechbloxModdingAPI/Blocks/Engine.cs +++ b/TechbloxModdingAPI/Blocks/Engine.cs @@ -22,7 +22,7 @@ namespace TechbloxModdingAPI.Blocks base(new EGID(id, CommonExclusiveGroups.ENGINE_BLOCK_BUILD_GROUP)) { } - + /* /// /// Gets or sets the Engine's On property. May not be saved. /// @@ -34,6 +34,7 @@ namespace TechbloxModdingAPI.Blocks } set { + Techblox.BlockColours.BlockColoursCompositionRoot BlockEngine.GetBlockInfo(this).engineOn = value; } } @@ -377,6 +378,6 @@ namespace TechbloxModdingAPI.Blocks { BlockEngine.GetBlockInfo(this).manualToAutoGearCoolOffTime = value; } - } + }*/ } } diff --git a/TechbloxModdingAPI/Blocks/Engines/BlueprintEngine.cs b/TechbloxModdingAPI/Blocks/Engines/BlueprintEngine.cs index 2ba15ce..789076e 100644 --- a/TechbloxModdingAPI/Blocks/Engines/BlueprintEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/BlueprintEngine.cs @@ -173,7 +173,8 @@ namespace TechbloxModdingAPI.Blocks.Engines foreach (var block in blocks) { GhostChildUtility.BuildGhostChild(in playerID, block.Id, in pos, in rot, entitiesDB, - BuildGhostBlueprintFactory, false, bssesopt.Get().buildingDroneReference); + BuildGhostBlueprintFactory, false, bssesopt.Get().buildingDroneReference, + FullGameFields._managers.blockLabelResourceManager); } } @@ -272,7 +273,8 @@ namespace TechbloxModdingAPI.Blocks.Engines uint ghostChildBlockId = CommonExclusiveGroups.GetNewGhostChildBlockID(); var ghostEntityReference = GhostBlockUtils.GetGhostEntityReference(sourceId.entityID, entitiesDB); var entityInitializer = BuildGhostBlueprintFactory.Build( - new EGID(ghostChildBlockId, BoxSelectExclusiveGroups.GhostChildEntitiesExclusiveGroup), /*dbStruct.DBID*/ (uint)BlockIDs.Cube); + new EGID(ghostChildBlockId, BoxSelectExclusiveGroups.GhostChildEntitiesExclusiveGroup), /*dbStruct.DBID*/ (uint)BlockIDs.Cube, + FullGameFields._managers.blockLabelResourceManager); entityInitializer.Init(dbStruct); entityInitializer.Init(new GFXPrefabEntityStructGPUI( PrefabsID.GetOrCreatePrefabID((ushort)entityInitializer.Get().prefabAssetID, diff --git a/TechbloxModdingAPI/Blocks/Engines/MovementEngine.cs b/TechbloxModdingAPI/Blocks/Engines/MovementEngine.cs index 07bfbe6..f9d65d8 100644 --- a/TechbloxModdingAPI/Blocks/Engines/MovementEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/MovementEngine.cs @@ -1,4 +1,5 @@ using RobocraftX.Common; +using RobocraftX.DOTS; using Svelto.ECS; using Svelto.ECS.EntityStructs; using Unity.Mathematics; @@ -39,7 +40,7 @@ namespace TechbloxModdingAPI.Blocks.Engines ref PositionEntityStruct posStruct = ref this.entitiesDB.QueryEntityOrDefault(block); ref GridRotationStruct gridStruct = ref this.entitiesDB.QueryEntityOrDefault(block); ref LocalTransformEntityStruct transStruct = ref this.entitiesDB.QueryEntityOrDefault(block); - ref UECSPhysicsEntityStruct phyStruct = ref this.entitiesDB.QueryEntityOrDefault(block); + ref DOTSPhysicsEntityStruct phyStruct = ref this.entitiesDB.QueryEntityOrDefault(block); // main (persistent) position posStruct.position = vector; // placement grid position @@ -49,7 +50,7 @@ namespace TechbloxModdingAPI.Blocks.Engines // collision position if (phyStruct.ID != default) { //It exists - FullGameFields._physicsWorld.EntityManager.SetComponentData(phyStruct.uecsEntity, new Translation + FullGameFields._physicsWorld.EntityManager.SetComponentData(phyStruct.dotsEntity, new Translation { Value = posStruct.position }); diff --git a/TechbloxModdingAPI/Blocks/Engines/RotationEngine.cs b/TechbloxModdingAPI/Blocks/Engines/RotationEngine.cs index b2be508..4186bfd 100644 --- a/TechbloxModdingAPI/Blocks/Engines/RotationEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/RotationEngine.cs @@ -1,5 +1,5 @@ using RobocraftX.Common; -using RobocraftX.UECS; +using RobocraftX.DOTS; using Svelto.ECS; using Svelto.ECS.EntityStructs; using Unity.Mathematics; @@ -40,7 +40,7 @@ namespace TechbloxModdingAPI.Blocks.Engines ref RotationEntityStruct rotStruct = ref this.entitiesDB.QueryEntityOrDefault(block); ref GridRotationStruct gridStruct = ref this.entitiesDB.QueryEntityOrDefault(block); ref LocalTransformEntityStruct transStruct = ref this.entitiesDB.QueryEntityOrDefault(block); - ref UECSPhysicsEntityStruct phyStruct = ref this.entitiesDB.QueryEntityOrDefault(block); + ref DOTSPhysicsEntityStruct phyStruct = ref this.entitiesDB.QueryEntityOrDefault(block); // main (persistent) rotation Quaternion newRotation = rotStruct.rotation; newRotation.eulerAngles = vector; @@ -52,7 +52,7 @@ namespace TechbloxModdingAPI.Blocks.Engines // collision rotation if (phyStruct.ID != default) { //It exists - FullGameFields._physicsWorld.EntityManager.SetComponentData(phyStruct.uecsEntity, + FullGameFields._physicsWorld.EntityManager.SetComponentData(phyStruct.dotsEntity, new Unity.Transforms.Rotation { Value = rotStruct.rotation diff --git a/TechbloxModdingAPI/Blocks/Engines/ScalingEngine.cs b/TechbloxModdingAPI/Blocks/Engines/ScalingEngine.cs index 9ca77f0..ef5cfe4 100644 --- a/TechbloxModdingAPI/Blocks/Engines/ScalingEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/ScalingEngine.cs @@ -2,7 +2,7 @@ using HarmonyLib; using RobocraftX.Common; -using RobocraftX.UECS; +using RobocraftX.DOTS; using Svelto.ECS; using Unity.Entities; @@ -13,7 +13,7 @@ namespace TechbloxModdingAPI.Blocks.Engines { public class ScalingEngine : IApiEngine { - private static IReactOnAddAndRemove physicsEngine; + private static IReactOnAddAndRemove physicsEngine; public void Ready() { @@ -34,16 +34,16 @@ namespace TechbloxModdingAPI.Blocks.Engines if (_entityManager == default) _entityManager = FullGameFields._physicsWorld.EntityManager; //Assuming the block exists - var entity = entitiesDB.QueryEntity(egid).uecsEntity; - var pes = new UECSPhysicsEntityCreationStruct(); - physicsEngine.Add(ref pes, egid); //Create new UECS entity + var entity = entitiesDB.QueryEntity(egid).dotsEntity; + var pes = new DOTSPhysicsEntityCreationStruct(); + physicsEngine.Add(ref pes, egid); //Create new DOTS entity _entityManager.DestroyEntity(entity); } [HarmonyPatch] class PhysicsEnginePatch { - static void Postfix(IReactOnAddAndRemove __instance) + static void Postfix(IReactOnAddAndRemove __instance) { physicsEngine = __instance; Logging.MetaDebugLog("Physics engine injected."); @@ -51,7 +51,7 @@ namespace TechbloxModdingAPI.Blocks.Engines static MethodBase TargetMethod(Harmony instance) { - return AccessTools.Method("RobocraftX.StateSync.HandleUECSPhysicEntitiesWithPrefabCreationEngine" + + return AccessTools.Method("RobocraftX.StateSync.HandleDOTSPhysicEntitiesWithPrefabCreationEngine" + ":Ready"); } } diff --git a/TechbloxModdingAPI/Commands/CommandPatch.cs b/TechbloxModdingAPI/Commands/CommandPatch.cs deleted file mode 100644 index b928c1d..0000000 --- a/TechbloxModdingAPI/Commands/CommandPatch.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using System.Reflection; - -using HarmonyLib; -using Svelto.ECS; -using RobocraftX.CR.MainGame; -using RobocraftX.Multiplayer; -using RobocraftX.StateSync; -using TechbloxModdingAPI.Utility; - -namespace TechbloxModdingAPI.Commands -{ - /// - /// Patch of RobocraftX.CR.MainGame.MainGameCompositionRoot.DeterministicCompose() - /// Initializes custom commands - /// - [HarmonyPatch] - static class CommandPatch - { - public static void Postfix(StateSyncRegistrationHelper stateSyncReg) - { - /*CommandLineCompositionRoot.Compose(contextHolder, stateSyncReg.enginesRoot, reloadGame, multiplayerParameters, - stateSyncReg); - uREPL C# compilation not supported anymore */ - var enginesRoot = stateSyncReg.enginesRoot; - CommandManager.RegisterEngines(enginesRoot); - } - - public static MethodInfo TargetMethod() - { - return AccessTools.Method(typeof(MainGameCompositionRoot), "DeterministicCompose") - .MakeGenericMethod(typeof(object)); - } - } -} \ No newline at end of file diff --git a/TechbloxModdingAPI/Engines/EnginePatches.cs b/TechbloxModdingAPI/Engines/EnginePatches.cs index 8b6e6a5..7c9524b 100644 --- a/TechbloxModdingAPI/Engines/EnginePatches.cs +++ b/TechbloxModdingAPI/Engines/EnginePatches.cs @@ -6,12 +6,13 @@ using RobocraftX.FrontEnd; using RobocraftX.StateSync; using Svelto.ECS; using Svelto.ECS.Schedulers; +using TechbloxModdingAPI.Commands; using TechbloxModdingAPI.Utility; namespace TechbloxModdingAPI.Engines { [HarmonyPatch] - class GameLoadedEnginePatch + static class GameLoadedTimeStoppedEnginePatch { public static EntitiesSubmissionScheduler Scheduler { get; private set; } public static void Postfix(StateSyncRegistrationHelper stateSyncReg) @@ -19,11 +20,30 @@ namespace TechbloxModdingAPI.Engines // register all game engines, including deterministic GameEngineManager.RegisterEngines(stateSyncReg); Scheduler = stateSyncReg.enginesRoot.scheduler; + // register command engines + /*CommandLineCompositionRoot.Compose(contextHolder, stateSyncReg.enginesRoot, reloadGame, multiplayerParameters, + stateSyncReg); - uREPL C# compilation not supported anymore */ + CommandManager.RegisterEngines(stateSyncReg.enginesRoot); } public static MethodBase TargetMethod() { - return AccessTools.Method(typeof(MainGameCompositionRoot), "DeterministicCompose").MakeGenericMethod(typeof(object)); + return AccessTools.Method(typeof(MainGameCompositionRoot), "DeterministicTimeStoppedCompose").MakeGenericMethod(typeof(object)); + } + } + + [HarmonyPatch] + static class GameLoadedTimeRunningEnginePatch + { + public static EntitiesSubmissionScheduler Scheduler { get; private set; } + public static void Postfix(StateSyncRegistrationHelper stateSyncReg) + { + GameLoadedTimeStoppedEnginePatch.Postfix(stateSyncReg); + } + + public static MethodBase TargetMethod() + { + return AccessTools.Method(typeof(MainGameCompositionRoot), "DeterministicTimeRunningCompose").MakeGenericMethod(typeof(object)); } } diff --git a/TechbloxModdingAPI/Main.cs b/TechbloxModdingAPI/Main.cs index 610aa8e..0961576 100644 --- a/TechbloxModdingAPI/Main.cs +++ b/TechbloxModdingAPI/Main.cs @@ -1,15 +1,15 @@ using System; +using System.Collections.Generic; using System.Reflection; using HarmonyLib; using RobocraftX; -using RobocraftX.Schedulers; using RobocraftX.Services; using Svelto.Context; -using Svelto.Tasks.ExtraLean; +using Svelto.Tasks; + using TechbloxModdingAPI.App; using TechbloxModdingAPI.Blocks; -using TechbloxModdingAPI.Events; using TechbloxModdingAPI.Tasks; using TechbloxModdingAPI.Utility; @@ -78,9 +78,20 @@ namespace TechbloxModdingAPI // init UI Interface.IMGUI.Constants.Init(); Interface.IMGUI.IMGUIManager.Init(); + Logging.MetaDebugLog("Initializing anti-anticheat"); + var type = AccessTools.TypeByName("Techblox.Services.Eos.Anticheat.Client.Services.AnticheatClientService"); + harmony.Patch(type.GetConstructors()[0], new HarmonyMethod(((Func) AntiAntiCheat).Method)); + harmony.Patch(AccessTools.Method(type, "Shutdown"), new HarmonyMethod(((Func) AntiAntiCheat).Method)); + harmony.Patch(AccessTools.Method(type, "StartProtectedSession"), new HarmonyMethod(((AntiAnticheatDelegate) AntiAntiCheat).Method)); + harmony.Patch(AccessTools.Method(type, "StopProtectedSession"), new HarmonyMethod(((AntiAnticheatDelegateBool) AntiAntiCheat).Method)); + harmony.Patch(AccessTools.Method("Techblox.Services.Eos.Anticheat.Client.EosGetPendingMessagesToSendServiceRequest:Execute"), new HarmonyMethod(((AntiAnticheatDelegateTask)AntiAntiCheatTask).Method)); Logging.MetaLog($"{currentAssembly.GetName().Name} v{currentAssembly.GetName().Version} initialized"); } + public delegate bool AntiAnticheatDelegate(ref object __result); + public delegate bool AntiAnticheatDelegateBool(ref bool __result); + public delegate bool AntiAnticheatDelegateTask(ref IEnumerator __result); + /// /// Shuts down & cleans up the TechbloxModdingAPI. /// Call this as late as possible before Techblox quits. @@ -109,5 +120,34 @@ namespace TechbloxModdingAPI ErrorBuilder.DisplayMustQuitError("Failed to patch Techblox!\n" + "Make sure you're using the latest version of TechbloxModdingAPI or disable mods if the API isn't released yet."); } + + private static bool AntiAntiCheat() => false; + + private static bool AntiAntiCheat(ref object __result) + { + var targetType = + AccessTools.TypeByName("Techblox.Services.Eos.Anticheat.Client.Services.StartProtectedSessionResult"); + var target = Activator.CreateInstance(targetType); + targetType.GetField("Success").SetValue(target, true); + __result = target; + return false; + } + + private static bool AntiAntiCheat(ref bool __result) + { + __result = true; + return false; + } + + private static bool AntiAntiCheatTask(ref IEnumerator __result) + { + IEnumerator Func() + { + yield return Yield.It; + } + + __result = Func(); + return false; + } } } diff --git a/TechbloxModdingAPI/Player.cs b/TechbloxModdingAPI/Player.cs index f4386db..125f2e0 100644 --- a/TechbloxModdingAPI/Player.cs +++ b/TechbloxModdingAPI/Player.cs @@ -187,8 +187,6 @@ namespace TechbloxModdingAPI public float Mass => 1f / playerEngine.GetCharacterStruct(Id).Get().physicsMass.InverseMass; - private float _ping = -1f; - /// /// The player's latest network ping time. /// @@ -197,12 +195,7 @@ namespace TechbloxModdingAPI { get { - var opt = playerEngine.GetPlayerStruct(Id, Type); - if (opt) - { - _ping = opt.Get().lastPingTimeSinceLevelLoad ?? _ping; - } - return _ping; + return playerEngine.GetPing() / 1000f; } } diff --git a/TechbloxModdingAPI/Players/PlayerEngine.cs b/TechbloxModdingAPI/Players/PlayerEngine.cs index 0dc2298..2722258 100644 --- a/TechbloxModdingAPI/Players/PlayerEngine.cs +++ b/TechbloxModdingAPI/Players/PlayerEngine.cs @@ -10,6 +10,7 @@ using RobocraftX.Physics; using RobocraftX.Blocks.Ghost; using Gamecraft.GUI.HUDFeedbackBlocks; using RobocraftX.Blocks; +using RobocraftX.Multiplayer; using RobocraftX.PilotSeat; using Svelto.ECS; using Techblox.Camera; @@ -227,5 +228,12 @@ namespace TechbloxModdingAPI.Players opt.Get().instantExit = true; entitiesDB.PublishEntityChange(egid); } + + public uint GetPing() + { + return entitiesDB + .QueryUniqueEntity(MultiplayerExclusiveGroups.MultiplayerStateGroup) + .networkStats.PingMs; + } } } diff --git a/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs b/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs index 75d0cc4..1cdfe9e 100644 --- a/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs +++ b/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs @@ -360,15 +360,6 @@ namespace TechbloxModdingAPI.Tests return modsString = sb.ToString(); } - public override void OnUpdate() - { - if (UnityEngine.Input.GetKeyDown(KeyCode.End)) - { - Console.WriteLine("Pressed button to toggle console"); - FakeInput.CustomInput(new LocalCosmeticInputEntityComponent {commandLineToggleInput = true}); - } - } - [HarmonyPatch] public class MinimumSpecsPatch { diff --git a/TechbloxModdingAPI/Utility/FullGameFields.cs b/TechbloxModdingAPI/Utility/FullGameFields.cs index 7ab1978..0aec467 100644 --- a/TechbloxModdingAPI/Utility/FullGameFields.cs +++ b/TechbloxModdingAPI/Utility/FullGameFields.cs @@ -1,20 +1,12 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -using DataLoader; +using DataLoader; using HarmonyLib; using RobocraftX; -using RobocraftX.Common.Utilities; +using RobocraftX.CR.MainGame; using RobocraftX.GUI; using RobocraftX.Multiplayer; -using RobocraftX.Rendering; using Svelto.Context; using Svelto.DataStructures; using Svelto.ECS; -using Svelto.ECS.Schedulers; using UnityEngine; using Unity.Entities; using Unity.Physics.Systems; @@ -128,11 +120,11 @@ namespace TechbloxModdingAPI.Utility } } - public static ECSGameObjectResourceManager _eCsGameObjectResourceManager + public static ECSResourceManagers _managers { get { - return (ECSGameObjectResourceManager)fgcr?.Field("_eCsGameObjectResourceManager").GetValue(); + return (ECSResourceManagers)fgcr?.Field("_managers").GetValue(); } } -- 2.30.2 From 4ac8d53a2d0dab5472060aa89353853d6783172e Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sun, 26 Dec 2021 23:37:02 +0100 Subject: [PATCH 224/252] Organize anti-anticheat, add block IDs, fix crash when adding event handlers multiple times --- TechbloxModdingAPI/App/AntiAntiCheatPatch.cs | 55 +++++++++++++++++++ TechbloxModdingAPI/Blocks/BlockIDs.cs | 8 ++- TechbloxModdingAPI/Main.cs | 45 ++------------- .../Players/PlayerEventsEngine.cs | 4 +- .../Tests/TechbloxModdingAPIPluginTest.cs | 2 - TechbloxModdingAPI/Utility/WrappedHandler.cs | 6 ++ 6 files changed, 75 insertions(+), 45 deletions(-) create mode 100644 TechbloxModdingAPI/App/AntiAntiCheatPatch.cs diff --git a/TechbloxModdingAPI/App/AntiAntiCheatPatch.cs b/TechbloxModdingAPI/App/AntiAntiCheatPatch.cs new file mode 100644 index 0000000..f07921d --- /dev/null +++ b/TechbloxModdingAPI/App/AntiAntiCheatPatch.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using HarmonyLib; +using Svelto.Tasks; + +namespace TechbloxModdingAPI.App +{ + public static class AntiAntiCheatPatch + { + private delegate bool AntiAnticheatDelegate(ref object __result); + + private delegate bool AntiAnticheatDelegateBool(ref bool __result); + + private delegate bool AntiAnticheatDelegateTask(ref IEnumerator __result); + + public static void Init(Harmony harmony) + { + var type = AccessTools.TypeByName("Techblox.Services.Eos.Anticheat.Client.Services.AnticheatClientService"); + harmony.Patch(type.GetConstructors()[0], new HarmonyMethod(((Func) AntiAntiCheat).Method)); + harmony.Patch(AccessTools.Method(type, "Shutdown"), new HarmonyMethod(((Func) AntiAntiCheat).Method)); + harmony.Patch(AccessTools.Method(type, "StartProtectedSession"), new HarmonyMethod(((AntiAnticheatDelegate) AntiAntiCheat).Method)); + harmony.Patch(AccessTools.Method(type, "StopProtectedSession"), new HarmonyMethod(((AntiAnticheatDelegateBool) AntiAntiCheat).Method)); + harmony.Patch(AccessTools.Method("Techblox.Services.Eos.Anticheat.Client.EosGetPendingMessagesToSendServiceRequest:Execute"), new HarmonyMethod(((AntiAnticheatDelegateTask)AntiAntiCheatTask).Method)); + } + + private static bool AntiAntiCheat() => false; + + private static bool AntiAntiCheat(ref object __result) + { + var targetType = + AccessTools.TypeByName("Techblox.Services.Eos.Anticheat.Client.Services.StartProtectedSessionResult"); + var target = Activator.CreateInstance(targetType); + targetType.GetField("Success").SetValue(target, true); + __result = target; + return false; + } + + private static bool AntiAntiCheat(ref bool __result) + { + __result = true; + return false; + } + + private static bool AntiAntiCheatTask(ref IEnumerator __result) + { + IEnumerator Func() + { + yield return Yield.It; + } + + __result = Func(); + return false; + } + } +} \ No newline at end of file diff --git a/TechbloxModdingAPI/Blocks/BlockIDs.cs b/TechbloxModdingAPI/Blocks/BlockIDs.cs index e454c40..2e3618f 100644 --- a/TechbloxModdingAPI/Blocks/BlockIDs.cs +++ b/TechbloxModdingAPI/Blocks/BlockIDs.cs @@ -273,6 +273,12 @@ namespace TechbloxModdingAPI.Blocks /// /// The grid block used by the world editor, named Small Grid like the other one /// - SmallGridInWorldEditor + SmallGridInWorldEditor, + SegoeUITextblock = 376, + GravtracTextblock, + HauserTextblock, + TechnopollasTextblock, + BitBlock = 385, + Timer } } \ No newline at end of file diff --git a/TechbloxModdingAPI/Main.cs b/TechbloxModdingAPI/Main.cs index 0961576..f11059b 100644 --- a/TechbloxModdingAPI/Main.cs +++ b/TechbloxModdingAPI/Main.cs @@ -1,12 +1,10 @@ using System; -using System.Collections.Generic; using System.Reflection; using HarmonyLib; using RobocraftX; using RobocraftX.Services; using Svelto.Context; -using Svelto.Tasks; using TechbloxModdingAPI.App; using TechbloxModdingAPI.Blocks; @@ -72,26 +70,20 @@ namespace TechbloxModdingAPI Block.Init(); BlockGroup.Init(); Wire.Init(); + // init client Logging.MetaDebugLog($"Initializing Client"); Client.Init(); Game.Init(); // init UI + Logging.MetaDebugLog($"Initializing UI"); Interface.IMGUI.Constants.Init(); Interface.IMGUI.IMGUIManager.Init(); + // init anti-anticheat Logging.MetaDebugLog("Initializing anti-anticheat"); - var type = AccessTools.TypeByName("Techblox.Services.Eos.Anticheat.Client.Services.AnticheatClientService"); - harmony.Patch(type.GetConstructors()[0], new HarmonyMethod(((Func) AntiAntiCheat).Method)); - harmony.Patch(AccessTools.Method(type, "Shutdown"), new HarmonyMethod(((Func) AntiAntiCheat).Method)); - harmony.Patch(AccessTools.Method(type, "StartProtectedSession"), new HarmonyMethod(((AntiAnticheatDelegate) AntiAntiCheat).Method)); - harmony.Patch(AccessTools.Method(type, "StopProtectedSession"), new HarmonyMethod(((AntiAnticheatDelegateBool) AntiAntiCheat).Method)); - harmony.Patch(AccessTools.Method("Techblox.Services.Eos.Anticheat.Client.EosGetPendingMessagesToSendServiceRequest:Execute"), new HarmonyMethod(((AntiAnticheatDelegateTask)AntiAntiCheatTask).Method)); + AntiAntiCheatPatch.Init(harmony); Logging.MetaLog($"{currentAssembly.GetName().Name} v{currentAssembly.GetName().Version} initialized"); } - public delegate bool AntiAnticheatDelegate(ref object __result); - public delegate bool AntiAnticheatDelegateBool(ref bool __result); - public delegate bool AntiAnticheatDelegateTask(ref IEnumerator __result); - /// /// Shuts down & cleans up the TechbloxModdingAPI. /// Call this as late as possible before Techblox quits. @@ -120,34 +112,5 @@ namespace TechbloxModdingAPI ErrorBuilder.DisplayMustQuitError("Failed to patch Techblox!\n" + "Make sure you're using the latest version of TechbloxModdingAPI or disable mods if the API isn't released yet."); } - - private static bool AntiAntiCheat() => false; - - private static bool AntiAntiCheat(ref object __result) - { - var targetType = - AccessTools.TypeByName("Techblox.Services.Eos.Anticheat.Client.Services.StartProtectedSessionResult"); - var target = Activator.CreateInstance(targetType); - targetType.GetField("Success").SetValue(target, true); - __result = target; - return false; - } - - private static bool AntiAntiCheat(ref bool __result) - { - __result = true; - return false; - } - - private static bool AntiAntiCheatTask(ref IEnumerator __result) - { - IEnumerator Func() - { - yield return Yield.It; - } - - __result = Func(); - return false; - } } } diff --git a/TechbloxModdingAPI/Players/PlayerEventsEngine.cs b/TechbloxModdingAPI/Players/PlayerEventsEngine.cs index 2c80f24..af7d095 100644 --- a/TechbloxModdingAPI/Players/PlayerEventsEngine.cs +++ b/TechbloxModdingAPI/Players/PlayerEventsEngine.cs @@ -1,7 +1,9 @@ using RobocraftX.Character; using RobocraftX.Character.Movement; using Svelto.ECS; + using TechbloxModdingAPI.Engines; +using TechbloxModdingAPI.Utility; namespace TechbloxModdingAPI.Players { @@ -21,7 +23,7 @@ namespace TechbloxModdingAPI.Players public void MovedTo(ref CharacterPilotSeatEntityStruct entityComponent, ExclusiveGroupStruct previousGroup, EGID egid) { - var seatId = entityComponent.pilotSeatEntity.ToEGID(entitiesDB); + entitiesDB.TryGetEGID(entityComponent.pilotSeatEntity, out var seatId); //TODO: Can't get EGID var player = EcsObjectBase.GetInstance(new EGID(egid.entityID, CharacterExclusiveGroups.OnFootGroup), e => new Player(e.entityID)); if (previousGroup == CharacterExclusiveGroups.InPilotSeatGroup) diff --git a/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs b/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs index 1cdfe9e..f528f83 100644 --- a/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs +++ b/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs @@ -10,12 +10,10 @@ using IllusionInjector; using RobocraftX.FrontEnd; using Unity.Mathematics; using UnityEngine; -using RobocraftX.Common.Input; using Svelto.Tasks; using Svelto.Tasks.Lean; using TechbloxModdingAPI.Blocks; using TechbloxModdingAPI.Commands; -using TechbloxModdingAPI.Input; using TechbloxModdingAPI.Players; using TechbloxModdingAPI.Tasks; using TechbloxModdingAPI.Utility; diff --git a/TechbloxModdingAPI/Utility/WrappedHandler.cs b/TechbloxModdingAPI/Utility/WrappedHandler.cs index 57ff3ba..41e2fc7 100644 --- a/TechbloxModdingAPI/Utility/WrappedHandler.cs +++ b/TechbloxModdingAPI/Utility/WrappedHandler.cs @@ -34,6 +34,12 @@ namespace TechbloxModdingAPI.Utility Logging.LogWarning(wrappedException.ToString()); } }; + if (wrappers.ContainsKey(added)) + { + original.eventHandler -= wrapped; + wrappers.Remove(added); + } + wrappers.Add(added, wrapped); return new WrappedHandler { eventHandler = original.eventHandler + wrapped }; } -- 2.30.2 From 93a0b2287a81afd4d8a7e18b4ee5e4d2796aa49d Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Mon, 27 Dec 2021 02:28:09 +0100 Subject: [PATCH 225/252] Added player join/leave events and fix errors - Fixed anticheat status error spam - Fixed IMGUI not actually running on OnGUI because that runner was changed in Svelto - Added player join and leave events - Made Game.Enter only trigger when both the game has finished loading *and* the local player has joined --- TechbloxModdingAPI/App/AntiAntiCheatPatch.cs | 1 + TechbloxModdingAPI/App/GameGameEngine.cs | 31 +++++++++++++++++-- .../Interface/IMGUI/IMGUIManager.cs | 8 +---- TechbloxModdingAPI/Player.Events.cs | 22 +++++++++++++ TechbloxModdingAPI/Player.cs | 10 ++++-- .../Players/PlayerEventsEngine.cs | 17 +++++++--- TechbloxModdingAPI/Tasks/OnGuiRunner.cs | 16 ++++++++++ 7 files changed, 90 insertions(+), 15 deletions(-) create mode 100644 TechbloxModdingAPI/Tasks/OnGuiRunner.cs diff --git a/TechbloxModdingAPI/App/AntiAntiCheatPatch.cs b/TechbloxModdingAPI/App/AntiAntiCheatPatch.cs index f07921d..ed249bf 100644 --- a/TechbloxModdingAPI/App/AntiAntiCheatPatch.cs +++ b/TechbloxModdingAPI/App/AntiAntiCheatPatch.cs @@ -21,6 +21,7 @@ namespace TechbloxModdingAPI.App harmony.Patch(AccessTools.Method(type, "StartProtectedSession"), new HarmonyMethod(((AntiAnticheatDelegate) AntiAntiCheat).Method)); harmony.Patch(AccessTools.Method(type, "StopProtectedSession"), new HarmonyMethod(((AntiAnticheatDelegateBool) AntiAntiCheat).Method)); harmony.Patch(AccessTools.Method("Techblox.Services.Eos.Anticheat.Client.EosGetPendingMessagesToSendServiceRequest:Execute"), new HarmonyMethod(((AntiAnticheatDelegateTask)AntiAntiCheatTask).Method)); + harmony.Patch(AccessTools.Method("Techblox.Anticheat.Client.Engines.ShowFeedbackDialogEngine:PollAnticheatStatus"), new HarmonyMethod(((AntiAnticheatDelegateTask)AntiAntiCheatTask).Method)); } private static bool AntiAntiCheat() => false; diff --git a/TechbloxModdingAPI/App/GameGameEngine.cs b/TechbloxModdingAPI/App/GameGameEngine.cs index 147606e..46167a4 100644 --- a/TechbloxModdingAPI/App/GameGameEngine.cs +++ b/TechbloxModdingAPI/App/GameGameEngine.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using RobocraftX.Common; using RobocraftX.Schedulers; @@ -13,6 +14,7 @@ using Techblox.Environment.Transition; using Techblox.GameSelection; using TechbloxModdingAPI.Blocks; using TechbloxModdingAPI.Engines; +using TechbloxModdingAPI.Players; using TechbloxModdingAPI.Utility; namespace TechbloxModdingAPI.App @@ -30,16 +32,32 @@ namespace TechbloxModdingAPI.App public EntitiesDB entitiesDB { set; private get; } private bool enteredGame; + private bool loadingFinished; + private bool playerJoined; public void Dispose() { ExitGame.Invoke(this, new GameEventArgs { GameName = GetGameData().saveName, GamePath = GetGameData().gameID }); IsInGame = false; + loadingFinished = false; + playerJoined = false; + enteredGame = false; } public void Ready() { enteredGame = true; + Player.Joined += OnPlayerJoined; + } + + private void OnPlayerJoined(object sender, PlayerEventArgs args) + { + Console.WriteLine("Player joined: " + args.PlayerId + " asd"); + if (args.Player.Type != PlayerType.Local) return; + Console.WriteLine("Player joined is local asd"); + playerJoined = true; + Player.Joined -= OnPlayerJoined; + CheckJoinEvent(); } // game functionality @@ -142,9 +160,18 @@ namespace TechbloxModdingAPI.App public void Remove(ref LoadingActionEntityStruct entityComponent, EGID egid) { // Finished loading if (!enteredGame) return; + enteredGame = false; + loadingFinished = true; + Console.WriteLine("Loading finished - asd"); + CheckJoinEvent(); + } + + private void CheckJoinEvent() + { + Console.WriteLine($"Check: {loadingFinished} {playerJoined}"); + if (!loadingFinished || !playerJoined) return; EnterGame.Invoke(this, new GameEventArgs { GameName = GetGameData().saveName, GamePath = GetGameData().gameID }); IsInGame = true; - enteredGame = false; } } } diff --git a/TechbloxModdingAPI/Interface/IMGUI/IMGUIManager.cs b/TechbloxModdingAPI/Interface/IMGUI/IMGUIManager.cs index 8b3c865..c27c484 100644 --- a/TechbloxModdingAPI/Interface/IMGUI/IMGUIManager.cs +++ b/TechbloxModdingAPI/Interface/IMGUI/IMGUIManager.cs @@ -1,13 +1,7 @@ -using System; -using System.Collections; using System.Collections.Generic; -using TechbloxModdingAPI.App; -using TechbloxModdingAPI.Utility; -using Rewired.Internal; -using Svelto.DataStructures; using Svelto.Tasks; using Svelto.Tasks.ExtraLean; -using Svelto.Tasks.ExtraLean.Unity; +using TechbloxModdingAPI.Tasks; using UnityEngine; namespace TechbloxModdingAPI.Interface.IMGUI diff --git a/TechbloxModdingAPI/Player.Events.cs b/TechbloxModdingAPI/Player.Events.cs index 1a07c36..8d8cd10 100644 --- a/TechbloxModdingAPI/Player.Events.cs +++ b/TechbloxModdingAPI/Player.Events.cs @@ -20,6 +20,22 @@ namespace TechbloxModdingAPI add => seatExited += value; remove => seatExited -= value; } + + internal static WrappedHandler joined; + + public static event EventHandler Joined + { + add => joined += value; + remove => joined -= value; + } + + internal static WrappedHandler left; + + public static event EventHandler Left + { + add => left += value; + remove => left -= value; + } } public struct PlayerSeatEventArgs @@ -27,4 +43,10 @@ namespace TechbloxModdingAPI public EGID SeatId; public Seat Seat => (Seat)Block.New(SeatId); } + + public struct PlayerEventArgs + { + public EGID PlayerId; + public Player Player => Player.GetInstance(PlayerId.entityID); + } } \ No newline at end of file diff --git a/TechbloxModdingAPI/Player.cs b/TechbloxModdingAPI/Player.cs index 125f2e0..462e44b 100644 --- a/TechbloxModdingAPI/Player.cs +++ b/TechbloxModdingAPI/Player.cs @@ -23,8 +23,8 @@ namespace TechbloxModdingAPI public partial class Player : EcsObjectBase, IEquatable, IEquatable { // static functionality - private static PlayerEngine playerEngine = new PlayerEngine(); - private static PlayerEventsEngine playerEventsEngine = new PlayerEventsEngine(); + private static readonly PlayerEngine playerEngine = new PlayerEngine(); + private static readonly PlayerEventsEngine playerEventsEngine = new PlayerEventsEngine(); private static Player localPlayer; /// @@ -76,6 +76,12 @@ namespace TechbloxModdingAPI } } + internal static Player GetInstance(uint id) + { + return EcsObjectBase.GetInstance(new EGID(id, CharacterExclusiveGroups.OnFootGroup), + e => new Player(e.entityID)); + } + /// /// Initializes a new instance of the class. /// diff --git a/TechbloxModdingAPI/Players/PlayerEventsEngine.cs b/TechbloxModdingAPI/Players/PlayerEventsEngine.cs index af7d095..4461b71 100644 --- a/TechbloxModdingAPI/Players/PlayerEventsEngine.cs +++ b/TechbloxModdingAPI/Players/PlayerEventsEngine.cs @@ -1,13 +1,13 @@ using RobocraftX.Character; using RobocraftX.Character.Movement; +using RobocraftX.Common.Input; using Svelto.ECS; using TechbloxModdingAPI.Engines; -using TechbloxModdingAPI.Utility; namespace TechbloxModdingAPI.Players { - public class PlayerEventsEngine : IApiEngine, IReactOnSwap + public class PlayerEventsEngine : IApiEngine, IReactOnSwap, IReactOnAddAndRemove { public void Ready() { @@ -24,12 +24,21 @@ namespace TechbloxModdingAPI.Players public void MovedTo(ref CharacterPilotSeatEntityStruct entityComponent, ExclusiveGroupStruct previousGroup, EGID egid) { entitiesDB.TryGetEGID(entityComponent.pilotSeatEntity, out var seatId); //TODO: Can't get EGID - var player = EcsObjectBase.GetInstance(new EGID(egid.entityID, CharacterExclusiveGroups.OnFootGroup), - e => new Player(e.entityID)); + var player = Player.GetInstance(egid.entityID); if (previousGroup == CharacterExclusiveGroups.InPilotSeatGroup) player.seatExited.Invoke(this, new PlayerSeatEventArgs { SeatId = seatId}); else if (egid.groupID == CharacterExclusiveGroups.InPilotSeatGroup) player.seatEntered.Invoke(this, new PlayerSeatEventArgs { SeatId = seatId }); } + + public void Add(ref PlayerIDStruct entityComponent, EGID egid) + { + Player.joined.Invoke(this, new PlayerEventArgs { PlayerId = egid }); + } + + public void Remove(ref PlayerIDStruct entityComponent, EGID egid) + { + Player.left.Invoke(this, new PlayerEventArgs { PlayerId = egid }); + } } } \ No newline at end of file diff --git a/TechbloxModdingAPI/Tasks/OnGuiRunner.cs b/TechbloxModdingAPI/Tasks/OnGuiRunner.cs new file mode 100644 index 0000000..b3c4000 --- /dev/null +++ b/TechbloxModdingAPI/Tasks/OnGuiRunner.cs @@ -0,0 +1,16 @@ +using System.Collections; +using Svelto.Tasks; +using Svelto.Tasks.ExtraLean; +using Svelto.Tasks.Unity.Internal; + +namespace TechbloxModdingAPI.Tasks +{ + public class OnGuiRunner : BaseRunner> + { + public OnGuiRunner(string name, uint runningOrder = 0) + : base(name) + { + UnityCoroutineRunner.StartOnGuiCoroutine(this._processEnumerator, runningOrder); + } + } +} \ No newline at end of file -- 2.30.2 From 5602ef9268f023bf761006aae22548eeaaf04408 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Tue, 28 Dec 2021 15:09:01 +0100 Subject: [PATCH 226/252] All kinds of fixes of issues during automatic tests - Fixed toggling time running mode - Fixed closing popups - Added support for pressing the buttons on a popup - Added error handling to Main.Init() - Automatically closing the beta message in the test plugin - Fixed Game.EnterGame() causing a crash in the game --- TechbloxModdingAPI/App/AppEngine.cs | 44 ---------- TechbloxModdingAPI/App/Client.cs | 59 +++++++++---- TechbloxModdingAPI/App/ClientAlertTest.cs | 20 +++-- .../App/GameBuildSimEventEngine.cs | 2 + TechbloxModdingAPI/App/GameGameEngine.cs | 33 +++++--- TechbloxModdingAPI/App/GameMenuEngine.cs | 32 ++++--- TechbloxModdingAPI/Input/FakeInput.cs | 2 +- TechbloxModdingAPI/Main.cs | 84 ++++++++++++------- .../Tests/TechbloxModdingAPIPluginTest.cs | 5 ++ TechbloxModdingAPI/Tests/TestRoot.cs | 12 ++- TechbloxModdingAPI/Utility/FullGameFields.cs | 18 ++++ 11 files changed, 188 insertions(+), 123 deletions(-) delete mode 100644 TechbloxModdingAPI/App/AppEngine.cs diff --git a/TechbloxModdingAPI/App/AppEngine.cs b/TechbloxModdingAPI/App/AppEngine.cs deleted file mode 100644 index e4f5dcb..0000000 --- a/TechbloxModdingAPI/App/AppEngine.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System; - -using RobocraftX.GUI.MyGamesScreen; -using Svelto.ECS; -using TechbloxModdingAPI.Engines; -using TechbloxModdingAPI.Utility; - -namespace TechbloxModdingAPI.App -{ - public class AppEngine : IFactoryEngine - { - public WrappedHandler EnterMenu; - - public WrappedHandler ExitMenu; - - public IEntityFactory Factory { set; private get; } - - public string Name => "TechbloxModdingAPIAppEngine"; - - public bool isRemovable => false; - - public EntitiesDB entitiesDB { set; private get; } - - public void Dispose() - { - IsInMenu = false; - ExitMenu.Invoke(this, new MenuEventArgs { }); - } - - public void Ready() - { - IsInMenu = true; - EnterMenu.Invoke(this, new MenuEventArgs { }); - } - - // app functionality - - public bool IsInMenu - { - get; - private set; - } = false; - } -} diff --git a/TechbloxModdingAPI/App/Client.cs b/TechbloxModdingAPI/App/Client.cs index 6fe4b4e..89f486f 100644 --- a/TechbloxModdingAPI/App/Client.cs +++ b/TechbloxModdingAPI/App/Client.cs @@ -14,12 +14,12 @@ namespace TechbloxModdingAPI.App /// public class Client { + public static Client Instance { get; } = new Client(); + protected static Func ErrorHandlerInstanceGetter; protected static Action EnqueueError; - protected static Action HandleErrorClosed; - /// /// An event that fires whenever the main menu is loaded. /// @@ -93,14 +93,31 @@ namespace TechbloxModdingAPI.App EnqueueError(errorHandlerInstance, popup); } - // TODO - /*public void CloseCurrentPrompt() + public void CloseCurrentPrompt() { - // RobocraftX.Services.ErrorHandler.Instance.HandlePopupClosed(); - // FIXME: this is a call that is also called when closing, not the actual closing action itself (so it doesn't work) object errorHandlerInstance = ErrorHandlerInstanceGetter(); - HandleErrorClosed(errorHandlerInstance); - }*/ + var popup = GetPopupCloseMethods(errorHandlerInstance); + popup.Close(); + } + + public void SelectFirstPromptButton() + { + object errorHandlerInstance = ErrorHandlerInstanceGetter(); + var popup = GetPopupCloseMethods(errorHandlerInstance); + popup.FirstButton(); + } + + public void SelectSecondPromptButton() + { + object errorHandlerInstance = ErrorHandlerInstanceGetter(); + var popup = GetPopupCloseMethods(errorHandlerInstance); + popup.SecondButton(); + } + + internal void CloseBetaPopup() + { + Game.menuEngine.CloseBetaPopup(); + } internal static void Init() { @@ -113,9 +130,6 @@ namespace TechbloxModdingAPI.App EnqueueError = (Action) AccessTools.Method("TechbloxModdingAPI.App.Client:GenEnqueueError") .MakeGenericMethod(errorHandler, errorHandle) .Invoke(null, new object[0]); - /*HandleErrorClosed = (Action) AccessTools.Method("TechbloxModdingAPI.App.Client:GenHandlePopupClosed") - .MakeGenericMethod(errorHandler) - .Invoke(null, new object[0]);*/ } // Creating delegates once is faster than reflection every time @@ -140,14 +154,23 @@ namespace TechbloxModdingAPI.App return enqueueCasted; } - private static Action GenHandlePopupClosed() + private static (Action Close, Action FirstButton, Action SecondButton) _errorPopup; + + private static (Action Close, Action FirstButton, Action SecondButton) GetPopupCloseMethods(object handler) { - Type errorHandler = AccessTools.TypeByName("RobocraftX.Services.ErrorHandler"); - MethodInfo handlePopupClosed = AccessTools.Method(errorHandler, "HandlePopupClosed"); - Action handleSimple = - (Action) Delegate.CreateDelegate(typeof(Action), handlePopupClosed); - Action handleCasted = (object instance) => handleSimple((T) instance); - return handleCasted; + if (_errorPopup.Close != null) + return _errorPopup; + Type errorHandler = handler.GetType(); + FieldInfo field = AccessTools.Field(errorHandler, "errorPopup"); + var errorPopup = (ErrorPopup)field.GetValue(handler); + MethodInfo info = AccessTools.Method(errorPopup.GetType(), "ClosePopup"); + var close = (Action)Delegate.CreateDelegate(typeof(Action), errorPopup, info); + info = AccessTools.Method(errorPopup.GetType(), "HandleFirstOption"); + var first = (Action)Delegate.CreateDelegate(typeof(Action), errorPopup, info); + info = AccessTools.Method(errorPopup.GetType(), "HandleSecondOption"); + var second = (Action)Delegate.CreateDelegate(typeof(Action), errorPopup, info); + _errorPopup = (close, first, second); + return _errorPopup; } } } diff --git a/TechbloxModdingAPI/App/ClientAlertTest.cs b/TechbloxModdingAPI/App/ClientAlertTest.cs index 20d8201..278a826 100644 --- a/TechbloxModdingAPI/App/ClientAlertTest.cs +++ b/TechbloxModdingAPI/App/ClientAlertTest.cs @@ -42,17 +42,25 @@ namespace TechbloxModdingAPI.App [APITestCase(TestType.Menu)] public static void TestPopUp2() { - Client c = new Client(); - c.PromptUser(popup2); - //c.CloseCurrentPrompt(); + Client.Instance.PromptUser(popup2); } [APITestCase(TestType.Menu)] public static void TestPopUp1() { - Client c = new Client(); - c.PromptUser(popup1); - //c.CloseCurrentPrompt(); + Client.Instance.PromptUser(popup1); + } + + [APITestCase(TestType.Menu)] + public static void TestPopUpClose1() + { + Client.Instance.CloseCurrentPrompt(); + } + + [APITestCase(TestType.Menu)] + public static void TestPopUpClose2() + { + Client.Instance.CloseCurrentPrompt(); } } #endif diff --git a/TechbloxModdingAPI/App/GameBuildSimEventEngine.cs b/TechbloxModdingAPI/App/GameBuildSimEventEngine.cs index 67e6769..1846dd2 100644 --- a/TechbloxModdingAPI/App/GameBuildSimEventEngine.cs +++ b/TechbloxModdingAPI/App/GameBuildSimEventEngine.cs @@ -27,12 +27,14 @@ namespace TechbloxModdingAPI.App public JobHandle OnInitializeTimeRunningMode(JobHandle inputDeps) { + Console.WriteLine("Init time running mode"); SimulationMode.Invoke(this, new GameEventArgs { GameName = "", GamePath = "" }); // TODO return inputDeps; } public JobHandle OnInitializeTimeStoppedMode(JobHandle inputDeps) { + Console.WriteLine("Init time stopped mode"); BuildMode.Invoke(this, new GameEventArgs { GameName = "", GamePath = "" }); return inputDeps; } diff --git a/TechbloxModdingAPI/App/GameGameEngine.cs b/TechbloxModdingAPI/App/GameGameEngine.cs index 46167a4..279b170 100644 --- a/TechbloxModdingAPI/App/GameGameEngine.cs +++ b/TechbloxModdingAPI/App/GameGameEngine.cs @@ -1,6 +1,7 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; +using HarmonyLib; +using RobocraftX; using RobocraftX.Common; using RobocraftX.Schedulers; using RobocraftX.SimulationModeState; @@ -9,11 +10,14 @@ using Svelto.Tasks; using Svelto.Tasks.Lean; using RobocraftX.Blocks; using RobocraftX.Common.Loading; +using RobocraftX.Multiplayer; using RobocraftX.ScreenshotTaker; using Techblox.Environment.Transition; using Techblox.GameSelection; + using TechbloxModdingAPI.Blocks; using TechbloxModdingAPI.Engines; +using TechbloxModdingAPI.Input; using TechbloxModdingAPI.Players; using TechbloxModdingAPI.Utility; @@ -52,9 +56,7 @@ namespace TechbloxModdingAPI.App private void OnPlayerJoined(object sender, PlayerEventArgs args) { - Console.WriteLine("Player joined: " + args.PlayerId + " asd"); if (args.Player.Type != PlayerType.Local) return; - Console.WriteLine("Player joined is local asd"); playerJoined = true; Player.Joined -= OnPlayerJoined; CheckJoinEvent(); @@ -112,10 +114,23 @@ namespace TechbloxModdingAPI.App public void ToggleTimeMode() { - if (!entitiesDB.FoundInGroups()) - throw new AppStateException("At least one block must exist in the world to enter simulation"); - SwitchAnimationUtil.Start(entitiesDB); - } + if (TimeRunningModeUtil.IsTimeStoppedMode(entitiesDB)) + FakeInput.ActionInput(toggleMode: true); + else + { + IEnumerator ReloadBuildModeTask() + { + SwitchAnimationUtil.Start(entitiesDB); + while (SwitchAnimationUtil.IsFadeOutActive(entitiesDB)) + yield return (TaskContract)Yield.It; + FullGameFields._multiplayerParams.MultiplayerMode = MultiplayerMode.SinglePlayer; + AccessTools.Method(typeof(FullGameCompositionRoot), "ReloadGame") + .Invoke(FullGameFields.Instance, new object[] { }); + } + + ReloadBuildModeTask().RunOn(ClientLean.UIScheduler); + } + } public EGID[] GetAllBlocksInGame(BlockIDs filter = BlockIDs.Invalid) { @@ -162,13 +177,11 @@ namespace TechbloxModdingAPI.App if (!enteredGame) return; enteredGame = false; loadingFinished = true; - Console.WriteLine("Loading finished - asd"); CheckJoinEvent(); } private void CheckJoinEvent() { - Console.WriteLine($"Check: {loadingFinished} {playerJoined}"); if (!loadingFinished || !playerJoined) return; EnterGame.Invoke(this, new GameEventArgs { GameName = GetGameData().saveName, GamePath = GetGameData().gameID }); IsInGame = true; diff --git a/TechbloxModdingAPI/App/GameMenuEngine.cs b/TechbloxModdingAPI/App/GameMenuEngine.cs index 276bda8..533b112 100644 --- a/TechbloxModdingAPI/App/GameMenuEngine.cs +++ b/TechbloxModdingAPI/App/GameMenuEngine.cs @@ -5,6 +5,7 @@ using HarmonyLib; using RobocraftX; using RobocraftX.GUI; using RobocraftX.GUI.MyGamesScreen; +using RobocraftX.Multiplayer; using Svelto.ECS; using Svelto.ECS.Experimental; using Techblox.GameSelection; @@ -103,19 +104,16 @@ namespace TechbloxModdingAPI.App return EnterGame(mgdes.GameName, mgdes.FileId); } - public bool EnterGame(string gameName, string fileId, bool autoEnterSim = false) + public bool EnterGame(ECSString gameName, string fileId, bool autoEnterSim = false) { - var data = new GameSelectionData - { - gameMode = Techblox.GameSelection.GameMode.PlayGame, - isOnline = false, - saveName = gameName, - saveType = SaveType.ExistingSave, - gameID = "GAMEID_Road_Track", //TODO: Expose to the API - userContentID = fileId - }; - // the private FullGameCompositionRoot.SwitchToGame() method gets passed to menu items for this reason - AccessTools.Method(typeof(FullGameCompositionRoot), "SwitchToGame").Invoke(FullGameFields.Instance, new object[]{data}); + FullGameFields._multiplayerParams.MultiplayerMode = MultiplayerMode.SinglePlayer; + ref var selection = ref entitiesDB.QueryEntity(GameSelectionConstants.GameSelectionEGID); + selection.userContentID.Set(fileId); + selection.triggerStart = true; + selection.saveType = SaveType.ExistingSave; + selection.saveName = gameName; + selection.gameMode = GameMode.PlayGame; + selection.gameID.Set("GAMEID_Road_Track"); //TODO: Expose to the API return true; } @@ -158,6 +156,16 @@ namespace TechbloxModdingAPI.App { return ref entitiesDB.QueryEntity(id); } + + internal void CloseBetaPopup() + { + var (buffer, count) = entitiesDB.QueryEntities(ExclusiveGroup.Search("BetaPopup")); + for (int index = 0; index < count; ++index) + { + entitiesDB.QueryEntity(buffer[index].TogglePanelButtonComponent.targetPanel) + .guiRoot.enabled = false; + } + } } internal class MyGameDataEntityDescriptor_DamnItFJWhyDidYouMakeThisInternal : GenericEntityDescriptor { } diff --git a/TechbloxModdingAPI/Input/FakeInput.cs b/TechbloxModdingAPI/Input/FakeInput.cs index 6beb63f..bcf8367 100644 --- a/TechbloxModdingAPI/Input/FakeInput.cs +++ b/TechbloxModdingAPI/Input/FakeInput.cs @@ -111,7 +111,7 @@ namespace TechbloxModdingAPI.Input ref LocalPlayerInputEntityStruct currentInput = ref inputEngine.GetPlayerInputRef(playerID); //Utility.Logging.CommandLog($"Current sim frame {currentInput.frame}"); // set inputs - if (toggleMode) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.ToggleTimeRunningModeTest; //TODO: Test, play + if (toggleMode) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.ToggleTimeRunningModePlay; //TODO: Test, play if (forward) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.Forward; if (backward) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.Backward; if (up) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.Up; diff --git a/TechbloxModdingAPI/Main.cs b/TechbloxModdingAPI/Main.cs index f11059b..554debe 100644 --- a/TechbloxModdingAPI/Main.cs +++ b/TechbloxModdingAPI/Main.cs @@ -49,39 +49,42 @@ namespace TechbloxModdingAPI harmony.PatchAll(currentAssembly); } catch (Exception e) - { //Can't use ErrorBuilder or Logging.LogException (which eventually uses ErrorBuilder) yet - Logging.Log(e.ToString()); - Logging.LogWarning("Failed to patch Techblox. Attempting to patch to display error..."); - harmony.Patch(AccessTools.Method(typeof(FullGameCompositionRoot), "OnContextInitialized") - .MakeGenericMethod(typeof(UnityContext)), - new HarmonyMethod(((Action) OnPatchError).Method)); //Can't use lambdas here :( + { + HandleError(e, "Failed to patch Techblox. Attempting to patch to display error...", OnPatchError); return; } - // init utility - Logging.MetaDebugLog($"Initializing Utility"); - Utility.GameState.Init(); - // init block implementors - Logging.MetaDebugLog($"Initializing Blocks"); - // init input - Input.FakeInput.Init(); - // init object-oriented classes - Player.Init(); - Block.Init(); - BlockGroup.Init(); - Wire.Init(); - // init client - Logging.MetaDebugLog($"Initializing Client"); - Client.Init(); - Game.Init(); - // init UI - Logging.MetaDebugLog($"Initializing UI"); - Interface.IMGUI.Constants.Init(); - Interface.IMGUI.IMGUIManager.Init(); - // init anti-anticheat - Logging.MetaDebugLog("Initializing anti-anticheat"); - AntiAntiCheatPatch.Init(harmony); - Logging.MetaLog($"{currentAssembly.GetName().Name} v{currentAssembly.GetName().Version} initialized"); + try + { + // init utility + Logging.MetaDebugLog($"Initializing Utility"); + Utility.GameState.Init(); + // init block implementors + Logging.MetaDebugLog($"Initializing Blocks"); + // init input + Input.FakeInput.Init(); + // init object-oriented classes + Player.Init(); + Block.Init(); + BlockGroup.Init(); + Wire.Init(); + // init client + Logging.MetaDebugLog($"Initializing Client"); + Client.Init(); + Game.Init(); + // init UI + Logging.MetaDebugLog($"Initializing UI"); + Interface.IMGUI.Constants.Init(); + Interface.IMGUI.IMGUIManager.Init(); + // init anti-anticheat + Logging.MetaDebugLog("Initializing anti-anticheat"); + AntiAntiCheatPatch.Init(harmony); + Logging.MetaLog($"{currentAssembly.GetName().Name} v{currentAssembly.GetName().Version} initialized"); + } + catch (Exception e) + { + HandleError(e, "Failed to initialize the API! Attempting to patch to display error...", OnInitError); + } } /// @@ -112,5 +115,26 @@ namespace TechbloxModdingAPI ErrorBuilder.DisplayMustQuitError("Failed to patch Techblox!\n" + "Make sure you're using the latest version of TechbloxModdingAPI or disable mods if the API isn't released yet."); } + + private static void OnInitError() + { + ErrorBuilder.DisplayMustQuitError("Failed to initialize the modding API!\n" + + "Make sure you're using the latest version. If you are, please report the error."); + } + + /// + /// Handles an init error. Logs the exception, a log message, and allows displaying an error in-game. + /// + /// The exception + /// The log message + /// The action to run when the game is ready to display error messages + private static void HandleError(Exception e, string logMsg, Action onInit) + { //Can't use ErrorBuilder or Logging.LogException (which eventually uses ErrorBuilder) yet + Logging.Log(e.ToString()); + Logging.LogWarning(logMsg); + harmony.Patch(AccessTools.Method(typeof(FullGameCompositionRoot), "OnContextInitialized") + .MakeGenericMethod(typeof(UnityContext)), + new HarmonyMethod(onInit.Method)); //Can't use lambdas here :( + } } } diff --git a/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs b/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs index f528f83..124d159 100644 --- a/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs +++ b/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs @@ -343,6 +343,11 @@ namespace TechbloxModdingAPI.Tests Logging.CommandLog(asset); } }).Build(); + Client.EnterMenu += (sender, args) => Scheduler.Schedule(new Once(() => Client.Instance.CloseBetaPopup())); + + Game.Enter += (sender, args) => + Console.WriteLine( + $"Current game selection data: {FullGameFields._gameSelectionData.gameMode} - {FullGameFields._gameSelectionData.saveType}"); #if TEST TestRoot.RunTests(); #endif diff --git a/TechbloxModdingAPI/Tests/TestRoot.cs b/TechbloxModdingAPI/Tests/TestRoot.cs index bd5dc01..16b85d0 100644 --- a/TechbloxModdingAPI/Tests/TestRoot.cs +++ b/TechbloxModdingAPI/Tests/TestRoot.cs @@ -129,7 +129,7 @@ namespace TechbloxModdingAPI.Tests private static IEnumerator GoToGameTests() { - Client app = new Client(); + Client app = Client.Instance; int oldLength = 0; while (app.MyGames.Length == 0 || oldLength != app.MyGames.Length) { @@ -137,7 +137,15 @@ namespace TechbloxModdingAPI.Tests yield return new WaitForSecondsEnumerator(1).Continue(); } yield return Yield.It; - app.MyGames[0].EnterGame(); + try + { + app.MyGames[0].EnterGame(); + } + catch (Exception e) + { + Console.WriteLine("Failed to go to game tests"); + Console.WriteLine(e); + } /*Game newGame = Game.NewGame(); yield return new WaitForSecondsEnumerator(5).Continue(); // wait for sync newGame.EnterGame();*/ diff --git a/TechbloxModdingAPI/Utility/FullGameFields.cs b/TechbloxModdingAPI/Utility/FullGameFields.cs index 0aec467..de9f487 100644 --- a/TechbloxModdingAPI/Utility/FullGameFields.cs +++ b/TechbloxModdingAPI/Utility/FullGameFields.cs @@ -7,6 +7,8 @@ using RobocraftX.Multiplayer; using Svelto.Context; using Svelto.DataStructures; using Svelto.ECS; +using Svelto.ECS.GUI; +using Techblox.GameSelection; using UnityEngine; using Unity.Entities; using Unity.Physics.Systems; @@ -144,6 +146,22 @@ namespace TechbloxModdingAPI.Utility } } + public static SveltoGUI _frontEndGUI + { + get + { + return (SveltoGUI)fgcr?.Field("_frontEndGUI").GetValue(); + } + } + + public static GameSelectionData _gameSelectionData + { + get + { + return (GameSelectionData)fgcr?.Field("_gameSelectionData").GetValue(); + } + } + private static Traverse fgcr; public static void Init(FullGameCompositionRoot instance) -- 2.30.2 From 966fdd4c3a936aa782ebbeac0e86ab6c2a7740f8 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Fri, 7 Jan 2022 02:14:58 +0100 Subject: [PATCH 227/252] Fix even more issues uncovered by tests - Fixed the time mode toggle not working during testing (changed the runner) - Made the testing thing wait until the time toggle finishes - Fixed the Game.Enter/Exit event being triggered on time mode change - Added a way to spawn and despawn the player's machine (which doesn't work yet) - Fixed the Player.Id property always being 0 - Attempted to fix the fake action inputs not working in simulation --- TechbloxModdingAPI/App/GameGameEngine.cs | 4 ++ TechbloxModdingAPI/EcsObjectBase.cs | 1 + TechbloxModdingAPI/Engines/EnginePatches.cs | 28 ++++++-- TechbloxModdingAPI/Input/FakeInput.cs | 70 +++++++++---------- TechbloxModdingAPI/Input/FakeInputEngine.cs | 10 +++ TechbloxModdingAPI/Input/FakeInputPatch.cs | 19 +++++ TechbloxModdingAPI/Player.cs | 24 +++++++ TechbloxModdingAPI/Players/PlayerEngine.cs | 32 +++++++++ TechbloxModdingAPI/Players/PlayerTests.cs | 17 ++++- TechbloxModdingAPI/Tests/TestRoot.cs | 14 +++- .../Utility/GameEngineManager.cs | 5 +- 11 files changed, 178 insertions(+), 46 deletions(-) create mode 100644 TechbloxModdingAPI/Input/FakeInputPatch.cs diff --git a/TechbloxModdingAPI/App/GameGameEngine.cs b/TechbloxModdingAPI/App/GameGameEngine.cs index 279b170..9856da8 100644 --- a/TechbloxModdingAPI/App/GameGameEngine.cs +++ b/TechbloxModdingAPI/App/GameGameEngine.cs @@ -41,6 +41,8 @@ namespace TechbloxModdingAPI.App public void Dispose() { + if (GameReloadedPatch.IsReload) + return; // Toggling time mode ExitGame.Invoke(this, new GameEventArgs { GameName = GetGameData().saveName, GamePath = GetGameData().gameID }); IsInGame = false; loadingFinished = false; @@ -50,6 +52,8 @@ namespace TechbloxModdingAPI.App public void Ready() { + if (GameReloadedPatch.IsReload) + return; // Toggling time mode enteredGame = true; Player.Joined += OnPlayerJoined; } diff --git a/TechbloxModdingAPI/EcsObjectBase.cs b/TechbloxModdingAPI/EcsObjectBase.cs index 9698eaa..ba42dc8 100644 --- a/TechbloxModdingAPI/EcsObjectBase.cs +++ b/TechbloxModdingAPI/EcsObjectBase.cs @@ -62,6 +62,7 @@ namespace TechbloxModdingAPI var id = initializer(this); if (!dict.ContainsKey(id)) // Multiple instances may be created dict.Add(id, this); + Id = id; } #region ECS initializer stuff diff --git a/TechbloxModdingAPI/Engines/EnginePatches.cs b/TechbloxModdingAPI/Engines/EnginePatches.cs index 7c9524b..d6b61a9 100644 --- a/TechbloxModdingAPI/Engines/EnginePatches.cs +++ b/TechbloxModdingAPI/Engines/EnginePatches.cs @@ -14,12 +14,10 @@ namespace TechbloxModdingAPI.Engines [HarmonyPatch] static class GameLoadedTimeStoppedEnginePatch { - public static EntitiesSubmissionScheduler Scheduler { get; private set; } public static void Postfix(StateSyncRegistrationHelper stateSyncReg) { // register all game engines, including deterministic GameEngineManager.RegisterEngines(stateSyncReg); - Scheduler = stateSyncReg.enginesRoot.scheduler; // register command engines /*CommandLineCompositionRoot.Compose(contextHolder, stateSyncReg.enginesRoot, reloadGame, multiplayerParameters, stateSyncReg); - uREPL C# compilation not supported anymore */ @@ -35,10 +33,10 @@ namespace TechbloxModdingAPI.Engines [HarmonyPatch] static class GameLoadedTimeRunningEnginePatch { - public static EntitiesSubmissionScheduler Scheduler { get; private set; } public static void Postfix(StateSyncRegistrationHelper stateSyncReg) { - GameLoadedTimeStoppedEnginePatch.Postfix(stateSyncReg); + GameEngineManager.RegisterEngines(stateSyncReg); + CommandManager.RegisterEngines(stateSyncReg.enginesRoot); } public static MethodBase TargetMethod() @@ -46,6 +44,28 @@ namespace TechbloxModdingAPI.Engines return AccessTools.Method(typeof(MainGameCompositionRoot), "DeterministicTimeRunningCompose").MakeGenericMethod(typeof(object)); } } + + [HarmonyPatch] + static class GameReloadedPatch + { + internal static bool IsReload; + public static void Prefix() => IsReload = true; + public static MethodBase TargetMethod() => AccessTools.Method(typeof(FullGameCompositionRoot), "ReloadGame"); + } + + [HarmonyPatch] + static class GameSwitchedToPatch + { + public static void Prefix() => GameReloadedPatch.IsReload = false; + public static MethodBase TargetMethod() => AccessTools.Method(typeof(FullGameCompositionRoot), "SwitchToGame"); + } + + [HarmonyPatch] + static class MenuSwitchedToPatch + { + public static void Prefix() => GameReloadedPatch.IsReload = false; + public static MethodBase TargetMethod() => AccessTools.Method(typeof(FullGameCompositionRoot), "SwitchToMenu"); + } [HarmonyPatch] class MenuLoadedEnginePatch diff --git a/TechbloxModdingAPI/Input/FakeInput.cs b/TechbloxModdingAPI/Input/FakeInput.cs index bcf8367..0b0a7f9 100644 --- a/TechbloxModdingAPI/Input/FakeInput.cs +++ b/TechbloxModdingAPI/Input/FakeInput.cs @@ -1,15 +1,13 @@ -using System; +using RobocraftX.Common.Input; -using RobocraftX.Common; -using RobocraftX.Common.Input; -using Svelto.ECS; +using TechbloxModdingAPI.App; using TechbloxModdingAPI.Utility; namespace TechbloxModdingAPI.Input { public static class FakeInput { - private static readonly FakeInputEngine inputEngine = new FakeInputEngine(); + internal static readonly FakeInputEngine inputEngine = new FakeInputEngine(); /// /// Customize the local input. @@ -103,39 +101,39 @@ namespace TechbloxModdingAPI.Input } public static void ActionInput(uint playerID = uint.MaxValue, bool toggleMode = false, bool forward = false, bool backward = false, bool up = false, bool down = false, bool left = false, bool right = false, bool sprint = false, bool toggleFly = false, bool alt = false, bool primary = false, bool secondary = false, bool tertiary = false, bool primaryHeld = false, bool secondaryHeld = false, bool toggleUnitGrid = false, bool ctrl = false, bool toggleColourMode = false, bool scaleBlockUp = false, bool scaleBlockDown = false, bool rotateBlockClockwise = false, bool rotateBlockCounterclockwise = false, bool cutSelection = false, bool copySelection = false, bool deleteSelection = false) - { - if (playerID == uint.MaxValue) - { - playerID = inputEngine.GetLocalPlayerID(); - } - ref LocalPlayerInputEntityStruct currentInput = ref inputEngine.GetPlayerInputRef(playerID); + { // TODO: We can only alter our own inputs clientside + ref var currentInput = ref inputEngine._localInputCache; + //Utility.Logging.CommandLog($"Current sim frame {currentInput.frame}"); // set inputs - if (toggleMode) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.ToggleTimeRunningModePlay; //TODO: Test, play - if (forward) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.Forward; - if (backward) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.Backward; - if (up) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.Up; - if (down) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.Down; - if (left) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.Left; - if (right) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.Right; - if (sprint) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.Sprint; - //if (toggleFly) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.SwitchFlyMode; - //if (alt) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.AltAction; - if (primary) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.PrimaryAction; - if (secondary) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.SecondaryAction; - if (tertiary) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.TertiaryAction; - if (primaryHeld) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.PrimaryActionHeld; - if (secondaryHeld) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.SecondaryActionHeld; - //if (toggleUnitGrid) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.ToggleUnitGrid; - if (ctrl) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.CtrlAction; - if (toggleColourMode) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.ToggleColourMode; - if (scaleBlockUp) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.ScaleBlockUp; - if (scaleBlockDown) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.ScaleBlockDown; - if (rotateBlockClockwise) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.RotateBlockClockwise; - if (rotateBlockCounterclockwise) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.RotateBlockAnticlockwise; - if (cutSelection) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.CutSelection; - if (copySelection) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.CopySelection; - if (deleteSelection) currentInput.actionMask |= RobocraftX.Common.Input.ActionInput.DeleteSelection; + if (toggleMode) currentInput |= RobocraftX.Common.Input.ActionInput.ToggleTimeRunningModePlay; //TODO: Test, play + if (forward) currentInput |= RobocraftX.Common.Input.ActionInput.Forward; + if (backward) currentInput |= RobocraftX.Common.Input.ActionInput.Backward; + if (up) currentInput |= RobocraftX.Common.Input.ActionInput.Up; + if (down) currentInput |= RobocraftX.Common.Input.ActionInput.Down; + if (left) currentInput |= RobocraftX.Common.Input.ActionInput.Left; + if (right) currentInput |= RobocraftX.Common.Input.ActionInput.Right; + if (sprint) currentInput |= RobocraftX.Common.Input.ActionInput.Sprint; + //if (toggleFly) currentInput |= RobocraftX.Common.Input.ActionInput.SwitchFlyMode; + //if (alt) currentInput |= RobocraftX.Common.Input.ActionInput.AltAction; + if (primary) currentInput |= RobocraftX.Common.Input.ActionInput.PrimaryActionClick; + if (secondary) currentInput |= RobocraftX.Common.Input.ActionInput.SecondaryActionClick; + if (tertiary) currentInput |= RobocraftX.Common.Input.ActionInput.TertiaryAction; + if (primaryHeld) currentInput |= RobocraftX.Common.Input.ActionInput.PrimaryActionHeld; + if (secondaryHeld) currentInput |= RobocraftX.Common.Input.ActionInput.SecondaryActionHeld; + //if (toggleUnitGrid) currentInput |= RobocraftX.Common.Input.ActionInput.ToggleUnitGrid; + if (ctrl) currentInput |= RobocraftX.Common.Input.ActionInput.CtrlAction; + if (toggleColourMode) currentInput |= RobocraftX.Common.Input.ActionInput.ToggleColourMode; + if (scaleBlockUp) currentInput |= RobocraftX.Common.Input.ActionInput.ScaleBlockUp; + if (scaleBlockDown) currentInput |= RobocraftX.Common.Input.ActionInput.ScaleBlockDown; + if (rotateBlockClockwise) currentInput |= RobocraftX.Common.Input.ActionInput.RotateBlockClockwise; + if (rotateBlockCounterclockwise) currentInput |= RobocraftX.Common.Input.ActionInput.RotateBlockAnticlockwise; + if (cutSelection) currentInput |= RobocraftX.Common.Input.ActionInput.CutSelection; + if (copySelection) currentInput |= RobocraftX.Common.Input.ActionInput.CopySelection; + if (deleteSelection) currentInput |= RobocraftX.Common.Input.ActionInput.DeleteSelection; + + if(Game.CurrentGame().IsTimeStopped) + inputEngine.HandleCustomInput(); // Only gets called when online, so calling it here as well } public static void Init() diff --git a/TechbloxModdingAPI/Input/FakeInputEngine.cs b/TechbloxModdingAPI/Input/FakeInputEngine.cs index 7b4528c..cc6a6c2 100644 --- a/TechbloxModdingAPI/Input/FakeInputEngine.cs +++ b/TechbloxModdingAPI/Input/FakeInputEngine.cs @@ -20,6 +20,8 @@ namespace TechbloxModdingAPI.Input public bool IsReady = false; + internal ActionInput _localInputCache; + public void Dispose() { IsReady = false; @@ -86,6 +88,14 @@ namespace TechbloxModdingAPI.Input return ref entitiesDB.QueryEntity(egid); } + internal void HandleCustomInput() + { + if (!LocalPlayerIDUtility.DoesLocalPlayerExist(entitiesDB)) + return; + GetPlayerInputRef(GetLocalPlayerID()).actionMask |= _localInputCache; + _localInputCache = default; + } + public uint GetLocalPlayerID() { return LocalPlayerIDUtility.GetLocalPlayerID(entitiesDB); diff --git a/TechbloxModdingAPI/Input/FakeInputPatch.cs b/TechbloxModdingAPI/Input/FakeInputPatch.cs new file mode 100644 index 0000000..f1a3281 --- /dev/null +++ b/TechbloxModdingAPI/Input/FakeInputPatch.cs @@ -0,0 +1,19 @@ +using System.Reflection; +using HarmonyLib; + +namespace TechbloxModdingAPI.Input +{ + [HarmonyPatch] + public static class FakeInputPatch + { + public static void Prefix() + { + FakeInput.inputEngine.HandleCustomInput(); // This gets called right before the input is sent to the server + } + + public static MethodBase TargetMethod() + { + return AccessTools.Method("RobocraftX.Multiplayer.Input.NetworkInputRecorderEngine:RecordDeterministicInput"); + } + } +} \ No newline at end of file diff --git a/TechbloxModdingAPI/Player.cs b/TechbloxModdingAPI/Player.cs index 462e44b..63d13e0 100644 --- a/TechbloxModdingAPI/Player.cs +++ b/TechbloxModdingAPI/Player.cs @@ -125,6 +125,7 @@ namespace TechbloxModdingAPI }) { this.Type = player; + Id = base.Id.entityID; } // object fields & properties @@ -434,15 +435,38 @@ namespace TechbloxModdingAPI playerEngine.SetLocation(Id, location, exitSeat: exitSeat); } + /// + /// Enter the given seat. + /// + /// The seat to enter. public void EnterSeat(Seat seat) { playerEngine.EnterSeat(Id, seat.Id); } + /// + /// Exit the seat the player is currently in. + /// public void ExitSeat() { playerEngine.ExitSeat(Id); } + + /// + /// Spawn the machine the player is holding in time running mode. + /// + public bool SpawnMachine() + { + return playerEngine.SpawnMachine(Id); + } + + /// + /// Despawn the player's machine in time running mode and place it in their hand. + /// + public bool DespawnMachine() + { + return playerEngine.DespawnMachine(Id); + } /// /// Returns the block the player is currently looking at in build mode. diff --git a/TechbloxModdingAPI/Players/PlayerEngine.cs b/TechbloxModdingAPI/Players/PlayerEngine.cs index 2722258..bf9c548 100644 --- a/TechbloxModdingAPI/Players/PlayerEngine.cs +++ b/TechbloxModdingAPI/Players/PlayerEngine.cs @@ -12,6 +12,7 @@ using Gamecraft.GUI.HUDFeedbackBlocks; using RobocraftX.Blocks; using RobocraftX.Multiplayer; using RobocraftX.PilotSeat; +using RobocraftX.SimulationModeState; using Svelto.ECS; using Techblox.Camera; using Unity.Mathematics; @@ -20,6 +21,7 @@ using Svelto.ECS.EntityStructs; using Techblox.BuildingDrone; using TechbloxModdingAPI.Engines; +using TechbloxModdingAPI.Input; using TechbloxModdingAPI.Utility; namespace TechbloxModdingAPI.Players @@ -205,6 +207,8 @@ namespace TechbloxModdingAPI.Players public void EnterSeat(uint playerId, EGID seatId) { + if (!TimeRunningModeUtil.IsTimeRunningMode(entitiesDB)) + return; PilotSeatGroupUtils.SwapTagTo(Functions, seatId); var opt = GetCharacterStruct(playerId, out var group); if (!opt) return; @@ -222,6 +226,8 @@ namespace TechbloxModdingAPI.Players public void ExitSeat(uint playerId) { + if (!TimeRunningModeUtil.IsTimeRunningMode(entitiesDB)) + return; EGID egid = new EGID(playerId, CharacterExclusiveGroups.InPilotSeatGroup); var opt = entitiesDB.QueryEntityOptional(egid); if (!opt) return; @@ -229,6 +235,32 @@ namespace TechbloxModdingAPI.Players entitiesDB.PublishEntityChange(egid); } + public bool SpawnMachine(uint playerId) + { + if (!TimeRunningModeUtil.IsTimeRunningMode(entitiesDB)) + return false; + EGID egid = new EGID(playerId, CharacterExclusiveGroups.MachineSpawningGroup); + if (!entitiesDB.Exists(egid)) + return false; + //Functions.SwapEntityGroup(egid, CharacterExclusiveGroups.OnFootGroup); + FakeInput.ActionInput(playerId, primary: true); + return true; + } + + public bool DespawnMachine(uint playerId) + { + if (!TimeRunningModeUtil.IsTimeRunningMode(entitiesDB)) + return false; + GetCharacterStruct(playerId, out var group); + if (group.isInvalid) + return false; + EGID egid = new EGID(playerId, group); + if (!entitiesDB.Exists(egid)) + return false; + Functions.SwapEntityGroup(egid, CharacterExclusiveGroups.MachineSpawningGroup); + return true; + } + public uint GetPing() { return entitiesDB diff --git a/TechbloxModdingAPI/Players/PlayerTests.cs b/TechbloxModdingAPI/Players/PlayerTests.cs index c974518..1fc4f49 100644 --- a/TechbloxModdingAPI/Players/PlayerTests.cs +++ b/TechbloxModdingAPI/Players/PlayerTests.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using Svelto.Tasks; using Svelto.Tasks.Enumerators; @@ -7,6 +8,7 @@ using Unity.Mathematics; using TechbloxModdingAPI.App; using TechbloxModdingAPI.Blocks; using TechbloxModdingAPI.Tests; +using TechbloxModdingAPI.Utility; namespace TechbloxModdingAPI.Players { @@ -45,7 +47,20 @@ namespace TechbloxModdingAPI.Players [APITestCase(TestType.SimulationMode)] public static IEnumerator SeatEventTestSim() { + yield return new WaitForSecondsEnumerator(1).Continue(); + Assert.Equal(Player.LocalPlayer.SpawnMachine(), true, "Failed to spawn the player's machine.", "Successfully spawned the player's machine."); + yield return new WaitForSecondsEnumerator(1).Continue(); var seats = Game.CurrentGame().GetBlocksInGame(BlockIDs.DriverSeat); + int c = 0; + while (seats.Length == 0 && c < 10) + { + Logging.MetaLog("Waiting for a seat to be spawned..."); + yield return new WaitForSecondsEnumerator(1).Continue(); + Console.WriteLine("Spawn machine: " + Player.LocalPlayer.SpawnMachine()); + seats = Game.CurrentGame().GetBlocksInGame(BlockIDs.DriverSeat); + c++; + } + if (seats.Length == 0) { Assert.Fail("No driver seat found!"); diff --git a/TechbloxModdingAPI/Tests/TestRoot.cs b/TechbloxModdingAPI/Tests/TestRoot.cs index 16b85d0..bffae51 100644 --- a/TechbloxModdingAPI/Tests/TestRoot.cs +++ b/TechbloxModdingAPI/Tests/TestRoot.cs @@ -7,7 +7,9 @@ using System.Linq; // welcome to the dark side using Svelto.Tasks; using Svelto.Tasks.Lean; using Svelto.Tasks.Enumerators; +using Svelto.Tasks.Lean.Unity; using UnityEngine; + using TechbloxModdingAPI.App; using TechbloxModdingAPI.Tasks; using TechbloxModdingAPI.Utility; @@ -64,7 +66,7 @@ namespace TechbloxModdingAPI.Tests _testsCountPassed = 0; _testsCountFailed = 0; // flow control - Game.Enter += (sender, args) => { GameTests().RunOn(RobocraftX.Schedulers.ClientLean.EveryFrameStepRunner_TimeRunningAndStopped); }; + Game.Enter += (sender, args) => { GameTests().RunOn(new UpdateMonoRunner("TechbloxModdingAPITestRunner")); }; Game.Exit += (s, a) => state = "ReturningFromGame"; Client.EnterMenu += (sender, args) => { @@ -165,6 +167,7 @@ namespace TechbloxModdingAPI.Tests }; for (var index = 0; index < testTypesToRun.Length; index++) { + Logging.MetaLog($"Running test type {testTypesToRun[index]}"); foreach (Type t in testTypes) { foreach (MethodBase m in t.GetMethods()) @@ -206,7 +209,16 @@ namespace TechbloxModdingAPI.Tests } if (index + 1 < testTypesToRun.Length) //Don't toggle on the last test + { + bool running = currentGame.IsTimeRunning; currentGame.ToggleTimeMode(); + while (running ? !currentGame.IsTimeStopped : !currentGame.IsTimeRunning) + { + Logging.MetaLog($"Waiting for time to {(running?"stop":"start")}..."); + yield return new WaitForSecondsEnumerator(1).Continue(); + } + } + yield return new WaitForSecondsEnumerator(5).Continue(); } // exit game diff --git a/TechbloxModdingAPI/Utility/GameEngineManager.cs b/TechbloxModdingAPI/Utility/GameEngineManager.cs index 16bf4e2..04b0da7 100644 --- a/TechbloxModdingAPI/Utility/GameEngineManager.cs +++ b/TechbloxModdingAPI/Utility/GameEngineManager.cs @@ -1,8 +1,5 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; using RobocraftX.StateSync; using Svelto.ECS; -- 2.30.2 From d27bcee8d579fd353e279b1566a58d0d01787409 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sun, 30 Jan 2022 04:32:10 +0100 Subject: [PATCH 228/252] Update to Techblox 2022.01.25.15.52 - Fixed compilation errors - Fixed patching errors and added missing anti-cheat patch - Added check to verify that the init data has been removed from blocks once they are placed in game - Removed block place event deduplication as it seems to be not needed anymore - Fixed async tests not properly running - Added Player.State - Attempted to fix seat entering/leaving (we can only send inputs in client code) - Fixed the weak dictionary ContainsKey returning true even if the item is no longer there --- CodeGenerator/Program.cs | 6 +- TechbloxModdingAPI/App/AntiAntiCheatPatch.cs | 2 + .../Blocks/Engines/BlockCloneEngine.cs | 4 +- .../Blocks/Engines/BlockEngine.cs | 13 +- .../Blocks/Engines/BlockEventsEngine.cs | 5 - .../Blocks/Engines/PlacementEngine.cs | 1 - TechbloxModdingAPI/EcsObjectBase.cs | 7 + .../Engines/IReactionaryEngine.cs | 2 +- TechbloxModdingAPI/Input/FakeInputPatch.cs | 2 +- .../SaveAndLoadCompositionRootPatch.cs | 2 +- TechbloxModdingAPI/Player.cs | 11 +- TechbloxModdingAPI/Players/PlayerEngine.cs | 15 +- .../Players/PlayerEventsEngine.cs | 1 + TechbloxModdingAPI/Players/PlayerState.cs | 9 + TechbloxModdingAPI/Players/PlayerTests.cs | 16 +- TechbloxModdingAPI/TechbloxModdingAPI.csproj | 176 ++++++++++++++++++ TechbloxModdingAPI/Tests/TestRoot.cs | 3 +- TechbloxModdingAPI/Utility/FullGameFields.cs | 4 +- TechbloxModdingAPI/Utility/WeakDictionary.cs | 6 +- 19 files changed, 252 insertions(+), 33 deletions(-) create mode 100644 TechbloxModdingAPI/Players/PlayerState.cs diff --git a/CodeGenerator/Program.cs b/CodeGenerator/Program.cs index 0e9dea5..708dd63 100644 --- a/CodeGenerator/Program.cs +++ b/CodeGenerator/Program.cs @@ -11,11 +11,11 @@ namespace CodeGenerator public static void Main(string[] args) { var bcg = new BlockClassGenerator(); - bcg.Generate("Engine", null, new Dictionary + /*bcg.Generate("Engine", null, new Dictionary { - { "engineOn", "On" } + { "engineOn", "On" } - TODO: Internal struct }, typeof(EngineBlockComponent), // Simulation time properties - typeof(EngineBlockTweakableComponent), typeof(EngineBlockReadonlyComponent)); + typeof(EngineBlockTweakableComponent), typeof(EngineBlockReadonlyComponent));*/ bcg.Generate("DampedSpring", "DAMPEDSPRING_BLOCK_GROUP", new Dictionary { {"maxExtent", "MaxExtension"} diff --git a/TechbloxModdingAPI/App/AntiAntiCheatPatch.cs b/TechbloxModdingAPI/App/AntiAntiCheatPatch.cs index ed249bf..d0aa1df 100644 --- a/TechbloxModdingAPI/App/AntiAntiCheatPatch.cs +++ b/TechbloxModdingAPI/App/AntiAntiCheatPatch.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using HarmonyLib; using Svelto.Tasks; +using Techblox.Anticheat.Client; namespace TechbloxModdingAPI.App { @@ -22,6 +23,7 @@ namespace TechbloxModdingAPI.App harmony.Patch(AccessTools.Method(type, "StopProtectedSession"), new HarmonyMethod(((AntiAnticheatDelegateBool) AntiAntiCheat).Method)); harmony.Patch(AccessTools.Method("Techblox.Services.Eos.Anticheat.Client.EosGetPendingMessagesToSendServiceRequest:Execute"), new HarmonyMethod(((AntiAnticheatDelegateTask)AntiAntiCheatTask).Method)); harmony.Patch(AccessTools.Method("Techblox.Anticheat.Client.Engines.ShowFeedbackDialogEngine:PollAnticheatStatus"), new HarmonyMethod(((AntiAnticheatDelegateTask)AntiAntiCheatTask).Method)); + harmony.Patch(AccessTools.Method(typeof(AnticheatClientCompositionRoot), "ClientComposeTimeRunning"), new HarmonyMethod(((Func)AntiAntiCheat).Method)); } private static bool AntiAntiCheat() => false; diff --git a/TechbloxModdingAPI/Blocks/Engines/BlockCloneEngine.cs b/TechbloxModdingAPI/Blocks/Engines/BlockCloneEngine.cs index a8cd39e..3d64280 100644 --- a/TechbloxModdingAPI/Blocks/Engines/BlockCloneEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/BlockCloneEngine.cs @@ -48,8 +48,8 @@ namespace TechbloxModdingAPI.Blocks.Engines pickedBlock.pickedBlockEntityID = sourceID; pickedBlock.placedBlockEntityID = targetID; pickedBlock.placedBlockTweaksMustCopy = true; - if (entitiesDB.Exists(pickedBlock.pickedBlockEntityID) - && entitiesDB.Exists(pickedBlock.placedBlockEntityID)) + if (entitiesDB.Exists(pickedBlock.pickedBlockEntityID) + && entitiesDB.Exists(pickedBlock.placedBlockEntityID)) { copyFromBlock.Invoke(Patch.copyEngine, new object[] {pickedBlock.ID, pickedBlock}); diff --git a/TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs b/TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs index c305f93..8cbf88d 100644 --- a/TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using System.Linq; using System.Reflection; @@ -79,6 +80,10 @@ namespace TechbloxModdingAPI.Blocks.Engines public ref T GetBlockInfo(Block block) where T : unmanaged, IEntityComponent { + #if DEBUG + if (!typeof(BlockTagEntityStruct).IsAssignableFrom(typeof(T)) && block.Exists && block.InitData.Valid) + throw new ArgumentException("The block exists but the init data has not been removed!"); + #endif return ref entitiesDB.QueryEntityOrDefault(block); } @@ -111,7 +116,7 @@ namespace TechbloxModdingAPI.Blocks.Engines : uint.MaxValue; if (prefabAssetID == uint.MaxValue) { - if (entitiesDB.QueryEntityOptional(block)) //The block exists + if (entitiesDB.QueryEntityOptional(block)) //The block exists throw new BlockException("Prefab asset ID not found for block " + block); //Set by the game return; } @@ -136,7 +141,7 @@ namespace TechbloxModdingAPI.Blocks.Engines public bool BlockExists(EGID blockID) { - return entitiesDB.Exists(blockID); + return entitiesDB.Exists(blockID); } public SimBody[] GetSimBodiesFromID(byte id) @@ -202,10 +207,10 @@ namespace TechbloxModdingAPI.Blocks.Engines public EGID? FindBlockEGID(uint id) { - var groups = entitiesDB.FindGroups(); + var groups = entitiesDB.FindGroups(); foreach (ExclusiveGroupStruct group in groups) { - if (entitiesDB.Exists(id, group)) + if (entitiesDB.Exists(id, group)) return new EGID(id, group); } diff --git a/TechbloxModdingAPI/Blocks/Engines/BlockEventsEngine.cs b/TechbloxModdingAPI/Blocks/Engines/BlockEventsEngine.cs index 4da3f65..4b7a514 100644 --- a/TechbloxModdingAPI/Blocks/Engines/BlockEventsEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/BlockEventsEngine.cs @@ -26,18 +26,13 @@ namespace TechbloxModdingAPI.Blocks.Engines public string Name { get; } = "TechbloxModdingAPIBlockEventsEngine"; public bool isRemovable { get; } = false; - private bool shouldAddRemove; public void Add(ref BlockTagEntityStruct entityComponent, EGID egid) { - if (!(shouldAddRemove = !shouldAddRemove)) - return; Placed.Invoke(this, new BlockPlacedRemovedEventArgs {ID = egid}); } public void Remove(ref BlockTagEntityStruct entityComponent, EGID egid) { - if (!(shouldAddRemove = !shouldAddRemove)) - return; Removed.Invoke(this, new BlockPlacedRemovedEventArgs {ID = egid}); } } diff --git a/TechbloxModdingAPI/Blocks/Engines/PlacementEngine.cs b/TechbloxModdingAPI/Blocks/Engines/PlacementEngine.cs index f4ea4c0..8f06ecc 100644 --- a/TechbloxModdingAPI/Blocks/Engines/PlacementEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/PlacementEngine.cs @@ -54,7 +54,6 @@ namespace TechbloxModdingAPI.Blocks.Engines //RobocraftX.CR.MachineEditing.PlaceSingleBlockEngine DBEntityStruct dbEntity = new DBEntityStruct {DBID = block}; - //TODO: Test EntityInitializer structInitializer = _blockEntityFactory.Build(CommonExclusiveGroups.blockIDGeneratorClient.Next(), block); //The ghost block index is only used for triggers uint prefabAssetID = structInitializer.Has() ? structInitializer.Get().prefabAssetID diff --git a/TechbloxModdingAPI/EcsObjectBase.cs b/TechbloxModdingAPI/EcsObjectBase.cs index ba42dc8..13a74f9 100644 --- a/TechbloxModdingAPI/EcsObjectBase.cs +++ b/TechbloxModdingAPI/EcsObjectBase.cs @@ -62,6 +62,13 @@ namespace TechbloxModdingAPI var id = initializer(this); if (!dict.ContainsKey(id)) // Multiple instances may be created dict.Add(id, this); + else + { + Logging.MetaDebugLog($"An object of this type and ID is already stored: {GetType()} - {id}"); + Logging.MetaDebugLog(this); + Logging.MetaDebugLog(dict[id]); + } + Id = id; } diff --git a/TechbloxModdingAPI/Engines/IReactionaryEngine.cs b/TechbloxModdingAPI/Engines/IReactionaryEngine.cs index d627866..739d626 100644 --- a/TechbloxModdingAPI/Engines/IReactionaryEngine.cs +++ b/TechbloxModdingAPI/Engines/IReactionaryEngine.cs @@ -14,7 +14,7 @@ namespace TechbloxModdingAPI.Engines /// /// Engine interface to handle ModEventEntityStruct events emitted by IEventEmitterEngines. /// - public interface IReactionaryEngine : IApiEngine, IReactOnAddAndRemove, IReactOnAddAndRemove where T : unmanaged, IEntityComponent + public interface IReactionaryEngine : IApiEngine, IReactOnAddAndRemove where T : unmanaged, IEntityComponent { } } diff --git a/TechbloxModdingAPI/Input/FakeInputPatch.cs b/TechbloxModdingAPI/Input/FakeInputPatch.cs index f1a3281..7168e05 100644 --- a/TechbloxModdingAPI/Input/FakeInputPatch.cs +++ b/TechbloxModdingAPI/Input/FakeInputPatch.cs @@ -13,7 +13,7 @@ namespace TechbloxModdingAPI.Input public static MethodBase TargetMethod() { - return AccessTools.Method("RobocraftX.Multiplayer.Input.NetworkInputRecorderEngine:RecordDeterministicInput"); + return AccessTools.Method("RobocraftX.Multiplayer.Input.DeterministicInputRecorderEngine:RecordDeterministicInput"); } } } \ No newline at end of file diff --git a/TechbloxModdingAPI/Persistence/SaveAndLoadCompositionRootPatch.cs b/TechbloxModdingAPI/Persistence/SaveAndLoadCompositionRootPatch.cs index b3ae6de..b9139a6 100644 --- a/TechbloxModdingAPI/Persistence/SaveAndLoadCompositionRootPatch.cs +++ b/TechbloxModdingAPI/Persistence/SaveAndLoadCompositionRootPatch.cs @@ -7,7 +7,7 @@ using HarmonyLib; namespace TechbloxModdingAPI.Persistence { - [HarmonyPatch(typeof(SaveAndLoadCompositionRoot), "Compose")] + [HarmonyPatch(typeof(SaveAndLoadCompositionRoot), "ServerCompose")] class SaveAndLoadCompositionRootPatch { public static EnginesRoot currentEnginesRoot; diff --git a/TechbloxModdingAPI/Player.cs b/TechbloxModdingAPI/Player.cs index 63d13e0..e50a29f 100644 --- a/TechbloxModdingAPI/Player.cs +++ b/TechbloxModdingAPI/Player.cs @@ -71,7 +71,7 @@ namespace TechbloxModdingAPI get { if (localPlayer == null || localPlayer.Id != playerEngine.GetLocalPlayer()) - localPlayer = new Player(PlayerType.Local); + localPlayer = GetInstance(playerEngine.GetLocalPlayer()); return localPlayer; } } @@ -363,6 +363,15 @@ namespace TechbloxModdingAPI public PlayerBuildingMode BuildingMode => (PlayerBuildingMode)Math.Log((double)playerEngine .GetCharacterStruct(Id).Get().timeStoppedContext, 2); // It's a bit field in game now + public PlayerState State => + playerEngine.GetCharacterStruct(Id).Get().ID.groupID switch + { + var group when group == CharacterExclusiveGroups.MachineSpawningGroup => PlayerState.HoldingMachine, + var group when group == CharacterExclusiveGroups.OnFootGroup => PlayerState.OnFoot, + var group when group == CharacterExclusiveGroups.InPilotSeatGroup => PlayerState.InSeat, + _ => throw new ArgumentOutOfRangeException("", "Unknown player state") + }; + /// /// Whether the player is sprinting. /// diff --git a/TechbloxModdingAPI/Players/PlayerEngine.cs b/TechbloxModdingAPI/Players/PlayerEngine.cs index bf9c548..b6e38b1 100644 --- a/TechbloxModdingAPI/Players/PlayerEngine.cs +++ b/TechbloxModdingAPI/Players/PlayerEngine.cs @@ -9,16 +9,14 @@ using RobocraftX.CR.MachineEditing.BoxSelect; using RobocraftX.Physics; using RobocraftX.Blocks.Ghost; using Gamecraft.GUI.HUDFeedbackBlocks; -using RobocraftX.Blocks; using RobocraftX.Multiplayer; -using RobocraftX.PilotSeat; using RobocraftX.SimulationModeState; using Svelto.ECS; using Techblox.Camera; using Unity.Mathematics; using Svelto.ECS.DataStructures; -using Svelto.ECS.EntityStructs; using Techblox.BuildingDrone; +using Techblox.Character; using TechbloxModdingAPI.Engines; using TechbloxModdingAPI.Input; @@ -209,9 +207,9 @@ namespace TechbloxModdingAPI.Players { if (!TimeRunningModeUtil.IsTimeRunningMode(entitiesDB)) return; - PilotSeatGroupUtils.SwapTagTo(Functions, seatId); + /*PilotSeatGroupUtils.SwapTagTo(Functions, seatId); var opt = GetCharacterStruct(playerId, out var group); - if (!opt) return; + if (!opt) return; - TODO: This is server code and mods run in client code atm. We can only send inputs even in singleplayer as it is. ref CharacterPilotSeatEntityStruct charSeat = ref opt.Get(); var charId = new EGID(playerId, group); charSeat.pilotSeatEntity = entitiesDB.GetEntityReference(seatId); @@ -221,7 +219,7 @@ namespace TechbloxModdingAPI.Players ref var seat = ref entitiesDB.QueryEntity(seatId); seat.occupyingCharacter = entitiesDB.GetEntityReference(charId); charSeat.followCam = entitiesDB.QueryEntity(seatId).followCam; - Functions.SwapEntityGroup(charId, CharacterExclusiveGroups.InPilotSeatGroup); + Functions.SwapEntityGroup(charId, CharacterExclusiveGroups.InPilotSeatGroup);*/ } public void ExitSeat(uint playerId) @@ -242,6 +240,11 @@ namespace TechbloxModdingAPI.Players EGID egid = new EGID(playerId, CharacterExclusiveGroups.MachineSpawningGroup); if (!entitiesDB.Exists(egid)) return false; + if (entitiesDB.QueryEntity(egid).isMachinePlacementInvalid) + { + Logging.MetaDebugLog("Machine placement invalid"); + return false; + } //Functions.SwapEntityGroup(egid, CharacterExclusiveGroups.OnFootGroup); FakeInput.ActionInput(playerId, primary: true); return true; diff --git a/TechbloxModdingAPI/Players/PlayerEventsEngine.cs b/TechbloxModdingAPI/Players/PlayerEventsEngine.cs index 4461b71..cf90c40 100644 --- a/TechbloxModdingAPI/Players/PlayerEventsEngine.cs +++ b/TechbloxModdingAPI/Players/PlayerEventsEngine.cs @@ -1,3 +1,4 @@ +using System; using RobocraftX.Character; using RobocraftX.Character.Movement; using RobocraftX.Common.Input; diff --git a/TechbloxModdingAPI/Players/PlayerState.cs b/TechbloxModdingAPI/Players/PlayerState.cs new file mode 100644 index 0000000..6ec6cbd --- /dev/null +++ b/TechbloxModdingAPI/Players/PlayerState.cs @@ -0,0 +1,9 @@ +namespace TechbloxModdingAPI.Players +{ + public enum PlayerState + { + HoldingMachine, + OnFoot, + InSeat + } +} \ No newline at end of file diff --git a/TechbloxModdingAPI/Players/PlayerTests.cs b/TechbloxModdingAPI/Players/PlayerTests.cs index 1fc4f49..9f3de75 100644 --- a/TechbloxModdingAPI/Players/PlayerTests.cs +++ b/TechbloxModdingAPI/Players/PlayerTests.cs @@ -29,7 +29,7 @@ namespace TechbloxModdingAPI.Players [APITestCase(TestType.EditMode)] public static void PositionTest() { - Player p = new Player(PlayerType.Local); + Player p = Player.LocalPlayer; if (!Assert.Errorless(() => { p.Teleport(0, 0, 0, relative: false); }, "Player.Teleport(origin) errored: ", "Player teleported to origin successfully.")) return; if (!Assert.CloseTo(p.Position, float3.zero, "Player is not close to origin despite being teleported there.", "Player.Position is at origin.")) return; if (!Assert.Errorless(() => { p.Position = float3.zero + 1; }, "Player.Position = origin+1 errored: ", "Player moved to origin+1.")) return; @@ -41,7 +41,7 @@ namespace TechbloxModdingAPI.Players { Player.LocalPlayer.SeatEntered += Assert.CallsBack("SeatEntered"); Player.LocalPlayer.SeatExited += Assert.CallsBack("SeatExited"); - Block.PlaceNew(BlockIDs.DriverSeat, -1f); + Block.PlaceNew(BlockIDs.DriverSeat, Player.LocalPlayer.Position); } [APITestCase(TestType.SimulationMode)] @@ -68,11 +68,21 @@ namespace TechbloxModdingAPI.Players } if (seats[0] is Seat seat) + { //TODO: Actually, the problem is likely that the player ID is different in build and sim Assert.Errorless(() => Player.LocalPlayer.EnterSeat(seat), "Failed to enter seat.", "Entered seat successfully."); + while (Player.LocalPlayer.State != PlayerState.InSeat) + { + bool cont = false; + Client.Instance.PromptUser(new SingleChoicePrompt("Testing", $"Enter the seat at {seat.Position} pls", "OK", () => cont = true)); + while (!cont) + yield return Yield.It; + yield return new WaitForSecondsEnumerator(5f).Continue(); + } + } else Assert.Fail("Found a seat that is not a seat!"); - yield return new WaitForSecondsEnumerator(1).Continue(); + yield return new WaitForSecondsEnumerator(5).Continue(); Assert.Errorless(() => Player.LocalPlayer.ExitSeat(), "Failed to exit seat.", "Exited seat successfully."); } diff --git a/TechbloxModdingAPI/TechbloxModdingAPI.csproj b/TechbloxModdingAPI/TechbloxModdingAPI.csproj index 6fe520b..c26813f 100644 --- a/TechbloxModdingAPI/TechbloxModdingAPI.csproj +++ b/TechbloxModdingAPI/TechbloxModdingAPI.csproj @@ -48,6 +48,14 @@ ..\ref\Techblox_Data\Managed\Assembly-CSharp.dll ..\..\ref\Techblox_Data\Managed\Assembly-CSharp.dll + + ..\ref\Techblox_Data\Managed\AWSSDK.Core.dll + ..\..\ref\Techblox_Data\Managed\AWSSDK.Core.dll + + + ..\ref\Techblox_Data\Managed\AWSSDK.GameLift.dll + ..\..\ref\Techblox_Data\Managed\AWSSDK.GameLift.dll + ..\ref\Techblox_Data\Managed\BevelEffect.dll ..\..\ref\Techblox_Data\Managed\BevelEffect.dll @@ -88,6 +96,10 @@ ..\ref\Techblox_Data\Managed\FMODUnityResonance.dll ..\..\ref\Techblox_Data\Managed\FMODUnityResonance.dll + + ..\ref\Techblox_Data\Managed\FMODUnityWrapperClient.dll + ..\..\ref\Techblox_Data\Managed\FMODUnityWrapperClient.dll + ..\ref\Techblox_Data\Managed\FullGame.dll ..\..\ref\Techblox_Data\Managed\FullGame.dll @@ -312,6 +324,10 @@ ..\ref\Techblox_Data\Managed\Gamecraft.Wires.Mockup.dll ..\..\ref\Techblox_Data\Managed\Gamecraft.Wires.Mockup.dll + + ..\ref\Techblox_Data\Managed\GameLiftServerSDKNet45.dll + ..\..\ref\Techblox_Data\Managed\GameLiftServerSDKNet45.dll + ..\ref\Techblox_Data\Managed\GameState.dll ..\..\ref\Techblox_Data\Managed\GameState.dll @@ -320,6 +336,10 @@ ..\ref\Techblox_Data\Managed\GhostShark.Outline.dll ..\..\ref\Techblox_Data\Managed\GhostShark.Outline.dll + + ..\ref\Techblox_Data\Managed\Google.Protobuf.dll + ..\..\ref\Techblox_Data\Managed\Google.Protobuf.dll + ..\ref\Techblox_Data\Managed\GPUInstancer.CrowdAnimations.dll ..\..\ref\Techblox_Data\Managed\GPUInstancer.CrowdAnimations.dll @@ -340,10 +360,22 @@ ..\ref\Techblox_Data\Managed\JWT.dll ..\..\ref\Techblox_Data\Managed\JWT.dll + + ..\ref\Techblox_Data\Managed\LiteNetLib.dll + ..\..\ref\Techblox_Data\Managed\LiteNetLib.dll + + + ..\ref\Techblox_Data\Managed\log4net.dll + ..\..\ref\Techblox_Data\Managed\log4net.dll + ..\ref\Techblox_Data\Managed\LZ4.dll ..\..\ref\Techblox_Data\Managed\LZ4.dll + + ..\ref\Techblox_Data\Managed\Monobehaviours.dll + ..\..\ref\Techblox_Data\Managed\Monobehaviours.dll + ..\ref\Techblox_Data\Managed\mscorlib.dll ..\..\ref\Techblox_Data\Managed\mscorlib.dll @@ -376,6 +408,10 @@ ..\ref\Techblox_Data\Managed\Rewired_Windows.dll ..\..\ref\Techblox_Data\Managed\Rewired_Windows.dll + + ..\ref\Techblox_Data\Managed\RichFX.dll + ..\..\ref\Techblox_Data\Managed\RichFX.dll + ..\ref\Techblox_Data\Managed\RobocraftECS.dll ..\..\ref\Techblox_Data\Managed\RobocraftECS.dll @@ -404,6 +440,10 @@ ..\ref\Techblox_Data\Managed\RobocraftX.Building.Jobs.dll ..\..\ref\Techblox_Data\Managed\RobocraftX.Building.Jobs.dll + + ..\ref\Techblox_Data\Managed\RobocraftX.Character.Audio.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.Character.Audio.dll + ..\ref\Techblox_Data\Managed\RobocraftX.Character.dll ..\..\ref\Techblox_Data\Managed\RobocraftX.Character.dll @@ -480,6 +520,10 @@ ..\ref\Techblox_Data\Managed\RobocraftX.MainGameMock.dll ..\..\ref\Techblox_Data\Managed\RobocraftX.MainGameMock.dll + + ..\ref\Techblox_Data\Managed\RobocraftX.MainSimulation.Audio.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.MainSimulation.Audio.dll + ..\ref\Techblox_Data\Managed\RobocraftX.MainSimulation.dll ..\..\ref\Techblox_Data\Managed\RobocraftX.MainSimulation.dll @@ -564,6 +608,10 @@ ..\ref\Techblox_Data\Managed\RobocratX.SimulationMockCompositionRoot.dll ..\..\ref\Techblox_Data\Managed\RobocratX.SimulationMockCompositionRoot.dll + + ..\ref\Techblox_Data\Managed\ShaderVariantsGenerationTool.dll + ..\..\ref\Techblox_Data\Managed\ShaderVariantsGenerationTool.dll + ..\ref\Techblox_Data\Managed\SpecializedDescriptors.dll ..\..\ref\Techblox_Data\Managed\SpecializedDescriptors.dll @@ -592,6 +640,22 @@ ..\ref\Techblox_Data\Managed\Svelto.Tasks.dll ..\..\ref\Techblox_Data\Managed\Svelto.Tasks.dll + + ..\ref\Techblox_Data\Managed\Techblox.AdditionalParts.dll + ..\..\ref\Techblox_Data\Managed\Techblox.AdditionalParts.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Anticheat.Client.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Anticheat.Client.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Anticheat.Common.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Anticheat.Common.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Anticheat.Server.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Anticheat.Server.dll + ..\ref\Techblox_Data\Managed\Techblox.AtmosphereBlock.dll ..\..\ref\Techblox_Data\Managed\Techblox.AtmosphereBlock.dll @@ -604,6 +668,18 @@ ..\ref\Techblox_Data\Managed\Techblox.Backend.dll ..\..\ref\Techblox_Data\Managed\Techblox.Backend.dll + + ..\ref\Techblox_Data\Managed\Techblox.BitBlock.dll + ..\..\ref\Techblox_Data\Managed\Techblox.BitBlock.dll + + + ..\ref\Techblox_Data\Managed\Techblox.BlockColours.dll + ..\..\ref\Techblox_Data\Managed\Techblox.BlockColours.dll + + + ..\ref\Techblox_Data\Managed\Techblox.BlockLabels.dll + ..\..\ref\Techblox_Data\Managed\Techblox.BlockLabels.dll + ..\ref\Techblox_Data\Managed\Techblox.Blocks.LightBlock.dll ..\..\ref\Techblox_Data\Managed\Techblox.Blocks.LightBlock.dll @@ -620,10 +696,18 @@ ..\ref\Techblox_Data\Managed\Techblox.Camera.dll ..\..\ref\Techblox_Data\Managed\Techblox.Camera.dll + + ..\ref\Techblox_Data\Managed\Techblox.Common.Audio.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Common.Audio.dll + ..\ref\Techblox_Data\Managed\Techblox.ContextSensitiveTextHint.dll ..\..\ref\Techblox_Data\Managed\Techblox.ContextSensitiveTextHint.dll + + ..\ref\Techblox_Data\Managed\Techblox.ECSResourceManagers.dll + ..\..\ref\Techblox_Data\Managed\Techblox.ECSResourceManagers.dll + ..\ref\Techblox_Data\Managed\Techblox.EngineBlock.dll ..\..\ref\Techblox_Data\Managed\Techblox.EngineBlock.dll @@ -660,6 +744,14 @@ ..\ref\Techblox_Data\Managed\Techblox.GUI.BuildRules.MockUps.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.BuildRules.MockUps.dll + + ..\ref\Techblox_Data\Managed\Techblox.GUI.Commands.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Commands.dll + + + ..\ref\Techblox_Data\Managed\Techblox.GUI.Controls.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Controls.dll + ..\ref\Techblox_Data\Managed\Techblox.GUI.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.dll @@ -692,6 +784,10 @@ ..\ref\Techblox_Data\Managed\Techblox.GUI.Inventory.Materials.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Inventory.Materials.dll + + ..\ref\Techblox_Data\Managed\Techblox.GUI.LoadingBar.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.LoadingBar.dll + ..\ref\Techblox_Data\Managed\Techblox.GUI.Login.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Login.dll @@ -712,6 +808,10 @@ ..\ref\Techblox_Data\Managed\Techblox.GUI.Notifications.MockUps.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Notifications.MockUps.dll + + ..\ref\Techblox_Data\Managed\Techblox.GUI.ScreenCanvas.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.ScreenCanvas.dll + ..\ref\Techblox_Data\Managed\Techblox.GUI.TabsBar.Landscapes.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.TabsBar.Landscapes.dll @@ -720,10 +820,38 @@ ..\ref\Techblox_Data\Managed\Techblox.GUI.TabsBar.Materials.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.TabsBar.Materials.dll + + ..\ref\Techblox_Data\Managed\Techblox.GUI.UsernameDisplay.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.UsernameDisplay.dll + + + ..\ref\Techblox_Data\Managed\Techblox.GUI.WorldCanvas.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.WorldCanvas.dll + ..\ref\Techblox_Data\Managed\Techblox.InputCapture.dll ..\..\ref\Techblox_Data\Managed\Techblox.InputCapture.dll + + ..\ref\Techblox_Data\Managed\Techblox.MachineSimulationPreprocessing.dll + ..\..\ref\Techblox_Data\Managed\Techblox.MachineSimulationPreprocessing.dll + + + ..\ref\Techblox_Data\Managed\Techblox.MachineSpawning.dll + ..\..\ref\Techblox_Data\Managed\Techblox.MachineSpawning.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Matchmaking.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Matchmaking.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Multiplayer.UsernameMessages.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Multiplayer.UsernameMessages.dll + + + ..\ref\Techblox_Data\Managed\Techblox.PlayUX.dll + ..\..\ref\Techblox_Data\Managed\Techblox.PlayUX.dll + ..\ref\Techblox_Data\Managed\Techblox.Pointer.dll ..\..\ref\Techblox_Data\Managed\Techblox.Pointer.dll @@ -756,22 +884,66 @@ ..\ref\Techblox_Data\Managed\Techblox.SaveGamesConversion.dll ..\..\ref\Techblox_Data\Managed\Techblox.SaveGamesConversion.dll + + ..\ref\Techblox_Data\Managed\Techblox.Server.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Server.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Services.Anticheat.Client.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Services.Anticheat.Client.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Services.Anticheat.Server.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Services.Anticheat.Server.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Services.Eos.Common.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Services.Eos.Common.dll + ..\ref\Techblox_Data\Managed\Techblox.Services.Eos.dll ..\..\ref\Techblox_Data\Managed\Techblox.Services.Eos.dll + + ..\ref\Techblox_Data\Managed\Techblox.Services.Eos.Server.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Services.Eos.Server.dll + ..\ref\Techblox_Data\Managed\Techblox.Services.GameDetails.dll ..\..\ref\Techblox_Data\Managed\Techblox.Services.GameDetails.dll + + ..\ref\Techblox_Data\Managed\Techblox.Services.LocalPreferences.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Services.LocalPreferences.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Services.Matchmaking.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Services.Matchmaking.dll + ..\ref\Techblox_Data\Managed\Techblox.Services.Storage.dll ..\..\ref\Techblox_Data\Managed\Techblox.Services.Storage.dll + + ..\ref\Techblox_Data\Managed\Techblox.SignalHandling.Audio.dll + ..\..\ref\Techblox_Data\Managed\Techblox.SignalHandling.Audio.dll + + + ..\ref\Techblox_Data\Managed\Techblox.SignalHandling.Common.dll + ..\..\ref\Techblox_Data\Managed\Techblox.SignalHandling.Common.dll + ..\ref\Techblox_Data\Managed\Techblox.SwitchAnimation.dll ..\..\ref\Techblox_Data\Managed\Techblox.SwitchAnimation.dll + + ..\ref\Techblox_Data\Managed\Techblox.TextBlock.dll + ..\..\ref\Techblox_Data\Managed\Techblox.TextBlock.dll + + + ..\ref\Techblox_Data\Managed\Techblox.TimerBlock.dll + ..\..\ref\Techblox_Data\Managed\Techblox.TimerBlock.dll + ..\ref\Techblox_Data\Managed\Techblox.WheelRigBlock.dll ..\..\ref\Techblox_Data\Managed\Techblox.WheelRigBlock.dll @@ -1228,6 +1400,10 @@ ..\ref\Techblox_Data\Managed\VisualProfiler.dll ..\..\ref\Techblox_Data\Managed\VisualProfiler.dll + + ..\ref\Techblox_Data\Managed\websocket-sharp.dll + ..\..\ref\Techblox_Data\Managed\websocket-sharp.dll + ..\ref\Techblox_Data\Managed\Whinarn.UnityMeshSimplifier.Runtime.dll ..\..\ref\Techblox_Data\Managed\Whinarn.UnityMeshSimplifier.Runtime.dll diff --git a/TechbloxModdingAPI/Tests/TestRoot.cs b/TechbloxModdingAPI/Tests/TestRoot.cs index bffae51..648d029 100644 --- a/TechbloxModdingAPI/Tests/TestRoot.cs +++ b/TechbloxModdingAPI/Tests/TestRoot.cs @@ -200,7 +200,8 @@ namespace TechbloxModdingAPI.Tests cont = false; } - yield return Yield.It; + if (cont) + yield return enumerator.Current; } while (cont); } diff --git a/TechbloxModdingAPI/Utility/FullGameFields.cs b/TechbloxModdingAPI/Utility/FullGameFields.cs index de9f487..f9eb6d1 100644 --- a/TechbloxModdingAPI/Utility/FullGameFields.cs +++ b/TechbloxModdingAPI/Utility/FullGameFields.cs @@ -122,11 +122,11 @@ namespace TechbloxModdingAPI.Utility } } - public static ECSResourceManagers _managers + public static ECSMainGameResourceManagers _managers { get { - return (ECSResourceManagers)fgcr?.Field("_managers").GetValue(); + return (ECSMainGameResourceManagers)fgcr?.Field("_gameManagers").GetValue(); } } diff --git a/TechbloxModdingAPI/Utility/WeakDictionary.cs b/TechbloxModdingAPI/Utility/WeakDictionary.cs index 287b044..35e55a5 100644 --- a/TechbloxModdingAPI/Utility/WeakDictionary.cs +++ b/TechbloxModdingAPI/Utility/WeakDictionary.cs @@ -54,7 +54,7 @@ namespace TechbloxModdingAPI.Utility public bool ContainsKey(TKey key) { - return _dictionary.ContainsKey(key); + return TryGetValue(key, out _); } public void Add(TKey key, TValue value) @@ -70,7 +70,9 @@ namespace TechbloxModdingAPI.Utility public bool TryGetValue(TKey key, out TValue value) { value = null; - return _dictionary.TryGetValue(key, out var reference) && reference.TryGetTarget(out value); + bool ret = _dictionary.TryGetValue(key, out var reference) && reference.TryGetTarget(out value); + if (!ret) _dictionary.Remove(key); + return ret; } public TValue this[TKey key] -- 2.30.2 From 4684b33c6949d84ee1adb8c591cffdafa4395d22 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Mon, 31 Jan 2022 23:20:03 +0100 Subject: [PATCH 229/252] Fix tests, getting machine blocks, block labels and visuals - Checking the material property again, it seems to work now - Fixed the Seat events not triggering during tests (the player in build and in sim is different) - Fixed Game.GetAllBlocksInGame() returning environment blocks (since a Game refers to a machine save) - Fixed the Block.Label property - Fixed the block visuals not being updated after applying changes --- TechbloxModdingAPI/App/GameBuildSimEventEngine.cs | 2 -- TechbloxModdingAPI/App/GameGameEngine.cs | 3 ++- TechbloxModdingAPI/Block.cs | 10 ++++++++-- TechbloxModdingAPI/Blocks/BlockTests.cs | 7 ------- TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs | 1 + TechbloxModdingAPI/Player.cs | 2 +- TechbloxModdingAPI/Players/PlayerEngine.cs | 4 ++-- TechbloxModdingAPI/Players/PlayerTests.cs | 9 ++++----- 8 files changed, 18 insertions(+), 20 deletions(-) diff --git a/TechbloxModdingAPI/App/GameBuildSimEventEngine.cs b/TechbloxModdingAPI/App/GameBuildSimEventEngine.cs index 1846dd2..67e6769 100644 --- a/TechbloxModdingAPI/App/GameBuildSimEventEngine.cs +++ b/TechbloxModdingAPI/App/GameBuildSimEventEngine.cs @@ -27,14 +27,12 @@ namespace TechbloxModdingAPI.App public JobHandle OnInitializeTimeRunningMode(JobHandle inputDeps) { - Console.WriteLine("Init time running mode"); SimulationMode.Invoke(this, new GameEventArgs { GameName = "", GamePath = "" }); // TODO return inputDeps; } public JobHandle OnInitializeTimeStoppedMode(JobHandle inputDeps) { - Console.WriteLine("Init time stopped mode"); BuildMode.Invoke(this, new GameEventArgs { GameName = "", GamePath = "" }); return inputDeps; } diff --git a/TechbloxModdingAPI/App/GameGameEngine.cs b/TechbloxModdingAPI/App/GameGameEngine.cs index 9856da8..1431eb4 100644 --- a/TechbloxModdingAPI/App/GameGameEngine.cs +++ b/TechbloxModdingAPI/App/GameGameEngine.cs @@ -150,7 +150,8 @@ namespace TechbloxModdingAPI.App dbid = (uint)filter; else dbid = entitiesDB.QueryEntity(buffer[i].ID).DBID; - if (dbid == (ulong)filter) + var ownership = entitiesDB.QueryEntity(buffer[i].ID).BlockOwnership; + if ((ownership & BlockOwnership.User) != 0 && dbid == (ulong)filter) blockEGIDs.Add(buffer[i].ID); } } diff --git a/TechbloxModdingAPI/Block.cs b/TechbloxModdingAPI/Block.cs index 7cead56..391ee62 100644 --- a/TechbloxModdingAPI/Block.cs +++ b/TechbloxModdingAPI/Block.cs @@ -340,9 +340,15 @@ namespace TechbloxModdingAPI [TestValue(null)] public string Label { - get => BlockEngine.GetBlockInfo(this).ToString(); //TODO: Block labels + get + { + var opt = BlockEngine.GetBlockInfoOptional(this); + return opt ? FullGameFields._managers.blockLabelResourceManager.GetText(opt.Get().instanceID) : null; + } set - { //TODO + { + var opt = BlockEngine.GetBlockInfoOptional(this); + if (opt) FullGameFields._managers.blockLabelResourceManager.SetText(opt.Get().instanceID, value); } } diff --git a/TechbloxModdingAPI/Blocks/BlockTests.cs b/TechbloxModdingAPI/Blocks/BlockTests.cs index 4bc29db..e58387e 100644 --- a/TechbloxModdingAPI/Blocks/BlockTests.cs +++ b/TechbloxModdingAPI/Blocks/BlockTests.cs @@ -87,13 +87,6 @@ namespace TechbloxModdingAPI.Blocks if (!block.Exists) continue; foreach (var property in block.GetType().GetProperties()) { - if (property.Name == "Material" || property.Name == "Flipped") continue; // TODO: Crashes in game - if (property.Name == "Material" || property.Name == "Flipped") - { - Console.WriteLine("Block type: "+block.Type); - Console.WriteLine("Will set " + property.Name); - yield return new WaitForSecondsEnumerator(1).Continue(); - } //Includes specialised block properties if (property.SetMethod == null) continue; var testValues = new (Type, object, Predicate)[] diff --git a/TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs b/TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs index 8cbf88d..baea454 100644 --- a/TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs @@ -106,6 +106,7 @@ namespace TechbloxModdingAPI.Blocks.Engines var skew = entitiesDB.QueryEntity(id); entitiesDB.QueryEntity(id).matrix = math.mul(float4x4.TRS(pos.position, rot.rotation, scale.scale), skew.skewMatrix); + entitiesDB.PublishEntityChange(id); // Signal a prefab change so it updates the render buffers } internal void UpdatePrefab(Block block, byte material, bool flipped) diff --git a/TechbloxModdingAPI/Player.cs b/TechbloxModdingAPI/Player.cs index e50a29f..635bb74 100644 --- a/TechbloxModdingAPI/Player.cs +++ b/TechbloxModdingAPI/Player.cs @@ -64,7 +64,7 @@ namespace TechbloxModdingAPI } /// - /// Returns the current player belonging to this client. + /// Returns the current player belonging to this client. It will be different after entering/leaving simulation. /// public static Player LocalPlayer { diff --git a/TechbloxModdingAPI/Players/PlayerEngine.cs b/TechbloxModdingAPI/Players/PlayerEngine.cs index b6e38b1..d5feaf5 100644 --- a/TechbloxModdingAPI/Players/PlayerEngine.cs +++ b/TechbloxModdingAPI/Players/PlayerEngine.cs @@ -226,11 +226,11 @@ namespace TechbloxModdingAPI.Players { if (!TimeRunningModeUtil.IsTimeRunningMode(entitiesDB)) return; - EGID egid = new EGID(playerId, CharacterExclusiveGroups.InPilotSeatGroup); + /*EGID egid = new EGID(playerId, CharacterExclusiveGroups.InPilotSeatGroup); var opt = entitiesDB.QueryEntityOptional(egid); if (!opt) return; opt.Get().instantExit = true; - entitiesDB.PublishEntityChange(egid); + entitiesDB.PublishEntityChange(egid);*/ } public bool SpawnMachine(uint playerId) diff --git a/TechbloxModdingAPI/Players/PlayerTests.cs b/TechbloxModdingAPI/Players/PlayerTests.cs index 9f3de75..32e9c14 100644 --- a/TechbloxModdingAPI/Players/PlayerTests.cs +++ b/TechbloxModdingAPI/Players/PlayerTests.cs @@ -39,15 +39,14 @@ namespace TechbloxModdingAPI.Players [APITestCase(TestType.Game)] public static void SeatEventTestBuild() { - Player.LocalPlayer.SeatEntered += Assert.CallsBack("SeatEntered"); - Player.LocalPlayer.SeatExited += Assert.CallsBack("SeatExited"); Block.PlaceNew(BlockIDs.DriverSeat, Player.LocalPlayer.Position); } [APITestCase(TestType.SimulationMode)] public static IEnumerator SeatEventTestSim() { - yield return new WaitForSecondsEnumerator(1).Continue(); + Player.LocalPlayer.SeatEntered += Assert.CallsBack("SeatEntered"); + Player.LocalPlayer.SeatExited += Assert.CallsBack("SeatExited"); Assert.Equal(Player.LocalPlayer.SpawnMachine(), true, "Failed to spawn the player's machine.", "Successfully spawned the player's machine."); yield return new WaitForSecondsEnumerator(1).Continue(); var seats = Game.CurrentGame().GetBlocksInGame(BlockIDs.DriverSeat); @@ -56,7 +55,7 @@ namespace TechbloxModdingAPI.Players { Logging.MetaLog("Waiting for a seat to be spawned..."); yield return new WaitForSecondsEnumerator(1).Continue(); - Console.WriteLine("Spawn machine: " + Player.LocalPlayer.SpawnMachine()); + Logging.MetaLog("Spawn machine: " + Player.LocalPlayer.SpawnMachine()); seats = Game.CurrentGame().GetBlocksInGame(BlockIDs.DriverSeat); c++; } @@ -68,7 +67,7 @@ namespace TechbloxModdingAPI.Players } if (seats[0] is Seat seat) - { //TODO: Actually, the problem is likely that the player ID is different in build and sim + { Assert.Errorless(() => Player.LocalPlayer.EnterSeat(seat), "Failed to enter seat.", "Entered seat successfully."); while (Player.LocalPlayer.State != PlayerState.InSeat) -- 2.30.2 From 5fea7dc3b3a9bb787dea52cb473537bf9857df74 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sun, 6 Feb 2022 03:11:51 +0100 Subject: [PATCH 230/252] Add support for generating block classes that use reflection to access internal components Added Engine properties again --- CodeGenerator/App.config | 10 +++ CodeGenerator/BlockClassGenerator.cs | 32 ++++++--- CodeGenerator/CodeGenerator.csproj | 14 ++++ CodeGenerator/Program.cs | 9 +-- CodeGenerator/packages.config | 4 ++ TechbloxModdingAPI/Blocks/Engine.cs | 65 +++++++++---------- .../Blocks/Engines/BlockEngine.cs | 14 ++++ 7 files changed, 103 insertions(+), 45 deletions(-) create mode 100644 CodeGenerator/App.config create mode 100644 CodeGenerator/packages.config diff --git a/CodeGenerator/App.config b/CodeGenerator/App.config new file mode 100644 index 0000000..1fe7c1f --- /dev/null +++ b/CodeGenerator/App.config @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/CodeGenerator/BlockClassGenerator.cs b/CodeGenerator/BlockClassGenerator.cs index c2307a0..a56b222 100644 --- a/CodeGenerator/BlockClassGenerator.cs +++ b/CodeGenerator/BlockClassGenerator.cs @@ -8,7 +8,6 @@ using System.Reflection; using Gamecraft.Tweaks; using RobocraftX.Common; using Svelto.ECS; -using Techblox.EngineBlock; namespace CodeGenerator { @@ -97,6 +96,8 @@ namespace CodeGenerator { if (!typeof(IEntityComponent).IsAssignableFrom(type)) throw new ArgumentException("Type must be an entity component"); + bool reflection = type.IsNotPublic; + var reflectedType = new CodeSnippetExpression($"HarmonyLib.AccessTools.TypeByName(\"{type.FullName}\")"); foreach (var field in type.GetFields()) { var attr = field.GetCustomAttribute(); @@ -108,10 +109,20 @@ namespace CodeGenerator } propName = char.ToUpper(propName[0]) + propName.Substring(1); - var structFieldReference = new CodeFieldReferenceExpression(new CodeMethodInvokeExpression( + var getStruct = new CodeMethodInvokeExpression( + new CodeMethodReferenceExpression(new CodeSnippetExpression("BlockEngine"), + "GetBlockInfo", new CodeTypeReference(type)), + new CodeThisReferenceExpression()); + CodeExpression structFieldReference = new CodeFieldReferenceExpression(getStruct, field.Name); + CodeExpression reflectedGet = new CodeCastExpression(field.FieldType, new CodeMethodInvokeExpression( new CodeMethodReferenceExpression(new CodeSnippetExpression("BlockEngine"), - "GetBlockInfo", new CodeTypeReference(type)), - new CodeThisReferenceExpression()), field.Name); + "GetBlockInfo"), + new CodeThisReferenceExpression(), reflectedType, new CodePrimitiveExpression(field.Name))); + CodeExpression reflectedSet = new CodeMethodInvokeExpression( + new CodeMethodReferenceExpression(new CodeSnippetExpression("BlockEngine"), + "SetBlockInfo"), + new CodeThisReferenceExpression(), reflectedType, new CodePrimitiveExpression(field.Name), + new CodePropertySetValueReferenceExpression()); cl.Members.Add(new CodeMemberProperty { Name = propName, @@ -119,18 +130,23 @@ namespace CodeGenerator HasSet = true, GetStatements = { - new CodeMethodReturnStatement(structFieldReference) + new CodeMethodReturnStatement(reflection ? reflectedGet : structFieldReference) }, SetStatements = { - new CodeAssignStatement(structFieldReference, new CodePropertySetValueReferenceExpression()) + reflection + ? (CodeStatement)new CodeExpressionStatement(reflectedSet) + : new CodeAssignStatement(structFieldReference, new CodePropertySetValueReferenceExpression()) }, Type = new CodeTypeReference(field.FieldType), Attributes = MemberAttributes.Public | MemberAttributes.Final, Comments = { - _start, new CodeCommentStatement($"Gets or sets the {baseClass}'s {propName} property." + - $" {(attr != null ? "Tweakable stat." : "May not be saved.")}", true), _end + _start, + new CodeCommentStatement($"Gets or sets the {baseClass}'s {propName} property." + + $" {(attr != null ? "Tweakable stat." : "May not be saved.")}", + true), + _end } }); } diff --git a/CodeGenerator/CodeGenerator.csproj b/CodeGenerator/CodeGenerator.csproj index f657a48..9de07d8 100644 --- a/CodeGenerator/CodeGenerator.csproj +++ b/CodeGenerator/CodeGenerator.csproj @@ -32,6 +32,10 @@ 4 + + ..\packages\Lib.Harmony.2.2.0\lib\net472\0Harmony.dll + True + @@ -1164,6 +1168,16 @@ ..\..\ref\Techblox_Data\Managed\VisualProfiler.dll + + + + + + + {7fd5a7d8-4f3e-426a-b07d-7dc70442a4df} + TechbloxModdingAPI + + - - ..\ref\Techblox_Data\Managed\IllusionInjector.dll - ..\..\ref\Techblox_Data\Managed\IllusionInjector.dll - - - ..\ref\Techblox_Data\Managed\IllusionPlugin.dll - ..\..\ref\Techblox_Data\Managed\IllusionPlugin.dll - ..\ref\Techblox_Data\Managed\Analytics.dll ..\..\ref\Techblox_Data\Managed\Analytics.dll @@ -356,6 +349,14 @@ ..\ref\Techblox_Data\Managed\Havok.Physics.Hybrid.dll ..\..\ref\Techblox_Data\Managed\Havok.Physics.Hybrid.dll + + ..\ref\Techblox_Data\Managed\IllusionInjector.dll + ..\..\ref\Techblox_Data\Managed\IllusionInjector.dll + + + ..\ref\Techblox_Data\Managed\IllusionPlugin.dll + ..\..\ref\Techblox_Data\Managed\IllusionPlugin.dll + ..\ref\Techblox_Data\Managed\JWT.dll ..\..\ref\Techblox_Data\Managed\JWT.dll @@ -660,6 +661,14 @@ ..\ref\Techblox_Data\Managed\Techblox.AtmosphereBlock.dll ..\..\ref\Techblox_Data\Managed\Techblox.AtmosphereBlock.dll + + ..\ref\Techblox_Data\Managed\Techblox.AudioBlocks.dll + ..\..\ref\Techblox_Data\Managed\Techblox.AudioBlocks.dll + + + ..\ref\Techblox_Data\Managed\Techblox.AudioBlocksClient.dll + ..\..\ref\Techblox_Data\Managed\Techblox.AudioBlocksClient.dll + ..\ref\Techblox_Data\Managed\Techblox.AutoForward.dll ..\..\ref\Techblox_Data\Managed\Techblox.AutoForward.dll @@ -680,6 +689,14 @@ ..\ref\Techblox_Data\Managed\Techblox.BlockLabels.dll ..\..\ref\Techblox_Data\Managed\Techblox.BlockLabels.dll + + ..\ref\Techblox_Data\Managed\Techblox.BlockLabelsServer.dll + ..\..\ref\Techblox_Data\Managed\Techblox.BlockLabelsServer.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Blocks.Connections.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Blocks.Connections.dll + ..\ref\Techblox_Data\Managed\Techblox.Blocks.LightBlock.dll ..\..\ref\Techblox_Data\Managed\Techblox.Blocks.LightBlock.dll @@ -696,6 +713,22 @@ ..\ref\Techblox_Data\Managed\Techblox.Camera.dll ..\..\ref\Techblox_Data\Managed\Techblox.Camera.dll + + ..\ref\Techblox_Data\Managed\Techblox.CentreHUDBlock.dll + ..\..\ref\Techblox_Data\Managed\Techblox.CentreHUDBlock.dll + + + ..\ref\Techblox_Data\Managed\Techblox.CentreHUDGUI.dll + ..\..\ref\Techblox_Data\Managed\Techblox.CentreHUDGUI.dll + + + ..\ref\Techblox_Data\Managed\Techblox.CheckpointBlock.dll + ..\..\ref\Techblox_Data\Managed\Techblox.CheckpointBlock.dll + + + ..\ref\Techblox_Data\Managed\Techblox.CheckpointBlockClient.dll + ..\..\ref\Techblox_Data\Managed\Techblox.CheckpointBlockClient.dll + ..\ref\Techblox_Data\Managed\Techblox.Common.Audio.dll ..\..\ref\Techblox_Data\Managed\Techblox.Common.Audio.dll @@ -704,6 +737,10 @@ ..\ref\Techblox_Data\Managed\Techblox.ContextSensitiveTextHint.dll ..\..\ref\Techblox_Data\Managed\Techblox.ContextSensitiveTextHint.dll + + ..\ref\Techblox_Data\Managed\Techblox.DistanceSensorBlock.dll + ..\..\ref\Techblox_Data\Managed\Techblox.DistanceSensorBlock.dll + ..\ref\Techblox_Data\Managed\Techblox.ECSResourceManagers.dll ..\..\ref\Techblox_Data\Managed\Techblox.ECSResourceManagers.dll @@ -728,6 +765,46 @@ ..\ref\Techblox_Data\Managed\Techblox.EnvironmentBlocks.SimulationWorldEnvironment.dll ..\..\ref\Techblox_Data\Managed\Techblox.EnvironmentBlocks.SimulationWorldEnvironment.dll + + ..\ref\Techblox_Data\Managed\Techblox.Gameplay.Client.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.Client.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Gameplay.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Gameplay.GameState.Client.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.GameState.Client.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Gameplay.GameState.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.GameState.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Gameplay.PlayerGameplayDetails.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.PlayerGameplayDetails.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Gameplay.Score.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.Score.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Gameplay.Spawning.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.Spawning.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Gameplay.Teams.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.Teams.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Gameplay.WorldResetting.Client.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.WorldResetting.Client.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Gameplay.WorldResetting.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.WorldResetting.dll + ..\ref\Techblox_Data\Managed\Techblox.GameSelection.dll ..\..\ref\Techblox_Data\Managed\Techblox.GameSelection.dll @@ -832,6 +909,18 @@ ..\ref\Techblox_Data\Managed\Techblox.InputCapture.dll ..\..\ref\Techblox_Data\Managed\Techblox.InputCapture.dll + + ..\ref\Techblox_Data\Managed\Techblox.JetBlock.dll + ..\..\ref\Techblox_Data\Managed\Techblox.JetBlock.dll + + + ..\ref\Techblox_Data\Managed\Techblox.JetBlockClient.dll + ..\..\ref\Techblox_Data\Managed\Techblox.JetBlockClient.dll + + + ..\ref\Techblox_Data\Managed\Techblox.MachineProcessingService.dll + ..\..\ref\Techblox_Data\Managed\Techblox.MachineProcessingService.dll + ..\ref\Techblox_Data\Managed\Techblox.MachineSimulationPreprocessing.dll ..\..\ref\Techblox_Data\Managed\Techblox.MachineSimulationPreprocessing.dll @@ -840,6 +929,10 @@ ..\ref\Techblox_Data\Managed\Techblox.MachineSpawning.dll ..\..\ref\Techblox_Data\Managed\Techblox.MachineSpawning.dll + + ..\ref\Techblox_Data\Managed\Techblox.MachineVelocityCameraEffects.dll + ..\..\ref\Techblox_Data\Managed\Techblox.MachineVelocityCameraEffects.dll + ..\ref\Techblox_Data\Managed\Techblox.Matchmaking.dll ..\..\ref\Techblox_Data\Managed\Techblox.Matchmaking.dll @@ -848,6 +941,10 @@ ..\ref\Techblox_Data\Managed\Techblox.Multiplayer.UsernameMessages.dll ..\..\ref\Techblox_Data\Managed\Techblox.Multiplayer.UsernameMessages.dll + + ..\ref\Techblox_Data\Managed\Techblox.Particles.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Particles.dll + ..\ref\Techblox_Data\Managed\Techblox.PlayUX.dll ..\..\ref\Techblox_Data\Managed\Techblox.PlayUX.dll @@ -884,6 +981,14 @@ ..\ref\Techblox_Data\Managed\Techblox.SaveGamesConversion.dll ..\..\ref\Techblox_Data\Managed\Techblox.SaveGamesConversion.dll + + ..\ref\Techblox_Data\Managed\Techblox.ScoreHUDBlock.dll + ..\..\ref\Techblox_Data\Managed\Techblox.ScoreHUDBlock.dll + + + ..\ref\Techblox_Data\Managed\Techblox.ScoreHUDGUI.dll + ..\..\ref\Techblox_Data\Managed\Techblox.ScoreHUDGUI.dll + ..\ref\Techblox_Data\Managed\Techblox.Server.dll ..\..\ref\Techblox_Data\Managed\Techblox.Server.dll @@ -932,6 +1037,22 @@ ..\ref\Techblox_Data\Managed\Techblox.SignalHandling.Common.dll ..\..\ref\Techblox_Data\Managed\Techblox.SignalHandling.Common.dll + + ..\ref\Techblox_Data\Managed\Techblox.SpawnBlock.Client.dll + ..\..\ref\Techblox_Data\Managed\Techblox.SpawnBlock.Client.dll + + + ..\ref\Techblox_Data\Managed\Techblox.SpawnBlock.Server.dll + ..\..\ref\Techblox_Data\Managed\Techblox.SpawnBlock.Server.dll + + + ..\ref\Techblox_Data\Managed\Techblox.StabilizerBlock.dll + ..\..\ref\Techblox_Data\Managed\Techblox.StabilizerBlock.dll + + + ..\ref\Techblox_Data\Managed\Techblox.StabilizerBlockClient.dll + ..\..\ref\Techblox_Data\Managed\Techblox.StabilizerBlockClient.dll + ..\ref\Techblox_Data\Managed\Techblox.SwitchAnimation.dll ..\..\ref\Techblox_Data\Managed\Techblox.SwitchAnimation.dll @@ -944,10 +1065,18 @@ ..\ref\Techblox_Data\Managed\Techblox.TimerBlock.dll ..\..\ref\Techblox_Data\Managed\Techblox.TimerBlock.dll + + ..\ref\Techblox_Data\Managed\Techblox.TriggerBlock.dll + ..\..\ref\Techblox_Data\Managed\Techblox.TriggerBlock.dll + ..\ref\Techblox_Data\Managed\Techblox.WheelRigBlock.dll ..\..\ref\Techblox_Data\Managed\Techblox.WheelRigBlock.dll + + ..\ref\Techblox_Data\Managed\Techblox.WorldResetterBlock.dll + ..\..\ref\Techblox_Data\Managed\Techblox.WorldResetterBlock.dll + ..\ref\Techblox_Data\Managed\UniTask.Addressables.dll ..\..\ref\Techblox_Data\Managed\UniTask.Addressables.dll @@ -1052,6 +1181,10 @@ ..\ref\Techblox_Data\Managed\Unity.Platforms.Common.dll ..\..\ref\Techblox_Data\Managed\Unity.Platforms.Common.dll + + ..\ref\Techblox_Data\Managed\Unity.Profiling.Core.dll + ..\..\ref\Techblox_Data\Managed\Unity.Profiling.Core.dll + ..\ref\Techblox_Data\Managed\Unity.Properties.dll ..\..\ref\Techblox_Data\Managed\Unity.Properties.dll diff --git a/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs b/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs index 7b225d0..12ae6e4 100644 --- a/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs +++ b/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs @@ -1,13 +1,17 @@ using System; using System.Collections.Generic; using System.Diagnostics; +using System.Linq; using System.Reflection; using System.Text; +using System.Text.RegularExpressions; +using DataLoader; using TechbloxModdingAPI.App; using HarmonyLib; using IllusionInjector; // test using RobocraftX.FrontEnd; +using ServiceLayer; using Unity.Mathematics; using UnityEngine; using Svelto.Tasks; @@ -257,7 +261,7 @@ namespace TechbloxModdingAPI.Tests /*((FasterList)AccessTools.Property(typeof(GuiInputMap), "GuiInputsButtonDown").GetValue(null)) .Add(new GuiInputMap.GuiInputMapElement(RewiredConsts.Action.ToggleCommandLine, GuiIn))*/ - /*Game.Enter += (sender, e) => + Game.Enter += (sender, e) => { ushort lastKey = ushort.MaxValue; foreach (var kv in FullGameFields._dataDb.GetValues() @@ -281,8 +285,8 @@ namespace TechbloxModdingAPI.Tests Console.WriteLine($"{name}{(currentKey != lastKey + 1 ? $" = {currentKey}" : "")},"); lastKey = currentKey; } - };*/ - /*Game.Enter += (sender, e) => + }; + Game.Enter += (sender, e) => { ushort lastKey = ushort.MaxValue; Console.WriteLine("Materials:\n" + FullGameFields._dataDb.GetValues() @@ -295,7 +299,7 @@ namespace TechbloxModdingAPI.Tests return result; }) .Aggregate((a, b) => a + "\n" + b)); - };*/ + }; CommandBuilder.Builder("takeScreenshot", "Enables the screenshot taker") .Action(() => -- 2.30.2 From 7f63944a6ef99a02cfc6943d91a42507e05da581 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sat, 19 Feb 2022 02:25:58 +0100 Subject: [PATCH 235/252] Block fixes, add mass and complexity properties, make Player.LocalPlayer return null if not found --- TechbloxModdingAPI/Block.cs | 25 ++++++++++++++++++-- TechbloxModdingAPI/Blocks/BlockComplexity.cs | 17 +++++++++++++ TechbloxModdingAPI/Cluster.cs | 6 +++++ TechbloxModdingAPI/Player.cs | 7 ++++-- TechbloxModdingAPI/SimBody.cs | 4 ++-- 5 files changed, 53 insertions(+), 6 deletions(-) create mode 100644 TechbloxModdingAPI/Blocks/BlockComplexity.cs diff --git a/TechbloxModdingAPI/Block.cs b/TechbloxModdingAPI/Block.cs index 1b1cd23..c76ee08 100644 --- a/TechbloxModdingAPI/Block.cs +++ b/TechbloxModdingAPI/Block.cs @@ -67,7 +67,7 @@ namespace TechbloxModdingAPI /// The block object or null if doesn't exist public static Block GetLastPlacedBlock() { - uint lastBlockID = (uint) AccessTools.Field(typeof(CommonExclusiveGroups), "_nextBlockEntityID").GetValue(null) - 1; + uint lastBlockID = CommonExclusiveGroups.blockIDGeneratorClient.Peek() - 1; EGID? egid = BlockEngine.FindBlockEGID(lastBlockID); return egid.HasValue ? New(egid.Value) : null; } @@ -366,8 +366,12 @@ namespace TechbloxModdingAPI get { if (blockGroup != null) return blockGroup; + if (!GameState.IsBuildMode()) return null; // Breaks in simulation var bgec = BlockEngine.GetBlockInfo(this); - return blockGroup = bgec.currentBlockGroup == -1 ? null : new BlockGroup(bgec.currentBlockGroup, this); + return blockGroup = bgec.currentBlockGroup == -1 + ? null + : GetInstance(new EGID((uint)bgec.currentBlockGroup, BlockGroupExclusiveGroups.BlockGroupEntityGroup), + egid => new BlockGroup((int)egid.entityID, this)); } set { @@ -395,6 +399,23 @@ namespace TechbloxModdingAPI set => BlockEngine.GetBlockInfo(this).isStatic = value; } + /// + /// The mass of the block. + /// + public float Mass + { + get => BlockEngine.GetBlockInfo(this).mass; + } + + /// + /// Block complexity used for build rules. Determines the 'cost' of the block. + /// + public BlockComplexity Complexity + { + get => new(BlockEngine.GetBlockInfo(this)); + set => BlockEngine.GetBlockInfo(this) = value; + } + /// /// Whether the block exists. The other properties will return a default value if the block doesn't exist. /// If the block was just placed, then this will also return false but the properties will work correctly. diff --git a/TechbloxModdingAPI/Blocks/BlockComplexity.cs b/TechbloxModdingAPI/Blocks/BlockComplexity.cs new file mode 100644 index 0000000..9f32866 --- /dev/null +++ b/TechbloxModdingAPI/Blocks/BlockComplexity.cs @@ -0,0 +1,17 @@ +using RobocraftX.Blocks; + +namespace TechbloxModdingAPI.Blocks +{ + public record BlockComplexity(int Cpu, int Power) + { + public BlockComplexity(BlockComplexityComponent component) : this(component.cpu, component.power) + { + } + + public int Cpu { get; } = Cpu; + public int Power { get; } = Power; + + public static implicit operator BlockComplexityComponent(BlockComplexity complexity) => + new() { cpu = complexity.Cpu, power = complexity.Power }; + } +} \ No newline at end of file diff --git a/TechbloxModdingAPI/Cluster.cs b/TechbloxModdingAPI/Cluster.cs index f88cec9..79eb7b9 100644 --- a/TechbloxModdingAPI/Cluster.cs +++ b/TechbloxModdingAPI/Cluster.cs @@ -1,6 +1,7 @@ using Gamecraft.Damage; using RobocraftX.Common; using Svelto.ECS; +using Techblox.Physics; namespace TechbloxModdingAPI { @@ -36,6 +37,11 @@ namespace TechbloxModdingAPI set => Block.BlockEngine.GetBlockInfo(this).healthMultiplier = value; } + /// + /// The mass of the cluster. + /// + public float Mass => Block.BlockEngine.GetBlockInfo(this).mass; + /// /// Returns the simulation-time rigid bodies for the chunks in this cluster. /// diff --git a/TechbloxModdingAPI/Player.cs b/TechbloxModdingAPI/Player.cs index 68f5e49..a535269 100644 --- a/TechbloxModdingAPI/Player.cs +++ b/TechbloxModdingAPI/Player.cs @@ -66,13 +66,16 @@ namespace TechbloxModdingAPI /// /// Returns the current player belonging to this client. It will be different after entering/leaving simulation. + /// May return null if the local player doesn't exist. /// public static Player LocalPlayer { get { - if (localPlayer == null || localPlayer.Id != playerEngine.GetLocalPlayer()) - localPlayer = GetInstance(playerEngine.GetLocalPlayer()); + var playerId = playerEngine.GetLocalPlayer(); + if (playerId == uint.MaxValue) return null; + if (localPlayer == null || localPlayer.Id != playerId) + localPlayer = GetInstance(playerId); return localPlayer; } } diff --git a/TechbloxModdingAPI/SimBody.cs b/TechbloxModdingAPI/SimBody.cs index bb05005..158927a 100644 --- a/TechbloxModdingAPI/SimBody.cs +++ b/TechbloxModdingAPI/SimBody.cs @@ -75,13 +75,13 @@ namespace TechbloxModdingAPI public float Mass { - get => math.rcp(GetStruct().physicsMass.InverseMass); + get => 0f; //TODO: Get mass from UECS entity //set => GetStruct().physicsMass.InverseMass = math.rcp(value); } public float3 CenterOfMass { - get => GetStruct().physicsMass.CenterOfMass; + get => Block.BlockEngine.GetBlockInfo(this).centreOfMass; //set => GetStruct().physicsMass.CenterOfMass = value; } -- 2.30.2 From 2db7b607f0f1059437b91a54c17980906b313514 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Wed, 23 Feb 2022 02:25:34 +0100 Subject: [PATCH 236/252] Improve UI elements (IMGUI) --- TechbloxModdingAPI/Interface/IMGUI/Button.cs | 28 ++--------------- TechbloxModdingAPI/Interface/IMGUI/Group.cs | 23 ++------------ .../Interface/IMGUI/IMGUIManager.cs | 7 +++-- TechbloxModdingAPI/Interface/IMGUI/Image.cs | 31 ++----------------- TechbloxModdingAPI/Interface/IMGUI/Label.cs | 23 ++------------ TechbloxModdingAPI/Interface/IMGUI/Text.cs | 23 ++------------ .../Interface/IMGUI/UIElement.cs | 19 +++++++++--- TechbloxModdingAPI/Player.cs | 4 +-- TechbloxModdingAPI/Players/PlayerEngine.cs | 2 +- TechbloxModdingAPI/SimBody.cs | 3 +- .../Tests/TechbloxModdingAPIPluginTest.cs | 6 ++-- 11 files changed, 37 insertions(+), 132 deletions(-) diff --git a/TechbloxModdingAPI/Interface/IMGUI/Button.cs b/TechbloxModdingAPI/Interface/IMGUI/Button.cs index de8e7cc..6cf5fc8 100644 --- a/TechbloxModdingAPI/Interface/IMGUI/Button.cs +++ b/TechbloxModdingAPI/Interface/IMGUI/Button.cs @@ -24,7 +24,7 @@ namespace TechbloxModdingAPI.Interface.IMGUI /// public event EventHandler OnClick; - public void OnGUI() + public override void OnGUI() { if (automaticLayout) { @@ -42,34 +42,15 @@ namespace TechbloxModdingAPI.Interface.IMGUI } } - /// - /// The button's unique name. - /// - public string Name { get; private set; } - - /// - /// Whether to display the button. - /// - public bool Enabled { get; set; } = true; - /// /// Initialize a new button with automatic layout. /// /// The text to display on the button. /// The button's name. - public Button(string text, string name = null) + public Button(string text, string name = null) : base(text, name) { automaticLayout = true; this.text = text; - if (name == null) - { - this.Name = typeof(Button).FullName + "::" + text; - } - else - { - this.Name = name; - } - IMGUIManager.AddElement(this); } /// @@ -83,10 +64,5 @@ namespace TechbloxModdingAPI.Interface.IMGUI automaticLayout = false; this.Box = box; } - - ~Button() - { - IMGUIManager.RemoveElement(this); - } } } \ No newline at end of file diff --git a/TechbloxModdingAPI/Interface/IMGUI/Group.cs b/TechbloxModdingAPI/Interface/IMGUI/Group.cs index b1dcccc..88a36c2 100644 --- a/TechbloxModdingAPI/Interface/IMGUI/Group.cs +++ b/TechbloxModdingAPI/Interface/IMGUI/Group.cs @@ -20,7 +20,7 @@ namespace TechbloxModdingAPI.Interface.IMGUI /// public Rect Box { get; set; } - public void OnGUI() + public override void OnGUI() { /*if (Constants.Default == null) return; if (Constants.Default.box == null) return;*/ @@ -60,16 +60,6 @@ namespace TechbloxModdingAPI.Interface.IMGUI GUI.EndGroup(); } } - - /// - /// The group's unique name. - /// - public string Name { get; } - - /// - /// Whether to display the group and everything in it. - /// - public bool Enabled { set; get; } = true; /// /// The amount of elements in the group. @@ -85,19 +75,10 @@ namespace TechbloxModdingAPI.Interface.IMGUI /// The rectangular area to use in the window. /// Name of the group. /// Whether to use automatic UI layout. - public Group(Rect box, string name = null, bool automaticLayout = false) + public Group(Rect box, string name = null, bool automaticLayout = false) : base(box.ToString().Replace(" ", ""), name) { Box = box; - if (name == null) - { - this.Name = typeof(Group).FullName + "::" + box.ToString().Replace(" ", ""); - } - else - { - this.Name = name; - } this.automaticLayout = automaticLayout; - IMGUIManager.AddElement(this); } /// diff --git a/TechbloxModdingAPI/Interface/IMGUI/IMGUIManager.cs b/TechbloxModdingAPI/Interface/IMGUI/IMGUIManager.cs index c27c484..d68f14b 100644 --- a/TechbloxModdingAPI/Interface/IMGUI/IMGUIManager.cs +++ b/TechbloxModdingAPI/Interface/IMGUI/IMGUIManager.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using Svelto.Tasks; using Svelto.Tasks.ExtraLean; using TechbloxModdingAPI.Tasks; +using TechbloxModdingAPI.Utility; using UnityEngine; namespace TechbloxModdingAPI.Interface.IMGUI @@ -14,9 +15,9 @@ namespace TechbloxModdingAPI.Interface.IMGUI /// public static class IMGUIManager { - internal static OnGuiRunner ImguiScheduler = new OnGuiRunner("TechbloxModdingAPI_IMGUIScheduler"); - - private static Dictionary _activeElements = new Dictionary(); + internal static OnGuiRunner ImguiScheduler = new("TechbloxModdingAPI_IMGUIScheduler"); + + private static readonly WeakDictionary _activeElements = new(); /// /// Add an UIElement instance to be managed by IMGUIManager. diff --git a/TechbloxModdingAPI/Interface/IMGUI/Image.cs b/TechbloxModdingAPI/Interface/IMGUI/Image.cs index 2bea1f4..88e82c1 100644 --- a/TechbloxModdingAPI/Interface/IMGUI/Image.cs +++ b/TechbloxModdingAPI/Interface/IMGUI/Image.cs @@ -20,7 +20,7 @@ namespace TechbloxModdingAPI.Interface.IMGUI /// public Rect Box { get; set; } = Rect.zero; - public void OnGUI() + public override void OnGUI() { //if (Texture == null) return; if (automaticLayout) @@ -32,43 +32,16 @@ namespace TechbloxModdingAPI.Interface.IMGUI GUI.Label(Box, Texture, Constants.Default.label); } } - - /// - /// The image element's unique name. - /// - public string Name { get; } - - /// - /// Whether to display the image and everything in it. - /// - public bool Enabled { set; get; } = true; /// /// Initializes a new instance of the class with automatic layout. /// /// Image to display. /// The element's name. - public Image(Texture texture = null, string name = null) + public Image(Texture texture = null, string name = null) : base(texture == null ? "" : $"{texture.name}({texture.width}x{texture.height})", name) { automaticLayout = true; Texture = texture; - if (name == null) - { - if (texture == null) - { - this.Name = typeof(Image).FullName + "::" + texture; - } - else - { - this.Name = typeof(Image).FullName + "::" + texture.name + "(" + texture.width + "x" + texture.height + ")"; - } - - } - else - { - this.Name = name; - } - IMGUIManager.AddElement(this); } /// diff --git a/TechbloxModdingAPI/Interface/IMGUI/Label.cs b/TechbloxModdingAPI/Interface/IMGUI/Label.cs index 960a6ca..e394f35 100644 --- a/TechbloxModdingAPI/Interface/IMGUI/Label.cs +++ b/TechbloxModdingAPI/Interface/IMGUI/Label.cs @@ -20,7 +20,7 @@ namespace TechbloxModdingAPI.Interface.IMGUI /// public Rect Box { get; set; } = Rect.zero; - public void OnGUI() + public override void OnGUI() { if (automaticLayout) { @@ -32,34 +32,15 @@ namespace TechbloxModdingAPI.Interface.IMGUI } } - /// - /// The label's unique name. - /// - public string Name { get; } - - /// - /// Whether to display the label. - /// - public bool Enabled { set; get; } = true; - /// /// Initializes a new instance of the class with automatic layout. /// /// Initial string to display on the label. /// The element's name. - public Label(string initialText = null, string name = null) + public Label(string initialText = null, string name = null) : base(initialText, name) { automaticLayout = true; Text = initialText; - if (name == null) - { - this.Name = typeof(Label).FullName + "::" + initialText; - } - else - { - this.Name = name; - } - IMGUIManager.AddElement(this); } /// diff --git a/TechbloxModdingAPI/Interface/IMGUI/Text.cs b/TechbloxModdingAPI/Interface/IMGUI/Text.cs index bdf6738..8f6033d 100644 --- a/TechbloxModdingAPI/Interface/IMGUI/Text.cs +++ b/TechbloxModdingAPI/Interface/IMGUI/Text.cs @@ -28,7 +28,7 @@ namespace TechbloxModdingAPI.Interface.IMGUI /// public event EventHandler OnEdit; - public void OnGUI() + public override void OnGUI() { string editedText = null; if (automaticLayout) @@ -61,36 +61,17 @@ namespace TechbloxModdingAPI.Interface.IMGUI } } - /// - /// The text field's unique name. - /// - public string Name { get; } - - /// - /// Whether to display the text field. - /// - public bool Enabled { set; get; } = true; - /// /// Initialize the text input field with automatic layout. /// /// Initial text in the input field. /// The text field's name. /// Allow multiple lines? - public Text(string initialText = null, string name = null, bool multiline = false) + public Text(string initialText = null, string name = null, bool multiline = false) : base(initialText, name) { this.Multiline = multiline; automaticLayout = true; text = initialText ?? ""; - if (name == null) - { - this.Name = typeof(Text).FullName + "::" + text; - } - else - { - this.Name = name; - } - IMGUIManager.AddElement(this); } /// diff --git a/TechbloxModdingAPI/Interface/IMGUI/UIElement.cs b/TechbloxModdingAPI/Interface/IMGUI/UIElement.cs index dd66af6..fb25c38 100644 --- a/TechbloxModdingAPI/Interface/IMGUI/UIElement.cs +++ b/TechbloxModdingAPI/Interface/IMGUI/UIElement.cs @@ -6,23 +6,34 @@ namespace TechbloxModdingAPI.Interface.IMGUI /// GUI Element like a text field, button or picture. /// This interface is used to wrap many elements from Unity's IMGUI system. /// - public interface UIElement + public abstract class UIElement { + protected UIElement(string text, string name) + { + Name = name ?? GetType().FullName + "::" + text; + IMGUIManager.AddElement(this); + } + + ~UIElement() + { + IMGUIManager.RemoveElement(this); + } + /// /// GUI operations to perform in the OnGUI scope. /// This is basically equivalent to a MonoBehaviour's OnGUI method. /// - void OnGUI(); + public abstract void OnGUI(); /// /// The element's name. /// This should be unique for every instance of the class. /// - string Name { get; } + public string Name { get; } /// /// Whether to display the UI element or not. /// - bool Enabled { get; } + public bool Enabled { get; set; } = true; } } \ No newline at end of file diff --git a/TechbloxModdingAPI/Player.cs b/TechbloxModdingAPI/Player.cs index a535269..32901ad 100644 --- a/TechbloxModdingAPI/Player.cs +++ b/TechbloxModdingAPI/Player.cs @@ -195,8 +195,8 @@ namespace TechbloxModdingAPI /// The player's mass. /// /// The mass. - public float Mass => - 1f / playerEngine.GetCharacterStruct(Id).Get().physicsMass.InverseMass; + [Obsolete] // We cannot get it clientside or something + public float Mass => 0; /// /// The player's latest network ping time. diff --git a/TechbloxModdingAPI/Players/PlayerEngine.cs b/TechbloxModdingAPI/Players/PlayerEngine.cs index 728f93f..7e53270 100644 --- a/TechbloxModdingAPI/Players/PlayerEngine.cs +++ b/TechbloxModdingAPI/Players/PlayerEngine.cs @@ -139,7 +139,7 @@ namespace TechbloxModdingAPI.Players group = default; if (GameState.IsBuildMode()) return entitiesDB.QueryEntityOptional(new EGID(playerId, LocalBuildingDrone.BuildGroup)); - + var characterGroups = CharacterExclusiveGroups.AllCharacters; for (int i = 0; i < characterGroups.count; i++) { diff --git a/TechbloxModdingAPI/SimBody.cs b/TechbloxModdingAPI/SimBody.cs index 158927a..06e152b 100644 --- a/TechbloxModdingAPI/SimBody.cs +++ b/TechbloxModdingAPI/SimBody.cs @@ -73,9 +73,10 @@ namespace TechbloxModdingAPI } } + [Obsolete] //Cannot get mass even from UECS public float Mass { - get => 0f; //TODO: Get mass from UECS entity + get => 0f; //set => GetStruct().physicsMass.InverseMass = math.rcp(value); } diff --git a/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs b/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs index 12ae6e4..7564816 100644 --- a/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs +++ b/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs @@ -261,7 +261,7 @@ namespace TechbloxModdingAPI.Tests /*((FasterList)AccessTools.Property(typeof(GuiInputMap), "GuiInputsButtonDown").GetValue(null)) .Add(new GuiInputMap.GuiInputMapElement(RewiredConsts.Action.ToggleCommandLine, GuiIn))*/ - Game.Enter += (sender, e) => + /*Game.Enter += (sender, e) => { ushort lastKey = ushort.MaxValue; foreach (var kv in FullGameFields._dataDb.GetValues() @@ -299,7 +299,7 @@ namespace TechbloxModdingAPI.Tests return result; }) .Aggregate((a, b) => a + "\n" + b)); - }; + };*/ CommandBuilder.Builder("takeScreenshot", "Enables the screenshot taker") .Action(() => @@ -368,7 +368,7 @@ namespace TechbloxModdingAPI.Tests }, () => shouldTestGhostBlock)); Logging.CommandLog("Test enabled"); }).Build(); - + Client.EnterMenu += (sender, args) => Scheduler.Schedule(new Once(() => Client.Instance.CloseBetaPopup())); Game.Enter += (sender, args) => -- 2.30.2 From 3eecdf2cf50fb57b947680122b76da90b058b0a0 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Thu, 24 Feb 2022 01:02:35 +0100 Subject: [PATCH 237/252] Add key collection to weak dictionary and compact code --- TechbloxModdingAPI/Utility/WeakDictionary.cs | 123 +++++++------------ 1 file changed, 44 insertions(+), 79 deletions(-) diff --git a/TechbloxModdingAPI/Utility/WeakDictionary.cs b/TechbloxModdingAPI/Utility/WeakDictionary.cs index 35e55a5..6c4cf57 100644 --- a/TechbloxModdingAPI/Utility/WeakDictionary.cs +++ b/TechbloxModdingAPI/Utility/WeakDictionary.cs @@ -7,7 +7,7 @@ namespace TechbloxModdingAPI.Utility { public class WeakDictionary : IDictionary where TValue : class { - private Dictionary> _dictionary = new Dictionary>(); + private readonly Dictionary> _dictionary = new(); public IEnumerator> GetEnumerator() { @@ -19,53 +19,19 @@ namespace TechbloxModdingAPI.Utility } } - IEnumerator IEnumerable.GetEnumerator() - { - return GetEnumerator(); - } - - public void Add(KeyValuePair item) - { - Add(item.Key, item.Value); - } - - public void Clear() - { - _dictionary.Clear(); - } - - public bool Contains(KeyValuePair item) - { - return TryGetValue(item.Key, out var value) && item.Value == value; - } - - public void CopyTo(KeyValuePair[] array, int arrayIndex) - { + IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); + public void Add(KeyValuePair item) => Add(item.Key, item.Value); + public void Clear() => _dictionary.Clear(); + public bool Contains(KeyValuePair item) => + TryGetValue(item.Key, out var value) && item.Value == value; + public void CopyTo(KeyValuePair[] array, int arrayIndex) => throw new System.NotImplementedException(); - } - - public bool Remove(KeyValuePair item) - { - return Contains(item) && Remove(item.Key); - } - + public bool Remove(KeyValuePair item) => Contains(item) && Remove(item.Key); public int Count => _dictionary.Count; public bool IsReadOnly => false; - - public bool ContainsKey(TKey key) - { - return TryGetValue(key, out _); - } - - public void Add(TKey key, TValue value) - { - _dictionary.Add(key, new WeakReference(value)); - } - - public bool Remove(TKey key) - { - return _dictionary.Remove(key); - } + public bool ContainsKey(TKey key) => TryGetValue(key, out _); + public void Add(TKey key, TValue value) => _dictionary.Add(key, new WeakReference(value)); + public bool Remove(TKey key) => _dictionary.Remove(key); public bool TryGetValue(TKey key, out TValue value) { @@ -83,12 +49,37 @@ namespace TechbloxModdingAPI.Utility set => _dictionary[key] = new WeakReference(value); } - public ICollection Keys => _dictionary.Keys; + public ICollection Keys => new KeyCollection(this); public ICollection Values => new ValueCollection(this); + public class KeyCollection : ICollection, IReadOnlyCollection + { + private readonly WeakDictionary _dictionary; + internal KeyCollection(WeakDictionary dictionary) + { + _dictionary = dictionary; + } + + public IEnumerator GetEnumerator() + { + using var enumerator = _dictionary.GetEnumerator(); + while (enumerator.MoveNext()) + yield return enumerator.Current.Key; + } + + IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); + public void Add(TKey item) => throw new NotSupportedException("The key collection is read only."); + public void Clear() => throw new NotSupportedException("The key collection is read only."); + public bool Contains(TKey item) => _dictionary.ContainsKey(item); + public void CopyTo(TKey[] array, int arrayIndex) => throw new NotImplementedException(); + public bool Remove(TKey item) => throw new NotSupportedException("The key collection is read only."); + public int Count => _dictionary.Count; + public bool IsReadOnly => true; + } + public class ValueCollection : ICollection, IReadOnlyCollection { - private WeakDictionary _dictionary; + private readonly WeakDictionary _dictionary; internal ValueCollection(WeakDictionary dictionary) { _dictionary = dictionary; @@ -98,41 +89,15 @@ namespace TechbloxModdingAPI.Utility { using var enumerator = _dictionary.GetEnumerator(); while (enumerator.MoveNext()) - { yield return enumerator.Current.Value; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetEnumerator(); - } - - public void Add(TValue item) - { - throw new NotSupportedException("The value collection is read only."); - } - - public void Clear() - { - throw new NotSupportedException("The value collection is read only."); - } - - public bool Contains(TValue item) - { - return _dictionary.Any(kv => kv.Value == item); - } - - public void CopyTo(TValue[] array, int arrayIndex) - { - throw new NotImplementedException(); - } - - public bool Remove(TValue item) - { - throw new NotSupportedException("The value collection is read only."); } + IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); + public void Add(TValue item) => throw new NotSupportedException("The value collection is read only."); + public void Clear() => throw new NotSupportedException("The value collection is read only."); + public bool Contains(TValue item) => _dictionary.Any(kv => kv.Value == item); + public void CopyTo(TValue[] array, int arrayIndex) => throw new NotImplementedException(); + public bool Remove(TValue item) => throw new NotSupportedException("The value collection is read only."); public int Count => _dictionary.Count; public bool IsReadOnly => true; } -- 2.30.2 From c4a9125ed342bebefb486dd401da7a28cd197712 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sun, 20 Mar 2022 18:01:14 +0100 Subject: [PATCH 238/252] Update to Techblox 2022.03.17.17.24 --- TechbloxModdingAPI/Blocks/BlockIDs.cs | 6 +++ .../Blocks/Engines/BlockEngine.cs | 43 +++++++++---------- .../Blocks/Engines/BlueprintEngine.cs | 2 +- .../Blocks/Engines/PlacementEngine.cs | 2 +- .../Utility/ManagedApiExtensions.cs | 2 +- .../Utility/NativeApiExtensions.cs | 4 +- TechbloxModdingAPI/Utility/OptionalRef.cs | 2 +- 7 files changed, 33 insertions(+), 28 deletions(-) diff --git a/TechbloxModdingAPI/Blocks/BlockIDs.cs b/TechbloxModdingAPI/Blocks/BlockIDs.cs index 3bf837a..49993a3 100644 --- a/TechbloxModdingAPI/Blocks/BlockIDs.cs +++ b/TechbloxModdingAPI/Blocks/BlockIDs.cs @@ -313,5 +313,11 @@ namespace TechbloxModdingAPI.Blocks LargeJet, DistanceSensor, Stabilizer, + ObjectID, + TeamScore = 428, + ScorePickupBlock, + StreetLamp = 435, + ConstantBlock = 452, + CounterBlock, } } \ No newline at end of file diff --git a/TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs b/TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs index 5d6162c..0b63e2c 100644 --- a/TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs @@ -15,6 +15,7 @@ using RobocraftX.Rendering.GPUI; using Svelto.DataStructures; using Svelto.ECS; using Svelto.ECS.EntityStructs; +using Svelto.ECS.Experimental; using Svelto.ECS.Hybrid; using Techblox.BuildingDrone; using Unity.Mathematics; @@ -138,7 +139,7 @@ namespace TechbloxModdingAPI.Blocks.Engines } uint prefabId = - PrefabsID.GetOrCreatePrefabID((ushort) prefabAssetID, material, 1, flipped); + PrefabsID.GetOrAddPrefabID((ushort) prefabAssetID, material, 1, flipped); entitiesDB.QueryEntityOrDefault(block).prefabID = prefabId; if (block.Exists) { @@ -168,28 +169,25 @@ namespace TechbloxModdingAPI.Blocks.Engines public SimBody[] GetSimBodiesFromID(byte id) { var ret = new FasterList(4); - var oide = entitiesDB.QueryEntities(); + var (oids, tags, count) = entitiesDB.QueryEntities(CommonExclusiveGroups.OBJID_BLOCK_GROUP); EGIDMapper? connections = null; - foreach (var ((oids, count), _) in oide) + for (int i = 0; i < count; i++) { - for (int i = 0; i < count; i++) - { - ref ObjectIdEntityStruct oid = ref oids[i]; - if (oid.objectId != id) continue; - if (!connections.HasValue) //Would need reflection to get the group from the build group otherwise - connections = entitiesDB.QueryMappedEntities(oid.ID.groupID); - var rid = connections.Value.Entity(oid.ID.entityID).machineRigidBodyId; - foreach (var rb in ret) - { - if (rb.Id.entityID == rid) - goto DUPLICATE; //Multiple Object Identifiers on one rigid body - } - - ret.Add(new SimBody(rid)); - DUPLICATE: ; + if (oids[i].objectId != id) continue; + var tag = tags[i]; + if (!connections.HasValue) //Would need reflection to get the group from the build group otherwise + connections = entitiesDB.QueryMappedEntities(tag.ID.groupID); + var rid = connections.Value.Entity(tag.ID.entityID).machineRigidBodyId; + foreach (var rb in ret) + { + if (rb.Id.entityID == rid) + goto DUPLICATE; //Multiple Object Identifiers on one rigid body } - } + ret.Add(new SimBody(rid)); + DUPLICATE: ; + } + return ret.ToArray(); } @@ -256,15 +254,16 @@ namespace TechbloxModdingAPI.Blocks.Engines public Block[] GetBodyBlocks(uint sbid) { - var groups = entitiesDB.QueryEntities(); + var groups = entitiesDB.FindGroups(); + groups = new QueryGroups(groups).Except(CommonExclusiveGroups.DISABLED_JOINTS_IN_SIM_GROUP).Evaluate().result; var set = new HashSet(); - foreach (var ((coll, count), _) in groups) + foreach (var ((coll, tags, count), _) in entitiesDB.QueryEntities(groups)) { for (var index = 0; index < count; index++) { var conn = coll[index]; if (conn.machineRigidBodyId == sbid) - set.Add(Block.New(conn.ID)); + set.Add(Block.New(tags[index].ID)); } } diff --git a/TechbloxModdingAPI/Blocks/Engines/BlueprintEngine.cs b/TechbloxModdingAPI/Blocks/Engines/BlueprintEngine.cs index 789076e..6bd48c8 100644 --- a/TechbloxModdingAPI/Blocks/Engines/BlueprintEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/BlueprintEngine.cs @@ -277,7 +277,7 @@ namespace TechbloxModdingAPI.Blocks.Engines FullGameFields._managers.blockLabelResourceManager); entityInitializer.Init(dbStruct); entityInitializer.Init(new GFXPrefabEntityStructGPUI( - PrefabsID.GetOrCreatePrefabID((ushort)entityInitializer.Get().prefabAssetID, + PrefabsID.GetOrAddPrefabID((ushort)entityInitializer.Get().prefabAssetID, entitiesDB.QueryEntity(sourceId).materialId, 7, FlippedBlockUtils.IsFlipped(in scalingEntityStruct.scale)), true)); entityInitializer.Init(entitiesDB.QueryEntity(sourceId)); diff --git a/TechbloxModdingAPI/Blocks/Engines/PlacementEngine.cs b/TechbloxModdingAPI/Blocks/Engines/PlacementEngine.cs index 8f06ecc..4d363a4 100644 --- a/TechbloxModdingAPI/Blocks/Engines/PlacementEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/PlacementEngine.cs @@ -58,7 +58,7 @@ namespace TechbloxModdingAPI.Blocks.Engines uint prefabAssetID = structInitializer.Has() ? structInitializer.Get().prefabAssetID : throw new BlockException("Prefab asset ID not found!"); //Set by the game - uint prefabId = PrefabsID.GetOrCreatePrefabID((ushort) prefabAssetID, (byte) BlockMaterial.SteelBodywork, 1, false); + uint prefabId = PrefabsID.GetOrAddPrefabID((ushort) prefabAssetID, (byte) BlockMaterial.SteelBodywork, 1, false); structInitializer.Init(new GFXPrefabEntityStructGPUI(prefabId)); structInitializer.Init(dbEntity); structInitializer.Init(new PositionEntityStruct {position = position}); diff --git a/TechbloxModdingAPI/Utility/ManagedApiExtensions.cs b/TechbloxModdingAPI/Utility/ManagedApiExtensions.cs index 6829b2d..b67705f 100644 --- a/TechbloxModdingAPI/Utility/ManagedApiExtensions.cs +++ b/TechbloxModdingAPI/Utility/ManagedApiExtensions.cs @@ -51,7 +51,7 @@ namespace TechbloxModdingAPI.Utility EGID id = group == ExclusiveGroupStruct.Invalid ? obj.Id : new EGID(obj.Id.entityID, group); var opt = QueryEntityOptional(entitiesDB, id); if (opt) return ref opt.Get(); - if (obj.InitData.Valid) return ref obj.InitData.Initializer(id).GetOrCreate(); + if (obj.InitData.Valid) return ref obj.InitData.Initializer(id).GetOrAdd(); return ref opt.Get(); //Default value } } diff --git a/TechbloxModdingAPI/Utility/NativeApiExtensions.cs b/TechbloxModdingAPI/Utility/NativeApiExtensions.cs index 90b0262..dec1eb0 100644 --- a/TechbloxModdingAPI/Utility/NativeApiExtensions.cs +++ b/TechbloxModdingAPI/Utility/NativeApiExtensions.cs @@ -55,7 +55,7 @@ namespace TechbloxModdingAPI.Utility EGID id = group == ExclusiveGroupStruct.Invalid ? obj.Id : new EGID(obj.Id.entityID, group); var opt = QueryEntityOptional(entitiesDB, id); if (opt) return ref opt.Get(); - if (obj.InitData.Valid) return ref obj.InitData.Initializer(id).GetOrCreate(); + if (obj.InitData.Valid) return ref obj.InitData.Initializer(id).GetOrAdd(); /*if (!obj.InitData.Valid) return ref opt.Get(); //Default value var init = obj.InitData.Initializer(id); // Do not create the component if missing, as that can trigger Add() listeners that, in some cases, may be @@ -71,7 +71,7 @@ namespace TechbloxModdingAPI.Utility /// It will only publish in the next frame. /// /// The entities DB to publish to - /// The ECS object that got changed + /// The ECS object that got changed /// Limits how many changes to publish - should be no more than the consumers' capacity that process this component /// The component that changed public static void PublishEntityChangeDelayed(this EntitiesDB entitiesDB, EGID id, int limit = 80) diff --git a/TechbloxModdingAPI/Utility/OptionalRef.cs b/TechbloxModdingAPI/Utility/OptionalRef.cs index c83e0da..9b3ec3d 100644 --- a/TechbloxModdingAPI/Utility/OptionalRef.cs +++ b/TechbloxModdingAPI/Utility/OptionalRef.cs @@ -59,7 +59,7 @@ namespace TechbloxModdingAPI.Utility { CompRefCache.Default = default; //The default value can be changed by mods if (state == State.Empty) return ref CompRefCache.Default; - if ((state & State.Initializer) != State.Empty) return ref initializer.GetOrCreate(); + if ((state & State.Initializer) != State.Empty) return ref initializer.GetOrAdd(); if ((state & State.Native) != State.Empty) return ref array[index]; return ref managedArray[index]; } -- 2.30.2 From c0ef8f1faeedc998e0a44370c438281fd01ebd80 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sun, 27 Mar 2022 03:49:45 +0200 Subject: [PATCH 239/252] Fix support for accessing properties using reflection The test still crashes the game --- TechbloxModdingAPI/Blocks/BlockTests.cs | 2 +- .../Blocks/Engines/BlockEngine.cs | 18 ++++++++++-------- TechbloxModdingAPI/Utility/OptionalRef.cs | 9 +++++++++ 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/TechbloxModdingAPI/Blocks/BlockTests.cs b/TechbloxModdingAPI/Blocks/BlockTests.cs index 34903cb..d9ce279 100644 --- a/TechbloxModdingAPI/Blocks/BlockTests.cs +++ b/TechbloxModdingAPI/Blocks/BlockTests.cs @@ -82,7 +82,7 @@ namespace TechbloxModdingAPI.Blocks yield break; for (var index = 0; index < blocks.Length; index++) { - if (index % 50 == 0) yield return new WaitForSecondsEnumerator(0.2f).Continue(); //The material or flipped status can only be changed 130 times per submission + if (index % 50 == 0) yield return new WaitForSecondsEnumerator(1f).Continue(); //The material or flipped status can only be changed 130 times per submission var block = blocks[index]; if (!block.Exists) continue; foreach (var property in block.GetType().GetProperties()) diff --git a/TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs b/TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs index 0b63e2c..92e2236 100644 --- a/TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs @@ -98,19 +98,21 @@ namespace TechbloxModdingAPI.Blocks.Engines internal object GetBlockInfo(Block block, Type type, string name) { - /*var opt = AccessTools.Method(typeof(BlockEngine), "GetBlockInfoOptional", generics: new[] { type }) - .Invoke(this, new object[] { block }); - TODO: Cannot call method with by-ref return value - var str = AccessTools.Method(opt.GetType(), "Get").Invoke(opt, Array.Empty()); - return AccessTools.Field(str.GetType(), name).GetValue(str);*/ - return AccessTools.Field(type, name).GetValue(Activator.CreateInstance(type)); + var opt = AccessTools.Method(typeof(NativeApiExtensions), "QueryEntityOptional", + new[] { typeof(EntitiesDB), typeof(EcsObjectBase), typeof(ExclusiveGroupStruct) }, new[] { type }) + .Invoke(null, new object[] { entitiesDB, block, null }); + var str = AccessTools.Property(opt.GetType(), "Value").GetValue(opt); + return AccessTools.Field(str.GetType(), name).GetValue(str); } internal void SetBlockInfo(Block block, Type type, string name, object value) { - /*var opt = AccessTools.Method(typeof(BlockEngine), "GetBlockInfoOptional", generics: new[] { type }) + var opt = AccessTools.Method(typeof(BlockEngine), "GetBlockInfoOptional", generics: new[] { type }) .Invoke(this, new object[] { block }); - var str = AccessTools.Method(opt.GetType(), "Get").Invoke(opt, Array.Empty()); - AccessTools.Field(str.GetType(), name).SetValue(str, value);*/ + var prop = AccessTools.Property(opt.GetType(), "Value"); + var str = prop.GetValue(opt); + AccessTools.Field(str.GetType(), name).SetValue(str, value); + prop.SetValue(opt, str); } public void UpdateDisplayedBlock(EGID id) diff --git a/TechbloxModdingAPI/Utility/OptionalRef.cs b/TechbloxModdingAPI/Utility/OptionalRef.cs index 9b3ec3d..a5e26b6 100644 --- a/TechbloxModdingAPI/Utility/OptionalRef.cs +++ b/TechbloxModdingAPI/Utility/OptionalRef.cs @@ -64,6 +64,15 @@ namespace TechbloxModdingAPI.Utility return ref managedArray[index]; } + /// + /// A non-by-ref view that allows getting and setting the value. + /// + public T Value + { + get => Get(); + set => Get() = value; + } + public bool Exists => state != State.Empty; public T? Nullable() => this ? Get() : default; -- 2.30.2 From 23abe47c725d145d4f2799176382010855bcf507 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Fri, 8 Apr 2022 03:25:05 +0200 Subject: [PATCH 240/252] Update to Techblox 2022.04.01.10.32 - Updated project to use .NET Standard 2.1, which is what the game uses - Updated CodeGenerator to use .NET 6 --- CodeGenerator/CodeGenerator.csproj | 658 ++++++++++++++++-- CodeGenerator/Properties/AssemblyInfo.cs | 35 - TechbloxModdingAPI/Blocks/BlockIDs.cs | 30 +- TechbloxModdingAPI/Blocks/BlockMaterial.cs | 1 + TechbloxModdingAPI/Blocks/BlockTests.cs | 4 +- .../Blocks/Engines/MovementEngine.cs | 6 +- .../Blocks/Engines/RotationEngine.cs | 6 +- TechbloxModdingAPI/TechbloxModdingAPI.csproj | 162 ++++- .../Tests/TechbloxModdingAPIPluginTest.cs | 4 +- 9 files changed, 773 insertions(+), 133 deletions(-) delete mode 100644 CodeGenerator/Properties/AssemblyInfo.cs diff --git a/CodeGenerator/CodeGenerator.csproj b/CodeGenerator/CodeGenerator.csproj index 9de07d8..035bf46 100644 --- a/CodeGenerator/CodeGenerator.csproj +++ b/CodeGenerator/CodeGenerator.csproj @@ -1,51 +1,34 @@ - - - + - Debug - AnyCPU - {0EBB6400-95A7-4A3D-B2ED-BF31E364CC10} - Exe - Properties - CodeGenerator - CodeGenerator - v4.7.2 - 512 + net6.0 + true + 2.2.0 + Exmods + GNU General Public Licence 3+ + https://git.exmods.org/modtainers/GamecraftModdingAPI + en-CA + true + 9 - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 + + + DEBUG;TEST;TRACE - - ..\packages\Lib.Harmony.2.2.0\lib\net472\0Harmony.dll - True - - - - - + + - - - + + + + + + ..\ref\Techblox_Data\Managed\IllusionInjector.dll @@ -55,6 +38,10 @@ ..\ref\Techblox_Data\Managed\IllusionPlugin.dll ..\..\ref\Techblox_Data\Managed\IllusionPlugin.dll + + ..\ref\Techblox_Data\Managed\Accessibility.dll + ..\..\ref\Techblox_Data\Managed\Accessibility.dll + ..\ref\Techblox_Data\Managed\Analytics.dll ..\..\ref\Techblox_Data\Managed\Analytics.dll @@ -67,6 +54,14 @@ ..\ref\Techblox_Data\Managed\Assembly-CSharp.dll ..\..\ref\Techblox_Data\Managed\Assembly-CSharp.dll + + ..\ref\Techblox_Data\Managed\AWSSDK.Core.dll + ..\..\ref\Techblox_Data\Managed\AWSSDK.Core.dll + + + ..\ref\Techblox_Data\Managed\AWSSDK.GameLift.dll + ..\..\ref\Techblox_Data\Managed\AWSSDK.GameLift.dll + ..\ref\Techblox_Data\Managed\BevelEffect.dll ..\..\ref\Techblox_Data\Managed\BevelEffect.dll @@ -91,6 +86,10 @@ ..\ref\Techblox_Data\Managed\DDNA.dll ..\..\ref\Techblox_Data\Managed\DDNA.dll + + ..\ref\Techblox_Data\Managed\EasyButtons.dll + ..\..\ref\Techblox_Data\Managed\EasyButtons.dll + ..\ref\Techblox_Data\Managed\EOSSDK.dll ..\..\ref\Techblox_Data\Managed\EOSSDK.dll @@ -103,6 +102,10 @@ ..\ref\Techblox_Data\Managed\FMODUnityResonance.dll ..\..\ref\Techblox_Data\Managed\FMODUnityResonance.dll + + ..\ref\Techblox_Data\Managed\FMODUnityWrapperClient.dll + ..\..\ref\Techblox_Data\Managed\FMODUnityWrapperClient.dll + ..\ref\Techblox_Data\Managed\FullGame.dll ..\..\ref\Techblox_Data\Managed\FullGame.dll @@ -131,10 +134,6 @@ ..\ref\Techblox_Data\Managed\Gamecraft.Blocks.GenericPhysicsBlocks.dll ..\..\ref\Techblox_Data\Managed\Gamecraft.Blocks.GenericPhysicsBlocks.dll - - ..\ref\Techblox_Data\Managed\Gamecraft.Blocks.LightBlock.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.Blocks.LightBlock.dll - ..\ref\Techblox_Data\Managed\Gamecraft.Blocks.LogicBlock.dll ..\..\ref\Techblox_Data\Managed\Gamecraft.Blocks.LogicBlock.dll @@ -331,6 +330,10 @@ ..\ref\Techblox_Data\Managed\Gamecraft.Wires.Mockup.dll ..\..\ref\Techblox_Data\Managed\Gamecraft.Wires.Mockup.dll + + ..\ref\Techblox_Data\Managed\GameLiftServerSDKNet45.dll + ..\..\ref\Techblox_Data\Managed\GameLiftServerSDKNet45.dll + ..\ref\Techblox_Data\Managed\GameState.dll ..\..\ref\Techblox_Data\Managed\GameState.dll @@ -339,6 +342,10 @@ ..\ref\Techblox_Data\Managed\GhostShark.Outline.dll ..\..\ref\Techblox_Data\Managed\GhostShark.Outline.dll + + ..\ref\Techblox_Data\Managed\Google.Protobuf.dll + ..\..\ref\Techblox_Data\Managed\Google.Protobuf.dll + ..\ref\Techblox_Data\Managed\GPUInstancer.CrowdAnimations.dll ..\..\ref\Techblox_Data\Managed\GPUInstancer.CrowdAnimations.dll @@ -355,17 +362,33 @@ ..\ref\Techblox_Data\Managed\Havok.Physics.Hybrid.dll ..\..\ref\Techblox_Data\Managed\Havok.Physics.Hybrid.dll + + ..\ref\Techblox_Data\Managed\IllusionInjector.dll + ..\..\ref\Techblox_Data\Managed\IllusionInjector.dll + + + ..\ref\Techblox_Data\Managed\IllusionPlugin.dll + ..\..\ref\Techblox_Data\Managed\IllusionPlugin.dll + ..\ref\Techblox_Data\Managed\JWT.dll ..\..\ref\Techblox_Data\Managed\JWT.dll + + ..\ref\Techblox_Data\Managed\LiteNetLib.dll + ..\..\ref\Techblox_Data\Managed\LiteNetLib.dll + + + ..\ref\Techblox_Data\Managed\log4net.dll + ..\..\ref\Techblox_Data\Managed\log4net.dll + ..\ref\Techblox_Data\Managed\LZ4.dll ..\..\ref\Techblox_Data\Managed\LZ4.dll - - ..\ref\Techblox_Data\Managed\mscorlib.dll - ..\..\ref\Techblox_Data\Managed\mscorlib.dll + + ..\ref\Techblox_Data\Managed\Monobehaviours.dll + ..\..\ref\Techblox_Data\Managed\Monobehaviours.dll ..\ref\Techblox_Data\Managed\MultiplayerNetworking.dll @@ -383,6 +406,14 @@ ..\ref\Techblox_Data\Managed\Newtonsoft.Json.dll ..\..\ref\Techblox_Data\Managed\Newtonsoft.Json.dll + + ..\ref\Techblox_Data\Managed\Novell.Directory.Ldap.dll + ..\..\ref\Techblox_Data\Managed\Novell.Directory.Ldap.dll + + + ..\ref\Techblox_Data\Managed\Prometheus.NetStandard.dll + ..\..\ref\Techblox_Data\Managed\Prometheus.NetStandard.dll + ..\ref\Techblox_Data\Managed\RCX.ScreenshotTaker.dll ..\..\ref\Techblox_Data\Managed\RCX.ScreenshotTaker.dll @@ -395,6 +426,10 @@ ..\ref\Techblox_Data\Managed\Rewired_Windows.dll ..\..\ref\Techblox_Data\Managed\Rewired_Windows.dll + + ..\ref\Techblox_Data\Managed\RichFX.dll + ..\..\ref\Techblox_Data\Managed\RichFX.dll + ..\ref\Techblox_Data\Managed\RobocraftECS.dll ..\..\ref\Techblox_Data\Managed\RobocraftECS.dll @@ -423,6 +458,10 @@ ..\ref\Techblox_Data\Managed\RobocraftX.Building.Jobs.dll ..\..\ref\Techblox_Data\Managed\RobocraftX.Building.Jobs.dll + + ..\ref\Techblox_Data\Managed\RobocraftX.Character.Audio.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.Character.Audio.dll + ..\ref\Techblox_Data\Managed\RobocraftX.Character.dll ..\..\ref\Techblox_Data\Managed\RobocraftX.Character.dll @@ -495,6 +534,14 @@ ..\ref\Techblox_Data\Managed\RobocraftX.MainGame.dll ..\..\ref\Techblox_Data\Managed\RobocraftX.MainGame.dll + + ..\ref\Techblox_Data\Managed\RobocraftX.MainGameMock.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.MainGameMock.dll + + + ..\ref\Techblox_Data\Managed\RobocraftX.MainSimulation.Audio.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.MainSimulation.Audio.dll + ..\ref\Techblox_Data\Managed\RobocraftX.MainSimulation.dll ..\..\ref\Techblox_Data\Managed\RobocraftX.MainSimulation.dll @@ -543,10 +590,6 @@ ..\ref\Techblox_Data\Managed\RobocraftX.Player.dll ..\..\ref\Techblox_Data\Managed\RobocraftX.Player.dll - - ..\ref\Techblox_Data\Managed\RobocraftX.Rendering.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.Rendering.dll - ..\ref\Techblox_Data\Managed\RobocraftX.Rendering.Mock.dll ..\..\ref\Techblox_Data\Managed\RobocraftX.Rendering.Mock.dll @@ -583,6 +626,18 @@ ..\ref\Techblox_Data\Managed\RobocratX.SimulationMockCompositionRoot.dll ..\..\ref\Techblox_Data\Managed\RobocratX.SimulationMockCompositionRoot.dll + + ..\ref\Techblox_Data\Managed\Serilog.dll + ..\..\ref\Techblox_Data\Managed\Serilog.dll + + + ..\ref\Techblox_Data\Managed\Serilog.Sinks.Grafana.Loki.dll + ..\..\ref\Techblox_Data\Managed\Serilog.Sinks.Grafana.Loki.dll + + + ..\ref\Techblox_Data\Managed\ShaderVariantsGenerationTool.dll + ..\..\ref\Techblox_Data\Managed\ShaderVariantsGenerationTool.dll + ..\ref\Techblox_Data\Managed\SpecializedDescriptors.dll ..\..\ref\Techblox_Data\Managed\SpecializedDescriptors.dll @@ -611,6 +666,34 @@ ..\ref\Techblox_Data\Managed\Svelto.Tasks.dll ..\..\ref\Techblox_Data\Managed\Svelto.Tasks.dll + + ..\ref\Techblox_Data\Managed\Techblox.AdditionalParts.dll + ..\..\ref\Techblox_Data\Managed\Techblox.AdditionalParts.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Anticheat.Client.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Anticheat.Client.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Anticheat.Common.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Anticheat.Common.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Anticheat.Server.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Anticheat.Server.dll + + + ..\ref\Techblox_Data\Managed\Techblox.AtmosphereBlock.dll + ..\..\ref\Techblox_Data\Managed\Techblox.AtmosphereBlock.dll + + + ..\ref\Techblox_Data\Managed\Techblox.AudioBlocks.dll + ..\..\ref\Techblox_Data\Managed\Techblox.AudioBlocks.dll + + + ..\ref\Techblox_Data\Managed\Techblox.AudioBlocksClient.dll + ..\..\ref\Techblox_Data\Managed\Techblox.AudioBlocksClient.dll + ..\ref\Techblox_Data\Managed\Techblox.AutoForward.dll ..\..\ref\Techblox_Data\Managed\Techblox.AutoForward.dll @@ -619,6 +702,34 @@ ..\ref\Techblox_Data\Managed\Techblox.Backend.dll ..\..\ref\Techblox_Data\Managed\Techblox.Backend.dll + + ..\ref\Techblox_Data\Managed\Techblox.BitBlock.dll + ..\..\ref\Techblox_Data\Managed\Techblox.BitBlock.dll + + + ..\ref\Techblox_Data\Managed\Techblox.BlockColours.dll + ..\..\ref\Techblox_Data\Managed\Techblox.BlockColours.dll + + + ..\ref\Techblox_Data\Managed\Techblox.BlockLabels.dll + ..\..\ref\Techblox_Data\Managed\Techblox.BlockLabels.dll + + + ..\ref\Techblox_Data\Managed\Techblox.BlockLabelsServer.dll + ..\..\ref\Techblox_Data\Managed\Techblox.BlockLabelsServer.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Blocks.Connections.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Blocks.Connections.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Blocks.Debug.Client.Monobehaviours.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Blocks.Debug.Client.Monobehaviours.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Blocks.LightBlock.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Blocks.LightBlock.dll + ..\ref\Techblox_Data\Managed\Techblox.Building.Rules.dll ..\..\ref\Techblox_Data\Managed\Techblox.Building.Rules.dll @@ -631,10 +742,54 @@ ..\ref\Techblox_Data\Managed\Techblox.Camera.dll ..\..\ref\Techblox_Data\Managed\Techblox.Camera.dll + + ..\ref\Techblox_Data\Managed\Techblox.CentreHUDBlock.dll + ..\..\ref\Techblox_Data\Managed\Techblox.CentreHUDBlock.dll + + + ..\ref\Techblox_Data\Managed\Techblox.CentreHUDGUI.dll + ..\..\ref\Techblox_Data\Managed\Techblox.CentreHUDGUI.dll + + + ..\ref\Techblox_Data\Managed\Techblox.CheckpointBlock.dll + ..\..\ref\Techblox_Data\Managed\Techblox.CheckpointBlock.dll + + + ..\ref\Techblox_Data\Managed\Techblox.CheckpointBlockClient.dll + ..\..\ref\Techblox_Data\Managed\Techblox.CheckpointBlockClient.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Common.Audio.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Common.Audio.dll + + + ..\ref\Techblox_Data\Managed\Techblox.ConstantBlockClient.dll + ..\..\ref\Techblox_Data\Managed\Techblox.ConstantBlockClient.dll + + + ..\ref\Techblox_Data\Managed\Techblox.ConstantBlockServer.dll + ..\..\ref\Techblox_Data\Managed\Techblox.ConstantBlockServer.dll + ..\ref\Techblox_Data\Managed\Techblox.ContextSensitiveTextHint.dll ..\..\ref\Techblox_Data\Managed\Techblox.ContextSensitiveTextHint.dll + + ..\ref\Techblox_Data\Managed\Techblox.CounterBlockClient.dll + ..\..\ref\Techblox_Data\Managed\Techblox.CounterBlockClient.dll + + + ..\ref\Techblox_Data\Managed\Techblox.CounterBlockServer.dll + ..\..\ref\Techblox_Data\Managed\Techblox.CounterBlockServer.dll + + + ..\ref\Techblox_Data\Managed\Techblox.DistanceSensorBlock.dll + ..\..\ref\Techblox_Data\Managed\Techblox.DistanceSensorBlock.dll + + + ..\ref\Techblox_Data\Managed\Techblox.ECSResourceManagers.dll + ..\..\ref\Techblox_Data\Managed\Techblox.ECSResourceManagers.dll + ..\ref\Techblox_Data\Managed\Techblox.EngineBlock.dll ..\..\ref\Techblox_Data\Managed\Techblox.EngineBlock.dll @@ -643,6 +798,62 @@ ..\ref\Techblox_Data\Managed\Techblox.Environment.dll ..\..\ref\Techblox_Data\Managed\Techblox.Environment.dll + + ..\ref\Techblox_Data\Managed\Techblox.EnvironmentBlocks.BuildingEnvironment.dll + ..\..\ref\Techblox_Data\Managed\Techblox.EnvironmentBlocks.BuildingEnvironment.dll + + + ..\ref\Techblox_Data\Managed\Techblox.EnvironmentBlocks.dll + ..\..\ref\Techblox_Data\Managed\Techblox.EnvironmentBlocks.dll + + + ..\ref\Techblox_Data\Managed\Techblox.EnvironmentBlocks.SimulationWorldEnvironment.dll + ..\..\ref\Techblox_Data\Managed\Techblox.EnvironmentBlocks.SimulationWorldEnvironment.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Gameplay.Client.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.Client.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Gameplay.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Gameplay.GameState.Client.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.GameState.Client.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Gameplay.GameState.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.GameState.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Gameplay.PlayerGameplayDetails.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.PlayerGameplayDetails.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Gameplay.Score.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.Score.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Gameplay.Spawning.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.Spawning.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Gameplay.Teams.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.Teams.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Gameplay.WorldResetting.Client.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.WorldResetting.Client.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Gameplay.WorldResetting.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.WorldResetting.dll + + + ..\ref\Techblox_Data\Managed\Techblox.GameSelection.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GameSelection.dll + ..\ref\Techblox_Data\Managed\Techblox.GUI.Building.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Building.dll @@ -655,10 +866,30 @@ ..\ref\Techblox_Data\Managed\Techblox.GUI.BuildRules.MockUps.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.BuildRules.MockUps.dll + + ..\ref\Techblox_Data\Managed\Techblox.GUI.Commands.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Commands.dll + + + ..\ref\Techblox_Data\Managed\Techblox.GUI.Controls.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Controls.dll + ..\ref\Techblox_Data\Managed\Techblox.GUI.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.dll + + ..\ref\Techblox_Data\Managed\Techblox.GUI.GamePortal.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.GamePortal.dll + + + ..\ref\Techblox_Data\Managed\Techblox.GUI.GamePortal.MockUps.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.GamePortal.MockUps.dll + + + ..\ref\Techblox_Data\Managed\Techblox.GUI.Hotbar.Landscapes.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Hotbar.Landscapes.dll + ..\ref\Techblox_Data\Managed\Techblox.GUI.Hotbar.Materials.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Hotbar.Materials.dll @@ -667,54 +898,322 @@ ..\ref\Techblox_Data\Managed\Techblox.GUI.Inventory.Common.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Inventory.Common.dll + + ..\ref\Techblox_Data\Managed\Techblox.GUI.Inventory.Landscapes.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Inventory.Landscapes.dll + ..\ref\Techblox_Data\Managed\Techblox.GUI.Inventory.Materials.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Inventory.Materials.dll + + ..\ref\Techblox_Data\Managed\Techblox.GUI.LoadingBar.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.LoadingBar.dll + ..\ref\Techblox_Data\Managed\Techblox.GUI.Login.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Login.dll + + ..\ref\Techblox_Data\Managed\Techblox.GUI.MainGame.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.MainGame.dll + + + ..\ref\Techblox_Data\Managed\Techblox.GUI.Mocks.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Mocks.dll + + + ..\ref\Techblox_Data\Managed\Techblox.GUI.Mocks.DynamicListBuild.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Mocks.DynamicListBuild.dll + ..\ref\Techblox_Data\Managed\Techblox.GUI.MyGamesScreen.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.MyGamesScreen.dll - - ..\ref\Techblox_Data\Managed\Techblox.GUI.Notifications.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Notifications.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.Notifications.MockUps.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Notifications.MockUps.dll + + ..\ref\Techblox_Data\Managed\Techblox.GUI.PauseMenuCommands.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.PauseMenuCommands.dll + + + ..\ref\Techblox_Data\Managed\Techblox.GUI.Progression.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Progression.dll + + + ..\ref\Techblox_Data\Managed\Techblox.GUI.ScreenCanvas.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.ScreenCanvas.dll + + + ..\ref\Techblox_Data\Managed\Techblox.GUI.TabsBar.Landscapes.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.TabsBar.Landscapes.dll + ..\ref\Techblox_Data\Managed\Techblox.GUI.TabsBar.Materials.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.TabsBar.Materials.dll + + ..\ref\Techblox_Data\Managed\Techblox.GUI.UsernameDisplay.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.UsernameDisplay.dll + + + ..\ref\Techblox_Data\Managed\Techblox.GUI.WorldCanvas.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.WorldCanvas.dll + ..\ref\Techblox_Data\Managed\Techblox.InputCapture.dll ..\..\ref\Techblox_Data\Managed\Techblox.InputCapture.dll + + ..\ref\Techblox_Data\Managed\Techblox.JetBlock.dll + ..\..\ref\Techblox_Data\Managed\Techblox.JetBlock.dll + + + ..\ref\Techblox_Data\Managed\Techblox.JetBlockClient.dll + ..\..\ref\Techblox_Data\Managed\Techblox.JetBlockClient.dll + + + ..\ref\Techblox_Data\Managed\Techblox.MachineProcessingService.dll + ..\..\ref\Techblox_Data\Managed\Techblox.MachineProcessingService.dll + + + ..\ref\Techblox_Data\Managed\Techblox.MachineSimulationPreprocessing.dll + ..\..\ref\Techblox_Data\Managed\Techblox.MachineSimulationPreprocessing.dll + + + ..\ref\Techblox_Data\Managed\Techblox.MachineSpawning.dll + ..\..\ref\Techblox_Data\Managed\Techblox.MachineSpawning.dll + + + ..\ref\Techblox_Data\Managed\Techblox.MachineVelocityCameraEffects.dll + ..\..\ref\Techblox_Data\Managed\Techblox.MachineVelocityCameraEffects.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Matchmaking.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Matchmaking.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Monitoring.Server.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Monitoring.Server.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Multiplayer.UsernameMessages.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Multiplayer.UsernameMessages.dll + + + ..\ref\Techblox_Data\Managed\Techblox.ObjectIDBlockClient.dll + ..\..\ref\Techblox_Data\Managed\Techblox.ObjectIDBlockClient.dll + + + ..\ref\Techblox_Data\Managed\Techblox.ObjectIDBlockServer.dll + ..\..\ref\Techblox_Data\Managed\Techblox.ObjectIDBlockServer.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Particles.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Particles.dll + + + ..\ref\Techblox_Data\Managed\Techblox.PlayUX.dll + ..\..\ref\Techblox_Data\Managed\Techblox.PlayUX.dll + ..\ref\Techblox_Data\Managed\Techblox.Pointer.dll ..\..\ref\Techblox_Data\Managed\Techblox.Pointer.dll + + ..\ref\Techblox_Data\Managed\Techblox.ProceduralReflectionProbes.dll + ..\..\ref\Techblox_Data\Managed\Techblox.ProceduralReflectionProbes.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Rendering.Common.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Rendering.Common.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Rendering.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Rendering.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Rendering.DOTS.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Rendering.DOTS.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Rendering.GPUI.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Rendering.GPUI.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Rendering.Unity.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Rendering.Unity.dll + ..\ref\Techblox_Data\Managed\Techblox.SaveGamesConversion.dll ..\..\ref\Techblox_Data\Managed\Techblox.SaveGamesConversion.dll + + ..\ref\Techblox_Data\Managed\Techblox.ScoreHUDBlock.dll + ..\..\ref\Techblox_Data\Managed\Techblox.ScoreHUDBlock.dll + + + ..\ref\Techblox_Data\Managed\Techblox.ScoreHUDGUI.dll + ..\..\ref\Techblox_Data\Managed\Techblox.ScoreHUDGUI.dll + + + ..\ref\Techblox_Data\Managed\Techblox.ScorePickupBlockClient.dll + ..\..\ref\Techblox_Data\Managed\Techblox.ScorePickupBlockClient.dll + + + ..\ref\Techblox_Data\Managed\Techblox.ScorePickupBlockServer.dll + ..\..\ref\Techblox_Data\Managed\Techblox.ScorePickupBlockServer.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Server.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Server.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Services.Anticheat.Client.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Services.Anticheat.Client.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Services.Anticheat.Server.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Services.Anticheat.Server.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Services.Eos.Common.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Services.Eos.Common.dll + ..\ref\Techblox_Data\Managed\Techblox.Services.Eos.dll ..\..\ref\Techblox_Data\Managed\Techblox.Services.Eos.dll + + ..\ref\Techblox_Data\Managed\Techblox.Services.Eos.Server.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Services.Eos.Server.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Services.GameDetails.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Services.GameDetails.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Services.LocalPreferences.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Services.LocalPreferences.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Services.Matchmaking.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Services.Matchmaking.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Services.Metrics.Server.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Services.Metrics.Server.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Services.Progression.Client.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Services.Progression.Client.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Services.Storage.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Services.Storage.dll + + + ..\ref\Techblox_Data\Managed\Techblox.SignalHandling.Audio.dll + ..\..\ref\Techblox_Data\Managed\Techblox.SignalHandling.Audio.dll + + + ..\ref\Techblox_Data\Managed\Techblox.SignalHandling.Common.dll + ..\..\ref\Techblox_Data\Managed\Techblox.SignalHandling.Common.dll + + + ..\ref\Techblox_Data\Managed\Techblox.SpawnBlock.Client.dll + ..\..\ref\Techblox_Data\Managed\Techblox.SpawnBlock.Client.dll + + + ..\ref\Techblox_Data\Managed\Techblox.SpawnBlock.Server.dll + ..\..\ref\Techblox_Data\Managed\Techblox.SpawnBlock.Server.dll + + + ..\ref\Techblox_Data\Managed\Techblox.StabilizerBlock.dll + ..\..\ref\Techblox_Data\Managed\Techblox.StabilizerBlock.dll + + + ..\ref\Techblox_Data\Managed\Techblox.StabilizerBlockClient.dll + ..\..\ref\Techblox_Data\Managed\Techblox.StabilizerBlockClient.dll + ..\ref\Techblox_Data\Managed\Techblox.SwitchAnimation.dll ..\..\ref\Techblox_Data\Managed\Techblox.SwitchAnimation.dll + + ..\ref\Techblox_Data\Managed\Techblox.TeamScoreBlockClient.dll + ..\..\ref\Techblox_Data\Managed\Techblox.TeamScoreBlockClient.dll + + + ..\ref\Techblox_Data\Managed\Techblox.TeamScoreBlockServer.dll + ..\..\ref\Techblox_Data\Managed\Techblox.TeamScoreBlockServer.dll + + + ..\ref\Techblox_Data\Managed\Techblox.TechpointConverterBlock.dll + ..\..\ref\Techblox_Data\Managed\Techblox.TechpointConverterBlock.dll + + + ..\ref\Techblox_Data\Managed\Techblox.TechpointConverterGUI.TechPointPoolHUD.dll + ..\..\ref\Techblox_Data\Managed\Techblox.TechpointConverterGUI.TechPointPoolHUD.dll + + + ..\ref\Techblox_Data\Managed\Techblox.TechpointConverterGUI.TechpointRewardPanel.dll + ..\..\ref\Techblox_Data\Managed\Techblox.TechpointConverterGUI.TechpointRewardPanel.dll + + + ..\ref\Techblox_Data\Managed\Techblox.TextBlock.dll + ..\..\ref\Techblox_Data\Managed\Techblox.TextBlock.dll + + + ..\ref\Techblox_Data\Managed\Techblox.TimerBlock.dll + ..\..\ref\Techblox_Data\Managed\Techblox.TimerBlock.dll + + + ..\ref\Techblox_Data\Managed\Techblox.TriggerBlock.dll + ..\..\ref\Techblox_Data\Managed\Techblox.TriggerBlock.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Tweaks.Validation.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Tweaks.Validation.dll + + + ..\ref\Techblox_Data\Managed\Techblox.VFXBlockClient.dll + ..\..\ref\Techblox_Data\Managed\Techblox.VFXBlockClient.dll + + + ..\ref\Techblox_Data\Managed\Techblox.VFXBlockServer.dll + ..\..\ref\Techblox_Data\Managed\Techblox.VFXBlockServer.dll + + + ..\ref\Techblox_Data\Managed\Techblox.VisualEffects.VFXGraph.dll + ..\..\ref\Techblox_Data\Managed\Techblox.VisualEffects.VFXGraph.dll + + + ..\ref\Techblox_Data\Managed\Techblox.WheelFX.dll + ..\..\ref\Techblox_Data\Managed\Techblox.WheelFX.dll + ..\ref\Techblox_Data\Managed\Techblox.WheelRigBlock.dll ..\..\ref\Techblox_Data\Managed\Techblox.WheelRigBlock.dll + + ..\ref\Techblox_Data\Managed\Techblox.Wheels.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Wheels.dll + + + ..\ref\Techblox_Data\Managed\Techblox.WorldEditor.Spawning.dll + ..\..\ref\Techblox_Data\Managed\Techblox.WorldEditor.Spawning.dll + + + ..\ref\Techblox_Data\Managed\Techblox.WorldEditor.TestPlayers.dll + ..\..\ref\Techblox_Data\Managed\Techblox.WorldEditor.TestPlayers.dll + + + ..\ref\Techblox_Data\Managed\Techblox.WorldResetterBlock.dll + ..\..\ref\Techblox_Data\Managed\Techblox.WorldResetterBlock.dll + ..\ref\Techblox_Data\Managed\UniTask.Addressables.dll ..\..\ref\Techblox_Data\Managed\UniTask.Addressables.dll @@ -819,6 +1318,10 @@ ..\ref\Techblox_Data\Managed\Unity.Platforms.Common.dll ..\..\ref\Techblox_Data\Managed\Unity.Platforms.Common.dll + + ..\ref\Techblox_Data\Managed\Unity.Profiling.Core.dll + ..\..\ref\Techblox_Data\Managed\Unity.Profiling.Core.dll + ..\ref\Techblox_Data\Managed\Unity.Properties.dll ..\..\ref\Techblox_Data\Managed\Unity.Properties.dll @@ -839,6 +1342,10 @@ ..\ref\Techblox_Data\Managed\Unity.Recorder.dll ..\..\ref\Techblox_Data\Managed\Unity.Recorder.dll + + ..\ref\Techblox_Data\Managed\Unity.Rendering.Hybrid.dll + ..\..\ref\Techblox_Data\Managed\Unity.Rendering.Hybrid.dll + ..\ref\Techblox_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll ..\..\ref\Techblox_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll @@ -995,6 +1502,10 @@ ..\ref\Techblox_Data\Managed\UnityEngine.LocalizationModule.dll ..\..\ref\Techblox_Data\Managed\UnityEngine.LocalizationModule.dll + + ..\ref\Techblox_Data\Managed\UnityEngine.NVIDIAModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.NVIDIAModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.ParticleSystemModule.dll ..\..\ref\Techblox_Data\Managed\UnityEngine.ParticleSystemModule.dll @@ -1055,10 +1566,18 @@ ..\ref\Techblox_Data\Managed\UnityEngine.TerrainPhysicsModule.dll ..\..\ref\Techblox_Data\Managed\UnityEngine.TerrainPhysicsModule.dll + + ..\ref\Techblox_Data\Managed\UnityEngine.TextCoreFontEngineModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.TextCoreFontEngineModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.TextCoreModule.dll ..\..\ref\Techblox_Data\Managed\UnityEngine.TextCoreModule.dll + + ..\ref\Techblox_Data\Managed\UnityEngine.TextCoreTextEngineModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.TextCoreTextEngineModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.TextRenderingModule.dll ..\..\ref\Techblox_Data\Managed\UnityEngine.TextRenderingModule.dll @@ -1159,32 +1678,21 @@ ..\ref\Techblox_Data\Managed\UnityEngine.XRModule.dll ..\..\ref\Techblox_Data\Managed\UnityEngine.XRModule.dll - - ..\ref\Techblox_Data\Managed\uREPL.dll - ..\..\ref\Techblox_Data\Managed\uREPL.dll - ..\ref\Techblox_Data\Managed\VisualProfiler.dll ..\..\ref\Techblox_Data\Managed\VisualProfiler.dll + + ..\ref\Techblox_Data\Managed\websocket-sharp.dll + ..\..\ref\Techblox_Data\Managed\websocket-sharp.dll + + + ..\ref\Techblox_Data\Managed\Whinarn.UnityMeshSimplifier.Runtime.dll + ..\..\ref\Techblox_Data\Managed\Whinarn.UnityMeshSimplifier.Runtime.dll + - - + - - - {7fd5a7d8-4f3e-426a-b07d-7dc70442a4df} - TechbloxModdingAPI - - - - - - + + \ No newline at end of file diff --git a/CodeGenerator/Properties/AssemblyInfo.cs b/CodeGenerator/Properties/AssemblyInfo.cs deleted file mode 100644 index 18681a4..0000000 --- a/CodeGenerator/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("CodeGenerator")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("CodeGenerator")] -[assembly: AssemblyCopyright("Copyright © ExMods 2021")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("0EBB6400-95A7-4A3D-B2ED-BF31E364CC10")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file diff --git a/TechbloxModdingAPI/Blocks/BlockIDs.cs b/TechbloxModdingAPI/Blocks/BlockIDs.cs index 49993a3..22ee226 100644 --- a/TechbloxModdingAPI/Blocks/BlockIDs.cs +++ b/TechbloxModdingAPI/Blocks/BlockIDs.cs @@ -274,11 +274,25 @@ namespace TechbloxModdingAPI.Blocks /// The grid block used by the world editor, named Small Grid like the other one /// SmallGridInWorldEditor, - SegoeUITextblock = 376, + CityDoubleCrossing, + CityDoubleCrossroads, + CitySmallDoubleJunction, + CityDoubleJunction, + CityDoubleToSingleJunction, + CitySmallDoubleRoad, + CityDoubleRoad, + CitySmallDoubleTurn, + CityLargeDoubleTurn, + CitySmallSingleTurn, + CityLargeSingleTurn, + CitySingleJunction, + CitySingleRoad, + SegoeUITextblock, GravtracTextblock, HauserTextblock, TechnopollasTextblock, - DiagonalTrackTile = 381, + CityDoubleHillRoad, + DiagonalTrackTile, DiagonalTrackTile2, DiagonalTransitionTile, SplitLane, @@ -299,8 +313,13 @@ namespace TechbloxModdingAPI.Blocks DirtInnerCorner3, DirtOuterCorner2 = 405, DirtOuterCorner3, - SmallGrassQuarterTile = 411, - HUDTimer = 413, + CityTarmacEdgeInner, + CityTarmacEdgeOuter, + CityTarmacEdgeRoad, + CityTarmac, + SmallGrassQuarterTile, + CityToRacetrackTransition, + HUDTimer, CentreHUD, Checkpoint, ScoreboardHUD, @@ -319,5 +338,8 @@ namespace TechbloxModdingAPI.Blocks StreetLamp = 435, ConstantBlock = 452, CounterBlock, + SmallGridHill, + SmallGridHillInnerCorner, + SmallGridHillOuterCorner } } \ No newline at end of file diff --git a/TechbloxModdingAPI/Blocks/BlockMaterial.cs b/TechbloxModdingAPI/Blocks/BlockMaterial.cs index 32bd967..fe98bd9 100644 --- a/TechbloxModdingAPI/Blocks/BlockMaterial.cs +++ b/TechbloxModdingAPI/Blocks/BlockMaterial.cs @@ -32,5 +32,6 @@ namespace TechbloxModdingAPI.Blocks WoodPainted, WoodRoughGrungy, Boundary, + Emissive } } \ No newline at end of file diff --git a/TechbloxModdingAPI/Blocks/BlockTests.cs b/TechbloxModdingAPI/Blocks/BlockTests.cs index d9ce279..d1fc146 100644 --- a/TechbloxModdingAPI/Blocks/BlockTests.cs +++ b/TechbloxModdingAPI/Blocks/BlockTests.cs @@ -7,9 +7,7 @@ using DataLoader; using Svelto.Tasks; using Svelto.Tasks.Enumerators; using Unity.Mathematics; -using UnityEngine; -using TechbloxModdingAPI.App; using TechbloxModdingAPI.Tests; using TechbloxModdingAPI.Utility; @@ -82,7 +80,7 @@ namespace TechbloxModdingAPI.Blocks yield break; for (var index = 0; index < blocks.Length; index++) { - if (index % 50 == 0) yield return new WaitForSecondsEnumerator(1f).Continue(); //The material or flipped status can only be changed 130 times per submission + if (index % 10 == 0) yield return new WaitForSecondsEnumerator(1f).Continue(); //The material or flipped status can only be changed 130 times per submission var block = blocks[index]; if (!block.Exists) continue; foreach (var property in block.GetType().GetProperties()) diff --git a/TechbloxModdingAPI/Blocks/Engines/MovementEngine.cs b/TechbloxModdingAPI/Blocks/Engines/MovementEngine.cs index f9d65d8..12996b0 100644 --- a/TechbloxModdingAPI/Blocks/Engines/MovementEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/MovementEngine.cs @@ -40,7 +40,7 @@ namespace TechbloxModdingAPI.Blocks.Engines ref PositionEntityStruct posStruct = ref this.entitiesDB.QueryEntityOrDefault(block); ref GridRotationStruct gridStruct = ref this.entitiesDB.QueryEntityOrDefault(block); ref LocalTransformEntityStruct transStruct = ref this.entitiesDB.QueryEntityOrDefault(block); - ref DOTSPhysicsEntityStruct phyStruct = ref this.entitiesDB.QueryEntityOrDefault(block); + var phyStruct = this.entitiesDB.QueryEntityOptional(block); // main (persistent) position posStruct.position = vector; // placement grid position @@ -48,9 +48,9 @@ namespace TechbloxModdingAPI.Blocks.Engines // rendered position transStruct.position = vector; // collision position - if (phyStruct.ID != default) + if (phyStruct) { //It exists - FullGameFields._physicsWorld.EntityManager.SetComponentData(phyStruct.dotsEntity, new Translation + FullGameFields._physicsWorld.EntityManager.SetComponentData(phyStruct.Get().dotsEntity, new Translation { Value = posStruct.position }); diff --git a/TechbloxModdingAPI/Blocks/Engines/RotationEngine.cs b/TechbloxModdingAPI/Blocks/Engines/RotationEngine.cs index 4186bfd..8c639e8 100644 --- a/TechbloxModdingAPI/Blocks/Engines/RotationEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/RotationEngine.cs @@ -40,7 +40,7 @@ namespace TechbloxModdingAPI.Blocks.Engines ref RotationEntityStruct rotStruct = ref this.entitiesDB.QueryEntityOrDefault(block); ref GridRotationStruct gridStruct = ref this.entitiesDB.QueryEntityOrDefault(block); ref LocalTransformEntityStruct transStruct = ref this.entitiesDB.QueryEntityOrDefault(block); - ref DOTSPhysicsEntityStruct phyStruct = ref this.entitiesDB.QueryEntityOrDefault(block); + var phyStruct = this.entitiesDB.QueryEntityOptional(block); // main (persistent) rotation Quaternion newRotation = rotStruct.rotation; newRotation.eulerAngles = vector; @@ -50,9 +50,9 @@ namespace TechbloxModdingAPI.Blocks.Engines // rendered rotation transStruct.rotation = newRotation; // collision rotation - if (phyStruct.ID != default) + if (phyStruct) { //It exists - FullGameFields._physicsWorld.EntityManager.SetComponentData(phyStruct.dotsEntity, + FullGameFields._physicsWorld.EntityManager.SetComponentData(phyStruct.Get().dotsEntity, new Unity.Transforms.Rotation { Value = rotStruct.rotation diff --git a/TechbloxModdingAPI/TechbloxModdingAPI.csproj b/TechbloxModdingAPI/TechbloxModdingAPI.csproj index ff031a7..619dcda 100644 --- a/TechbloxModdingAPI/TechbloxModdingAPI.csproj +++ b/TechbloxModdingAPI/TechbloxModdingAPI.csproj @@ -1,6 +1,6 @@  - net472 + netstandard2.1 true 2.2.0 Exmods @@ -19,9 +19,7 @@ - - - + @@ -29,6 +27,18 @@ + + ..\ref\Techblox_Data\Managed\IllusionInjector.dll + ..\..\ref\Techblox_Data\Managed\IllusionInjector.dll + + + ..\ref\Techblox_Data\Managed\IllusionPlugin.dll + ..\..\ref\Techblox_Data\Managed\IllusionPlugin.dll + + + ..\ref\Techblox_Data\Managed\Accessibility.dll + ..\..\ref\Techblox_Data\Managed\Accessibility.dll + ..\ref\Techblox_Data\Managed\Analytics.dll ..\..\ref\Techblox_Data\Managed\Analytics.dll @@ -389,14 +399,18 @@ ..\ref\Techblox_Data\Managed\MultiplayerTest.dll ..\..\ref\Techblox_Data\Managed\MultiplayerTest.dll - - ..\ref\Techblox_Data\Managed\netstandard.dll - ..\..\ref\Techblox_Data\Managed\netstandard.dll - ..\ref\Techblox_Data\Managed\Newtonsoft.Json.dll ..\..\ref\Techblox_Data\Managed\Newtonsoft.Json.dll + + ..\ref\Techblox_Data\Managed\Novell.Directory.Ldap.dll + ..\..\ref\Techblox_Data\Managed\Novell.Directory.Ldap.dll + + + ..\ref\Techblox_Data\Managed\Prometheus.NetStandard.dll + ..\..\ref\Techblox_Data\Managed\Prometheus.NetStandard.dll + ..\ref\Techblox_Data\Managed\RCX.ScreenshotTaker.dll ..\..\ref\Techblox_Data\Managed\RCX.ScreenshotTaker.dll @@ -609,6 +623,14 @@ ..\ref\Techblox_Data\Managed\RobocratX.SimulationMockCompositionRoot.dll ..\..\ref\Techblox_Data\Managed\RobocratX.SimulationMockCompositionRoot.dll + + ..\ref\Techblox_Data\Managed\Serilog.dll + ..\..\ref\Techblox_Data\Managed\Serilog.dll + + + ..\ref\Techblox_Data\Managed\Serilog.Sinks.Grafana.Loki.dll + ..\..\ref\Techblox_Data\Managed\Serilog.Sinks.Grafana.Loki.dll + ..\ref\Techblox_Data\Managed\ShaderVariantsGenerationTool.dll ..\..\ref\Techblox_Data\Managed\ShaderVariantsGenerationTool.dll @@ -697,6 +719,10 @@ ..\ref\Techblox_Data\Managed\Techblox.Blocks.Connections.dll ..\..\ref\Techblox_Data\Managed\Techblox.Blocks.Connections.dll + + ..\ref\Techblox_Data\Managed\Techblox.Blocks.Debug.Client.Monobehaviours.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Blocks.Debug.Client.Monobehaviours.dll + ..\ref\Techblox_Data\Managed\Techblox.Blocks.LightBlock.dll ..\..\ref\Techblox_Data\Managed\Techblox.Blocks.LightBlock.dll @@ -733,10 +759,26 @@ ..\ref\Techblox_Data\Managed\Techblox.Common.Audio.dll ..\..\ref\Techblox_Data\Managed\Techblox.Common.Audio.dll + + ..\ref\Techblox_Data\Managed\Techblox.ConstantBlockClient.dll + ..\..\ref\Techblox_Data\Managed\Techblox.ConstantBlockClient.dll + + + ..\ref\Techblox_Data\Managed\Techblox.ConstantBlockServer.dll + ..\..\ref\Techblox_Data\Managed\Techblox.ConstantBlockServer.dll + ..\ref\Techblox_Data\Managed\Techblox.ContextSensitiveTextHint.dll ..\..\ref\Techblox_Data\Managed\Techblox.ContextSensitiveTextHint.dll + + ..\ref\Techblox_Data\Managed\Techblox.CounterBlockClient.dll + ..\..\ref\Techblox_Data\Managed\Techblox.CounterBlockClient.dll + + + ..\ref\Techblox_Data\Managed\Techblox.CounterBlockServer.dll + ..\..\ref\Techblox_Data\Managed\Techblox.CounterBlockServer.dll + ..\ref\Techblox_Data\Managed\Techblox.DistanceSensorBlock.dll ..\..\ref\Techblox_Data\Managed\Techblox.DistanceSensorBlock.dll @@ -869,6 +911,10 @@ ..\ref\Techblox_Data\Managed\Techblox.GUI.Login.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Login.dll + + ..\ref\Techblox_Data\Managed\Techblox.GUI.MainGame.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.MainGame.dll + ..\ref\Techblox_Data\Managed\Techblox.GUI.Mocks.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Mocks.dll @@ -885,6 +931,14 @@ ..\ref\Techblox_Data\Managed\Techblox.GUI.Notifications.MockUps.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Notifications.MockUps.dll + + ..\ref\Techblox_Data\Managed\Techblox.GUI.PauseMenuCommands.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.PauseMenuCommands.dll + + + ..\ref\Techblox_Data\Managed\Techblox.GUI.Progression.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Progression.dll + ..\ref\Techblox_Data\Managed\Techblox.GUI.ScreenCanvas.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.ScreenCanvas.dll @@ -937,10 +991,22 @@ ..\ref\Techblox_Data\Managed\Techblox.Matchmaking.dll ..\..\ref\Techblox_Data\Managed\Techblox.Matchmaking.dll + + ..\ref\Techblox_Data\Managed\Techblox.Monitoring.Server.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Monitoring.Server.dll + ..\ref\Techblox_Data\Managed\Techblox.Multiplayer.UsernameMessages.dll ..\..\ref\Techblox_Data\Managed\Techblox.Multiplayer.UsernameMessages.dll + + ..\ref\Techblox_Data\Managed\Techblox.ObjectIDBlockClient.dll + ..\..\ref\Techblox_Data\Managed\Techblox.ObjectIDBlockClient.dll + + + ..\ref\Techblox_Data\Managed\Techblox.ObjectIDBlockServer.dll + ..\..\ref\Techblox_Data\Managed\Techblox.ObjectIDBlockServer.dll + ..\ref\Techblox_Data\Managed\Techblox.Particles.dll ..\..\ref\Techblox_Data\Managed\Techblox.Particles.dll @@ -989,6 +1055,14 @@ ..\ref\Techblox_Data\Managed\Techblox.ScoreHUDGUI.dll ..\..\ref\Techblox_Data\Managed\Techblox.ScoreHUDGUI.dll + + ..\ref\Techblox_Data\Managed\Techblox.ScorePickupBlockClient.dll + ..\..\ref\Techblox_Data\Managed\Techblox.ScorePickupBlockClient.dll + + + ..\ref\Techblox_Data\Managed\Techblox.ScorePickupBlockServer.dll + ..\..\ref\Techblox_Data\Managed\Techblox.ScorePickupBlockServer.dll + ..\ref\Techblox_Data\Managed\Techblox.Server.dll ..\..\ref\Techblox_Data\Managed\Techblox.Server.dll @@ -1025,6 +1099,14 @@ ..\ref\Techblox_Data\Managed\Techblox.Services.Matchmaking.dll ..\..\ref\Techblox_Data\Managed\Techblox.Services.Matchmaking.dll + + ..\ref\Techblox_Data\Managed\Techblox.Services.Metrics.Server.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Services.Metrics.Server.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Services.Progression.Client.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Services.Progression.Client.dll + ..\ref\Techblox_Data\Managed\Techblox.Services.Storage.dll ..\..\ref\Techblox_Data\Managed\Techblox.Services.Storage.dll @@ -1057,6 +1139,26 @@ ..\ref\Techblox_Data\Managed\Techblox.SwitchAnimation.dll ..\..\ref\Techblox_Data\Managed\Techblox.SwitchAnimation.dll + + ..\ref\Techblox_Data\Managed\Techblox.TeamScoreBlockClient.dll + ..\..\ref\Techblox_Data\Managed\Techblox.TeamScoreBlockClient.dll + + + ..\ref\Techblox_Data\Managed\Techblox.TeamScoreBlockServer.dll + ..\..\ref\Techblox_Data\Managed\Techblox.TeamScoreBlockServer.dll + + + ..\ref\Techblox_Data\Managed\Techblox.TechpointConverterBlock.dll + ..\..\ref\Techblox_Data\Managed\Techblox.TechpointConverterBlock.dll + + + ..\ref\Techblox_Data\Managed\Techblox.TechpointConverterGUI.TechPointPoolHUD.dll + ..\..\ref\Techblox_Data\Managed\Techblox.TechpointConverterGUI.TechPointPoolHUD.dll + + + ..\ref\Techblox_Data\Managed\Techblox.TechpointConverterGUI.TechpointRewardPanel.dll + ..\..\ref\Techblox_Data\Managed\Techblox.TechpointConverterGUI.TechpointRewardPanel.dll + ..\ref\Techblox_Data\Managed\Techblox.TextBlock.dll ..\..\ref\Techblox_Data\Managed\Techblox.TextBlock.dll @@ -1069,10 +1171,42 @@ ..\ref\Techblox_Data\Managed\Techblox.TriggerBlock.dll ..\..\ref\Techblox_Data\Managed\Techblox.TriggerBlock.dll + + ..\ref\Techblox_Data\Managed\Techblox.Tweaks.Validation.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Tweaks.Validation.dll + + + ..\ref\Techblox_Data\Managed\Techblox.VFXBlockClient.dll + ..\..\ref\Techblox_Data\Managed\Techblox.VFXBlockClient.dll + + + ..\ref\Techblox_Data\Managed\Techblox.VFXBlockServer.dll + ..\..\ref\Techblox_Data\Managed\Techblox.VFXBlockServer.dll + + + ..\ref\Techblox_Data\Managed\Techblox.VisualEffects.VFXGraph.dll + ..\..\ref\Techblox_Data\Managed\Techblox.VisualEffects.VFXGraph.dll + + + ..\ref\Techblox_Data\Managed\Techblox.WheelFX.dll + ..\..\ref\Techblox_Data\Managed\Techblox.WheelFX.dll + ..\ref\Techblox_Data\Managed\Techblox.WheelRigBlock.dll ..\..\ref\Techblox_Data\Managed\Techblox.WheelRigBlock.dll + + ..\ref\Techblox_Data\Managed\Techblox.Wheels.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Wheels.dll + + + ..\ref\Techblox_Data\Managed\Techblox.WorldEditor.Spawning.dll + ..\..\ref\Techblox_Data\Managed\Techblox.WorldEditor.Spawning.dll + + + ..\ref\Techblox_Data\Managed\Techblox.WorldEditor.TestPlayers.dll + ..\..\ref\Techblox_Data\Managed\Techblox.WorldEditor.TestPlayers.dll + ..\ref\Techblox_Data\Managed\Techblox.WorldResetterBlock.dll ..\..\ref\Techblox_Data\Managed\Techblox.WorldResetterBlock.dll @@ -1365,6 +1499,10 @@ ..\ref\Techblox_Data\Managed\UnityEngine.LocalizationModule.dll ..\..\ref\Techblox_Data\Managed\UnityEngine.LocalizationModule.dll + + ..\ref\Techblox_Data\Managed\UnityEngine.NVIDIAModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.NVIDIAModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.ParticleSystemModule.dll ..\..\ref\Techblox_Data\Managed\UnityEngine.ParticleSystemModule.dll @@ -1425,10 +1563,18 @@ ..\ref\Techblox_Data\Managed\UnityEngine.TerrainPhysicsModule.dll ..\..\ref\Techblox_Data\Managed\UnityEngine.TerrainPhysicsModule.dll + + ..\ref\Techblox_Data\Managed\UnityEngine.TextCoreFontEngineModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.TextCoreFontEngineModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.TextCoreModule.dll ..\..\ref\Techblox_Data\Managed\UnityEngine.TextCoreModule.dll + + ..\ref\Techblox_Data\Managed\UnityEngine.TextCoreTextEngineModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.TextCoreTextEngineModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.TextRenderingModule.dll ..\..\ref\Techblox_Data\Managed\UnityEngine.TextRenderingModule.dll diff --git a/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs b/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs index 7564816..4307f16 100644 --- a/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs +++ b/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs @@ -261,7 +261,7 @@ namespace TechbloxModdingAPI.Tests /*((FasterList)AccessTools.Property(typeof(GuiInputMap), "GuiInputsButtonDown").GetValue(null)) .Add(new GuiInputMap.GuiInputMapElement(RewiredConsts.Action.ToggleCommandLine, GuiIn))*/ - /*Game.Enter += (sender, e) => + Game.Enter += (sender, e) => { ushort lastKey = ushort.MaxValue; foreach (var kv in FullGameFields._dataDb.GetValues() @@ -299,7 +299,7 @@ namespace TechbloxModdingAPI.Tests return result; }) .Aggregate((a, b) => a + "\n" + b)); - };*/ + }; CommandBuilder.Builder("takeScreenshot", "Enables the screenshot taker") .Action(() => -- 2.30.2 From f9aa6ce2bb5e4428d43a822bc39bf74dc92ef714 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Tue, 12 Apr 2022 00:52:24 +0200 Subject: [PATCH 241/252] Re-add object ID class, add some wheel rig properties, remove old game assembly refernces --- CodeGenerator/BlockClassGenerator.cs | 4 +- CodeGenerator/CodeGenerator.csproj | 177 +----------------- CodeGenerator/Program.cs | 2 + .../Blocks/Engines/BlockEngine.cs | 20 +- TechbloxModdingAPI/Blocks/ObjectID.cs | 50 +++++ TechbloxModdingAPI/Blocks/WheelRig.cs | 30 +++ TechbloxModdingAPI/Players/PlayerEngine.cs | 9 - TechbloxModdingAPI/TechbloxModdingAPI.csproj | 168 ----------------- .../Tests/TechbloxModdingAPIPluginTest.cs | 4 +- 9 files changed, 106 insertions(+), 358 deletions(-) create mode 100644 TechbloxModdingAPI/Blocks/ObjectID.cs diff --git a/CodeGenerator/BlockClassGenerator.cs b/CodeGenerator/BlockClassGenerator.cs index a56b222..77d4ad4 100644 --- a/CodeGenerator/BlockClassGenerator.cs +++ b/CodeGenerator/BlockClassGenerator.cs @@ -22,7 +22,7 @@ namespace CodeGenerator group = GetGroup(name) + "_BLOCK_BUILD_GROUP"; } - if (!group.Contains(".")) + if (!group.Contains('.')) group = "CommonExclusiveGroups." + group; var codeUnit = new CodeCompileUnit(); @@ -67,7 +67,7 @@ namespace CodeGenerator codeUnit.Namespaces.Add(ns); var provider = CodeDomProvider.CreateProvider("CSharp"); - var path = $@"..\..\..\TechbloxModdingAPI\Blocks\{name}.cs"; + var path = $@"..\..\..\..\TechbloxModdingAPI\Blocks\{name}.cs"; using (var sw = new StreamWriter(path)) { provider.GenerateCodeFromCompileUnit(codeUnit, sw, new CodeGeneratorOptions {BracingStyle = "C"}); diff --git a/CodeGenerator/CodeGenerator.csproj b/CodeGenerator/CodeGenerator.csproj index 035bf46..554855f 100644 --- a/CodeGenerator/CodeGenerator.csproj +++ b/CodeGenerator/CodeGenerator.csproj @@ -9,6 +9,7 @@ en-CA true 9 + Exe @@ -66,10 +67,6 @@ ..\ref\Techblox_Data\Managed\BevelEffect.dll ..\..\ref\Techblox_Data\Managed\BevelEffect.dll - - ..\ref\Techblox_Data\Managed\Blocks.HUDFeedbackBlocks.dll - ..\..\ref\Techblox_Data\Managed\Blocks.HUDFeedbackBlocks.dll - ..\ref\Techblox_Data\Managed\Boxophobic.TheVehetationEngine.Runtime.dll ..\..\ref\Techblox_Data\Managed\Boxophobic.TheVehetationEngine.Runtime.dll @@ -110,10 +107,6 @@ ..\ref\Techblox_Data\Managed\FullGame.dll ..\..\ref\Techblox_Data\Managed\FullGame.dll - - ..\ref\Techblox_Data\Managed\Gamecraft.AudioBlocks.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.AudioBlocks.dll - ..\ref\Techblox_Data\Managed\Gamecraft.BlockEntityFactory.dll ..\..\ref\Techblox_Data\Managed\Gamecraft.BlockEntityFactory.dll @@ -122,46 +115,18 @@ ..\ref\Techblox_Data\Managed\Gamecraft.BlockGroups.dll ..\..\ref\Techblox_Data\Managed\Gamecraft.BlockGroups.dll - - ..\ref\Techblox_Data\Managed\Gamecraft.Blocks.DamagingSurfaceBlock.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.Blocks.DamagingSurfaceBlock.dll - ..\ref\Techblox_Data\Managed\Gamecraft.Blocks.DestructionBlocks.dll ..\..\ref\Techblox_Data\Managed\Gamecraft.Blocks.DestructionBlocks.dll - - ..\ref\Techblox_Data\Managed\Gamecraft.Blocks.GenericPhysicsBlocks.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.Blocks.GenericPhysicsBlocks.dll - ..\ref\Techblox_Data\Managed\Gamecraft.Blocks.LogicBlock.dll ..\..\ref\Techblox_Data\Managed\Gamecraft.Blocks.LogicBlock.dll - - ..\ref\Techblox_Data\Managed\GameCraft.Blocks.ProjectileBlock.dll - ..\..\ref\Techblox_Data\Managed\GameCraft.Blocks.ProjectileBlock.dll - - - ..\ref\Techblox_Data\Managed\Gamecraft.Blocks.TextBlock.CompositionRoot.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.Blocks.TextBlock.CompositionRoot.dll - - - ..\ref\Techblox_Data\Managed\Gamecraft.Blocks.TimerBlock.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.Blocks.TimerBlock.dll - ..\ref\Techblox_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll ..\..\ref\Techblox_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll - - ..\ref\Techblox_Data\Managed\Gamecraft.CharacterVulnerability.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.CharacterVulnerability.dll - - - ..\ref\Techblox_Data\Managed\Gamecraft.CharacterVulnerabilityGui.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.CharacterVulnerabilityGui.dll - ..\ref\Techblox_Data\Managed\Gamecraft.ColourPalette.dll ..\..\ref\Techblox_Data\Managed\Gamecraft.ColourPalette.dll @@ -186,10 +151,6 @@ ..\ref\Techblox_Data\Managed\Gamecraft.GUI.BlueprintInventory.dll ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.BlueprintInventory.dll - - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.BlueprintInventoryMock.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.BlueprintInventoryMock.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.Blueprints.dll ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.Blueprints.dll @@ -218,10 +179,6 @@ ..\ref\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.Colours.dll ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.Colours.dll - - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.HUDFeedbackBlocks.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.HUDFeedbackBlocks.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.ModeBar.dll ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.ModeBar.dll @@ -246,10 +203,6 @@ ..\ref\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Common.dll ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Common.dll - - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.TimeModeClock.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.TimeModeClock.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.Tweaks.dll ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.Tweaks.dll @@ -258,18 +211,10 @@ ..\ref\Techblox_Data\Managed\Gamecraft.GUI.Wires.dll ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.Wires.dll - - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.Wires.Mockup.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.Wires.Mockup.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll - - ..\ref\Techblox_Data\Managed\Gamecraft.InventoryTimeRunning.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.InventoryTimeRunning.dll - ..\ref\Techblox_Data\Managed\Gamecraft.JointBlocks.dll ..\..\ref\Techblox_Data\Managed\Gamecraft.JointBlocks.dll @@ -282,14 +227,6 @@ ..\ref\Techblox_Data\Managed\Gamecraft.NetStrings.dll ..\..\ref\Techblox_Data\Managed\Gamecraft.NetStrings.dll - - ..\ref\Techblox_Data\Managed\Gamecraft.PerformanceWarnings.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.PerformanceWarnings.dll - - - ..\ref\Techblox_Data\Managed\Gamecraft.PickupBlck.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.PickupBlck.dll - ..\ref\Techblox_Data\Managed\Gamecraft.PickupsCommon.dll ..\..\ref\Techblox_Data\Managed\Gamecraft.PickupsCommon.dll @@ -298,10 +235,6 @@ ..\ref\Techblox_Data\Managed\Gamecraft.PopupMessage.dll ..\..\ref\Techblox_Data\Managed\Gamecraft.PopupMessage.dll - - ..\ref\Techblox_Data\Managed\Gamecraft.Projectiles.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.Projectiles.dll - ..\ref\Techblox_Data\Managed\Gamecraft.Serialization.dll ..\..\ref\Techblox_Data\Managed\Gamecraft.Serialization.dll @@ -310,26 +243,14 @@ ..\ref\Techblox_Data\Managed\Gamecraft.Tweaks.dll ..\..\ref\Techblox_Data\Managed\Gamecraft.Tweaks.dll - - ..\ref\Techblox_Data\Managed\Gamecraft.Tweaks.Mockup.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.Tweaks.Mockup.dll - ..\ref\Techblox_Data\Managed\Gamecraft.VisualEffects.Decals.dll ..\..\ref\Techblox_Data\Managed\Gamecraft.VisualEffects.Decals.dll - - ..\ref\Techblox_Data\Managed\Gamecraft.VisualEffects.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.VisualEffects.dll - ..\ref\Techblox_Data\Managed\Gamecraft.Wires.dll ..\..\ref\Techblox_Data\Managed\Gamecraft.Wires.dll - - ..\ref\Techblox_Data\Managed\Gamecraft.Wires.Mockup.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.Wires.Mockup.dll - ..\ref\Techblox_Data\Managed\GameLiftServerSDKNet45.dll ..\..\ref\Techblox_Data\Managed\GameLiftServerSDKNet45.dll @@ -362,14 +283,6 @@ ..\ref\Techblox_Data\Managed\Havok.Physics.Hybrid.dll ..\..\ref\Techblox_Data\Managed\Havok.Physics.Hybrid.dll - - ..\ref\Techblox_Data\Managed\IllusionInjector.dll - ..\..\ref\Techblox_Data\Managed\IllusionInjector.dll - - - ..\ref\Techblox_Data\Managed\IllusionPlugin.dll - ..\..\ref\Techblox_Data\Managed\IllusionPlugin.dll - ..\ref\Techblox_Data\Managed\JWT.dll ..\..\ref\Techblox_Data\Managed\JWT.dll @@ -390,18 +303,14 @@ ..\ref\Techblox_Data\Managed\Monobehaviours.dll ..\..\ref\Techblox_Data\Managed\Monobehaviours.dll + + ..\ref\Techblox_Data\Managed\mscorlib.dll + ..\..\ref\Techblox_Data\Managed\mscorlib.dll + ..\ref\Techblox_Data\Managed\MultiplayerNetworking.dll ..\..\ref\Techblox_Data\Managed\MultiplayerNetworking.dll - - ..\ref\Techblox_Data\Managed\MultiplayerTest.dll - ..\..\ref\Techblox_Data\Managed\MultiplayerTest.dll - - - ..\ref\Techblox_Data\Managed\netstandard.dll - ..\..\ref\Techblox_Data\Managed\netstandard.dll - ..\ref\Techblox_Data\Managed\Newtonsoft.Json.dll ..\..\ref\Techblox_Data\Managed\Newtonsoft.Json.dll @@ -482,10 +391,6 @@ ..\ref\Techblox_Data\Managed\RobocraftX.FrontEnd.dll ..\..\ref\Techblox_Data\Managed\RobocraftX.FrontEnd.dll - - ..\ref\Techblox_Data\Managed\RobocraftX.GUI.BlockLabel.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.BlockLabel.dll - ..\ref\Techblox_Data\Managed\RobocraftX.GUI.DebugDisplay.dll ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.DebugDisplay.dll @@ -534,10 +439,6 @@ ..\ref\Techblox_Data\Managed\RobocraftX.MainGame.dll ..\..\ref\Techblox_Data\Managed\RobocraftX.MainGame.dll - - ..\ref\Techblox_Data\Managed\RobocraftX.MainGameMock.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.MainGameMock.dll - ..\ref\Techblox_Data\Managed\RobocraftX.MainSimulation.Audio.dll ..\..\ref\Techblox_Data\Managed\RobocraftX.MainSimulation.Audio.dll @@ -546,18 +447,10 @@ ..\ref\Techblox_Data\Managed\RobocraftX.MainSimulation.dll ..\..\ref\Techblox_Data\Managed\RobocraftX.MainSimulation.dll - - ..\ref\Techblox_Data\Managed\RobocraftX.MockCharacter.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.MockCharacter.dll - ..\ref\Techblox_Data\Managed\RobocraftX.Multiplayer.dll ..\..\ref\Techblox_Data\Managed\RobocraftX.Multiplayer.dll - - ..\ref\Techblox_Data\Managed\RobocraftX.Multiplayer.GUI.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.Multiplayer.GUI.dll - ..\ref\Techblox_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll ..\..\ref\Techblox_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll @@ -574,10 +467,6 @@ ..\ref\Techblox_Data\Managed\RobocraftX.ObjectIdBlocks.dll ..\..\ref\Techblox_Data\Managed\RobocraftX.ObjectIdBlocks.dll - - ..\ref\Techblox_Data\Managed\RobocraftX.Party.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.Party.dll - ..\ref\Techblox_Data\Managed\RobocraftX.Physics.dll ..\..\ref\Techblox_Data\Managed\RobocraftX.Physics.dll @@ -590,10 +479,6 @@ ..\ref\Techblox_Data\Managed\RobocraftX.Player.dll ..\..\ref\Techblox_Data\Managed\RobocraftX.Player.dll - - ..\ref\Techblox_Data\Managed\RobocraftX.Rendering.Mock.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.Rendering.Mock.dll - ..\ref\Techblox_Data\Managed\RobocraftX.SaveAndLoad.dll ..\..\ref\Techblox_Data\Managed\RobocraftX.SaveAndLoad.dll @@ -610,22 +495,10 @@ ..\ref\Techblox_Data\Managed\RobocraftX.SignalHandling.dll ..\..\ref\Techblox_Data\Managed\RobocraftX.SignalHandling.dll - - ..\ref\Techblox_Data\Managed\RobocraftX.SpawnPoints.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.SpawnPoints.dll - ..\ref\Techblox_Data\Managed\RobocraftX.StateSync.dll ..\..\ref\Techblox_Data\Managed\RobocraftX.StateSync.dll - - ..\ref\Techblox_Data\Managed\RobocraftX_TextBlock.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX_TextBlock.dll - - - ..\ref\Techblox_Data\Managed\RobocratX.SimulationMockCompositionRoot.dll - ..\..\ref\Techblox_Data\Managed\RobocratX.SimulationMockCompositionRoot.dll - ..\ref\Techblox_Data\Managed\Serilog.dll ..\..\ref\Techblox_Data\Managed\Serilog.dll @@ -794,10 +667,6 @@ ..\ref\Techblox_Data\Managed\Techblox.EngineBlock.dll ..\..\ref\Techblox_Data\Managed\Techblox.EngineBlock.dll - - ..\ref\Techblox_Data\Managed\Techblox.Environment.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Environment.dll - ..\ref\Techblox_Data\Managed\Techblox.EnvironmentBlocks.BuildingEnvironment.dll ..\..\ref\Techblox_Data\Managed\Techblox.EnvironmentBlocks.BuildingEnvironment.dll @@ -862,14 +731,6 @@ ..\ref\Techblox_Data\Managed\Techblox.GUI.BuildRules.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.BuildRules.dll - - ..\ref\Techblox_Data\Managed\Techblox.GUI.BuildRules.MockUps.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.BuildRules.MockUps.dll - - - ..\ref\Techblox_Data\Managed\Techblox.GUI.Commands.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Commands.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.Controls.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Controls.dll @@ -882,10 +743,6 @@ ..\ref\Techblox_Data\Managed\Techblox.GUI.GamePortal.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.GamePortal.dll - - ..\ref\Techblox_Data\Managed\Techblox.GUI.GamePortal.MockUps.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.GamePortal.MockUps.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.Hotbar.Landscapes.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Hotbar.Landscapes.dll @@ -918,22 +775,10 @@ ..\ref\Techblox_Data\Managed\Techblox.GUI.MainGame.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.MainGame.dll - - ..\ref\Techblox_Data\Managed\Techblox.GUI.Mocks.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Mocks.dll - - - ..\ref\Techblox_Data\Managed\Techblox.GUI.Mocks.DynamicListBuild.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Mocks.DynamicListBuild.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.MyGamesScreen.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.MyGamesScreen.dll - - ..\ref\Techblox_Data\Managed\Techblox.GUI.Notifications.MockUps.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Notifications.MockUps.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.PauseMenuCommands.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.PauseMenuCommands.dll @@ -942,10 +787,6 @@ ..\ref\Techblox_Data\Managed\Techblox.GUI.Progression.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Progression.dll - - ..\ref\Techblox_Data\Managed\Techblox.GUI.ScreenCanvas.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.ScreenCanvas.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.TabsBar.Landscapes.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.TabsBar.Landscapes.dll @@ -958,10 +799,6 @@ ..\ref\Techblox_Data\Managed\Techblox.GUI.UsernameDisplay.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.UsernameDisplay.dll - - ..\ref\Techblox_Data\Managed\Techblox.GUI.WorldCanvas.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.WorldCanvas.dll - ..\ref\Techblox_Data\Managed\Techblox.InputCapture.dll ..\..\ref\Techblox_Data\Managed\Techblox.InputCapture.dll @@ -1570,10 +1407,6 @@ ..\ref\Techblox_Data\Managed\UnityEngine.TextCoreFontEngineModule.dll ..\..\ref\Techblox_Data\Managed\UnityEngine.TextCoreFontEngineModule.dll - - ..\ref\Techblox_Data\Managed\UnityEngine.TextCoreModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.TextCoreModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.TextCoreTextEngineModule.dll ..\..\ref\Techblox_Data\Managed\UnityEngine.TextCoreTextEngineModule.dll diff --git a/CodeGenerator/Program.cs b/CodeGenerator/Program.cs index f403aeb..9f1e3ae 100644 --- a/CodeGenerator/Program.cs +++ b/CodeGenerator/Program.cs @@ -3,6 +3,7 @@ using HarmonyLib; using RobocraftX.Blocks; using RobocraftX.PilotSeat; using Techblox.EngineBlock; +using Techblox.ObjectIDBlockServer; using Techblox.WheelRigBlock; namespace CodeGenerator @@ -38,6 +39,7 @@ namespace CodeGenerator {"pistonVelocity", "MaximumForce"} }, typeof(PistonReadOnlyStruct)); bcg.Generate("Motor", null, null, typeof(MotorReadOnlyStruct)); + bcg.Generate("ObjectID", "ObjectIDBlockExclusiveGroups.OBJECT_ID_BLOCK_GROUP", null, typeof(ObjectIDTweakableComponent)); } } } \ No newline at end of file diff --git a/TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs b/TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs index 92e2236..a368e6f 100644 --- a/TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs @@ -18,6 +18,7 @@ using Svelto.ECS.EntityStructs; using Svelto.ECS.Experimental; using Svelto.ECS.Hybrid; using Techblox.BuildingDrone; +using Techblox.ObjectIDBlockServer; using Unity.Mathematics; using TechbloxModdingAPI.Engines; @@ -171,7 +172,7 @@ namespace TechbloxModdingAPI.Blocks.Engines public SimBody[] GetSimBodiesFromID(byte id) { var ret = new FasterList(4); - var (oids, tags, count) = entitiesDB.QueryEntities(CommonExclusiveGroups.OBJID_BLOCK_GROUP); + var (oids, tags, count) = entitiesDB.QueryEntities(ObjectIDBlockExclusiveGroups.OBJECT_ID_BLOCK_GROUP); EGIDMapper? connections = null; for (int i = 0; i < count; i++) { @@ -272,11 +273,20 @@ namespace TechbloxModdingAPI.Blocks.Engines return set.ToArray(); } -#if DEBUG - public EntitiesDB GetEntitiesDB() + public ObjectID[] GetObjectIDsFromID(byte id) { - return entitiesDB; + if (!entitiesDB.HasAny(ObjectIDBlockExclusiveGroups.OBJECT_ID_BLOCK_GROUP)) + return Array.Empty(); + + var ret = new FasterList(4); + var (oids, tags, count) = entitiesDB.QueryEntities(ObjectIDBlockExclusiveGroups.OBJECT_ID_BLOCK_GROUP); + for (var index = 0; index < count; index++) + { + if (oids[index].objectIDToTrigger == id) + ret.Add(new ObjectID(tags[index].ID)); + } + + return ret.ToArray(); } -#endif } } \ No newline at end of file diff --git a/TechbloxModdingAPI/Blocks/ObjectID.cs b/TechbloxModdingAPI/Blocks/ObjectID.cs new file mode 100644 index 0000000..0496882 --- /dev/null +++ b/TechbloxModdingAPI/Blocks/ObjectID.cs @@ -0,0 +1,50 @@ +using System; +using Techblox.ObjectIDBlockServer; + +namespace TechbloxModdingAPI.Blocks +{ + using Svelto.ECS; + + + public class ObjectID : SignalingBlock + { + + /// + /// Constructs a(n) ObjectID object representing an existing block. + /// + public ObjectID(EGID egid) : + base(egid) + { + } + + /// + /// Constructs a(n) ObjectID object representing an existing block. + /// + public ObjectID(uint id) : + base(new EGID(id, ObjectIDBlockExclusiveGroups.OBJECT_ID_BLOCK_GROUP)) + { + } + + /// + /// Gets or sets the ObjectID's Identifier property. Tweakable stat. + /// + public char Identifier + { + get => (char) (BlockEngine.GetBlockInfo(this).objectIDToTrigger + 'A'); + set + { + if(value is < 'A' or > 'Z') + throw new ArgumentOutOfRangeException(nameof(value), "ObjectIdentifier must be set to a letter between A and Z."); + BlockEngine.GetBlockInfo(this).objectIDToTrigger = (byte) (value - 'A'); + Label = value + ""; //The label isn't updated automatically + } + } + + /// + /// Finds the identifier blocks with the given ID. + /// + /// The ID to look for + /// An array that may be empty + public static ObjectID[] GetByID(char id) => BlockEngine.GetObjectIDsFromID((byte) (id - 'A')); + } +} diff --git a/TechbloxModdingAPI/Blocks/WheelRig.cs b/TechbloxModdingAPI/Blocks/WheelRig.cs index 28ba739..217de8b 100644 --- a/TechbloxModdingAPI/Blocks/WheelRig.cs +++ b/TechbloxModdingAPI/Blocks/WheelRig.cs @@ -40,6 +40,21 @@ namespace TechbloxModdingAPI.Blocks } } + /// + /// Gets or sets the WheelRig's FlipDirection property. Tweakable stat. + /// + public bool FlipDirection + { + get + { + return BlockEngine.GetBlockInfo(this).flipDirection; + } + set + { + BlockEngine.GetBlockInfo(this).flipDirection = value; + } + } + /// /// Gets or sets the WheelRig's MaxVelocity property. May not be saved. /// @@ -71,6 +86,21 @@ namespace TechbloxModdingAPI.Blocks } } + /// + /// Gets or sets the WheelRig's FlipSteering property. Tweakable stat. + /// + public bool FlipSteering + { + get + { + return BlockEngine.GetBlockInfo(this).flipSteering; + } + set + { + BlockEngine.GetBlockInfo(this).flipSteering = value; + } + } + /// /// Gets or sets the WheelRig's VelocityForMinAngle property. May not be saved. /// diff --git a/TechbloxModdingAPI/Players/PlayerEngine.cs b/TechbloxModdingAPI/Players/PlayerEngine.cs index 7e53270..24f019c 100644 --- a/TechbloxModdingAPI/Players/PlayerEngine.cs +++ b/TechbloxModdingAPI/Players/PlayerEngine.cs @@ -8,7 +8,6 @@ using RobocraftX.Common.Input; using RobocraftX.CR.MachineEditing.BoxSelect; using RobocraftX.Physics; using RobocraftX.Blocks.Ghost; -using Gamecraft.GUI.HUDFeedbackBlocks; using RobocraftX.Common; using RobocraftX.Multiplayer; using RobocraftX.SimulationModeState; @@ -113,14 +112,6 @@ namespace TechbloxModdingAPI.Players return true; } - public bool GetGameOverScreen(uint playerId) - { - if (entitiesDB == null) return false; - ref HudActivatedBlocksEntityStruct habes = ref entitiesDB.QueryEntity(HUDFeedbackBlocksGUIExclusiveGroups.GameOverHudEgid); - NativeDynamicArrayCast nativeDynamicArrayCast = new NativeDynamicArrayCast(habes.activatedBlocksOrdered); - return nativeDynamicArrayCast.count > 0; - } - public bool IsDead(uint playerId) { if (entitiesDB == null) return true; diff --git a/TechbloxModdingAPI/TechbloxModdingAPI.csproj b/TechbloxModdingAPI/TechbloxModdingAPI.csproj index 619dcda..4cde902 100644 --- a/TechbloxModdingAPI/TechbloxModdingAPI.csproj +++ b/TechbloxModdingAPI/TechbloxModdingAPI.csproj @@ -63,10 +63,6 @@ ..\ref\Techblox_Data\Managed\BevelEffect.dll ..\..\ref\Techblox_Data\Managed\BevelEffect.dll - - ..\ref\Techblox_Data\Managed\Blocks.HUDFeedbackBlocks.dll - ..\..\ref\Techblox_Data\Managed\Blocks.HUDFeedbackBlocks.dll - ..\ref\Techblox_Data\Managed\Boxophobic.TheVehetationEngine.Runtime.dll ..\..\ref\Techblox_Data\Managed\Boxophobic.TheVehetationEngine.Runtime.dll @@ -107,10 +103,6 @@ ..\ref\Techblox_Data\Managed\FullGame.dll ..\..\ref\Techblox_Data\Managed\FullGame.dll - - ..\ref\Techblox_Data\Managed\Gamecraft.AudioBlocks.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.AudioBlocks.dll - ..\ref\Techblox_Data\Managed\Gamecraft.BlockEntityFactory.dll ..\..\ref\Techblox_Data\Managed\Gamecraft.BlockEntityFactory.dll @@ -119,46 +111,18 @@ ..\ref\Techblox_Data\Managed\Gamecraft.BlockGroups.dll ..\..\ref\Techblox_Data\Managed\Gamecraft.BlockGroups.dll - - ..\ref\Techblox_Data\Managed\Gamecraft.Blocks.DamagingSurfaceBlock.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.Blocks.DamagingSurfaceBlock.dll - ..\ref\Techblox_Data\Managed\Gamecraft.Blocks.DestructionBlocks.dll ..\..\ref\Techblox_Data\Managed\Gamecraft.Blocks.DestructionBlocks.dll - - ..\ref\Techblox_Data\Managed\Gamecraft.Blocks.GenericPhysicsBlocks.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.Blocks.GenericPhysicsBlocks.dll - ..\ref\Techblox_Data\Managed\Gamecraft.Blocks.LogicBlock.dll ..\..\ref\Techblox_Data\Managed\Gamecraft.Blocks.LogicBlock.dll - - ..\ref\Techblox_Data\Managed\GameCraft.Blocks.ProjectileBlock.dll - ..\..\ref\Techblox_Data\Managed\GameCraft.Blocks.ProjectileBlock.dll - - - ..\ref\Techblox_Data\Managed\Gamecraft.Blocks.TextBlock.CompositionRoot.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.Blocks.TextBlock.CompositionRoot.dll - - - ..\ref\Techblox_Data\Managed\Gamecraft.Blocks.TimerBlock.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.Blocks.TimerBlock.dll - ..\ref\Techblox_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll ..\..\ref\Techblox_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll - - ..\ref\Techblox_Data\Managed\Gamecraft.CharacterVulnerability.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.CharacterVulnerability.dll - - - ..\ref\Techblox_Data\Managed\Gamecraft.CharacterVulnerabilityGui.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.CharacterVulnerabilityGui.dll - ..\ref\Techblox_Data\Managed\Gamecraft.ColourPalette.dll ..\..\ref\Techblox_Data\Managed\Gamecraft.ColourPalette.dll @@ -183,10 +147,6 @@ ..\ref\Techblox_Data\Managed\Gamecraft.GUI.BlueprintInventory.dll ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.BlueprintInventory.dll - - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.BlueprintInventoryMock.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.BlueprintInventoryMock.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.Blueprints.dll ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.Blueprints.dll @@ -215,10 +175,6 @@ ..\ref\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.Colours.dll ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.Colours.dll - - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.HUDFeedbackBlocks.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.HUDFeedbackBlocks.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.ModeBar.dll ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.ModeBar.dll @@ -243,10 +199,6 @@ ..\ref\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Common.dll ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Common.dll - - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.TimeModeClock.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.TimeModeClock.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.Tweaks.dll ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.Tweaks.dll @@ -255,18 +207,10 @@ ..\ref\Techblox_Data\Managed\Gamecraft.GUI.Wires.dll ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.Wires.dll - - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.Wires.Mockup.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.Wires.Mockup.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll - - ..\ref\Techblox_Data\Managed\Gamecraft.InventoryTimeRunning.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.InventoryTimeRunning.dll - ..\ref\Techblox_Data\Managed\Gamecraft.JointBlocks.dll ..\..\ref\Techblox_Data\Managed\Gamecraft.JointBlocks.dll @@ -279,14 +223,6 @@ ..\ref\Techblox_Data\Managed\Gamecraft.NetStrings.dll ..\..\ref\Techblox_Data\Managed\Gamecraft.NetStrings.dll - - ..\ref\Techblox_Data\Managed\Gamecraft.PerformanceWarnings.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.PerformanceWarnings.dll - - - ..\ref\Techblox_Data\Managed\Gamecraft.PickupBlck.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.PickupBlck.dll - ..\ref\Techblox_Data\Managed\Gamecraft.PickupsCommon.dll ..\..\ref\Techblox_Data\Managed\Gamecraft.PickupsCommon.dll @@ -295,10 +231,6 @@ ..\ref\Techblox_Data\Managed\Gamecraft.PopupMessage.dll ..\..\ref\Techblox_Data\Managed\Gamecraft.PopupMessage.dll - - ..\ref\Techblox_Data\Managed\Gamecraft.Projectiles.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.Projectiles.dll - ..\ref\Techblox_Data\Managed\Gamecraft.Serialization.dll ..\..\ref\Techblox_Data\Managed\Gamecraft.Serialization.dll @@ -307,26 +239,14 @@ ..\ref\Techblox_Data\Managed\Gamecraft.Tweaks.dll ..\..\ref\Techblox_Data\Managed\Gamecraft.Tweaks.dll - - ..\ref\Techblox_Data\Managed\Gamecraft.Tweaks.Mockup.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.Tweaks.Mockup.dll - ..\ref\Techblox_Data\Managed\Gamecraft.VisualEffects.Decals.dll ..\..\ref\Techblox_Data\Managed\Gamecraft.VisualEffects.Decals.dll - - ..\ref\Techblox_Data\Managed\Gamecraft.VisualEffects.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.VisualEffects.dll - ..\ref\Techblox_Data\Managed\Gamecraft.Wires.dll ..\..\ref\Techblox_Data\Managed\Gamecraft.Wires.dll - - ..\ref\Techblox_Data\Managed\Gamecraft.Wires.Mockup.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.Wires.Mockup.dll - ..\ref\Techblox_Data\Managed\GameLiftServerSDKNet45.dll ..\..\ref\Techblox_Data\Managed\GameLiftServerSDKNet45.dll @@ -359,14 +279,6 @@ ..\ref\Techblox_Data\Managed\Havok.Physics.Hybrid.dll ..\..\ref\Techblox_Data\Managed\Havok.Physics.Hybrid.dll - - ..\ref\Techblox_Data\Managed\IllusionInjector.dll - ..\..\ref\Techblox_Data\Managed\IllusionInjector.dll - - - ..\ref\Techblox_Data\Managed\IllusionPlugin.dll - ..\..\ref\Techblox_Data\Managed\IllusionPlugin.dll - ..\ref\Techblox_Data\Managed\JWT.dll ..\..\ref\Techblox_Data\Managed\JWT.dll @@ -395,10 +307,6 @@ ..\ref\Techblox_Data\Managed\MultiplayerNetworking.dll ..\..\ref\Techblox_Data\Managed\MultiplayerNetworking.dll - - ..\ref\Techblox_Data\Managed\MultiplayerTest.dll - ..\..\ref\Techblox_Data\Managed\MultiplayerTest.dll - ..\ref\Techblox_Data\Managed\Newtonsoft.Json.dll ..\..\ref\Techblox_Data\Managed\Newtonsoft.Json.dll @@ -479,10 +387,6 @@ ..\ref\Techblox_Data\Managed\RobocraftX.FrontEnd.dll ..\..\ref\Techblox_Data\Managed\RobocraftX.FrontEnd.dll - - ..\ref\Techblox_Data\Managed\RobocraftX.GUI.BlockLabel.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.BlockLabel.dll - ..\ref\Techblox_Data\Managed\RobocraftX.GUI.DebugDisplay.dll ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.DebugDisplay.dll @@ -531,10 +435,6 @@ ..\ref\Techblox_Data\Managed\RobocraftX.MainGame.dll ..\..\ref\Techblox_Data\Managed\RobocraftX.MainGame.dll - - ..\ref\Techblox_Data\Managed\RobocraftX.MainGameMock.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.MainGameMock.dll - ..\ref\Techblox_Data\Managed\RobocraftX.MainSimulation.Audio.dll ..\..\ref\Techblox_Data\Managed\RobocraftX.MainSimulation.Audio.dll @@ -543,18 +443,10 @@ ..\ref\Techblox_Data\Managed\RobocraftX.MainSimulation.dll ..\..\ref\Techblox_Data\Managed\RobocraftX.MainSimulation.dll - - ..\ref\Techblox_Data\Managed\RobocraftX.MockCharacter.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.MockCharacter.dll - ..\ref\Techblox_Data\Managed\RobocraftX.Multiplayer.dll ..\..\ref\Techblox_Data\Managed\RobocraftX.Multiplayer.dll - - ..\ref\Techblox_Data\Managed\RobocraftX.Multiplayer.GUI.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.Multiplayer.GUI.dll - ..\ref\Techblox_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll ..\..\ref\Techblox_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll @@ -571,10 +463,6 @@ ..\ref\Techblox_Data\Managed\RobocraftX.ObjectIdBlocks.dll ..\..\ref\Techblox_Data\Managed\RobocraftX.ObjectIdBlocks.dll - - ..\ref\Techblox_Data\Managed\RobocraftX.Party.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.Party.dll - ..\ref\Techblox_Data\Managed\RobocraftX.Physics.dll ..\..\ref\Techblox_Data\Managed\RobocraftX.Physics.dll @@ -587,10 +475,6 @@ ..\ref\Techblox_Data\Managed\RobocraftX.Player.dll ..\..\ref\Techblox_Data\Managed\RobocraftX.Player.dll - - ..\ref\Techblox_Data\Managed\RobocraftX.Rendering.Mock.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.Rendering.Mock.dll - ..\ref\Techblox_Data\Managed\RobocraftX.SaveAndLoad.dll ..\..\ref\Techblox_Data\Managed\RobocraftX.SaveAndLoad.dll @@ -607,22 +491,10 @@ ..\ref\Techblox_Data\Managed\RobocraftX.SignalHandling.dll ..\..\ref\Techblox_Data\Managed\RobocraftX.SignalHandling.dll - - ..\ref\Techblox_Data\Managed\RobocraftX.SpawnPoints.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.SpawnPoints.dll - ..\ref\Techblox_Data\Managed\RobocraftX.StateSync.dll ..\..\ref\Techblox_Data\Managed\RobocraftX.StateSync.dll - - ..\ref\Techblox_Data\Managed\RobocraftX_TextBlock.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX_TextBlock.dll - - - ..\ref\Techblox_Data\Managed\RobocratX.SimulationMockCompositionRoot.dll - ..\..\ref\Techblox_Data\Managed\RobocratX.SimulationMockCompositionRoot.dll - ..\ref\Techblox_Data\Managed\Serilog.dll ..\..\ref\Techblox_Data\Managed\Serilog.dll @@ -791,10 +663,6 @@ ..\ref\Techblox_Data\Managed\Techblox.EngineBlock.dll ..\..\ref\Techblox_Data\Managed\Techblox.EngineBlock.dll - - ..\ref\Techblox_Data\Managed\Techblox.Environment.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Environment.dll - ..\ref\Techblox_Data\Managed\Techblox.EnvironmentBlocks.BuildingEnvironment.dll ..\..\ref\Techblox_Data\Managed\Techblox.EnvironmentBlocks.BuildingEnvironment.dll @@ -859,14 +727,6 @@ ..\ref\Techblox_Data\Managed\Techblox.GUI.BuildRules.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.BuildRules.dll - - ..\ref\Techblox_Data\Managed\Techblox.GUI.BuildRules.MockUps.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.BuildRules.MockUps.dll - - - ..\ref\Techblox_Data\Managed\Techblox.GUI.Commands.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Commands.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.Controls.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Controls.dll @@ -879,10 +739,6 @@ ..\ref\Techblox_Data\Managed\Techblox.GUI.GamePortal.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.GamePortal.dll - - ..\ref\Techblox_Data\Managed\Techblox.GUI.GamePortal.MockUps.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.GamePortal.MockUps.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.Hotbar.Landscapes.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Hotbar.Landscapes.dll @@ -915,22 +771,10 @@ ..\ref\Techblox_Data\Managed\Techblox.GUI.MainGame.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.MainGame.dll - - ..\ref\Techblox_Data\Managed\Techblox.GUI.Mocks.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Mocks.dll - - - ..\ref\Techblox_Data\Managed\Techblox.GUI.Mocks.DynamicListBuild.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Mocks.DynamicListBuild.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.MyGamesScreen.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.MyGamesScreen.dll - - ..\ref\Techblox_Data\Managed\Techblox.GUI.Notifications.MockUps.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Notifications.MockUps.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.PauseMenuCommands.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.PauseMenuCommands.dll @@ -939,10 +783,6 @@ ..\ref\Techblox_Data\Managed\Techblox.GUI.Progression.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Progression.dll - - ..\ref\Techblox_Data\Managed\Techblox.GUI.ScreenCanvas.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.ScreenCanvas.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.TabsBar.Landscapes.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.TabsBar.Landscapes.dll @@ -955,10 +795,6 @@ ..\ref\Techblox_Data\Managed\Techblox.GUI.UsernameDisplay.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.UsernameDisplay.dll - - ..\ref\Techblox_Data\Managed\Techblox.GUI.WorldCanvas.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.WorldCanvas.dll - ..\ref\Techblox_Data\Managed\Techblox.InputCapture.dll ..\..\ref\Techblox_Data\Managed\Techblox.InputCapture.dll @@ -1567,10 +1403,6 @@ ..\ref\Techblox_Data\Managed\UnityEngine.TextCoreFontEngineModule.dll ..\..\ref\Techblox_Data\Managed\UnityEngine.TextCoreFontEngineModule.dll - - ..\ref\Techblox_Data\Managed\UnityEngine.TextCoreModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.TextCoreModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.TextCoreTextEngineModule.dll ..\..\ref\Techblox_Data\Managed\UnityEngine.TextCoreTextEngineModule.dll diff --git a/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs b/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs index 4307f16..7564816 100644 --- a/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs +++ b/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs @@ -261,7 +261,7 @@ namespace TechbloxModdingAPI.Tests /*((FasterList)AccessTools.Property(typeof(GuiInputMap), "GuiInputsButtonDown").GetValue(null)) .Add(new GuiInputMap.GuiInputMapElement(RewiredConsts.Action.ToggleCommandLine, GuiIn))*/ - Game.Enter += (sender, e) => + /*Game.Enter += (sender, e) => { ushort lastKey = ushort.MaxValue; foreach (var kv in FullGameFields._dataDb.GetValues() @@ -299,7 +299,7 @@ namespace TechbloxModdingAPI.Tests return result; }) .Aggregate((a, b) => a + "\n" + b)); - }; + };*/ CommandBuilder.Builder("takeScreenshot", "Enables the screenshot taker") .Action(() => -- 2.30.2 From a610623644aa5f277e79121acaef96410a9e6507 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Tue, 12 Apr 2022 03:18:28 +0200 Subject: [PATCH 242/252] Bump version --- CodeGenerator/CodeGenerator.csproj | 2 +- TechbloxModdingAPI/Blocks/WheelRig.cs | 1 + TechbloxModdingAPI/TechbloxModdingAPI.csproj | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CodeGenerator/CodeGenerator.csproj b/CodeGenerator/CodeGenerator.csproj index 554855f..e02e6a8 100644 --- a/CodeGenerator/CodeGenerator.csproj +++ b/CodeGenerator/CodeGenerator.csproj @@ -2,7 +2,7 @@ net6.0 true - 2.2.0 + 1.2.0 Exmods GNU General Public Licence 3+ https://git.exmods.org/modtainers/GamecraftModdingAPI diff --git a/TechbloxModdingAPI/Blocks/WheelRig.cs b/TechbloxModdingAPI/Blocks/WheelRig.cs index 217de8b..f978ea1 100644 --- a/TechbloxModdingAPI/Blocks/WheelRig.cs +++ b/TechbloxModdingAPI/Blocks/WheelRig.cs @@ -89,6 +89,7 @@ namespace TechbloxModdingAPI.Blocks /// /// Gets or sets the WheelRig's FlipSteering property. Tweakable stat. /// + [TestValue(false)] public bool FlipSteering { get diff --git a/TechbloxModdingAPI/TechbloxModdingAPI.csproj b/TechbloxModdingAPI/TechbloxModdingAPI.csproj index 4cde902..aa1d39b 100644 --- a/TechbloxModdingAPI/TechbloxModdingAPI.csproj +++ b/TechbloxModdingAPI/TechbloxModdingAPI.csproj @@ -2,7 +2,7 @@ netstandard2.1 true - 2.2.0 + 2.3.0 Exmods GNU General Public Licence 3+ https://git.exmods.org/modtainers/GamecraftModdingAPI -- 2.30.2 From dfe1bfb504e90a03b1280a3cbd4984aa81c6645f Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Fri, 29 Apr 2022 02:07:46 +0200 Subject: [PATCH 243/252] Begin updating to Techblox 2022.04.28.14.02 Updated project generator script to always order assemblies (it didn't do that for me on Linux) and to fix minor issues --- Automation/gen_csproj.py | 8 +- .../Blocks/Engines/BlockEngine.cs | 5 +- .../Blocks/Engines/BlueprintEngine.cs | 12 +-- .../Blocks/Engines/RemovalEngine.cs | 37 ++++++-- TechbloxModdingAPI/Cluster.cs | 22 +++-- TechbloxModdingAPI/SimBody.cs | 17 ++-- TechbloxModdingAPI/TechbloxModdingAPI.csproj | 90 +++++++++++++++++-- 7 files changed, 144 insertions(+), 47 deletions(-) diff --git a/Automation/gen_csproj.py b/Automation/gen_csproj.py index c70b002..fc854b8 100755 --- a/Automation/gen_csproj.py +++ b/Automation/gen_csproj.py @@ -5,7 +5,7 @@ from pathlib import Path, PurePath import re import os -DLL_EXCLUSIONS_REGEX = r"(System|Microsoft|Mono|IronPython|DiscordRPC)\." +DLL_EXCLUSIONS_REGEX = r"(System|Microsoft|Mono|IronPython|DiscordRPC|IllusionInjector|IllusionPlugin|netstandard)\." def getAssemblyReferences(path): asmDir = Path(path) @@ -15,10 +15,12 @@ def getAssemblyReferences(path): addedPath = "../" asmDir = Path(addedPath + path) for child in asmDir.iterdir(): - if child.is_file() and re.search(DLL_EXCLUSIONS_REGEX, str(child), re.I) is None and str(child).lower().endswith(".dll"): + if child.is_file() and re.search(DLL_EXCLUSIONS_REGEX, str(child)) is None and str(child).lower().endswith(".dll"): childstr = str(child) childstr = os.path.relpath(childstr, addedPath).replace("\\", "/") result.append(childstr) + result.sort(key=str.lower) + result = [path + "/IllusionInjector.dll", path + "/IllusionPlugin.dll"] + result # Always put it on top return result def buildReferencesXml(path): @@ -51,7 +53,7 @@ if __name__ == "__main__": if depsStart is None or depsEnd is None: print("Unable to find dependency XML comments, aborting!") exit(1) - newFileStr = fileStr[:depsStart.start()] + "\n" + asmXml + "\n" + fileStr[depsEnd.end() + 1:] + newFileStr = fileStr[:depsStart.start() - 1] + "\n" + asmXml + "\n" + fileStr[depsEnd.end() + 1:] with open("../TechbloxModdingAPI/TechbloxModdingAPI.csproj", "w") as xmlFile: print("Writing Assembly references") xmlFile.write(newFileStr) diff --git a/TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs b/TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs index a368e6f..7a15226 100644 --- a/TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs @@ -1,11 +1,9 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Reflection; using HarmonyLib; using Gamecraft.ColourPalette; -using Gamecraft.TimeRunning; using Gamecraft.Wires; using RobocraftX.Blocks; using RobocraftX.Common; @@ -58,7 +56,8 @@ namespace TechbloxModdingAPI.Blocks.Engines ecoll[i].isProcessed = false; } } - + + //TODO: GetConnectedCubesUtility ConnectedCubesUtility.TreeTraversal.GetConnectedCubes(entitiesDB, blockID, cubeStack, cubes, (in GridConnectionsEntityStruct _) => false); diff --git a/TechbloxModdingAPI/Blocks/Engines/BlueprintEngine.cs b/TechbloxModdingAPI/Blocks/Engines/BlueprintEngine.cs index 6bd48c8..e40f998 100644 --- a/TechbloxModdingAPI/Blocks/Engines/BlueprintEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/BlueprintEngine.cs @@ -18,7 +18,7 @@ using Svelto.ECS.DataStructures; using Svelto.ECS.EntityStructs; using Svelto.ECS.Native; using Svelto.ECS.Serialization; -using Techblox.Blocks; +using Techblox.Blocks.Connections; using TechbloxModdingAPI.Engines; using TechbloxModdingAPI.Utility; using Unity.Collections; @@ -48,7 +48,8 @@ namespace TechbloxModdingAPI.Blocks.Engines private static readonly MethodInfo SerializeGhostBlueprint = AccessTools.Method(SerializeGhostBlueprintType, "SerializeClipboardGhostEntities"); - private static NativeEntityRemove nativeRemove; + private static NativeEntityRemove nativeBlockRemove; + private static NativeEntityRemove nativeConnectionRemove; private static MachineGraphConnectionEntityFactory connectionFactory; private static IEntityFunctions entityFunctions; private static ClipboardSerializationDataResourceManager clipboardManager; @@ -88,8 +89,8 @@ namespace TechbloxModdingAPI.Blocks.Engines public void RemoveBlockGroup(int id) { - BlockGroupUtility.RemoveAllBlocksInBlockGroup(id, entitiesDB, removedConnections, nativeRemove, - connectionFactory, default).Complete(); + BlockGroupUtility.RemoveAllBlocksInBlockGroup(id, entitiesDB, removedConnections, nativeBlockRemove, + nativeConnectionRemove, connectionFactory, default).Complete(); } public int CreateBlockGroup(float3 position, quaternion rotation) @@ -339,7 +340,8 @@ namespace TechbloxModdingAPI.Blocks.Engines public static void Prefix(IEntityFunctions entityFunctions, MachineGraphConnectionEntityFactory machineGraphConnectionEntityFactory) { - nativeRemove = entityFunctions.ToNativeRemove("GCAPI" + nameof(BlueprintEngine)); + nativeBlockRemove = entityFunctions.ToNativeRemove("TBAPI" + nameof(BlueprintEngine)); + nativeConnectionRemove = entityFunctions.ToNativeRemove("TBAPI" + nameof(BlueprintEngine)); connectionFactory = machineGraphConnectionEntityFactory; BlueprintEngine.entityFunctions = entityFunctions; } diff --git a/TechbloxModdingAPI/Blocks/Engines/RemovalEngine.cs b/TechbloxModdingAPI/Blocks/Engines/RemovalEngine.cs index 7999443..0610a18 100644 --- a/TechbloxModdingAPI/Blocks/Engines/RemovalEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/RemovalEngine.cs @@ -1,32 +1,43 @@ using System.Reflection; +using Gamecraft.Blocks.BlockGroups; using HarmonyLib; using RobocraftX.Blocks; using RobocraftX.Common; -using Svelto.Common; +using RobocraftX.GroupTags; +using RobocraftX.StateSync; using Svelto.ECS; using Svelto.ECS.Native; +using Techblox.Blocks.Connections; +using Unity.Collections; +using Unity.Jobs; +using Allocator = Unity.Collections.Allocator; using TechbloxModdingAPI.Engines; using TechbloxModdingAPI.Utility; namespace TechbloxModdingAPI.Blocks.Engines { - public class RemovalEngine : IApiEngine + public class RemovalEngine : IApiEngine, IDeterministicTimeStopped { private static IEntityFunctions _entityFunctions; private static MachineGraphConnectionEntityFactory _connectionFactory; + private NativeHashSet removedConnections = new(2000, Allocator.Persistent); public bool RemoveBlock(EGID target) { if (!entitiesDB.Exists(target)) return false; - var connections = entitiesDB.QueryEntity(target); - var groups = entitiesDB.FindGroups(); - using var connStructMapper = //The allocator needs to be persistent because that's what is used in the Dispose() method - entitiesDB.QueryNativeMappedEntities(groups, Allocator.Persistent); - for (int i = connections.connections.Count() - 1; i >= 0; i--) - _connectionFactory.RemoveConnection(connections, i, connStructMapper); + using var connStructMapper = + entitiesDB.QueryNativeMappedEntities(GroupTag.Groups, + Svelto.Common.Allocator.Temp); + if (entitiesDB.TryQueryNativeMappedEntities( + ConnectionsExclusiveGroups.MACHINE_CONNECTION_GROUP, out var mapper)) + { + BlockGroupUtility.RemoveBlockConnections(target, removedConnections, _connectionFactory, + connStructMapper, mapper, entitiesDB.GetEntityReferenceMap(), _entityFunctions); + } + _entityFunctions.RemoveEntity(target); return true; } @@ -39,9 +50,11 @@ namespace TechbloxModdingAPI.Blocks.Engines public void Dispose() { + removedConnections.Dispose(); } - public string Name { get; } = "TechbloxModdingAPIRemovalGameEngine"; + public string Name => "TechbloxModdingAPIRemovalGameEngine"; + public string name => Name; public bool isRemovable => false; @@ -61,5 +74,11 @@ namespace TechbloxModdingAPI.Blocks.Engines return AccessTools.TypeByName("RobocraftX.CR.MachineEditing.RemoveBlockEngine").GetConstructors()[0]; } } + + public JobHandle DeterministicStep(in float deltaTime, JobHandle inputDeps) + { + removedConnections.Clear(); + return default; + } } } \ No newline at end of file diff --git a/TechbloxModdingAPI/Cluster.cs b/TechbloxModdingAPI/Cluster.cs index 79eb7b9..378d4db 100644 --- a/TechbloxModdingAPI/Cluster.cs +++ b/TechbloxModdingAPI/Cluster.cs @@ -1,7 +1,5 @@ -using Gamecraft.Damage; -using RobocraftX.Common; -using Svelto.ECS; -using Techblox.Physics; +using Svelto.ECS; +using Techblox.TimeRunning.Clusters; namespace TechbloxModdingAPI { @@ -15,26 +13,26 @@ namespace TechbloxModdingAPI { } - public Cluster(uint id) : this(new EGID(id, CommonExclusiveGroups.SIMULATION_CLUSTERS_GROUP)) + public Cluster(uint id) : this(new EGID(id, ClustersExclusiveGroups.SIMULATION_CLUSTERS_GROUP)) { } - public float InitialHealth + public float InitialHealth //TODO { - get => Block.BlockEngine.GetBlockInfo(this).initialHealth; - set => Block.BlockEngine.GetBlockInfo(this).initialHealth = value; + get => 0f; + set { } } public float CurrentHealth { - get => Block.BlockEngine.GetBlockInfo(this).currentHealth; - set => Block.BlockEngine.GetBlockInfo(this).currentHealth = value; + get => 0f; + set { } } public float HealthMultiplier { - get => Block.BlockEngine.GetBlockInfo(this).healthMultiplier; - set => Block.BlockEngine.GetBlockInfo(this).healthMultiplier = value; + get => 0f; + set { } } /// diff --git a/TechbloxModdingAPI/SimBody.cs b/TechbloxModdingAPI/SimBody.cs index 06e152b..1120103 100644 --- a/TechbloxModdingAPI/SimBody.cs +++ b/TechbloxModdingAPI/SimBody.cs @@ -6,6 +6,7 @@ using UnityEngine; using Gamecraft.Damage; using RobocraftX.Common; using RobocraftX.Physics; +using Techblox.TimeRunning.Clusters; namespace TechbloxModdingAPI { @@ -20,7 +21,7 @@ namespace TechbloxModdingAPI /// public Cluster Cluster => cluster ??= clusterId == uint.MaxValue // Return cluster or if it's null then set it ? Block.BlockEngine.GetCluster(Id.entityID) // If we don't have a clusterId set then get it from the game - : GetInstance(new EGID(clusterId, CommonExclusiveGroups.SIMULATION_CLUSTERS_GROUP), + : GetInstance(new EGID(clusterId, ClustersExclusiveGroups.SIMULATION_CLUSTERS_GROUP), egid => new Cluster(egid)); // Otherwise get the cluster from the ID private Cluster cluster; @@ -82,7 +83,7 @@ namespace TechbloxModdingAPI public float3 CenterOfMass { - get => Block.BlockEngine.GetBlockInfo(this).centreOfMass; + get => 0f; //TODO //set => GetStruct().physicsMass.CenterOfMass = value; } @@ -93,20 +94,20 @@ namespace TechbloxModdingAPI public float InitialHealth { - get => Block.BlockEngine.GetBlockInfo(this).initialHealth; - set => Block.BlockEngine.GetBlockInfo(this).initialHealth = value; + get => 0f; + set { } } public float CurrentHealth { - get => Block.BlockEngine.GetBlockInfo(this).currentHealth; - set => Block.BlockEngine.GetBlockInfo(this).currentHealth = value; + get => 0f; + set { } } public float HealthMultiplier { - get => Block.BlockEngine.GetBlockInfo(this).healthMultiplier; - set => Block.BlockEngine.GetBlockInfo(this).healthMultiplier = value; + get => 0f; + set { } } /// diff --git a/TechbloxModdingAPI/TechbloxModdingAPI.csproj b/TechbloxModdingAPI/TechbloxModdingAPI.csproj index aa1d39b..456a019 100644 --- a/TechbloxModdingAPI/TechbloxModdingAPI.csproj +++ b/TechbloxModdingAPI/TechbloxModdingAPI.csproj @@ -415,6 +415,10 @@ ..\ref\Techblox_Data\Managed\RobocraftX.GUI.PauseMenu.dll ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.PauseMenu.dll + + ..\ref\Techblox_Data\Managed\RobocraftX.GUI.QuitConfirmation.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.QuitConfirmation.dll + ..\ref\Techblox_Data\Managed\RobocraftX.GUI.ScaleGhost.dll ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.ScaleGhost.dll @@ -591,10 +595,6 @@ ..\ref\Techblox_Data\Managed\Techblox.Blocks.Connections.dll ..\..\ref\Techblox_Data\Managed\Techblox.Blocks.Connections.dll - - ..\ref\Techblox_Data\Managed\Techblox.Blocks.Debug.Client.Monobehaviours.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Blocks.Debug.Client.Monobehaviours.dll - ..\ref\Techblox_Data\Managed\Techblox.Blocks.LightBlock.dll ..\..\ref\Techblox_Data\Managed\Techblox.Blocks.LightBlock.dll @@ -603,6 +603,10 @@ ..\ref\Techblox_Data\Managed\Techblox.Building.Rules.dll ..\..\ref\Techblox_Data\Managed\Techblox.Building.Rules.dll + + ..\ref\Techblox_Data\Managed\Techblox.Building.Shift.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Building.Shift.dll + ..\ref\Techblox_Data\Managed\Techblox.BuildingDrone.dll ..\..\ref\Techblox_Data\Managed\Techblox.BuildingDrone.dll @@ -727,6 +731,14 @@ ..\ref\Techblox_Data\Managed\Techblox.GUI.BuildRules.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.BuildRules.dll + + ..\ref\Techblox_Data\Managed\Techblox.GUI.Collection.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Collection.dll + + + ..\ref\Techblox_Data\Managed\Techblox.GUI.Commands.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Commands.dll + ..\ref\Techblox_Data\Managed\Techblox.GUI.Controls.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Controls.dll @@ -771,18 +783,26 @@ ..\ref\Techblox_Data\Managed\Techblox.GUI.MainGame.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.MainGame.dll + + ..\ref\Techblox_Data\Managed\Techblox.GUI.MainGame.StateMachine.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.MainGame.StateMachine.dll + ..\ref\Techblox_Data\Managed\Techblox.GUI.MyGamesScreen.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.MyGamesScreen.dll - - ..\ref\Techblox_Data\Managed\Techblox.GUI.PauseMenuCommands.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.PauseMenuCommands.dll + + ..\ref\Techblox_Data\Managed\Techblox.GUI.PauseMenu.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.PauseMenu.dll ..\ref\Techblox_Data\Managed\Techblox.GUI.Progression.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Progression.dll + + ..\ref\Techblox_Data\Managed\Techblox.GUI.ScreenCanvas.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.ScreenCanvas.dll + ..\ref\Techblox_Data\Managed\Techblox.GUI.TabsBar.Landscapes.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.TabsBar.Landscapes.dll @@ -795,6 +815,10 @@ ..\ref\Techblox_Data\Managed\Techblox.GUI.UsernameDisplay.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.UsernameDisplay.dll + + ..\ref\Techblox_Data\Managed\Techblox.GUI.WorldCanvas.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.WorldCanvas.dll + ..\ref\Techblox_Data\Managed\Techblox.InputCapture.dll ..\..\ref\Techblox_Data\Managed\Techblox.InputCapture.dll @@ -943,10 +967,30 @@ ..\ref\Techblox_Data\Managed\Techblox.Services.Progression.Client.dll ..\..\ref\Techblox_Data\Managed\Techblox.Services.Progression.Client.dll + + ..\ref\Techblox_Data\Managed\Techblox.Services.Progression.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Services.Progression.dll + ..\ref\Techblox_Data\Managed\Techblox.Services.Storage.dll ..\..\ref\Techblox_Data\Managed\Techblox.Services.Storage.dll + + ..\ref\Techblox_Data\Managed\Techblox.Services.Users.Client.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Services.Users.Client.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Services.Users.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Services.Users.dll + + + ..\ref\Techblox_Data\Managed\Techblox.ServoBlocksServer.dll + ..\..\ref\Techblox_Data\Managed\Techblox.ServoBlocksServer.dll + + + ..\ref\Techblox_Data\Managed\Techblox.ServosServer.dll + ..\..\ref\Techblox_Data\Managed\Techblox.ServosServer.dll + ..\ref\Techblox_Data\Managed\Techblox.SignalHandling.Audio.dll ..\..\ref\Techblox_Data\Managed\Techblox.SignalHandling.Audio.dll @@ -955,6 +999,10 @@ ..\ref\Techblox_Data\Managed\Techblox.SignalHandling.Common.dll ..\..\ref\Techblox_Data\Managed\Techblox.SignalHandling.Common.dll + + ..\ref\Techblox_Data\Managed\Techblox.Simulation.Clusters.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Simulation.Clusters.dll + ..\ref\Techblox_Data\Managed\Techblox.SpawnBlock.Client.dll ..\..\ref\Techblox_Data\Managed\Techblox.SpawnBlock.Client.dll @@ -1023,6 +1071,30 @@ ..\ref\Techblox_Data\Managed\Techblox.VisualEffects.VFXGraph.dll ..\..\ref\Techblox_Data\Managed\Techblox.VisualEffects.VFXGraph.dll + + ..\ref\Techblox_Data\Managed\Techblox.Weapons.Aiming.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Weapons.Aiming.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Weapons.DisablerBlock.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Weapons.DisablerBlock.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Weapons.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Weapons.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Weapons.Projectiles.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Weapons.Projectiles.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Weapons.Projectiles.Server.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Weapons.Projectiles.Server.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Weapons.Server.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Weapons.Server.dll + ..\ref\Techblox_Data\Managed\Techblox.WheelFX.dll ..\..\ref\Techblox_Data\Managed\Techblox.WheelFX.dll @@ -1403,6 +1475,10 @@ ..\ref\Techblox_Data\Managed\UnityEngine.TextCoreFontEngineModule.dll ..\..\ref\Techblox_Data\Managed\UnityEngine.TextCoreFontEngineModule.dll + + ..\ref\Techblox_Data\Managed\UnityEngine.TextCoreModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.TextCoreModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.TextCoreTextEngineModule.dll ..\..\ref\Techblox_Data\Managed\UnityEngine.TextCoreTextEngineModule.dll -- 2.30.2 From 55344d1352a5301a8d54da61316733deda8cf349 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Wed, 1 Jun 2022 16:54:17 +0200 Subject: [PATCH 244/252] Start updating to Techblox 2022.05.25.11.05 Resolved compiler errors Mostly by removing erroring code --- CodeGenerator/BlockClassGenerator.cs | 2 +- CodeGenerator/CodeGenerator.csproj | 94 +++++++++++++++++-- CodeGenerator/Program.cs | 6 +- TechbloxModdingAPI/Block.cs | 7 +- TechbloxModdingAPI/Blocks/BlockIDs.cs | 34 ++++++- TechbloxModdingAPI/Blocks/BlockMaterial.cs | 10 +- .../Blocks/Engines/BlockEngine.cs | 28 +++--- .../Blocks/Engines/MovementEngine.cs | 2 +- .../Blocks/Engines/RotationEngine.cs | 4 +- .../Blocks/Engines/SignalEngine.cs | 4 +- TechbloxModdingAPI/Blocks/Servo.cs | 32 +++---- TechbloxModdingAPI/TechbloxModdingAPI.csproj | 4 + 12 files changed, 174 insertions(+), 53 deletions(-) diff --git a/CodeGenerator/BlockClassGenerator.cs b/CodeGenerator/BlockClassGenerator.cs index 77d4ad4..81cd00f 100644 --- a/CodeGenerator/BlockClassGenerator.cs +++ b/CodeGenerator/BlockClassGenerator.cs @@ -67,7 +67,7 @@ namespace CodeGenerator codeUnit.Namespaces.Add(ns); var provider = CodeDomProvider.CreateProvider("CSharp"); - var path = $@"..\..\..\..\TechbloxModdingAPI\Blocks\{name}.cs"; + var path = $@"../../../../TechbloxModdingAPI/Blocks/{name}.cs"; using (var sw = new StreamWriter(path)) { provider.GenerateCodeFromCompileUnit(codeUnit, sw, new CodeGeneratorOptions {BracingStyle = "C"}); diff --git a/CodeGenerator/CodeGenerator.csproj b/CodeGenerator/CodeGenerator.csproj index e02e6a8..32255ac 100644 --- a/CodeGenerator/CodeGenerator.csproj +++ b/CodeGenerator/CodeGenerator.csproj @@ -419,6 +419,10 @@ ..\ref\Techblox_Data\Managed\RobocraftX.GUI.PauseMenu.dll ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.PauseMenu.dll + + ..\ref\Techblox_Data\Managed\RobocraftX.GUI.QuitConfirmation.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.QuitConfirmation.dll + ..\ref\Techblox_Data\Managed\RobocraftX.GUI.ScaleGhost.dll ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.ScaleGhost.dll @@ -595,10 +599,6 @@ ..\ref\Techblox_Data\Managed\Techblox.Blocks.Connections.dll ..\..\ref\Techblox_Data\Managed\Techblox.Blocks.Connections.dll - - ..\ref\Techblox_Data\Managed\Techblox.Blocks.Debug.Client.Monobehaviours.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Blocks.Debug.Client.Monobehaviours.dll - ..\ref\Techblox_Data\Managed\Techblox.Blocks.LightBlock.dll ..\..\ref\Techblox_Data\Managed\Techblox.Blocks.LightBlock.dll @@ -607,6 +607,10 @@ ..\ref\Techblox_Data\Managed\Techblox.Building.Rules.dll ..\..\ref\Techblox_Data\Managed\Techblox.Building.Rules.dll + + ..\ref\Techblox_Data\Managed\Techblox.Building.Shift.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Building.Shift.dll + ..\ref\Techblox_Data\Managed\Techblox.BuildingDrone.dll ..\..\ref\Techblox_Data\Managed\Techblox.BuildingDrone.dll @@ -731,6 +735,14 @@ ..\ref\Techblox_Data\Managed\Techblox.GUI.BuildRules.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.BuildRules.dll + + ..\ref\Techblox_Data\Managed\Techblox.GUI.Collection.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Collection.dll + + + ..\ref\Techblox_Data\Managed\Techblox.GUI.Commands.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Commands.dll + ..\ref\Techblox_Data\Managed\Techblox.GUI.Controls.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Controls.dll @@ -775,18 +787,26 @@ ..\ref\Techblox_Data\Managed\Techblox.GUI.MainGame.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.MainGame.dll + + ..\ref\Techblox_Data\Managed\Techblox.GUI.MainGame.StateMachine.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.MainGame.StateMachine.dll + ..\ref\Techblox_Data\Managed\Techblox.GUI.MyGamesScreen.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.MyGamesScreen.dll - - ..\ref\Techblox_Data\Managed\Techblox.GUI.PauseMenuCommands.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.PauseMenuCommands.dll + + ..\ref\Techblox_Data\Managed\Techblox.GUI.PauseMenu.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.PauseMenu.dll ..\ref\Techblox_Data\Managed\Techblox.GUI.Progression.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Progression.dll + + ..\ref\Techblox_Data\Managed\Techblox.GUI.ScreenCanvas.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.ScreenCanvas.dll + ..\ref\Techblox_Data\Managed\Techblox.GUI.TabsBar.Landscapes.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.TabsBar.Landscapes.dll @@ -799,6 +819,10 @@ ..\ref\Techblox_Data\Managed\Techblox.GUI.UsernameDisplay.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.UsernameDisplay.dll + + ..\ref\Techblox_Data\Managed\Techblox.GUI.WorldCanvas.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.WorldCanvas.dll + ..\ref\Techblox_Data\Managed\Techblox.InputCapture.dll ..\..\ref\Techblox_Data\Managed\Techblox.InputCapture.dll @@ -947,10 +971,30 @@ ..\ref\Techblox_Data\Managed\Techblox.Services.Progression.Client.dll ..\..\ref\Techblox_Data\Managed\Techblox.Services.Progression.Client.dll + + ..\ref\Techblox_Data\Managed\Techblox.Services.Progression.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Services.Progression.dll + ..\ref\Techblox_Data\Managed\Techblox.Services.Storage.dll ..\..\ref\Techblox_Data\Managed\Techblox.Services.Storage.dll + + ..\ref\Techblox_Data\Managed\Techblox.Services.Users.Client.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Services.Users.Client.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Services.Users.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Services.Users.dll + + + ..\ref\Techblox_Data\Managed\Techblox.ServoBlocksServer.dll + ..\..\ref\Techblox_Data\Managed\Techblox.ServoBlocksServer.dll + + + ..\ref\Techblox_Data\Managed\Techblox.ServosServer.dll + ..\..\ref\Techblox_Data\Managed\Techblox.ServosServer.dll + ..\ref\Techblox_Data\Managed\Techblox.SignalHandling.Audio.dll ..\..\ref\Techblox_Data\Managed\Techblox.SignalHandling.Audio.dll @@ -959,6 +1003,10 @@ ..\ref\Techblox_Data\Managed\Techblox.SignalHandling.Common.dll ..\..\ref\Techblox_Data\Managed\Techblox.SignalHandling.Common.dll + + ..\ref\Techblox_Data\Managed\Techblox.Simulation.Clusters.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Simulation.Clusters.dll + ..\ref\Techblox_Data\Managed\Techblox.SpawnBlock.Client.dll ..\..\ref\Techblox_Data\Managed\Techblox.SpawnBlock.Client.dll @@ -1027,6 +1075,30 @@ ..\ref\Techblox_Data\Managed\Techblox.VisualEffects.VFXGraph.dll ..\..\ref\Techblox_Data\Managed\Techblox.VisualEffects.VFXGraph.dll + + ..\ref\Techblox_Data\Managed\Techblox.Weapons.Aiming.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Weapons.Aiming.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Weapons.DisablerBlock.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Weapons.DisablerBlock.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Weapons.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Weapons.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Weapons.Projectiles.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Weapons.Projectiles.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Weapons.Projectiles.Server.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Weapons.Projectiles.Server.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Weapons.Server.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Weapons.Server.dll + ..\ref\Techblox_Data\Managed\Techblox.WheelFX.dll ..\..\ref\Techblox_Data\Managed\Techblox.WheelFX.dll @@ -1407,6 +1479,10 @@ ..\ref\Techblox_Data\Managed\UnityEngine.TextCoreFontEngineModule.dll ..\..\ref\Techblox_Data\Managed\UnityEngine.TextCoreFontEngineModule.dll + + ..\ref\Techblox_Data\Managed\UnityEngine.TextCoreModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.TextCoreModule.dll + ..\ref\Techblox_Data\Managed\UnityEngine.TextCoreTextEngineModule.dll ..\..\ref\Techblox_Data\Managed\UnityEngine.TextCoreTextEngineModule.dll @@ -1523,6 +1599,10 @@ ..\ref\Techblox_Data\Managed\Whinarn.UnityMeshSimplifier.Runtime.dll ..\..\ref\Techblox_Data\Managed\Whinarn.UnityMeshSimplifier.Runtime.dll + + ..\ref\Techblox_Data\Managed\ZFBrowser.dll + ..\..\ref\Techblox_Data\Managed\ZFBrowser.dll + diff --git a/CodeGenerator/Program.cs b/CodeGenerator/Program.cs index 9f1e3ae..900c6d4 100644 --- a/CodeGenerator/Program.cs +++ b/CodeGenerator/Program.cs @@ -3,7 +3,7 @@ using HarmonyLib; using RobocraftX.Blocks; using RobocraftX.PilotSeat; using Techblox.EngineBlock; -using Techblox.ObjectIDBlockServer; +using Techblox.ServoBlocksServer; using Techblox.WheelRigBlock; namespace CodeGenerator @@ -24,7 +24,7 @@ namespace CodeGenerator }, typeof(TweakableJointDampingComponent), typeof(DampedSpringReadOnlyStruct)); bcg.Generate("LogicGate", "LOGIC_BLOCK_GROUP"); - bcg.Generate("Servo", types: typeof(ServoReadOnlyStruct), renames: new Dictionary + bcg.Generate("Servo", types: typeof(ServoReadOnlyTweakableComponent), renames: new Dictionary { {"minDeviation", "MinimumAngle"}, {"maxDeviation", "MaximumAngle"}, @@ -39,7 +39,7 @@ namespace CodeGenerator {"pistonVelocity", "MaximumForce"} }, typeof(PistonReadOnlyStruct)); bcg.Generate("Motor", null, null, typeof(MotorReadOnlyStruct)); - bcg.Generate("ObjectID", "ObjectIDBlockExclusiveGroups.OBJECT_ID_BLOCK_GROUP", null, typeof(ObjectIDTweakableComponent)); + //bcg.Generate("ObjectID", "ObjectIDBlockExclusiveGroups.OBJECT_ID_BLOCK_GROUP", null, typeof(ObjectIDTweakableComponent)); } } } \ No newline at end of file diff --git a/TechbloxModdingAPI/Block.cs b/TechbloxModdingAPI/Block.cs index c76ee08..5c3c897 100644 --- a/TechbloxModdingAPI/Block.cs +++ b/TechbloxModdingAPI/Block.cs @@ -441,9 +441,10 @@ namespace TechbloxModdingAPI public SimBody GetSimBody() { var st = BlockEngine.GetBlockInfo(this); - return st.machineRigidBodyId != uint.MaxValue - ? new SimBody(st.machineRigidBodyId, st.clusterId) - : null; + /*return st.machineRigidBodyId != uint.MaxValue + ? new SimBody(st.machineRigidBodyId, st.clusterId) - TODO: + : null;*/ + return null; } /// diff --git a/TechbloxModdingAPI/Blocks/BlockIDs.cs b/TechbloxModdingAPI/Blocks/BlockIDs.cs index 22ee226..bd4ba8a 100644 --- a/TechbloxModdingAPI/Blocks/BlockIDs.cs +++ b/TechbloxModdingAPI/Blocks/BlockIDs.cs @@ -333,13 +333,39 @@ namespace TechbloxModdingAPI.Blocks DistanceSensor, Stabilizer, ObjectID, - TeamScore = 428, + ScoreToTechpointConversion, + TeamScore, ScorePickupBlock, - StreetLamp = 435, - ConstantBlock = 452, + SportyHatchbackDriverSeat, + SportyHatchbackPassengerSeat, + FlamingExhaust = 433, + SmokingExhaust, + StreetLamp, + Vector7HatchbackWheel, + Vector7HatchbackWheelWideProfile, + Vector7SedanWheel, + Vector7SedanWideProfile, + Vector7FormulaWheel, + Vector7FormulaWheelRear, + Vector7MonsterTruckWheel, + Vector7TruckWheel, + Vector7TruckWheelDouble, + BusSeat, + XLJet, + XXLJet, + ElectricSedanEngine, + HeadlampIndicator, + HeadlampSrip, + HeadlampStripEdge, + ConstantBlock, CounterBlock, SmallGridHill, SmallGridHillInnerCorner, - SmallGridHillOuterCorner + SmallGridHillOuterCorner, + Vector7SmallJet = 460, + Vector7MediumJet, + Vector7LargeJet, + Vector7XLJet, + Vector7XXLJet } } \ No newline at end of file diff --git a/TechbloxModdingAPI/Blocks/BlockMaterial.cs b/TechbloxModdingAPI/Blocks/BlockMaterial.cs index fe98bd9..641b21f 100644 --- a/TechbloxModdingAPI/Blocks/BlockMaterial.cs +++ b/TechbloxModdingAPI/Blocks/BlockMaterial.cs @@ -32,6 +32,14 @@ namespace TechbloxModdingAPI.Blocks WoodPainted, WoodRoughGrungy, Boundary, - Emissive + Emissive, + AircraftPaneling_Riveted_Painted, + AircraftPaneling_Riveted_Metallic, + Steel_Bodywork_Pearlescent, + Steel_Bodywork_RadWrap, + Steel_Bodywork_Glitter, + BouncyRubber, + BouncyRubber_TieDye, + FuturisticPaneling_Riveted_Painted = 40 } } \ No newline at end of file diff --git a/TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs b/TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs index 7a15226..dc035ee 100644 --- a/TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs @@ -53,13 +53,13 @@ namespace TechbloxModdingAPI.Blocks.Engines { for(int i = 0; i < count; i++) { - ecoll[i].isProcessed = false; + ecoll[i].areConnectionsAssigned = false; } } //TODO: GetConnectedCubesUtility - ConnectedCubesUtility.TreeTraversal.GetConnectedCubes(entitiesDB, blockID, cubeStack, cubes, - (in GridConnectionsEntityStruct _) => false); + /*ConnectedCubesUtility.TreeTraversal.GetConnectedCubes(entitiesDB, blockID, cubeStack, cubes, + (in GridConnectionsEntityStruct _) => false);*/ var ret = new Block[cubes.count]; for (int i = 0; i < cubes.count; i++) @@ -179,15 +179,15 @@ namespace TechbloxModdingAPI.Blocks.Engines var tag = tags[i]; if (!connections.HasValue) //Would need reflection to get the group from the build group otherwise connections = entitiesDB.QueryMappedEntities(tag.ID.groupID); - var rid = connections.Value.Entity(tag.ID.entityID).machineRigidBodyId; - foreach (var rb in ret) + //var rid = connections.Value.Entity(tag.ID.entityID).machineRigidBodyId; + /*foreach (var rb in ret) - TODO { if (rb.Id.entityID == rid) goto DUPLICATE; //Multiple Object Identifiers on one rigid body } ret.Add(new SimBody(rid)); - DUPLICATE: ; + DUPLICATE: ;*/ } return ret.ToArray(); @@ -201,8 +201,8 @@ namespace TechbloxModdingAPI.Blocks.Engines { ref var joint = ref joints[i]; if (joint.isBroken) continue; - if (joint.connectedEntityA == id) list.Add(new SimBody(joint.connectedEntityB)); - else if (joint.connectedEntityB == id) list.Add(new SimBody(joint.connectedEntityA)); + /*if (joint.connectedEntityA == id) list.Add(new SimBody(joint.connectedEntityB)); - TODO: + else if (joint.connectedEntityB == id) list.Add(new SimBody(joint.connectedEntityA));*/ } return list.ToArray(); @@ -217,8 +217,8 @@ namespace TechbloxModdingAPI.Blocks.Engines for (var index = 0; index < count; index++) { var conn = coll[index]; - if (conn.clusterId == cid) - bodies.Add(conn.machineRigidBodyId); + /*if (conn.clusterId == cid) - TODO + bodies.Add(conn.machineRigidBodyId);*/ } } @@ -246,8 +246,8 @@ namespace TechbloxModdingAPI.Blocks.Engines { var conn = coll[index]; //Static blocks don't have a cluster ID but the cluster destruction manager should have one - if (conn.machineRigidBodyId == sbid && conn.clusterId != uint.MaxValue) - return new Cluster(conn.clusterId); + /*if (conn.machineRigidBodyId == sbid && conn.clusterId != uint.MaxValue) - TODO: + return new Cluster(conn.clusterId);*/ } } @@ -264,8 +264,8 @@ namespace TechbloxModdingAPI.Blocks.Engines for (var index = 0; index < count; index++) { var conn = coll[index]; - if (conn.machineRigidBodyId == sbid) - set.Add(Block.New(tags[index].ID)); + /*if (conn.machineRigidBodyId == sbid) - TODO + set.Add(Block.New(tags[index].ID));*/ } } diff --git a/TechbloxModdingAPI/Blocks/Engines/MovementEngine.cs b/TechbloxModdingAPI/Blocks/Engines/MovementEngine.cs index 12996b0..34ab4d5 100644 --- a/TechbloxModdingAPI/Blocks/Engines/MovementEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/MovementEngine.cs @@ -56,7 +56,7 @@ namespace TechbloxModdingAPI.Blocks.Engines }); } - entitiesDB.QueryEntityOrDefault(block).isProcessed = false; + entitiesDB.QueryEntityOrDefault(block).areConnectionsAssigned = false; return posStruct.position; } diff --git a/TechbloxModdingAPI/Blocks/Engines/RotationEngine.cs b/TechbloxModdingAPI/Blocks/Engines/RotationEngine.cs index 8c639e8..a047031 100644 --- a/TechbloxModdingAPI/Blocks/Engines/RotationEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/RotationEngine.cs @@ -59,7 +59,9 @@ namespace TechbloxModdingAPI.Blocks.Engines }); } - entitiesDB.QueryEntityOrDefault(block).isProcessed = false; + // TODO: Connections probably need to be assigned (maybe) + // They are assigned during machine processing anyway + entitiesDB.QueryEntityOrDefault(block).areConnectionsAssigned = false; return ((Quaternion)rotStruct.rotation).eulerAngles; } diff --git a/TechbloxModdingAPI/Blocks/Engines/SignalEngine.cs b/TechbloxModdingAPI/Blocks/Engines/SignalEngine.cs index 1f89816..ffd2b07 100644 --- a/TechbloxModdingAPI/Blocks/Engines/SignalEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/SignalEngine.cs @@ -313,7 +313,7 @@ namespace TechbloxModdingAPI.Blocks.Engines for (int i = 0; i < count; i++) { ref BlockPortsStruct s = ref coll[i]; - res.Add(s.ID); + //res.Add(s.ID); - TODO } } @@ -367,7 +367,7 @@ namespace TechbloxModdingAPI.Blocks.Engines : NamedExclusiveGroup.Group; if (entitiesDB.Exists(signalID, group)) { - index = entitiesDB.QueryEntity(signalID, group).anyChannelIndex; + index = entitiesDB.QueryEntity(signalID, group).firstChannelIndexCachedInSim; var channelData = entitiesDB.QueryEntities(NamedExclusiveGroup.Group); return channelData; diff --git a/TechbloxModdingAPI/Blocks/Servo.cs b/TechbloxModdingAPI/Blocks/Servo.cs index 89bd194..8f626df 100644 --- a/TechbloxModdingAPI/Blocks/Servo.cs +++ b/TechbloxModdingAPI/Blocks/Servo.cs @@ -30,11 +30,11 @@ namespace TechbloxModdingAPI.Blocks { get { - return BlockEngine.GetBlockInfo(this).servoVelocity; + return BlockEngine.GetBlockInfo(this).servoVelocity; } set { - BlockEngine.GetBlockInfo(this).servoVelocity = value; + BlockEngine.GetBlockInfo(this).servoVelocity = value; } } @@ -45,11 +45,11 @@ namespace TechbloxModdingAPI.Blocks { get { - return BlockEngine.GetBlockInfo(this).minDeviation; + return BlockEngine.GetBlockInfo(this).minDeviation; } set { - BlockEngine.GetBlockInfo(this).minDeviation = value; + BlockEngine.GetBlockInfo(this).minDeviation = value; } } @@ -60,11 +60,11 @@ namespace TechbloxModdingAPI.Blocks { get { - return BlockEngine.GetBlockInfo(this).maxDeviation; + return BlockEngine.GetBlockInfo(this).maxDeviation; } set { - BlockEngine.GetBlockInfo(this).maxDeviation = value; + BlockEngine.GetBlockInfo(this).maxDeviation = value; } } @@ -75,11 +75,11 @@ namespace TechbloxModdingAPI.Blocks { get { - return BlockEngine.GetBlockInfo(this).reverse; + return BlockEngine.GetBlockInfo(this).reverse; } set { - BlockEngine.GetBlockInfo(this).reverse = value; + BlockEngine.GetBlockInfo(this).reverse = value; } } @@ -90,11 +90,11 @@ namespace TechbloxModdingAPI.Blocks { get { - return BlockEngine.GetBlockInfo(this).hasProportionalInput; + return BlockEngine.GetBlockInfo(this).hasProportionalInput; } set { - BlockEngine.GetBlockInfo(this).hasProportionalInput = value; + BlockEngine.GetBlockInfo(this).hasProportionalInput = value; } } @@ -105,11 +105,11 @@ namespace TechbloxModdingAPI.Blocks { get { - return BlockEngine.GetBlockInfo(this).directionVector; + return BlockEngine.GetBlockInfo(this).directionVector; } set { - BlockEngine.GetBlockInfo(this).directionVector = value; + BlockEngine.GetBlockInfo(this).directionVector = value; } } @@ -120,11 +120,11 @@ namespace TechbloxModdingAPI.Blocks { get { - return BlockEngine.GetBlockInfo(this).rotationAxis; + return BlockEngine.GetBlockInfo(this).rotationAxis; } set { - BlockEngine.GetBlockInfo(this).rotationAxis = value; + BlockEngine.GetBlockInfo(this).rotationAxis = value; } } @@ -135,11 +135,11 @@ namespace TechbloxModdingAPI.Blocks { get { - return BlockEngine.GetBlockInfo(this).forceAxis; + return BlockEngine.GetBlockInfo(this).forceAxis; } set { - BlockEngine.GetBlockInfo(this).forceAxis = value; + BlockEngine.GetBlockInfo(this).forceAxis = value; } } } diff --git a/TechbloxModdingAPI/TechbloxModdingAPI.csproj b/TechbloxModdingAPI/TechbloxModdingAPI.csproj index 456a019..12ff5bb 100644 --- a/TechbloxModdingAPI/TechbloxModdingAPI.csproj +++ b/TechbloxModdingAPI/TechbloxModdingAPI.csproj @@ -1595,6 +1595,10 @@ ..\ref\Techblox_Data\Managed\Whinarn.UnityMeshSimplifier.Runtime.dll ..\..\ref\Techblox_Data\Managed\Whinarn.UnityMeshSimplifier.Runtime.dll + + ..\ref\Techblox_Data\Managed\ZFBrowser.dll + ..\..\ref\Techblox_Data\Managed\ZFBrowser.dll + -- 2.30.2 From f70b65e79699f48d1fe07b4210dec591acf220bd Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Thu, 29 Sep 2022 00:29:12 +0200 Subject: [PATCH 245/252] Start updating to Techblox 2022.08.11.09.42 and start work on RefCollection What have I got myself into --- .../Blocks/Engines/RemovalEngine.cs | 6 +- .../Blocks/Engines/SignalEngine.cs | 28 +++--- TechbloxModdingAPI/Blocks/SignalingBlock.cs | 4 +- TechbloxModdingAPI/Blocks/Wire.cs | 13 +-- .../Utility/ManagedApiExtensions.cs | 24 ++++- .../Utility/NativeApiExtensions.cs | 23 +++-- TechbloxModdingAPI/Utility/OptionalRef.cs | 14 ++- TechbloxModdingAPI/Utility/RefCollection.cs | 88 +++++++++++++++++++ 8 files changed, 166 insertions(+), 34 deletions(-) create mode 100644 TechbloxModdingAPI/Utility/RefCollection.cs diff --git a/TechbloxModdingAPI/Blocks/Engines/RemovalEngine.cs b/TechbloxModdingAPI/Blocks/Engines/RemovalEngine.cs index 0610a18..e4e899b 100644 --- a/TechbloxModdingAPI/Blocks/Engines/RemovalEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/RemovalEngine.cs @@ -22,7 +22,7 @@ namespace TechbloxModdingAPI.Blocks.Engines { private static IEntityFunctions _entityFunctions; private static MachineGraphConnectionEntityFactory _connectionFactory; - private NativeHashSet removedConnections = new(2000, Allocator.Persistent); + private NativeHashSet removedConnections; public bool RemoveBlock(EGID target) { @@ -44,6 +44,7 @@ namespace TechbloxModdingAPI.Blocks.Engines public void Ready() { + removedConnections = new(2000, Allocator.Persistent); } public EntitiesDB entitiesDB { get; set; } @@ -77,7 +78,8 @@ namespace TechbloxModdingAPI.Blocks.Engines public JobHandle DeterministicStep(in float deltaTime, JobHandle inputDeps) { - removedConnections.Clear(); + if (removedConnections.IsCreated) + removedConnections.Clear(); return default; } } diff --git a/TechbloxModdingAPI/Blocks/Engines/SignalEngine.cs b/TechbloxModdingAPI/Blocks/Engines/SignalEngine.cs index ffd2b07..a30f638 100644 --- a/TechbloxModdingAPI/Blocks/Engines/SignalEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/SignalEngine.cs @@ -226,27 +226,27 @@ namespace TechbloxModdingAPI.Blocks.Engines uint entityID = (output ? ports.firstOutputID : ports.firstInputID) + i; if (!mapper.TryGetArrayAndEntityIndex(entityID, out var index, out var array) || array[index].usage != portUsage) continue; - return new OptionalRef(array, index); + return new OptionalRef(array, index, new EGID(entityID, group)); } return default; } - public ref WireEntityStruct MatchPortToWire(PortEntityStruct port, EGID blockID, out bool exists) + public OptionalRef MatchPortToWire(PortEntityStruct port, EGID blockID, out EGID wireID) { - var (wires, count) = entitiesDB.QueryEntities(NamedExclusiveGroup.Group); + var (wires, ids, count) = entitiesDB.QueryEntities(NamedExclusiveGroup.Group); for (uint i = 0; i < count; i++) { if ((wires[i].destinationPortUsage == port.usage && wires[i].destinationBlockEGID == blockID) || (wires[i].sourcePortUsage == port.usage && wires[i].sourceBlockEGID == blockID)) { - exists = true; - return ref wires[i]; + wireID = new EGID(ids[i], BuildModeWiresGroups.WiresGroup.Group); + return new OptionalRef(wires, i); } } - exists = false; - WireEntityStruct[] defRef = new WireEntityStruct[1]; - return ref defRef[0]; + + wireID = default; + return default; } public EGID MatchBlocksToWire(EGID startBlock, EGID endBlock, byte startPort = byte.MaxValue, byte endPort = byte.MaxValue) @@ -275,19 +275,23 @@ namespace TechbloxModdingAPI.Blocks.Engines endPorts = new EGID[] {new EGID(ports.firstInputID + endPort, NamedExclusiveGroup.Group) }; } - var (wires, count) = entitiesDB.QueryEntities(NamedExclusiveGroup.Group); for (int endIndex = 0; endIndex < endPorts.Length; endIndex++) { PortEntityStruct endPES = entitiesDB.QueryEntity(endPorts[endIndex]); for (int startIndex = 0; startIndex < startPorts.Length; startIndex++) { PortEntityStruct startPES = entitiesDB.QueryEntity(startPorts[startIndex]); + foreach (var wire in entitiesDB.QueryEntitiesOptional( + NamedExclusiveGroup.Group)) + { + + } for (int w = 0; w < count; w++) { if ((wires[w].destinationPortUsage == endPES.usage && wires[w].destinationBlockEGID == endBlock) && (wires[w].sourcePortUsage == startPES.usage && wires[w].sourceBlockEGID == startBlock)) { - return wires[w].ID; + return new EGID(ids[w], NamedExclusiveGroup.Group); } } } @@ -308,12 +312,12 @@ namespace TechbloxModdingAPI.Blocks.Engines public EGID[] GetElectricBlocks() { var res = new FasterList(); - foreach (var ((coll, count), _) in entitiesDB.QueryEntities()) + foreach (var ((coll, ids, count), _) in entitiesDB.QueryEntities()) { for (int i = 0; i < count; i++) { ref BlockPortsStruct s = ref coll[i]; - //res.Add(s.ID); - TODO + //res.Add(s.ID); - TODO: Would need to search for the groups for each block } } diff --git a/TechbloxModdingAPI/Blocks/SignalingBlock.cs b/TechbloxModdingAPI/Blocks/SignalingBlock.cs index 7ae6e6a..bf679c4 100644 --- a/TechbloxModdingAPI/Blocks/SignalingBlock.cs +++ b/TechbloxModdingAPI/Blocks/SignalingBlock.cs @@ -46,9 +46,9 @@ namespace TechbloxModdingAPI.Blocks /// The connected wire. /// Port identifier. /// Whether the port has a wire connected to it. - protected ref WireEntityStruct GetConnectedWire(PortEntityStruct port, out bool connected) + protected OptionalRef GetConnectedWire(PortEntityStruct port, out EGID egid) { - return ref SignalEngine.MatchPortToWire(port, Id, out connected); + return SignalEngine.MatchPortToWire(port, Id, out egid); } /// diff --git a/TechbloxModdingAPI/Blocks/Wire.cs b/TechbloxModdingAPI/Blocks/Wire.cs index e59312d..41a8791 100644 --- a/TechbloxModdingAPI/Blocks/Wire.cs +++ b/TechbloxModdingAPI/Blocks/Wire.cs @@ -5,6 +5,7 @@ using Svelto.ECS; using Svelto.ECS.Experimental; using TechbloxModdingAPI.Blocks.Engines; +using TechbloxModdingAPI.Utility; namespace TechbloxModdingAPI.Blocks { @@ -45,9 +46,9 @@ namespace TechbloxModdingAPI.Blocks { var port = signalEngine.MatchBlockIOToPort(end, endPort, false); if (!port) return null; - WireEntityStruct wire = signalEngine.MatchPortToWire(port, end.Id, out var exists); - return exists - ? new Wire(wire.sourceBlockEGID, end.Id, wire.sourcePortUsage, endPort, wire.ID, false) + var wire = signalEngine.MatchPortToWire(port, end.Id, out var egid); + return wire + ? new Wire(wire.Get().sourceBlockEGID, end.Id, wire.Get().sourcePortUsage, endPort, egid, false) : null; } @@ -62,9 +63,9 @@ namespace TechbloxModdingAPI.Blocks { var port = signalEngine.MatchBlockIOToPort(start, startPort, true); if (!port) return null; - WireEntityStruct wire = signalEngine.MatchPortToWire(port, start.Id, out var exists); - return exists - ? new Wire(start.Id, wire.destinationBlockEGID, startPort, wire.destinationPortUsage, wire.ID, false) + var wire = signalEngine.MatchPortToWire(port, start.Id, out var egid); + return wire + ? new Wire(start.Id, wire.Get().destinationBlockEGID, startPort, wire.Get().destinationPortUsage, egid, false) : null; } diff --git a/TechbloxModdingAPI/Utility/ManagedApiExtensions.cs b/TechbloxModdingAPI/Utility/ManagedApiExtensions.cs index b67705f..fb8d758 100644 --- a/TechbloxModdingAPI/Utility/ManagedApiExtensions.cs +++ b/TechbloxModdingAPI/Utility/ManagedApiExtensions.cs @@ -1,3 +1,5 @@ +using System.Collections; +using System.Collections.Generic; using Svelto.ECS; using Svelto.ECS.Hybrid; @@ -18,7 +20,7 @@ namespace TechbloxModdingAPI.Utility { return entitiesDB.TryQueryEntitiesAndIndex(egid, out uint index, out var array) ? new OptionalRef(array, index) - : new OptionalRef(); + : new OptionalRef(); } /// @@ -29,7 +31,8 @@ namespace TechbloxModdingAPI.Utility /// The group of the entity if the object can have multiple /// The component to query /// A reference to the component or a dummy value - public static OptionalRef QueryEntityOptional(this EntitiesDB entitiesDB, EcsObjectBase obj, ExclusiveGroupStruct group = default) + public static OptionalRef QueryEntityOptional(this EntitiesDB entitiesDB, EcsObjectBase obj, + ExclusiveGroupStruct group = default) where T : struct, IEntityViewComponent { EGID id = group == ExclusiveGroupStruct.Invalid ? obj.Id : new EGID(obj.Id.entityID, group); @@ -45,7 +48,8 @@ namespace TechbloxModdingAPI.Utility /// The group of the entity if the object can have multiple /// The component to query /// A reference to the component or a dummy value - public static ref T QueryEntityOrDefault(this EntitiesDB entitiesDB, EcsObjectBase obj, ExclusiveGroupStruct group = default) + public static ref T QueryEntityOrDefault(this EntitiesDB entitiesDB, EcsObjectBase obj, + ExclusiveGroupStruct group = default) where T : struct, IEntityViewComponent { EGID id = group == ExclusiveGroupStruct.Invalid ? obj.Id : new EGID(obj.Id.entityID, group); @@ -54,5 +58,19 @@ namespace TechbloxModdingAPI.Utility if (obj.InitData.Valid) return ref obj.InitData.Initializer(id).GetOrAdd(); return ref opt.Get(); //Default value } + + /// + /// Query entities as OptionalRefs. The elements always exist, it's just a nice way to encapsulate the data. + /// + /// + /// + /// + /// + /// + /// + public static RefCollection QueryEntitiesOptional(this EntitiesDB entitiesDB, ExclusiveGroupStruct group) where T : struct, IBaseEntityComponent + { + return entitiesDB.QueryEntities(group); + } } } \ No newline at end of file diff --git a/TechbloxModdingAPI/Utility/NativeApiExtensions.cs b/TechbloxModdingAPI/Utility/NativeApiExtensions.cs index dec1eb0..a673bc4 100644 --- a/TechbloxModdingAPI/Utility/NativeApiExtensions.cs +++ b/TechbloxModdingAPI/Utility/NativeApiExtensions.cs @@ -22,7 +22,7 @@ namespace TechbloxModdingAPI.Utility { return entitiesDB.TryQueryEntitiesAndIndex(egid, out uint index, out var array) ? new OptionalRef(array, index) - : new OptionalRef(); + : new OptionalRef(); } /// @@ -33,7 +33,8 @@ namespace TechbloxModdingAPI.Utility /// The group of the entity if the object can have multiple /// The component to query /// A reference to the component or a dummy value - public static OptionalRef QueryEntityOptional(this EntitiesDB entitiesDB, EcsObjectBase obj, ExclusiveGroupStruct group = default) + public static OptionalRef QueryEntityOptional(this EntitiesDB entitiesDB, EcsObjectBase obj, + ExclusiveGroupStruct group = default) where T : unmanaged, IEntityComponent { EGID id = group == ExclusiveGroupStruct.Invalid ? obj.Id : new EGID(obj.Id.entityID, group); @@ -49,7 +50,8 @@ namespace TechbloxModdingAPI.Utility /// The group of the entity if the object can have multiple /// The component to query /// A reference to the component or a dummy value - public static ref T QueryEntityOrDefault(this EntitiesDB entitiesDB, EcsObjectBase obj, ExclusiveGroupStruct group = default) + public static ref T QueryEntityOrDefault(this EntitiesDB entitiesDB, EcsObjectBase obj, + ExclusiveGroupStruct group = default) where T : unmanaged, IEntityComponent { EGID id = group == ExclusiveGroupStruct.Invalid ? obj.Id : new EGID(obj.Id.entityID, group); @@ -76,8 +78,9 @@ namespace TechbloxModdingAPI.Utility /// The component that changed public static void PublishEntityChangeDelayed(this EntitiesDB entitiesDB, EGID id, int limit = 80) where T : unmanaged, IEntityComponent - { //TODO: Doesn't seem to help - if(!ChangesToPublish.ContainsKey(typeof(T))) + { + //TODO: Doesn't seem to help + if (!ChangesToPublish.ContainsKey(typeof(T))) ChangesToPublish.Add(typeof(T), (0, new HashSet())); var changes = ChangesToPublish[typeof(T)].Changes; if (changes.Contains(id)) return; @@ -98,5 +101,15 @@ namespace TechbloxModdingAPI.Utility yield return Yield.It; ChangesToPublish[typeof(T)] = (0, changes); } + + public static IEnumerable QueryEntities(this EntitiesDB entitiesDB, ExclusiveGroupStruct group, + ManagedApiExtensions.EntityEnumeratorSelect select) where T : unmanaged, IEntityComponent + { + var (coll, ids, count) = entitiesDB.QueryEntities(group); + for (uint i = 0; i < count; i++) + { + yield return select(ref coll[i], new EGID(ids[i], group)); + } + } } } \ No newline at end of file diff --git a/TechbloxModdingAPI/Utility/OptionalRef.cs b/TechbloxModdingAPI/Utility/OptionalRef.cs index a5e26b6..e1dfb4b 100644 --- a/TechbloxModdingAPI/Utility/OptionalRef.cs +++ b/TechbloxModdingAPI/Utility/OptionalRef.cs @@ -4,8 +4,9 @@ using Svelto.ECS; namespace TechbloxModdingAPI.Utility { - public ref struct OptionalRef where T : struct, IEntityComponent + public ref struct OptionalRef where T : struct, IBaseEntityComponent { + private readonly EGID entityId; private readonly State state; private readonly uint index; private NB array; @@ -13,19 +14,21 @@ namespace TechbloxModdingAPI.Utility private readonly EntityInitializer initializer; //The possible fields are: (index && (array || managedArray)) || initializer - public OptionalRef(NB array, uint index) + public OptionalRef(NB array, uint index, EGID entityId = default) { state = State.Native; this.array = array; this.index = index; + this.entityId = entityId; initializer = default; } - public OptionalRef(MB array, uint index) + public OptionalRef(MB array, uint index, EGID entityId = default) { state = State.Managed; managedArray = array; this.index = index; + this.entityId = entityId; initializer = default; this.array = default; } @@ -35,8 +38,9 @@ namespace TechbloxModdingAPI.Utility /// /// The object with the initializer /// Whether the struct is unmanaged - public OptionalRef(EcsObjectBase obj, bool unmanaged) + public OptionalRef(EcsObjectBase obj, bool unmanaged, EGID entityId = default) { + this.entityId = entityId; if (obj.InitData.Valid) { initializer = obj.InitData.Initializer(obj.Id); @@ -80,6 +84,8 @@ namespace TechbloxModdingAPI.Utility public static implicit operator bool(OptionalRef opt) => opt.state != State.Empty; + public static implicit operator EGID(OptionalRef opt) => opt.entityId; + /// /// Creates an instance of a struct T that can be referenced. /// diff --git a/TechbloxModdingAPI/Utility/RefCollection.cs b/TechbloxModdingAPI/Utility/RefCollection.cs new file mode 100644 index 0000000..13a91d2 --- /dev/null +++ b/TechbloxModdingAPI/Utility/RefCollection.cs @@ -0,0 +1,88 @@ +using System; +using Svelto.DataStructures; +using Svelto.ECS; +using Svelto.ECS.Hybrid; +using Svelto.ECS.Internal; + +namespace TechbloxModdingAPI.Utility +{ + public ref struct RefCollection where T : struct, IBaseEntityComponent + { + private readonly bool managed; + private int count; + private NB nativeArray; + private MB managedArray; + private NativeEntityIDs nativeIDs; + private ManagedEntityIDs managedIDs; + + private RefCollection(EntityCollection coll, T inst = default) + { + if (inst is IEntityComponent) + { + DeconstructCollection(coll); + } + if (typeof(T).IsAssignableFrom(typeof(IEntityViewComponent))) + { + (managedArray, managedIDs, count) = coll2; + } + } + + private void DeconstructCollection(EntityCollection coll) where TM : struct, IEntityViewComponent + where TN : unmanaged, IEntityComponent + { + switch (coll) + { + case EntityCollection cm: + { + MB ma; + (ma, managedIDs, count) = cm; + if (ma is MB mb) + managedArray = mb; + else + throw new InvalidCastException("Expected managed buffer in managed entity collection! Wut"); + break; + } + case EntityCollection cn: + { + NB na; + (na, nativeIDs, count) = cn; + if (na is NB nb) + nativeArray = nb; + else + throw new InvalidCastException("Expected native buffer in native entity collection! Wut"); + break; + } + } + } + + public static implicit operator RefCollection(EntityCollection coll) + { + return new RefCollection(coll); + } + + public Enumerator GetEnumerator() => new(this); + + public ref struct Enumerator + { + private RefCollection collection; + private uint index; + public Enumerator(RefCollection collection) + { + index = default; + this.collection = collection; + } + + public OptionalRef Current => collection.coll.[index]; + + public bool MoveNext() + { + return true; + } + } + + private static void Test(EntityCollection coll) where TN : unmanaged, IEntityComponent + { + + } + } +} \ No newline at end of file -- 2.30.2 From 5117b695007b77c357d46e3b64b7b2721b4a45c2 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Thu, 29 Sep 2022 01:26:51 +0200 Subject: [PATCH 246/252] Fix RefCollection and start using it to query multiple users - I overcomplicated in the beginning - It doesn't shorten the code that much but it provides a stable interface and it's easier to use so I guess it's nice --- .../Blocks/Engines/SignalEngine.cs | 13 +-- .../Utility/ManagedApiExtensions.cs | 5 +- .../Utility/NativeApiExtensions.cs | 19 ++-- TechbloxModdingAPI/Utility/OptionalRef.cs | 5 + TechbloxModdingAPI/Utility/RefCollection.cs | 95 ++++++++----------- 5 files changed, 64 insertions(+), 73 deletions(-) diff --git a/TechbloxModdingAPI/Blocks/Engines/SignalEngine.cs b/TechbloxModdingAPI/Blocks/Engines/SignalEngine.cs index a30f638..75dbddc 100644 --- a/TechbloxModdingAPI/Blocks/Engines/SignalEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/SignalEngine.cs @@ -281,17 +281,14 @@ namespace TechbloxModdingAPI.Blocks.Engines for (int startIndex = 0; startIndex < startPorts.Length; startIndex++) { PortEntityStruct startPES = entitiesDB.QueryEntity(startPorts[startIndex]); - foreach (var wire in entitiesDB.QueryEntitiesOptional( + foreach (var wireOpt in entitiesDB.QueryEntitiesOptional( NamedExclusiveGroup.Group)) { - - } - for (int w = 0; w < count; w++) - { - if ((wires[w].destinationPortUsage == endPES.usage && wires[w].destinationBlockEGID == endBlock) - && (wires[w].sourcePortUsage == startPES.usage && wires[w].sourceBlockEGID == startBlock)) + var wire = wireOpt.Get(); + if ((wire.destinationPortUsage == endPES.usage && wire.destinationBlockEGID == endBlock) + && (wire.sourcePortUsage == startPES.usage && wire.sourceBlockEGID == startBlock)) { - return new EGID(ids[w], NamedExclusiveGroup.Group); + return wireOpt.EGID; } } } diff --git a/TechbloxModdingAPI/Utility/ManagedApiExtensions.cs b/TechbloxModdingAPI/Utility/ManagedApiExtensions.cs index fb8d758..cf61e14 100644 --- a/TechbloxModdingAPI/Utility/ManagedApiExtensions.cs +++ b/TechbloxModdingAPI/Utility/ManagedApiExtensions.cs @@ -68,9 +68,10 @@ namespace TechbloxModdingAPI.Utility /// /// /// - public static RefCollection QueryEntitiesOptional(this EntitiesDB entitiesDB, ExclusiveGroupStruct group) where T : struct, IBaseEntityComponent + public static RefCollection QueryEntitiesOptional(this EntitiesDB entitiesDB, ExclusiveGroupStruct group) where T : struct, IEntityViewComponent { - return entitiesDB.QueryEntities(group); + var (buffer, ids, count) = entitiesDB.QueryEntities(group); + return new RefCollection(count, buffer, ids, group); } } } \ No newline at end of file diff --git a/TechbloxModdingAPI/Utility/NativeApiExtensions.cs b/TechbloxModdingAPI/Utility/NativeApiExtensions.cs index a673bc4..c20a4b2 100644 --- a/TechbloxModdingAPI/Utility/NativeApiExtensions.cs +++ b/TechbloxModdingAPI/Utility/NativeApiExtensions.cs @@ -102,14 +102,19 @@ namespace TechbloxModdingAPI.Utility ChangesToPublish[typeof(T)] = (0, changes); } - public static IEnumerable QueryEntities(this EntitiesDB entitiesDB, ExclusiveGroupStruct group, - ManagedApiExtensions.EntityEnumeratorSelect select) where T : unmanaged, IEntityComponent + /// + /// Query entities as OptionalRefs. The elements always exist, it's just a nice way to encapsulate the data. + /// + /// + /// + /// + /// + /// + /// + public static RefCollection QueryEntitiesOptional(this EntitiesDB entitiesDB, ExclusiveGroupStruct group) where T : unmanaged, IEntityComponent { - var (coll, ids, count) = entitiesDB.QueryEntities(group); - for (uint i = 0; i < count; i++) - { - yield return select(ref coll[i], new EGID(ids[i], group)); - } + var (buffer, ids, count) = entitiesDB.QueryEntities(group); + return new RefCollection(count, buffer, ids, group); } } } \ No newline at end of file diff --git a/TechbloxModdingAPI/Utility/OptionalRef.cs b/TechbloxModdingAPI/Utility/OptionalRef.cs index e1dfb4b..b89ff88 100644 --- a/TechbloxModdingAPI/Utility/OptionalRef.cs +++ b/TechbloxModdingAPI/Utility/OptionalRef.cs @@ -77,6 +77,11 @@ namespace TechbloxModdingAPI.Utility set => Get() = value; } + /// + /// The ID of the entity this component belongs to. + /// + public EGID EGID => entityId; + public bool Exists => state != State.Empty; public T? Nullable() => this ? Get() : default; diff --git a/TechbloxModdingAPI/Utility/RefCollection.cs b/TechbloxModdingAPI/Utility/RefCollection.cs index 13a91d2..be76390 100644 --- a/TechbloxModdingAPI/Utility/RefCollection.cs +++ b/TechbloxModdingAPI/Utility/RefCollection.cs @@ -6,83 +6,66 @@ using Svelto.ECS.Internal; namespace TechbloxModdingAPI.Utility { - public ref struct RefCollection where T : struct, IBaseEntityComponent + public readonly ref struct RefCollection where T : struct, IBaseEntityComponent { private readonly bool managed; - private int count; - private NB nativeArray; - private MB managedArray; - private NativeEntityIDs nativeIDs; - private ManagedEntityIDs managedIDs; + private readonly int count; + private readonly NB nativeArray; + private readonly MB managedArray; + private readonly NativeEntityIDs nativeIDs; + private readonly ManagedEntityIDs managedIDs; + private readonly ExclusiveGroupStruct group; - private RefCollection(EntityCollection coll, T inst = default) + public RefCollection(int count, MB managedArray, ManagedEntityIDs managedIDs, ExclusiveGroupStruct group) { - if (inst is IEntityComponent) - { - DeconstructCollection(coll); - } - if (typeof(T).IsAssignableFrom(typeof(IEntityViewComponent))) - { - (managedArray, managedIDs, count) = coll2; - } + this.count = count; + this.managedArray = managedArray; + this.managedIDs = managedIDs; + this.group = group; + managed = true; + nativeArray = default; + nativeIDs = default; } - private void DeconstructCollection(EntityCollection coll) where TM : struct, IEntityViewComponent - where TN : unmanaged, IEntityComponent + public RefCollection(int count, NB nativeArray, NativeEntityIDs nativeIDs, ExclusiveGroupStruct group) { - switch (coll) - { - case EntityCollection cm: - { - MB ma; - (ma, managedIDs, count) = cm; - if (ma is MB mb) - managedArray = mb; - else - throw new InvalidCastException("Expected managed buffer in managed entity collection! Wut"); - break; - } - case EntityCollection cn: - { - NB na; - (na, nativeIDs, count) = cn; - if (na is NB nb) - nativeArray = nb; - else - throw new InvalidCastException("Expected native buffer in native entity collection! Wut"); - break; - } - } - } - - public static implicit operator RefCollection(EntityCollection coll) - { - return new RefCollection(coll); + this.count = count; + this.nativeArray = nativeArray; + this.nativeIDs = nativeIDs; + this.group = group; + managed = false; } public Enumerator GetEnumerator() => new(this); public ref struct Enumerator { - private RefCollection collection; - private uint index; + private RefCollection coll; + private int index; + public Enumerator(RefCollection collection) { - index = default; - this.collection = collection; + index = -1; + coll = collection; } - public OptionalRef Current => collection.coll.[index]; + public OptionalRef Current + { + get + { + if (coll.count <= index && index >= 0) return default; + if (coll.managed) + return new OptionalRef(coll.managedArray, (uint)index, + new EGID(coll.managedIDs[index], coll.group)); + return new OptionalRef(coll.nativeArray, (uint)index, + new EGID(coll.nativeIDs[index], coll.group)); + } + } public bool MoveNext() { - return true; + return ++index < coll.count; } } - - private static void Test(EntityCollection coll) where TN : unmanaged, IEntityComponent - { - - } } } \ No newline at end of file -- 2.30.2 From 5e90c5ee261aed834ed8de0c860115ed8088b90c Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sun, 2 Oct 2022 01:34:51 +0200 Subject: [PATCH 247/252] Fix all compiler issues and add Count property and smart ToArray() function to RefCollection - Collections can be converted into arrays using a mapper and a predicate function --- CodeGenerator/CodeGenerator.csproj | 107 +++++++----------- TechbloxModdingAPI/App/Client.cs | 5 - TechbloxModdingAPI/App/GameGameEngine.cs | 9 +- TechbloxModdingAPI/App/GameMenuEngine.cs | 10 -- .../Blocks/Engines/BlockEngine.cs | 19 ++-- .../Blocks/Engines/SignalEngine.cs | 47 ++------ TechbloxModdingAPI/Blocks/Wire.cs | 12 +- TechbloxModdingAPI/Player.cs | 44 +++---- TechbloxModdingAPI/Players/PlayerEngine.cs | 5 +- TechbloxModdingAPI/TechbloxModdingAPI.csproj | 104 +++++++---------- .../Tests/TechbloxModdingAPIPluginTest.cs | 2 - TechbloxModdingAPI/Utility/OptionalRef.cs | 2 +- TechbloxModdingAPI/Utility/RefCollection.cs | 21 ++++ 13 files changed, 162 insertions(+), 225 deletions(-) diff --git a/CodeGenerator/CodeGenerator.csproj b/CodeGenerator/CodeGenerator.csproj index 32255ac..c80dce9 100644 --- a/CodeGenerator/CodeGenerator.csproj +++ b/CodeGenerator/CodeGenerator.csproj @@ -115,10 +115,6 @@ ..\ref\Techblox_Data\Managed\Gamecraft.BlockGroups.dll ..\..\ref\Techblox_Data\Managed\Gamecraft.BlockGroups.dll - - ..\ref\Techblox_Data\Managed\Gamecraft.Blocks.DestructionBlocks.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.Blocks.DestructionBlocks.dll - ..\ref\Techblox_Data\Managed\Gamecraft.Blocks.LogicBlock.dll ..\..\ref\Techblox_Data\Managed\Gamecraft.Blocks.LogicBlock.dll @@ -283,10 +279,6 @@ ..\ref\Techblox_Data\Managed\Havok.Physics.Hybrid.dll ..\..\ref\Techblox_Data\Managed\Havok.Physics.Hybrid.dll - - ..\ref\Techblox_Data\Managed\JWT.dll - ..\..\ref\Techblox_Data\Managed\JWT.dll - ..\ref\Techblox_Data\Managed\LiteNetLib.dll ..\..\ref\Techblox_Data\Managed\LiteNetLib.dll @@ -415,10 +407,6 @@ ..\ref\Techblox_Data\Managed\RobocraftX.GUI.Inventory.dll ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.Inventory.dll - - ..\ref\Techblox_Data\Managed\RobocraftX.GUI.PauseMenu.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.PauseMenu.dll - ..\ref\Techblox_Data\Managed\RobocraftX.GUI.QuitConfirmation.dll ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.QuitConfirmation.dll @@ -547,6 +535,10 @@ ..\ref\Techblox_Data\Managed\Techblox.AdditionalParts.dll ..\..\ref\Techblox_Data\Managed\Techblox.AdditionalParts.dll + + ..\ref\Techblox_Data\Managed\Techblox.AntiAFKServer.dll + ..\..\ref\Techblox_Data\Managed\Techblox.AntiAFKServer.dll + ..\ref\Techblox_Data\Managed\Techblox.Anticheat.Client.dll ..\..\ref\Techblox_Data\Managed\Techblox.Anticheat.Client.dll @@ -555,10 +547,6 @@ ..\ref\Techblox_Data\Managed\Techblox.Anticheat.Common.dll ..\..\ref\Techblox_Data\Managed\Techblox.Anticheat.Common.dll - - ..\ref\Techblox_Data\Managed\Techblox.Anticheat.Server.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Anticheat.Server.dll - ..\ref\Techblox_Data\Managed\Techblox.AtmosphereBlock.dll ..\..\ref\Techblox_Data\Managed\Techblox.AtmosphereBlock.dll @@ -627,6 +615,18 @@ ..\ref\Techblox_Data\Managed\Techblox.CentreHUDGUI.dll ..\..\ref\Techblox_Data\Managed\Techblox.CentreHUDGUI.dll + + ..\ref\Techblox_Data\Managed\Techblox.CharacterDamage.Client.dll + ..\..\ref\Techblox_Data\Managed\Techblox.CharacterDamage.Client.dll + + + ..\ref\Techblox_Data\Managed\Techblox.CharacterDamage.Server.dll + ..\..\ref\Techblox_Data\Managed\Techblox.CharacterDamage.Server.dll + + + ..\ref\Techblox_Data\Managed\Techblox.CharacterRespawnScreen.dll + ..\..\ref\Techblox_Data\Managed\Techblox.CharacterRespawnScreen.dll + ..\ref\Techblox_Data\Managed\Techblox.CheckpointBlock.dll ..\..\ref\Techblox_Data\Managed\Techblox.CheckpointBlock.dll @@ -659,6 +659,14 @@ ..\ref\Techblox_Data\Managed\Techblox.CounterBlockServer.dll ..\..\ref\Techblox_Data\Managed\Techblox.CounterBlockServer.dll + + ..\ref\Techblox_Data\Managed\Techblox.DamageRbScoreBlockServerServer.dll + ..\..\ref\Techblox_Data\Managed\Techblox.DamageRbScoreBlockServerServer.dll + + + ..\ref\Techblox_Data\Managed\Techblox.DirectionalDamageVingette.dll + ..\..\ref\Techblox_Data\Managed\Techblox.DirectionalDamageVingette.dll + ..\ref\Techblox_Data\Managed\Techblox.DistanceSensorBlock.dll ..\..\ref\Techblox_Data\Managed\Techblox.DistanceSensorBlock.dll @@ -735,14 +743,14 @@ ..\ref\Techblox_Data\Managed\Techblox.GUI.BuildRules.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.BuildRules.dll + + ..\ref\Techblox_Data\Managed\Techblox.GUI.CharacterHealthFeedback.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.CharacterHealthFeedback.dll + ..\ref\Techblox_Data\Managed\Techblox.GUI.Collection.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Collection.dll - - ..\ref\Techblox_Data\Managed\Techblox.GUI.Commands.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Commands.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.Controls.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Controls.dll @@ -755,6 +763,10 @@ ..\ref\Techblox_Data\Managed\Techblox.GUI.GamePortal.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.GamePortal.dll + + ..\ref\Techblox_Data\Managed\Techblox.GUI.GeneralSettingsScreen.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.GeneralSettingsScreen.dll + ..\ref\Techblox_Data\Managed\Techblox.GUI.Hotbar.Landscapes.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Hotbar.Landscapes.dll @@ -783,6 +795,10 @@ ..\ref\Techblox_Data\Managed\Techblox.GUI.Login.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Login.dll + + ..\ref\Techblox_Data\Managed\Techblox.GUI.MachineReconstructTimer.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.MachineReconstructTimer.dll + ..\ref\Techblox_Data\Managed\Techblox.GUI.MainGame.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.MainGame.dll @@ -803,10 +819,6 @@ ..\ref\Techblox_Data\Managed\Techblox.GUI.Progression.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Progression.dll - - ..\ref\Techblox_Data\Managed\Techblox.GUI.ScreenCanvas.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.ScreenCanvas.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.TabsBar.Landscapes.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.TabsBar.Landscapes.dll @@ -819,10 +831,6 @@ ..\ref\Techblox_Data\Managed\Techblox.GUI.UsernameDisplay.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.UsernameDisplay.dll - - ..\ref\Techblox_Data\Managed\Techblox.GUI.WorldCanvas.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.WorldCanvas.dll - ..\ref\Techblox_Data\Managed\Techblox.InputCapture.dll ..\..\ref\Techblox_Data\Managed\Techblox.InputCapture.dll @@ -835,6 +843,10 @@ ..\ref\Techblox_Data\Managed\Techblox.JetBlockClient.dll ..\..\ref\Techblox_Data\Managed\Techblox.JetBlockClient.dll + + ..\ref\Techblox_Data\Managed\Techblox.KillScoreBlock.dll + ..\..\ref\Techblox_Data\Managed\Techblox.KillScoreBlock.dll + ..\ref\Techblox_Data\Managed\Techblox.MachineProcessingService.dll ..\..\ref\Techblox_Data\Managed\Techblox.MachineProcessingService.dll @@ -935,10 +947,6 @@ ..\ref\Techblox_Data\Managed\Techblox.Services.Anticheat.Client.dll ..\..\ref\Techblox_Data\Managed\Techblox.Services.Anticheat.Client.dll - - ..\ref\Techblox_Data\Managed\Techblox.Services.Anticheat.Server.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Services.Anticheat.Server.dll - ..\ref\Techblox_Data\Managed\Techblox.Services.Eos.Common.dll ..\..\ref\Techblox_Data\Managed\Techblox.Services.Eos.Common.dll @@ -947,10 +955,6 @@ ..\ref\Techblox_Data\Managed\Techblox.Services.Eos.dll ..\..\ref\Techblox_Data\Managed\Techblox.Services.Eos.dll - - ..\ref\Techblox_Data\Managed\Techblox.Services.Eos.Server.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Services.Eos.Server.dll - ..\ref\Techblox_Data\Managed\Techblox.Services.GameDetails.dll ..\..\ref\Techblox_Data\Managed\Techblox.Services.GameDetails.dll @@ -987,6 +991,10 @@ ..\ref\Techblox_Data\Managed\Techblox.Services.Users.dll ..\..\ref\Techblox_Data\Managed\Techblox.Services.Users.dll + + ..\ref\Techblox_Data\Managed\Techblox.ServoBlocksClient.dll + ..\..\ref\Techblox_Data\Managed\Techblox.ServoBlocksClient.dll + ..\ref\Techblox_Data\Managed\Techblox.ServoBlocksServer.dll ..\..\ref\Techblox_Data\Managed\Techblox.ServoBlocksServer.dll @@ -1147,22 +1155,6 @@ ..\ref\Techblox_Data\Managed\Unity.Addressables.dll ..\..\ref\Techblox_Data\Managed\Unity.Addressables.dll - - ..\ref\Techblox_Data\Managed\Unity.Burst.Cecil.dll - ..\..\ref\Techblox_Data\Managed\Unity.Burst.Cecil.dll - - - ..\ref\Techblox_Data\Managed\Unity.Burst.Cecil.Mdb.dll - ..\..\ref\Techblox_Data\Managed\Unity.Burst.Cecil.Mdb.dll - - - ..\ref\Techblox_Data\Managed\Unity.Burst.Cecil.Pdb.dll - ..\..\ref\Techblox_Data\Managed\Unity.Burst.Cecil.Pdb.dll - - - ..\ref\Techblox_Data\Managed\Unity.Burst.Cecil.Rocks.dll - ..\..\ref\Techblox_Data\Managed\Unity.Burst.Cecil.Rocks.dll - ..\ref\Techblox_Data\Managed\Unity.Burst.dll ..\..\ref\Techblox_Data\Managed\Unity.Burst.dll @@ -1479,10 +1471,6 @@ ..\ref\Techblox_Data\Managed\UnityEngine.TextCoreFontEngineModule.dll ..\..\ref\Techblox_Data\Managed\UnityEngine.TextCoreFontEngineModule.dll - - ..\ref\Techblox_Data\Managed\UnityEngine.TextCoreModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.TextCoreModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.TextCoreTextEngineModule.dll ..\..\ref\Techblox_Data\Managed\UnityEngine.TextCoreTextEngineModule.dll @@ -1595,17 +1583,10 @@ ..\ref\Techblox_Data\Managed\websocket-sharp.dll ..\..\ref\Techblox_Data\Managed\websocket-sharp.dll - - ..\ref\Techblox_Data\Managed\Whinarn.UnityMeshSimplifier.Runtime.dll - ..\..\ref\Techblox_Data\Managed\Whinarn.UnityMeshSimplifier.Runtime.dll - ..\ref\Techblox_Data\Managed\ZFBrowser.dll ..\..\ref\Techblox_Data\Managed\ZFBrowser.dll - - - \ No newline at end of file diff --git a/TechbloxModdingAPI/App/Client.cs b/TechbloxModdingAPI/App/Client.cs index 89f486f..317adec 100644 --- a/TechbloxModdingAPI/App/Client.cs +++ b/TechbloxModdingAPI/App/Client.cs @@ -114,11 +114,6 @@ namespace TechbloxModdingAPI.App popup.SecondButton(); } - internal void CloseBetaPopup() - { - Game.menuEngine.CloseBetaPopup(); - } - internal static void Init() { // this would have been so much simpler if this didn't involve a bunch of internal fields & classes diff --git a/TechbloxModdingAPI/App/GameGameEngine.cs b/TechbloxModdingAPI/App/GameGameEngine.cs index a07bed8..8eab6fd 100644 --- a/TechbloxModdingAPI/App/GameGameEngine.cs +++ b/TechbloxModdingAPI/App/GameGameEngine.cs @@ -140,18 +140,19 @@ namespace TechbloxModdingAPI.App { var allBlocks = entitiesDB.QueryEntities(); List blockEGIDs = new List(); - foreach (var ((buffer, count), _) in allBlocks) + foreach (var ((_, ids, count), group) in allBlocks) { for (int i = 0; i < count; i++) { + var id = new EGID(ids[i], group); uint dbid; if (filter == BlockIDs.Invalid) dbid = (uint)filter; else - dbid = entitiesDB.QueryEntity(buffer[i].ID).DBID; - var ownership = entitiesDB.QueryEntity(buffer[i].ID).BlockOwnership; + dbid = entitiesDB.QueryEntity(id).DBID; + var ownership = entitiesDB.QueryEntity(id).BlockOwnership; if ((ownership & BlockOwnership.User) != 0 && dbid == (ulong)filter) - blockEGIDs.Add(buffer[i].ID); + blockEGIDs.Add(id); } } diff --git a/TechbloxModdingAPI/App/GameMenuEngine.cs b/TechbloxModdingAPI/App/GameMenuEngine.cs index 0f68299..8da4742 100644 --- a/TechbloxModdingAPI/App/GameMenuEngine.cs +++ b/TechbloxModdingAPI/App/GameMenuEngine.cs @@ -154,16 +154,6 @@ namespace TechbloxModdingAPI.App { return ref entitiesDB.QueryEntity(id); } - - internal void CloseBetaPopup() - { - var (buffer, count) = entitiesDB.QueryEntities(ExclusiveGroup.Search("BetaPopup")); - for (int index = 0; index < count; ++index) - { - entitiesDB.QueryEntity(buffer[index].TogglePanelButtonComponent.targetPanel) - .guiRoot.enabled = false; - } - } } internal class MyGameDataEntityDescriptor_DamnItFJWhyDidYouMakeThisInternal : GenericEntityDescriptor { } diff --git a/TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs b/TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs index dc035ee..e3d7695 100644 --- a/TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs @@ -70,7 +70,7 @@ namespace TechbloxModdingAPI.Blocks.Engines public float4 ConvertBlockColor(byte index) => index == byte.MaxValue ? new float4(-1f, -1f, -1f, -1f) : entitiesDB.QueryEntity(index, - CommonExclusiveGroups.COLOUR_PALETTE_GROUP).Colour; + ColourPaletteExclusiveGroups.COLOUR_PALETTE_GROUP).Colour; public OptionalRef GetBlockInfoOptional(Block block) where T : unmanaged, IEntityComponent { @@ -171,14 +171,13 @@ namespace TechbloxModdingAPI.Blocks.Engines public SimBody[] GetSimBodiesFromID(byte id) { var ret = new FasterList(4); - var (oids, tags, count) = entitiesDB.QueryEntities(ObjectIDBlockExclusiveGroups.OBJECT_ID_BLOCK_GROUP); + var oids = entitiesDB.QueryEntitiesOptional(ObjectIDBlockExclusiveGroups.OBJECT_ID_BLOCK_GROUP); EGIDMapper? connections = null; - for (int i = 0; i < count; i++) + foreach (var oid in oids) { - if (oids[i].objectId != id) continue; - var tag = tags[i]; + if (oid.Get().objectId != id) continue; if (!connections.HasValue) //Would need reflection to get the group from the build group otherwise - connections = entitiesDB.QueryMappedEntities(tag.ID.groupID); + connections = entitiesDB.QueryMappedEntities(oid.EGID.groupID); //var rid = connections.Value.Entity(tag.ID.entityID).machineRigidBodyId; /*foreach (var rb in ret) - TODO { @@ -278,11 +277,11 @@ namespace TechbloxModdingAPI.Blocks.Engines return Array.Empty(); var ret = new FasterList(4); - var (oids, tags, count) = entitiesDB.QueryEntities(ObjectIDBlockExclusiveGroups.OBJECT_ID_BLOCK_GROUP); - for (var index = 0; index < count; index++) + var oids = entitiesDB.QueryEntitiesOptional(ObjectIDBlockExclusiveGroups.OBJECT_ID_BLOCK_GROUP); + foreach (var oid in oids) { - if (oids[index].objectIDToTrigger == id) - ret.Add(new ObjectID(tags[index].ID)); + if (oid.Get().objectIDToTrigger == id) + ret.Add(new ObjectID(oid.EGID)); } return ret.ToArray(); diff --git a/TechbloxModdingAPI/Blocks/Engines/SignalEngine.cs b/TechbloxModdingAPI/Blocks/Engines/SignalEngine.cs index 75dbddc..e2009b4 100644 --- a/TechbloxModdingAPI/Blocks/Engines/SignalEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/SignalEngine.cs @@ -41,7 +41,7 @@ namespace TechbloxModdingAPI.Blocks.Engines // implementations for block wiring - public WireEntityStruct CreateNewWire(EGID startBlock, byte startPort, EGID endBlock, byte endPort) + public (WireEntityStruct Wire, EGID ID) CreateNewWire(EGID startBlock, byte startPort, EGID endBlock, byte endPort) { EGID wireEGID = new EGID(BuildModeWiresGroups.NewWireEntityId, BuildModeWiresGroups.WiresGroup.Group); EntityInitializer wireInitializer = Factory.BuildEntity(wireEGID); @@ -50,10 +50,9 @@ namespace TechbloxModdingAPI.Blocks.Engines sourceBlockEGID = startBlock, sourcePortUsage = startPort, destinationBlockEGID = endBlock, - destinationPortUsage = endPort, - ID = wireEGID + destinationPortUsage = endPort }); - return wireInitializer.Get(); + return (wireInitializer.Get(), wireEGID); } public ref WireEntityStruct GetWire(EGID wire) @@ -323,42 +322,18 @@ namespace TechbloxModdingAPI.Blocks.Engines public EGID[] WiredToInput(EGID block, byte port) { - WireEntityStruct[] wireEntityStructs = Search(NamedExclusiveGroup.Group, - (WireEntityStruct wes) => wes.destinationPortUsage == port && wes.destinationBlockEGID == block); - EGID[] result = new EGID[wireEntityStructs.Length]; - for (uint i = 0; i < wireEntityStructs.Length; i++) - { - result[i] = wireEntityStructs[i].ID; - } - - return result; + return entitiesDB + .QueryEntitiesOptional(NamedExclusiveGroup.Group) + .ToArray(wire => wire.ID, + wire => wire.Component.destinationPortUsage == port && wire.Component.destinationBlockEGID == block); } public EGID[] WiredToOutput(EGID block, byte port) { - WireEntityStruct[] wireEntityStructs = Search(NamedExclusiveGroup.Group, - (WireEntityStruct wes) => wes.sourcePortUsage == port && wes.sourceBlockEGID == block); - EGID[] result = new EGID[wireEntityStructs.Length]; - for (uint i = 0; i < wireEntityStructs.Length; i++) - { - result[i] = wireEntityStructs[i].ID; - } - - return result; - } - - private T[] Search(ExclusiveGroup group, Func isMatch) where T : unmanaged, IEntityComponent - { - FasterList results = new FasterList(); - var (components, count) = entitiesDB.QueryEntities(group); - for (uint i = 0; i < count; i++) - { - if (isMatch(components[i])) - { - results.Add(components[i]); - } - } - return results.ToArray(); + return entitiesDB + .QueryEntitiesOptional(NamedExclusiveGroup.Group) + .ToArray(wire => wire.ID, + wire => wire.Component.sourcePortUsage == port && wire.Component.sourceBlockEGID == block); } private EntityCollection GetSignalStruct(uint signalID, out uint index, bool input = true) diff --git a/TechbloxModdingAPI/Blocks/Wire.cs b/TechbloxModdingAPI/Blocks/Wire.cs index 41a8791..1a949dd 100644 --- a/TechbloxModdingAPI/Blocks/Wire.cs +++ b/TechbloxModdingAPI/Blocks/Wire.cs @@ -31,8 +31,8 @@ namespace TechbloxModdingAPI.Blocks public static Wire Connect(SignalingBlock start, byte startPort, SignalingBlock end, byte endPort) { - WireEntityStruct wire = signalEngine.CreateNewWire(start.Id, startPort, end.Id, endPort); - return new Wire(wire, start, end); + var (wire, id) = signalEngine.CreateNewWire(start.Id, startPort, end.Id, endPort); + return new Wire(wire, start, end, id); } /// @@ -133,9 +133,9 @@ namespace TechbloxModdingAPI.Blocks this.endBlockEGID = endBlock; this.inputToOutput = inputToOutput; this.wireEGID = wire; - endPortEGID = signalEngine.MatchBlockIOToPort(startBlock, startPort, inputToOutput).Nullable()?.ID ?? default; + endPortEGID = signalEngine.MatchBlockIOToPort(startBlock, startPort, inputToOutput).EGID; if (endPortEGID == default) throw new WireInvalidException("Wire end port not found"); - startPortEGID = signalEngine.MatchBlockIOToPort(endBlock, endPort, !inputToOutput).Nullable()?.ID ?? default; + startPortEGID = signalEngine.MatchBlockIOToPort(endBlock, endPort, !inputToOutput).EGID; if (startPortEGID == default) throw new WireInvalidException("Wire start port not found"); this.startPort = startPort; this.endPort = endPort; @@ -152,8 +152,8 @@ namespace TechbloxModdingAPI.Blocks wireEgid, false); } - private Wire(WireEntityStruct wire, SignalingBlock src, SignalingBlock dest) - : this(src, dest, wire.sourcePortUsage, wire.destinationPortUsage, wire.ID, false) + private Wire(WireEntityStruct wire, SignalingBlock src, SignalingBlock dest, EGID wireEgid) + : this(src, dest, wire.sourcePortUsage, wire.destinationPortUsage, wireEgid, false) { } diff --git a/TechbloxModdingAPI/Player.cs b/TechbloxModdingAPI/Player.cs index 32901ad..857c477 100644 --- a/TechbloxModdingAPI/Player.cs +++ b/TechbloxModdingAPI/Player.cs @@ -1,6 +1,5 @@ using System; using Gamecraft.Wires; -using RobocraftX.Blocks.Ghost; using RobocraftX.Character; using RobocraftX.Character.Movement; using Unity.Mathematics; @@ -11,6 +10,7 @@ using RobocraftX.Physics; using Svelto.ECS; using Techblox.BuildingDrone; using Techblox.Camera; +using Techblox.Character; using TechbloxModdingAPI.Blocks; using TechbloxModdingAPI.Players; using TechbloxModdingAPI.Utility; @@ -214,15 +214,16 @@ namespace TechbloxModdingAPI /// The player's initial health when entering Simulation (aka Time Running) mode. /// /// The initial health. + [Obsolete("We can no longer get initial health, returns max health.")] public float InitialHealth { get { - var opt = playerEngine.GetCharacterStruct(Id); - return opt ? opt.Get().initialHealth : -1f; + var opt = playerEngine.GetCharacterStruct(Id); + return opt ? opt.Get().maxHealth : -1f; } - set => playerEngine.GetCharacterStruct(Id).Get().initialHealth = value; + set => playerEngine.GetCharacterStruct(Id).Get().maxHealth = value; } /// @@ -233,30 +234,25 @@ namespace TechbloxModdingAPI { get { - var opt = playerEngine.GetCharacterStruct(Id); + var opt = playerEngine.GetCharacterStruct(Id); return opt ? opt.Get().currentHealth : -1f; } - set => playerEngine.GetCharacterStruct(Id).Get().currentHealth = value; + set => playerEngine.GetCharacterStruct(Id).Get().currentHealth = value; } /// /// Whether this is damageable. /// /// true if damageable; otherwise, false. + [Obsolete("Players are probably always damageable")] public bool Damageable { - get - { - var opt = playerEngine.GetCharacterStruct(Id); - return opt.Get().canTakeDamageStat; - } + get => true; + // ReSharper disable once ValueParameterNotUsed set { - ref var healthStruct = ref playerEngine.GetCharacterStruct(Id).Get(); - healthStruct.canTakeDamage = value; - healthStruct.canTakeDamageStat = value; } } @@ -264,30 +260,26 @@ namespace TechbloxModdingAPI /// The player's lives when initially entering Simulation (aka Time Running) mode. /// /// The initial lives. + [Obsolete("The player has infinite lives")] public uint InitialLives { - get - { - var opt = playerEngine.GetCharacterStruct(Id); - return opt ? opt.Get().initialLives : uint.MaxValue; - } + get => uint.MaxValue; - set => playerEngine.GetCharacterStruct(Id).Get().initialLives = value; + // ReSharper disable once ValueParameterNotUsed + set { } } /// /// The player's current lives in Simulation (aka Time Running) mode. /// /// The current lives. + [Obsolete("The player has infinite lives")] public uint CurrentLives { - get - { - var opt = playerEngine.GetCharacterStruct(Id); - return opt ? opt.Get().currentLives : uint.MaxValue; - } + get => uint.MaxValue; - set => playerEngine.GetCharacterStruct(Id).Get().currentLives = value; + // ReSharper disable once ValueParameterNotUsed + set { } } /*/// diff --git a/TechbloxModdingAPI/Players/PlayerEngine.cs b/TechbloxModdingAPI/Players/PlayerEngine.cs index 24f019c..534f75a 100644 --- a/TechbloxModdingAPI/Players/PlayerEngine.cs +++ b/TechbloxModdingAPI/Players/PlayerEngine.cs @@ -115,7 +115,7 @@ namespace TechbloxModdingAPI.Players public bool IsDead(uint playerId) { if (entitiesDB == null) return true; - return entitiesDB.Exists(playerId, CharacterExclusiveGroups.DeadCharacters); + return entitiesDB.Exists(playerId, CharacterExclusiveGroups.DeadGroup); } // reusable methods @@ -164,8 +164,9 @@ namespace TechbloxModdingAPI.Players var opt = GetCameraStruct(playerId); if (!opt) return default; PhysicCameraRayCastEntityStruct rayCast = opt; + EGID physicCameraEgid = new EGID(playerId, CameraExclusiveGroups.PhysicCameraGroup); float distance = maxDistance < 0 - ? GhostBlockUtils.GetBuildInteractionDistance(entitiesDB, rayCast, + ? GhostBlockUtils.GetBuildInteractionDistance(entitiesDB, rayCast, physicCameraEgid, GhostBlockUtils.GhostCastMethod.GhostCastProportionalToBlockSize) : maxDistance; if (rayCast.hit && rayCast.distance <= distance) diff --git a/TechbloxModdingAPI/TechbloxModdingAPI.csproj b/TechbloxModdingAPI/TechbloxModdingAPI.csproj index 12ff5bb..709fc87 100644 --- a/TechbloxModdingAPI/TechbloxModdingAPI.csproj +++ b/TechbloxModdingAPI/TechbloxModdingAPI.csproj @@ -111,10 +111,6 @@ ..\ref\Techblox_Data\Managed\Gamecraft.BlockGroups.dll ..\..\ref\Techblox_Data\Managed\Gamecraft.BlockGroups.dll - - ..\ref\Techblox_Data\Managed\Gamecraft.Blocks.DestructionBlocks.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.Blocks.DestructionBlocks.dll - ..\ref\Techblox_Data\Managed\Gamecraft.Blocks.LogicBlock.dll ..\..\ref\Techblox_Data\Managed\Gamecraft.Blocks.LogicBlock.dll @@ -279,10 +275,6 @@ ..\ref\Techblox_Data\Managed\Havok.Physics.Hybrid.dll ..\..\ref\Techblox_Data\Managed\Havok.Physics.Hybrid.dll - - ..\ref\Techblox_Data\Managed\JWT.dll - ..\..\ref\Techblox_Data\Managed\JWT.dll - ..\ref\Techblox_Data\Managed\LiteNetLib.dll ..\..\ref\Techblox_Data\Managed\LiteNetLib.dll @@ -411,10 +403,6 @@ ..\ref\Techblox_Data\Managed\RobocraftX.GUI.Inventory.dll ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.Inventory.dll - - ..\ref\Techblox_Data\Managed\RobocraftX.GUI.PauseMenu.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.PauseMenu.dll - ..\ref\Techblox_Data\Managed\RobocraftX.GUI.QuitConfirmation.dll ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.QuitConfirmation.dll @@ -543,6 +531,10 @@ ..\ref\Techblox_Data\Managed\Techblox.AdditionalParts.dll ..\..\ref\Techblox_Data\Managed\Techblox.AdditionalParts.dll + + ..\ref\Techblox_Data\Managed\Techblox.AntiAFKServer.dll + ..\..\ref\Techblox_Data\Managed\Techblox.AntiAFKServer.dll + ..\ref\Techblox_Data\Managed\Techblox.Anticheat.Client.dll ..\..\ref\Techblox_Data\Managed\Techblox.Anticheat.Client.dll @@ -551,10 +543,6 @@ ..\ref\Techblox_Data\Managed\Techblox.Anticheat.Common.dll ..\..\ref\Techblox_Data\Managed\Techblox.Anticheat.Common.dll - - ..\ref\Techblox_Data\Managed\Techblox.Anticheat.Server.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Anticheat.Server.dll - ..\ref\Techblox_Data\Managed\Techblox.AtmosphereBlock.dll ..\..\ref\Techblox_Data\Managed\Techblox.AtmosphereBlock.dll @@ -623,6 +611,18 @@ ..\ref\Techblox_Data\Managed\Techblox.CentreHUDGUI.dll ..\..\ref\Techblox_Data\Managed\Techblox.CentreHUDGUI.dll + + ..\ref\Techblox_Data\Managed\Techblox.CharacterDamage.Client.dll + ..\..\ref\Techblox_Data\Managed\Techblox.CharacterDamage.Client.dll + + + ..\ref\Techblox_Data\Managed\Techblox.CharacterDamage.Server.dll + ..\..\ref\Techblox_Data\Managed\Techblox.CharacterDamage.Server.dll + + + ..\ref\Techblox_Data\Managed\Techblox.CharacterRespawnScreen.dll + ..\..\ref\Techblox_Data\Managed\Techblox.CharacterRespawnScreen.dll + ..\ref\Techblox_Data\Managed\Techblox.CheckpointBlock.dll ..\..\ref\Techblox_Data\Managed\Techblox.CheckpointBlock.dll @@ -655,6 +655,14 @@ ..\ref\Techblox_Data\Managed\Techblox.CounterBlockServer.dll ..\..\ref\Techblox_Data\Managed\Techblox.CounterBlockServer.dll + + ..\ref\Techblox_Data\Managed\Techblox.DamageRbScoreBlockServerServer.dll + ..\..\ref\Techblox_Data\Managed\Techblox.DamageRbScoreBlockServerServer.dll + + + ..\ref\Techblox_Data\Managed\Techblox.DirectionalDamageVingette.dll + ..\..\ref\Techblox_Data\Managed\Techblox.DirectionalDamageVingette.dll + ..\ref\Techblox_Data\Managed\Techblox.DistanceSensorBlock.dll ..\..\ref\Techblox_Data\Managed\Techblox.DistanceSensorBlock.dll @@ -731,14 +739,14 @@ ..\ref\Techblox_Data\Managed\Techblox.GUI.BuildRules.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.BuildRules.dll + + ..\ref\Techblox_Data\Managed\Techblox.GUI.CharacterHealthFeedback.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.CharacterHealthFeedback.dll + ..\ref\Techblox_Data\Managed\Techblox.GUI.Collection.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Collection.dll - - ..\ref\Techblox_Data\Managed\Techblox.GUI.Commands.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Commands.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.Controls.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Controls.dll @@ -751,6 +759,10 @@ ..\ref\Techblox_Data\Managed\Techblox.GUI.GamePortal.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.GamePortal.dll + + ..\ref\Techblox_Data\Managed\Techblox.GUI.GeneralSettingsScreen.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.GeneralSettingsScreen.dll + ..\ref\Techblox_Data\Managed\Techblox.GUI.Hotbar.Landscapes.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Hotbar.Landscapes.dll @@ -779,6 +791,10 @@ ..\ref\Techblox_Data\Managed\Techblox.GUI.Login.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Login.dll + + ..\ref\Techblox_Data\Managed\Techblox.GUI.MachineReconstructTimer.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.MachineReconstructTimer.dll + ..\ref\Techblox_Data\Managed\Techblox.GUI.MainGame.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.MainGame.dll @@ -799,10 +815,6 @@ ..\ref\Techblox_Data\Managed\Techblox.GUI.Progression.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Progression.dll - - ..\ref\Techblox_Data\Managed\Techblox.GUI.ScreenCanvas.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.ScreenCanvas.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.TabsBar.Landscapes.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.TabsBar.Landscapes.dll @@ -815,10 +827,6 @@ ..\ref\Techblox_Data\Managed\Techblox.GUI.UsernameDisplay.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.UsernameDisplay.dll - - ..\ref\Techblox_Data\Managed\Techblox.GUI.WorldCanvas.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.WorldCanvas.dll - ..\ref\Techblox_Data\Managed\Techblox.InputCapture.dll ..\..\ref\Techblox_Data\Managed\Techblox.InputCapture.dll @@ -831,6 +839,10 @@ ..\ref\Techblox_Data\Managed\Techblox.JetBlockClient.dll ..\..\ref\Techblox_Data\Managed\Techblox.JetBlockClient.dll + + ..\ref\Techblox_Data\Managed\Techblox.KillScoreBlock.dll + ..\..\ref\Techblox_Data\Managed\Techblox.KillScoreBlock.dll + ..\ref\Techblox_Data\Managed\Techblox.MachineProcessingService.dll ..\..\ref\Techblox_Data\Managed\Techblox.MachineProcessingService.dll @@ -931,10 +943,6 @@ ..\ref\Techblox_Data\Managed\Techblox.Services.Anticheat.Client.dll ..\..\ref\Techblox_Data\Managed\Techblox.Services.Anticheat.Client.dll - - ..\ref\Techblox_Data\Managed\Techblox.Services.Anticheat.Server.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Services.Anticheat.Server.dll - ..\ref\Techblox_Data\Managed\Techblox.Services.Eos.Common.dll ..\..\ref\Techblox_Data\Managed\Techblox.Services.Eos.Common.dll @@ -943,10 +951,6 @@ ..\ref\Techblox_Data\Managed\Techblox.Services.Eos.dll ..\..\ref\Techblox_Data\Managed\Techblox.Services.Eos.dll - - ..\ref\Techblox_Data\Managed\Techblox.Services.Eos.Server.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Services.Eos.Server.dll - ..\ref\Techblox_Data\Managed\Techblox.Services.GameDetails.dll ..\..\ref\Techblox_Data\Managed\Techblox.Services.GameDetails.dll @@ -983,6 +987,10 @@ ..\ref\Techblox_Data\Managed\Techblox.Services.Users.dll ..\..\ref\Techblox_Data\Managed\Techblox.Services.Users.dll + + ..\ref\Techblox_Data\Managed\Techblox.ServoBlocksClient.dll + ..\..\ref\Techblox_Data\Managed\Techblox.ServoBlocksClient.dll + ..\ref\Techblox_Data\Managed\Techblox.ServoBlocksServer.dll ..\..\ref\Techblox_Data\Managed\Techblox.ServoBlocksServer.dll @@ -1143,22 +1151,6 @@ ..\ref\Techblox_Data\Managed\Unity.Addressables.dll ..\..\ref\Techblox_Data\Managed\Unity.Addressables.dll - - ..\ref\Techblox_Data\Managed\Unity.Burst.Cecil.dll - ..\..\ref\Techblox_Data\Managed\Unity.Burst.Cecil.dll - - - ..\ref\Techblox_Data\Managed\Unity.Burst.Cecil.Mdb.dll - ..\..\ref\Techblox_Data\Managed\Unity.Burst.Cecil.Mdb.dll - - - ..\ref\Techblox_Data\Managed\Unity.Burst.Cecil.Pdb.dll - ..\..\ref\Techblox_Data\Managed\Unity.Burst.Cecil.Pdb.dll - - - ..\ref\Techblox_Data\Managed\Unity.Burst.Cecil.Rocks.dll - ..\..\ref\Techblox_Data\Managed\Unity.Burst.Cecil.Rocks.dll - ..\ref\Techblox_Data\Managed\Unity.Burst.dll ..\..\ref\Techblox_Data\Managed\Unity.Burst.dll @@ -1475,10 +1467,6 @@ ..\ref\Techblox_Data\Managed\UnityEngine.TextCoreFontEngineModule.dll ..\..\ref\Techblox_Data\Managed\UnityEngine.TextCoreFontEngineModule.dll - - ..\ref\Techblox_Data\Managed\UnityEngine.TextCoreModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.TextCoreModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.TextCoreTextEngineModule.dll ..\..\ref\Techblox_Data\Managed\UnityEngine.TextCoreTextEngineModule.dll @@ -1591,10 +1579,6 @@ ..\ref\Techblox_Data\Managed\websocket-sharp.dll ..\..\ref\Techblox_Data\Managed\websocket-sharp.dll - - ..\ref\Techblox_Data\Managed\Whinarn.UnityMeshSimplifier.Runtime.dll - ..\..\ref\Techblox_Data\Managed\Whinarn.UnityMeshSimplifier.Runtime.dll - ..\ref\Techblox_Data\Managed\ZFBrowser.dll ..\..\ref\Techblox_Data\Managed\ZFBrowser.dll diff --git a/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs b/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs index 7564816..32ed3e5 100644 --- a/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs +++ b/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs @@ -368,8 +368,6 @@ namespace TechbloxModdingAPI.Tests }, () => shouldTestGhostBlock)); Logging.CommandLog("Test enabled"); }).Build(); - - Client.EnterMenu += (sender, args) => Scheduler.Schedule(new Once(() => Client.Instance.CloseBetaPopup())); Game.Enter += (sender, args) => Console.WriteLine( diff --git a/TechbloxModdingAPI/Utility/OptionalRef.cs b/TechbloxModdingAPI/Utility/OptionalRef.cs index b89ff88..2d551e3 100644 --- a/TechbloxModdingAPI/Utility/OptionalRef.cs +++ b/TechbloxModdingAPI/Utility/OptionalRef.cs @@ -78,7 +78,7 @@ namespace TechbloxModdingAPI.Utility } /// - /// The ID of the entity this component belongs to. + /// The ID of the entity this component belongs to or default if it doesn't exist. /// public EGID EGID => entityId; diff --git a/TechbloxModdingAPI/Utility/RefCollection.cs b/TechbloxModdingAPI/Utility/RefCollection.cs index be76390..0776e8a 100644 --- a/TechbloxModdingAPI/Utility/RefCollection.cs +++ b/TechbloxModdingAPI/Utility/RefCollection.cs @@ -37,6 +37,27 @@ namespace TechbloxModdingAPI.Utility } public Enumerator GetEnumerator() => new(this); + + /// + /// The amount of items in the collection. + /// + public int Count => count; + + public T[] ToArray() => ToArray(a => a.Component); + + public TA[] ToArray(Func<(T Component, EGID ID), TA> transformFunction, Predicate<(T Component, EGID ID)> predicateFunction = null) + { + var result = new TA[Count]; + int i = 0; + foreach (var opt in this) + { + if (predicateFunction != null && !predicateFunction((opt.Get(), opt.EGID))) continue; + result[i] = transformFunction((opt.Get(), opt.EGID)); + i++; + } + + return result; + } public ref struct Enumerator { -- 2.30.2 From 23439abde310111c378ad3188addaad9d6e1cea7 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Tue, 4 Oct 2022 01:47:09 +0200 Subject: [PATCH 248/252] Add new blocks and materials, make every type public in the game, fix entity publish - Probably should've committed more - Added new block IDs and a material (also fixed material names) - Added missing player states - Added a class to make every type public in the game's code, so we don't need to worry about internal components - We don't need to worry about anticheat so it should be fine - will need to be made into its own exe though - Fixed delayed entity publishing and set the limits based on the consumers (just 30 almost everywhere) --- CodeGenerator/CodeGenerator.csproj | 1 + CodeGenerator/MakeEverythingPublicInGame.cs | 36 +++++++++++ CodeGenerator/Program.cs | 7 +++ TechbloxModdingAPI/Blocks/BlockIDs.cs | 16 ++++- TechbloxModdingAPI/Blocks/BlockMaterial.cs | 15 ++--- TechbloxModdingAPI/Blocks/BlockTests.cs | 1 - TechbloxModdingAPI/Blocks/Engine.cs | 60 +++++++++---------- .../Blocks/Engines/BlockEngine.cs | 9 +-- TechbloxModdingAPI/Player.cs | 3 + .../Utility/NativeApiExtensions.cs | 2 +- 10 files changed, 105 insertions(+), 45 deletions(-) create mode 100644 CodeGenerator/MakeEverythingPublicInGame.cs diff --git a/CodeGenerator/CodeGenerator.csproj b/CodeGenerator/CodeGenerator.csproj index c80dce9..41e2dc5 100644 --- a/CodeGenerator/CodeGenerator.csproj +++ b/CodeGenerator/CodeGenerator.csproj @@ -20,6 +20,7 @@ + diff --git a/CodeGenerator/MakeEverythingPublicInGame.cs b/CodeGenerator/MakeEverythingPublicInGame.cs new file mode 100644 index 0000000..9e8d47c --- /dev/null +++ b/CodeGenerator/MakeEverythingPublicInGame.cs @@ -0,0 +1,36 @@ +using System; +using System.IO; +using System.Reflection.Metadata; +using System.Text.RegularExpressions; +using Mono.Cecil; +using ModuleDefinition = Mono.Cecil.ModuleDefinition; + +namespace CodeGenerator +{ + public class MakeEverythingPublicInGame + { + public void Start() + { + Console.WriteLine("Starting assembly editing..."); + var fileRegex = + new Regex(".*(Techblox|Gamecraft|RobocraftX|FullGame|RobocraftECS|DataLoader|RCX|GameState)[^/]*(\\.dll)"); + foreach (var file in Directory.EnumerateFiles(@"../../../../../ref/Techblox_Data/Managed")) + { + if (!fileRegex.IsMatch(file)) continue; + Console.WriteLine(file); + ProcessAssembly(file); + } + } + + public void ProcessAssembly(string path) + { + var mod = ModuleDefinition.ReadModule(path, new(ReadingMode.Immediate) { ReadWrite = true }); + foreach (var typeDefinition in mod.Types) + { + typeDefinition.Attributes |= TypeAttributes.Public; + } + + mod.Write(); + } + } +} \ No newline at end of file diff --git a/CodeGenerator/Program.cs b/CodeGenerator/Program.cs index 900c6d4..fd3e0a5 100644 --- a/CodeGenerator/Program.cs +++ b/CodeGenerator/Program.cs @@ -11,6 +11,13 @@ namespace CodeGenerator internal class Program { public static void Main(string[] args) + { + GenerateBlockClasses(); + var mepig = new MakeEverythingPublicInGame(); + mepig.Start(); + } + + private static void GenerateBlockClasses() { var bcg = new BlockClassGenerator(); bcg.Generate("Engine", null, new Dictionary diff --git a/TechbloxModdingAPI/Blocks/BlockIDs.cs b/TechbloxModdingAPI/Blocks/BlockIDs.cs index bd4ba8a..3970824 100644 --- a/TechbloxModdingAPI/Blocks/BlockIDs.cs +++ b/TechbloxModdingAPI/Blocks/BlockIDs.cs @@ -302,6 +302,7 @@ namespace TechbloxModdingAPI.Blocks FloodLight, SoccerBall, CircularWallLight, + BlueSkyAtmos, DirtToGrassTransitionTile = 393, DirtToGrassTransitionInnerTile, DirtToGrassTransitionOuterTile, @@ -362,10 +363,21 @@ namespace TechbloxModdingAPI.Blocks SmallGridHill, SmallGridHillInnerCorner, SmallGridHillOuterCorner, - Vector7SmallJet = 460, + AimingAxleServo, + AimingHingeServo, + WeaponDisabler, + Vector7SmallJet, Vector7MediumJet, Vector7LargeJet, Vector7XLJet, - Vector7XXLJet + Vector7XXLJet, + APCWheelRigNoSteering, + APCWheelRigWithSteering, + APCWheel, + APCSeat, + APCEngine, + DamageScoreBlock, + KillScoreBlock, + Autocannon = 480 } } \ No newline at end of file diff --git a/TechbloxModdingAPI/Blocks/BlockMaterial.cs b/TechbloxModdingAPI/Blocks/BlockMaterial.cs index 641b21f..51d0694 100644 --- a/TechbloxModdingAPI/Blocks/BlockMaterial.cs +++ b/TechbloxModdingAPI/Blocks/BlockMaterial.cs @@ -33,13 +33,14 @@ namespace TechbloxModdingAPI.Blocks WoodRoughGrungy, Boundary, Emissive, - AircraftPaneling_Riveted_Painted, - AircraftPaneling_Riveted_Metallic, - Steel_Bodywork_Pearlescent, - Steel_Bodywork_RadWrap, - Steel_Bodywork_Glitter, + AircraftPanelingRivetedPainted, + AircraftPanelingRivetedMetallic, + SteelBodyworkPearlescent, + SteelBodyworkRadWrap, + SteelBodyworkGlitter, BouncyRubber, - BouncyRubber_TieDye, - FuturisticPaneling_Riveted_Painted = 40 + BouncyRubberTieDye, + BrickPainted, + FuturisticPanelingRivetedPainted, } } \ No newline at end of file diff --git a/TechbloxModdingAPI/Blocks/BlockTests.cs b/TechbloxModdingAPI/Blocks/BlockTests.cs index d1fc146..1e39945 100644 --- a/TechbloxModdingAPI/Blocks/BlockTests.cs +++ b/TechbloxModdingAPI/Blocks/BlockTests.cs @@ -80,7 +80,6 @@ namespace TechbloxModdingAPI.Blocks yield break; for (var index = 0; index < blocks.Length; index++) { - if (index % 10 == 0) yield return new WaitForSecondsEnumerator(1f).Continue(); //The material or flipped status can only be changed 130 times per submission var block = blocks[index]; if (!block.Exists) continue; foreach (var property in block.GetType().GetProperties()) diff --git a/TechbloxModdingAPI/Blocks/Engine.cs b/TechbloxModdingAPI/Blocks/Engine.cs index a0ab875..6140b11 100644 --- a/TechbloxModdingAPI/Blocks/Engine.cs +++ b/TechbloxModdingAPI/Blocks/Engine.cs @@ -30,11 +30,11 @@ namespace TechbloxModdingAPI.Blocks { get { - return ((bool)(BlockEngine.GetBlockInfo(this, HarmonyLib.AccessTools.TypeByName("Techblox.EngineBlock.EngineBlockComponent"), "engineOn"))); + return BlockEngine.GetBlockInfo(this).engineOn; } set { - BlockEngine.SetBlockInfo(this, HarmonyLib.AccessTools.TypeByName("Techblox.EngineBlock.EngineBlockComponent"), "engineOn", value); + BlockEngine.GetBlockInfo(this).engineOn = value; } } @@ -45,11 +45,11 @@ namespace TechbloxModdingAPI.Blocks { get { - return ((int)(BlockEngine.GetBlockInfo(this, HarmonyLib.AccessTools.TypeByName("Techblox.EngineBlock.EngineBlockComponent"), "currentGear"))); + return BlockEngine.GetBlockInfo(this).currentGear; } set { - BlockEngine.SetBlockInfo(this, HarmonyLib.AccessTools.TypeByName("Techblox.EngineBlock.EngineBlockComponent"), "currentGear", value); + BlockEngine.GetBlockInfo(this).currentGear = value; } } @@ -60,11 +60,11 @@ namespace TechbloxModdingAPI.Blocks { get { - return ((float)(BlockEngine.GetBlockInfo(this, HarmonyLib.AccessTools.TypeByName("Techblox.EngineBlock.EngineBlockComponent"), "gearChangeCountdown"))); + return BlockEngine.GetBlockInfo(this).gearChangeCountdown; } set { - BlockEngine.SetBlockInfo(this, HarmonyLib.AccessTools.TypeByName("Techblox.EngineBlock.EngineBlockComponent"), "gearChangeCountdown", value); + BlockEngine.GetBlockInfo(this).gearChangeCountdown = value; } } @@ -75,11 +75,11 @@ namespace TechbloxModdingAPI.Blocks { get { - return ((float)(BlockEngine.GetBlockInfo(this, HarmonyLib.AccessTools.TypeByName("Techblox.EngineBlock.EngineBlockComponent"), "currentRpmAV"))); + return BlockEngine.GetBlockInfo(this).currentRpmAV; } set { - BlockEngine.SetBlockInfo(this, HarmonyLib.AccessTools.TypeByName("Techblox.EngineBlock.EngineBlockComponent"), "currentRpmAV", value); + BlockEngine.GetBlockInfo(this).currentRpmAV = value; } } @@ -90,11 +90,11 @@ namespace TechbloxModdingAPI.Blocks { get { - return ((float)(BlockEngine.GetBlockInfo(this, HarmonyLib.AccessTools.TypeByName("Techblox.EngineBlock.EngineBlockComponent"), "currentRpmLV"))); + return BlockEngine.GetBlockInfo(this).currentRpmLV; } set { - BlockEngine.SetBlockInfo(this, HarmonyLib.AccessTools.TypeByName("Techblox.EngineBlock.EngineBlockComponent"), "currentRpmLV", value); + BlockEngine.GetBlockInfo(this).currentRpmLV = value; } } @@ -105,11 +105,11 @@ namespace TechbloxModdingAPI.Blocks { get { - return ((float)(BlockEngine.GetBlockInfo(this, HarmonyLib.AccessTools.TypeByName("Techblox.EngineBlock.EngineBlockComponent"), "targetRpmAV"))); + return BlockEngine.GetBlockInfo(this).targetRpmAV; } set { - BlockEngine.SetBlockInfo(this, HarmonyLib.AccessTools.TypeByName("Techblox.EngineBlock.EngineBlockComponent"), "targetRpmAV", value); + BlockEngine.GetBlockInfo(this).targetRpmAV = value; } } @@ -120,11 +120,11 @@ namespace TechbloxModdingAPI.Blocks { get { - return ((float)(BlockEngine.GetBlockInfo(this, HarmonyLib.AccessTools.TypeByName("Techblox.EngineBlock.EngineBlockComponent"), "targetRpmLV"))); + return BlockEngine.GetBlockInfo(this).targetRpmLV; } set { - BlockEngine.SetBlockInfo(this, HarmonyLib.AccessTools.TypeByName("Techblox.EngineBlock.EngineBlockComponent"), "targetRpmLV", value); + BlockEngine.GetBlockInfo(this).targetRpmLV = value; } } @@ -135,11 +135,11 @@ namespace TechbloxModdingAPI.Blocks { get { - return ((float)(BlockEngine.GetBlockInfo(this, HarmonyLib.AccessTools.TypeByName("Techblox.EngineBlock.EngineBlockComponent"), "currentTorque"))); + return BlockEngine.GetBlockInfo(this).currentTorque; } set { - BlockEngine.SetBlockInfo(this, HarmonyLib.AccessTools.TypeByName("Techblox.EngineBlock.EngineBlockComponent"), "currentTorque", value); + BlockEngine.GetBlockInfo(this).currentTorque = value; } } @@ -150,11 +150,11 @@ namespace TechbloxModdingAPI.Blocks { get { - return ((float)(BlockEngine.GetBlockInfo(this, HarmonyLib.AccessTools.TypeByName("Techblox.EngineBlock.EngineBlockComponent"), "totalWheelVelocityAV"))); + return BlockEngine.GetBlockInfo(this).totalWheelVelocityAV; } set { - BlockEngine.SetBlockInfo(this, HarmonyLib.AccessTools.TypeByName("Techblox.EngineBlock.EngineBlockComponent"), "totalWheelVelocityAV", value); + BlockEngine.GetBlockInfo(this).totalWheelVelocityAV = value; } } @@ -165,11 +165,11 @@ namespace TechbloxModdingAPI.Blocks { get { - return ((float)(BlockEngine.GetBlockInfo(this, HarmonyLib.AccessTools.TypeByName("Techblox.EngineBlock.EngineBlockComponent"), "totalWheelVelocityLV"))); + return BlockEngine.GetBlockInfo(this).totalWheelVelocityLV; } set { - BlockEngine.SetBlockInfo(this, HarmonyLib.AccessTools.TypeByName("Techblox.EngineBlock.EngineBlockComponent"), "totalWheelVelocityLV", value); + BlockEngine.GetBlockInfo(this).totalWheelVelocityLV = value; } } @@ -180,11 +180,11 @@ namespace TechbloxModdingAPI.Blocks { get { - return ((int)(BlockEngine.GetBlockInfo(this, HarmonyLib.AccessTools.TypeByName("Techblox.EngineBlock.EngineBlockComponent"), "totalWheelCount"))); + return BlockEngine.GetBlockInfo(this).totalWheelCount; } set { - BlockEngine.SetBlockInfo(this, HarmonyLib.AccessTools.TypeByName("Techblox.EngineBlock.EngineBlockComponent"), "totalWheelCount", value); + BlockEngine.GetBlockInfo(this).totalWheelCount = value; } } @@ -195,11 +195,11 @@ namespace TechbloxModdingAPI.Blocks { get { - return ((bool)(BlockEngine.GetBlockInfo(this, HarmonyLib.AccessTools.TypeByName("Techblox.EngineBlock.EngineBlockComponent"), "lastGearUpInput"))); + return BlockEngine.GetBlockInfo(this).lastGearUpInput; } set { - BlockEngine.SetBlockInfo(this, HarmonyLib.AccessTools.TypeByName("Techblox.EngineBlock.EngineBlockComponent"), "lastGearUpInput", value); + BlockEngine.GetBlockInfo(this).lastGearUpInput = value; } } @@ -210,11 +210,11 @@ namespace TechbloxModdingAPI.Blocks { get { - return ((bool)(BlockEngine.GetBlockInfo(this, HarmonyLib.AccessTools.TypeByName("Techblox.EngineBlock.EngineBlockComponent"), "lastGearDownInput"))); + return BlockEngine.GetBlockInfo(this).lastGearDownInput; } set { - BlockEngine.SetBlockInfo(this, HarmonyLib.AccessTools.TypeByName("Techblox.EngineBlock.EngineBlockComponent"), "lastGearDownInput", value); + BlockEngine.GetBlockInfo(this).lastGearDownInput = value; } } @@ -225,11 +225,11 @@ namespace TechbloxModdingAPI.Blocks { get { - return ((float)(BlockEngine.GetBlockInfo(this, HarmonyLib.AccessTools.TypeByName("Techblox.EngineBlock.EngineBlockComponent"), "manualToAutoGearCoolOffCounter"))); + return BlockEngine.GetBlockInfo(this).manualToAutoGearCoolOffCounter; } set { - BlockEngine.SetBlockInfo(this, HarmonyLib.AccessTools.TypeByName("Techblox.EngineBlock.EngineBlockComponent"), "manualToAutoGearCoolOffCounter", value); + BlockEngine.GetBlockInfo(this).manualToAutoGearCoolOffCounter = value; } } @@ -240,11 +240,11 @@ namespace TechbloxModdingAPI.Blocks { get { - return ((float)(BlockEngine.GetBlockInfo(this, HarmonyLib.AccessTools.TypeByName("Techblox.EngineBlock.EngineBlockComponent"), "load"))); + return BlockEngine.GetBlockInfo(this).load; } set { - BlockEngine.SetBlockInfo(this, HarmonyLib.AccessTools.TypeByName("Techblox.EngineBlock.EngineBlockComponent"), "load", value); + BlockEngine.GetBlockInfo(this).load = value; } } diff --git a/TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs b/TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs index e3d7695..824071f 100644 --- a/TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs @@ -21,6 +21,7 @@ using Unity.Mathematics; using TechbloxModdingAPI.Engines; using TechbloxModdingAPI.Utility; +using PrefabsID = RobocraftX.Common.PrefabsID; namespace TechbloxModdingAPI.Blocks.Engines { @@ -124,7 +125,7 @@ namespace TechbloxModdingAPI.Blocks.Engines var skew = entitiesDB.QueryEntity(id); entitiesDB.QueryEntity(id).matrix = math.mul(float4x4.TRS(pos.position, rot.rotation, scale.scale), skew.skewMatrix); - entitiesDB.PublishEntityChangeDelayed(id); // Signal a prefab change so it updates the render buffers + entitiesDB.PublishEntityChangeDelayed(id, 30); // Signal a prefab change so it updates the render buffers } internal void UpdatePrefab(Block block, byte material, bool flipped) @@ -145,8 +146,8 @@ namespace TechbloxModdingAPI.Blocks.Engines entitiesDB.QueryEntityOrDefault(block).prefabID = prefabId; if (block.Exists) { - entitiesDB.PublishEntityChangeDelayed(block.Id); - entitiesDB.PublishEntityChangeDelayed(block.Id); + entitiesDB.PublishEntityChangeDelayed(block.Id, 30); + entitiesDB.PublishEntityChangeDelayed(block.Id, 30); ref BuildingActionComponent local = ref entitiesDB.QueryEntity(BuildingDroneUtility @@ -160,7 +161,7 @@ namespace TechbloxModdingAPI.Blocks.Engines public void UpdateBlockColor(EGID id) { - entitiesDB.PublishEntityChange(id); + entitiesDB.PublishEntityChangeDelayed(id, 30); } public bool BlockExists(EGID blockID) diff --git a/TechbloxModdingAPI/Player.cs b/TechbloxModdingAPI/Player.cs index 857c477..24799f3 100644 --- a/TechbloxModdingAPI/Player.cs +++ b/TechbloxModdingAPI/Player.cs @@ -365,6 +365,9 @@ namespace TechbloxModdingAPI var group when group == CharacterExclusiveGroups.MachineSpawningGroup => PlayerState.HoldingMachine, var group when group == CharacterExclusiveGroups.OnFootGroup => PlayerState.OnFoot, var group when group == CharacterExclusiveGroups.InPilotSeatGroup => PlayerState.InSeat, + var group when group == CharacterExclusiveGroups.DyingOnFootGroup => PlayerState.OnFoot, + var group when group == CharacterExclusiveGroups.DyingInPilotSeatGroup => PlayerState.InSeat, + var group when group == CharacterExclusiveGroups.DeadGroup => PlayerState.OnFoot, _ => throw new ArgumentOutOfRangeException("", "Unknown player state") }; diff --git a/TechbloxModdingAPI/Utility/NativeApiExtensions.cs b/TechbloxModdingAPI/Utility/NativeApiExtensions.cs index c20a4b2..34f15f0 100644 --- a/TechbloxModdingAPI/Utility/NativeApiExtensions.cs +++ b/TechbloxModdingAPI/Utility/NativeApiExtensions.cs @@ -99,7 +99,7 @@ namespace TechbloxModdingAPI.Utility changes.Remove(id); ChangesToPublish[typeof(T)] = (count + 1, changes); yield return Yield.It; - ChangesToPublish[typeof(T)] = (0, changes); + ChangesToPublish[typeof(T)] = (Math.Max(ChangesToPublish[typeof(T)].PublishedCount - 1, 0), changes); } /// -- 2.30.2 From e0cd7f6aecc9e128090b5dd168655f523d25fe33 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Wed, 5 Oct 2022 01:53:54 +0200 Subject: [PATCH 249/252] Fix assembly editing and add more of it - It breaks the game atm, not sure why exactly but it's probably not a good thing --- CodeGenerator/CodeGenerator.csproj | 1 - CodeGenerator/MakeEverythingPublicInGame.cs | 36 - CodeGenerator/Program.cs | 5 +- .../MakeEverythingPublicInGame.csproj | 1574 +++++++++++++++++ MakeEverythingPublicInGame/Program.cs | 25 + TechbloxModdingAPI.sln | 8 + .../Utility/NativeApiExtensions.cs | 28 +- TechbloxModdingAPI/Utility/OptionalRef.cs | 2 + TechbloxModdingAPI/Utility/RefCollection.cs | 2 + 9 files changed, 1641 insertions(+), 40 deletions(-) delete mode 100644 CodeGenerator/MakeEverythingPublicInGame.cs create mode 100644 MakeEverythingPublicInGame/MakeEverythingPublicInGame.csproj create mode 100644 MakeEverythingPublicInGame/Program.cs diff --git a/CodeGenerator/CodeGenerator.csproj b/CodeGenerator/CodeGenerator.csproj index 41e2dc5..c80dce9 100644 --- a/CodeGenerator/CodeGenerator.csproj +++ b/CodeGenerator/CodeGenerator.csproj @@ -20,7 +20,6 @@ - diff --git a/CodeGenerator/MakeEverythingPublicInGame.cs b/CodeGenerator/MakeEverythingPublicInGame.cs deleted file mode 100644 index 9e8d47c..0000000 --- a/CodeGenerator/MakeEverythingPublicInGame.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using System.IO; -using System.Reflection.Metadata; -using System.Text.RegularExpressions; -using Mono.Cecil; -using ModuleDefinition = Mono.Cecil.ModuleDefinition; - -namespace CodeGenerator -{ - public class MakeEverythingPublicInGame - { - public void Start() - { - Console.WriteLine("Starting assembly editing..."); - var fileRegex = - new Regex(".*(Techblox|Gamecraft|RobocraftX|FullGame|RobocraftECS|DataLoader|RCX|GameState)[^/]*(\\.dll)"); - foreach (var file in Directory.EnumerateFiles(@"../../../../../ref/Techblox_Data/Managed")) - { - if (!fileRegex.IsMatch(file)) continue; - Console.WriteLine(file); - ProcessAssembly(file); - } - } - - public void ProcessAssembly(string path) - { - var mod = ModuleDefinition.ReadModule(path, new(ReadingMode.Immediate) { ReadWrite = true }); - foreach (var typeDefinition in mod.Types) - { - typeDefinition.Attributes |= TypeAttributes.Public; - } - - mod.Write(); - } - } -} \ No newline at end of file diff --git a/CodeGenerator/Program.cs b/CodeGenerator/Program.cs index fd3e0a5..8d870e3 100644 --- a/CodeGenerator/Program.cs +++ b/CodeGenerator/Program.cs @@ -1,7 +1,10 @@ using System.Collections.Generic; using HarmonyLib; using RobocraftX.Blocks; +using RobocraftX.Common; +using RobocraftX.GroupTags; using RobocraftX.PilotSeat; +using Svelto.ECS; using Techblox.EngineBlock; using Techblox.ServoBlocksServer; using Techblox.WheelRigBlock; @@ -13,8 +16,6 @@ namespace CodeGenerator public static void Main(string[] args) { GenerateBlockClasses(); - var mepig = new MakeEverythingPublicInGame(); - mepig.Start(); } private static void GenerateBlockClasses() diff --git a/MakeEverythingPublicInGame/MakeEverythingPublicInGame.csproj b/MakeEverythingPublicInGame/MakeEverythingPublicInGame.csproj new file mode 100644 index 0000000..536fb28 --- /dev/null +++ b/MakeEverythingPublicInGame/MakeEverythingPublicInGame.csproj @@ -0,0 +1,1574 @@ + + + + Exe + net6.0 + enable + enable + + + + + + + + + + ..\ref\Techblox_Data\Managed\IllusionInjector.dll + ..\..\ref\Techblox_Data\Managed\IllusionInjector.dll + + + ..\ref\Techblox_Data\Managed\IllusionPlugin.dll + ..\..\ref\Techblox_Data\Managed\IllusionPlugin.dll + + + ..\ref\Techblox_Data\Managed\Accessibility.dll + ..\..\ref\Techblox_Data\Managed\Accessibility.dll + + + ..\ref\Techblox_Data\Managed\Analytics.dll + ..\..\ref\Techblox_Data\Managed\Analytics.dll + + + ..\ref\Techblox_Data\Managed\Assembly-CSharp-firstpass.dll + ..\..\ref\Techblox_Data\Managed\Assembly-CSharp-firstpass.dll + + + ..\ref\Techblox_Data\Managed\Assembly-CSharp.dll + ..\..\ref\Techblox_Data\Managed\Assembly-CSharp.dll + + + ..\ref\Techblox_Data\Managed\AWSSDK.Core.dll + ..\..\ref\Techblox_Data\Managed\AWSSDK.Core.dll + + + ..\ref\Techblox_Data\Managed\AWSSDK.GameLift.dll + ..\..\ref\Techblox_Data\Managed\AWSSDK.GameLift.dll + + + ..\ref\Techblox_Data\Managed\BevelEffect.dll + ..\..\ref\Techblox_Data\Managed\BevelEffect.dll + + + ..\ref\Techblox_Data\Managed\Boxophobic.TheVehetationEngine.Runtime.dll + ..\..\ref\Techblox_Data\Managed\Boxophobic.TheVehetationEngine.Runtime.dll + + + ..\ref\Techblox_Data\Managed\Boxophobic.Utils.Scripts.dll + ..\..\ref\Techblox_Data\Managed\Boxophobic.Utils.Scripts.dll + + + ..\ref\Techblox_Data\Managed\DataLoader.dll + ..\..\ref\Techblox_Data\Managed\DataLoader.dll + + + ..\ref\Techblox_Data\Managed\DDNA.dll + ..\..\ref\Techblox_Data\Managed\DDNA.dll + + + ..\ref\Techblox_Data\Managed\EasyButtons.dll + ..\..\ref\Techblox_Data\Managed\EasyButtons.dll + + + ..\ref\Techblox_Data\Managed\EOSSDK.dll + ..\..\ref\Techblox_Data\Managed\EOSSDK.dll + + + ..\ref\Techblox_Data\Managed\FMODUnity.dll + ..\..\ref\Techblox_Data\Managed\FMODUnity.dll + + + ..\ref\Techblox_Data\Managed\FMODUnityResonance.dll + ..\..\ref\Techblox_Data\Managed\FMODUnityResonance.dll + + + ..\ref\Techblox_Data\Managed\FMODUnityWrapperClient.dll + ..\..\ref\Techblox_Data\Managed\FMODUnityWrapperClient.dll + + + ..\ref\Techblox_Data\Managed\FullGame.dll + ..\..\ref\Techblox_Data\Managed\FullGame.dll + + + ..\ref\Techblox_Data\Managed\Gamecraft.BlockEntityFactory.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.BlockEntityFactory.dll + + + ..\ref\Techblox_Data\Managed\Gamecraft.BlockGroups.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.BlockGroups.dll + + + ..\ref\Techblox_Data\Managed\Gamecraft.Blocks.LogicBlock.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.Blocks.LogicBlock.dll + + + ..\ref\Techblox_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll + + + ..\ref\Techblox_Data\Managed\Gamecraft.ColourPalette.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.ColourPalette.dll + + + ..\ref\Techblox_Data\Managed\Gamecraft.Damage.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.Damage.dll + + + ..\ref\Techblox_Data\Managed\Gamecraft.Effects.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.Effects.dll + + + ..\ref\Techblox_Data\Managed\Gamecraft.ExplosionFragments.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.ExplosionFragments.dll + + + ..\ref\Techblox_Data\Managed\Gamecraft.GraphicsSettings.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GraphicsSettings.dll + + + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.BlueprintInventory.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.BlueprintInventory.dll + + + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.Blueprints.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.Blueprints.dll + + + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.BlueprintSets.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.BlueprintSets.dll + + + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.GameOptionsScreen.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.GameOptionsScreen.dll + + + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll + + + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.Blocks.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.Blocks.dll + + + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.BlueprintsHotbar.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.BlueprintsHotbar.dll + + + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.Colours.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.Colours.dll + + + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.ModeBar.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.ModeBar.dll + + + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.OptionsScreen.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.OptionsScreen.dll + + + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Blocks.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Blocks.dll + + + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Blueprints.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Blueprints.dll + + + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Colours.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Colours.dll + + + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Common.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Common.dll + + + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.Tweaks.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.Tweaks.dll + + + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.Wires.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.Wires.dll + + + ..\ref\Techblox_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll + + + ..\ref\Techblox_Data\Managed\Gamecraft.JointBlocks.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.JointBlocks.dll + + + ..\ref\Techblox_Data\Managed\Gamecraft.Music.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.Music.dll + + + ..\ref\Techblox_Data\Managed\Gamecraft.NetStrings.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.NetStrings.dll + + + ..\ref\Techblox_Data\Managed\Gamecraft.PickupsCommon.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.PickupsCommon.dll + + + ..\ref\Techblox_Data\Managed\Gamecraft.PopupMessage.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.PopupMessage.dll + + + ..\ref\Techblox_Data\Managed\Gamecraft.Serialization.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.Serialization.dll + + + ..\ref\Techblox_Data\Managed\Gamecraft.Tweaks.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.Tweaks.dll + + + ..\ref\Techblox_Data\Managed\Gamecraft.VisualEffects.Decals.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.VisualEffects.Decals.dll + + + ..\ref\Techblox_Data\Managed\Gamecraft.Wires.dll + ..\..\ref\Techblox_Data\Managed\Gamecraft.Wires.dll + + + ..\ref\Techblox_Data\Managed\GameLiftServerSDKNet45.dll + ..\..\ref\Techblox_Data\Managed\GameLiftServerSDKNet45.dll + + + ..\ref\Techblox_Data\Managed\GameState.dll + ..\..\ref\Techblox_Data\Managed\GameState.dll + + + ..\ref\Techblox_Data\Managed\GhostShark.Outline.dll + ..\..\ref\Techblox_Data\Managed\GhostShark.Outline.dll + + + ..\ref\Techblox_Data\Managed\Google.Protobuf.dll + ..\..\ref\Techblox_Data\Managed\Google.Protobuf.dll + + + ..\ref\Techblox_Data\Managed\GPUInstancer.CrowdAnimations.dll + ..\..\ref\Techblox_Data\Managed\GPUInstancer.CrowdAnimations.dll + + + ..\ref\Techblox_Data\Managed\GPUInstancer.dll + ..\..\ref\Techblox_Data\Managed\GPUInstancer.dll + + + ..\ref\Techblox_Data\Managed\Havok.Physics.dll + ..\..\ref\Techblox_Data\Managed\Havok.Physics.dll + + + ..\ref\Techblox_Data\Managed\Havok.Physics.Hybrid.dll + ..\..\ref\Techblox_Data\Managed\Havok.Physics.Hybrid.dll + + + ..\ref\Techblox_Data\Managed\LiteNetLib.dll + ..\..\ref\Techblox_Data\Managed\LiteNetLib.dll + + + ..\ref\Techblox_Data\Managed\log4net.dll + ..\..\ref\Techblox_Data\Managed\log4net.dll + + + ..\ref\Techblox_Data\Managed\LZ4.dll + ..\..\ref\Techblox_Data\Managed\LZ4.dll + + + ..\ref\Techblox_Data\Managed\Monobehaviours.dll + ..\..\ref\Techblox_Data\Managed\Monobehaviours.dll + + + ..\ref\Techblox_Data\Managed\mscorlib.dll + ..\..\ref\Techblox_Data\Managed\mscorlib.dll + + + ..\ref\Techblox_Data\Managed\MultiplayerNetworking.dll + ..\..\ref\Techblox_Data\Managed\MultiplayerNetworking.dll + + + ..\ref\Techblox_Data\Managed\Newtonsoft.Json.dll + ..\..\ref\Techblox_Data\Managed\Newtonsoft.Json.dll + + + ..\ref\Techblox_Data\Managed\Novell.Directory.Ldap.dll + ..\..\ref\Techblox_Data\Managed\Novell.Directory.Ldap.dll + + + ..\ref\Techblox_Data\Managed\Prometheus.NetStandard.dll + ..\..\ref\Techblox_Data\Managed\Prometheus.NetStandard.dll + + + ..\ref\Techblox_Data\Managed\RCX.ScreenshotTaker.dll + ..\..\ref\Techblox_Data\Managed\RCX.ScreenshotTaker.dll + + + ..\ref\Techblox_Data\Managed\Rewired_Core.dll + ..\..\ref\Techblox_Data\Managed\Rewired_Core.dll + + + ..\ref\Techblox_Data\Managed\Rewired_Windows.dll + ..\..\ref\Techblox_Data\Managed\Rewired_Windows.dll + + + ..\ref\Techblox_Data\Managed\RichFX.dll + ..\..\ref\Techblox_Data\Managed\RichFX.dll + + + ..\ref\Techblox_Data\Managed\RobocraftECS.dll + ..\..\ref\Techblox_Data\Managed\RobocraftECS.dll + + + ..\ref\Techblox_Data\Managed\RobocraftX.AccountPreferences.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.AccountPreferences.dll + + + ..\ref\Techblox_Data\Managed\RobocraftX.Blocks.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.Blocks.dll + + + ..\ref\Techblox_Data\Managed\RobocraftX.Blocks.Ghost.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.Blocks.Ghost.dll + + + ..\ref\Techblox_Data\Managed\RobocraftX.Blocks.Triggers.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.Blocks.Triggers.dll + + + ..\ref\Techblox_Data\Managed\RobocraftX.Building.BoxSelect.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.Building.BoxSelect.dll + + + ..\ref\Techblox_Data\Managed\RobocraftX.Building.Jobs.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.Building.Jobs.dll + + + ..\ref\Techblox_Data\Managed\RobocraftX.Character.Audio.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.Character.Audio.dll + + + ..\ref\Techblox_Data\Managed\RobocraftX.Character.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.Character.dll + + + ..\ref\Techblox_Data\Managed\RobocraftX.Common.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.Common.dll + + + ..\ref\Techblox_Data\Managed\RobocraftX.ControlsScreen.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.ControlsScreen.dll + + + ..\ref\Techblox_Data\Managed\RobocraftX.Crosshair.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.Crosshair.dll + + + ..\ref\Techblox_Data\Managed\RobocraftX.FrontEnd.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.FrontEnd.dll + + + ..\ref\Techblox_Data\Managed\RobocraftX.GUI.DebugDisplay.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.DebugDisplay.dll + + + ..\ref\Techblox_Data\Managed\RobocraftX.GUI.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.dll + + + ..\ref\Techblox_Data\Managed\RobocraftX.GUI.Hotbar.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.Hotbar.dll + + + ..\ref\Techblox_Data\Managed\RobocraftX.GUI.Inventory.BlocksInventory.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.Inventory.BlocksInventory.dll + + + ..\ref\Techblox_Data\Managed\RobocraftX.GUI.Inventory.ColourInventory.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.Inventory.ColourInventory.dll + + + ..\ref\Techblox_Data\Managed\RobocraftX.GUI.Inventory.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.Inventory.dll + + + ..\ref\Techblox_Data\Managed\RobocraftX.GUI.QuitConfirmation.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.QuitConfirmation.dll + + + ..\ref\Techblox_Data\Managed\RobocraftX.GUI.ScaleGhost.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.ScaleGhost.dll + + + ..\ref\Techblox_Data\Managed\RobocraftX.GUI.TabsBar.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.TabsBar.dll + + + ..\ref\Techblox_Data\Managed\RobocraftX.Input.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.Input.dll + + + ..\ref\Techblox_Data\Managed\RobocraftX.MachineEditor.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.MachineEditor.dll + + + ..\ref\Techblox_Data\Managed\RobocraftX.MainGame.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.MainGame.dll + + + ..\ref\Techblox_Data\Managed\RobocraftX.MainSimulation.Audio.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.MainSimulation.Audio.dll + + + ..\ref\Techblox_Data\Managed\RobocraftX.MainSimulation.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.MainSimulation.dll + + + ..\ref\Techblox_Data\Managed\RobocraftX.Multiplayer.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.Multiplayer.dll + + + ..\ref\Techblox_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll + + + ..\ref\Techblox_Data\Managed\RobocraftX.Multiplayer.Serializers.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.Multiplayer.Serializers.dll + + + ..\ref\Techblox_Data\Managed\RobocraftX.MultiplayerInput.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.MultiplayerInput.dll + + + ..\ref\Techblox_Data\Managed\RobocraftX.ObjectIdBlocks.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.ObjectIdBlocks.dll + + + ..\ref\Techblox_Data\Managed\RobocraftX.Physics.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.Physics.dll + + + ..\ref\Techblox_Data\Managed\RobocraftX.PilotSeat.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.PilotSeat.dll + + + ..\ref\Techblox_Data\Managed\RobocraftX.Player.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.Player.dll + + + ..\ref\Techblox_Data\Managed\RobocraftX.SaveAndLoad.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.SaveAndLoad.dll + + + ..\ref\Techblox_Data\Managed\RobocraftX.SaveGameDialog.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.SaveGameDialog.dll + + + ..\ref\Techblox_Data\Managed\RobocraftX.Services.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.Services.dll + + + ..\ref\Techblox_Data\Managed\RobocraftX.SignalHandling.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.SignalHandling.dll + + + ..\ref\Techblox_Data\Managed\RobocraftX.StateSync.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.StateSync.dll + + + ..\ref\Techblox_Data\Managed\Serilog.dll + ..\..\ref\Techblox_Data\Managed\Serilog.dll + + + ..\ref\Techblox_Data\Managed\Serilog.Sinks.Grafana.Loki.dll + ..\..\ref\Techblox_Data\Managed\Serilog.Sinks.Grafana.Loki.dll + + + ..\ref\Techblox_Data\Managed\ShaderVariantsGenerationTool.dll + ..\..\ref\Techblox_Data\Managed\ShaderVariantsGenerationTool.dll + + + ..\ref\Techblox_Data\Managed\SpecializedDescriptors.dll + ..\..\ref\Techblox_Data\Managed\SpecializedDescriptors.dll + + + ..\ref\Techblox_Data\Managed\StringFormatter.dll + ..\..\ref\Techblox_Data\Managed\StringFormatter.dll + + + ..\ref\Techblox_Data\Managed\Svelto.Common.dll + ..\..\ref\Techblox_Data\Managed\Svelto.Common.dll + + + ..\ref\Techblox_Data\Managed\Svelto.ECS.dll + ..\..\ref\Techblox_Data\Managed\Svelto.ECS.dll + + + ..\ref\Techblox_Data\Managed\Svelto.ECS.GUI.dll + ..\..\ref\Techblox_Data\Managed\Svelto.ECS.GUI.dll + + + ..\ref\Techblox_Data\Managed\Svelto.Services.dll + ..\..\ref\Techblox_Data\Managed\Svelto.Services.dll + + + ..\ref\Techblox_Data\Managed\Svelto.Tasks.dll + ..\..\ref\Techblox_Data\Managed\Svelto.Tasks.dll + + + ..\ref\Techblox_Data\Managed\Techblox.AdditionalParts.dll + ..\..\ref\Techblox_Data\Managed\Techblox.AdditionalParts.dll + + + ..\ref\Techblox_Data\Managed\Techblox.AntiAFKServer.dll + ..\..\ref\Techblox_Data\Managed\Techblox.AntiAFKServer.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Anticheat.Client.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Anticheat.Client.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Anticheat.Common.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Anticheat.Common.dll + + + ..\ref\Techblox_Data\Managed\Techblox.AtmosphereBlock.dll + ..\..\ref\Techblox_Data\Managed\Techblox.AtmosphereBlock.dll + + + ..\ref\Techblox_Data\Managed\Techblox.AudioBlocks.dll + ..\..\ref\Techblox_Data\Managed\Techblox.AudioBlocks.dll + + + ..\ref\Techblox_Data\Managed\Techblox.AudioBlocksClient.dll + ..\..\ref\Techblox_Data\Managed\Techblox.AudioBlocksClient.dll + + + ..\ref\Techblox_Data\Managed\Techblox.AutoForward.dll + ..\..\ref\Techblox_Data\Managed\Techblox.AutoForward.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Backend.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Backend.dll + + + ..\ref\Techblox_Data\Managed\Techblox.BitBlock.dll + ..\..\ref\Techblox_Data\Managed\Techblox.BitBlock.dll + + + ..\ref\Techblox_Data\Managed\Techblox.BlockColours.dll + ..\..\ref\Techblox_Data\Managed\Techblox.BlockColours.dll + + + ..\ref\Techblox_Data\Managed\Techblox.BlockLabels.dll + ..\..\ref\Techblox_Data\Managed\Techblox.BlockLabels.dll + + + ..\ref\Techblox_Data\Managed\Techblox.BlockLabelsServer.dll + ..\..\ref\Techblox_Data\Managed\Techblox.BlockLabelsServer.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Blocks.Connections.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Blocks.Connections.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Blocks.LightBlock.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Blocks.LightBlock.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Building.Rules.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Building.Rules.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Building.Shift.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Building.Shift.dll + + + ..\ref\Techblox_Data\Managed\Techblox.BuildingDrone.dll + ..\..\ref\Techblox_Data\Managed\Techblox.BuildingDrone.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Camera.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Camera.dll + + + ..\ref\Techblox_Data\Managed\Techblox.CentreHUDBlock.dll + ..\..\ref\Techblox_Data\Managed\Techblox.CentreHUDBlock.dll + + + ..\ref\Techblox_Data\Managed\Techblox.CentreHUDGUI.dll + ..\..\ref\Techblox_Data\Managed\Techblox.CentreHUDGUI.dll + + + ..\ref\Techblox_Data\Managed\Techblox.CharacterDamage.Client.dll + ..\..\ref\Techblox_Data\Managed\Techblox.CharacterDamage.Client.dll + + + ..\ref\Techblox_Data\Managed\Techblox.CharacterDamage.Server.dll + ..\..\ref\Techblox_Data\Managed\Techblox.CharacterDamage.Server.dll + + + ..\ref\Techblox_Data\Managed\Techblox.CharacterRespawnScreen.dll + ..\..\ref\Techblox_Data\Managed\Techblox.CharacterRespawnScreen.dll + + + ..\ref\Techblox_Data\Managed\Techblox.CheckpointBlock.dll + ..\..\ref\Techblox_Data\Managed\Techblox.CheckpointBlock.dll + + + ..\ref\Techblox_Data\Managed\Techblox.CheckpointBlockClient.dll + ..\..\ref\Techblox_Data\Managed\Techblox.CheckpointBlockClient.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Common.Audio.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Common.Audio.dll + + + ..\ref\Techblox_Data\Managed\Techblox.ConstantBlockClient.dll + ..\..\ref\Techblox_Data\Managed\Techblox.ConstantBlockClient.dll + + + ..\ref\Techblox_Data\Managed\Techblox.ConstantBlockServer.dll + ..\..\ref\Techblox_Data\Managed\Techblox.ConstantBlockServer.dll + + + ..\ref\Techblox_Data\Managed\Techblox.ContextSensitiveTextHint.dll + ..\..\ref\Techblox_Data\Managed\Techblox.ContextSensitiveTextHint.dll + + + ..\ref\Techblox_Data\Managed\Techblox.CounterBlockClient.dll + ..\..\ref\Techblox_Data\Managed\Techblox.CounterBlockClient.dll + + + ..\ref\Techblox_Data\Managed\Techblox.CounterBlockServer.dll + ..\..\ref\Techblox_Data\Managed\Techblox.CounterBlockServer.dll + + + ..\ref\Techblox_Data\Managed\Techblox.DamageRbScoreBlockServerServer.dll + ..\..\ref\Techblox_Data\Managed\Techblox.DamageRbScoreBlockServerServer.dll + + + ..\ref\Techblox_Data\Managed\Techblox.DirectionalDamageVingette.dll + ..\..\ref\Techblox_Data\Managed\Techblox.DirectionalDamageVingette.dll + + + ..\ref\Techblox_Data\Managed\Techblox.DistanceSensorBlock.dll + ..\..\ref\Techblox_Data\Managed\Techblox.DistanceSensorBlock.dll + + + ..\ref\Techblox_Data\Managed\Techblox.ECSResourceManagers.dll + ..\..\ref\Techblox_Data\Managed\Techblox.ECSResourceManagers.dll + + + ..\ref\Techblox_Data\Managed\Techblox.EngineBlock.dll + ..\..\ref\Techblox_Data\Managed\Techblox.EngineBlock.dll + + + ..\ref\Techblox_Data\Managed\Techblox.EnvironmentBlocks.BuildingEnvironment.dll + ..\..\ref\Techblox_Data\Managed\Techblox.EnvironmentBlocks.BuildingEnvironment.dll + + + ..\ref\Techblox_Data\Managed\Techblox.EnvironmentBlocks.dll + ..\..\ref\Techblox_Data\Managed\Techblox.EnvironmentBlocks.dll + + + ..\ref\Techblox_Data\Managed\Techblox.EnvironmentBlocks.SimulationWorldEnvironment.dll + ..\..\ref\Techblox_Data\Managed\Techblox.EnvironmentBlocks.SimulationWorldEnvironment.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Gameplay.Client.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.Client.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Gameplay.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Gameplay.GameState.Client.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.GameState.Client.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Gameplay.GameState.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.GameState.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Gameplay.PlayerGameplayDetails.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.PlayerGameplayDetails.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Gameplay.Score.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.Score.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Gameplay.Spawning.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.Spawning.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Gameplay.Teams.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.Teams.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Gameplay.WorldResetting.Client.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.WorldResetting.Client.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Gameplay.WorldResetting.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.WorldResetting.dll + + + ..\ref\Techblox_Data\Managed\Techblox.GameSelection.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GameSelection.dll + + + ..\ref\Techblox_Data\Managed\Techblox.GUI.Building.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Building.dll + + + ..\ref\Techblox_Data\Managed\Techblox.GUI.BuildRules.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.BuildRules.dll + + + ..\ref\Techblox_Data\Managed\Techblox.GUI.CharacterHealthFeedback.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.CharacterHealthFeedback.dll + + + ..\ref\Techblox_Data\Managed\Techblox.GUI.Collection.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Collection.dll + + + ..\ref\Techblox_Data\Managed\Techblox.GUI.Controls.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Controls.dll + + + ..\ref\Techblox_Data\Managed\Techblox.GUI.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.dll + + + ..\ref\Techblox_Data\Managed\Techblox.GUI.GamePortal.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.GamePortal.dll + + + ..\ref\Techblox_Data\Managed\Techblox.GUI.GeneralSettingsScreen.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.GeneralSettingsScreen.dll + + + ..\ref\Techblox_Data\Managed\Techblox.GUI.Hotbar.Landscapes.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Hotbar.Landscapes.dll + + + ..\ref\Techblox_Data\Managed\Techblox.GUI.Hotbar.Materials.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Hotbar.Materials.dll + + + ..\ref\Techblox_Data\Managed\Techblox.GUI.Inventory.Common.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Inventory.Common.dll + + + ..\ref\Techblox_Data\Managed\Techblox.GUI.Inventory.Landscapes.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Inventory.Landscapes.dll + + + ..\ref\Techblox_Data\Managed\Techblox.GUI.Inventory.Materials.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Inventory.Materials.dll + + + ..\ref\Techblox_Data\Managed\Techblox.GUI.LoadingBar.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.LoadingBar.dll + + + ..\ref\Techblox_Data\Managed\Techblox.GUI.Login.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Login.dll + + + ..\ref\Techblox_Data\Managed\Techblox.GUI.MachineReconstructTimer.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.MachineReconstructTimer.dll + + + ..\ref\Techblox_Data\Managed\Techblox.GUI.MainGame.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.MainGame.dll + + + ..\ref\Techblox_Data\Managed\Techblox.GUI.MainGame.StateMachine.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.MainGame.StateMachine.dll + + + ..\ref\Techblox_Data\Managed\Techblox.GUI.MyGamesScreen.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.MyGamesScreen.dll + + + ..\ref\Techblox_Data\Managed\Techblox.GUI.PauseMenu.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.PauseMenu.dll + + + ..\ref\Techblox_Data\Managed\Techblox.GUI.Progression.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Progression.dll + + + ..\ref\Techblox_Data\Managed\Techblox.GUI.TabsBar.Landscapes.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.TabsBar.Landscapes.dll + + + ..\ref\Techblox_Data\Managed\Techblox.GUI.TabsBar.Materials.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.TabsBar.Materials.dll + + + ..\ref\Techblox_Data\Managed\Techblox.GUI.UsernameDisplay.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.UsernameDisplay.dll + + + ..\ref\Techblox_Data\Managed\Techblox.InputCapture.dll + ..\..\ref\Techblox_Data\Managed\Techblox.InputCapture.dll + + + ..\ref\Techblox_Data\Managed\Techblox.JetBlock.dll + ..\..\ref\Techblox_Data\Managed\Techblox.JetBlock.dll + + + ..\ref\Techblox_Data\Managed\Techblox.JetBlockClient.dll + ..\..\ref\Techblox_Data\Managed\Techblox.JetBlockClient.dll + + + ..\ref\Techblox_Data\Managed\Techblox.KillScoreBlock.dll + ..\..\ref\Techblox_Data\Managed\Techblox.KillScoreBlock.dll + + + ..\ref\Techblox_Data\Managed\Techblox.MachineProcessingService.dll + ..\..\ref\Techblox_Data\Managed\Techblox.MachineProcessingService.dll + + + ..\ref\Techblox_Data\Managed\Techblox.MachineSimulationPreprocessing.dll + ..\..\ref\Techblox_Data\Managed\Techblox.MachineSimulationPreprocessing.dll + + + ..\ref\Techblox_Data\Managed\Techblox.MachineSpawning.dll + ..\..\ref\Techblox_Data\Managed\Techblox.MachineSpawning.dll + + + ..\ref\Techblox_Data\Managed\Techblox.MachineVelocityCameraEffects.dll + ..\..\ref\Techblox_Data\Managed\Techblox.MachineVelocityCameraEffects.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Matchmaking.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Matchmaking.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Monitoring.Server.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Monitoring.Server.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Multiplayer.UsernameMessages.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Multiplayer.UsernameMessages.dll + + + ..\ref\Techblox_Data\Managed\Techblox.ObjectIDBlockClient.dll + ..\..\ref\Techblox_Data\Managed\Techblox.ObjectIDBlockClient.dll + + + ..\ref\Techblox_Data\Managed\Techblox.ObjectIDBlockServer.dll + ..\..\ref\Techblox_Data\Managed\Techblox.ObjectIDBlockServer.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Particles.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Particles.dll + + + ..\ref\Techblox_Data\Managed\Techblox.PlayUX.dll + ..\..\ref\Techblox_Data\Managed\Techblox.PlayUX.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Pointer.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Pointer.dll + + + ..\ref\Techblox_Data\Managed\Techblox.ProceduralReflectionProbes.dll + ..\..\ref\Techblox_Data\Managed\Techblox.ProceduralReflectionProbes.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Rendering.Common.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Rendering.Common.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Rendering.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Rendering.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Rendering.DOTS.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Rendering.DOTS.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Rendering.GPUI.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Rendering.GPUI.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Rendering.Unity.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Rendering.Unity.dll + + + ..\ref\Techblox_Data\Managed\Techblox.SaveGamesConversion.dll + ..\..\ref\Techblox_Data\Managed\Techblox.SaveGamesConversion.dll + + + ..\ref\Techblox_Data\Managed\Techblox.ScoreHUDBlock.dll + ..\..\ref\Techblox_Data\Managed\Techblox.ScoreHUDBlock.dll + + + ..\ref\Techblox_Data\Managed\Techblox.ScoreHUDGUI.dll + ..\..\ref\Techblox_Data\Managed\Techblox.ScoreHUDGUI.dll + + + ..\ref\Techblox_Data\Managed\Techblox.ScorePickupBlockClient.dll + ..\..\ref\Techblox_Data\Managed\Techblox.ScorePickupBlockClient.dll + + + ..\ref\Techblox_Data\Managed\Techblox.ScorePickupBlockServer.dll + ..\..\ref\Techblox_Data\Managed\Techblox.ScorePickupBlockServer.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Server.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Server.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Services.Anticheat.Client.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Services.Anticheat.Client.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Services.Eos.Common.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Services.Eos.Common.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Services.Eos.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Services.Eos.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Services.GameDetails.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Services.GameDetails.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Services.LocalPreferences.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Services.LocalPreferences.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Services.Matchmaking.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Services.Matchmaking.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Services.Metrics.Server.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Services.Metrics.Server.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Services.Progression.Client.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Services.Progression.Client.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Services.Progression.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Services.Progression.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Services.Storage.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Services.Storage.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Services.Users.Client.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Services.Users.Client.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Services.Users.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Services.Users.dll + + + ..\ref\Techblox_Data\Managed\Techblox.ServoBlocksClient.dll + ..\..\ref\Techblox_Data\Managed\Techblox.ServoBlocksClient.dll + + + ..\ref\Techblox_Data\Managed\Techblox.ServoBlocksServer.dll + ..\..\ref\Techblox_Data\Managed\Techblox.ServoBlocksServer.dll + + + ..\ref\Techblox_Data\Managed\Techblox.ServosServer.dll + ..\..\ref\Techblox_Data\Managed\Techblox.ServosServer.dll + + + ..\ref\Techblox_Data\Managed\Techblox.SignalHandling.Audio.dll + ..\..\ref\Techblox_Data\Managed\Techblox.SignalHandling.Audio.dll + + + ..\ref\Techblox_Data\Managed\Techblox.SignalHandling.Common.dll + ..\..\ref\Techblox_Data\Managed\Techblox.SignalHandling.Common.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Simulation.Clusters.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Simulation.Clusters.dll + + + ..\ref\Techblox_Data\Managed\Techblox.SpawnBlock.Client.dll + ..\..\ref\Techblox_Data\Managed\Techblox.SpawnBlock.Client.dll + + + ..\ref\Techblox_Data\Managed\Techblox.SpawnBlock.Server.dll + ..\..\ref\Techblox_Data\Managed\Techblox.SpawnBlock.Server.dll + + + ..\ref\Techblox_Data\Managed\Techblox.StabilizerBlock.dll + ..\..\ref\Techblox_Data\Managed\Techblox.StabilizerBlock.dll + + + ..\ref\Techblox_Data\Managed\Techblox.StabilizerBlockClient.dll + ..\..\ref\Techblox_Data\Managed\Techblox.StabilizerBlockClient.dll + + + ..\ref\Techblox_Data\Managed\Techblox.SwitchAnimation.dll + ..\..\ref\Techblox_Data\Managed\Techblox.SwitchAnimation.dll + + + ..\ref\Techblox_Data\Managed\Techblox.TeamScoreBlockClient.dll + ..\..\ref\Techblox_Data\Managed\Techblox.TeamScoreBlockClient.dll + + + ..\ref\Techblox_Data\Managed\Techblox.TeamScoreBlockServer.dll + ..\..\ref\Techblox_Data\Managed\Techblox.TeamScoreBlockServer.dll + + + ..\ref\Techblox_Data\Managed\Techblox.TechpointConverterBlock.dll + ..\..\ref\Techblox_Data\Managed\Techblox.TechpointConverterBlock.dll + + + ..\ref\Techblox_Data\Managed\Techblox.TechpointConverterGUI.TechPointPoolHUD.dll + ..\..\ref\Techblox_Data\Managed\Techblox.TechpointConverterGUI.TechPointPoolHUD.dll + + + ..\ref\Techblox_Data\Managed\Techblox.TechpointConverterGUI.TechpointRewardPanel.dll + ..\..\ref\Techblox_Data\Managed\Techblox.TechpointConverterGUI.TechpointRewardPanel.dll + + + ..\ref\Techblox_Data\Managed\Techblox.TextBlock.dll + ..\..\ref\Techblox_Data\Managed\Techblox.TextBlock.dll + + + ..\ref\Techblox_Data\Managed\Techblox.TimerBlock.dll + ..\..\ref\Techblox_Data\Managed\Techblox.TimerBlock.dll + + + ..\ref\Techblox_Data\Managed\Techblox.TriggerBlock.dll + ..\..\ref\Techblox_Data\Managed\Techblox.TriggerBlock.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Tweaks.Validation.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Tweaks.Validation.dll + + + ..\ref\Techblox_Data\Managed\Techblox.VFXBlockClient.dll + ..\..\ref\Techblox_Data\Managed\Techblox.VFXBlockClient.dll + + + ..\ref\Techblox_Data\Managed\Techblox.VFXBlockServer.dll + ..\..\ref\Techblox_Data\Managed\Techblox.VFXBlockServer.dll + + + ..\ref\Techblox_Data\Managed\Techblox.VisualEffects.VFXGraph.dll + ..\..\ref\Techblox_Data\Managed\Techblox.VisualEffects.VFXGraph.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Weapons.Aiming.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Weapons.Aiming.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Weapons.DisablerBlock.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Weapons.DisablerBlock.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Weapons.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Weapons.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Weapons.Projectiles.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Weapons.Projectiles.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Weapons.Projectiles.Server.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Weapons.Projectiles.Server.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Weapons.Server.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Weapons.Server.dll + + + ..\ref\Techblox_Data\Managed\Techblox.WheelFX.dll + ..\..\ref\Techblox_Data\Managed\Techblox.WheelFX.dll + + + ..\ref\Techblox_Data\Managed\Techblox.WheelRigBlock.dll + ..\..\ref\Techblox_Data\Managed\Techblox.WheelRigBlock.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Wheels.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Wheels.dll + + + ..\ref\Techblox_Data\Managed\Techblox.WorldEditor.Spawning.dll + ..\..\ref\Techblox_Data\Managed\Techblox.WorldEditor.Spawning.dll + + + ..\ref\Techblox_Data\Managed\Techblox.WorldEditor.TestPlayers.dll + ..\..\ref\Techblox_Data\Managed\Techblox.WorldEditor.TestPlayers.dll + + + ..\ref\Techblox_Data\Managed\Techblox.WorldResetterBlock.dll + ..\..\ref\Techblox_Data\Managed\Techblox.WorldResetterBlock.dll + + + ..\ref\Techblox_Data\Managed\UniTask.Addressables.dll + ..\..\ref\Techblox_Data\Managed\UniTask.Addressables.dll + + + ..\ref\Techblox_Data\Managed\UniTask.dll + ..\..\ref\Techblox_Data\Managed\UniTask.dll + + + ..\ref\Techblox_Data\Managed\UniTask.DOTween.dll + ..\..\ref\Techblox_Data\Managed\UniTask.DOTween.dll + + + ..\ref\Techblox_Data\Managed\UniTask.Linq.dll + ..\..\ref\Techblox_Data\Managed\UniTask.Linq.dll + + + ..\ref\Techblox_Data\Managed\UniTask.TextMeshPro.dll + ..\..\ref\Techblox_Data\Managed\UniTask.TextMeshPro.dll + + + ..\ref\Techblox_Data\Managed\Unity.Addressables.dll + ..\..\ref\Techblox_Data\Managed\Unity.Addressables.dll + + + ..\ref\Techblox_Data\Managed\Unity.Burst.dll + ..\..\ref\Techblox_Data\Managed\Unity.Burst.dll + + + ..\ref\Techblox_Data\Managed\Unity.Burst.Unsafe.dll + ..\..\ref\Techblox_Data\Managed\Unity.Burst.Unsafe.dll + + + ..\ref\Techblox_Data\Managed\Unity.Collections.dll + ..\..\ref\Techblox_Data\Managed\Unity.Collections.dll + + + ..\ref\Techblox_Data\Managed\Unity.Collections.LowLevel.ILSupport.dll + ..\..\ref\Techblox_Data\Managed\Unity.Collections.LowLevel.ILSupport.dll + + + ..\ref\Techblox_Data\Managed\Unity.Deformations.dll + ..\..\ref\Techblox_Data\Managed\Unity.Deformations.dll + + + ..\ref\Techblox_Data\Managed\Unity.Entities.dll + ..\..\ref\Techblox_Data\Managed\Unity.Entities.dll + + + ..\ref\Techblox_Data\Managed\Unity.Entities.Hybrid.dll + ..\..\ref\Techblox_Data\Managed\Unity.Entities.Hybrid.dll + + + ..\ref\Techblox_Data\Managed\Unity.InternalAPIEngineBridge.012.dll + ..\..\ref\Techblox_Data\Managed\Unity.InternalAPIEngineBridge.012.dll + + + ..\ref\Techblox_Data\Managed\Unity.Jobs.dll + ..\..\ref\Techblox_Data\Managed\Unity.Jobs.dll + + + ..\ref\Techblox_Data\Managed\Unity.Mathematics.dll + ..\..\ref\Techblox_Data\Managed\Unity.Mathematics.dll + + + ..\ref\Techblox_Data\Managed\Unity.Mathematics.Extensions.dll + ..\..\ref\Techblox_Data\Managed\Unity.Mathematics.Extensions.dll + + + ..\ref\Techblox_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll + ..\..\ref\Techblox_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll + + + ..\ref\Techblox_Data\Managed\Unity.MemoryProfiler.dll + ..\..\ref\Techblox_Data\Managed\Unity.MemoryProfiler.dll + + + ..\ref\Techblox_Data\Managed\Unity.Physics.dll + ..\..\ref\Techblox_Data\Managed\Unity.Physics.dll + + + ..\ref\Techblox_Data\Managed\Unity.Physics.Hybrid.dll + ..\..\ref\Techblox_Data\Managed\Unity.Physics.Hybrid.dll + + + ..\ref\Techblox_Data\Managed\Unity.Platforms.Common.dll + ..\..\ref\Techblox_Data\Managed\Unity.Platforms.Common.dll + + + ..\ref\Techblox_Data\Managed\Unity.Profiling.Core.dll + ..\..\ref\Techblox_Data\Managed\Unity.Profiling.Core.dll + + + ..\ref\Techblox_Data\Managed\Unity.Properties.dll + ..\..\ref\Techblox_Data\Managed\Unity.Properties.dll + + + ..\ref\Techblox_Data\Managed\Unity.Properties.Reflection.dll + ..\..\ref\Techblox_Data\Managed\Unity.Properties.Reflection.dll + + + ..\ref\Techblox_Data\Managed\Unity.Properties.UI.dll + ..\..\ref\Techblox_Data\Managed\Unity.Properties.UI.dll + + + ..\ref\Techblox_Data\Managed\Unity.Recorder.Base.dll + ..\..\ref\Techblox_Data\Managed\Unity.Recorder.Base.dll + + + ..\ref\Techblox_Data\Managed\Unity.Recorder.dll + ..\..\ref\Techblox_Data\Managed\Unity.Recorder.dll + + + ..\ref\Techblox_Data\Managed\Unity.Rendering.Hybrid.dll + ..\..\ref\Techblox_Data\Managed\Unity.Rendering.Hybrid.dll + + + ..\ref\Techblox_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll + ..\..\ref\Techblox_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll + + + ..\ref\Techblox_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll + ..\..\ref\Techblox_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll + + + ..\ref\Techblox_Data\Managed\Unity.RenderPipelines.HighDefinition.Config.Runtime.dll + ..\..\ref\Techblox_Data\Managed\Unity.RenderPipelines.HighDefinition.Config.Runtime.dll + + + ..\ref\Techblox_Data\Managed\Unity.RenderPipelines.HighDefinition.Runtime.dll + ..\..\ref\Techblox_Data\Managed\Unity.RenderPipelines.HighDefinition.Runtime.dll + + + ..\ref\Techblox_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll + ..\..\ref\Techblox_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll + + + ..\ref\Techblox_Data\Managed\Unity.ResourceManager.dll + ..\..\ref\Techblox_Data\Managed\Unity.ResourceManager.dll + + + ..\ref\Techblox_Data\Managed\Unity.Scenes.dll + ..\..\ref\Techblox_Data\Managed\Unity.Scenes.dll + + + ..\ref\Techblox_Data\Managed\Unity.ScriptableBuildPipeline.dll + ..\..\ref\Techblox_Data\Managed\Unity.ScriptableBuildPipeline.dll + + + ..\ref\Techblox_Data\Managed\Unity.Serialization.dll + ..\..\ref\Techblox_Data\Managed\Unity.Serialization.dll + + + ..\ref\Techblox_Data\Managed\Unity.TextMeshPro.dll + ..\..\ref\Techblox_Data\Managed\Unity.TextMeshPro.dll + + + ..\ref\Techblox_Data\Managed\Unity.Timeline.dll + ..\..\ref\Techblox_Data\Managed\Unity.Timeline.dll + + + ..\ref\Techblox_Data\Managed\Unity.Transforms.dll + ..\..\ref\Techblox_Data\Managed\Unity.Transforms.dll + + + ..\ref\Techblox_Data\Managed\Unity.Transforms.Hybrid.dll + ..\..\ref\Techblox_Data\Managed\Unity.Transforms.Hybrid.dll + + + ..\ref\Techblox_Data\Managed\Unity.VisualEffectGraph.Runtime.dll + ..\..\ref\Techblox_Data\Managed\Unity.VisualEffectGraph.Runtime.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.AccessibilityModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.AccessibilityModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.AIModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.AIModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.AndroidJNIModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.AndroidJNIModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.AnimationModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.AnimationModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.ARModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.ARModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.AssetBundleModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.AssetBundleModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.AudioModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.AudioModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.ClothModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.ClothModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.ClusterInputModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.ClusterInputModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.ClusterRendererModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.ClusterRendererModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.CoreModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.CoreModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.CrashReportingModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.CrashReportingModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.DirectorModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.DirectorModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.DSPGraphModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.DSPGraphModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.GameCenterModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.GameCenterModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.GIModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.GIModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.GridModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.GridModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.HotReloadModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.HotReloadModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.ImageConversionModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.ImageConversionModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.IMGUIModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.IMGUIModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.InputLegacyModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.InputLegacyModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.InputModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.InputModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.JSONSerializeModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.JSONSerializeModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.LocalizationModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.LocalizationModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.NVIDIAModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.NVIDIAModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.ParticleSystemModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.ParticleSystemModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.PerformanceReportingModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.PerformanceReportingModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.Physics2DModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.Physics2DModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.PhysicsModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.PhysicsModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.ProfilerModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.ProfilerModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.ScreenCaptureModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.ScreenCaptureModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.SharedInternalsModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.SharedInternalsModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.SpriteMaskModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.SpriteMaskModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.SpriteShapeModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.SpriteShapeModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.StreamingModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.StreamingModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.SubstanceModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.SubstanceModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.SubsystemsModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.SubsystemsModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.TerrainModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.TerrainModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.TerrainPhysicsModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.TerrainPhysicsModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.TextCoreFontEngineModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.TextCoreFontEngineModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.TextCoreTextEngineModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.TextCoreTextEngineModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.TextRenderingModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.TextRenderingModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.TilemapModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.TilemapModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.TLSModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.TLSModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.UI.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.UI.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.UIElementsModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.UIElementsModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.UIElementsNativeModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.UIElementsNativeModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.UIModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.UIModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.UmbraModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.UmbraModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.UNETModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.UNETModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.UnityAnalyticsModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.UnityAnalyticsModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.UnityConnectModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.UnityConnectModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.UnityCurlModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.UnityCurlModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.UnityTestProtocolModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.UnityTestProtocolModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.VehiclesModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.VehiclesModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.VFXModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.VFXModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.VideoModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.VideoModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.VirtualTexturingModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.VirtualTexturingModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.VRModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.VRModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.WindModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.WindModule.dll + + + ..\ref\Techblox_Data\Managed\UnityEngine.XRModule.dll + ..\..\ref\Techblox_Data\Managed\UnityEngine.XRModule.dll + + + ..\ref\Techblox_Data\Managed\VisualProfiler.dll + ..\..\ref\Techblox_Data\Managed\VisualProfiler.dll + + + ..\ref\Techblox_Data\Managed\websocket-sharp.dll + ..\..\ref\Techblox_Data\Managed\websocket-sharp.dll + + + ..\ref\Techblox_Data\Managed\ZFBrowser.dll + ..\..\ref\Techblox_Data\Managed\ZFBrowser.dll + + + + diff --git a/MakeEverythingPublicInGame/Program.cs b/MakeEverythingPublicInGame/Program.cs new file mode 100644 index 0000000..08c7fd2 --- /dev/null +++ b/MakeEverythingPublicInGame/Program.cs @@ -0,0 +1,25 @@ +using System.Text.RegularExpressions; +using Mono.Cecil; + +Console.WriteLine("Starting assembly editing..."); +var fileRegex = + new Regex(".*(Techblox|Gamecraft|RobocraftX|FullGame|RobocraftECS|DataLoader|RCX|GameState|Svelto\\.ECS)[^/]*(\\.dll)"); +foreach (var file in Directory.EnumerateFiles(@"../../../../../ref/Techblox_Data/Managed")) +{ + if (!fileRegex.IsMatch(file)) continue; + Console.WriteLine(file); + ProcessAssembly(file); +} + +void ProcessAssembly(string path) +{ + var mod = ModuleDefinition.ReadModule(path, new(ReadingMode.Immediate) { ReadWrite = true }); + foreach (var typeDefinition in mod.Types) + { + typeDefinition.IsPublic = true; + foreach (var method in typeDefinition.Methods) method.IsPublic = true; + foreach (var field in typeDefinition.Fields) field.IsPublic = true; + } + + mod.Write(); +} \ No newline at end of file diff --git a/TechbloxModdingAPI.sln b/TechbloxModdingAPI.sln index 999cac5..20512c0 100644 --- a/TechbloxModdingAPI.sln +++ b/TechbloxModdingAPI.sln @@ -7,6 +7,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TechbloxModdingAPI", "Techb EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeGenerator", "CodeGenerator\CodeGenerator.csproj", "{0EBB6400-95A7-4A3D-B2ED-BF31E364CC10}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MakeEverythingPublicInGame", "MakeEverythingPublicInGame\MakeEverythingPublicInGame.csproj", "{391A3107-E5C6-4A04-9467-6D868AA9A8B4}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -26,6 +28,12 @@ Global {0EBB6400-95A7-4A3D-B2ED-BF31E364CC10}.Release|Any CPU.Build.0 = Release|Any CPU {0EBB6400-95A7-4A3D-B2ED-BF31E364CC10}.Test|Any CPU.ActiveCfg = Debug|Any CPU {0EBB6400-95A7-4A3D-B2ED-BF31E364CC10}.Test|Any CPU.Build.0 = Debug|Any CPU + {391A3107-E5C6-4A04-9467-6D868AA9A8B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {391A3107-E5C6-4A04-9467-6D868AA9A8B4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {391A3107-E5C6-4A04-9467-6D868AA9A8B4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {391A3107-E5C6-4A04-9467-6D868AA9A8B4}.Release|Any CPU.Build.0 = Release|Any CPU + {391A3107-E5C6-4A04-9467-6D868AA9A8B4}.Test|Any CPU.ActiveCfg = Debug|Any CPU + {391A3107-E5C6-4A04-9467-6D868AA9A8B4}.Test|Any CPU.Build.0 = Debug|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/TechbloxModdingAPI/Utility/NativeApiExtensions.cs b/TechbloxModdingAPI/Utility/NativeApiExtensions.cs index 34f15f0..47629bb 100644 --- a/TechbloxModdingAPI/Utility/NativeApiExtensions.cs +++ b/TechbloxModdingAPI/Utility/NativeApiExtensions.cs @@ -1,5 +1,8 @@ using System; using System.Collections.Generic; +using System.Reflection; +using HarmonyLib; +using Svelto.DataStructures; using Svelto.ECS; using Svelto.Tasks; using Svelto.Tasks.Lean; @@ -79,7 +82,6 @@ namespace TechbloxModdingAPI.Utility public static void PublishEntityChangeDelayed(this EntitiesDB entitiesDB, EGID id, int limit = 80) where T : unmanaged, IEntityComponent { - //TODO: Doesn't seem to help if (!ChangesToPublish.ContainsKey(typeof(T))) ChangesToPublish.Add(typeof(T), (0, new HashSet())); var changes = ChangesToPublish[typeof(T)].Changes; @@ -94,6 +96,30 @@ namespace TechbloxModdingAPI.Utility yield return Yield.It; while (ChangesToPublish[typeof(T)].PublishedCount >= limit) yield return Yield.It; + if (!entitiesDB._entityStream._streams.TryGetValue(TypeRefWrapper.wrapper, out var result)) + yield break; // There is no entity stream for this type + var consumers = (result as EntityStream)?._consumers; + if (consumers == null) + { + Console.WriteLine("Consumers is null"); + yield break; + } + + bool waitForConsumers; + do + { + waitForConsumers = false; + for (int i = 0; i < consumers.count; i++) + { + var buffer = consumers[i]._ringBuffer; + if (buffer.Count + 1 <= buffer.Capacity) continue; + waitForConsumers = true; + Console.WriteLine($"Gonna have to wait for a consumer (capacity: {buffer.Capacity} count: {buffer.Count}"); + break; + } + + if (waitForConsumers) yield return Yield.It; + } while (waitForConsumers); entitiesDB.PublishEntityChange(id); var (count, changes) = ChangesToPublish[typeof(T)]; changes.Remove(id); diff --git a/TechbloxModdingAPI/Utility/OptionalRef.cs b/TechbloxModdingAPI/Utility/OptionalRef.cs index 2d551e3..4e3325b 100644 --- a/TechbloxModdingAPI/Utility/OptionalRef.cs +++ b/TechbloxModdingAPI/Utility/OptionalRef.cs @@ -21,6 +21,7 @@ namespace TechbloxModdingAPI.Utility this.index = index; this.entityId = entityId; initializer = default; + managedArray = default; } public OptionalRef(MB array, uint index, EGID entityId = default) @@ -53,6 +54,7 @@ namespace TechbloxModdingAPI.Utility } array = default; index = default; + managedArray = default; } /// diff --git a/TechbloxModdingAPI/Utility/RefCollection.cs b/TechbloxModdingAPI/Utility/RefCollection.cs index 0776e8a..29d82d5 100644 --- a/TechbloxModdingAPI/Utility/RefCollection.cs +++ b/TechbloxModdingAPI/Utility/RefCollection.cs @@ -34,6 +34,8 @@ namespace TechbloxModdingAPI.Utility this.nativeIDs = nativeIDs; this.group = group; managed = false; + managedArray = default; + managedIDs = default; } public Enumerator GetEnumerator() => new(this); -- 2.30.2 From b3b1e9b9e7a02eec4f11cbe250196252f892de47 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Tue, 18 Oct 2022 20:19:41 +0200 Subject: [PATCH 250/252] Update reference paths to allow for RC2 dev as well --- CodeGenerator/CodeGenerator.csproj | 1556 ++++++++-------- .../MakeEverythingPublicInGame.csproj | 1556 ++++++++-------- MakeEverythingPublicInGame/Program.cs | 2 +- TechbloxModdingAPI/TechbloxModdingAPI.csproj | 1558 ++++++++--------- 4 files changed, 2336 insertions(+), 2336 deletions(-) diff --git a/CodeGenerator/CodeGenerator.csproj b/CodeGenerator/CodeGenerator.csproj index c80dce9..766eefc 100644 --- a/CodeGenerator/CodeGenerator.csproj +++ b/CodeGenerator/CodeGenerator.csproj @@ -32,1560 +32,1560 @@ - ..\ref\Techblox_Data\Managed\IllusionInjector.dll - ..\..\ref\Techblox_Data\Managed\IllusionInjector.dll + ..\ref_TB\Techblox_Data\Managed\IllusionInjector.dll + ..\..\ref_TB\Techblox_Data\Managed\IllusionInjector.dll - ..\ref\Techblox_Data\Managed\IllusionPlugin.dll - ..\..\ref\Techblox_Data\Managed\IllusionPlugin.dll + ..\ref_TB\Techblox_Data\Managed\IllusionPlugin.dll + ..\..\ref_TB\Techblox_Data\Managed\IllusionPlugin.dll - ..\ref\Techblox_Data\Managed\Accessibility.dll - ..\..\ref\Techblox_Data\Managed\Accessibility.dll + ..\ref_TB\Techblox_Data\Managed\Accessibility.dll + ..\..\ref_TB\Techblox_Data\Managed\Accessibility.dll - ..\ref\Techblox_Data\Managed\Analytics.dll - ..\..\ref\Techblox_Data\Managed\Analytics.dll + ..\ref_TB\Techblox_Data\Managed\Analytics.dll + ..\..\ref_TB\Techblox_Data\Managed\Analytics.dll - ..\ref\Techblox_Data\Managed\Assembly-CSharp-firstpass.dll - ..\..\ref\Techblox_Data\Managed\Assembly-CSharp-firstpass.dll + ..\ref_TB\Techblox_Data\Managed\Assembly-CSharp-firstpass.dll + ..\..\ref_TB\Techblox_Data\Managed\Assembly-CSharp-firstpass.dll - ..\ref\Techblox_Data\Managed\Assembly-CSharp.dll - ..\..\ref\Techblox_Data\Managed\Assembly-CSharp.dll + ..\ref_TB\Techblox_Data\Managed\Assembly-CSharp.dll + ..\..\ref_TB\Techblox_Data\Managed\Assembly-CSharp.dll - ..\ref\Techblox_Data\Managed\AWSSDK.Core.dll - ..\..\ref\Techblox_Data\Managed\AWSSDK.Core.dll + ..\ref_TB\Techblox_Data\Managed\AWSSDK.Core.dll + ..\..\ref_TB\Techblox_Data\Managed\AWSSDK.Core.dll - ..\ref\Techblox_Data\Managed\AWSSDK.GameLift.dll - ..\..\ref\Techblox_Data\Managed\AWSSDK.GameLift.dll + ..\ref_TB\Techblox_Data\Managed\AWSSDK.GameLift.dll + ..\..\ref_TB\Techblox_Data\Managed\AWSSDK.GameLift.dll - ..\ref\Techblox_Data\Managed\BevelEffect.dll - ..\..\ref\Techblox_Data\Managed\BevelEffect.dll + ..\ref_TB\Techblox_Data\Managed\BevelEffect.dll + ..\..\ref_TB\Techblox_Data\Managed\BevelEffect.dll - ..\ref\Techblox_Data\Managed\Boxophobic.TheVehetationEngine.Runtime.dll - ..\..\ref\Techblox_Data\Managed\Boxophobic.TheVehetationEngine.Runtime.dll + ..\ref_TB\Techblox_Data\Managed\Boxophobic.TheVehetationEngine.Runtime.dll + ..\..\ref_TB\Techblox_Data\Managed\Boxophobic.TheVehetationEngine.Runtime.dll - ..\ref\Techblox_Data\Managed\Boxophobic.Utils.Scripts.dll - ..\..\ref\Techblox_Data\Managed\Boxophobic.Utils.Scripts.dll + ..\ref_TB\Techblox_Data\Managed\Boxophobic.Utils.Scripts.dll + ..\..\ref_TB\Techblox_Data\Managed\Boxophobic.Utils.Scripts.dll - ..\ref\Techblox_Data\Managed\DataLoader.dll - ..\..\ref\Techblox_Data\Managed\DataLoader.dll + ..\ref_TB\Techblox_Data\Managed\DataLoader.dll + ..\..\ref_TB\Techblox_Data\Managed\DataLoader.dll - ..\ref\Techblox_Data\Managed\DDNA.dll - ..\..\ref\Techblox_Data\Managed\DDNA.dll + ..\ref_TB\Techblox_Data\Managed\DDNA.dll + ..\..\ref_TB\Techblox_Data\Managed\DDNA.dll - ..\ref\Techblox_Data\Managed\EasyButtons.dll - ..\..\ref\Techblox_Data\Managed\EasyButtons.dll + ..\ref_TB\Techblox_Data\Managed\EasyButtons.dll + ..\..\ref_TB\Techblox_Data\Managed\EasyButtons.dll - ..\ref\Techblox_Data\Managed\EOSSDK.dll - ..\..\ref\Techblox_Data\Managed\EOSSDK.dll + ..\ref_TB\Techblox_Data\Managed\EOSSDK.dll + ..\..\ref_TB\Techblox_Data\Managed\EOSSDK.dll - ..\ref\Techblox_Data\Managed\FMODUnity.dll - ..\..\ref\Techblox_Data\Managed\FMODUnity.dll + ..\ref_TB\Techblox_Data\Managed\FMODUnity.dll + ..\..\ref_TB\Techblox_Data\Managed\FMODUnity.dll - ..\ref\Techblox_Data\Managed\FMODUnityResonance.dll - ..\..\ref\Techblox_Data\Managed\FMODUnityResonance.dll + ..\ref_TB\Techblox_Data\Managed\FMODUnityResonance.dll + ..\..\ref_TB\Techblox_Data\Managed\FMODUnityResonance.dll - ..\ref\Techblox_Data\Managed\FMODUnityWrapperClient.dll - ..\..\ref\Techblox_Data\Managed\FMODUnityWrapperClient.dll + ..\ref_TB\Techblox_Data\Managed\FMODUnityWrapperClient.dll + ..\..\ref_TB\Techblox_Data\Managed\FMODUnityWrapperClient.dll - ..\ref\Techblox_Data\Managed\FullGame.dll - ..\..\ref\Techblox_Data\Managed\FullGame.dll + ..\ref_TB\Techblox_Data\Managed\FullGame.dll + ..\..\ref_TB\Techblox_Data\Managed\FullGame.dll - ..\ref\Techblox_Data\Managed\Gamecraft.BlockEntityFactory.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.BlockEntityFactory.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.BlockEntityFactory.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.BlockEntityFactory.dll - ..\ref\Techblox_Data\Managed\Gamecraft.BlockGroups.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.BlockGroups.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.BlockGroups.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.BlockGroups.dll - ..\ref\Techblox_Data\Managed\Gamecraft.Blocks.LogicBlock.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.Blocks.LogicBlock.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.Blocks.LogicBlock.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.Blocks.LogicBlock.dll - ..\ref\Techblox_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll - ..\ref\Techblox_Data\Managed\Gamecraft.ColourPalette.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.ColourPalette.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.ColourPalette.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.ColourPalette.dll - ..\ref\Techblox_Data\Managed\Gamecraft.Damage.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.Damage.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.Damage.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.Damage.dll - ..\ref\Techblox_Data\Managed\Gamecraft.Effects.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.Effects.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.Effects.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.Effects.dll - ..\ref\Techblox_Data\Managed\Gamecraft.ExplosionFragments.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.ExplosionFragments.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.ExplosionFragments.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.ExplosionFragments.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GraphicsSettings.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GraphicsSettings.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.GraphicsSettings.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.GraphicsSettings.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.BlueprintInventory.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.BlueprintInventory.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.BlueprintInventory.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.BlueprintInventory.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.Blueprints.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.Blueprints.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.Blueprints.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.Blueprints.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.BlueprintSets.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.BlueprintSets.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.BlueprintSets.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.BlueprintSets.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.GameOptionsScreen.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.GameOptionsScreen.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.GameOptionsScreen.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.GameOptionsScreen.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.Blocks.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.Blocks.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.Blocks.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.Blocks.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.BlueprintsHotbar.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.BlueprintsHotbar.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.BlueprintsHotbar.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.BlueprintsHotbar.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.Colours.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.Colours.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.Colours.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.Colours.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.ModeBar.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.ModeBar.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.ModeBar.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.ModeBar.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.OptionsScreen.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.OptionsScreen.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.OptionsScreen.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.OptionsScreen.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Blocks.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Blocks.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Blocks.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Blocks.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Blueprints.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Blueprints.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Blueprints.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Blueprints.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Colours.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Colours.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Colours.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Colours.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Common.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Common.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Common.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Common.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.Tweaks.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.Tweaks.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.Tweaks.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.Tweaks.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.Wires.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.Wires.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.Wires.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.Wires.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll - ..\ref\Techblox_Data\Managed\Gamecraft.JointBlocks.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.JointBlocks.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.JointBlocks.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.JointBlocks.dll - ..\ref\Techblox_Data\Managed\Gamecraft.Music.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.Music.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.Music.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.Music.dll - ..\ref\Techblox_Data\Managed\Gamecraft.NetStrings.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.NetStrings.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.NetStrings.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.NetStrings.dll - ..\ref\Techblox_Data\Managed\Gamecraft.PickupsCommon.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.PickupsCommon.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.PickupsCommon.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.PickupsCommon.dll - ..\ref\Techblox_Data\Managed\Gamecraft.PopupMessage.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.PopupMessage.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.PopupMessage.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.PopupMessage.dll - ..\ref\Techblox_Data\Managed\Gamecraft.Serialization.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.Serialization.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.Serialization.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.Serialization.dll - ..\ref\Techblox_Data\Managed\Gamecraft.Tweaks.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.Tweaks.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.Tweaks.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.Tweaks.dll - ..\ref\Techblox_Data\Managed\Gamecraft.VisualEffects.Decals.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.VisualEffects.Decals.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.VisualEffects.Decals.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.VisualEffects.Decals.dll - ..\ref\Techblox_Data\Managed\Gamecraft.Wires.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.Wires.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.Wires.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.Wires.dll - ..\ref\Techblox_Data\Managed\GameLiftServerSDKNet45.dll - ..\..\ref\Techblox_Data\Managed\GameLiftServerSDKNet45.dll + ..\ref_TB\Techblox_Data\Managed\GameLiftServerSDKNet45.dll + ..\..\ref_TB\Techblox_Data\Managed\GameLiftServerSDKNet45.dll - ..\ref\Techblox_Data\Managed\GameState.dll - ..\..\ref\Techblox_Data\Managed\GameState.dll + ..\ref_TB\Techblox_Data\Managed\GameState.dll + ..\..\ref_TB\Techblox_Data\Managed\GameState.dll - ..\ref\Techblox_Data\Managed\GhostShark.Outline.dll - ..\..\ref\Techblox_Data\Managed\GhostShark.Outline.dll + ..\ref_TB\Techblox_Data\Managed\GhostShark.Outline.dll + ..\..\ref_TB\Techblox_Data\Managed\GhostShark.Outline.dll - ..\ref\Techblox_Data\Managed\Google.Protobuf.dll - ..\..\ref\Techblox_Data\Managed\Google.Protobuf.dll + ..\ref_TB\Techblox_Data\Managed\Google.Protobuf.dll + ..\..\ref_TB\Techblox_Data\Managed\Google.Protobuf.dll - ..\ref\Techblox_Data\Managed\GPUInstancer.CrowdAnimations.dll - ..\..\ref\Techblox_Data\Managed\GPUInstancer.CrowdAnimations.dll + ..\ref_TB\Techblox_Data\Managed\GPUInstancer.CrowdAnimations.dll + ..\..\ref_TB\Techblox_Data\Managed\GPUInstancer.CrowdAnimations.dll - ..\ref\Techblox_Data\Managed\GPUInstancer.dll - ..\..\ref\Techblox_Data\Managed\GPUInstancer.dll + ..\ref_TB\Techblox_Data\Managed\GPUInstancer.dll + ..\..\ref_TB\Techblox_Data\Managed\GPUInstancer.dll - ..\ref\Techblox_Data\Managed\Havok.Physics.dll - ..\..\ref\Techblox_Data\Managed\Havok.Physics.dll + ..\ref_TB\Techblox_Data\Managed\Havok.Physics.dll + ..\..\ref_TB\Techblox_Data\Managed\Havok.Physics.dll - ..\ref\Techblox_Data\Managed\Havok.Physics.Hybrid.dll - ..\..\ref\Techblox_Data\Managed\Havok.Physics.Hybrid.dll + ..\ref_TB\Techblox_Data\Managed\Havok.Physics.Hybrid.dll + ..\..\ref_TB\Techblox_Data\Managed\Havok.Physics.Hybrid.dll - ..\ref\Techblox_Data\Managed\LiteNetLib.dll - ..\..\ref\Techblox_Data\Managed\LiteNetLib.dll + ..\ref_TB\Techblox_Data\Managed\LiteNetLib.dll + ..\..\ref_TB\Techblox_Data\Managed\LiteNetLib.dll - ..\ref\Techblox_Data\Managed\log4net.dll - ..\..\ref\Techblox_Data\Managed\log4net.dll + ..\ref_TB\Techblox_Data\Managed\log4net.dll + ..\..\ref_TB\Techblox_Data\Managed\log4net.dll - ..\ref\Techblox_Data\Managed\LZ4.dll - ..\..\ref\Techblox_Data\Managed\LZ4.dll + ..\ref_TB\Techblox_Data\Managed\LZ4.dll + ..\..\ref_TB\Techblox_Data\Managed\LZ4.dll - ..\ref\Techblox_Data\Managed\Monobehaviours.dll - ..\..\ref\Techblox_Data\Managed\Monobehaviours.dll + ..\ref_TB\Techblox_Data\Managed\Monobehaviours.dll + ..\..\ref_TB\Techblox_Data\Managed\Monobehaviours.dll - ..\ref\Techblox_Data\Managed\mscorlib.dll - ..\..\ref\Techblox_Data\Managed\mscorlib.dll + ..\ref_TB\Techblox_Data\Managed\mscorlib.dll + ..\..\ref_TB\Techblox_Data\Managed\mscorlib.dll - ..\ref\Techblox_Data\Managed\MultiplayerNetworking.dll - ..\..\ref\Techblox_Data\Managed\MultiplayerNetworking.dll + ..\ref_TB\Techblox_Data\Managed\MultiplayerNetworking.dll + ..\..\ref_TB\Techblox_Data\Managed\MultiplayerNetworking.dll - ..\ref\Techblox_Data\Managed\Newtonsoft.Json.dll - ..\..\ref\Techblox_Data\Managed\Newtonsoft.Json.dll + ..\ref_TB\Techblox_Data\Managed\Newtonsoft.Json.dll + ..\..\ref_TB\Techblox_Data\Managed\Newtonsoft.Json.dll - ..\ref\Techblox_Data\Managed\Novell.Directory.Ldap.dll - ..\..\ref\Techblox_Data\Managed\Novell.Directory.Ldap.dll + ..\ref_TB\Techblox_Data\Managed\Novell.Directory.Ldap.dll + ..\..\ref_TB\Techblox_Data\Managed\Novell.Directory.Ldap.dll - ..\ref\Techblox_Data\Managed\Prometheus.NetStandard.dll - ..\..\ref\Techblox_Data\Managed\Prometheus.NetStandard.dll + ..\ref_TB\Techblox_Data\Managed\Prometheus.NetStandard.dll + ..\..\ref_TB\Techblox_Data\Managed\Prometheus.NetStandard.dll - ..\ref\Techblox_Data\Managed\RCX.ScreenshotTaker.dll - ..\..\ref\Techblox_Data\Managed\RCX.ScreenshotTaker.dll + ..\ref_TB\Techblox_Data\Managed\RCX.ScreenshotTaker.dll + ..\..\ref_TB\Techblox_Data\Managed\RCX.ScreenshotTaker.dll - ..\ref\Techblox_Data\Managed\Rewired_Core.dll - ..\..\ref\Techblox_Data\Managed\Rewired_Core.dll + ..\ref_TB\Techblox_Data\Managed\Rewired_Core.dll + ..\..\ref_TB\Techblox_Data\Managed\Rewired_Core.dll - ..\ref\Techblox_Data\Managed\Rewired_Windows.dll - ..\..\ref\Techblox_Data\Managed\Rewired_Windows.dll + ..\ref_TB\Techblox_Data\Managed\Rewired_Windows.dll + ..\..\ref_TB\Techblox_Data\Managed\Rewired_Windows.dll - ..\ref\Techblox_Data\Managed\RichFX.dll - ..\..\ref\Techblox_Data\Managed\RichFX.dll + ..\ref_TB\Techblox_Data\Managed\RichFX.dll + ..\..\ref_TB\Techblox_Data\Managed\RichFX.dll - ..\ref\Techblox_Data\Managed\RobocraftECS.dll - ..\..\ref\Techblox_Data\Managed\RobocraftECS.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftECS.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftECS.dll - ..\ref\Techblox_Data\Managed\RobocraftX.AccountPreferences.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.AccountPreferences.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.AccountPreferences.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.AccountPreferences.dll - ..\ref\Techblox_Data\Managed\RobocraftX.Blocks.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.Blocks.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.Blocks.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.Blocks.dll - ..\ref\Techblox_Data\Managed\RobocraftX.Blocks.Ghost.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.Blocks.Ghost.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.Blocks.Ghost.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.Blocks.Ghost.dll - ..\ref\Techblox_Data\Managed\RobocraftX.Blocks.Triggers.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.Blocks.Triggers.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.Blocks.Triggers.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.Blocks.Triggers.dll - ..\ref\Techblox_Data\Managed\RobocraftX.Building.BoxSelect.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.Building.BoxSelect.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.Building.BoxSelect.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.Building.BoxSelect.dll - ..\ref\Techblox_Data\Managed\RobocraftX.Building.Jobs.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.Building.Jobs.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.Building.Jobs.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.Building.Jobs.dll - ..\ref\Techblox_Data\Managed\RobocraftX.Character.Audio.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.Character.Audio.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.Character.Audio.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.Character.Audio.dll - ..\ref\Techblox_Data\Managed\RobocraftX.Character.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.Character.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.Character.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.Character.dll - ..\ref\Techblox_Data\Managed\RobocraftX.Common.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.Common.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.Common.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.Common.dll - ..\ref\Techblox_Data\Managed\RobocraftX.ControlsScreen.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.ControlsScreen.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.ControlsScreen.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.ControlsScreen.dll - ..\ref\Techblox_Data\Managed\RobocraftX.Crosshair.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.Crosshair.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.Crosshair.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.Crosshair.dll - ..\ref\Techblox_Data\Managed\RobocraftX.FrontEnd.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.FrontEnd.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.FrontEnd.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.FrontEnd.dll - ..\ref\Techblox_Data\Managed\RobocraftX.GUI.DebugDisplay.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.DebugDisplay.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.GUI.DebugDisplay.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.GUI.DebugDisplay.dll - ..\ref\Techblox_Data\Managed\RobocraftX.GUI.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.GUI.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.GUI.dll - ..\ref\Techblox_Data\Managed\RobocraftX.GUI.Hotbar.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.Hotbar.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.GUI.Hotbar.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.GUI.Hotbar.dll - ..\ref\Techblox_Data\Managed\RobocraftX.GUI.Inventory.BlocksInventory.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.Inventory.BlocksInventory.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.GUI.Inventory.BlocksInventory.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.GUI.Inventory.BlocksInventory.dll - ..\ref\Techblox_Data\Managed\RobocraftX.GUI.Inventory.ColourInventory.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.Inventory.ColourInventory.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.GUI.Inventory.ColourInventory.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.GUI.Inventory.ColourInventory.dll - ..\ref\Techblox_Data\Managed\RobocraftX.GUI.Inventory.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.Inventory.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.GUI.Inventory.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.GUI.Inventory.dll - ..\ref\Techblox_Data\Managed\RobocraftX.GUI.QuitConfirmation.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.QuitConfirmation.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.GUI.QuitConfirmation.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.GUI.QuitConfirmation.dll - ..\ref\Techblox_Data\Managed\RobocraftX.GUI.ScaleGhost.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.ScaleGhost.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.GUI.ScaleGhost.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.GUI.ScaleGhost.dll - ..\ref\Techblox_Data\Managed\RobocraftX.GUI.TabsBar.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.TabsBar.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.GUI.TabsBar.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.GUI.TabsBar.dll - ..\ref\Techblox_Data\Managed\RobocraftX.Input.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.Input.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.Input.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.Input.dll - ..\ref\Techblox_Data\Managed\RobocraftX.MachineEditor.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.MachineEditor.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.MachineEditor.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.MachineEditor.dll - ..\ref\Techblox_Data\Managed\RobocraftX.MainGame.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.MainGame.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.MainGame.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.MainGame.dll - ..\ref\Techblox_Data\Managed\RobocraftX.MainSimulation.Audio.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.MainSimulation.Audio.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.MainSimulation.Audio.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.MainSimulation.Audio.dll - ..\ref\Techblox_Data\Managed\RobocraftX.MainSimulation.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.MainSimulation.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.MainSimulation.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.MainSimulation.dll - ..\ref\Techblox_Data\Managed\RobocraftX.Multiplayer.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.Multiplayer.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.Multiplayer.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.Multiplayer.dll - ..\ref\Techblox_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll - ..\ref\Techblox_Data\Managed\RobocraftX.Multiplayer.Serializers.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.Multiplayer.Serializers.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.Multiplayer.Serializers.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.Multiplayer.Serializers.dll - ..\ref\Techblox_Data\Managed\RobocraftX.MultiplayerInput.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.MultiplayerInput.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.MultiplayerInput.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.MultiplayerInput.dll - ..\ref\Techblox_Data\Managed\RobocraftX.ObjectIdBlocks.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.ObjectIdBlocks.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.ObjectIdBlocks.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.ObjectIdBlocks.dll - ..\ref\Techblox_Data\Managed\RobocraftX.Physics.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.Physics.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.Physics.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.Physics.dll - ..\ref\Techblox_Data\Managed\RobocraftX.PilotSeat.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.PilotSeat.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.PilotSeat.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.PilotSeat.dll - ..\ref\Techblox_Data\Managed\RobocraftX.Player.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.Player.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.Player.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.Player.dll - ..\ref\Techblox_Data\Managed\RobocraftX.SaveAndLoad.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.SaveAndLoad.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.SaveAndLoad.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.SaveAndLoad.dll - ..\ref\Techblox_Data\Managed\RobocraftX.SaveGameDialog.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.SaveGameDialog.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.SaveGameDialog.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.SaveGameDialog.dll - ..\ref\Techblox_Data\Managed\RobocraftX.Services.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.Services.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.Services.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.Services.dll - ..\ref\Techblox_Data\Managed\RobocraftX.SignalHandling.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.SignalHandling.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.SignalHandling.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.SignalHandling.dll - ..\ref\Techblox_Data\Managed\RobocraftX.StateSync.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.StateSync.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.StateSync.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.StateSync.dll - ..\ref\Techblox_Data\Managed\Serilog.dll - ..\..\ref\Techblox_Data\Managed\Serilog.dll + ..\ref_TB\Techblox_Data\Managed\Serilog.dll + ..\..\ref_TB\Techblox_Data\Managed\Serilog.dll - ..\ref\Techblox_Data\Managed\Serilog.Sinks.Grafana.Loki.dll - ..\..\ref\Techblox_Data\Managed\Serilog.Sinks.Grafana.Loki.dll + ..\ref_TB\Techblox_Data\Managed\Serilog.Sinks.Grafana.Loki.dll + ..\..\ref_TB\Techblox_Data\Managed\Serilog.Sinks.Grafana.Loki.dll - ..\ref\Techblox_Data\Managed\ShaderVariantsGenerationTool.dll - ..\..\ref\Techblox_Data\Managed\ShaderVariantsGenerationTool.dll + ..\ref_TB\Techblox_Data\Managed\ShaderVariantsGenerationTool.dll + ..\..\ref_TB\Techblox_Data\Managed\ShaderVariantsGenerationTool.dll - ..\ref\Techblox_Data\Managed\SpecializedDescriptors.dll - ..\..\ref\Techblox_Data\Managed\SpecializedDescriptors.dll + ..\ref_TB\Techblox_Data\Managed\SpecializedDescriptors.dll + ..\..\ref_TB\Techblox_Data\Managed\SpecializedDescriptors.dll - ..\ref\Techblox_Data\Managed\StringFormatter.dll - ..\..\ref\Techblox_Data\Managed\StringFormatter.dll + ..\ref_TB\Techblox_Data\Managed\StringFormatter.dll + ..\..\ref_TB\Techblox_Data\Managed\StringFormatter.dll - ..\ref\Techblox_Data\Managed\Svelto.Common.dll - ..\..\ref\Techblox_Data\Managed\Svelto.Common.dll + ..\ref_TB\Techblox_Data\Managed\Svelto.Common.dll + ..\..\ref_TB\Techblox_Data\Managed\Svelto.Common.dll - ..\ref\Techblox_Data\Managed\Svelto.ECS.dll - ..\..\ref\Techblox_Data\Managed\Svelto.ECS.dll + ..\ref_TB\Techblox_Data\Managed\Svelto.ECS.dll + ..\..\ref_TB\Techblox_Data\Managed\Svelto.ECS.dll - ..\ref\Techblox_Data\Managed\Svelto.ECS.GUI.dll - ..\..\ref\Techblox_Data\Managed\Svelto.ECS.GUI.dll + ..\ref_TB\Techblox_Data\Managed\Svelto.ECS.GUI.dll + ..\..\ref_TB\Techblox_Data\Managed\Svelto.ECS.GUI.dll - ..\ref\Techblox_Data\Managed\Svelto.Services.dll - ..\..\ref\Techblox_Data\Managed\Svelto.Services.dll + ..\ref_TB\Techblox_Data\Managed\Svelto.Services.dll + ..\..\ref_TB\Techblox_Data\Managed\Svelto.Services.dll - ..\ref\Techblox_Data\Managed\Svelto.Tasks.dll - ..\..\ref\Techblox_Data\Managed\Svelto.Tasks.dll + ..\ref_TB\Techblox_Data\Managed\Svelto.Tasks.dll + ..\..\ref_TB\Techblox_Data\Managed\Svelto.Tasks.dll - ..\ref\Techblox_Data\Managed\Techblox.AdditionalParts.dll - ..\..\ref\Techblox_Data\Managed\Techblox.AdditionalParts.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.AdditionalParts.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.AdditionalParts.dll - ..\ref\Techblox_Data\Managed\Techblox.AntiAFKServer.dll - ..\..\ref\Techblox_Data\Managed\Techblox.AntiAFKServer.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.AntiAFKServer.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.AntiAFKServer.dll - ..\ref\Techblox_Data\Managed\Techblox.Anticheat.Client.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Anticheat.Client.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Anticheat.Client.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Anticheat.Client.dll - ..\ref\Techblox_Data\Managed\Techblox.Anticheat.Common.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Anticheat.Common.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Anticheat.Common.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Anticheat.Common.dll - ..\ref\Techblox_Data\Managed\Techblox.AtmosphereBlock.dll - ..\..\ref\Techblox_Data\Managed\Techblox.AtmosphereBlock.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.AtmosphereBlock.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.AtmosphereBlock.dll - ..\ref\Techblox_Data\Managed\Techblox.AudioBlocks.dll - ..\..\ref\Techblox_Data\Managed\Techblox.AudioBlocks.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.AudioBlocks.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.AudioBlocks.dll - ..\ref\Techblox_Data\Managed\Techblox.AudioBlocksClient.dll - ..\..\ref\Techblox_Data\Managed\Techblox.AudioBlocksClient.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.AudioBlocksClient.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.AudioBlocksClient.dll - ..\ref\Techblox_Data\Managed\Techblox.AutoForward.dll - ..\..\ref\Techblox_Data\Managed\Techblox.AutoForward.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.AutoForward.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.AutoForward.dll - ..\ref\Techblox_Data\Managed\Techblox.Backend.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Backend.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Backend.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Backend.dll - ..\ref\Techblox_Data\Managed\Techblox.BitBlock.dll - ..\..\ref\Techblox_Data\Managed\Techblox.BitBlock.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.BitBlock.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.BitBlock.dll - ..\ref\Techblox_Data\Managed\Techblox.BlockColours.dll - ..\..\ref\Techblox_Data\Managed\Techblox.BlockColours.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.BlockColours.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.BlockColours.dll - ..\ref\Techblox_Data\Managed\Techblox.BlockLabels.dll - ..\..\ref\Techblox_Data\Managed\Techblox.BlockLabels.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.BlockLabels.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.BlockLabels.dll - ..\ref\Techblox_Data\Managed\Techblox.BlockLabelsServer.dll - ..\..\ref\Techblox_Data\Managed\Techblox.BlockLabelsServer.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.BlockLabelsServer.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.BlockLabelsServer.dll - ..\ref\Techblox_Data\Managed\Techblox.Blocks.Connections.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Blocks.Connections.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Blocks.Connections.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Blocks.Connections.dll - ..\ref\Techblox_Data\Managed\Techblox.Blocks.LightBlock.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Blocks.LightBlock.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Blocks.LightBlock.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Blocks.LightBlock.dll - ..\ref\Techblox_Data\Managed\Techblox.Building.Rules.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Building.Rules.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Building.Rules.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Building.Rules.dll - ..\ref\Techblox_Data\Managed\Techblox.Building.Shift.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Building.Shift.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Building.Shift.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Building.Shift.dll - ..\ref\Techblox_Data\Managed\Techblox.BuildingDrone.dll - ..\..\ref\Techblox_Data\Managed\Techblox.BuildingDrone.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.BuildingDrone.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.BuildingDrone.dll - ..\ref\Techblox_Data\Managed\Techblox.Camera.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Camera.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Camera.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Camera.dll - ..\ref\Techblox_Data\Managed\Techblox.CentreHUDBlock.dll - ..\..\ref\Techblox_Data\Managed\Techblox.CentreHUDBlock.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.CentreHUDBlock.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.CentreHUDBlock.dll - ..\ref\Techblox_Data\Managed\Techblox.CentreHUDGUI.dll - ..\..\ref\Techblox_Data\Managed\Techblox.CentreHUDGUI.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.CentreHUDGUI.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.CentreHUDGUI.dll - ..\ref\Techblox_Data\Managed\Techblox.CharacterDamage.Client.dll - ..\..\ref\Techblox_Data\Managed\Techblox.CharacterDamage.Client.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.CharacterDamage.Client.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.CharacterDamage.Client.dll - ..\ref\Techblox_Data\Managed\Techblox.CharacterDamage.Server.dll - ..\..\ref\Techblox_Data\Managed\Techblox.CharacterDamage.Server.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.CharacterDamage.Server.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.CharacterDamage.Server.dll - ..\ref\Techblox_Data\Managed\Techblox.CharacterRespawnScreen.dll - ..\..\ref\Techblox_Data\Managed\Techblox.CharacterRespawnScreen.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.CharacterRespawnScreen.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.CharacterRespawnScreen.dll - ..\ref\Techblox_Data\Managed\Techblox.CheckpointBlock.dll - ..\..\ref\Techblox_Data\Managed\Techblox.CheckpointBlock.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.CheckpointBlock.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.CheckpointBlock.dll - ..\ref\Techblox_Data\Managed\Techblox.CheckpointBlockClient.dll - ..\..\ref\Techblox_Data\Managed\Techblox.CheckpointBlockClient.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.CheckpointBlockClient.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.CheckpointBlockClient.dll - ..\ref\Techblox_Data\Managed\Techblox.Common.Audio.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Common.Audio.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Common.Audio.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Common.Audio.dll - ..\ref\Techblox_Data\Managed\Techblox.ConstantBlockClient.dll - ..\..\ref\Techblox_Data\Managed\Techblox.ConstantBlockClient.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.ConstantBlockClient.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.ConstantBlockClient.dll - ..\ref\Techblox_Data\Managed\Techblox.ConstantBlockServer.dll - ..\..\ref\Techblox_Data\Managed\Techblox.ConstantBlockServer.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.ConstantBlockServer.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.ConstantBlockServer.dll - ..\ref\Techblox_Data\Managed\Techblox.ContextSensitiveTextHint.dll - ..\..\ref\Techblox_Data\Managed\Techblox.ContextSensitiveTextHint.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.ContextSensitiveTextHint.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.ContextSensitiveTextHint.dll - ..\ref\Techblox_Data\Managed\Techblox.CounterBlockClient.dll - ..\..\ref\Techblox_Data\Managed\Techblox.CounterBlockClient.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.CounterBlockClient.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.CounterBlockClient.dll - ..\ref\Techblox_Data\Managed\Techblox.CounterBlockServer.dll - ..\..\ref\Techblox_Data\Managed\Techblox.CounterBlockServer.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.CounterBlockServer.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.CounterBlockServer.dll - ..\ref\Techblox_Data\Managed\Techblox.DamageRbScoreBlockServerServer.dll - ..\..\ref\Techblox_Data\Managed\Techblox.DamageRbScoreBlockServerServer.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.DamageRbScoreBlockServerServer.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.DamageRbScoreBlockServerServer.dll - ..\ref\Techblox_Data\Managed\Techblox.DirectionalDamageVingette.dll - ..\..\ref\Techblox_Data\Managed\Techblox.DirectionalDamageVingette.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.DirectionalDamageVingette.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.DirectionalDamageVingette.dll - ..\ref\Techblox_Data\Managed\Techblox.DistanceSensorBlock.dll - ..\..\ref\Techblox_Data\Managed\Techblox.DistanceSensorBlock.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.DistanceSensorBlock.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.DistanceSensorBlock.dll - ..\ref\Techblox_Data\Managed\Techblox.ECSResourceManagers.dll - ..\..\ref\Techblox_Data\Managed\Techblox.ECSResourceManagers.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.ECSResourceManagers.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.ECSResourceManagers.dll - ..\ref\Techblox_Data\Managed\Techblox.EngineBlock.dll - ..\..\ref\Techblox_Data\Managed\Techblox.EngineBlock.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.EngineBlock.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.EngineBlock.dll - ..\ref\Techblox_Data\Managed\Techblox.EnvironmentBlocks.BuildingEnvironment.dll - ..\..\ref\Techblox_Data\Managed\Techblox.EnvironmentBlocks.BuildingEnvironment.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.EnvironmentBlocks.BuildingEnvironment.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.EnvironmentBlocks.BuildingEnvironment.dll - ..\ref\Techblox_Data\Managed\Techblox.EnvironmentBlocks.dll - ..\..\ref\Techblox_Data\Managed\Techblox.EnvironmentBlocks.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.EnvironmentBlocks.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.EnvironmentBlocks.dll - ..\ref\Techblox_Data\Managed\Techblox.EnvironmentBlocks.SimulationWorldEnvironment.dll - ..\..\ref\Techblox_Data\Managed\Techblox.EnvironmentBlocks.SimulationWorldEnvironment.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.EnvironmentBlocks.SimulationWorldEnvironment.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.EnvironmentBlocks.SimulationWorldEnvironment.dll - ..\ref\Techblox_Data\Managed\Techblox.Gameplay.Client.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.Client.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.Client.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.Client.dll - ..\ref\Techblox_Data\Managed\Techblox.Gameplay.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.dll - ..\ref\Techblox_Data\Managed\Techblox.Gameplay.GameState.Client.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.GameState.Client.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.GameState.Client.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.GameState.Client.dll - ..\ref\Techblox_Data\Managed\Techblox.Gameplay.GameState.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.GameState.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.GameState.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.GameState.dll - ..\ref\Techblox_Data\Managed\Techblox.Gameplay.PlayerGameplayDetails.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.PlayerGameplayDetails.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.PlayerGameplayDetails.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.PlayerGameplayDetails.dll - ..\ref\Techblox_Data\Managed\Techblox.Gameplay.Score.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.Score.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.Score.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.Score.dll - ..\ref\Techblox_Data\Managed\Techblox.Gameplay.Spawning.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.Spawning.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.Spawning.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.Spawning.dll - ..\ref\Techblox_Data\Managed\Techblox.Gameplay.Teams.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.Teams.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.Teams.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.Teams.dll - ..\ref\Techblox_Data\Managed\Techblox.Gameplay.WorldResetting.Client.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.WorldResetting.Client.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.WorldResetting.Client.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.WorldResetting.Client.dll - ..\ref\Techblox_Data\Managed\Techblox.Gameplay.WorldResetting.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.WorldResetting.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.WorldResetting.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.WorldResetting.dll - ..\ref\Techblox_Data\Managed\Techblox.GameSelection.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GameSelection.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GameSelection.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GameSelection.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.Building.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Building.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Building.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Building.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.BuildRules.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.BuildRules.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.BuildRules.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.BuildRules.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.CharacterHealthFeedback.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.CharacterHealthFeedback.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.CharacterHealthFeedback.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.CharacterHealthFeedback.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.Collection.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Collection.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Collection.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Collection.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.Controls.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Controls.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Controls.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Controls.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.GamePortal.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.GamePortal.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.GamePortal.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.GamePortal.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.GeneralSettingsScreen.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.GeneralSettingsScreen.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.GeneralSettingsScreen.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.GeneralSettingsScreen.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.Hotbar.Landscapes.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Hotbar.Landscapes.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Hotbar.Landscapes.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Hotbar.Landscapes.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.Hotbar.Materials.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Hotbar.Materials.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Hotbar.Materials.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Hotbar.Materials.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.Inventory.Common.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Inventory.Common.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Inventory.Common.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Inventory.Common.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.Inventory.Landscapes.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Inventory.Landscapes.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Inventory.Landscapes.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Inventory.Landscapes.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.Inventory.Materials.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Inventory.Materials.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Inventory.Materials.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Inventory.Materials.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.LoadingBar.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.LoadingBar.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.LoadingBar.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.LoadingBar.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.Login.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Login.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Login.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Login.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.MachineReconstructTimer.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.MachineReconstructTimer.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.MachineReconstructTimer.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.MachineReconstructTimer.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.MainGame.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.MainGame.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.MainGame.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.MainGame.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.MainGame.StateMachine.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.MainGame.StateMachine.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.MainGame.StateMachine.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.MainGame.StateMachine.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.MyGamesScreen.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.MyGamesScreen.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.MyGamesScreen.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.MyGamesScreen.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.PauseMenu.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.PauseMenu.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.PauseMenu.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.PauseMenu.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.Progression.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Progression.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Progression.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Progression.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.TabsBar.Landscapes.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.TabsBar.Landscapes.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.TabsBar.Landscapes.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.TabsBar.Landscapes.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.TabsBar.Materials.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.TabsBar.Materials.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.TabsBar.Materials.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.TabsBar.Materials.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.UsernameDisplay.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.UsernameDisplay.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.UsernameDisplay.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.UsernameDisplay.dll - ..\ref\Techblox_Data\Managed\Techblox.InputCapture.dll - ..\..\ref\Techblox_Data\Managed\Techblox.InputCapture.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.InputCapture.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.InputCapture.dll - ..\ref\Techblox_Data\Managed\Techblox.JetBlock.dll - ..\..\ref\Techblox_Data\Managed\Techblox.JetBlock.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.JetBlock.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.JetBlock.dll - ..\ref\Techblox_Data\Managed\Techblox.JetBlockClient.dll - ..\..\ref\Techblox_Data\Managed\Techblox.JetBlockClient.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.JetBlockClient.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.JetBlockClient.dll - ..\ref\Techblox_Data\Managed\Techblox.KillScoreBlock.dll - ..\..\ref\Techblox_Data\Managed\Techblox.KillScoreBlock.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.KillScoreBlock.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.KillScoreBlock.dll - ..\ref\Techblox_Data\Managed\Techblox.MachineProcessingService.dll - ..\..\ref\Techblox_Data\Managed\Techblox.MachineProcessingService.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.MachineProcessingService.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.MachineProcessingService.dll - ..\ref\Techblox_Data\Managed\Techblox.MachineSimulationPreprocessing.dll - ..\..\ref\Techblox_Data\Managed\Techblox.MachineSimulationPreprocessing.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.MachineSimulationPreprocessing.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.MachineSimulationPreprocessing.dll - ..\ref\Techblox_Data\Managed\Techblox.MachineSpawning.dll - ..\..\ref\Techblox_Data\Managed\Techblox.MachineSpawning.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.MachineSpawning.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.MachineSpawning.dll - ..\ref\Techblox_Data\Managed\Techblox.MachineVelocityCameraEffects.dll - ..\..\ref\Techblox_Data\Managed\Techblox.MachineVelocityCameraEffects.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.MachineVelocityCameraEffects.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.MachineVelocityCameraEffects.dll - ..\ref\Techblox_Data\Managed\Techblox.Matchmaking.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Matchmaking.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Matchmaking.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Matchmaking.dll - ..\ref\Techblox_Data\Managed\Techblox.Monitoring.Server.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Monitoring.Server.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Monitoring.Server.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Monitoring.Server.dll - ..\ref\Techblox_Data\Managed\Techblox.Multiplayer.UsernameMessages.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Multiplayer.UsernameMessages.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Multiplayer.UsernameMessages.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Multiplayer.UsernameMessages.dll - ..\ref\Techblox_Data\Managed\Techblox.ObjectIDBlockClient.dll - ..\..\ref\Techblox_Data\Managed\Techblox.ObjectIDBlockClient.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.ObjectIDBlockClient.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.ObjectIDBlockClient.dll - ..\ref\Techblox_Data\Managed\Techblox.ObjectIDBlockServer.dll - ..\..\ref\Techblox_Data\Managed\Techblox.ObjectIDBlockServer.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.ObjectIDBlockServer.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.ObjectIDBlockServer.dll - ..\ref\Techblox_Data\Managed\Techblox.Particles.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Particles.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Particles.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Particles.dll - ..\ref\Techblox_Data\Managed\Techblox.PlayUX.dll - ..\..\ref\Techblox_Data\Managed\Techblox.PlayUX.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.PlayUX.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.PlayUX.dll - ..\ref\Techblox_Data\Managed\Techblox.Pointer.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Pointer.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Pointer.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Pointer.dll - ..\ref\Techblox_Data\Managed\Techblox.ProceduralReflectionProbes.dll - ..\..\ref\Techblox_Data\Managed\Techblox.ProceduralReflectionProbes.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.ProceduralReflectionProbes.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.ProceduralReflectionProbes.dll - ..\ref\Techblox_Data\Managed\Techblox.Rendering.Common.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Rendering.Common.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Rendering.Common.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Rendering.Common.dll - ..\ref\Techblox_Data\Managed\Techblox.Rendering.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Rendering.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Rendering.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Rendering.dll - ..\ref\Techblox_Data\Managed\Techblox.Rendering.DOTS.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Rendering.DOTS.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Rendering.DOTS.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Rendering.DOTS.dll - ..\ref\Techblox_Data\Managed\Techblox.Rendering.GPUI.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Rendering.GPUI.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Rendering.GPUI.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Rendering.GPUI.dll - ..\ref\Techblox_Data\Managed\Techblox.Rendering.Unity.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Rendering.Unity.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Rendering.Unity.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Rendering.Unity.dll - ..\ref\Techblox_Data\Managed\Techblox.SaveGamesConversion.dll - ..\..\ref\Techblox_Data\Managed\Techblox.SaveGamesConversion.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.SaveGamesConversion.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.SaveGamesConversion.dll - ..\ref\Techblox_Data\Managed\Techblox.ScoreHUDBlock.dll - ..\..\ref\Techblox_Data\Managed\Techblox.ScoreHUDBlock.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.ScoreHUDBlock.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.ScoreHUDBlock.dll - ..\ref\Techblox_Data\Managed\Techblox.ScoreHUDGUI.dll - ..\..\ref\Techblox_Data\Managed\Techblox.ScoreHUDGUI.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.ScoreHUDGUI.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.ScoreHUDGUI.dll - ..\ref\Techblox_Data\Managed\Techblox.ScorePickupBlockClient.dll - ..\..\ref\Techblox_Data\Managed\Techblox.ScorePickupBlockClient.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.ScorePickupBlockClient.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.ScorePickupBlockClient.dll - ..\ref\Techblox_Data\Managed\Techblox.ScorePickupBlockServer.dll - ..\..\ref\Techblox_Data\Managed\Techblox.ScorePickupBlockServer.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.ScorePickupBlockServer.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.ScorePickupBlockServer.dll - ..\ref\Techblox_Data\Managed\Techblox.Server.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Server.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Server.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Server.dll - ..\ref\Techblox_Data\Managed\Techblox.Services.Anticheat.Client.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Services.Anticheat.Client.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Services.Anticheat.Client.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Services.Anticheat.Client.dll - ..\ref\Techblox_Data\Managed\Techblox.Services.Eos.Common.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Services.Eos.Common.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Services.Eos.Common.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Services.Eos.Common.dll - ..\ref\Techblox_Data\Managed\Techblox.Services.Eos.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Services.Eos.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Services.Eos.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Services.Eos.dll - ..\ref\Techblox_Data\Managed\Techblox.Services.GameDetails.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Services.GameDetails.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Services.GameDetails.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Services.GameDetails.dll - ..\ref\Techblox_Data\Managed\Techblox.Services.LocalPreferences.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Services.LocalPreferences.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Services.LocalPreferences.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Services.LocalPreferences.dll - ..\ref\Techblox_Data\Managed\Techblox.Services.Matchmaking.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Services.Matchmaking.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Services.Matchmaking.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Services.Matchmaking.dll - ..\ref\Techblox_Data\Managed\Techblox.Services.Metrics.Server.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Services.Metrics.Server.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Services.Metrics.Server.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Services.Metrics.Server.dll - ..\ref\Techblox_Data\Managed\Techblox.Services.Progression.Client.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Services.Progression.Client.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Services.Progression.Client.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Services.Progression.Client.dll - ..\ref\Techblox_Data\Managed\Techblox.Services.Progression.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Services.Progression.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Services.Progression.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Services.Progression.dll - ..\ref\Techblox_Data\Managed\Techblox.Services.Storage.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Services.Storage.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Services.Storage.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Services.Storage.dll - ..\ref\Techblox_Data\Managed\Techblox.Services.Users.Client.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Services.Users.Client.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Services.Users.Client.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Services.Users.Client.dll - ..\ref\Techblox_Data\Managed\Techblox.Services.Users.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Services.Users.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Services.Users.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Services.Users.dll - ..\ref\Techblox_Data\Managed\Techblox.ServoBlocksClient.dll - ..\..\ref\Techblox_Data\Managed\Techblox.ServoBlocksClient.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.ServoBlocksClient.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.ServoBlocksClient.dll - ..\ref\Techblox_Data\Managed\Techblox.ServoBlocksServer.dll - ..\..\ref\Techblox_Data\Managed\Techblox.ServoBlocksServer.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.ServoBlocksServer.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.ServoBlocksServer.dll - ..\ref\Techblox_Data\Managed\Techblox.ServosServer.dll - ..\..\ref\Techblox_Data\Managed\Techblox.ServosServer.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.ServosServer.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.ServosServer.dll - ..\ref\Techblox_Data\Managed\Techblox.SignalHandling.Audio.dll - ..\..\ref\Techblox_Data\Managed\Techblox.SignalHandling.Audio.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.SignalHandling.Audio.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.SignalHandling.Audio.dll - ..\ref\Techblox_Data\Managed\Techblox.SignalHandling.Common.dll - ..\..\ref\Techblox_Data\Managed\Techblox.SignalHandling.Common.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.SignalHandling.Common.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.SignalHandling.Common.dll - ..\ref\Techblox_Data\Managed\Techblox.Simulation.Clusters.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Simulation.Clusters.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Simulation.Clusters.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Simulation.Clusters.dll - ..\ref\Techblox_Data\Managed\Techblox.SpawnBlock.Client.dll - ..\..\ref\Techblox_Data\Managed\Techblox.SpawnBlock.Client.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.SpawnBlock.Client.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.SpawnBlock.Client.dll - ..\ref\Techblox_Data\Managed\Techblox.SpawnBlock.Server.dll - ..\..\ref\Techblox_Data\Managed\Techblox.SpawnBlock.Server.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.SpawnBlock.Server.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.SpawnBlock.Server.dll - ..\ref\Techblox_Data\Managed\Techblox.StabilizerBlock.dll - ..\..\ref\Techblox_Data\Managed\Techblox.StabilizerBlock.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.StabilizerBlock.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.StabilizerBlock.dll - ..\ref\Techblox_Data\Managed\Techblox.StabilizerBlockClient.dll - ..\..\ref\Techblox_Data\Managed\Techblox.StabilizerBlockClient.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.StabilizerBlockClient.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.StabilizerBlockClient.dll - ..\ref\Techblox_Data\Managed\Techblox.SwitchAnimation.dll - ..\..\ref\Techblox_Data\Managed\Techblox.SwitchAnimation.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.SwitchAnimation.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.SwitchAnimation.dll - ..\ref\Techblox_Data\Managed\Techblox.TeamScoreBlockClient.dll - ..\..\ref\Techblox_Data\Managed\Techblox.TeamScoreBlockClient.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.TeamScoreBlockClient.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.TeamScoreBlockClient.dll - ..\ref\Techblox_Data\Managed\Techblox.TeamScoreBlockServer.dll - ..\..\ref\Techblox_Data\Managed\Techblox.TeamScoreBlockServer.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.TeamScoreBlockServer.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.TeamScoreBlockServer.dll - ..\ref\Techblox_Data\Managed\Techblox.TechpointConverterBlock.dll - ..\..\ref\Techblox_Data\Managed\Techblox.TechpointConverterBlock.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.TechpointConverterBlock.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.TechpointConverterBlock.dll - ..\ref\Techblox_Data\Managed\Techblox.TechpointConverterGUI.TechPointPoolHUD.dll - ..\..\ref\Techblox_Data\Managed\Techblox.TechpointConverterGUI.TechPointPoolHUD.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.TechpointConverterGUI.TechPointPoolHUD.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.TechpointConverterGUI.TechPointPoolHUD.dll - ..\ref\Techblox_Data\Managed\Techblox.TechpointConverterGUI.TechpointRewardPanel.dll - ..\..\ref\Techblox_Data\Managed\Techblox.TechpointConverterGUI.TechpointRewardPanel.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.TechpointConverterGUI.TechpointRewardPanel.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.TechpointConverterGUI.TechpointRewardPanel.dll - ..\ref\Techblox_Data\Managed\Techblox.TextBlock.dll - ..\..\ref\Techblox_Data\Managed\Techblox.TextBlock.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.TextBlock.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.TextBlock.dll - ..\ref\Techblox_Data\Managed\Techblox.TimerBlock.dll - ..\..\ref\Techblox_Data\Managed\Techblox.TimerBlock.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.TimerBlock.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.TimerBlock.dll - ..\ref\Techblox_Data\Managed\Techblox.TriggerBlock.dll - ..\..\ref\Techblox_Data\Managed\Techblox.TriggerBlock.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.TriggerBlock.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.TriggerBlock.dll - ..\ref\Techblox_Data\Managed\Techblox.Tweaks.Validation.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Tweaks.Validation.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Tweaks.Validation.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Tweaks.Validation.dll - ..\ref\Techblox_Data\Managed\Techblox.VFXBlockClient.dll - ..\..\ref\Techblox_Data\Managed\Techblox.VFXBlockClient.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.VFXBlockClient.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.VFXBlockClient.dll - ..\ref\Techblox_Data\Managed\Techblox.VFXBlockServer.dll - ..\..\ref\Techblox_Data\Managed\Techblox.VFXBlockServer.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.VFXBlockServer.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.VFXBlockServer.dll - ..\ref\Techblox_Data\Managed\Techblox.VisualEffects.VFXGraph.dll - ..\..\ref\Techblox_Data\Managed\Techblox.VisualEffects.VFXGraph.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.VisualEffects.VFXGraph.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.VisualEffects.VFXGraph.dll - ..\ref\Techblox_Data\Managed\Techblox.Weapons.Aiming.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Weapons.Aiming.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Weapons.Aiming.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Weapons.Aiming.dll - ..\ref\Techblox_Data\Managed\Techblox.Weapons.DisablerBlock.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Weapons.DisablerBlock.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Weapons.DisablerBlock.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Weapons.DisablerBlock.dll - ..\ref\Techblox_Data\Managed\Techblox.Weapons.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Weapons.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Weapons.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Weapons.dll - ..\ref\Techblox_Data\Managed\Techblox.Weapons.Projectiles.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Weapons.Projectiles.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Weapons.Projectiles.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Weapons.Projectiles.dll - ..\ref\Techblox_Data\Managed\Techblox.Weapons.Projectiles.Server.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Weapons.Projectiles.Server.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Weapons.Projectiles.Server.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Weapons.Projectiles.Server.dll - ..\ref\Techblox_Data\Managed\Techblox.Weapons.Server.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Weapons.Server.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Weapons.Server.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Weapons.Server.dll - ..\ref\Techblox_Data\Managed\Techblox.WheelFX.dll - ..\..\ref\Techblox_Data\Managed\Techblox.WheelFX.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.WheelFX.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.WheelFX.dll - ..\ref\Techblox_Data\Managed\Techblox.WheelRigBlock.dll - ..\..\ref\Techblox_Data\Managed\Techblox.WheelRigBlock.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.WheelRigBlock.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.WheelRigBlock.dll - ..\ref\Techblox_Data\Managed\Techblox.Wheels.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Wheels.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Wheels.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Wheels.dll - ..\ref\Techblox_Data\Managed\Techblox.WorldEditor.Spawning.dll - ..\..\ref\Techblox_Data\Managed\Techblox.WorldEditor.Spawning.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.WorldEditor.Spawning.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.WorldEditor.Spawning.dll - ..\ref\Techblox_Data\Managed\Techblox.WorldEditor.TestPlayers.dll - ..\..\ref\Techblox_Data\Managed\Techblox.WorldEditor.TestPlayers.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.WorldEditor.TestPlayers.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.WorldEditor.TestPlayers.dll - ..\ref\Techblox_Data\Managed\Techblox.WorldResetterBlock.dll - ..\..\ref\Techblox_Data\Managed\Techblox.WorldResetterBlock.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.WorldResetterBlock.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.WorldResetterBlock.dll - ..\ref\Techblox_Data\Managed\UniTask.Addressables.dll - ..\..\ref\Techblox_Data\Managed\UniTask.Addressables.dll + ..\ref_TB\Techblox_Data\Managed\UniTask.Addressables.dll + ..\..\ref_TB\Techblox_Data\Managed\UniTask.Addressables.dll - ..\ref\Techblox_Data\Managed\UniTask.dll - ..\..\ref\Techblox_Data\Managed\UniTask.dll + ..\ref_TB\Techblox_Data\Managed\UniTask.dll + ..\..\ref_TB\Techblox_Data\Managed\UniTask.dll - ..\ref\Techblox_Data\Managed\UniTask.DOTween.dll - ..\..\ref\Techblox_Data\Managed\UniTask.DOTween.dll + ..\ref_TB\Techblox_Data\Managed\UniTask.DOTween.dll + ..\..\ref_TB\Techblox_Data\Managed\UniTask.DOTween.dll - ..\ref\Techblox_Data\Managed\UniTask.Linq.dll - ..\..\ref\Techblox_Data\Managed\UniTask.Linq.dll + ..\ref_TB\Techblox_Data\Managed\UniTask.Linq.dll + ..\..\ref_TB\Techblox_Data\Managed\UniTask.Linq.dll - ..\ref\Techblox_Data\Managed\UniTask.TextMeshPro.dll - ..\..\ref\Techblox_Data\Managed\UniTask.TextMeshPro.dll + ..\ref_TB\Techblox_Data\Managed\UniTask.TextMeshPro.dll + ..\..\ref_TB\Techblox_Data\Managed\UniTask.TextMeshPro.dll - ..\ref\Techblox_Data\Managed\Unity.Addressables.dll - ..\..\ref\Techblox_Data\Managed\Unity.Addressables.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Addressables.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Addressables.dll - ..\ref\Techblox_Data\Managed\Unity.Burst.dll - ..\..\ref\Techblox_Data\Managed\Unity.Burst.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Burst.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Burst.dll - ..\ref\Techblox_Data\Managed\Unity.Burst.Unsafe.dll - ..\..\ref\Techblox_Data\Managed\Unity.Burst.Unsafe.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Burst.Unsafe.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Burst.Unsafe.dll - ..\ref\Techblox_Data\Managed\Unity.Collections.dll - ..\..\ref\Techblox_Data\Managed\Unity.Collections.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Collections.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Collections.dll - ..\ref\Techblox_Data\Managed\Unity.Collections.LowLevel.ILSupport.dll - ..\..\ref\Techblox_Data\Managed\Unity.Collections.LowLevel.ILSupport.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Collections.LowLevel.ILSupport.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Collections.LowLevel.ILSupport.dll - ..\ref\Techblox_Data\Managed\Unity.Deformations.dll - ..\..\ref\Techblox_Data\Managed\Unity.Deformations.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Deformations.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Deformations.dll - ..\ref\Techblox_Data\Managed\Unity.Entities.dll - ..\..\ref\Techblox_Data\Managed\Unity.Entities.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Entities.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Entities.dll - ..\ref\Techblox_Data\Managed\Unity.Entities.Hybrid.dll - ..\..\ref\Techblox_Data\Managed\Unity.Entities.Hybrid.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Entities.Hybrid.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Entities.Hybrid.dll - ..\ref\Techblox_Data\Managed\Unity.InternalAPIEngineBridge.012.dll - ..\..\ref\Techblox_Data\Managed\Unity.InternalAPIEngineBridge.012.dll + ..\ref_TB\Techblox_Data\Managed\Unity.InternalAPIEngineBridge.012.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.InternalAPIEngineBridge.012.dll - ..\ref\Techblox_Data\Managed\Unity.Jobs.dll - ..\..\ref\Techblox_Data\Managed\Unity.Jobs.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Jobs.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Jobs.dll - ..\ref\Techblox_Data\Managed\Unity.Mathematics.dll - ..\..\ref\Techblox_Data\Managed\Unity.Mathematics.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Mathematics.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Mathematics.dll - ..\ref\Techblox_Data\Managed\Unity.Mathematics.Extensions.dll - ..\..\ref\Techblox_Data\Managed\Unity.Mathematics.Extensions.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Mathematics.Extensions.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Mathematics.Extensions.dll - ..\ref\Techblox_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll - ..\..\ref\Techblox_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll - ..\ref\Techblox_Data\Managed\Unity.MemoryProfiler.dll - ..\..\ref\Techblox_Data\Managed\Unity.MemoryProfiler.dll + ..\ref_TB\Techblox_Data\Managed\Unity.MemoryProfiler.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.MemoryProfiler.dll - ..\ref\Techblox_Data\Managed\Unity.Physics.dll - ..\..\ref\Techblox_Data\Managed\Unity.Physics.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Physics.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Physics.dll - ..\ref\Techblox_Data\Managed\Unity.Physics.Hybrid.dll - ..\..\ref\Techblox_Data\Managed\Unity.Physics.Hybrid.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Physics.Hybrid.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Physics.Hybrid.dll - ..\ref\Techblox_Data\Managed\Unity.Platforms.Common.dll - ..\..\ref\Techblox_Data\Managed\Unity.Platforms.Common.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Platforms.Common.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Platforms.Common.dll - ..\ref\Techblox_Data\Managed\Unity.Profiling.Core.dll - ..\..\ref\Techblox_Data\Managed\Unity.Profiling.Core.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Profiling.Core.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Profiling.Core.dll - ..\ref\Techblox_Data\Managed\Unity.Properties.dll - ..\..\ref\Techblox_Data\Managed\Unity.Properties.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Properties.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Properties.dll - ..\ref\Techblox_Data\Managed\Unity.Properties.Reflection.dll - ..\..\ref\Techblox_Data\Managed\Unity.Properties.Reflection.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Properties.Reflection.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Properties.Reflection.dll - ..\ref\Techblox_Data\Managed\Unity.Properties.UI.dll - ..\..\ref\Techblox_Data\Managed\Unity.Properties.UI.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Properties.UI.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Properties.UI.dll - ..\ref\Techblox_Data\Managed\Unity.Recorder.Base.dll - ..\..\ref\Techblox_Data\Managed\Unity.Recorder.Base.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Recorder.Base.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Recorder.Base.dll - ..\ref\Techblox_Data\Managed\Unity.Recorder.dll - ..\..\ref\Techblox_Data\Managed\Unity.Recorder.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Recorder.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Recorder.dll - ..\ref\Techblox_Data\Managed\Unity.Rendering.Hybrid.dll - ..\..\ref\Techblox_Data\Managed\Unity.Rendering.Hybrid.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Rendering.Hybrid.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Rendering.Hybrid.dll - ..\ref\Techblox_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll - ..\..\ref\Techblox_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll + ..\ref_TB\Techblox_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll - ..\ref\Techblox_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll - ..\..\ref\Techblox_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll + ..\ref_TB\Techblox_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll - ..\ref\Techblox_Data\Managed\Unity.RenderPipelines.HighDefinition.Config.Runtime.dll - ..\..\ref\Techblox_Data\Managed\Unity.RenderPipelines.HighDefinition.Config.Runtime.dll + ..\ref_TB\Techblox_Data\Managed\Unity.RenderPipelines.HighDefinition.Config.Runtime.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.RenderPipelines.HighDefinition.Config.Runtime.dll - ..\ref\Techblox_Data\Managed\Unity.RenderPipelines.HighDefinition.Runtime.dll - ..\..\ref\Techblox_Data\Managed\Unity.RenderPipelines.HighDefinition.Runtime.dll + ..\ref_TB\Techblox_Data\Managed\Unity.RenderPipelines.HighDefinition.Runtime.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.RenderPipelines.HighDefinition.Runtime.dll - ..\ref\Techblox_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll - ..\..\ref\Techblox_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll + ..\ref_TB\Techblox_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll - ..\ref\Techblox_Data\Managed\Unity.ResourceManager.dll - ..\..\ref\Techblox_Data\Managed\Unity.ResourceManager.dll + ..\ref_TB\Techblox_Data\Managed\Unity.ResourceManager.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.ResourceManager.dll - ..\ref\Techblox_Data\Managed\Unity.Scenes.dll - ..\..\ref\Techblox_Data\Managed\Unity.Scenes.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Scenes.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Scenes.dll - ..\ref\Techblox_Data\Managed\Unity.ScriptableBuildPipeline.dll - ..\..\ref\Techblox_Data\Managed\Unity.ScriptableBuildPipeline.dll + ..\ref_TB\Techblox_Data\Managed\Unity.ScriptableBuildPipeline.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.ScriptableBuildPipeline.dll - ..\ref\Techblox_Data\Managed\Unity.Serialization.dll - ..\..\ref\Techblox_Data\Managed\Unity.Serialization.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Serialization.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Serialization.dll - ..\ref\Techblox_Data\Managed\Unity.TextMeshPro.dll - ..\..\ref\Techblox_Data\Managed\Unity.TextMeshPro.dll + ..\ref_TB\Techblox_Data\Managed\Unity.TextMeshPro.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.TextMeshPro.dll - ..\ref\Techblox_Data\Managed\Unity.Timeline.dll - ..\..\ref\Techblox_Data\Managed\Unity.Timeline.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Timeline.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Timeline.dll - ..\ref\Techblox_Data\Managed\Unity.Transforms.dll - ..\..\ref\Techblox_Data\Managed\Unity.Transforms.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Transforms.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Transforms.dll - ..\ref\Techblox_Data\Managed\Unity.Transforms.Hybrid.dll - ..\..\ref\Techblox_Data\Managed\Unity.Transforms.Hybrid.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Transforms.Hybrid.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Transforms.Hybrid.dll - ..\ref\Techblox_Data\Managed\Unity.VisualEffectGraph.Runtime.dll - ..\..\ref\Techblox_Data\Managed\Unity.VisualEffectGraph.Runtime.dll + ..\ref_TB\Techblox_Data\Managed\Unity.VisualEffectGraph.Runtime.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.VisualEffectGraph.Runtime.dll - ..\ref\Techblox_Data\Managed\UnityEngine.AccessibilityModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.AccessibilityModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.AccessibilityModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.AccessibilityModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.AIModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.AIModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.AIModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.AIModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.AndroidJNIModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.AndroidJNIModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.AndroidJNIModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.AndroidJNIModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.AnimationModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.AnimationModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.AnimationModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.AnimationModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.ARModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.ARModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.ARModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.ARModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.AssetBundleModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.AssetBundleModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.AssetBundleModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.AssetBundleModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.AudioModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.AudioModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.AudioModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.AudioModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.ClothModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.ClothModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.ClothModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.ClothModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.ClusterInputModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.ClusterInputModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.ClusterInputModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.ClusterInputModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.ClusterRendererModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.ClusterRendererModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.ClusterRendererModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.ClusterRendererModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.CoreModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.CoreModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.CoreModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.CoreModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.CrashReportingModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.CrashReportingModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.CrashReportingModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.CrashReportingModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.DirectorModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.DirectorModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.DirectorModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.DirectorModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.dll - ..\ref\Techblox_Data\Managed\UnityEngine.DSPGraphModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.DSPGraphModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.DSPGraphModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.DSPGraphModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.GameCenterModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.GameCenterModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.GameCenterModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.GameCenterModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.GIModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.GIModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.GIModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.GIModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.GridModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.GridModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.GridModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.GridModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.HotReloadModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.HotReloadModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.HotReloadModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.HotReloadModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.ImageConversionModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.ImageConversionModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.ImageConversionModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.ImageConversionModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.IMGUIModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.IMGUIModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.IMGUIModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.IMGUIModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.InputLegacyModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.InputLegacyModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.InputLegacyModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.InputLegacyModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.InputModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.InputModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.InputModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.InputModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.JSONSerializeModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.JSONSerializeModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.JSONSerializeModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.JSONSerializeModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.LocalizationModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.LocalizationModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.LocalizationModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.LocalizationModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.NVIDIAModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.NVIDIAModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.NVIDIAModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.NVIDIAModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.ParticleSystemModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.ParticleSystemModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.ParticleSystemModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.ParticleSystemModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.PerformanceReportingModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.PerformanceReportingModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.PerformanceReportingModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.PerformanceReportingModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.Physics2DModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.Physics2DModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.Physics2DModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.Physics2DModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.PhysicsModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.PhysicsModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.PhysicsModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.PhysicsModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.ProfilerModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.ProfilerModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.ProfilerModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.ProfilerModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.ScreenCaptureModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.ScreenCaptureModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.ScreenCaptureModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.ScreenCaptureModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.SharedInternalsModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.SharedInternalsModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.SharedInternalsModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.SharedInternalsModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.SpriteMaskModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.SpriteMaskModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.SpriteMaskModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.SpriteMaskModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.SpriteShapeModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.SpriteShapeModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.SpriteShapeModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.SpriteShapeModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.StreamingModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.StreamingModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.StreamingModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.StreamingModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.SubstanceModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.SubstanceModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.SubstanceModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.SubstanceModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.SubsystemsModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.SubsystemsModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.SubsystemsModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.SubsystemsModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.TerrainModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.TerrainModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.TerrainModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.TerrainModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.TerrainPhysicsModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.TerrainPhysicsModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.TerrainPhysicsModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.TerrainPhysicsModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.TextCoreFontEngineModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.TextCoreFontEngineModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.TextCoreFontEngineModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.TextCoreFontEngineModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.TextCoreTextEngineModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.TextCoreTextEngineModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.TextCoreTextEngineModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.TextCoreTextEngineModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.TextRenderingModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.TextRenderingModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.TextRenderingModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.TextRenderingModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.TilemapModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.TilemapModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.TilemapModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.TilemapModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.TLSModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.TLSModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.TLSModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.TLSModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.UI.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.UI.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.UI.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.UI.dll - ..\ref\Techblox_Data\Managed\UnityEngine.UIElementsModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.UIElementsModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.UIElementsModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.UIElementsModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.UIElementsNativeModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.UIElementsNativeModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.UIElementsNativeModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.UIElementsNativeModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.UIModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.UIModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.UIModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.UIModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.UmbraModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.UmbraModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.UmbraModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.UmbraModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.UNETModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.UNETModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.UNETModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.UNETModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.UnityAnalyticsModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.UnityAnalyticsModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.UnityAnalyticsModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.UnityAnalyticsModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.UnityConnectModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.UnityConnectModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.UnityConnectModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.UnityConnectModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.UnityCurlModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.UnityCurlModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.UnityCurlModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.UnityCurlModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.UnityTestProtocolModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.UnityTestProtocolModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.UnityTestProtocolModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.UnityTestProtocolModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.UnityWebRequestModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.UnityWebRequestModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.VehiclesModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.VehiclesModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.VehiclesModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.VehiclesModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.VFXModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.VFXModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.VFXModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.VFXModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.VideoModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.VideoModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.VideoModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.VideoModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.VirtualTexturingModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.VirtualTexturingModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.VirtualTexturingModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.VirtualTexturingModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.VRModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.VRModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.VRModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.VRModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.WindModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.WindModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.WindModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.WindModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.XRModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.XRModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.XRModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.XRModule.dll - ..\ref\Techblox_Data\Managed\VisualProfiler.dll - ..\..\ref\Techblox_Data\Managed\VisualProfiler.dll + ..\ref_TB\Techblox_Data\Managed\VisualProfiler.dll + ..\..\ref_TB\Techblox_Data\Managed\VisualProfiler.dll - ..\ref\Techblox_Data\Managed\websocket-sharp.dll - ..\..\ref\Techblox_Data\Managed\websocket-sharp.dll + ..\ref_TB\Techblox_Data\Managed\websocket-sharp.dll + ..\..\ref_TB\Techblox_Data\Managed\websocket-sharp.dll - ..\ref\Techblox_Data\Managed\ZFBrowser.dll - ..\..\ref\Techblox_Data\Managed\ZFBrowser.dll + ..\ref_TB\Techblox_Data\Managed\ZFBrowser.dll + ..\..\ref_TB\Techblox_Data\Managed\ZFBrowser.dll diff --git a/MakeEverythingPublicInGame/MakeEverythingPublicInGame.csproj b/MakeEverythingPublicInGame/MakeEverythingPublicInGame.csproj index 536fb28..dde2177 100644 --- a/MakeEverythingPublicInGame/MakeEverythingPublicInGame.csproj +++ b/MakeEverythingPublicInGame/MakeEverythingPublicInGame.csproj @@ -14,1560 +14,1560 @@ - ..\ref\Techblox_Data\Managed\IllusionInjector.dll - ..\..\ref\Techblox_Data\Managed\IllusionInjector.dll + ..\ref_TB\Techblox_Data\Managed\IllusionInjector.dll + ..\..\ref_TB\Techblox_Data\Managed\IllusionInjector.dll - ..\ref\Techblox_Data\Managed\IllusionPlugin.dll - ..\..\ref\Techblox_Data\Managed\IllusionPlugin.dll + ..\ref_TB\Techblox_Data\Managed\IllusionPlugin.dll + ..\..\ref_TB\Techblox_Data\Managed\IllusionPlugin.dll - ..\ref\Techblox_Data\Managed\Accessibility.dll - ..\..\ref\Techblox_Data\Managed\Accessibility.dll + ..\ref_TB\Techblox_Data\Managed\Accessibility.dll + ..\..\ref_TB\Techblox_Data\Managed\Accessibility.dll - ..\ref\Techblox_Data\Managed\Analytics.dll - ..\..\ref\Techblox_Data\Managed\Analytics.dll + ..\ref_TB\Techblox_Data\Managed\Analytics.dll + ..\..\ref_TB\Techblox_Data\Managed\Analytics.dll - ..\ref\Techblox_Data\Managed\Assembly-CSharp-firstpass.dll - ..\..\ref\Techblox_Data\Managed\Assembly-CSharp-firstpass.dll + ..\ref_TB\Techblox_Data\Managed\Assembly-CSharp-firstpass.dll + ..\..\ref_TB\Techblox_Data\Managed\Assembly-CSharp-firstpass.dll - ..\ref\Techblox_Data\Managed\Assembly-CSharp.dll - ..\..\ref\Techblox_Data\Managed\Assembly-CSharp.dll + ..\ref_TB\Techblox_Data\Managed\Assembly-CSharp.dll + ..\..\ref_TB\Techblox_Data\Managed\Assembly-CSharp.dll - ..\ref\Techblox_Data\Managed\AWSSDK.Core.dll - ..\..\ref\Techblox_Data\Managed\AWSSDK.Core.dll + ..\ref_TB\Techblox_Data\Managed\AWSSDK.Core.dll + ..\..\ref_TB\Techblox_Data\Managed\AWSSDK.Core.dll - ..\ref\Techblox_Data\Managed\AWSSDK.GameLift.dll - ..\..\ref\Techblox_Data\Managed\AWSSDK.GameLift.dll + ..\ref_TB\Techblox_Data\Managed\AWSSDK.GameLift.dll + ..\..\ref_TB\Techblox_Data\Managed\AWSSDK.GameLift.dll - ..\ref\Techblox_Data\Managed\BevelEffect.dll - ..\..\ref\Techblox_Data\Managed\BevelEffect.dll + ..\ref_TB\Techblox_Data\Managed\BevelEffect.dll + ..\..\ref_TB\Techblox_Data\Managed\BevelEffect.dll - ..\ref\Techblox_Data\Managed\Boxophobic.TheVehetationEngine.Runtime.dll - ..\..\ref\Techblox_Data\Managed\Boxophobic.TheVehetationEngine.Runtime.dll + ..\ref_TB\Techblox_Data\Managed\Boxophobic.TheVehetationEngine.Runtime.dll + ..\..\ref_TB\Techblox_Data\Managed\Boxophobic.TheVehetationEngine.Runtime.dll - ..\ref\Techblox_Data\Managed\Boxophobic.Utils.Scripts.dll - ..\..\ref\Techblox_Data\Managed\Boxophobic.Utils.Scripts.dll + ..\ref_TB\Techblox_Data\Managed\Boxophobic.Utils.Scripts.dll + ..\..\ref_TB\Techblox_Data\Managed\Boxophobic.Utils.Scripts.dll - ..\ref\Techblox_Data\Managed\DataLoader.dll - ..\..\ref\Techblox_Data\Managed\DataLoader.dll + ..\ref_TB\Techblox_Data\Managed\DataLoader.dll + ..\..\ref_TB\Techblox_Data\Managed\DataLoader.dll - ..\ref\Techblox_Data\Managed\DDNA.dll - ..\..\ref\Techblox_Data\Managed\DDNA.dll + ..\ref_TB\Techblox_Data\Managed\DDNA.dll + ..\..\ref_TB\Techblox_Data\Managed\DDNA.dll - ..\ref\Techblox_Data\Managed\EasyButtons.dll - ..\..\ref\Techblox_Data\Managed\EasyButtons.dll + ..\ref_TB\Techblox_Data\Managed\EasyButtons.dll + ..\..\ref_TB\Techblox_Data\Managed\EasyButtons.dll - ..\ref\Techblox_Data\Managed\EOSSDK.dll - ..\..\ref\Techblox_Data\Managed\EOSSDK.dll + ..\ref_TB\Techblox_Data\Managed\EOSSDK.dll + ..\..\ref_TB\Techblox_Data\Managed\EOSSDK.dll - ..\ref\Techblox_Data\Managed\FMODUnity.dll - ..\..\ref\Techblox_Data\Managed\FMODUnity.dll + ..\ref_TB\Techblox_Data\Managed\FMODUnity.dll + ..\..\ref_TB\Techblox_Data\Managed\FMODUnity.dll - ..\ref\Techblox_Data\Managed\FMODUnityResonance.dll - ..\..\ref\Techblox_Data\Managed\FMODUnityResonance.dll + ..\ref_TB\Techblox_Data\Managed\FMODUnityResonance.dll + ..\..\ref_TB\Techblox_Data\Managed\FMODUnityResonance.dll - ..\ref\Techblox_Data\Managed\FMODUnityWrapperClient.dll - ..\..\ref\Techblox_Data\Managed\FMODUnityWrapperClient.dll + ..\ref_TB\Techblox_Data\Managed\FMODUnityWrapperClient.dll + ..\..\ref_TB\Techblox_Data\Managed\FMODUnityWrapperClient.dll - ..\ref\Techblox_Data\Managed\FullGame.dll - ..\..\ref\Techblox_Data\Managed\FullGame.dll + ..\ref_TB\Techblox_Data\Managed\FullGame.dll + ..\..\ref_TB\Techblox_Data\Managed\FullGame.dll - ..\ref\Techblox_Data\Managed\Gamecraft.BlockEntityFactory.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.BlockEntityFactory.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.BlockEntityFactory.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.BlockEntityFactory.dll - ..\ref\Techblox_Data\Managed\Gamecraft.BlockGroups.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.BlockGroups.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.BlockGroups.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.BlockGroups.dll - ..\ref\Techblox_Data\Managed\Gamecraft.Blocks.LogicBlock.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.Blocks.LogicBlock.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.Blocks.LogicBlock.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.Blocks.LogicBlock.dll - ..\ref\Techblox_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll - ..\ref\Techblox_Data\Managed\Gamecraft.ColourPalette.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.ColourPalette.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.ColourPalette.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.ColourPalette.dll - ..\ref\Techblox_Data\Managed\Gamecraft.Damage.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.Damage.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.Damage.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.Damage.dll - ..\ref\Techblox_Data\Managed\Gamecraft.Effects.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.Effects.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.Effects.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.Effects.dll - ..\ref\Techblox_Data\Managed\Gamecraft.ExplosionFragments.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.ExplosionFragments.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.ExplosionFragments.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.ExplosionFragments.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GraphicsSettings.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GraphicsSettings.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.GraphicsSettings.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.GraphicsSettings.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.BlueprintInventory.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.BlueprintInventory.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.BlueprintInventory.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.BlueprintInventory.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.Blueprints.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.Blueprints.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.Blueprints.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.Blueprints.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.BlueprintSets.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.BlueprintSets.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.BlueprintSets.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.BlueprintSets.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.GameOptionsScreen.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.GameOptionsScreen.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.GameOptionsScreen.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.GameOptionsScreen.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.Blocks.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.Blocks.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.Blocks.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.Blocks.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.BlueprintsHotbar.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.BlueprintsHotbar.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.BlueprintsHotbar.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.BlueprintsHotbar.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.Colours.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.Colours.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.Colours.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.Colours.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.ModeBar.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.ModeBar.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.ModeBar.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.ModeBar.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.OptionsScreen.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.OptionsScreen.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.OptionsScreen.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.OptionsScreen.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Blocks.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Blocks.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Blocks.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Blocks.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Blueprints.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Blueprints.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Blueprints.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Blueprints.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Colours.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Colours.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Colours.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Colours.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Common.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Common.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Common.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Common.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.Tweaks.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.Tweaks.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.Tweaks.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.Tweaks.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.Wires.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.Wires.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.Wires.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.Wires.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll - ..\ref\Techblox_Data\Managed\Gamecraft.JointBlocks.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.JointBlocks.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.JointBlocks.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.JointBlocks.dll - ..\ref\Techblox_Data\Managed\Gamecraft.Music.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.Music.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.Music.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.Music.dll - ..\ref\Techblox_Data\Managed\Gamecraft.NetStrings.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.NetStrings.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.NetStrings.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.NetStrings.dll - ..\ref\Techblox_Data\Managed\Gamecraft.PickupsCommon.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.PickupsCommon.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.PickupsCommon.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.PickupsCommon.dll - ..\ref\Techblox_Data\Managed\Gamecraft.PopupMessage.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.PopupMessage.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.PopupMessage.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.PopupMessage.dll - ..\ref\Techblox_Data\Managed\Gamecraft.Serialization.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.Serialization.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.Serialization.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.Serialization.dll - ..\ref\Techblox_Data\Managed\Gamecraft.Tweaks.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.Tweaks.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.Tweaks.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.Tweaks.dll - ..\ref\Techblox_Data\Managed\Gamecraft.VisualEffects.Decals.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.VisualEffects.Decals.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.VisualEffects.Decals.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.VisualEffects.Decals.dll - ..\ref\Techblox_Data\Managed\Gamecraft.Wires.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.Wires.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.Wires.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.Wires.dll - ..\ref\Techblox_Data\Managed\GameLiftServerSDKNet45.dll - ..\..\ref\Techblox_Data\Managed\GameLiftServerSDKNet45.dll + ..\ref_TB\Techblox_Data\Managed\GameLiftServerSDKNet45.dll + ..\..\ref_TB\Techblox_Data\Managed\GameLiftServerSDKNet45.dll - ..\ref\Techblox_Data\Managed\GameState.dll - ..\..\ref\Techblox_Data\Managed\GameState.dll + ..\ref_TB\Techblox_Data\Managed\GameState.dll + ..\..\ref_TB\Techblox_Data\Managed\GameState.dll - ..\ref\Techblox_Data\Managed\GhostShark.Outline.dll - ..\..\ref\Techblox_Data\Managed\GhostShark.Outline.dll + ..\ref_TB\Techblox_Data\Managed\GhostShark.Outline.dll + ..\..\ref_TB\Techblox_Data\Managed\GhostShark.Outline.dll - ..\ref\Techblox_Data\Managed\Google.Protobuf.dll - ..\..\ref\Techblox_Data\Managed\Google.Protobuf.dll + ..\ref_TB\Techblox_Data\Managed\Google.Protobuf.dll + ..\..\ref_TB\Techblox_Data\Managed\Google.Protobuf.dll - ..\ref\Techblox_Data\Managed\GPUInstancer.CrowdAnimations.dll - ..\..\ref\Techblox_Data\Managed\GPUInstancer.CrowdAnimations.dll + ..\ref_TB\Techblox_Data\Managed\GPUInstancer.CrowdAnimations.dll + ..\..\ref_TB\Techblox_Data\Managed\GPUInstancer.CrowdAnimations.dll - ..\ref\Techblox_Data\Managed\GPUInstancer.dll - ..\..\ref\Techblox_Data\Managed\GPUInstancer.dll + ..\ref_TB\Techblox_Data\Managed\GPUInstancer.dll + ..\..\ref_TB\Techblox_Data\Managed\GPUInstancer.dll - ..\ref\Techblox_Data\Managed\Havok.Physics.dll - ..\..\ref\Techblox_Data\Managed\Havok.Physics.dll + ..\ref_TB\Techblox_Data\Managed\Havok.Physics.dll + ..\..\ref_TB\Techblox_Data\Managed\Havok.Physics.dll - ..\ref\Techblox_Data\Managed\Havok.Physics.Hybrid.dll - ..\..\ref\Techblox_Data\Managed\Havok.Physics.Hybrid.dll + ..\ref_TB\Techblox_Data\Managed\Havok.Physics.Hybrid.dll + ..\..\ref_TB\Techblox_Data\Managed\Havok.Physics.Hybrid.dll - ..\ref\Techblox_Data\Managed\LiteNetLib.dll - ..\..\ref\Techblox_Data\Managed\LiteNetLib.dll + ..\ref_TB\Techblox_Data\Managed\LiteNetLib.dll + ..\..\ref_TB\Techblox_Data\Managed\LiteNetLib.dll - ..\ref\Techblox_Data\Managed\log4net.dll - ..\..\ref\Techblox_Data\Managed\log4net.dll + ..\ref_TB\Techblox_Data\Managed\log4net.dll + ..\..\ref_TB\Techblox_Data\Managed\log4net.dll - ..\ref\Techblox_Data\Managed\LZ4.dll - ..\..\ref\Techblox_Data\Managed\LZ4.dll + ..\ref_TB\Techblox_Data\Managed\LZ4.dll + ..\..\ref_TB\Techblox_Data\Managed\LZ4.dll - ..\ref\Techblox_Data\Managed\Monobehaviours.dll - ..\..\ref\Techblox_Data\Managed\Monobehaviours.dll + ..\ref_TB\Techblox_Data\Managed\Monobehaviours.dll + ..\..\ref_TB\Techblox_Data\Managed\Monobehaviours.dll - ..\ref\Techblox_Data\Managed\mscorlib.dll - ..\..\ref\Techblox_Data\Managed\mscorlib.dll + ..\ref_TB\Techblox_Data\Managed\mscorlib.dll + ..\..\ref_TB\Techblox_Data\Managed\mscorlib.dll - ..\ref\Techblox_Data\Managed\MultiplayerNetworking.dll - ..\..\ref\Techblox_Data\Managed\MultiplayerNetworking.dll + ..\ref_TB\Techblox_Data\Managed\MultiplayerNetworking.dll + ..\..\ref_TB\Techblox_Data\Managed\MultiplayerNetworking.dll - ..\ref\Techblox_Data\Managed\Newtonsoft.Json.dll - ..\..\ref\Techblox_Data\Managed\Newtonsoft.Json.dll + ..\ref_TB\Techblox_Data\Managed\Newtonsoft.Json.dll + ..\..\ref_TB\Techblox_Data\Managed\Newtonsoft.Json.dll - ..\ref\Techblox_Data\Managed\Novell.Directory.Ldap.dll - ..\..\ref\Techblox_Data\Managed\Novell.Directory.Ldap.dll + ..\ref_TB\Techblox_Data\Managed\Novell.Directory.Ldap.dll + ..\..\ref_TB\Techblox_Data\Managed\Novell.Directory.Ldap.dll - ..\ref\Techblox_Data\Managed\Prometheus.NetStandard.dll - ..\..\ref\Techblox_Data\Managed\Prometheus.NetStandard.dll + ..\ref_TB\Techblox_Data\Managed\Prometheus.NetStandard.dll + ..\..\ref_TB\Techblox_Data\Managed\Prometheus.NetStandard.dll - ..\ref\Techblox_Data\Managed\RCX.ScreenshotTaker.dll - ..\..\ref\Techblox_Data\Managed\RCX.ScreenshotTaker.dll + ..\ref_TB\Techblox_Data\Managed\RCX.ScreenshotTaker.dll + ..\..\ref_TB\Techblox_Data\Managed\RCX.ScreenshotTaker.dll - ..\ref\Techblox_Data\Managed\Rewired_Core.dll - ..\..\ref\Techblox_Data\Managed\Rewired_Core.dll + ..\ref_TB\Techblox_Data\Managed\Rewired_Core.dll + ..\..\ref_TB\Techblox_Data\Managed\Rewired_Core.dll - ..\ref\Techblox_Data\Managed\Rewired_Windows.dll - ..\..\ref\Techblox_Data\Managed\Rewired_Windows.dll + ..\ref_TB\Techblox_Data\Managed\Rewired_Windows.dll + ..\..\ref_TB\Techblox_Data\Managed\Rewired_Windows.dll - ..\ref\Techblox_Data\Managed\RichFX.dll - ..\..\ref\Techblox_Data\Managed\RichFX.dll + ..\ref_TB\Techblox_Data\Managed\RichFX.dll + ..\..\ref_TB\Techblox_Data\Managed\RichFX.dll - ..\ref\Techblox_Data\Managed\RobocraftECS.dll - ..\..\ref\Techblox_Data\Managed\RobocraftECS.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftECS.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftECS.dll - ..\ref\Techblox_Data\Managed\RobocraftX.AccountPreferences.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.AccountPreferences.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.AccountPreferences.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.AccountPreferences.dll - ..\ref\Techblox_Data\Managed\RobocraftX.Blocks.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.Blocks.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.Blocks.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.Blocks.dll - ..\ref\Techblox_Data\Managed\RobocraftX.Blocks.Ghost.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.Blocks.Ghost.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.Blocks.Ghost.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.Blocks.Ghost.dll - ..\ref\Techblox_Data\Managed\RobocraftX.Blocks.Triggers.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.Blocks.Triggers.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.Blocks.Triggers.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.Blocks.Triggers.dll - ..\ref\Techblox_Data\Managed\RobocraftX.Building.BoxSelect.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.Building.BoxSelect.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.Building.BoxSelect.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.Building.BoxSelect.dll - ..\ref\Techblox_Data\Managed\RobocraftX.Building.Jobs.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.Building.Jobs.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.Building.Jobs.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.Building.Jobs.dll - ..\ref\Techblox_Data\Managed\RobocraftX.Character.Audio.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.Character.Audio.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.Character.Audio.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.Character.Audio.dll - ..\ref\Techblox_Data\Managed\RobocraftX.Character.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.Character.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.Character.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.Character.dll - ..\ref\Techblox_Data\Managed\RobocraftX.Common.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.Common.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.Common.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.Common.dll - ..\ref\Techblox_Data\Managed\RobocraftX.ControlsScreen.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.ControlsScreen.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.ControlsScreen.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.ControlsScreen.dll - ..\ref\Techblox_Data\Managed\RobocraftX.Crosshair.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.Crosshair.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.Crosshair.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.Crosshair.dll - ..\ref\Techblox_Data\Managed\RobocraftX.FrontEnd.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.FrontEnd.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.FrontEnd.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.FrontEnd.dll - ..\ref\Techblox_Data\Managed\RobocraftX.GUI.DebugDisplay.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.DebugDisplay.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.GUI.DebugDisplay.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.GUI.DebugDisplay.dll - ..\ref\Techblox_Data\Managed\RobocraftX.GUI.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.GUI.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.GUI.dll - ..\ref\Techblox_Data\Managed\RobocraftX.GUI.Hotbar.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.Hotbar.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.GUI.Hotbar.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.GUI.Hotbar.dll - ..\ref\Techblox_Data\Managed\RobocraftX.GUI.Inventory.BlocksInventory.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.Inventory.BlocksInventory.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.GUI.Inventory.BlocksInventory.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.GUI.Inventory.BlocksInventory.dll - ..\ref\Techblox_Data\Managed\RobocraftX.GUI.Inventory.ColourInventory.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.Inventory.ColourInventory.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.GUI.Inventory.ColourInventory.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.GUI.Inventory.ColourInventory.dll - ..\ref\Techblox_Data\Managed\RobocraftX.GUI.Inventory.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.Inventory.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.GUI.Inventory.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.GUI.Inventory.dll - ..\ref\Techblox_Data\Managed\RobocraftX.GUI.QuitConfirmation.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.QuitConfirmation.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.GUI.QuitConfirmation.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.GUI.QuitConfirmation.dll - ..\ref\Techblox_Data\Managed\RobocraftX.GUI.ScaleGhost.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.ScaleGhost.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.GUI.ScaleGhost.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.GUI.ScaleGhost.dll - ..\ref\Techblox_Data\Managed\RobocraftX.GUI.TabsBar.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.TabsBar.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.GUI.TabsBar.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.GUI.TabsBar.dll - ..\ref\Techblox_Data\Managed\RobocraftX.Input.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.Input.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.Input.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.Input.dll - ..\ref\Techblox_Data\Managed\RobocraftX.MachineEditor.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.MachineEditor.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.MachineEditor.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.MachineEditor.dll - ..\ref\Techblox_Data\Managed\RobocraftX.MainGame.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.MainGame.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.MainGame.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.MainGame.dll - ..\ref\Techblox_Data\Managed\RobocraftX.MainSimulation.Audio.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.MainSimulation.Audio.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.MainSimulation.Audio.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.MainSimulation.Audio.dll - ..\ref\Techblox_Data\Managed\RobocraftX.MainSimulation.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.MainSimulation.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.MainSimulation.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.MainSimulation.dll - ..\ref\Techblox_Data\Managed\RobocraftX.Multiplayer.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.Multiplayer.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.Multiplayer.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.Multiplayer.dll - ..\ref\Techblox_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll - ..\ref\Techblox_Data\Managed\RobocraftX.Multiplayer.Serializers.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.Multiplayer.Serializers.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.Multiplayer.Serializers.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.Multiplayer.Serializers.dll - ..\ref\Techblox_Data\Managed\RobocraftX.MultiplayerInput.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.MultiplayerInput.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.MultiplayerInput.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.MultiplayerInput.dll - ..\ref\Techblox_Data\Managed\RobocraftX.ObjectIdBlocks.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.ObjectIdBlocks.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.ObjectIdBlocks.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.ObjectIdBlocks.dll - ..\ref\Techblox_Data\Managed\RobocraftX.Physics.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.Physics.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.Physics.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.Physics.dll - ..\ref\Techblox_Data\Managed\RobocraftX.PilotSeat.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.PilotSeat.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.PilotSeat.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.PilotSeat.dll - ..\ref\Techblox_Data\Managed\RobocraftX.Player.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.Player.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.Player.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.Player.dll - ..\ref\Techblox_Data\Managed\RobocraftX.SaveAndLoad.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.SaveAndLoad.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.SaveAndLoad.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.SaveAndLoad.dll - ..\ref\Techblox_Data\Managed\RobocraftX.SaveGameDialog.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.SaveGameDialog.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.SaveGameDialog.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.SaveGameDialog.dll - ..\ref\Techblox_Data\Managed\RobocraftX.Services.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.Services.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.Services.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.Services.dll - ..\ref\Techblox_Data\Managed\RobocraftX.SignalHandling.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.SignalHandling.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.SignalHandling.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.SignalHandling.dll - ..\ref\Techblox_Data\Managed\RobocraftX.StateSync.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.StateSync.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.StateSync.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.StateSync.dll - ..\ref\Techblox_Data\Managed\Serilog.dll - ..\..\ref\Techblox_Data\Managed\Serilog.dll + ..\ref_TB\Techblox_Data\Managed\Serilog.dll + ..\..\ref_TB\Techblox_Data\Managed\Serilog.dll - ..\ref\Techblox_Data\Managed\Serilog.Sinks.Grafana.Loki.dll - ..\..\ref\Techblox_Data\Managed\Serilog.Sinks.Grafana.Loki.dll + ..\ref_TB\Techblox_Data\Managed\Serilog.Sinks.Grafana.Loki.dll + ..\..\ref_TB\Techblox_Data\Managed\Serilog.Sinks.Grafana.Loki.dll - ..\ref\Techblox_Data\Managed\ShaderVariantsGenerationTool.dll - ..\..\ref\Techblox_Data\Managed\ShaderVariantsGenerationTool.dll + ..\ref_TB\Techblox_Data\Managed\ShaderVariantsGenerationTool.dll + ..\..\ref_TB\Techblox_Data\Managed\ShaderVariantsGenerationTool.dll - ..\ref\Techblox_Data\Managed\SpecializedDescriptors.dll - ..\..\ref\Techblox_Data\Managed\SpecializedDescriptors.dll + ..\ref_TB\Techblox_Data\Managed\SpecializedDescriptors.dll + ..\..\ref_TB\Techblox_Data\Managed\SpecializedDescriptors.dll - ..\ref\Techblox_Data\Managed\StringFormatter.dll - ..\..\ref\Techblox_Data\Managed\StringFormatter.dll + ..\ref_TB\Techblox_Data\Managed\StringFormatter.dll + ..\..\ref_TB\Techblox_Data\Managed\StringFormatter.dll - ..\ref\Techblox_Data\Managed\Svelto.Common.dll - ..\..\ref\Techblox_Data\Managed\Svelto.Common.dll + ..\ref_TB\Techblox_Data\Managed\Svelto.Common.dll + ..\..\ref_TB\Techblox_Data\Managed\Svelto.Common.dll - ..\ref\Techblox_Data\Managed\Svelto.ECS.dll - ..\..\ref\Techblox_Data\Managed\Svelto.ECS.dll + ..\ref_TB\Techblox_Data\Managed\Svelto.ECS.dll + ..\..\ref_TB\Techblox_Data\Managed\Svelto.ECS.dll - ..\ref\Techblox_Data\Managed\Svelto.ECS.GUI.dll - ..\..\ref\Techblox_Data\Managed\Svelto.ECS.GUI.dll + ..\ref_TB\Techblox_Data\Managed\Svelto.ECS.GUI.dll + ..\..\ref_TB\Techblox_Data\Managed\Svelto.ECS.GUI.dll - ..\ref\Techblox_Data\Managed\Svelto.Services.dll - ..\..\ref\Techblox_Data\Managed\Svelto.Services.dll + ..\ref_TB\Techblox_Data\Managed\Svelto.Services.dll + ..\..\ref_TB\Techblox_Data\Managed\Svelto.Services.dll - ..\ref\Techblox_Data\Managed\Svelto.Tasks.dll - ..\..\ref\Techblox_Data\Managed\Svelto.Tasks.dll + ..\ref_TB\Techblox_Data\Managed\Svelto.Tasks.dll + ..\..\ref_TB\Techblox_Data\Managed\Svelto.Tasks.dll - ..\ref\Techblox_Data\Managed\Techblox.AdditionalParts.dll - ..\..\ref\Techblox_Data\Managed\Techblox.AdditionalParts.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.AdditionalParts.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.AdditionalParts.dll - ..\ref\Techblox_Data\Managed\Techblox.AntiAFKServer.dll - ..\..\ref\Techblox_Data\Managed\Techblox.AntiAFKServer.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.AntiAFKServer.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.AntiAFKServer.dll - ..\ref\Techblox_Data\Managed\Techblox.Anticheat.Client.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Anticheat.Client.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Anticheat.Client.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Anticheat.Client.dll - ..\ref\Techblox_Data\Managed\Techblox.Anticheat.Common.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Anticheat.Common.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Anticheat.Common.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Anticheat.Common.dll - ..\ref\Techblox_Data\Managed\Techblox.AtmosphereBlock.dll - ..\..\ref\Techblox_Data\Managed\Techblox.AtmosphereBlock.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.AtmosphereBlock.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.AtmosphereBlock.dll - ..\ref\Techblox_Data\Managed\Techblox.AudioBlocks.dll - ..\..\ref\Techblox_Data\Managed\Techblox.AudioBlocks.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.AudioBlocks.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.AudioBlocks.dll - ..\ref\Techblox_Data\Managed\Techblox.AudioBlocksClient.dll - ..\..\ref\Techblox_Data\Managed\Techblox.AudioBlocksClient.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.AudioBlocksClient.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.AudioBlocksClient.dll - ..\ref\Techblox_Data\Managed\Techblox.AutoForward.dll - ..\..\ref\Techblox_Data\Managed\Techblox.AutoForward.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.AutoForward.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.AutoForward.dll - ..\ref\Techblox_Data\Managed\Techblox.Backend.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Backend.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Backend.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Backend.dll - ..\ref\Techblox_Data\Managed\Techblox.BitBlock.dll - ..\..\ref\Techblox_Data\Managed\Techblox.BitBlock.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.BitBlock.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.BitBlock.dll - ..\ref\Techblox_Data\Managed\Techblox.BlockColours.dll - ..\..\ref\Techblox_Data\Managed\Techblox.BlockColours.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.BlockColours.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.BlockColours.dll - ..\ref\Techblox_Data\Managed\Techblox.BlockLabels.dll - ..\..\ref\Techblox_Data\Managed\Techblox.BlockLabels.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.BlockLabels.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.BlockLabels.dll - ..\ref\Techblox_Data\Managed\Techblox.BlockLabelsServer.dll - ..\..\ref\Techblox_Data\Managed\Techblox.BlockLabelsServer.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.BlockLabelsServer.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.BlockLabelsServer.dll - ..\ref\Techblox_Data\Managed\Techblox.Blocks.Connections.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Blocks.Connections.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Blocks.Connections.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Blocks.Connections.dll - ..\ref\Techblox_Data\Managed\Techblox.Blocks.LightBlock.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Blocks.LightBlock.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Blocks.LightBlock.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Blocks.LightBlock.dll - ..\ref\Techblox_Data\Managed\Techblox.Building.Rules.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Building.Rules.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Building.Rules.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Building.Rules.dll - ..\ref\Techblox_Data\Managed\Techblox.Building.Shift.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Building.Shift.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Building.Shift.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Building.Shift.dll - ..\ref\Techblox_Data\Managed\Techblox.BuildingDrone.dll - ..\..\ref\Techblox_Data\Managed\Techblox.BuildingDrone.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.BuildingDrone.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.BuildingDrone.dll - ..\ref\Techblox_Data\Managed\Techblox.Camera.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Camera.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Camera.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Camera.dll - ..\ref\Techblox_Data\Managed\Techblox.CentreHUDBlock.dll - ..\..\ref\Techblox_Data\Managed\Techblox.CentreHUDBlock.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.CentreHUDBlock.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.CentreHUDBlock.dll - ..\ref\Techblox_Data\Managed\Techblox.CentreHUDGUI.dll - ..\..\ref\Techblox_Data\Managed\Techblox.CentreHUDGUI.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.CentreHUDGUI.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.CentreHUDGUI.dll - ..\ref\Techblox_Data\Managed\Techblox.CharacterDamage.Client.dll - ..\..\ref\Techblox_Data\Managed\Techblox.CharacterDamage.Client.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.CharacterDamage.Client.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.CharacterDamage.Client.dll - ..\ref\Techblox_Data\Managed\Techblox.CharacterDamage.Server.dll - ..\..\ref\Techblox_Data\Managed\Techblox.CharacterDamage.Server.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.CharacterDamage.Server.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.CharacterDamage.Server.dll - ..\ref\Techblox_Data\Managed\Techblox.CharacterRespawnScreen.dll - ..\..\ref\Techblox_Data\Managed\Techblox.CharacterRespawnScreen.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.CharacterRespawnScreen.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.CharacterRespawnScreen.dll - ..\ref\Techblox_Data\Managed\Techblox.CheckpointBlock.dll - ..\..\ref\Techblox_Data\Managed\Techblox.CheckpointBlock.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.CheckpointBlock.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.CheckpointBlock.dll - ..\ref\Techblox_Data\Managed\Techblox.CheckpointBlockClient.dll - ..\..\ref\Techblox_Data\Managed\Techblox.CheckpointBlockClient.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.CheckpointBlockClient.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.CheckpointBlockClient.dll - ..\ref\Techblox_Data\Managed\Techblox.Common.Audio.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Common.Audio.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Common.Audio.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Common.Audio.dll - ..\ref\Techblox_Data\Managed\Techblox.ConstantBlockClient.dll - ..\..\ref\Techblox_Data\Managed\Techblox.ConstantBlockClient.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.ConstantBlockClient.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.ConstantBlockClient.dll - ..\ref\Techblox_Data\Managed\Techblox.ConstantBlockServer.dll - ..\..\ref\Techblox_Data\Managed\Techblox.ConstantBlockServer.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.ConstantBlockServer.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.ConstantBlockServer.dll - ..\ref\Techblox_Data\Managed\Techblox.ContextSensitiveTextHint.dll - ..\..\ref\Techblox_Data\Managed\Techblox.ContextSensitiveTextHint.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.ContextSensitiveTextHint.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.ContextSensitiveTextHint.dll - ..\ref\Techblox_Data\Managed\Techblox.CounterBlockClient.dll - ..\..\ref\Techblox_Data\Managed\Techblox.CounterBlockClient.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.CounterBlockClient.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.CounterBlockClient.dll - ..\ref\Techblox_Data\Managed\Techblox.CounterBlockServer.dll - ..\..\ref\Techblox_Data\Managed\Techblox.CounterBlockServer.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.CounterBlockServer.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.CounterBlockServer.dll - ..\ref\Techblox_Data\Managed\Techblox.DamageRbScoreBlockServerServer.dll - ..\..\ref\Techblox_Data\Managed\Techblox.DamageRbScoreBlockServerServer.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.DamageRbScoreBlockServerServer.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.DamageRbScoreBlockServerServer.dll - ..\ref\Techblox_Data\Managed\Techblox.DirectionalDamageVingette.dll - ..\..\ref\Techblox_Data\Managed\Techblox.DirectionalDamageVingette.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.DirectionalDamageVingette.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.DirectionalDamageVingette.dll - ..\ref\Techblox_Data\Managed\Techblox.DistanceSensorBlock.dll - ..\..\ref\Techblox_Data\Managed\Techblox.DistanceSensorBlock.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.DistanceSensorBlock.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.DistanceSensorBlock.dll - ..\ref\Techblox_Data\Managed\Techblox.ECSResourceManagers.dll - ..\..\ref\Techblox_Data\Managed\Techblox.ECSResourceManagers.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.ECSResourceManagers.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.ECSResourceManagers.dll - ..\ref\Techblox_Data\Managed\Techblox.EngineBlock.dll - ..\..\ref\Techblox_Data\Managed\Techblox.EngineBlock.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.EngineBlock.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.EngineBlock.dll - ..\ref\Techblox_Data\Managed\Techblox.EnvironmentBlocks.BuildingEnvironment.dll - ..\..\ref\Techblox_Data\Managed\Techblox.EnvironmentBlocks.BuildingEnvironment.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.EnvironmentBlocks.BuildingEnvironment.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.EnvironmentBlocks.BuildingEnvironment.dll - ..\ref\Techblox_Data\Managed\Techblox.EnvironmentBlocks.dll - ..\..\ref\Techblox_Data\Managed\Techblox.EnvironmentBlocks.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.EnvironmentBlocks.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.EnvironmentBlocks.dll - ..\ref\Techblox_Data\Managed\Techblox.EnvironmentBlocks.SimulationWorldEnvironment.dll - ..\..\ref\Techblox_Data\Managed\Techblox.EnvironmentBlocks.SimulationWorldEnvironment.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.EnvironmentBlocks.SimulationWorldEnvironment.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.EnvironmentBlocks.SimulationWorldEnvironment.dll - ..\ref\Techblox_Data\Managed\Techblox.Gameplay.Client.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.Client.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.Client.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.Client.dll - ..\ref\Techblox_Data\Managed\Techblox.Gameplay.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.dll - ..\ref\Techblox_Data\Managed\Techblox.Gameplay.GameState.Client.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.GameState.Client.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.GameState.Client.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.GameState.Client.dll - ..\ref\Techblox_Data\Managed\Techblox.Gameplay.GameState.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.GameState.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.GameState.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.GameState.dll - ..\ref\Techblox_Data\Managed\Techblox.Gameplay.PlayerGameplayDetails.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.PlayerGameplayDetails.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.PlayerGameplayDetails.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.PlayerGameplayDetails.dll - ..\ref\Techblox_Data\Managed\Techblox.Gameplay.Score.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.Score.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.Score.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.Score.dll - ..\ref\Techblox_Data\Managed\Techblox.Gameplay.Spawning.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.Spawning.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.Spawning.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.Spawning.dll - ..\ref\Techblox_Data\Managed\Techblox.Gameplay.Teams.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.Teams.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.Teams.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.Teams.dll - ..\ref\Techblox_Data\Managed\Techblox.Gameplay.WorldResetting.Client.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.WorldResetting.Client.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.WorldResetting.Client.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.WorldResetting.Client.dll - ..\ref\Techblox_Data\Managed\Techblox.Gameplay.WorldResetting.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.WorldResetting.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.WorldResetting.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.WorldResetting.dll - ..\ref\Techblox_Data\Managed\Techblox.GameSelection.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GameSelection.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GameSelection.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GameSelection.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.Building.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Building.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Building.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Building.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.BuildRules.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.BuildRules.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.BuildRules.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.BuildRules.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.CharacterHealthFeedback.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.CharacterHealthFeedback.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.CharacterHealthFeedback.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.CharacterHealthFeedback.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.Collection.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Collection.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Collection.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Collection.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.Controls.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Controls.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Controls.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Controls.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.GamePortal.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.GamePortal.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.GamePortal.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.GamePortal.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.GeneralSettingsScreen.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.GeneralSettingsScreen.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.GeneralSettingsScreen.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.GeneralSettingsScreen.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.Hotbar.Landscapes.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Hotbar.Landscapes.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Hotbar.Landscapes.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Hotbar.Landscapes.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.Hotbar.Materials.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Hotbar.Materials.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Hotbar.Materials.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Hotbar.Materials.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.Inventory.Common.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Inventory.Common.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Inventory.Common.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Inventory.Common.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.Inventory.Landscapes.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Inventory.Landscapes.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Inventory.Landscapes.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Inventory.Landscapes.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.Inventory.Materials.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Inventory.Materials.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Inventory.Materials.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Inventory.Materials.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.LoadingBar.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.LoadingBar.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.LoadingBar.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.LoadingBar.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.Login.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Login.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Login.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Login.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.MachineReconstructTimer.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.MachineReconstructTimer.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.MachineReconstructTimer.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.MachineReconstructTimer.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.MainGame.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.MainGame.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.MainGame.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.MainGame.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.MainGame.StateMachine.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.MainGame.StateMachine.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.MainGame.StateMachine.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.MainGame.StateMachine.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.MyGamesScreen.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.MyGamesScreen.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.MyGamesScreen.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.MyGamesScreen.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.PauseMenu.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.PauseMenu.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.PauseMenu.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.PauseMenu.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.Progression.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Progression.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Progression.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Progression.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.TabsBar.Landscapes.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.TabsBar.Landscapes.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.TabsBar.Landscapes.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.TabsBar.Landscapes.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.TabsBar.Materials.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.TabsBar.Materials.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.TabsBar.Materials.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.TabsBar.Materials.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.UsernameDisplay.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.UsernameDisplay.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.UsernameDisplay.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.UsernameDisplay.dll - ..\ref\Techblox_Data\Managed\Techblox.InputCapture.dll - ..\..\ref\Techblox_Data\Managed\Techblox.InputCapture.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.InputCapture.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.InputCapture.dll - ..\ref\Techblox_Data\Managed\Techblox.JetBlock.dll - ..\..\ref\Techblox_Data\Managed\Techblox.JetBlock.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.JetBlock.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.JetBlock.dll - ..\ref\Techblox_Data\Managed\Techblox.JetBlockClient.dll - ..\..\ref\Techblox_Data\Managed\Techblox.JetBlockClient.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.JetBlockClient.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.JetBlockClient.dll - ..\ref\Techblox_Data\Managed\Techblox.KillScoreBlock.dll - ..\..\ref\Techblox_Data\Managed\Techblox.KillScoreBlock.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.KillScoreBlock.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.KillScoreBlock.dll - ..\ref\Techblox_Data\Managed\Techblox.MachineProcessingService.dll - ..\..\ref\Techblox_Data\Managed\Techblox.MachineProcessingService.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.MachineProcessingService.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.MachineProcessingService.dll - ..\ref\Techblox_Data\Managed\Techblox.MachineSimulationPreprocessing.dll - ..\..\ref\Techblox_Data\Managed\Techblox.MachineSimulationPreprocessing.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.MachineSimulationPreprocessing.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.MachineSimulationPreprocessing.dll - ..\ref\Techblox_Data\Managed\Techblox.MachineSpawning.dll - ..\..\ref\Techblox_Data\Managed\Techblox.MachineSpawning.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.MachineSpawning.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.MachineSpawning.dll - ..\ref\Techblox_Data\Managed\Techblox.MachineVelocityCameraEffects.dll - ..\..\ref\Techblox_Data\Managed\Techblox.MachineVelocityCameraEffects.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.MachineVelocityCameraEffects.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.MachineVelocityCameraEffects.dll - ..\ref\Techblox_Data\Managed\Techblox.Matchmaking.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Matchmaking.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Matchmaking.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Matchmaking.dll - ..\ref\Techblox_Data\Managed\Techblox.Monitoring.Server.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Monitoring.Server.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Monitoring.Server.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Monitoring.Server.dll - ..\ref\Techblox_Data\Managed\Techblox.Multiplayer.UsernameMessages.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Multiplayer.UsernameMessages.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Multiplayer.UsernameMessages.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Multiplayer.UsernameMessages.dll - ..\ref\Techblox_Data\Managed\Techblox.ObjectIDBlockClient.dll - ..\..\ref\Techblox_Data\Managed\Techblox.ObjectIDBlockClient.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.ObjectIDBlockClient.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.ObjectIDBlockClient.dll - ..\ref\Techblox_Data\Managed\Techblox.ObjectIDBlockServer.dll - ..\..\ref\Techblox_Data\Managed\Techblox.ObjectIDBlockServer.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.ObjectIDBlockServer.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.ObjectIDBlockServer.dll - ..\ref\Techblox_Data\Managed\Techblox.Particles.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Particles.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Particles.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Particles.dll - ..\ref\Techblox_Data\Managed\Techblox.PlayUX.dll - ..\..\ref\Techblox_Data\Managed\Techblox.PlayUX.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.PlayUX.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.PlayUX.dll - ..\ref\Techblox_Data\Managed\Techblox.Pointer.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Pointer.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Pointer.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Pointer.dll - ..\ref\Techblox_Data\Managed\Techblox.ProceduralReflectionProbes.dll - ..\..\ref\Techblox_Data\Managed\Techblox.ProceduralReflectionProbes.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.ProceduralReflectionProbes.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.ProceduralReflectionProbes.dll - ..\ref\Techblox_Data\Managed\Techblox.Rendering.Common.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Rendering.Common.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Rendering.Common.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Rendering.Common.dll - ..\ref\Techblox_Data\Managed\Techblox.Rendering.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Rendering.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Rendering.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Rendering.dll - ..\ref\Techblox_Data\Managed\Techblox.Rendering.DOTS.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Rendering.DOTS.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Rendering.DOTS.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Rendering.DOTS.dll - ..\ref\Techblox_Data\Managed\Techblox.Rendering.GPUI.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Rendering.GPUI.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Rendering.GPUI.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Rendering.GPUI.dll - ..\ref\Techblox_Data\Managed\Techblox.Rendering.Unity.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Rendering.Unity.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Rendering.Unity.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Rendering.Unity.dll - ..\ref\Techblox_Data\Managed\Techblox.SaveGamesConversion.dll - ..\..\ref\Techblox_Data\Managed\Techblox.SaveGamesConversion.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.SaveGamesConversion.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.SaveGamesConversion.dll - ..\ref\Techblox_Data\Managed\Techblox.ScoreHUDBlock.dll - ..\..\ref\Techblox_Data\Managed\Techblox.ScoreHUDBlock.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.ScoreHUDBlock.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.ScoreHUDBlock.dll - ..\ref\Techblox_Data\Managed\Techblox.ScoreHUDGUI.dll - ..\..\ref\Techblox_Data\Managed\Techblox.ScoreHUDGUI.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.ScoreHUDGUI.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.ScoreHUDGUI.dll - ..\ref\Techblox_Data\Managed\Techblox.ScorePickupBlockClient.dll - ..\..\ref\Techblox_Data\Managed\Techblox.ScorePickupBlockClient.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.ScorePickupBlockClient.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.ScorePickupBlockClient.dll - ..\ref\Techblox_Data\Managed\Techblox.ScorePickupBlockServer.dll - ..\..\ref\Techblox_Data\Managed\Techblox.ScorePickupBlockServer.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.ScorePickupBlockServer.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.ScorePickupBlockServer.dll - ..\ref\Techblox_Data\Managed\Techblox.Server.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Server.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Server.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Server.dll - ..\ref\Techblox_Data\Managed\Techblox.Services.Anticheat.Client.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Services.Anticheat.Client.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Services.Anticheat.Client.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Services.Anticheat.Client.dll - ..\ref\Techblox_Data\Managed\Techblox.Services.Eos.Common.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Services.Eos.Common.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Services.Eos.Common.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Services.Eos.Common.dll - ..\ref\Techblox_Data\Managed\Techblox.Services.Eos.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Services.Eos.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Services.Eos.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Services.Eos.dll - ..\ref\Techblox_Data\Managed\Techblox.Services.GameDetails.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Services.GameDetails.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Services.GameDetails.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Services.GameDetails.dll - ..\ref\Techblox_Data\Managed\Techblox.Services.LocalPreferences.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Services.LocalPreferences.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Services.LocalPreferences.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Services.LocalPreferences.dll - ..\ref\Techblox_Data\Managed\Techblox.Services.Matchmaking.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Services.Matchmaking.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Services.Matchmaking.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Services.Matchmaking.dll - ..\ref\Techblox_Data\Managed\Techblox.Services.Metrics.Server.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Services.Metrics.Server.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Services.Metrics.Server.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Services.Metrics.Server.dll - ..\ref\Techblox_Data\Managed\Techblox.Services.Progression.Client.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Services.Progression.Client.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Services.Progression.Client.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Services.Progression.Client.dll - ..\ref\Techblox_Data\Managed\Techblox.Services.Progression.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Services.Progression.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Services.Progression.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Services.Progression.dll - ..\ref\Techblox_Data\Managed\Techblox.Services.Storage.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Services.Storage.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Services.Storage.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Services.Storage.dll - ..\ref\Techblox_Data\Managed\Techblox.Services.Users.Client.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Services.Users.Client.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Services.Users.Client.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Services.Users.Client.dll - ..\ref\Techblox_Data\Managed\Techblox.Services.Users.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Services.Users.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Services.Users.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Services.Users.dll - ..\ref\Techblox_Data\Managed\Techblox.ServoBlocksClient.dll - ..\..\ref\Techblox_Data\Managed\Techblox.ServoBlocksClient.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.ServoBlocksClient.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.ServoBlocksClient.dll - ..\ref\Techblox_Data\Managed\Techblox.ServoBlocksServer.dll - ..\..\ref\Techblox_Data\Managed\Techblox.ServoBlocksServer.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.ServoBlocksServer.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.ServoBlocksServer.dll - ..\ref\Techblox_Data\Managed\Techblox.ServosServer.dll - ..\..\ref\Techblox_Data\Managed\Techblox.ServosServer.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.ServosServer.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.ServosServer.dll - ..\ref\Techblox_Data\Managed\Techblox.SignalHandling.Audio.dll - ..\..\ref\Techblox_Data\Managed\Techblox.SignalHandling.Audio.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.SignalHandling.Audio.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.SignalHandling.Audio.dll - ..\ref\Techblox_Data\Managed\Techblox.SignalHandling.Common.dll - ..\..\ref\Techblox_Data\Managed\Techblox.SignalHandling.Common.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.SignalHandling.Common.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.SignalHandling.Common.dll - ..\ref\Techblox_Data\Managed\Techblox.Simulation.Clusters.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Simulation.Clusters.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Simulation.Clusters.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Simulation.Clusters.dll - ..\ref\Techblox_Data\Managed\Techblox.SpawnBlock.Client.dll - ..\..\ref\Techblox_Data\Managed\Techblox.SpawnBlock.Client.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.SpawnBlock.Client.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.SpawnBlock.Client.dll - ..\ref\Techblox_Data\Managed\Techblox.SpawnBlock.Server.dll - ..\..\ref\Techblox_Data\Managed\Techblox.SpawnBlock.Server.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.SpawnBlock.Server.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.SpawnBlock.Server.dll - ..\ref\Techblox_Data\Managed\Techblox.StabilizerBlock.dll - ..\..\ref\Techblox_Data\Managed\Techblox.StabilizerBlock.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.StabilizerBlock.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.StabilizerBlock.dll - ..\ref\Techblox_Data\Managed\Techblox.StabilizerBlockClient.dll - ..\..\ref\Techblox_Data\Managed\Techblox.StabilizerBlockClient.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.StabilizerBlockClient.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.StabilizerBlockClient.dll - ..\ref\Techblox_Data\Managed\Techblox.SwitchAnimation.dll - ..\..\ref\Techblox_Data\Managed\Techblox.SwitchAnimation.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.SwitchAnimation.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.SwitchAnimation.dll - ..\ref\Techblox_Data\Managed\Techblox.TeamScoreBlockClient.dll - ..\..\ref\Techblox_Data\Managed\Techblox.TeamScoreBlockClient.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.TeamScoreBlockClient.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.TeamScoreBlockClient.dll - ..\ref\Techblox_Data\Managed\Techblox.TeamScoreBlockServer.dll - ..\..\ref\Techblox_Data\Managed\Techblox.TeamScoreBlockServer.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.TeamScoreBlockServer.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.TeamScoreBlockServer.dll - ..\ref\Techblox_Data\Managed\Techblox.TechpointConverterBlock.dll - ..\..\ref\Techblox_Data\Managed\Techblox.TechpointConverterBlock.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.TechpointConverterBlock.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.TechpointConverterBlock.dll - ..\ref\Techblox_Data\Managed\Techblox.TechpointConverterGUI.TechPointPoolHUD.dll - ..\..\ref\Techblox_Data\Managed\Techblox.TechpointConverterGUI.TechPointPoolHUD.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.TechpointConverterGUI.TechPointPoolHUD.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.TechpointConverterGUI.TechPointPoolHUD.dll - ..\ref\Techblox_Data\Managed\Techblox.TechpointConverterGUI.TechpointRewardPanel.dll - ..\..\ref\Techblox_Data\Managed\Techblox.TechpointConverterGUI.TechpointRewardPanel.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.TechpointConverterGUI.TechpointRewardPanel.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.TechpointConverterGUI.TechpointRewardPanel.dll - ..\ref\Techblox_Data\Managed\Techblox.TextBlock.dll - ..\..\ref\Techblox_Data\Managed\Techblox.TextBlock.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.TextBlock.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.TextBlock.dll - ..\ref\Techblox_Data\Managed\Techblox.TimerBlock.dll - ..\..\ref\Techblox_Data\Managed\Techblox.TimerBlock.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.TimerBlock.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.TimerBlock.dll - ..\ref\Techblox_Data\Managed\Techblox.TriggerBlock.dll - ..\..\ref\Techblox_Data\Managed\Techblox.TriggerBlock.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.TriggerBlock.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.TriggerBlock.dll - ..\ref\Techblox_Data\Managed\Techblox.Tweaks.Validation.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Tweaks.Validation.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Tweaks.Validation.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Tweaks.Validation.dll - ..\ref\Techblox_Data\Managed\Techblox.VFXBlockClient.dll - ..\..\ref\Techblox_Data\Managed\Techblox.VFXBlockClient.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.VFXBlockClient.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.VFXBlockClient.dll - ..\ref\Techblox_Data\Managed\Techblox.VFXBlockServer.dll - ..\..\ref\Techblox_Data\Managed\Techblox.VFXBlockServer.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.VFXBlockServer.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.VFXBlockServer.dll - ..\ref\Techblox_Data\Managed\Techblox.VisualEffects.VFXGraph.dll - ..\..\ref\Techblox_Data\Managed\Techblox.VisualEffects.VFXGraph.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.VisualEffects.VFXGraph.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.VisualEffects.VFXGraph.dll - ..\ref\Techblox_Data\Managed\Techblox.Weapons.Aiming.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Weapons.Aiming.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Weapons.Aiming.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Weapons.Aiming.dll - ..\ref\Techblox_Data\Managed\Techblox.Weapons.DisablerBlock.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Weapons.DisablerBlock.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Weapons.DisablerBlock.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Weapons.DisablerBlock.dll - ..\ref\Techblox_Data\Managed\Techblox.Weapons.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Weapons.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Weapons.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Weapons.dll - ..\ref\Techblox_Data\Managed\Techblox.Weapons.Projectiles.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Weapons.Projectiles.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Weapons.Projectiles.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Weapons.Projectiles.dll - ..\ref\Techblox_Data\Managed\Techblox.Weapons.Projectiles.Server.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Weapons.Projectiles.Server.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Weapons.Projectiles.Server.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Weapons.Projectiles.Server.dll - ..\ref\Techblox_Data\Managed\Techblox.Weapons.Server.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Weapons.Server.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Weapons.Server.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Weapons.Server.dll - ..\ref\Techblox_Data\Managed\Techblox.WheelFX.dll - ..\..\ref\Techblox_Data\Managed\Techblox.WheelFX.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.WheelFX.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.WheelFX.dll - ..\ref\Techblox_Data\Managed\Techblox.WheelRigBlock.dll - ..\..\ref\Techblox_Data\Managed\Techblox.WheelRigBlock.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.WheelRigBlock.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.WheelRigBlock.dll - ..\ref\Techblox_Data\Managed\Techblox.Wheels.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Wheels.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Wheels.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Wheels.dll - ..\ref\Techblox_Data\Managed\Techblox.WorldEditor.Spawning.dll - ..\..\ref\Techblox_Data\Managed\Techblox.WorldEditor.Spawning.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.WorldEditor.Spawning.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.WorldEditor.Spawning.dll - ..\ref\Techblox_Data\Managed\Techblox.WorldEditor.TestPlayers.dll - ..\..\ref\Techblox_Data\Managed\Techblox.WorldEditor.TestPlayers.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.WorldEditor.TestPlayers.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.WorldEditor.TestPlayers.dll - ..\ref\Techblox_Data\Managed\Techblox.WorldResetterBlock.dll - ..\..\ref\Techblox_Data\Managed\Techblox.WorldResetterBlock.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.WorldResetterBlock.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.WorldResetterBlock.dll - ..\ref\Techblox_Data\Managed\UniTask.Addressables.dll - ..\..\ref\Techblox_Data\Managed\UniTask.Addressables.dll + ..\ref_TB\Techblox_Data\Managed\UniTask.Addressables.dll + ..\..\ref_TB\Techblox_Data\Managed\UniTask.Addressables.dll - ..\ref\Techblox_Data\Managed\UniTask.dll - ..\..\ref\Techblox_Data\Managed\UniTask.dll + ..\ref_TB\Techblox_Data\Managed\UniTask.dll + ..\..\ref_TB\Techblox_Data\Managed\UniTask.dll - ..\ref\Techblox_Data\Managed\UniTask.DOTween.dll - ..\..\ref\Techblox_Data\Managed\UniTask.DOTween.dll + ..\ref_TB\Techblox_Data\Managed\UniTask.DOTween.dll + ..\..\ref_TB\Techblox_Data\Managed\UniTask.DOTween.dll - ..\ref\Techblox_Data\Managed\UniTask.Linq.dll - ..\..\ref\Techblox_Data\Managed\UniTask.Linq.dll + ..\ref_TB\Techblox_Data\Managed\UniTask.Linq.dll + ..\..\ref_TB\Techblox_Data\Managed\UniTask.Linq.dll - ..\ref\Techblox_Data\Managed\UniTask.TextMeshPro.dll - ..\..\ref\Techblox_Data\Managed\UniTask.TextMeshPro.dll + ..\ref_TB\Techblox_Data\Managed\UniTask.TextMeshPro.dll + ..\..\ref_TB\Techblox_Data\Managed\UniTask.TextMeshPro.dll - ..\ref\Techblox_Data\Managed\Unity.Addressables.dll - ..\..\ref\Techblox_Data\Managed\Unity.Addressables.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Addressables.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Addressables.dll - ..\ref\Techblox_Data\Managed\Unity.Burst.dll - ..\..\ref\Techblox_Data\Managed\Unity.Burst.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Burst.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Burst.dll - ..\ref\Techblox_Data\Managed\Unity.Burst.Unsafe.dll - ..\..\ref\Techblox_Data\Managed\Unity.Burst.Unsafe.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Burst.Unsafe.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Burst.Unsafe.dll - ..\ref\Techblox_Data\Managed\Unity.Collections.dll - ..\..\ref\Techblox_Data\Managed\Unity.Collections.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Collections.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Collections.dll - ..\ref\Techblox_Data\Managed\Unity.Collections.LowLevel.ILSupport.dll - ..\..\ref\Techblox_Data\Managed\Unity.Collections.LowLevel.ILSupport.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Collections.LowLevel.ILSupport.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Collections.LowLevel.ILSupport.dll - ..\ref\Techblox_Data\Managed\Unity.Deformations.dll - ..\..\ref\Techblox_Data\Managed\Unity.Deformations.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Deformations.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Deformations.dll - ..\ref\Techblox_Data\Managed\Unity.Entities.dll - ..\..\ref\Techblox_Data\Managed\Unity.Entities.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Entities.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Entities.dll - ..\ref\Techblox_Data\Managed\Unity.Entities.Hybrid.dll - ..\..\ref\Techblox_Data\Managed\Unity.Entities.Hybrid.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Entities.Hybrid.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Entities.Hybrid.dll - ..\ref\Techblox_Data\Managed\Unity.InternalAPIEngineBridge.012.dll - ..\..\ref\Techblox_Data\Managed\Unity.InternalAPIEngineBridge.012.dll + ..\ref_TB\Techblox_Data\Managed\Unity.InternalAPIEngineBridge.012.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.InternalAPIEngineBridge.012.dll - ..\ref\Techblox_Data\Managed\Unity.Jobs.dll - ..\..\ref\Techblox_Data\Managed\Unity.Jobs.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Jobs.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Jobs.dll - ..\ref\Techblox_Data\Managed\Unity.Mathematics.dll - ..\..\ref\Techblox_Data\Managed\Unity.Mathematics.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Mathematics.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Mathematics.dll - ..\ref\Techblox_Data\Managed\Unity.Mathematics.Extensions.dll - ..\..\ref\Techblox_Data\Managed\Unity.Mathematics.Extensions.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Mathematics.Extensions.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Mathematics.Extensions.dll - ..\ref\Techblox_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll - ..\..\ref\Techblox_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll - ..\ref\Techblox_Data\Managed\Unity.MemoryProfiler.dll - ..\..\ref\Techblox_Data\Managed\Unity.MemoryProfiler.dll + ..\ref_TB\Techblox_Data\Managed\Unity.MemoryProfiler.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.MemoryProfiler.dll - ..\ref\Techblox_Data\Managed\Unity.Physics.dll - ..\..\ref\Techblox_Data\Managed\Unity.Physics.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Physics.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Physics.dll - ..\ref\Techblox_Data\Managed\Unity.Physics.Hybrid.dll - ..\..\ref\Techblox_Data\Managed\Unity.Physics.Hybrid.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Physics.Hybrid.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Physics.Hybrid.dll - ..\ref\Techblox_Data\Managed\Unity.Platforms.Common.dll - ..\..\ref\Techblox_Data\Managed\Unity.Platforms.Common.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Platforms.Common.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Platforms.Common.dll - ..\ref\Techblox_Data\Managed\Unity.Profiling.Core.dll - ..\..\ref\Techblox_Data\Managed\Unity.Profiling.Core.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Profiling.Core.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Profiling.Core.dll - ..\ref\Techblox_Data\Managed\Unity.Properties.dll - ..\..\ref\Techblox_Data\Managed\Unity.Properties.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Properties.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Properties.dll - ..\ref\Techblox_Data\Managed\Unity.Properties.Reflection.dll - ..\..\ref\Techblox_Data\Managed\Unity.Properties.Reflection.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Properties.Reflection.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Properties.Reflection.dll - ..\ref\Techblox_Data\Managed\Unity.Properties.UI.dll - ..\..\ref\Techblox_Data\Managed\Unity.Properties.UI.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Properties.UI.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Properties.UI.dll - ..\ref\Techblox_Data\Managed\Unity.Recorder.Base.dll - ..\..\ref\Techblox_Data\Managed\Unity.Recorder.Base.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Recorder.Base.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Recorder.Base.dll - ..\ref\Techblox_Data\Managed\Unity.Recorder.dll - ..\..\ref\Techblox_Data\Managed\Unity.Recorder.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Recorder.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Recorder.dll - ..\ref\Techblox_Data\Managed\Unity.Rendering.Hybrid.dll - ..\..\ref\Techblox_Data\Managed\Unity.Rendering.Hybrid.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Rendering.Hybrid.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Rendering.Hybrid.dll - ..\ref\Techblox_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll - ..\..\ref\Techblox_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll + ..\ref_TB\Techblox_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll - ..\ref\Techblox_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll - ..\..\ref\Techblox_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll + ..\ref_TB\Techblox_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll - ..\ref\Techblox_Data\Managed\Unity.RenderPipelines.HighDefinition.Config.Runtime.dll - ..\..\ref\Techblox_Data\Managed\Unity.RenderPipelines.HighDefinition.Config.Runtime.dll + ..\ref_TB\Techblox_Data\Managed\Unity.RenderPipelines.HighDefinition.Config.Runtime.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.RenderPipelines.HighDefinition.Config.Runtime.dll - ..\ref\Techblox_Data\Managed\Unity.RenderPipelines.HighDefinition.Runtime.dll - ..\..\ref\Techblox_Data\Managed\Unity.RenderPipelines.HighDefinition.Runtime.dll + ..\ref_TB\Techblox_Data\Managed\Unity.RenderPipelines.HighDefinition.Runtime.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.RenderPipelines.HighDefinition.Runtime.dll - ..\ref\Techblox_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll - ..\..\ref\Techblox_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll + ..\ref_TB\Techblox_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll - ..\ref\Techblox_Data\Managed\Unity.ResourceManager.dll - ..\..\ref\Techblox_Data\Managed\Unity.ResourceManager.dll + ..\ref_TB\Techblox_Data\Managed\Unity.ResourceManager.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.ResourceManager.dll - ..\ref\Techblox_Data\Managed\Unity.Scenes.dll - ..\..\ref\Techblox_Data\Managed\Unity.Scenes.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Scenes.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Scenes.dll - ..\ref\Techblox_Data\Managed\Unity.ScriptableBuildPipeline.dll - ..\..\ref\Techblox_Data\Managed\Unity.ScriptableBuildPipeline.dll + ..\ref_TB\Techblox_Data\Managed\Unity.ScriptableBuildPipeline.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.ScriptableBuildPipeline.dll - ..\ref\Techblox_Data\Managed\Unity.Serialization.dll - ..\..\ref\Techblox_Data\Managed\Unity.Serialization.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Serialization.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Serialization.dll - ..\ref\Techblox_Data\Managed\Unity.TextMeshPro.dll - ..\..\ref\Techblox_Data\Managed\Unity.TextMeshPro.dll + ..\ref_TB\Techblox_Data\Managed\Unity.TextMeshPro.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.TextMeshPro.dll - ..\ref\Techblox_Data\Managed\Unity.Timeline.dll - ..\..\ref\Techblox_Data\Managed\Unity.Timeline.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Timeline.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Timeline.dll - ..\ref\Techblox_Data\Managed\Unity.Transforms.dll - ..\..\ref\Techblox_Data\Managed\Unity.Transforms.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Transforms.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Transforms.dll - ..\ref\Techblox_Data\Managed\Unity.Transforms.Hybrid.dll - ..\..\ref\Techblox_Data\Managed\Unity.Transforms.Hybrid.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Transforms.Hybrid.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Transforms.Hybrid.dll - ..\ref\Techblox_Data\Managed\Unity.VisualEffectGraph.Runtime.dll - ..\..\ref\Techblox_Data\Managed\Unity.VisualEffectGraph.Runtime.dll + ..\ref_TB\Techblox_Data\Managed\Unity.VisualEffectGraph.Runtime.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.VisualEffectGraph.Runtime.dll - ..\ref\Techblox_Data\Managed\UnityEngine.AccessibilityModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.AccessibilityModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.AccessibilityModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.AccessibilityModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.AIModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.AIModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.AIModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.AIModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.AndroidJNIModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.AndroidJNIModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.AndroidJNIModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.AndroidJNIModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.AnimationModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.AnimationModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.AnimationModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.AnimationModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.ARModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.ARModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.ARModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.ARModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.AssetBundleModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.AssetBundleModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.AssetBundleModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.AssetBundleModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.AudioModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.AudioModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.AudioModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.AudioModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.ClothModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.ClothModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.ClothModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.ClothModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.ClusterInputModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.ClusterInputModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.ClusterInputModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.ClusterInputModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.ClusterRendererModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.ClusterRendererModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.ClusterRendererModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.ClusterRendererModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.CoreModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.CoreModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.CoreModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.CoreModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.CrashReportingModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.CrashReportingModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.CrashReportingModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.CrashReportingModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.DirectorModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.DirectorModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.DirectorModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.DirectorModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.dll - ..\ref\Techblox_Data\Managed\UnityEngine.DSPGraphModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.DSPGraphModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.DSPGraphModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.DSPGraphModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.GameCenterModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.GameCenterModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.GameCenterModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.GameCenterModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.GIModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.GIModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.GIModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.GIModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.GridModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.GridModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.GridModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.GridModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.HotReloadModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.HotReloadModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.HotReloadModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.HotReloadModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.ImageConversionModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.ImageConversionModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.ImageConversionModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.ImageConversionModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.IMGUIModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.IMGUIModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.IMGUIModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.IMGUIModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.InputLegacyModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.InputLegacyModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.InputLegacyModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.InputLegacyModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.InputModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.InputModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.InputModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.InputModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.JSONSerializeModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.JSONSerializeModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.JSONSerializeModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.JSONSerializeModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.LocalizationModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.LocalizationModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.LocalizationModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.LocalizationModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.NVIDIAModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.NVIDIAModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.NVIDIAModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.NVIDIAModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.ParticleSystemModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.ParticleSystemModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.ParticleSystemModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.ParticleSystemModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.PerformanceReportingModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.PerformanceReportingModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.PerformanceReportingModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.PerformanceReportingModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.Physics2DModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.Physics2DModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.Physics2DModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.Physics2DModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.PhysicsModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.PhysicsModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.PhysicsModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.PhysicsModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.ProfilerModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.ProfilerModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.ProfilerModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.ProfilerModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.ScreenCaptureModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.ScreenCaptureModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.ScreenCaptureModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.ScreenCaptureModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.SharedInternalsModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.SharedInternalsModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.SharedInternalsModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.SharedInternalsModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.SpriteMaskModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.SpriteMaskModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.SpriteMaskModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.SpriteMaskModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.SpriteShapeModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.SpriteShapeModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.SpriteShapeModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.SpriteShapeModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.StreamingModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.StreamingModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.StreamingModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.StreamingModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.SubstanceModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.SubstanceModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.SubstanceModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.SubstanceModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.SubsystemsModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.SubsystemsModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.SubsystemsModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.SubsystemsModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.TerrainModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.TerrainModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.TerrainModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.TerrainModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.TerrainPhysicsModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.TerrainPhysicsModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.TerrainPhysicsModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.TerrainPhysicsModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.TextCoreFontEngineModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.TextCoreFontEngineModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.TextCoreFontEngineModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.TextCoreFontEngineModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.TextCoreTextEngineModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.TextCoreTextEngineModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.TextCoreTextEngineModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.TextCoreTextEngineModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.TextRenderingModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.TextRenderingModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.TextRenderingModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.TextRenderingModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.TilemapModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.TilemapModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.TilemapModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.TilemapModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.TLSModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.TLSModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.TLSModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.TLSModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.UI.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.UI.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.UI.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.UI.dll - ..\ref\Techblox_Data\Managed\UnityEngine.UIElementsModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.UIElementsModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.UIElementsModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.UIElementsModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.UIElementsNativeModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.UIElementsNativeModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.UIElementsNativeModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.UIElementsNativeModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.UIModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.UIModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.UIModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.UIModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.UmbraModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.UmbraModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.UmbraModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.UmbraModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.UNETModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.UNETModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.UNETModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.UNETModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.UnityAnalyticsModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.UnityAnalyticsModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.UnityAnalyticsModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.UnityAnalyticsModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.UnityConnectModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.UnityConnectModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.UnityConnectModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.UnityConnectModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.UnityCurlModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.UnityCurlModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.UnityCurlModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.UnityCurlModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.UnityTestProtocolModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.UnityTestProtocolModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.UnityTestProtocolModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.UnityTestProtocolModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.UnityWebRequestModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.UnityWebRequestModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.VehiclesModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.VehiclesModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.VehiclesModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.VehiclesModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.VFXModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.VFXModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.VFXModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.VFXModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.VideoModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.VideoModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.VideoModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.VideoModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.VirtualTexturingModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.VirtualTexturingModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.VirtualTexturingModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.VirtualTexturingModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.VRModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.VRModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.VRModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.VRModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.WindModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.WindModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.WindModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.WindModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.XRModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.XRModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.XRModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.XRModule.dll - ..\ref\Techblox_Data\Managed\VisualProfiler.dll - ..\..\ref\Techblox_Data\Managed\VisualProfiler.dll + ..\ref_TB\Techblox_Data\Managed\VisualProfiler.dll + ..\..\ref_TB\Techblox_Data\Managed\VisualProfiler.dll - ..\ref\Techblox_Data\Managed\websocket-sharp.dll - ..\..\ref\Techblox_Data\Managed\websocket-sharp.dll + ..\ref_TB\Techblox_Data\Managed\websocket-sharp.dll + ..\..\ref_TB\Techblox_Data\Managed\websocket-sharp.dll - ..\ref\Techblox_Data\Managed\ZFBrowser.dll - ..\..\ref\Techblox_Data\Managed\ZFBrowser.dll + ..\ref_TB\Techblox_Data\Managed\ZFBrowser.dll + ..\..\ref_TB\Techblox_Data\Managed\ZFBrowser.dll diff --git a/MakeEverythingPublicInGame/Program.cs b/MakeEverythingPublicInGame/Program.cs index 08c7fd2..e28c4a2 100644 --- a/MakeEverythingPublicInGame/Program.cs +++ b/MakeEverythingPublicInGame/Program.cs @@ -13,7 +13,7 @@ foreach (var file in Directory.EnumerateFiles(@"../../../../../ref/Techblox_Data void ProcessAssembly(string path) { - var mod = ModuleDefinition.ReadModule(path, new(ReadingMode.Immediate) { ReadWrite = true }); + using var mod = ModuleDefinition.ReadModule(path, new(ReadingMode.Immediate) { ReadWrite = true }); foreach (var typeDefinition in mod.Types) { typeDefinition.IsPublic = true; diff --git a/TechbloxModdingAPI/TechbloxModdingAPI.csproj b/TechbloxModdingAPI/TechbloxModdingAPI.csproj index 709fc87..2138283 100644 --- a/TechbloxModdingAPI/TechbloxModdingAPI.csproj +++ b/TechbloxModdingAPI/TechbloxModdingAPI.csproj @@ -28,1565 +28,1565 @@ - ..\ref\Techblox_Data\Managed\IllusionInjector.dll - ..\..\ref\Techblox_Data\Managed\IllusionInjector.dll + ..\ref_TB\Techblox_Data\Managed\IllusionInjector.dll + ..\..\ref_TB\Techblox_Data\Managed\IllusionInjector.dll - ..\ref\Techblox_Data\Managed\IllusionPlugin.dll - ..\..\ref\Techblox_Data\Managed\IllusionPlugin.dll + ..\ref_TB\Techblox_Data\Managed\IllusionPlugin.dll + ..\..\ref_TB\Techblox_Data\Managed\IllusionPlugin.dll - ..\ref\Techblox_Data\Managed\Accessibility.dll - ..\..\ref\Techblox_Data\Managed\Accessibility.dll + ..\ref_TB\Techblox_Data\Managed\Accessibility.dll + ..\..\ref_TB\Techblox_Data\Managed\Accessibility.dll - ..\ref\Techblox_Data\Managed\Analytics.dll - ..\..\ref\Techblox_Data\Managed\Analytics.dll + ..\ref_TB\Techblox_Data\Managed\Analytics.dll + ..\..\ref_TB\Techblox_Data\Managed\Analytics.dll - ..\ref\Techblox_Data\Managed\Assembly-CSharp-firstpass.dll - ..\..\ref\Techblox_Data\Managed\Assembly-CSharp-firstpass.dll + ..\ref_TB\Techblox_Data\Managed\Assembly-CSharp-firstpass.dll + ..\..\ref_TB\Techblox_Data\Managed\Assembly-CSharp-firstpass.dll - ..\ref\Techblox_Data\Managed\Assembly-CSharp.dll - ..\..\ref\Techblox_Data\Managed\Assembly-CSharp.dll + ..\ref_TB\Techblox_Data\Managed\Assembly-CSharp.dll + ..\..\ref_TB\Techblox_Data\Managed\Assembly-CSharp.dll - ..\ref\Techblox_Data\Managed\AWSSDK.Core.dll - ..\..\ref\Techblox_Data\Managed\AWSSDK.Core.dll + ..\ref_TB\Techblox_Data\Managed\AWSSDK.Core.dll + ..\..\ref_TB\Techblox_Data\Managed\AWSSDK.Core.dll - ..\ref\Techblox_Data\Managed\AWSSDK.GameLift.dll - ..\..\ref\Techblox_Data\Managed\AWSSDK.GameLift.dll + ..\ref_TB\Techblox_Data\Managed\AWSSDK.GameLift.dll + ..\..\ref_TB\Techblox_Data\Managed\AWSSDK.GameLift.dll - ..\ref\Techblox_Data\Managed\BevelEffect.dll - ..\..\ref\Techblox_Data\Managed\BevelEffect.dll + ..\ref_TB\Techblox_Data\Managed\BevelEffect.dll + ..\..\ref_TB\Techblox_Data\Managed\BevelEffect.dll - ..\ref\Techblox_Data\Managed\Boxophobic.TheVehetationEngine.Runtime.dll - ..\..\ref\Techblox_Data\Managed\Boxophobic.TheVehetationEngine.Runtime.dll + ..\ref_TB\Techblox_Data\Managed\Boxophobic.TheVehetationEngine.Runtime.dll + ..\..\ref_TB\Techblox_Data\Managed\Boxophobic.TheVehetationEngine.Runtime.dll - ..\ref\Techblox_Data\Managed\Boxophobic.Utils.Scripts.dll - ..\..\ref\Techblox_Data\Managed\Boxophobic.Utils.Scripts.dll + ..\ref_TB\Techblox_Data\Managed\Boxophobic.Utils.Scripts.dll + ..\..\ref_TB\Techblox_Data\Managed\Boxophobic.Utils.Scripts.dll - ..\ref\Techblox_Data\Managed\DataLoader.dll - ..\..\ref\Techblox_Data\Managed\DataLoader.dll + ..\ref_TB\Techblox_Data\Managed\DataLoader.dll + ..\..\ref_TB\Techblox_Data\Managed\DataLoader.dll - ..\ref\Techblox_Data\Managed\DDNA.dll - ..\..\ref\Techblox_Data\Managed\DDNA.dll + ..\ref_TB\Techblox_Data\Managed\DDNA.dll + ..\..\ref_TB\Techblox_Data\Managed\DDNA.dll - ..\ref\Techblox_Data\Managed\EasyButtons.dll - ..\..\ref\Techblox_Data\Managed\EasyButtons.dll + ..\ref_TB\Techblox_Data\Managed\EasyButtons.dll + ..\..\ref_TB\Techblox_Data\Managed\EasyButtons.dll - ..\ref\Techblox_Data\Managed\EOSSDK.dll - ..\..\ref\Techblox_Data\Managed\EOSSDK.dll + ..\ref_TB\Techblox_Data\Managed\EOSSDK.dll + ..\..\ref_TB\Techblox_Data\Managed\EOSSDK.dll - ..\ref\Techblox_Data\Managed\FMODUnity.dll - ..\..\ref\Techblox_Data\Managed\FMODUnity.dll + ..\ref_TB\Techblox_Data\Managed\FMODUnity.dll + ..\..\ref_TB\Techblox_Data\Managed\FMODUnity.dll - ..\ref\Techblox_Data\Managed\FMODUnityResonance.dll - ..\..\ref\Techblox_Data\Managed\FMODUnityResonance.dll + ..\ref_TB\Techblox_Data\Managed\FMODUnityResonance.dll + ..\..\ref_TB\Techblox_Data\Managed\FMODUnityResonance.dll - ..\ref\Techblox_Data\Managed\FMODUnityWrapperClient.dll - ..\..\ref\Techblox_Data\Managed\FMODUnityWrapperClient.dll + ..\ref_TB\Techblox_Data\Managed\FMODUnityWrapperClient.dll + ..\..\ref_TB\Techblox_Data\Managed\FMODUnityWrapperClient.dll - ..\ref\Techblox_Data\Managed\FullGame.dll - ..\..\ref\Techblox_Data\Managed\FullGame.dll + ..\ref_TB\Techblox_Data\Managed\FullGame.dll + ..\..\ref_TB\Techblox_Data\Managed\FullGame.dll - ..\ref\Techblox_Data\Managed\Gamecraft.BlockEntityFactory.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.BlockEntityFactory.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.BlockEntityFactory.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.BlockEntityFactory.dll - ..\ref\Techblox_Data\Managed\Gamecraft.BlockGroups.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.BlockGroups.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.BlockGroups.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.BlockGroups.dll - ..\ref\Techblox_Data\Managed\Gamecraft.Blocks.LogicBlock.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.Blocks.LogicBlock.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.Blocks.LogicBlock.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.Blocks.LogicBlock.dll - ..\ref\Techblox_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll - ..\ref\Techblox_Data\Managed\Gamecraft.ColourPalette.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.ColourPalette.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.ColourPalette.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.ColourPalette.dll - ..\ref\Techblox_Data\Managed\Gamecraft.Damage.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.Damage.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.Damage.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.Damage.dll - ..\ref\Techblox_Data\Managed\Gamecraft.Effects.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.Effects.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.Effects.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.Effects.dll - ..\ref\Techblox_Data\Managed\Gamecraft.ExplosionFragments.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.ExplosionFragments.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.ExplosionFragments.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.ExplosionFragments.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GraphicsSettings.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GraphicsSettings.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.GraphicsSettings.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.GraphicsSettings.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.BlueprintInventory.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.BlueprintInventory.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.BlueprintInventory.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.BlueprintInventory.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.Blueprints.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.Blueprints.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.Blueprints.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.Blueprints.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.BlueprintSets.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.BlueprintSets.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.BlueprintSets.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.BlueprintSets.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.GameOptionsScreen.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.GameOptionsScreen.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.GameOptionsScreen.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.GameOptionsScreen.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.Blocks.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.Blocks.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.Blocks.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.Blocks.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.BlueprintsHotbar.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.BlueprintsHotbar.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.BlueprintsHotbar.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.BlueprintsHotbar.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.Colours.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.Colours.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.Colours.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.Hotbar.Colours.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.ModeBar.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.ModeBar.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.ModeBar.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.ModeBar.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.OptionsScreen.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.OptionsScreen.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.OptionsScreen.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.OptionsScreen.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Blocks.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Blocks.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Blocks.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Blocks.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Blueprints.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Blueprints.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Blueprints.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Blueprints.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Colours.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Colours.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Colours.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Colours.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Common.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Common.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Common.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.TabsBar.Common.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.Tweaks.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.Tweaks.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.Tweaks.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.Tweaks.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.Wires.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.Wires.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.Wires.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.Wires.dll - ..\ref\Techblox_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll - ..\ref\Techblox_Data\Managed\Gamecraft.JointBlocks.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.JointBlocks.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.JointBlocks.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.JointBlocks.dll - ..\ref\Techblox_Data\Managed\Gamecraft.Music.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.Music.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.Music.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.Music.dll - ..\ref\Techblox_Data\Managed\Gamecraft.NetStrings.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.NetStrings.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.NetStrings.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.NetStrings.dll - ..\ref\Techblox_Data\Managed\Gamecraft.PickupsCommon.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.PickupsCommon.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.PickupsCommon.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.PickupsCommon.dll - ..\ref\Techblox_Data\Managed\Gamecraft.PopupMessage.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.PopupMessage.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.PopupMessage.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.PopupMessage.dll - ..\ref\Techblox_Data\Managed\Gamecraft.Serialization.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.Serialization.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.Serialization.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.Serialization.dll - ..\ref\Techblox_Data\Managed\Gamecraft.Tweaks.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.Tweaks.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.Tweaks.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.Tweaks.dll - ..\ref\Techblox_Data\Managed\Gamecraft.VisualEffects.Decals.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.VisualEffects.Decals.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.VisualEffects.Decals.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.VisualEffects.Decals.dll - ..\ref\Techblox_Data\Managed\Gamecraft.Wires.dll - ..\..\ref\Techblox_Data\Managed\Gamecraft.Wires.dll + ..\ref_TB\Techblox_Data\Managed\Gamecraft.Wires.dll + ..\..\ref_TB\Techblox_Data\Managed\Gamecraft.Wires.dll - ..\ref\Techblox_Data\Managed\GameLiftServerSDKNet45.dll - ..\..\ref\Techblox_Data\Managed\GameLiftServerSDKNet45.dll + ..\ref_TB\Techblox_Data\Managed\GameLiftServerSDKNet45.dll + ..\..\ref_TB\Techblox_Data\Managed\GameLiftServerSDKNet45.dll - ..\ref\Techblox_Data\Managed\GameState.dll - ..\..\ref\Techblox_Data\Managed\GameState.dll + ..\ref_TB\Techblox_Data\Managed\GameState.dll + ..\..\ref_TB\Techblox_Data\Managed\GameState.dll - ..\ref\Techblox_Data\Managed\GhostShark.Outline.dll - ..\..\ref\Techblox_Data\Managed\GhostShark.Outline.dll + ..\ref_TB\Techblox_Data\Managed\GhostShark.Outline.dll + ..\..\ref_TB\Techblox_Data\Managed\GhostShark.Outline.dll - ..\ref\Techblox_Data\Managed\Google.Protobuf.dll - ..\..\ref\Techblox_Data\Managed\Google.Protobuf.dll + ..\ref_TB\Techblox_Data\Managed\Google.Protobuf.dll + ..\..\ref_TB\Techblox_Data\Managed\Google.Protobuf.dll - ..\ref\Techblox_Data\Managed\GPUInstancer.CrowdAnimations.dll - ..\..\ref\Techblox_Data\Managed\GPUInstancer.CrowdAnimations.dll + ..\ref_TB\Techblox_Data\Managed\GPUInstancer.CrowdAnimations.dll + ..\..\ref_TB\Techblox_Data\Managed\GPUInstancer.CrowdAnimations.dll - ..\ref\Techblox_Data\Managed\GPUInstancer.dll - ..\..\ref\Techblox_Data\Managed\GPUInstancer.dll + ..\ref_TB\Techblox_Data\Managed\GPUInstancer.dll + ..\..\ref_TB\Techblox_Data\Managed\GPUInstancer.dll - ..\ref\Techblox_Data\Managed\Havok.Physics.dll - ..\..\ref\Techblox_Data\Managed\Havok.Physics.dll + ..\ref_TB\Techblox_Data\Managed\Havok.Physics.dll + ..\..\ref_TB\Techblox_Data\Managed\Havok.Physics.dll - ..\ref\Techblox_Data\Managed\Havok.Physics.Hybrid.dll - ..\..\ref\Techblox_Data\Managed\Havok.Physics.Hybrid.dll + ..\ref_TB\Techblox_Data\Managed\Havok.Physics.Hybrid.dll + ..\..\ref_TB\Techblox_Data\Managed\Havok.Physics.Hybrid.dll - ..\ref\Techblox_Data\Managed\LiteNetLib.dll - ..\..\ref\Techblox_Data\Managed\LiteNetLib.dll + ..\ref_TB\Techblox_Data\Managed\LiteNetLib.dll + ..\..\ref_TB\Techblox_Data\Managed\LiteNetLib.dll - ..\ref\Techblox_Data\Managed\log4net.dll - ..\..\ref\Techblox_Data\Managed\log4net.dll + ..\ref_TB\Techblox_Data\Managed\log4net.dll + ..\..\ref_TB\Techblox_Data\Managed\log4net.dll - ..\ref\Techblox_Data\Managed\LZ4.dll - ..\..\ref\Techblox_Data\Managed\LZ4.dll + ..\ref_TB\Techblox_Data\Managed\LZ4.dll + ..\..\ref_TB\Techblox_Data\Managed\LZ4.dll - ..\ref\Techblox_Data\Managed\Monobehaviours.dll - ..\..\ref\Techblox_Data\Managed\Monobehaviours.dll + ..\ref_TB\Techblox_Data\Managed\Monobehaviours.dll + ..\..\ref_TB\Techblox_Data\Managed\Monobehaviours.dll - ..\ref\Techblox_Data\Managed\mscorlib.dll - ..\..\ref\Techblox_Data\Managed\mscorlib.dll + ..\ref_TB\Techblox_Data\Managed\mscorlib.dll + ..\..\ref_TB\Techblox_Data\Managed\mscorlib.dll - ..\ref\Techblox_Data\Managed\MultiplayerNetworking.dll - ..\..\ref\Techblox_Data\Managed\MultiplayerNetworking.dll + ..\ref_TB\Techblox_Data\Managed\MultiplayerNetworking.dll + ..\..\ref_TB\Techblox_Data\Managed\MultiplayerNetworking.dll - ..\ref\Techblox_Data\Managed\Newtonsoft.Json.dll - ..\..\ref\Techblox_Data\Managed\Newtonsoft.Json.dll + ..\ref_TB\Techblox_Data\Managed\Newtonsoft.Json.dll + ..\..\ref_TB\Techblox_Data\Managed\Newtonsoft.Json.dll - ..\ref\Techblox_Data\Managed\Novell.Directory.Ldap.dll - ..\..\ref\Techblox_Data\Managed\Novell.Directory.Ldap.dll + ..\ref_TB\Techblox_Data\Managed\Novell.Directory.Ldap.dll + ..\..\ref_TB\Techblox_Data\Managed\Novell.Directory.Ldap.dll - ..\ref\Techblox_Data\Managed\Prometheus.NetStandard.dll - ..\..\ref\Techblox_Data\Managed\Prometheus.NetStandard.dll + ..\ref_TB\Techblox_Data\Managed\Prometheus.NetStandard.dll + ..\..\ref_TB\Techblox_Data\Managed\Prometheus.NetStandard.dll - ..\ref\Techblox_Data\Managed\RCX.ScreenshotTaker.dll - ..\..\ref\Techblox_Data\Managed\RCX.ScreenshotTaker.dll + ..\ref_TB\Techblox_Data\Managed\RCX.ScreenshotTaker.dll + ..\..\ref_TB\Techblox_Data\Managed\RCX.ScreenshotTaker.dll - ..\ref\Techblox_Data\Managed\Rewired_Core.dll - ..\..\ref\Techblox_Data\Managed\Rewired_Core.dll + ..\ref_TB\Techblox_Data\Managed\Rewired_Core.dll + ..\..\ref_TB\Techblox_Data\Managed\Rewired_Core.dll - ..\ref\Techblox_Data\Managed\Rewired_Windows.dll - ..\..\ref\Techblox_Data\Managed\Rewired_Windows.dll + ..\ref_TB\Techblox_Data\Managed\Rewired_Windows.dll + ..\..\ref_TB\Techblox_Data\Managed\Rewired_Windows.dll - ..\ref\Techblox_Data\Managed\RichFX.dll - ..\..\ref\Techblox_Data\Managed\RichFX.dll + ..\ref_TB\Techblox_Data\Managed\RichFX.dll + ..\..\ref_TB\Techblox_Data\Managed\RichFX.dll - ..\ref\Techblox_Data\Managed\RobocraftECS.dll - ..\..\ref\Techblox_Data\Managed\RobocraftECS.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftECS.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftECS.dll - ..\ref\Techblox_Data\Managed\RobocraftX.AccountPreferences.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.AccountPreferences.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.AccountPreferences.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.AccountPreferences.dll - ..\ref\Techblox_Data\Managed\RobocraftX.Blocks.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.Blocks.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.Blocks.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.Blocks.dll - ..\ref\Techblox_Data\Managed\RobocraftX.Blocks.Ghost.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.Blocks.Ghost.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.Blocks.Ghost.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.Blocks.Ghost.dll - ..\ref\Techblox_Data\Managed\RobocraftX.Blocks.Triggers.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.Blocks.Triggers.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.Blocks.Triggers.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.Blocks.Triggers.dll - ..\ref\Techblox_Data\Managed\RobocraftX.Building.BoxSelect.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.Building.BoxSelect.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.Building.BoxSelect.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.Building.BoxSelect.dll - ..\ref\Techblox_Data\Managed\RobocraftX.Building.Jobs.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.Building.Jobs.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.Building.Jobs.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.Building.Jobs.dll - ..\ref\Techblox_Data\Managed\RobocraftX.Character.Audio.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.Character.Audio.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.Character.Audio.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.Character.Audio.dll - ..\ref\Techblox_Data\Managed\RobocraftX.Character.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.Character.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.Character.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.Character.dll - ..\ref\Techblox_Data\Managed\RobocraftX.Common.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.Common.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.Common.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.Common.dll - ..\ref\Techblox_Data\Managed\RobocraftX.ControlsScreen.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.ControlsScreen.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.ControlsScreen.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.ControlsScreen.dll - ..\ref\Techblox_Data\Managed\RobocraftX.Crosshair.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.Crosshair.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.Crosshair.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.Crosshair.dll - ..\ref\Techblox_Data\Managed\RobocraftX.FrontEnd.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.FrontEnd.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.FrontEnd.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.FrontEnd.dll - ..\ref\Techblox_Data\Managed\RobocraftX.GUI.DebugDisplay.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.DebugDisplay.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.GUI.DebugDisplay.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.GUI.DebugDisplay.dll - ..\ref\Techblox_Data\Managed\RobocraftX.GUI.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.GUI.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.GUI.dll - ..\ref\Techblox_Data\Managed\RobocraftX.GUI.Hotbar.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.Hotbar.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.GUI.Hotbar.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.GUI.Hotbar.dll - ..\ref\Techblox_Data\Managed\RobocraftX.GUI.Inventory.BlocksInventory.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.Inventory.BlocksInventory.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.GUI.Inventory.BlocksInventory.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.GUI.Inventory.BlocksInventory.dll - ..\ref\Techblox_Data\Managed\RobocraftX.GUI.Inventory.ColourInventory.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.Inventory.ColourInventory.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.GUI.Inventory.ColourInventory.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.GUI.Inventory.ColourInventory.dll - ..\ref\Techblox_Data\Managed\RobocraftX.GUI.Inventory.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.Inventory.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.GUI.Inventory.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.GUI.Inventory.dll - ..\ref\Techblox_Data\Managed\RobocraftX.GUI.QuitConfirmation.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.QuitConfirmation.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.GUI.QuitConfirmation.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.GUI.QuitConfirmation.dll - ..\ref\Techblox_Data\Managed\RobocraftX.GUI.ScaleGhost.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.ScaleGhost.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.GUI.ScaleGhost.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.GUI.ScaleGhost.dll - ..\ref\Techblox_Data\Managed\RobocraftX.GUI.TabsBar.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.GUI.TabsBar.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.GUI.TabsBar.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.GUI.TabsBar.dll - ..\ref\Techblox_Data\Managed\RobocraftX.Input.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.Input.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.Input.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.Input.dll - ..\ref\Techblox_Data\Managed\RobocraftX.MachineEditor.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.MachineEditor.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.MachineEditor.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.MachineEditor.dll - ..\ref\Techblox_Data\Managed\RobocraftX.MainGame.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.MainGame.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.MainGame.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.MainGame.dll - ..\ref\Techblox_Data\Managed\RobocraftX.MainSimulation.Audio.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.MainSimulation.Audio.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.MainSimulation.Audio.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.MainSimulation.Audio.dll - ..\ref\Techblox_Data\Managed\RobocraftX.MainSimulation.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.MainSimulation.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.MainSimulation.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.MainSimulation.dll - ..\ref\Techblox_Data\Managed\RobocraftX.Multiplayer.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.Multiplayer.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.Multiplayer.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.Multiplayer.dll - ..\ref\Techblox_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll - ..\ref\Techblox_Data\Managed\RobocraftX.Multiplayer.Serializers.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.Multiplayer.Serializers.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.Multiplayer.Serializers.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.Multiplayer.Serializers.dll - ..\ref\Techblox_Data\Managed\RobocraftX.MultiplayerInput.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.MultiplayerInput.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.MultiplayerInput.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.MultiplayerInput.dll - ..\ref\Techblox_Data\Managed\RobocraftX.ObjectIdBlocks.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.ObjectIdBlocks.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.ObjectIdBlocks.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.ObjectIdBlocks.dll - ..\ref\Techblox_Data\Managed\RobocraftX.Physics.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.Physics.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.Physics.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.Physics.dll - ..\ref\Techblox_Data\Managed\RobocraftX.PilotSeat.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.PilotSeat.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.PilotSeat.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.PilotSeat.dll - ..\ref\Techblox_Data\Managed\RobocraftX.Player.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.Player.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.Player.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.Player.dll - ..\ref\Techblox_Data\Managed\RobocraftX.SaveAndLoad.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.SaveAndLoad.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.SaveAndLoad.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.SaveAndLoad.dll - ..\ref\Techblox_Data\Managed\RobocraftX.SaveGameDialog.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.SaveGameDialog.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.SaveGameDialog.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.SaveGameDialog.dll - ..\ref\Techblox_Data\Managed\RobocraftX.Services.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.Services.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.Services.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.Services.dll - ..\ref\Techblox_Data\Managed\RobocraftX.SignalHandling.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.SignalHandling.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.SignalHandling.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.SignalHandling.dll - ..\ref\Techblox_Data\Managed\RobocraftX.StateSync.dll - ..\..\ref\Techblox_Data\Managed\RobocraftX.StateSync.dll + ..\ref_TB\Techblox_Data\Managed\RobocraftX.StateSync.dll + ..\..\ref_TB\Techblox_Data\Managed\RobocraftX.StateSync.dll - ..\ref\Techblox_Data\Managed\Serilog.dll - ..\..\ref\Techblox_Data\Managed\Serilog.dll + ..\ref_TB\Techblox_Data\Managed\Serilog.dll + ..\..\ref_TB\Techblox_Data\Managed\Serilog.dll - ..\ref\Techblox_Data\Managed\Serilog.Sinks.Grafana.Loki.dll - ..\..\ref\Techblox_Data\Managed\Serilog.Sinks.Grafana.Loki.dll + ..\ref_TB\Techblox_Data\Managed\Serilog.Sinks.Grafana.Loki.dll + ..\..\ref_TB\Techblox_Data\Managed\Serilog.Sinks.Grafana.Loki.dll - ..\ref\Techblox_Data\Managed\ShaderVariantsGenerationTool.dll - ..\..\ref\Techblox_Data\Managed\ShaderVariantsGenerationTool.dll + ..\ref_TB\Techblox_Data\Managed\ShaderVariantsGenerationTool.dll + ..\..\ref_TB\Techblox_Data\Managed\ShaderVariantsGenerationTool.dll - ..\ref\Techblox_Data\Managed\SpecializedDescriptors.dll - ..\..\ref\Techblox_Data\Managed\SpecializedDescriptors.dll + ..\ref_TB\Techblox_Data\Managed\SpecializedDescriptors.dll + ..\..\ref_TB\Techblox_Data\Managed\SpecializedDescriptors.dll - ..\ref\Techblox_Data\Managed\StringFormatter.dll - ..\..\ref\Techblox_Data\Managed\StringFormatter.dll + ..\ref_TB\Techblox_Data\Managed\StringFormatter.dll + ..\..\ref_TB\Techblox_Data\Managed\StringFormatter.dll - ..\ref\Techblox_Data\Managed\Svelto.Common.dll - ..\..\ref\Techblox_Data\Managed\Svelto.Common.dll + ..\ref_TB\Techblox_Data\Managed\Svelto.Common.dll + ..\..\ref_TB\Techblox_Data\Managed\Svelto.Common.dll - ..\ref\Techblox_Data\Managed\Svelto.ECS.dll - ..\..\ref\Techblox_Data\Managed\Svelto.ECS.dll + ..\ref_TB\Techblox_Data\Managed\Svelto.ECS.dll + ..\..\ref_TB\Techblox_Data\Managed\Svelto.ECS.dll - ..\ref\Techblox_Data\Managed\Svelto.ECS.GUI.dll - ..\..\ref\Techblox_Data\Managed\Svelto.ECS.GUI.dll + ..\ref_TB\Techblox_Data\Managed\Svelto.ECS.GUI.dll + ..\..\ref_TB\Techblox_Data\Managed\Svelto.ECS.GUI.dll - ..\ref\Techblox_Data\Managed\Svelto.Services.dll - ..\..\ref\Techblox_Data\Managed\Svelto.Services.dll + ..\ref_TB\Techblox_Data\Managed\Svelto.Services.dll + ..\..\ref_TB\Techblox_Data\Managed\Svelto.Services.dll - ..\ref\Techblox_Data\Managed\Svelto.Tasks.dll - ..\..\ref\Techblox_Data\Managed\Svelto.Tasks.dll + ..\ref_TB\Techblox_Data\Managed\Svelto.Tasks.dll + ..\..\ref_TB\Techblox_Data\Managed\Svelto.Tasks.dll - ..\ref\Techblox_Data\Managed\Techblox.AdditionalParts.dll - ..\..\ref\Techblox_Data\Managed\Techblox.AdditionalParts.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.AdditionalParts.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.AdditionalParts.dll - ..\ref\Techblox_Data\Managed\Techblox.AntiAFKServer.dll - ..\..\ref\Techblox_Data\Managed\Techblox.AntiAFKServer.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.AntiAFKServer.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.AntiAFKServer.dll - ..\ref\Techblox_Data\Managed\Techblox.Anticheat.Client.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Anticheat.Client.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Anticheat.Client.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Anticheat.Client.dll - ..\ref\Techblox_Data\Managed\Techblox.Anticheat.Common.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Anticheat.Common.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Anticheat.Common.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Anticheat.Common.dll - ..\ref\Techblox_Data\Managed\Techblox.AtmosphereBlock.dll - ..\..\ref\Techblox_Data\Managed\Techblox.AtmosphereBlock.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.AtmosphereBlock.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.AtmosphereBlock.dll - ..\ref\Techblox_Data\Managed\Techblox.AudioBlocks.dll - ..\..\ref\Techblox_Data\Managed\Techblox.AudioBlocks.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.AudioBlocks.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.AudioBlocks.dll - ..\ref\Techblox_Data\Managed\Techblox.AudioBlocksClient.dll - ..\..\ref\Techblox_Data\Managed\Techblox.AudioBlocksClient.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.AudioBlocksClient.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.AudioBlocksClient.dll - ..\ref\Techblox_Data\Managed\Techblox.AutoForward.dll - ..\..\ref\Techblox_Data\Managed\Techblox.AutoForward.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.AutoForward.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.AutoForward.dll - ..\ref\Techblox_Data\Managed\Techblox.Backend.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Backend.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Backend.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Backend.dll - ..\ref\Techblox_Data\Managed\Techblox.BitBlock.dll - ..\..\ref\Techblox_Data\Managed\Techblox.BitBlock.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.BitBlock.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.BitBlock.dll - ..\ref\Techblox_Data\Managed\Techblox.BlockColours.dll - ..\..\ref\Techblox_Data\Managed\Techblox.BlockColours.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.BlockColours.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.BlockColours.dll - ..\ref\Techblox_Data\Managed\Techblox.BlockLabels.dll - ..\..\ref\Techblox_Data\Managed\Techblox.BlockLabels.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.BlockLabels.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.BlockLabels.dll - ..\ref\Techblox_Data\Managed\Techblox.BlockLabelsServer.dll - ..\..\ref\Techblox_Data\Managed\Techblox.BlockLabelsServer.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.BlockLabelsServer.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.BlockLabelsServer.dll - ..\ref\Techblox_Data\Managed\Techblox.Blocks.Connections.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Blocks.Connections.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Blocks.Connections.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Blocks.Connections.dll - ..\ref\Techblox_Data\Managed\Techblox.Blocks.LightBlock.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Blocks.LightBlock.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Blocks.LightBlock.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Blocks.LightBlock.dll - ..\ref\Techblox_Data\Managed\Techblox.Building.Rules.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Building.Rules.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Building.Rules.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Building.Rules.dll - ..\ref\Techblox_Data\Managed\Techblox.Building.Shift.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Building.Shift.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Building.Shift.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Building.Shift.dll - ..\ref\Techblox_Data\Managed\Techblox.BuildingDrone.dll - ..\..\ref\Techblox_Data\Managed\Techblox.BuildingDrone.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.BuildingDrone.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.BuildingDrone.dll - ..\ref\Techblox_Data\Managed\Techblox.Camera.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Camera.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Camera.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Camera.dll - ..\ref\Techblox_Data\Managed\Techblox.CentreHUDBlock.dll - ..\..\ref\Techblox_Data\Managed\Techblox.CentreHUDBlock.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.CentreHUDBlock.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.CentreHUDBlock.dll - ..\ref\Techblox_Data\Managed\Techblox.CentreHUDGUI.dll - ..\..\ref\Techblox_Data\Managed\Techblox.CentreHUDGUI.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.CentreHUDGUI.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.CentreHUDGUI.dll - ..\ref\Techblox_Data\Managed\Techblox.CharacterDamage.Client.dll - ..\..\ref\Techblox_Data\Managed\Techblox.CharacterDamage.Client.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.CharacterDamage.Client.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.CharacterDamage.Client.dll - ..\ref\Techblox_Data\Managed\Techblox.CharacterDamage.Server.dll - ..\..\ref\Techblox_Data\Managed\Techblox.CharacterDamage.Server.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.CharacterDamage.Server.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.CharacterDamage.Server.dll - ..\ref\Techblox_Data\Managed\Techblox.CharacterRespawnScreen.dll - ..\..\ref\Techblox_Data\Managed\Techblox.CharacterRespawnScreen.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.CharacterRespawnScreen.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.CharacterRespawnScreen.dll - ..\ref\Techblox_Data\Managed\Techblox.CheckpointBlock.dll - ..\..\ref\Techblox_Data\Managed\Techblox.CheckpointBlock.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.CheckpointBlock.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.CheckpointBlock.dll - ..\ref\Techblox_Data\Managed\Techblox.CheckpointBlockClient.dll - ..\..\ref\Techblox_Data\Managed\Techblox.CheckpointBlockClient.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.CheckpointBlockClient.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.CheckpointBlockClient.dll - ..\ref\Techblox_Data\Managed\Techblox.Common.Audio.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Common.Audio.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Common.Audio.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Common.Audio.dll - ..\ref\Techblox_Data\Managed\Techblox.ConstantBlockClient.dll - ..\..\ref\Techblox_Data\Managed\Techblox.ConstantBlockClient.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.ConstantBlockClient.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.ConstantBlockClient.dll - ..\ref\Techblox_Data\Managed\Techblox.ConstantBlockServer.dll - ..\..\ref\Techblox_Data\Managed\Techblox.ConstantBlockServer.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.ConstantBlockServer.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.ConstantBlockServer.dll - ..\ref\Techblox_Data\Managed\Techblox.ContextSensitiveTextHint.dll - ..\..\ref\Techblox_Data\Managed\Techblox.ContextSensitiveTextHint.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.ContextSensitiveTextHint.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.ContextSensitiveTextHint.dll - ..\ref\Techblox_Data\Managed\Techblox.CounterBlockClient.dll - ..\..\ref\Techblox_Data\Managed\Techblox.CounterBlockClient.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.CounterBlockClient.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.CounterBlockClient.dll - ..\ref\Techblox_Data\Managed\Techblox.CounterBlockServer.dll - ..\..\ref\Techblox_Data\Managed\Techblox.CounterBlockServer.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.CounterBlockServer.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.CounterBlockServer.dll - ..\ref\Techblox_Data\Managed\Techblox.DamageRbScoreBlockServerServer.dll - ..\..\ref\Techblox_Data\Managed\Techblox.DamageRbScoreBlockServerServer.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.DamageRbScoreBlockServerServer.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.DamageRbScoreBlockServerServer.dll - ..\ref\Techblox_Data\Managed\Techblox.DirectionalDamageVingette.dll - ..\..\ref\Techblox_Data\Managed\Techblox.DirectionalDamageVingette.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.DirectionalDamageVingette.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.DirectionalDamageVingette.dll - ..\ref\Techblox_Data\Managed\Techblox.DistanceSensorBlock.dll - ..\..\ref\Techblox_Data\Managed\Techblox.DistanceSensorBlock.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.DistanceSensorBlock.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.DistanceSensorBlock.dll - ..\ref\Techblox_Data\Managed\Techblox.ECSResourceManagers.dll - ..\..\ref\Techblox_Data\Managed\Techblox.ECSResourceManagers.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.ECSResourceManagers.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.ECSResourceManagers.dll - ..\ref\Techblox_Data\Managed\Techblox.EngineBlock.dll - ..\..\ref\Techblox_Data\Managed\Techblox.EngineBlock.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.EngineBlock.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.EngineBlock.dll - ..\ref\Techblox_Data\Managed\Techblox.EnvironmentBlocks.BuildingEnvironment.dll - ..\..\ref\Techblox_Data\Managed\Techblox.EnvironmentBlocks.BuildingEnvironment.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.EnvironmentBlocks.BuildingEnvironment.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.EnvironmentBlocks.BuildingEnvironment.dll - ..\ref\Techblox_Data\Managed\Techblox.EnvironmentBlocks.dll - ..\..\ref\Techblox_Data\Managed\Techblox.EnvironmentBlocks.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.EnvironmentBlocks.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.EnvironmentBlocks.dll - ..\ref\Techblox_Data\Managed\Techblox.EnvironmentBlocks.SimulationWorldEnvironment.dll - ..\..\ref\Techblox_Data\Managed\Techblox.EnvironmentBlocks.SimulationWorldEnvironment.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.EnvironmentBlocks.SimulationWorldEnvironment.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.EnvironmentBlocks.SimulationWorldEnvironment.dll - ..\ref\Techblox_Data\Managed\Techblox.Gameplay.Client.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.Client.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.Client.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.Client.dll - ..\ref\Techblox_Data\Managed\Techblox.Gameplay.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.dll - ..\ref\Techblox_Data\Managed\Techblox.Gameplay.GameState.Client.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.GameState.Client.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.GameState.Client.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.GameState.Client.dll - ..\ref\Techblox_Data\Managed\Techblox.Gameplay.GameState.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.GameState.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.GameState.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.GameState.dll - ..\ref\Techblox_Data\Managed\Techblox.Gameplay.PlayerGameplayDetails.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.PlayerGameplayDetails.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.PlayerGameplayDetails.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.PlayerGameplayDetails.dll - ..\ref\Techblox_Data\Managed\Techblox.Gameplay.Score.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.Score.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.Score.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.Score.dll - ..\ref\Techblox_Data\Managed\Techblox.Gameplay.Spawning.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.Spawning.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.Spawning.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.Spawning.dll - ..\ref\Techblox_Data\Managed\Techblox.Gameplay.Teams.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.Teams.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.Teams.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.Teams.dll - ..\ref\Techblox_Data\Managed\Techblox.Gameplay.WorldResetting.Client.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.WorldResetting.Client.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.WorldResetting.Client.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.WorldResetting.Client.dll - ..\ref\Techblox_Data\Managed\Techblox.Gameplay.WorldResetting.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Gameplay.WorldResetting.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.WorldResetting.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Gameplay.WorldResetting.dll - ..\ref\Techblox_Data\Managed\Techblox.GameSelection.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GameSelection.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GameSelection.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GameSelection.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.Building.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Building.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Building.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Building.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.BuildRules.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.BuildRules.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.BuildRules.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.BuildRules.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.CharacterHealthFeedback.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.CharacterHealthFeedback.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.CharacterHealthFeedback.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.CharacterHealthFeedback.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.Collection.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Collection.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Collection.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Collection.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.Controls.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Controls.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Controls.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Controls.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.GamePortal.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.GamePortal.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.GamePortal.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.GamePortal.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.GeneralSettingsScreen.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.GeneralSettingsScreen.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.GeneralSettingsScreen.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.GeneralSettingsScreen.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.Hotbar.Landscapes.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Hotbar.Landscapes.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Hotbar.Landscapes.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Hotbar.Landscapes.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.Hotbar.Materials.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Hotbar.Materials.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Hotbar.Materials.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Hotbar.Materials.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.Inventory.Common.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Inventory.Common.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Inventory.Common.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Inventory.Common.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.Inventory.Landscapes.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Inventory.Landscapes.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Inventory.Landscapes.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Inventory.Landscapes.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.Inventory.Materials.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Inventory.Materials.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Inventory.Materials.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Inventory.Materials.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.LoadingBar.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.LoadingBar.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.LoadingBar.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.LoadingBar.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.Login.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Login.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Login.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Login.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.MachineReconstructTimer.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.MachineReconstructTimer.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.MachineReconstructTimer.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.MachineReconstructTimer.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.MainGame.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.MainGame.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.MainGame.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.MainGame.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.MainGame.StateMachine.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.MainGame.StateMachine.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.MainGame.StateMachine.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.MainGame.StateMachine.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.MyGamesScreen.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.MyGamesScreen.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.MyGamesScreen.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.MyGamesScreen.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.PauseMenu.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.PauseMenu.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.PauseMenu.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.PauseMenu.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.Progression.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Progression.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Progression.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.Progression.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.TabsBar.Landscapes.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.TabsBar.Landscapes.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.TabsBar.Landscapes.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.TabsBar.Landscapes.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.TabsBar.Materials.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.TabsBar.Materials.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.TabsBar.Materials.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.TabsBar.Materials.dll - ..\ref\Techblox_Data\Managed\Techblox.GUI.UsernameDisplay.dll - ..\..\ref\Techblox_Data\Managed\Techblox.GUI.UsernameDisplay.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.GUI.UsernameDisplay.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.GUI.UsernameDisplay.dll - ..\ref\Techblox_Data\Managed\Techblox.InputCapture.dll - ..\..\ref\Techblox_Data\Managed\Techblox.InputCapture.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.InputCapture.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.InputCapture.dll - ..\ref\Techblox_Data\Managed\Techblox.JetBlock.dll - ..\..\ref\Techblox_Data\Managed\Techblox.JetBlock.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.JetBlock.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.JetBlock.dll - ..\ref\Techblox_Data\Managed\Techblox.JetBlockClient.dll - ..\..\ref\Techblox_Data\Managed\Techblox.JetBlockClient.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.JetBlockClient.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.JetBlockClient.dll - ..\ref\Techblox_Data\Managed\Techblox.KillScoreBlock.dll - ..\..\ref\Techblox_Data\Managed\Techblox.KillScoreBlock.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.KillScoreBlock.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.KillScoreBlock.dll - ..\ref\Techblox_Data\Managed\Techblox.MachineProcessingService.dll - ..\..\ref\Techblox_Data\Managed\Techblox.MachineProcessingService.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.MachineProcessingService.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.MachineProcessingService.dll - ..\ref\Techblox_Data\Managed\Techblox.MachineSimulationPreprocessing.dll - ..\..\ref\Techblox_Data\Managed\Techblox.MachineSimulationPreprocessing.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.MachineSimulationPreprocessing.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.MachineSimulationPreprocessing.dll - ..\ref\Techblox_Data\Managed\Techblox.MachineSpawning.dll - ..\..\ref\Techblox_Data\Managed\Techblox.MachineSpawning.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.MachineSpawning.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.MachineSpawning.dll - ..\ref\Techblox_Data\Managed\Techblox.MachineVelocityCameraEffects.dll - ..\..\ref\Techblox_Data\Managed\Techblox.MachineVelocityCameraEffects.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.MachineVelocityCameraEffects.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.MachineVelocityCameraEffects.dll - ..\ref\Techblox_Data\Managed\Techblox.Matchmaking.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Matchmaking.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Matchmaking.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Matchmaking.dll - ..\ref\Techblox_Data\Managed\Techblox.Monitoring.Server.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Monitoring.Server.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Monitoring.Server.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Monitoring.Server.dll - ..\ref\Techblox_Data\Managed\Techblox.Multiplayer.UsernameMessages.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Multiplayer.UsernameMessages.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Multiplayer.UsernameMessages.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Multiplayer.UsernameMessages.dll - ..\ref\Techblox_Data\Managed\Techblox.ObjectIDBlockClient.dll - ..\..\ref\Techblox_Data\Managed\Techblox.ObjectIDBlockClient.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.ObjectIDBlockClient.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.ObjectIDBlockClient.dll - ..\ref\Techblox_Data\Managed\Techblox.ObjectIDBlockServer.dll - ..\..\ref\Techblox_Data\Managed\Techblox.ObjectIDBlockServer.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.ObjectIDBlockServer.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.ObjectIDBlockServer.dll - ..\ref\Techblox_Data\Managed\Techblox.Particles.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Particles.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Particles.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Particles.dll - ..\ref\Techblox_Data\Managed\Techblox.PlayUX.dll - ..\..\ref\Techblox_Data\Managed\Techblox.PlayUX.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.PlayUX.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.PlayUX.dll - ..\ref\Techblox_Data\Managed\Techblox.Pointer.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Pointer.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Pointer.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Pointer.dll - ..\ref\Techblox_Data\Managed\Techblox.ProceduralReflectionProbes.dll - ..\..\ref\Techblox_Data\Managed\Techblox.ProceduralReflectionProbes.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.ProceduralReflectionProbes.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.ProceduralReflectionProbes.dll - ..\ref\Techblox_Data\Managed\Techblox.Rendering.Common.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Rendering.Common.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Rendering.Common.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Rendering.Common.dll - ..\ref\Techblox_Data\Managed\Techblox.Rendering.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Rendering.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Rendering.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Rendering.dll - ..\ref\Techblox_Data\Managed\Techblox.Rendering.DOTS.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Rendering.DOTS.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Rendering.DOTS.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Rendering.DOTS.dll - ..\ref\Techblox_Data\Managed\Techblox.Rendering.GPUI.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Rendering.GPUI.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Rendering.GPUI.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Rendering.GPUI.dll - ..\ref\Techblox_Data\Managed\Techblox.Rendering.Unity.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Rendering.Unity.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Rendering.Unity.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Rendering.Unity.dll - ..\ref\Techblox_Data\Managed\Techblox.SaveGamesConversion.dll - ..\..\ref\Techblox_Data\Managed\Techblox.SaveGamesConversion.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.SaveGamesConversion.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.SaveGamesConversion.dll - ..\ref\Techblox_Data\Managed\Techblox.ScoreHUDBlock.dll - ..\..\ref\Techblox_Data\Managed\Techblox.ScoreHUDBlock.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.ScoreHUDBlock.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.ScoreHUDBlock.dll - ..\ref\Techblox_Data\Managed\Techblox.ScoreHUDGUI.dll - ..\..\ref\Techblox_Data\Managed\Techblox.ScoreHUDGUI.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.ScoreHUDGUI.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.ScoreHUDGUI.dll - ..\ref\Techblox_Data\Managed\Techblox.ScorePickupBlockClient.dll - ..\..\ref\Techblox_Data\Managed\Techblox.ScorePickupBlockClient.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.ScorePickupBlockClient.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.ScorePickupBlockClient.dll - ..\ref\Techblox_Data\Managed\Techblox.ScorePickupBlockServer.dll - ..\..\ref\Techblox_Data\Managed\Techblox.ScorePickupBlockServer.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.ScorePickupBlockServer.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.ScorePickupBlockServer.dll - ..\ref\Techblox_Data\Managed\Techblox.Server.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Server.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Server.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Server.dll - ..\ref\Techblox_Data\Managed\Techblox.Services.Anticheat.Client.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Services.Anticheat.Client.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Services.Anticheat.Client.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Services.Anticheat.Client.dll - ..\ref\Techblox_Data\Managed\Techblox.Services.Eos.Common.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Services.Eos.Common.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Services.Eos.Common.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Services.Eos.Common.dll - ..\ref\Techblox_Data\Managed\Techblox.Services.Eos.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Services.Eos.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Services.Eos.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Services.Eos.dll - ..\ref\Techblox_Data\Managed\Techblox.Services.GameDetails.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Services.GameDetails.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Services.GameDetails.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Services.GameDetails.dll - ..\ref\Techblox_Data\Managed\Techblox.Services.LocalPreferences.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Services.LocalPreferences.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Services.LocalPreferences.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Services.LocalPreferences.dll - ..\ref\Techblox_Data\Managed\Techblox.Services.Matchmaking.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Services.Matchmaking.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Services.Matchmaking.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Services.Matchmaking.dll - ..\ref\Techblox_Data\Managed\Techblox.Services.Metrics.Server.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Services.Metrics.Server.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Services.Metrics.Server.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Services.Metrics.Server.dll - ..\ref\Techblox_Data\Managed\Techblox.Services.Progression.Client.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Services.Progression.Client.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Services.Progression.Client.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Services.Progression.Client.dll - ..\ref\Techblox_Data\Managed\Techblox.Services.Progression.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Services.Progression.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Services.Progression.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Services.Progression.dll - ..\ref\Techblox_Data\Managed\Techblox.Services.Storage.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Services.Storage.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Services.Storage.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Services.Storage.dll - ..\ref\Techblox_Data\Managed\Techblox.Services.Users.Client.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Services.Users.Client.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Services.Users.Client.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Services.Users.Client.dll - ..\ref\Techblox_Data\Managed\Techblox.Services.Users.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Services.Users.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Services.Users.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Services.Users.dll - ..\ref\Techblox_Data\Managed\Techblox.ServoBlocksClient.dll - ..\..\ref\Techblox_Data\Managed\Techblox.ServoBlocksClient.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.ServoBlocksClient.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.ServoBlocksClient.dll - ..\ref\Techblox_Data\Managed\Techblox.ServoBlocksServer.dll - ..\..\ref\Techblox_Data\Managed\Techblox.ServoBlocksServer.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.ServoBlocksServer.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.ServoBlocksServer.dll - ..\ref\Techblox_Data\Managed\Techblox.ServosServer.dll - ..\..\ref\Techblox_Data\Managed\Techblox.ServosServer.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.ServosServer.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.ServosServer.dll - ..\ref\Techblox_Data\Managed\Techblox.SignalHandling.Audio.dll - ..\..\ref\Techblox_Data\Managed\Techblox.SignalHandling.Audio.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.SignalHandling.Audio.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.SignalHandling.Audio.dll - ..\ref\Techblox_Data\Managed\Techblox.SignalHandling.Common.dll - ..\..\ref\Techblox_Data\Managed\Techblox.SignalHandling.Common.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.SignalHandling.Common.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.SignalHandling.Common.dll - ..\ref\Techblox_Data\Managed\Techblox.Simulation.Clusters.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Simulation.Clusters.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Simulation.Clusters.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Simulation.Clusters.dll - ..\ref\Techblox_Data\Managed\Techblox.SpawnBlock.Client.dll - ..\..\ref\Techblox_Data\Managed\Techblox.SpawnBlock.Client.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.SpawnBlock.Client.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.SpawnBlock.Client.dll - ..\ref\Techblox_Data\Managed\Techblox.SpawnBlock.Server.dll - ..\..\ref\Techblox_Data\Managed\Techblox.SpawnBlock.Server.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.SpawnBlock.Server.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.SpawnBlock.Server.dll - ..\ref\Techblox_Data\Managed\Techblox.StabilizerBlock.dll - ..\..\ref\Techblox_Data\Managed\Techblox.StabilizerBlock.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.StabilizerBlock.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.StabilizerBlock.dll - ..\ref\Techblox_Data\Managed\Techblox.StabilizerBlockClient.dll - ..\..\ref\Techblox_Data\Managed\Techblox.StabilizerBlockClient.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.StabilizerBlockClient.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.StabilizerBlockClient.dll - ..\ref\Techblox_Data\Managed\Techblox.SwitchAnimation.dll - ..\..\ref\Techblox_Data\Managed\Techblox.SwitchAnimation.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.SwitchAnimation.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.SwitchAnimation.dll - ..\ref\Techblox_Data\Managed\Techblox.TeamScoreBlockClient.dll - ..\..\ref\Techblox_Data\Managed\Techblox.TeamScoreBlockClient.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.TeamScoreBlockClient.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.TeamScoreBlockClient.dll - ..\ref\Techblox_Data\Managed\Techblox.TeamScoreBlockServer.dll - ..\..\ref\Techblox_Data\Managed\Techblox.TeamScoreBlockServer.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.TeamScoreBlockServer.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.TeamScoreBlockServer.dll - ..\ref\Techblox_Data\Managed\Techblox.TechpointConverterBlock.dll - ..\..\ref\Techblox_Data\Managed\Techblox.TechpointConverterBlock.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.TechpointConverterBlock.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.TechpointConverterBlock.dll - ..\ref\Techblox_Data\Managed\Techblox.TechpointConverterGUI.TechPointPoolHUD.dll - ..\..\ref\Techblox_Data\Managed\Techblox.TechpointConverterGUI.TechPointPoolHUD.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.TechpointConverterGUI.TechPointPoolHUD.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.TechpointConverterGUI.TechPointPoolHUD.dll - ..\ref\Techblox_Data\Managed\Techblox.TechpointConverterGUI.TechpointRewardPanel.dll - ..\..\ref\Techblox_Data\Managed\Techblox.TechpointConverterGUI.TechpointRewardPanel.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.TechpointConverterGUI.TechpointRewardPanel.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.TechpointConverterGUI.TechpointRewardPanel.dll - ..\ref\Techblox_Data\Managed\Techblox.TextBlock.dll - ..\..\ref\Techblox_Data\Managed\Techblox.TextBlock.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.TextBlock.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.TextBlock.dll - ..\ref\Techblox_Data\Managed\Techblox.TimerBlock.dll - ..\..\ref\Techblox_Data\Managed\Techblox.TimerBlock.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.TimerBlock.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.TimerBlock.dll - ..\ref\Techblox_Data\Managed\Techblox.TriggerBlock.dll - ..\..\ref\Techblox_Data\Managed\Techblox.TriggerBlock.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.TriggerBlock.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.TriggerBlock.dll - ..\ref\Techblox_Data\Managed\Techblox.Tweaks.Validation.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Tweaks.Validation.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Tweaks.Validation.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Tweaks.Validation.dll - ..\ref\Techblox_Data\Managed\Techblox.VFXBlockClient.dll - ..\..\ref\Techblox_Data\Managed\Techblox.VFXBlockClient.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.VFXBlockClient.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.VFXBlockClient.dll - ..\ref\Techblox_Data\Managed\Techblox.VFXBlockServer.dll - ..\..\ref\Techblox_Data\Managed\Techblox.VFXBlockServer.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.VFXBlockServer.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.VFXBlockServer.dll - ..\ref\Techblox_Data\Managed\Techblox.VisualEffects.VFXGraph.dll - ..\..\ref\Techblox_Data\Managed\Techblox.VisualEffects.VFXGraph.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.VisualEffects.VFXGraph.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.VisualEffects.VFXGraph.dll - ..\ref\Techblox_Data\Managed\Techblox.Weapons.Aiming.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Weapons.Aiming.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Weapons.Aiming.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Weapons.Aiming.dll - ..\ref\Techblox_Data\Managed\Techblox.Weapons.DisablerBlock.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Weapons.DisablerBlock.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Weapons.DisablerBlock.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Weapons.DisablerBlock.dll - ..\ref\Techblox_Data\Managed\Techblox.Weapons.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Weapons.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Weapons.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Weapons.dll - ..\ref\Techblox_Data\Managed\Techblox.Weapons.Projectiles.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Weapons.Projectiles.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Weapons.Projectiles.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Weapons.Projectiles.dll - ..\ref\Techblox_Data\Managed\Techblox.Weapons.Projectiles.Server.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Weapons.Projectiles.Server.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Weapons.Projectiles.Server.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Weapons.Projectiles.Server.dll - ..\ref\Techblox_Data\Managed\Techblox.Weapons.Server.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Weapons.Server.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Weapons.Server.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Weapons.Server.dll - ..\ref\Techblox_Data\Managed\Techblox.WheelFX.dll - ..\..\ref\Techblox_Data\Managed\Techblox.WheelFX.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.WheelFX.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.WheelFX.dll - ..\ref\Techblox_Data\Managed\Techblox.WheelRigBlock.dll - ..\..\ref\Techblox_Data\Managed\Techblox.WheelRigBlock.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.WheelRigBlock.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.WheelRigBlock.dll - ..\ref\Techblox_Data\Managed\Techblox.Wheels.dll - ..\..\ref\Techblox_Data\Managed\Techblox.Wheels.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.Wheels.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.Wheels.dll - ..\ref\Techblox_Data\Managed\Techblox.WorldEditor.Spawning.dll - ..\..\ref\Techblox_Data\Managed\Techblox.WorldEditor.Spawning.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.WorldEditor.Spawning.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.WorldEditor.Spawning.dll - ..\ref\Techblox_Data\Managed\Techblox.WorldEditor.TestPlayers.dll - ..\..\ref\Techblox_Data\Managed\Techblox.WorldEditor.TestPlayers.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.WorldEditor.TestPlayers.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.WorldEditor.TestPlayers.dll - ..\ref\Techblox_Data\Managed\Techblox.WorldResetterBlock.dll - ..\..\ref\Techblox_Data\Managed\Techblox.WorldResetterBlock.dll + ..\ref_TB\Techblox_Data\Managed\Techblox.WorldResetterBlock.dll + ..\..\ref_TB\Techblox_Data\Managed\Techblox.WorldResetterBlock.dll - ..\ref\Techblox_Data\Managed\UniTask.Addressables.dll - ..\..\ref\Techblox_Data\Managed\UniTask.Addressables.dll + ..\ref_TB\Techblox_Data\Managed\UniTask.Addressables.dll + ..\..\ref_TB\Techblox_Data\Managed\UniTask.Addressables.dll - ..\ref\Techblox_Data\Managed\UniTask.dll - ..\..\ref\Techblox_Data\Managed\UniTask.dll + ..\ref_TB\Techblox_Data\Managed\UniTask.dll + ..\..\ref_TB\Techblox_Data\Managed\UniTask.dll - ..\ref\Techblox_Data\Managed\UniTask.DOTween.dll - ..\..\ref\Techblox_Data\Managed\UniTask.DOTween.dll + ..\ref_TB\Techblox_Data\Managed\UniTask.DOTween.dll + ..\..\ref_TB\Techblox_Data\Managed\UniTask.DOTween.dll - ..\ref\Techblox_Data\Managed\UniTask.Linq.dll - ..\..\ref\Techblox_Data\Managed\UniTask.Linq.dll + ..\ref_TB\Techblox_Data\Managed\UniTask.Linq.dll + ..\..\ref_TB\Techblox_Data\Managed\UniTask.Linq.dll - ..\ref\Techblox_Data\Managed\UniTask.TextMeshPro.dll - ..\..\ref\Techblox_Data\Managed\UniTask.TextMeshPro.dll + ..\ref_TB\Techblox_Data\Managed\UniTask.TextMeshPro.dll + ..\..\ref_TB\Techblox_Data\Managed\UniTask.TextMeshPro.dll - ..\ref\Techblox_Data\Managed\Unity.Addressables.dll - ..\..\ref\Techblox_Data\Managed\Unity.Addressables.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Addressables.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Addressables.dll - ..\ref\Techblox_Data\Managed\Unity.Burst.dll - ..\..\ref\Techblox_Data\Managed\Unity.Burst.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Burst.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Burst.dll - ..\ref\Techblox_Data\Managed\Unity.Burst.Unsafe.dll - ..\..\ref\Techblox_Data\Managed\Unity.Burst.Unsafe.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Burst.Unsafe.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Burst.Unsafe.dll - ..\ref\Techblox_Data\Managed\Unity.Collections.dll - ..\..\ref\Techblox_Data\Managed\Unity.Collections.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Collections.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Collections.dll - ..\ref\Techblox_Data\Managed\Unity.Collections.LowLevel.ILSupport.dll - ..\..\ref\Techblox_Data\Managed\Unity.Collections.LowLevel.ILSupport.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Collections.LowLevel.ILSupport.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Collections.LowLevel.ILSupport.dll - ..\ref\Techblox_Data\Managed\Unity.Deformations.dll - ..\..\ref\Techblox_Data\Managed\Unity.Deformations.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Deformations.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Deformations.dll - ..\ref\Techblox_Data\Managed\Unity.Entities.dll - ..\..\ref\Techblox_Data\Managed\Unity.Entities.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Entities.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Entities.dll - ..\ref\Techblox_Data\Managed\Unity.Entities.Hybrid.dll - ..\..\ref\Techblox_Data\Managed\Unity.Entities.Hybrid.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Entities.Hybrid.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Entities.Hybrid.dll - ..\ref\Techblox_Data\Managed\Unity.InternalAPIEngineBridge.012.dll - ..\..\ref\Techblox_Data\Managed\Unity.InternalAPIEngineBridge.012.dll + ..\ref_TB\Techblox_Data\Managed\Unity.InternalAPIEngineBridge.012.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.InternalAPIEngineBridge.012.dll - ..\ref\Techblox_Data\Managed\Unity.Jobs.dll - ..\..\ref\Techblox_Data\Managed\Unity.Jobs.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Jobs.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Jobs.dll - ..\ref\Techblox_Data\Managed\Unity.Mathematics.dll - ..\..\ref\Techblox_Data\Managed\Unity.Mathematics.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Mathematics.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Mathematics.dll - ..\ref\Techblox_Data\Managed\Unity.Mathematics.Extensions.dll - ..\..\ref\Techblox_Data\Managed\Unity.Mathematics.Extensions.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Mathematics.Extensions.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Mathematics.Extensions.dll - ..\ref\Techblox_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll - ..\..\ref\Techblox_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll - ..\ref\Techblox_Data\Managed\Unity.MemoryProfiler.dll - ..\..\ref\Techblox_Data\Managed\Unity.MemoryProfiler.dll + ..\ref_TB\Techblox_Data\Managed\Unity.MemoryProfiler.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.MemoryProfiler.dll - ..\ref\Techblox_Data\Managed\Unity.Physics.dll - ..\..\ref\Techblox_Data\Managed\Unity.Physics.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Physics.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Physics.dll - ..\ref\Techblox_Data\Managed\Unity.Physics.Hybrid.dll - ..\..\ref\Techblox_Data\Managed\Unity.Physics.Hybrid.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Physics.Hybrid.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Physics.Hybrid.dll - ..\ref\Techblox_Data\Managed\Unity.Platforms.Common.dll - ..\..\ref\Techblox_Data\Managed\Unity.Platforms.Common.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Platforms.Common.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Platforms.Common.dll - ..\ref\Techblox_Data\Managed\Unity.Profiling.Core.dll - ..\..\ref\Techblox_Data\Managed\Unity.Profiling.Core.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Profiling.Core.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Profiling.Core.dll - ..\ref\Techblox_Data\Managed\Unity.Properties.dll - ..\..\ref\Techblox_Data\Managed\Unity.Properties.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Properties.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Properties.dll - ..\ref\Techblox_Data\Managed\Unity.Properties.Reflection.dll - ..\..\ref\Techblox_Data\Managed\Unity.Properties.Reflection.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Properties.Reflection.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Properties.Reflection.dll - ..\ref\Techblox_Data\Managed\Unity.Properties.UI.dll - ..\..\ref\Techblox_Data\Managed\Unity.Properties.UI.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Properties.UI.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Properties.UI.dll - ..\ref\Techblox_Data\Managed\Unity.Recorder.Base.dll - ..\..\ref\Techblox_Data\Managed\Unity.Recorder.Base.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Recorder.Base.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Recorder.Base.dll - ..\ref\Techblox_Data\Managed\Unity.Recorder.dll - ..\..\ref\Techblox_Data\Managed\Unity.Recorder.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Recorder.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Recorder.dll - ..\ref\Techblox_Data\Managed\Unity.Rendering.Hybrid.dll - ..\..\ref\Techblox_Data\Managed\Unity.Rendering.Hybrid.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Rendering.Hybrid.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Rendering.Hybrid.dll - ..\ref\Techblox_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll - ..\..\ref\Techblox_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll + ..\ref_TB\Techblox_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll - ..\ref\Techblox_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll - ..\..\ref\Techblox_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll + ..\ref_TB\Techblox_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll - ..\ref\Techblox_Data\Managed\Unity.RenderPipelines.HighDefinition.Config.Runtime.dll - ..\..\ref\Techblox_Data\Managed\Unity.RenderPipelines.HighDefinition.Config.Runtime.dll + ..\ref_TB\Techblox_Data\Managed\Unity.RenderPipelines.HighDefinition.Config.Runtime.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.RenderPipelines.HighDefinition.Config.Runtime.dll - ..\ref\Techblox_Data\Managed\Unity.RenderPipelines.HighDefinition.Runtime.dll - ..\..\ref\Techblox_Data\Managed\Unity.RenderPipelines.HighDefinition.Runtime.dll + ..\ref_TB\Techblox_Data\Managed\Unity.RenderPipelines.HighDefinition.Runtime.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.RenderPipelines.HighDefinition.Runtime.dll - ..\ref\Techblox_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll - ..\..\ref\Techblox_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll + ..\ref_TB\Techblox_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll - ..\ref\Techblox_Data\Managed\Unity.ResourceManager.dll - ..\..\ref\Techblox_Data\Managed\Unity.ResourceManager.dll + ..\ref_TB\Techblox_Data\Managed\Unity.ResourceManager.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.ResourceManager.dll - ..\ref\Techblox_Data\Managed\Unity.Scenes.dll - ..\..\ref\Techblox_Data\Managed\Unity.Scenes.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Scenes.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Scenes.dll - ..\ref\Techblox_Data\Managed\Unity.ScriptableBuildPipeline.dll - ..\..\ref\Techblox_Data\Managed\Unity.ScriptableBuildPipeline.dll + ..\ref_TB\Techblox_Data\Managed\Unity.ScriptableBuildPipeline.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.ScriptableBuildPipeline.dll - ..\ref\Techblox_Data\Managed\Unity.Serialization.dll - ..\..\ref\Techblox_Data\Managed\Unity.Serialization.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Serialization.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Serialization.dll - ..\ref\Techblox_Data\Managed\Unity.TextMeshPro.dll - ..\..\ref\Techblox_Data\Managed\Unity.TextMeshPro.dll + ..\ref_TB\Techblox_Data\Managed\Unity.TextMeshPro.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.TextMeshPro.dll - ..\ref\Techblox_Data\Managed\Unity.Timeline.dll - ..\..\ref\Techblox_Data\Managed\Unity.Timeline.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Timeline.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Timeline.dll - ..\ref\Techblox_Data\Managed\Unity.Transforms.dll - ..\..\ref\Techblox_Data\Managed\Unity.Transforms.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Transforms.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Transforms.dll - ..\ref\Techblox_Data\Managed\Unity.Transforms.Hybrid.dll - ..\..\ref\Techblox_Data\Managed\Unity.Transforms.Hybrid.dll + ..\ref_TB\Techblox_Data\Managed\Unity.Transforms.Hybrid.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.Transforms.Hybrid.dll - ..\ref\Techblox_Data\Managed\Unity.VisualEffectGraph.Runtime.dll - ..\..\ref\Techblox_Data\Managed\Unity.VisualEffectGraph.Runtime.dll + ..\ref_TB\Techblox_Data\Managed\Unity.VisualEffectGraph.Runtime.dll + ..\..\ref_TB\Techblox_Data\Managed\Unity.VisualEffectGraph.Runtime.dll - ..\ref\Techblox_Data\Managed\UnityEngine.AccessibilityModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.AccessibilityModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.AccessibilityModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.AccessibilityModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.AIModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.AIModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.AIModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.AIModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.AndroidJNIModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.AndroidJNIModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.AndroidJNIModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.AndroidJNIModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.AnimationModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.AnimationModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.AnimationModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.AnimationModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.ARModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.ARModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.ARModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.ARModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.AssetBundleModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.AssetBundleModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.AssetBundleModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.AssetBundleModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.AudioModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.AudioModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.AudioModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.AudioModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.ClothModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.ClothModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.ClothModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.ClothModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.ClusterInputModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.ClusterInputModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.ClusterInputModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.ClusterInputModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.ClusterRendererModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.ClusterRendererModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.ClusterRendererModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.ClusterRendererModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.CoreModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.CoreModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.CoreModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.CoreModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.CrashReportingModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.CrashReportingModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.CrashReportingModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.CrashReportingModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.DirectorModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.DirectorModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.DirectorModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.DirectorModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.dll - ..\ref\Techblox_Data\Managed\UnityEngine.DSPGraphModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.DSPGraphModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.DSPGraphModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.DSPGraphModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.GameCenterModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.GameCenterModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.GameCenterModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.GameCenterModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.GIModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.GIModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.GIModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.GIModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.GridModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.GridModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.GridModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.GridModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.HotReloadModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.HotReloadModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.HotReloadModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.HotReloadModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.ImageConversionModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.ImageConversionModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.ImageConversionModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.ImageConversionModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.IMGUIModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.IMGUIModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.IMGUIModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.IMGUIModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.InputLegacyModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.InputLegacyModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.InputLegacyModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.InputLegacyModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.InputModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.InputModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.InputModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.InputModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.JSONSerializeModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.JSONSerializeModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.JSONSerializeModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.JSONSerializeModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.LocalizationModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.LocalizationModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.LocalizationModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.LocalizationModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.NVIDIAModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.NVIDIAModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.NVIDIAModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.NVIDIAModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.ParticleSystemModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.ParticleSystemModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.ParticleSystemModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.ParticleSystemModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.PerformanceReportingModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.PerformanceReportingModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.PerformanceReportingModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.PerformanceReportingModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.Physics2DModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.Physics2DModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.Physics2DModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.Physics2DModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.PhysicsModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.PhysicsModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.PhysicsModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.PhysicsModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.ProfilerModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.ProfilerModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.ProfilerModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.ProfilerModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.ScreenCaptureModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.ScreenCaptureModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.ScreenCaptureModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.ScreenCaptureModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.SharedInternalsModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.SharedInternalsModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.SharedInternalsModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.SharedInternalsModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.SpriteMaskModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.SpriteMaskModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.SpriteMaskModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.SpriteMaskModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.SpriteShapeModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.SpriteShapeModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.SpriteShapeModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.SpriteShapeModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.StreamingModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.StreamingModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.StreamingModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.StreamingModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.SubstanceModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.SubstanceModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.SubstanceModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.SubstanceModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.SubsystemsModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.SubsystemsModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.SubsystemsModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.SubsystemsModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.TerrainModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.TerrainModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.TerrainModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.TerrainModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.TerrainPhysicsModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.TerrainPhysicsModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.TerrainPhysicsModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.TerrainPhysicsModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.TextCoreFontEngineModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.TextCoreFontEngineModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.TextCoreFontEngineModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.TextCoreFontEngineModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.TextCoreTextEngineModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.TextCoreTextEngineModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.TextCoreTextEngineModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.TextCoreTextEngineModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.TextRenderingModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.TextRenderingModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.TextRenderingModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.TextRenderingModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.TilemapModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.TilemapModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.TilemapModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.TilemapModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.TLSModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.TLSModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.TLSModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.TLSModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.UI.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.UI.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.UI.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.UI.dll - ..\ref\Techblox_Data\Managed\UnityEngine.UIElementsModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.UIElementsModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.UIElementsModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.UIElementsModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.UIElementsNativeModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.UIElementsNativeModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.UIElementsNativeModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.UIElementsNativeModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.UIModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.UIModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.UIModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.UIModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.UmbraModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.UmbraModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.UmbraModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.UmbraModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.UNETModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.UNETModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.UNETModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.UNETModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.UnityAnalyticsModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.UnityAnalyticsModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.UnityAnalyticsModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.UnityAnalyticsModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.UnityConnectModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.UnityConnectModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.UnityConnectModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.UnityConnectModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.UnityCurlModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.UnityCurlModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.UnityCurlModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.UnityCurlModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.UnityTestProtocolModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.UnityTestProtocolModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.UnityTestProtocolModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.UnityTestProtocolModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.UnityWebRequestModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.UnityWebRequestModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.VehiclesModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.VehiclesModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.VehiclesModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.VehiclesModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.VFXModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.VFXModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.VFXModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.VFXModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.VideoModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.VideoModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.VideoModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.VideoModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.VirtualTexturingModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.VirtualTexturingModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.VirtualTexturingModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.VirtualTexturingModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.VRModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.VRModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.VRModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.VRModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.WindModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.WindModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.WindModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.WindModule.dll - ..\ref\Techblox_Data\Managed\UnityEngine.XRModule.dll - ..\..\ref\Techblox_Data\Managed\UnityEngine.XRModule.dll + ..\ref_TB\Techblox_Data\Managed\UnityEngine.XRModule.dll + ..\..\ref_TB\Techblox_Data\Managed\UnityEngine.XRModule.dll - ..\ref\Techblox_Data\Managed\VisualProfiler.dll - ..\..\ref\Techblox_Data\Managed\VisualProfiler.dll + ..\ref_TB\Techblox_Data\Managed\VisualProfiler.dll + ..\..\ref_TB\Techblox_Data\Managed\VisualProfiler.dll - ..\ref\Techblox_Data\Managed\websocket-sharp.dll - ..\..\ref\Techblox_Data\Managed\websocket-sharp.dll + ..\ref_TB\Techblox_Data\Managed\websocket-sharp.dll + ..\..\ref_TB\Techblox_Data\Managed\websocket-sharp.dll - ..\ref\Techblox_Data\Managed\ZFBrowser.dll - ..\..\ref\Techblox_Data\Managed\ZFBrowser.dll + ..\ref_TB\Techblox_Data\Managed\ZFBrowser.dll + ..\..\ref_TB\Techblox_Data\Managed\ZFBrowser.dll - + \ No newline at end of file -- 2.30.2 From 67f32b8810dc814f116eb0ce63fa24570d006b4f Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Thu, 30 Mar 2023 01:17:31 +0200 Subject: [PATCH 251/252] Improved and fixed publish queue detection and block test - Made the PublishEntityChangesDelayed() method use the internals of Svelto.ECS to determine if it should wait -- I had this code for a while but it used too much reflection to my liking -- Now I made the reflection code nicer and a bit safer - Fixed float comparisons: last time I didn't actually used abs() for float3 but I found this even better method --- TechbloxModdingAPI/Blocks/BlockTests.cs | 39 +++++++++---- TechbloxModdingAPI/Blocks/Engine.cs | 4 +- .../Blocks/Engines/BlockEngine.cs | 9 +-- .../Blocks/Engines/BlueprintEngine.cs | 1 + .../Blocks/Engines/MovementEngine.cs | 1 + .../Blocks/Engines/PlacementEngine.cs | 1 + .../Blocks/Engines/RotationEngine.cs | 1 + .../Blocks/Engines/SignalEngine.cs | 1 + TechbloxModdingAPI/Players/PlayerEngine.cs | 1 + .../Utility/{ => ECS}/ManagedApiExtensions.cs | 4 +- .../NativeApiExtensions.EntitiesDBHelper.cs | 56 +++++++++++++++++++ .../Utility/{ => ECS}/NativeApiExtensions.cs | 35 +++--------- 12 files changed, 106 insertions(+), 47 deletions(-) rename TechbloxModdingAPI/Utility/{ => ECS}/ManagedApiExtensions.cs (97%) create mode 100644 TechbloxModdingAPI/Utility/ECS/NativeApiExtensions.EntitiesDBHelper.cs rename TechbloxModdingAPI/Utility/{ => ECS}/NativeApiExtensions.cs (77%) diff --git a/TechbloxModdingAPI/Blocks/BlockTests.cs b/TechbloxModdingAPI/Blocks/BlockTests.cs index 1e39945..a0ee0e9 100644 --- a/TechbloxModdingAPI/Blocks/BlockTests.cs +++ b/TechbloxModdingAPI/Blocks/BlockTests.cs @@ -5,7 +5,6 @@ using System.Reflection; using DataLoader; using Svelto.Tasks; -using Svelto.Tasks.Enumerators; using Unity.Mathematics; using TechbloxModdingAPI.Tests; @@ -86,28 +85,44 @@ namespace TechbloxModdingAPI.Blocks { //Includes specialised block properties if (property.SetMethod == null) continue; - var testValues = new (Type, object, Predicate)[] + + bool3 Float3Compare(float3 a, float3 b) + { // From Unity reference code + return math.abs(b - a) < math.max( + 0.000001f * math.max(math.abs(a), math.abs(b)), + float.Epsilon * 8 + ); + } + bool4 Float4Compare(float4 a, float4 b) + { // From Unity reference code + return math.abs(b - a) < math.max( + 0.000001f * math.max(math.abs(a), math.abs(b)), + float.Epsilon * 8 + ); + } + + var testValues = new (Type, object, Predicate<(object Value, object Default)>)[] { //(type, default value, predicate or null for equality) (typeof(long), 3, null), (typeof(int), 4, null), - (typeof(double), 5.2f, obj => Math.Abs((double) obj - 5.2f) < float.Epsilon), - (typeof(float), 5.2f, obj => Math.Abs((float) obj - 5.2f) < float.Epsilon), - (typeof(bool), true, obj => (bool) obj), - (typeof(string), "Test", obj => (string) obj == "Test"), //String equality check - (typeof(float3), (float3) 2, obj => math.all((float3) obj - 2 < (float3) float.Epsilon)), + (typeof(double), 5.2f, t => Math.Abs((double) t.Value - (double) t.Default) < float.Epsilon), + (typeof(float), 5.2f, t => Math.Abs((float) t.Value - (float) t.Default) < float.Epsilon), + (typeof(bool), true, t => (bool) t.Value), + (typeof(string), "Test", t => (string) t.Value == "Test"), //String equality check + (typeof(float3), (float3) 20, t => math.all(Float3Compare((float3)t.Value, (float3)t.Default))), (typeof(BlockColor), new BlockColor(BlockColors.Aqua, 2), null), - (typeof(float4), (float4) 5, obj => math.all((float4) obj - 5 < (float4) float.Epsilon)) + (typeof(float4), (float4) 5, t => math.all(Float4Compare((float4)t.Value, (float4)t.Default))) }; var propType = property.PropertyType; if (!propType.IsValueType) continue; - (object valueToUse, Predicate predicateToUse) = (null, null); + (object valueToUse, Predicate<(object Value, object Default)> predicateToUse) = (null, null); foreach (var (type, value, predicate) in testValues) { if (type.IsAssignableFrom(propType)) { valueToUse = value; - predicateToUse = predicate ?? (obj => Equals(obj, value)); + predicateToUse = predicate ?? (t => Equals(t.Value, t.Default)); break; } } @@ -116,7 +131,7 @@ namespace TechbloxModdingAPI.Blocks { var values = propType.GetEnumValues(); valueToUse = values.GetValue(values.Length / 2); - predicateToUse = val => Equals(val, valueToUse); + predicateToUse = t => Equals(t.Value, t.Default); } if (valueToUse == null) @@ -144,7 +159,7 @@ namespace TechbloxModdingAPI.Blocks continue; } var attr = property.GetCustomAttribute(); - if (!predicateToUse(got) && (attr == null || !Equals(attr.PossibleValue, got))) + if (!predicateToUse((got, valueToUse)) && (attr == null || !Equals(attr.PossibleValue, got))) { Assert.Fail($"Property {block.GetType().Name}.{property.Name} value {got} does not equal {valueToUse} for block {block}."); yield break; diff --git a/TechbloxModdingAPI/Blocks/Engine.cs b/TechbloxModdingAPI/Blocks/Engine.cs index 6140b11..e3d7ade 100644 --- a/TechbloxModdingAPI/Blocks/Engine.cs +++ b/TechbloxModdingAPI/Blocks/Engine.cs @@ -23,7 +23,7 @@ namespace TechbloxModdingAPI.Blocks { } - /// + /*/// - TODO: Internal struct access /// Gets or sets the Engine's On property. May not be saved. /// public bool On @@ -377,6 +377,6 @@ namespace TechbloxModdingAPI.Blocks { BlockEngine.GetBlockInfo(this).manualToAutoGearCoolOffTime = value; } - } + }*/ } } diff --git a/TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs b/TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs index 824071f..fd16d2f 100644 --- a/TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs @@ -21,6 +21,7 @@ using Unity.Mathematics; using TechbloxModdingAPI.Engines; using TechbloxModdingAPI.Utility; +using TechbloxModdingAPI.Utility.ECS; using PrefabsID = RobocraftX.Common.PrefabsID; namespace TechbloxModdingAPI.Blocks.Engines @@ -125,7 +126,7 @@ namespace TechbloxModdingAPI.Blocks.Engines var skew = entitiesDB.QueryEntity(id); entitiesDB.QueryEntity(id).matrix = math.mul(float4x4.TRS(pos.position, rot.rotation, scale.scale), skew.skewMatrix); - entitiesDB.PublishEntityChangeDelayed(id, 30); // Signal a prefab change so it updates the render buffers + entitiesDB.PublishEntityChangeDelayed(id); // Signal a prefab change so it updates the render buffers } internal void UpdatePrefab(Block block, byte material, bool flipped) @@ -146,8 +147,8 @@ namespace TechbloxModdingAPI.Blocks.Engines entitiesDB.QueryEntityOrDefault(block).prefabID = prefabId; if (block.Exists) { - entitiesDB.PublishEntityChangeDelayed(block.Id, 30); - entitiesDB.PublishEntityChangeDelayed(block.Id, 30); + entitiesDB.PublishEntityChangeDelayed(block.Id); + entitiesDB.PublishEntityChangeDelayed(block.Id); ref BuildingActionComponent local = ref entitiesDB.QueryEntity(BuildingDroneUtility @@ -161,7 +162,7 @@ namespace TechbloxModdingAPI.Blocks.Engines public void UpdateBlockColor(EGID id) { - entitiesDB.PublishEntityChangeDelayed(id, 30); + entitiesDB.PublishEntityChangeDelayed(id); } public bool BlockExists(EGID blockID) diff --git a/TechbloxModdingAPI/Blocks/Engines/BlueprintEngine.cs b/TechbloxModdingAPI/Blocks/Engines/BlueprintEngine.cs index e40f998..f04b3a3 100644 --- a/TechbloxModdingAPI/Blocks/Engines/BlueprintEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/BlueprintEngine.cs @@ -21,6 +21,7 @@ using Svelto.ECS.Serialization; using Techblox.Blocks.Connections; using TechbloxModdingAPI.Engines; using TechbloxModdingAPI.Utility; +using TechbloxModdingAPI.Utility.ECS; using Unity.Collections; using Unity.Mathematics; using UnityEngine; diff --git a/TechbloxModdingAPI/Blocks/Engines/MovementEngine.cs b/TechbloxModdingAPI/Blocks/Engines/MovementEngine.cs index 34ab4d5..7f8acfd 100644 --- a/TechbloxModdingAPI/Blocks/Engines/MovementEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/MovementEngine.cs @@ -7,6 +7,7 @@ using Unity.Transforms; using TechbloxModdingAPI.Engines; using TechbloxModdingAPI.Utility; +using TechbloxModdingAPI.Utility.ECS; namespace TechbloxModdingAPI.Blocks.Engines { diff --git a/TechbloxModdingAPI/Blocks/Engines/PlacementEngine.cs b/TechbloxModdingAPI/Blocks/Engines/PlacementEngine.cs index 4d363a4..d32f7f1 100644 --- a/TechbloxModdingAPI/Blocks/Engines/PlacementEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/PlacementEngine.cs @@ -16,6 +16,7 @@ using Unity.Mathematics; using TechbloxModdingAPI.Engines; using TechbloxModdingAPI.Utility; +using TechbloxModdingAPI.Utility.ECS; namespace TechbloxModdingAPI.Blocks.Engines { diff --git a/TechbloxModdingAPI/Blocks/Engines/RotationEngine.cs b/TechbloxModdingAPI/Blocks/Engines/RotationEngine.cs index a047031..ccfc13e 100644 --- a/TechbloxModdingAPI/Blocks/Engines/RotationEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/RotationEngine.cs @@ -7,6 +7,7 @@ using UnityEngine; using TechbloxModdingAPI.Engines; using TechbloxModdingAPI.Utility; +using TechbloxModdingAPI.Utility.ECS; namespace TechbloxModdingAPI.Blocks.Engines { diff --git a/TechbloxModdingAPI/Blocks/Engines/SignalEngine.cs b/TechbloxModdingAPI/Blocks/Engines/SignalEngine.cs index e2009b4..45d6e75 100644 --- a/TechbloxModdingAPI/Blocks/Engines/SignalEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/SignalEngine.cs @@ -6,6 +6,7 @@ using Svelto.ECS; using TechbloxModdingAPI.Engines; using TechbloxModdingAPI.Utility; +using TechbloxModdingAPI.Utility.ECS; namespace TechbloxModdingAPI.Blocks.Engines { diff --git a/TechbloxModdingAPI/Players/PlayerEngine.cs b/TechbloxModdingAPI/Players/PlayerEngine.cs index 534f75a..a1965fd 100644 --- a/TechbloxModdingAPI/Players/PlayerEngine.cs +++ b/TechbloxModdingAPI/Players/PlayerEngine.cs @@ -21,6 +21,7 @@ using Techblox.Character; using TechbloxModdingAPI.Engines; using TechbloxModdingAPI.Input; using TechbloxModdingAPI.Utility; +using TechbloxModdingAPI.Utility.ECS; namespace TechbloxModdingAPI.Players { diff --git a/TechbloxModdingAPI/Utility/ManagedApiExtensions.cs b/TechbloxModdingAPI/Utility/ECS/ManagedApiExtensions.cs similarity index 97% rename from TechbloxModdingAPI/Utility/ManagedApiExtensions.cs rename to TechbloxModdingAPI/Utility/ECS/ManagedApiExtensions.cs index cf61e14..e689666 100644 --- a/TechbloxModdingAPI/Utility/ManagedApiExtensions.cs +++ b/TechbloxModdingAPI/Utility/ECS/ManagedApiExtensions.cs @@ -1,9 +1,7 @@ -using System.Collections; -using System.Collections.Generic; using Svelto.ECS; using Svelto.ECS.Hybrid; -namespace TechbloxModdingAPI.Utility +namespace TechbloxModdingAPI.Utility.ECS { public static class ManagedApiExtensions { diff --git a/TechbloxModdingAPI/Utility/ECS/NativeApiExtensions.EntitiesDBHelper.cs b/TechbloxModdingAPI/Utility/ECS/NativeApiExtensions.EntitiesDBHelper.cs new file mode 100644 index 0000000..5922478 --- /dev/null +++ b/TechbloxModdingAPI/Utility/ECS/NativeApiExtensions.EntitiesDBHelper.cs @@ -0,0 +1,56 @@ +using System; +using System.Diagnostics.CodeAnalysis; +using System.Linq; +using System.Reflection; +using HarmonyLib; +using Svelto.DataStructures; +using Svelto.ECS; + +namespace TechbloxModdingAPI.Utility.ECS +{ + public static partial class NativeApiExtensions + { + [SuppressMessage("ReSharper", "StaticMemberInGenericType")] + private static class EntitiesDBHelper where T : unmanaged, IEntityComponent + { // Each type gets a new set of fields here (that's what the ReSharper warning is about too) + public static readonly Lazy EntityStream = + new(() => AccessTools.PropertyGetter(typeof(EntitiesDB), "_entityStream")); + + public static readonly Lazy Streams = new(() => + AccessTools.Field(EntityStream.Value.ReturnType, "_streams")); + + public static readonly Lazy Consumers = new(() => + AccessTools.Field(typeof(EntityStream), "_consumers")); + + public static readonly Lazy TryGetValue = + new(AccessTools.Method(Streams.Value.FieldType, "TryGetValue")); + + public static readonly Lazy RingBuffer = + new(() => AccessTools.Field(typeof(Consumer), "_ringBuffer")); + } + + private static EntityStream GetEntityStream(this EntitiesDB entitiesDB) where T : unmanaged, IEntityComponent + { + // EntitiesStreams (internal) + var entitiesStreams = EntitiesDBHelper.EntityStream.Value.Invoke(entitiesDB, Array.Empty()); + // FasterDictionary (interface is internal) + var streams = EntitiesDBHelper.Streams.Value.GetValue(entitiesStreams); + + var parameters = new object[] { TypeRefWrapper.wrapper, null }; + var success = EntitiesDBHelper.TryGetValue.Value.Invoke(streams, parameters); + if (!(bool)success) + return null; // There is no entity stream for this type + return (EntityStream)parameters[1]; + } + + private static ThreadSafeFasterList> GetConsumers(this EntityStream stream) where T : unmanaged, IEntityComponent + { + return (ThreadSafeFasterList>)EntitiesDBHelper.Consumers.Value.GetValue(stream); + } + + private static RingBuffer<(T, EGID)> GetRingBuffer(this Consumer consumer) where T : unmanaged, IEntityComponent + { + return (RingBuffer<(T, EGID)>)EntitiesDBHelper.RingBuffer.Value.GetValue(consumer); + } + } +} \ No newline at end of file diff --git a/TechbloxModdingAPI/Utility/NativeApiExtensions.cs b/TechbloxModdingAPI/Utility/ECS/NativeApiExtensions.cs similarity index 77% rename from TechbloxModdingAPI/Utility/NativeApiExtensions.cs rename to TechbloxModdingAPI/Utility/ECS/NativeApiExtensions.cs index 47629bb..9cd0b64 100644 --- a/TechbloxModdingAPI/Utility/NativeApiExtensions.cs +++ b/TechbloxModdingAPI/Utility/ECS/NativeApiExtensions.cs @@ -1,16 +1,14 @@ using System; using System.Collections.Generic; -using System.Reflection; -using HarmonyLib; using Svelto.DataStructures; using Svelto.ECS; using Svelto.Tasks; using Svelto.Tasks.Lean; using TechbloxModdingAPI.Tasks; -namespace TechbloxModdingAPI.Utility +namespace TechbloxModdingAPI.Utility.ECS { - public static class NativeApiExtensions + public static partial class NativeApiExtensions { /// /// Attempts to query an entity and returns an optional that contains the result if succeeded. @@ -69,36 +67,27 @@ namespace TechbloxModdingAPI.Utility return ref opt.Get(); //Default value } - private static readonly Dictionary Changes)> ChangesToPublish = new(); - /// /// Publishes an entity change, ignoring duplicate publishes and delaying changes as necessary. /// It will only publish in the next frame. /// /// The entities DB to publish to /// The ECS object that got changed - /// Limits how many changes to publish - should be no more than the consumers' capacity that process this component /// The component that changed - public static void PublishEntityChangeDelayed(this EntitiesDB entitiesDB, EGID id, int limit = 80) + public static void PublishEntityChangeDelayed(this EntitiesDB entitiesDB, EGID id) where T : unmanaged, IEntityComponent { - if (!ChangesToPublish.ContainsKey(typeof(T))) - ChangesToPublish.Add(typeof(T), (0, new HashSet())); - var changes = ChangesToPublish[typeof(T)].Changes; - if (changes.Contains(id)) return; - changes.Add(id); - PublishChanges(entitiesDB, id, limit).RunOn(Scheduler.leanRunner); + PublishChanges(entitiesDB, id).RunOn(Scheduler.leanRunner); } - private static IEnumerator PublishChanges(EntitiesDB entitiesDB, EGID id, int limit) + private static IEnumerator PublishChanges(EntitiesDB entitiesDB, EGID id) where T : unmanaged, IEntityComponent { yield return Yield.It; - while (ChangesToPublish[typeof(T)].PublishedCount >= limit) - yield return Yield.It; - if (!entitiesDB._entityStream._streams.TryGetValue(TypeRefWrapper.wrapper, out var result)) + var entityStream = entitiesDB.GetEntityStream(); + if (entityStream is null) yield break; // There is no entity stream for this type - var consumers = (result as EntityStream)?._consumers; + var consumers = entityStream.GetConsumers(); if (consumers == null) { Console.WriteLine("Consumers is null"); @@ -111,21 +100,15 @@ namespace TechbloxModdingAPI.Utility waitForConsumers = false; for (int i = 0; i < consumers.count; i++) { - var buffer = consumers[i]._ringBuffer; + var buffer = consumers[i].GetRingBuffer(); if (buffer.Count + 1 <= buffer.Capacity) continue; waitForConsumers = true; - Console.WriteLine($"Gonna have to wait for a consumer (capacity: {buffer.Capacity} count: {buffer.Count}"); break; } if (waitForConsumers) yield return Yield.It; } while (waitForConsumers); entitiesDB.PublishEntityChange(id); - var (count, changes) = ChangesToPublish[typeof(T)]; - changes.Remove(id); - ChangesToPublish[typeof(T)] = (count + 1, changes); - yield return Yield.It; - ChangesToPublish[typeof(T)] = (Math.Max(ChangesToPublish[typeof(T)].PublishedCount - 1, 0), changes); } /// -- 2.30.2 From 5dff88d7032eaa637db7995ae7c0cda102a326d6 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Mon, 21 Aug 2023 23:59:29 +0200 Subject: [PATCH 252/252] Switch from IPA to BepInEx - Removed a bunch of test code - Preparing for 3.0 --- Automation/gen_csproj.py | 2 +- CodeGenerator/CodeGenerator.csproj | 2 +- TechbloxModdingAPI/Main.cs | 2 +- TechbloxModdingAPI/TechbloxModdingAPI.csproj | 50 +- .../Tests/TechbloxModdingAPIPluginTest.cs | 448 +++--------------- TechbloxModdingAPI/Utility/Dependency.cs | 46 +- 6 files changed, 98 insertions(+), 452 deletions(-) diff --git a/Automation/gen_csproj.py b/Automation/gen_csproj.py index fc854b8..0c88372 100755 --- a/Automation/gen_csproj.py +++ b/Automation/gen_csproj.py @@ -41,7 +41,7 @@ if __name__ == "__main__": args = parser.parse_args() print("Building Assembly references") - asmXml = buildReferencesXml("../ref/Techblox_Data/Managed") + asmXml = buildReferencesXml("../ref_TB/Techblox_Data/Managed") # print(asmXml) with open("../TechbloxModdingAPI/TechbloxModdingAPI.csproj", "r") as xmlFile: diff --git a/CodeGenerator/CodeGenerator.csproj b/CodeGenerator/CodeGenerator.csproj index 766eefc..6952a6f 100644 --- a/CodeGenerator/CodeGenerator.csproj +++ b/CodeGenerator/CodeGenerator.csproj @@ -19,7 +19,7 @@ DEBUG;TEST;TRACE - + diff --git a/TechbloxModdingAPI/Main.cs b/TechbloxModdingAPI/Main.cs index 554debe..de38cc6 100644 --- a/TechbloxModdingAPI/Main.cs +++ b/TechbloxModdingAPI/Main.cs @@ -104,7 +104,7 @@ namespace TechbloxModdingAPI } Scheduler.Dispose(); var currentAssembly = Assembly.GetExecutingAssembly(); - harmony.UnpatchAll(currentAssembly.GetName().Name); + harmony.UnpatchSelf(); harmony = null; Logging.MetaLog($"{currentAssembly.GetName().Name} v{currentAssembly.GetName().Version} shutdown"); } diff --git a/TechbloxModdingAPI/TechbloxModdingAPI.csproj b/TechbloxModdingAPI/TechbloxModdingAPI.csproj index 2138283..5f6e410 100644 --- a/TechbloxModdingAPI/TechbloxModdingAPI.csproj +++ b/TechbloxModdingAPI/TechbloxModdingAPI.csproj @@ -1,40 +1,33 @@ - + + netstandard2.1 - true - 2.3.0 + TechbloxModdingAPI + An object-oriented API for Techblox mods. + 3.0.0 Exmods GNU General Public Licence 3+ https://git.exmods.org/modtainers/GamecraftModdingAPI en-CA true - 9 - - - - - - - DEBUG;TEST;TRACE + latest + - + + + + + + + + + - - - - - ..\ref_TB\Techblox_Data\Managed\IllusionInjector.dll - ..\..\ref_TB\Techblox_Data\Managed\IllusionInjector.dll - - - ..\ref_TB\Techblox_Data\Managed\IllusionPlugin.dll - ..\..\ref_TB\Techblox_Data\Managed\IllusionPlugin.dll - ..\ref_TB\Techblox_Data\Managed\Accessibility.dll ..\..\ref_TB\Techblox_Data\Managed\Accessibility.dll @@ -51,6 +44,10 @@ ..\ref_TB\Techblox_Data\Managed\Assembly-CSharp.dll ..\..\ref_TB\Techblox_Data\Managed\Assembly-CSharp.dll + + ..\ref_TB\Techblox_Data\Managed\Assembly-Csharp.dll + ..\..\ref_TB\Techblox_Data\Managed\Assembly-Csharp.dll + ..\ref_TB\Techblox_Data\Managed\AWSSDK.Core.dll ..\..\ref_TB\Techblox_Data\Managed\AWSSDK.Core.dll @@ -1584,9 +1581,12 @@ ..\..\ref_TB\Techblox_Data\Managed\ZFBrowser.dll + + + - + - \ No newline at end of file + diff --git a/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs b/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs index 32ed3e5..1f9c5f9 100644 --- a/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs +++ b/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs @@ -1,406 +1,84 @@ using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; using System.Reflection; using System.Text; -using System.Text.RegularExpressions; -using DataLoader; -using TechbloxModdingAPI.App; +using BepInEx; +using BepInEx.Bootstrap; using HarmonyLib; -using IllusionInjector; -// test using RobocraftX.FrontEnd; -using ServiceLayer; -using Unity.Mathematics; -using UnityEngine; -using Svelto.Tasks; -using Svelto.Tasks.Lean; -using TechbloxModdingAPI.Blocks; +using TechbloxModdingAPI.App; using TechbloxModdingAPI.Commands; -using TechbloxModdingAPI.Players; -using TechbloxModdingAPI.Tasks; -using TechbloxModdingAPI.Utility; namespace TechbloxModdingAPI.Tests { -#if DEBUG - // unused by design - /// - /// Modding API implemented as a standalone IPA Plugin. - /// Ideally, TechbloxModdingAPI should be loaded by another mod; not itself - /// - class TechbloxModdingAPIPluginTest : IllusionPlugin.IEnhancedPlugin + #if DEBUG // The API should be loaded by other plugins, but it can be used by itself for testing + [BepInPlugin("org.exmods.TechbloxModdingAPIPluginTest", PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_VERSION)] + [BepInProcess("Techblox.exe")] + public class TechbloxModdingAPIPluginTest : BaseUnityPlugin { + private void Awake() + { + Main.Init(); + Client.EnterMenu += (sender, args) => throw new Exception("Test handler always throws an exception!"); + Client.EnterMenu += (sender, args) => Console.WriteLine("EnterMenu handler after erroring handler"); + Game.Enter += (s, a) => + { + Player.LocalPlayer.SeatEntered += (sender, args) => + Console.WriteLine($"Player {Player.LocalPlayer} entered seat {args.Seat}"); + Player.LocalPlayer.SeatExited += (sender, args) => + Console.WriteLine($"Player {Player.LocalPlayer} exited seat {args.Seat}"); + }; + + CommandBuilder.Builder() + .Name("Exit") + .Description("Close Techblox immediately, without any prompts") + .Action(() => { UnityEngine.Application.Quit(); }) + .Build(); - private static Harmony harmony { get; set; } + CommandBuilder.Builder() + .Name("SetFOV") + .Description("Set the player camera's field of view") + .Action((float d) => { UnityEngine.Camera.main.fieldOfView = d; }) + .Build(); + + Game.AddPersistentDebugInfo("InstalledMods", InstalledMods); + + // Plugin startup logic + Logger.LogInfo($"Plugin {PluginInfo.PLUGIN_GUID} is loaded!"); + +#if TEST + TestRoot.RunTests(); +#endif + } - public override string Name { get; } = Assembly.GetExecutingAssembly().GetName().Name; - - public override string Version { get; } = Assembly.GetExecutingAssembly().GetName().Version.ToString(); - - public string HarmonyID { get; } = "org.git.exmods.modtainers.techbloxmoddingapi"; - - public override void OnApplicationQuit() + private void OnDestroy() { Main.Shutdown(); } - public override void OnApplicationStart() - { - FileLog.Reset(); - Harmony.DEBUG = true; - Main.Init(); - Logging.MetaDebugLog($"Version group id {ApiExclusiveGroups.versionGroup}"); - // disable background music - Logging.MetaDebugLog("Audio Mixers: " + string.Join(",", AudioTools.GetMixers())); - //AudioTools.SetVolume(0.0f, "Music"); // The game now sets this from settings again after this is called :( - - //Utility.VersionTracking.Enable();//(very) unstable - - // debug/test handlers - Client.EnterMenu += (sender, args) => throw new Exception("Test handler always throws an exception!"); - Client.EnterMenu += (sender, args) => Console.WriteLine("EnterMenu handler after erroring handler"); - Game.Enter += (s, a) => - { - Player.LocalPlayer.SeatEntered += (sender, args) => - Console.WriteLine($"Player {Player.LocalPlayer} entered seat {args.Seat}"); - Player.LocalPlayer.SeatExited += (sender, args) => - Console.WriteLine($"Player {Player.LocalPlayer} exited seat {args.Seat}"); - }; - - // debug/test commands - if (Dependency.Hell("ExtraCommands")) - { - CommandBuilder.Builder() - .Name("Exit") - .Description("Close Techblox immediately, without any prompts") - .Action(() => { UnityEngine.Application.Quit(); }) - .Build(); - - CommandBuilder.Builder() - .Name("SetFOV") - .Description("Set the player camera's field of view") - .Action((float d) => { UnityEngine.Camera.main.fieldOfView = d; }) - .Build(); - - CommandBuilder.Builder() - .Name("MoveLastBlock") - .Description("Move the most-recently-placed block, and any connected blocks by the given offset") - .Action((float x, float y, float z) => - { - if (GameState.IsBuildMode()) - foreach (var block in Block.GetLastPlacedBlock().GetConnectedCubes()) - block.Position += new Unity.Mathematics.float3(x, y, z); - else - Logging.CommandLogError("Blocks can only be moved in Build mode!"); - }).Build(); - - CommandBuilder.Builder() - .Name("PlaceAluminium") - .Description("Place a block of aluminium at the given coordinates") - .Action((float x, float y, float z) => - { - var block = Block.PlaceNew(BlockIDs.Cube, new float3(x, y, z)); - Logging.CommandLog("Block placed with type: " + block.Type); - }) - .Build(); - - CommandBuilder.Builder() - .Name("PlaceAluminiumLots") - .Description("Place a lot of blocks of aluminium at the given coordinates") - .Action((float x, float y, float z) => - { - Logging.CommandLog("Starting..."); - var sw = Stopwatch.StartNew(); - for (int i = 0; i < 100; i++) - for (int j = 0; j < 100; j++) - Block.PlaceNew(BlockIDs.Cube, new float3(x + i, y, z + j)); - sw.Stop(); - Logging.CommandLog("Finished in " + sw.ElapsedMilliseconds + "ms"); - }) - .Build(); - - Block b = null; - CommandBuilder.Builder("moveBlockInSim", "Run in build mode first while looking at a block, then in sim to move it up") - .Action(() => - { - if (b == null) - { - b = new Player(PlayerType.Local).GetBlockLookedAt(); - Logging.CommandLog("Block saved: " + b); - } - else - Logging.CommandLog("Block moved to: " + (b.GetSimBody().Position += new float3(0, 2, 0))); - }).Build(); - - CommandBuilder.Builder("Error", "Throw an error to make sure SimpleCustomCommandEngine's wrapper catches it.") - .Action(() => { throw new Exception("Error Command always throws an error"); }) - .Build(); - - CommandBuilder.Builder("ColorBlock", - "Change color of the block looked at if there's any.") - .Action(str => - { - if (!Enum.TryParse(str, out BlockColors color)) - { - Logging.CommandLog("Color " + str + " not found! Interpreting as 4 color values."); - var s = str.Split(' '); - new Player(PlayerType.Local).GetBlockLookedAt().CustomColor = new float4(float.Parse(s[0]), - float.Parse(s[1]), float.Parse(s[2]), float.Parse(s[3])); - return; - } - - new Player(PlayerType.Local).GetBlockLookedAt().Color = color; - Logging.CommandLog("Colored block to " + color); - - }).Build(); - - CommandBuilder.Builder("MoveBlockByID", "Gets a block based on its object identifier and teleports it up.") - .Action(ch => - { - foreach (var body in SimBody.GetFromObjectID(ch)) - { - Logging.CommandLog("SimBody: " + body); - body.Position += new float3(0, 10, 0); - foreach (var bodyConnectedBody in body.GetConnectedBodies()) - { - Logging.CommandLog("Moving " + bodyConnectedBody); - bodyConnectedBody.Position += new float3(0, 10, 0); - } - } - }).Build(); - - CommandBuilder.Builder("TestChunkHealth", "Sets the chunk looked at to the given health.") - .Action((float val, float max) => - { - var body = new Player(PlayerType.Local).GetSimBodyLookedAt(); - if (body == null) return; - body.CurrentHealth = val; - body.InitialHealth = max; - Logging.CommandLog("Health set to: " + val); - }).Build(); - - CommandBuilder.Builder("placeBlockGroup", "Places some blocks in a group") - .Action((float x, float y, float z) => - { - var pos = new float3(x, y, z); - var group = BlockGroup.Create(new Block(BlockIDs.Cube, pos) {Color = BlockColors.Aqua}); - new Block(BlockIDs.Cube, pos += new float3(1, 0, 0)) - {Color = BlockColors.Blue, BlockGroup = group}; - new Block(BlockIDs.Cube, pos += new float3(1, 0, 0)) - {Color = BlockColors.Green, BlockGroup = group}; - new Block(BlockIDs.Cube, pos + new float3(1, 0, 0)) - {Color = BlockColors.Lime, BlockGroup = group}; - }).Build(); - - CommandBuilder.Builder("placeCustomBlock", "Places a custom block, needs a custom catalog and assets.") - .Action((float x, float y, float z) => - { - Logging.CommandLog("Block placed: " + - Block.PlaceNew((BlockIDs) 500, new float3(0, 0, 0))); - }).Build(); - - CommandBuilder.Builder("toggleTimeMode", "Enters or exits simulation.") - .Action((float x, float y, float z) => - { - Game.CurrentGame().ToggleTimeMode(); - }).Build(); - - CommandBuilder.Builder("testColorBlock", "Tests coloring a block to default color") - .Action(() => Player.LocalPlayer.GetBlockLookedAt().Color = BlockColors.Default).Build(); - CommandBuilder.Builder("testMaterialBlock", "Tests materialing a block to default material") - .Action(() => Player.LocalPlayer.GetBlockLookedAt().Material = BlockMaterial.Default).Build(); - CommandBuilder.Builder("testGameName", "Tests changing the game name") - .Action(() => Game.CurrentGame().Name = "Test").Build(); - CommandBuilder.Builder("makeBlockStatic", "Makes a block you look at static") - .Action(() => Player.LocalPlayer.GetBlockLookedAt().Static = true).Build(); - - Game.AddPersistentDebugInfo("InstalledMods", InstalledMods); - /*Block.Placed += (sender, args) => - Logging.MetaDebugLog("Placed block " + args.Block); - Block.Removed += (sender, args) => - Logging.MetaDebugLog("Removed block " + args.Block);*/ - } - - // dependency test - if (Dependency.Hell("TechbloxScripting", new Version("0.0.1.0"))) - { - Logging.LogWarning("You're in TechbloxScripting dependency hell"); - } - else - { - Logging.Log("Compatible TechbloxScripting detected"); - } - // Interface test - /*Group uiGroup = new Group(new Rect(20, 20, 200, 500), "TechbloxModdingAPI_UITestGroup", true); - var button = new Button("TEST"); - button.OnClick += (b, __) => { Logging.MetaDebugLog($"Click on {((Interface.IMGUI.Button)b).Name}");}; - var button2 = new Button("TEST2"); - button2.OnClick += (b, __) => { Logging.MetaDebugLog($"Click on {((Interface.IMGUI.Button)b).Name}");}; - Text uiText = new Text("", multiline: true); - uiText.OnEdit += (t, txt) => { Logging.MetaDebugLog($"Text in {((Text)t).Name} is now '{txt}'"); }; - Label uiLabel = new Label("Label!"); - Image uiImg = new Image(name:"Behold this texture!"); - uiImg.Enabled = false; - uiGroup.AddElement(button); - uiGroup.AddElement(button2); - uiGroup.AddElement(uiText); - uiGroup.AddElement(uiLabel); - uiGroup.AddElement(uiImg);*/ - - /*Addressables.LoadAssetAsync("Assets/Art/Textures/UI/FrontEndMap/RCX_Blue_Background_5k.jpg") - .Completed += - handle => - { - uiImg.Texture = handle.Result; - uiImg.Enabled = true; - Logging.MetaDebugLog($"Got blue bg asset {handle.Result}"); - };*/ - - /*((FasterList)AccessTools.Property(typeof(GuiInputMap), "GuiInputsButtonDown").GetValue(null)) - .Add(new GuiInputMap.GuiInputMapElement(RewiredConsts.Action.ToggleCommandLine, GuiIn))*/ - - /*Game.Enter += (sender, e) => - { - ushort lastKey = ushort.MaxValue; - foreach (var kv in FullGameFields._dataDb.GetValues() - .OrderBy(kv=>ushort.Parse(kv.Key))) - { - var data = (CubeListData) kv.Value; - ushort currentKey = ushort.Parse(kv.Key); - var toReplace = new Dictionary - { - {"Scalable", ""}, {"Qtr", "Quarter"}, {"RNeg", "Rounded Negative"}, - {"Neg", "Negative"}, {"Tetra", "Tetrahedron"}, - {"RWedge", "Rounded Wedge"}, {"RTetra", "Rounded Tetrahedron"} - }; - string name = LocalizationService.Localize(data.CubeNameKey).Split(' ').Select(str => - str.Length > 0 ? char.ToUpper(str[0]) + str.Substring(1) : str).Aggregate((a, b) => a + b) - .Replace("-", ""); - foreach (var rkv in toReplace) - { - name = Regex.Replace(name, rkv.Key + "([A-Z]|$)", rkv.Value + "$1"); - } - Console.WriteLine($"{name}{(currentKey != lastKey + 1 ? $" = {currentKey}" : "")},"); - lastKey = currentKey; - } - }; - Game.Enter += (sender, e) => - { - ushort lastKey = ushort.MaxValue; - Console.WriteLine("Materials:\n" + FullGameFields._dataDb.GetValues() - .OrderBy(kv => ushort.Parse(kv.Key)) - .Select(kv => - { - ushort currentKey = ushort.Parse(kv.Key); - string result = $"{((MaterialPropertiesData)kv.Value).Name}{(currentKey != lastKey + 1 ? $" = {kv.Key}" : "")},"; - lastKey = currentKey; - return result; - }) - .Aggregate((a, b) => a + "\n" + b)); - };*/ - - CommandBuilder.Builder("takeScreenshot", "Enables the screenshot taker") - .Action(() => - { - Game.CurrentGame().EnableScreenshotTaker(); - }).Build(); - - CommandBuilder.Builder("testPositionDefault", "Tests the Block.Position property's default value.") - .Action(() => - { - IEnumerator Loop() - { - for (int i = 0; i < 2; i++) - { - Console.WriteLine("A"); - var block = Block.PlaceNew(BlockIDs.Cube, 1); - Console.WriteLine("B"); - while (!block.Exists) - yield return Yield.It; - Console.WriteLine("C"); - block.Remove(); - Console.WriteLine("D"); - while (block.Exists) - yield return Yield.It; - Console.WriteLine("E - Pos: " + block.Position); - block.Position = 4; - Console.WriteLine("F - Pos: " + block.Position); - } - } - - Loop().RunOn(Scheduler.leanRunner); - }).Build(); - - CommandBuilder.Builder("importAssetBundle") - .Action(() => - { - Logging.CommandLog("Importing asset bundle..."); - var ab = AssetBundle.LoadFromFile( - @"filepath"); - Logging.CommandLog("Imported asset bundle: " + ab); - var assets = ab.LoadAllAssets(); - Logging.CommandLog("Loaded " + assets.Length + " assets"); - foreach (var asset in assets) - { - Logging.CommandLog(asset); - } - }).Build(); - - bool shouldTestGhostBlock = false; - CommandBuilder.Builder("testGhostBlock") - .Action(() => - { - if (shouldTestGhostBlock) - { - shouldTestGhostBlock = false; - Logging.CommandLog("Test disabled"); - } - - shouldTestGhostBlock = true; - Scheduler.Schedule(new Repeatable(() => - { - var ghostBlock = Player.LocalPlayer.GetGhostBlock(); - if (ghostBlock == null) return; - ghostBlock.Position = Player.LocalPlayer.Position + 2; - ghostBlock.Color = new BlockColor(BlockColors.Lime); - }, () => shouldTestGhostBlock)); - Logging.CommandLog("Test enabled"); - }).Build(); - - Game.Enter += (sender, args) => - Console.WriteLine( - $"Current game selection data: {FullGameFields._gameSelectionData.gameMode} - {FullGameFields._gameSelectionData.saveType}"); -#if TEST - TestRoot.RunTests(); -#endif - } - - private string modsString; + private string modsString; private string InstalledMods() { - if (modsString != null) return modsString; - StringBuilder sb = new StringBuilder("Installed mods:"); - foreach (var plugin in PluginManager.Plugins) - sb.Append("\n" + plugin.Name + " - " + plugin.Version); - return modsString = sb.ToString(); - } - - [HarmonyPatch] - public class MinimumSpecsPatch - { - public static bool Prefix(ref bool __result) - { - __result = true; - return false; - } - - public static MethodInfo TargetMethod() - { - return ((Func) MinimumSpecsCheck.CheckRequirementsMet).Method; - } + if (modsString != null) return modsString; + StringBuilder sb = new StringBuilder("Installed mods:"); + foreach (var (_, plugin) in Chainloader.PluginInfos) + sb.Append("\n" + plugin.Metadata.Name + " - " + plugin.Metadata.Version); + return modsString = sb.ToString(); } } -#endif + + [HarmonyPatch] + public class MinimumSpecsPatch + { + public static bool Prefix(ref bool __result) + { + __result = true; + return false; + } + + public static MethodInfo TargetMethod() + { + return ((Func) MinimumSpecsCheck.CheckRequirementsMet).Method; + } + } + #endif } diff --git a/TechbloxModdingAPI/Utility/Dependency.cs b/TechbloxModdingAPI/Utility/Dependency.cs index 3f33277..b160ac9 100644 --- a/TechbloxModdingAPI/Utility/Dependency.cs +++ b/TechbloxModdingAPI/Utility/Dependency.cs @@ -1,7 +1,5 @@ using System; - -using IllusionInjector; -using IllusionPlugin; +using BepInEx.Bootstrap; namespace TechbloxModdingAPI.Utility { @@ -15,11 +13,11 @@ namespace TechbloxModdingAPI.Utility /// /// The plugin. /// The plugin's name. - public static IPlugin GetPlugin(string name) + public static BepInEx.PluginInfo GetPlugin(string name) { - foreach(IPlugin plugin in PluginManager.Plugins) + foreach(var plugin in Chainloader.PluginInfos.Values) { - if (plugin.Name == name) + if (plugin.Metadata.Name == name) { return plugin; } @@ -35,45 +33,15 @@ namespace TechbloxModdingAPI.Utility /// The plugin's name. public static Version GetPluginVersion(string name) { - IPlugin plugin = GetPlugin(name); + var plugin = GetPlugin(name); if (plugin != null) { try { - return new Version(plugin.Version); - } catch (Exception e) when ( - e is ArgumentException - || e is ArgumentNullException - || e is ArgumentOutOfRangeException - || e is FormatException - || e is OverflowException) {} + return plugin.Metadata.Version; + } catch (Exception e) when (e is ArgumentException or FormatException or OverflowException) {} return plugin.GetType().Assembly.GetName().Version; } return null; } - - // (I'm leaving the auto-generated version) - // - // Hell the specified name and version. - // - // The hell. - // Name. - // Version. - /// - /// Detect if you're in dependency hell with respect to the plugin. - /// ie Check if the plugin doesn't exist or is out of date. - /// When version is null, this only checks if the plugin exists. - /// The version is retrieved using GetPluginVersion(string name). - /// - /// Are you in dependency hell? - /// The plugin's name' - /// The target version. - public static bool Hell(string name, Version version = null) - { - Version pluginVersion = GetPluginVersion(name); - if (version == null) { - return pluginVersion == null; - } - return (pluginVersion == null || pluginVersion < version); - } } } -- 2.30.2