mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Handle potentially missing ship log canvas
This commit is contained in:
parent
5d1a16f572
commit
e74dbfb863
@ -20,6 +20,8 @@ namespace NewHorizons.Handlers
|
||||
|
||||
var shipLogRoot = SearchUtilities.Find("Ship_Body/Module_Cabin/Systems_Cabin/ShipLogPivot/ShipLog/ShipLogPivot/ShipLogCanvas");
|
||||
|
||||
if (shipLogRoot != null)
|
||||
{
|
||||
var starChartLog = new GameObject("StarChartMode");
|
||||
starChartLog.SetActive(false);
|
||||
starChartLog.transform.parent = shipLogRoot.transform;
|
||||
@ -47,6 +49,12 @@ namespace NewHorizons.Handlers
|
||||
var upperRightPromptList = shipLogRoot.transform.Find("ScreenPromptListScaleRoot/ScreenPromptList_UpperRight")?.GetComponent<ScreenPromptList>();
|
||||
var oneShotSource = SearchUtilities.Find("Ship_Body/Module_Cabin/Systems_Cabin/ShipLogPivot/ShipLog/OneShotAudio_ShipLog")?.GetComponent<OWAudioSource>();
|
||||
|
||||
ShipLogStarChartMode.Initialize(
|
||||
centerPromptList,
|
||||
upperRightPromptList,
|
||||
oneShotSource);
|
||||
}
|
||||
|
||||
_starSystemToFactID = new Dictionary<string, string>();
|
||||
_factIDToStarSystem = new Dictionary<string, string>();
|
||||
|
||||
@ -57,11 +65,6 @@ namespace NewHorizons.Handlers
|
||||
RegisterFactForSystem(system.Config.factRequiredForWarp, system.UniqueID);
|
||||
}
|
||||
}
|
||||
|
||||
ShipLogStarChartMode.Initialize(
|
||||
centerPromptList,
|
||||
upperRightPromptList,
|
||||
oneShotSource);
|
||||
}
|
||||
|
||||
public static bool CanWarp()
|
||||
@ -98,7 +101,9 @@ namespace NewHorizons.Handlers
|
||||
if (_factIDToStarSystem.TryGetValue(factID, out var systemUnlocked))
|
||||
{
|
||||
Logger.Log($"Just learned [{factID}] and unlocked [{systemUnlocked}]");
|
||||
if (!Main.HasWarpDrive) Main.Instance.EnableWarpDrive();
|
||||
if (!Main.HasWarpDrive)
|
||||
Main.Instance.EnableWarpDrive();
|
||||
if (ShipLogStarChartMode != null)
|
||||
ShipLogStarChartMode.AddSystemCard(systemUnlocked);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user