## Minor features
- Added an option to use a detail for asteroid belts, instead of just
procgen.
- Also added asteroid belt options for gravity and random orientation.
- Added `selectable` to map mode info, allowing you to make the map mode
icon not able to be selected (useful for bodies without ship logs like
stars) Fixes #1003

## Improvements
- Added option separate from Debug for visualizing quantum object
visibility shapes

## Bug fixes
- Fixed the proxy shadow caster on heightmaps, so they cast shadows onto
other bodies better (fixes #1001)
This commit is contained in:
xen-42 2025-01-06 10:48:47 -05:00 committed by GitHub
commit be810425d6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
13 changed files with 193 additions and 60 deletions

View File

@ -1,6 +1,7 @@
using NewHorizons.External; using NewHorizons.External;
using NewHorizons.External.Configs; using NewHorizons.External.Configs;
using NewHorizons.External.Modules; using NewHorizons.External.Modules;
using NewHorizons.External.Modules.Props;
using NewHorizons.External.SerializableData; using NewHorizons.External.SerializableData;
using NewHorizons.Handlers; using NewHorizons.Handlers;
using NewHorizons.Utility.OWML; using NewHorizons.Utility.OWML;
@ -36,7 +37,7 @@ namespace NewHorizons.Builder.Body
config.Base = new BaseModule() config.Base = new BaseModule()
{ {
surfaceGravity = 1, surfaceGravity = belt.gravity,
surfaceSize = size, surfaceSize = size,
gravityFallOff = GravityFallOff.InverseSquared gravityFallOff = GravityFallOff.InverseSquared
}; };
@ -49,7 +50,8 @@ namespace NewHorizons.Builder.Body
trueAnomaly = 360f * (i + Random.Range(-0.2f, 0.2f)) / (float)count, trueAnomaly = 360f * (i + Random.Range(-0.2f, 0.2f)) / (float)count,
primaryBody = bodyName, primaryBody = bodyName,
semiMajorAxis = Random.Range(belt.innerRadius, belt.outerRadius), semiMajorAxis = Random.Range(belt.innerRadius, belt.outerRadius),
showOrbitLine = false showOrbitLine = false,
isTidallyLocked = true
}; };
config.ReferenceFrame = new ReferenceFrameModule() config.ReferenceFrame = new ReferenceFrameModule()
@ -62,8 +64,30 @@ namespace NewHorizons.Builder.Body
enabled = false enabled = false
}; };
config.ProcGen = belt.procGen; if (!string.IsNullOrEmpty(belt.assetBundle) || !string.IsNullOrEmpty(belt.path))
if (config.ProcGen == null) {
config.Props = new PropModule()
{
details = new DetailInfo[1]
{
new DetailInfo()
{
assetBundle = belt.assetBundle,
path = belt.path,
scale = size,
rotation = belt.randomOrientation ? Random.rotation.eulerAngles : Vector3.zero,
keepLoaded = true
}
}
};
}
else if (belt.procGen != null)
{
config.ProcGen = belt.procGen;
config.ProcGen.scale = size;
}
else
{ {
config.ProcGen = new ProcGenModule() config.ProcGen = new ProcGenModule()
{ {
@ -71,11 +95,6 @@ namespace NewHorizons.Builder.Body
color = new MColor(126, 94, 73) color = new MColor(126, 94, 73)
}; };
} }
else
{
// Still update the size
config.ProcGen.scale = size;
}
var asteroid = new NewHorizonsBody(config, mod); var asteroid = new NewHorizonsBody(config, mod);
PlanetCreationHandler.GenerateBody(asteroid); PlanetCreationHandler.GenerateBody(asteroid);

View File

@ -91,14 +91,15 @@ namespace NewHorizons.Builder.Body
level2.name += "1"; level2.name += "1";
LODGroup.RecalculateBounds(); LODGroup.RecalculateBounds();
// do this only for LOD because only the main body uses LOD, while title screen and proxies dont
var superGroup = planetGO.GetComponent<ProxyShadowCasterSuperGroup>();
if (superGroup != null) level2.gameObject.AddComponent<ProxyShadowCaster>()._superGroup = superGroup;
} }
var cubeSphereSC = cubeSphere.AddComponent<SphereCollider>(); var cubeSphereSC = cubeSphere.AddComponent<SphereCollider>();
cubeSphereSC.radius = Mathf.Min(module.minHeight, module.maxHeight) * Mathf.Min(stretch.x, stretch.y, stretch.z); cubeSphereSC.radius = Mathf.Min(module.minHeight, module.maxHeight) * Mathf.Min(stretch.x, stretch.y, stretch.z);
var superGroup = planetGO.GetComponent<ProxyShadowCasterSuperGroup>();
if (superGroup != null) cubeSphere.AddComponent<ProxyShadowCaster>()._superGroup = superGroup;
cubeSphere.SetActive(true); cubeSphere.SetActive(true);
// Now that we've made the mesh we can delete the heightmap texture // Now that we've made the mesh we can delete the heightmap texture

View File

@ -15,11 +15,11 @@ namespace NewHorizons.Builder.Props
public static void Make(GameObject go, Sector sector, PlanetConfig config, IModBehaviour mod, QuantumGroupInfo quantumGroup, GameObject[] propsInGroup) public static void Make(GameObject go, Sector sector, PlanetConfig config, IModBehaviour mod, QuantumGroupInfo quantumGroup, GameObject[] propsInGroup)
{ {
switch(quantumGroup.type) switch (quantumGroup.type)
{ {
case QuantumGroupType.Sockets: MakeSocketGroup (go, sector, config, mod, quantumGroup, propsInGroup); return; case QuantumGroupType.Sockets: MakeSocketGroup(go, sector, config, mod, quantumGroup, propsInGroup); return;
case QuantumGroupType.States: MakeStateGroup (go, sector, config, mod, quantumGroup, propsInGroup); return; case QuantumGroupType.States: MakeStateGroup(go, sector, config, mod, quantumGroup, propsInGroup); return;
// case PropModule.QuantumGroupType.Shuffle: MakeShuffleGroup(go, sector, config, mod, quantumGroup, propsInGroup); return; // case PropModule.QuantumGroupType.Shuffle: MakeShuffleGroup(go, sector, config, mod, quantumGroup, propsInGroup); return;
} }
} }
@ -44,7 +44,7 @@ namespace NewHorizons.Builder.Props
socket.SetActive(true); socket.SetActive(true);
} }
foreach(var prop in propsInGroup) foreach (var prop in propsInGroup)
{ {
prop.SetActive(false); prop.SetActive(false);
var quantumObject = prop.AddComponent<SocketedQuantumObject>(); var quantumObject = prop.AddComponent<SocketedQuantumObject>();
@ -72,7 +72,7 @@ namespace NewHorizons.Builder.Props
groupRoot.transform.localPosition = Vector3.zero; groupRoot.transform.localPosition = Vector3.zero;
var states = new List<QuantumState>(); var states = new List<QuantumState>();
foreach(var prop in propsInGroup) foreach (var prop in propsInGroup)
{ {
prop.transform.parent = groupRoot.transform; prop.transform.parent = groupRoot.transform;
var state = prop.AddComponent<QuantumState>(); var state = prop.AddComponent<QuantumState>();
@ -97,7 +97,7 @@ namespace NewHorizons.Builder.Props
var boxShape = empty.AddComponent<BoxShape>(); var boxShape = empty.AddComponent<BoxShape>();
boxShape.center = boxBounds.center; boxShape.center = boxBounds.center;
boxShape.extents = boxBounds.size; boxShape.extents = boxBounds.size;
if (Main.Debug) empty.AddComponent<BoxShapeVisualizer>(); empty.AddComponent<BoxShapeVisualizer>();
empty.AddComponent<ShapeVisibilityTracker>(); empty.AddComponent<ShapeVisibilityTracker>();
} }
@ -136,7 +136,7 @@ namespace NewHorizons.Builder.Props
{ {
public MeshFilter f; public MeshFilter f;
public SkinnedMeshRenderer s; public SkinnedMeshRenderer s;
public GameObject g; public GameObject gameObject;
} }
public static void AddBoundsVisibility(GameObject g) public static void AddBoundsVisibility(GameObject g)
@ -145,19 +145,19 @@ namespace NewHorizons.Builder.Props
var skinnedMeshRenderers = g.GetComponentsInChildren<SkinnedMeshRenderer>(); var skinnedMeshRenderers = g.GetComponentsInChildren<SkinnedMeshRenderer>();
var boxShapeRecievers = meshFilters var boxShapeRecievers = meshFilters
.Select(f => new BoxShapeReciever() { f=f, g=f.gameObject }) .Select(f => new BoxShapeReciever() { f = f, gameObject = f.gameObject })
.Concat ( .Concat(
skinnedMeshRenderers.Select(s => new BoxShapeReciever() { s=s, g=s.gameObject }) skinnedMeshRenderers.Select(s => new BoxShapeReciever() { s = s, gameObject = s.gameObject })
) )
.ToList(); .ToList();
foreach(var boxshapeReciever in boxShapeRecievers) foreach (var boxshapeReciever in boxShapeRecievers)
{ {
var box = boxshapeReciever.g.AddComponent<BoxShape>(); var box = boxshapeReciever.gameObject.AddComponent<BoxShape>();
boxshapeReciever.g.AddComponent<ShapeVisibilityTracker>(); boxshapeReciever.gameObject.AddComponent<ShapeVisibilityTracker>();
if (Main.Debug) boxshapeReciever.g.AddComponent<BoxShapeVisualizer>(); boxshapeReciever.gameObject.AddComponent<BoxShapeVisualizer>();
var fixer = boxshapeReciever.g.AddComponent<BoxShapeFixer>(); var fixer = boxshapeReciever.gameObject.AddComponent<BoxShapeFixer>();
fixer.shape = box; fixer.shape = box;
fixer.meshFilter = boxshapeReciever.f; fixer.meshFilter = boxshapeReciever.f;
fixer.skinnedMeshRenderer = boxshapeReciever.s; fixer.skinnedMeshRenderer = boxshapeReciever.s;
@ -213,9 +213,13 @@ namespace NewHorizons.Builder.Props
public MeshFilter meshFilter; public MeshFilter meshFilter;
public SkinnedMeshRenderer skinnedMeshRenderer; public SkinnedMeshRenderer skinnedMeshRenderer;
void Update() public void Update()
{ {
if (meshFilter == null && skinnedMeshRenderer == null) { NHLogger.LogVerbose("Useless BoxShapeFixer, destroying"); DestroyImmediate(this); } if (meshFilter == null && skinnedMeshRenderer == null)
{
NHLogger.LogVerbose("Useless BoxShapeFixer, destroying");
DestroyImmediate(this);
}
Mesh sharedMesh = null; Mesh sharedMesh = null;
if (meshFilter != null) sharedMesh = meshFilter.sharedMesh; if (meshFilter != null) sharedMesh = meshFilter.sharedMesh;

View File

@ -21,11 +21,25 @@ namespace NewHorizons.Builder.ShipLog
{ {
// Takes the game object because sometimes we change the AO to an NHAO and it breaks // Takes the game object because sometimes we change the AO to an NHAO and it breaks
private static Dictionary<GameObject, ShipLogAstroObject> _astroObjectToShipLog = new(); private static Dictionary<GameObject, ShipLogAstroObject> _astroObjectToShipLog = new();
private static Dictionary<ShipLogAstroObject, MapModeInfo> _astroObjectToMapModeInfo = new();
public static MapModeInfo GetMapModeInfoForAstroObject(ShipLogAstroObject slao)
{
if (_astroObjectToMapModeInfo.TryGetValue(slao, out var mapModeInfo))
{
return mapModeInfo;
}
else
{
return null;
}
}
#region General #region General
public static ShipLogAstroObject[][] ConstructMapMode(string systemName, GameObject transformParent, ShipLogAstroObject[][] currentNav, int layer) public static ShipLogAstroObject[][] ConstructMapMode(string systemName, GameObject transformParent, ShipLogAstroObject[][] currentNav, int layer)
{ {
_astroObjectToShipLog = new(); _astroObjectToShipLog = new();
_astroObjectToMapModeInfo = new();
// Add stock planets // Add stock planets
foreach (var shipLogAstroObject in currentNav.SelectMany(x => x)) foreach (var shipLogAstroObject in currentNav.SelectMany(x => x))
@ -65,7 +79,7 @@ namespace NewHorizons.Builder.ShipLog
else else
{ {
flagManualPositionUsed = true; flagManualPositionUsed = true;
if (body.Config.ShipLog?.mapMode?.manualNavigationPosition == null) if (body.Config.ShipLog?.mapMode != null && body.Config.ShipLog.mapMode.manualNavigationPosition == null && body.Config.ShipLog.mapMode.selectable)
{ {
NHLogger.LogError("Navigation position is missing for: " + body.Config.name); NHLogger.LogError("Navigation position is missing for: " + body.Config.name);
return null; return null;
@ -172,6 +186,7 @@ namespace NewHorizons.Builder.ShipLog
ShipLogAstroObject astroObject = gameObject.AddComponent<ShipLogAstroObject>(); ShipLogAstroObject astroObject = gameObject.AddComponent<ShipLogAstroObject>();
astroObject._id = ShipLogHandler.GetAstroObjectId(body); astroObject._id = ShipLogHandler.GetAstroObjectId(body);
_astroObjectToShipLog[body.Object] = astroObject; _astroObjectToShipLog[body.Object] = astroObject;
_astroObjectToMapModeInfo[astroObject] = body.Config.ShipLog?.mapMode;
Texture2D image = null; Texture2D image = null;
Texture2D outline = null; Texture2D outline = null;
@ -582,7 +597,10 @@ namespace NewHorizons.Builder.ShipLog
astroObject._unviewedObj.GetComponent<Image>().enabled = false; astroObject._unviewedObj.GetComponent<Image>().enabled = false;
} }
node.astroObject = astroObject; node.astroObject = astroObject;
if (node.lastSibling != null) ConnectNodeToLastSibling(node, greyScaleMaterial); if (NewHorizons.Main.Debug)
{
if (node.lastSibling != null) ConnectNodeToLastSibling(node, greyScaleMaterial);
}
MakeDetails(node.mainBody, newNodeGO.transform, greyScaleMaterial); MakeDetails(node.mainBody, newNodeGO.transform, greyScaleMaterial);
} }
#endregion #endregion

View File

@ -1,4 +1,4 @@
using System.ComponentModel; using System.ComponentModel;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using Newtonsoft.Json; using Newtonsoft.Json;
@ -13,7 +13,7 @@ namespace NewHorizons.External.Modules
[Range(-1, 200)] [DefaultValue(-1)] public int amount = -1; [Range(-1, 200)] [DefaultValue(-1)] public int amount = -1;
/// <summary> /// <summary>
/// Angle between the rings and the equatorial plane of the planet. /// Angle between the belt and the equatorial plane of the planet.
/// </summary> /// </summary>
public float inclination; public float inclination;
@ -23,7 +23,7 @@ namespace NewHorizons.External.Modules
[Range(0f, double.MaxValue)] public float innerRadius; [Range(0f, double.MaxValue)] public float innerRadius;
/// <summary> /// <summary>
/// Angle defining the point where the rings rise up from the planet's equatorial plane if inclination is nonzero. /// Angle defining the point where the belt rises up from the planet's equatorial plane if inclination is nonzero.
/// </summary> /// </summary>
public float longitudeOfAscendingNode; public float longitudeOfAscendingNode;
@ -45,7 +45,7 @@ namespace NewHorizons.External.Modules
[Range(0f, double.MaxValue)] public float outerRadius; [Range(0f, double.MaxValue)] public float outerRadius;
/// <summary> /// <summary>
/// How the asteroids are generated /// How the asteroids are generated, unless you supply a detail yourself using "assetBundle" and "path"
/// </summary> /// </summary>
public ProcGenModule procGen; public ProcGenModule procGen;
@ -53,5 +53,30 @@ namespace NewHorizons.External.Modules
/// Number used to randomize asteroid positions /// Number used to randomize asteroid positions
/// </summary> /// </summary>
public int randomSeed; public int randomSeed;
/// <summary>
/// You can use this to load a custom asset or ingame object, instead of using ProcGen. It will be scaled by "minSize" and "maxSize", so ideally it should be near a 1 meter radius.
/// This is a relative filepath to an asset-bundle to load the prefab defined in `path` from.
/// </summary>
public string assetBundle;
/// <summary>
/// You can use this to load a custom asset or ingame object, instead of using ProcGen. It will be scaled by "minSize" and "maxSize", so ideally it should be near a 1 meter radius.
/// This is either the path in the scene hierarchy of the item to copy or the path to the object in the supplied asset bundle.
/// </summary>
public string path;
/// <summary>
/// Surface gravity of the asteroids.
/// </summary>
[Range(0f, double.MaxValue)]
[DefaultValue(1)]
public float gravity = 1f;
/// <summary>
/// Should the detail of the asteroid be randomly oriented, or should it point towards the center.
/// </summary>
[DefaultValue(true)]
public bool randomOrientation = true;
} }
} }

View File

@ -79,6 +79,12 @@ namespace NewHorizons.External.Modules
/// Scale to apply to the planet in map mode. /// Scale to apply to the planet in map mode.
/// </summary> /// </summary>
[DefaultValue(1f)] public float scale = 1f; [DefaultValue(1f)] public float scale = 1f;
/// <summary>
/// Can this ship log map mode entry be selected
/// Ex) Set to false for stars with no entries on them so they are skipped in navigation
/// </summary>
[DefaultValue(true)] public bool selectable = true;
} }
[JsonObject] [JsonObject]

View File

@ -47,6 +47,7 @@ namespace NewHorizons
// Settings // Settings
public static bool Debug { get; private set; } public static bool Debug { get; private set; }
public static bool VisualizeQuantumObjects { get; private set; }
public static bool VerboseLogs { get; private set; } public static bool VerboseLogs { get; private set; }
public static bool SequentialPreCaching { get; private set; } public static bool SequentialPreCaching { get; private set; }
public static bool CustomTitleScreen { get; private set; } public static bool CustomTitleScreen { get; private set; }
@ -134,6 +135,7 @@ namespace NewHorizons
var currentScene = SceneManager.GetActiveScene().name; var currentScene = SceneManager.GetActiveScene().name;
Debug = config.GetSettingsValue<bool>(nameof(Debug)); Debug = config.GetSettingsValue<bool>(nameof(Debug));
VisualizeQuantumObjects = config.GetSettingsValue<bool>(nameof(VisualizeQuantumObjects));
VerboseLogs = config.GetSettingsValue<bool>(nameof(VerboseLogs)); VerboseLogs = config.GetSettingsValue<bool>(nameof(VerboseLogs));
SequentialPreCaching = config.GetSettingsValue<bool>(nameof(SequentialPreCaching)); SequentialPreCaching = config.GetSettingsValue<bool>(nameof(SequentialPreCaching));

View File

@ -31,7 +31,7 @@ namespace NewHorizons.Patches.ShipLogPatches
{ {
// Custom astro objects might have no entries, in this case they will be permanently hidden // Custom astro objects might have no entries, in this case they will be permanently hidden
// Just treat it as if it were revealed // Just treat it as if it were revealed
if (__instance._entries.Count == 0) if (__instance._entries == null || __instance._entries.Count == 0)
{ {
__instance._state = ShipLogEntry.State.Explored; __instance._state = ShipLogEntry.State.Explored;
__instance._imageObj.SetActive(true); __instance._imageObj.SetActive(true);

View File

@ -1,5 +1,6 @@
using HarmonyLib; using HarmonyLib;
using NewHorizons.Builder.ShipLog; using NewHorizons.Builder.ShipLog;
using NewHorizons.Components.Orbital;
using NewHorizons.Handlers; using NewHorizons.Handlers;
using NewHorizons.Utility; using NewHorizons.Utility;
using NewHorizons.Utility.OWML; using NewHorizons.Utility.OWML;
@ -19,6 +20,29 @@ namespace NewHorizons.Patches.ShipLogPatches
GameObject panRoot = SearchUtilities.Find(ShipLogHandler.PAN_ROOT_PATH); GameObject panRoot = SearchUtilities.Find(ShipLogHandler.PAN_ROOT_PATH);
GameObject sunObject = SearchUtilities.Find(ShipLogHandler.PAN_ROOT_PATH + "/Sun"); GameObject sunObject = SearchUtilities.Find(ShipLogHandler.PAN_ROOT_PATH + "/Sun");
ShipLogAstroObject[][] navMatrix = MapModeBuilder.ConstructMapMode(Main.Instance.CurrentStarSystem, panRoot, __instance._astroObjects, sunObject.layer); ShipLogAstroObject[][] navMatrix = MapModeBuilder.ConstructMapMode(Main.Instance.CurrentStarSystem, panRoot, __instance._astroObjects, sunObject.layer);
// Remove anything that isnt meant to be selectable
var flagRemovedUnselectable = false;
for (int i = 0; i < navMatrix.Length; i++)
{
for (int j = 0; j < navMatrix[i].Length; j++)
{
if (!(MapModeBuilder.GetMapModeInfoForAstroObject(navMatrix[i][j])?.selectable ?? true))
{
flagRemovedUnselectable = true;
navMatrix[i][j].UpdateState();
navMatrix[i][j] = null;
}
}
}
if (flagRemovedUnselectable)
{
navMatrix = navMatrix.Where(a => a.Count(c => c != null) > 0).ToArray();
for (var index = 0; index < navMatrix.Length; index++)
{
navMatrix[index] = navMatrix[index].Where(a => a != null).ToArray();
}
}
if (navMatrix == null || navMatrix.Length <= 1) if (navMatrix == null || navMatrix.Length <= 1)
{ {
NHLogger.LogWarning("Skipping Map Mode Generation."); NHLogger.LogWarning("Skipping Map Mode Generation.");

View File

@ -280,7 +280,7 @@
}, },
"inclination": { "inclination": {
"type": "number", "type": "number",
"description": "Angle between the rings and the equatorial plane of the planet.", "description": "Angle between the belt and the equatorial plane of the planet.",
"format": "float" "format": "float"
}, },
"innerRadius": { "innerRadius": {
@ -291,7 +291,7 @@
}, },
"longitudeOfAscendingNode": { "longitudeOfAscendingNode": {
"type": "number", "type": "number",
"description": "Angle defining the point where the rings rise up from the planet's equatorial plane if inclination is nonzero.", "description": "Angle defining the point where the belt rises up from the planet's equatorial plane if inclination is nonzero.",
"format": "float" "format": "float"
}, },
"maxSize": { "maxSize": {
@ -315,13 +315,33 @@
"minimum": 0.0 "minimum": 0.0
}, },
"procGen": { "procGen": {
"description": "How the asteroids are generated", "description": "How the asteroids are generated, unless you supply a detail yourself using \"assetBundle\" and \"path\"",
"$ref": "#/definitions/ProcGenModule" "$ref": "#/definitions/ProcGenModule"
}, },
"randomSeed": { "randomSeed": {
"type": "integer", "type": "integer",
"description": "Number used to randomize asteroid positions", "description": "Number used to randomize asteroid positions",
"format": "int32" "format": "int32"
},
"assetBundle": {
"type": "string",
"description": "You can use this to load a custom asset or ingame object, instead of using ProcGen. It will be scaled by \"minSize\" and \"maxSize\", so ideally it should be near a 1 meter radius.\nThis is a relative filepath to an asset-bundle to load the prefab defined in `path` from."
},
"path": {
"type": "string",
"description": "You can use this to load a custom asset or ingame object, instead of using ProcGen. It will be scaled by \"minSize\" and \"maxSize\", so ideally it should be near a 1 meter radius.\nThis is either the path in the scene hierarchy of the item to copy or the path to the object in the supplied asset bundle. "
},
"gravity": {
"type": "number",
"description": "Surface gravity of the asteroids.",
"format": "float",
"default": 1,
"minimum": 0.0
},
"randomOrientation": {
"type": "boolean",
"description": "Should the detail of the asteroid be randomly oriented, or should it point towards the center.",
"default": true
} }
} }
}, },
@ -4067,6 +4087,11 @@
"description": "Scale to apply to the planet in map mode.", "description": "Scale to apply to the planet in map mode.",
"format": "float", "format": "float",
"default": 1.0 "default": 1.0
},
"selectable": {
"type": "boolean",
"description": "Can this ship log map mode entry be selected\nEx) Set to false for stars with no entries on them so they are skipped in navigation",
"default": true
} }
} }
}, },

View File

@ -4,16 +4,19 @@ namespace NewHorizons.Utility.Geometry
{ {
public class BoxShapeVisualizer : MonoBehaviour public class BoxShapeVisualizer : MonoBehaviour
{ {
BoxShape box; private BoxShape _box;
void Awake() public void Awake()
{ {
box = GetComponent<BoxShape>(); _box = GetComponent<BoxShape>();
} }
void OnRenderObject() public void OnRenderObject()
{ {
Popcron.Gizmos.Cube(transform.TransformPoint(box.center), transform.rotation, Vector3.Scale(box.size, transform.lossyScale)); if (Main.Debug && Main.VisualizeQuantumObjects)
{
Popcron.Gizmos.Cube(transform.TransformPoint(_box.center), transform.rotation, Vector3.Scale(_box.size, transform.lossyScale));
}
} }
} }
} }

View File

@ -16,6 +16,12 @@
"value": false, "value": false,
"tooltip": "Enables the debug raycast, visible quantum object colliders, and debug options menu." "tooltip": "Enables the debug raycast, visible quantum object colliders, and debug options menu."
}, },
"VisualizeQuantumObjects": {
"title": "Visualize Quantum Objects",
"type": "toggle",
"value": false,
"tooltip": "Draws boundaries around quantum objects when Debug mode is on."
},
"VerboseLogs": { "VerboseLogs": {
"title": "Verbose Logs", "title": "Verbose Logs",
"type": "toggle", "type": "toggle",

View File

@ -4,7 +4,7 @@
"author": "xen, Bwc9876, JohnCorby, MegaPiggy, Trifid, and friends", "author": "xen, Bwc9876, JohnCorby, MegaPiggy, Trifid, and friends",
"name": "New Horizons", "name": "New Horizons",
"uniqueName": "xen.NewHorizons", "uniqueName": "xen.NewHorizons",
"version": "1.24.6", "version": "1.25.0",
"owmlVersion": "2.12.1", "owmlVersion": "2.12.1",
"dependencies": [ "JohnCorby.VanillaFix", "xen.CommonCameraUtility", "dgarro.CustomShipLogModes" ], "dependencies": [ "JohnCorby.VanillaFix", "xen.CommonCameraUtility", "dgarro.CustomShipLogModes" ],
"conflicts": [ "PacificEngine.OW_CommonResources" ], "conflicts": [ "PacificEngine.OW_CommonResources" ],