using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using ComfyLib; using GUIFramework; using HarmonyLib; using Microsoft.CodeAnalysis; using Splatform; using TMPro; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("Pinnacle")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Pinnacle")] [assembly: AssemblyCopyright("Copyright © 2022")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("8d534f00-8286-4b0e-b2bc-a7669730bbca")] [assembly: AssemblyFileVersion("1.16.1")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = "")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.16.1.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [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 Pinnacle { public static class PluginConfig { public static ConfigFile CurrentConfig { get; private set; } public static ConfigEntry IsModEnabled { get; private set; } public static ConfigEntry CenterMapLerpDuration { get; private set; } public static ConfigEntry PinListPanelToggleShortcut { get; private set; } public static ConfigEntry PinListPanelShowPinPosition { get; private set; } public static ConfigEntry PinListPanelPosition { get; private set; } public static ConfigEntry PinListPanelSizeDelta { get; private set; } public static ConfigEntry PinListPanelBackgroundColor { get; private set; } public static ConfigEntry PinListPanelScrollRectMovementType { get; private set; } public static ConfigEntry PinListPanelScrollRectScrollSensitivity { get; private set; } public static ConfigEntry PinListPanelEditPinOnRowClick { get; private set; } public static ConfigEntry PinEditPanelDefaultPosition { get; private set; } public static ConfigEntry PinEditPanelToggleLerpDuration { get; private set; } public static ConfigEntry PinFilterPanelPosition { get; private set; } public static ConfigEntry PinFilterPanelGridIconSize { get; private set; } public static ConfigEntry PinFont { get; private set; } public static ConfigEntry PinFontSize { get; private set; } public static ConfigEntry AddPinAtMouseShortcut { get; private set; } public static ConfigEntry ProcessPinIconColorTags { get; private set; } public static ConfigEntry ProcessPinIconSpriteTags { get; private set; } public static ConfigEntry ProcessPinIconScaleTags { get; private set; } public static ConfigEntry StripPinIconColorTagText { get; private set; } public static ConfigEntry StripPinIconSpriteTagText { get; private set; } public static ConfigEntry StripPinIconScaleTagText { get; private set; } public static ConfigEntry QuickMapPinDefaultName { get; private set; } public static ConfigEntry QuickMapPinDefaultPinType { get; private set; } public static ConfigEntry QuickMapPinShortcut { get; private set; } public static void BindConfig(ConfigFile config) { CurrentConfig = config; IsModEnabled = config.BindInOrder("_Global", "isModEnabled", defaultValue: true, "Globally enable or disable this mod."); IsModEnabled.OnSettingChanged(PinnacleUtils.TogglePinnacle); IsModEnabled.OnSettingChanged(ComfyCommandUtils.ToggleCommands); CenterMapLerpDuration = config.BindInOrder("CenterMap", "lerpDuration", 1f, "Duration (in seconds) for the CenterMap lerp.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 3f)); BindPinListPanelConfig(config); BindPinEditPanelConfig(config); BindPinFilterPanelConfig(config); BindPinIconConfig(config); BindQuickMapPinConfig(config); LateBindConfigQueue.Reset(config); LateBindConfigQueue.Enqueue(BindMinimapConfig); } public static void BindPinListPanelConfig(ConfigFile config) { //IL_0012: 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_00b6: 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) PinListPanelToggleShortcut = config.BindInOrder("PinListPanel", "pinListPanelToggleShortcut", new KeyboardShortcut((KeyCode)9, Array.Empty()), "Keyboard shortcut to toggle the PinListPanel on/off."); PinListPanelShowPinPosition = config.BindInOrder("PinListPanel.Columns", "pinListPanelShowPinPosition", defaultValue: true, "Show the Pin.Position columns in the PinListPanel."); PinListPanelPosition = config.BindInOrder("PinListPanel.Panel", "pinListPanelPosition", new Vector2(25f, 0f), "The value for the PinListPanel.Panel position (relative to pivot/anchors)."); PinListPanelPosition.OnSettingChanged((Action)PinListPanelController.SetPanelPosition); PinListPanelSizeDelta = config.BindInOrder("PinListPanel.Panel", "pinListPanelSizeDelta", new Vector2(400f, 400f), "The value for the PinListPanel.Panel sizeDelta (width/height in pixels)."); PinListPanelSizeDelta.OnSettingChanged((Action)PinListPanelController.SetPanelSize); PinListPanelBackgroundColor = config.BindInOrder("PinListPanel.Panel", "pinListPanelBackgroundColor", new Color(0f, 0f, 0f, 0.9f), "The value for the PinListPanel.Panel background color."); PinListPanelBackgroundColor.OnSettingChanged((Action)PinListPanelController.SetBackgroundColor); PinListPanelScrollRectMovementType = config.BindInOrder("PinListPanel.ScrollRect", "movementType", (MovementType)2, "Determines how the PinListPanel scrolling should behave.", (AcceptableValueBase)(object)new AcceptableValueEnumList((MovementType)2, (MovementType)1)); PinListPanelScrollRectMovementType.OnSettingChanged((Action)PinListPanelController.SetScrollRectMovementType); PinListPanelScrollRectScrollSensitivity = config.BindInOrder("PinListPanel.ScrollRect", "scrollSensitivity", 3600f, "PinListPanel scroll-sensitivity when using the mouse-wheel.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 7200f)); PinListPanelScrollRectScrollSensitivity.OnSettingChanged(PinListPanelController.SetScrollRectScrollSensitivity); PinListPanelEditPinOnRowClick = config.BindInOrder("PinListPanel.Behaviour", "pinListPanelEditPinOnRowClick", defaultValue: true, "If set, will show the PinEditPanel when a row is selected in the PinListPanel."); } public static void BindPinEditPanelConfig(ConfigFile config) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) PinEditPanelDefaultPosition = config.BindInOrder("PinEditPanel", "pinEditPanelDefaultPosition", new Vector2(0f, 25f), "PinEditPanel position, relative to the bottom-center of the Minimap."); PinEditPanelToggleLerpDuration = config.BindInOrder("PinEditPanel.Toggle", "pinEditPanelToggleLerpDuration", 0.25f, "Duration (in seconds) for the PinEditPanel.Toggle on/off lerp.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 3f)); } public static void BindPinFilterPanelConfig(ConfigFile config) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) PinFilterPanelPosition = config.BindInOrder("PinFilterPanel.Panel", "pinFilterPanelPanelPosition", new Vector2(-25f, 0f), "The value for the PinFilterPanel.Panel position (relative to pivot/anchors)."); PinFilterPanelGridIconSize = config.BindInOrder("PinFilterPanel.Grid", "pinFilterPanelGridIconSize", 30f, "The size of the PinFilterPanel.Grid icons.", (AcceptableValueBase)(object)new AcceptableValueRange(10f, 100f)); PinFilterPanelGridIconSize.OnSettingChanged(PinFilterPanelController.UpdateStyle); } public static void BindMinimapConfig(ConfigFile config) { //IL_0104: Unknown result type (might be due to invalid IL or missing references) string valheimNorseFont = UIResources.ValheimNorseFont; List list = new List(); list.AddRange(from f in Resources.FindObjectsOfTypeAll() select ((Object)f).name into f orderby f select f); PinFont = config.BindInOrder("Minimap", "Pin.Font", valheimNorseFont, "The font for the Pin text on the Minimap.", (AcceptableValueBase)(object)new AcceptableValueList(list.ToArray())); PinFontSize = config.BindInOrder("Minimap", "Pin.FontSize", 18, "The font size for the Pin text on the Minimap.", (AcceptableValueBase)(object)new AcceptableValueRange(2, 26)); PinFont.OnSettingChanged(PinMarkerUtils.SetPinNameFont); PinFontSize.OnSettingChanged(PinMarkerUtils.SetPinNameFontSize); AddPinAtMouseShortcut = config.BindInOrder("Minimap.Actions", "addPinAtMouseShortcut", KeyboardShortcut.Empty, "Keyboard shortcut to add a Minimap.Pin at the mouse position."); } private static void BindPinIconConfig(ConfigFile config) { ProcessPinIconColorTags = config.BindInOrder("PinIcon.Tags", "processPinIconColorTags", defaultValue: true, "If set, will process pin-icon-color tags: [#ff00ff]"); ProcessPinIconSpriteTags = config.BindInOrder("PinIcon.Tags", "processPinIconSpriteTags", defaultValue: true, "If set, will process pin-icon-sprite tags: [:sprite_name]"); ProcessPinIconScaleTags = config.BindInOrder("PinIcon.Tags", "processPinIconScaleTags", defaultValue: true, "If set, will process pin-icon-scale tags: [150%]"); StripPinIconColorTagText = config.BindInOrder("PinIcon.Tags", "stripPinIconColorTagText", defaultValue: true, "If set, will strip pin-icon-color tags from the pin-text."); StripPinIconSpriteTagText = config.BindInOrder("PinIcon.Tags", "stripPinIconSpriteTagText", defaultValue: true, "If set, will strip pin-icon-sprite tags from the pin-text."); StripPinIconScaleTagText = config.BindInOrder("PinIcon.Tags", "stripPinIconScaleTagText", defaultValue: true, "If set, will strip pin-icon-scale tags from the pin-text."); } private static void BindQuickMapPinConfig(ConfigFile config) { //IL_0057: Unknown result type (might be due to invalid IL or missing references) QuickMapPinDefaultName = config.BindInOrder("QuickMapPin", "quickMapPinDefaultName", "QuickPin", "Default pin-name to use for a quick-map-pin."); QuickMapPinDefaultPinType = config.BindInOrder("QuickMapPin", "quickMapPinDefaultPinType", (PinType)3, "Default pin-type to use for a quick-map-pin."); QuickMapPinShortcut = config.BindInOrder("QuickMapPin", "quickMapPinShortcut", new KeyboardShortcut((KeyCode)0, Array.Empty()), "Shortcut to add a quick-map-pin at current position with the Minimap is open."); } } public static class LateBindConfigQueue { [HarmonyPatch(typeof(FejdStartup))] private static class FejdStartupPatch { [HarmonyPostfix] [HarmonyPatch("Awake")] private static void AwakePostfix() { while (_queue.Count > 0) { _queue.Dequeue()(_currentConfig); } } } private static ConfigFile _currentConfig = null; private static readonly Queue> _queue = new Queue>(); public static void Reset(ConfigFile currentConfig) { _currentConfig = currentConfig; _queue.Clear(); } public static void Enqueue(Action bindConfigAction) { _queue.Enqueue(bindConfigAction); } } public static class CenterMapHelper { private static Coroutine _centerMapCoroutine; public static void CenterMapOnPosition(Vector3 targetPosition) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)Minimap.instance) && Object.op_Implicit((Object)(object)Player.m_localPlayer)) { if (_centerMapCoroutine != null) { ((MonoBehaviour)Minimap.instance).StopCoroutine(_centerMapCoroutine); } _centerMapCoroutine = ((MonoBehaviour)Minimap.instance).StartCoroutine(CenterMapCoroutine(targetPosition - ((Component)Player.m_localPlayer).transform.position, PluginConfig.CenterMapLerpDuration.Value)); } } private static IEnumerator CenterMapCoroutine(Vector3 targetPosition, float lerpDuration) { //IL_0007: 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) float timeElapsed = 0f; Vector3 startPosition = Minimap.instance.m_mapOffset; while (timeElapsed < lerpDuration) { float num = timeElapsed / lerpDuration; num = num * num * (3f - 2f * num); Minimap.instance.m_mapOffset = Vector3.Lerp(startPosition, targetPosition, num); timeElapsed += Time.deltaTime; yield return null; } Minimap.instance.m_mapOffset = targetPosition; } } public static class AddMapPinCommand { [CompilerGenerated] private static class <>O { public static ConsoleEventFailable <0>__Run; } [ComfyCommand] public static ConsoleCommand Register() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Expected O, but got Unknown //IL_001a: 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_0025: Expected O, but got Unknown object obj = <>O.<0>__Run; if (obj == null) { ConsoleEventFailable val = Run; <>O.<0>__Run = val; obj = (object)val; } return new ConsoleCommand("add-map-pin", "(Pinnacle) add-map-pin [--position=] [--pin-name=] [--pin-type=] [--log]", (ConsoleEventFailable)obj, false, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false); } public static object Run(ConsoleEventArgs args) { return Run(new ComfyArgs(args)); } public static bool Run(ComfyArgs args) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: 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_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) Minimap instance = Minimap.instance; Player localPlayer = Player.m_localPlayer; if (!Object.op_Implicit((Object)(object)instance) || !Object.op_Implicit((Object)(object)localPlayer)) { return false; } Vector3 value = ((Component)localPlayer).transform.position; if (args.TryGetValue("position", "pos", out var argValue) && !argValue.TryParseVector3(out value)) { Pinnacle.LogWarning("Unable to parse --position: " + argValue); return false; } if (!args.TryGetValue("pin-name", "name", out var argValue2)) { argValue2 = string.Empty; } PinType value2 = (PinType)3; if (args.TryGetValue("pin-type", "type", out var argValue3) && !argValue3.TryParseValue(out value2)) { Pinnacle.LogWarning("Unable to parse --pin-type: " + argValue3); return false; } PinData val = instance.AddPin(value, value2, argValue2, true, false, 0L, default(PlatformUserID)); if (args.TryGetValue("log", out bool argValue4) && argValue4) { Pinnacle.LogInfo($"Added new pin... Position: {val.m_pos:F0}, Type: {value2:F}, Name: {argValue2}"); } return true; } } public static class ExportPinsCommand { [CompilerGenerated] private static class <>O { public static ConsoleEventFailable <0>__ExportPinsToBinaryFile; public static ConsoleEventFailable <1>__ExportPinsToTextFile; } [ComfyCommand] public static IEnumerable Register() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected O, but got Unknown //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Expected O, but got Unknown ConsoleCommand[] array = new ConsoleCommand[2]; object obj = <>O.<0>__ExportPinsToBinaryFile; if (obj == null) { ConsoleEventFailable val = ExportPinsToBinaryFile; <>O.<0>__ExportPinsToBinaryFile = val; obj = (object)val; } array[0] = new ConsoleCommand("pinnacle-exportpins-binary", " [name-filter-regex] -- export pins to a file in binary format.", (ConsoleEventFailable)obj, false, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false); object obj2 = <>O.<1>__ExportPinsToTextFile; if (obj2 == null) { ConsoleEventFailable val2 = ExportPinsToTextFile; <>O.<1>__ExportPinsToTextFile = val2; obj2 = (object)val2; } array[1] = new ConsoleCommand("pinnacle-exportpins-text", " [name-filter-regex] -- export pins to a file in plain text format.", (ConsoleEventFailable)obj2, false, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false); return new <>z__ReadOnlyArray((ConsoleCommand[])(object)array); } public static object ExportPinsToBinaryFile(ConsoleEventArgs args) { PinImportExport.ExportPinsToFile(args, PinImportExport.PinFileFormat.Binary); return true; } public static object ExportPinsToTextFile(ConsoleEventArgs args) { PinImportExport.ExportPinsToFile(args, PinImportExport.PinFileFormat.PlainText); return true; } } public static class ImportPinsCommand { [CompilerGenerated] private static class <>O { public static ConsoleEvent <0>__ImportPinsFromBinaryFile; } [ComfyCommand] public static ConsoleCommand Register() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Expected O, but got Unknown //IL_001a: 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_0025: Expected O, but got Unknown object obj = <>O.<0>__ImportPinsFromBinaryFile; if (obj == null) { ConsoleEvent val = PinImportExport.ImportPinsFromBinaryFile; <>O.<0>__ImportPinsFromBinaryFile = val; obj = (object)val; } return new ConsoleCommand("pinnacle-importpins-binary", " [name-filter-regex] -- import pins in binary format from file.", (ConsoleEvent)obj, false, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false); } } public static class RemoveAllPinsCommand { [CompilerGenerated] private static class <>O { public static ConsoleEventFailable <0>__Run; } [ComfyCommand] public static ConsoleCommand Register() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Expected O, but got Unknown //IL_001a: 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_0025: Expected O, but got Unknown object obj = <>O.<0>__Run; if (obj == null) { ConsoleEventFailable val = Run; <>O.<0>__Run = val; obj = (object)val; } return new ConsoleCommand("pinnacle-remove-all-pins", "(Pinnacle) Removes ALL pins.", (ConsoleEventFailable)obj, false, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false); } public static object Run(ConsoleEventArgs args) { if (!Object.op_Implicit((Object)(object)Minimap.instance)) { return false; } int num = Minimap.instance.m_pins.RemoveAll((PinData pin) => pin.m_save); args.Context.AddString($"Removed {num} pins."); return true; } } public static class PinEditPanelController { public static PinEditPanel PinEditPanel { get; private set; } public static void TogglePanel(PinData pinToEdit = null) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: 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_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) if (!IsValid()) { PinEditPanel = new PinEditPanel(Minimap.instance.m_largeRoot.transform); PinEditPanel.RectTransform.SetAnchorMin(new Vector2(0.5f, 0f)).SetAnchorMax(new Vector2(0.5f, 0f)).SetPivot(new Vector2(0.5f, 0f)) .SetPosition(new Vector2(0f, 25f)) .SetSizeDelta(new Vector2(200f, 200f)); } if (pinToEdit == null) { PinEditPanel.SetTargetPin(null); PinEditPanel.SetActive(toggle: false); return; } CenterMapHelper.CenterMapOnPosition(pinToEdit.m_pos); PinEditPanel.RectTransform.SetPosition(PluginConfig.PinEditPanelDefaultPosition.Value); PinEditPanel.SetTargetPin(pinToEdit); PinEditPanel.SetActive(toggle: true); } public static bool IsValid() { if (PinEditPanel != null) { return Object.op_Implicit((Object)(object)PinEditPanel.Panel); } return false; } public static bool HasFocus() { if (PinEditPanel != null && Object.op_Implicit((Object)(object)PinEditPanel.Panel) && PinEditPanel.Panel.activeSelf) { return PinEditPanel.HasFocus(); } return false; } } public static class PinFilterPanelController { private static PinFilterPanel _currentPanel; public static void TogglePanel(bool toggleOn) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: 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) if (!IsValid()) { _currentPanel = new PinFilterPanel(Minimap.instance.m_largeRoot.transform); _currentPanel.RectTransform.SetAnchorMin(new Vector2(1f, 0.5f)).SetAnchorMax(new Vector2(1f, 0.5f)).SetPivot(new Vector2(1f, 0.5f)) .SetPosition(PluginConfig.PinFilterPanelPosition.Value); _currentPanel.PanelDragger.OnPanelEndDrag += SavePanelPosition; } _currentPanel.Panel.SetActive(toggleOn); } private static void SavePanelPosition(object sender, Vector3 position) { //IL_0005: 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) PluginConfig.PinFilterPanelPosition.Value = Vector2.op_Implicit(position); } public static bool IsValid() { if (_currentPanel != null) { return Object.op_Implicit((Object)(object)_currentPanel.Panel); } return false; } public static void UpdateIconFilters() { if (IsValid()) { _currentPanel.UpdatePinIconFilters(); } } public static void UpdateStyle() { if (IsValid()) { _currentPanel.SetPanelStyle(); } } } public static class PinListPanelController { public static PinListPanel PinListPanel { get; private set; } public static void TogglePanel() { PinListPanel pinListPanel = PinListPanel; bool? obj; if (pinListPanel == null) { obj = null; } else { GameObject obj2 = pinListPanel.Panel.Ref(); obj = ((obj2 != null) ? new bool?(!obj2.activeSelf) : ((bool?)null)); } bool? flag = obj; TogglePanel(flag == true); } public static void TogglePanel(bool toggleOn) { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_005c: 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_007f: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)PinListPanel?.Panel)) { PinListPanel = new PinListPanel(Minimap.instance.m_largeRoot.transform); PinListPanel.RectTransform.SetAnchorMin(new Vector2(0f, 0.5f)).SetAnchorMax(new Vector2(0f, 0.5f)).SetPivot(new Vector2(0f, 0.5f)) .SetPosition(PluginConfig.PinListPanelPosition.Value) .SetSizeDelta(PluginConfig.PinListPanelSizeDelta.Value); PinListPanel.PanelDragger.OnPanelEndDrag += OnPanelDragEnd; PinListPanel.PanelResizer.OnPanelEndResize += OnPanelResizeEnd; } if (toggleOn) { PinListPanel.Panel.SetActive(true); PinListPanel.SetTargetPins(); } else { PinListPanel.PinNameFilter.InputField.DeactivateInputField(false); PinListPanel.Panel.SetActive(false); } } public static bool IsPanelValid() { return Object.op_Implicit((Object)(object)PinListPanel?.Panel); } public static bool HasFocus() { if (PinListPanel != null) { return PinListPanel.HasFocus(); } return false; } public static void SetBackgroundColor(Color color) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) if (IsPanelValid()) { ((Graphic)PinListPanel.Background).color = color; } } public static void SetPanelPosition(Vector2 position) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) if (IsPanelValid()) { PinListPanel.RectTransform.anchoredPosition = position; } } public static void SetPanelSize(Vector2 sizeDelta) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) if (IsPanelValid()) { PinListPanel.RectTransform.sizeDelta = sizeDelta; PinListPanel.SetTargetPins(); } } public static void SetScrollRectMovementType(MovementType movementType) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) if (IsPanelValid()) { PinListPanel.ScrollRect.movementType = movementType; } } public static void SetScrollRectScrollSensitivity(float scrollSensitivity) { if (IsPanelValid()) { PinListPanel.ScrollRect.scrollSensitivity = scrollSensitivity; } } private static void OnPanelDragEnd(object sender, Vector3 position) { //IL_0005: 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) PluginConfig.PinListPanelPosition.Value = Vector2.op_Implicit(position); } private static void OnPanelResizeEnd(object sender, Vector2 sizeDelta) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) PluginConfig.PinListPanelSizeDelta.Value = sizeDelta; } } public static class PinIconManager { public static Regex IconColorTagRegex = new Regex(".*\\[(#[0-9a-fA-F]{6})\\].*", RegexOptions.Compiled | RegexOptions.CultureInvariant, TimeSpan.FromMilliseconds(100.0)); public static Regex IconSpriteTagRegex = new Regex(".*\\[:(\\w{3,})\\].*", RegexOptions.Compiled | RegexOptions.CultureInvariant, TimeSpan.FromMilliseconds(100.0)); public static Regex IconScaleTagRegex = new Regex(".*\\[(\\d{2,3})%\\]", RegexOptions.Compiled | RegexOptions.CultureInvariant, TimeSpan.FromMilliseconds(100.0)); public static void ProcessIconTagsCreated(PinData pinData) { if ((0u | ((PluginConfig.ProcessPinIconColorTags.Value && TryProcessIconColorTag(pinData)) ? 1u : 0u) | ((PluginConfig.ProcessPinIconSpriteTags.Value && TryProcessIconSpriteTag(pinData)) ? 1u : 0u) | ((PluginConfig.ProcessPinIconScaleTags.Value && TryProcessIconScaleTag(pinData)) ? 1u : 0u)) != 0) { pinData.m_worldSize = 0f; } } public static void ProcessIconTagsModified(PinData pinData) { bool flag = HasIconTagFlag(pinData); bool flag2 = false; if (PluginConfig.ProcessPinIconColorTags.Value && TryProcessIconColorTag(pinData)) { flag2 = true; } else if (flag) { ResetIconColor(pinData); } if (PluginConfig.ProcessPinIconSpriteTags.Value && TryProcessIconSpriteTag(pinData)) { flag2 = true; } else if (flag) { ResetIconSprite(pinData); } if (PluginConfig.ProcessPinIconScaleTags.Value && TryProcessIconScaleTag(pinData)) { flag2 = true; } else if (flag) { ResetIconScale(pinData); } if (flag2) { RemoveIconTagText(pinData.m_NamePinData); pinData.m_worldSize = 0f; } else if (flag) { pinData.m_worldSize = 0f; } } public static bool IsValidIconTagName(string pinName) { if (pinName != null && pinName.Length > 0) { return pinName[pinName.Length - 1] == ']'; } return false; } public static bool HasIconTagFlag(PinData pinData) { return pinData.m_worldSize == 0f; } public static void RemoveIconTagText(PinNameData pinNameData) { string text = pinNameData.PinNameText.text; if (IsValidIconTagName(text)) { if (PluginConfig.StripPinIconColorTagText.Value) { text = RemoveIconColorTagText(text); } if (PluginConfig.StripPinIconSpriteTagText.Value) { text = RemoveIconSpriteTagText(text); } if (PluginConfig.StripPinIconScaleTagText.Value) { text = RemoveIconScaleTagText(text); } pinNameData.PinNameText.text = text; } } public static bool TryProcessIconColorTag(PinData pinData) { //IL_0045: Unknown result type (might be due to invalid IL or missing references) string name = pinData.m_name; if (name.Length >= 9) { Match match = IconColorTagRegex.Match(name); Color color = default(Color); if (match.Success && ColorUtility.TryParseHtmlString(match.Groups[1].Value, ref color)) { ((Graphic)pinData.m_iconElement).color = color; return true; } } return false; } public static void ResetIconColor(PinData pinData) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) ((Graphic)pinData.m_iconElement).color = ((pinData.m_ownerID == 0L) ? Color.white : GetIconFadeColor(Minimap.instance)); } public static Color GetIconFadeColor(Minimap minimap) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) return new Color(0.7f, 0.7f, 0.7f, 0.8f * minimap.m_sharedMapDataFade); } public static string RemoveIconColorTagText(string nameText) { if (nameText.Length >= 9) { Match match = IconColorTagRegex.Match(nameText); if (match.Success) { Group obj = match.Groups[1]; return nameText.Remove(obj.Index - 1, obj.Length + 2); } } return nameText; } public static bool TryProcessIconSpriteTag(PinData pinData) { string name = pinData.m_name; if (name.Length >= 6) { Match match = IconSpriteTagRegex.Match(name); if (match.Success && UIResources.SpriteCache.TryGetResource(match.Groups[1].Value, out var cachedResource)) { pinData.m_iconElement.sprite = cachedResource; return true; } } return false; } public static void ResetIconSprite(PinData pinData) { pinData.m_iconElement.sprite = pinData.m_icon; } public static string RemoveIconSpriteTagText(string nameText) { if (nameText.Length >= 6) { Match match = IconSpriteTagRegex.Match(nameText); if (match.Success) { Group obj = match.Groups[1]; return nameText.Remove(obj.Index - 2, obj.Length + 3); } } return nameText; } public static bool TryProcessIconScaleTag(PinData pinData) { string name = pinData.m_name; if (name.Length >= 4) { Match match = IconScaleTagRegex.Match(name); if (match.Success && int.TryParse(match.Groups[1].Value, out var result)) { float num = (float)Mathf.Clamp(result, 50, 200) * 0.01f * GetIconDefaultSize(Minimap.instance); pinData.m_uiElement.SetSizeWithCurrentAnchors((Axis)0, num); pinData.m_uiElement.SetSizeWithCurrentAnchors((Axis)1, num); return true; } } return false; } public static void ResetIconScale(PinData pinData) { RectTransform uiElement = pinData.m_uiElement; float iconDefaultSize = GetIconDefaultSize(Minimap.instance); uiElement.SetSizeWithCurrentAnchors((Axis)0, iconDefaultSize); uiElement.SetSizeWithCurrentAnchors((Axis)1, iconDefaultSize); } public static string RemoveIconScaleTagText(string nameText) { if (nameText.Length >= 4) { Match match = IconScaleTagRegex.Match(nameText); if (match.Success) { Group obj = match.Groups[1]; return nameText.Remove(obj.Index - 1, obj.Length + 3); } } return nameText; } public static float GetIconDefaultSize(Minimap minimap) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 if ((int)minimap.m_mode != 2) { return minimap.m_pinSizeSmall; } return minimap.m_pinSizeLarge; } } public static class PinImportExport { public enum PinFileFormat { Binary, PlainText } public static void ExportPinsToFile(ConsoleEventArgs args, PinFileFormat exportFormat) { if (Object.op_Implicit((Object)(object)Minimap.instance)) { object arg = ((args.Length >= 2) ? args[1] : DateTimeOffset.UtcNow.ToUnixTimeSeconds().ToString()); object arg2 = 8; string text = string.Format("Pinnacle/{0}.v{1}.{2}", arg, arg2, exportFormat switch { PinFileFormat.Binary => "pins", PinFileFormat.PlainText => "pins.txt", _ => string.Empty, }); Directory.CreateDirectory(Path.GetDirectoryName(text)); IReadOnlyCollection readOnlyCollection = FilterPins(Minimap.instance.m_pins, (args.Length >= 3) ? args[2] : string.Empty); Pinnacle.LogInfo($"Exporting {readOnlyCollection.Count} pins to file: {text}"); Pinnacle.LogInfo($"Exported {exportFormat switch { PinFileFormat.Binary => ExportPinsToBinaryFile(readOnlyCollection, text), PinFileFormat.PlainText => ExportPinsToTextFile(readOnlyCollection, text), _ => 0, }} pins to file: {text} "); } } private static int ExportPinsToBinaryFile(IReadOnlyCollection pins, string filename) { //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected I4, but got Unknown using FileStream output = new FileStream(filename, FileMode.CreateNew); using BinaryWriter binaryWriter = new BinaryWriter(output); int num = 0; binaryWriter.Write(pins.Count); foreach (PinData pin in pins) { if (pin.m_save) { binaryWriter.Write(pin.m_name); binaryWriter.Write(pin.m_pos.x); binaryWriter.Write(pin.m_pos.y); binaryWriter.Write(pin.m_pos.z); binaryWriter.Write((int)pin.m_type); binaryWriter.Write(pin.m_checked); binaryWriter.Write(pin.m_ownerID); binaryWriter.Write(((object)Unsafe.As(ref pin.m_author)/*cast due to .constrained prefix*/).ToString()); num++; } } return num; } private static int ExportPinsToTextFile(IReadOnlyCollection pins, string filename) { //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) using StreamWriter streamWriter = File.CreateText(filename); int num = 0; foreach (PinData pin in pins) { if (pin.m_save) { streamWriter.Write("\"" + pin.m_name + "\","); streamWriter.Write($"{pin.m_pos.x},{pin.m_pos.y},{pin.m_pos.z},"); streamWriter.Write($"{pin.m_type},{pin.m_checked},{pin.m_ownerID},{pin.m_author}"); streamWriter.WriteLine(); num++; } } return num; } public static void ImportPinsFromBinaryFile(ConsoleEventArgs args) { //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_0115: 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) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0123: 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_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Expected O, but got Unknown //IL_015d: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)Minimap.instance) || args.Length < 2) { return; } string text = "Pinnacle/" + args[1]; if (!File.Exists(text)) { args.Context.AddString("Could not find file: " + text); return; } Dictionary dictionary = Minimap.instance.m_icons.ToDictionary((SpriteData data) => data.m_name, (SpriteData data) => data.m_icon); using FileStream input = new FileStream(text, FileMode.Open); using BinaryReader binaryReader = new BinaryReader(input); int num = binaryReader.ReadInt32(); List list = new List(num); Pinnacle.LogInfo($"Reading {num} pins from file: {text}"); for (int num2 = 0; num2 < num; num2++) { PinData val = new PinData { m_name = binaryReader.ReadString(), m_pos = new Vector3 { x = binaryReader.ReadSingle(), y = binaryReader.ReadSingle(), z = binaryReader.ReadSingle() }, m_type = (PinType)binaryReader.ReadInt32(), m_checked = binaryReader.ReadBoolean(), m_ownerID = binaryReader.ReadInt64(), m_author = new PlatformUserID(binaryReader.ReadString()), m_save = true }; dictionary.TryGetValue(val.m_type, out val.m_icon); list.Add(val); } if (args.Length >= 3) { list = FilterPins(list, args[2]); } Pinnacle.LogInfo($"Imported {list.Count} pins from file: {text}"); Minimap.instance.m_pins.AddRange(list); } private static List FilterPins(IReadOnlyCollection pins, string nameRegexPattern) { if (nameRegexPattern.Length > 0) { Pinnacle.LogInfo($"Filtering {pins.Count} pins by pin.name with regex: {nameRegexPattern}"); Regex regex = new Regex(nameRegexPattern, RegexOptions.CultureInvariant, TimeSpan.FromSeconds(1.0)); return pins.Where((PinData pin) => pin.m_save && regex.Match(pin.m_name).Success).ToList(); } return pins.Where((PinData pin) => pin.m_save).ToList(); } } public static class PinMarkerUtils { public static void SetupPinNamePrefab(Minimap minimap) { TMP_Text componentInChildren = minimap.m_pinNamePrefab.GetComponentInChildren(); componentInChildren.enableAutoSizing = false; componentInChildren.richText = true; SetPinNameFont(); SetPinNameFontSize(); } public static void SetPinNameFont() { if (!Object.op_Implicit((Object)(object)Minimap.instance)) { return; } TMP_FontAsset fontAssetByName = UIResources.GetFontAssetByName(PluginConfig.PinFont.Value); foreach (TMP_Text pinNameLabel in GetPinNameLabels(Minimap.instance)) { pinNameLabel.font = fontAssetByName; } } public static void SetPinNameFontSize() { if (!Object.op_Implicit((Object)(object)Minimap.instance)) { return; } float fontSize = PluginConfig.PinFontSize.Value; foreach (TMP_Text pinNameLabel in GetPinNameLabels(Minimap.instance)) { pinNameLabel.fontSize = fontSize; } } private static IEnumerable GetPinNameLabels(Minimap minimap) { TMP_Text[] componentsInChildren = minimap.m_pinNamePrefab.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { yield return componentsInChildren[i]; } componentsInChildren = ((Component)minimap.m_pinNameRootLarge).GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { yield return componentsInChildren[i]; } } } public static class PinnacleUtils { public static void TogglePinnacle(bool toggleOn) { if (Object.op_Implicit((Object)(object)Minimap.instance) && Object.op_Implicit((Object)(object)Minimap.instance.m_largeRoot)) { PinEditPanelController.TogglePanel(); PinListPanelController.TogglePanel(toggleOn: false); PinFilterPanelController.TogglePanel(toggleOn); ToggleVanillaIconPanels(!toggleOn); } } public static void ToggleVanillaIconPanels(bool toggleOn) { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown if (!Object.op_Implicit((Object)(object)Minimap.instance) || !Object.op_Implicit((Object)(object)Minimap.instance.m_largeRoot)) { return; } foreach (Transform item in Minimap.instance.m_largeRoot.transform) { Transform val = item; if (((Object)val).name.StartsWith("IconPanel", StringComparison.InvariantCulture)) { ((Component)val).gameObject.SetActive(toggleOn); } } } public static void CenterMapOnOrTeleportTo(PinData targetPin) { //IL_004e: Unknown result type (might be due to invalid IL or missing references) if (PluginConfig.IsModEnabled.Value && ((Terminal)Console.m_instance).IsCheatsEnabled() && Object.op_Implicit((Object)(object)Player.m_localPlayer) && ZInput.GetKey((KeyCode)304, true)) { TeleportTo(targetPin); return; } PinEditPanelController.TogglePanel(PluginConfig.PinListPanelEditPinOnRowClick.Value ? targetPin : null); CenterMapHelper.CenterMapOnPosition(targetPin.m_pos); } public static void TeleportTo(PinData targetPin) { //IL_0001: 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_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Invalid comparison between Unknown and I4 //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) Vector3 targetPosition = targetPin.m_pos; if ((int)targetPin.m_type == 10 && !targetPin.m_save && !targetPin.m_checked) { targetPosition = GetPlayerInfoPosition(targetPin); } TeleportTo(targetPosition); } public static Vector3 GetPlayerInfoPosition(PinData targetPin) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: 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_0085: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004d: 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_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: 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) string name = targetPin.m_name; foreach (PlayerInfo player in ZNet.m_instance.m_players) { if (player.m_name == name && player.m_publicPosition) { Pinnacle.LogInfo($"Found PlayerInfo for {player.m_name}: {targetPin.m_pos:F0} -> {player.m_position:F0}"); return player.m_position; } } return targetPin.m_pos; } public static void TeleportTo(Vector3 targetPosition) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) Player localPlayer = Player.m_localPlayer; if (!Object.op_Implicit((Object)(object)localPlayer)) { Pinnacle.LogWarning("No local Player found."); return; } if (Mathf.Approximately(targetPosition.y, 0f)) { targetPosition.y = GetHeight(targetPosition); } Pinnacle.LogInfo($"Teleporting player from {((Component)localPlayer).transform.position:F0} to {targetPosition:F0}."); ((Character)localPlayer).TeleportTo(targetPosition, ((Component)localPlayer).transform.rotation, true); Minimap.instance.SetMapMode((MapMode)1); } public static float GetHeight(Vector3 targetPosition) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) float num = default(float); if (!Heightmap.GetHeight(targetPosition, ref num)) { num = GetHeightmapData(targetPosition).m_baseHeights[0]; } return Mathf.Max(0f, num); } public static HMBuildData GetHeightmapData(Vector3 targetPosition) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown HMBuildData val = new HMBuildData(targetPosition, 1, 1f, false, WorldGenerator.m_instance); HeightmapBuilder.m_instance.Build(val); return val; } public static PinData AddNewPin(Minimap minimap, Vector3 targetPosition) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0022: 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) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) if (Mathf.Approximately(targetPosition.y, 0f)) { targetPosition.y = GetHeight(targetPosition); } return minimap.AddPin(targetPosition, minimap.m_selectedType, string.Empty, true, false, 0L, default(PlatformUserID)); } public static PinData AddQuickMapPin(Minimap minimap, Vector3 targetPosition) { //IL_0001: 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_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) return minimap.AddPin(targetPosition, PluginConfig.QuickMapPinDefaultPinType.Value, PluginConfig.QuickMapPinDefaultName.Value, true, false, 0L, default(PlatformUserID)); } } public sealed class LabelButton { public GameObject Container { get; private set; } public RectTransform RectTransform { get; private set; } public TextMeshProUGUI Label { get; private set; } public Button Button { get; private set; } public LabelButton(Transform parentTransform) { Container = CreateContainer(parentTransform); RectTransform = Container.GetComponent(); Label = CreateLabel(Container.transform); Button = CreateButton(Container); } private static GameObject CreateContainer(Transform parentTransform) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0060: 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_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0092: 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_00b2: Expected O, but got Unknown GameObject val = new GameObject("Button", new Type[1] { typeof(RectTransform) }); val.transform.SetParent(parentTransform, false); val.AddComponent().SetType((Type)1).SetSprite(UIResources.GetSprite("button")) .SetColor(Color.white); val.GetComponent().SetAnchorMin(new Vector2(0.5f, 0.5f)).SetAnchorMax(new Vector2(0.5f, 0.5f)) .SetPivot(new Vector2(0.5f, 0.5f)) .SetPosition(Vector2.zero) .SetSizeDelta(new Vector2(120f, 45f)); return val; } private static TextMeshProUGUI CreateLabel(Transform parentTransform) { //IL_002b: 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_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) TextMeshProUGUI obj = UIBuilder.CreateTMPLabel(parentTransform); ((TMP_Text)obj.SetFontSize(16f).SetAlignment((TextAlignmentOptions)514)).SetText("Button"); ((TMP_Text)obj).rectTransform.SetAnchorMin(Vector2.zero).SetAnchorMax(Vector2.one).SetPivot(new Vector2(0.5f, 0.5f)) .SetPosition(Vector2.zero) .SetSizeDelta(Vector2.zero); return obj; } private static Button CreateButton(GameObject container) { //IL_000f: 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) Button obj = container.AddComponent