diff --git a/BepInEx5Plugins.Ash.Alisa.WakeUpCutsceneSkip/BepInEx5Plugins.Ash.Alisa.WakeUpCutsceneSkip.csproj b/BepInEx5Plugins.Ash.Alisa.WakeUpCutsceneSkip/BepInEx5Plugins.Ash.Alisa.WakeUpCutsceneSkip.csproj new file mode 100644 index 0000000..34064c1 --- /dev/null +++ b/BepInEx5Plugins.Ash.Alisa.WakeUpCutsceneSkip/BepInEx5Plugins.Ash.Alisa.WakeUpCutsceneSkip.csproj @@ -0,0 +1,37 @@ + + + + net35 + BepInEx5Plugins.Ash.Alisa.WakeUpCutsceneSkip + WakeUpCutsceneSkip + 1.0.0 + true + 9.0 + + + + + + + + + + + + + + + + ..\lib\SteamRelease\Assembly-CSharp.dll + false + + + ..\lib\UnityEngine\UnityEngine.UI.dll + false + + + + + + + diff --git a/BepInEx5Plugins.Ash.Alisa.WakeUpCutsceneSkip/HarmonyPatches/WakeUpCutscene_SkipCutscene.cs b/BepInEx5Plugins.Ash.Alisa.WakeUpCutsceneSkip/HarmonyPatches/WakeUpCutscene_SkipCutscene.cs new file mode 100644 index 0000000..8b7976d --- /dev/null +++ b/BepInEx5Plugins.Ash.Alisa.WakeUpCutsceneSkip/HarmonyPatches/WakeUpCutscene_SkipCutscene.cs @@ -0,0 +1,70 @@ +using HarmonyLib; +using System.Collections; +using UnityEngine; +using UnityEngine.UI; + +namespace BepInEx5Plugins.Ash.Alisa.WakeUpCutsceneSkip.HarmonyPatches +{ + [HarmonyPatch(typeof(WakeUpCutscene), "SkipCutscene")] + public class WakeUpCutscene_SkipCutscene + { + // Replace call to SkippingCutscene. + public static void Postfix(WakeUpCutscene __instance + , ref GameObject ___player + , ref GameObject ___rayPoint + , ref GameObject ___blopshadow + , ref EquipmentMenu ___playerUI + , ref Animator ___fadeControl + , ref AudioSource ___audioSource + , ref ActivateTextAtLine ___textComponent + ) + { + __instance.StopAllCoroutines(); + __instance.StopAllCoroutines(); + __instance.StopAllCoroutines(); + __instance.StartCoroutine(SkippingCutscene(__instance, ___player, ___rayPoint, ___blopshadow, ___playerUI, ___fadeControl, ___audioSource, ___textComponent)); + } + + // Reset the skip trigger then wait before fading out. + private static IEnumerator SkippingCutscene(WakeUpCutscene cutscene + , GameObject player + , GameObject rayPoint + , GameObject blopshadow + , EquipmentMenu playerUI + , Animator fadeControl + , AudioSource audioSource + , ActivateTextAtLine textComponent + ) + { + fadeControl.SetBool("Fade", true); + yield return new WaitForSeconds(0.4f); + audioSource.Stop(); + audioSource.spatialBlend = 0.9f; + audioSource.volume = 1f; + cutscene.blackBarsCanvas.GetComponentInChildren().SetBool("Fade", false); + GameObject.FindWithTag("Subtitles").GetComponent().text = string.Empty; + textComponent.theTextBox.theText = GameObject.FindWithTag("Text").GetComponent(); + textComponent.theTextBox.DisableTextBox(); + ProgressManager.instance.data.cutscene_WakeUp = false; + player.GetComponentInChildren().SetTrigger("Skip"); + player.GetComponentInChildren().SetBool("WakeUpCutscene", false); + blopshadow.SetActive(true); + player.GetComponent().enabled = true; + yield return new WaitForSeconds(1f); + + player.GetComponentInChildren().ResetTrigger("Skip"); + yield return new WaitForSeconds(0.6f); + + fadeControl.SetBool("Fade", false); + + player.GetComponent().enabled = true; + player.GetComponent().enabled = true; + rayPoint.GetComponent().interactionIsActive = false; + GameObject.FindWithTag("PlayerUI").GetComponent().enabled = true; + playerUI.canOpenMenu = true; + yield return new WaitForSeconds(0.5f); + blopshadow.SetActive(true); + cutscene.gameObject.SetActive(false); + } + } +} diff --git a/BepInEx5Plugins.Ash.Alisa.WakeUpCutsceneSkip/NuGet.Config b/BepInEx5Plugins.Ash.Alisa.WakeUpCutsceneSkip/NuGet.Config new file mode 100644 index 0000000..1864ded --- /dev/null +++ b/BepInEx5Plugins.Ash.Alisa.WakeUpCutsceneSkip/NuGet.Config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/BepInEx5Plugins.Ash.Alisa.WakeUpCutsceneSkip/Plugin.cs b/BepInEx5Plugins.Ash.Alisa.WakeUpCutsceneSkip/Plugin.cs new file mode 100644 index 0000000..0497926 --- /dev/null +++ b/BepInEx5Plugins.Ash.Alisa.WakeUpCutsceneSkip/Plugin.cs @@ -0,0 +1,26 @@ +using BepInEx; +using HarmonyLib; +using System; + +namespace BepInEx5Plugins.Ash.Alisa.WakeUpCutsceneSkip +{ + [BepInPlugin(PluginInfo.PLUGIN_GUID, PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_VERSION)] + public class Plugin : BaseUnityPlugin + { + private void Awake() + { + try + { + Logger.LogInfo($"Plugin {PluginInfo.PLUGIN_GUID} is loaded!"); + + var harmony = new Harmony(Info.Metadata.GUID); + + harmony.PatchAll(); + } + catch (Exception exception) + { + Console.WriteLine(exception); + } + } + } +}