diff --git a/NewHorizons/Builder/ShipLog/MapModeBuilder.cs b/NewHorizons/Builder/ShipLog/MapModeBuilder.cs index d1a174b0..ff52a30b 100644 --- a/NewHorizons/Builder/ShipLog/MapModeBuilder.cs +++ b/NewHorizons/Builder/ShipLog/MapModeBuilder.cs @@ -45,16 +45,16 @@ namespace NewHorizons.Builder.ShipLog } } - if (flagManualPositionUsed) + if (flagAutoPositionUsed) { if (flagAutoPositionUsed && flagManualPositionUsed) - NHLogger.LogWarning("Can't mix manual and automatic layout of ship log map mode, defaulting to manual"); - return ConstructMapModeManual(bodies, transformParent, greyScaleMaterial, currentNav, layer); - } - else if (flagAutoPositionUsed) - { + NHLogger.LogWarning("Can't mix manual and automatic layout of ship log map mode, defaulting to automatic"); return ConstructMapModeAuto(bodies, transformParent, greyScaleMaterial, layer); } + else if (flagManualPositionUsed) + { + return ConstructMapModeManual(bodies, transformParent, greyScaleMaterial, currentNav, layer); + } return null; } @@ -475,7 +475,12 @@ namespace NewHorizons.Builder.ShipLog private static void MakeNode(ref MapModeObject node, GameObject parent, Material greyScaleMaterial, int layer) { - const float padding = 100f; + // Space between this node and the previous node + // Take whatever scale will prevent overlap + var lastSiblingScale = node.lastSibling?.mainBody?.Config?.ShipLog?.mapMode?.scale ?? 1f; + var scale = node.mainBody?.Config?.ShipLog?.mapMode?.scale ?? 1f; + float padding = 100f * (scale + lastSiblingScale) / 2f; + Vector2 position = Vector2.zero; if (node.lastSibling != null) { diff --git a/NewHorizons/External/SerializableData/MVector2.cs b/NewHorizons/External/SerializableData/MVector2.cs index 77c3eccc..0e4aadd6 100644 --- a/NewHorizons/External/SerializableData/MVector2.cs +++ b/NewHorizons/External/SerializableData/MVector2.cs @@ -1,6 +1,9 @@ #region +using NewHorizons.Utility.DebugTools.Menu; +using NewHorizons.Utility.OWML; using Newtonsoft.Json; +using System; using UnityEngine; #endregion @@ -26,6 +29,11 @@ namespace NewHorizons.External.SerializableData public static implicit operator Vector2(MVector2 vec) { + if (vec == null) + { + NHLogger.LogWarning($"Null MVector2 can't be turned into a non-nullable Vector2, returning Vector2.zero - {Environment.StackTrace}"); + return Vector2.zero; + } return new Vector2(vec.x, vec.y); } } diff --git a/NewHorizons/manifest.json b/NewHorizons/manifest.json index 3359833d..447d846b 100644 --- a/NewHorizons/manifest.json +++ b/NewHorizons/manifest.json @@ -1,10 +1,10 @@ { "$schema": "https://raw.githubusercontent.com/amazingalek/owml/master/schemas/manifest_schema.json", "filename": "NewHorizons.dll", - "author": "xen, Bwc9876, clay, MegaPiggy, John, Trifid, Hawkbar, Book", + "author": "xen, Bwc9876, JohnCorby, MegaPiggy, Clay, Trifid, and friends", "name": "New Horizons", "uniqueName": "xen.NewHorizons", - "version": "1.18.7", + "version": "1.18.8", "owmlVersion": "2.9.8", "dependencies": [ "JohnCorby.VanillaFix", "_nebula.MenuFramework", "xen.CommonCameraUtility", "dgarro.CustomShipLogModes" ], "conflicts": [ "Raicuparta.QuantumSpaceBuddies", "PacificEngine.OW_CommonResources" ],