Decompiled source of SignalTSFX v1.0.0

SignalTSFX.dll

Decompiled a year ago
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 SignalTSFX.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("SignalTSFX")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SignalTSFX")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("b9bf1483-0da1-433b-894b-12952a8ac092")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace SignalTSFX
{
	[BepInPlugin("Ex.SignalTSFXMod", "Ex Signal Transmitter SFX Mod", "1.0.0")]
	public class SignalTSFXBase : BaseUnityPlugin
	{
		private const string modGUID = "Ex.SignalTSFXMod";

		private const string modName = "Ex Signal Transmitter SFX Mod";

		private const string modVersion = "1.0.0";

		private readonly Harmony harmony = new Harmony("Ex.SignalTSFXMod");

		private static SignalTSFXBase Instance;

		internal ManualLogSource mls;

		internal static AudioClip newStartTransmissionSFX;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("Ex.SignalTSFXMod");
			mls.LogInfo((object)"Signal Transmitter has initiated");
			string location = ((BaseUnityPlugin)Instance).Info.Location;
			string text = "SignalTSFX.dll";
			string text2 = location.TrimEnd(text.ToCharArray());
			string text3 = text2 + "SignalTSFX";
			AssetBundle val = AssetBundle.LoadFromFile(text3);
			if ((Object)(object)val == (Object)null)
			{
				mls.LogError((object)"Failed to load audio assets!");
				return;
			}
			newStartTransmissionSFX = val.LoadAsset<AudioClip>("Assets/Nokia.mp3");
			harmony.PatchAll(typeof(SignalTSFXBase));
			harmony.PatchAll(typeof(SignalTPatch));
			mls.LogInfo((object)"Signal Transmitter SFX mod has loaded.");
		}
	}
}
namespace SignalTSFX.Patches
{
	[HarmonyPatch(typeof(HUDManager))]
	internal class SignalTPatch
	{
		[HarmonyPatch("DisplaySignalTranslatorMessage")]
		[HarmonyPostfix]
		public static void SignalTSFXPatch(SignalTranslator signalTranslator)
		{
			signalTranslator.startTransmissionSFX = SignalTSFXBase.newStartTransmissionSFX;
		}
	}
}