mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Fix more issues with vanilla bodies
This commit is contained in:
parent
e51fa7d7d2
commit
65694f2666
@ -204,22 +204,35 @@ namespace NewHorizons.Builder.ShipLog
|
||||
}
|
||||
}
|
||||
|
||||
foreach (NewHorizonsBody body in bodies.Where(b => ShipLogHandler.IsVanillaBody(b) == false))
|
||||
foreach(NewHorizonsBody body in bodies)
|
||||
{
|
||||
if (body.Config.ShipLog == null) continue;
|
||||
if (body.Config.ShipLog?.mapMode?.manualNavigationPosition == null) continue;
|
||||
|
||||
// Sometimes they got other names idk
|
||||
var name = body.Config.Name.Replace(" ", "");
|
||||
var existingBody = AstroObjectLocator.GetAstroObject(body.Config.Name);
|
||||
if (existingBody != null)
|
||||
{
|
||||
var astroName = existingBody.GetAstroObjectName();
|
||||
if (astroName == AstroObject.Name.RingWorld) name = "InvisiblePlanet";
|
||||
else if (astroName != AstroObject.Name.CustomString) name = astroName.ToString();
|
||||
}
|
||||
// Should probably also just fix the IsVanilla method
|
||||
var isVanilla = ShipLogHandler.IsVanillaBody(body);
|
||||
|
||||
Logger.Log($"The name: {name} is vanilla? {isVanilla}");
|
||||
|
||||
if (!isVanilla)
|
||||
{
|
||||
GameObject newMapModeGO = CreateMapModeGameObject(body, transformParent, layer, body.Config.ShipLog?.mapMode?.manualPosition);
|
||||
ShipLogAstroObject newAstroObject = AddShipLogAstroObject(newMapModeGO, body, greyScaleMaterial, layer);
|
||||
MakeDetails(body, newMapModeGO.transform, greyScaleMaterial);
|
||||
Vector2 navigationPosition = body.Config.ShipLog?.mapMode?.manualNavigationPosition;
|
||||
navMatrix[(int)navigationPosition.y][(int)navigationPosition.x] = newAstroObject;
|
||||
}
|
||||
|
||||
if (Main.Instance.CurrentStarSystem == "SolarSystem")
|
||||
else if (Main.Instance.CurrentStarSystem == "SolarSystem")
|
||||
{
|
||||
foreach (NewHorizonsBody body in Main.BodyDict["SolarSystem"].Where(ShipLogHandler.IsVanillaBody))
|
||||
{
|
||||
GameObject gameObject = GameObject.Find(ShipLogHandler.PAN_ROOT_PATH + "/" + body.Config.Name.Replace(" ", ""));
|
||||
GameObject gameObject = GameObject.Find(ShipLogHandler.PAN_ROOT_PATH + "/" + name);
|
||||
if (body.Config.Destroy || (body.Config.ShipLog?.mapMode?.remove ?? false))
|
||||
{
|
||||
ShipLogAstroObject astroObject = gameObject.GetComponent<ShipLogAstroObject>();
|
||||
@ -232,7 +245,7 @@ namespace NewHorizons.Builder.ShipLog
|
||||
GameObject.Find(ShipLogHandler.PAN_ROOT_PATH + "/" + "SandFunnel").SetActive(false);
|
||||
}
|
||||
}
|
||||
else if(body.Config.Name == "SandFunnel")
|
||||
else if (name == "SandFunnel")
|
||||
{
|
||||
GameObject.Find(ShipLogHandler.PAN_ROOT_PATH + "/" + "SandFunnel").SetActive(false);
|
||||
}
|
||||
|
||||
@ -180,7 +180,15 @@ namespace NewHorizons.Builder.ShipLog
|
||||
{
|
||||
if (_entryIdToRawName.ContainsKey(entry._id))
|
||||
{
|
||||
entry._curiosity = _rawNameToCuriosityName[_entryIdToRawName[entry._id]];
|
||||
var raw = _entryIdToRawName[entry._id];
|
||||
if (_rawNameToCuriosityName.ContainsKey(raw))
|
||||
{
|
||||
entry._curiosity = _rawNameToCuriosityName[raw];
|
||||
}
|
||||
else
|
||||
{
|
||||
Logger.LogError($"Couldn't find {raw}. Did you define the curiosity in a json config? Because you have to.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -34,6 +34,10 @@ namespace NewHorizons.Builder.Handlers
|
||||
|
||||
public static bool IsVanillaBody(NewHorizonsBody body)
|
||||
{
|
||||
var existingBody = AstroObjectLocator.GetAstroObject(body.Config.Name);
|
||||
if (existingBody != null && existingBody.GetAstroObjectName() != AstroObject.Name.CustomString)
|
||||
return true;
|
||||
|
||||
return vanillaBodies.Contains(body.Config.Name.Replace(" ", ""));
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user