mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Move to an extension
This commit is contained in:
parent
d759f1843b
commit
4519d2f257
@ -74,7 +74,7 @@ namespace NewHorizons.Builder.Body
|
||||
|
||||
if (string.IsNullOrEmpty(cometTailModule.primaryBody))
|
||||
cometTailModule.primaryBody = !string.IsNullOrEmpty(config.Orbit.primaryBody) ? config.Orbit.primaryBody
|
||||
: (primaryBody._name == AstroObject.Name.CustomString ? primaryBody.GetCustomName() : primaryBody._name.ToString());
|
||||
: primaryBody.GetKey();
|
||||
|
||||
var rootObj = new GameObject("CometRoot");
|
||||
rootObj.SetActive(false);
|
||||
|
||||
@ -445,6 +445,11 @@ namespace NewHorizons.Utility
|
||||
return globalMusicController._endTimesSource.clip.length;
|
||||
}
|
||||
|
||||
public static string GetKey(this AstroObject ao)
|
||||
{
|
||||
return ao._name == AstroObject.Name.CustomString ? ao.GetCustomName() : ao._name.ToString();
|
||||
}
|
||||
|
||||
public static CodeMatcher LogInstructions(this CodeMatcher matcher, string prefix)
|
||||
{
|
||||
matcher.InstructionEnumeration().LogInstructions(prefix);
|
||||
|
||||
@ -65,7 +65,7 @@ namespace NewHorizons.Utility.OuterWilds
|
||||
|
||||
public static void RegisterCustomAstroObject(AstroObject ao)
|
||||
{
|
||||
var key = ao._name == AstroObject.Name.CustomString ? ao.GetCustomName() : ao._name.ToString();
|
||||
var key = ao.GetKey();
|
||||
|
||||
if (_customAstroObjectDictionary.ContainsKey(key))
|
||||
{
|
||||
@ -81,7 +81,7 @@ namespace NewHorizons.Utility.OuterWilds
|
||||
|
||||
public static void DeregisterCustomAstroObject(AstroObject ao)
|
||||
{
|
||||
var key = ao._name == AstroObject.Name.CustomString ? ao.GetCustomName() : ao._name.ToString();
|
||||
var key = ao.GetKey();
|
||||
_customAstroObjectDictionary.Remove(key);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user