Decompiled source of AccessibilityOptionsSFX v1.0.0

LCReducePipeLeakSFX.dll

Decompiled 10 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using HarmonyLib;
using LethalSettings.UI;
using LethalSettings.UI.Components;
using Microsoft.CodeAnalysis;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("Sakiskid")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("My first plugin")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("LCReducePipeLeakSFX")]
[assembly: AssemblyTitle("LCReducePipeLeakSFX")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace LCReducePipeLeakSFX
{
	[BepInPlugin("LCReducePipeLeakSFX", "LCReducePipeLeakSFX", "1.0.0")]
	public class LCReducePipeLeakSFX : BaseUnityPlugin
	{
		private static string ConfigSection = "LCReducePipeLeakSFX";

		public static ConfigEntry<float> cfg_BrokenValveVolume;

		private ConfigDefinition cfgDef_BrokenValveVolume = new ConfigDefinition(ConfigSection, "BrokenValve");

		private void Awake()
		{
			cfg_BrokenValveVolume = ((BaseUnityPlugin)this).Config.Bind<float>(cfgDef_BrokenValveVolume, 0.675f, (ConfigDescription)null);
			InitializeModSettings();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin LCReducePipeLeakSFX is loaded!");
			Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), (string)null);
		}

		public void InitializeModSettings()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Expected O, but got Unknown
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Expected O, but got Unknown
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Expected O, but got Unknown
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Expected O, but got Unknown
			ModSettingsConfig val = new ModSettingsConfig();
			val.Name = "LCReducePipeLeakSFX";
			val.Version = "1.0.0";
			val.Id = "LCReducePipeLeakSFX";
			val.Description = "Reduces or amplifies sounds of the environment";
			MenuComponent[] array = new MenuComponent[2];
			HorizontalComponent val2 = new HorizontalComponent();
			val2.Children = (MenuComponent[])(object)new MenuComponent[1] { (MenuComponent)new SliderComponent
			{
				MinValue = 0f,
				MaxValue = 200f,
				Value = cfg_BrokenValveVolume.Value,
				Text = "Broken Valve Volume",
				OnValueChanged = delegate(SliderComponent self, float value)
				{
					((BaseUnityPlugin)this).Logger.LogInfo((object)$"New value: {value}");
					cfg_BrokenValveVolume.Value = value;
				}
			} };
			array[0] = (MenuComponent)val2;
			val2 = new HorizontalComponent();
			val2.Children = (MenuComponent[])(object)new MenuComponent[1] { (MenuComponent)new ButtonComponent
			{
				Text = "Save Volume Preferences",
				OnClick = delegate
				{
					SaveConfig();
				}
			} };
			array[1] = (MenuComponent)val2;
			val.MenuComponents = (MenuComponent[])(object)array;
			ModMenu.RegisterMod(val);
		}

		public void SaveConfig()
		{
			((BaseUnityPlugin)this).Config.Save();
		}
	}
	[HarmonyPatch(typeof(SteamValveHazard), "Start")]
	public static class SetSteamValveAudio
	{
		public static bool Prefix(ref SteamValveHazard __instance)
		{
			__instance.valveAudio.volume = LCReducePipeLeakSFX.cfg_BrokenValveVolume.Value * 0.01f;
			return true;
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "LCReducePipeLeakSFX";

		public const string PLUGIN_NAME = "LCReducePipeLeakSFX";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}