Decompiled source of TeleportToMap v1.0.0

Mods\TeleportToMap.dll

Decompiled a day ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Text.Json;
using BoneLib;
using BoneLib.BoneMenu;
using BoneLib.Notifications;
using Il2CppSLZ.Marrow;
using MelonLoader;
using MelonLoader.Utils;
using Microsoft.CodeAnalysis;
using TeleportToMapMod;
using UnityEngine;
using UnityEngine.SceneManagement;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: MelonInfo(typeof(Main), "TeleportToMap", "1.0.0", "Vladislav", null)]
[assembly: MelonGame("Stress Level Zero", "BONELAB")]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("Vladislav")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("Custom Bonelab Teleport To Map Mod")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("TeleportToMap")]
[assembly: AssemblyTitle("TeleportToMap")]
[assembly: AssemblyVersion("1.0.0.0")]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace TeleportToMapMod
{
	public class SpawnPointData
	{
		public int Index { get; set; }

		public string Name { get; set; } = "";

		public bool IsSet { get; set; }

		public float X { get; set; }

		public float Y { get; set; }

		public float Z { get; set; }

		public float FwdX { get; set; }

		public float FwdY { get; set; }

		public float FwdZ { get; set; } = 1f;

		public SpawnPointData()
		{
		}

		public SpawnPointData(int index)
		{
			Index = index;
			Name = $"Point {index}";
			IsSet = false;
		}
	}
	public class MapPresetData
	{
		public string Name { get; set; } = "Preset 1";

		public List<SpawnPointData> Points { get; set; } = new List<SpawnPointData>();

		public MapPresetData()
		{
		}

		public MapPresetData(string name)
		{
			Name = name;
			Points = new List<SpawnPointData>();
			for (int i = 1; i <= 10; i++)
			{
				Points.Add(new SpawnPointData(i));
			}
		}
	}
	public class MapStorage
	{
		public string MapBarcode { get; set; } = "";

		public string MapTitle { get; set; } = "";

		public int ActivePresetIndex { get; set; }

		public List<MapPresetData> Presets { get; set; } = new List<MapPresetData>();

		public MapStorage()
		{
		}

		public MapStorage(string barcode, string title)
		{
			MapBarcode = barcode;
			MapTitle = title;
			ActivePresetIndex = 0;
			Presets = new List<MapPresetData>
			{
				new MapPresetData("Preset 1"),
				new MapPresetData("Preset 2"),
				new MapPresetData("Preset 3")
			};
		}

		public MapPresetData GetActivePreset()
		{
			if (Presets == null || Presets.Count == 0)
			{
				Presets = new List<MapPresetData>
				{
					new MapPresetData("Preset 1")
				};
				ActivePresetIndex = 0;
			}
			if (ActivePresetIndex < 0 || ActivePresetIndex >= Presets.Count)
			{
				ActivePresetIndex = 0;
			}
			return Presets[ActivePresetIndex];
		}
	}
	public class Main : MelonMod
	{
		private const int MaxPoints = 10;

		private const int MaxPresets = 8;

		private static MapStorage _currentMapStorage = new MapStorage("DefaultMap", "Default Map");

		private static string _currentLevelKey = "DefaultMap";

		private static string _currentLevelTitle = "Default Map";

		private static string _saveDirectory = "";

		private static Page _rootPage;

		private static FunctionElement _mapInfoElem;

		private static Page _quickTpPage;

		private static Page _configPage;

		private static Page _presetsPage;

		private static FunctionElement _activePresetStatusElem;

		private static readonly List<FunctionElement> _presetSelectButtons = new List<FunctionElement>();

		private static readonly List<FunctionElement> _quickTpButtons = new List<FunctionElement>();

		private static readonly List<FunctionElement> _statusElements = new List<FunctionElement>();

		private static readonly List<FunctionElement> _pointSlotHeaders = new List<FunctionElement>();

		public override void OnInitializeMelon()
		{
			//IL_0046: 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)
			MelonLogger.Msg("TeleportToMap v1.0.0: Initializing...");
			_saveDirectory = Path.Combine(MelonEnvironment.UserDataDirectory, "CustomSpawnPoints");
			if (!Directory.Exists(_saveDirectory))
			{
				Directory.CreateDirectory(_saveDirectory);
			}
			Hooking.OnLevelLoaded += OnLevelLoaded;
			try
			{
				Scene activeScene = SceneManager.GetActiveScene();
				if (!string.IsNullOrEmpty(((Scene)(ref activeScene)).name))
				{
					_currentLevelKey = ((Scene)(ref activeScene)).name;
					_currentLevelTitle = ((Scene)(ref activeScene)).name;
					LoadMapStorage(_currentLevelKey, _currentLevelTitle);
				}
			}
			catch
			{
			}
			BuildMenu();
		}

		private void OnLevelLoaded(LevelInfo info)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			if (!string.IsNullOrEmpty(info.barcode))
			{
				_currentLevelKey = info.barcode;
				_currentLevelTitle = ((!string.IsNullOrEmpty(info.title)) ? info.title : info.barcode);
			}
			else
			{
				Scene activeScene = SceneManager.GetActiveScene();
				_currentLevelKey = ((!string.IsNullOrEmpty(((Scene)(ref activeScene)).name)) ? ((Scene)(ref activeScene)).name : "DefaultMap");
				_currentLevelTitle = _currentLevelKey;
			}
			MelonLogger.Msg($"[SpawnPoinSetMap] Map Loaded: {_currentLevelTitle} ({_currentLevelKey})");
			LoadMapStorage(_currentLevelKey, _currentLevelTitle);
			RefreshMenuUI();
		}

		private static string GetSaveFilePath(string levelKey)
		{
			string text = string.Join("_", levelKey.Split(Path.GetInvalidFileNameChars())).Replace(" ", "_");
			return Path.Combine(_saveDirectory, text + ".json");
		}

		private static void SaveMapStorage()
		{
			try
			{
				string saveFilePath = GetSaveFilePath(_currentLevelKey);
				JsonSerializerOptions options = new JsonSerializerOptions
				{
					WriteIndented = true
				};
				string contents = JsonSerializer.Serialize(_currentMapStorage, options);
				File.WriteAllText(saveFilePath, contents);
				MelonLogger.Msg("[SpawnPoinSetMap] Saved map presets to: " + saveFilePath);
			}
			catch (Exception ex)
			{
				MelonLogger.Error("[SpawnPoinSetMap] Error saving map storage: " + ex.Message);
			}
		}

		private static void LoadMapStorage(string levelKey, string levelTitle)
		{
			string saveFilePath = GetSaveFilePath(levelKey);
			if (File.Exists(saveFilePath))
			{
				try
				{
					MapStorage mapStorage = JsonSerializer.Deserialize<MapStorage>(File.ReadAllText(saveFilePath));
					if (mapStorage != null && mapStorage.Presets != null && mapStorage.Presets.Count > 0)
					{
						_currentMapStorage = mapStorage;
						_currentMapStorage.MapBarcode = levelKey;
						_currentMapStorage.MapTitle = levelTitle;
						MelonLogger.Msg($"[SpawnPoinSetMap] Loaded {_currentMapStorage.Presets.Count} presets for map '{levelTitle}'");
						return;
					}
				}
				catch (Exception ex)
				{
					MelonLogger.Error("[SpawnPoinSetMap] Error reading file " + saveFilePath + ": " + ex.Message);
				}
			}
			_currentMapStorage = new MapStorage(levelKey, levelTitle);
			SaveMapStorage();
		}

		private static void BuildMenu()
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: 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_00aa: Unknown result type (might be due to invalid IL or missing references)
			_rootPage = Page.Root.CreatePage("Teleport To Map (10)", Color.cyan, 0, true);
			_mapInfoElem = _rootPage.CreateFunction("Map: " + _currentLevelTitle, Color.white, (Action)delegate
			{
				MapPresetData activePreset = _currentMapStorage.GetActivePreset();
				Notify("Map Info", "Map: " + _currentLevelTitle + "\nActive Preset: " + activePreset.Name, (NotificationType)0);
			});
			BuildPresetsSubPage();
			BuildQuickTpSubPage();
			BuildConfigSubPage();
			_rootPage.CreateFunction("Save All to Disk", Color.white, (Action)delegate
			{
				SaveMapStorage();
				Notify("Saved", "All map presets saved to disk!", (NotificationType)0);
			});
			_rootPage.CreateFunction("Reload Map Data", Color.white, (Action)delegate
			{
				LoadMapStorage(_currentLevelKey, _currentLevelTitle);
				RefreshMenuUI();
				Notify("Reloaded", "Data reloaded for: " + _currentLevelTitle, (NotificationType)0);
			});
			RefreshMenuUI();
		}

		private static void BuildPresetsSubPage()
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			_presetsPage = _rootPage.CreatePage("Map Presets", Color.magenta, 0, true);
			_activePresetStatusElem = _presetsPage.CreateFunction("Active: Preset 1", Color.cyan, (Action)delegate
			{
			});
			_presetSelectButtons.Clear();
			for (int num = 0; num < 8; num++)
			{
				int pIndex = num;
				FunctionElement item = _presetsPage.CreateFunction($"Preset {pIndex + 1}", Color.white, (Action)delegate
				{
					SelectPreset(pIndex);
				});
				_presetSelectButtons.Add(item);
			}
			_presetsPage.CreateFunction("+ Add New Preset", Color.green, (Action)delegate
			{
				if (_currentMapStorage.Presets.Count >= 8)
				{
					Notify("Limit Reached", $"Maximum {8} presets per map!", (NotificationType)1);
				}
				else
				{
					int value = _currentMapStorage.Presets.Count + 1;
					MapPresetData mapPresetData = new MapPresetData($"Preset {value}");
					_currentMapStorage.Presets.Add(mapPresetData);
					_currentMapStorage.ActivePresetIndex = _currentMapStorage.Presets.Count - 1;
					SaveMapStorage();
					RefreshMenuUI();
					Notify("New Preset", "Created & activated '" + mapPresetData.Name + "'!", (NotificationType)0);
				}
			});
			_presetsPage.CreateString("Rename Active Preset", Color.yellow, "Preset 1", (Action<string>)delegate(string newName)
			{
				if (!string.IsNullOrWhiteSpace(newName))
				{
					MapPresetData activePreset = _currentMapStorage.GetActivePreset();
					activePreset.Name = newName.Trim();
					SaveMapStorage();
					RefreshMenuUI();
					Notify("Preset Renamed", "Active preset is now '" + activePreset.Name + "'", (NotificationType)0);
				}
			});
		}

		private static void BuildQuickTpSubPage()
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			_quickTpPage = _rootPage.CreatePage("Quick Teleport", Color.green, 0, true);
			_quickTpButtons.Clear();
			for (int i = 0; i < 10; i++)
			{
				int index = i;
				FunctionElement item = _quickTpPage.CreateFunction($"[{index + 1}] Empty", Color.gray, (Action)delegate
				{
					TeleportToSlot(index);
				});
				_quickTpButtons.Add(item);
			}
		}

		private static void BuildConfigSubPage()
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: 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_0140: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0257: Unknown result type (might be due to invalid IL or missing references)
			//IL_0283: Unknown result type (might be due to invalid IL or missing references)
			_configPage = _rootPage.CreatePage("Point Settings (1-10)", Color.yellow, 0, true);
			_statusElements.Clear();
			_pointSlotHeaders.Clear();
			for (int i = 0; i < 10; i++)
			{
				int index = i;
				Page val = _configPage.CreatePage($"Slot {index + 1}: Point {index + 1}", Color.yellow, 0, true);
				FunctionElement item = val.CreateFunction($"Slot {index + 1}", Color.cyan, (Action)delegate
				{
				});
				_pointSlotHeaders.Add(item);
				FunctionElement item2 = val.CreateFunction("Status: Not Set", Color.white, (Action)delegate
				{
				});
				_statusElements.Add(item2);
				val.CreateFunction("Teleport Here", Color.cyan, (Action)delegate
				{
					TeleportToSlot(index);
				});
				val.CreateFunction("Save Current Position", Color.yellow, (Action)delegate
				{
					SavePositionToSlot(index);
				});
				val.CreateString("Rename Point", Color.magenta, $"Point {index + 1}", (Action<string>)delegate(string newName)
				{
					if (!string.IsNullOrWhiteSpace(newName))
					{
						MapPresetData activePreset = _currentMapStorage.GetActivePreset();
						if (index < activePreset.Points.Count)
						{
							activePreset.Points[index].Name = newName.Trim();
							SaveMapStorage();
							RefreshMenuUI();
							Notify("Renamed", $"Point {index + 1} named '{activePreset.Points[index].Name}'", (NotificationType)0);
						}
					}
				});
				Page val2 = val.CreatePage("Quick Name Presets", Color.gray, 0, true);
				string[] array = new string[10] { "Base", "Roof", "Sniper", "Spawn", "Arena", "Secret", "Armory", "Entrance", "Center", "High Ground" };
				foreach (string text in array)
				{
					string chosenName = text;
					val2.CreateFunction(chosenName, Color.white, (Action)delegate
					{
						MapPresetData activePreset = _currentMapStorage.GetActivePreset();
						if (index < activePreset.Points.Count)
						{
							activePreset.Points[index].Name = chosenName;
							SaveMapStorage();
							RefreshMenuUI();
							Notify("Name Set", $"Slot {index + 1} named '{chosenName}'", (NotificationType)0);
						}
					});
				}
				val.CreateFunction("Clear Point", Color.red, (Action)delegate
				{
					MapPresetData activePreset = _currentMapStorage.GetActivePreset();
					if (index < activePreset.Points.Count)
					{
						SpawnPointData spawnPointData = activePreset.Points[index];
						spawnPointData.IsSet = false;
						spawnPointData.Name = $"Point {index + 1}";
						SaveMapStorage();
						RefreshMenuUI();
						Notify("Cleared", $"Slot {index + 1} has been reset.", (NotificationType)1);
					}
				});
			}
		}

		private static void SelectPreset(int index)
		{
			if (index >= 0 && index < _currentMapStorage.Presets.Count)
			{
				_currentMapStorage.ActivePresetIndex = index;
				SaveMapStorage();
				RefreshMenuUI();
				MapPresetData activePreset = _currentMapStorage.GetActivePreset();
				Notify("Preset Activated", $"Now using: '{activePreset.Name}'\n(Map: {_currentLevelTitle})", (NotificationType)0);
				MelonLogger.Msg($"[SpawnPoinSetMap] Switched to preset index {index} ('{activePreset.Name}')");
			}
		}

		private static void RefreshMenuUI()
		{
			//IL_0132: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0287: Unknown result type (might be due to invalid IL or missing references)
			//IL_0280: Unknown result type (might be due to invalid IL or missing references)
			//IL_033a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0333: Unknown result type (might be due to invalid IL or missing references)
			//IL_0413: Unknown result type (might be due to invalid IL or missing references)
			//IL_040c: Unknown result type (might be due to invalid IL or missing references)
			MapPresetData activePreset = _currentMapStorage.GetActivePreset();
			if (_mapInfoElem != null)
			{
				((Element)_mapInfoElem).ElementName = "Map: " + _currentLevelTitle;
			}
			if (_activePresetStatusElem != null)
			{
				((Element)_activePresetStatusElem).ElementName = "Active: " + activePreset.Name;
			}
			for (int i = 0; i < _presetSelectButtons.Count; i++)
			{
				if (i < _currentMapStorage.Presets.Count)
				{
					MapPresetData mapPresetData = _currentMapStorage.Presets[i];
					bool flag = i == _currentMapStorage.ActivePresetIndex;
					((Element)_presetSelectButtons[i]).ElementName = (flag ? ("* [" + mapPresetData.Name + "] (Active)") : ("  [" + mapPresetData.Name + "]"));
					((Element)_presetSelectButtons[i]).ElementColor = (flag ? Color.green : Color.white);
				}
				else
				{
					((Element)_presetSelectButtons[i]).ElementName = $"- [Slot {i + 1} Empty] -";
					((Element)_presetSelectButtons[i]).ElementColor = Color.gray;
				}
			}
			for (int j = 0; j < 10; j++)
			{
				SpawnPointData spawnPointData = null;
				if (activePreset.Points != null && j < activePreset.Points.Count)
				{
					spawnPointData = activePreset.Points[j];
				}
				bool flag2 = spawnPointData?.IsSet ?? false;
				string value = ((spawnPointData != null) ? spawnPointData.Name : $"Point {j + 1}");
				if (j < _quickTpButtons.Count && _quickTpButtons[j] != null)
				{
					((Element)_quickTpButtons[j]).ElementName = (flag2 ? $"[{j + 1}] {value}" : $"[{j + 1}] (Empty)");
					((Element)_quickTpButtons[j]).ElementColor = (flag2 ? Color.green : Color.gray);
				}
				if (j < _pointSlotHeaders.Count && _pointSlotHeaders[j] != null)
				{
					((Element)_pointSlotHeaders[j]).ElementName = $"Slot {j + 1}: {value} {(flag2 ? "[SET]" : "[EMPTY]")}";
					((Element)_pointSlotHeaders[j]).ElementColor = (flag2 ? Color.green : Color.yellow);
				}
				if (j < _statusElements.Count && _statusElements[j] != null)
				{
					((Element)_statusElements[j]).ElementName = (flag2 ? $"Pos: ({spawnPointData.X:F1}, {spawnPointData.Y:F1}, {spawnPointData.Z:F1})" : "Status: Not Set");
					((Element)_statusElements[j]).ElementColor = (flag2 ? Color.green : Color.white);
				}
			}
		}

		private static void SavePositionToSlot(int index)
		{
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: 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_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: 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_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: 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_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0148: Unknown result type (might be due to invalid IL or missing references)
			//IL_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_0162: Unknown result type (might be due to invalid IL or missing references)
			//IL_016f: Unknown result type (might be due to invalid IL or missing references)
			//IL_017c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0189: 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_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			MapPresetData activePreset = _currentMapStorage.GetActivePreset();
			if (index < 0 || index >= activePreset.Points.Count)
			{
				return;
			}
			RigManager rigManager = Player.RigManager;
			if ((Object)(object)rigManager == (Object)null)
			{
				Notify("Error", "Player RigManager not found!", (NotificationType)2);
				return;
			}
			Vector3 val = (((Object)(object)Player.PhysicsRig != (Object)null && (Object)(object)Player.PhysicsRig.feet != (Object)null) ? Player.PhysicsRig.feet.transform.position : ((!((Object)(object)Player.PhysicsRig != (Object)null) || !((Object)(object)((Rig)Player.PhysicsRig).m_pelvis != (Object)null)) ? ((Component)rigManager).transform.position : (((Rig)Player.PhysicsRig).m_pelvis.position - new Vector3(0f, 0.85f, 0f))));
			Vector3 val2 = Vector3.forward;
			if ((Object)(object)Player.PhysicsRig != (Object)null && (Object)(object)((Rig)Player.PhysicsRig).m_head != (Object)null)
			{
				Vector3 forward = ((Rig)Player.PhysicsRig).m_head.forward;
				forward.y = 0f;
				if (((Vector3)(ref forward)).sqrMagnitude > 0.01f)
				{
					val2 = ((Vector3)(ref forward)).normalized;
				}
			}
			else
			{
				val2 = ((Component)rigManager).transform.forward;
			}
			SpawnPointData spawnPointData = activePreset.Points[index];
			spawnPointData.IsSet = true;
			spawnPointData.X = val.x;
			spawnPointData.Y = val.y;
			spawnPointData.Z = val.z;
			spawnPointData.FwdX = val2.x;
			spawnPointData.FwdY = val2.y;
			spawnPointData.FwdZ = val2.z;
			SaveMapStorage();
			RefreshMenuUI();
			Notify("Point Saved!", $"[{index + 1}] {spawnPointData.Name}\nPos: ({spawnPointData.X:F1}, {spawnPointData.Y:F1}, {spawnPointData.Z:F1})", (NotificationType)0);
			MelonLogger.Msg($"[SpawnPoinSetMap] Slot {index + 1} ('{spawnPointData.Name}') saved at ({spawnPointData.X:F2}, {spawnPointData.Y:F2}, {spawnPointData.Z:F2}) in preset '{activePreset.Name}'");
		}

		private static void TeleportToSlot(int index)
		{
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			MapPresetData activePreset = _currentMapStorage.GetActivePreset();
			if (index < 0 || index >= activePreset.Points.Count)
			{
				return;
			}
			SpawnPointData spawnPointData = activePreset.Points[index];
			if (!spawnPointData.IsSet)
			{
				Notify("Slot Empty", $"Point {index + 1} is not set yet!\nClick 'Save Current Position' first.", (NotificationType)1);
				return;
			}
			RigManager rigManager = Player.RigManager;
			if ((Object)(object)rigManager == (Object)null)
			{
				Notify("Error", "Player RigManager not found!", (NotificationType)2);
				return;
			}
			Vector3 val = default(Vector3);
			((Vector3)(ref val))..ctor(spawnPointData.X, spawnPointData.Y, spawnPointData.Z);
			Vector3 forward = default(Vector3);
			((Vector3)(ref forward))..ctor(spawnPointData.FwdX, spawnPointData.FwdY, spawnPointData.FwdZ);
			if (((Vector3)(ref forward)).sqrMagnitude < 0.01f)
			{
				forward = Vector3.forward;
			}
			rigManager.Teleport(val, forward, true);
			Notify("Teleported!", "Moved to: " + spawnPointData.Name, (NotificationType)0);
			MelonLogger.Msg($"[SpawnPoinSetMap] Teleported to slot {index + 1} ('{spawnPointData.Name}')");
		}

		private static void Notify(string title, string message, NotificationType type)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: 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_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Expected O, but got Unknown
			Notifier.Send(new Notification
			{
				Title = NotificationText.op_Implicit(title),
				Message = NotificationText.op_Implicit(message),
				PopupLength = 2.5f,
				Type = type,
				ShowTitleOnPopup = true
			});
		}
	}
}