Decompiled source of RemoteMatchmaking v1.0.0

Mods/RemoteMatchmaking.dll

Decompiled a week ago
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using Il2CppRUMBLE.Environment.Matchmaking;
using Il2CppRUMBLE.Interactions.InteractionBase;
using MelonLoader;
using RemoteMatchmaking;
using RumbleModUI;
using RumbleModdingAPI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: MelonInfo(typeof(Main), "RemoteMatchmaking", "1.0.0", "Lopes", null)]
[assembly: MelonGame("Buckethead Entertainment", "RUMBLE")]
[assembly: MelonColor(255, 195, 0, 255)]
[assembly: MelonAuthorColor(255, 195, 0, 255)]
[assembly: VerifyLoaderVersion(0, 6, 6, true)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("RemoteMatchmaking")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("RemoteMatchmaking")]
[assembly: AssemblyTitle("RemoteMatchmaking")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace RemoteMatchmaking;

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

	public const string ModVersion = "1.0.0";

	public const string Author = "Lopes";
}
public class Main : MelonMod
{
	private string currentScene = "Loader";

	private Mod RemoteMatchmaking = new Mod();

	private bool ABdown;

	private bool BTriggerdown;

	private bool LeverOn = false;

	private int Slider = 0;

	private bool enabled = true;

	private List<ModSetting> settings = new List<ModSetting>();

	public override void OnSceneWasLoaded(int buildIndex, string sceneName)
	{
		currentScene = sceneName;
	}

	public override void OnLateInitializeMelon()
	{
		Calls.onMapInitialized += mapLoaded;
		UI.instance.UI_Initialized += UIInit;
	}

	private void UIInit()
	{
		//IL_004c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0056: Expected O, but got Unknown
		RemoteMatchmaking.ModName = "RemoteMatchmaking";
		RemoteMatchmaking.ModVersion = "1.0.0";
		RemoteMatchmaking.SetFolder("RemoteMatchmaking");
		settings.Add((ModSetting)(object)RemoteMatchmaking.AddToList("Enabled", false, 0, "Toggles Mod On/Off", new Tags()));
		RemoteMatchmaking.GetFromFile();
		RemoteMatchmaking.ModSaved += Save;
		UI.instance.AddMod(RemoteMatchmaking);
	}

	public void Save()
	{
		enabled = (bool)settings[0].SavedValue;
	}

	public void mapLoaded()
	{
	}

	public override void OnFixedUpdate()
	{
		if (!(currentScene == "Gym"))
		{
			return;
		}
		if ((double)RightController.GetSecondary() > 0.9 && (double)RightController.GetPrimary() > 0.9)
		{
			if (!ABdown)
			{
				ABdown = true;
				if (LeverOn)
				{
					InteractionLeverconsole.GetGameObject().GetComponent<MatchmakingLever>().SetLeverStep(1, false, false);
					LeverOn = false;
				}
				else
				{
					InteractionLeverconsole.GetGameObject().GetComponent<MatchmakingLever>().SetLeverStep(0, false, false);
					LeverOn = true;
				}
			}
		}
		else
		{
			ABdown = false;
		}
		if ((double)RightController.GetSecondary() > 0.9 && (double)RightController.GetTrigger() > 0.9)
		{
			if (!BTriggerdown)
			{
				BTriggerdown = true;
				if (Slider == 1)
				{
					Sliderhandle.GetGameObject().GetComponent<InteractionNumericalBase>().SetStep(1, false, false);
					Slider = 0;
				}
				else
				{
					Sliderhandle.GetGameObject().GetComponent<InteractionNumericalBase>().SetStep(0, false, false);
					Slider = 1;
				}
			}
		}
		else
		{
			BTriggerdown = false;
		}
	}
}