Decompiled source of FlatLand v1.5.2

Mods/FlatLand.dll

Decompiled 3 months 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 FlatLand;
using Il2Cpp;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Il2CppRUMBLE.Audio;
using Il2CppRUMBLE.Interactions.InteractionBase;
using Il2CppRUMBLE.Managers;
using Il2CppRUMBLE.MoveSystem;
using Il2CppRUMBLE.Players.Subsystems;
using Il2CppRUMBLE.Utilities;
using Il2CppTMPro;
using MelonLoader;
using RumbleModUI;
using RumbleModdingAPI;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.SceneManagement;

[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), "FlatLand", "1.5.2", "UlvakSkillz", "https://thunderstore.io/c/rumble/p/UlvakSkillz/FlatLand/")]
[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("FlatLand")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("FlatLand")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("2815acf9-0270-46d3-a435-9c8bd2031c27")]
[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 FlatLand;

public class main : MelonMod
{
	private string currentScene = "Loader";

	private string lastScene = "";

	private bool gymInit = false;

	private bool flatLandActive = false;

	private bool respawning = false;

	private GameObject buttonToSwaptoFlatLand;

	private GameObject flatLandTextPanel;

	private GameObject flatLandParent;

	private List<string> dontDisableGameObject = new List<string>();

	private List<GameObject> DisabledDDOLGameObjects = new List<GameObject>();

	private GameObject landParent;

	private GameObject plane;

	private GameObject measureParent;

	private GameObject flatLandParent2;

	private GameObject matchmaker;

	private GameObject regionBoard;

	private UI UI = UI.instance;

	private Mod FlatLand = new Mod();

	private int size;

	private bool loadMatchmaker;

	private bool showMeasurements;

	private bool darkMode;

	private bool autoLoad;

	public override void OnLateInitializeMelon()
	{
		//IL_0046: Unknown result type (might be due to invalid IL or missing references)
		//IL_0050: Expected O, but got Unknown
		//IL_0063: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Expected O, but got Unknown
		//IL_0080: Unknown result type (might be due to invalid IL or missing references)
		//IL_008a: Expected O, but got Unknown
		//IL_009d: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a7: Expected O, but got Unknown
		//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c4: Expected O, but got Unknown
		FlatLand.ModName = "FlatLand";
		FlatLand.ModVersion = "1.5.2";
		FlatLand.SetFolder("FlatLand");
		FlatLand.AddToList("Map Size", 125, "Determins the size of the FlatLand", new Tags());
		FlatLand.AddToList("Have Matchmaker", false, 0, "Loads a Matchmaker into FlatLand", new Tags());
		FlatLand.AddToList("Show Measurements", true, 0, "Shows Numbers in FlatLand for Easy Measurements", new Tags());
		FlatLand.AddToList("DarkMode", false, 0, "Toggles Walls for Dark Mode", new Tags());
		FlatLand.AddToList("Auto Load FlatLand", false, 0, "Automatically Loads into FlatLand instead of the Gym", new Tags());
		FlatLand.GetFromFile();
		FlatLand.ModSaved += Save;
		size = (int)FlatLand.Settings[0].SavedValue;
		if (size < 1)
		{
			size = 1;
			FlatLand.Settings[0].SavedValue = 1;
			FlatLand.Settings[0].Value = 1;
		}
		loadMatchmaker = (bool)FlatLand.Settings[1].SavedValue;
		showMeasurements = (bool)FlatLand.Settings[2].SavedValue;
		darkMode = (bool)FlatLand.Settings[3].SavedValue;
		autoLoad = (bool)FlatLand.Settings[4].SavedValue;
		UI.instance.UI_Initialized += UIInit;
		Calls.onMapInitialized += SceneInit;
		dontDisableGameObject.Add("[bHaptics]");
		dontDisableGameObject.Add("LanguageManager");
		dontDisableGameObject.Add("PhotonMono");
		dontDisableGameObject.Add("Game Instance");
		dontDisableGameObject.Add("Timer Updater");
		dontDisableGameObject.Add("SteamManager");
		dontDisableGameObject.Add("AnalyticsContainer");
		dontDisableGameObject.Add("PlayFabHttp");
		dontDisableGameObject.Add("UniverseLibCanvas");
		dontDisableGameObject.Add("UE_Freecam");
		dontDisableGameObject.Add("GymPostEffects");
		dontDisableGameObject.Add("!ftraceLightmaps");
		dontDisableGameObject.Add("VoiceLogger");
		dontDisableGameObject.Add("Lighting and effects");
		dontDisableGameObject.Add("Steam Audio Manager Settings");
		dontDisableGameObject.Add("--------------LOGIC--------------");
		dontDisableGameObject.Add("Player Controller(Clone)");
		dontDisableGameObject.Add("Health");
	}

	private void Save()
	{
		size = (int)FlatLand.Settings[0].SavedValue;
		if (size < 1)
		{
			size = 1;
			FlatLand.Settings[0].SavedValue = 1;
			FlatLand.Settings[0].Value = 1;
		}
		bool flag = loadMatchmaker;
		loadMatchmaker = (bool)FlatLand.Settings[1].SavedValue;
		showMeasurements = (bool)FlatLand.Settings[2].SavedValue;
		darkMode = (bool)FlatLand.Settings[3].SavedValue;
		autoLoad = (bool)FlatLand.Settings[4].SavedValue;
		if (flatLandActive)
		{
			if (flag != loadMatchmaker)
			{
				matchmaker.SetActive(loadMatchmaker);
				regionBoard.SetActive(loadMatchmaker);
			}
			MelonCoroutines.Start(ReLoadFlatLand());
		}
	}

	private void UIInit()
	{
		UI.AddMod(FlatLand);
	}

	public override void OnFixedUpdate()
	{
		//IL_003b: Unknown result type (might be due to invalid IL or missing references)
		if (flatLandActive)
		{
			float y = ((Component)Singleton<PlayerManager>.instance.localPlayer.Controller).gameObject.transform.GetChild(2).GetChild(13).GetChild(0)
				.position.y;
			if (!respawning && y <= -10f)
			{
				respawning = true;
				((Component)Singleton<PlayerManager>.instance.localPlayer.Controller).gameObject.GetComponent<PlayerResetSystem>().ResetPlayerController();
			}
			else if (respawning && y >= -10f)
			{
				respawning = false;
			}
		}
	}

	public override void OnSceneWasLoaded(int buildIndex, string sceneName)
	{
		lastScene = currentScene;
		currentScene = sceneName;
		if (flatLandActive)
		{
			ReactivateDDOLObjects();
			flatLandActive = false;
		}
		gymInit = false;
	}

	private void SceneInit()
	{
		//IL_0077: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_0103: Expected O, but got Unknown
		//IL_017c: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_022b: Unknown result type (might be due to invalid IL or missing references)
		//IL_024b: Unknown result type (might be due to invalid IL or missing references)
		//IL_026b: Unknown result type (might be due to invalid IL or missing references)
		//IL_02db: Unknown result type (might be due to invalid IL or missing references)
		//IL_0300: Unknown result type (might be due to invalid IL or missing references)
		if (!(currentScene == "Gym") || gymInit)
		{
			return;
		}
		try
		{
			GameObject val = GameObject.CreatePrimitive((PrimitiveType)3);
			val.AddComponent<MeshCollider>();
			((Object)val).name = "BackPanel";
			val.GetComponent<Renderer>().material.shader = Shader.Find("Universal Render Pipeline/Lit");
			val.GetComponent<Renderer>().material.color = new Color(0f, 1f, 0.814f);
			val.transform.parent = MatchConsole.GetGameObject().transform;
			val.transform.localRotation = Quaternion.Euler(0f, 0f, 0f);
			val.transform.localPosition = new Vector3(-0.4915f, 1.2083f, -0.0151f);
			val.transform.localScale = new Vector3(3f, 2.41f, 0.02f);
			flatLandParent = new GameObject();
			((Object)flatLandParent).name = "FlatLand";
			flatLandTextPanel = Object.Instantiate<GameObject>(((Component)RankRelaxControls.GetGameObject().transform.GetChild(17)).gameObject);
			((Object)flatLandTextPanel).name = "FlatLand Plate";
			flatLandTextPanel.transform.parent = flatLandParent.transform;
			flatLandTextPanel.transform.position = new Vector3(7.45f, 1.9f, 10.12f);
			flatLandTextPanel.transform.rotation = Quaternion.Euler(90f, 122.8f, 0f);
			flatLandTextPanel.transform.localScale = new Vector3(0.29f, 0.3036f, 0.362f);
			GameObject val2 = Object.Instantiate<GameObject>(((Component)RankRelaxControls.GetGameObject().transform.GetChild(15).GetChild(6)).gameObject);
			val2.transform.parent = flatLandTextPanel.transform;
			((Object)val2).name = "Text";
			val2.transform.localPosition = new Vector3(0.04f, 0.74f, 0f);
			val2.transform.localRotation = Quaternion.Euler(0f, 270f, 90f);
			val2.transform.localScale = new Vector3(6.0414f, 3.7636f, 6.462f);
			TextMeshPro component = val2.GetComponent<TextMeshPro>();
			((TMP_Text)component).text = "FlatLand";
			buttonToSwaptoFlatLand = Create.NewButton();
			((Object)buttonToSwaptoFlatLand).name = "FlatLandButton";
			buttonToSwaptoFlatLand.transform.parent = flatLandParent.transform;
			buttonToSwaptoFlatLand.transform.position = new Vector3(7.67f, 1.7f, 10f);
			buttonToSwaptoFlatLand.transform.localRotation = Quaternion.Euler(0f, 302.5f, 90f);
			((Component)buttonToSwaptoFlatLand.transform.GetChild(0)).gameObject.GetComponent<InteractionButton>().onPressed.AddListener(UnityAction.op_Implicit((Action)delegate
			{
				MelonCoroutines.Start(ToFlatLandPressed());
			}));
			gymInit = true;
			if (autoLoad && lastScene != "Gym")
			{
				MelonCoroutines.Start(AutoLoad(currentScene));
			}
		}
		catch
		{
		}
	}

	private IEnumerator AutoLoad(string scene)
	{
		yield return (object)new WaitForSeconds(5f);
		if (scene == currentScene)
		{
			MelonCoroutines.Start(ToFlatLandPressed());
		}
	}

	private IEnumerator ToFlatLandPressed()
	{
		try
		{
			matchmaker = MatchConsole.GetGameObject();
			regionBoard = RegionSelector.GetGameObject();
			((Component)Singleton<PlayerManager>.instance.localPlayer.Controller).gameObject.GetComponent<PlayerResetSystem>().ResetPlayerController();
		}
		catch
		{
		}
		yield return (object)new WaitForSeconds(1f);
		flatLandActive = true;
		DeloadGym();
		LoadFlatLand();
	}

	private IEnumerator ReLoadFlatLand()
	{
		((Component)Singleton<PlayerManager>.instance.localPlayer.Controller).gameObject.GetComponent<PlayerResetSystem>().ResetPlayerController();
		yield return (object)new WaitForSeconds(1f);
		Object.DestroyImmediate((Object)(object)landParent);
		Object.DestroyImmediate((Object)(object)measureParent);
		Object.DestroyImmediate((Object)(object)flatLandParent2);
		LoadFlatLand();
	}

	private IEnumerator TurnOffAllExtraRootObjects()
	{
		GameObject temp3 = new GameObject();
		Object.DontDestroyOnLoad((Object)(object)temp3);
		Scene ddolScene = temp3.scene;
		Object.DestroyImmediate((Object)(object)temp3);
		GameObject[] ddolGameObjects = Il2CppArrayBase<GameObject>.op_Implicit((Il2CppArrayBase<GameObject>)(object)((Scene)(ref ddolScene)).GetRootGameObjects());
		Scene activeScene = SceneManager.GetActiveScene();
		GameObject[] allGameObjects = Il2CppArrayBase<GameObject>.op_Implicit((Il2CppArrayBase<GameObject>)(object)((Scene)(ref activeScene)).GetRootGameObjects());
		GameObject[] array = ddolGameObjects;
		foreach (GameObject temp in array)
		{
			if (temp.active && !dontDisableGameObject.Contains(((Object)temp).name))
			{
				temp.SetActive(false);
				DisabledDDOLGameObjects.Add(temp);
			}
		}
		GameObject[] array2 = allGameObjects;
		foreach (GameObject temp2 in array2)
		{
			if (temp2.active && !dontDisableGameObject.Contains(((Object)temp2).name))
			{
				temp2.SetActive(false);
			}
			else if (((Object)temp2).name == "--------------LOGIC--------------")
			{
				for (int i = 0; i < temp2.transform.GetChildCount(); i++)
				{
					if (((Object)((Component)temp2.transform.GetChild(i)).gameObject).name == "Heinhouser products")
					{
						for (int j = 0; j < temp2.transform.GetChild(i).GetChildCount(); j++)
						{
							if (((Object)((Component)temp2.transform.GetChild(i).GetChild(j)).gameObject).name != "MatchConsole" && ((Object)((Component)temp2.transform.GetChild(i).GetChild(j)).gameObject).name != "RegionSelector")
							{
								((Component)temp2.transform.GetChild(i).GetChild(j)).gameObject.SetActive(false);
							}
							else if (!loadMatchmaker)
							{
								((Component)temp2.transform.GetChild(i).GetChild(j)).gameObject.SetActive(false);
							}
						}
					}
					else if (((Object)((Component)temp2.transform.GetChild(i)).gameObject).name != "Handelers")
					{
						((Component)temp2.transform.GetChild(i)).gameObject.SetActive(false);
					}
				}
			}
			else if (((Object)temp2).name == "Lighting and effects")
			{
				((Component)temp2.transform.GetChild(0)).gameObject.SetActive(false);
			}
		}
		yield break;
	}

	private void DeloadGym()
	{
		try
		{
			Singleton<PoolManager>.instance.ResetPools((AssetType)3);
			Object.Destroy((Object)(object)SceneBoundaryPlayer.GetGameObject());
			MelonCoroutines.Start(TurnOffAllExtraRootObjects());
		}
		catch
		{
		}
	}

	private void ReLoadGym()
	{
		if (matchmaker.active)
		{
			InteractionLever component = ((Component)matchmaker.transform.GetChild(7).GetChild(2).GetChild(0)).GetComponent<InteractionLever>();
			if (((InteractionNumericalBase)component).snappedStep == 1)
			{
				((InteractionNumericalBase)component).SetStep(0, false, false);
			}
		}
		Singleton<SceneManager>.instance.LoadSceneAsync(1, false, false, 2f, (LoadSceneMode)0, (AudioCall)null);
	}

	private void ReactivateDDOLObjects()
	{
		foreach (GameObject disabledDDOLGameObject in DisabledDDOLGameObjects)
		{
			disabledDDOLGameObject.SetActive(true);
		}
		DisabledDDOLGameObjects.Clear();
	}

	private void LoadFlatLand()
	{
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Expected O, but got Unknown
		//IL_0075: Unknown result type (might be due to invalid IL or missing references)
		//IL_009a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0103: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_03b1: Expected O, but got Unknown
		//IL_03dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_013d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0191: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0203: Unknown result type (might be due to invalid IL or missing references)
		//IL_0224: Unknown result type (might be due to invalid IL or missing references)
		//IL_0274: Unknown result type (might be due to invalid IL or missing references)
		//IL_0295: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0307: Unknown result type (might be due to invalid IL or missing references)
		//IL_0351: Unknown result type (might be due to invalid IL or missing references)
		//IL_0372: Unknown result type (might be due to invalid IL or missing references)
		//IL_06f6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0700: Expected O, but got Unknown
		//IL_072b: Unknown result type (might be due to invalid IL or missing references)
		//IL_078a: Unknown result type (might be due to invalid IL or missing references)
		//IL_07aa: Unknown result type (might be due to invalid IL or missing references)
		//IL_07ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_0836: Unknown result type (might be due to invalid IL or missing references)
		//IL_0856: Unknown result type (might be due to invalid IL or missing references)
		//IL_0876: Unknown result type (might be due to invalid IL or missing references)
		//IL_08d8: Unknown result type (might be due to invalid IL or missing references)
		//IL_08f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_098f: Unknown result type (might be due to invalid IL or missing references)
		//IL_09b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_09d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a43: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a64: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a85: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ae8: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b09: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bbb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bdc: Unknown result type (might be due to invalid IL or missing references)
		//IL_044d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0488: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c11: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c36: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c70: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c95: Unknown result type (might be due to invalid IL or missing references)
		//IL_0cba: Unknown result type (might be due to invalid IL or missing references)
		//IL_05cf: Unknown result type (might be due to invalid IL or missing references)
		//IL_05f0: Unknown result type (might be due to invalid IL or missing references)
		//IL_04bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0683: Unknown result type (might be due to invalid IL or missing references)
		//IL_054f: Unknown result type (might be due to invalid IL or missing references)
		//IL_06b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_05a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_057c: Unknown result type (might be due to invalid IL or missing references)
		try
		{
			landParent = new GameObject();
			((Object)landParent).name = "LandParent";
			plane = GameObject.CreatePrimitive((PrimitiveType)3);
			((Object)plane).name = "Floor";
			plane.transform.parent = landParent.transform;
			plane.transform.localScale = new Vector3((float)size, 0.01f, (float)size);
			plane.transform.position = new Vector3(2.8007f, 0f, -1.9802f);
			plane.layer = 9;
			Object.Destroy((Object)(object)plane.GetComponent<BoxCollider>());
			plane.GetComponent<Renderer>().material.shader = Shader.Find("Universal Render Pipeline/Lit");
			plane.GetComponent<Renderer>().material.color = new Color(1f, 1f, 1f);
			if (darkMode)
			{
				plane.GetComponent<Renderer>().material.color = new Color(0.25f, 0.25f, 0.25f);
				GameObject val = Object.Instantiate<GameObject>(plane);
				val.transform.parent = landParent.transform;
				val.transform.position = new Vector3((float)(size / 2) + 2.8007f, (float)(size / 2), -1.9802f);
				val.transform.rotation = Quaternion.Euler(0f, 0f, 90f);
				GameObject val2 = Object.Instantiate<GameObject>(val);
				val2.transform.parent = landParent.transform;
				val2.transform.position = new Vector3((float)(-size / 2) + 2.8007f, (float)(size / 2), -1.9802f);
				val2.transform.rotation = Quaternion.Euler(0f, 0f, 90f);
				GameObject val3 = Object.Instantiate<GameObject>(val);
				val3.transform.parent = landParent.transform;
				val3.transform.position = new Vector3(2.8007f, (float)(size / 2), (float)(size / 2) - 1.9802f);
				val3.transform.rotation = Quaternion.Euler(90f, 0f, 0f);
				GameObject val4 = Object.Instantiate<GameObject>(val);
				val4.transform.parent = landParent.transform;
				val4.transform.position = new Vector3(2.8007f, (float)(size / 2), (float)(-size / 2) - 1.9802f);
				val4.transform.rotation = Quaternion.Euler(90f, 0f, 0f);
				GameObject val5 = Object.Instantiate<GameObject>(val);
				val5.transform.parent = landParent.transform;
				val5.transform.position = new Vector3(2.8007f, (float)size - 1f, -1.9802f);
				val5.transform.rotation = Quaternion.Euler(0f, 0f, 0f);
			}
			MeshCollider collider = plane.AddComponent<MeshCollider>();
			GroundCollider val6 = plane.AddComponent<GroundCollider>();
			val6.isMainGroundCollider = true;
			val6.collider = (Collider)(object)collider;
			measureParent = new GameObject();
			((Object)measureParent).name = "Measurements";
			measureParent.transform.position = new Vector3(0f, 0f, 0f);
			for (int i = 0; i <= 1; i++)
			{
				for (int j = -size / 2; j <= size / 2; j++)
				{
					GameObject val7 = GameObject.CreatePrimitive((PrimitiveType)3);
					Object.Destroy((Object)(object)val7.GetComponent<BoxCollider>());
					val7.GetComponent<Renderer>().material.shader = Shader.Find("Universal Render Pipeline/Lit");
					val7.GetComponent<Renderer>().material.color = new Color(0f, 0f, 0f);
					val7.transform.parent = measureParent.transform;
					val7.transform.localScale = new Vector3(0.01f, 0.0101f, (float)size);
					if (i == 0)
					{
						val7.transform.position = new Vector3((float)j + 2.8007f, 0f, -1.9802f);
						if (showMeasurements && j % 5 == 0 && j != 0)
						{
							GameObject val8 = Create.NewText();
							((TMP_Text)val8.GetComponent<TextMeshPro>()).text = Mathf.Abs(j).ToString();
							((TMP_Text)val8.GetComponent<TextMeshPro>()).fontSize = 10f;
							val8.transform.parent = measureParent.transform;
							val8.transform.position = new Vector3((float)j + 2.8007f, 0.5f, -1.9802f);
							if (j < 0)
							{
								val8.transform.rotation = Quaternion.Euler(0f, -90f, 0f);
							}
							else
							{
								val8.transform.rotation = Quaternion.Euler(0f, 90f, 0f);
							}
						}
						continue;
					}
					val7.transform.position = new Vector3(2.8007f, 0f, (float)j - 1.9802f);
					val7.transform.localRotation = Quaternion.Euler(0f, 90f, 0f);
					if (showMeasurements && j % 5 == 0 && j != 0)
					{
						GameObject val9 = Create.NewText();
						((TMP_Text)val9.GetComponent<TextMeshPro>()).text = Mathf.Abs(j).ToString();
						((TMP_Text)val9.GetComponent<TextMeshPro>()).fontSize = 10f;
						val9.transform.parent = measureParent.transform;
						val9.transform.position = new Vector3(2.8007f, 0.5f, (float)j - 1.9802f);
						if (j < 0)
						{
							val9.transform.rotation = Quaternion.Euler(0f, 180f, 0f);
						}
					}
				}
			}
			flatLandParent2 = new GameObject();
			((Object)flatLandParent2).name = "FlatLandButtonParent";
			flatLandParent2.transform.position = new Vector3(-3.8f, 0f, -11.2473f);
			GameObject val10 = Object.Instantiate<GameObject>(((Component)RankRelaxControls.GetGameObject().transform.GetChild(17)).gameObject);
			((Object)val10).name = "FlatLand Plate";
			val10.transform.parent = flatLandParent2.transform;
			val10.transform.localPosition = new Vector3(9.09f, 1.1882f, 5.6149f);
			val10.transform.rotation = Quaternion.Euler(90f, 0f, 0f);
			val10.transform.localScale = new Vector3(0.29f, 0.3036f, 0.362f);
			Object.Destroy((Object)(object)val10.GetComponent<BoxCollider>());
			GameObject val11 = Object.Instantiate<GameObject>(((Component)RankRelaxControls.GetGameObject().transform.GetChild(15).GetChild(6)).gameObject);
			val11.transform.parent = val10.transform;
			((Object)val11).name = "Text";
			val11.transform.localPosition = new Vector3(0.04f, 0.74f, 0f);
			val11.transform.localRotation = Quaternion.Euler(0f, 270f, 90f);
			val11.transform.localScale = new Vector3(6.0414f, 3.7636f, 6.462f);
			TextMeshPro component = val11.GetComponent<TextMeshPro>();
			((TMP_Text)component).text = "To Gym";
			GameObject val12 = Create.NewButton();
			((Object)val12).name = "FlatLand Button";
			val12.transform.parent = flatLandParent2.transform;
			val12.transform.localPosition = new Vector3(9.0845f, 1f, 5.8345f);
			val12.transform.localRotation = Quaternion.Euler(0f, 180f, 90f);
			((Component)val12.transform.GetChild(0)).gameObject.GetComponent<InteractionButton>().onPressed.AddListener(UnityAction.op_Implicit((Action)delegate
			{
				ReLoadGym();
			}));
			GameObject val13 = Object.Instantiate<GameObject>(((Component)RankRelaxControls.GetGameObject().transform.GetChild(17)).gameObject);
			((Object)val13).name = "Kill Structures Plate";
			val13.transform.parent = flatLandParent2.transform;
			val13.transform.localPosition = new Vector3(9.09f, 1.7882f, 5.4749f);
			val13.transform.rotation = Quaternion.Euler(90f, 0f, 0f);
			val13.transform.localScale = new Vector3(0.29f, 0.5f, 0.362f);
			Object.Destroy((Object)(object)val13.GetComponent<BoxCollider>());
			GameObject val14 = Object.Instantiate<GameObject>(((Component)RankRelaxControls.GetGameObject().transform.GetChild(15).GetChild(6)).gameObject);
			val14.transform.parent = val13.transform;
			((Object)val14).name = "Text";
			val14.transform.localPosition = new Vector3(0.04f, 0.74f, 0f);
			val14.transform.localRotation = Quaternion.Euler(0f, 270f, 90f);
			val14.transform.localScale = new Vector3(3.525f, 3.8836f, 6.462f);
			TextMeshPro component2 = val14.GetComponent<TextMeshPro>();
			((TMP_Text)component2).text = "Reset Structures";
			GameObject val15 = Create.NewButton();
			((Object)val15).name = "Kill Structures Button";
			val15.transform.parent = flatLandParent2.transform;
			val15.transform.localPosition = new Vector3(9.0845f, 1.6f, 5.8345f);
			val15.transform.localRotation = Quaternion.Euler(0f, 180f, 90f);
			((Component)val15.transform.GetChild(0)).gameObject.GetComponent<InteractionButton>().onPressed.AddListener(UnityAction.op_Implicit((Action)delegate
			{
				Singleton<PoolManager>.instance.ResetPools((AssetType)3);
			}));
			GameObject val16 = Object.Instantiate<GameObject>(ShiftstoneQuickswapper.GetGameObject());
			val16.SetActive(true);
			Object.Destroy((Object)(object)((Component)val16.transform.GetChild(0).GetChild(0)).GetComponent<MeshCollider>());
			val16.transform.parent = flatLandParent2.transform;
			val16.transform.localPosition = new Vector3(8.4845f, 1f, 6.6345f);
			val16.transform.rotation = Quaternion.Euler(0f, 355.9185f, 0f);
			if (loadMatchmaker)
			{
				matchmaker.transform.position = new Vector3(2.5214f, -0.001f, -5.9377f);
				matchmaker.transform.rotation = Quaternion.Euler(0f, 179.2461f, 0f);
				GameObject gameObject = ((Component)matchmaker.transform.GetChild(9)).gameObject;
				gameObject.transform.localPosition = new Vector3(0.75f, 2.15f, -0.5f);
				regionBoard.transform.position = new Vector3(0.676f, 0.958f, -4.45f);
				regionBoard.transform.rotation = Quaternion.Euler(0f, 90f, 305f);
			}
		}
		catch
		{
		}
	}
}