mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
made AstroObjectLocator also register astro objects under the name of their game object, eg MyPlanet_Body
This commit is contained in:
parent
d04f36881b
commit
f30320e758
@ -69,7 +69,8 @@ namespace NewHorizons.Utility
|
||||
else
|
||||
{
|
||||
Logger.Log($"Registering [{ao.name}] as [{key}]");
|
||||
_customAstroObjectDictionary.Add(key, ao);
|
||||
_customAstroObjectDictionary.Add(key, ao);
|
||||
_customAstroObjectDictionary.Add(ao.name, ao);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -144,13 +144,10 @@ namespace NewHorizons.Utility.DebugUtilities
|
||||
|
||||
public static string GetAstroObjectName(string bodyName)
|
||||
{
|
||||
if (bodyName.EndsWith("_Body")) bodyName = bodyName.Substring(0, bodyName.Length-"_Body".Length);
|
||||
|
||||
var astroObject = AstroObjectLocator.GetAstroObject(bodyName);
|
||||
if (astroObject == null) return null;
|
||||
|
||||
var astroObjectName = astroObject.name;
|
||||
if (astroObjectName.EndsWith("_Body")) astroObjectName = astroObjectName.Substring(0, astroObjectName.Length-"_Body".Length);
|
||||
|
||||
return astroObjectName;
|
||||
}
|
||||
@ -202,7 +199,7 @@ namespace NewHorizons.Utility.DebugUtilities
|
||||
|
||||
string bodyName = GetAstroObjectName(bodyGameObjectName);
|
||||
|
||||
Logger.Log("Adding prop to " + Main.Instance.CurrentStarSystem + "::" + bodyName);
|
||||
Logger.Log("Adding prop to " + Main.Instance.CurrentStarSystem + "::" + bodyName + " (passed name: "+bodyGameObjectName+")");
|
||||
|
||||
|
||||
detailInfo = detailInfo == null ? new DetailInfo() : detailInfo;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user