Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net35</TargetFramework>
<AssemblyName>BepInEx5Plugins.Ash.Alisa.WakeUpCutsceneSkip</AssemblyName>
<Description>WakeUpCutsceneSkip</Description>
<Version>1.0.0</Version>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>9.0</LangVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BepInEx.Analyzers" Version="1.*" PrivateAssets="all" />
<PackageReference Include="BepInEx.Core" Version="5.*" />
<PackageReference Include="BepInEx.PluginInfoProps" Version="1.*" />
<PackageReference Include="UnityEngine.Modules" Version="5.6.7" IncludeAssets="compile" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework.TrimEnd(`0123456789`))' == 'net'">
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
<Reference Include="Assembly-CSharp">
<HintPath>..\lib\SteamRelease\Assembly-CSharp.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>..\lib\UnityEngine\UnityEngine.UI.dll</HintPath>
<Private>false</Private>
</Reference>
</ItemGroup>

<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="xcopy /Y /Q /C /I &quot;$(OutDir)&quot; &quot;..\$(OutDir)\$(TargetName)\&quot;" />
</Target>
</Project>
Original file line number Diff line number Diff line change
@@ -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<Animator>().SetBool("Fade", false);
GameObject.FindWithTag("Subtitles").GetComponent<Text>().text = string.Empty;
textComponent.theTextBox.theText = GameObject.FindWithTag("Text").GetComponent<Text>();
textComponent.theTextBox.DisableTextBox();
ProgressManager.instance.data.cutscene_WakeUp = false;
player.GetComponentInChildren<Animator>().SetTrigger("Skip");
player.GetComponentInChildren<Animator>().SetBool("WakeUpCutscene", false);
blopshadow.SetActive(true);
player.GetComponent<Collider>().enabled = true;
yield return new WaitForSeconds(1f);

player.GetComponentInChildren<Animator>().ResetTrigger("Skip");
yield return new WaitForSeconds(0.6f);

fadeControl.SetBool("Fade", false);

player.GetComponent<AlisaMovement>().enabled = true;
player.GetComponent<WeaponControl>().enabled = true;
rayPoint.GetComponent<Interaction>().interactionIsActive = false;
GameObject.FindWithTag("PlayerUI").GetComponent<EquipmentMenu>().enabled = true;
playerUI.canOpenMenu = true;
yield return new WaitForSeconds(0.5f);
blopshadow.SetActive(true);
cutscene.gameObject.SetActive(false);
}
}
}
6 changes: 6 additions & 0 deletions BepInEx5Plugins.Ash.Alisa.WakeUpCutsceneSkip/NuGet.Config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="BepInEx" value="https://nuget.bepinex.dev/v3/index.json" />
</packageSources>
</configuration>
26 changes: 26 additions & 0 deletions BepInEx5Plugins.Ash.Alisa.WakeUpCutsceneSkip/Plugin.cs
Original file line number Diff line number Diff line change
@@ -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);
}
}
}
}