Decompiled source of AvatarSwitcherDisabler v1.0.0

Mods/Avatar Switcher Disabler.dll

Decompiled 7 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using HarmonyLib;
using LabFusion.Utilities;
using MelonLoader;
using SLZ.Props;
using bonelab_template;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("A code mod that prevents pesky forced avatar changes, mostly for BONELAB Fusion")]
[assembly: AssemblyDescription("A code mod that prevents pesky forced avatar changes, mostly for BONELAB Fusion")]
[assembly: AssemblyCompany("Mod Company")]
[assembly: AssemblyProduct("Avatar Switcher Disabler")]
[assembly: AssemblyCopyright("Developed by DayTrip10")]
[assembly: AssemblyTrademark("Mod Company")]
[assembly: AssemblyFileVersion("1.0.0")]
[assembly: MelonInfo(typeof(Main), "Avatar Switcher Disabler", "1.0.0", "DayTrip10", "Link")]
[assembly: MelonColor(ConsoleColor.White)]
[assembly: MelonGame("Stress Level Zero", "BONELAB")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace bonelab_template;

internal class Main : MelonMod
{
	internal const string Name = "Avatar Switcher Disabler";

	internal const string Description = "A code mod that prevents pesky forced avatar changes, mostly for BONELAB Fusion";

	internal const string Author = "DayTrip10";

	internal const string Company = "Mod Company";

	internal const string Version = "1.0.0";

	internal const string DownloadLink = "Link";

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

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

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

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

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

	public override void OnLateUpdate()
	{
		((MelonBase)this).OnLateUpdate();
	}
}
public class DestroyGameObjectWithPullCordForceChange : MelonMod
{
	[HarmonyPatch(typeof(PullCordForceChange), "ForceChange")]
	public static class ForceChange_Patch
	{
		[HarmonyPrefix]
		public static bool Prefix(PullCordForceChange __instance)
		{
			return false;
		}
	}

	private static Harmony harmony;

	public override void OnApplicationStart()
	{
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_001f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0025: Unknown result type (might be due to invalid IL or missing references)
		//IL_002a: 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_0036: Unknown result type (might be due to invalid IL or missing references)
		//IL_0038: Unknown result type (might be due to invalid IL or missing references)
		//IL_003d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0042: Unknown result type (might be due to invalid IL or missing references)
		//IL_0049: Unknown result type (might be due to invalid IL or missing references)
		//IL_0055: Expected O, but got Unknown
		//IL_0061: Unknown result type (might be due to invalid IL or missing references)
		//IL_006b: Expected O, but got Unknown
		MelonLogger.Msg("DestroyGameObjectWithPullCordForceChange mod loaded");
		MelonLogger.Msg("Avatar Forced Changes Prevented");
		string text = "Forced Avatar Changes Have Been Disabled";
		FusionNotifier.Send(new FusionNotification
		{
			title = NotificationText.op_Implicit("Avatar Changes Prevented"),
			showTitleOnPopup = true,
			message = NotificationText.op_Implicit(text),
			isMenuItem = false,
			isPopup = true
		});
		if (harmony == null)
		{
			harmony = new Harmony("com.mygamemods.destroywithpullcordforcechange");
		}
		harmony.PatchAll(Assembly.GetExecutingAssembly());
	}

	public override void OnUpdate()
	{
	}

	public override void OnApplicationQuit()
	{
		Harmony obj = harmony;
		if (obj != null)
		{
			obj.UnpatchAll((string)null);
		}
	}
}