Decompiled source of InstantParkSearcher v2.0.1

Mods/InstantParkSearcher.dll

Decompiled 5 months ago
using System.Collections;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using Il2CppRUMBLE.Environment;
using Il2CppRUMBLE.Interactions.InteractionBase;
using InstantParkSearcher;
using MelonLoader;
using RumbleModdingAPI;
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(main), "Instant Park Searcher", "2.0.1", "UlvakSkillz", null)]
[assembly: MelonGame("Buckethead Entertainment", "RUMBLE")]
[assembly: MelonColor(255, 195, 0, 255)]
[assembly: MelonAuthorColor(255, 195, 0, 255)]
[assembly: VerifyLoaderVersion(0, 6, 2, true)]
[assembly: AssemblyTitle("InstantParkSearcher")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("InstantParkSearcher")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("c7782c7f-af24-4ef0-94b4-d1a4292ae989")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace InstantParkSearcher;

public class main : MelonMod
{
	private ParkBoardGymVariant parkBoardGymVariant;

	private InteractionSlider interactionSlider;

	private string currentScene = "Loader";

	public override void OnLateInitializeMelon()
	{
		Calls.onMapInitialized += Init;
	}

	private void Init()
	{
		if (currentScene == "Gym")
		{
			parkBoardGymVariant = Parkboard.GetGameObject().GetComponent<ParkBoardGymVariant>();
			interactionSlider = ((Component)PrimaryDisplay.GetGameObject().transform.GetChild(1).GetChild(0).GetChild(2)
				.GetChild(8)).gameObject.GetComponent<InteractionSlider>();
			((InteractionNumericalBase)interactionSlider).SetStep(1, false, false);
			MelonCoroutines.Start(ParkSearch());
		}
	}

	public IEnumerator ParkSearch()
	{
		yield return (object)new WaitForSeconds(1f);
		parkBoardGymVariant.OnFindRandomParkPressed();
	}

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