Decompiled source of NXMDPModMenu v1.0.0

NXMDPModMenu.dll

Decompiled 10 months ago
using System;
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 HelmetCamera;
using LethalSettings.UI;
using LethalSettings.UI.Components;
using Microsoft.CodeAnalysis;
using ReservedFlashlightSlot;
using ReservedItemSlotCore.Config;
using ReservedWalkieSlot;
using TMPro;
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("NXMDPModMenu")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("NXMDPModMenu")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("cf440218-009f-49ca-90bc-5efa53d34997")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
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;
		}
	}
}
namespace NXMDPModMenu
{
	[BepInPlugin("NXMDPModMenu", "NXDev-NXMDPModMenu", "1.0.0")]
	public class LCTutorialMod : BaseUnityPlugin
	{
		private const string modGUID = "NXMDPModMenu";

		private const string modName = "NXDev-NXMDPModMenu";

		private const string modVersion = "1.0.0";

		private readonly Harmony harmony = new Harmony("NXMDPModMenu");

		private static LCTutorialMod Instance;

		public static ManualLogSource mls;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("NXMDPModMenu");
			mls.LogInfo((object)"The mod NXMDPModMenu has awakened.");
			harmony.PatchAll(typeof(LCTutorialMod));
			new ModSettingsMenu();
		}
	}
	internal class ModSettingsMenu
	{
		private class ReservedSlots
		{
			private class SlotCore
			{
				public SlotCore()
				{
					//IL_0008: Unknown result type (might be due to invalid IL or missing references)
					//IL_000e: Expected O, but got Unknown
					//IL_0047: Unknown result type (might be due to invalid IL or missing references)
					//IL_004d: Expected O, but got Unknown
					//IL_0056: Unknown result type (might be due to invalid IL or missing references)
					//IL_005b: Unknown result type (might be due to invalid IL or missing references)
					//IL_0068: Expected O, but got Unknown
					//IL_006a: Unknown result type (might be due to invalid IL or missing references)
					//IL_006f: Unknown result type (might be due to invalid IL or missing references)
					//IL_0080: Unknown result type (might be due to invalid IL or missing references)
					//IL_008c: Unknown result type (might be due to invalid IL or missing references)
					//IL_00b3: Expected O, but got Unknown
					//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
					//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
					//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
					//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
					//IL_00fe: Expected O, but got Unknown
					ModSettingsConfig val = new ModSettingsConfig();
					val.Name = "ReservedItemSlotCore";
					val.Id = "FlipMods.ReservedItemSlotCore";
					val.Version = "1.7.7";
					val.Description = "The core mod for all ReservedItemSlot mods. Adds functionality for my ReservedItemSlot mods.";
					MenuComponent[] array = new MenuComponent[1];
					VerticalComponent val2 = new VerticalComponent();
					val2.Children = (MenuComponent[])(object)new MenuComponent[3]
					{
						(MenuComponent)new LabelComponent
						{
							Text = "Placeholder for keybind..."
						},
						(MenuComponent)new ToggleComponent
						{
							Value = ConfigSettings.toggleFocusReservedHotbar.Value,
							Text = "Toggle Focus Reserved Hotbar",
							OnValueChanged = delegate(ToggleComponent self, bool value)
							{
								logger.LogInfo((object)$"New value: {value}");
								ConfigSettings.toggleFocusReservedHotbar.Value = !ConfigSettings.toggleFocusReservedHotbar.Value;
							}
						},
						(MenuComponent)new ToggleComponent
						{
							Value = ConfigSettings.preventReservedItemSlotFade.Value,
							Text = "Prevent Reserved Item Slot Fade",
							OnValueChanged = delegate(ToggleComponent self, bool value)
							{
								logger.LogInfo((object)$"New value: {value}");
								ConfigSettings.preventReservedItemSlotFade.Value = !ConfigSettings.preventReservedItemSlotFade.Value;
							}
						}
					};
					array[0] = (MenuComponent)val2;
					val.MenuComponents = (MenuComponent[])(object)array;
					ModMenu.RegisterMod(val, true, true);
				}
			}

			private class FlashlightSlot
			{
				public FlashlightSlot()
				{
					//IL_0008: Unknown result type (might be due to invalid IL or missing references)
					//IL_000e: Expected O, but got Unknown
					//IL_0047: Unknown result type (might be due to invalid IL or missing references)
					//IL_004d: Expected O, but got Unknown
					//IL_0056: Unknown result type (might be due to invalid IL or missing references)
					//IL_005b: Unknown result type (might be due to invalid IL or missing references)
					//IL_0068: Expected O, but got Unknown
					//IL_006a: Unknown result type (might be due to invalid IL or missing references)
					//IL_006f: Unknown result type (might be due to invalid IL or missing references)
					//IL_0080: Unknown result type (might be due to invalid IL or missing references)
					//IL_008c: Unknown result type (might be due to invalid IL or missing references)
					//IL_00b3: Expected O, but got Unknown
					ModSettingsConfig val = new ModSettingsConfig();
					val.Name = "ReservedFlashlightSlot";
					val.Id = "FlipMods.ReservedFlashlightSlot";
					val.Version = "1.5.7";
					val.Description = "Gives a free, dedicated flashlight slot on the right side of your screen. Allows the flashlight to become togglable via keybinds.";
					MenuComponent[] array = new MenuComponent[1];
					VerticalComponent val2 = new VerticalComponent();
					val2.Children = (MenuComponent[])(object)new MenuComponent[2]
					{
						(MenuComponent)new LabelComponent
						{
							Text = "Placeholder for keybind..."
						},
						(MenuComponent)new ToggleComponent
						{
							Value = ConfigSettings.hideFlashlightMeshShoulder.Value,
							Text = "Hide Flashlight On Shoulder",
							OnValueChanged = delegate(ToggleComponent self, bool value)
							{
								logger.LogInfo((object)$"New value: {value}");
								ConfigSettings.hideFlashlightMeshShoulder.Value = !ConfigSettings.hideFlashlightMeshShoulder.Value;
							}
						}
					};
					array[0] = (MenuComponent)val2;
					val.MenuComponents = (MenuComponent[])(object)array;
					ModMenu.RegisterMod(val, true, true);
				}
			}

			private class WalkieSlot
			{
				public WalkieSlot()
				{
					//IL_0008: Unknown result type (might be due to invalid IL or missing references)
					//IL_000e: Expected O, but got Unknown
					//IL_0047: Unknown result type (might be due to invalid IL or missing references)
					//IL_004d: Expected O, but got Unknown
					//IL_0056: Unknown result type (might be due to invalid IL or missing references)
					//IL_005b: Unknown result type (might be due to invalid IL or missing references)
					//IL_0068: Expected O, but got Unknown
					//IL_006a: Unknown result type (might be due to invalid IL or missing references)
					//IL_006f: Unknown result type (might be due to invalid IL or missing references)
					//IL_0080: Unknown result type (might be due to invalid IL or missing references)
					//IL_008c: Unknown result type (might be due to invalid IL or missing references)
					//IL_00b3: Expected O, but got Unknown
					ModSettingsConfig val = new ModSettingsConfig();
					val.Name = "ReservedWalkieSlot";
					val.Id = "FlipMods.ReservedWalkieSlot";
					val.Version = "1.5.3";
					val.Description = "Gives a free, dedicated Walkie slot on the right side of your screen. You can press [X] to activate and speak into the Walkie at anytime.";
					MenuComponent[] array = new MenuComponent[1];
					VerticalComponent val2 = new VerticalComponent();
					val2.Children = (MenuComponent[])(object)new MenuComponent[2]
					{
						(MenuComponent)new LabelComponent
						{
							Text = "Placeholder for keybind..."
						},
						(MenuComponent)new ToggleComponent
						{
							Value = ConfigSettings.hideWalkieMeshShoulder.Value,
							Text = "Hide Walkie On Shoulder",
							OnValueChanged = delegate(ToggleComponent self, bool value)
							{
								logger.LogInfo((object)$"New value: {value}");
								ConfigSettings.hideWalkieMeshShoulder.Value = !ConfigSettings.hideWalkieMeshShoulder.Value;
							}
						}
					};
					array[0] = (MenuComponent)val2;
					val.MenuComponents = (MenuComponent[])(object)array;
					ModMenu.RegisterMod(val, true, true);
				}
			}

			private SlotCore coreSettings = new SlotCore();

			private FlashlightSlot flaslightSettings = new FlashlightSlot();

			private WalkieSlot walkieSettings = new WalkieSlot();
		}

		private class HelmetCamera
		{
			public HelmetCamera()
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				//IL_000e: Expected O, but got Unknown
				//IL_0019: Unknown result type (might be due to invalid IL or missing references)
				//IL_0023: Expected O, but got Unknown
				//IL_002f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0039: Expected O, but got Unknown
				//IL_0045: Unknown result type (might be due to invalid IL or missing references)
				//IL_004f: Expected O, but got Unknown
				//IL_005b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0065: Expected O, but got Unknown
				//IL_0071: Unknown result type (might be due to invalid IL or missing references)
				//IL_007b: Expected O, but got Unknown
				//IL_0092: Unknown result type (might be due to invalid IL or missing references)
				//IL_0098: Expected O, but got Unknown
				//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d7: Expected O, but got Unknown
				//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
				//IL_0106: Unknown result type (might be due to invalid IL or missing references)
				//IL_012d: Expected O, but got Unknown
				//IL_012f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0134: Unknown result type (might be due to invalid IL or missing references)
				//IL_0140: Unknown result type (might be due to invalid IL or missing references)
				//IL_014c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0158: Unknown result type (might be due to invalid IL or missing references)
				//IL_017f: Expected O, but got Unknown
				//IL_0181: Unknown result type (might be due to invalid IL or missing references)
				//IL_0186: Unknown result type (might be due to invalid IL or missing references)
				//IL_0192: Unknown result type (might be due to invalid IL or missing references)
				//IL_019e: Unknown result type (might be due to invalid IL or missing references)
				//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
				//IL_01d1: Expected O, but got Unknown
				OptionDataList val = new OptionDataList();
				val.options.Add(new OptionData("48x48"));
				val.options.Add(new OptionData("128x128"));
				val.options.Add(new OptionData("256x256"));
				val.options.Add(new OptionData("512x512"));
				val.options.Add(new OptionData("1024x1024"));
				OptionData value2 = val.options[PluginInit.config_isHighQuality.Value];
				ModSettingsConfig val2 = new ModSettingsConfig();
				val2.Name = "Helmet_Cameras";
				val2.Id = "RickArg.lethalcompany.helmetcameras";
				val2.Version = "2.1.5";
				val2.Description = "For monitoring first person cameras on player's helmets. For best \"Camera Man\" experience.";
				MenuComponent[] array = new MenuComponent[1];
				VerticalComponent val3 = new VerticalComponent();
				val3.Children = (MenuComponent[])(object)new MenuComponent[3]
				{
					(MenuComponent)new DropdownComponent
					{
						Value = value2,
						Text = "Monitor Resolution",
						Options = val.options,
						OnValueChanged = delegate(DropdownComponent self, OptionData value)
						{
							switch (value.text)
							{
							case "48x48":
								PluginInit.config_isHighQuality.Value = 0;
								break;
							case "128x128":
								PluginInit.config_isHighQuality.Value = 1;
								break;
							case "256x256":
								PluginInit.config_isHighQuality.Value = 2;
								break;
							case "512x512":
								PluginInit.config_isHighQuality.Value = 3;
								break;
							case "1024x1024":
								PluginInit.config_isHighQuality.Value = 4;
								break;
							}
						}
					},
					(MenuComponent)new SliderComponent
					{
						MinValue = 10f,
						MaxValue = 100f,
						Text = "Camera's Render Distance",
						OnValueChanged = delegate(SliderComponent self, float value)
						{
							PluginInit.config_renderDistance.Value = (int)value;
							logger.LogInfo((object)$"New value: {value}");
						}
					},
					(MenuComponent)new SliderComponent
					{
						MinValue = 24f,
						MaxValue = 144f,
						Text = "Camera's FPS",
						OnValueChanged = delegate(SliderComponent self, float value)
						{
							PluginInit.config_cameraFps.Value = (int)value;
							logger.LogInfo((object)$"New value: {value}");
						}
					}
				};
				array[0] = (MenuComponent)val3;
				val2.MenuComponents = (MenuComponent[])(object)array;
				ModMenu.RegisterMod(val2);
			}
		}

		internal static string configPath = "BepInEx/config/";

		private static ManualLogSource logger = LCTutorialMod.mls;

		private ReservedSlots reservedSlotsSettingsMenu = new ReservedSlots();

		private HelmetCamera helmetCameraSettingsMenu = new HelmetCamera();
	}
}