Decompiled source of TutorialFixer v0.0.2

Mods/TutorialFixer.dll

Decompiled 9 months ago
using System;
using System.Collections;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BoneLib;
using MelonLoader;
using SLZ.Bonelab;
using TutorialFixer;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("Fixes the borked tutorial pop-ups.")]
[assembly: AssemblyDescription("Fixes the borked tutorial pop-ups.")]
[assembly: AssemblyProduct("Tutorial Fixer")]
[assembly: AssemblyCopyright("Developed by jaced, root-mega")]
[assembly: AssemblyFileVersion("0.0.1")]
[assembly: MelonInfo(typeof(Main), "Tutorial Fixer", "0.0.1", "jaced, root-mega", "Link")]
[assembly: MelonColor(ConsoleColor.DarkYellow)]
[assembly: MelonGame("Stress Level Zero", "BONELAB")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("0.0.1.0")]
namespace TutorialFixer;

internal class Main : MelonMod
{
	internal const string Name = "Tutorial Fixer";

	internal const string Description = "Fixes the borked tutorial pop-ups.";

	internal const string Author = "jaced, root-mega";

	internal const string Version = "0.0.1";

	internal const string DownloadLink = "Link";

	public override void OnInitializeMelon()
	{
		Hooking.OnLevelInitialized += LevelInitialized;
	}

	private static IEnumerator ExecuteAfterDelay()
	{
		yield return (object)new WaitForSeconds(0.5f);
		TutorialRig tutorialRig = Player.rigManager.tutorialRig;
		ControllerToolTip controller_left = ((Component)Player.rigManager.tutorialRig.toolTip_left).GetComponent<ControllerToolTip>();
		ControllerToolTip controller_right = ((Component)Player.rigManager.tutorialRig.toolTip_right).GetComponent<ControllerToolTip>();
		InputHighlight val = (InputHighlight)0;
		InputHighlight val2 = (InputHighlight)0;
		LocationHighlight val3 = (LocationHighlight)0;
		LocationHighlight val4 = (LocationHighlight)8;
		SpecificHand val5 = (SpecificHand)1;
		bool flag = false;
		string text = "";
		string text2 = "";
		int num = 1;
		float num2 = 0.001f;
		Sprite val6 = null;
		Sprite val7 = null;
		AudioClip val8 = null;
		TutorialTrigger val9 = null;
		try
		{
			tutorialRig.CUSTOMTUTORIAL(val, val2, val3, val4, val5, flag, text, text2, num, num2, val6, val7, val8, val9);
			MelonLogger.Msg("Tutorial bootstrapper method invoked successfully.");
		}
		catch (Exception ex)
		{
			MelonLogger.Error("Error starting the tutorial bootstrapper: " + ex.Message);
		}
		yield return (object)new WaitForSeconds(0.05f);
		Vector3 val10 = default(Vector3);
		((Vector3)(ref val10))..ctor(1.7711f, 0.5631f, 0.8788f);
		controller_left.max_bg_scale = val10;
		controller_right.max_bg_scale = val10;
		controller_left.target_bg_scale = val10;
		controller_right.target_bg_scale = val10;
	}

	internal static void LevelInitialized(LevelInfo info)
	{
		MelonLogger.Msg("BONELAB level has been loaded! Trying to fix tutorial pop-ups now...");
		if ((Object)(object)Player.rigManager == (Object)null)
		{
			MelonLogger.Msg("Player.rigManager is null. Exiting method.");
		}
		else if ((Object)(object)Player.rigManager.tutorialRig == (Object)null)
		{
			MelonLogger.Msg("Player.rigManager.tutorialRig is null. Exiting method.");
		}
		else if ((Object)(object)Player.rigManager.tutorialRig.toolTip_left == (Object)null)
		{
			MelonLogger.Msg("Player.rigManager.tutorialRig.toolTip_left is null. Exiting method.");
		}
		else if ((Object)(object)((Component)Player.rigManager.tutorialRig.toolTip_left).GetComponent<ControllerToolTip>() == (Object)null)
		{
			MelonLogger.Msg("ControllerToolTip component not found on left controller. Exiting method.");
		}
		else if ((Object)(object)((Component)Player.rigManager.tutorialRig.toolTip_right).GetComponent<ControllerToolTip>() == (Object)null)
		{
			MelonLogger.Msg("ControllerToolTip component not found on right controller. Exiting method.");
		}
		else
		{
			MelonCoroutines.Start(ExecuteAfterDelay());
		}
	}
}