mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Null check for profile
This commit is contained in:
parent
64b0816d62
commit
fcd4ab4fe6
@ -88,8 +88,8 @@ namespace NewHorizons.External.Configs
|
||||
/// </summary>
|
||||
public object extras;
|
||||
|
||||
public bool KnowsFact() => string.IsNullOrEmpty(factRequiredForTitle) || ShipLogHandler.KnowsFact(factRequiredForTitle);
|
||||
public bool KnowsFact() => string.IsNullOrEmpty(factRequiredForTitle) || StandaloneProfileManager.SharedInstance.currentProfile != null && ShipLogHandler.KnowsFact(factRequiredForTitle);
|
||||
|
||||
public bool HasCondition() => string.IsNullOrEmpty(conditionRequiredForTitle) || PlayerData.GetPersistentCondition(conditionRequiredForTitle);
|
||||
public bool HasCondition() => string.IsNullOrEmpty(conditionRequiredForTitle) || StandaloneProfileManager.SharedInstance.currentProfile != null && PlayerData.GetPersistentCondition(conditionRequiredForTitle);
|
||||
}
|
||||
}
|
||||
|
||||
@ -34,10 +34,12 @@ namespace NewHorizons.Handlers
|
||||
var profileManager = StandaloneProfileManager.SharedInstance;
|
||||
profileManager.PreInitialize();
|
||||
profileManager.Initialize();
|
||||
PlayerData.Init(profileManager.currentProfileGameSave,
|
||||
profileManager.currentProfileGameSettings,
|
||||
profileManager.currentProfileGraphicsSettings,
|
||||
profileManager.currentProfileInputJSON);
|
||||
if (profileManager.currentProfile != null)
|
||||
PlayerData.Init(profileManager.currentProfileGameSave,
|
||||
profileManager.currentProfileGameSettings,
|
||||
profileManager.currentProfileGraphicsSettings,
|
||||
profileManager.currentProfileInputJSON);
|
||||
|
||||
|
||||
// TODO: Select one title screen and if it has shareTitleScreen set to true do all the other ones that have it true too.
|
||||
var (mod, config) = Main.TitleScreenConfigs.FirstOrDefault(kvp => kvp.Value.KnowsFact() && kvp.Value.HasCondition());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user