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>
|
/// </summary>
|
||||||
public object extras;
|
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,11 +34,13 @@ namespace NewHorizons.Handlers
|
|||||||
var profileManager = StandaloneProfileManager.SharedInstance;
|
var profileManager = StandaloneProfileManager.SharedInstance;
|
||||||
profileManager.PreInitialize();
|
profileManager.PreInitialize();
|
||||||
profileManager.Initialize();
|
profileManager.Initialize();
|
||||||
|
if (profileManager.currentProfile != null)
|
||||||
PlayerData.Init(profileManager.currentProfileGameSave,
|
PlayerData.Init(profileManager.currentProfileGameSave,
|
||||||
profileManager.currentProfileGameSettings,
|
profileManager.currentProfileGameSettings,
|
||||||
profileManager.currentProfileGraphicsSettings,
|
profileManager.currentProfileGraphicsSettings,
|
||||||
profileManager.currentProfileInputJSON);
|
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.
|
// 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());
|
var (mod, config) = Main.TitleScreenConfigs.FirstOrDefault(kvp => kvp.Value.KnowsFact() && kvp.Value.HasCondition());
|
||||||
if (config != null)
|
if (config != null)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user