using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Core.Logging.Interpolation;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using Il2CppInterop.Runtime.Attributes;
using Il2CppInterop.Runtime.InteropTypes;
using Il2CppSystem.Collections.Generic;
using Mirror;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("AERX")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyCopyright("Copyright (c) 2026 AERX")]
[assembly: AssemblyDescription("Nearby object markers for Big Walk, by AERX.")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("BigWalk.AllObjectMarkers")]
[assembly: AssemblyTitle("BigWalk.AllObjectMarkers")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace BigWalk.AllObjectMarkers;
internal static class MarkerMath
{
internal static bool Matches(string name, string filter)
{
if (string.IsNullOrWhiteSpace(filter))
{
return true;
}
string[] array = filter.Split(',', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
foreach (string value in array)
{
if (name.Contains(value, StringComparison.OrdinalIgnoreCase))
{
return true;
}
}
return false;
}
internal static string CleanName(string name)
{
string text = (name ?? "Object").Replace("(Clone)", "").Trim();
if (text.Length != 0)
{
return text;
}
return "Object";
}
internal static int VisibleCount(int count, int maximum)
{
if (maximum > 0)
{
return Math.Min(count, maximum);
}
return count;
}
internal static (float x, float y, bool edge) Project(float x, float y, float depth, float width, float height, float margin)
{
float num = Math.Max(1f, width / 2f - margin);
float num2 = Math.Max(1f, height / 2f - margin);
float num3 = x - width / 2f;
float num4 = height / 2f - y;
if (!(depth <= 0f) && !(Math.Abs(num3) > num) && !(Math.Abs(num4) > num2))
{
return (x: x, y: height - y, edge: false);
}
if (depth <= 0f)
{
num3 = 0f - num3;
num4 = 0f - num4;
}
if (Math.Abs(num3) + Math.Abs(num4) < 0.001f)
{
num4 = num2;
}
float num5 = Math.Max(Math.Abs(num3) / num, Math.Abs(num4) / num2);
return (x: width / 2f + num3 / num5, y: height / 2f + num4 / num5, edge: true);
}
}
public sealed class MarkerOverlay : MonoBehaviour
{
private sealed class Target
{
internal Transform Transform;
internal string Name = "";
internal int Kind;
internal float DistanceSquared;
}
private readonly List<Target> _targets = new List<Target>();
private readonly List<Target> _nearby = new List<Target>();
private readonly HashSet<int> _seen = new HashSet<int>();
private PlayerCharacter _player;
private Camera _camera;
private float _nextDiscovery;
private float _nextRange;
private float _nextPlayer;
private float _nextWarning;
private bool _menu;
private bool _waiting = true;
private bool _ownsMenuBlock;
private bool _previousCursorVisible;
private CursorLockMode _previousCursorLock;
private PlayerCharacter _menuPlayer;
private GUIStyle _label;
private GUIStyle _panelText;
private GUIStyle _title;
private GUIStyle _button;
private GUIStyle _field;
private GUIStyle _toggle;
private Font _font;
private string _status = "等待进入游戏";
private int _drawn;
private int _edges;
private static Plugin P => Plugin.Instance;
public MarkerOverlay(IntPtr pointer)
: base(pointer)
{
}
public void Update()
{
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_00c4: 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)
try
{
if (Time.unscaledTime >= _nextPlayer)
{
_nextPlayer = Time.unscaledTime + 1f;
FindLocalPlayer();
}
if (Input.GetKeyDown(P.MenuKey.Value))
{
if (_menu)
{
CloseMenu();
}
else
{
OpenMenu();
}
}
if (!_menu && Input.GetKeyDown(P.ToggleKey.Value))
{
P.MarkersEnabled.Value = !P.MarkersEnabled.Value;
_nextDiscovery = (_nextRange = 0f);
((BasePlugin)P).Config.Save();
}
if (!_menu && Input.GetKeyDown(P.ModeKey.Value))
{
ToggleScenery();
}
if (!_menu && Input.GetKeyDown(P.RefreshKey.Value))
{
_nextDiscovery = (_nextRange = 0f);
}
if ((Object)(object)_player == (Object)null || (Object)(object)_camera == (Object)null || !((Component)_player).gameObject.activeInHierarchy)
{
_waiting = true;
_nearby.Clear();
_status = "等待进入游戏";
return;
}
_waiting = false;
if (!P.MarkersEnabled.Value)
{
_drawn = (_edges = 0);
return;
}
if (Time.unscaledTime >= _nextDiscovery)
{
_nextDiscovery = Time.unscaledTime + P.DiscoverySeconds.Value;
Discover();
_nextRange = 0f;
}
if (Time.unscaledTime >= _nextRange)
{
_nextRange = Time.unscaledTime + P.RefreshSeconds.Value;
UpdateNearby();
}
}
catch (Exception exception)
{
Warn("Update", exception);
}
}
public void LateUpdate()
{
if (_menu)
{
Cursor.lockState = (CursorLockMode)0;
Cursor.visible = true;
}
}
[HideFromIl2Cpp]
private void OpenMenu()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
_previousCursorLock = Cursor.lockState;
_previousCursorVisible = Cursor.visible;
_menuPlayer = _player;
_ownsMenuBlock = (Object)(object)_menuPlayer != (Object)null && _menuPlayer.menu != null && !_menuPlayer.menu.localHasMenuOpen;
if (_ownsMenuBlock)
{
_menuPlayer.menu.SetMenuOpen(true);
}
_menu = true;
Cursor.lockState = (CursorLockMode)0;
Cursor.visible = true;
}
[HideFromIl2Cpp]
private void CloseMenu()
{
//IL_0084: Unknown result type (might be due to invalid IL or missing references)
if (!_menu)
{
return;
}
_menu = false;
if (_ownsMenuBlock && (Object)(object)_menuPlayer != (Object)null && _menuPlayer.menu != null)
{
_menuPlayer.menu.SetMenuOpen(false);
}
_ownsMenuBlock = false;
_menuPlayer = null;
int num;
int num2;
if ((Object)(object)_player != (Object)null && _player.menu != null)
{
num = (_player.menu.localHasMenuOpen ? 1 : 0);
if (num != 0)
{
num2 = 0;
goto IL_008c;
}
}
else
{
num = 0;
}
num2 = (int)_previousCursorLock;
goto IL_008c;
IL_008c:
Cursor.lockState = (CursorLockMode)num2;
Cursor.visible = num != 0 || _previousCursorVisible;
((BasePlugin)P).Config.Save();
}
[HideFromIl2Cpp]
private void FindLocalPlayer()
{
PlayerCharacter val = null;
List<PlayerCharacter> allPlayerCharacters = PlayerCharacter.allPlayerCharacters;
if (allPlayerCharacters != null)
{
for (int i = 0; i < allPlayerCharacters.Count; i++)
{
PlayerCharacter val2 = allPlayerCharacters[i];
if ((Object)(object)val2 != (Object)null && ((NetworkBehaviour)val2).isLocalPlayer)
{
val = val2;
break;
}
}
}
if ((Object)(object)val == (Object)null)
{
if (_menu && (Object)(object)_menuPlayer != (Object)null)
{
CloseMenu();
}
if ((Object)(object)_player != (Object)null)
{
_targets.Clear();
_nearby.Clear();
}
_player = null;
_camera = null;
return;
}
if ((Object)(object)_player == (Object)null || ((Object)val).GetInstanceID() != ((Object)_player).GetInstanceID())
{
if (_menu && (Object)(object)_menuPlayer != (Object)null)
{
CloseMenu();
}
_targets.Clear();
_nearby.Clear();
_nextDiscovery = (_nextRange = 0f);
}
_player = val;
PlayerCameraMinder cameraMinder = val.cameraMinder;
PlayerCameraReferences val3 = ((cameraMinder != null) ? cameraMinder.playerCameraReferences : null);
_camera = (((Object)(object)val3 != (Object)null) ? val3.playerCamera : Camera.main);
if ((Object)(object)_camera == (Object)null)
{
_camera = Camera.main;
}
}
[HideFromIl2Cpp]
private void ToggleScenery()
{
P.IncludeScenery.Value = !P.IncludeScenery.Value;
_nextDiscovery = (_nextRange = 0f);
((BasePlugin)P).Config.Save();
}
[HideFromIl2Cpp]
private void Discover()
{
_targets.Clear();
_seen.Clear();
List<Prop> allProps = Prop.allProps;
if (allProps != null)
{
int count = allProps.Count;
for (int i = 0; i < count; i++)
{
Prop val = allProps[i];
if ((Object)(object)val != (Object)null)
{
AddTarget(((Component)val).transform, ((Object)val).name, 0);
}
}
}
else
{
foreach (Prop item in Object.FindObjectsOfType<Prop>())
{
if ((Object)(object)item != (Object)null)
{
AddTarget(((Component)item).transform, ((Object)item).name, 0);
}
}
}
foreach (CastableTarget item2 in Object.FindObjectsOfType<CastableTarget>())
{
if (!((Object)(object)item2 == (Object)null))
{
Prop componentInParent = ((Component)item2).GetComponentInParent<Prop>();
if ((Object)(object)componentInParent != (Object)null)
{
AddTarget(((Component)componentInParent).transform, ((Object)componentInParent).name, 0);
}
else
{
AddTarget(((Component)item2).transform, ((Object)item2).name, 1);
}
}
}
if (P.IncludeScenery.Value)
{
foreach (MeshRenderer item3 in Object.FindObjectsOfType<MeshRenderer>())
{
AddSceneryRenderer((Renderer)(object)item3);
}
foreach (SkinnedMeshRenderer item4 in Object.FindObjectsOfType<SkinnedMeshRenderer>())
{
AddSceneryRenderer((Renderer)(object)item4);
}
}
_status = $"已发现 {_targets.Count} 个对象";
((BasePlugin)P).Log.LogDebug((object)_status);
}
[HideFromIl2Cpp]
private void AddSceneryRenderer(Renderer renderer)
{
if ((Object)(object)renderer == (Object)null || !renderer.enabled || (Object)(object)((Component)renderer).GetComponentInParent<PlayerCharacter>() != (Object)null)
{
return;
}
Prop componentInParent = ((Component)renderer).GetComponentInParent<Prop>();
if ((Object)(object)componentInParent != (Object)null)
{
AddTarget(((Component)componentInParent).transform, ((Object)componentInParent).name, 0);
return;
}
CastableTarget componentInParent2 = ((Component)renderer).GetComponentInParent<CastableTarget>();
if ((Object)(object)componentInParent2 != (Object)null)
{
AddTarget(((Component)componentInParent2).transform, ((Object)componentInParent2).name, 1);
}
else if (((Component)renderer).gameObject.layer != 5)
{
AddTarget(((Component)renderer).transform, ((Object)renderer).name, 2);
}
}
[HideFromIl2Cpp]
private void AddTarget(Transform transform, string name, int kind)
{
if (Alive(transform))
{
int instanceID = ((Object)transform).GetInstanceID();
if (_seen.Add(instanceID))
{
_targets.Add(new Target
{
Transform = transform,
Name = MarkerMath.CleanName(name),
Kind = kind
});
}
}
}
[HideFromIl2Cpp]
private void UpdateNearby()
{
//IL_0025: 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_0090: 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_0096: 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)
_nearby.Clear();
if ((Object)(object)_player == (Object)null)
{
return;
}
Vector3 position = ((Component)_player).transform.position;
float num = P.Range.Value * P.Range.Value;
foreach (Target target in _targets)
{
if (Alive(target.Transform) && MarkerMath.Matches(target.Name, P.Filter.Value))
{
Vector3 val = target.Transform.position - position;
float sqrMagnitude = ((Vector3)(ref val)).sqrMagnitude;
if (!(sqrMagnitude > num))
{
target.DistanceSquared = sqrMagnitude;
_nearby.Add(target);
}
}
}
_nearby.Sort((Target a, Target b) => a.DistanceSquared.CompareTo(b.DistanceSquared));
}
public void OnGUI()
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
//IL_008c: Unknown result type (might be due to invalid IL or missing references)
//IL_0048: Unknown result type (might be due to invalid IL or missing references)
//IL_004e: Invalid comparison between Unknown and I4
Color color = GUI.color;
int depth = GUI.depth;
try
{
EnsureStyles();
GUI.depth = -1000;
if (!_waiting && P.MarkersEnabled.Value && (Object)(object)_camera != (Object)null && (int)Event.current.type == 7)
{
DrawMarkers();
}
if (P.ShowHud.Value)
{
DrawHud();
}
if (_menu)
{
DrawMenu();
}
}
catch (Exception exception)
{
Warn("OnGUI", exception);
}
finally
{
GUI.color = color;
GUI.depth = depth;
}
}
[HideFromIl2Cpp]
private void EnsureStyles()
{
//IL_0055: Unknown result type (might be due to invalid IL or missing references)
//IL_005a: Unknown result type (might be due to invalid IL or missing references)
//IL_006f: Unknown result type (might be due to invalid IL or missing references)
//IL_0076: Unknown result type (might be due to invalid IL or missing references)
//IL_007d: Unknown result type (might be due to invalid IL or missing references)
//IL_0089: Expected O, but got Unknown
//IL_0094: Unknown result type (might be due to invalid IL or missing references)
//IL_0099: Unknown result type (might be due to invalid IL or missing references)
//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
//IL_00ad: Expected O, but got Unknown
//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
//IL_00b9: 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_00cd: Expected O, but got Unknown
//IL_00d8: 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_00e5: Unknown result type (might be due to invalid IL or missing references)
//IL_00f1: Expected O, but got Unknown
//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
//IL_0101: Unknown result type (might be due to invalid IL or missing references)
//IL_0109: Unknown result type (might be due to invalid IL or missing references)
//IL_0115: Expected O, but got Unknown
//IL_0120: Unknown result type (might be due to invalid IL or missing references)
//IL_0125: Unknown result type (might be due to invalid IL or missing references)
//IL_012d: Unknown result type (might be due to invalid IL or missing references)
//IL_0139: Expected O, but got Unknown
//IL_019e: Unknown result type (might be due to invalid IL or missing references)
if (_label != null && _label.fontSize == P.FontSize.Value)
{
return;
}
if ((Object)(object)_font == (Object)null)
{
try
{
_font = Font.CreateDynamicFontFromOSFont("Microsoft YaHei", 16);
}
catch
{
}
}
_label = new GUIStyle(GUI.skin.label)
{
fontSize = P.FontSize.Value,
alignment = (TextAnchor)4,
richText = false,
wordWrap = false
};
_panelText = new GUIStyle(GUI.skin.label)
{
fontSize = 15,
richText = false
};
_title = new GUIStyle(_panelText)
{
fontSize = 19,
fontStyle = (FontStyle)1
};
_button = new GUIStyle(GUI.skin.button)
{
fontSize = 15,
richText = false
};
_field = new GUIStyle(GUI.skin.textField)
{
fontSize = 15,
richText = false
};
_toggle = new GUIStyle(GUI.skin.toggle)
{
fontSize = 15,
richText = false
};
GUIStyle[] array = (GUIStyle[])(object)new GUIStyle[6] { _label, _panelText, _title, _button, _field, _toggle };
foreach (GUIStyle val in array)
{
if ((Object)(object)_font != (Object)null)
{
val.font = _font;
}
val.normal.textColor = Color.white;
}
}
[HideFromIl2Cpp]
private void DrawMarkers()
{
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
//IL_003d: Unknown result type (might be due to invalid IL or missing references)
//IL_0088: Unknown result type (might be due to invalid IL or missing references)
//IL_008d: Unknown result type (might be due to invalid IL or missing references)
//IL_008f: Unknown result type (might be due to invalid IL or missing references)
//IL_0090: Unknown result type (might be due to invalid IL or missing references)
//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
//IL_00be: Unknown result type (might be due to invalid IL or missing references)
//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
//IL_012c: Unknown result type (might be due to invalid IL or missing references)
//IL_0131: Unknown result type (might be due to invalid IL or missing references)
//IL_016d: Unknown result type (might be due to invalid IL or missing references)
//IL_016f: 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)
//IL_019a: Unknown result type (might be due to invalid IL or missing references)
//IL_0149: Unknown result type (might be due to invalid IL or missing references)
//IL_014e: Unknown result type (might be due to invalid IL or missing references)
//IL_0166: 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_02bf: Unknown result type (might be due to invalid IL or missing references)
//IL_02c9: Expected O, but got Unknown
//IL_02c4: Unknown result type (might be due to invalid IL or missing references)
//IL_0355: Unknown result type (might be due to invalid IL or missing references)
//IL_035a: Unknown result type (might be due to invalid IL or missing references)
//IL_036f: Unknown result type (might be due to invalid IL or missing references)
//IL_0379: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)_camera == (Object)null || (Object)(object)_player == (Object)null)
{
return;
}
_drawn = (_edges = 0);
Vector3 position = ((Component)_player).transform.position;
for (int num = MarkerMath.VisibleCount(_nearby.Count, P.MaxMarkers.Value) - 1; num >= 0; num--)
{
Target target = _nearby[num];
if (Alive(target.Transform))
{
Vector3 position2 = target.Transform.position;
float num2 = Vector3.Distance(position, position2);
if (!(num2 > P.Range.Value))
{
Vector3 val = _camera.WorldToScreenPoint(position2);
(float, float, bool) tuple = MarkerMath.Project(val.x, val.y, val.z, Screen.width, Screen.height, 38f);
if (!tuple.Item3 || P.EdgeMarkers.Value)
{
Color color = (Color)(target.Kind switch
{
0 => new Color(0.35f, 1f, 0.65f, 1f),
1 => new Color(1f, 0.8f, 0.25f, 1f),
_ => new Color(0.4f, 0.8f, 1f, 0.9f),
});
Fill(new Rect(tuple.Item1 - 3f, tuple.Item2 - 3f, 6f, 6f), color);
string text = (P.Names.Value ? target.Name : "");
if (text.Length > 52)
{
text = text.Substring(0, 49) + "...";
}
if (P.Distances.Value)
{
text += $" {num2:0}m";
}
if (tuple.Item3)
{
text = ((tuple.Item2 <= 40f) ? "^ " : ((tuple.Item2 >= (float)(Screen.height - 40)) ? "v " : ((tuple.Item1 < (float)(Screen.width / 2)) ? "< " : "> "))) + text;
_edges++;
}
if (text.Length > 0)
{
float num3 = Math.Min(Screen.width - 8, Math.Max(70f, _label.CalcSize(new GUIContent(text)).x + 10f));
float num4 = Mathf.Clamp(tuple.Item1 - num3 / 2f, 4f, (float)Screen.width - num3 - 4f);
float num5 = Mathf.Clamp(tuple.Item2 + 5f, 4f, (float)(Screen.height - P.FontSize.Value - 12));
Rect val2 = new Rect(num4, num5, num3, (float)(P.FontSize.Value + 8));
Fill(val2, new Color(0.02f, 0.03f, 0.045f, 0.75f));
GUI.color = color;
GUI.Label(val2, text, _label);
}
_drawn++;
}
}
}
}
}
[HideFromIl2Cpp]
private void DrawHud()
{
//IL_0024: 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_0047: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: Unknown result type (might be due to invalid IL or missing references)
//IL_0116: Unknown result type (might be due to invalid IL or missing references)
//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
//IL_01d0: Unknown result type (might be due to invalid IL or missing references)
//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
//IL_0214: Unknown result type (might be due to invalid IL or missing references)
//IL_0236: Unknown result type (might be due to invalid IL or missing references)
float num = Math.Max(8, Screen.width - 420);
float num2 = 12f;
Fill(new Rect(num, num2, 408f, 94f), new Color(0.025f, 0.04f, 0.055f, 0.9f));
GUI.color = Color.white;
string value = (_waiting ? "等待进入游戏" : (P.MarkersEnabled.Value ? "已开启" : "已关闭"));
GUI.Label(new Rect(num + 12f, num2 + 7f, 390f, 25f), $"周围物体标记 · {value} · {P.Range.Value:0} 米", _panelText);
GUI.Label(new Rect(num + 12f, num2 + 33f, 390f, 25f), $"范围内 {_nearby.Count} · 显示 {_drawn} · {(P.IncludeScenery.Value ? "含场景物体" : "道具 + 交互物体")}", _panelText);
GUI.Label(new Rect(num + 12f, num2 + 59f, 390f, 25f), $"{P.ToggleKey.Value} 开关 {P.ModeKey.Value} 场景 {P.MenuKey.Value} 设置 {P.RefreshKey.Value} 刷新", _panelText);
}
[HideFromIl2Cpp]
private void DrawMenu()
{
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0069: 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_00b8: Unknown result type (might be due to invalid IL or missing references)
//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
//IL_0130: Unknown result type (might be due to invalid IL or missing references)
//IL_0183: Unknown result type (might be due to invalid IL or missing references)
//IL_01ee: Unknown result type (might be due to invalid IL or missing references)
//IL_025c: Unknown result type (might be due to invalid IL or missing references)
//IL_0289: Unknown result type (might be due to invalid IL or missing references)
//IL_0302: Unknown result type (might be due to invalid IL or missing references)
//IL_034d: Unknown result type (might be due to invalid IL or missing references)
//IL_0398: Unknown result type (might be due to invalid IL or missing references)
//IL_03d9: Unknown result type (might be due to invalid IL or missing references)
//IL_0461: Unknown result type (might be due to invalid IL or missing references)
//IL_04a0: Unknown result type (might be due to invalid IL or missing references)
//IL_04e0: Unknown result type (might be due to invalid IL or missing references)
//IL_0523: Unknown result type (might be due to invalid IL or missing references)
//IL_0590: Unknown result type (might be due to invalid IL or missing references)
//IL_05bd: Unknown result type (might be due to invalid IL or missing references)
//IL_05ea: Unknown result type (might be due to invalid IL or missing references)
//IL_062f: Unknown result type (might be due to invalid IL or missing references)
float num = Mathf.Max(8f, (float)(Screen.width - 510) / 2f);
float num2 = Mathf.Max(8f, (float)(Screen.height - 560) / 2f);
Fill(new Rect(num, num2, 510f, 560f), new Color(0.035f, 0.055f, 0.08f, 0.98f));
GUI.color = Color.white;
GUI.Label(new Rect(num + 20f, num2 + 14f, 460f, 32f), "周围物体标记 / All Object Markers", _title);
GUI.Label(new Rect(num + 20f, num2 + 48f, 470f, 24f), "绿色:道具 黄色:交互物体 蓝色:场景物体", _panelText);
P.MarkersEnabled.Value = GUI.Toggle(new Rect(num + 20f, num2 + 82f, 220f, 26f), P.MarkersEnabled.Value, "开启物体标记", _toggle);
if (GUI.Toggle(new Rect(num + 250f, num2 + 82f, 240f, 26f), P.IncludeScenery.Value, "同时标记树木、石头等", _toggle) != P.IncludeScenery.Value)
{
ToggleScenery();
}
GUI.Label(new Rect(num + 20f, num2 + 119f, 450f, 24f), $"标记范围:{P.Range.Value:0} 米", _panelText);
float num3 = Mathf.Round(GUI.HorizontalSlider(new Rect(num + 20f, num2 + 150f, 465f, 22f), P.Range.Value, 5f, 500f));
if (num3 != P.Range.Value)
{
P.Range.Value = num3;
_nextRange = 0f;
}
GUI.Label(new Rect(num + 20f, num2 + 180f, 460f, 24f), "名称筛选(留空=全部,逗号分隔多个关键词)", _panelText);
string text = GUI.TextField(new Rect(num + 20f, num2 + 210f, 465f, 29f), P.Filter.Value, 160, _field);
if (text != P.Filter.Value)
{
P.Filter.Value = text;
_nextRange = 0f;
}
P.Names.Value = GUI.Toggle(new Rect(num + 20f, num2 + 255f, 210f, 26f), P.Names.Value, "显示物体名称", _toggle);
P.Distances.Value = GUI.Toggle(new Rect(num + 250f, num2 + 255f, 220f, 26f), P.Distances.Value, "显示距离", _toggle);
P.EdgeMarkers.Value = GUI.Toggle(new Rect(num + 20f, num2 + 290f, 450f, 26f), P.EdgeMarkers.Value, "屏幕边缘提示背后与画面外的物体", _toggle);
GUI.Label(new Rect(num + 20f, num2 + 327f, 460f, 24f), "数量:" + ((P.MaxMarkers.Value == 0) ? "全部(不限数量)" : $"最近 {P.MaxMarkers.Value} 个"), _panelText);
if (GUI.Button(new Rect(num + 20f, num2 + 360f, 145f, 30f), "全部", _button))
{
P.MaxMarkers.Value = 0;
}
if (GUI.Button(new Rect(num + 180f, num2 + 360f, 145f, 30f), "最近 100 个", _button))
{
P.MaxMarkers.Value = 100;
}
if (GUI.Button(new Rect(num + 340f, num2 + 360f, 145f, 30f), "最近 300 个", _button))
{
P.MaxMarkers.Value = 300;
}
GUI.Label(new Rect(num + 20f, num2 + 405f, 470f, 24f), _status + $",范围内 {_nearby.Count} 个", _panelText);
GUI.Label(new Rect(num + 20f, num2 + 436f, 470f, 24f), "只标记当前已加载对象;物体较多时可缩小范围。", _panelText);
GUI.Label(new Rect(num + 20f, num2 + 465f, 470f, 24f), "物体名称使用游戏内部名称;重扫会自动发现新物体。", _panelText);
if (GUI.Button(new Rect(num + 20f, num2 + 508f, 220f, 32f), "立即重新扫描", _button))
{
_nextDiscovery = (_nextRange = 0f);
}
if (GUI.Button(new Rect(num + 265f, num2 + 508f, 220f, 32f), "保存并关闭设置", _button))
{
CloseMenu();
}
}
[HideFromIl2Cpp]
private static bool Alive(Transform transform)
{
if (transform != null && !((Il2CppObjectBase)transform).WasCollected && (Object)(object)transform != (Object)null)
{
return ((Component)transform).gameObject.activeInHierarchy;
}
return false;
}
[HideFromIl2Cpp]
private static void Fill(Rect rect, Color color)
{
//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)
GUI.color = color;
GUI.DrawTexture(rect, (Texture)(object)Texture2D.whiteTexture);
}
[HideFromIl2Cpp]
private void Warn(string location, Exception exception)
{
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
//IL_003e: Expected O, but got Unknown
if (!(Time.unscaledTime < _nextWarning))
{
_nextWarning = Time.unscaledTime + 10f;
_status = "扫描异常,详情见 BepInEx 日志";
ManualLogSource log = ((BasePlugin)P).Log;
bool flag = default(bool);
BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(2, 2, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(location);
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(": ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<Exception>(exception);
}
log.LogWarning(val);
}
}
public void OnDestroy()
{
CloseMenu();
_targets.Clear();
_nearby.Clear();
_seen.Clear();
if ((Object)(object)_font != (Object)null)
{
Object.Destroy((Object)(object)_font);
}
}
}
[BepInPlugin("local.bigwalk.allobjectmarkers", "All Object Markers", "1.0.0")]
[BepInProcess("Big Walk.exe")]
public sealed class Plugin : BasePlugin
{
public const string Id = "local.bigwalk.allobjectmarkers";
internal static Plugin Instance;
internal ConfigEntry<bool> MarkersEnabled;
internal ConfigEntry<bool> IncludeScenery;
internal ConfigEntry<bool> EdgeMarkers;
internal ConfigEntry<bool> Names;
internal ConfigEntry<bool> Distances;
internal ConfigEntry<bool> ShowHud;
internal ConfigEntry<float> Range;
internal ConfigEntry<float> DiscoverySeconds;
internal ConfigEntry<float> RefreshSeconds;
internal ConfigEntry<int> MaxMarkers;
internal ConfigEntry<int> FontSize;
internal ConfigEntry<string> Filter;
internal ConfigEntry<KeyCode> ToggleKey;
internal ConfigEntry<KeyCode> MenuKey;
internal ConfigEntry<KeyCode> ModeKey;
internal ConfigEntry<KeyCode> RefreshKey;
private MarkerOverlay _overlay;
public override void Load()
{
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: Expected O, but got Unknown
//IL_0098: Unknown result type (might be due to invalid IL or missing references)
//IL_00a2: Expected O, but got Unknown
//IL_0197: Unknown result type (might be due to invalid IL or missing references)
//IL_01a1: Expected O, but got Unknown
//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
//IL_01df: Expected O, but got Unknown
//IL_0213: Unknown result type (might be due to invalid IL or missing references)
//IL_021d: Expected O, but got Unknown
Instance = this;
((BasePlugin)this).Config.SaveOnConfigSet = false;
MarkersEnabled = ((BasePlugin)this).Config.Bind<bool>("General", "Enabled", true, "Show markers. F6 toggles this.");
Range = ((BasePlugin)this).Config.Bind<float>("General", "RangeMeters", 100f, new ConfigDescription("Radius around the local player.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(5f, 500f), Array.Empty<object>()));
MaxMarkers = ((BasePlugin)this).Config.Bind<int>("General", "MaxMarkers", 0, new ConfigDescription("0 = ALL matches, no count limit. Set a positive number to show the nearest N.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 10000), Array.Empty<object>()));
IncludeScenery = ((BasePlugin)this).Config.Bind<bool>("General", "IncludeScenery", false, "Also mark loaded scene mesh renderers (trees, rocks, buildings, etc.). F7 toggles. Props and interaction targets are always included.");
Filter = ((BasePlugin)this).Config.Bind<string>("General", "NameFilter", "", "Empty = all. Comma-separated name fragments match ANY term, case insensitive. Names come from game objects.");
EdgeMarkers = ((BasePlugin)this).Config.Bind<bool>("Display", "EdgeMarkers", true, "Show direction markers for objects outside the screen or behind you.");
Names = ((BasePlugin)this).Config.Bind<bool>("Display", "ShowNames", true, "Show game object names.");
Distances = ((BasePlugin)this).Config.Bind<bool>("Display", "ShowDistance", true, "Show distance in metres.");
ShowHud = ((BasePlugin)this).Config.Bind<bool>("Display", "ShowHUD", true, "Show status and key hints.");
FontSize = ((BasePlugin)this).Config.Bind<int>("Display", "FontSize", 14, new ConfigDescription("Label text size.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(10, 24), Array.Empty<object>()));
DiscoverySeconds = ((BasePlugin)this).Config.Bind<float>("Performance", "DiscoverySeconds", 5f, new ConfigDescription("Interval for discovering newly loaded objects. F9 forces a rescan.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 30f), Array.Empty<object>()));
RefreshSeconds = ((BasePlugin)this).Config.Bind<float>("Performance", "RangeRefreshSeconds", 0.35f, new ConfigDescription("Interval for updating range and nearest ordering. Screen positions still follow objects every frame.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 3f), Array.Empty<object>()));
ToggleKey = ((BasePlugin)this).Config.Bind<KeyCode>("Keys", "Toggle", (KeyCode)287, "Toggle all markers.");
ModeKey = ((BasePlugin)this).Config.Bind<KeyCode>("Keys", "ToggleScenery", (KeyCode)288, "Toggle scene objects.");
MenuKey = ((BasePlugin)this).Config.Bind<KeyCode>("Keys", "Menu", (KeyCode)289, "Open settings and release the mouse. Closing restores the previous control state.");
RefreshKey = ((BasePlugin)this).Config.Bind<KeyCode>("Keys", "Refresh", (KeyCode)290, "Discover objects immediately.");
((BasePlugin)this).Config.Save();
_overlay = ((BasePlugin)this).AddComponent<MarkerOverlay>();
((BasePlugin)this).Log.LogInfo((object)"All Object Markers 1.0.0 loaded. F6 on/off, F7 scenery, F8 settings, F9 refresh. Count limit: 0 = unlimited.");
}
public override bool Unload()
{
if ((Object)(object)_overlay != (Object)null)
{
Object.Destroy((Object)(object)_overlay);
}
((BasePlugin)this).Config.Save();
return true;
}
}