Decompiled source of TeleportMenu Mono v2.1.0

Mods/TeleportMenu_Mono.dll

Decompiled 2 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using HarmonyLib;
using MelonLoader;
using MelonLoader.Utils;
using Newtonsoft.Json;
using ScheduleITeleportMenu;
using ScheduleOne.DevUtilities;
using ScheduleOne.Economy;
using ScheduleOne.Money;
using ScheduleOne.PlayerScripts;
using ScheduleOne.Quests;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: MelonInfo(typeof(Main), "Teleport Menu", "2.1.0", "MrTibbz", null)]
[assembly: MelonGame("TVGS", "Schedule I")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyCompany("TeleportMenu")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("TeleportMenu")]
[assembly: AssemblyTitle("TeleportMenu")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace ScheduleITeleportMenu;

public class Main : MelonMod
{
	[Serializable]
	public class TeleportLocation
	{
		public string Name;

		public SerializableVector3 Position;

		public bool IsFavorite;

		public string Category;
	}

	[Serializable]
	public class SerializableVector3
	{
		public float x;

		public float y;

		public float z;

		public SerializableVector3(Vector3 v)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: 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)
			x = v.x;
			y = v.y;
			z = v.z;
		}

		public Vector3 ToVector3()
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			return new Vector3(x, y, z);
		}
	}

	[Serializable]
	private class CombinedData
	{
		public List<TeleportLocation> SavedLocations = new List<TeleportLocation>();

		public List<TeleportLocation> FavoriteLocations = new List<TeleportLocation>();

		public SerializableVector3 SafetyTeleportPosition = new SerializableVector3(Vector3.zero);

		public ModSettings Settings = new ModSettings();
	}

	private enum MenuState
	{
		Main,
		SubMenu,
		Favorites,
		Settings
	}

	[HarmonyPatch(typeof(Customer), "ContractAccepted")]
	private class Patch_ContractAccepted
	{
		private static void Postfix(Customer __instance, Contract __result, EDealWindow window, bool trackContract, Dealer dealer)
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			if ((!trackContract && !IsDealerThePlayer(dealer)) || (Object)(object)__result == (Object)null || (Object)(object)__result.DeliveryLocation == (Object)null)
			{
				return;
			}
			Vector3 position = ((Component)__result.DeliveryLocation).transform.position;
			position.y += 1f;
			object obj = ((Quest)__result).Title;
			if (obj == null)
			{
				if (__instance == null)
				{
					obj = null;
				}
				else
				{
					DeliveryLocation defaultDeliveryLocation = __instance.DefaultDeliveryLocation;
					obj = ((defaultDeliveryLocation != null) ? ((Object)defaultDeliveryLocation).name : null);
				}
				if (obj == null)
				{
					obj = "Deal";
				}
			}
			string dealName = (string)obj;
			if (!Instance.allLocations.Any((TeleportLocation l) => l.Name == dealName && l.Category == "Active Deals"))
			{
				Instance.AddActiveDealTeleport(new TeleportLocation
				{
					Name = dealName,
					Position = new SerializableVector3(position),
					Category = "Active Deals"
				});
			}
		}
	}

	[HarmonyPatch(typeof(Customer), "ProcessHandover")]
	private class Patch_ProcessHandover
	{
		private static void Postfix(Contract contract)
		{
			if (!((Object)(object)contract == (Object)null))
			{
				string dealName = ((Quest)contract).Title;
				if (Instance.allLocations.Any((TeleportLocation l) => l.Name == (dealName ?? "") && l.Category == "Active Deals"))
				{
					Instance.RemoveActiveDealTeleport(dealName ?? "");
				}
			}
		}
	}

	public class ModSettings
	{
		public KeyCode menuKey = (KeyCode)283;

		public KeyCode safetyTeleportKey = (KeyCode)284;

		public int titleFontSize = 18;

		public int titleTextColorR = 255;

		public int titleTextColorG = 255;

		public int titleTextColorB = 255;

		public int textColorR = 255;

		public int textColorG = 255;

		public int textColorB = 255;

		public int fontSize = 14;

		public bool bold;

		public int buttonHoverR = 128;

		public int buttonHoverG = 161;

		public int buttonHoverB = 191;

		public int accentBarR = 110;

		public int accentBarG = 110;

		public int accentBarB = 110;

		public int accentBarA = 255;

		public int backgroundR = 77;

		public int backgroundG = 77;

		public int backgroundB = 77;

		public int backgroundA = 255;

		public bool chargeForTeleport;

		public int teleportCost = 30;
	}

	private string waitingForKey;

	private bool isMenuOpen;

	private Rect windowRect = new Rect(200f, 100f, 400f, 500f);

	private Vector2 scrollPosition;

	private bool isResizing;

	private Vector2 resizeStartMousePosition;

	private Vector2 resizeStartWindowSize;

	private bool isDragging;

	private Vector2 dragOffset;

	private float x = 15f;

	private MenuState currentMenu;

	private string currentCategory = "";

	private string newLocationName = "";

	private string combinedSavePath;

	public static Main Instance;

	private SerializableVector3 safetyTeleportPosition = new SerializableVector3(Vector3.zero);

	private List<TeleportLocation> savedLocations = new List<TeleportLocation>();

	private List<TeleportLocation> favoriteLocations = new List<TeleportLocation>();

	private List<TeleportLocation> allLocations = new List<TeleportLocation>();

	private ModSettings settings = new ModSettings();

	private void TeleportToLocation(TeleportLocation location)
	{
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)Player.Local != (Object)null)
		{
			((Component)Player.Local).transform.position = location.Position.ToVector3();
			MelonLogger.Msg($"Teleported to {location.Name} ({location.Position.x}, {location.Position.y}, {location.Position.z})");
		}
		if (!settings.chargeForTeleport)
		{
			return;
		}
		MoneyManager instance = NetworkSingleton<MoneyManager>.Instance;
		int teleportCost = settings.teleportCost;
		if ((Object)(object)instance != (Object)null)
		{
			if (instance.cashBalance >= (float)teleportCost)
			{
				instance.ChangeCashBalance((float)(-teleportCost), true, false);
				MelonLogger.Msg($"[Teleport Menu] Charged ${teleportCost} for teleport. Remaining: ${instance.cashBalance}");
			}
			else
			{
				MelonLogger.Msg($"[Teleport Menu] Not enough money! Requires ${teleportCost}.");
			}
		}
	}

	public override void OnInitializeMelon()
	{
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
		combinedSavePath = Path.Combine(MelonEnvironment.UserDataDirectory, "TeleportMenu/AllData.json");
		LoadAllData();
		InitializeAllLocations();
		Instance = this;
		new Harmony("TeleportMenuPatches").PatchAll();
		foreach (TeleportLocation saved in savedLocations)
		{
			if (!allLocations.Any((TeleportLocation l) => l.Name == saved.Name && l.Category == saved.Category))
			{
				allLocations.Add(saved);
			}
		}
		if (!allLocations.Any((TeleportLocation l) => l.Category == "Custom Teleports"))
		{
			allLocations.Add(new TeleportLocation
			{
				Name = "",
				Position = new SerializableVector3(Vector3.zero),
				Category = "Custom Teleports"
			});
		}
		foreach (TeleportLocation fav in favoriteLocations)
		{
			TeleportLocation teleportLocation = allLocations.FirstOrDefault((TeleportLocation l) => l.Name == fav.Name && l.Category == fav.Category);
			if (teleportLocation != null)
			{
				teleportLocation.IsFavorite = true;
			}
		}
		MelonLogger.Msg("Initialization complete.");
	}

	public override void OnUpdate()
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0109: Unknown result type (might be due to invalid IL or missing references)
		//IL_0178: Unknown result type (might be due to invalid IL or missing references)
		//IL_0141: Unknown result type (might be due to invalid IL or missing references)
		//IL_0146: Unknown result type (might be due to invalid IL or missing references)
		//IL_014c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0151: Unknown result type (might be due to invalid IL or missing references)
		if (Input.GetKeyDown(settings.menuKey))
		{
			isMenuOpen = !isMenuOpen;
			if (isMenuOpen)
			{
				Cursor.visible = true;
				Cursor.lockState = (CursorLockMode)0;
				if ((Object)(object)PlayerSingleton<PlayerMovement>.Instance != (Object)null)
				{
					((Behaviour)PlayerSingleton<PlayerMovement>.Instance).enabled = false;
				}
				if ((Object)(object)PlayerSingleton<PlayerCamera>.Instance != (Object)null)
				{
					((Behaviour)PlayerSingleton<PlayerCamera>.Instance).enabled = false;
				}
			}
			else
			{
				Cursor.visible = false;
				Cursor.lockState = (CursorLockMode)1;
				if ((Object)(object)PlayerSingleton<PlayerMovement>.Instance != (Object)null)
				{
					((Behaviour)PlayerSingleton<PlayerMovement>.Instance).enabled = true;
				}
				if ((Object)(object)PlayerSingleton<PlayerCamera>.Instance != (Object)null)
				{
					((Behaviour)PlayerSingleton<PlayerCamera>.Instance).enabled = true;
				}
			}
		}
		if (isResizing && Input.GetMouseButton(0))
		{
			Vector2 val = Vector2.op_Implicit(Input.mousePosition) - resizeStartMousePosition;
			((Rect)(ref windowRect)).width = Mathf.Max(200f, resizeStartWindowSize.x + val.x);
			((Rect)(ref windowRect)).height = Mathf.Max(200f, resizeStartWindowSize.y - val.y);
		}
		else if (Input.GetMouseButtonUp(0))
		{
			isResizing = false;
		}
		if (isDragging && Input.GetMouseButton(0))
		{
			((Rect)(ref windowRect)).position = Vector2.op_Implicit(Input.mousePosition) - dragOffset;
		}
		else if (Input.GetMouseButtonUp(0))
		{
			isDragging = false;
		}
		HandleTyping();
		if (Input.GetKeyDown(settings.safetyTeleportKey))
		{
			TeleportToLocation(new TeleportLocation
			{
				Name = "Safety Teleport",
				Position = safetyTeleportPosition,
				Category = "Custom Teleports"
			});
		}
	}

	public override void OnGUI()
	{
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		//IL_0069: Unknown result type (might be due to invalid IL or missing references)
		//IL_006f: Invalid comparison between Unknown and I4
		//IL_0079: Unknown result type (might be due to invalid IL or missing references)
		//IL_007e: Unknown result type (might be due to invalid IL or missing references)
		//IL_007f: Unknown result type (might be due to invalid IL or missing references)
		//IL_003c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0041: Unknown result type (might be due to invalid IL or missing references)
		//IL_017e: Unknown result type (might be due to invalid IL or missing references)
		//IL_018b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0197: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a6: Expected O, but got Unknown
		//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ea: 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_009b: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_01fe: 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_020e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0213: Unknown result type (might be due to invalid IL or missing references)
		//IL_0218: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00da: Unknown result type (might be due to invalid IL or missing references)
		if ((int)Event.current.type == 0 && Event.current.button == 1)
		{
			if (currentMenu == MenuState.Favorites || currentMenu == MenuState.Settings || currentMenu == MenuState.SubMenu)
			{
				currentMenu = MenuState.Main;
				scrollPosition = Vector2.zero;
				Event.current.Use();
			}
			else
			{
				_ = currentMenu;
			}
		}
		if (waitingForKey != null && (int)Event.current.type == 4)
		{
			KeyCode keyCode = Event.current.keyCode;
			if ((int)keyCode != 0)
			{
				if (waitingForKey == "menuKey")
				{
					settings.menuKey = keyCode;
					MelonLogger.Msg($"[Teleport Menu] Menu key set to {keyCode}");
				}
				else if (waitingForKey == "safetyTeleportKey")
				{
					settings.safetyTeleportKey = keyCode;
					MelonLogger.Msg($"[Teleport Menu] Safety teleport key set to {keyCode}");
				}
				waitingForKey = null;
				SaveAllData();
				Event.current.Use();
			}
		}
		if (isMenuOpen && (Event.current.isKey || Event.current.isMouse))
		{
			Event.current.Use();
		}
		if (!isMenuOpen)
		{
			return;
		}
		GUI.backgroundColor = new Color((float)settings.backgroundR / 255f, (float)settings.backgroundG / 255f, (float)settings.backgroundB / 255f, (float)settings.backgroundA / 255f);
		windowRect = GUI.Window(0, windowRect, new WindowFunction(DrawWindow), "");
		if ((int)Event.current.type == 0)
		{
			Rect val = new Rect(((Rect)(ref windowRect)).x, ((Rect)(ref windowRect)).y, ((Rect)(ref windowRect)).width, 20f);
			if (((Rect)(ref val)).Contains(Event.current.mousePosition))
			{
				isDragging = true;
				dragOffset = Vector2.op_Implicit(Input.mousePosition) - ((Rect)(ref windowRect)).position;
				Event.current.Use();
			}
		}
	}

	private void HandleTyping()
	{
		//IL_0026: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		//IL_0036: Invalid comparison between Unknown and I4
		//IL_0067: Unknown result type (might be due to invalid IL or missing references)
		//IL_006a: Invalid comparison between Unknown and I4
		//IL_006c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0072: Invalid comparison between Unknown and I4
		//IL_0075: Unknown result type (might be due to invalid IL or missing references)
		if (!isMenuOpen)
		{
			return;
		}
		foreach (KeyCode value in Enum.GetValues(typeof(KeyCode)))
		{
			if (!Input.GetKeyDown(value))
			{
				continue;
			}
			if ((int)value == 8)
			{
				if (newLocationName.Length > 0)
				{
					newLocationName = newLocationName.Substring(0, newLocationName.Length - 1);
				}
			}
			else if ((int)value != 13 && (int)value != 271)
			{
				string text = KeyCodeToString(value);
				if (!string.IsNullOrEmpty(text))
				{
					newLocationName += text;
				}
			}
		}
	}

	private string KeyCodeToString(KeyCode key)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0003: Invalid comparison between Unknown and I4
		//IL_003e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0041: Invalid comparison between Unknown and I4
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Invalid comparison between Unknown and I4
		//IL_0055: Unknown result type (might be due to invalid IL or missing references)
		//IL_0058: Invalid comparison between Unknown and I4
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_0046: Invalid comparison between Unknown and I4
		//IL_0060: Unknown result type (might be due to invalid IL or missing references)
		//IL_0063: Invalid comparison between Unknown and I4
		//IL_0048: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_004d: Expected I4, but got Unknown
		//IL_006b: Unknown result type (might be due to invalid IL or missing references)
		//IL_006e: Invalid comparison between Unknown and I4
		if ((int)key >= 97 && (int)key <= 122)
		{
			string text = ((object)(KeyCode)(ref key)).ToString();
			if (Input.GetKey((KeyCode)304) || Input.GetKey((KeyCode)303))
			{
				return text.ToUpper();
			}
			return text.ToLower();
		}
		if ((int)key >= 48 && (int)key <= 57)
		{
			return (key - 48).ToString();
		}
		if ((int)key == 32)
		{
			return " ";
		}
		if ((int)key == 45)
		{
			return "-";
		}
		if ((int)key == 46)
		{
			return ".";
		}
		return null;
	}

	private GUIStyle GetLabelStyle()
	{
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		//IL_0037: Unknown result type (might be due to invalid IL or missing references)
		//IL_0073: Unknown result type (might be due to invalid IL or missing references)
		//IL_007e: Expected O, but got Unknown
		GUIStyle val = new GUIStyle(GUI.skin.label)
		{
			fontSize = settings.fontSize,
			fontStyle = (FontStyle)(settings.bold ? 1 : 0)
		};
		val.normal.textColor = new Color((float)settings.textColorR / 255f, (float)settings.textColorG / 255f, (float)settings.textColorB / 255f);
		return val;
	}

	private GUIStyle GetButtonStyle()
	{
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		//IL_0037: Unknown result type (might be due to invalid IL or missing references)
		//IL_0073: Unknown result type (might be due to invalid IL or missing references)
		//IL_007d: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c4: Expected O, but got Unknown
		GUIStyle val = new GUIStyle(GUI.skin.button)
		{
			fontSize = settings.fontSize,
			fontStyle = (FontStyle)(settings.bold ? 1 : 0)
		};
		val.normal.textColor = new Color((float)settings.textColorR / 255f, (float)settings.textColorG / 255f, (float)settings.textColorB / 255f);
		val.hover.textColor = new Color((float)settings.buttonHoverR / 255f, (float)settings.buttonHoverG / 255f, (float)settings.buttonHoverB / 255f);
		return val;
	}

	private GUIStyle GetCenteredLabelStyle()
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0013: Expected O, but got Unknown
		return new GUIStyle(GetLabelStyle())
		{
			alignment = (TextAnchor)4
		};
	}

	private void DrawWindow(int windowID)
	{
		//IL_0048: Unknown result type (might be due to invalid IL or missing references)
		//IL_006c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0076: Unknown result type (might be due to invalid IL or missing references)
		//IL_007b: Unknown result type (might be due to invalid IL or missing references)
		//IL_008c: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ef: Expected O, but got Unknown
		//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fb: Expected O, but got Unknown
		//IL_0128: Unknown result type (might be due to invalid IL or missing references)
		//IL_012e: Unknown result type (might be due to invalid IL or missing references)
		//IL_014f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0154: Unknown result type (might be due to invalid IL or missing references)
		//IL_0159: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
		GUI.backgroundColor = new Color((float)settings.accentBarR / 255f, (float)settings.accentBarG / 255f, (float)settings.accentBarB / 255f, (float)settings.accentBarA / 255f);
		GUI.Box(new Rect(0f, 0f, ((Rect)(ref windowRect)).width, 20f), "Teleport Menu", new GUIStyle
		{
			fontSize = settings.titleFontSize,
			fontStyle = (FontStyle)(settings.bold ? 1 : 0),
			normal = new GUIStyleState
			{
				textColor = new Color((float)settings.titleTextColorR / 255f, (float)settings.titleTextColorG / 255f, (float)settings.titleTextColorB / 255f)
			},
			alignment = (TextAnchor)4
		});
		float num = 1300f;
		scrollPosition = GUI.BeginScrollView(new Rect(0f, 20f, ((Rect)(ref windowRect)).width, ((Rect)(ref windowRect)).height - 20f), scrollPosition, new Rect(0f, 0f, ((Rect)(ref windowRect)).width - 20f, num));
		GUIStyle buttonStyle = GetButtonStyle();
		GUIStyle labelStyle = GetLabelStyle();
		switch (currentMenu)
		{
		case MenuState.Main:
			DrawMainMenu(buttonStyle);
			break;
		case MenuState.SubMenu:
			DrawLocationSubMenu(buttonStyle);
			break;
		case MenuState.Favorites:
			DrawFavoritesMenu(buttonStyle);
			break;
		case MenuState.Settings:
			DrawSettingsMenu(buttonStyle, labelStyle);
			break;
		}
		GUI.EndScrollView();
		GUI.DragWindow(new Rect(0f, 0f, ((Rect)(ref windowRect)).width - 20f, 20f));
	}

	private void DrawMainMenu(GUIStyle buttonStyle)
	{
		//IL_0023: 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_00ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
		//IL_012e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0182: Unknown result type (might be due to invalid IL or missing references)
		//IL_0153: Unknown result type (might be due to invalid IL or missing references)
		//IL_0158: Unknown result type (might be due to invalid IL or missing references)
		//IL_019c: 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)
		float num = 20f;
		if (GUI.Button(new Rect(x, num, ((Rect)(ref windowRect)).width - 40f, 40f), "Favorites", buttonStyle))
		{
			currentMenu = MenuState.Favorites;
			scrollPosition = Vector2.zero;
		}
		num += 45f;
		foreach (string item in from c in allLocations.Select((TeleportLocation l) => l.Category).Distinct()
			where c != "Custom Teleports"
			select c)
		{
			if (GUI.Button(new Rect(x, num, ((Rect)(ref windowRect)).width - 40f, 40f), item, buttonStyle))
			{
				currentCategory = item;
				currentMenu = MenuState.SubMenu;
				scrollPosition = Vector2.zero;
			}
			num += 45f;
		}
		if (GUI.Button(new Rect(x, num, ((Rect)(ref windowRect)).width - 40f, 40f), "Custom Teleports", buttonStyle))
		{
			currentCategory = "Custom Teleports";
			currentMenu = MenuState.SubMenu;
			scrollPosition = Vector2.zero;
		}
		num += 45f;
		if (GUI.Button(new Rect(x, num, ((Rect)(ref windowRect)).width - 40f, 40f), "Settings", buttonStyle))
		{
			currentMenu = MenuState.Settings;
			scrollPosition = Vector2.zero;
		}
	}

	private void DrawFavoritesMenu(GUIStyle buttonStyle)
	{
		//IL_00da: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_019a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0119: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
		float num = 20f;
		float num2 = ((Rect)(ref windowRect)).width - 87f;
		List<string> categoryOrder = GetMenuCategoryOrder();
		List<TeleportLocation> list = favoriteLocations.OrderBy((TeleportLocation f) => categoryOrder.IndexOf(f.Category)).ToList();
		string text = "";
		foreach (TeleportLocation loc in list)
		{
			if (loc.Category != text)
			{
				text = loc.Category;
				GUI.Label(new Rect(x, num, ((Rect)(ref windowRect)).width - 40f, 25f), text ?? "", GetCenteredLabelStyle());
				num += 30f;
			}
			if (GUI.Button(new Rect(x, num, num2, 40f), loc.Name, buttonStyle))
			{
				TeleportToLocation(loc);
			}
			if (GUI.Button(new Rect(x + num2 + 5f, num, 40f, 40f), "X", buttonStyle))
			{
				loc.IsFavorite = false;
				favoriteLocations.RemoveAll((TeleportLocation f) => f.Name == loc.Name && f.Category == loc.Category);
				SaveAllData();
				break;
			}
			num += 45f;
		}
		if (GUI.Button(new Rect(x, num, ((Rect)(ref windowRect)).width - 40f, 40f), "Back", buttonStyle))
		{
			currentMenu = MenuState.Main;
			scrollPosition = Vector2.zero;
		}
	}

	private void DrawLocationSubMenu(GUIStyle buttonStyle)
	{
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
		//IL_0422: Unknown result type (might be due to invalid IL or missing references)
		//IL_043c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0441: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0233: Unknown result type (might be due to invalid IL or missing references)
		//IL_0238: 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_0266: Unknown result type (might be due to invalid IL or missing references)
		//IL_025f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0270: Unknown result type (might be due to invalid IL or missing references)
		//IL_029a: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ad: Expected O, but got Unknown
		//IL_02c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_037c: Unknown result type (might be due to invalid IL or missing references)
		float num = 20f;
		float num2 = 40f;
		float num3 = 40f;
		List<TeleportLocation> list = allLocations.Where((TeleportLocation l) => l.Category == currentCategory && (!string.IsNullOrEmpty(l.Name) || currentCategory != "Custom Teleports")).ToList();
		if (currentCategory == "Custom Teleports")
		{
			GUI.Label(new Rect(20f, num, ((Rect)(ref windowRect)).width - 40f, 30f), "Enter Name: " + newLocationName, GetLabelStyle());
			num += 35f;
			if (GUI.Button(new Rect(x, num, ((Rect)(ref windowRect)).width - 40f, 40f), "Save Current Location", buttonStyle))
			{
				SaveCurrentLocation();
			}
			num += 45f;
			if (GUI.Button(new Rect(x, num, ((Rect)(ref windowRect)).width - 40f, 40f), "Set Safety Teleport", buttonStyle))
			{
				safetyTeleportPosition = new SerializableVector3(((Component)Player.Local).transform.position);
				SaveAllData();
				MelonLogger.Msg($"Safety Teleport location saved at ({safetyTeleportPosition.x}, {safetyTeleportPosition.y}, {safetyTeleportPosition.z})");
			}
			num += 45f;
		}
		foreach (TeleportLocation loc in list)
		{
			float num4 = ((Rect)(ref windowRect)).width - 87f;
			if (currentCategory == "Custom Teleports")
			{
				num4 = ((Rect)(ref windowRect)).width - 131f;
			}
			string text = loc.Name ?? "";
			if (string.IsNullOrEmpty(loc.Name))
			{
				text = "Unnamed Location";
			}
			if (GUI.Button(new Rect(x, num, num4, 40f), text, buttonStyle))
			{
				TeleportToLocation(loc);
			}
			string text2 = (loc.IsFavorite ? "★" : "☆");
			GUIStyle val = new GUIStyle(GUI.skin.button)
			{
				fontSize = settings.fontSize + 2
			};
			val.normal.textColor = (loc.IsFavorite ? Color.yellow : Color.white);
			val.hover.textColor = new Color((float)settings.buttonHoverR, (float)settings.buttonHoverG, (float)settings.buttonHoverB);
			val.alignment = (TextAnchor)4;
			GUIStyle val2 = val;
			if (GUI.Button(new Rect(x + num4 + 5f, num, num2, 40f), text2, val2))
			{
				loc.IsFavorite = !loc.IsFavorite;
				if (loc.IsFavorite)
				{
					if (!favoriteLocations.Any((TeleportLocation f) => f.Name == loc.Name && f.Category == loc.Category))
					{
						favoriteLocations.Add(loc);
					}
				}
				else
				{
					favoriteLocations.RemoveAll((TeleportLocation f) => f.Name == loc.Name && f.Category == loc.Category);
				}
				SaveAllData();
			}
			if (currentCategory == "Custom Teleports" && GUI.Button(new Rect(x + num4 + 5f + num2 + 5f, num, num3, 40f), "X", buttonStyle))
			{
				savedLocations.RemoveAll((TeleportLocation l) => l.Name == loc.Name && l.Category == loc.Category);
				allLocations.RemoveAll((TeleportLocation l) => l.Name == loc.Name && l.Category == loc.Category);
				favoriteLocations.RemoveAll((TeleportLocation f) => f.Name == loc.Name && f.Category == loc.Category);
				SaveAllData();
				break;
			}
			num += 45f;
		}
		if (GUI.Button(new Rect(x, num, ((Rect)(ref windowRect)).width - 40f, 40f), "Back", buttonStyle))
		{
			currentMenu = MenuState.Main;
			scrollPosition = Vector2.zero;
		}
	}

	private void InitializeAllLocations()
	{
		//IL_0031: Unknown result type (might be due to invalid IL or missing references)
		//IL_0076: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0100: Unknown result type (might be due to invalid IL or missing references)
		//IL_0145: Unknown result type (might be due to invalid IL or missing references)
		//IL_018a: Unknown result type (might be due to invalid IL or missing references)
		//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
		//IL_0214: Unknown result type (might be due to invalid IL or missing references)
		//IL_0259: Unknown result type (might be due to invalid IL or missing references)
		//IL_029e: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_0328: Unknown result type (might be due to invalid IL or missing references)
		//IL_036d: Unknown result type (might be due to invalid IL or missing references)
		//IL_03b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_03f7: Unknown result type (might be due to invalid IL or missing references)
		//IL_043c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0481: Unknown result type (might be due to invalid IL or missing references)
		//IL_04c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_050b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0550: Unknown result type (might be due to invalid IL or missing references)
		//IL_0595: Unknown result type (might be due to invalid IL or missing references)
		//IL_05da: Unknown result type (might be due to invalid IL or missing references)
		//IL_061f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0664: Unknown result type (might be due to invalid IL or missing references)
		//IL_06a9: Unknown result type (might be due to invalid IL or missing references)
		//IL_06ee: Unknown result type (might be due to invalid IL or missing references)
		//IL_0733: Unknown result type (might be due to invalid IL or missing references)
		//IL_0778: Unknown result type (might be due to invalid IL or missing references)
		//IL_07bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0802: Unknown result type (might be due to invalid IL or missing references)
		//IL_0847: Unknown result type (might be due to invalid IL or missing references)
		//IL_088c: Unknown result type (might be due to invalid IL or missing references)
		//IL_08d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0916: Unknown result type (might be due to invalid IL or missing references)
		//IL_095b: Unknown result type (might be due to invalid IL or missing references)
		//IL_09a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_09e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a2a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a6f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ab4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0af9: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b3e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b83: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bc8: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c0d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c52: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c97: Unknown result type (might be due to invalid IL or missing references)
		//IL_0cdc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d21: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d66: Unknown result type (might be due to invalid IL or missing references)
		//IL_0dab: Unknown result type (might be due to invalid IL or missing references)
		//IL_0df0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e35: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e7a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ebf: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f04: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f49: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f8e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fd3: Unknown result type (might be due to invalid IL or missing references)
		//IL_1018: Unknown result type (might be due to invalid IL or missing references)
		//IL_105d: Unknown result type (might be due to invalid IL or missing references)
		//IL_10a2: Unknown result type (might be due to invalid IL or missing references)
		allLocations = new List<TeleportLocation>();
		allLocations.Add(new TeleportLocation
		{
			Name = "RV",
			Position = new SerializableVector3(new Vector3(14f, 0.9f, -77f)),
			Category = "Properties"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Motel",
			Position = new SerializableVector3(new Vector3(-66f, 1.6f, 83f)),
			Category = "Properties"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Sweatshop",
			Position = new SerializableVector3(new Vector3(-64f, 0.4f, 142f)),
			Category = "Properties"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Storage Unit",
			Position = new SerializableVector3(new Vector3(-5.1f, 1f, 103f)),
			Category = "Properties"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Bungalow",
			Position = new SerializableVector3(new Vector3(-168f, -2.7f, 114f)),
			Category = "Properties"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Barn",
			Position = new SerializableVector3(new Vector3(181f, 1f, -14f)),
			Category = "Properties"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Docks Warehouse",
			Position = new SerializableVector3(new Vector3(-81f, -1.5f, -59f)),
			Category = "Properties"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Manor (Inside Gate)",
			Position = new SerializableVector3(new Vector3(163f, 11f, -71f)),
			Category = "Properties"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Manor (Outside Gate)",
			Position = new SerializableVector3(new Vector3(166f, 11f, -79f)),
			Category = "Properties"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Laundromat",
			Position = new SerializableVector3(new Vector3(-22.5f, 1f, 25f)),
			Category = "Businesses"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Post Office",
			Position = new SerializableVector3(new Vector3(47f, 1f, 5f)),
			Category = "Businesses"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Car Wash",
			Position = new SerializableVector3(new Vector3(-8.5f, 1f, -19f)),
			Category = "Businesses"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Taco Ticklers",
			Position = new SerializableVector3(new Vector3(-30f, 1f, 62f)),
			Category = "Businesses"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Dan's Hardware",
			Position = new SerializableVector3(new Vector3(-21f, -3f, 137f)),
			Category = "Stores"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Handy Hank's",
			Position = new SerializableVector3(new Vector3(104f, 1f, 25f)),
			Category = "Stores"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Gas-Mart",
			Position = new SerializableVector3(new Vector3(-113f, -2.9f, 68f)),
			Category = "Stores"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Gas-Mart/Auto Shop",
			Position = new SerializableVector3(new Vector3(16f, 1f, -16.5f)),
			Category = "Stores"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Pawnshop",
			Position = new SerializableVector3(new Vector3(-61.3f, 1f, 53f)),
			Category = "Stores"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Shred Shack",
			Position = new SerializableVector3(new Vector3(-39f, -2.9f, 121f)),
			Category = "Stores"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Ray's Real Estate",
			Position = new SerializableVector3(new Vector3(81.5f, 1f, -7f)),
			Category = "Stores"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Blueball's Boutique",
			Position = new SerializableVector3(new Vector3(71f, 1f, -8f)),
			Category = "Stores"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Thrifty Threads",
			Position = new SerializableVector3(new Vector3(-22.5f, 1f, 12f)),
			Category = "Stores"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Top Tattoo",
			Position = new SerializableVector3(new Vector3(-130f, -2.9f, 67.4f)),
			Category = "Stores"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Benji Coleman",
			Position = new SerializableVector3(new Vector3(-67f, 1.6f, 88f)),
			Category = "Dealers"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Molly Presley",
			Position = new SerializableVector3(new Vector3(-166f, -2.8f, 93f)),
			Category = "Dealers"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Brad Crosby",
			Position = new SerializableVector3(new Vector3(2.6f, 1f, 83f)),
			Category = "Dealers"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Jane Lucero",
			Position = new SerializableVector3(new Vector3(-27.4f, 0.9f, -82f)),
			Category = "Dealers"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Wei Long",
			Position = new SerializableVector3(new Vector3(65f, 5f, -67f)),
			Category = "Dealers"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Leo Rivers",
			Position = new SerializableVector3(new Vector3(149f, 1.7f, 65f)),
			Category = "Dealers"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Warehouse (Outside)",
			Position = new SerializableVector3(new Vector3(-42f, -1.5f, 43f)),
			Category = "World"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Warehouse (Inside)",
			Position = new SerializableVector3(new Vector3(-42f, -1f, 38f)),
			Category = "World"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Casino",
			Position = new SerializableVector3(new Vector3(22.8f, 2f, 89f)),
			Category = "World"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Construction site",
			Position = new SerializableVector3(new Vector3(-130f, -3f, 97f)),
			Category = "World"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Water Front",
			Position = new SerializableVector3(new Vector3(51.5f, 1f, 95f)),
			Category = "World"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Westville",
			Position = new SerializableVector3(new Vector3(-137.2f, -3f, 44f)),
			Category = "World"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "North Arcade Wall",
			Position = new SerializableVector3(new Vector3(-48f, -3f, 148f)),
			Category = "Dead Drops"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Behind Thompson Construction",
			Position = new SerializableVector3(new Vector3(-36f, 1f, 113f)),
			Category = "Dead Drops"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Taco Ticklers Exterior Wall",
			Position = new SerializableVector3(new Vector3(-24f, 1f, 82f)),
			Category = "Dead Drops"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Skate Park",
			Position = new SerializableVector3(new Vector3(-41f, 1f, 87f)),
			Category = "Dead Drops"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Behind Motel Office",
			Position = new SerializableVector3(new Vector3(-66f, 1f, 77f)),
			Category = "Dead Drops"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Under West Bridge",
			Position = new SerializableVector3(new Vector3(-89f, -3f, 67f)),
			Category = "Dead Drops"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Behind Gas-Mart",
			Position = new SerializableVector3(new Vector3(-113f, -3f, 55f)),
			Category = "Dead Drops"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Alleyway Behind Top Tattoo",
			Position = new SerializableVector3(new Vector3(-139f, -3f, 73f)),
			Category = "Dead Drops"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Brown Apartment Block",
			Position = new SerializableVector3(new Vector3(-171f, -3f, 93f)),
			Category = "Dead Drops"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Pawn Shop West Wall",
			Position = new SerializableVector3(new Vector3(-67f, 1f, 52f)),
			Category = "Dead Drops"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Alleyway Behind The Laundromat",
			Position = new SerializableVector3(new Vector3(-34f, -2f, 25f)),
			Category = "Dead Drops"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Alleyway Behind Slop Shop",
			Position = new SerializableVector3(new Vector3(-3f, 1f, 32f)),
			Category = "Dead Drops"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Alleyway Behind Grocery Store",
			Position = new SerializableVector3(new Vector3(6f, 1f, 72f)),
			Category = "Dead Drops"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Behind The Supermarket",
			Position = new SerializableVector3(new Vector3(25f, 1f, 69f)),
			Category = "Dead Drops"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Behind Crimson Canary",
			Position = new SerializableVector3(new Vector3(46f, 1f, 66f)),
			Category = "Dead Drops"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Behind Medical Practice",
			Position = new SerializableVector3(new Vector3(98f, 1f, 72f)),
			Category = "Dead Drops"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Behind Fire Station",
			Position = new SerializableVector3(new Vector3(114f, 1f, 38f)),
			Category = "Dead Drops"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Behind Bank",
			Position = new SerializableVector3(new Vector3(76f, 1f, 36f)),
			Category = "Dead Drops"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Fountain",
			Position = new SerializableVector3(new Vector3(48f, 1f, 32f)),
			Category = "Dead Drops"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Central Canal",
			Position = new SerializableVector3(new Vector3(26f, -1f, 13f)),
			Category = "Dead Drops"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Behind Auto Shops",
			Position = new SerializableVector3(new Vector3(2f, 1f, -4f)),
			Category = "Dead Drops"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Grey Docks Building",
			Position = new SerializableVector3(new Vector3(-47f, -1.5f, -72f)),
			Category = "Dead Drops"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Behind Randys Bait Tackle",
			Position = new SerializableVector3(new Vector3(-98f, -2f, -37f)),
			Category = "Dead Drops"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Gazebo",
			Position = new SerializableVector3(new Vector3(93f, 5f, -129f)),
			Category = "Dead Drops"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Albert Hoover's Stash",
			Position = new SerializableVector3(new Vector3(-18f, -3f, 147f)),
			Category = "Supplier Stashes"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Shirley Watt's Stash",
			Position = new SerializableVector3(new Vector3(-66f, -1.5f, 32f)),
			Category = "Supplier Stashes"
		});
		allLocations.Add(new TeleportLocation
		{
			Name = "Salvador Moreno's Stash",
			Position = new SerializableVector3(new Vector3(148f, 1f, 35f)),
			Category = "Supplier Stashes"
		});
		foreach (TeleportLocation savedLocation in savedLocations)
		{
			savedLocation.Category = "Custom Teleports";
			allLocations.Add(savedLocation);
		}
	}

	public void AddActiveDealTeleport(TeleportLocation loc)
	{
		allLocations.RemoveAll((TeleportLocation l) => l.Name == loc.Name && l.Category == "Active Deals");
		allLocations.Add(loc);
		MelonLogger.Msg("[Teleport Menu] Added Active Deal teleport: " + loc.Name);
	}

	public void RemoveActiveDealTeleport(string dealName)
	{
		allLocations.RemoveAll((TeleportLocation l) => l.Name == dealName && l.Category == "Active Deals");
		MelonLogger.Msg("[Teleport Menu] Removed Active Deal teleport: " + dealName);
	}

	private static bool IsDealerThePlayer(object dealer)
	{
		if (dealer == null)
		{
			return true;
		}
		Type type = dealer.GetType();
		string[] array = new string[4] { "IsLocalPlayer", "isLocalPlayer", "IsPlayer", "isPlayer" };
		foreach (string name in array)
		{
			PropertyInfo property = type.GetProperty(name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
			if (property != null && property.PropertyType == typeof(bool))
			{
				return (bool)property.GetValue(dealer);
			}
			FieldInfo field = type.GetField(name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
			if (field != null && field.FieldType == typeof(bool))
			{
				return (bool)field.GetValue(dealer);
			}
		}
		PropertyInfo propertyInfo = type.GetProperty("Owner") ?? type.GetProperty("Player") ?? type.GetProperty("owner");
		if (propertyInfo != null)
		{
			object value = propertyInfo.GetValue(dealer);
			if (value != null && (Object)(object)Player.Local != (Object)null)
			{
				return value == Player.Local;
			}
		}
		return false;
	}

	private void SaveCurrentLocation()
	{
		//IL_003c: Unknown result type (might be due to invalid IL or missing references)
		if (string.IsNullOrWhiteSpace(newLocationName))
		{
			newLocationName = GenerateLocationName();
		}
		TeleportLocation newLoc = new TeleportLocation
		{
			Name = newLocationName,
			Position = new SerializableVector3(((Component)Player.Local).transform.position),
			Category = "Custom Teleports"
		};
		savedLocations.Add(newLoc);
		SaveAllData();
		if (!allLocations.Any((TeleportLocation l) => l.Name == newLoc.Name && l.Category == newLoc.Category))
		{
			allLocations.Add(newLoc);
		}
		MelonLogger.Msg("Saved location: " + newLocationName);
		newLocationName = "";
		currentCategory = "Custom Teleports";
		currentMenu = MenuState.SubMenu;
	}

	private string GenerateLocationName()
	{
		int num = 1;
		string text = "Location_";
		string name = text + num;
		while (savedLocations.Any((TeleportLocation l) => l.Name == name))
		{
			num++;
			name = text + num;
		}
		return name;
	}

	private List<string> GetMenuCategoryOrder()
	{
		List<string> list = allLocations.Select((TeleportLocation l) => l.Category).Distinct().ToList();
		if (!list.Contains("Custom Teleports"))
		{
			list.Add("Custom Teleports");
		}
		return list;
	}

	private void DrawSettingsMenu(GUIStyle buttonStyle, GUIStyle labelStyle)
	{
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		//IL_0026: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0099: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_0129: Unknown result type (might be due to invalid IL or missing references)
		//IL_0190: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_0207: Unknown result type (might be due to invalid IL or missing references)
		//IL_0251: Unknown result type (might be due to invalid IL or missing references)
		//IL_028e: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d8: Unknown result type (might be due to invalid IL or missing references)
		//IL_0315: Unknown result type (might be due to invalid IL or missing references)
		//IL_0358: Unknown result type (might be due to invalid IL or missing references)
		//IL_0394: Unknown result type (might be due to invalid IL or missing references)
		//IL_03de: Unknown result type (might be due to invalid IL or missing references)
		//IL_0418: Unknown result type (might be due to invalid IL or missing references)
		//IL_0455: Unknown result type (might be due to invalid IL or missing references)
		//IL_049f: Unknown result type (might be due to invalid IL or missing references)
		//IL_04dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0526: Unknown result type (might be due to invalid IL or missing references)
		//IL_0563: Unknown result type (might be due to invalid IL or missing references)
		//IL_05a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_05e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0625: Unknown result type (might be due to invalid IL or missing references)
		//IL_065a: Unknown result type (might be due to invalid IL or missing references)
		//IL_068f: Unknown result type (might be due to invalid IL or missing references)
		//IL_06c9: Unknown result type (might be due to invalid IL or missing references)
		//IL_0706: Unknown result type (might be due to invalid IL or missing references)
		//IL_0750: Unknown result type (might be due to invalid IL or missing references)
		//IL_078d: Unknown result type (might be due to invalid IL or missing references)
		//IL_07d7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0814: Unknown result type (might be due to invalid IL or missing references)
		//IL_085e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0898: Unknown result type (might be due to invalid IL or missing references)
		//IL_08d5: Unknown result type (might be due to invalid IL or missing references)
		//IL_091f: Unknown result type (might be due to invalid IL or missing references)
		//IL_095c: Unknown result type (might be due to invalid IL or missing references)
		//IL_09a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_09e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a2d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a6a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ab4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0aee: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b2b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b75: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bb2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bfc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c39: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c83: Unknown result type (might be due to invalid IL or missing references)
		//IL_0cc0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d0a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d3d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d72: Unknown result type (might be due to invalid IL or missing references)
		//IL_0da0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ddb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e26: Unknown result type (might be due to invalid IL or missing references)
		//IL_0146: Unknown result type (might be due to invalid IL or missing references)
		//IL_0156: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e63: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ea0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0edd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f2b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f79: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f93: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f98: Unknown result type (might be due to invalid IL or missing references)
		float num = 20f;
		GUI.Label(new Rect(20f, num, 400f, 25f), $"Menu Toggle Key: {settings.menuKey}", labelStyle);
		if (GUI.Button(new Rect(275f, num, 100f, 25f), (waitingForKey == "menuKey") ? "Press Key..." : "Change", buttonStyle))
		{
			waitingForKey = "menuKey";
		}
		num += 35f;
		GUI.Label(new Rect(20f, num, 400f, 25f), $"Safety Teleport Key: {settings.safetyTeleportKey}", labelStyle);
		if (GUI.Button(new Rect(275f, num, 100f, 25f), (waitingForKey == "safetyTeleportKey") ? "Press Key..." : "Change", buttonStyle))
		{
			waitingForKey = "safetyTeleportKey";
		}
		num += 35f;
		if (GUI.Button(new Rect(x, num, ((Rect)(ref windowRect)).width - 40f, 35f), "Reset Keys", buttonStyle))
		{
			settings.menuKey = (KeyCode)283;
			settings.safetyTeleportKey = (KeyCode)284;
			SaveAllData();
			MelonLogger.Msg("Keys reset.");
		}
		num += 45f;
		GUI.Label(new Rect(x, num, ((Rect)(ref windowRect)).width - 40f, 25f), "Title Settings", GetCenteredLabelStyle());
		num += 35f;
		float num2 = settings.titleTextColorR;
		num2 = GUI.HorizontalSlider(new Rect(20f, num, 200f, 20f), num2, 0f, 255f);
		settings.titleTextColorR = Mathf.RoundToInt(num2);
		GUI.Label(new Rect(230f, num - 4f, 200f, 25f), $"Red: {settings.titleTextColorR}", labelStyle);
		num += 25f;
		num2 = settings.titleTextColorG;
		num2 = GUI.HorizontalSlider(new Rect(20f, num, 200f, 20f), num2, 0f, 255f);
		settings.titleTextColorG = Mathf.RoundToInt(num2);
		GUI.Label(new Rect(230f, num - 4f, 200f, 25f), $"Green: {settings.titleTextColorG}", labelStyle);
		num += 25f;
		num2 = settings.titleTextColorB;
		num2 = GUI.HorizontalSlider(new Rect(20f, num, 200f, 20f), num2, 0f, 255f);
		settings.titleTextColorB = Mathf.RoundToInt(num2);
		GUI.Label(new Rect(230f, num - 4f, 200f, 25f), $"Blue: {settings.titleTextColorB}", labelStyle);
		num += 25f;
		settings.titleFontSize = (int)GUI.HorizontalSlider(new Rect(20f, num, 200f, 20f), (float)settings.titleFontSize, 10f, 30f);
		GUI.Label(new Rect(230f, num - 4f, 200f, 25f), $"Font Size: {settings.titleFontSize}", labelStyle);
		num += 35f;
		GUI.Label(new Rect(x, num, ((Rect)(ref windowRect)).width - 40f, 25f), "Text Settings", GetCenteredLabelStyle());
		num += 35f;
		num2 = settings.textColorR;
		num2 = GUI.HorizontalSlider(new Rect(20f, num, 200f, 20f), num2, 0f, 255f);
		settings.textColorR = Mathf.RoundToInt(num2);
		GUI.Label(new Rect(230f, num - 4f, 200f, 25f), $"Red: {settings.textColorR}", labelStyle);
		num += 25f;
		num2 = settings.textColorG;
		num2 = GUI.HorizontalSlider(new Rect(20f, num, 200f, 20f), num2, 0f, 255f);
		settings.textColorG = Mathf.RoundToInt(num2);
		GUI.Label(new Rect(230f, num - 4f, 200f, 25f), $"Green: {settings.textColorG}", labelStyle);
		num += 25f;
		num2 = settings.textColorB;
		num2 = GUI.HorizontalSlider(new Rect(20f, num, 200f, 20f), num2, 0f, 255f);
		settings.textColorB = Mathf.RoundToInt(num2);
		GUI.Label(new Rect(230f, num - 4f, 200f, 25f), $"Blue: {settings.textColorB}", labelStyle);
		num += 25f;
		settings.fontSize = (int)GUI.HorizontalSlider(new Rect(20f, num, 200f, 20f), (float)settings.fontSize, 10f, 30f);
		GUI.Label(new Rect(230f, num - 4f, 200f, 25f), $"Font Size: {settings.fontSize}", labelStyle);
		num += 25f;
		settings.bold = GUI.Toggle(new Rect(20f, num, 20f, 20f), settings.bold, "");
		GUI.Label(new Rect(40f, num - 2f, 200f, 25f), "Bold", labelStyle);
		num += 35f;
		GUI.Label(new Rect(x, num, ((Rect)(ref windowRect)).width - 40f, 25f), "Hover Color", GetCenteredLabelStyle());
		num += 35f;
		num2 = settings.buttonHoverR;
		num2 = GUI.HorizontalSlider(new Rect(20f, num, 200f, 20f), num2, 0f, 255f);
		settings.buttonHoverR = Mathf.RoundToInt(num2);
		GUI.Label(new Rect(230f, num - 4f, 200f, 25f), $"Red: {settings.buttonHoverR}", labelStyle);
		num += 25f;
		num2 = settings.buttonHoverG;
		num2 = GUI.HorizontalSlider(new Rect(20f, num, 200f, 20f), num2, 0f, 255f);
		settings.buttonHoverG = Mathf.RoundToInt(num2);
		GUI.Label(new Rect(230f, num - 4f, 200f, 25f), $"Green: {settings.buttonHoverG}", labelStyle);
		num += 25f;
		num2 = settings.buttonHoverB;
		num2 = GUI.HorizontalSlider(new Rect(20f, num, 200f, 20f), num2, 0f, 255f);
		settings.buttonHoverB = Mathf.RoundToInt(num2);
		GUI.Label(new Rect(230f, num - 4f, 200f, 25f), $"Blue: {settings.buttonHoverB}", labelStyle);
		num += 35f;
		GUI.Label(new Rect(x, num, ((Rect)(ref windowRect)).width - 40f, 25f), "Accent Color & Alpha", GetCenteredLabelStyle());
		num += 35f;
		num2 = settings.accentBarR;
		num2 = GUI.HorizontalSlider(new Rect(20f, num, 200f, 20f), num2, 0f, 255f);
		settings.accentBarR = Mathf.RoundToInt(num2);
		GUI.Label(new Rect(230f, num - 4f, 200f, 25f), $"Red: {settings.accentBarR}", labelStyle);
		num += 25f;
		num2 = settings.accentBarG;
		num2 = GUI.HorizontalSlider(new Rect(20f, num, 200f, 20f), num2, 0f, 255f);
		settings.accentBarG = Mathf.RoundToInt(num2);
		GUI.Label(new Rect(230f, num - 4f, 200f, 25f), $"Green: {settings.accentBarG}", labelStyle);
		num += 25f;
		num2 = settings.accentBarB;
		num2 = GUI.HorizontalSlider(new Rect(20f, num, 200f, 20f), num2, 0f, 255f);
		settings.accentBarB = Mathf.RoundToInt(num2);
		GUI.Label(new Rect(230f, num - 4f, 200f, 25f), $"Blue: {settings.accentBarB}", labelStyle);
		num += 25f;
		num2 = settings.accentBarA;
		num2 = GUI.HorizontalSlider(new Rect(20f, num, 200f, 20f), num2, 0f, 255f);
		settings.accentBarA = Mathf.RoundToInt(num2);
		GUI.Label(new Rect(230f, num - 4f, 200f, 25f), $"Alpha: {settings.accentBarA}", labelStyle);
		num += 35f;
		GUI.Label(new Rect(x, num, ((Rect)(ref windowRect)).width - 40f, 25f), "Background Settings", GetCenteredLabelStyle());
		num += 35f;
		num2 = settings.backgroundR;
		num2 = GUI.HorizontalSlider(new Rect(20f, num, 200f, 20f), num2, 0f, 255f);
		settings.backgroundR = Mathf.RoundToInt(num2);
		GUI.Label(new Rect(230f, num - 4f, 200f, 25f), $"Red: {settings.backgroundR}", labelStyle);
		num += 25f;
		num2 = settings.backgroundG;
		num2 = GUI.HorizontalSlider(new Rect(20f, num, 200f, 20f), num2, 0f, 255f);
		settings.backgroundG = Mathf.RoundToInt(num2);
		GUI.Label(new Rect(230f, num - 4f, 200f, 25f), $"Green: {settings.backgroundG}", labelStyle);
		num += 25f;
		num2 = settings.backgroundB;
		num2 = GUI.HorizontalSlider(new Rect(20f, num, 200f, 20f), num2, 0f, 255f);
		settings.backgroundB = Mathf.RoundToInt(num2);
		GUI.Label(new Rect(230f, num - 4f, 200f, 25f), $"Blue: {settings.backgroundB}", labelStyle);
		num += 25f;
		num2 = settings.backgroundA;
		num2 = GUI.HorizontalSlider(new Rect(20f, num, 200f, 20f), num2, 0f, 255f);
		settings.backgroundA = Mathf.RoundToInt(num2);
		GUI.Label(new Rect(230f, num - 4f, 200f, 25f), $"Alpha: {settings.backgroundA}", labelStyle);
		num += 35f;
		GUI.Label(new Rect(x, num, ((Rect)(ref windowRect)).width - 40f, 25f), "Teleport Cost Settings", GetCenteredLabelStyle());
		num += 35f;
		settings.chargeForTeleport = GUI.Toggle(new Rect(20f, num, 200f, 25f), settings.chargeForTeleport, "");
		GUI.Label(new Rect(40f, num - 2f, 200f, 25f), "Enable Teleport Cost", labelStyle);
		num += 30f;
		GUI.Label(new Rect(230f, num - 4f, 200f, 25f), $"Cost: ${settings.teleportCost}", labelStyle);
		settings.teleportCost = (int)GUI.HorizontalSlider(new Rect(20f, num, 200f, 25f), (float)settings.teleportCost, 0f, 500f);
		num += 45f;
		if (GUI.Button(new Rect(x, num, ((Rect)(ref windowRect)).width - 40f, 40f), "Save Settings", buttonStyle))
		{
			SaveAllData();
		}
		num += 45f;
		if (GUI.Button(new Rect(x, num, ((Rect)(ref windowRect)).width - 40f, 40f), "Load Settings", buttonStyle))
		{
			LoadAllData();
		}
		num += 45f;
		if (GUI.Button(new Rect(x, num, ((Rect)(ref windowRect)).width - 40f, 40f), "Reset Settings", buttonStyle))
		{
			ResetSettings();
		}
		num += 45f;
		if (GUI.Button(new Rect(x, num, ((Rect)(ref windowRect)).width - 40f, 40f), "Export Teleports", buttonStyle))
		{
			string exportPath = Path.Combine(MelonEnvironment.UserDataDirectory, "TeleportMenu/ExportedTeleports.json");
			ExportTeleports(exportPath);
		}
		num += 45f;
		if (GUI.Button(new Rect(x, num, ((Rect)(ref windowRect)).width - 40f, 40f), "Import Teleports", buttonStyle))
		{
			string importPath = Path.Combine(MelonEnvironment.UserDataDirectory, "TeleportMenu/ExportedTeleports.json");
			ImportTeleports(importPath);
		}
		num += 45f;
		if (GUI.Button(new Rect(x, num, ((Rect)(ref windowRect)).width - 40f, 40f), "Back", buttonStyle))
		{
			currentMenu = MenuState.Main;
			scrollPosition = Vector2.zero;
		}
	}

	private void ResetSettings()
	{
		settings = new ModSettings();
		MelonLogger.Msg("Settings reset to default.");
	}

	private void ExportTeleports(string exportPath)
	{
		try
		{
			string directoryName = Path.GetDirectoryName(exportPath);
			if (!Directory.Exists(directoryName))
			{
				Directory.CreateDirectory(directoryName);
			}
			string contents = JsonConvert.SerializeObject((object)savedLocations, (Formatting)1);
			File.WriteAllText(exportPath, contents);
			MelonLogger.Msg($"[Teleport Menu] Exported {savedLocations.Count} custom teleports to {exportPath}");
		}
		catch (Exception arg)
		{
			MelonLogger.Error($"[Teleport Menu] Failed to export teleports: {arg}");
		}
	}

	private void ImportTeleports(string importPath)
	{
		try
		{
			if (!File.Exists(importPath))
			{
				MelonLogger.Error("[Teleport Menu] Import file not found: " + importPath);
				return;
			}
			List<TeleportLocation> list = JsonConvert.DeserializeObject<List<TeleportLocation>>(File.ReadAllText(importPath)) ?? new List<TeleportLocation>();
			foreach (TeleportLocation loc in list)
			{
				loc.Category = "Custom Teleports";
				if (!savedLocations.Any((TeleportLocation l) => l.Name == loc.Name && l.Category == "Custom Teleports"))
				{
					savedLocations.Add(loc);
				}
				if (!allLocations.Any((TeleportLocation l) => l.Name == loc.Name && l.Category == "Custom Teleports"))
				{
					allLocations.Add(loc);
				}
				if (loc.IsFavorite && !favoriteLocations.Any((TeleportLocation f) => f.Name == loc.Name && f.Category == loc.Category))
				{
					favoriteLocations.Add(loc);
				}
			}
			SaveAllData();
			MelonLogger.Msg($"[Teleport Menu] Imported {list.Count} custom teleports from {importPath}");
		}
		catch (Exception arg)
		{
			MelonLogger.Error($"[Teleport Menu] Failed to import teleports: {arg}");
		}
	}

	private void SaveAllData()
	{
		try
		{
			string directoryName = Path.GetDirectoryName(combinedSavePath);
			if (!Directory.Exists(directoryName))
			{
				Directory.CreateDirectory(directoryName);
			}
			string contents = JsonConvert.SerializeObject((object)new CombinedData
			{
				SavedLocations = savedLocations,
				FavoriteLocations = favoriteLocations,
				SafetyTeleportPosition = safetyTeleportPosition,
				Settings = settings
			}, (Formatting)1);
			File.WriteAllText(combinedSavePath, contents);
			MelonLogger.Msg("All data saved.");
		}
		catch (Exception arg)
		{
			MelonLogger.Error($"[Teleport Menu] Failed to data: {arg}");
		}
	}

	private void LoadAllData()
	{
		//IL_00db: Unknown result type (might be due to invalid IL or missing references)
		//IL_009d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0056: Unknown result type (might be due to invalid IL or missing references)
		try
		{
			if (File.Exists(combinedSavePath))
			{
				CombinedData combinedData = JsonConvert.DeserializeObject<CombinedData>(File.ReadAllText(combinedSavePath));
				if (combinedData != null)
				{
					savedLocations = combinedData.SavedLocations ?? new List<TeleportLocation>();
					favoriteLocations = combinedData.FavoriteLocations ?? new List<TeleportLocation>();
					safetyTeleportPosition = combinedData.SafetyTeleportPosition ?? new SerializableVector3(Vector3.zero);
					settings = combinedData.Settings ?? new ModSettings();
				}
				MelonLogger.Msg("All data loaded.");
			}
			else
			{
				savedLocations = new List<TeleportLocation>();
				favoriteLocations = new List<TeleportLocation>();
				safetyTeleportPosition = new SerializableVector3(Vector3.zero);
				settings = new ModSettings();
				MelonLogger.Msg(" No data found, starting fresh.");
			}
		}
		catch (Exception arg)
		{
			savedLocations = new List<TeleportLocation>();
			favoriteLocations = new List<TeleportLocation>();
			safetyTeleportPosition = new SerializableVector3(Vector3.zero);
			settings = new ModSettings();
			MelonLogger.Error($"[Teleport Menu] Failed to load data: {arg}");
		}
	}
}