From 63295f82c97b7f5683a53401f6e9bf18f527e449 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Tue, 7 Sep 2021 23:15:03 +0200 Subject: [PATCH] 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); } }