From c9e4418a7e8e91fbf9d41bd58ee7b7abf8c5358e Mon Sep 17 00:00:00 2001 From: Krevace Date: Sun, 31 Jul 2022 19:26:24 -0400 Subject: [PATCH] Added back skip splash, disabled by default. --- OWVoiceMod/OWVoiceMod.cs | 24 +++++++++++++++++++++++- OWVoiceMod/default-config.json | 5 +++++ OWVoiceMod/manifest.json | 2 +- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/OWVoiceMod/OWVoiceMod.cs b/OWVoiceMod/OWVoiceMod.cs index 5dccd08..2f6beb8 100644 --- a/OWVoiceMod/OWVoiceMod.cs +++ b/OWVoiceMod/OWVoiceMod.cs @@ -1,6 +1,7 @@ using HarmonyLib; using OWML.Common; using OWML.ModHelper; +using OWML.Utils; using System; using System.Collections.Generic; using System.IO; @@ -20,7 +21,8 @@ public class OWVoiceMod : ModBehaviour public static AudioSource audioSource; public static int randomDialogueNum = -1; - + + private static bool splashSkip; private static bool conversations; private static bool hearthianRecordings; public static bool nomaiRecordings; @@ -36,6 +38,25 @@ private void Start() RegisterAssets(Path.Combine(ModHelper.Manifest.ModFolderPath, "Assets")); + if (splashSkip) + { + // Copied from https://github.com/Vesper-Works/OuterWildsOnline/blob/master/OuterWildsOnline/ConnectionController.cs#L106-L119 + // Skip flash screen. + var titleScreenAnimation = FindObjectOfType(); + titleScreenAnimation._fadeDuration = 0; + titleScreenAnimation._gamepadSplash = false; + titleScreenAnimation._introPan = false; + titleScreenAnimation.Invoke("FadeInTitleLogo"); + + // Skip menu fade. + var titleAnimationController = FindObjectOfType(); + titleAnimationController._logoFadeDelay = 0.001f; + titleAnimationController._logoFadeDuration = 0.001f; + titleAnimationController._optionsFadeDelay = 0.001f; + titleAnimationController._optionsFadeDuration = 0.001f; + titleAnimationController._optionsFadeSpacing = 0.001f; + } + Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly()); LoadManager.OnCompleteSceneLoad += OnCompleteSceneLoad; @@ -71,6 +92,7 @@ public static void RegisterAssets(string assetsFolder) public override void Configure(IModConfig config) { + splashSkip = config.GetSettingsValue("splashSkip"); conversations = config.GetSettingsValue("conversations"); hearthianRecordings = config.GetSettingsValue("hearthianRecordings"); nomaiRecordings = config.GetSettingsValue("nomaiRecordings"); diff --git a/OWVoiceMod/default-config.json b/OWVoiceMod/default-config.json index db7ecfa..9f6a795 100644 --- a/OWVoiceMod/default-config.json +++ b/OWVoiceMod/default-config.json @@ -42,6 +42,11 @@ "value": "1", "min": 0, "max": 1 + }, + "splashSkip": { + "title": "Skip Splash Screen", + "type": "toggle", + "value": false } } } \ No newline at end of file diff --git a/OWVoiceMod/manifest.json b/OWVoiceMod/manifest.json index 7f043c7..b832275 100644 --- a/OWVoiceMod/manifest.json +++ b/OWVoiceMod/manifest.json @@ -3,7 +3,7 @@ "author": "Krevace", "name": "Voice Acting Mod", "uniqueName": "Krevace.VoiceMod", - "version": "0.3.9", + "version": "0.3.10", "owmlVersion": "2.5.2", "priorityLoad": true } \ No newline at end of file