using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using ComfyLib; using HarmonyLib; using Microsoft.CodeAnalysis; using SoftReferenceableAssets; using TMPro; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("ZoneScouter")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("ZoneScouter")] [assembly: AssemblyCopyright("Copyright © 2022")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("185751b7-5cae-480a-8e9c-d8ec87ce481f")] [assembly: AssemblyFileVersion("1.9.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.9.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.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 ZoneScouter { public static class PluginConfig { public enum PositionValueOrder { XYZ, XZY } public enum PositionValueSeparator { Space, Comma } public enum GridSize { ThreeByThree = 3, FiveByFive = 5 } public static ConfigEntry IsModEnabled { get; private set; } public static ConfigEntry ShowSectorInfoPanel { get; private set; } public static ConfigEntry SectorInfoPanelPosition { get; private set; } public static ConfigEntry SectorInfoPanelBackgroundColor { get; private set; } public static ConfigEntry SectorInfoPanelFontSize { get; private set; } public static ConfigEntry PositionValueXTextColor { get; private set; } public static ConfigEntry PositionValueYTextColor { get; private set; } public static ConfigEntry PositionValueZTextColor { get; private set; } public static ConfigEntry PositionValueXBackgroundColor { get; private set; } public static ConfigEntry PositionValueYBackgroundColor { get; private set; } public static ConfigEntry PositionValueZBackgroundColor { get; private set; } public static ConfigEntry CopyPositionValuePrefix { get; private set; } public static ConfigEntry CopyPositionValueSeparator { get; private set; } public static ConfigEntry CopyPositionValueOrder { get; private set; } public static ConfigEntry ShowSectorContent { get; private set; } public static ConfigEntry ShowZDOManagerContent { get; private set; } public static ConfigEntry ShowSectorZdoCountGrid { get; private set; } public static ConfigEntry SectorZdoCountGridSize { get; private set; } public static ConfigEntry CellZdoCountBackgroundImageColor { get; private set; } public static ConfigEntry CellZdoCountTextFontSize { get; private set; } public static ConfigEntry CellZdoCountTextColor { get; private set; } public static ConfigEntry CellSectorBackgroundImageColor { get; private set; } public static ConfigEntry CellSectorTextFontSize { get; private set; } public static ConfigEntry CellSectorTextColor { get; private set; } public static ConfigEntry ShowSectorBoundaries { get; private set; } public static ConfigEntry SectorBoundaryColor { get; private set; } public static ConfigEntry ToggleSectorBoundariesShortcut { get; private set; } public static void BindConfig(ConfigFile config) { //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_0339: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Unknown result type (might be due to invalid IL or missing references) //IL_0560: Unknown result type (might be due to invalid IL or missing references) //IL_05f8: Unknown result type (might be due to invalid IL or missing references) //IL_0656: Unknown result type (might be due to invalid IL or missing references) //IL_0702: Unknown result type (might be due to invalid IL or missing references) //IL_07a6: Unknown result type (might be due to invalid IL or missing references) //IL_07f6: Unknown result type (might be due to invalid IL or missing references) IsModEnabled = config.BindInOrder("_Global", "isModEnabled", defaultValue: true, "Globally enable or disable this mod."); IsModEnabled.OnSettingChanged(SectorInfoPanelController.ToggleSectorInfoPanel); IsModEnabled.OnSettingChanged(SectorBoundaries.ToggleSectorBoundaries); ShowSectorInfoPanel = config.BindInOrder("SectorInfoPanel", "showSectorInfoPanel", defaultValue: true, "Show the SectorInfoPanel on the Hud."); ShowSectorInfoPanel.OnSettingChanged(SectorInfoPanelController.ToggleSectorInfoPanel); SectorInfoPanelPosition = config.BindInOrder("SectorInfoPanel", "sectorInfoPanelPosition", new Vector2(0f, -25f), "SectorInfoPanel position (relative to pivot/anchors)."); SectorInfoPanelPosition.OnSettingChanged((Action)SetSectorInfoPanelPosition); SectorInfoPanelBackgroundColor = config.BindInOrder("SectorInfoPanel", "sectorInfoPanelBackgroundColor", new Color(0f, 0f, 0f, 0.9f), "SectorInfoPanel background color."); SectorInfoPanelBackgroundColor.OnSettingChanged(SetSectorInfoPanelStyle); SectorInfoPanelFontSize = config.BindInOrder("SectorInfoPanel.Font", "sectorInfoPanelFontSize", 16, "SectorInfoPanel font size.", (AcceptableValueBase)(object)new AcceptableValueRange(2, 64)); SectorInfoPanelFontSize.OnSettingChanged(SetSectorInfoPanelStyle); PositionValueXTextColor = config.BindInOrder("SectorInfoPanel.PositionRow", "positionValueXTextColor", new Color(1f, 0.878f, 0.51f), "SectorInfoPanel.PositionRow.X value text color."); PositionValueXTextColor.OnSettingChanged(SetSectorInfoPanelStyle); PositionValueXBackgroundColor = config.BindInOrder("SectorInfoPanel.PositionRow", "positionValueXBackgroundColor", new Color(1f, 0.878f, 0.51f, 0.1f), "SectorInfoPanel.PositionRow.X value background color."); PositionValueXBackgroundColor.OnSettingChanged(SetSectorInfoPanelStyle); PositionValueYTextColor = config.BindInOrder("SectorInfoPanel.PositionRow", "positionValueYTextColor", new Color(0.565f, 0.792f, 0.976f), "SectorInfoPanel.PositionRow.Y value text color."); PositionValueYTextColor.OnSettingChanged(SetSectorInfoPanelStyle); PositionValueYBackgroundColor = config.BindInOrder("SectorInfoPanel.PositionRow", "positionValueYBackgroundColor", new Color(0.565f, 0.792f, 0.976f, 0.1f), "SectorInfoPanel.PositionRow.Y value background color."); PositionValueYBackgroundColor.OnSettingChanged(SetSectorInfoPanelStyle); PositionValueZTextColor = config.BindInOrder("SectorInfoPanel.PositionRow", "positionValueZTextColor", new Color(0.647f, 0.839f, 0.655f), "SectorInfoPanel.PositionRow.Z value text color."); PositionValueZTextColor.OnSettingChanged(SetSectorInfoPanelStyle); PositionValueZBackgroundColor = config.BindInOrder("SectorInfoPanel.PositionRow", "positionValueZBackgroundColor", new Color(0.647f, 0.839f, 0.655f, 0.1f), "SectorInfoPanel.PositionRow.Z value background color."); PositionValueZBackgroundColor.OnSettingChanged(SetSectorInfoPanelStyle); CopyPositionValuePrefix = config.BindInOrder("SectorInfoPanel.CopyPosition", "copyPositionValuePrefix", "Position: ", "Prefix to prepend to position text when copied to clipboard."); CopyPositionValueSeparator = config.BindInOrder("SectorInfoPanel.CopyPosition", "copyPositionValueSeparator", PositionValueSeparator.Space, "Separator to use between the position XYZ values when copied to clipboard."); CopyPositionValueOrder = config.BindInOrder("SectorInfoPanel.CopyPosition", "copyPositionValueOrder", PositionValueOrder.XYZ, "Order of the position XYZ values when copied to clipboard."); ShowSectorContent = config.BindInOrder("SectorInfoPanel.SectorContent", "showSectorContent", defaultValue: true, "Show SectorInfoPanel.Sector content."); ShowSectorContent.OnSettingChanged(SectorInfoPanelController.ToggleSectorContent); ShowZDOManagerContent = config.BindInOrder("SectorInfoPanel.ZDOManagerContent", "showZDOManagerContent", defaultValue: false, "Show SectorInfoPanel.ZDOManager content."); ShowZDOManagerContent.OnSettingChanged(SectorInfoPanelController.ToggleZDOManagerContent); ShowSectorZdoCountGrid = config.BindInOrder("SectorZdoCountGrid", "showSectorZdoCountGrid", defaultValue: false, "Show the SectorZdoCount grid in the SectorInfo panel."); ShowSectorZdoCountGrid.OnSettingChanged(SectorInfoPanelController.ToggleSectorZdoCountGrid); SectorZdoCountGridSize = config.BindInOrder("SectorZdoCountGrid", "sectorZdoCountGridSize", GridSize.ThreeByThree, "Size of the SectorZdoCount grid."); SectorZdoCountGridSize.OnSettingChanged(SectorInfoPanelController.ToggleSectorZdoCountGrid); CellZdoCountBackgroundImageColor = config.BindInOrder("SectorZdoCountGrid", "cellZdoCountBackgroundImageColor", Color.clear, "SectorZdoCountCell.ZdoCount.Background.Image color."); CellZdoCountBackgroundImageColor.OnSettingChanged(SetSectorZDOCountGridCellStyle); CellZdoCountTextFontSize = config.BindInOrder("SectorZdoCountGrid", "cellZdoCountTextFontSize", 16, "SectorZdoCountCell.ZdoCount.Text font size.", (AcceptableValueBase)(object)new AcceptableValueRange(2, 64)); CellZdoCountTextFontSize.OnSettingChanged(SetSectorZDOCountGridCellStyle); CellZdoCountTextColor = config.BindInOrder("SectorZdoCountGrid", "cellZdoCountTextColor", Color.white, "SectorZdoCountCell.ZdoCount.Text color."); CellZdoCountTextColor.OnSettingChanged(SetSectorZDOCountGridCellStyle); CellSectorBackgroundImageColor = config.BindInOrder("SectorZdoCountGrid", "cellSectorBackgroundImageColor", new Color(0.5f, 0.5f, 0.5f, 0.5f), "SectorZdoCountCell.Sector.Background.Image color."); CellSectorBackgroundImageColor.OnSettingChanged(SetSectorZDOCountGridCellStyle); CellSectorTextFontSize = config.BindInOrder("SectorZdoCountGrid", "cellSectorTextFontSize", 16, "SectorZdoCountCell.Sector.Text font size.", (AcceptableValueBase)(object)new AcceptableValueRange(2, 64)); CellSectorTextFontSize.OnSettingChanged(SetSectorZDOCountGridCellStyle); CellSectorTextColor = config.BindInOrder("SectorZdoCountGrid", "cellSectorTextColor", new Color(0.9f, 0.9f, 0.9f, 1f), "SectorZdoCountCell.Sector.Text color."); CellSectorTextColor.OnSettingChanged(SetSectorZDOCountGridCellStyle); ShowSectorBoundaries = config.BindInOrder("SectorBoundary", "showSectorBoundaries", defaultValue: false, "Shows sector boundaries using semi-transparent walls at each boundary."); ShowSectorBoundaries.OnSettingChanged(SectorBoundaries.ToggleSectorBoundaries); SectorBoundaryColor = config.BindInOrder("SectorBoundary", "sectorBoundaryColor", new Color(1f, 0f, 1f, 1f), "Color to use for the sector boundary walls."); SectorBoundaryColor.OnSettingChanged((Action)SectorBoundaries.SetBoundaryColor); ToggleSectorBoundariesShortcut = config.BindInOrder("SectorBoundary", "toggleSectorBoundariesShortcut", new KeyboardShortcut((KeyCode)0, Array.Empty()), "Shortcut to toggle on/off sector boundaries."); } private static void SetSectorInfoPanelPosition(Vector2 position) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) SectorInfoPanelController.SectorInfoPanel?.RectTransform.SetPosition(position); } private static void SetSectorInfoPanelStyle() { SectorInfoPanelController.SectorInfoPanel?.SetPanelStyle(); } private static void SetSectorZDOCountGridCellStyle() { SectorInfoPanelController.SectorZdoCountGrid?.SetCellStyle(); } } public static class SectorBoundaries { [CompilerGenerated] private sealed class d__9 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; private WaitForSeconds 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__9(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; if (num != 0) { if (num != 1) { return false; } <>1__state = -1; if (Object.op_Implicit((Object)(object)ZoneSystem.m_instance) && Object.op_Implicit((Object)(object)Player.m_localPlayer)) { Vector3 position = ((Component)Player.m_localPlayer).transform.position; Vector3 zonePos = ZoneSystem.GetZonePos(ZoneSystem.GetZone(position)); zonePos.y = position.y; _boundaryCube.transform.position = zonePos; } } else { <>1__state = -1; 5__2 = new WaitForSeconds(1f); } <>2__current = 5__2; <>1__state = 1; return true; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static readonly Vector2i UnsetSector = new Vector2i(int.MaxValue, int.MaxValue); private static Coroutine _updateBoundaryCubeCoroutine; private static Vector2i _lastBoundarySector = UnsetSector; private static GameObject _boundaryCube; private static readonly List _boundaryWallRendererCache = new List(); public static void ToggleSectorBoundaries() { TearDown(); StartUp(); } public static void SetBoundaryColor(Color targetColor) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) if (!PluginConfig.IsModEnabled.Value || !Object.op_Implicit((Object)(object)_boundaryCube)) { return; } foreach (MeshRenderer item in _boundaryWallRendererCache) { ((Renderer)item).material.SetColor("_Color", targetColor); } } private static void TearDown() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) if (_updateBoundaryCubeCoroutine != null && Object.op_Implicit((Object)(object)Hud.m_instance)) { ((MonoBehaviour)Hud.m_instance).StopCoroutine(_updateBoundaryCubeCoroutine); } _updateBoundaryCubeCoroutine = null; _lastBoundarySector = UnsetSector; if (Object.op_Implicit((Object)(object)_boundaryCube)) { Object.Destroy((Object)(object)_boundaryCube); } _boundaryCube = null; _boundaryWallRendererCache.Clear(); } private static void StartUp() { if (PluginConfig.IsModEnabled.Value && PluginConfig.ShowSectorBoundaries.Value && Object.op_Implicit((Object)(object)Hud.m_instance)) { _boundaryCube = CreateBoundaryCube(); _boundaryWallRendererCache.AddRange(_boundaryCube.GetComponentsInChildren()); _updateBoundaryCubeCoroutine = ((MonoBehaviour)Hud.m_instance).StartCoroutine(UpdateBoundaryCubeCoroutine()); } } [IteratorStateMachine(typeof(d__9))] private static IEnumerator UpdateBoundaryCubeCoroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__9(0); } private static GameObject CreateBoundaryCube() { //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_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Expected O, but got Unknown //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Expected O, but got Unknown //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Expected O, but got Unknown //IL_00d7: Expected O, but got Unknown GameObject val = new GameObject("BoundaryCube"); val.transform.position = Vector3.zero; CreateBoundaryCubeWall(val, new Vector3(32f, -256f, 0f), new Vector3(0.1f, 1024f, 64f)); CreateBoundaryCubeWall(val, new Vector3(-32f, -256f, 0f), new Vector3(0.1f, 1024f, 64f)); CreateBoundaryCubeWall(val, new Vector3(0f, -256f, 32f), new Vector3(64f, 1024f, 0.1f)); CreateBoundaryCubeWall(val, new Vector3(0f, -256f, -32f), new Vector3(64f, 1024f, 0.1f)); return val; } private static GameObject CreateBoundaryCubeWall(GameObject cube, Vector3 position, Vector3 scale) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) GameObject obj = GameObject.CreatePrimitive((PrimitiveType)3); ((Object)obj).name = "BoundaryCube.Wall"; obj.transform.SetParent(cube.transform, false); obj.transform.localPosition = position; obj.transform.localScale = scale; MeshRenderer component = obj.GetComponent(); ((Renderer)component).material.SetColor("_Color", PluginConfig.SectorBoundaryColor.Value); ((Renderer)component).material.shader = AssetUtils.DistortionShader; Object.Destroy((Object)(object)obj.GetComponentInChildren()); return obj; } } public static class SectorInfoPanelController { [CompilerGenerated] private static class <>O { public static EventHandler <0>__OnSectorInfoPanelEndDrag; public static UnityAction <1>__CopyPlayerPositionToClipboard; } [CompilerGenerated] private sealed class d__19 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; private WaitForSeconds 5__2; private Vector3 5__3; private Vector2i 5__4; private long 5__5; private uint 5__6; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__19(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; if (num != 0) { if (num != 1) { return false; } <>1__state = -1; if (Object.op_Implicit((Object)(object)ZoneSystem.m_instance) && Object.op_Implicit((Object)(object)Player.m_localPlayer) && Object.op_Implicit((Object)(object)SectorInfoPanel?.Panel)) { uint nextUid = ZDOMan.s_instance.m_nextUid; if (nextUid != 5__6) { SectorInfoPanel.ZDOManagerNextId.Value.SetText($"{nextUid:D}"); 5__6 = nextUid; } Vector3 position = ((Component)Player.m_localPlayer).transform.position; if (position != 5__3) { 5__3 = position; SectorInfoPanel.PositionX.Value.SetText($"{position.x:F0}"); SectorInfoPanel.PositionY.Value.SetText($"{position.y:F0}"); SectorInfoPanel.PositionZ.Value.SetText($"{position.z:F0}"); } Vector2i zone = ZoneSystem.GetZone(position); long sectorZdoCount = GetSectorZdoCount(zone); if (!(zone == 5__4) || sectorZdoCount != 5__5) { 5__4 = zone; 5__5 = sectorZdoCount; SectorInfoPanel.SectorXY.Value.SetText($"{zone.x},{zone.y}"); SectorInfoPanel.SectorZdoCount.Value.SetText($"{sectorZdoCount}"); } } } else { <>1__state = -1; 5__2 = new WaitForSeconds(0.25f); 5__3 = Vector3.positiveInfinity; 5__4 = new Vector2i(int.MinValue, int.MaxValue); 5__5 = long.MaxValue; 5__6 = uint.MaxValue; } <>2__current = 5__2; <>1__state = 1; return true; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__20 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; private WaitForSeconds 5__2; private int 5__3; private int 5__4; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__20(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Expected O, but got Unknown //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; if (!Object.op_Implicit((Object)(object)SectorZdoCountGrid?.Grid)) { return false; } 5__2 = new WaitForSeconds(1f); 5__3 = SectorZdoCountGrid.Size; 5__4 = Mathf.FloorToInt((float)5__3 / 2f); break; case 1: <>1__state = -1; break; case 2: <>1__state = -1; break; } if (Object.op_Implicit((Object)(object)SectorZdoCountGrid?.Grid)) { if (!Object.op_Implicit((Object)(object)Player.m_localPlayer)) { <>2__current = 5__2; <>1__state = 1; return true; } Vector2i zone = ZoneSystem.GetZone(((Component)Player.m_localPlayer).transform.position); Vector2i val = default(Vector2i); for (int i = 0; i < 5__3; i++) { for (int j = 0; j < 5__3; j++) { ((Vector2i)(ref val))..ctor(zone.x + i - 5__4, zone.y - j + 5__4); SectorZdoCountCell sectorZdoCountCell = SectorZdoCountGrid.Cells[j, i]; sectorZdoCountCell.ZdoCount.SetText($"{GetSectorZdoCount(val)}"); sectorZdoCountCell.Sector.SetText($"{val.x},{val.y}"); } } <>2__current = 5__2; <>1__state = 2; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static readonly Dictionary SectorToIndexCache = new Dictionary(); private static Coroutine _updateSectorInfoPanelCoroutine; private static Coroutine _updateSectorZdoCountGridCoroutine; public static SectorInfoPanel SectorInfoPanel { get; private set; } public static SectorZdoCountGrid SectorZdoCountGrid { get; private set; } public static void ToggleSectorInfoPanel() { //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Expected O, but got Unknown if (_updateSectorInfoPanelCoroutine != null) { ((MonoBehaviour)Hud.m_instance.Ref()).StopCoroutine(_updateSectorInfoPanelCoroutine); _updateSectorInfoPanelCoroutine = null; } if (Object.op_Implicit((Object)(object)SectorInfoPanel?.Panel)) { Object.Destroy((Object)(object)SectorInfoPanel.Panel); SectorInfoPanel = null; } if (PluginConfig.IsModEnabled.Value && PluginConfig.ShowSectorInfoPanel.Value && Object.op_Implicit((Object)(object)Hud.m_instance)) { SectorInfoPanel = new SectorInfoPanel(((Component)Hud.m_instance).transform); ((Transform)SectorInfoPanel.RectTransform.SetAnchorMin(new Vector2(0.5f, 1f)).SetAnchorMax(new Vector2(0.5f, 1f)).SetPivot(new Vector2(0.5f, 1f)) .SetPosition(PluginConfig.SectorInfoPanelPosition.Value) .SetSizeDelta(new Vector2(200f, 200f))).SetAsFirstSibling(); SectorInfoPanel.PanelDragger.OnPanelEndDrag += OnSectorInfoPanelEndDrag; ButtonClickedEvent onClick = SectorInfoPanel.CopyPositionButton.Button.onClick; object obj = <>O.<1>__CopyPlayerPositionToClipboard; if (obj == null) { UnityAction val = CopyPlayerPositionToClipboard; <>O.<1>__CopyPlayerPositionToClipboard = val; obj = (object)val; } ((UnityEvent)onClick).AddListener((UnityAction)obj); SectorInfoPanel.Panel.SetActive(true); _updateSectorInfoPanelCoroutine = ((MonoBehaviour)Hud.m_instance).StartCoroutine(UpdateSectorInfoPanelCoroutine()); } ToggleSectorZdoCountGrid(); } public static void OnSectorInfoPanelEndDrag(object sender, Vector3 position) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) PluginConfig.SectorInfoPanelPosition.Value = Vector2.op_Implicit(position); } public static bool HasValidPanel() { return Object.op_Implicit((Object)(object)SectorInfoPanel?.Panel); } public static void ToggleSectorContent(bool toggleOn) { if (HasValidPanel()) { SectorInfoPanel.ToggleSectorContent(toggleOn); } } public static void ToggleZDOManagerContent(bool toggleOn) { if (HasValidPanel()) { SectorInfoPanel.ToggleZDOManagerContent(toggleOn); } } public static void ToggleMenuComponents(bool toggleOn) { if (HasValidPanel()) { SectorInfoPanel.ToggleMenuComponents(toggleOn); } } public static void ToggleSectorZdoCountGrid() { if (_updateSectorZdoCountGridCoroutine != null && Object.op_Implicit((Object)(object)Hud.m_instance)) { ((MonoBehaviour)Hud.m_instance).StopCoroutine(_updateSectorZdoCountGridCoroutine); _updateSectorZdoCountGridCoroutine = null; } if (Object.op_Implicit((Object)(object)SectorZdoCountGrid?.Grid)) { Object.Destroy((Object)(object)SectorZdoCountGrid.Grid); SectorZdoCountGrid = null; } if (PluginConfig.IsModEnabled.Value && PluginConfig.ShowSectorInfoPanel.Value && PluginConfig.ShowSectorZdoCountGrid.Value && Object.op_Implicit((Object)(object)SectorInfoPanel?.Panel)) { SectorZdoCountGrid = new SectorZdoCountGrid(SectorInfoPanel.Panel.transform, PluginConfig.SectorZdoCountGridSize.Value); SectorZdoCountGrid.Grid.SetActive(true); _updateSectorZdoCountGridCoroutine = ((MonoBehaviour)Hud.m_instance).StartCoroutine(UpdateSectorZdoCountGrid()); } } private static long GetSectorZdoCount(Vector2i sector) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) if (!SectorToIndexCache.TryGetValue(sector, out var value)) { value = ZDOMan.s_instance.SectorToIndex(sector); SectorToIndexCache[sector] = value; } if (value < 0) { return 0L; } return ZDOMan.s_instance.m_objectsBySector[value]?.Count ?? 0; } [IteratorStateMachine(typeof(d__19))] private static IEnumerator UpdateSectorInfoPanelCoroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__19(0); } [IteratorStateMachine(typeof(d__20))] private static IEnumerator UpdateSectorZdoCountGrid() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__20(0); } public static void CopyPlayerPositionToClipboard() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)Player.m_localPlayer)) { CopyPositionToClipboard(((Component)Player.m_localPlayer).transform.position); } } public static void CopyPositionToClipboard(Vector3 targetPosition) { //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) string value = PluginConfig.CopyPositionValuePrefix.Value; string text = ((PluginConfig.CopyPositionValueSeparator.Value == PluginConfig.PositionValueSeparator.Space) ? " " : ","); ChatExtensions.AddMessage(obj: "Copied to clipboard: " + (GUIUtility.systemCopyBuffer = ((PluginConfig.CopyPositionValueOrder.Value == PluginConfig.PositionValueOrder.XYZ) ? $"{value}{targetPosition.x:F0}{text}{targetPosition.y:F0}{text}{targetPosition.z:F0}" : $"{value}{targetPosition.x:F0}{text}{targetPosition.z:F0}{text}{targetPosition.y:F0}")), chat: Chat.instance); } } public sealed class ButtonCell { private static readonly Lazy _buttonColorBlock = new Lazy((Func)delegate { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) ColorBlock result = default(ColorBlock); ((ColorBlock)(ref result)).normalColor = new Color(0f, 0f, 0f, 0.3f); ((ColorBlock)(ref result)).highlightedColor = new Color(0.565f, 0.792f, 0.976f, 0.3f); ((ColorBlock)(ref result)).disabledColor = new Color(0.5f, 0.5f, 0.5f, 0.3f); ((ColorBlock)(ref result)).pressedColor = new Color(1f, 0.878f, 0.51f, 0.3f); ((ColorBlock)(ref result)).selectedColor = new Color(0.647f, 0.839f, 0.655f, 0.3f); ((ColorBlock)(ref result)).colorMultiplier = 1f; ((ColorBlock)(ref result)).fadeDuration = 0.1f; return result; }); public GameObject Cell { get; private set; } public Image Background { get; private set; } public TMP_Text Label { get; private set; } public Button Button { get; private set; } public ButtonCell(Transform parentTransform) { //IL_0072: Unknown result type (might be due to invalid IL or missing references) Cell = CreateChildCell(parentTransform); Background = CreateChildBackground(Cell.transform).GetComponent(); Label = CreateChildLabel(((Component)Background).transform); Button = Cell.AddComponent