Please disclose if your mod was created primarily 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 PinAssistant v1.8.3
plugins/WxAxW.PinAssistant.dll
Decompiled 4 months 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.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; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Configuration; using HarmonyLib; using Jotunn; using Jotunn.Entities; using Jotunn.GUI; using Jotunn.Managers; using Jotunn.Utils; using Kits_Bitz.Under_The_Radar; using Newtonsoft.Json; using Pinnacle; using Splatform; using TMPro; using UnityEngine; using UnityEngine.Events; using UnityEngine.SceneManagement; using UnityEngine.UI; using WxAxW.PinAssistant.Components; using WxAxW.PinAssistant.Configuration; using WxAxW.PinAssistant.Core; using WxAxW.PinAssistant.Integration; using WxAxW.PinAssistant.Patches; using WxAxW.PinAssistant.Utils; using neobotics.ValheimMods; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("WxAxWValheimMods")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("WxAxWValheimMods")] [assembly: AssemblyCopyright("Copyright © 2021")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("e3243d22-4307-4008-ba36-9f326008cde5")] [assembly: AssemblyFileVersion("0.0.1.0")] [assembly: IgnoresAccessChecksTo("AutoMapPins")] [assembly: IgnoresAccessChecksTo("HUDCompass")] [assembly: IgnoresAccessChecksTo("Kits_Bitz.Under_The_Radar")] [assembly: IgnoresAccessChecksTo("Pinnacle")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.1.0")] [module: UnverifiableCode] namespace WxAxW.PinAssistant { [BepInPlugin("WxAxW.PinAssistant", "PinAssistant", "1.8.3")] [BepInDependency(/*Could not decode attribute arguments.*/)] internal class Plugin : BaseUnityPlugin { [CompilerGenerated] private sealed class <StartAutoPinCoroutine>d__18 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <StartAutoPinCoroutine>d__18(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown int num = <>1__state; if (num != 0) { if (num != 1) { return false; } <>1__state = -1; } else { <>1__state = -1; } TrackingHandler.Instance.PinLookedObject(ModConfig.Instance.LookDistanceConfig.Value); <>2__current = (object)new WaitForSeconds(ModConfig.Instance.TickRateConfig.Value); <>1__state = 1; return true; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public const string PluginGUID = "WxAxW.PinAssistant"; public const string PluginName = "PinAssistant"; public const string PluginVersion = "1.8.3"; public static CustomLocalization Localization = LocalizationManager.Instance.GetLocalization(); public static Plugin m_instance; public bool m_isInGame; private readonly Harmony harmony = new Harmony("WxAxW.PinAssistant"); private Coroutine m_coroutineAutoPin; private AssetBundle m_assetBundle; private List<PluginComponent> pluginComponents; public static Plugin Instance => m_instance; public static event Action PluginSceneChanged; private void Awake() { if ((Object)(object)m_instance == (Object)null) { m_instance = this; } ModConfig.Init(((BaseUnityPlugin)this).Config); m_assetBundle = AssetUtils.LoadAssetBundleFromResources("pin_assistant_bundle"); ModConfig.Instance.IsEnabledConfig.SettingChanged += OnTogglePluginConfig; SceneManager.sceneLoaded += OnSceneChange; SceneManager.sceneLoaded += GUIManagerExtension.InitialTMPLoad; MinimapManager.OnVanillaMapAvailable += LoadMinimapFilterUI; MinimapManager.OnVanillaMapAvailable += UpdateMinimapMinZoom; pluginComponents = new List<PluginComponent> { PinHandler.Instance, TrackingHandler.Instance, PinGroupHandler.Instance, PinFilterHandler.Instance }; foreach (PluginComponent pluginComponent in pluginComponents) { pluginComponent.Start(); } PatchAll(); WxAxW.PinAssistant.Utils.Debug.Log(TextType.PLUGIN_ENABLED); ((Behaviour)this).enabled = false; } private void Update() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0071: 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_00a3: 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) KeyboardShortcut value = ModConfig.Instance.TrackLookedObjectConfig.Value; if (((KeyboardShortcut)(ref value)).IsDown() && !FilterPinsUI.Instance.IsFocused) { TrackingHandler.Instance.LookAt(ModConfig.Instance.LookDistanceConfig.Value, out var id, out var _); if ((Object)(object)TrackObjectUI.Instance == (Object)null) { WxAxW.PinAssistant.Utils.Debug.Error("Track Object UI did not initialize correctly!"); } else { TrackObjectUI.Instance.SetupTrackObject(id); } } value = ModConfig.Instance.PinLookedObjectConfig.Value; if (((KeyboardShortcut)(ref value)).IsDown()) { TrackingHandler.Instance.PinLookedObject(ModConfig.Instance.LookDistanceConfig.Value); } value = ModConfig.Instance.ReloadTrackedObjectsConfig.Value; if (((KeyboardShortcut)(ref value)).IsDown()) { TrackingHandler.Instance.DeserializeTrackedObjects(ModConfig.Instance.TrackedObjectsConfig.Value); } } private void OnDestroy() { harmony.UnpatchSelf(); ModConfig.Instance.IsEnabledConfig.SettingChanged -= OnTogglePluginConfig; SceneManager.sceneLoaded -= OnSceneChange; GUIManager.OnCustomGUIAvailable -= LoadTrackObjectUI; MinimapManager.OnVanillaMapAvailable -= LoadMinimapFilterUI; foreach (PluginComponent pluginComponent in pluginComponents) { pluginComponent.Destroy(); } WxAxW.PinAssistant.Utils.Debug.Log(TextType.PLUGIN_DISABLED); } [IteratorStateMachine(typeof(<StartAutoPinCoroutine>d__18))] private IEnumerator StartAutoPinCoroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <StartAutoPinCoroutine>d__18(0); } private void PatchAll() { harmony.PatchAll(typeof(MinimapPatches)); if (ModExists("Pinnacle")) { WxAxW.PinAssistant.Utils.Debug.Log("Pinnacle exists patching mod for compatibility"); harmony.PatchAll(typeof(PinnaclePatches)); } if (ModExists("Kits_Bitz.Under_The_Radar")) { WxAxW.PinAssistant.Utils.Debug.Log("Under_The_Radar exists patching mod for compatibility"); harmony.PatchAll(typeof(UnderTheRadarPatches)); } if (ModExists("HUDCompass")) { WxAxW.PinAssistant.Utils.Debug.Log("HUDCompass exists patching mod for compatibility"); harmony.PatchAll(typeof(HUDCompassPatches)); } } private void OnEnable() { WxAxW.PinAssistant.Utils.Debug.Log(TextType.MOD_ENABLED); foreach (PluginComponent pluginComponent in pluginComponents) { pluginComponent.enabled = true; } if ((Object)(object)TrackObjectUI.Instance != (Object)null) { ((Behaviour)TrackObjectUI.Instance).enabled = true; } if ((Object)(object)FilterPinsUI.Instance != (Object)null) { ((Behaviour)FilterPinsUI.Instance).enabled = true; } ModConfig.Instance.IsAutoPinningEnabledConfig.SettingChanged += OnToggleAutoPinningConfig; ModConfig.Instance.MaxZoomMultiplier.SettingChanged += OnMaxZoomMultiplierConfig; } private void OnDisable() { WxAxW.PinAssistant.Utils.Debug.Log(TextType.MOD_DISABLED); foreach (PluginComponent pluginComponent in pluginComponents) { pluginComponent.enabled = false; } if ((Object)(object)TrackObjectUI.Instance != (Object)null) { ((Behaviour)TrackObjectUI.Instance).enabled = false; } if ((Object)(object)FilterPinsUI.Instance != (Object)null) { ((Behaviour)FilterPinsUI.Instance).enabled = false; } ModConfig.Instance.IsAutoPinningEnabledConfig.SettingChanged -= OnToggleAutoPinningConfig; ModConfig.Instance.MaxZoomMultiplier.SettingChanged -= OnMaxZoomMultiplierConfig; } private void ModToggle() { bool enabled = ModConfig.Instance.IsEnabledConfig.Value && m_isInGame; ((Behaviour)this).enabled = enabled; UpdateMinimapMinZoom(); ToggleAutoPinning(); } private void OnSceneChange(Scene scene, LoadSceneMode mode) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) WxAxW.PinAssistant.Utils.Debug.Log(TextType.SCENE_CHANGE, ((Scene)(ref scene)).name); Scene activeScene = SceneManager.GetActiveScene(); m_isInGame = ((Scene)(ref activeScene)).name.Equals("main"); ModToggle(); TryLoadTrackObjectUI(); } private void ToggleAutoPinning() { if (!((Behaviour)this).enabled || !ModConfig.Instance.IsAutoPinningEnabledConfig.Value) { if (m_coroutineAutoPin != null) { ((MonoBehaviour)this).StopCoroutine(m_coroutineAutoPin); m_coroutineAutoPin = null; } } else if (m_coroutineAutoPin == null) { m_coroutineAutoPin = ((MonoBehaviour)this).StartCoroutine("StartAutoPinCoroutine"); } } private void UpdateMinimapMinZoom() { if (!((Object)(object)Minimap.instance == (Object)null)) { float num = 0.01f; float value = ModConfig.Instance.MaxZoomMultiplier.Value; if (((Behaviour)this).enabled && value != 0f) { num /= value; } Minimap.instance.m_minZoom = num; } } private void TryLoadTrackObjectUI() { if (!((Object)(object)TrackObjectUI.Instance != (Object)null) && (m_isInGame || ModConfig.Instance.IsDebugModeConfig.Value)) { if ((Object)(object)GUIManager.CustomGUIFront == (Object)null) { GUIManager.OnCustomGUIAvailable += LoadTrackObjectUI; } else { LoadTrackObjectUI(); } } } private void LoadTrackObjectUI() { GUIManager.OnCustomGUIAvailable -= LoadTrackObjectUI; TrackObjectUI.Init(m_assetBundle); } private void LoadMinimapFilterUI() { FilterPinsUI.Init(m_assetBundle, ModConfig.Instance.IsSearchWindowEnabledConfig.Value); } private void OnTogglePluginConfig(object sender, EventArgs e) { ModToggle(); } private void OnToggleAutoPinningConfig(object sender, EventArgs e) { ToggleAutoPinning(); } private void OnMaxZoomMultiplierConfig(object sender, EventArgs e) { UpdateMinimapMinZoom(); } private bool ModExists(string assemblyName) { try { Assembly.Load(assemblyName); return true; } catch (Exception) { return false; } } private void PrintLayerNames() { if (ModConfig.Instance.IsDebugModeConfig.Value) { int num = 32; for (int i = 0; i < num; i++) { string text = LayerMask.LayerToName(i); WxAxW.PinAssistant.Utils.Debug.Log("Layer " + i + ": " + text); } } } } internal static class VersionInfo { public const string Current = "1.8.3"; } } namespace WxAxW.PinAssistant.Utils { internal static class Debug { public static void Log(object message) { if (ModConfig.Instance.IsDebugModeConfig.Value) { Logger.LogInfo(message); } } public static string Log(TextType messageType, params object[] parameters) { string text = TextAttribute.Get(messageType, parameters); if (ModConfig.Instance.IsDebugModeConfig.Value) { Logger.LogInfo((object)text); } return text; } public static void Warning(object message) { Logger.LogWarning(message); } public static string Warning(TextType messageType, params object[] parameters) { string text = TextAttribute.Get(messageType, parameters); Logger.LogWarning((object)text); return text; } public static void Error(object message) { Logger.LogError(message); } } internal static class DictionaryExtensions { public static bool ChangeKey<TKey, TValue>(this IDictionary<TKey, TValue> dict, TKey oldKey, TKey newKey) { if (!dict.TryGetValue(oldKey, out var value)) { return false; } dict.Remove(oldKey); dict.Add(newKey, value); return true; } } internal static class TMPDropdownExtensions { public static void AddOptionWithList<T>(this TMP_Dropdown dropDown, string optionName, List<T> list, T value) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown dropDown.options.Add(new OptionData(optionName)); list.Add(value); } } internal static class GUIManagerExtension { private static readonly FieldInfo privateFieldInfoGUIInStart = typeof(GUIManager).GetField("GUIInStart", BindingFlags.Instance | BindingFlags.NonPublic); private static bool GUIInStart; public static readonly List<Sprite> m_mapIcons = new List<Sprite>(); public static TMP_FontAsset AveriaSerif { get; set; } public static TMP_FontAsset TMPNorse { get; set; } public static void InitialTMPLoad(this GUIManager @this, Scene scene, LoadSceneMode loadMode) { if (!(((Scene)(ref scene)).name != "start")) { TMP_FontAsset[] source = Resources.FindObjectsOfTypeAll<TMP_FontAsset>(); AveriaSerif = ((IEnumerable<TMP_FontAsset>)source).FirstOrDefault((Func<TMP_FontAsset, bool>)((TMP_FontAsset x) => ((Object)x).name == "Valheim-AveriaSerifLibre")); TMPNorse = ((IEnumerable<TMP_FontAsset>)source).FirstOrDefault((Func<TMP_FontAsset, bool>)((TMP_FontAsset x) => ((Object)x).name == "Valheim-Norse")); if ((Object)(object)AveriaSerif == (Object)null || (Object)(object)TMPNorse == (Object)null) { throw new Exception("Fonts not found"); } SceneManager.sceneLoaded -= InitialTMPLoad; } } public static void UpdateGUIInStart(this GUIManager @this) { GUIInStart = (bool)privateFieldInfoGUIInStart.GetValue(@this); } public static void ApplyTMPTextStyle(this GUIManager @this, TMP_Text text, TMP_FontAsset font, Color color, int fontSize = 16, bool createOutline = true) { //IL_0011: 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) text.font = font; text.fontSize = fontSize; ((Graphic)text).color = color; text.fontStyle = (FontStyles)1; if (createOutline) { ((Shadow)ExposedGameObjectExtension.GetOrAddComponent<Outline>(((Component)text).gameObject)).effectColor = Color.black; } } public static void ApplyTMPTextStyle(this GUIManager @this, TMP_Text text, Color color, int fontSize = 16, bool createOutline = true) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) @this.ApplyTMPTextStyle(text, AveriaSerif, color, fontSize, createOutline); } public static void ApplyTMPTextStyle(this GUIManager @this, TMP_Text text, int fontSize = 16) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) @this.ApplyTMPTextStyle(text, AveriaSerif, Color.white, fontSize); } public static void ApplyTMPButtonStyle(this GUIManager @this, Button button, int fontSize = 16) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) @this.ApplyButtonStyle(button, fontSize); TMP_Text componentInChildren = ((Component)button).GetComponentInChildren<TMP_Text>(true); if (Object.op_Implicit((Object)(object)componentInChildren)) { @this.ApplyTMPTextStyle(componentInChildren, @this.ValheimOrange, fontSize); componentInChildren.alignment = (TextAlignmentOptions)514; } } [Obsolete("Only here for backward compat")] public static void ApplyTMPInputFieldStyle(this GUIManager @this, TMP_InputField field) { @this.ApplyTMPInputFieldStyle(field, 16); } public static void ApplyTMPInputFieldStyle(this GUIManager @this, TMP_InputField field, int fontSize = 16) { @this.ApplyTMPInputFieldStyle(field, AveriaSerif, fontSize); } public static void ApplyTMPInputFieldStyle(this GUIManager @this, TMP_InputField field, TMP_FontAsset font, int fontSize = 16) { //IL_0016: 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_008f: Unknown result type (might be due to invalid IL or missing references) @this.UpdateGUIInStart(); Graphic targetGraphic = ((Selectable)field).targetGraphic; Image val = (Image)(object)((targetGraphic is Image) ? targetGraphic : null); if (val != null) { ((Graphic)val).color = Color.white; val.sprite = @this.GetSprite("text_field"); val.pixelsPerUnitMultiplier = (GUIInStart ? 2f : 1f); } Graphic placeholder = field.placeholder; TMP_Text val2 = (TMP_Text)(object)((placeholder is TMP_Text) ? placeholder : null); if (val2 != null) { val2.font = font; val2.fontStyle = (FontStyles)3; ((Graphic)val2).color = Color.grey; val2.fontSize = fontSize; } if (Object.op_Implicit((Object)(object)field.textComponent)) { @this.ApplyTMPTextStyle(field.textComponent, font, Color.white, fontSize); } } public static void ApplyTMPDropdownStyle(this GUIManager @this, TMP_Dropdown dropdown, int fontSize = 16) { //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) @this.UpdateGUIInStart(); ((Component)dropdown).gameObject.layer = 5; if ((Object)(object)dropdown.template != (Object)null) { ((Component)dropdown.template).gameObject.layer = 5; } if (Object.op_Implicit((Object)(object)dropdown.captionText)) { @this.ApplyTMPTextStyle(dropdown.captionText, fontSize); } if (Object.op_Implicit((Object)(object)dropdown.itemText)) { @this.ApplyTMPTextStyle(dropdown.itemText, fontSize); } Image val = default(Image); if (((Component)dropdown).TryGetComponent<Image>(ref val)) { val.sprite = @this.GetSprite("text_field"); val.pixelsPerUnitMultiplier = (GUIInStart ? 2f : 1f); } GameObject gameObject = ((Component)((Component)dropdown).transform.Find("Arrow")).gameObject; gameObject.transform.localRotation = Quaternion.Euler(new Vector3(0f, 0f, 180f)); Image val2 = default(Image); if (gameObject.TryGetComponent<Image>(ref val2)) { gameObject.SetSize(25f, 25f); val2.sprite = @this.GetSprite("map_marker"); ((Graphic)val2).color = Color.white; val2.pixelsPerUnitMultiplier = (GUIInStart ? 2f : 1f); } ScrollRect val3 = default(ScrollRect); if (Object.op_Implicit((Object)(object)dropdown.template) && ((Component)dropdown.template).TryGetComponent<ScrollRect>(ref val3)) { @this.ApplyScrollRectStyle(val3); } Image val4 = default(Image); if (Object.op_Implicit((Object)(object)dropdown.template) && ((Component)dropdown.template).TryGetComponent<Image>(ref val4)) { val4.sprite = @this.GetSprite("button_small"); ((Graphic)val4).color = Color.white; val4.pixelsPerUnitMultiplier = (GUIInStart ? 2f : 1f); } GameObject gameObject2 = ((Component)((Transform)dropdown.template).Find("Viewport/Content/Item")).gameObject; Toggle val5 = default(Toggle); if (Object.op_Implicit((Object)(object)gameObject2) && gameObject2.TryGetComponent<Toggle>(ref val5)) { val5.toggleTransition = (ToggleTransition)0; ((Selectable)val5).colors = @this.ValheimToggleColorBlock; Toggle obj = val5; SpriteState spriteState = default(SpriteState); ((SpriteState)(ref spriteState)).highlightedSprite = @this.GetSprite("button_highlight"); ((Selectable)obj).spriteState = spriteState; Graphic targetGraphic = ((Selectable)val5).targetGraphic; Image val6 = (Image)(object)((targetGraphic is Image) ? targetGraphic : null); if (val6 != null) { ((Behaviour)val6).enabled = false; } Graphic graphic = val5.graphic; Image val7 = (Image)(object)((graphic is Image) ? graphic : null); if (val7 != null) { val7.sprite = @this.GetSprite("checkbox_marker"); ((Graphic)val7).color = Color.white; val7.type = (Type)0; ((MaskableGraphic)val7).maskable = true; val7.pixelsPerUnitMultiplier = (GUIInStart ? 2f : 1f); ((Shadow)ExposedGameObjectExtension.GetOrAddComponent<Outline>(((Component)val7).gameObject)).effectColor = Color.black; } } } public static void ApplyTMPToggleStyle(this GUIManager @this, Toggle toggle, int fontSize = 16) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) @this.ApplyToogleStyle(toggle); TMP_Text componentInChildren = ((Component)toggle).GetComponentInChildren<TMP_Text>(true); if (Object.op_Implicit((Object)(object)componentInChildren)) { @this.ApplyTMPTextStyle(componentInChildren, @this.ValheimOrange, fontSize); componentInChildren.alignment = (TextAlignmentOptions)513; } } internal static GameObject SetSize(this GameObject go, float width, float height) { RectTransform component = go.GetComponent<RectTransform>(); component.SetSizeWithCurrentAnchors((Axis)0, width); component.SetSizeWithCurrentAnchors((Axis)1, height); return go; } } [Serializable] public class LooseDictionary<TValue> where TValue : IComparable<TValue> { public class TraverseDetails { public string searchKey; public string originalKey; public TValue value; public TrieNode nodeResult; public string actualKey; public bool conflicting; public string blackListedWord; public bool deleteMode; public bool exactMatchOnly; public StringBuilder keyBuilder = new StringBuilder(); public TValue conflictingNodeValue; public bool endOfDeleteTraversal; public TraverseDetails(string searchKey, TValue value = default(TValue), string actualKey = "", string blackListedWord = "", bool deleteMode = false, bool exactMatchOnly = false) { this.searchKey = searchKey; originalKey = searchKey; this.value = value; this.actualKey = actualKey; this.blackListedWord = blackListedWord; this.deleteMode = deleteMode; this.exactMatchOnly = exactMatchOnly; } } public class TrieNode : IComparable<TrieNode> { private readonly Dictionary<char, TrieNode> m_children = new Dictionary<char, TrieNode>(); private TValue m_value; private bool m_nodeExactMatchOnly; private string m_blackListWord = ""; public TValue Value { get { return m_value; } set { m_value = value; } } public bool NodeExactMatchOnly { get { return m_nodeExactMatchOnly; } set { m_nodeExactMatchOnly = value; } } public string BlackListWord { get { return m_blackListWord; } set { m_blackListWord = value; } } public TrieNode() { } public TrieNode(TValue value, bool nodeExactMatchOnly, string blackListWord) { SetValues(value, nodeExactMatchOnly, blackListWord); } public TrieNode Clone() { return new TrieNode(m_value, m_nodeExactMatchOnly, m_blackListWord); } public bool AddNode(string key, TrieNode nodeToAdd, bool forceAdd = false) { char key2 = key[0]; if (key.Length > 1) { string key3 = key.Substring(1); if (!m_children.TryGetValue(key2, out var value)) { value = new TrieNode(); m_children.Add(key2, value); } return value.AddNode(key3, nodeToAdd, forceAdd); } if (m_children.TryGetValue(key2, out var value2)) { if (!forceAdd) { return false; } value2.SetValues(nodeToAdd); } else { m_children.Add(key2, nodeToAdd); } return true; } public void Remove(char childNodeKey, TraverseDetails td) { TrieNode trieNode = m_children[childNodeKey]; trieNode.ResetValues(); if (trieNode.m_children.Count != 0) { td.endOfDeleteTraversal = true; } else { m_children.Remove(childNodeKey); } } public void Clear() { m_children.Clear(); m_value = default(TValue); m_nodeExactMatchOnly = false; m_blackListWord = ""; } public bool TraverseRecursive(TraverseDetails td, int currentIndex = 0) { if (currentIndex >= td.searchKey.Length) { return false; } char c = td.searchKey[currentIndex]; td.keyBuilder.Append(c); if (!m_children.TryGetValue(c, out var value)) { td.keyBuilder.Clear(); return false; } if (IsNodeValid(value, td.originalKey, currentIndex, td.exactMatchOnly)) { td.value = value.m_value; td.nodeResult = value; td.actualKey = td.keyBuilder.ToString(); if (td.deleteMode) { Remove(c, td); return true; } td.conflicting = CheckChildrenValid(td.searchKey, td.exactMatchOnly); return true; } if (!value.TraverseRecursive(td, currentIndex + 1)) { return false; } if (td.deleteMode && !td.endOfDeleteTraversal) { Remove(c, td); } return true; } private bool IsNodeValid(TrieNode nodeToCheck, string key, int currentIndex, bool exactMatchOnly = false) { if (nodeToCheck.m_value == null || ((nodeToCheck.m_nodeExactMatchOnly || exactMatchOnly) && currentIndex != key.Length - 1) || (!string.IsNullOrEmpty(nodeToCheck.m_blackListWord) && key.IndexOf(nodeToCheck.m_blackListWord, StringComparison.OrdinalIgnoreCase) != -1)) { return false; } return true; } private void FindAllNodeValues(List<TrieNode> allValues) { foreach (TrieNode value in m_children.Values) { allValues.Add(value); value.FindAllNodeValues(allValues); } } private bool CheckChildrenValid(string key, bool exactMatch) { if (exactMatch) { return false; } List<TrieNode> list = new List<TrieNode>(); FindAllNodeValues(list); for (int i = 0; i < list.Count; i++) { TrieNode trieNode = list[i]; if (trieNode.m_value != null && !trieNode.m_nodeExactMatchOnly && (string.IsNullOrEmpty(trieNode.m_blackListWord) || key.IndexOf(trieNode.m_blackListWord, StringComparison.OrdinalIgnoreCase) == -1)) { return true; } } return false; } public bool TryGetValueRecursiveLite(string key, string originalKey, out TValue result, int currentIndex = 0) { result = default(TValue); if (currentIndex >= key.Length) { return false; } char key2 = key[currentIndex]; if (!m_children.TryGetValue(key2, out var value)) { return false; } if (IsNodeValid(value, originalKey, currentIndex)) { result = value.m_value; return true; } return value.TryGetValueRecursiveLite(key, originalKey, out result, currentIndex + 1); } public void SetValues(TrieNode nodeToRetrieve) { SetValues(nodeToRetrieve.Value, nodeToRetrieve.NodeExactMatchOnly, nodeToRetrieve.BlackListWord); } public void SetValues(TraverseDetails td) { SetValues(td.value, td.exactMatchOnly, td.blackListedWord); } public void SetValues(TValue value, bool exactMatchOnly, string blackListedWord) { m_value = value; m_nodeExactMatchOnly = exactMatchOnly; m_blackListWord = blackListedWord; } private void ResetValues() { m_value = default(TValue); m_nodeExactMatchOnly = false; m_blackListWord = string.Empty; } public bool TraverseLooseRecursive(StringBuilder keyBuilder, TraverseDetails td, int currentIndex = 0, int nodeLength = 1) { if (currentIndex >= td.searchKey.Length) { return false; } bool flag = true; char c = td.searchKey[currentIndex]; keyBuilder.Append(c); if (!m_children.TryGetValue(c, out var value)) { if (td.exactMatchOnly) { return false; } value = this; keyBuilder.Clear(); flag = false; nodeLength--; } if (IsNodeValidLoose(value, td.searchKey, nodeLength, td.exactMatchOnly)) { td.value = value.m_value; td.nodeResult = value; td.actualKey = keyBuilder.ToString(); td.conflicting = CheckChildrenValid(td.searchKey, td.exactMatchOnly); if (td.deleteMode) { Remove(c, td); } return true; } bool flag2 = value.TraverseLooseRecursive(keyBuilder, td, currentIndex + 1, nodeLength + 1); if (flag && !flag2) { value = this; flag2 = value.TraverseLooseRecursive(keyBuilder, td, currentIndex + 1, nodeLength); keyBuilder.Clear(); } if (!flag2) { return false; } if (td.deleteMode && !td.endOfDeleteTraversal) { Remove(c, td); } return true; } public bool TryGetValueLooseRecursiveLite(string key, out TValue result, int currentIndex = 0, int nodeLength = 1) { result = default(TValue); if (currentIndex >= key.Length) { return false; } bool flag = true; char key2 = key[currentIndex]; if (!m_children.TryGetValue(key2, out var value)) { value = this; flag = false; nodeLength--; } if (IsNodeValidLoose(value, key, nodeLength)) { result = value.m_value; return true; } bool flag2 = value.TryGetValueLooseRecursiveLite(key, out result, currentIndex + 1, nodeLength + 1); if (flag && !flag2) { value = this; flag2 = value.TryGetValueLooseRecursiveLite(key, out result, currentIndex + 1, nodeLength); } return flag2; } private bool IsNodeValidLoose(TrieNode nodeToCheck, string key, int nodeLength, bool exactMatchOnly = false) { if (nodeToCheck.m_value == null || ((nodeToCheck.m_nodeExactMatchOnly || exactMatchOnly) && nodeLength != key.Length) || (!string.IsNullOrEmpty(nodeToCheck.m_blackListWord) && key.IndexOf(nodeToCheck.m_blackListWord, StringComparison.OrdinalIgnoreCase) != -1)) { return false; } return true; } public int CompareTo(TrieNode other) { return m_value.CompareTo(other.m_value); } } [JsonProperty("Version")] private readonly string m_version = "2.0"; private Dictionary<string, TrieNode> m_altDictionary = new Dictionary<string, TrieNode>(); private TrieNode root = new TrieNode(); [JsonProperty("Alternate Dictionary")] public Dictionary<string, TrieNode> AltDictionary { get { return m_altDictionary; } set { m_altDictionary = value; InitializeTrieFromDict(); } } public void InitializeTrieFromDict() { root = new TrieNode(); foreach (KeyValuePair<string, TrieNode> item in m_altDictionary) { root.AddNode(item.Key, item.Value, forceAdd: true); } } public bool Add(string key, TValue value, out bool conflicting, string blackListWord = "", bool exactMatchOnly = false) { key = key.ToLower(); conflicting = false; if (m_altDictionary.ContainsKey(key)) { return false; } TrieNode trieNode = new TrieNode(value, exactMatchOnly, blackListWord); TraverseDetails traverseDetails = new TraverseDetails(key, value, "", blackListWord, deleteMode: false, exactMatchOnly); if (!traverseDetails.exactMatchOnly) { conflicting = Traverse(traverseDetails); } root.AddNode(key, trieNode); m_altDictionary.Add(key, trieNode); return true; } public bool Modify(string key, TValue newValue, bool newNodeExact, string newBlackListWord) { key = key.ToLower(); if (!m_altDictionary.TryGetValue(key, out var value)) { return false; } value.SetValues(newValue, newNodeExact, newBlackListWord); return true; } public bool ChangeKey(string key, string newKey, out bool conflicting, out TValue conflictingValue) { key = key.ToLower(); newKey = newKey.ToLower(); conflicting = false; conflictingValue = default(TValue); if (key.Equals(newKey)) { return true; } if (m_altDictionary.ContainsKey(newKey) || !m_altDictionary.TryGetValue(key, out var value)) { return false; } TrieNode trieNode = value.Clone(); m_altDictionary.Remove(key); m_altDictionary.Add(newKey, trieNode); RemoveNode(key); string searchKey = key; bool nodeExactMatchOnly = trieNode.NodeExactMatchOnly; TraverseDetails traverseDetails = new TraverseDetails(searchKey, default(TValue), "", "", deleteMode: false, nodeExactMatchOnly); Traverse(traverseDetails); conflicting = traverseDetails.conflicting; conflictingValue = traverseDetails.value; root.AddNode(newKey, trieNode); return true; } public bool Remove(string key) { key = key.ToLower(); if (!m_altDictionary.Remove(key)) { return false; } RemoveNode(key); return true; } public void SortTrackedObjects() { List<KeyValuePair<string, TrieNode>> source = m_altDictionary.OrderBy((KeyValuePair<string, TrieNode> kvp) => kvp.Value).ToList(); m_altDictionary = source.ToDictionary((KeyValuePair<string, TrieNode> kvp) => kvp.Key, (KeyValuePair<string, TrieNode> kvp) => kvp.Value); } public void Clear() { if (m_altDictionary.Count != 0) { m_altDictionary.Clear(); root.Clear(); } } public bool TryGetValueLoose(string key, out TValue value, bool exactMatch = false) { key = key.ToLower(); value = default(TValue); if (m_altDictionary.TryGetValue(key, out var value2)) { value = value2.Value; return true; } if (exactMatch) { return false; } TraverseDetails traverseDetails = new TraverseDetails(key); bool result = Traverse(traverseDetails); value = traverseDetails.value; return result; } public bool RemoveNode(string key) { TraverseDetails traverseDetails = new TraverseDetails(key, default(TValue), "", "", deleteMode: true, exactMatchOnly: true); return Traverse(traverseDetails); } public bool TryGetNodeLoose(string key, out TrieNode nodeResult) { TraverseDetails traverseDetails = new TraverseDetails(key); bool result = Traverse(traverseDetails); nodeResult = traverseDetails.nodeResult; return result; } public bool TryGetValueLooseLite(string key, out TValue result) { result = default(TValue); key = key.ToLower(); if (m_altDictionary.TryGetValue(key, out var value)) { result = value.Value; return true; } for (int i = 0; i < key.Length; i++) { string key2 = key.Substring(i); if (root.TryGetValueRecursiveLite(key2, key, out result)) { return true; } } return false; } public bool Traverse(TraverseDetails traverseDetails) { if (traverseDetails.exactMatchOnly) { return root.TraverseRecursive(traverseDetails); } string searchKey = traverseDetails.searchKey; for (int i = 0; i < traverseDetails.searchKey.Length; i++) { traverseDetails.searchKey = searchKey.Substring(i); if (root.TraverseRecursive(traverseDetails)) { return true; } } return false; } } } namespace WxAxW.PinAssistant.Patches { [HarmonyPatch(typeof(Minimap))] internal class MinimapPatches { public static bool isSpecialPin = false; public static bool isManualPin = false; public static PinData m_edittingPinInitial = new PinData(); public static PinData m_edittingPinCurrent; public static event Action<PinData> OnPinAdd; public static event Action<PinData> OnPinRemove; public static event Action OnPinClear; public static event Action<PinData> OnPinSetTarget; public static event Action<PinData, PinData> OnPinUpdate; public static event Action OnMinimapUpdatePins; [HarmonyPostfix] [HarmonyPatch("AddPin")] private static void Postfix(ref PinData __result) { MinimapPatches.OnPinAdd?.Invoke(__result); isSpecialPin = false; isManualPin = false; } [HarmonyPrefix] [HarmonyPatch("RemovePin", new Type[] { typeof(PinData) })] private static void Prefix(ref PinData pin) { MinimapPatches.OnPinRemove?.Invoke(pin); } [HarmonyPrefix] [HarmonyPatch("ClearPins")] private static void PrefixClearPins() { MinimapPatches.OnPinClear?.Invoke(); } [HarmonyPostfix] [HarmonyPatch("UpdatePins")] private static void PostFixUpdatePins() { MinimapPatches.OnMinimapUpdatePins?.Invoke(); } [HarmonyPrefix] [HarmonyPatch("ShowPinNameInput")] private static void ShowPinNameInputPrefix() { isManualPin = true; WxAxW.PinAssistant.Utils.Debug.Log("Manual pin added"); } [HarmonyPostfix] [HarmonyPatch("ShowPinNameInput")] private static void PostFixShowPinNameInput(Minimap __instance, ref bool __runOriginal) { if (__runOriginal) { SetTargetPin(__instance.m_namePin); } } [HarmonyPrefix] [HarmonyPatch("HidePinTextInput")] private static void PrefixHidePinTextInput(Minimap __instance) { if (__instance.m_namePin != null) { WxAxW.PinAssistant.Utils.Debug.Log("New manual pin editted"); MinimapPatches.OnPinUpdate?.Invoke(m_edittingPinInitial, m_edittingPinCurrent); SetTargetPin(null); } } public static void SetTargetPin(PinData pinToSet) { if (pinToSet == m_edittingPinCurrent) { WxAxW.PinAssistant.Utils.Debug.Log("Editting same pin or no pin currently editting."); return; } if (pinToSet == null) { WxAxW.PinAssistant.Utils.Debug.Log("End editting pin, " + m_edittingPinCurrent.m_name); } else { WxAxW.PinAssistant.Utils.Debug.Log("Start editting pin, " + pinToSet.m_name); } m_edittingPinCurrent = pinToSet; CopyValues(m_edittingPinCurrent); MinimapPatches.OnPinSetTarget?.Invoke(m_edittingPinCurrent); } public static void UpdatePin() { MinimapPatches.OnPinUpdate?.Invoke(m_edittingPinInitial, m_edittingPinCurrent); CopyValues(m_edittingPinCurrent); } private static void CopyValues(PinData pin) { //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_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) if (pin != null) { m_edittingPinInitial.m_name = pin.m_name; m_edittingPinInitial.m_type = pin.m_type; m_edittingPinInitial.m_pos = pin.m_pos; } } [HarmonyTranspiler] [HarmonyPatch("DiscoverLocation")] [HarmonyPatch("UpdateProfilePins")] [HarmonyPatch("UpdateEventPin")] [HarmonyPatch("UpdateLocationPins")] [HarmonyPatch("UpdatePlayerPins")] [HarmonyPatch("UpdatePingPins")] [HarmonyPatch("UpdateShoutPins")] private static IEnumerable<CodeInstruction> TranspilerIgnoreNewPin(IEnumerable<CodeInstruction> instructions) { return ExcludePinsInMethod(instructions); } public static IEnumerable<CodeInstruction> ExcludePinsInMethod(IEnumerable<CodeInstruction> instructions, bool isVirtual = false) { return FindCall(instructions, useEnd: false, isVirtual, AccessTools.Method(typeof(Minimap), "AddPin", (Type[])null, (Type[])null)).Repeat((Action<CodeMatcher>)delegate(CodeMatcher matcher) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Expected O, but got Unknown //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown matcher.InsertAndAdvance((CodeInstruction[])(object)new CodeInstruction[2] { new CodeInstruction(OpCodes.Ldc_I4_1, (object)null), new CodeInstruction(OpCodes.Stsfld, (object)AccessTools.Field(typeof(MinimapPatches), "isSpecialPin")) }).Advance(1); }, (Action<string>)null).InstructionEnumeration(); } private static CodeMatcher FindCall(IEnumerable<CodeInstruction> instructions, bool useEnd, bool isVirtual, MethodInfo method) { //IL_0002: 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_002c: Expected O, but got Unknown return new CodeMatcher(instructions, (ILGenerator)null).MatchForward(useEnd, (CodeMatch[])(object)new CodeMatch[1] { new CodeMatch((OpCode?)(isVirtual ? OpCodes.Callvirt : OpCodes.Call), (object)method, (string)null) }); } } [HarmonyPatch(typeof(PinEditPanel))] internal class PinnaclePatches { [HarmonyPostfix] [HarmonyPatch("SetTargetPin")] private static void PostfixSetTargetPin(ref PinData pin) { MinimapPatches.SetTargetPin(pin); } [HarmonyPostfix] [HarmonyPatch("OnPinNameValueChange")] [HarmonyPatch("OnPinTypeValueChange")] private static void PostfixOnPinUpdate() { MinimapPatches.UpdatePin(); } } [HarmonyPatch(typeof(RadarPinComponent))] internal class UnderTheRadarPatches { [HarmonyTranspiler] [HarmonyPatch("Update")] private static IEnumerable<CodeInstruction> TranspilerIgnoreRadarPin(IEnumerable<CodeInstruction> instructions) { return MinimapPatches.ExcludePinsInMethod(instructions, isVirtual: true); } } [HarmonyPatch(typeof(HudUpdateCompassPatch))] public static class HUDCompassPatches { [HarmonyTranspiler] [HarmonyPatch("Prefix")] private static IEnumerable<CodeInstruction> TranspilerPrefix(IEnumerable<CodeInstruction> instructions) { //IL_0002: 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_0035: Expected O, but got Unknown //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Expected O, but got Unknown return new CodeMatcher(instructions, (ILGenerator)null).MatchForward(false, (CodeMatch[])(object)new CodeMatch[1] { new CodeMatch((OpCode?)OpCodes.Ldsfld, (object)AccessTools.Field(typeof(Cfg), "colorPins"), (string)null) }).RemoveInstructions(2).InsertAndAdvance((CodeInstruction[])(object)new CodeInstruction[2] { new CodeInstruction(OpCodes.Ldloc_S, (object)(byte)16), new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(HUDCompassHandler), "GetPinColor", (Type[])null, (Type[])null)) }) .InstructionEnumeration(); } } } namespace WxAxW.PinAssistant.Integration { internal class HUDCompassHandler { public static Color GetPinColor(PinData pin) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: 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_0024: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) Color color = PinGroupHandler.Instance.GetColor(pin); if (color == Color.white) { return Cfg.colorPins.Value; } return color; } } } namespace WxAxW.PinAssistant.Core { internal class PinFilterHandler : PluginComponent { private static PinFilterHandler m_instance = new PinFilterHandler(); private IEnumerable<PinData> m_listFilteredOutPinsQuery; private List<PinData> m_listFilteredOutPins; internal static PinFilterHandler Instance { get { return m_instance; } set { m_instance = value; } } public override void Start() { } public override void Destroy() { } public override void OnEnable() { MinimapPatches.OnPinAdd += OnPinAdd; MinimapPatches.OnPinSetTarget += OnPinSetup; MinimapPatches.OnMinimapUpdatePins += OnMinimapUpdatePins; } public override void OnDisable() { MinimapPatches.OnPinAdd -= OnPinAdd; MinimapPatches.OnPinSetTarget -= OnPinSetup; MinimapPatches.OnMinimapUpdatePins -= OnMinimapUpdatePins; ResetFilteredPins(); } public void SearchPins(string pinNameQuery, PinType pinTypeQuery, bool whitelist = false, bool isRegex = false) { //IL_0015: 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) ResetFilteredPins(); if (isRegex) { if (!IsRegexValid(pinNameQuery)) { return; } m_listFilteredOutPinsQuery = PinHandler.Instance.MonitoredPins.Values.Where(delegate(PinData pinData) { //IL_0019: 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) bool num2 = Regex.IsMatch(pinData.m_name, pinNameQuery, RegexOptions.IgnoreCase); bool flag3 = PinTypeMatches(pinData.m_type, pinTypeQuery); bool flag4 = num2 && flag3; return (!whitelist) ? flag4 : (!flag4); }); } else { bool isExact = IsExact(pinNameQuery, out pinNameQuery); m_listFilteredOutPinsQuery = PinHandler.Instance.MonitoredPins.Values.Where(delegate(PinData pinData) { //IL_0033: 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 num = CompareSearch(pinData.m_name, pinNameQuery, isExact); bool flag = PinTypeMatches(pinData.m_type, pinTypeQuery); bool flag2 = num && flag; return (!whitelist) ? flag2 : (!flag2); }); } m_listFilteredOutPins = m_listFilteredOutPinsQuery.ToList(); FilterOutPins(); } private bool IsRegexValid(string pinNameQuery) { try { Regex.Match("", pinNameQuery); return true; } catch (Exception) { WxAxW.PinAssistant.Utils.Debug.Warning("Invalid RegEx Pattern!"); return false; } } private bool IsExact(string pinNameQuery, out string trimmedString) { trimmedString = pinNameQuery; string pattern = "^\".*\"$"; bool flag = Regex.IsMatch(pinNameQuery, pattern) || string.IsNullOrEmpty(pinNameQuery); if (flag) { trimmedString = pinNameQuery.Trim(new char[1] { '"' }); } return flag; } private bool PinTypeMatches(PinType pinType, PinType pinTypeQuery) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Invalid comparison between Unknown and I4 //IL_0006: 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) if ((int)pinTypeQuery == 8) { return true; } return pinType == pinTypeQuery; } private bool CompareSearch(string foundPin, string query, bool isExact = false) { if (isExact) { return foundPin.Equals(query, StringComparison.OrdinalIgnoreCase); } return foundPin.IndexOf(query, StringComparison.OrdinalIgnoreCase) != -1; } public void ResetFilteredPins() { if (m_listFilteredOutPins != null) { FilterOutPins(renderPins: true); m_listFilteredOutPinsQuery = null; m_listFilteredOutPins = null; } } public void FilterOutPins(bool renderPins = false) { if (m_listFilteredOutPins == null) { return; } foreach (PinData listFilteredOutPin in m_listFilteredOutPins) { PinNameData namePinData = listFilteredOutPin.m_NamePinData; if (namePinData != null) { GameObject pinNameGameObject = namePinData.PinNameGameObject; if (pinNameGameObject != null) { pinNameGameObject.SetActive(renderPins); } } RectTransform uiElement = listFilteredOutPin.m_uiElement; if (uiElement != null) { ((Component)uiElement).gameObject.SetActive(renderPins); } } } public void ReplacePins(string oldPinsName, string newPinsName, PinType oldType, PinType newType, bool isRegex) { //IL_007b: 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_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Invalid comparison between Unknown and I4 //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) Minimap.instance.m_pinUpdateRequired = true; WxAxW.PinAssistant.Utils.Debug.Log("Renaming all matching pins"); if (isRegex && !IsRegexValid(oldPinsName)) { WxAxW.PinAssistant.Utils.Debug.Error("Invalid Regex pattern!"); return; } bool isExact = IsExact(oldPinsName, out oldPinsName); foreach (PinData value in PinHandler.Instance.MonitoredPins.Values) { if ((isRegex ? Regex.IsMatch(value.m_name, oldPinsName, RegexOptions.IgnoreCase) : CompareSearch(value.m_name, oldPinsName, isExact)) && PinTypeMatches(value.m_type, oldType)) { PinType newType2 = (((int)newType == 8) ? value.m_type : newType); PinGroupHandler.Instance.ModifyPin(value, newPinsName, newType2); } } UpdateFilteredOutPins(); } public void UpdateFilteredOutPins() { if (m_listFilteredOutPinsQuery != null) { Minimap.instance.m_pinUpdateRequired = true; m_listFilteredOutPins = m_listFilteredOutPinsQuery.ToList(); } } private void OnPinAdd(PinData pin) { if (!MinimapPatches.isSpecialPin && !MinimapPatches.isManualPin) { UpdateFilteredOutPins(); } } private void OnPinSetup(PinData pin) { if (pin == null) { UpdateFilteredOutPins(); } } private void OnMinimapUpdatePins() { FilterOutPins(); } } internal class PinGroup { private readonly List<PinData> m_pins = new List<PinData>(); private string m_pinName = string.Empty; private PinType m_pinType = (PinType)8; private Color m_pinColor; private Color m_pinColorShared; public List<PinData> Pins => m_pins; public string PinName => m_pinName; public PinType PinType => m_pinType; public Color PinColor { get { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return m_pinColor; } set { //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) //IL_0014: 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_002c: 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_003d: Unknown result type (might be due to invalid IL or missing references) m_pinColor = value; m_pinColorShared = new Color(value.r * 0.7f, value.g * 0.7f, value.b * 0.7f, value.a * 0.8f); ApplyColor(); } } public PinGroup(string pinName, PinType pinType, Color pinColor) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) SetValues(pinName, pinType, pinColor); } ~PinGroup() { WxAxW.PinAssistant.Utils.Debug.Log($"PinGroup, {m_pinName}, {m_pinType}, Destroyed!"); } public void TransferTo(PinGroup newPinGroup) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) List<PinData> pins = RemoveAll(); newPinGroup.AddRange(pins); Clear(); WxAxW.PinAssistant.Utils.Debug.Log($"Transferred, {m_pinName} | {m_pinType} to {newPinGroup.m_pinName} | {newPinGroup.m_pinType}"); } public void ApplyColor() { //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_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: 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_005e: Unknown result type (might be due to invalid IL or missing references) if (PinColor == Color.white) { return; } Color pinColorShared = m_pinColorShared; pinColorShared.a *= Minimap.instance.m_sharedMapDataFade; foreach (PinData pin in m_pins) { Image iconElement = pin.m_iconElement; if (!((Object)(object)iconElement == (Object)null)) { ((Graphic)iconElement).color = ((pin.m_ownerID == 0L) ? PinColor : pinColorShared); } } } public void ResetColor() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) PinColor = Color.white; } public void ModifyPinGroupPins(string newName, PinType newType) { //IL_004f: 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_0058: 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_0074: Unknown result type (might be due to invalid IL or missing references) if (!m_pinName.Equals(newName)) { m_pinName = newName; foreach (PinData pin in m_pins) { PinHandler.SetPinName(pin, m_pinName); } } if (m_pinType == newType) { return; } m_pinType = newType; foreach (PinData pin2 in m_pins) { PinHandler.SetPinType(pin2, m_pinType); } } public void Add(PinData pin) { m_pins.Add(pin); } public void AddRange(List<PinData> pins) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) PinHandler.SetPinsData(pins, m_pinName, m_pinType); ApplyColor(); m_pins.AddRange(pins); } public bool Remove(PinData pin) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) if (m_pins.Remove(pin)) { WxAxW.PinAssistant.Utils.Debug.Log($"Removed pin from group, {m_pinName} | {pin.m_type}"); return true; } return false; } public List<PinData> RemoveAll() { List<PinData> result = new List<PinData>(m_pins); Clear(); return result; } public void Clear() { m_pins.Clear(); } public void SetValues(string pinName, PinType pinType, Color pinColor) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) m_pinName = pinName; m_pinType = pinType; PinColor = pinColor; } } internal class PinGroupHandler : PluginComponent { private static PinGroupHandler m_instance = new PinGroupHandler(); private readonly Dictionary<string, PinGroup> m_pinGroups = new Dictionary<string, PinGroup>(); public static PinGroupHandler Instance { get { return m_instance; } private set { m_instance = value; } } public override void Start() { MinimapPatches.OnPinAdd += OnPinAdd; MinimapPatches.OnPinRemove += OnPinRemove; MinimapPatches.OnPinUpdate += OnPinUpdate; } public override void Destroy() { MinimapPatches.OnPinAdd -= OnPinAdd; MinimapPatches.OnPinRemove -= OnPinRemove; MinimapPatches.OnPinUpdate -= OnPinUpdate; m_instance = null; } public override void OnEnable() { OnTrackedObjectsReload(TrackingHandler.Instance.TrackedObjects); TrackingHandler.Instance.OnTrackedObjectAdd += OnTrackedObjectAdd; TrackingHandler.Instance.OnTrackedObjectRemove += OnTrackedObjectRemove; TrackingHandler.Instance.OnTrackedObjectUpdate += OnTrackedObjectUpdate; TrackingHandler.Instance.OnTrackedObjectsReload += OnTrackedObjectsReload; MinimapPatches.OnMinimapUpdatePins += OnMinimapUpdatePins; } public override void OnDisable() { TrackingHandler.Instance.OnTrackedObjectAdd -= OnTrackedObjectAdd; TrackingHandler.Instance.OnTrackedObjectRemove -= OnTrackedObjectRemove; TrackingHandler.Instance.OnTrackedObjectUpdate -= OnTrackedObjectUpdate; TrackingHandler.Instance.OnTrackedObjectsReload -= OnTrackedObjectsReload; MinimapPatches.OnMinimapUpdatePins -= OnMinimapUpdatePins; } public void ColorPins() { foreach (KeyValuePair<string, PinGroup> pinGroup in m_pinGroups) { pinGroup.Value.ApplyColor(); } } private void AddPinToGroup(PinData pin) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) InitOrGetPinGroup(pin, Color.white).Add(pin); } private PinGroup InitOrGetPinGroup(PinData newPin, Color pinColor) { //IL_000e: 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) return InitOrGetPinGroup(GetPinKey(newPin), newPin.m_name, newPin.m_type, pinColor); } private PinGroup InitOrGetPinGroup(string key, string pinName, PinType pinType, Color pinColor, bool forceChangeColor = false) { //IL_0021: 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_0053: Unknown result type (might be due to invalid IL or missing references) if (!m_pinGroups.TryGetValue(key, out var value)) { WxAxW.PinAssistant.Utils.Debug.Log("Created pin group for " + key); PinGroup pinGroup = new PinGroup(pinName, pinType, pinColor); m_pinGroups.Add(key, pinGroup); return pinGroup; } if (forceChangeColor) { WxAxW.PinAssistant.Utils.Debug.Log("Pin group named, '" + key + "' exists, Changing the color only instead."); value.PinColor = pinColor; } return value; } public void ModifyPin(PinData pinData, string newName, PinType newType) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) ModifyPin(pinData, pinData.m_name, newName, pinData.m_type, newType); } public void ModifyPin(PinData pinData, string oldName, string newName, PinType oldType, PinType newType) { //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_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) if (oldName.Equals(newName) && oldType == newType) { return; } WxAxW.PinAssistant.Utils.Debug.Log($"Modifying {oldName} | {oldType} to {newName} | {newType}"); string pinKey = GetPinKey(oldName, oldType); if (!m_pinGroups.TryGetValue(pinKey, out var value)) { WxAxW.PinAssistant.Utils.Debug.Error("Pin group not found, contact dev"); return; } if (!value.Remove(pinData)) { WxAxW.PinAssistant.Utils.Debug.Error("Pin not found in group, contact dev"); } if (!oldName.Equals(newName)) { PinHandler.SetPinName(pinData, newName); } if (!((object)(PinType)(ref oldType)).Equals((object?)newType)) { PinHandler.SetPinType(pinData, newType); } AddPinToGroup(pinData); } public void ModifyPinGroup(TrackedObject oldPinGroup, TrackedObject newPinGroup) { //IL_000e: 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) //IL_001a: 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) ModifyPinGroup(oldPinGroup.Name, newPinGroup.Name, oldPinGroup.Icon, newPinGroup.Icon, oldPinGroup.PinColor, newPinGroup.PinColor); } public void ModifyPinGroup(string oldPinsName, string newPinsName, PinType oldType, PinType newType, Color oldPinsColor, Color newPinsColor) { //IL_0011: 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) //IL_0014: 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_0009: 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) //IL_001e: 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_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) PinGroup value; if (!oldPinsName.Equals(newPinsName) || oldType != newType) { TransferPinGroup(oldPinsName, newPinsName, oldType, newType, oldPinsColor, newPinsColor); } else if (oldPinsColor == newPinsColor) { WxAxW.PinAssistant.Utils.Debug.Log("No changes detected in pin group, skipping modification."); } else if (!m_pinGroups.TryGetValue(GetPinKey(oldPinsName, oldType), out value)) { WxAxW.PinAssistant.Utils.Debug.Error("Pin group not found, contact dev"); } else { value.PinColor = newPinsColor; } } private void TransferPinGroup(string oldPinsName, string newPinsName, PinType oldType, PinType newType, Color oldPinsColor, Color newPinsColor) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Invalid comparison between Unknown and I4 //IL_0011: 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_004f: 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) if ((int)newType == 8) { WxAxW.PinAssistant.Utils.Debug.Error("How did you manage to do this. Transfer was not successful as the Pin Icon is set to \"None\"."); return; } string pinKey = GetPinKey(newPinsName, newType); string pinKey2 = GetPinKey(oldPinsName, oldType); if (!m_pinGroups.TryGetValue(pinKey2, out var value)) { WxAxW.PinAssistant.Utils.Debug.Error("Initial Pin Group does not exist, transfer was not successful."); return; } if (!m_pinGroups.TryGetValue(pinKey, out var value2)) { value2 = InitOrGetPinGroup(pinKey, newPinsName, newType, newPinsColor); } value.TransferTo(value2); value.ResetColor(); } public static string GetPinKey(PinData pinData) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) return GetPinKey(pinData.m_name, pinData.m_type); } public static string GetPinKey(string pinName, PinType pinType) { return pinName.ToLower() + "_" + ((object)(PinType)(ref pinType)).ToString(); } public Color GetColor(PinData pin) { //IL_001c: 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) if (!m_pinGroups.TryGetValue(GetPinKey(pin), out var value)) { return Color.white; } return value.PinColor; } private void OnPinAdd(PinData pin) { if (!MinimapPatches.isSpecialPin) { AddPinToGroup(pin); } } private void OnPinRemove(PinData pin) { if (m_pinGroups.TryGetValue(GetPinKey(pin), out var value)) { value.Remove(pin); } } private void OnPinUpdate(PinData oldPin, PinData newPin) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_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_0031: 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_0053: 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) if (newPin != null) { string name = oldPin.m_name; string name2 = newPin.m_name; PinType type = oldPin.m_type; PinType type2 = newPin.m_type; WxAxW.PinAssistant.Utils.Debug.Log($"Updating pin from, {name} | {type}, to {name2} | {type2}"); ModifyPin(newPin, name, name2, type, type2); } } private void OnMinimapUpdatePins() { ColorPins(); } private void OnTrackedObjectAdd(TrackedObject trackedObject) { //IL_0008: 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_000f: 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) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) string name = trackedObject.Name; PinType icon = trackedObject.Icon; Color pinColor = trackedObject.PinColor; WxAxW.PinAssistant.Utils.Debug.Log("Initializing pin name storage for tracked object, " + trackedObject.ObjectID + "."); string pinKey = GetPinKey(name, icon); InitOrGetPinGroup(pinKey, name, icon, pinColor, forceChangeColor: true); } private void OnTrackedObjectRemove(TrackedObject trackedObject) { //IL_0007: 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) string pinKey = GetPinKey(trackedObject.Name, trackedObject.Icon); if (!m_pinGroups.TryGetValue(pinKey, out var value)) { WxAxW.PinAssistant.Utils.Debug.Error("Failed to remove group, contact dev!"); return; } WxAxW.PinAssistant.Utils.Debug.Log("Removing color for " + trackedObject.ObjectID); value.PinColor = Color.white; } private void OnTrackedObjectUpdate(TrackedObject trackedObject, TrackedObject newTrackedObject, bool modifyPins) { //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_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_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0057: 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_0074: Unknown result type (might be due to invalid IL or missing references) string name = trackedObject.Name; PinType icon = trackedObject.Icon; string name2 = newTrackedObject.Name; PinType icon2 = newTrackedObject.Icon; string pinKey = GetPinKey(name, icon); string pinKey2 = GetPinKey(name2, icon2); bool flag = pinKey.Equals(pinKey2); if (!m_pinGroups.TryGetValue(pinKey, out var value)) { WxAxW.PinAssistant.Utils.Debug.Error("Failed to update group, contact dev!"); return; } if (flag) { value.PinColor = newTrackedObject.PinColor; return; } if (modifyPins) { ModifyPinGroup(trackedObject, newTrackedObject); return; } InitOrGetPinGroup(pinKey2, name2, icon2, newTrackedObject.PinColor, forceChangeColor: true); value.ResetColor(); } private void OnTrackedObjectsReload(LooseDictionary<TrackedObject> trackedObjects) { foreach (KeyValuePair<string, PinGroup> pinGroup in m_pinGroups) { pinGroup.Value.ResetColor(); } foreach (LooseDictionary<TrackedObject>.TrieNode value in trackedObjects.AltDictionary.Values) { OnTrackedObjectAdd(value.Value); } WxAxW.PinAssistant.Utils.Debug.Log("Minimap Pin color reloaded"); } } internal class PinHandler : PluginComponent { private static PinHandler m_instance = new PinHandler(); private Dictionary<Vector3, PinData> m_monitoredPins = new Dictionary<Vector3, PinData>(); private Dictionary<PinType, Tuple<Sprite, string>> m_dictionaryPinType = new Dictionary<PinType, Tuple<Sprite, string>>(); private bool m_dictionaryPinTypePopulated; public Action OnDictionaryPinTypePopulated; public static PinHandler Instance { get { return m_instance; } set { m_instance = value; } } public Dictionary<Vector3, PinData> MonitoredPins { get { return m_monitoredPins; } set { m_monitoredPins = value; } } public Dictionary<PinType, Tuple<Sprite, string>> DictionaryPinType { get { return m_dictionaryPinType; } set { m_dictionaryPinType = value; } } public bool DictionaryPinTypePopulated { get { return m_dictionaryPinTypePopulated; } set { m_dictionaryPinTypePopulated = value; } } public override void Start() { MinimapManager.OnVanillaMapAvailable += PopulateIcons; } public override void Destroy() { } public override void OnEnable() { MinimapPatches.OnPinAdd += OnPinAdd; MinimapPatches.OnPinRemove += OnPinRemove; MinimapPatches.OnPinUpdate += OnPinUpdate; MinimapPatches.OnPinClear += OnPinsClear; PopulatePins(); } public override void OnDisable() { MinimapPatches.OnPinAdd -= OnPinAdd; MinimapPatches.OnPinRemove -= OnPinRemove; MinimapPatches.OnPinUpdate -= OnPinUpdate; MinimapPatches.OnPinClear -= OnPinsClear; ClearPins(); } public static void SetPinName(PinData pin, string newName) { pin.m_name = newName; PinNameData namePinData = pin.m_NamePinData; if (namePinData != null) { TMP_Text pinNameText = namePinData.PinNameText; if (pinNameText != null) { pinNameText.SetText(newName); } } } public static void SetPinType(PinData pin, PinType newPinType, Sprite pinSprite = 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_0015: Unknown result type (might be due to invalid IL or missing references) pin.m_type = newPinType; if ((Object)(object)pinSprite == (Object)null) { pinSprite = Minimap.instance.GetSprite(newPinType); } pin.m_icon = pinSprite; if (!((Object)(object)pin.m_iconElement == (Object)null)) { pin.m_iconElement.sprite = pin.m_icon; } } public static void SetPinData(PinData pin, string newName, PinType newPinType, Sprite pinSprite = null) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) SetPinName(pin, newName); SetPinType(pin, newPinType, pinSprite); } public static void SetPinsData(List<PinData> pins, string newName, PinType newPinType) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) foreach (PinData pin in pins) { SetPinData(pin, newName, newPinType); } } private void PopulatePins() { //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0090: 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) if ((Object)(object)Minimap.instance == (Object)null && !Plugin.Instance.m_isInGame) { WxAxW.PinAssistant.Utils.Debug.Warning(TextType.MINIMAP_NOT_FOUND); return; } List<PinData> pins = Minimap.instance.m_pins; if (pins == null || pins.Count == 0) { WxAxW.PinAssistant.Utils.Debug.Log(TextType.WORLD_LOADING); return; } foreach (PinData item in pins) { WxAxW.PinAssistant.Utils.Debug.Log(TextType.PIN_ADDING, "PopulatePins", item.m_name, item.m_pos); if (!m_monitoredPins.ContainsKey(item.m_pos)) { m_monitoredPins.Add(item.m_pos, item); } } WxAxW.PinAssistant.Utils.Debug.Log(TextType.PINS_POPULATED); } private void PopulateIcons() { //IL_0042: 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_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Invalid comparison between Unknown and I4 //IL_0051: 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) if ((Object)(object)Minimap.instance == (Object)null) { return; } Array values = Enum.GetValues(typeof(PinType)); m_dictionaryPinType.Add((PinType)8, new Tuple<Sprite, string>(null, "None")); foreach (PinType item2 in values) { if ((int)item2 != 8) { Sprite sprite = Minimap.instance.GetSprite(item2); string item = FormatSpriteName(((Object)sprite).name); m_dictionaryPinType.Add(item2, new Tuple<Sprite, string>(sprite, item)); } } m_dictionaryPinTypePopulated = true; OnDictionaryPinTypePopulated?.Invoke(); MinimapManager.OnVanillaMapAvailable -= PopulateIcons; } private string FormatSpriteName(string sprName) { sprName = Regex.Replace(sprName, "mapicon_", string.Empty); if (sprName.IndexOf("_32") != -1) { sprName = Regex.Replace(sprName, "_32", string.Empty); } if (sprName.IndexOf("_colored") != -1) { sprName = Regex.Replace(sprName, "_colored", string.Empty); } sprName = Regex.Replace(sprName, "(^\\w)|(\\s\\w)", (Match m) => m.Value.ToUpper()); return sprName; } public void AddPin(Vector3 pos, string name, PinType icon, bool save, bool isChecked) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0030: 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_0081: 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) //IL_0091: 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) if (CheckPinPositionExist(pos)) { WxAxW.PinAssistant.Utils.Debug.Log(TextType.PIN_ADDING_EXISTS); return; } float value = ModConfig.Instance.RedundancyDistanceAnyConfig.Value; if (value != 0f && !CheckValidPinPosition(pos, name, value, allPins: true)) { WxAxW.PinAssistant.Utils.Debug.Log(TextType.PIN_ADDING_EXISTS_NEARBY); return; } float value2 = ModConfig.Instance.RedundancyDistanceSameConfig.Value; if (value2 != 0f && !CheckValidPinPosition(pos, name, value2, allPins: false)) { WxAxW.PinAssistant.Utils.Debug.Log(TextType.PIN_ADDING_EXISTS_SIMILAR_NEARBY); } else { Minimap.instance.AddPin(pos, icon, name, save, isChecked, 0L, default(PlatformUserID)); } } private void RemovePin(PinData pinData) { //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_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: 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) Vector3 pos = pinData.m_pos; if (m_monitoredPins.TryGetValue(pos, out var value) && value == pinData) { m_monitoredPins.Remove(pos); WxAxW.PinAssistant.Utils.Debug.Log(TextType.PIN_REMOVED, pinData.m_name, pinData.m_pos); } } private void ClearPins() { m_monitoredPins.Clear(); WxAxW.PinAssistant.Utils.Debug.Log(TextType.PINS_CLEARED); } private bool CheckPinPositionExist(Vector3 pinPos) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return m_monitoredPins.ContainsKey(pinPos); } internal bool CheckValidPinPosition(Vector3 pinToAdd, string pinName, float redundancyDistance, bool allPins) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) foreach (PinData value in m_monitoredPins.Values) { if ((allPins || value.m_name.IndexOf(pinName, StringComparison.OrdinalIgnoreCase) != -1) && !CheckValidDistance(pinToAdd, value.m_pos, redundancyDistance)) { return false; } } return true; } private bool CheckValidDistance(Vector3 v1, Vector3 v2, float redundancyDistance) { //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) return Get2DDistance(v1, v2) > redundancyDistance; } private float Get2DDistance(Vector3 v1, Vector3 v2) { //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_0017: 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) return Mathf.Sqrt(Mathf.Pow(v2.x - v1.x, 2f) + Mathf.Pow(v2.z - v1.z, 2f)); } private void OnPinAdd(PinData pinData) { //IL_001c: 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_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) WxAxW.PinAssistant.Utils.Debug.Log(TextType.PIN_ADDING, "OnPinAdd", pinData.m_name, pinData.m_pos); if (MinimapPatches.isSpecialPin) { WxAxW.PinAssistant.Utils.Debug.Log("Special Pin found will not include in the list of pins in PinAssistant"); return; } if (pinData.m_pos == Vector3.zero) { WxAxW.PinAssistant.Utils.Debug.Log(TextType.PING_ADDING); return; } if (m_monitoredPins.ContainsKey(pinData.m_pos)) { WxAxW.PinAssistant.Utils.Debug.Log(TextType.PIN_ADDING_EXISTS); return; } WxAxW.PinAssistant.Utils.Debug.Log(TextType.PIN_ADDED); m_monitoredPins.Add(pinData.m_pos, pinData); } private void OnPinRemove(PinData pinData) { RemovePin(pinData); } private void OnPinUpdate(PinData oldPin, PinData newPin) { //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_001b: 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) if (!(oldPin.m_pos == newPin.m_pos)) { m_monitoredPins.ChangeKey(oldPin.m_pos, newPin.m_pos); } } private void OnPinsClear() { m_monitoredPins.Clear(); } } public abstract class PluginComponent { private bool m_enabled; public bool enabled { get { return m_enabled; } set { if (m_enabled != value) { m_enabled = value; if (m_enabled) { OnEnable(); } else { OnDisable(); } } } } public abstract void Start(); public abstract void Destroy(); public abstract void OnEnable(); public abstract void OnDisable(); } [Serializable] public class TrackedObject : IComparable<TrackedObject> { public class SerializableColor { public float r = 1f; public float g = 1f; public float b = 1f; public float a = 1f; public SerializableColor() { } public SerializableColor(Color color) { //IL_0033: Unknown result type (might be due to invalid IL or missing references) SetWithColor(color); } public SerializableColor(float r, float g, float b, float a) { this.r = r; this.g = g; this.b = b; this.a = a; } public void SetWithColor(Color color) { //IL_0001: 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_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) r = color.r; g = color.g; b = color.b; a = color.a; } internal void ConvertToColor(ref Color pinColor) { pinColor.r = r; pinColor.g = g; pinColor.b = b; pinColor.a = a; } } private string m_objectID; private string m_name; private string m_blackListWords; private PinType m_icon; private Color m_pinColor = Color.white; private bool m_save; private bool m_isChecked; private bool m_isExactMatchOnly; private SerializableColor m_serializeColor = new SerializableColor(); public string ObjectID { get { return m_objectID; } set { m_objectID = value; } } public string Name { get { return m_name; } set { m_name = value; } } public string BlackListWords { get { return m_blackListWords; } set { m_blackListWords = value; } } public PinType Icon { get { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return m_icon; } set { //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) m_icon = value; } } [JsonIgnore] public Color PinColor { get { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return m_pinColor; } set { //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) m_pinColor = value; } } public bool Save { get { return m_save; } set { m_save = value; } } public bool IsChecked { get { return m_isChecked; } set { m_isChecked = value; } } public bool IsExactMatchOnly { get { return m_isExactMatchOnly; } set { m_isExactMatchOnly = value; } } public SerializableColor SerializeColor { get { return m_serializeColor; } set { m_serializeColor = value; m_serializeColor.ConvertToColor(ref m_pinColor); } } public TrackedObject() { }//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) public TrackedObject(string objectID, string name, string blackListWords, PinType icon, Color pinColor, bool save = true, bool isChecked = false, bool isExact = false) { //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_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) SetValues(objectID, name, blackListWords, icon, pinColor, save, isChecked, isExact); } public void SetValues(TrackedObject newValues) { //IL_0014: 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) SetValues(newValues.ObjectID, newValues.Name, newValues.BlackListWords, newValues.Icon, newValues.PinColor, newValues.Save, newValues.IsChecked, newValues.IsExactMatchOnly); } public void SetValues(string objectID, string name, string blackListWords, PinType icon, Color pinColor, bool save = true, bool isChecked = false, bool isExact = false) { //IL_0016: 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_003a: 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_0042: 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) m_objectID = objectID; m_name = name; m_blackListWords = blackListWords; m_icon = icon; if (m_serializeColor == null) { m_serializeColor = new SerializableColor(pinColor); } else { m_serializeColor.SetWithColor(pinColor); } m_pinColor = pinColor; m_save = save; m_isChecked = isChecked; m_isExactMatchOnly = isExact; } public int GetPinIntAsDropdown() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected I4, but got Unknown int num = (int)Icon; if (num >= 8) { return num - 1; } return num; } public override string ToString() { if (string.IsNullOrEmpty(m_name)) { return "object"; } return m_name; } public override bool Equals(object obj) { if (obj is TrackedObject trackedObject) { return m_objectID == trackedObject.m_objectID; } return false; } public override int GetHashCode() { return 1328540911 + EqualityComparer<string>.Default.GetHashCode(m_objectID); } public int CompareTo(TrackedObject other) { return m_name.CompareTo(other.m_name); } } public class TrackingHandler : PluginComponent { public delegate string OnModifiedTrackedObjectsHandler(); private static TrackingHandler m_instance = new TrackingHandler(); private LooseDictionary<TrackedObject> m_trackedObjects = new LooseDictionary<TrackedObject>(); public int m_layersToCheck = LayerMask.GetMask(new string[7] { "Default", "Default_small", "item", "piece", "piece_nonsolid", "static_solid", "terrain" }); public List<Type> m_trackedTypes = new List<Type>(); public static TrackingHandler Instance => m_instance; public LooseDictionary<TrackedObject> TrackedObjects { get { return m_trackedObjects; } set { m_trackedObjects = value; } } public event OnModifiedTrackedObjectsHandler OnModifiedTrackedObjects; public event Action<TrackedObject> OnTrackedObjectAdd; public event Action<TrackedObject> OnTrackedObjectRemove; public event Action<TrackedObject, TrackedObject, bool> OnTrackedObjectUpdate; public event Action<LooseDictionary<TrackedObject>> OnTrackedObjectSaved; public event Action<LooseDictionary<TrackedObject>> OnTrackedObjectsReload; public override void Start() { } public override void OnEnable() { DeserializeTrackedObjects(ModConfig.Instance.TrackedObjectsConfig.Value); OnModifiedTrackedObjects += SerializeTrackedObjects; } public override void OnDisable() { m_trackedTypes.Clear(); m_trackedObjects.Clear(); OnModifiedTrackedObjects -= SerializeTrackedObjects; } public override void Destroy() { m_instance = null; } public void PinLookedObject(float lookDistance) { if (LookAt(lookDistance, out var id, out var obj)) { AddObjAsPin(id, obj); } } public bool LookAt(float lookDistance, out string id, out GameObject obj) { //IL_0023: 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_0062: Unknown result type (might be due to invalid IL or missing references) id = string.Empty; obj = null; if ((Object)(object)GameCamera.instance == (Object)null) { return false; } RaycastHit hit = default(RaycastHit); if (!Physics.Raycast(((Component)GameCamera.instance).transform.position, ((Component)GameCamera.instance).transform.forward, ref hit, lookDistance, m_layersToCheck)) { return false; } if (((Component)((RaycastHit)(ref hit)).collider).gameObject.layer == 11) { return false; } if (!EnsureValid(lookDistance, hit, out hit)) { return false; } obj = ((Component)((Component)((RaycastHit)(ref hit)).collider).transform.root).gameObject; id = ProcessLookedObjectName(obj); WxAxW.PinAssistant.Utils.Debug.Log(TextType.OBJECT_INFO, id, LayerMask.LayerToName(((Component)((RaycastHit)(ref hit)).collider).gameObject.layer), ((Component)((RaycastHit)(ref hit)).collider).gameObject.layer, LayerMask.LayerToName(obj.layer), obj.layer); return true; } private bool EnsureValid(float lookDistance, RaycastHit hit, out RaycastHit hit2) { //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_009e: 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_00b7: 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_00cb: Unknown result type (might be due to invalid IL or missing references) hit2 = hit; WxAxW.PinAssistant.Utils.Debug.Log("Hit Transform Name: " + ((Object)((Component)((RaycastHit)(ref hit)).transform).gameObject).name + " on layer " + LayerMask.LayerToName(((Component)((RaycastHit)(ref hit)).transform).gameObject.layer)); WxAxW.PinAssistant.Utils.Debug.Log("Hit Collider Name: " + ((Object)((Component)((RaycastHit)(ref hit)).collider).gameObject).name + " on layer " + LayerMask.LayerToName(((Component)((RaycastHit)(ref hit)).collider).gameObject.layer)); if (((Object)((Component)((RaycastHit)(ref hit)).collider).gameObject).name != "Sadel") { return true; } if (!Physics.Raycast(((RaycastHit)(ref hit)).point + ((Component)GameCamera.instance).transform.forward * 0.01f, ((Component)GameCamera.instance).transform.forward, ref hit2, lookDistance, m_layersToCheck)) { return false; } if (((Component)((RaycastHit)(ref hit2)).collider).gameObject.layer == 11) { return false; } return true; } private string ProcessLookedObjectName(GameObject obj) { switch (((Object)obj).name) { case "LocationProxy(Clone)": return ((Object)obj.transform.GetChild(0)).name; case "___MineRock5 m_meshFilter": return "Invalid! Track undamaged instead"; case "DG_ForestCrypt(Clone)": case "DG_SunkenCrypt(Clone)": case "TreasureChest_forestcrypt(Clone)": case "TreasureChest_sunkencrypt(Clone)": case "Pickable_ForestCryptRemains01(Clone)": case "Pickable_ForestCryptRemains02(Clone)": case "Pickable_ForestCryptRemains03(Clone)": case "Pickable_ForestCryptRandom(Clone)": case "Pickable_SunkenCryptRandom(Clone)": case "dungeon_forestcrypt_door(Clone)": case "sunken_crypt_gate(Clone)": return ""; default: return ((Object)obj).name; } } public void AddObjAsPin(string id, GameObject obj) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) if (Minimap.instance != null) { if (!m_trackedObjects.TryGetValueLooseLite(id, out var result)) { WxAxW.PinAssistant.Utils.Debug.Log(TextType.OBJECT_NOT_TRACKED); return; } Vector3 position = obj.transform.position; PinHandler.Instance.AddPin(position, result.Name, result.Icon, result.Save, result.IsChecked); } } public string FormatObjectName(string name) { name = Regex.Replace(name, "_", " "); name = Regex.Replace(name, "(?:\\d|\\(clone\\))|\\b(?:pickable|small)\\b", string.Empty, RegexOptions.IgnoreCase); string text = Regex.Replace(name, "rock", string.Empty, RegexOptions.IgnoreCase); if (!string.IsNullOrWhiteSpace(text)) { name = text; } name = Regex.Replace(name, "\\b\\w", (Match m) => m.Value.ToUpper()); name = Regex.Replace(name, "([a-z])([A-Z])", "$1 $2").Trim(); return name; } public bool AddTrackedObject(TrackedObject trackedObjectToAdd, out bool conflicting) { string objectID = trackedObjectToAdd.ObjectID; bool isExactMatchOnly = trackedObjectToAdd.IsExactMatchOnly; string blackListWords = trackedObjectToAdd.BlackListWords; if (!m_trackedObjects.Add(objectID, trackedObjectToAdd, out conflicting, blackListWords, isExactMatchOnly)) { return false; } WxAxW.PinAssistant.Utils.Debug.Log("Tracking " + trackedObjectToAdd.ObjectID); this.OnTrackedObjectAdd?.Invoke(trackedObjectToAdd); this.OnModifiedTrackedObjects?.Invoke(); return true; } public bool RemoveTrackedObject(TrackedObject trackedObjectToDelete) { if (!m_trackedObjects.Remove(trackedObjectToDelete.ObjectID)) { return false; } WxAxW.PinAssistant.Utils.Debug.Log("Untracking " + trackedObjectToDelete.ObjectID); this.OnTrackedObjectRemove?.Invoke(trackedObjectToDelete); this.OnModifiedTrackedObjects?.Invoke(); return true; } public bool ModifyTrackedObject(TrackedObject objToEdit, TrackedObject newValues, bool renamePins, out bool conficting, out TrackedObject foundConflict) { conficting = false; foundConflict = null; if (!m_trackedObjects.AltDictionary.ContainsKey(objToEdit.ObjectID.ToLower())) { WxAxW.PinAssistant.Utils.Debug.Error("Tracked object id not found report this to the dev"); return false; } if (!m_trackedObjects.ChangeKey(objToEdit.ObjectID, newValues.ObjectID, out conficting, out foundConflict)) { WxAxW.PinAssistant.Utils.Debug.Warning("New ObjectID already exists, will not modify"); return false; } m_trackedObjects.Modify(newValues.ObjectID, newValues, newValues.IsExactMatchOnly, newValues.BlackListWords); this.OnTrackedObjectUpdate?.Invoke(objToEdit, newValues, renamePins); this.OnModifiedTrackedObjects?.Invoke(); return true; } public void AddType(Type type) { if (!m_trackedTypes.Contains(type)) { m_trackedTypes.Add(type); } } public void RemoveType(Type type) { m_trackedTypes.Remove(type); } public string SerializeTrackedObjects() { //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_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown WxAxW.PinAssistant.Utils.Debug.Log("Serializing tracked objects"); m_trackedObjects.SortTrackedObjects(); string text = JsonConvert.SerializeObject((object)m_trackedObjects, new JsonSerializerSettings { FloatParseHandling = (FloatParseHandling)1, ReferenceLoopHandling = (ReferenceLoopHandling)1 }); WxAxW.PinAssistant.Utils.Debug.Log("Serialized, saving to data"); ModConfig.Instance.TrackedObjectsConfig.Value = text; WxAxW.PinAssistant.Utils.Debug.Log("Saved"); this.OnTrackedObjectSaved?.Invoke(m_trackedObjects); return text; } public void DeserializeTrackedObjects(string serializedObject) { //IL_004d: Expected O, but got Unknown //IL_0017: 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_0028: Expected O, but got Unknown m_trackedObjects.Clear(); TextType messageType = TextType.TRACKED_OBJECTS_INITIALIZED; if (!string.IsNullOrEmpty(serializedObject)) { try { LooseDictionary<TrackedObject> looseDictionary = JsonConvert.DeserializeObject<LooseDictionary<TrackedObject>>(serializedObject, new JsonSerializerSettings { ObjectCreationHandling = (ObjectCreationHandling)2 }); if (looseDictionary.AltDictionary.Count > 0) { m_trackedObjects = looseDictionary; messageType = TextType.TRACKED_OBJECTS_LOADED; } else { messageType = TextType.TRACKED_OBJECTS_EMPTY; } } catch (JsonException val) { WxAxW.PinAssistant.Utils.Debug.Error((object)val); messageType = TextType.TRACKED_OBJECTS_INVALID; } } WxAxW.PinAssistant.Utils.Debug.Log(messageType); this.OnTrackedObjectsReload?.Invoke(m_trackedObjects); } } } namespace WxAxW.PinAssistant.Configuration { public enum TextType { NULL, [Text("General")] CONFIG_CATEGORY_GENERAL, [Text("Hotkeys")] CONFIG_CATEGORY_HOTKEYS, [Text("Technical")] CONFIG_CATEGORY_TECHNICAL, [Text("Enabled Mod")] CONFIG_NAME_TOGGLE_MOD, [Text("Auto Pinning")] CONFIG_NAME_TOGGLE_AUTOPINNING, [Text("Show Search Window on startup")] CONFIG_NAME_TOGGLE_STARTFILTERENABLED, [Text("Look Tick Rate")] CONFIG_NAME_VAL_TICKRATE, [Text("Similar Pin Redundancy Distance")] CONFIG_NAME_VAL_DISTANCEREDUNDANCY_SAME, [Text("Any Pin Redundancy Distance")] CONFIG_NAME_VAL_DISTANCEREDUNDANCY_ANY, [Text("Look Distance")] CONFIG_NAME_VAL_DISTANCELOOK, [Text("Max Mini/Map Zoom Multiplier")] CONFIG_NAME_VAL_MAXZOOMMULT, [Text("Track Looked Object")] CONFIG_NAME_KEY_TRACKOBJECT, [Text("Pin Object")] CONFIG_NAME_KEY_PINOBJECT, [Text("Toggle Search Window")] CONFIG_NAME_KEY_TOGGLEFILTERWINDOW, [Text("Reload Tracked Objects")] CONFIG_NAME_KEY_RELOADTRACKED, [Text("Debug Mode")] CONFIG_NAME_DEBUGMODE, [Text("Objects Tracked")] CONFIG_NAME_OBJEECTSTRACKED, [Text("Enable or disable plugin\nTo auto pin you must enable '{0}' and look at the object")] CONFIG_MESSAGE_TOGGLE_MOD, [Text("Enable or disable auto pinning when looking at an object (only auto pins objects from '{0}'")] CONFIG_MESSAGE_TOGGLE_AUTOPINNING, [Text("Shows/Hides the Search Window on startup.\n(added this for the purpose of Pinnacle so they show/hide in tandem.\nto do so, hide Pinnacle's panel, toggle off this entry and re-enable this mod, you only need to do this once.)")] CONFIG_MESSAGE_TOGGLE_STARTFILTERENABLED, [Text("The tick rate for when to check the object you're looking at to attempt to pin it\nThe value is 'n seconds per tick'")] CONFIG_MESSAGE_VAL_TICKRATE, [Text("The minimum distance or space required to prevent pinning similar pins close together. (Based on pin's name, 0 to completely stop this check")] CONFIG_MESSAGE