This commit is contained in:
Nick J. Connors 2022-02-22 00:47:47 -05:00
parent 616c577b7a
commit 09d9e59c5a
2 changed files with 33 additions and 34 deletions

View File

@ -417,13 +417,11 @@ namespace NewHorizons.Builder.ShipLog
{ {
newY += newNode.branch_height; newY += newNode.branch_height;
parent.Increment_height(); parent.Increment_height();
newY += 1;
} }
else else
{ {
newX += newNode.branch_width; newX += newNode.branch_width;
parent.Increment_width(); parent.Increment_width();
newX += 1;
} }
lastSibling = newNode; lastSibling = newNode;
@ -465,7 +463,7 @@ namespace NewHorizons.Builder.ShipLog
private static void MakeNode(ref MapModeObject node, GameObject parent, Material greyScaleMaterial, int layer) private static void MakeNode(ref MapModeObject node, GameObject parent, Material greyScaleMaterial, int layer)
{ {
const float padding = 50f; const float padding = 100f;
Vector2 position = Vector2.zero; Vector2 position = Vector2.zero;
if (node.lastSibling != null) if (node.lastSibling != null)
{ {
@ -474,15 +472,6 @@ namespace NewHorizons.Builder.ShipLog
position = lastPosition; position = lastPosition;
float extraDistance = (node.mainBody.Config.ShipLog?.mapMode?.offset ?? 0f) * 100; float extraDistance = (node.mainBody.Config.ShipLog?.mapMode?.offset ?? 0f) * 100;
if(node.parent != null)
{
var branchDistance = node.parent.children.IndexOf(node);
var goingUp = node.parent.level % 2 != 0;
if(goingUp && branchDistance == 0) position.y += (int)padding;
if(!goingUp && branchDistance == 0) position.x += (int)padding;
}
if (node.level % 2 == 0) if (node.level % 2 == 0)
{ {
position.y += padding * (node.y - node.lastSibling.y) + extraDistance; position.y += padding * (node.y - node.lastSibling.y) + extraDistance;
@ -525,11 +514,16 @@ namespace NewHorizons.Builder.ShipLog
private static Color GetDominantPlanetColor(NewHorizonsBody body) private static Color GetDominantPlanetColor(NewHorizonsBody body)
{ {
try
{
if (body.Config?.Singularity?.Type == "BlackHole") return Color.black;
if (body.Config?.Singularity?.Type == "WhiteHole") return Color.white;
var starColor = body.Config?.Star?.Tint; var starColor = body.Config?.Star?.Tint;
if (starColor != null) return starColor.ToColor(); if (starColor != null) return starColor.ToColor();
var atmoColor = body.Config.Atmosphere?.AtmosphereTint; var atmoColor = body.Config.Atmosphere?.AtmosphereTint;
if (body.Config.Atmosphere?.Cloud != null) return atmoColor.ToColor(); if (body.Config.Atmosphere?.Cloud != null && atmoColor != null) return atmoColor.ToColor();
if (body.Config?.HeightMap?.TextureMap != null) if (body.Config?.HeightMap?.TextureMap != null)
{ {
@ -550,6 +544,11 @@ namespace NewHorizons.Builder.ShipLog
var sandColor = body.Config.Sand?.Tint; var sandColor = body.Config.Sand?.Tint;
if (sandColor != null) return sandColor.ToColor(); if (sandColor != null) return sandColor.ToColor();
}
catch(Exception)
{
Logger.LogWarning($"Something went wrong trying to pick the colour for {body.Config.Name} but I'm too lazy to fix it.");
}
return Color.white; return Color.white;
} }

View File

@ -3,7 +3,7 @@
"author": "xen", "author": "xen",
"name": "New Horizons", "name": "New Horizons",
"uniqueName": "xen.NewHorizons", "uniqueName": "xen.NewHorizons",
"version": "0.8.3", "version": "0.9.0",
"owmlVersion": "2.1.0", "owmlVersion": "2.1.0",
"dependencies": [ "PacificEngine.OW_CommonResources" ], "dependencies": [ "PacificEngine.OW_CommonResources" ],
"conflicts": [ "Raicuparta.QuantumSpaceBuddies", "Vesper.OuterWildsMMO", "Vesper.AutoResume" ] "conflicts": [ "Raicuparta.QuantumSpaceBuddies", "Vesper.OuterWildsMMO", "Vesper.AutoResume" ]