Decompiled source of SOTF ModMenu 2025 v2.0.0

plugins/SOTF_ModMenu.dll

Decompiled 2 weeks ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using Il2CppInterop.Runtime.Injection;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Microsoft.CodeAnalysis;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("SOTF_ModMenu")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("SOTF_ModMenu")]
[assembly: AssemblyTitle("SOTF_ModMenu")]
[assembly: AssemblyVersion("1.0.0.0")]
[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 YourName.SOTFModMenu
{
	public static class Features
	{
		private static Light _caveLight;

		public static void ApplyCaveLight(bool on)
		{
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Expected O, but got Unknown
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			if (!on)
			{
				if ((Object)(object)_caveLight != (Object)null)
				{
					Object.Destroy((Object)(object)((Component)_caveLight).gameObject);
				}
				_caveLight = null;
			}
			else if (!((Object)(object)_caveLight != (Object)null))
			{
				Camera main = Camera.main;
				if (!((Object)(object)main == (Object)null))
				{
					GameObject val = new GameObject("SOTF_CaveLight");
					Object.DontDestroyOnLoad((Object)val);
					val.transform.SetParent(((Component)main).transform);
					val.transform.localPosition = new Vector3(0f, 0f, 0.6f);
					_caveLight = val.AddComponent<Light>();
					_caveLight.type = (LightType)2;
					_caveLight.range = 20f;
					_caveLight.intensity = 2.2f;
				}
			}
		}

		public static void ApplyGodMode()
		{
		}

		public static void ApplyInfHeal()
		{
		}

		public static void ApplyInfStamina()
		{
		}

		public static void ApplyInfLung()
		{
		}

		public static void ApplyNoFallDamageSoft()
		{
		}

		public static void ApplyNoCold()
		{
		}

		public static void ApplyNoHunger()
		{
		}

		public static void ApplyNoThirst()
		{
		}

		public static void ApplyAlwaysRested()
		{
		}

		public static void ApplyInstantBuild()
		{
		}

		public static void ApplyInfiniteLogs()
		{
		}

		public static void ApplyInfiniteAmmo()
		{
		}

		public static void ApplySpeedRun(bool on)
		{
		}

		public static void ApplyFly(bool on)
		{
		}

		public static void ApplyNoClip(bool on)
		{
		}

		public static void ApplyInstantKill()
		{
		}

		public static void ApplyOGMusic(bool on)
		{
		}

		public static CreativeSnapshot EnableCreativeGiveAll()
		{
			return new CreativeSnapshot();
		}

		public static void DisableCreativeRevert(CreativeSnapshot snapshot)
		{
		}
	}
	public class CreativeSnapshot
	{
	}
	public class MenuBehaviour : MonoBehaviour
	{
		private bool _open;

		private Rect _window = new Rect(30f, 30f, 420f, 520f);

		private Vector2 _scroll;

		private bool godMode;

		private bool infHeal;

		private bool infStamina;

		private bool infLung;

		private bool noFallDamage;

		private bool noCold;

		private bool noHunger;

		private bool noThirst;

		private bool alwaysRested;

		private bool instantBuild;

		private bool infiniteLogs;

		private bool infiniteAmmo;

		private bool caveLight;

		private bool speedRun;

		private bool ogMusic;

		private bool fly;

		private bool noclip;

		private bool instantKill;

		private bool creativeMode;

		private CreativeSnapshot _creativeSnapshot = new CreativeSnapshot();

		public MenuBehaviour(IntPtr ptr)
			: base(ptr)
		{
		}//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)


		private void Update()
		{
			if (Input.GetKeyDown((KeyCode)96))
			{
				_open = !_open;
			}
			if (godMode)
			{
				Features.ApplyGodMode();
			}
			if (infHeal)
			{
				Features.ApplyInfHeal();
			}
			if (infStamina)
			{
				Features.ApplyInfStamina();
			}
			if (infLung)
			{
				Features.ApplyInfLung();
			}
			if (noCold)
			{
				Features.ApplyNoCold();
			}
			if (noHunger)
			{
				Features.ApplyNoHunger();
			}
			if (noThirst)
			{
				Features.ApplyNoThirst();
			}
			if (alwaysRested)
			{
				Features.ApplyAlwaysRested();
			}
			if (noFallDamage)
			{
				Features.ApplyNoFallDamageSoft();
			}
			if (instantBuild)
			{
				Features.ApplyInstantBuild();
			}
			if (infiniteLogs)
			{
				Features.ApplyInfiniteLogs();
			}
			if (infiniteAmmo)
			{
				Features.ApplyInfiniteAmmo();
			}
			if (caveLight)
			{
				Features.ApplyCaveLight(on: true);
			}
			else
			{
				Features.ApplyCaveLight(on: false);
			}
			if (speedRun)
			{
				Features.ApplySpeedRun(on: true);
			}
			else
			{
				Features.ApplySpeedRun(on: false);
			}
			if (fly)
			{
				Features.ApplyFly(on: true);
			}
			else
			{
				Features.ApplyFly(on: false);
			}
			if (noclip)
			{
				Features.ApplyNoClip(on: true);
			}
			else
			{
				Features.ApplyNoClip(on: false);
			}
			if (instantKill)
			{
				Features.ApplyInstantKill();
			}
			if (ogMusic)
			{
				Features.ApplyOGMusic(on: true);
			}
			else
			{
				Features.ApplyOGMusic(on: false);
			}
		}

		private void OnGUI()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			if (_open)
			{
				_window = GUI.Window(1337, _window, WindowFunction.op_Implicit((Action<int>)delegate(int id)
				{
					DrawWindow(id);
				}), "SOTF ModMenu (Patch16)");
			}
		}

		private void DrawWindow(int id)
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d3: Unknown result type (might be due to invalid IL or missing references)
			GUILayout.Label("Toggle: BackQuote (` / ё)", (Il2CppReferenceArray<GUILayoutOption>)null);
			GUILayout.Space(6f);
			_scroll = GUILayout.BeginScrollView(_scroll, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(440f) });
			godMode = GUILayout.Toggle(godMode, "God Mode", Array.Empty<GUILayoutOption>());
			infHeal = GUILayout.Toggle(infHeal, "Inf Heal", Array.Empty<GUILayoutOption>());
			infStamina = GUILayout.Toggle(infStamina, "Inf Stamina", Array.Empty<GUILayoutOption>());
			infLung = GUILayout.Toggle(infLung, "Inf Lung Capacity", Array.Empty<GUILayoutOption>());
			noFallDamage = GUILayout.Toggle(noFallDamage, "No Fall Damage", Array.Empty<GUILayoutOption>());
			noCold = GUILayout.Toggle(noCold, "No Cold", Array.Empty<GUILayoutOption>());
			noHunger = GUILayout.Toggle(noHunger, "No Hunger", Array.Empty<GUILayoutOption>());
			noThirst = GUILayout.Toggle(noThirst, "No Thirst", Array.Empty<GUILayoutOption>());
			alwaysRested = GUILayout.Toggle(alwaysRested, "Always Rested", Array.Empty<GUILayoutOption>());
			instantBuild = GUILayout.Toggle(instantBuild, "Instant Build", Array.Empty<GUILayoutOption>());
			infiniteLogs = GUILayout.Toggle(infiniteLogs, "Infinite Logs", Array.Empty<GUILayoutOption>());
			infiniteAmmo = GUILayout.Toggle(infiniteAmmo, "Infinite Ammo", Array.Empty<GUILayoutOption>());
			GUILayout.Space(8f);
			caveLight = GUILayout.Toggle(caveLight, "Cave Light", Array.Empty<GUILayoutOption>());
			speedRun = GUILayout.Toggle(speedRun, "SpeedRun", Array.Empty<GUILayoutOption>());
			ogMusic = GUILayout.Toggle(ogMusic, "OG Menu Music", Array.Empty<GUILayoutOption>());
			GUILayout.Space(8f);
			fly = GUILayout.Toggle(fly, "Fly", Array.Empty<GUILayoutOption>());
			noclip = GUILayout.Toggle(noclip, "Noclip", Array.Empty<GUILayoutOption>());
			instantKill = GUILayout.Toggle(instantKill, "Instant Kill", Array.Empty<GUILayoutOption>());
			GUILayout.Space(12f);
			GUILayout.Label("Creative mode (выдать набор / убрать назад):", (Il2CppReferenceArray<GUILayoutOption>)null);
			bool flag = GUILayout.Toggle(creativeMode, "Creative Mod (give all items)", Array.Empty<GUILayoutOption>());
			if (flag != creativeMode)
			{
				creativeMode = flag;
				if (creativeMode)
				{
					_creativeSnapshot = Features.EnableCreativeGiveAll();
				}
				else
				{
					Features.DisableCreativeRevert(_creativeSnapshot);
				}
			}
			GUILayout.Space(12f);
			GUILayout.Label("Item Spawner:", (Il2CppReferenceArray<GUILayoutOption>)null);
			GUILayout.BeginHorizontal((Il2CppReferenceArray<GUILayoutOption>)null);
			GUILayout.Button("Open Item Spawner (FUTURE)", (Il2CppReferenceArray<GUILayoutOption>)null);
			GUILayout.EndHorizontal();
			GUILayout.EndScrollView();
			GUI.DragWindow(new Rect(0f, 0f, 10000f, 20f));
		}
	}
	[BepInPlugin("yourname.sotf.modmenu", "SOTF ModMenu (Patch16)", "2.0.0")]
	public class ModMenuPlugin : BasePlugin
	{
		internal static ManualLogSource Logger;

		public override void Load()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Expected O, but got Unknown
			Logger = ((BasePlugin)this).Log;
			Logger.LogInfo((object)"SOTF ModMenu loaded (IL2CPP).");
			ClassInjector.RegisterTypeInIl2Cpp<MenuBehaviour>();
			GameObject val = new GameObject("SOTF_ModMenu");
			Object.DontDestroyOnLoad((Object)val);
			val.AddComponent<MenuBehaviour>();
			((BasePlugin)this).Log.LogInfo((object)"MenuBehaviour added.");
		}
	}
}