Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of PingMark v1.6.2
PingMark.dll
Decompiled 3 weeks 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.Concurrent; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.IO; using System.IO.Compression; using System.Linq; using System.Linq.Expressions; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Serialization; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using System.Text.RegularExpressions; using System.Threading; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using JetBrains.Annotations; using JoksterCube.AbilityKit; using JoksterCube.PingMark.Common; using JoksterCube.PingMark.Common.Networking; using JoksterCube.PingMark.Domain; using JoksterCube.PingMark.Domain.Collections; using JoksterCube.PingMark.Domain.Enums; using JoksterCube.PingMark.Domain.Models; using JoksterCube.PingMark.Domain.Networking; using JoksterCube.PingMark.Domain.PingTargets; using JoksterCube.PingMark.Settings; using Microsoft.CodeAnalysis; using ServerSync; using SoftReferenceableAssets; using TMPro; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Rendering; using UnityEngine.UI; using Valheim.SettingsGui; using YamlDotNet.Core; using YamlDotNet.Core.Events; using YamlDotNet.Core.Tokens; using YamlDotNet.Helpers; using YamlDotNet.Serialization; using YamlDotNet.Serialization.BufferedDeserialization; using YamlDotNet.Serialization.BufferedDeserialization.TypeDiscriminators; using YamlDotNet.Serialization.Converters; using YamlDotNet.Serialization.EventEmitters; using YamlDotNet.Serialization.NamingConventions; using YamlDotNet.Serialization.NodeDeserializers; using YamlDotNet.Serialization.NodeTypeResolvers; using YamlDotNet.Serialization.ObjectFactories; using YamlDotNet.Serialization.ObjectGraphTraversalStrategies; using YamlDotNet.Serialization.ObjectGraphVisitors; using YamlDotNet.Serialization.Schemas; using YamlDotNet.Serialization.TypeInspectors; using YamlDotNet.Serialization.TypeResolvers; using YamlDotNet.Serialization.Utilities; using YamlDotNet.Serialization.ValueDeserializers; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("PingMark")] [assembly: AssemblyDescription("Mark loot, creatures, and locations with named pings, colored outlines, and live distances. Sense what's hidden around you and share discoveries with your party.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("JoksterCube")] [assembly: AssemblyProduct("PingMark")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("7b25968d-61be-412f-b20f-36c18da9de86")] [assembly: AssemblyFileVersion("1.6.2")] [assembly: InternalsVisibleTo("PingMark.Tests")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.6.2.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace JoksterCube.PingMark { [BepInPlugin("JoksterCube.PingMark", "PingMark", "1.6.2")] public class Plugin : BaseUnityPlugin { internal static readonly ManualLogSource ModLogger = Logger.CreateLogSource("PingMark"); internal static string ConnectionError = string.Empty; private static readonly ConfigSync ConfigSync = new ConfigSync("JoksterCube.PingMark") { DisplayName = "PingMark", CurrentVersion = "1.6.2", MinimumRequiredVersion = "1.6.2" }; private readonly string _configFileFullPath = Path.Combine(Paths.ConfigPath, "JoksterCube.PingMark.cfg"); private FileSystemWatcher? _configWatcher; private DateTime _lastConfigWrite; private const string UpdateFeature = "Ping input and highlights"; private readonly Harmony _harmony = new Harmony("JoksterCube.PingMark"); internal static bool InitialConfigSyncDone => ConfigSync.InitialSyncDone; internal static bool CanEditPrefabCollections { get { if (!ConfigSync.IsSourceOfTruth) { return ConfigSync.IsAdmin; } return true; } } private void Awake() { PluginConfig.Build(((BaseUnityPlugin)this).Config, ConfigSync); PrefabCollectionStore.Initialize(((BaseUnityPlugin)this).Config); PrefabCollectionEditor.View = (Behaviour?)(object)PrefabCollectionEditorView.Create(this); Assembly executingAssembly = Assembly.GetExecutingAssembly(); _harmony.PatchAll(executingAssembly); OutlineManager.Initialize(); SetupWatcher(); } private void Update() { if (PatchGuard.IsDisabled("Ping input and highlights")) { return; } try { ZPingNetwork.Update(); MobHighlight.Update(); HookedFish.Update(); InputManager.Update(); Perception.Update(); } catch (Exception exception) { PatchGuard.Fail("Ping input and highlights", exception); } } private void OnDestroy() { PrefabCollectionEditor.Close(); OutlineManager.Dispose(); _harmony.UnpatchSelf(); PrefabCollectionStore.Dispose(); _configWatcher?.Dispose(); ((BaseUnityPlugin)this).Config.Save(); } private void SetupWatcher() { FileSystemWatcher fileSystemWatcher = new FileSystemWatcher(Paths.ConfigPath, "JoksterCube.PingMark.cfg"); fileSystemWatcher.Changed += ReadConfigValues; fileSystemWatcher.Created += ReadConfigValues; fileSystemWatcher.Renamed += ReadConfigValues; fileSystemWatcher.SynchronizingObject = ThreadingHelper.SynchronizingObject; _configWatcher = fileSystemWatcher; fileSystemWatcher.EnableRaisingEvents = true; } private void ReadConfigValues(object sender, FileSystemEventArgs e) { if (!File.Exists(_configFileFullPath)) { return; } DateTime lastWriteTimeUtc = File.GetLastWriteTimeUtc(_configFileFullPath); if (lastWriteTimeUtc == _lastConfigWrite) { return; } _lastConfigWrite = lastWriteTimeUtc; try { ModLogger.LogDebug((object)"ReadConfigCalled called"); ((BaseUnityPlugin)this).Config.Reload(); } catch { ModLogger.LogError((object)"There was an issue loading your JoksterCube.PingMark.cfg"); ModLogger.LogError((object)"Please check your config entries for spelling and format!"); } } } } namespace JoksterCube.PingMark.Settings { internal sealed class ConfigInfo<T> { internal string Group { get; } internal string Name { get; } internal ConfigDescription Description { get; } internal T DefaultValue { get; } internal bool Synchronized { get; } internal bool IsAdvanced { get; set; } internal ConfigInfo(string group, string name, string description, T defaultValue, bool synchronized = true) : this(group, name, new ConfigDescription(description, (AcceptableValueBase)null, Array.Empty<object>()), defaultValue, synchronized) { }//IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown internal ConfigInfo(string group, string name, ConfigDescription description, T defaultValue, bool synchronized = true) { Group = group; Name = name; Description = description; DefaultValue = defaultValue; Synchronized = synchronized; } } internal static class ConfigOptions { private static ConfigFile? _configFile; private static ConfigSync? _configSync; private static readonly Dictionary<string, int> NextOrder = new Dictionary<string, int>(); internal static void Initialize(ConfigFile config, ConfigSync configSync) { _configFile = config; _configSync = configSync; } internal static ConfigEntry<T> Config<T>(string group, string name, T value, ConfigDescription description, bool synchronizedSetting = true, bool advanced = false) { //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Expected O, but got Unknown int value2; int num = (NextOrder.TryGetValue(group, out value2) ? value2 : 1000); NextOrder[group] = num - 1; ConfigurationManagerAttributes element = new ConfigurationManagerAttributes { Order = num, IsAdvanced = (advanced ? new bool?(true) : ((bool?)null)) }; ConfigDescription val = new ConfigDescription(description.Description + (synchronizedSetting ? " [Synced with Server]" : " [Not Synced with Server]"), description.AcceptableValues, (description.Tags ?? Array.Empty<object>()).Append(element).ToArray()); ConfigEntry<T> val2 = (_configFile ?? throw new InvalidOperationException("ConfigOptions is not initialized.")).Bind<T>(group, name, value, val); (_configSync ?? throw new InvalidOperationException("ConfigOptions is not initialized.")).AddConfigEntry<T>(val2).SynchronizedConfig = synchronizedSetting; return val2; } internal static ConfigEntry<T> Config<T>(string group, string name, T value, string description, bool synchronizedSetting = true) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown return Config(group, name, value, new ConfigDescription(description, (AcceptableValueBase)null, Array.Empty<object>()), synchronizedSetting); } internal static ConfigEntry<T> Config<T>(ConfigInfo<T> configInfo) { return Config(configInfo.Group, configInfo.Name, configInfo.DefaultValue, configInfo.Description, configInfo.Synchronized, configInfo.IsAdvanced); } } internal sealed class ConfigurationManagerAttributes { public int? Order; public bool? IsAdvanced; public bool? ReadOnly; public bool? Browsable; public string? DispName; public string? Category; } internal static class Constants { internal static class Plugin { internal const string ModName = "PingMark"; internal const string ModVersion = "1.6.2"; internal const string Author = "JoksterCube"; internal const string ModGUID = "JoksterCube.PingMark"; internal const string Description = "Mark loot, creatures, and locations with named pings, colored outlines, and live distances. Sense what's hidden around you and share discoveries with your party."; internal const string Copyright = "Copyright © 2026"; internal const string Guid = "7b25968d-61be-412f-b20f-36c18da9de86"; internal const string ConfigFileName = "JoksterCube.PingMark.cfg"; internal const string CollectionsFileName = "JoksterCube.PingMark.Collections.yml"; } internal static class DebugMessages { internal const string ReadConfigCalled = "ReadConfigCalled called"; internal const string ErrorLoadingConfig = "There was an issue loading your JoksterCube.PingMark.cfg"; internal const string RequestCheckConfig = "Please check your config entries for spelling and format!"; } internal static class LayerMasks { internal static readonly int MobHighlight = LayerMask.GetMask(new string[13] { "Default", "static_solid", "Default_small", "piece", "piece_nonsolid", "terrain", "vehicle", "character", "character_net", "character_ghost", "character_noenv", "hitbox", "item" }); internal static readonly int SightBlockers = LayerMask.GetMask(new string[4] { "Default", "static_solid", "piece", "terrain" }); } internal static class Groups { internal static class General { internal const string Group = "1 - General"; internal static readonly ConfigInfo<Toggle> Enabled = new ConfigInfo<Toggle>("1 - General", "Enabled", "Enable all PingMark features.", Toggle.On, synchronized: false); internal static readonly ConfigInfo<Toggle> Lock = new ConfigInfo<Toggle>("1 - General", "Lock Configuration", "If on, synchronized configuration is locked and can be changed by server admins only.", Toggle.On); internal static readonly ConfigInfo<float> RefreshInterval = new ConfigInfo<float>("1 - General", "Refresh Interval", new ConfigDescription("How often, in seconds, distances on visible pings and highlighted mobs are recalculated.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.05f, 5f), Array.Empty<object>()), 0.25f) { IsAdvanced = true }; internal static readonly ConfigInfo<float> PingCooldown = new ConfigInfo<float>("1 - General", "Ping Cooldown", new ConfigDescription("Minimum seconds between Z pings and character highlights. Set to 0 to disable.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 60f), Array.Empty<object>()), 0f); internal static readonly ConfigInfo<float> ZPingBroadcastDistance = new ConfigInfo<float>("1 - General", "Z Ping Broadcast Distance", new ConfigDescription("Maximum distance in meters from the sending player to PingMark recipients of Z location pings and character highlights. Map pings remain global. Set to 0 for unlimited. Without a modded server, the shorter of the sender's and the recipient's setting applies.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 10000f), Array.Empty<object>()), 200f); internal static readonly ConfigInfo<Toggle> SendZPingsToUnmoddedPlayers = new ConfigInfo<Toggle>("1 - General", "Send Z Pings To Unmodded Players", "Send Z pings as ordinary location pings to players without PingMark, regardless of distance. Character pings use the character's current position. If off, players without PingMark receive no Z pings.", Toggle.On); internal static readonly ConfigInfo<Toggle> DebugPrefabId = new ConfigInfo<Toggle>("1 - General", "Debug Ping Names", "Show all names found on the hit object (prefab ID, location ID, hover, piece, etc.) in a top-left message when camera pinging.", Toggle.Off, synchronized: false) { IsAdvanced = true }; internal static readonly ConfigInfo<Toggle> ShowAbilityNames = new ConfigInfo<Toggle>("1 - General", "Show Ability Names", "Show the names above the Guardian Power and the ability slots beside it (Perception, Fishsight and other mods' slots). Turn off to hide them all and bring the slots closer together.", Toggle.On, synchronized: false); } internal static class PingLabel { internal const string Group = "2 - Ping Label"; internal static readonly ConfigInfo<Toggle> ShowPingerName = new ConfigInfo<Toggle>("2 - Ping Label", "Show Pinger Name", "Show the pinger's name on world/map ping labels and above highlighted mobs and players.", Toggle.On, synchronized: false); internal static readonly ConfigInfo<Toggle> ShowDistance = new ConfigInfo<Toggle>("2 - Ping Label", "Show Distance", "Show distance on world/map ping labels and above highlighted mobs and players.", Toggle.On, synchronized: false); internal static readonly ConfigInfo<string> EmptyLabelText = new ConfigInfo<string>("2 - Ping Label", "Empty Label Text", "Text shown when the pinger name, target name, and distance are all hidden.", "PING", synchronized: false) { IsAdvanced = true }; internal static readonly ConfigInfo<Toggle> UseKilometers = new ConfigInfo<Toggle>("2 - Ping Label", "Use Kilometers", "Show distances of 1000 meters or more in kilometers with two decimal places.", Toggle.On, synchronized: false); internal static readonly ConfigInfo<Toggle> ShowTargetName = new ConfigInfo<Toggle>("2 - Ping Label", "Show Target Name", "Show the pinged location/object name on this client. Target names are sent regardless of the sender's display setting.", Toggle.On, synchronized: false); internal static readonly ConfigInfo<Color> PingColor = new ConfigInfo<Color>("2 - Ping Label", "Ping Color", "Color of in-world ping labels (name and distance) when not matched to an outline color.", Color.white, synchronized: false); internal static readonly ConfigInfo<Toggle> MatchTextToOutline = new ConfigInfo<Toggle>("2 - Ping Label", "Match Ping Text To Outline", "Color the ping label with the outline color of the pinged target.", Toggle.Off, synchronized: false); internal static readonly ConfigInfo<float> Duration = new ConfigInfo<float>("2 - Ping Label", "Ping Duration", new ConfigDescription("Seconds a location or object ping stays: its label, outline and map marker. Vanilla pings last 5 seconds. Mobs and players have their own durations.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 120f), Array.Empty<object>()), 5f); } internal static class Outlines { internal const string Group = "5 - Outlines"; internal static readonly ConfigInfo<Toggle> PingOutlineEnabled = new ConfigInfo<Toggle>("5 - Outlines", "Enable Ping Outline", "Draw an outline around pinged locations, valuables/resources, drops and other models.", Toggle.On, synchronized: false); internal static readonly ConfigInfo<float> OutlineWidth = new ConfigInfo<float>("5 - Outlines", "Outline Width", new ConfigDescription("Width in pixels of outlines around highlighted mobs and pinged models. Visible through obstacles. Set to 0 to disable.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 10f), Array.Empty<object>()), 2f, synchronized: false); internal static readonly ConfigInfo<Color> PingDropColor = new ConfigInfo<Color>("5 - Outlines", "Ping Drop Color", "Outline color for pinged dropped items (weapons, armor, materials on the ground).", new Color(0.7f, 0.5f, 1f), synchronized: false); internal static readonly ConfigInfo<Color> PingFishColor = new ConfigInfo<Color>("5 - Outlines", "Ping Fish Color", "Outline color for pinged fish, swimming or on the ground, and for the fish on your line.", new Color(1f, 0.45f, 0.75f), synchronized: false); internal static readonly ConfigInfo<Color> PingPlayerColor = new ConfigInfo<Color>("5 - Outlines", "Ping Gravestone/Player Color", "Outline color for pinged gravestones and other players.", new Color(1f, 0.5f, 0.15f), synchronized: false); internal static readonly ConfigInfo<Color> PingAnythingColor = new ConfigInfo<Color>("5 - Outlines", "Ping Anything Color", "Outline color for any other pinged model.", Color.white, synchronized: false); internal static readonly ConfigInfo<Color> HostileOutlineColor = new ConfigInfo<Color>("5 - Outlines", "Hostile Outline Color", "Outline color for highlighted hostile mobs.", new Color(0.9f, 0.18f, 0.12f), synchronized: false); internal static readonly ConfigInfo<Color> AllyOutlineColor = new ConfigInfo<Color>("5 - Outlines", "Ally Outline Color", "Outline color for highlighted ally and tamed mobs. Matches the green of their health bar by default.", new Color(0.25f, 0.88f, 0.1f), synchronized: false); } internal static class PrefabCollections { internal const string Group = "7 - Prefab Collections"; internal const int Color1Id = 1; internal const int Color2Id = 2; internal const int Color3Id = 3; internal const int Color4Id = 4; internal const int Color5Id = 5; internal const int Color6Id = 6; internal const int Color7Id = 7; internal const int Color8Id = 8; internal const int Color9Id = 9; internal const int Color10Id = 10; internal const int Color11Id = 11; internal const int Color12Id = 12; internal static readonly ConfigInfo<Color> Color1 = new ConfigInfo<Color>("7 - Prefab Collections", "Color 1", "Section palette color 1.", new Color(0.8f, 0.8f, 0.8f), synchronized: false) { IsAdvanced = true }; internal static readonly ConfigInfo<Color> Color2 = new ConfigInfo<Color>("7 - Prefab Collections", "Color 2", "Section palette color 2.", Color.white, synchronized: false) { IsAdvanced = true }; internal static readonly ConfigInfo<Color> Color3 = new ConfigInfo<Color>("7 - Prefab Collections", "Color 3", "Section palette color 3.", new Color(0.95f, 0.25f, 0.2f), synchronized: false) { IsAdvanced = true }; internal static readonly ConfigInfo<Color> Color4 = new ConfigInfo<Color>("7 - Prefab Collections", "Color 4", "Section palette color 4.", new Color(1f, 0.5f, 0.15f), synchronized: false) { IsAdvanced = true }; internal static readonly ConfigInfo<Color> Color5 = new ConfigInfo<Color>("7 - Prefab Collections", "Color 5", "Section palette color 5.", new Color(1f, 0.82f, 0.3f), synchronized: false) { IsAdvanced = true }; internal static readonly ConfigInfo<Color> Color6 = new ConfigInfo<Color>("7 - Prefab Collections", "Color 6", "Section palette color 6.", new Color(0.65f, 0.85f, 0.25f), synchronized: false) { IsAdvanced = true }; internal static readonly ConfigInfo<Color> Color7 = new ConfigInfo<Color>("7 - Prefab Collections", "Color 7", "Section palette color 7.", new Color(0.25f, 0.75f, 0.35f), synchronized: false) { IsAdvanced = true }; internal static readonly ConfigInfo<Color> Color8 = new ConfigInfo<Color>("7 - Prefab Collections", "Color 8", "Section palette color 8.", new Color(0.25f, 0.8f, 0.7f), synchronized: false) { IsAdvanced = true }; internal static readonly ConfigInfo<Color> Color9 = new ConfigInfo<Color>("7 - Prefab Collections", "Color 9", "Section palette color 9.", new Color(0.25f, 0.75f, 1f), synchronized: false) { IsAdvanced = true }; internal static readonly ConfigInfo<Color> Color10 = new ConfigInfo<Color>("7 - Prefab Collections", "Color 10", "Section palette color 10.", new Color(0.35f, 0.45f, 1f), synchronized: false) { IsAdvanced = true }; internal static readonly ConfigInfo<Color> Color11 = new ConfigInfo<Color>("7 - Prefab Collections", "Color 11", "Section palette color 11.", new Color(0.7f, 0.45f, 0.9f), synchronized: false) { IsAdvanced = true }; internal static readonly ConfigInfo<Color> Color12 = new ConfigInfo<Color>("7 - Prefab Collections", "Color 12", "Section palette color 12.", new Color(1f, 0.45f, 0.7f), synchronized: false) { IsAdvanced = true }; internal static readonly ConfigInfo<Color>[] Colors = new ConfigInfo<Color>[12] { Color1, Color2, Color3, Color4, Color5, Color6, Color7, Color8, Color9, Color10, Color11, Color12 }; internal static readonly ConfigInfo<int> UnassignedColorId = new ConfigInfo<int>("7 - Prefab Collections", "Unassigned Section Color ID", new ConfigDescription("Palette color ID for the Unassigned section.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 12), Array.Empty<object>()), 1, synchronized: false) { IsAdvanced = true }; } internal static class MobHighlight { internal const string Group = "6 - Mob Highlight"; internal static readonly ConfigInfo<Toggle> Enabled = new ConfigInfo<Toggle>("6 - Mob Highlight", "Enable Mob Highlight", "Enable temporarily highlighting mobs with a visible nameplate.", Toggle.On); internal static readonly ConfigInfo<Toggle> OutlineEnabled = new ConfigInfo<Toggle>("6 - Mob Highlight", "Enable Mob Outline", "Draw an outline around highlighted mobs.", Toggle.On, synchronized: false); internal static readonly ConfigInfo<float> MobHighlightDuration = new ConfigInfo<float>("6 - Mob Highlight", "Mob Highlight Duration", new ConfigDescription("Seconds a highlighted mob's nameplate remains visible.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 120f), Array.Empty<object>()), 10f); internal static readonly ConfigInfo<int> MaxHighlightedMobs = new ConfigInfo<int>("6 - Mob Highlight", "Max Highlighted Mobs", new ConfigDescription("Maximum number of mob or player nameplates highlighted at once per sending player. Highlighting another replaces only that player's oldest highlight.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 20), Array.Empty<object>()), 1); } internal static class Inputs { internal const string Group = "9 - Inputs"; internal static readonly ConfigInfo<KeyboardShortcut> ToggleModShortcut = new ConfigInfo<KeyboardShortcut>("9 - Inputs", "Toggle Mod Shortcut", "Toggle all PingMark features.", new KeyboardShortcut((KeyCode)112, (KeyCode[])(object)new KeyCode[1] { (KeyCode)305 }), synchronized: false); internal static readonly ConfigInfo<KeyboardShortcut> PrefabEditorShortcut = new ConfigInfo<KeyboardShortcut>("9 - Inputs", "Prefab Editor Shortcut", "Press to open the prefab collection editor when its shortcut is enabled. With server-synced lists, only admins can edit.", new KeyboardShortcut((KeyCode)112, (KeyCode[])(object)new KeyCode[2] { (KeyCode)305, (KeyCode)303 }), synchronized: false); internal const string LegacyPingShortcutName = "Mob Highlight Shortcut"; internal static readonly ConfigInfo<KeyboardShortcut> PingShortcut = new ConfigInfo<KeyboardShortcut>("9 - Inputs", "Ping Shortcut", "Ping what is under the camera crosshair: highlights a creature (or an enabled player), otherwise pings the aimed object or location.", new KeyboardShortcut((KeyCode)122, Array.Empty<KeyCode>()), synchronized: false); internal static readonly ConfigInfo<KeyboardShortcut> PerceptionShortcut = new ConfigInfo<KeyboardShortcut>("9 - Inputs", "Perception Shortcut", "Outline nearby listed objects and dropped items for as long as a ping lasts, without pinging anyone. Only works standing still: no other key may be held. Causes Perception Fatigue.", new KeyboardShortcut((KeyCode)122, (KeyCode[])(object)new KeyCode[1] { (KeyCode)304 }), synchronized: false); internal static readonly ConfigInfo<KeyboardShortcut> FishsightShortcut = new ConfigInfo<KeyboardShortcut>("9 - Inputs", "Fishsight Shortcut", "While a fish is on your line, switch its outline on or off. Leave empty to hide the Fishsight slot.", new KeyboardShortcut((KeyCode)122, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 }), synchronized: false); internal static readonly ConfigInfo<Toggle> PrefabEditorShortcutEnabled = new ConfigInfo<Toggle>("9 - Inputs", "Enable Prefab Editor Shortcut", "Enable the Prefab Editor Shortcut.", Toggle.On, synchronized: false) { IsAdvanced = true }; } internal static class Fishing { internal const string Group = "11 - Fishing"; internal static readonly ConfigInfo<Toggle> AutoOutlineHookedFish = new ConfigInfo<Toggle>("11 - Fishing", "Auto Outline Hooked Fish", "Outline every fish you hook until it is caught or gets away, so you can see what it is doing. If off, only a fish you pinged before it bit stays outlined. Either way, a Fishsight slot beside the Guardian Power shows while a fish is hooked, and Fishsight Shortcut switches the outline for that fish.", Toggle.Off, synchronized: false); } internal static class Perception { internal const string Group = "10 - Perception"; internal static readonly ConfigInfo<Toggle> Enabled = new ConfigInfo<Toggle>("10 - Perception", "Enable Perception", "Let players outline nearby listed objects with the Perception Shortcut, plus whatever else Ping Targets enables for pings: drops, gravestones, other players (highlighted) and all other objects. Nearby PingMark players within the Z Ping Broadcast Distance see the same outlines.", Toggle.On); internal static readonly ConfigInfo<float> Range = new ConfigInfo<float>("10 - Perception", "Perception Range", new ConfigDescription("Radius in meters around the player that Perception searches.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 30f), Array.Empty<object>()), 10f); internal static readonly ConfigInfo<Toggle> LineOfSight = new ConfigInfo<Toggle>("10 - Perception", "Perception Line Of Sight", "Perception only senses what the player can see: objects, drops and creatures behind walls, rock, buildings or under the ground (such as buried treasure) are left out.", Toggle.On); internal static readonly ConfigInfo<float> Duration = new ConfigInfo<float>("10 - Perception", "Perception Duration", new ConfigDescription("Seconds Perception keeps nearby objects and creatures outlined, shown as the Perception status effect. In Relative mode, Perception Fatigue starts when it ends.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 60f), Array.Empty<object>()), 15f); internal static readonly ConfigInfo<Toggle> EarlyEnd = new ConfigInfo<Toggle>("10 - Perception", "End Perception Early", "End Perception, and start its fatigue, as soon as everything it found that can run out is gone: drops picked up, pickables picked, chests emptied, deposits and other destructibles broken, and enemies killed. Allies and lasting objects such as portals and stations do not count.", Toggle.On); internal static readonly ConfigInfo<int> MaxTargets = new ConfigInfo<int>("10 - Perception", "Perception Max Outlines", new ConfigDescription("Maximum objects outlined per use, nearest first. Also limits what other players' scans can outline for you.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 200), Array.Empty<object>()), 64); internal static readonly ConfigInfo<float> FatigueDuration = new ConfigInfo<float>("10 - Perception", "Perception Fatigue Duration", new ConfigDescription("Fixed mode: seconds from using Perception until it can be used again, including Perception Duration, like a Guardian Power cooldown. Relative mode: seconds of fatigue once Perception ends, the base that the found objects and creatures add to. The Perception slot next to the Guardian Power counts it down. Set to 0 (and every cost to 0 in Relative mode) to disable.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 300f), Array.Empty<object>()), 60f); internal static readonly ConfigInfo<FatigueMode> Mode = new ConfigInfo<FatigueMode>("10 - Perception", "Perception Fatigue Mode", "Fixed: Perception can be used again Perception Fatigue Duration after the last use. Relative: fatigue starts once Perception ends, and the more Perception finds, the longer it lasts, using the costs below up to Perception Max Fatigue.", FatigueMode.Fixed); internal static readonly ConfigInfo<float> ObjectCost = new ConfigInfo<float>("10 - Perception", "Fatigue Per Object", new ConfigDescription("Relative mode: seconds of fatigue added for each listed object Perception outlines.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 30f), Array.Empty<object>()), 1.5f); internal static readonly ConfigInfo<float> DropCost = new ConfigInfo<float>("10 - Perception", "Fatigue Per Drop", new ConfigDescription("Relative mode: seconds of fatigue added for each dropped item on the ground Perception outlines.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 30f), Array.Empty<object>()), 0.25f); internal static readonly ConfigInfo<float> AllyCost = new ConfigInfo<float>("10 - Perception", "Fatigue Per Ally", new ConfigDescription("Relative mode: seconds of fatigue added for each tamed or non-hostile creature Perception highlights.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 30f), Array.Empty<object>()), 0.5f); internal static readonly ConfigInfo<float> EnemyCost = new ConfigInfo<float>("10 - Perception", "Fatigue Per Enemy", new ConfigDescription("Relative mode: seconds of fatigue added for each hostile creature Perception highlights.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 30f), Array.Empty<object>()), 2.5f); internal static readonly ConfigInfo<float> MaxFatigue = new ConfigInfo<float>("10 - Perception", "Perception Max Fatigue", new ConfigDescription("Relative mode: the longest Perception Fatigue can get, however much was found.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 600f), Array.Empty<object>()), 90f); internal static readonly ConfigInfo<Toggle> CreaturesEnabled = new ConfigInfo<Toggle>("10 - Perception", "Perceive Creatures", "Perception also highlights every hostile and allied creature within Perception Range with a nameplate and outline, up to Perception Max Outlines. These highlights do not count toward Max Highlighted Mobs. Requires Enable Mob Highlight.", Toggle.On); internal static readonly ConfigInfo<Toggle> EffectEnabled = new ConfigInfo<Toggle>("10 - Perception", "Perception Effect", "Play a Guardian Power style burst around a player who uses Perception, so you can see it was used. Nearby PingMark players see it too.", Toggle.On, synchronized: false); internal static readonly ConfigInfo<Color> EffectColor = new ConfigInfo<Color>("10 - Perception", "Perception Effect Color", "Color of the Perception burst, for your own Perception and other players'. Brightness follows the original effect.", new Color(0.35f, 0.8f, 1f), synchronized: false); internal static readonly ConfigInfo<string> EffectSound = new ConfigInfo<string>("10 - Perception", "Perception Sound", "Sound prefab played with the Perception burst instead of its Guardian Power blast, for example sfx_WishbonePing_near, sfx_secretfound or sfx_runestone_activate. Leave empty for silence.", "sfx_WishbonePing_near", synchronized: false); } internal static class PlayerHighlight { internal const string Group = "8 - Player Highlight"; internal static readonly ConfigInfo<float> Duration = new ConfigInfo<float>("8 - Player Highlight", "Player Highlight Duration", new ConfigDescription("Seconds a pinged player remains highlighted.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 120f), Array.Empty<object>()), 5f); internal static readonly ConfigInfo<Toggle> HideOwnOutline = new ConfigInfo<Toggle>("8 - Player Highlight", "Hide Own Player Outline", "Hide the outline on your own character when another player pings you. Other recipients still see your outline when player pinging is enabled.", Toggle.On); } internal static class CameraPing { internal const string Group = "3 - Camera Ping"; internal static readonly ConfigInfo<float> MaxDistance = new ConfigInfo<float>("3 - Camera Ping", "Max Distance", new ConfigDescription("Maximum camera ping distance in meters. If nothing is hit, ping this far along the view direction.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(10f, 2000f), Array.Empty<object>()), 500f, synchronized: false); internal static readonly ConfigInfo<float> MaxUnderwaterDepth = new ConfigInfo<float>("3 - Camera Ping", "Max Underwater Depth", new ConfigDescription("Maximum depth in meters below the water surface at which objects can be pinged. Deeper targets ping the water surface instead.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 100f), Array.Empty<object>()), 10f, synchronized: false) { IsAdvanced = true }; } internal static class PingTargets { internal const string Group = "4 - Ping Targets"; internal static readonly ConfigInfo<string> PrefabSections = new ConfigInfo<string>("4 - Ping Targets", "Prefab Sections", "Section definitions managed in the Prefab Collections editor.", "Version: 1\nSections:\n- Name: Valuables\n Prefabs: AshCrow, AshlandsBush2, AshlandsTreeLog1, AshlandsTreeLog2, AshlandsTreeLogHalf1, AshlandsTreeLogHalf2, Barnacle, BarnacleLava, barrell, barreltrap, beech_log, beech_log_half, Beehive, Beehive_Destruction, Birch_log, Birch_log_half, blackmarble_altar_crystal, blackmarble_post01, BlueberryBush, CargoCrate, caverock_ice_stalagmite, Charred_altar_bellfragment, Chest, cloth_hanging_door, cloth_hanging_door_double, cloth_hanging_long, CloudberryBush, Crow, dungeon_iron_pile, dvergrprops_barrel, DvergrProps_extractor_crate, dvergrprops_pickaxe, dvergrtown_wood_pole, dvergrtown_wood_wall01, elaking_trashpile, fenrirhide_hanging, FirTree_Big_log, FirTree_big_log_half, FirTree_log, FirTree_log_half, FirTree_Snow_log, FirTree_Snow_log_half, FlametalRockstand, FlametalRockstand_frac, FrozenGD, FrozenSkeleton_Pose1, FrozenSkeleton_Pose2, giant_brain, giant_brain_frac, giant_helmet1, giant_helmet1_destruction, giant_helmet2, giant_helmet2_destruction, giant_ribs, giant_ribs_frac, giant_skull, giant_skull_frac, giant_sword1, giant_sword1_destruction, giant_sword2, giant_sword2_destruction, goblin_totempole, goblin_trashpile, goldvein, goldvein_frac, Greydwarf_Root, Greydwarf_Surprise, GuckSack, GuckSack_small, hanging_hairstrands, Ice_floor_fractured, ice_rock1, ice_rock1_frac, IceShore, IronOre_scraps, LargeBone, LargeBone_half01, LargeBone_half02, Leviathan, LeviathanLava, LingonberryBush, loot_chest_stone, loot_chest_wood, loot_deepNorth_Granary, loot_deepNorth_TimberHall, LuredFaderEmber, LuredWisp, MineRock_Copper, MineRock_Iron, MineRock_Meteorite, MineRock_Meteorite_frac, MineRock_Obsidian, MineRock_Obsidian_frac, MineRock_Tin, MineRock_Tin_frac, morgenhole_pile, Morkhalla_Bedroll1, Morkhalla_Bedroll2, Morkhalla_ChestAncient, Morkhalla_Eye1, Morkhalla_Eye2, Morkhalla_Eye3, Morkhalla_Eye4, Morkhalla_Eye5_gemstone, Morkhalla_Eye6_gemstone, Morkhalla_Eye7_gemstone, Morkhalla_Rubble1, Morkhalla_Rubble2, Morkhalla_Rubble3, Morkhalla_Rubble4, Morkhalla_Rug_corner, Morkhalla_Rug_end1, Morkhalla_Rug_end2, Morkhalla_Rug_middle, Morkhalla_Rug_stair, Morkhalla_WeaponStand, mudpile, mudpile2, mudpile2_frac, mudpile_beacon, mudpile_frac, mudpile_fragile, mudpile_old, Oak_log, Oak_log_half, Pickable_Ashstone, Pickable_Barley, Pickable_Barley_Wild, Pickable_BlackCoreStand, Pickable_Bloodbag, Pickable_BogIronOre, Pickable_Branch, Pickable_Branch_Snow, Pickable_Carrot, Pickable_Charredskull, Pickable_Dandelion, Pickable_DolmenTreasure, Pickable_DragonEgg, Pickable_DvergerThing, Pickable_DvergrLantern, Pickable_DvergrMineTreasure, Pickable_DvergrStein, Pickable_Fiddlehead, Pickable_Fishingrod, Pickable_Flax, Pickable_Flax_Wild, Pickable_Flint, Pickable_ForestCryptRandom, Pickable_ForestCryptRemains01, Pickable_ForestCryptRemains02, Pickable_ForestCryptRemains03, Pickable_ForestCryptRemains04, Pickable_FrostCoreHanger, Pickable_GlowWorm, Pickable_Guck, Pickable_Hairstrands, Pickable_Hairstrands01, Pickable_Hairstrands02, Pickable_HardRockOffspring, Pickable_Item, Pickable_Kale, Pickable_MeatPile, Pickable_MeatRemains, Pickable_Meteorite, Pickable_MoltenCoreStand, Pickable_MorkHallaTreasure, Pickable_MountainCaveCrystal, Pickable_MountainCaveObsidian, Pickable_MountainCaveRandom, Pickable_MountainRemains01_buried, Pickable_Mushroom, Pickable_Mushroom_blue, Pickable_Mushroom_JotunPuffs, Pickable_Mushroom_Magecap, Pickable_Mushroom_yellow, Pickable_Oat, Pickable_Obsidian, Pickable_Onion, Pickable_Pot_Shard, Pickable_Poteitr, Pickable_RandomFood, Pickable_RoyalJelly, Pickable_SeedCarrot, Pickable_SeedKale, Pickable_SeedOnion, Pickable_SeedTurnip, Pickable_SmokePuff, Pickable_Snowball, Pickable_Stone, Pickable_StoneRock, Pickable_SulfurRock, Pickable_SunkenCryptRandom, Pickable_SurtlingCoreStand, Pickable_Swordpiece1, Pickable_Swordpiece2, Pickable_Swordpiece3, Pickable_Tar, Pickable_TarBig, Pickable_Thistle, Pickable_Tin, Pickable_Turnip, Pickable_VoltureEgg, piece_beehive, piece_birdnest, piece_chest, piece_chest_barrel, piece_chest_blackmetal, piece_chest_grausten, piece_chest_private, piece_chest_warderobe, piece_chest_wood, piece_gift1, piece_gift2, piece_gift3, piece_pot1, piece_pot1_cracked, piece_pot1_red, piece_pot2, piece_pot2_cracked, piece_pot2_red, piece_pot3, piece_pot3_cracked, piece_pot3_red, piece_sapcollector, PineTree_log, PineTree_log_half, PineTree_log_halfOLD, PineTree_logOLD, PineTree_Snow_log, PineTree_Snow_log_half, PineTree_Snow_log_half_frost_troll, PineTree_Snow_log_XL, PineTree_Snow_log_XL_half, prop_itemstand_TrophyDraugrElite, prop_itemstand_TrophyGoblinBrute, prop_itemstand_TrophyGoblinShaman, prop_itemstand_TrophyGreydwarf, prop_itemstand_TrophyGreydwarfBrute, prop_itemstand_TrophySeekerBrute, RaspberryBush, rock3_ice_frac, rock3_silver, rock3_silver_frac, rock4_copper, rock4_copper_frac, Seagal, shipwreck_karve_chest, shipwreck_vikingship_chest, silvervein, silvervein_frac, stoneblock_fracture, stonechest, SulfurArch, SwampTree1_log, TreasureChest_ashland_stone, TreasureChest_ashlands, TreasureChest_ashlands_fortress, TreasureChest_blackforest, TreasureChest_charredfortress, TreasureChest_deepnorth_village, TreasureChest_dvergr_loose_stone, TreasureChest_dvergrtower, TreasureChest_dvergrtown, TreasureChest_fCrypt, TreasureChest_forestcrypt, TreasureChest_forestcrypt_hildir, TreasureChest_heath, TreasureChest_heath_hildir, TreasureChest_meadows, TreasureChest_meadows_01, TreasureChest_meadows_02, TreasureChest_meadows_buried, TreasureChest_meadows_combat, TreasureChest_memorial_buried, TreasureChest_mistlands, TreasureChest_morkhalla, TreasureChest_mountaincave, TreasureChest_mountaincave_hildir, TreasureChest_mountains, TreasureChest_plains, TreasureChest_plains_stone, TreasureChest_plainsfortress_hildir, TreasureChest_sunkencrypt, TreasureChest_swamp, TreasureChest_trollcave, TrollFrost_Dead, TrollFrost_Frac, TrollFrost_Frac_arm, TrollFrost_Frac_legs, UnstableLavaRock, veg_skull_Ashlands, VineAsh, VineGreen, yggashoot_log, yggashoot_log_half, YggdrasilRoot\n Enabled: true\n ColorId: 5\n- Name: Locations\n Prefabs: AbandonedLogCabin02, AbandonedLogCabin03, AbandonedLogCabin04, altar, AncientUpgradeStation, AshlandRuins, BearCave, BigRockClearing, BogWitch_Camp, Castle, CharredFortress, CharredRuins1, CharredRuins2, CharredRuins3, CharredRuins4, CharredTowerRuins1, CharredTowerRuins1_dvergr, CharredTowerRuins2, CharredTowerRuins3, CombatRuin01, Crypt2, Crypt3, Crypt4, DN_Bossroom, DN_gammeltrollFrac01, DN_gammeltrollFrac02, DN_hut01, Dolmen01, Dolmen02, Dolmen03, FimbulLocation01, Fort1, FortressRuins, FrozenShip01_DN, FrozenShip02_DN, FrozenShip03_DN, GoblinCamp1, GoblinCamp2, GoblinCamp2_1, GoblinHut01, GoblinHut02, GoblinHut03, Grave1, Greydwarf_camp1, Greydwarf_camp2, Greydwarf_camp3, HalfBurried_ForestCrypt, Hildir_camp, Hildir_cave, Hildir_crypt, Hildir_plainsfortress, HotSpring1, HotSpring2, HotSpring3, IcePond1, InfestedTree01, LumberCamp, Maypole, Mistlands_DvergrBossEntrance1, Mistlands_DvergrTownEntrance1, Mistlands_DvergrTownEntrance2, Mistlands_Excavation1, Mistlands_Excavation2, Mistlands_Excavation3, Mistlands_Giant1, Mistlands_Giant2, Mistlands_GuardTower1_new, Mistlands_GuardTower1_ruined_new, Mistlands_GuardTower1_ruined_new2, Mistlands_GuardTower2_new, Mistlands_GuardTower3_new, Mistlands_GuardTower3_ruined_new, Mistlands_Harbour1, Mistlands_Lighthouse1_new, Mistlands_RoadPost1, Mistlands_RockSpire1, Mistlands_Statue1, Mistlands_Statue2, Mistlands_StatueGroup1, Mistlands_Swords1, Mistlands_Swords2, Mistlands_Swords3, Mistlands_Viaduct1, Mistlands_Viaduct2, MorgenHole1, MorgenHole2, MorgenHole3, MorkBorg, MountainCave01, MountainCave02, MountainGrave01, MountainWell1, NorthMemorialPlace, NorthVillage, Pillar1, Pillar2, PlaceofMystery1, PlaceofMystery2, PlaceofMystery3, Ruin1, Ruin2, Ruin3, ShipSetting01, ShipSetting02, ShipSetting03, ShipWreck01, ShipWreck01_DN, ShipWreck02, ShipWreck02_DN, ShipWreck03, ShipWreck04, Skull1, StatueEvil, StoneCircle, StoneHenge1, StoneHenge2, StoneHenge3, StoneHenge4, StoneHenge5, StoneHenge6, StoneHouse1, StoneHouse1_heath, StoneHouse2, StoneHouse2_heath, StoneHouse3, StoneHouse4, StoneHouse5, StoneHouse5_heath, StoneTower1, StoneTower2, StoneTower3, StoneTower4, StoneTowerRuins03, StoneTowerRuins04, StoneTowerRuins05, StoneTowerRuins05_leet, StoneTowerRuins07, StoneTowerRuins07_sunk, StoneTowerRuins08, StoneTowerRuins08_sunk, StoneTowerRuins09, StoneTowerRuins09_sunk, StoneTowerRuins10, StoneTowerRuins10_sunk, stonewall, SunkenCrypt1, SunkenCrypt2, SunkenCrypt3, SunkenCrypt4, SwampHut1, SwampHut1_1, SwampHut2, SwampHut2_1, SwampHut3, SwampHut3_1, SwampHut4, SwampHut5, SwampRuin1, SwampRuin2, SwampWell1, TarPit1, TarPit1_1, TarPit2, TarPit2_1, TarPit3, TarPit3_1, TheDarkestHole, TheHole01, TrollCave, TrollCave02, Vendor_BlackForest, Waymarker01, Waymarker02, WoodFarm1, WoodHouse1, WoodHouse10, WoodHouse11, WoodHouse12, WoodHouse13, WoodHouse2, WoodHouse3, WoodHouse4, WoodHouse5, WoodHouse6, WoodHouse7, WoodHouse8, WoodHouse9, WoodVillage1, WoodVillage2, xmastree\n Enabled: true\n ColorId: 9\n- Name: Useful\n Prefabs: ashwood_bed, ashwood_door, BatteringRam, bed, blackforge, BlackIce_Core, blastfurnace, BlobMorkBig, BogWitch, BogWitch_Fire_Pit, Bonemass, BonePileSpawner, BonePileSpawner_swamp, bonfire, BossStone_Bonemass, BossStone_DragonQueen, BossStone_Eikthyr, BossStone_Fader, BossStone_Moder, BossStone_TheElder, BossStone_TheQueen, BossStone_Yagluth, Candle_resin, Cart, CastleKit_brazier, CastleKit_groundtorch_unlit, Catapult, CelestialShard, charcoal_kiln, CharredStone_Spawner, darkwood_gate, dragoneggcup, Dragonqueen, DrakeLorestone, DrakeNest01, dungeon_forestcrypt_door, dungeon_queen_door, dungeon_sunkencrypt_irongate, dvergrtown_secretdoor, dvergrtown_slidingdoor, Eikthyrnir, eitrrefinery, EvilHeart_Forest, EvilHeart_Swamp, fader_bellholder, FaderLocation, fermenter, fire_pit, fire_pit_haldor, fire_pit_hildir, fire_pit_iron, FireHole, flametal_gate, forge, fuling_turret, GDKing, GoblinKing, goblinking_totemholder, GrapplingPoint, GrapplingPointSecondary, Haldor, hearth, Hildir, HildirChest1, HildirChest2, HildirChest3, hole_destructableDoor, hole_destructableDoor1, hole_destructableDoor2, incinerator, iron_grate, Karve, LootSpawner_pineforest, Morkborg_gate, Morkhalla_Drawbridge, Morkhalla_firepit, Morkhalla_jotun_gate, MountainKit_brazier, MountainKit_brazier_blue, MountainKit_wood_gate, offeraltar_FrozenKing_bossroom, piece_artisanstation, piece_bathtub, piece_bed02, piece_brazierceiling01, piece_brazierfloor01, piece_brazierfloor02, piece_cartographytable, piece_cauldron, piece_cookingstation, piece_cookingstation_iron, piece_drawbridge, piece_drawbridge_log, piece_dvergr_wood_door, piece_EternalPyre, piece_FaderEmbers, piece_FrostFoundry, piece_FrostKiln, piece_groundtorch, piece_groundtorch_blue, piece_groundtorch_green, piece_groundtorch_wood, piece_hexagonal_door, piece_jackoturnip, piece_magetable, piece_MeadCauldron, piece_oven, piece_preptable, piece_snowlantern, piece_spinningwheel, piece_stonecutter, piece_turret, piece_walltorch, piece_wisplure, piece_workbench, portal, portal_stone, portal_wood, prop_bonfire, prop_piece_brazierfloor01, Raft, Runestone_Ashlands, Runestone_BlackForest, Runestone_Boars, Runestone_DeepNorth, Runestone_Draugr, Runestone_Greydwarfs, Runestone_Meadows, Runestone_Mistlands, Runestone_Mountains, Runestone_Plains, Runestone_Swamps, Sled, smelter, Spawner_Bat, Spawner_Bjorn_sleeping, Spawner_Blob, Spawner_BlobElite, Spawner_BlobTar, Spawner_BlobTar_respawn_30, Spawner_Boar, Spawner_BogWitchKvastur_respawn_30, Spawner_Brood, Spawner_Charred, Spawner_Charred_Archer, Spawner_Charred_balista, Spawner_Charred_Dyrnwyn, Spawner_Charred_Mage, Spawner_CharredCross, Spawner_CharredStone, Spawner_CharredStone_Elite, Spawner_CharredStone_event, Spawner_Chicken, Spawner_Cultist, Spawner_Cultist_Hildir, Spawner_Cultist_Hildir_bossroom, Spawner_Draugr, Spawner_Draugr_Elite, Spawner_Draugr_Noise, Spawner_Draugr_Ranged, Spawner_Draugr_Ranged_Noise, Spawner_Draugr_respawn_30, Spawner_DraugrPile, Spawner_DvergerArbalest, Spawner_DvergerAshlands, Spawner_DvergerDeepNorth, Spawner_DvergerMage, Spawner_DvergerRandom, Spawner_ElakingMole_Wakeup, Spawner_FallenValkyrie, Spawner_Fenring, Spawner_Fish4, Spawner_Frysling, Spawner_Frysling_respawn_30, Spawner_Ghost, Spawner_Ghost_sleeping, Spawner_Ghost_Void, Spawner_Goblin, Spawner_GoblinArcher, Spawner_GoblinBrute, Spawner_GoblinBrute_Hildir, Spawner_GoblinDeepNorth, Spawner_GoblinShaman, Spawner_Greydwarf, Spawner_Greydwarf_Elite, Spawner_Greydwarf_Shaman, Spawner_Greydwarf_Surprise, Spawner_GreydwarfNest, Spawner_Hatchling, Spawner_Hen, Spawner_Hole, Spawner_Hole_double, Spawner_imp, Spawner_imp_respawn, Spawner_JotunDualWield, Spawner_JotunWarrior, Spawner_JotunWitch, Spawner_Kvastur, Spawner_Leech_cave, Spawner_Location_Elite, Spawner_Location_Greydwarf, Spawner_Location_Shaman, Spawner_Morgen, Spawner_Morgen_wakeup, Spawner_Seeker, Spawner_Seeker_respawn_240, Spawner_SeekerBrute, Spawner_SeekerBrute_respawn_240, Spawner_ShadowPerson, Spawner_Skeleton, Spawner_Skeleton_hildir, Spawner_Skeleton_hildir_bossroom, Spawner_Skeleton_Meadows, Spawner_Skeleton_Meadows_night_noarcher, Spawner_Skeleton_Mountains, Spawner_Skeleton_Mountains_night_noarcher, Spawner_Skeleton_night_noarcher, Spawner_Skeleton_poison, Spawner_Skeleton_respawn_30, Spawner_Skeleton_rise, Spawner_Skeleton_Swamp, Spawner_Skeleton_Swamp_night_noarcher, Spawner_StoneGolem, Spawner_Tick, Spawner_Tick_stared, Spawner_Tick_stared_respawn_240, Spawner_Troll, Spawner_TrollFrost, Spawner_Twitcher, Spawner_Ulv, Spawner_Volture, Spawner_Wraith, Spawner_Writhan, StartPlatform, StartTemple, stave_gate, sunken_crypt_gate, Trailership, TriggerSpawner_Brood, TriggerSpawner_Seeker, UpgradeStation, Vegvisir_Bonemass, Vegvisir_DNBoss, Vegvisir_Eikthyr, Vegvisir_Fader, Vegvisir_GDKing, Vegvisir_Hildir_Cave, Vegvisir_Hildir_Crypt, Vegvisir_Hildir_Tower, Vegvisir_Moder, Vegvisir_Queen, Vegvisir_Yagluth, VikingShip, VikingShip_Ashlands, VoltureNest, windmill, wood_door, wood_fence_gate, wood_gate, wood_window\n Enabled: true\n ColorId: 8"); internal static readonly ConfigInfo<Toggle> DropsEnabled = new ConfigInfo<Toggle>("4 - Ping Targets", "Enable Drops", "Outline and name pinged dropped items (weapons, armor, materials on the ground).", Toggle.On); internal static readonly ConfigInfo<Toggle> FishEnabled = new ConfigInfo<Toggle>("4 - Ping Targets", "Enable Fish", "Outline and name pinged fish, swimming or on the ground, with their quality.", Toggle.On); internal static readonly ConfigInfo<Toggle> GravestonesEnabled = new ConfigInfo<Toggle>("4 - Ping Targets", "Enable Gravestones", "Outline and name pinged gravestones.", Toggle.On); internal static readonly ConfigInfo<Toggle> PlayersEnabled = new ConfigInfo<Toggle>("4 - Ping Targets", "Enable Other Players", "Temporarily highlight pinged players instead of sending a ground ping. Player nameplates show distance when Show Distance is on.", Toggle.Off); internal static readonly ConfigInfo<Toggle> OthersEnabled = new ConfigInfo<Toggle>("4 - Ping Targets", "Enable All Other", "Outline and name any other pinged model that is not in the lists or a dropped item.", Toggle.Off); } } } internal static class PluginConfig { private static ConfigEntry<Toggle> _serverConfigLocked = null; internal static ConfigEntry<Toggle> Enabled = null; internal static ConfigEntry<float> RefreshInterval = null; internal static ConfigEntry<float> PingCooldown = null; internal static ConfigEntry<float> ZPingBroadcastDistance = null; internal static ConfigEntry<Toggle> SendZPingsToUnmoddedPlayers = null; internal static ConfigEntry<Toggle> DebugPrefabId = null; internal static ConfigEntry<Toggle> ShowAbilityNames = null; internal static ConfigEntry<Toggle> ShowPingerName = null; internal static ConfigEntry<Toggle> ShowDistance = null; internal static ConfigEntry<string> EmptyLabelText = null; internal static ConfigEntry<Toggle> UseKilometers = null; internal static ConfigEntry<Toggle> ShowTargetName = null; internal static ConfigEntry<Color> PingColor = null; internal static ConfigEntry<Toggle> MatchTextToOutline = null; internal static ConfigEntry<float> PingDuration = null; internal static ConfigEntry<float> CameraPingMaxDistance = null; internal static ConfigEntry<float> MaxUnderwaterDepth = null; internal static ConfigEntry<Toggle> DropsEnabled = null; internal static ConfigEntry<Toggle> FishEnabled = null; internal static ConfigEntry<Toggle> GravestonesEnabled = null; internal static ConfigEntry<Toggle> PlayersEnabled = null; internal static ConfigEntry<float> PlayerHighlightDuration = null; internal static ConfigEntry<Toggle> HideOwnPlayerOutline = null; internal static ConfigEntry<Toggle> OthersEnabled = null; internal static ConfigEntry<Toggle> PingOutlineEnabled = null; internal static ConfigEntry<float> OutlineWidth = null; internal static ConfigEntry<Color> PingDropColor = null; internal static ConfigEntry<Color> PingFishColor = null; internal static ConfigEntry<Color> PingPlayerColor = null; internal static ConfigEntry<Color> PingAnythingColor = null; internal static ConfigEntry<Color> HostileOutlineColor = null; internal static ConfigEntry<Color> AllyOutlineColor = null; internal static ConfigEntry<Color>[] PrefabSectionColors = Array.Empty<ConfigEntry<Color>>(); internal static ConfigEntry<int> UnassignedSectionColorId = null; internal static ConfigEntry<Toggle> MobHighlightEnabled = null; internal static ConfigEntry<Toggle> MobOutlineEnabled = null; internal static ConfigEntry<float> MobHighlightDuration = null; internal static ConfigEntry<int> MaxHighlightedMobs = null; internal static ConfigEntry<KeyboardShortcut> ToggleModShortcut = null; internal static ConfigEntry<KeyboardShortcut> PrefabEditorShortcut = null; internal static ConfigEntry<KeyboardShortcut> PingShortcut = null; internal static ConfigEntry<Toggle> PrefabEditorShortcutEnabled = null; internal static ConfigEntry<KeyboardShortcut> PerceptionShortcut = null; internal static ConfigEntry<KeyboardShortcut> FishsightShortcut = null; internal static ConfigEntry<Toggle> AutoOutlineHookedFish = null; internal static ConfigEntry<Toggle> PerceptionEnabled = null; internal static ConfigEntry<float> PerceptionRange = null; internal static ConfigEntry<Toggle> PerceptionLineOfSight = null; internal static ConfigEntry<float> PerceptionDuration = null; internal static ConfigEntry<Toggle> PerceptionEarlyEnd = null; internal static ConfigEntry<int> PerceptionMaxTargets = null; internal static ConfigEntry<float> PerceptionFatigueDuration = null; internal static ConfigEntry<Toggle> PerceptionCreaturesEnabled = null; internal static ConfigEntry<FatigueMode> PerceptionFatigueMode = null; internal static ConfigEntry<float> PerceptionObjectCost = null; internal static ConfigEntry<float> PerceptionDropCost = null; internal static ConfigEntry<float> PerceptionAllyCost = null; internal static ConfigEntry<float> PerceptionEnemyCost = null; internal static ConfigEntry<float> PerceptionMaxFatigue = null; internal static ConfigEntry<Toggle> PerceptionEffectEnabled = null; internal static ConfigEntry<Color> PerceptionEffectColor = null; internal static ConfigEntry<string> PerceptionEffectSound = null; internal static void Build(ConfigFile config, ConfigSync configSync) { ConfigOptions.Initialize(config, configSync); Enabled = ConfigOptions.Config(Constants.Groups.General.Enabled); _serverConfigLocked = ConfigOptions.Config(Constants.Groups.General.Lock); configSync.AddLockingConfigEntry<Toggle>(_serverConfigLocked); RefreshInterval = ConfigOptions.Config(Constants.Groups.General.RefreshInterval); PingCooldown = ConfigOptions.Config(Constants.Groups.General.PingCooldown); ZPingBroadcastDistance = ConfigOptions.Config(Constants.Groups.General.ZPingBroadcastDistance); SendZPingsToUnmoddedPlayers = ConfigOptions.Config(Constants.Groups.General.SendZPingsToUnmoddedPlayers); DebugPrefabId = ConfigOptions.Config(Constants.Groups.General.DebugPrefabId); ShowAbilityNames = ConfigOptions.Config(Constants.Groups.General.ShowAbilityNames); ShowPingerName = ConfigOptions.Config(Constants.Groups.PingLabel.ShowPingerName); ShowDistance = ConfigOptions.Config(Constants.Groups.PingLabel.ShowDistance); EmptyLabelText = ConfigOptions.Config(Constants.Groups.PingLabel.EmptyLabelText); UseKilometers = ConfigOptions.Config(Constants.Groups.PingLabel.UseKilometers); ShowTargetName = ConfigOptions.Config(Constants.Groups.PingLabel.ShowTargetName); PingColor = ConfigOptions.Config(Constants.Groups.PingLabel.PingColor); MatchTextToOutline = ConfigOptions.Config(Constants.Groups.PingLabel.MatchTextToOutline); PingDuration = ConfigOptions.Config(Constants.Groups.PingLabel.Duration); CameraPingMaxDistance = ConfigOptions.Config(Constants.Groups.CameraPing.MaxDistance); MaxUnderwaterDepth = ConfigOptions.Config(Constants.Groups.CameraPing.MaxUnderwaterDepth); DropsEnabled = ConfigOptions.Config(Constants.Groups.PingTargets.DropsEnabled); FishEnabled = ConfigOptions.Config(Constants.Groups.PingTargets.FishEnabled); GravestonesEnabled = ConfigOptions.Config(Constants.Groups.PingTargets.GravestonesEnabled); PlayersEnabled = ConfigOptions.Config(Constants.Groups.PingTargets.PlayersEnabled); PlayerHighlightDuration = ConfigOptions.Config(Constants.Groups.PlayerHighlight.Duration); HideOwnPlayerOutline = ConfigOptions.Config(Constants.Groups.PlayerHighlight.HideOwnOutline); OthersEnabled = ConfigOptions.Config(Constants.Groups.PingTargets.OthersEnabled); PingOutlineEnabled = ConfigOptions.Config(Constants.Groups.Outlines.PingOutlineEnabled); OutlineWidth = ConfigOptions.Config(Constants.Groups.Outlines.OutlineWidth); PingDropColor = ConfigOptions.Config(Constants.Groups.Outlines.PingDropColor); PingFishColor = ConfigOptions.Config(Constants.Groups.Outlines.PingFishColor); PingPlayerColor = ConfigOptions.Config(Constants.Groups.Outlines.PingPlayerColor); PingAnythingColor = ConfigOptions.Config(Constants.Groups.Outlines.PingAnythingColor); HostileOutlineColor = ConfigOptions.Config(Constants.Groups.Outlines.HostileOutlineColor); AllyOutlineColor = ConfigOptions.Config(Constants.Groups.Outlines.AllyOutlineColor); MigrateAllyOutlineColor(); PrefabSectionColors = new ConfigEntry<Color>[12] { ConfigOptions.Config(Constants.Groups.PrefabCollections.Color1), ConfigOptions.Config(Constants.Groups.PrefabCollections.Color2), ConfigOptions.Config(Constants.Groups.PrefabCollections.Color3), ConfigOptions.Config(Constants.Groups.PrefabCollections.Color4), ConfigOptions.Config(Constants.Groups.PrefabCollections.Color5), ConfigOptions.Config(Constants.Groups.PrefabCollections.Color6), ConfigOptions.Config(Constants.Groups.PrefabCollections.Color7), ConfigOptions.Config(Constants.Groups.PrefabCollections.Color8), ConfigOptions.Config(Constants.Groups.PrefabCollections.Color9), ConfigOptions.Config(Constants.Groups.PrefabCollections.Color10), ConfigOptions.Config(Constants.Groups.PrefabCollections.Color11), ConfigOptions.Config(Constants.Groups.PrefabCollections.Color12) }; UnassignedSectionColorId = ConfigOptions.Config(Constants.Groups.PrefabCollections.UnassignedColorId); MobHighlightEnabled = ConfigOptions.Config(Constants.Groups.MobHighlight.Enabled); MobOutlineEnabled = ConfigOptions.Config(Constants.Groups.MobHighlight.OutlineEnabled); MobHighlightDuration = ConfigOptions.Config(Constants.Groups.MobHighlight.MobHighlightDuration); MaxHighlightedMobs = ConfigOptions.Config(Constants.Groups.MobHighlight.MaxHighlightedMobs); ToggleModShortcut = ConfigOptions.Config(Constants.Groups.Inputs.ToggleModShortcut); PrefabEditorShortcut = ConfigOptions.Config(Constants.Groups.Inputs.PrefabEditorShortcut); PingShortcut = ConfigOptions.Config(Constants.Groups.Inputs.PingShortcut); MigrateRenamedShortcut(config); PerceptionShortcut = ConfigOptions.Config(Constants.Groups.Inputs.PerceptionShortcut); FishsightShortcut = ConfigOptions.Config(Constants.Groups.Inputs.FishsightShortcut); PrefabEditorShortcutEnabled = ConfigOptions.Config(Constants.Groups.Inputs.PrefabEditorShortcutEnabled); AutoOutlineHookedFish = ConfigOptions.Config(Constants.Groups.Fishing.AutoOutlineHookedFish); PerceptionEnabled = ConfigOptions.Config(Constants.Groups.Perception.Enabled); PerceptionRange = ConfigOptions.Config(Constants.Groups.Perception.Range); PerceptionLineOfSight = ConfigOptions.Config(Constants.Groups.Perception.LineOfSight); PerceptionDuration = ConfigOptions.Config(Constants.Groups.Perception.Duration); PerceptionEarlyEnd = ConfigOptions.Config(Constants.Groups.Perception.EarlyEnd); PerceptionMaxTargets = ConfigOptions.Config(Constants.Groups.Perception.MaxTargets); PerceptionFatigueDuration = ConfigOptions.Config(Constants.Groups.Perception.FatigueDuration); PerceptionCreaturesEnabled = ConfigOptions.Config(Constants.Groups.Perception.CreaturesEnabled); PerceptionFatigueMode = ConfigOptions.Config(Constants.Groups.Perception.Mode); PerceptionObjectCost = ConfigOptions.Config(Constants.Groups.Perception.ObjectCost); PerceptionDropCost = ConfigOptions.Config(Constants.Groups.Perception.DropCost); PerceptionAllyCost = ConfigOptions.Config(Constants.Groups.Perception.AllyCost); PerceptionEnemyCost = ConfigOptions.Config(Constants.Groups.Perception.EnemyCost); PerceptionMaxFatigue = ConfigOptions.Config(Constants.Groups.Perception.MaxFatigue); PerceptionEffectEnabled = ConfigOptions.Config(Constants.Groups.Perception.EffectEnabled); PerceptionEffectColor = ConfigOptions.Config(Constants.Groups.Perception.EffectColor); PerceptionEffectSound = ConfigOptions.Config(Constants.Groups.Perception.EffectSound); } private static void MigrateAllyOutlineColor() { //IL_0005: 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_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: 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_0025: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) Color32 left = Color32.op_Implicit(AllyOutlineColor.Value); if (SameColor(left, Color32.op_Implicit(new Color(0.5f, 0.85f, 0.3f))) || SameColor(left, Color32.op_Implicit(new Color(0.3f, 0.65f, 1f)))) { AllyOutlineColor.Value = Constants.Groups.Outlines.AllyOutlineColor.DefaultValue; } } private static bool SameColor(Color32 left, Color32 right) { //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_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_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002a: 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) if (left.r == right.r && left.g == right.g && left.b == right.b) { return left.a == right.a; } return false; } private static void MigrateRenamedShortcut(ConfigFile config) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: 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_0047: Unknown result type (might be due to invalid IL or missing references) ConfigEntry<KeyboardShortcut> val = config.Bind<KeyboardShortcut>("9 - Inputs", "Mob Highlight Shortcut", Constants.Groups.Inputs.PingShortcut.DefaultValue, (ConfigDescription)null); if (!((object)val.Value/*cast due to .constrained prefix*/).Equals((object?)Constants.Groups.Inputs.PingShortcut.DefaultValue)) { PingShortcut.Value = val.Value; } config.Remove(((ConfigEntryBase)val).Definition); config.Save(); } internal static Color GetPrefabSectionColor(int colorId) { //IL_0028: 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) if (PrefabSectionColors.Length == 0) { return Color.white; } int num = Mathf.Clamp(colorId - 1, 0, PrefabSectionColors.Length - 1); return PrefabSectionColors[num].Value; } } } namespace JoksterCube.PingMark.Patches.ZPing { [HarmonyPatch(typeof(ZRoutedRpc), "RouteRPC")] internal static class ZPingServerRoutingPatch { private const string Feature = "Server ping routing"; private const int MaxPackageSize = 1024; private const int MaxPerceptionPackageSize = 8192; private static bool Prefix(RoutedRPCData rpcData) { if (PatchGuard.IsDisabled("Server ping routing")) { return true; } try { return PrefixCore(rpcData); } catch (Exception exception) { PatchGuard.Fail("Server ping routing", exception); return true; } } private static bool PrefixCore(RoutedRPCData rpcData) { //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Expected O, but got Unknown //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) ZNet instance = ZNet.instance; if (!Object.op_Implicit((Object)(object)instance) || !instance.IsServer() || rpcData.m_targetPeerID != 0L || !((ZDOID)(ref rpcData.m_targetZDO)).IsNone()) { return true; } bool flag = false; if (rpcData.m_methodHash == StringExtensionMethods.GetStableHashCode("ChatMessage")) { if (!TryReadFallbackMarker(rpcData.m_parameters, out var isFallback) || !isFallback) { return true; } if (!PluginConfig.SendZPingsToUnmoddedPlayers.IsOn()) { return false; } flag = true; } else if (rpcData.m_methodHash != StringExtensionMethods.GetStableHashCode("JoksterCube.PingMark.ZLocationPing.v3") && rpcData.m_methodHash != StringExtensionMethods.GetStableHashCode("JoksterCube.PingMark.ZMobPing") && rpcData.m_methodHash != StringExtensionMethods.GetStableHashCode("JoksterCube.PingMark.ZPlayerPing") && rpcData.m_methodHash != StringExtensionMethods.GetStableHashCode("JoksterCube.PingMark.Perception")) { return true; } int num = ((rpcData.m_methodHash == StringExtensionMethods.GetStableHashCode("JoksterCube.PingMark.Perception")) ? 8192 : 1024); if (rpcData.m_parameters.Size() > num || !PingRateLimiter.TryConsume(rpcData.m_senderPeerID)) { return false; } Vector3 origin; try { rpcData.m_parameters.SetPos(0); origin = rpcData.m_parameters.ReadVector3(); } catch (Exception) { return false; } finally { rpcData.m_parameters.SetPos(0); } ZNetPeer peer = instance.GetPeer(rpcData.m_senderPeerID); if (peer != null) { origin = peer.m_refPos; } ZPackage val = new ZPackage(); rpcData.Serialize(val); foreach (ZNetPeer connectedPeer in instance.GetConnectedPeers()) { if (connectedPeer.m_uid == rpcData.m_senderPeerID || !connectedPeer.IsReady()) { continue; } bool flag2 = RpcHandlers.ValidatedPeers.Contains(connectedPeer.m_rpc); bool num2; if (!flag) { if (!flag2) { continue; } num2 = ZPingNetwork.IsInRange(origin, connectedPeer.m_refPos, PluginConfig.ZPingBroadcastDistance.Value); } else { num2 = !flag2; } if (num2) { connectedPeer.m_rpc.Invoke("RoutedRPC", new object[1] { val }); } } return false; } private static bool TryReadFallbackMarker(ZPackage parameters, out bool isFallback) { //IL_000b: 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) isFallback = false; try { parameters.SetPos(0); parameters.ReadVector3(); if (parameters.ReadInt() != 3) { return true; } new UserInfo().Deserialize(ref parameters); isFallback = parameters.ReadString() == "JoksterCube.PingMark.ZPingFallback"; return true; } catch (Exception) { return false; } finally { parameters.SetPos(0); } } } [HarmonyPatch(typeof(Chat), "RPC_ChatMessage")] internal static class ZPingVanillaFallbackPatch { private static bool Prefix(int type, string text) { if (type == 3) { return text != "JoksterCube.PingMark.ZPingFallback"; } return true; } } } namespace JoksterCube.PingMark.Patches.Session { [HarmonyPatch(typeof(ZNet), "OnDestroy")] internal static class SessionResetPatch { private const string Feature = "Session reset"; private static void Postfix() { if (PatchGuard.IsDisabled("Session reset")) { return; } try { PostfixCore(); } catch (Exception exception) { PatchGuard.Fail("Session reset", exception); } } private static void PostfixCore() { SessionState.Clear(); } } } namespace JoksterCube.PingMark.Patches.PrefabEditor { [HarmonyPatch(typeof(Menu), "IsActive")] internal static class PrefabEditorActivePatch { private static void Postfix(ref bool __result) { __result |= PrefabCollectionEditor.BlocksInput; } } [HarmonyPatch(typeof(Menu), "Update")] internal static class PrefabEditorMenuInputPatch { private static bool Prefix() { return !PrefabCollectionEditor.BlocksInput; } } [HarmonyPatch(typeof(GameCamera), "UpdateMouseCapture")] internal static class PrefabEditorMouseCapturePatch { private static bool Prefix() { if (!PrefabCollectionEditor.IsOpen) { return true; } PrefabCollectionEditor.ReleaseMouse(); return false; } } [HarmonyPatch(typeof(Menu), "IsVisible")] internal static class PrefabEditorVisiblePatch { private static void Postfix(ref bool __result) { __result |= PrefabCollectionEditor.BlocksInput; } } } namespace JoksterCube.PingMark.Patches.PingLabels { [HarmonyPatch(typeof(Minimap), "UpdatePingPins")] internal static class PingMapLabelPatch { private const string Feature = "Map ping labels"; private static void Postfix(List<PinData> ___m_pingPins, List<WorldTextInstance> ___m_tempShouts) { if (PatchGuard.IsDisabled("Map ping labels")) { return; } try { PostfixCore(___m_pingPins, ___m_tempShouts); } catch (Exception exception) { PatchGuard.Fail("Map ping labels", exception); } } private static void PostfixCore(List<PinData> ___m_pingPins, List<WorldTextInstance> ___m_tempShouts) { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Invalid comparison between Unknown and I4 if (!PluginConfig.Enabled.IsOn()) { return; } Player localPlayer = Player.m_localPlayer; if (!Object.op_Implicit((Object)(object)localPlayer)) { return; } int num = Mathf.Min(___m_pingPins.Count, ___m_tempShouts.Count); for (int i = 0; i < num; i++) { WorldTextInstance val = ___m_tempShouts[i]; if ((int)val.m_type == 3) { PinData val2 = ___m_pingPins[i]; string text = (val2.m_name = PingLabelFormatter.Get(val, localPlayer)); if (val2.m_NamePinData != null && Object.op_Implicit((Object)(object)val2.m_NamePinData.PinNameText)) { val2.m_NamePinData.PinNameText.text = text; } } } } } [HarmonyPatch(typeof(Chat), "UpdateWorldTextField")] internal static class PingWorldTextLabelPatch { private const string Feature = "Ping labels"; private static void Postfix(WorldTextInstance __0) { if (PatchGuard.IsDisabled("Ping labels")) { return; } try { PostfixCore(__0); } catch (Exception exception) { PatchGuard.Fail("Ping labels", exception); } } private static void PostfixCore(WorldTextInstance __0) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Invalid comparison between Unknown and I4 if ((int)__0.m_type == 3 && PluginConfig.Enabled.IsOn()) { Player localPlayer = Player.m_localPlayer; if (Object.op_Implicit((Object)(object)localPlayer)) { PingLabelFormatter.Invalidate(__0); ((TMP_Text)__0.m_textMeshField).text = PingLabelFormatter.Get(__0, localPlayer); } } } } [HarmonyPatch(typeof(Chat), "UpdateWorldTexts")] internal static class WorldTextsUpdatePatch { private const string Feature = "Ping labels"; private static readonly List<WorldTextInstance> Expired = new List<WorldTextInstance>(); private static TMP_FontAsset? _mapFont; private static void Prefix(float dt, List<WorldTextInstance> ___m_worldTexts, float ___m_worldTextTTL) { if (PatchGuard.IsDisabled("Ping labels")) { return; } try { PrefixCore(dt, ___m_worldTexts, ___m_worldTextTTL); } catch (Exception exception) { PatchGuard.Fail("Ping labels", exception); } } private static void PrefixCore(float dt, List<WorldTextInstance> worldTexts, float ttl) { //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Invalid comparison between Unknown and I4 //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) if (!PluginConfig.Enabled.IsOn()) { GroundPingLabelAnchors.Anchors.Clear(); return; } float num = dt * (ttl / Mathf.Max(PluginConfig.PingDuration.Value, 0.1f) - 1f); if (!Mathf.Approximately(num, 0f)) { foreach (WorldTextInstance worldText in worldTexts) { if ((int)worldText.m_type == 3) { worldText.m_timer += num; } } } foreach (KeyValuePair<WorldTextInstance, Vector3> anchor in GroundPingLabelAnchors.Anchors) { if (!Object.op_Implicit((Object)(object)anchor.Key.m_gui)) { Expired.Add(anchor.Key); } else { anchor.Key.m_position = anchor.Value - Vector3.up * (0.3f + dt * 0.15f); } } foreach (WorldTextInstance item in Expired) { GroundPingLabelAnchors.Anchors.Remove(item); } Expired.Clear(); } private static void Postfix(float dt, List<WorldTextInstance> ___m_worldTexts) { if (PatchGuard.IsDisabled("Ping labels")) { return; } try { PostfixCore(dt, ___m_worldTexts); } catch (Exception exception) { PatchGuard.Fail("Ping labels", exception); } } private static void PostfixCore(float dt, List<WorldTextInstance> ___m_worldTexts) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) OutlineManager.UpdatePings(___m_worldTexts); if (!PluginConfig.Enabled.IsOn()) { return; } foreach (KeyValuePair<WorldTextInstance, Vector3> anchor in GroundPingLabelAnchors.Anchors) { anchor.Key.m_position = anchor.Value; } UpdateLabelStyles(___m_worldTexts); Player localPlayer = Player.m_localPlayer; if (Object.op_Implicit((Object)(object)localPlayer)) { PingLabelFormatter.Tick(dt, ___m_worldTexts, localPlayer); } } private static void UpdateLabelStyles(List<WorldTextInstance> worldTexts) { //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Invalid comparison between Unknown and I4 //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)_mapFont) && Object.op_Implicit((Object)(object)Minimap.instance)) { GameObject pinNamePrefab = Minimap.instance.m_pinNamePrefab; if (pinNamePrefab != null && Object.op_Implicit((Object)(object)pinNamePrefab)) { TMP_Text val = (PingLabelFormatter.MapLabelTemplate = pinNamePrefab.GetComponentInChildren<TMP_Text>(true)); _mapFont = (Object.op_Implicit((Object)(object)val) ? val.font : null); } } PingLabelFormatter.MapFont = _mapFont; foreach (WorldTextInstance worldText in worldTexts) { if ((int)worldText.m_type == 3 && Object.op_Implicit((Object)(object)worldText.m_textMeshField)) { TMP_Text textMeshField = (TMP_Text)(object)worldText.m_textMeshField; if (Object.op_Implicit((Object)(object)_mapFont) && (Object)(object)textMeshField.font != (Object)(object)_mapFont) { textMeshField.font = _mapFont; } Color color; Color val2 = ((PluginConfig.MatchTextToOutline.IsOn() && OutlineManager.TryGetPingColor(worldText, out color)) ? color : PluginConfig.PingColor.Value); if (((Graphic)textMeshField).color != val2) { ((Graphic)textMeshField).color = val2; } } } } } } namespace JoksterCube.PingMark.Patches.Hud { [HarmonyPatch(typeof(Hud), "UpdateGuardianPower")] internal static class PerceptionHudPatch { private const string Feature = "Perception HUD"; private static void Postfix(Hud __instance) { if (PatchGuard.IsDisabled("Perception HUD")) { return; } try { AbilitySlot.SetNamesHidden(__instance, "PingMark", PluginConfig.Enabled.IsOn() && !PluginConfig.ShowAbilityNames.IsOn()); PerceptionHud.Update(__instance); HookedFish.UpdateHud(__instance); } catch (Exception exception) { PatchGuard.Fail("Perception HUD", exception); } } } } namespace JoksterCube.PingMark.Patches.Highlights { [HarmonyPatch(typeof(EnemyHud), "LateUpdate")] internal static class MobHighlightNamePatch { private sealed class Nameplate(string originalName) { internal readonly string OriginalName = originalName; internal readonly List<(Transform Transform, Vector3 Position)> Markers = new List<(Transform, Vector3)>(); internal TMP_Text? Label; internal string? Distance; internal string? Status; internal (ZDOID Id, long Order, string Distance, bool ShowName, bool ShowDistance)? TextKey; internal string Text = string.Empty; internal (Bounds Bounds, Rect Rect)? Layout; internal (TMP_FontAsset? Font, float Size, bool Auto, float Min, float Max, FontStyles Style, float Line, float Character, float Word, float Paragraph, float Width)? Style; internal void Restore(TMP_Text? name) { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)name)) { name.text = originalName; } if (Object.op_Implicit((Object)(object)Label)) { Object.Destroy((Object)(object)((Component)Label).gameObject); } foreach (var (val, localPosition) in Markers) { if (Object.op_Implicit((Object)(object)val)) { val.localPosition = localPosition; } } } } private const string Feature = "Creature nameplates"; private static readonly Dictionary<TMP_Text, Nameplate> Nameplates = new Dictionary<TMP_Text, Nameplate>(); private static readonly List<TMP_Text> Expired = new List<TMP_Text>(); private static float _distanceTimer; private static void Prefix(Dictionary<Character, HudData> ___m_huds) { if (PatchGuard.IsDisabled("Creature nameplates")) { return; } try { PrefixCore(___m_huds); } catch (Exception exception) { PatchGuard.Fail("Creature nameplates", exception); } } private static void PrefixCore(Dictionary<Character, HudData> ___m_huds) { foreach (KeyValuePair<Character, HudData> ___m_hud in ___m_huds) { if (MobHighlight.IsMarked(___m_hud.Key)) { ___m_hud.Value.m_hoverTimer = 0f; } } } private static void Postfix(Dictionary<Character, HudData> ___m_huds) { if (PatchGuard.IsDisabled("Creature nameplates")) { return; } try { PostfixCore(___m_huds); } catch (Exception exception) { PatchGuard.Fail("Creature nameplates", exception); } } private static void PostfixCore(Dictionary<Character, HudData> ___m_huds) { _distanceTimer += Time.deltaTime; if (_distanceTimer >= PluginConfig.RefreshInterval.Value) { _distanceTimer = 0f; foreach (Nameplate value3 in Nameplates.Values) { value3.Distance = (value3.Status = null); } } Player localPlayer = Player.m_localPlayer; foreach (KeyValuePair<Character, HudData> ___m_hud in ___m_huds) { TMP_Text name = (TMP_Text)(object)___m_hud.Value.m_name; if (!Object.op_Implicit((Object)(object)name)) { continue; } if (!MobHighlight.IsMarked(___m_hud.Key)) { if (Nameplates.TryGetValue(name, out Nameplate value)) { value.Restore(name); Nameplates.Remove(name); } continue; } if (!Nameplates.TryGetValue(name, out Nameplate value2)) { value2 = (Nameplates[name] = new Nameplate(name.text)); } if (Object.op_Implicit((Object)(object)localPlayer)) { UpdateNameplate(___m_hud.Key, ___m_hud.Value, name, value2, localPlayer); } } foreach (TMP_Text key in Nameplates.Keys) { if (!Object.op_Implicit((Object)(object)key)) { Expired.Add(key); } } foreach (TMP_Text item in Expired) { Nameplates[item].Restore(null); Nameplates.Remove(item); } Expired.Clear(); } private static void UpdateNameplate(Character character, HudData hud, TMP_Text name, Nameplate nameplate, Player localPlayer) { //IL_0014: 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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) Nameplate nameplate2 = nameplate; if (nameplate2.Distance == null) { nameplate2.Distance = PingLabelFormatter.FormatDistance(((Component)character).transform.position, localPlayer); } nameplate2 = nameplate; if (nameplate2.Status == null) { nameplate2.Status = PingLabelFormatter.GetTameStatus(character); } string text = nameplate.originalName + nameplate.Status; if (name.text != text) { name.text = text; } if (Object.op_Implicit((Object)(object)PingLabelFormatter.MapFont) && !Object.op_Implicit((Object)(object)nameplate.Label)) { CreateLabel(hud, name, nameplate); } TMP_Text label = nameplate.Label; if (!Object.op_Implicit((Object)(object)label)) { return; } ZDOID zDOID = character.GetZDOID(); long pingerOrder = MobHighlight.GetPingerOrder(character); (ZDOID, long, string, bool, bool) tuple = (zDOID, pingerOrder, nameplate.Distance, PluginConfig.ShowPingerName.IsOn(), PluginConfig.ShowDistance.IsOn()); if (!nameplate.TextKey.Equals(tuple)) { nameplate.TextKey = tuple; nameplate.Text = PingLabelFormatter.GetCharacterLabel(character, nameplate.Distance); } if (label.text != nameplate.Text) { label.text = nameplate.Text; } bool flag = nameplate.Text.Length > 0; if (((Component)label).gameObject.activeSelf != flag) { ((Component)label).gameObject.SetActive(flag); } UpdateLabelStyle(name, label, nameplate); Rect rect = name.rectTransform.rect; (Bounds, Rect)? layout = nameplate.Layout; (Bounds, Rect) tuple2; if (layout.HasValue) { tuple2 = layout.GetValueOrDefault(); if (!name.havePropertiesChanged && !(tuple2.Item2 != rect)) { goto IL_01b5; } } name.ForceMeshUpdate(false, false); nameplate.Layout = (tuple2 = (name.textBounds, rect)); goto IL_01b5; IL_01b5: Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(((Bounds)(ref tuple2.Item1)).center.x, ((Bounds)(ref tuple2.Item1)).max.y + 2f); if (label.rectTransform.anchoredPosition != val) { label.rectTransform.anchoredPosition = val; } } private static void CreateLabel(HudData hud, TMP_Text name, Nameplate nameplate) { //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) RectTransform rectTransform = name.rectTransform; GameObject val = Object.Instantiate<GameObject>(((Component)name).gameObject, name.transform.parent, false); ((Object)val).name = ((Object)((Component)name).gameObject).name + " PingMark"; TMP_Text component = val.GetComponent<TMP_Text>(); RectTransform rectTransform2 = component.rectTransform; if (nameplate.Markers.Count == 0) { Transform[] array = (Transform[])(object)new Transform[2] { (Transform)hud.m_alerted, (Transform)hud.m_aware }; foreach (Transform val2 in array) { if (Object.op_Implicit((Object)(object)val2)) { nameplate.Markers.Add((val2, val2.localPosition)); } } } ((Transform)rectTransform2).SetParent((Transform)(object)rectTransform, false); rectTransform2.anchorMin = rectTransform.pivot; rectTransform2.anchorMax = rectTransform.pivot; rectTransform2.pivot = new Vector2(0.5f, 0f); ((Transform)rectTransform2).localScale = Vector3.one; for (int j = 0; j < val.transform.childCount; j++) { ((Component)val.transform.GetChild(j)).gameObject.SetActive(false); } component.alignment = (TextAlignmentOptions)1026; ((Graphic)component).color = Color.white; ((Graphic)component).raycastTarget = false; nameplate.Label = component; nameplate.Style = null; UpdateLabelStyle(name, component, nameplate); } private static void UpdateLabelStyle(TMP_Text name, TMP_Text label, Nameplate nameplate) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_004a: 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_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) TMP_Text val = PingLabelFormatter.StyleSource(name); TMP_FontAsset? mapFont = PingLabelFormatter.MapFont; float fontSize = val.fontSize; bool enableAutoSizing = val.enableAutoSizing; float fontSizeMin = val.fontSizeMin; float fontSizeMax = val.fontSizeMax; FontStyles fontStyle = val.fontStyle; float lineSpacing = val.lineSpacing; float characterSpacing = val.characterSpacing; float wordSpacing = val.wordSpacing; float paragraphSpacing = val.paragraphSpacing; Rect rect = name.rectTransform.rect; (TMP_FontAsset, float, bool, float, float, FontStyles, float, float, float, float, float) tuple = (mapFont, fontSize, enableAutoSizing, fontSizeMin, fontSizeMax, fontStyle, lineSpacing, characterSpacing, wordSpacing, paragraphSpacing, ((Rect)(ref rect)).width); if (nameplate.Style.Equals(tuple)) { return; } nameplate.Style = tuple; label.font = PingLabelFormatter.MapFont; label.fontSize = val.fontSize; label.enableAutoSizing = val.enableAutoSizing; label.fontSizeMin = val.fontSizeMin; label.fontSizeMax = val.fontSizeMax; label.fontStyle = val.fontStyle; label.lineSpacing = val.lineSpacing; label.characterSpacing = val.characterSpacing; label.wordSpacing = val.wordSpacing; label.paragraphSpacing = val.paragraphSpacing; float y = val.GetPreferredValues("Mg").y; RectTransform rectTransform = label.rectTransform; rect = name.rectTransform.rect; rectTransform.sizeDelta = new Vector2(((Rect)(ref rect)).width, y * 2f); foreach (var (val2, val3) in nameplate.Markers) { if (Object.op_Implicit((Object)(object)val2)) { val2.localPosition = val3 + Vector3.up * (y * 2f); } } } } [HarmonyPatch(typeof(EnemyHud), "TestShow")] internal static class MobHighlightVisibilityPatch { private const string Feature = "Creature nameplates"; private static void Postfix(Character __0, ref bool __result) { if (PatchGuard.IsDisabled("Creature nameplates")) { return; } try { PostfixCore(__0, ref __result); } catch (Exception exception) { PatchGuard.Fail("Creature nameplates", exception); } } private static void PostfixCore(Character __0, ref bool __result) { if (MobHighlight.IsMarked(__0)) { __result = true; } } } } namespace JoksterCube.PingMark.Patches.GroundPing { [HarmonyPatch(typeof(Chat), "AddInworldText")] internal static class GroundPingAddLabelPatch { private const string Feature = "Ping labels"; private static void Prefix(string text, out string __state) { __state = text; } private static void Postfix(long senderID, Vector3 position, Type type, string __state, List<WorldTextInstance> ___m_worldTexts) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) if (PatchGuard.IsDisabled("Ping labels")) { return; } try { PostfixCore(senderID, position, type, __state, ___m_worldTexts); } catch (Exception exception) { PatchGuard.Fail("Ping labels", exception); } } private static void PostfixCore(long senderID, Vector3 position, Type type, string __state, List<WorldTextInstance> ___m_worldTexts) { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Invalid comparison between Unknown and I4 //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Invalid comparison between Unknown and I4 //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Invalid comparison between Unknown and I4 //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Invalid comparison between Unknown and I4 //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) string text = __state; WorldTextInstance val = ___m_worldTexts.Find((WorldTextInstance world) => world.m_talkerID == senderID); if (val == null) { return; } OutlineManager.SetPingTarget(val, null); if (!PluginConfig.Enabled.IsOn()) { GroundPingLabelAnchors.Anchors.Remove(val); return; } if ((int)type == 3) { GroundPingLabelAnchors.Anchors[val] = position; } else { GroundPingLabelAnchors.Anchors.Remove(val); } if ((int)type == 3 && Object.op_Implicit((Object)(object)ZNet.instance) && senderID == ZNet.GetUID() && MobTargeting.TryConsumeGroundPing(position, out string targetName, out PingTarget? target)) { OutlineManager.SetPingTarget(val, target ?? PingTargetResolver.FindTarget(position)); if (!string.IsNullOrWhiteSpace(targetName)) { text = targetName; } } else if ((int)type == 3) { ZDOID id; PingTarget? target2 = (ZPingNetwork.TryTakeRemoteTarget(senderID, position, out id) ? PingTargetResolver.ResolveInstance(id, position) : ((PingTarget?)null)) ?? PingTargetResolver.FindTarget(position); OutlineManager.SetPingTarget(val, target2); if (!string.IsNullOrWhiteSpace(text) && target2.HasValue) { PingTarget valueOrDefault = target2.GetValueOrDefault(); string name = valueOrDefault.Name; if (name != null && name.Length > 0) { text = valueOrDefault.Name; } } } if ((int)type == 3 && !string.IsNullOrWhiteSpace(text)) { val.m_text = text; PingLabelFormatter.Invalidate(val); Player localPlayer = Player.m_localPlayer; if (Object.op_Implicit((Object)(object)localPlayer) && Object.op_Implicit((Object)(object)val.m_textMeshField)) { ((TMP_Text)val.m_textMeshField).text = PingLabelFormatter.Get(val, localPlayer); } } } } } namespace JoksterCube.PingMark.Patches.Controls { internal static class ControlsMenuPatches { [HarmonyPatch(typeof(KeyboardMouseSettings), "Initialize")] private static class AddRowsPatch { private static void Prefix(KeyboardMouseSettings __instance) { Guard(delegate { ControlsMenu.AddRows(__instance); }); } } [HarmonyPatch(typeof(KeyboardMouseSettings), "UpdateBindings")] private static class UpdateLabelsPatch { private static void Postfix(KeyboardMouseSettings __instance) { Guard(delegate { ControlsMenu.UpdateLabels(__instance); }); } } [HarmonyPatch(typeof(KeyboardMouseSettings), "OnOkAsync")] private static class SavePatch { private static void Postfix() { Guard(ControlsMenu.Save); } } [HarmonyPatch(typeof(KeyboardMouseSettings), "ResetBindings")] private static class ResetPatch { private static void Postfix(KeyboardMouseSettings __instance) { Guard(delegate { ControlsMenu.Reset(__instance); }); } } private const string Feature = "Controls menu shortcuts"; private static void Guard(Action action) { if (PatchGuard.IsDisabled("Controls menu shortcuts")) { return; } try { action(); } catch (Exception exception) { PatchGuard.Fail("Controls menu shortcuts", exception); } } } } namespace JoksterCube.PingMark.Domain { internal static class ControlsMenu { private static readonly (string Name, string Label, Func<ConfigEntry<KeyboardShortcut>> Entry)[] Rows = new(string, string, Func<ConfigEntry<KeyboardShortcut>>)[3] { ("PingMark_Ping", "Ping", () => PluginConfig.PingShortcut), ("PingMark_Perception", "Perception", () => PluginConfig.PerceptionShortcut), ("PingMark_FishOutline", "Fishsight", () => PluginConfig.FishsightShortcut) }; private static Dictionary<string, KeyCode>? _keyCodes; internal static void AddRows(KeyboardMouseSettings settings) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Expected O, but got Unknown ZInput instance = ZInput.instance; if (instance == null) { return; } (string, string, Func<ConfigEntry<KeyboardShortcut>>)[] rows = Rows; for (int i = 0; i < rows.Length; i++) { (string, string, Func<ConfigEntry<KeyboardShortcut>>) tuple = rows[i]; ButtonDef obj = Button(instance, tuple.Item1); KeyboardShortcut value = tuple.Item3().Value; obj.Rebind(PathFor(((KeyboardShortcut)(ref value)).MainKey)); } List<KeySetting> keys = settings.m_keys; if (keys.Count == 0 || keys.Exists((KeySetting key) => key.m_keyName == Rows[0].Name)) { return; } int num = Mathf.Clamp(settings.m_keyRows, 1, keys.Count); KeySetting val = keys[num - 1]; int num2 = ((Transform)val.m_keyTransform).GetSiblingIndex() + 1; TMP_Text val4 = default(TMP_Text); for (int num3 = 0; num3 < Rows.Length; num3++) { RectTransform val2 = Object.Instantiate<RectTransform>(val.m_keyTransform, ((Transform)val.m_keyTransform).parent); ((Object)val2).name = Rows[num3].Name; ((Transform)val2).SetSiblingIndex(num2 + num3); Transform val3 = ((Transform)val2).Find("Label"); if (Object.op_Implicit((Object)(object)val3) && ((Component)val3).TryGetComponent<TMP_Text>(ref val4)) { val4.richText = true; val4.text = "<size=85%><color=#A8A8A8>PingMark ·</color></size> " + Rows[num3].Label; } keys.Insert(num + num3, new KeySetting { m_keyName = Rows[num3].Name, m_keyTransform = val2, m_blockedButtons = (val.m_blockedButtons ?? Array.Empty<KeyCode>()) }); } int num4 = Mathf.Max(1, settings.m_keyCols); settings.m_keyRows = Mathf.Max(settings.m_keyRows + Rows.Length, Mathf.CeilToInt((float)keys.Count / (float)num4)); FitGrid(((Transform)val.m_keyTransform).parent, settings.m_keyRows); } internal static void UpdateLabels(KeyboardMouseSettings settings) { //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) foreach (KeySetting key in settings.m_keys) { int num = Array.FindIndex(Rows, ((string Name, string Label, Func<ConfigEntry<KeyboardShortcut>> Entry) row) => row.Name == key.m_keyName); if (num < 0) { continue; } TMP_Text componentInChildren = ((Component)((Com