Mirror mode attempt and update to latest Techblox

This commit is contained in:
Norbi Peti 2021-11-04 20:58:12 +01:00
parent 72a447cc0e
commit 39be331d94
3 changed files with 335 additions and 90 deletions

View file

@ -9,6 +9,7 @@ using TechbloxModdingAPI.Blocks;
using TechbloxModdingAPI.Commands;
using TechbloxModdingAPI.Utility;
using IllusionPlugin;
using Techblox.Services.GameDetails;
using TechbloxModdingAPI.App;
using Unity.Mathematics;
using Main = TechbloxModdingAPI.Main;
@ -20,6 +21,8 @@ namespace BuildingTools
private readonly CommandUtils _commandUtils;
private readonly BlockSelections _blockSelections;
private readonly MirrorModeEngine _mirrorModeEngine = new MirrorModeEngine();
public BuildingTools()
{
_blockSelections = new BlockSelections();
@ -215,7 +218,9 @@ namespace BuildingTools
CommandBuilder.Builder("setLimits", "Sets the CPU and power limits.")
.Action((int cpu, int power) =>
{
var data = FullGameFields._dataDb.GetValue<BuildRulesData>(1);
//MachineRulesComponent 0U, GroupCompound<MACHINE, LOCAL>.BuildGroup
//var data = FullGameFields._dataDb.GetValue<BuildRulesData>(1);
var data = new BuildRulesData(); //TODO
Logging.CommandLog($"Old CPU limit: {data.CPULimitMax}, power limit: {data.PowerLimitMax}");
data.PowerLimitMax = power;
data.CPULimitMax = cpu;
@ -246,6 +251,8 @@ namespace BuildingTools
noGarage.Toggle();
}).Build();
_mirrorModeEngine.Init();
new Harmony("BuildTools").PatchAll(Assembly.GetExecutingAssembly());
}
@ -281,16 +288,11 @@ namespace BuildingTools
if (wire == null) return "";
var startPos = wire.Start.Position;
var endPos = wire.End.Position;
Console.WriteLine("Start port: " + wire.StartPort + " End port: " + wire.EndPort);
Console.WriteLine("Start block: " + wire.Start);
Console.WriteLine("End block: " + wire.End);
string startName = wire.StartPort != byte.MaxValue ? wire.Start.OutputPortName(wire.StartPort) : "no port";
string endName = wire.EndPort != byte.MaxValue ? wire.End.InputPortName(wire.EndPort) : "no port";
return $"Wire with {wire.Id}\n" +
$"- From block {wire.Start.Type} at {startPos.x:F} {startPos.y:F} {startPos.z:F}\n" +
$"- at port {startName}\n" +
$"- at port {wire.StartPortName}\n" +
$"- To block {wire.End.Type} at {endPos.x:F} {endPos.y:F} {endPos.z:F}\n" +
$"- at port {endName}";
$"- at port {wire.EndPortName}";
}
private static string GetBodyInfoInSimMode()

View file

@ -69,13 +69,13 @@
<HintPath>..\ref\TechbloxPreview_Data\Managed\Blocks.HUDFeedbackBlocks.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Blocks.HUDFeedbackBlocks.dll</HintPath>
</Reference>
<Reference Include="CommandLine">
<HintPath>..\ref\TechbloxPreview_Data\Managed\CommandLine.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\CommandLine.dll</HintPath>
<Reference Include="Boxophobic.TheVehetationEngine.Runtime">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Boxophobic.TheVehetationEngine.Runtime.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Boxophobic.TheVehetationEngine.Runtime.dll</HintPath>
</Reference>
<Reference Include="CommandLineCompositionRoot">
<HintPath>..\ref\TechbloxPreview_Data\Managed\CommandLineCompositionRoot.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\CommandLineCompositionRoot.dll</HintPath>
<Reference Include="Boxophobic.Utils.Scripts">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Boxophobic.Utils.Scripts.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Boxophobic.Utils.Scripts.dll</HintPath>
</Reference>
<Reference Include="DataLoader">
<HintPath>..\ref\TechbloxPreview_Data\Managed\DataLoader.dll</HintPath>
@ -85,6 +85,14 @@
<HintPath>..\ref\TechbloxPreview_Data\Managed\DDNA.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\DDNA.dll</HintPath>
</Reference>
<Reference Include="EasyButtons">
<HintPath>..\ref\TechbloxPreview_Data\Managed\EasyButtons.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\EasyButtons.dll</HintPath>
</Reference>
<Reference Include="EOSSDK">
<HintPath>..\ref\TechbloxPreview_Data\Managed\EOSSDK.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\EOSSDK.dll</HintPath>
</Reference>
<Reference Include="FMODUnity">
<HintPath>..\ref\TechbloxPreview_Data\Managed\FMODUnity.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\FMODUnity.dll</HintPath>
@ -105,6 +113,10 @@
<HintPath>..\ref\TechbloxPreview_Data\Managed\Gamecraft.BlockEntityFactory.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.BlockEntityFactory.dll</HintPath>
</Reference>
<Reference Include="Gamecraft.BlockGroups">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Gamecraft.BlockGroups.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.BlockGroups.dll</HintPath>
</Reference>
<Reference Include="Gamecraft.Blocks.DamagingSurfaceBlock">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.DamagingSurfaceBlock.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.DamagingSurfaceBlock.dll</HintPath>
@ -117,10 +129,6 @@
<HintPath>..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.GenericPhysicsBlocks.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.GenericPhysicsBlocks.dll</HintPath>
</Reference>
<Reference Include="Gamecraft.Blocks.LightBlock">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.LightBlock.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.LightBlock.dll</HintPath>
</Reference>
<Reference Include="Gamecraft.Blocks.LogicBlock">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.LogicBlock.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.LogicBlock.dll</HintPath>
@ -157,6 +165,10 @@
<HintPath>..\ref\TechbloxPreview_Data\Managed\Gamecraft.Damage.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Damage.dll</HintPath>
</Reference>
<Reference Include="Gamecraft.Effects">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Gamecraft.Effects.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Effects.dll</HintPath>
</Reference>
<Reference Include="Gamecraft.ExplosionFragments">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Gamecraft.ExplosionFragments.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.ExplosionFragments.dll</HintPath>
@ -209,6 +221,10 @@
<HintPath>..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.ModeBar.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.ModeBar.dll</HintPath>
</Reference>
<Reference Include="Gamecraft.GUI.OptionsScreen">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.OptionsScreen.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.OptionsScreen.dll</HintPath>
</Reference>
<Reference Include="Gamecraft.GUI.TabsBar.Blocks">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Blocks.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Blocks.dll</HintPath>
@ -265,74 +281,10 @@
<HintPath>..\ref\TechbloxPreview_Data\Managed\Gamecraft.PerformanceWarnings.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.PerformanceWarnings.dll</HintPath>
</Reference>
<Reference Include="Gamecraft.BlockGroups">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Gamecraft.BlockGroups.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.BlockGroups.dll</HintPath>
</Reference>
<Reference Include="Gamecraft.Effects">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Gamecraft.Effects.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Effects.dll</HintPath>
</Reference>
<Reference Include="Gamecraft.GUI.OptionsScreen">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.OptionsScreen.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.OptionsScreen.dll</HintPath>
</Reference>
<Reference Include="Gamecraft.PickupBlck">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Gamecraft.PickupBlck.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.PickupBlck.dll</HintPath>
</Reference>
<Reference Include="Havok.Physics.Hybrid">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Havok.Physics.Hybrid.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Havok.Physics.Hybrid.dll</HintPath>
</Reference>
<Reference Include="RobocraftX.Blocks.Ghost">
<HintPath>..\ref\TechbloxPreview_Data\Managed\RobocraftX.Blocks.Ghost.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Blocks.Ghost.dll</HintPath>
</Reference>
<Reference Include="RobocraftX.GUI.Inventory.ColourInventory">
<HintPath>..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.ColourInventory.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.ColourInventory.dll</HintPath>
</Reference>
<Reference Include="Robocraftx.ObjectIdBlocks">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Robocraftx.ObjectIdBlocks.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Robocraftx.ObjectIdBlocks.dll</HintPath>
</Reference>
<Reference Include="StringFormatter">
<HintPath>..\ref\TechbloxPreview_Data\Managed\StringFormatter.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\StringFormatter.dll</HintPath>
</Reference>
<Reference Include="Techblox.FlyCam">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Techblox.FlyCam.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Techblox.FlyCam.dll</HintPath>
</Reference>
<Reference Include="Unity.Addressables">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Unity.Addressables.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Unity.Addressables.dll</HintPath>
</Reference>
<Reference Include="Unity.Mathematics.Extensions">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Unity.Mathematics.Extensions.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Unity.Mathematics.Extensions.dll</HintPath>
</Reference>
<Reference Include="Unity.ResourceManager">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Unity.ResourceManager.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Unity.ResourceManager.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.AudioModule">
<HintPath>..\ref\TechbloxPreview_Data\Managed\UnityEngine.AudioModule.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.AudioModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.IMGUIModule">
<HintPath>..\ref\TechbloxPreview_Data\Managed\UnityEngine.IMGUIModule.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.IMGUIModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.SpriteShapeModule">
<HintPath>..\ref\TechbloxPreview_Data\Managed\UnityEngine.SpriteShapeModule.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.SpriteShapeModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UmbraModule">
<HintPath>..\ref\TechbloxPreview_Data\Managed\UnityEngine.UmbraModule.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UmbraModule.dll</HintPath>
</Reference>
<Reference Include="Gamecraft.PickupsCommon">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Gamecraft.PickupsCommon.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.PickupsCommon.dll</HintPath>
@ -393,6 +345,10 @@
<HintPath>..\ref\TechbloxPreview_Data\Managed\Havok.Physics.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Havok.Physics.dll</HintPath>
</Reference>
<Reference Include="Havok.Physics.Hybrid">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Havok.Physics.Hybrid.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Havok.Physics.Hybrid.dll</HintPath>
</Reference>
<Reference Include="JWT">
<HintPath>..\ref\TechbloxPreview_Data\Managed\JWT.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\JWT.dll</HintPath>
@ -445,6 +401,10 @@
<HintPath>..\ref\TechbloxPreview_Data\Managed\RobocraftX.Blocks.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Blocks.dll</HintPath>
</Reference>
<Reference Include="RobocraftX.Blocks.Ghost">
<HintPath>..\ref\TechbloxPreview_Data\Managed\RobocraftX.Blocks.Ghost.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Blocks.Ghost.dll</HintPath>
</Reference>
<Reference Include="RobocraftX.Blocks.Triggers">
<HintPath>..\ref\TechbloxPreview_Data\Managed\RobocraftX.Blocks.Triggers.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Blocks.Triggers.dll</HintPath>
@ -497,6 +457,10 @@
<HintPath>..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.BlocksInventory.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.BlocksInventory.dll</HintPath>
</Reference>
<Reference Include="RobocraftX.GUI.Inventory.ColourInventory">
<HintPath>..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.ColourInventory.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.ColourInventory.dll</HintPath>
</Reference>
<Reference Include="RobocraftX.GUI.Inventory">
<HintPath>..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.dll</HintPath>
@ -525,6 +489,10 @@
<HintPath>..\ref\TechbloxPreview_Data\Managed\RobocraftX.MainGame.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.MainGame.dll</HintPath>
</Reference>
<Reference Include="RobocraftX.MainGameMock">
<HintPath>..\ref\TechbloxPreview_Data\Managed\RobocraftX.MainGameMock.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.MainGameMock.dll</HintPath>
</Reference>
<Reference Include="RobocraftX.MainSimulation">
<HintPath>..\ref\TechbloxPreview_Data\Managed\RobocraftX.MainSimulation.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.MainSimulation.dll</HintPath>
@ -553,6 +521,10 @@
<HintPath>..\ref\TechbloxPreview_Data\Managed\RobocraftX.MultiplayerInput.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.MultiplayerInput.dll</HintPath>
</Reference>
<Reference Include="RobocraftX.ObjectIdBlocks">
<HintPath>..\ref\TechbloxPreview_Data\Managed\RobocraftX.ObjectIdBlocks.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.ObjectIdBlocks.dll</HintPath>
</Reference>
<Reference Include="RobocraftX.Party">
<HintPath>..\ref\TechbloxPreview_Data\Managed\RobocraftX.Party.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Party.dll</HintPath>
@ -569,10 +541,6 @@
<HintPath>..\ref\TechbloxPreview_Data\Managed\RobocraftX.Player.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Player.dll</HintPath>
</Reference>
<Reference Include="RobocraftX.Rendering">
<HintPath>..\ref\TechbloxPreview_Data\Managed\RobocraftX.Rendering.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Rendering.dll</HintPath>
</Reference>
<Reference Include="RobocraftX.Rendering.Mock">
<HintPath>..\ref\TechbloxPreview_Data\Managed\RobocraftX.Rendering.Mock.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Rendering.Mock.dll</HintPath>
@ -613,6 +581,10 @@
<HintPath>..\ref\TechbloxPreview_Data\Managed\SpecializedDescriptors.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\SpecializedDescriptors.dll</HintPath>
</Reference>
<Reference Include="StringFormatter">
<HintPath>..\ref\TechbloxPreview_Data\Managed\StringFormatter.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\StringFormatter.dll</HintPath>
</Reference>
<Reference Include="Svelto.Common">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Svelto.Common.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Svelto.Common.dll</HintPath>
@ -621,6 +593,10 @@
<HintPath>..\ref\TechbloxPreview_Data\Managed\Svelto.ECS.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Svelto.ECS.dll</HintPath>
</Reference>
<Reference Include="Svelto.ECS.GUI">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Svelto.ECS.GUI.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Svelto.ECS.GUI.dll</HintPath>
</Reference>
<Reference Include="Svelto.Services">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Svelto.Services.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Svelto.Services.dll</HintPath>
@ -629,14 +605,38 @@
<HintPath>..\ref\TechbloxPreview_Data\Managed\Svelto.Tasks.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Svelto.Tasks.dll</HintPath>
</Reference>
<Reference Include="Techblox.AtmosphereBlock">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Techblox.AtmosphereBlock.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Techblox.AtmosphereBlock.dll</HintPath>
</Reference>
<Reference Include="Techblox.AutoForward">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Techblox.AutoForward.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Techblox.AutoForward.dll</HintPath>
</Reference>
<Reference Include="Techblox.Backend">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Techblox.Backend.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Techblox.Backend.dll</HintPath>
</Reference>
<Reference Include="Techblox.Blocks.LightBlock">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Techblox.Blocks.LightBlock.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Techblox.Blocks.LightBlock.dll</HintPath>
</Reference>
<Reference Include="Techblox.Building.Rules">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Techblox.Building.Rules.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Techblox.Building.Rules.dll</HintPath>
</Reference>
<Reference Include="Techblox.BuildingDrone">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Techblox.BuildingDrone.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Techblox.BuildingDrone.dll</HintPath>
</Reference>
<Reference Include="Techblox.Camera">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Techblox.Camera.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Techblox.Camera.dll</HintPath>
</Reference>
<Reference Include="Techblox.ContextSensitiveTextHint">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Techblox.ContextSensitiveTextHint.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Techblox.ContextSensitiveTextHint.dll</HintPath>
</Reference>
<Reference Include="Techblox.EngineBlock">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Techblox.EngineBlock.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Techblox.EngineBlock.dll</HintPath>
@ -645,6 +645,50 @@
<HintPath>..\ref\TechbloxPreview_Data\Managed\Techblox.Environment.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Techblox.Environment.dll</HintPath>
</Reference>
<Reference Include="Techblox.EnvironmentBlocks.BuildingEnvironment">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Techblox.EnvironmentBlocks.BuildingEnvironment.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Techblox.EnvironmentBlocks.BuildingEnvironment.dll</HintPath>
</Reference>
<Reference Include="Techblox.EnvironmentBlocks">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Techblox.EnvironmentBlocks.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Techblox.EnvironmentBlocks.dll</HintPath>
</Reference>
<Reference Include="Techblox.EnvironmentBlocks.SimulationWorldEnvironment">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Techblox.EnvironmentBlocks.SimulationWorldEnvironment.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Techblox.EnvironmentBlocks.SimulationWorldEnvironment.dll</HintPath>
</Reference>
<Reference Include="Techblox.GameSelection">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Techblox.GameSelection.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Techblox.GameSelection.dll</HintPath>
</Reference>
<Reference Include="Techblox.GUI.Building">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Building.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Building.dll</HintPath>
</Reference>
<Reference Include="Techblox.GUI.BuildRules">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.BuildRules.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.BuildRules.dll</HintPath>
</Reference>
<Reference Include="Techblox.GUI.BuildRules.MockUps">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.BuildRules.MockUps.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.BuildRules.MockUps.dll</HintPath>
</Reference>
<Reference Include="Techblox.GUI">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.dll</HintPath>
</Reference>
<Reference Include="Techblox.GUI.GamePortal">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.GamePortal.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.GamePortal.dll</HintPath>
</Reference>
<Reference Include="Techblox.GUI.GamePortal.MockUps">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.GamePortal.MockUps.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.GamePortal.MockUps.dll</HintPath>
</Reference>
<Reference Include="Techblox.GUI.Hotbar.Landscapes">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Hotbar.Landscapes.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Hotbar.Landscapes.dll</HintPath>
</Reference>
<Reference Include="Techblox.GUI.Hotbar.Materials">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Hotbar.Materials.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Hotbar.Materials.dll</HintPath>
@ -653,14 +697,38 @@
<HintPath>..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Inventory.Common.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Inventory.Common.dll</HintPath>
</Reference>
<Reference Include="Techblox.GUI.Inventory.Landscapes">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Inventory.Landscapes.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Inventory.Landscapes.dll</HintPath>
</Reference>
<Reference Include="Techblox.GUI.Inventory.Materials">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Inventory.Materials.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Inventory.Materials.dll</HintPath>
</Reference>
<Reference Include="Techblox.GUI.Login">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Login.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Login.dll</HintPath>
</Reference>
<Reference Include="Techblox.GUI.Mocks">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Mocks.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Mocks.dll</HintPath>
</Reference>
<Reference Include="Techblox.GUI.Mocks.DynamicListBuild">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Mocks.DynamicListBuild.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Mocks.DynamicListBuild.dll</HintPath>
</Reference>
<Reference Include="Techblox.GUI.MyGamesScreen">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.MyGamesScreen.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.MyGamesScreen.dll</HintPath>
</Reference>
<Reference Include="Techblox.GUI.Notifications.MockUps">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Notifications.MockUps.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Notifications.MockUps.dll</HintPath>
</Reference>
<Reference Include="Techblox.GUI.TabsBar.Landscapes">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.TabsBar.Landscapes.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.TabsBar.Landscapes.dll</HintPath>
</Reference>
<Reference Include="Techblox.GUI.TabsBar.Materials">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.TabsBar.Materials.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.TabsBar.Materials.dll</HintPath>
@ -673,6 +741,46 @@
<HintPath>..\ref\TechbloxPreview_Data\Managed\Techblox.Pointer.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Techblox.Pointer.dll</HintPath>
</Reference>
<Reference Include="Techblox.ProceduralReflectionProbes">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Techblox.ProceduralReflectionProbes.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Techblox.ProceduralReflectionProbes.dll</HintPath>
</Reference>
<Reference Include="Techblox.Rendering.Common">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Techblox.Rendering.Common.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Techblox.Rendering.Common.dll</HintPath>
</Reference>
<Reference Include="Techblox.Rendering">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Techblox.Rendering.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Techblox.Rendering.dll</HintPath>
</Reference>
<Reference Include="Techblox.Rendering.DOTS">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Techblox.Rendering.DOTS.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Techblox.Rendering.DOTS.dll</HintPath>
</Reference>
<Reference Include="Techblox.Rendering.GPUI">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Techblox.Rendering.GPUI.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Techblox.Rendering.GPUI.dll</HintPath>
</Reference>
<Reference Include="Techblox.Rendering.Unity">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Techblox.Rendering.Unity.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Techblox.Rendering.Unity.dll</HintPath>
</Reference>
<Reference Include="Techblox.SaveGamesConversion">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Techblox.SaveGamesConversion.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Techblox.SaveGamesConversion.dll</HintPath>
</Reference>
<Reference Include="Techblox.Services.Eos">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Techblox.Services.Eos.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Techblox.Services.Eos.dll</HintPath>
</Reference>
<Reference Include="Techblox.Services.GameDetails">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Techblox.Services.GameDetails.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Techblox.Services.GameDetails.dll</HintPath>
</Reference>
<Reference Include="Techblox.Services.Storage">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Techblox.Services.Storage.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Techblox.Services.Storage.dll</HintPath>
</Reference>
<Reference Include="Techblox.SwitchAnimation">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Techblox.SwitchAnimation.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Techblox.SwitchAnimation.dll</HintPath>
@ -701,6 +809,10 @@
<HintPath>..\ref\TechbloxPreview_Data\Managed\UniTask.TextMeshPro.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\UniTask.TextMeshPro.dll</HintPath>
</Reference>
<Reference Include="Unity.Addressables">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Unity.Addressables.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Unity.Addressables.dll</HintPath>
</Reference>
<Reference Include="Unity.Burst.Cecil">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.dll</HintPath>
@ -757,6 +869,10 @@
<HintPath>..\ref\TechbloxPreview_Data\Managed\Unity.Mathematics.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Unity.Mathematics.dll</HintPath>
</Reference>
<Reference Include="Unity.Mathematics.Extensions">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Unity.Mathematics.Extensions.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Unity.Mathematics.Extensions.dll</HintPath>
</Reference>
<Reference Include="Unity.Mathematics.Extensions.Hybrid">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll</HintPath>
@ -789,6 +905,18 @@
<HintPath>..\ref\TechbloxPreview_Data\Managed\Unity.Properties.UI.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Unity.Properties.UI.dll</HintPath>
</Reference>
<Reference Include="Unity.Recorder.Base">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Unity.Recorder.Base.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Unity.Recorder.Base.dll</HintPath>
</Reference>
<Reference Include="Unity.Recorder">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Unity.Recorder.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Unity.Recorder.dll</HintPath>
</Reference>
<Reference Include="Unity.Rendering.Hybrid">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Unity.Rendering.Hybrid.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Unity.Rendering.Hybrid.dll</HintPath>
</Reference>
<Reference Include="Unity.RenderPipelines.Core.Runtime">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll</HintPath>
@ -809,6 +937,10 @@
<HintPath>..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll</HintPath>
</Reference>
<Reference Include="Unity.ResourceManager">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Unity.ResourceManager.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Unity.ResourceManager.dll</HintPath>
</Reference>
<Reference Include="Unity.Scenes">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Unity.Scenes.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Unity.Scenes.dll</HintPath>
@ -865,6 +997,10 @@
<HintPath>..\ref\TechbloxPreview_Data\Managed\UnityEngine.AssetBundleModule.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.AssetBundleModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.AudioModule">
<HintPath>..\ref\TechbloxPreview_Data\Managed\UnityEngine.AudioModule.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.AudioModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.ClothModule">
<HintPath>..\ref\TechbloxPreview_Data\Managed\UnityEngine.ClothModule.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.ClothModule.dll</HintPath>
@ -917,6 +1053,10 @@
<HintPath>..\ref\TechbloxPreview_Data\Managed\UnityEngine.ImageConversionModule.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.ImageConversionModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.IMGUIModule">
<HintPath>..\ref\TechbloxPreview_Data\Managed\UnityEngine.IMGUIModule.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.IMGUIModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.InputLegacyModule">
<HintPath>..\ref\TechbloxPreview_Data\Managed\UnityEngine.InputLegacyModule.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.InputLegacyModule.dll</HintPath>
@ -969,6 +1109,10 @@
<HintPath>..\ref\TechbloxPreview_Data\Managed\UnityEngine.SpriteMaskModule.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.SpriteMaskModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.SpriteShapeModule">
<HintPath>..\ref\TechbloxPreview_Data\Managed\UnityEngine.SpriteShapeModule.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.SpriteShapeModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.StreamingModule">
<HintPath>..\ref\TechbloxPreview_Data\Managed\UnityEngine.StreamingModule.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.StreamingModule.dll</HintPath>
@ -1021,6 +1165,10 @@
<HintPath>..\ref\TechbloxPreview_Data\Managed\UnityEngine.UIModule.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UIModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UmbraModule">
<HintPath>..\ref\TechbloxPreview_Data\Managed\UnityEngine.UmbraModule.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UmbraModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UNETModule">
<HintPath>..\ref\TechbloxPreview_Data\Managed\UnityEngine.UNETModule.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UNETModule.dll</HintPath>
@ -1089,14 +1237,14 @@
<HintPath>..\ref\TechbloxPreview_Data\Managed\UnityEngine.XRModule.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.XRModule.dll</HintPath>
</Reference>
<Reference Include="uREPL">
<HintPath>..\ref\TechbloxPreview_Data\Managed\uREPL.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\uREPL.dll</HintPath>
</Reference>
<Reference Include="VisualProfiler">
<HintPath>..\ref\TechbloxPreview_Data\Managed\VisualProfiler.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\VisualProfiler.dll</HintPath>
</Reference>
<Reference Include="Whinarn.UnityMeshSimplifier.Runtime">
<HintPath>..\ref\TechbloxPreview_Data\Managed\Whinarn.UnityMeshSimplifier.Runtime.dll</HintPath>
<HintPath>..\..\ref\TechbloxPreview_Data\Managed\Whinarn.UnityMeshSimplifier.Runtime.dll</HintPath>
</Reference>
</ItemGroup>
<Target Name="CopyToPlugins" AfterTargets="AfterBuild">

View file

@ -0,0 +1,95 @@
using System;
using System.Collections.Generic;
using Gamecraft.GUI.Blueprints;
using RobocraftX.Blocks.Ghost;
using RobocraftX.Common;
using RobocraftX.CR.MachineEditing.BoxSelect;
using RobocraftX.Physics;
using Svelto.ECS;
using Svelto.ECS.EntityStructs;
using Svelto.Tasks;
using Svelto.Tasks.Enumerators;
using Svelto.Tasks.Lean;
using Techblox.Blocks;
using TechbloxModdingAPI;
using TechbloxModdingAPI.App;
using TechbloxModdingAPI.Blocks;
using TechbloxModdingAPI.Blocks.Engines;
using TechbloxModdingAPI.Engines;
using TechbloxModdingAPI.Interface.IMGUI;
using TechbloxModdingAPI.Players;
using TechbloxModdingAPI.Tasks;
using TechbloxModdingAPI.Utility;
using Unity.Mathematics;
using UnityEngine;
namespace BuildingTools
{
public class MirrorModeEngine : IApiEngine
{
private Button _button;
private bool _enabled;
private Block _lastPlaced;
private Block _ghostBlock;
private void BlockOnPlaced(object sender, BlockPlacedRemovedEventArgs e)
{
if (!_enabled) return;
if (Player.LocalPlayer.BuildingMode != PlayerBuildingMode.BlockMode) return;
if (e.ID == _lastPlaced?.Id) return;
_lastPlaced = e.Block.Copy();
_lastPlaced.Position *= new float3(-1, 1, 1);
//_lastPlaced.Flipped = !_lastPlaced.Flipped;
if (math.abs(_lastPlaced.Rotation.y - 90) < float.Epsilon ||
math.abs(_lastPlaced.Rotation.y - 270) < float.Epsilon)
_lastPlaced.Rotation += new float3(0, 180, 0);
}
public void Init()
{
/*Block.Placed += BlockOnPlaced; - TODO.
Game.Enter += OnGameOnEnter;
Game.Exit += (sender, args) => _button = null;*/
}
private void OnGameOnEnter(object sender, GameEventArgs args)
{
_button = new Button("Mirror mode");
_button.OnClick += (_, __) => _enabled = !_enabled;
TryCreateGhostBlock().RunOn(Scheduler.leanRunner);
}
private IEnumerator<TaskContract> TryCreateGhostBlock()
{
int c = 0;
while (_ghostBlock == null && c++ < 10)
{
Console.WriteLine($"Ghost block is {_ghostBlock} and c is {c}");
try
{
//_ghostBlock = Block.CreateGhostBlock();
Console.WriteLine($"New block: {_ghostBlock}");
_ghostBlock.Position += 1;
}
catch (Exception e)
{
Console.WriteLine(e);
}
yield return new WaitForSecondsEnumerator(1f).Continue();
}
}
public void Ready()
{
}
public EntitiesDB entitiesDB { get; set; }
public void Dispose()
{
}
public string Name { get; } = "BuildingToolsMirroModeEngine";
public bool isRemovable { get; } = true;
}
}