Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of SeaRoute v1.1.1
SeaRoute.dll
Decompiled a day ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Net; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Text; using System.Threading; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using Microsoft.CodeAnalysis; using MyMods; using MyMods.Web; using Newtonsoft.Json; using Splatform; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("SeaRoute")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.1.1.0")] [assembly: AssemblyInformationalVersion("1.1.1+c13f19c3b078d3d6a56a0c7fbbe49d5fd3c23638")] [assembly: AssemblyProduct("SeaRoute")] [assembly: AssemblyTitle("SeaRoute")] [assembly: AssemblyVersion("1.1.1.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 MyMods { public static class HallClient { private struct Pending { public string Id; public string Title; public int Order; public Action<Rect> Draw; } private static readonly List<Pending> s_pending = new List<Pending>(); private static Type s_type; private static bool s_miss; private static MethodInfo s_register; private static MethodInfo s_open; private static MethodInfo s_close; private static MethodInfo s_hosting; private static MethodInfo s_yield; private static MethodInfo s_hold; private static PropertyInfo s_ready; private static PropertyInfo s_openProp; private static Type HallType { get { if (s_type != null || s_miss) { return s_type; } s_type = Type.GetType("DFGHub.HallBoard, DFGHub"); s_miss = s_type == null; return s_type; } } public static bool Ready { get { if (s_ready == null && HallType != null) { s_ready = HallType.GetProperty("Ready", BindingFlags.Static | BindingFlags.Public); } if (s_ready == null) { return false; } object value = s_ready.GetValue(null, null); bool flag = default(bool); int num; if (value is bool) { flag = (bool)value; num = 1; } else { num = 0; } return (byte)((uint)num & (flag ? 1u : 0u)) != 0; } } public static bool IsOpen { get { if (s_openProp == null && HallType != null) { s_openProp = HallType.GetProperty("IsOpen", BindingFlags.Static | BindingFlags.Public); } if (s_openProp == null) { return false; } object value = s_openProp.GetValue(null, null); bool flag = default(bool); int num; if (value is bool) { flag = (bool)value; num = 1; } else { num = 0; } return (byte)((uint)num & (flag ? 1u : 0u)) != 0; } } public static void Bind(string id, string title, int order, Action<Rect> draw) { if (string.IsNullOrEmpty(id) || draw == null) { return; } for (int num = s_pending.Count - 1; num >= 0; num--) { if (string.Equals(s_pending[num].Id, id, StringComparison.OrdinalIgnoreCase)) { s_pending.RemoveAt(num); } } s_pending.Add(new Pending { Id = id, Title = title, Order = order, Draw = draw }); Flush(); } public static void Flush() { if (s_pending.Count != 0 && Ready) { for (int i = 0; i < s_pending.Count; i++) { Pending pending = s_pending[i]; TryRegister(pending.Id, pending.Title, pending.Order, pending.Draw); } s_pending.Clear(); } } public static bool TryOpen(string tabId) { if (!Ready) { return false; } if (s_open == null) { s_open = HallType.GetMethod("Open", BindingFlags.Static | BindingFlags.Public); } if (s_open == null) { return false; } try { object obj = s_open.Invoke(null, new object[1] { tabId }); bool flag = default(bool); int num; if (obj is bool) { flag = (bool)obj; num = 1; } else { num = 0; } return (byte)((uint)num & (flag ? 1u : 0u)) != 0; } catch (Exception) { return false; } } public static void Close() { if (HallType == null) { return; } if (s_close == null) { s_close = HallType.GetMethod("Close", BindingFlags.Static | BindingFlags.Public); } try { s_close?.Invoke(null, null); } catch (Exception) { } } public static bool IsHosting(string id) { if (HallType == null || string.IsNullOrEmpty(id)) { return false; } if (s_hosting == null) { s_hosting = HallType.GetMethod("IsHosting", BindingFlags.Static | BindingFlags.Public); } if (s_hosting == null) { return false; } try { object obj = s_hosting.Invoke(null, new object[1] { id }); bool flag = default(bool); int num; if (obj is bool) { flag = (bool)obj; num = 1; } else { num = 0; } return (byte)((uint)num & (flag ? 1u : 0u)) != 0; } catch (Exception) { return false; } } public static void SetYield(bool yieldScreen) { if (HallType == null) { return; } if (s_yield == null) { s_yield = HallType.GetMethod("SetYield", BindingFlags.Static | BindingFlags.Public); } try { s_yield?.Invoke(null, new object[1] { yieldScreen }); } catch (Exception) { } } public static void HoldEscape() { if (HallType == null) { return; } if (s_hold == null) { s_hold = HallType.GetMethod("HoldEscape", BindingFlags.Static | BindingFlags.Public); } try { s_hold?.Invoke(null, null); } catch (Exception) { } } private static void TryRegister(string id, string title, int order, Action<Rect> draw) { if (s_register == null) { s_register = HallType.GetMethod("Register", BindingFlags.Static | BindingFlags.Public); } s_register?.Invoke(null, new object[4] { id, title, order, draw }); } } } namespace MyMods.Web { public static class WebNav { public sealed class Link { public readonly string Id; public readonly string Label; public readonly int Port; public string Url => "http://127.0.0.1:" + Port + "/"; public Link(string id, string label, int port) { Id = id; Label = label; Port = port; } } public static readonly Link[] Links = new Link[14] { new Link("monsters", "Monsters", 8777), new Link("searoute", "SeaRoute", 8778), new Link("longboat", "Harpoon Longboat", 8779), new Link("tradewind", "TradeWind", 8780), new Link("safeharbor", "Safe Harbor", 8781), new Link("hub", "DFG Hub", 8782), new Link("vault", "Viking Vault", 8783), new Link("qolvault", "QoL Vault Buttons", 8784), new Link("qolinventory", "QoL Inventory Buttons", 8785), new Link("cacophony", "Cacophony", 8787), new Link("ominous", "Ominous", 8788), new Link("pebble", "Pebble", 8789), new Link("trolls", "Trolls", 8790), new Link("transporter", "Transporter", 8791) }; public const string Style = "nav.top{position:sticky;top:0;z-index:20;font-family:Segoe UI,Arial,sans-serif;background:#0d1219;border-bottom:1px solid #2b3b4c;padding:6px 14px;display:flex;align-items:center;gap:6px;flex-wrap:wrap}\nnav.top .brand{color:#7f8fa0;font-size:11px;text-transform:uppercase;letter-spacing:.6px;margin-right:8px}\nnav.top a{color:#9fc3dd;text-decoration:none;font-size:13px;padding:4px 9px;border-radius:5px}\nnav.top a:hover{background:#1a2530}\nnav.top a.here{background:#3a2b4c;border:1px solid #55406b;color:#efe0ff}\n"; public static string Html(string currentId) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append("<nav class='top'><span class='brand'>MyMods</span>"); Link[] links = Links; foreach (Link link in links) { stringBuilder.Append("<a class='"); if (link.Id == currentId) { stringBuilder.Append("here"); } stringBuilder.Append("' href='").Append(link.Url).Append("'>") .Append(link.Label) .Append("</a>"); } stringBuilder.Append("</nav>"); return stringBuilder.ToString(); } public static Link Find(string id) { Link[] links = Links; foreach (Link link in links) { if (link.Id == id) { return link; } } return null; } } } namespace SeaRoute { internal static class ChartTableKit { internal const string PrefabName = "searoute_charttable"; internal static GameObject s_chartTablePrefab; private const BindingFlags InstanceFields = BindingFlags.Instance | BindingFlags.NonPublic; internal static string GiveKit() { if ((Object)(object)ZNetScene.instance == (Object)null) { return "be in a world to unpack the kit."; } try { RegisterAsPrefab(); RegisterInBuildMenu(); SeaRoutePlugin.Debug("chart table kit unpacked."); return "SeaRoute chart table added to your Hammer build menu (Misc). Interact with it to manage routes."; } catch (Exception ex) { SeaRoutePlugin.Debug("chart table kit failed: " + ex); return "could not unpack the chart table kit (" + ex.Message + ")."; } } private static void RegisterAsPrefab() { if (!((Object)(object)s_chartTablePrefab != (Object)null)) { GameObject prefab = ZNetScene.instance.GetPrefab("piece_cartographytable"); if ((Object)(object)prefab == (Object)null) { throw new InvalidOperationException("piece_cartographytable not found in ZNetScene."); } GameObject val = Object.Instantiate<GameObject>(prefab, (Transform)null, true); ((Object)val).name = "searoute_charttable"; val.SetActive(false); Restyle(val); Piece component = val.GetComponent<Piece>(); if ((Object)(object)component != (Object)null) { component.m_name = "SeaRoute Chart Table"; component.m_description = "Plan ship routes: record stops, drop map pins, and pick a route to follow from your boat."; } if ((Object)(object)val.GetComponent<ChartTableInteract>() == (Object)null) { val.AddComponent<ChartTableInteract>(); } FieldInfo field = typeof(ZNetScene).GetField("m_namedPrefabs", BindingFlags.Instance | BindingFlags.NonPublic); Dictionary<int, GameObject> dictionary = ((field != null) ? (field.GetValue(ZNetScene.instance) as Dictionary<int, GameObject>) : null); if (dictionary != null) { dictionary[StringExtensionMethods.GetStableHashCode("searoute_charttable")] = val; } ZNetScene.instance.m_prefabs.Add(val); s_chartTablePrefab = val; SeaRoutePlugin.Debug("chart table prefab registered: 'searoute_charttable'."); } } private static void RegisterInBuildMenu() { if ((Object)(object)ObjectDB.instance == (Object)null) { throw new InvalidOperationException("ObjectDB not loaded."); } GameObject itemPrefab = ObjectDB.instance.GetItemPrefab("Hammer"); if ((Object)(object)itemPrefab == (Object)null) { throw new InvalidOperationException("Hammer item not found."); } PieceTable buildPieces = itemPrefab.GetComponent<ItemDrop>().m_itemData.m_shared.m_buildPieces; if ((Object)(object)buildPieces == (Object)null) { throw new InvalidOperationException("Hammer build table not found."); } Piece component = s_chartTablePrefab.GetComponent<Piece>(); if (buildPieces.m_pieces != null && !buildPieces.m_pieces.Contains(s_chartTablePrefab)) { buildPieces.m_pieces.Add(s_chartTablePrefab); } if ((Object)(object)component != (Object)null && buildPieces.m_availablePieces != null && !buildPieces.m_availablePieces.Contains(component)) { buildPieces.m_availablePieces.Add(component); } if ((Object)(object)component != (Object)null && buildPieces.m_enabledPieces != null && !buildPieces.m_enabledPieces.Contains(component)) { buildPieces.m_enabledPieces.Add(component); } SeaRoutePlugin.Debug("chart table added to Hammer build menu."); } private static void Restyle(GameObject root) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: 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) //IL_008b: Unknown result type (might be due to invalid IL or missing references) Renderer[] componentsInChildren = root.GetComponentsInChildren<Renderer>(true); foreach (Renderer val in componentsInChildren) { Material[] sharedMaterials = val.sharedMaterials; bool flag = false; for (int j = 0; j < sharedMaterials.Length; j++) { if (!((Object)(object)sharedMaterials[j] == (Object)null)) { Material val2 = new Material(sharedMaterials[j]); if (val2.HasProperty("_Color")) { Color color = val2.color; color.r *= 0.55f; color.g *= 0.85f; color.b = Mathf.Clamp01(color.b + 0.3f); val2.color = color; } sharedMaterials[j] = val2; flag = true; } } if (flag) { val.sharedMaterials = sharedMaterials; } } } } internal class ChartTableInteract : MonoBehaviour, Interactable { public bool Interact(Humanoid user, bool hold, bool alt) { SeaRoutePlugin.OpenRouteMenu(); return true; } public bool UseItem(Humanoid user, ItemData item) { return false; } public string GetHoverName() { return "SeaRoute Chart Table"; } public string GetHoverText() { return "Plan a ship route"; } } internal sealed class MainThreadQueue : MonoBehaviour { private readonly object m_lock = new object(); private readonly Queue<Action> m_actions = new Queue<Action>(); public void Post(Action action) { lock (m_lock) { m_actions.Enqueue(action); } } private void Update() { Action[] array = null; lock (m_lock) { if (m_actions.Count > 0) { array = m_actions.ToArray(); m_actions.Clear(); } } if (array == null) { return; } for (int i = 0; i < array.Length; i++) { try { array[i](); } catch (Exception ex) { SeaRoutePlugin.Debug("main-thread task error: " + ex.Message); } } } } public static class MapTools { private static FieldInfo s_mapTextureField; private static FieldInfo s_fogTextureField; private static bool s_reflectFailed; private static byte[] s_cachedPng; private static DateTime s_cacheStamp = DateTime.MinValue; public static bool Available { get { EnsureCache(); return !s_reflectFailed; } } private static void EnsureCache() { if (!s_reflectFailed) { Type typeFromHandle = typeof(Minimap); if (s_mapTextureField == null) { s_mapTextureField = typeFromHandle.GetField("m_mapTexture", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); s_fogTextureField = typeFromHandle.GetField("m_fogTexture", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); } if (s_mapTextureField == null) { SeaRoutePlugin.Debug("map texture reflection failed; map view disabled."); s_reflectFailed = true; } } } internal static float WorldHalf() { if (WorldGenerator.instance != null) { return 10000f; } ZoneSystem instance = ZoneSystem.instance; if ((Object)(object)instance != (Object)null && instance.m_zoneSize > 0.1f) { return instance.m_zoneSize; } return 5000f; } public static Vector2 WorldToUv(Vector3 world) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) float num = WorldHalf(); float num2 = (world.x + num) / (num * 2f); float num3 = (world.z + num) / (num * 2f); return new Vector2(Mathf.Clamp01(num2), Mathf.Clamp01(num3)); } public static Vector3 UvToWorld(float u, float v) { //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) float num = WorldHalf(); float num2 = Mathf.Clamp01(u) * num * 2f - num; float num3 = Mathf.Clamp01(v) * num * 2f - num; float num4 = 0f; if ((Object)(object)ZoneSystem.instance != (Object)null) { num4 = ZoneSystem.instance.GetGroundHeight(new Vector3(num2, 0f, num3)); } return new Vector3(num2, num4, num3); } public static byte[] CapturePng() { //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_0211: 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_021e: Expected O, but got Unknown //IL_0225: Expected O, but got Unknown //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0185: 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_0190: 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_01ad: 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_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) EnsureCache(); if (s_reflectFailed) { return null; } Minimap instance = Minimap.instance; if ((Object)(object)instance == (Object)null) { return null; } if (s_cachedPng != null && (DateTime.UtcNow - s_cacheStamp).TotalSeconds < 5.0) { return s_cachedPng; } try { object? value = s_mapTextureField.GetValue(instance); Texture2D val = (Texture2D)((value is Texture2D) ? value : null); object? value2 = s_fogTextureField.GetValue(instance); Texture2D val2 = (Texture2D)((value2 is Texture2D) ? value2 : null); if ((Object)(object)val == (Object)null || ((Texture)val).width < 4) { return null; } int num = Mathf.Max(256, Mathf.Min(((Texture)val).width, 1500)); Color[] array = Downsample(val, num); Color[] array2 = (((Object)(object)val2 != (Object)null && ((Texture)val2).width >= 4) ? Downsample(val2, num) : null); byte[] array3 = new byte[num * num * 4]; if (array2 == null || array2.Length != array.Length) { for (int i = 0; i < array.Length; i++) { int num2 = i * 4; array3[num2] = (byte)(array[i].r * 255f); array3[num2 + 1] = (byte)(array[i].g * 255f); array3[num2 + 2] = (byte)(array[i].b * 255f); array3[num2 + 3] = byte.MaxValue; } } else { for (int j = 0; j < array.Length; j++) { int num3 = j * 4; Color val3 = array[j]; Color val4 = array2[j]; array3[num3] = (byte)(val3.r * val4.r * 255f); array3[num3 + 1] = (byte)(val3.g * val4.g * 255f); array3[num3 + 2] = (byte)(val3.b * val4.b * 255f); array3[num3 + 3] = byte.MaxValue; } } Texture2D val5 = new Texture2D(num, num, (TextureFormat)4, false); val5.LoadRawTextureData(array3); val5.Apply(false); byte[] result = ImageConversion.EncodeToPNG(val5); Object.Destroy((Object)val5); s_cachedPng = result; s_cacheStamp = DateTime.UtcNow; return result; } catch (Exception ex) { SeaRoutePlugin.Debug("map capture failed: " + ex.Message); return null; } } private static Color[] Downsample(Texture2D source, int size) { //IL_0021: 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_0035: 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_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Expected O, but got Unknown RenderTexture temporary = RenderTexture.GetTemporary(size, size, 0, (RenderTextureFormat)0); Graphics.Blit((Texture)(object)source, temporary); RenderTexture active = RenderTexture.active; RenderTexture.active = temporary; Texture2D val = new Texture2D(size, size, (TextureFormat)4, false); val.ReadPixels(new Rect(0f, 0f, (float)size, (float)size), 0, 0); val.Apply(false); RenderTexture.active = active; RenderTexture.ReleaseTemporary(temporary); Color[] pixels = val.GetPixels(0); Object.Destroy((Object)val); return pixels; } } public class RoutePin { public string Name; public Vector3 Position; public long OwnerID; public bool Save; public int Type; } public static class PinTools { private static FieldInfo s_pinsField; private static Type s_pinDataType; private static FieldInfo s_nameField; private static FieldInfo s_posField; private static FieldInfo s_ownerField; private static FieldInfo s_saveField; private static FieldInfo s_typeField; private static Type s_pinTypeEnum; private static MethodInfo s_addPin; private static MethodInfo s_removePin; private static MethodInfo s_screenToWorld; private static FieldInfo s_iconsField; private static Type s_spriteDataType; private static FieldInfo s_spriteNameField; private static FieldInfo s_spriteIconField; private static FieldInfo s_selectedIconsField; private static FieldInfo s_selectedIcon4Field; private static PropertyInfo s_imageSpriteProp; private static bool s_reflectFailed; private static object s_routeSlotType; private static Minimap s_injectedMinimap; private static Sprite s_shipSprite; private static Texture2D s_shipTexture; private static readonly List<object> s_currentRoutePins = new List<object>(); private static void EnsureCache() { if (s_reflectFailed) { return; } Type typeFromHandle = typeof(Minimap); if (s_pinsField == null) { s_pinsField = typeFromHandle.GetField("m_pins", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); } if (s_pinDataType == null) { s_pinDataType = typeFromHandle.GetNestedType("PinData", BindingFlags.Public | BindingFlags.NonPublic); } if (s_pinTypeEnum == null) { s_pinTypeEnum = typeFromHandle.GetNestedType("PinType", BindingFlags.Public | BindingFlags.NonPublic); } if (s_nameField == null && s_pinDataType != null) { s_nameField = s_pinDataType.GetField("m_name", BindingFlags.Instance | BindingFlags.Public); s_posField = s_pinDataType.GetField("m_pos", BindingFlags.Instance | BindingFlags.Public); s_ownerField = s_pinDataType.GetField("m_ownerID", BindingFlags.Instance | BindingFlags.Public); s_saveField = s_pinDataType.GetField("m_save", BindingFlags.Instance | BindingFlags.Public); s_typeField = s_pinDataType.GetField("m_type", BindingFlags.Instance | BindingFlags.Public); } if (s_addPin == null && s_pinTypeEnum != null) { s_addPin = typeFromHandle.GetMethod("AddPin", new Type[7] { typeof(Vector3), s_pinTypeEnum, typeof(string), typeof(bool), typeof(bool), typeof(long), typeof(PlatformUserID) }); } if (s_removePin == null && s_pinDataType != null) { MethodInfo[] methods = typeFromHandle.GetMethods(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); foreach (MethodInfo methodInfo in methods) { ParameterInfo[] parameters = methodInfo.GetParameters(); if (methodInfo.Name == "RemovePin" && parameters.Length == 1 && parameters[0].ParameterType == s_pinDataType) { s_removePin = methodInfo; break; } } } if (s_screenToWorld == null) { s_screenToWorld = typeFromHandle.GetMethod("ScreenToWorldPoint", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, new Type[1] { typeof(Vector3) }, null); } if (s_iconsField == null) { s_iconsField = typeFromHandle.GetField("m_icons", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); } if (s_spriteDataType == null) { s_spriteDataType = typeFromHandle.GetNestedType("SpriteData", BindingFlags.Public | BindingFlags.NonPublic); } if (s_spriteNameField == null && s_spriteDataType != null) { s_spriteNameField = s_spriteDataType.GetField("m_name", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); s_spriteIconField = s_spriteDataType.GetField("m_icon", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); } if (s_selectedIconsField == null) { s_selectedIconsField = typeFromHandle.GetField("m_selectedIcons", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); } if (s_selectedIcon4Field == null) { s_selectedIcon4Field = typeFromHandle.GetField("m_selectedIcon4", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); } if (s_imageSpriteProp == null) { Type type = ((s_selectedIcon4Field != null) ? s_selectedIcon4Field.FieldType : null); if (type == null && s_selectedIconsField != null) { Type[] genericArguments = s_selectedIconsField.FieldType.GetGenericArguments(); if (genericArguments.Length > 1) { type = genericArguments[1]; } } if (type != null) { s_imageSpriteProp = type.GetProperty("sprite"); } } if (s_pinsField == null || s_pinDataType == null || s_nameField == null || s_posField == null || s_saveField == null || s_typeField == null || s_pinTypeEnum == null || s_addPin == null || s_removePin == null) { SeaRoutePlugin.Debug("pin reflection incomplete; map pin support disabled."); s_reflectFailed = true; } } private static object RouteSlotPinType() { if (s_routeSlotType == null) { try { s_routeSlotType = Enum.Parse(s_pinTypeEnum, "Icon4"); } catch { s_routeSlotType = Enum.Parse(s_pinTypeEnum, "Icon3"); } } return s_routeSlotType; } private static Sprite BuildShipSprite() { //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Expected O, but got Unknown //IL_0121: 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_020d: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)s_shipSprite != (Object)null) { return s_shipSprite; } string[] array = new string[14] { "................", "W.......M.......", "W.......M.......", ".W......M.......", ".WW.....M.......", "..WW....M.......", "..WWW...M.......", "...WWW..M.......", "...WWWW.M.......", "....WWWWM.......", "....WWWWMMMMM...", "..HHHHHHHHHHH...", "..HHHHHHHHHHH...", "................" }; Color val = default(Color); ((Color)(ref val))..ctor(0f, 0f, 0f, 0f); Color val2 = default(Color); ((Color)(ref val2))..ctor(0.96f, 0.96f, 0.92f, 1f); Color val3 = default(Color); ((Color)(ref val3))..ctor(0.99f, 0.99f, 1f, 1f); Color val4 = default(Color); ((Color)(ref val4))..ctor(0.8f, 0.8f, 0.78f, 1f); Texture2D val5 = new Texture2D(32, 32, (TextureFormat)4, false); ((Texture)val5).filterMode = (FilterMode)0; for (int i = 0; i < 32; i++) { for (int j = 0; j < 32; j++) { val5.SetPixel(j, i, val); } } for (int k = 0; k < array.Length; k++) { for (int l = 0; l < array[k].Length; l++) { char c = array[k][l]; Color val6; if (c != 'H') { if (c != 'M') { if (c != 'W') { continue; } val6 = val2; } else { val6 = val3; } } else { val6 = val4; } for (int m = 0; m < 2; m++) { for (int n = 0; n < 2; n++) { val5.SetPixel(l * 2 + n, 32 - (k * 2 + m) - 1, val6); } } } } val5.Apply(); ((Object)val5).hideFlags = (HideFlags)61; Sprite obj = Sprite.Create(val5, new Rect(0f, 0f, 32f, 32f), new Vector2(0.5f, 0.5f), 100f); ((Object)obj).hideFlags = (HideFlags)61; s_shipTexture = val5; s_shipSprite = obj; return obj; } private static void EnsureCustomIcon() { if ((Object)(object)Minimap.instance == (Object)null || (Object)(object)s_injectedMinimap == (Object)(object)Minimap.instance) { return; } EnsureCache(); if (s_reflectFailed || s_iconsField == null || s_spriteDataType == null || s_spriteNameField == null || s_spriteIconField == null) { return; } try { if (!(s_iconsField.GetValue(Minimap.instance) is IList list)) { return; } Sprite value = BuildShipSprite(); object obj = RouteSlotPinType(); int num = -1; for (int i = 0; i < list.Count; i++) { object obj2 = list[i]; if (obj2 != null && object.Equals(s_spriteNameField.GetValue(obj2), obj)) { num = i; break; } } if (num >= 0) { object obj3 = list[num]; s_spriteIconField.SetValue(obj3, value); list[num] = obj3; } else { object obj4 = Activator.CreateInstance(s_spriteDataType); s_spriteNameField.SetValue(obj4, obj); s_spriteIconField.SetValue(obj4, value); list.Add(obj4); } if (s_selectedIconsField != null && s_selectedIconsField.GetValue(Minimap.instance) is IDictionary dictionary && dictionary.Contains(obj) && s_imageSpriteProp != null) { object obj5 = dictionary[obj]; if (obj5 != null) { s_imageSpriteProp.SetValue(obj5, value); } } if (s_selectedIcon4Field != null) { object value2 = s_selectedIcon4Field.GetValue(Minimap.instance); if (value2 != null && s_imageSpriteProp != null) { s_imageSpriteProp.SetValue(value2, value); } } s_injectedMinimap = Minimap.instance; SeaRoutePlugin.Debug("custom ship pin icon injected into the Icon4 map-pin slot."); } catch (Exception ex) { SeaRoutePlugin.Debug("failed to inject custom ship pin icon: " + ex.Message); } } private static object ResolveRoutePinType() { string text = ((SeaRoutePlugin.RoutePinIcon != null) ? SeaRoutePlugin.RoutePinIcon.Value.Trim() : "Custom"); if (string.IsNullOrEmpty(text) || text.Equals("Custom", StringComparison.OrdinalIgnoreCase)) { EnsureCustomIcon(); return RouteSlotPinType(); } try { return Enum.Parse(s_pinTypeEnum, text); } catch { return Enum.Parse(s_pinTypeEnum, "Icon3"); } } public static List<RoutePin> ReadRoutePins() { //IL_0095: 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) List<RoutePin> list = new List<RoutePin>(); Minimap instance = Minimap.instance; if ((Object)(object)instance == (Object)null) { return list; } EnsureCache(); if (s_reflectFailed) { return list; } try { if (!(s_pinsField.GetValue(instance) is IList list2)) { return list; } for (int i = 0; i < list2.Count; i++) { object obj = list2[i]; if (obj != null) { RoutePin routePin = new RoutePin(); routePin.Name = (string)s_nameField.GetValue(obj); if (!string.IsNullOrEmpty(routePin.Name)) { routePin.Position = (Vector3)s_posField.GetValue(obj); routePin.OwnerID = (long)s_ownerField.GetValue(obj); routePin.Save = (bool)s_saveField.GetValue(obj); object value = s_typeField.GetValue(obj); routePin.Type = ((value != null) ? Convert.ToInt32(value) : 0); list.Add(routePin); } } } } catch (Exception ex) { SeaRoutePlugin.Debug("failed to read map pins: " + ex.Message); } return list; } public static void ClearRoutePinsOnMap(string prefix) { Minimap instance = Minimap.instance; if ((Object)(object)instance == (Object)null) { return; } EnsureCache(); if (s_reflectFailed || s_pinsField == null || s_removePin == null) { return; } try { if (!(s_pinsField.GetValue(instance) is IList list)) { return; } string text = (string.IsNullOrEmpty(prefix) ? "SR" : prefix.Trim()); for (int num = list.Count - 1; num >= 0; num--) { object obj = list[num]; if (obj != null) { string text2 = (string)s_nameField.GetValue(obj); if (!string.IsNullOrEmpty(text2) && (s_currentRoutePins.Contains(obj) || text2.StartsWith(text + " ", StringComparison.OrdinalIgnoreCase))) { s_removePin.Invoke(instance, new object[1] { obj }); } } } s_currentRoutePins.Clear(); } catch (Exception ex) { SeaRoutePlugin.Debug("failed to clear route pins on map: " + ex.Message); } } public static void SyncRoutePinsOnMap(SeaRouteData route, string prefix) { //IL_00ce: 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_0114: Unknown result type (might be due to invalid IL or missing references) Minimap minimap = Minimap.instance; if ((Object)(object)minimap == (Object)null) { return; } EnsureCache(); if (s_reflectFailed || s_pinsField == null || s_removePin == null || s_addPin == null) { return; } try { ClearRoutePinsOnMap(prefix); if (route == null) { return; } string text = (string.IsNullOrEmpty(prefix) ? "SR" : prefix.Trim()); object icon = ResolveRoutePinType(); long owner = (((Object)(object)Player.m_localPlayer != (Object)null) ? Player.m_localPlayer.GetPlayerID() : 0); Action<Vector3, string> action = delegate(Vector3 pos, string pinName) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) s_addPin.Invoke(minimap, new object[7] { pos, icon, pinName, false, false, owner, (object)new PlatformUserID("") }); if (s_pinsField.GetValue(minimap) is IList { Count: >0 } list) { s_currentRoutePins.Add(list[list.Count - 1]); } }; if (route.StartPin != null && route.StartPin.IsValid) { action(route.StartPin.Position, text + " " + route.Name + " Start"); } if (route.Pins != null) { for (int num = 0; num < route.Pins.Length; num++) { RouteWaypoint routeWaypoint = route.Pins[num]; if (routeWaypoint != null && routeWaypoint.IsValid) { action(routeWaypoint.Position, $"{text} {route.Name} {num + 1}"); } } } if (route.EndPin != null && route.EndPin.IsValid) { action(route.EndPin.Position, text + " " + route.Name + " End"); } SeaRoutePlugin.Debug($"Map pins synced for '{route.Name}': {s_currentRoutePins.Count} pins shown."); } catch (Exception ex) { SeaRoutePlugin.Debug("failed to sync route pins on map: " + ex.Message); } } public static void AddRoutePin(Vector3 position, string name) { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) Minimap instance = Minimap.instance; if ((Object)(object)instance == (Object)null) { return; } EnsureCache(); if (s_reflectFailed) { return; } try { object obj = ResolveRoutePinType(); long num = 0L; Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer != (Object)null) { num = localPlayer.GetPlayerID(); } s_addPin.Invoke(instance, new object[7] { position, obj, name, true, false, num, (object)new PlatformUserID("") }); } catch (Exception ex) { SeaRoutePlugin.Debug("failed to add route pin: " + ex.Message); } } public static void AddCustomPin(Vector3 position, string name, string iconName, bool isSaved) { //IL_009e: 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) Minimap instance = Minimap.instance; if ((Object)(object)instance == (Object)null) { return; } EnsureCache(); if (s_reflectFailed) { return; } string text = (string.IsNullOrEmpty(iconName) ? "" : iconName.Trim()); object obj; if (text.Length == 0 || text.Equals("Custom", StringComparison.OrdinalIgnoreCase)) { obj = ResolveRoutePinType(); } else { try { obj = Enum.Parse(s_pinTypeEnum, text); } catch { obj = Enum.Parse(s_pinTypeEnum, "Icon3"); } } long num = 0L; Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer != (Object)null) { num = localPlayer.GetPlayerID(); } try { s_addPin.Invoke(instance, new object[7] { position, obj, name, isSaved, false, num, (object)new PlatformUserID("") }); } catch (Exception ex) { SeaRoutePlugin.Debug("failed to add pin: " + ex.Message); } } public static bool RemovePinByName(string name) { Minimap instance = Minimap.instance; if ((Object)(object)instance == (Object)null) { return false; } EnsureCache(); if (s_reflectFailed) { return false; } try { if (!(s_pinsField.GetValue(instance) is IList list)) { return false; } for (int i = 0; i < list.Count; i++) { object obj = list[i]; if (obj != null && !((string)s_nameField.GetValue(obj) != name)) { s_removePin.Invoke(instance, new object[1] { obj }); return true; } } } catch (Exception ex) { SeaRoutePlugin.Debug("failed to remove pin: " + ex.Message); } return false; } public static bool ScreenToWorld(Vector3 screenPos, out Vector3 world) { //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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) Minimap instance = Minimap.instance; world = Vector3.zero; if ((Object)(object)instance == (Object)null) { return false; } EnsureCache(); if (s_screenToWorld == null) { return false; } try { world = (Vector3)s_screenToWorld.Invoke(instance, new object[1] { screenPos }); return true; } catch (Exception ex) { SeaRoutePlugin.Debug("failed to convert screen point to world: " + ex.Message); return false; } } public static string[] IconNames() { string[] result = new string[6] { "Icon0", "Icon1", "Icon2", "Icon3", "Death", "Icon4" }; if (s_pinTypeEnum == null) { return result; } Array values = Enum.GetValues(s_pinTypeEnum); if (values == null || values.Length == 0) { return result; } string[] array = new string[values.Length]; for (int i = 0; i < array.Length; i++) { array[i] = values.GetValue(i).ToString(); } return array; } } public class RouteWaypoint { public string Name; public float X; public float Y; public float Z; [JsonIgnore] public Vector3 Position => new Vector3(X, Y, Z); [JsonIgnore] public bool IsValid { get { if (X == 0f && Y == 0f && Z == 0f) { return !string.IsNullOrEmpty(Name); } return true; } } public RouteWaypoint() { } public RouteWaypoint(string name, Vector3 position) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001a: 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) Name = name; X = position.x; Y = position.y; Z = position.z; } } public class SeaRouteData { public string Name; public RouteWaypoint StartPin; public RouteWaypoint[] Pins; public RouteWaypoint EndPin; [JsonProperty(/*Could not decode attribute arguments.*/)] public List<RouteWaypoint> Waypoints; public SeaRouteData() { Pins = new RouteWaypoint[10]; Waypoints = new List<RouteWaypoint>(); } public List<RouteWaypoint> GetActiveWaypoints() { List<RouteWaypoint> list = new List<RouteWaypoint>(); if (StartPin != null && StartPin.IsValid) { if (string.IsNullOrEmpty(StartPin.Name)) { StartPin.Name = Name + " Start"; } list.Add(StartPin); } if (Pins != null) { for (int i = 0; i < Pins.Length; i++) { RouteWaypoint routeWaypoint = Pins[i]; if (routeWaypoint != null && routeWaypoint.IsValid) { if (string.IsNullOrEmpty(routeWaypoint.Name)) { routeWaypoint.Name = Name + " " + (i + 1); } list.Add(routeWaypoint); } } } if (EndPin != null && EndPin.IsValid) { if (string.IsNullOrEmpty(EndPin.Name)) { EndPin.Name = Name + " End"; } list.Add(EndPin); } return list; } public RouteWaypoint GetSlot(int slotIndex) { switch (slotIndex) { case 0: return StartPin; case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10: if (Pins == null || slotIndex - 1 >= Pins.Length) { return null; } return Pins[slotIndex - 1]; default: if (slotIndex == 11) { return EndPin; } return null; } } public void SetSlot(int slotIndex, RouteWaypoint wp) { EnsurePinsArray(); switch (slotIndex) { case 0: StartPin = wp; break; case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10: Pins[slotIndex - 1] = wp; break; default: if (slotIndex == 11) { EndPin = wp; } break; } SyncLegacyWaypoints(); } public void EnsurePinsArray() { if (Pins != null && Pins.Length == 10) { return; } RouteWaypoint[] array = new RouteWaypoint[10]; if (Pins != null) { for (int i = 0; i < Mathf.Min(Pins.Length, 10); i++) { array[i] = Pins[i]; } } Pins = array; } public void SyncLegacyWaypoints() { Waypoints = GetActiveWaypoints(); } } public class SeaRouteFile { public int Version = 2; public List<SeaRouteData> Routes = new List<SeaRouteData>(); } public static class RouteStore { private static string m_path; public static string FilePath => m_path; internal static void Init() { m_path = Path.Combine(Paths.ConfigPath, "searoute_routes.json"); } public static List<SeaRouteData> Load() { try { if (!File.Exists(m_path)) { return new List<SeaRouteData>(); } SeaRouteFile seaRouteFile = JsonConvert.DeserializeObject<SeaRouteFile>(File.ReadAllText(m_path)); if (seaRouteFile == null || seaRouteFile.Routes == null) { return new List<SeaRouteData>(); } seaRouteFile.Routes.RemoveAll((SeaRouteData r) => r == null || string.IsNullOrEmpty(r.Name)); foreach (SeaRouteData route in seaRouteFile.Routes) { route.EnsurePinsArray(); bool flag = (route.StartPin != null && route.StartPin.IsValid) || (route.EndPin != null && route.EndPin.IsValid); if (!flag && route.Pins != null) { for (int num = 0; num < route.Pins.Length; num++) { if (route.Pins[num] != null && route.Pins[num].IsValid) { flag = true; break; } } } if (!flag && route.Waypoints != null && route.Waypoints.Count > 0) { route.Waypoints.RemoveAll((RouteWaypoint w) => w == null); if (route.Waypoints.Count > 0) { route.StartPin = route.Waypoints[0]; if (route.Waypoints.Count > 1) { route.EndPin = route.Waypoints[route.Waypoints.Count - 1]; for (int num2 = 1; num2 < route.Waypoints.Count - 1 && num2 <= 10; num2++) { route.Pins[num2 - 1] = route.Waypoints[num2]; } } } } route.SyncLegacyWaypoints(); } return seaRouteFile.Routes; } catch (Exception ex) { SeaRoutePlugin.Debug("failed to load route file: " + ex.Message); return new List<SeaRouteData>(); } } public static void SaveAll(List<SeaRouteData> routes) { try { if (routes != null) { foreach (SeaRouteData route in routes) { route?.SyncLegacyWaypoints(); } } SeaRouteFile seaRouteFile = new SeaRouteFile(); seaRouteFile.Routes = routes ?? new List<SeaRouteData>(); Directory.CreateDirectory(Path.GetDirectoryName(m_path)); File.WriteAllText(m_path, JsonConvert.SerializeObject((object)seaRouteFile, (Formatting)1)); } catch (Exception ex) { SeaRoutePlugin.Debug("failed to save route file: " + ex.Message); } } public static SeaRouteData Find(List<SeaRouteData> routes, string name) { if (routes == null || string.IsNullOrEmpty(name)) { return null; } foreach (SeaRouteData route in routes) { if (string.Equals(route.Name, name, StringComparison.OrdinalIgnoreCase)) { return route; } } return null; } public static void Upsert(List<SeaRouteData> routes, SeaRouteData route) { if (routes != null && route != null) { route.SyncLegacyWaypoints(); SeaRouteData seaRouteData = Find(routes, route.Name); if (seaRouteData != null) { int index = routes.IndexOf(seaRouteData); routes[index] = route; } else { routes.Add(route); } SaveAll(routes); } } public static void Remove(List<SeaRouteData> routes, string name) { SeaRouteData seaRouteData = Find(routes, name); if (seaRouteData != null) { routes.Remove(seaRouteData); SaveAll(routes); } } public static string NextUntitledName(List<SeaRouteData> routes) { int num = ((routes == null) ? 1 : (routes.Count + 1)); while (Find(routes, "Route " + num) != null) { num++; } return "Route " + num; } public static void Rename(List<SeaRouteData> routes, string oldName, string newName, out SeaRouteData renamed) { renamed = null; if (routes == null || string.IsNullOrEmpty(oldName) || string.IsNullOrEmpty(newName)) { return; } SeaRouteData seaRouteData = Find(routes, oldName); if (seaRouteData == null) { return; } for (int num = routes.Count - 1; num >= 0; num--) { if (routes[num] != seaRouteData && string.Equals(routes[num].Name, newName, StringComparison.OrdinalIgnoreCase)) { routes.RemoveAt(num); } } seaRouteData.Name = newName; seaRouteData.SyncLegacyWaypoints(); renamed = seaRouteData; SaveAll(routes); } public static void CollapseTo(List<SeaRouteData> routes, SeaRouteData keep) { routes.Clear(); routes.Add(keep); SaveAll(routes); } } public class SeaRouteGUI : MonoBehaviour { private bool m_open; private Rect m_panelRect; private bool m_isDragging; private Vector2 m_dragOffset; private int m_pickingSlot = -1; private string m_renameField = ""; private string m_statusText = ""; private float m_statusTimer; private Vector2 m_waypointsScroll; private Texture2D m_whiteTex; private static readonly Color ColBackdrop = new Color(0f, 0f, 0f, 0.4f); private static readonly Color ColWindowBg = new Color(0.08f, 0.1f, 0.14f, 0.98f); private static readonly Color ColWindowBorder = new Color(0.74f, 0.58f, 0.28f, 1f); private static readonly Color ColWindowBorderInner = new Color(0.18f, 0.23f, 0.32f, 0.85f); private static readonly Color ColCardBg = new Color(0.09f, 0.11f, 0.16f, 0.96f); private static readonly Color ColCardBorder = new Color(0.22f, 0.28f, 0.38f, 0.85f); private static readonly Color ColCardHeaderBg = new Color(0.12f, 0.16f, 0.22f, 1f); private static readonly Color ColSlotEmptyBg = new Color(0.06f, 0.08f, 0.11f, 0.95f); private static readonly Color ColSlotEmptyBorder = new Color(0.14f, 0.18f, 0.24f, 0.7f); private static readonly Color ColSlotItemBg = new Color(0.11f, 0.14f, 0.2f, 0.95f); private static readonly Color ColSlotItemBorder = new Color(0.24f, 0.32f, 0.44f, 0.85f); private static readonly Color ColSlotHoverBorder = new Color(0.38f, 0.72f, 1f, 1f); private static readonly Color ColSlotSelectedBg = new Color(0.26f, 0.2f, 0.08f, 0.98f); private static readonly Color ColSlotSelectedBorder = new Color(1f, 0.82f, 0.28f, 1f); private static readonly Color ColGoldText = new Color(1f, 0.84f, 0.38f, 1f); private static readonly Color ColWhiteText = new Color(0.92f, 0.95f, 0.98f, 1f); private static readonly Color ColMutedText = new Color(0.6f, 0.66f, 0.75f, 1f); private static readonly Color ColCyanText = new Color(0.4f, 0.8f, 1f, 1f); private static readonly Color ColGreenText = new Color(0.38f, 0.88f, 0.48f, 1f); private static readonly Color ColRedText = new Color(0.95f, 0.38f, 0.38f, 1f); private static readonly Dictionary<string, GUIStyle> styleCache = new Dictionary<string, GUIStyle>(); public static SeaRouteGUI Instance { get; private set; } public static bool IsOpen { get { if ((Object)(object)Instance != (Object)null) { return Instance.m_open; } return false; } } private void Awake() { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown //IL_001b: Unknown result type (might be due to invalid IL or missing references) Instance = this; m_whiteTex = new Texture2D(1, 1); m_whiteTex.SetPixel(0, 0, Color.white); m_whiteTex.Apply(); } private void OnDestroy() { if ((Object)(object)Instance == (Object)(object)this) { Instance = null; } } public void Open() { m_open = true; PrepareHosted(); } public void PrepareHosted() { m_statusText = ""; SeaRouteData seaRouteData = SeaRoutePlugin.ActiveRouteLoad(); m_renameField = ((seaRouteData != null) ? seaRouteData.Name : ""); SyncMapPins(); } public void Close() { bool num = HallClient.IsHosting("searoute"); m_open = false; m_isDragging = false; m_pickingSlot = -1; HallClient.SetYield(yieldScreen: false); if (num) { HallClient.Close(); } } public void Toggle() { if (m_open) { Close(); } else { Open(); } } public void SetStatus(string msg) { m_statusText = msg; m_statusTimer = 4.5f; } private void Update() { //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) bool flag = HallClient.IsHosting("searoute"); if (!m_open && !flag) { if (m_pickingSlot >= 0) { m_pickingSlot = -1; HallClient.SetYield(yieldScreen: false); } return; } if ((Object)(object)Player.m_localPlayer == (Object)null || ((Character)Player.m_localPlayer).IsDead()) { Close(); return; } HallClient.SetYield(flag && m_pickingSlot >= 0); PlayerController.SetTakeInputDelay(0.25f); if (m_pickingSlot >= 0) { if (Input.GetKeyDown((KeyCode)27)) { m_pickingSlot = -1; HallClient.HoldEscape(); HallClient.SetYield(yieldScreen: true); SetStatus("Map picking canceled."); return; } if (Input.GetMouseButtonDown(0)) { Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(Input.mousePosition.x, (float)Screen.height - Input.mousePosition.y); if (!((Rect)(ref m_panelRect)).Contains(val)) { if (PinTools.ScreenToWorld(Input.mousePosition, out var world)) { SetPinToLocation(m_pickingSlot, world); SetStatus($"Placed {GetSlotTitle(m_pickingSlot)} at ({world.x:F0}, {world.z:F0})."); } else { SetStatus("Could not convert click to map coordinates."); } m_pickingSlot = -1; try { MethodInfo method = typeof(Minimap).GetMethod("HidePinTextInput", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (method != null && (Object)(object)Minimap.instance != (Object)null) { method.Invoke(Minimap.instance, new object[1] { false }); } return; } catch { return; } } } } else if (m_open && Input.GetKeyDown((KeyCode)27)) { Close(); return; } if (m_statusTimer > 0f) { m_statusTimer -= Time.deltaTime; if (m_statusTimer <= 0f) { m_statusText = ""; } } } private void SyncMapPins() { PinTools.SyncRoutePinsOnMap(SeaRoutePlugin.ActiveRouteLoad(), SeaRoutePlugin.MapPinPrefix.Value); } private void DrawRect(Rect r, Color c) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) GUI.color = c; GUI.DrawTexture(r, (Texture)(object)m_whiteTex); GUI.color = Color.white; } private void DrawBorder(Rect r, Color c, float thickness = 1f) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: 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) GUI.color = c; GUI.DrawTexture(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).y, ((Rect)(ref r)).width, thickness), (Texture)(object)m_whiteTex); GUI.DrawTexture(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).yMax - thickness, ((Rect)(ref r)).width, thickness), (Texture)(object)m_whiteTex); GUI.DrawTexture(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).y + thickness, thickness, ((Rect)(ref r)).height - thickness * 2f), (Texture)(object)m_whiteTex); GUI.DrawTexture(new Rect(((Rect)(ref r)).xMax - thickness, ((Rect)(ref r)).y + thickness, thickness, ((Rect)(ref r)).height - thickness * 2f), (Texture)(object)m_whiteTex); GUI.color = Color.white; } private void DrawBox(Rect r, Color bg, Color border, float thickness = 1f) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: 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_001f: 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) DrawRect(r, bg); if (thickness > 0f && border.a > 0.01f) { DrawBorder(r, border, thickness); } } private void DrawCard(Rect r, string title, string badge = null) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: 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_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_00be: 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) DrawBox(r, ColCardBg, ColCardBorder); Rect r2 = default(Rect); ((Rect)(ref r2))..ctor(((Rect)(ref r)).x, ((Rect)(ref r)).y, ((Rect)(ref r)).width, 26f); DrawBox(r2, ColCardHeaderBg, ColCardBorder); GUI.Label(new Rect(((Rect)(ref r2)).x + 8f, ((Rect)(ref r2)).y + 3f, ((Rect)(ref r2)).width - 16f, 20f), title, GetTextStyle(12, bold: true, (TextAnchor)3, ColGoldText)); if (!string.IsNullOrEmpty(badge)) { GUI.Label(new Rect(((Rect)(ref r2)).xMax - 150f, ((Rect)(ref r2)).y + 3f, 142f, 20f), badge, GetTextStyle(11, bold: true, (TextAnchor)5, ColCyanText)); } } private bool CustomButton(Rect r, string text, Color bg, Color hoverBg, Color textColor, int fontSize = 11, bool bold = true, Color? border = null) { //IL_0007: 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_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: 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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006b: 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_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) bool flag = ((Rect)(ref r)).Contains(Event.current.mousePosition); Color bg2 = (flag ? hoverBg : bg); Color border2 = (Color)(((??)border) ?? (flag ? new Color(0.4f, 0.75f, 1f, 0.9f) : new Color(0.24f, 0.3f, 0.4f, 0.85f))); DrawBox(r, bg2, border2); GUI.Label(r, text, GetTextStyle(fontSize, bold, (TextAnchor)4, textColor)); return GUI.Button(r, GUIContent.none, GUIStyle.none); } private static GUIStyle GetTextStyle(int fontSize, bool bold, TextAnchor anchor, Color color) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected I4, but got Unknown //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: 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_0099: 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_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: 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) string key = $"{fontSize}_{(bold ? 1 : 0)}_{(int)anchor}_{color.r:F2}_{color.g:F2}_{color.b:F2}_{color.a:F2}"; if (!styleCache.TryGetValue(key, out var value)) { value = new GUIStyle(GUI.skin.label) { fontSize = fontSize, fontStyle = (FontStyle)(bold ? 1 : 0), alignment = anchor, clipping = (TextClipping)1 }; value.normal.textColor = color; value.hover.textColor = color; value.active.textColor = color; styleCache[key] = value; } return value; } private Rect Shrink(Rect r, float amount) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) return new Rect(((Rect)(ref r)).x + amount, ((Rect)(ref r)).y + amount, ((Rect)(ref r)).width - amount * 2f, ((Rect)(ref r)).height - amount * 2f); } private void OnGUI() { //IL_0038: 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_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0143: 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_0191: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Invalid comparison between Unknown and I4 //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Invalid comparison between Unknown and I4 //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: 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_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) if (!HallClient.IsHosting("searoute") && m_open) { Cursor.visible = true; Cursor.lockState = (CursorLockMode)0; DrawRect(new Rect(0f, 0f, (float)Screen.width, (float)Screen.height), ColBackdrop); float num = 490f; float num2 = Mathf.Min(740f, (float)Screen.height - 32f); if (((Rect)(ref m_panelRect)).width < 10f || ((Rect)(ref m_panelRect)).height < 10f) { m_panelRect = new Rect((float)Screen.width - num - 24f, ((float)Screen.height - num2) * 0.5f, num, num2); } else { ((Rect)(ref m_panelRect)).width = num; ((Rect)(ref m_panelRect)).height = num2; ((Rect)(ref m_panelRect)).x = Mathf.Clamp(((Rect)(ref m_panelRect)).x, 0f, (float)Screen.width - num); ((Rect)(ref m_panelRect)).y = Mathf.Clamp(((Rect)(ref m_panelRect)).y, 0f, (float)Screen.height - num2); } DrawBox(m_panelRect, ColWindowBg, ColWindowBorder, 2f); DrawBorder(Shrink(m_panelRect, 3f), ColWindowBorderInner); Event current = Event.current; Rect val = default(Rect); ((Rect)(ref val))..ctor(((Rect)(ref m_panelRect)).x, ((Rect)(ref m_panelRect)).y, ((Rect)(ref m_panelRect)).width - 36f, 36f); if ((int)current.type == 0 && ((Rect)(ref val)).Contains(current.mousePosition)) { m_isDragging = true; m_dragOffset = current.mousePosition - new Vector2(((Rect)(ref m_panelRect)).x, ((Rect)(ref m_panelRect)).y); current.Use(); } else if ((int)current.type == 3 && m_isDragging) { ((Rect)(ref m_panelRect)).x = current.mousePosition.x - m_dragOffset.x; ((Rect)(ref m_panelRect)).y = current.mousePosition.y - m_dragOffset.y; current.Use(); } else if ((int)current.type == 1 && m_isDragging) { m_isDragging = false; current.Use(); } DrawContents(m_panelRect); } } public void DrawHosted(Rect panel) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) m_panelRect = panel; DrawContents(panel); } private void DrawContents(Rect panel) { //IL_0036: 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_00a2: 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_0127: Unknown result type (might be due to invalid IL or missing references) float num = ((Rect)(ref panel)).y + 8f; Rect r = default(Rect); ((Rect)(ref r))..ctor(((Rect)(ref panel)).x + 10f, num, ((Rect)(ref panel)).width - 20f, 32f); DrawHeader(r); num += 38f; Rect r2 = default(Rect); ((Rect)(ref r2))..ctor(((Rect)(ref panel)).x + 10f, num, ((Rect)(ref panel)).width - 20f, 96f); DrawRoutesCard(r2); num += 102f; Rect r3 = default(Rect); ((Rect)(ref r3))..ctor(((Rect)(ref panel)).x + 10f, num, ((Rect)(ref panel)).width - 20f, 134f); DrawPilotCard(r3); num += 140f; float num2 = 42f; float num3 = ((Rect)(ref panel)).yMax - num - num2 - 12f; Rect r4 = default(Rect); ((Rect)(ref r4))..ctor(((Rect)(ref panel)).x + 10f, num, ((Rect)(ref panel)).width - 20f, num3); DrawWaypointsCard(r4); num += num3 + 6f; Rect r5 = default(Rect); ((Rect)(ref r5))..ctor(((Rect)(ref panel)).x + 10f, num, ((Rect)(ref panel)).width - 20f, num2); DrawFooterCard(r5); } private void DrawHeader(Rect r) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0016: 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_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0070: 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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0128: 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) DrawBox(r, new Color(0.1f, 0.13f, 0.18f, 0.95f), new Color(0.25f, 0.32f, 0.44f, 0.85f)); GUI.Label(new Rect(((Rect)(ref r)).x + 8f, ((Rect)(ref r)).y + 4f, 220f, 24f), "⚓ SEA ROUTE PILOT", GetTextStyle(13, bold: true, (TextAnchor)3, ColGoldText)); bool num = (Object)(object)SeaRoutePlugin.ActivePilot != (Object)null; string text = (num ? "● SAILING" : "IDLE"); Color color = (num ? ColGreenText : ColMutedText); GUI.Label(new Rect(((Rect)(ref r)).xMax - 140f, ((Rect)(ref r)).y + 5f, 95f, 20f), text, GetTextStyle(11, bold: true, (TextAnchor)5, color)); Rect r2 = default(Rect); ((Rect)(ref r2))..ctor(((Rect)(ref r)).xMax - 28f, ((Rect)(ref r)).y + 4f, 24f, 24f); if (CustomButton(r2, "✕", new Color(0.35f, 0.12f, 0.12f, 1f), new Color(0.65f, 0.18f, 0.18f, 1f), Color.white, 12)) { Close(); } } private void DrawRoutesCard(Rect r) { //IL_0066: 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_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_0279: Unknown result type (might be due to invalid IL or missing references) //IL_0294: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Unknown result type (might be due to invalid IL or missing references) //IL_0326: Unknown result type (might be due to invalid IL or missing references) //IL_032b: Unknown result type (might be due to invalid IL or missing references) //IL_0371: Unknown result type (might be due to invalid IL or missing references) //IL_037f: Unknown result type (might be due to invalid IL or missing references) List<SeaRouteData> list = SeaRoutePlugin.RoutesForEditor(); SeaRouteData active = SeaRoutePlugin.ActiveRouteLoad(); int num = list?.Count ?? 0; int num2 = ((active != null && list != null) ? list.FindIndex((SeaRouteData x) => string.Equals(x.Name, active.Name, StringComparison.OrdinalIgnoreCase)) : (-1)); string badge = $"Route {num2 + 1} of {Mathf.Max(1, num)}"; DrawCard(r, "ROUTES & MAP SYNC", badge); float num3 = ((Rect)(ref r)).y + 30f; float num4 = ((Rect)(ref r)).x + 8f; float num5 = ((Rect)(ref r)).width - 16f; Rect r2 = default(Rect); ((Rect)(ref r2))..ctor(num4, num3, 26f, 24f); if (CustomButton(r2, "◀", new Color(0.14f, 0.18f, 0.25f, 1f), new Color(0.24f, 0.32f, 0.44f, 1f), ColWhiteText)) { CycleRoute(-1); } float num6 = num5 - 26f - 26f - 85f - 12f; Rect val = default(Rect); ((Rect)(ref val))..ctor(((Rect)(ref r2)).xMax + 4f, num3, num6, 24f); m_renameField = GUI.TextField(val, m_renameField ?? "", 28); Rect r3 = default(Rect); ((Rect)(ref r3))..ctor(((Rect)(ref val)).xMax + 4f, num3, 26f, 24f); if (CustomButton(r3, "▶", new Color(0.14f, 0.18f, 0.25f, 1f), new Color(0.24f, 0.32f, 0.44f, 1f), ColWhiteText)) { CycleRoute(1); } Rect r4 = default(Rect); ((Rect)(ref r4))..ctor(((Rect)(ref r3)).xMax + 4f, num3, 85f, 24f); if (CustomButton(r4, "\ud83d\udcbe Save", new Color(0.16f, 0.36f, 0.22f, 1f), new Color(0.22f, 0.5f, 0.3f, 1f), ColGoldText)) { SaveOrRenameActiveRoute(); } num3 += 28f; Rect r5 = default(Rect); ((Rect)(ref r5))..ctor(num4, num3, 95f, 24f); if (CustomButton(r5, "+ New Route", new Color(0.15f, 0.22f, 0.32f, 1f), new Color(0.22f, 0.32f, 0.48f, 1f), ColCyanText)) { CreateNewRoute(); } Rect r6 = default(Rect); ((Rect)(ref r6))..ctor(((Rect)(ref r5)).xMax + 6f, num3, 75f, 24f); if (CustomButton(r6, "\ud83d\uddd1 Delete", new Color(0.28f, 0.12f, 0.12f, 1f), new Color(0.48f, 0.16f, 0.16f, 1f), ColRedText)) { DeleteActiveRoute(); } GUI.Label(new Rect(((Rect)(ref r6)).xMax + 8f, num3, num5 - (((Rect)(ref r6)).xMax - num4) - 8f, 24f), "★ Shown on Map", GetTextStyle(11, bold: true, (TextAnchor)5, ColGoldText)); } private void CycleRoute(int dir) { List<SeaRouteData> list = RouteStore.Load(); if (list != null && list.Count > 1) { string current = SeaRoutePlugin.SelectedRouteName; int num = list.FindIndex((SeaRouteData r) => string.Equals(r.Name, current, StringComparison.OrdinalIgnoreCase)); if (num < 0) { num = 0; } num = (num + dir + list.Count) % list.Count; SeaRoutePlugin.SelectRoute(list[num].Name); m_renameField = list[num].Name; SyncMapPins(); SetStatus("Selected route '" + list[num].Name + "'."); } } private void SaveOrRenameActiveRoute() { string text = m_renameField?.Trim(); if (string.IsNullOrEmpty(text)) { SetStatus("Route name cannot be empty."); return; } if (!string.Equals(SeaRoutePlugin.SelectedRouteName, text, StringComparison.OrdinalIgnoreCase)) { string status = SeaRoutePlugin.RenameActiveRoute(text); SetStatus(status); } else { SeaRouteData seaRouteData = SeaRoutePlugin.ActiveRouteLoad(); if (seaRouteData != null) { RouteStore.Upsert(RouteStore.Load(), seaRouteData); SetStatus("Saved '" + seaRouteData.Name + "'."); } } SyncMapPins(); } private void CreateNewRoute() { List<SeaRouteData> routes = RouteStore.Load(); string text = RouteStore.NextUntitledName(routes); SeaRouteData route = new SeaRouteData { Name = text }; RouteStore.Upsert(routes, route); SeaRoutePlugin.SelectRoute(text); m_renameField = text; SyncMapPins(); SetStatus("Created '" + text + "'."); } private void DeleteActiveRoute() { List<SeaRouteData> list = RouteStore.Load(); if (list != null && list.Count != 0) { string selectedRouteName = SeaRoutePlugin.SelectedRouteName; RouteStore.Remove(list, selectedRouteName); PinTools.ClearRoutePinsOnMap(SeaRoutePlugin.MapPinPrefix.Value); if (list.Count > 0) { SeaRoutePlugin.SelectRoute(list[0].Name); m_renameField = list[0].Name; } else { CreateNewRoute(); } SyncMapPins(); SetStatus("Deleted '" + selectedRouteName + "'."); } } private void DrawPilotCard(Rect r) { //IL_000f: 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_00af: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_0273: 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_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_030b: Unknown result type (might be due to invalid IL or missing references) //IL_02f0: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_0310: 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_032e: Unknown result type (might be due to invalid IL or missing references) //IL_0316: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: 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_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_0340: Unknown result type (might be due to invalid IL or missing references) //IL_0339: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_0345: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Unknown result type (might be due to invalid IL or missing references) //IL_0366: Unknown result type (might be due to invalid IL or missing references) //IL_035f: Unknown result type (might be due to invalid IL or missing references) //IL_036b: Unknown result type (might be due to invalid IL or missing references) //IL_036e: Unknown result type (might be due to invalid IL or missing references) //IL_0375: Unknown result type (might be due to invalid IL or missing references) //IL_0377: Unknown result type (might be due to invalid IL or missing references) //IL_0379: Unknown result type (might be due to invalid IL or missing references) //IL_037e: Unknown result type (might be due to invalid IL or missing references) SeaRoutePilot activePilot = SeaRoutePlugin.ActivePilot; bool flag = (Object)(object)activePilot != (Object)null; DrawCard(r, "AUTOPILOT & STEERING", flag ? "ACTIVE" : "STANDBY"); float num = ((Rect)(ref r)).y + 30f; float num2 = ((Rect)(ref r)).x + 8f; float num3 = ((Rect)(ref r)).width - 16f; bool flag2 = (Object)(object)SeaRoutePlugin.FindSteeredShip() != (Object)null || flag; string text = (flag ? $"<color=#61e07b>Sailing:</color> <color=#ffd661>{activePilot.RouteName}</color> ➔ <color=#66ccff>{activePilot.CurrentTargetName}</color> ({activePilot.DistanceToCurrent:F0}m away)" : (flag2 ? "<color=#61e07b>Ship:</color> Ready to sail" : "<color=#99a8b8>No ship nearby - stand near a ship</color>")); GUI.Label(new Rect(num2, num, num3, 20f), text, GetTextStyle(11, bold: false, (TextAnchor)3, ColWhiteText)); num += 22f; int currentGear = SeaRoutePlugin.CurrentGear; float num4 = (flag ? activePilot.CurrentSpeed : SeaRoutePlugin.CurrentGearSpeed()); string text2 = $"Speed: {num4:F1} m/s • Gear: {SeaRoutePlugin.GearLabels[currentGear]} ({SeaRoutePlugin.GearSpeeds[currentGear]:F1} m/s)"; GUI.Label(new Rect(num2, num, num3, 18f), text2, GetTextStyle(10, bold: false, (TextAnchor)3, ColCyanText)); num += 22f; float num5 = (num3 - 8f) / 3f; Rect r2 = default(Rect); for (int i = 0; i < 3; i++) { ((Rect)(ref r2))..ctor(num2 + (float)i * (num5 + 4f), num, num5, 22f); bool flag3 = currentGear == i; Color val = (flag3 ? new Color(0.26f, 0.2f, 0.08f, 1f) : new Color(0.12f, 0.15f, 0.2f, 0.9f)); Color hoverBg = (Color)(flag3 ? val : new Color(0.18f, 0.24f, 0.34f, 1f)); Color textColor = (flag3 ? ColGoldText : ColMutedText); Color value = (Color)(flag3 ? ColGoldText : new Color(0.2f, 0.25f, 0.35f, 0.8f)); string text3 = $"{SeaRoutePlugin.GearLabels[i]} ({SeaRoutePlugin.GearSpeeds[i]:F1}m/s)"; if (CustomButton(r2, text3, val, hoverBg, textColor, 10, flag3, value)) { SeaRoutePlugin.SetGear(i); } } num += 26f; Rect r3 = default(Rect); ((Rect)(ref r3))..ctor(num2, num, num3, 28f); if (flag) { if (CustomButton(r3, "⏹ STOP AUTOPILOT", new Color(0.48f, 0.16f, 0.16f, 1f), new Color(0.7f, 0.2f, 0.2f, 1f), Color.white, 12, bold: true, ColRedText)) { string status = SeaRoutePlugin.StopRoutePilot(); SetStatus(status); } return; } Color val2 = (flag2 ? new Color(0.14f, 0.38f, 0.2f, 1f) : new Color(0.15f, 0.18f, 0.22f, 0.8f)); Color hoverBg2 = (Color)(flag2 ? new Color(0.2f, 0.52f, 0.28f, 1f) : val2); Color textColor2 = (flag2 ? ColGoldText : ColMutedText); Color value2 = (Color)(flag2 ? ColGoldText : new Color(0.24f, 0.3f, 0.4f, 0.7f)); if (CustomButton(r3, "▶ SAIL ROUTE (Start ➔ 1-10 ➔ End)", val2, hoverBg2, textColor2, 12, bold: true, value2)) { string status2 = SeaRoutePlugin.StartRoutePilot(SeaRoutePlugin.SelectedRouteName); SetStatus(status2); } } private void DrawWaypointsCard(Rect r) { //IL_0018: 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_0124: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0142: 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_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: 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_01b5: 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_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_0282: 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_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_02ed: Unknown result type (might be due to invalid IL or missing references) //IL_0306: Unknown result type (might be due to invalid IL or missing references) //IL_030b: Unknown result type (might be due to invalid IL or missing references) //IL_036a: 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_0386: Unknown result type (might be due to invalid IL or missing references) //IL_038b: Unknown result type (might be due to invalid IL or missing references) //IL_0390: Unknown result type (might be due to invalid IL or missing references) //IL_03b3: Unknown result type (might be due to invalid IL or missing references) //IL_03a2: Unknown result type (might be due to invalid IL or missing references) //IL_03b8: Unknown result type (might be due to invalid IL or missing references) //IL_03e9: Unknown result type (might be due to invalid IL or missing references) //IL_03ee: Unknown result type (might be due to invalid IL or missing references) SeaRouteData seaRouteData = SeaRoutePlugin.ActiveRouteLoad(); List<RouteWaypoint> list = ((seaRouteData != null) ? seaRouteData.GetActiveWaypoints() : new List<RouteWaypoint>()); DrawCard(r, "ROUTE PINS (START, 1-10, END)", $"{list.Count} of 12 Set"); float num = ((Rect)(ref r)).y + 30f; float num2 = ((Rect)(ref r)).x + 8f; float num3 = ((Rect)(ref r)).width - 16f; if (m_pickingSlot >= 0) { Rect val = default(Rect); ((Rect)(ref val))..ctor(num2, num, num3, 22f); DrawBox(val, new Color(0.28f, 0.22f, 0.08f, 1f), ColGoldText); string text = GetSlotTitle(m_pickingSlot).ToUpper(); GUI.Label(val, "★ CLICK MAP TO PLACE " + text + " • ESC TO CANCEL", GetTextStyle(10, bold: true, (TextAnchor)4, ColGoldText)); num += 25f; } float num4 = (num3 - 12f) / 4f; Rect r2 = default(Rect); ((Rect)(ref r2))..ctor(num2, num, num4, 24f); if (CustomButton(r2, "+ Set Here", new Color(0.14f, 0.24f, 0.36f, 1f), new Color(0.2f, 0.36f, 0.52f, 1f), ColCyanText, 10, bold: false)) { SetNextAvailablePin(); } Rect r3 = default(Rect); ((Rect)(ref r3))..ctor(((Rect)(ref r2)).xMax + 4f, num, num4, 24f); Color bg = ((m_pickingSlot >= 0) ? new Color(0.36f, 0.26f, 0.08f, 1f) : new Color(0.22f, 0.2f, 0.12f, 1f)); Color value = (Color)((m_pickingSlot >= 0) ? ColGoldText : new Color(0.32f, 0.28f, 0.18f, 0.9f)); if (CustomButton(r3, "\ud83d\udccd Pick Map", bg, new Color(0.42f, 0.32f, 0.12f, 1f), ColGoldText, 10, m_pickingSlot >= 0, value)) { StartPickingNextAvailable(); } Rect r4 = default(Rect); ((Rect)(ref r4))..ctor(((Rect)(ref r3)).xMax + 4f, num, num4, 24f); if (CustomButton(r4, "\ud83d\uddfa Import", new Color(0.18f, 0.22f, 0.28f, 1f), new Color(0.26f, 0.32f, 0.4f, 1f), ColWhiteText, 10, bold: false)) { string status = SeaRoutePlugin.ImportRoutesFromPins(); SyncMapPins(); SetStatus(status); } Rect r5 = default(Rect); ((Rect)(ref r5))..ctor(((Rect)(ref r4)).xMax + 4f, num, num4, 24f); if (CustomButton(r5, "Clear All", new Color(0.26f, 0.14f, 0.14f, 1f), new Color(0.4f, 0.18f, 0.18f, 1f), ColRedText, 10, bold: false)) { ClearAllPins(); } num += 28f; float num5 = ((Rect)(ref r)).yMax - num - 6f; Rect val2 = default(Rect); ((Rect)(ref val2))..ctor(num2, num, num3, num5); int num6 = 12; float num7 = 26f; float num8 = (float)num6 * (num7 + 3f); m_waypointsScroll = GUI.BeginScrollView(val2, m_waypointsScroll, new Rect(0f, 0f, num3 - 18f, num8)); Vector3 playerPos = (((Object)(object)Player.m_localPlayer != (Object)null) ? ((Component)Player.m_localPlayer).transform.position : Vector3.zero); SeaRoutePilot activePilot = SeaRoutePlugin.ActivePilot; Rect r6 = default(Rect); for (int i = 0; i < num6; i++) { ((Rect)(ref r6))..ctor(0f, (float)i * (num7 + 3f), num3 - 18f, num7); DrawWaypointSlotRow(r6, i, seaRouteData, playerPos, activePilot); } GUI.EndScrollView(); } private void DrawWaypointSlotRow(Rect r, int slotIndex, SeaRouteData route, Vector3 playerPos, SeaRoutePilot pilot) { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_006e: 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_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0167: 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_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_0354: Unknown result type (might be due to invalid IL or missing references) //IL_035f: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_03a3: Unknown result type (might be due to invalid IL or missing references) //IL_03be: Unknown result type (might be due to invalid IL or missing references) //IL_03d7: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_0297: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_02b9: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_02d1: Unknown result type (might be due to invalid IL or missing references) //IL_0337: Unknown result type (might be due to invalid IL or missing references) //IL_0330: Unknown result type (might be due to invalid IL or missing references) //IL_0453: Unknown result type (might be due to invalid IL or missing references) //IL_0438: Unknown result type (might be due to invalid IL or missing references) //IL_033c: Unknown result type (might be due to invalid IL or missing references) //IL_033e: Unknown result type (might be due to invalid IL or missing references) //IL_0346: Unknown result type (might be due to invalid IL or missing references) //IL_0458: Unknown result type (might be due to invalid IL or missing references) //IL_048d: Unknown result type (might be due to invalid IL or missing references) //IL_0472: Unknown result type (might be due to invalid IL or missing references) //IL_0492: 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_0498: Unknown result type (might be due to invalid IL or missing references) //IL_04a4: Unknown result type (might be due to invalid IL or missing references) //IL_04c5: Unknown result type (might be due to invalid IL or missing references) //IL_04be: Unknown result type (might be due to invalid IL or missing references) //IL_04ca: Unknown result type (might be due to invalid IL or missing references) //IL_04fd: Unknown result type (might be due to invalid IL or missing references) //IL_0501: Unknown result type (might be due to invalid IL or missing references) //IL_0503: Unknown result type (might be due to invalid IL or missing references) //IL_0505: 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_0554: Unknown result type (might be due to invalid IL or missing references) //IL_056f: Unknown result type (might be due to invalid IL or missing references) //IL_0588: Unknown result type (might be due to invalid IL or missing references) //IL_058d: Unknown result type (might be due to invalid IL or missing references) RouteWaypoint routeWaypoint = route?.GetSlot(slotIndex); bool flag = routeWaypoint?.IsValid ?? false; string text; Color bg = default(Color); Color border = default(Color); switch (slotIndex) { case 0: text = "START"; ((Color)(ref bg))..ctor(0.12f, 0.32f, 0.18f, 1f); border = ColGreenText; break; case 11: text = "END"; ((Color)(ref bg))..ctor(0.38f, 0.14f, 0.14f, 1f); border = ColRedText; break; default: text = $"PIN {slotIndex}"; ((Color)(ref bg))..ctor(0.1f, 0.18f, 0.28f, 1f); ((Color)(ref border))..ctor(0.24f, 0.4f, 0.6f, 0.8f); break; } bool flag2 = (Object)(object)pilot != (Object)null && flag && string.Equals(pilot.CurrentTargetName, routeWaypoint.Name, StringComparison.OrdinalIgnoreCase); bool flag3 = m_pickingSlot == slotIndex; Color bg2 = (Color)(flag2 ? new Color(0.24f, 0.2f, 0.08f, 0.95f) : (flag3 ? new Color(0.26f, 0.22f, 0.08f, 0.95f) : (flag ? ColSlotItemBg : ColSlotEmptyBg))); Color border2 = (flag2 ? ColGoldText : (flag3 ? ColGoldText : (flag ? ColSlotItemBorder : ColSlotEmptyBorder))); DrawBox(r, bg2, border2); Rect val = default(Rect); ((Rect)(ref val))..ctor(((Rect)(ref r)).x + 3f, ((Rect)(ref r)).y + 3f, 54f, ((Rect)(ref r)).height - 6f); if (flag && GUI.Button(val, GUIContent.none, GUIStyle.none)) { JumpToSlot(slotIndex, routeWaypoint); } DrawBox(val, bg, border); GUI.Label(val, text, GetTextStyle(10, bold: true, (TextAnchor)4, ColWhiteText)); float num = (flag3 ? 116f : 105f); float num2 = ((Rect)(ref val)).xMax + 6f; float num3 = ((Rect)(ref r)).width - num2 - num - 5f; Rect val2 = default(Rect); ((Rect)(ref val2))..ctor(num2, ((Rect)(ref r)).y + 2f, num3, ((Rect)(ref r)).height - 4f); if (flag3) { GUI.Label(val2, "<color=#ffd661>Click on map...</color>", GetTextStyle(10, bold: true, (TextAnchor)3, ColGoldText)); } else if (flag) { bool flag4 = ((Rect)(ref val2)).Contains(Event.current.mousePosition) || ((Rect)(ref val)).Contains(Event.current.mousePosition); if (GUI.Button(val2, GUIContent.none, GUIStyle.none)) { JumpToSlot(slotIndex, routeWaypoint); } float num4 = Vector2.Distance(new Vector2(playerPos.x, playerPos.z), new Vector2(routeWaypoint.X, routeWaypoint.Z)); string text2 = $"({routeWaypoint.X:F0}, {routeWaypoint.Z:F0}) • {num4:F0}m"; if (flag2) { text2 += " <color=#ffd661>➔ TARGET</color>"; } else if (flag4) { text2 += " <color=#66ccff>▶ Jump</color>"; } Color color = (flag4 ? ColCyanText : ColWhiteText); GUI.Label(val2, text2, GetTextStyle(10, bold: false, (TextAnchor)3, color)); } else { GUI.Label(val2, "[Empty / Not Set]", GetTextStyle(10, bold: false, (TextAnchor)3, ColMutedText)); } float num5 = ((Rect)(ref r)).xMax - num; Rect r2 = default(Rect); ((Rect)(ref r2))..ctor(num5, ((Rect)(ref r)).y + 3f, 38f, ((Rect)(ref r)).height - 6f); if (CustomButton(r2, "Here", new Color(0.14f, 0.22f, 0.32f, 1f), new Color(0.2f, 0.34f, 0.48f, 1f), ColCyanText, 10, bold: false)) { SetPinToPlayer(slotIndex); } float num6 = (flag3 ? 47f : 36f); string text3 = (flag3 ? "Pick..." : "Map"); Color bg3 = (flag3 ? new Color(0.4f, 0.3f, 0.08f, 1f) : new Color(0.18f, 0.2f, 0.26f, 1f)); Color hoverBg = (flag3 ? new Color(0.55f, 0.4f, 0.12f, 1f) : new Color(0.26f, 0.3f, 0.4f, 1f)); Color textColor = (flag3 ? ColGoldText : ColWhiteText); Color value = (Color)(flag3 ? ColGoldText : new Color(0.24f, 0.3f, 0.4f, 0.85f)); Rect r3 = default(Rect); ((Rect)(ref r3))..ctor(((Rect)(ref r2)).xMax + 3f, ((Rect)(ref r)).y + 3f, num6, ((Rect)(ref r)).height - 6f); if (CustomButton(r3, text3, bg3, hoverBg, textColor, 10, flag3, value)) { StartPickingSlot(slotIndex); } Rect r4 = default(Rect); ((Rect)(ref r4))..ctor(((Rect)(ref r3)).xMax + 3f, ((Rect)(ref r)).y + 3f, 22f, ((Rect)(ref r)).height - 6f); if (CustomButton(r4, "✕", new Color(0.24f, 0.12f, 0.12f, 1f), new Color(0.42f, 0.16f, 0.16f, 1f), ColRedText, 10)) { ClearPin(slotIndex); } } private void JumpToSlot(int slotIndex, RouteWaypoint wp) { if (wp != null && wp.IsValid) { string text = SeaRoutePlugin.JumpToRouteWaypoint(wp.Name); SetStatus(text); SeaRoutePlugin.Message("SeaRoute: " + text); } } private void StartPickingSlot(int slotIndex) { if (m_pickingSlot == slotIndex) { m_pickingSlot = -1; SetStatus("Map picking canceled."); return; } m_pickingSlot = slotIndex; if ((Object)(object)Minimap.instance != (Object)null && !Minimap.IsOpen()) { Minimap.instance.SetMapMode((MapMode)2); } SetStatus("Click on the map to place " + GetSlotTitle(slotIndex) + " (or click Pick/Esc to cancel)..."); } private void StartPickingNextAvailable() { SeaRouteData seaRouteData = SeaRoutePlugin.ActiveRouteLoad(); if (seaRouteData == null) { return; } int num = -1; for (int i = 0; i < 12; i++) { RouteWaypoint slot = seaRouteData.GetSlot(i); if (slot == null || !slot.IsValid) { num = i; break; } } if (num < 0) { SetStatus("All 12 route pins are already set."); } else { StartPickingSlot(num); } } private void SetPinToLocation(int slotIndex, Vector3 world) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) SeaRouteData seaRouteData = SeaRoutePlugin.ActiveRouteLoad(); if (seaRouteData != null) { string slotDefaultName = GetSlotDefaultName(seaRouteData.Name, slotIndex); seaRouteData.SetSlot(slotIndex, new RouteWaypoint(slotDefaultName, world)); RouteStore.Upsert(RouteStore.Load(), seaRouteData); SyncMapPins(); } } private void SetPinToPlayer(int slotIndex) { //IL_0021: 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_0029: Unknown result type (might be due to invalid IL or missing references) Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null) { SetStatus("No player in world to record position."); return; } Vector3 position = ((Component)localPlayer).transform.position; SetPinToLocation(slotIndex, position); } private void SetNextAvailablePin() { if ((Object)(object)Player.m_localPlayer == (Objec