using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using IntroSpeechPlease.Patches;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("IntroSpeechPlease")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("IntroSpeechPlease")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("9235da77-dd53-4680-a2e0-9483481cf7d7")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace IntroSpeechPlease
{
[BepInPlugin("Baldy.IntroSpeechPlease", "Intro Speech Please", "1.0.0")]
public class IntroSpeechBase : BaseUnityPlugin
{
private const string modGUID = "Baldy.IntroSpeechPlease";
private const string modName = "Intro Speech Please";
private const string modVersion = "1.0.0";
private readonly Harmony harmony = new Harmony("Baldy.IntroSpeechPlease");
private static IntroSpeechBase Instance;
internal ManualLogSource mls;
private void Awake()
{
if ((Object)(object)Instance == (Object)null)
{
Instance = this;
}
mls = Logger.CreateLogSource("Baldy.IntroSpeechPlease");
harmony.PatchAll(typeof(IntroSpeechBase));
harmony.PatchAll(typeof(ShipIntroSpeechPatch));
mls.LogInfo((object)"Intro Speech Please! has loaded");
}
}
}
namespace IntroSpeechPlease.Patches
{
[HarmonyPatch(typeof(StartOfRound))]
internal class ShipIntroSpeechPatch
{
[HarmonyPatch("DisableShipSpeaker")]
[HarmonyPostfix]
private static void DisableSpeakerPatch(StartOfRound __instance)
{
if (__instance.speakerAudioSource.isPlaying)
{
__instance.speakerAudioSource.Stop();
__instance.speakerAudioSource.PlayOneShot(__instance.disableSpeakerSFX);
}
else
{
__instance.speakerAudioSource.PlayOneShot(__instance.shipIntroSpeechSFX);
}
}
}
}