mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Fix focal point children not showing up
This commit is contained in:
parent
1b12a71cf4
commit
ba63099a72
@ -388,7 +388,7 @@ namespace NewHorizons.Builder.ShipLog
|
|||||||
return new MapModeObject();
|
return new MapModeObject();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static List<MapModeObject> ConstructChildrenNodes(MapModeObject parent, List<NewHorizonsBody> searchList, string secondaryName = "")
|
private static List<MapModeObject> ConstructChildrenNodes(MapModeObject parent, List<NewHorizonsBody> searchList, string secondaryName = "", string focalPointName = "")
|
||||||
{
|
{
|
||||||
List<MapModeObject> children = new List<MapModeObject>();
|
List<MapModeObject> children = new List<MapModeObject>();
|
||||||
int newX = parent.x;
|
int newX = parent.x;
|
||||||
@ -396,7 +396,7 @@ namespace NewHorizons.Builder.ShipLog
|
|||||||
int newLevel = parent.level + 1;
|
int newLevel = parent.level + 1;
|
||||||
MapModeObject lastSibling = parent;
|
MapModeObject lastSibling = parent;
|
||||||
|
|
||||||
foreach (NewHorizonsBody body in searchList.Where(b => b.Config.Orbit.primaryBody == parent.mainBody.Config.name || b.Config.name == secondaryName))
|
foreach (NewHorizonsBody body in searchList.Where(b => b.Config.Orbit.primaryBody == parent.mainBody.Config.name || (b.Config.Orbit.primaryBody == focalPointName && b.Config.name != parent.mainBody.Config.name) || b.Config.name == secondaryName))
|
||||||
{
|
{
|
||||||
bool even = newLevel % 2 == 0;
|
bool even = newLevel % 2 == 0;
|
||||||
newX = even ? newX : newX + 1;
|
newX = even ? newX : newX + 1;
|
||||||
@ -411,13 +411,15 @@ namespace NewHorizons.Builder.ShipLog
|
|||||||
lastSibling = lastSibling
|
lastSibling = lastSibling
|
||||||
};
|
};
|
||||||
string newSecondaryName = "";
|
string newSecondaryName = "";
|
||||||
|
string newFocalPointName = "";
|
||||||
if (body.Config.FocalPoint != null)
|
if (body.Config.FocalPoint != null)
|
||||||
{
|
{
|
||||||
|
newFocalPointName = body.Config.name;
|
||||||
newNode.mainBody = searchList.Find(b => b.Config.name == body.Config.FocalPoint.primary);
|
newNode.mainBody = searchList.Find(b => b.Config.name == body.Config.FocalPoint.primary);
|
||||||
newSecondaryName = searchList.Find(b => b.Config.name == body.Config.FocalPoint.secondary).Config.name;
|
newSecondaryName = searchList.Find(b => b.Config.name == body.Config.FocalPoint.secondary).Config.name;
|
||||||
}
|
}
|
||||||
|
|
||||||
newNode.children = ConstructChildrenNodes(newNode, searchList, newSecondaryName);
|
newNode.children = ConstructChildrenNodes(newNode, searchList, newSecondaryName, newFocalPointName);
|
||||||
if (even)
|
if (even)
|
||||||
{
|
{
|
||||||
newY += newNode.branch_height;
|
newY += newNode.branch_height;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user