mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
reopen profile menu
This commit is contained in:
parent
439093e65d
commit
492c0bf47d
@ -25,6 +25,7 @@ namespace NewHorizons.Handlers
|
||||
.Where(b => (b.Config.HeightMap != null || b.Config.Atmosphere?.clouds != null) && b.Config.Star == null && b.Config.canShowOnTitle).ToArray();
|
||||
internal static int eligibleCount => eligibleBodies.Count();
|
||||
internal static bool reloaded = false;
|
||||
internal static bool reopenProfile = false;
|
||||
|
||||
public static void Init()
|
||||
{
|
||||
@ -110,8 +111,9 @@ namespace NewHorizons.Handlers
|
||||
|
||||
private static void OnProfileSignInComplete(ProfileManagerSignInResult result)
|
||||
{
|
||||
NHLogger.LogError($"OnProfileSignInComplete {result}: {StandaloneProfileManager.SharedInstance.currentProfile.profileName}");
|
||||
NHLogger.LogVerbose($"OnProfileSignInComplete {result}: {StandaloneProfileManager.SharedInstance.currentProfile.profileName}");
|
||||
reloaded = true;
|
||||
reopenProfile = true;
|
||||
|
||||
// Taken and modified from SubmitActionLoadScene.ConfirmSubmit
|
||||
LoadManager.LoadScene(OWScene.TitleScreen);
|
||||
|
||||
@ -165,6 +165,7 @@ namespace NewHorizons
|
||||
if (wasUsingCustomTitleScreen != CustomTitleScreen && SceneManager.GetActiveScene().name == "TitleScreen" && _wasConfigured)
|
||||
{
|
||||
NHLogger.LogVerbose("Reloading");
|
||||
TitleSceneHandler.reloaded = true;
|
||||
// Taken and modified from SubmitActionLoadScene.ConfirmSubmit
|
||||
LoadManager.LoadScene(OWScene.TitleScreen);
|
||||
Locator.GetMenuInputModule().DisableInputs();
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
using HarmonyLib;
|
||||
using NewHorizons.Handlers;
|
||||
using NewHorizons.Utility;
|
||||
using NewHorizons.Utility.OWML;
|
||||
using OWML.Utils;
|
||||
using UnityEngine;
|
||||
@ -12,11 +13,11 @@ internal static class TitleScenePatches
|
||||
[HarmonyPrefix, HarmonyPatch(typeof(TitleScreenAnimation), nameof(TitleScreenAnimation.Awake))]
|
||||
public static void TitleScreenAnimation_Awake(TitleScreenAnimation __instance)
|
||||
{
|
||||
// Skip Splash on title screen reload
|
||||
if (TitleSceneHandler.reloaded)
|
||||
{
|
||||
TitleSceneHandler.reloaded = false;
|
||||
|
||||
// Skip Splash on title screen reload
|
||||
TitleScreenAnimation titleScreenAnimation = __instance;
|
||||
titleScreenAnimation._fadeDuration = 0;
|
||||
titleScreenAnimation._gamepadSplash = false;
|
||||
@ -29,6 +30,15 @@ internal static class TitleScenePatches
|
||||
titleAnimationController._optionsFadeDuration = 0.001f;
|
||||
titleAnimationController._optionsFadeSpacing = 0.001f;
|
||||
titleAnimationController.FadeInTitleLogo();
|
||||
|
||||
// Reopen profile
|
||||
if (TitleSceneHandler.reopenProfile)
|
||||
{
|
||||
TitleSceneHandler.reopenProfile = false;
|
||||
Delay.FireOnNextUpdate(() =>
|
||||
SearchUtilities.Find("TitleMenu/TitleCanvas/TitleLayoutGroup/MainMenuBlock/MainMenuLayoutGroup/Button-Profile")
|
||||
.GetComponent<SubmitActionMenu>().Submit());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user