Decompiled source of InstantParkSearcher v2.1.0

Mods/InstantParkSearcher.dll

Decompiled a month ago
using System;
using System.Collections;
using System.Collections.Generic;
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.1.0", "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
{
	[CompilerGenerated]
	private sealed class <ParkSearch>d__5 : IEnumerator<object>, IDisposable, IEnumerator
	{
		private int <>1__state;

		private object <>2__current;

		public main <>4__this;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <ParkSearch>d__5(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Expected O, but got Unknown
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				<>2__current = (object)new WaitForSeconds(1f);
				<>1__state = 1;
				return true;
			case 1:
				<>1__state = -1;
				<>4__this.parkBoardGymVariant.OnFindRandomParkPressed();
				return false;
			}
		}

		bool IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		[DebuggerHidden]
		void IEnumerator.Reset()
		{
			throw new NotSupportedException();
		}
	}

	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());
		}
	}

	[IteratorStateMachine(typeof(<ParkSearch>d__5))]
	public IEnumerator ParkSearch()
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <ParkSearch>d__5(0)
		{
			<>4__this = this
		};
	}

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