diff --git a/Commands/Modifying/Scale/SubCommands/Add.cs b/Commands/Modifying/Scale/SubCommands/Add.cs index 18bb82f..1478f36 100644 --- a/Commands/Modifying/Scale/SubCommands/Add.cs +++ b/Commands/Modifying/Scale/SubCommands/Add.cs @@ -43,7 +43,16 @@ public bool Execute(ArraySegment arguments, ICommandSender sender, out s if (arguments.Count >= 3 && TryGetVector(arguments.At(0), arguments.At(1), arguments.At(2), out Vector3 newScale)) { - mapEditorObject.Base.Scale += newScale; + if(mapEditorObject.GetComponentInParent() != null || mapEditorObject.GetComponentInChildren() != null) + { + AdminToys.WaypointToy waypointToy = mapEditorObject.GetComponent(); + WaypointToy waypointToy1 = WaypointToy.Get(waypointToy); + waypointToy1.BoundsSize += newScale; + response = waypointToy1.BoundsSize.ToString("F3"); + return true; + } + + mapEditorObject.Base.Scale += newScale; mapEditorObject.UpdateObjectAndCopies(); response = mapEditorObject.Base.Scale.ToString("F3"); diff --git a/Commands/Modifying/Scale/SubCommands/Set.cs b/Commands/Modifying/Scale/SubCommands/Set.cs index 2ea02ef..6fba1e9 100644 --- a/Commands/Modifying/Scale/SubCommands/Set.cs +++ b/Commands/Modifying/Scale/SubCommands/Set.cs @@ -41,9 +41,18 @@ public bool Execute(ArraySegment arguments, ICommandSender sender, out s return false; } - if (arguments.Count >= 3 && TryGetVector(arguments.At(0), arguments.At(1), arguments.At(2), out Vector3 newScale)) + if (arguments.Count >= 3 && TryGetVector(arguments.At(0), arguments.At(1), arguments.At(2), out Vector3 newScale)) { - mapEditorObject.Base.Scale = newScale; + if (mapEditorObject.GetComponentInParent() != null || mapEditorObject.GetComponentInChildren() != null) + { + AdminToys.WaypointToy waypointToy = mapEditorObject.GetComponent(); + WaypointToy waypointToy1 = WaypointToy.Get(waypointToy); + waypointToy1.BoundsSize = newScale; + response = waypointToy1.BoundsSize.ToString("F3"); + return true; + } + + mapEditorObject.Base.Scale = newScale; mapEditorObject.UpdateObjectAndCopies(); response = mapEditorObject.Base.Scale.ToString("F3"); diff --git a/Features/Serializable/Schematics/SchematicBlockData.cs b/Features/Serializable/Schematics/SchematicBlockData.cs index 5e2ae64..b8485ed 100644 --- a/Features/Serializable/Schematics/SchematicBlockData.cs +++ b/Features/Serializable/Schematics/SchematicBlockData.cs @@ -57,11 +57,10 @@ public GameObject Create(SchematicObject schematicObject, Transform parentTransf transform.localScale = BlockType switch { BlockType.Empty when Scale == Vector3.zero => Vector3.one, - BlockType.Waypoint => Scale * SerializableWaypoint.ScaleMultiplier, - _ => Scale, + BlockType.Waypoint => ApplyWaypointBounds(Scale, transform), + _ => Scale, }; - - if (gameObject.TryGetComponent(out AdminToyBase adminToyBase)) + if (gameObject.TryGetComponent(out AdminToyBase adminToyBase) && gameObject.GetComponent() == null) { if (Properties != null && Properties.TryGetValue("Static", out object isStatic) && Convert.ToBoolean(isStatic)) { @@ -75,8 +74,17 @@ public GameObject Create(SchematicObject schematicObject, Transform parentTransf return gameObject; } + private static Vector3 ApplyWaypointBounds(Vector3 scale, Transform t) + { + if (t.TryGetComponent(out var wp)) + { + LabApi.Features.Wrappers.WaypointToy waypointToy = LabApi.Features.Wrappers.WaypointToy.Get(wp); + waypointToy.BoundsSize = scale; + } + return scale; + } - private GameObject CreateEmpty(bool fallback = false) + private GameObject CreateEmpty(bool fallback = false) { if (fallback) Logger.Warn($"{BlockType} is not yet implemented. Object will be an empty GameObject instead."); diff --git a/Features/Serializable/SerializableWaypoint.cs b/Features/Serializable/SerializableWaypoint.cs index 9f0ef76..760b29e 100644 --- a/Features/Serializable/SerializableWaypoint.cs +++ b/Features/Serializable/SerializableWaypoint.cs @@ -11,7 +11,6 @@ namespace ProjectMER.Features.Serializable; public class SerializableWaypoint : SerializableObject, IIndicatorDefinition { - public const float ScaleMultiplier = 1 / 256f; public override GameObject? SpawnOrUpdateObject(Room? room = null, GameObject? instance = null) { @@ -21,7 +20,7 @@ public class SerializableWaypoint : SerializableObject, IIndicatorDefinition _prevIndex = Index; waypoint.transform.SetPositionAndRotation(position, rotation); - waypoint.transform.localScale = Scale * ScaleMultiplier; + waypoint.NetworkBoundsSize = Vector3.one; waypoint.NetworkMovementSmoothing = 60; waypoint.NetworkVisualizeBounds = true; diff --git a/ProjectMER.csproj b/ProjectMER.csproj index 18ec451..718be51 100644 --- a/ProjectMER.csproj +++ b/ProjectMER.csproj @@ -9,23 +9,304 @@ - - - - - - - - - - - - - + - + + ..\..\Dll2\LabAPI(Only)\Assembly-CSharp-firstpass.dll + + + ..\..\Dll2\LabAPI(Only)\Assembly-CSharp-Publicized.dll + + + ..\..\Dll2\LabAPI(Only)\BouncyCastle.Cryptography.dll + + + ..\..\Dll2\LabAPI(Only)\Caress.dll + + + ..\..\Dll2\LabAPI(Only)\CommandSystem.Core.dll + + + ..\..\Dll2\LabAPI(Only)\CustomPasses.dll + + + ..\..\Dll2\LabAPI(Only)\DnsClient.dll + + + ..\..\Dll2\LabAPI(Only)\Facepunch.Steamworks.Posix.dll + + + ..\..\Dll2\LabAPI(Only)\Interop.dll + + + ..\..\Dll2\LabAPI(Only)\LabApi.dll + + + ..\..\Dll2\LabAPI(Only)\Microsoft.Bcl.AsyncInterfaces.dll + + + ..\..\Dll2\LabAPI(Only)\Mirror.dll + + + ..\..\Dll2\LabAPI(Only)\Mirror.Components.dll + + + ..\..\Dll2\LabAPI(Only)\Mono.Security.dll + + + ..\..\Dll2\LabAPI(Only)\netstandard.dll + + + ..\..\Dll2\LabAPI(Only)\NorthwoodLib.dll + + + ..\..\Dll2\LabAPI(Only)\Pooling.dll + + + ..\..\Dll2\LabAPI(Only)\Snake.dll + + + ..\..\Dll2\LabAPI(Only)\Unity.TextMeshPro.dll + + + ..\..\Dll2\LabAPI(Only)\UnityEngine.dll + + + ..\..\DLL\UnityEngine.AccessibilityModule.dll + + + ..\..\DLL\UnityEngine.AIModule.dll + + + ..\..\DLL\UnityEngine.AndroidJNIModule.dll + + + ..\..\DLL\UnityEngine.AnimationModule.dll + + + ..\..\DLL\UnityEngine.ARModule.dll + + + ..\..\DLL\UnityEngine.AssetBundleModule.dll + + + ..\..\DLL\UnityEngine.AudioModule.dll + + + ..\..\DLL\UnityEngine.ClothModule.dll + + + ..\..\DLL\UnityEngine.ClusterInputModule.dll + + + ..\..\DLL\UnityEngine.ClusterRendererModule.dll + + + ..\..\DLL\UnityEngine.ContentLoadModule.dll + + + ..\..\Dll2\LabAPI(Only)\UnityEngine.CoreModule.dll + + + ..\..\DLL\UnityEngine.CrashReportingModule.dll + + + ..\..\DLL\UnityEngine.DirectorModule.dll + + + ..\..\DLL\UnityEngine.DSPGraphModule.dll + + + ..\..\DLL\UnityEngine.GameCenterModule.dll + + + ..\..\DLL\UnityEngine.GIModule.dll + + + ..\..\DLL\UnityEngine.GraphicsStateCollectionSerializerModule.dll + + + ..\..\DLL\UnityEngine.GridModule.dll + + + ..\..\DLL\UnityEngine.HierarchyCoreModule.dll + + + ..\..\DLL\UnityEngine.HotReloadModule.dll + + + ..\..\DLL\UnityEngine.ImageConversionModule.dll + + + ..\..\DLL\UnityEngine.IMGUIModule.dll + + + ..\..\DLL\UnityEngine.InputForUIModule.dll + + + ..\..\DLL\UnityEngine.InputLegacyModule.dll + + + ..\..\DLL\UnityEngine.InputModule.dll + + + ..\..\DLL\UnityEngine.JSONSerializeModule.dll + + + ..\..\DLL\UnityEngine.LocalizationModule.dll + + + ..\..\DLL\UnityEngine.MarshallingModule.dll + + + ..\..\DLL\UnityEngine.MultiplayerModule.dll + + + ..\..\DLL\UnityEngine.NVIDIAModule.dll + + + ..\..\DLL\UnityEngine.ParticleSystemModule.dll + + + ..\..\DLL\UnityEngine.PerformanceReportingModule.dll + + + ..\..\DLL\UnityEngine.Physics2DModule.dll + + + ..\..\Dll2\LabAPI(Only)\UnityEngine.PhysicsModule.dll + + + ..\..\DLL\UnityEngine.ProfilerModule.dll + + + ..\..\DLL\UnityEngine.PropertiesModule.dll + + + ..\..\DLL\UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll + + + ..\..\DLL\UnityEngine.ScreenCaptureModule.dll + + + ..\..\DLL\UnityEngine.ShaderVariantAnalyticsModule.dll + + + ..\..\DLL\UnityEngine.SharedInternalsModule.dll + + + ..\..\DLL\UnityEngine.SpriteMaskModule.dll + + + ..\..\DLL\UnityEngine.SpriteShapeModule.dll + + + ..\..\DLL\UnityEngine.StreamingModule.dll + + + ..\..\DLL\UnityEngine.SubstanceModule.dll + + + ..\..\DLL\UnityEngine.SubsystemsModule.dll + + + ..\..\DLL\UnityEngine.TerrainModule.dll + + + ..\..\DLL\UnityEngine.TerrainPhysicsModule.dll + + + ..\..\DLL\UnityEngine.TextCoreFontEngineModule.dll + + + ..\..\DLL\UnityEngine.TextCoreTextEngineModule.dll + + + ..\..\DLL\UnityEngine.TextRenderingModule.dll + + + ..\..\DLL\UnityEngine.TilemapModule.dll + + + ..\..\DLL\UnityEngine.TLSModule.dll + + + ..\..\DLL\UnityEngine.UI.dll + + + ..\..\DLL\UnityEngine.UIElementsModule.dll + + + ..\..\DLL\UnityEngine.UIElementsNativeModule.dll + + + ..\..\DLL\UnityEngine.UIModule.dll + + + ..\..\DLL\UnityEngine.UmbraModule.dll + + + ..\..\DLL\UnityEngine.UNETModule.dll + + + ..\..\DLL\UnityEngine.UnityAnalyticsCommonModule.dll + + + ..\..\DLL\UnityEngine.UnityAnalyticsModule.dll + + + ..\..\DLL\UnityEngine.UnityConnectModule.dll + + + ..\..\DLL\UnityEngine.UnityCurlModule.dll + + + ..\..\DLL\UnityEngine.UnityTestProtocolModule.dll + + + ..\..\DLL\UnityEngine.UnityWebRequestAssetBundleModule.dll + + + ..\..\DLL\UnityEngine.UnityWebRequestAudioModule.dll + + + ..\..\DLL\UnityEngine.UnityWebRequestModule.dll + + + ..\..\DLL\UnityEngine.UnityWebRequestTextureModule.dll + + + ..\..\DLL\UnityEngine.UnityWebRequestWWWModule.dll + + + ..\..\DLL\UnityEngine.VehiclesModule.dll + + + ..\..\DLL\UnityEngine.VFXModule.dll + + + ..\..\DLL\UnityEngine.VideoModule.dll + + + ..\..\DLL\UnityEngine.VirtualTexturingModule.dll + + + ..\..\DLL\UnityEngine.VRModule.dll + + + ..\..\DLL\UnityEngine.WindModule.dll + + + ..\..\DLL\UnityEngine.XRModule.dll + + + ..\..\Dll2\LabAPI(Only)\YamlDotNet.dll + + + ..\..\Dll2\LabAPI(Only)\zxing.dll +