Decompiled source of StairsFix v2.0.2

Mods/StairFix.dll

Decompiled 5 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using MelonLoader;
using StairFix;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: MelonInfo(typeof(StairFixClass), "StairsFix", "2.0.2", "Baumritter", null)]
[assembly: MelonGame("Buckethead Entertainment", "RUMBLE")]
[assembly: VerifyLoaderVersion(0, 6, 4, true)]
[assembly: MelonColor(200, 0, 200, 0)]
[assembly: MelonAuthorColor(200, 0, 200, 0)]
[assembly: AssemblyTitle("StairsFix")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("StairsFix")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("caa17032-5000-4195-b343-c26492084360")]
[assembly: AssemblyFileVersion("2.0.2")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("2.0.2.0")]
namespace StairFix;

public static class BuildInfo
{
	public const string ModName = "StairsFix";

	public const string ModVersion = "2.0.2";

	public const string Description = "Obstructs the jail.";

	public const string Author = "Baumritter";

	public const string Company = "";
}
public class StairFixClass : MelonMod
{
	private const double SceneDelay = 4.0;

	private readonly bool debuglog = false;

	private bool loaddelaydone = false;

	private bool loadlockout = false;

	private bool DoOnce = false;

	private DateTime loaddelay;

	private string currentscene;

	private GameObject Frame;

	private GameObject Box1;

	private GameObject Box2;

	public override void OnInitializeMelon()
	{
		((MelonBase)this).OnInitializeMelon();
	}

	public override void OnLateInitializeMelon()
	{
		((MelonBase)this).OnLateInitializeMelon();
	}

	public override void OnUpdate()
	{
		//IL_003e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_0054: Expected O, but got Unknown
		//IL_006e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0093: Unknown result type (might be due to invalid IL or missing references)
		//IL_018c: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01db: Unknown result type (might be due to invalid IL or missing references)
		//IL_0200: Unknown result type (might be due to invalid IL or missing references)
		//IL_022a: Unknown result type (might be due to invalid IL or missing references)
		//IL_024f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0279: Unknown result type (might be due to invalid IL or missing references)
		//IL_029e: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ed: Unknown result type (might be due to invalid IL or missing references)
		//IL_0317: Unknown result type (might be due to invalid IL or missing references)
		//IL_033c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0361: Unknown result type (might be due to invalid IL or missing references)
		//IL_0388: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_03d2: Unknown result type (might be due to invalid IL or missing references)
		((MelonBase)this).OnUpdate();
		LoadDelayLogic();
		if (!(currentscene == "Gym") || !loaddelaydone || DoOnce)
		{
			return;
		}
		Frame = new GameObject
		{
			name = "StairsFix"
		};
		Frame.transform.localPosition = new Vector3(11.5f, 0.4f, -3.25f);
		Frame.transform.localEulerAngles = new Vector3(0f, 50f, 0f);
		Box1 = GameObject.Find("--------------LOGIC--------------/Heinhouser products/Howard root/Props/Crate (5)");
		Box2 = Object.Instantiate<GameObject>(Box1);
		for (int i = 0; i < Box2.transform.childCount; i++)
		{
			((Component)Box2.transform.GetChild(i)).gameObject.SetActive(false);
		}
		for (int j = 0; j <= 6; j++)
		{
			Box1 = Object.Instantiate<GameObject>(Box2);
			Box1.transform.SetParent(Frame.transform);
			((Object)Box1).name = "StairsCrate";
			switch (j)
			{
			case 0:
				Box1.transform.localPosition = new Vector3(-0.2f, 0f, 0.075f);
				Box1.transform.localEulerAngles = new Vector3(0f, 0f, 5.5f);
				break;
			case 1:
				Box1.transform.localPosition = new Vector3(0.44f, -0.03f, 0.075f);
				Box1.transform.localEulerAngles = new Vector3(0.6f, 0f, 336.4f);
				break;
			case 2:
				Box1.transform.localPosition = new Vector3(0.77f, -0.755f, 0.075f);
				Box1.transform.localEulerAngles = new Vector3(0f, 355f, 0.7f);
				break;
			case 3:
				Box1.transform.localPosition = new Vector3(0.79f, -1.335f, 0.035f);
				Box1.transform.localEulerAngles = new Vector3(359f, 10f, 1.7f);
				break;
			case 4:
				Box1.transform.localPosition = new Vector3(-0.04f, -0.849f, -0.54f);
				Box1.transform.localEulerAngles = new Vector3(0f, 2.562f, 339.14f);
				break;
			case 5:
				Box1.transform.localPosition = new Vector3(0.281f, -0.474f, -0.53f);
				Box1.transform.localEulerAngles = new Vector3(0f, 3.662f, 20.2758f);
				Box1.transform.localScale = new Vector3(0.52f, 0.52f, 0.52f);
				break;
			case 6:
				Box1.transform.localPosition = new Vector3(0.09f, -0.19f, 0.975f);
				Box1.transform.localEulerAngles = new Vector3(0f, 352.3685f, 329.4683f);
				Box1.transform.localScale = new Vector3(0.8f, 0.8f, 0.8f);
				break;
			}
		}
		Object.Destroy((Object)(object)Box2);
		DoOnce = true;
	}

	public void LoadDelayLogic()
	{
		if (!loaddelaydone && !loadlockout)
		{
			loaddelay = DateTime.Now.AddSeconds(4.0);
			loadlockout = true;
			if (debuglog)
			{
				MelonLogger.Msg("LoadDelay: Start.");
			}
			if (debuglog)
			{
				MelonLogger.Msg(loaddelay.ToString());
			}
		}
		if (DateTime.Now >= loaddelay && !loaddelaydone)
		{
			loaddelaydone = true;
			if (debuglog)
			{
				MelonLogger.Msg("LoadDelay: End.");
			}
		}
	}

	public override void OnSceneWasLoaded(int buildIndex, string sceneName)
	{
		((MelonMod)this).OnSceneWasLoaded(buildIndex, sceneName);
		currentscene = sceneName;
		loaddelaydone = false;
		loadlockout = false;
		DoOnce = false;
	}
}