using System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using Peak; using UnityEngine; using UnityEngine.SceneManagement; using Zorro.Core; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("youxia173")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.5.1.0")] [assembly: AssemblyInformationalVersion("1.5.1")] [assembly: AssemblyProduct("ItemDisplay")] [assembly: AssemblyTitle("youxia173.ItemDisplay")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.5.1.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.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 LuggageDistanceMarkers { internal static class AmuletRegistry { private static readonly HashSet KnownIds = new HashSet(); private static readonly Dictionary Known = new Dictionary(); private static readonly HashSet KnownFakeIds = new HashSet(); private static readonly Dictionary KnownFake = new Dictionary(); private static readonly List ScratchIds = new List(); internal static int KnownCount => Known.Count + KnownFake.Count; internal static string LastHoverInfo { get; private set; } = "-"; internal static string LastRejectReason { get; private set; } = "-"; internal static void Register(Item? item, string reason) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)item == (Object)null) { LastRejectReason = reason + ": null"; return; } try { Scene scene = ((Component)item).gameObject.scene; if (!((Scene)(ref scene)).IsValid()) { LastRejectReason = reason + ": prefab/no-scene"; return; } } catch { LastRejectReason = reason + ": scene-check-fail"; return; } if (!LooksLikeScoutAmulet(item, out string _)) { LastRejectReason = reason + ": not-amulet (" + SafeName(item) + ")"; return; } int instanceID = ((Object)item).GetInstanceID(); if (KnownIds.Add(instanceID)) { Known[instanceID] = item; } else { Known[instanceID] = item; } } internal static void NoteInteractible(IInteractible? interactible, string reason) { if (interactible == null) { LastHoverInfo = "null"; return; } try { LastHoverInfo = ((object)interactible).GetType().Name + ":" + interactible.GetName(); } catch { LastHoverInfo = ((object)interactible).GetType().Name; } FakeItem val = (FakeItem)(object)((interactible is FakeItem) ? interactible : null); if ((Object)(object)val != (Object)null) { RegisterFake(val, reason); return; } Item val2 = (Item)(object)((interactible is Item) ? interactible : null); if ((Object)(object)val2 == (Object)null) { try { Transform transform = interactible.GetTransform(); if ((Object)(object)transform != (Object)null) { val2 = ((Component)transform).GetComponentInParent(); } } catch { } } if ((Object)(object)val2 != (Object)null) { Register(val2, reason); } else { LastRejectReason = reason + ": hover-unknown (" + LastHoverInfo + ")"; } } internal static void RegisterFake(FakeItem? fake, string reason) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)fake == (Object)null) { LastRejectReason = reason + ": null-fake"; return; } try { Scene scene = ((Component)fake).gameObject.scene; if (!((Scene)(ref scene)).IsValid()) { LastRejectReason = reason + ": fake-prefab/no-scene"; return; } } catch { LastRejectReason = reason + ": fake-scene-check-fail"; return; } if (!LooksLikeScoutAmulet(fake, out string _)) { LastRejectReason = reason + ": fake-not-amulet (" + SafeName(fake) + ")"; return; } int instanceID = ((Object)fake).GetInstanceID(); if (KnownFakeIds.Add(instanceID)) { KnownFake[instanceID] = fake; } else { KnownFake[instanceID] = fake; } } internal static void CollectMarkableFake(List into) { into.Clear(); ScratchIds.Clear(); foreach (KeyValuePair item in KnownFake) { FakeItem value = item.Value; if ((Object)(object)value == (Object)null) { ScratchIds.Add(item.Key); continue; } try { if (((object)value).Equals((object?)null)) { ScratchIds.Add(item.Key); continue; } } catch { ScratchIds.Add(item.Key); continue; } if (!LooksLikeScoutAmulet(value, out string _)) { ScratchIds.Add(item.Key); } else if (IsMarkableWorldAmulet(value)) { into.Add(value); } } for (int i = 0; i < ScratchIds.Count; i++) { int num = ScratchIds[i]; KnownFakeIds.Remove(num); KnownFake.Remove(num); } } internal static void CollectMarkable(List into) { into.Clear(); ScratchIds.Clear(); foreach (KeyValuePair item in Known) { Item value = item.Value; if ((Object)(object)value == (Object)null) { ScratchIds.Add(item.Key); continue; } try { if (((object)value).Equals((object?)null)) { ScratchIds.Add(item.Key); continue; } } catch { ScratchIds.Add(item.Key); continue; } if (!LooksLikeScoutAmulet(value, out string _)) { ScratchIds.Add(item.Key); } else if (IsMarkableWorldAmulet(value)) { into.Add(value); } } for (int i = 0; i < ScratchIds.Count; i++) { int num = ScratchIds[i]; KnownIds.Remove(num); Known.Remove(num); } } internal static bool LooksLikeScoutAmulet(Item item, out string how) { return IsScoutAmuletCore(item, out how); } internal static bool LooksLikeScoutAmulet(FakeItem fake, out string how) { how = ""; if ((Object)(object)fake == (Object)null) { return false; } try { return IsScoutAmuletCore(fake.realItemPrefab, out how); } catch { return false; } } private static bool IsScoutAmuletCore(Item? item, out string how) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) how = ""; if ((Object)(object)item == (Object)null) { return false; } try { if (((Enum)item.itemTags).HasFlag((Enum)(object)(ItemTags)512)) { how = "tag"; return true; } } catch { } try { if ((Object)(object)((Component)item).GetComponent() != (Object)null) { how = "AmuletBase"; return true; } } catch { } return false; } internal static bool IsMarkableWorldAmulet(Item? item) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Invalid comparison between Unknown and I4 if ((Object)(object)item == (Object)null) { return false; } try { Scene scene = ((Component)item).gameObject.scene; if (!((Scene)(ref scene)).IsValid()) { return false; } if (!LooksLikeScoutAmulet(item, out string _)) { return false; } if ((Object)(object)item.holderCharacter != (Object)null) { return false; } if ((Object)(object)item.wearerCharacter != (Object)null) { return false; } if ((int)item.itemState == 2) { return false; } return true; } catch { return false; } } internal static bool IsMarkableWorldAmulet(FakeItem? fake) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)fake == (Object)null) { return false; } try { Scene scene = ((Component)fake).gameObject.scene; if (!((Scene)(ref scene)).IsValid()) { return false; } if (!LooksLikeScoutAmulet(fake, out string _)) { return false; } if (fake.pickedUp) { return false; } if (!((Component)fake).gameObject.activeInHierarchy) { return false; } return true; } catch { return false; } } internal static string SafeName(Item item) { try { string itemName = item.GetItemName((ItemInstanceData)null); if (!string.IsNullOrEmpty(itemName) && !MarkerL10n.LooksLikeRawKey(itemName)) { return itemName; } } catch { } try { string name = item.GetName(); if (!string.IsNullOrEmpty(name) && !MarkerL10n.LooksLikeRawKey(name)) { return name; } } catch { } try { if (item.UIData != null && !string.IsNullOrEmpty(item.UIData.itemName)) { return item.UIData.itemName; } } catch { } if (!((Object)(object)((Component)item).gameObject != (Object)null)) { return "?"; } return ((Object)((Component)item).gameObject).name; } internal static string SafeName(FakeItem fake) { try { string name = fake.GetName(); if (!string.IsNullOrEmpty(name) && !MarkerL10n.LooksLikeRawKey(name)) { return name; } } catch { } if (!string.IsNullOrEmpty(fake.itemName)) { return fake.itemName; } if (!((Object)(object)((Component)fake).gameObject != (Object)null)) { return "?"; } return ((Object)((Component)fake).gameObject).name; } internal static Vector3 GetWorldPos(Item item) { //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_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_002b: 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) try { if ((Object)(object)item.mainRenderer != (Object)null) { Bounds bounds = item.mainRenderer.bounds; return ((Bounds)(ref bounds)).center; } } catch { } try { return item.Center(); } catch { return ((Component)item).transform.position; } } internal static Vector3 GetWorldPos(FakeItem fake) { //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_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_002b: 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) try { if ((Object)(object)fake.mainRenderer != (Object)null) { Bounds bounds = fake.mainRenderer.bounds; return ((Bounds)(ref bounds)).center; } } catch { } try { return fake.Center(); } catch { return ((Component)fake).transform.position; } } internal static void SweepFakeAmulets(string reason) { if (!Plugin.ShowScoutAmulets.Value) { return; } try { FakeItem[] array = Object.FindObjectsByType((FindObjectsInactive)0, (FindObjectsSortMode)0); if (array != null) { for (int i = 0; i < array.Length; i++) { RegisterFake(array[i], reason); } } } catch (Exception ex) { Plugin.Log.LogWarning((object)("Amulet FakeItem sweep failed: " + ex.Message)); } } internal static void RefreshActiveAmuletItems() { if (!Plugin.ShowScoutAmulets.Value) { return; } try { List aLL_ACTIVE_ITEMS = Item.ALL_ACTIVE_ITEMS; if (aLL_ACTIVE_ITEMS != null) { for (int i = 0; i < aLL_ACTIVE_ITEMS.Count; i++) { Register(aLL_ACTIVE_ITEMS[i], "ALL_ACTIVE"); } } } catch { } } } [HarmonyPatch(typeof(FakeItem), "HoverEnter")] internal static class FakeItemHoverEnterAmuletPatch { private static void Postfix(FakeItem __instance) { if (Plugin.ShowScoutAmulets.Value) { AmuletRegistry.NoteInteractible((IInteractible?)(object)__instance, "FakeHoverEnter"); } } } [HarmonyPatch(typeof(Item), "HoverEnter")] internal static class ItemHoverEnterAmuletPatch { private static void Postfix(Item __instance) { if (Plugin.ShowScoutAmulets.Value) { AmuletRegistry.NoteInteractible((IInteractible?)(object)__instance, "HoverEnter"); } } } [HarmonyPatch(typeof(GUIManager), "RefreshInteractablePrompt")] internal static class GuiRefreshAmuletPatch { private static void Postfix(GUIManager __instance) { if (!Plugin.ShowScoutAmulets.Value) { return; } try { if ((Object)(object)Interaction.instance != (Object)null) { AmuletRegistry.NoteInteractible(Interaction.instance.currentHovered, "GUIRefresh"); } } catch { } } } [HarmonyPatch(typeof(Spawner), "InitializePhysics")] internal static class SpawnerInitAmuletPatch { private static void Postfix(Item newItem) { if (Plugin.ShowScoutAmulets.Value) { AmuletRegistry.Register(newItem, "Spawner.InitPhys"); } } } [HarmonyPatch(typeof(Item), "SetKinematic")] internal static class ItemSetKinematicAmuletPatch { private static void Postfix(Item __instance) { if (Plugin.ShowScoutAmulets.Value) { AmuletRegistry.Register(__instance, "SetKinematic"); } } } internal static class DefaultFoodMarkItems { internal static readonly ushort[] Ids = new ushort[36] { 3, 4, 5, 9, 10, 11, 12, 19, 20, 21, 36, 40, 41, 46, 56, 57, 60, 75, 76, 83, 84, 88, 89, 93, 97, 102, 103, 108, 153, 154, 158, 159, 160, 161, 162, 178 }; internal static readonly HashSet ForceFoodCategory = new HashSet(Ids); } internal static class DefaultMarkItems { internal static readonly string DefaultConfigIds = BuildDefaultConfigIds(); private static string BuildDefaultConfigIds() { HashSet hashSet = new HashSet(); AddAll(hashSet, DefaultFoodMarkItems.Ids); AddAll(hashSet, DefaultOtherMarkItems.Ids); List list = new List(hashSet); list.Sort(); StringBuilder stringBuilder = new StringBuilder(list.Count * 4); for (int i = 0; i < list.Count; i++) { if (i > 0) { stringBuilder.Append(','); } stringBuilder.Append(list[i]); } return stringBuilder.ToString(); } private static void AddAll(HashSet into, ushort[] source) { for (int i = 0; i < source.Length; i++) { into.Add(source[i]); } } } internal static class DefaultOtherMarkItems { internal static readonly ushort[] SortPriority = new ushort[18] { 181, 45, 68, 117, 90, 79, 155, 81, 110, 106, 111, 184, 172, 95, 101, 48, 8, 165 }; internal static readonly ushort[] Ids = SortPriority; internal static readonly HashSet ForcePropCategory = new HashSet(Ids); internal static int GetSortIndex(ushort id) { for (int i = 0; i < SortPriority.Length; i++) { if (SortPriority[i] == id) { return i; } } return 1000 + id; } internal static int CompareSort(ushort a, ushort b) { return GetSortIndex(a).CompareTo(GetSortIndex(b)); } } internal static class GloomBellRegistry { internal static void CopyUnlit(List into) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) into.Clear(); List aLL_GLOOM_SAFE_ZONES = GloomSafeZone.ALL_GLOOM_SAFE_ZONES; for (int i = 0; i < aLL_GLOOM_SAFE_ZONES.Count; i++) { GloomSafeZone obj = aLL_GLOOM_SAFE_ZONES[i]; GhostFire val = (GhostFire)(object)((obj is GhostFire) ? obj : null); if (val == null) { continue; } try { if (!((GloomSafeZone)val).isLit && ((Component)val).gameObject.activeInHierarchy) { Scene scene = ((Component)val).gameObject.scene; if (((Scene)(ref scene)).IsValid()) { goto IL_0056; } } } catch { } continue; IL_0056: into.Add(val); } } internal static string SafeName(GhostFire bell) { try { string name = bell.GetName(); if (!string.IsNullOrEmpty(name) && !MarkerL10n.LooksLikeRawKey(name)) { return name; } } catch { } return "钟楼"; } internal static Vector3 GetWorldPos(GhostFire bell) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) try { return bell.Center(); } catch { return ((Component)bell).transform.position; } } } internal static class HiddenConfig { internal static ConfigDescription Desc(string text) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown return new ConfigDescription(text, (AcceptableValueBase)null, new object[1] { "Hidden" }); } internal static ConfigDescription Desc(string text, AcceptableValueBase range) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown return new ConfigDescription(text, range, new object[1] { "Hidden" }); } internal static ConfigDescription Desc(string text, AcceptableValueList list) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown return new ConfigDescription(text, (AcceptableValueBase)(object)list, new object[1] { "Hidden" }); } } internal static class ImGuiColorPicker { private static Texture2D? _hueBar; private static GUIStyle? _miniLabel; private static GUIStyle? _channelField; internal static void Draw(ref MarkerRgb rgb, float scale, GUIStyle labelStyle, GUIStyle fieldStyle) { //IL_0008: 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_0099: Unknown result type (might be due to invalid IL or missing references) EnsureStyles(labelStyle, fieldStyle); float num2 = default(float); float num3 = default(float); float num = default(float); Color.RGBToHSV(rgb.Color, ref num, ref num2, ref num3); num = Mathf.Clamp01(num); num2 = Mathf.Clamp01(num2); num3 = Mathf.Clamp01(num3); float num4 = 32f * scale; float num5 = 16f * scale; float rowH = 24f * scale; Event current = Event.current; GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(Mathf.Max(num4, num5)) }); DrawSwatchRect(rgb.Color, num4, num4); num = DrawHueBar(GUILayoutUtility.GetRect(GUIContent.none, GUIStyle.none, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Height(num5), GUILayout.ExpandWidth(true) }), num, current); ApplyHsv(ref rgb, num, num2, num3); GUILayout.EndHorizontal(); rgb.R = DrawChannelRow("R", rgb.R, rowH, scale); rgb.G = DrawChannelRow("G", rgb.G, rowH, scale); rgb.B = DrawChannelRow("B", rgb.B, rowH, scale); } private static void ApplyHsv(ref MarkerRgb rgb, float h, float s, float v) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) Color val = Color.HSVToRGB(h, s, v); rgb.R = Mathf.Clamp(Mathf.RoundToInt(val.r * 255f), 0, 255); rgb.G = Mathf.Clamp(Mathf.RoundToInt(val.g * 255f), 0, 255); rgb.B = Mathf.Clamp(Mathf.RoundToInt(val.b * 255f), 0, 255); } private static int DrawChannelRow(string channel, int value, float rowH, float scale) { GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(rowH) }); GUILayout.Label(channel, _miniLabel, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(16f * scale) }); if (int.TryParse(GUILayout.TextField(value.ToString(), _channelField, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(42f * scale), GUILayout.Height(rowH - 2f) }), out var result)) { value = Mathf.Clamp(result, 0, 255); } value = Mathf.RoundToInt(GUILayout.HorizontalSlider((float)value, 0f, 255f, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(16f * scale) })); GUILayout.Label(value.ToString(), _miniLabel, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(32f * scale) }); GUILayout.EndHorizontal(); return value; } private static void DrawSwatchRect(Color color, float w, float h) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: 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_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) Rect rect = GUILayoutUtility.GetRect(w, h, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(w), GUILayout.Height(h) }); Color color2 = GUI.color; GUI.color = color; GUI.DrawTexture(rect, (Texture)(object)Texture2D.whiteTexture, (ScaleMode)0); GUI.color = color2; DrawBorder(rect); } private static float DrawHueBar(Rect rect, float currentH, Event ev) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //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_002e: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Invalid comparison between Unknown and I4 //IL_009d: Unknown result type (might be due to invalid IL or missing references) EnsureHueBar(); GUI.DrawTexture(rect, (Texture)(object)_hueBar, (ScaleMode)0); DrawBorder(rect); float num = ((Rect)(ref rect)).x + currentH * ((Rect)(ref rect)).width; Color color = GUI.color; GUI.color = Color.white; GUI.DrawTexture(new Rect(num - 1f, ((Rect)(ref rect)).y - 1f, 2f, ((Rect)(ref rect)).height + 2f), (Texture)(object)Texture2D.whiteTexture); GUI.color = color; if ((int)ev.type != 0 && (int)ev.type != 3) { return currentH; } if (!((Rect)(ref rect)).Contains(ev.mousePosition)) { return currentH; } ev.Use(); return Mathf.Clamp01((ev.mousePosition.x - ((Rect)(ref rect)).x) / ((Rect)(ref rect)).width); } private static void EnsureHueBar() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_hueBar != (Object)null) { return; } _hueBar = new Texture2D(256, 8, (TextureFormat)4, false) { wrapMode = (TextureWrapMode)1, filterMode = (FilterMode)1 }; for (int i = 0; i < 256; i++) { Color val = Color.HSVToRGB((float)i / 255f, 1f, 1f); for (int j = 0; j < 8; j++) { _hueBar.SetPixel(i, j, val); } } _hueBar.Apply(); } private static void DrawBorder(Rect rect) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_003d: 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_0095: 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) Color color = GUI.color; GUI.color = new Color(1f, 1f, 1f, 0.35f); GUI.DrawTexture(new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).y, ((Rect)(ref rect)).width, 1f), (Texture)(object)Texture2D.whiteTexture); GUI.DrawTexture(new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).yMax - 1f, ((Rect)(ref rect)).width, 1f), (Texture)(object)Texture2D.whiteTexture); GUI.DrawTexture(new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).y, 1f, ((Rect)(ref rect)).height), (Texture)(object)Texture2D.whiteTexture); GUI.DrawTexture(new Rect(((Rect)(ref rect)).xMax - 1f, ((Rect)(ref rect)).y, 1f, ((Rect)(ref rect)).height), (Texture)(object)Texture2D.whiteTexture); GUI.color = color; } private static void EnsureStyles(GUIStyle labelStyle, GUIStyle fieldStyle) { //IL_0009: 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_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown if (_miniLabel == null) { _miniLabel = new GUIStyle(labelStyle) { alignment = (TextAnchor)3, clipping = (TextClipping)0, wordWrap = false }; _channelField = new GUIStyle(fieldStyle) { alignment = (TextAnchor)4 }; } } } internal enum ItemPickerCategory { Food, Prop } internal sealed class ItemCatalogEntry { internal ushort ItemId; internal string PrefabName = ""; internal string DisplayName = ""; internal ItemPickerCategory Category; internal string SearchText = ""; internal Texture? Icon; } internal static class ItemCatalog { private static readonly List Entries = new List(); private static Language _loadedLanguage; private static bool _ready; internal static IReadOnlyList EntriesReadonly => Entries; internal static bool IsReady => _ready; internal static void EnsureLoaded() { //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_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) Language val = MarkerL10n.CurrentLanguage(); if (_ready && _loadedLanguage == val) { return; } Entries.Clear(); _ready = false; try { ItemDatabase instance = SingletonAsset.Instance; if (((DatabaseAsset)(object)instance)?.Objects == null) { return; } for (int i = 0; i < ((DatabaseAsset)(object)instance).Objects.Count; i++) { Item val2 = ((DatabaseAsset)(object)instance).Objects[i]; if (!((Object)(object)val2 == (Object)null) && !ShouldHide(val2) && IsPickerItem(val2.itemID)) { string text = ((Object)val2).name ?? ""; string text2 = ResolveDisplayName(val2); if (string.IsNullOrWhiteSpace(text2)) { text2 = text; } ItemCatalogEntry item = new ItemCatalogEntry { ItemId = val2.itemID, PrefabName = text, DisplayName = text2, Category = Classify(val2, text2), SearchText = $"{text2} {text} {val2.itemID}".ToLowerInvariant(), Icon = ResolveIcon(val2) }; Entries.Add(item); } } Entries.Sort(CompareEntries); _loadedLanguage = val; _ready = true; } catch (Exception ex) { Plugin.Log.LogWarning((object)("ItemCatalog load failed: " + ex.Message)); } } internal static void Reset() { _ready = false; Entries.Clear(); } private static Texture? ResolveIcon(Item prefab) { try { return (Texture?)(object)prefab.UIData?.icon; } catch { return null; } } private static string ResolveDisplayName(Item prefab) { try { string name = prefab.GetName(); if (!string.IsNullOrWhiteSpace(name) && !MarkerL10n.LooksLikeRawKey(name)) { return name.Trim(); } } catch { } try { string itemName = prefab.GetItemName((ItemInstanceData)null); if (!string.IsNullOrWhiteSpace(itemName) && !MarkerL10n.LooksLikeRawKey(itemName)) { return itemName.Trim(); } } catch { } return ((Object)prefab).name ?? ""; } private static bool ShouldHide(Item item) { string text = ((Object)item).name ?? ""; if (string.IsNullOrWhiteSpace(text)) { return true; } if (text.StartsWith("C_", StringComparison.OrdinalIgnoreCase)) { return true; } if (text.IndexOf("_Prop", StringComparison.OrdinalIgnoreCase) >= 0 || text.IndexOf("_TEMP", StringComparison.OrdinalIgnoreCase) >= 0 || text.IndexOf("_UNUSED", StringComparison.OrdinalIgnoreCase) >= 0 || text.IndexOf("_Hidden", StringComparison.OrdinalIgnoreCase) >= 0) { return true; } return string.Equals(text, "Skull", StringComparison.OrdinalIgnoreCase); } private static bool IsPickerItem(ushort id) { if (!DefaultFoodMarkItems.ForceFoodCategory.Contains(id)) { return DefaultOtherMarkItems.ForcePropCategory.Contains(id); } return true; } private static ItemPickerCategory Classify(Item item, string displayName) { if (DefaultFoodMarkItems.ForceFoodCategory.Contains(item.itemID)) { return ItemPickerCategory.Food; } return ItemPickerCategory.Prop; } private static int CompareEntries(ItemCatalogEntry a, ItemCatalogEntry b) { int num = a.Category.CompareTo(b.Category); if (num != 0) { return num; } if (a.Category == ItemPickerCategory.Prop) { return DefaultOtherMarkItems.CompareSort(a.ItemId, b.ItemId); } return string.Compare(a.DisplayName, b.DisplayName, StringComparison.CurrentCultureIgnoreCase); } } [HarmonyPatch(typeof(CharacterMovement), "CameraLook")] internal static class ItemPickerCameraLookPatch { [HarmonyPrefix] private static bool Prefix() { return !ItemPickerWindow.IsUiOpen; } } [HarmonyPatch(typeof(CursorHandler), "Update")] internal static class ItemPickerCursorPatch { [HarmonyPostfix] private static void Postfix() { if (ItemPickerWindow.IsUiOpen) { Cursor.lockState = (CursorLockMode)0; Cursor.visible = true; } } } internal enum MarkerPanelTab { Settings, Luggage, Items } internal sealed class ItemPickerWindow { private const int WindowId = 1279544656; private const float ReferenceHeight = 1440f; private bool _open; private Vector2 _scroll; private Vector2 _settingsScroll; private Vector2 _luggageScroll; private string _search = ""; private ItemPickerCategory _category; private bool _showSelectedOnly; private MarkerPanelTab _tab; private readonly HashSet _workingItems = new HashSet(); private readonly MarkerPanelState _state = new MarkerPanelState(); private string? _listeningKeyId; private CursorLockMode _prevLock; private bool _prevCursorVisible; private GUIStyle? _windowStyle; private GUIStyle? _labelStyle; private GUIStyle? _buttonStyle; private GUIStyle? _toggleStyle; private GUIStyle? _textFieldStyle; private Texture2D? _windowTex; private Texture2D? _buttonTex; private Texture2D? _buttonHoverTex; internal bool IsOpen => _open; internal static bool IsUiOpen { get; private set; } private static float UiScale => Mathf.Clamp((float)Screen.height / 1440f, 0.65f, 2.5f); internal void Toggle() { if (_open) { Close(); } else { Open(); } } internal void Open() { //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_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0087: 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_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) ItemCatalog.EnsureLoaded(); _state.LoadFromConfig(); _workingItems.Clear(); foreach (ushort selectedId in SelectedItemStore.SelectedIds) { _workingItems.Add(selectedId); } _search = ""; _category = ItemPickerCategory.Food; _showSelectedOnly = false; _tab = MarkerPanelTab.Settings; _scroll = Vector2.zero; _settingsScroll = Vector2.zero; _luggageScroll = Vector2.zero; _listeningKeyId = null; _open = true; IsUiOpen = true; _prevLock = Cursor.lockState; _prevCursorVisible = Cursor.visible; ApplyUiCursorState(); Plugin.Log.LogInfo((object)$"标记设置面板:已打开(物品目录 {ItemCatalog.EntriesReadonly.Count} 项,已选 {_workingItems.Count} 项)"); } internal void Close() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) if (_open) { _open = false; IsUiOpen = false; Cursor.lockState = _prevLock; Cursor.visible = _prevCursorVisible; Plugin.Log.LogInfo((object)"标记设置面板:已关闭"); } } internal void MaintainUiCursor() { if (_open) { ApplyUiCursorState(); } } private static void ApplyUiCursorState() { Cursor.lockState = (CursorLockMode)0; Cursor.visible = true; } internal void Draw() { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Expected O, but got Unknown //IL_0068: Unknown result type (might be due to invalid IL or missing references) if (_open) { EnsureStyles(); float uiScale = UiScale; float num = 820f * uiScale; float num2 = 900f * uiScale; Rect val = default(Rect); ((Rect)(ref val))..ctor(((float)Screen.width - num) * 0.5f, ((float)Screen.height - num2) * 0.5f, num, num2); GUI.ModalWindow(1279544656, val, new WindowFunction(DrawWindow), PanelL10n.Get(PanelL10n.Key.Title), _windowStyle); } } private void DrawWindow(int id) { float uiScale = UiScale; HandleKeyCapture(); DrawMainTabs(uiScale); GUILayout.Space(6f * uiScale); switch (_tab) { case MarkerPanelTab.Settings: DrawSettingsTab(uiScale); break; case MarkerPanelTab.Luggage: DrawLuggageTab(uiScale); break; case MarkerPanelTab.Items: DrawItemsTab(uiScale); break; } GUILayout.Space(4f * uiScale); DrawFooter(uiScale); } private void DrawMainTabs(float scale) { GUILayout.BeginHorizontal(Array.Empty()); DrawMainTab(PanelL10n.Get(PanelL10n.Key.TabSettings), MarkerPanelTab.Settings, scale); DrawMainTab(PanelL10n.Get(PanelL10n.Key.TabLuggage), MarkerPanelTab.Luggage, scale); DrawMainTab(PanelL10n.Get(PanelL10n.Key.TabItems), MarkerPanelTab.Items, scale); GUILayout.EndHorizontal(); } private void DrawMainTab(string label, MarkerPanelTab tab, float scale) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) if (_tab == tab) { GUI.backgroundColor = new Color(0.55f, 0.75f, 1f); } if (GUILayout.Button(label, _buttonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f * scale) })) { _tab = tab; } GUI.backgroundColor = Color.white; } private void DrawSettingsTab(float scale) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) _settingsScroll = GUILayout.BeginScrollView(_settingsScroll, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandHeight(true) }); _state.ModEnabled = DrawToggle(PanelL10n.Get(PanelL10n.Key.EnableMod), _state.ModEnabled, scale); GUILayout.Space(4f * scale); GUILayout.Label(PanelL10n.Get(PanelL10n.Key.SectionDisplay), _labelStyle, Array.Empty()); _state.ShowDistance = DrawToggle(PanelL10n.Get(PanelL10n.Key.ShowDistance), _state.ShowDistance, scale); _state.ShowTypePrefix = DrawToggle(PanelL10n.Get(PanelL10n.Key.ShowNames), _state.ShowTypePrefix, scale); _state.StartVisible = DrawToggle(PanelL10n.Get(PanelL10n.Key.StartVisible), _state.StartVisible, scale); _state.DisplayMode = DrawModeButtons(_state.DisplayMode, scale); if (string.Equals(_state.DisplayMode, "Timed", StringComparison.OrdinalIgnoreCase)) { _state.TimedSeconds = DrawFloatSliderRow(PanelL10n.Get(PanelL10n.Key.TimedSeconds), _state.TimedSeconds, 1f, 120f, scale); } _state.MaxDistanceMeters = DrawFloatSliderRow(PanelL10n.Get(PanelL10n.Key.LuggageMaxDistance), _state.MaxDistanceMeters, 0f, 5000f, scale); _state.HeightOffset = DrawFloatSliderRow(PanelL10n.Get(PanelL10n.Key.HeightOffset), _state.HeightOffset, 0f, 10f, scale); _state.FontSize = DrawIntSliderRow(PanelL10n.Get(PanelL10n.Key.FontSize), _state.FontSize, 10, 48, scale); GUILayout.Space(6f * scale); GUILayout.Label(PanelL10n.Get(PanelL10n.Key.SectionHotkeys), _labelStyle, Array.Empty()); DrawHotkeysSection(scale); GUILayout.Space(6f * scale); GUILayout.Label(PanelL10n.Get(PanelL10n.Key.SectionOtherMarkers), _labelStyle, Array.Empty()); _state.ShowScoutAmulets = DrawToggle(PanelL10n.Get(PanelL10n.Key.ScoutAmulets), _state.ShowScoutAmulets, scale); if (_state.ShowScoutAmulets) { _state.AmuletMaxDistanceMeters = DrawFloatSliderRow(PanelL10n.Get(PanelL10n.Key.AmuletMaxDistance), _state.AmuletMaxDistanceMeters, 0f, 5000f, scale); } _state.MarkGloomBells = DrawToggle(PanelL10n.Get(PanelL10n.Key.GloomBells), _state.MarkGloomBells, scale); if (_state.MarkGloomBells) { _state.GloomBellMaxDistanceMeters = DrawFloatSliderRow(PanelL10n.Get(PanelL10n.Key.GloomMaxDistance), _state.GloomBellMaxDistanceMeters, 0f, 5000f, scale); } _state.OtherItemsMaxDistanceMeters = DrawFloatSliderRow(PanelL10n.Get(PanelL10n.Key.CustomItemsMaxDistance), _state.OtherItemsMaxDistanceMeters, 0f, 5000f, scale); GUILayout.Space(6f * scale); GUILayout.Label(PanelL10n.Get(PanelL10n.Key.SectionOtherColors), _labelStyle, Array.Empty()); DrawColorBlock(PanelL10n.Get(PanelL10n.Key.ColorAmulet), ref _state.ColorAmulet, MarkerDefaultColors.Amulet, scale); DrawColorBlock(PanelL10n.Get(PanelL10n.Key.ColorGloom), ref _state.ColorGloomBell, MarkerDefaultColors.GloomBell, scale); DrawColorBlock(PanelL10n.Get(PanelL10n.Key.ColorCustom), ref _state.ColorOtherItem, MarkerDefaultColors.OtherItem, scale); GUILayout.EndScrollView(); } private void DrawLuggageTab(float scale) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) _luggageScroll = GUILayout.BeginScrollView(_luggageScroll, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandHeight(true) }); GUILayout.Label(PanelL10n.Get(PanelL10n.Key.LuggageHint), _labelStyle, Array.Empty()); GUILayout.Space(4f * scale); DrawLuggageRow(LuggageKind.Regular, ref _state.ShowLuggageRegular, ref _state.ColorRegular, scale); DrawLuggageRow(LuggageKind.Big, ref _state.ShowLuggageBig, ref _state.ColorBig, scale); DrawLuggageRow(LuggageKind.Explorer, ref _state.ShowLuggageExplorer, ref _state.ColorExplorer, scale); DrawLuggageRow(LuggageKind.Ancient, ref _state.ShowLuggageAncient, ref _state.ColorAncient, scale); DrawLuggageRow(LuggageKind.Clown, ref _state.ShowLuggageClown, ref _state.ColorClown, scale); DrawLuggageRow(LuggageKind.Trick, ref _state.ShowLuggageTrick, ref _state.ColorTrick, scale); DrawLuggageRow(LuggageKind.Respawn, ref _state.MarkRespawnChests, ref _state.ColorRespawn, scale); GUILayout.EndScrollView(); } private void DrawLuggageRow(LuggageKind kind, ref bool enabled, ref MarkerRgb rgb, float scale) { MarkerRgb defaultRgb = MarkerDefaultColors.ForLuggage(kind); GUILayout.BeginVertical(GUIStyle.op_Implicit("box"), Array.Empty()); string label = MarkerL10n.LuggageTypeLabel(kind); enabled = DrawToggle(label, enabled, scale); if (enabled) { GUILayout.Space(2f * scale); DrawColorBlock(label, ref rgb, defaultRgb, scale); } GUILayout.EndVertical(); GUILayout.Space(4f * scale); } private void DrawItemsTab(float scale) { //IL_0065: 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_007e: Unknown result type (might be due to invalid IL or missing references) GUILayout.Label(PanelL10n.Get(PanelL10n.Key.SearchHint), _labelStyle, Array.Empty()); _search = GUILayout.TextField(_search ?? "", _textFieldStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f * scale) }); DrawCategoryTabs(scale); GUILayout.Space(4f * scale); int num = 0; int num2 = 0; _scroll = GUILayout.BeginScrollView(_scroll, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandHeight(true) }); IReadOnlyList entriesReadonly = ItemCatalog.EntriesReadonly; string q = (_search ?? "").Trim().ToLowerInvariant(); for (int i = 0; i < entriesReadonly.Count; i++) { ItemCatalogEntry itemCatalogEntry = entriesReadonly[i]; if (!PassesFilter(itemCatalogEntry, q)) { continue; } num++; bool flag = _workingItems.Contains(itemCatalogEntry.ItemId); if (flag) { num2++; } string label = $"{itemCatalogEntry.DisplayName} ({itemCatalogEntry.PrefabName}) #{itemCatalogEntry.ItemId}"; bool flag2 = DrawItemRow(flag, label, itemCatalogEntry.Icon, scale); if (flag2 != flag) { if (flag2) { _workingItems.Add(itemCatalogEntry.ItemId); } else { _workingItems.Remove(itemCatalogEntry.ItemId); } } } if (num == 0) { GUILayout.Label(ItemCatalog.IsReady ? PanelL10n.Get(PanelL10n.Key.NoMatches) : PanelL10n.Get(PanelL10n.Key.Loading), _labelStyle, Array.Empty()); } GUILayout.EndScrollView(); GUILayout.Label(PanelL10n.ItemCountLine(num, num2, _workingItems.Count), _labelStyle, Array.Empty()); GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(PanelL10n.Get(PanelL10n.Key.SelectFiltered), _buttonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f * scale) })) { SelectFiltered(q, select: true); } if (GUILayout.Button(PanelL10n.Get(PanelL10n.Key.ClearFiltered), _buttonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f * scale) })) { SelectFiltered(q, select: false); } if (GUILayout.Button(PanelL10n.Get(PanelL10n.Key.ClearAll), _buttonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f * scale) })) { _workingItems.Clear(); } GUILayout.EndHorizontal(); } private void DrawFooter(float scale) { GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(PanelL10n.Get(PanelL10n.Key.Save), _buttonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(36f * scale) })) { SaveAndClose(); } if (GUILayout.Button(PanelL10n.Get(PanelL10n.Key.Cancel), _buttonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(36f * scale) })) { Close(); } if (GUILayout.Button(PanelL10n.Get(PanelL10n.Key.CloseEsc), _buttonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(36f * scale) })) { Close(); } GUILayout.EndHorizontal(); } private void SaveAndClose() { _state.SaveToConfig(((BaseUnityPlugin)Plugin.Instance).Config); SelectedItemStore.ApplyWorkingSet(_workingItems); SelectedItemStore.SaveIfDirty(); Plugin.Instance.NotifyPanelSaved(_state.StartVisible); Plugin.Log.LogInfo((object)$"标记设置已保存(自定义物品 {_workingItems.Count} 项)"); Close(); } private bool DrawToggle(string label, bool value, float scale) { return GUILayout.Toggle(value, label, _toggleStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(24f * scale) }); } private string DrawModeButtons(string mode, float scale) { GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label(PanelL10n.Get(PanelL10n.Key.DisplayMode), (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(140f * scale) }); bool flag = string.Equals(mode, "Toggle", StringComparison.OrdinalIgnoreCase); string text = PanelL10n.Get(PanelL10n.Key.ModeToggle); string text2 = PanelL10n.Get(PanelL10n.Key.ModeTimed); if (GUILayout.Button(flag ? ("[ " + text + " ]") : text, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f * scale) })) { mode = "Toggle"; } if (GUILayout.Button((!flag) ? ("[ " + text2 + " ]") : text2, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f * scale) })) { mode = "Timed"; } GUILayout.EndHorizontal(); return mode; } private void HandleKeyCapture() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Invalid comparison between Unknown and I4 //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Invalid comparison between Unknown and I4 //IL_003c: 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_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) if (_listeningKeyId == null) { return; } Event current = Event.current; if ((int)current.type != 4) { return; } if ((int)current.keyCode != 27) { if (_listeningKeyId == "toggle") { _state.ToggleKeyCode = current.keyCode; } else if (_listeningKeyId == "panel") { _state.ItemPanelKeyCode = current.keyCode; } } _listeningKeyId = null; current.Use(); } private void DrawHotkeysSection(float scale) { DrawKeyBindRow(PanelL10n.Get(PanelL10n.Key.ToggleMarkers), ref _state.ToggleKeyCode, "toggle", scale); DrawKeyBindRow(PanelL10n.Get(PanelL10n.Key.OpenPanel), ref _state.ItemPanelKeyCode, "panel", scale); _state.ItemPanelUseAlt = DrawToggle(PanelL10n.Get(PanelL10n.Key.PanelNeedAlt), _state.ItemPanelUseAlt, scale); _state.ItemPanelAllowLeftCtrl = DrawToggle(PanelL10n.Get(PanelL10n.Key.PanelAllowLeftCtrl), _state.ItemPanelAllowLeftCtrl, scale); } private void DrawKeyBindRow(string label, ref KeyCode key, string id, float scale) { float num = 28f * scale; GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(num) }); GUILayout.Label(label, _labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(240f * scale) }); bool flag = _listeningKeyId == id; if (GUILayout.Button(flag ? PanelL10n.Get(PanelL10n.Key.PressKey) : KeyLabel(key), _buttonStyle, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(160f * scale), GUILayout.Height(num - 2f) })) { _listeningKeyId = (flag ? null : id); } GUILayout.EndHorizontal(); } private unsafe static string KeyLabel(KeyCode key) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) if ((int)key != 0) { return ((object)(*(KeyCode*)(&key))/*cast due to .constrained prefix*/).ToString(); } return PanelL10n.Get(PanelL10n.Key.KeyUnset); } private float DrawFloatSliderRow(string label, float value, float min, float max, float scale) { float num = 28f * scale; GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(num) }); GUILayout.Label(label, _labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(220f * scale) }); if (float.TryParse(GUILayout.TextField(value.ToString("0.##"), _textFieldStyle, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(72f * scale), GUILayout.Height(num - 2f) }), out var result)) { value = result; } value = Mathf.Clamp(value, min, max); value = GUILayout.HorizontalSlider(value, min, max, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.MinWidth(160f * scale), GUILayout.Height(18f * scale) }); GUILayout.EndHorizontal(); return Mathf.Clamp(value, min, max); } private int DrawIntSliderRow(string label, int value, int min, int max, float scale) { float num = 28f * scale; GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(num) }); GUILayout.Label(label, _labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(220f * scale) }); if (int.TryParse(GUILayout.TextField(value.ToString(), _textFieldStyle, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(72f * scale), GUILayout.Height(num - 2f) }), out var result)) { value = result; } value = Mathf.Clamp(value, min, max); value = Mathf.RoundToInt(GUILayout.HorizontalSlider((float)value, (float)min, (float)max, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.MinWidth(160f * scale), GUILayout.Height(18f * scale) })); GUILayout.EndHorizontal(); return Mathf.Clamp(value, min, max); } private void DrawColorBlock(string label, ref MarkerRgb rgb, MarkerRgb defaultRgb, float scale) { float num = 26f * scale; GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(num) }); GUILayout.Label(label, _labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) }); if (GUILayout.Button(PanelL10n.Get(PanelL10n.Key.Reset), _buttonStyle, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(72f * scale), GUILayout.Height(num - 2f) })) { rgb = defaultRgb; } GUILayout.EndHorizontal(); ImGuiColorPicker.Draw(ref rgb, scale, _labelStyle, _textFieldStyle); GUILayout.Space(2f * scale); } private bool DrawItemRow(bool on, string label, Texture? icon, float scale) { //IL_0057: 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_0097: Unknown result type (might be due to invalid IL or missing references) float num = 32f * scale; float num2 = 24f * scale; GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(num) }); if ((Object)(object)icon != (Object)null) { GUILayout.Label(GUIContent.none, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(num2 + 8f), GUILayout.Height(num) }); Rect lastRect = GUILayoutUtility.GetLastRect(); ((Rect)(ref lastRect)).x = ((Rect)(ref lastRect)).x + 4f; ((Rect)(ref lastRect)).y = ((Rect)(ref lastRect)).y + (num - num2) * 0.5f; ((Rect)(ref lastRect)).width = num2; ((Rect)(ref lastRect)).height = num2; GUI.DrawTexture(lastRect, icon, (ScaleMode)2); } bool result = GUILayout.Toggle(on, label, _toggleStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(num) }); GUILayout.EndHorizontal(); return result; } private bool PassesFilter(ItemCatalogEntry entry, string q) { if (_showSelectedOnly && !_workingItems.Contains(entry.ItemId)) { return false; } if (!_showSelectedOnly && entry.Category != _category) { return false; } if (!string.IsNullOrEmpty(q) && entry.SearchText.IndexOf(q, StringComparison.Ordinal) < 0) { return false; } return true; } private void SelectFiltered(string q, bool select) { IReadOnlyList entriesReadonly = ItemCatalog.EntriesReadonly; for (int i = 0; i < entriesReadonly.Count; i++) { ItemCatalogEntry itemCatalogEntry = entriesReadonly[i]; if (PassesFilter(itemCatalogEntry, q)) { if (select) { _workingItems.Add(itemCatalogEntry.ItemId); } else { _workingItems.Remove(itemCatalogEntry.ItemId); } } } } private void DrawCategoryTabs(float scale) { GUILayout.BeginHorizontal(Array.Empty()); DrawSelectedOnlyTab(scale); DrawTab(PanelL10n.Get(PanelL10n.Key.TabFood), ItemPickerCategory.Food, scale); DrawTab(PanelL10n.Get(PanelL10n.Key.TabProp), ItemPickerCategory.Prop, scale); GUILayout.EndHorizontal(); } private void DrawSelectedOnlyTab(float scale) { //IL_0017: 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) if (_showSelectedOnly) { GUI.backgroundColor = new Color(0.55f, 0.85f, 0.55f); } if (GUILayout.Button(PanelL10n.Get(PanelL10n.Key.TabSelected), _buttonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f * scale) })) { _showSelectedOnly = !_showSelectedOnly; } GUI.backgroundColor = Color.white; } private void DrawTab(string label, ItemPickerCategory cat, float scale) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) if (!_showSelectedOnly && _category == cat) { GUI.backgroundColor = new Color(0.55f, 0.75f, 1f); } if (GUILayout.Button(label, _buttonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f * scale) })) { _showSelectedOnly = false; _category = cat; } GUI.backgroundColor = Color.white; } private void EnsureStyles() { //IL_001e: 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_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Expected O, but got Unknown //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Expected O, but got Unknown //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: 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_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0127: 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_013e: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Expected O, but got Unknown //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_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Expected O, but got Unknown //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Expected O, but got Unknown if (_windowStyle == null) { _windowTex = MakeTex(new Color(0.08f, 0.09f, 0.12f, 0.96f)); _buttonTex = MakeTex(new Color(0.18f, 0.2f, 0.26f, 1f)); _buttonHoverTex = MakeTex(new Color(0.28f, 0.32f, 0.42f, 1f)); int num = Mathf.RoundToInt(16f * UiScale); _windowStyle = new GUIStyle(GUI.skin.window) { fontSize = num + 2, fontStyle = (FontStyle)1 }; _labelStyle = new GUIStyle(GUI.skin.label) { fontSize = num, wordWrap = true }; GUIStyle val = new GUIStyle(GUI.skin.button) { fontSize = num }; val.normal.background = _buttonTex; val.normal.textColor = Color.white; val.hover.background = _buttonHoverTex; val.hover.textColor = Color.white; val.active.background = _buttonHoverTex; val.active.textColor = Color.white; _buttonStyle = val; _toggleStyle = new GUIStyle(GUI.skin.toggle) { fontSize = num, wordWrap = false }; _textFieldStyle = new GUIStyle(GUI.skin.textField) { fontSize = num }; _windowStyle.normal.background = _windowTex; } } private static Texture2D MakeTex(Color c) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown Texture2D val = new Texture2D(1, 1, (TextureFormat)4, false); val.SetPixel(0, 0, c); val.Apply(); return val; } } internal sealed class MarkerColorConfig { internal ConfigEntry R; internal ConfigEntry G; internal ConfigEntry B; internal Color Color => new Color((float)R.Value / 255f, (float)G.Value / 255f, (float)B.Value / 255f, 1f); internal static MarkerColorConfig Bind(ConfigFile config, string section, string labelEn, string labelZh, Color defaultColor) { //IL_0000: 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_003c: Unknown result type (might be due to invalid IL or missing references) int num = Mathf.Clamp(Mathf.RoundToInt(defaultColor.r * 255f), 0, 255); int num2 = Mathf.Clamp(Mathf.RoundToInt(defaultColor.g * 255f), 0, 255); int num3 = Mathf.Clamp(Mathf.RoundToInt(defaultColor.b * 255f), 0, 255); AcceptableValueRange range = new AcceptableValueRange(0, 255); string text = "EN: " + labelEn + " marker color.\n中文:" + labelZh + "标记颜色。"; return new MarkerColorConfig { R = config.Bind(section, labelEn + " Color R " + labelZh + "颜色R", num, HiddenConfig.Desc(text + " Red 0-255 / 红 0-255。", (AcceptableValueBase)(object)range)), G = config.Bind(section, labelEn + " Color G " + labelZh + "颜色G", num2, HiddenConfig.Desc(text + " Green 0-255 / 绿 0-255。", (AcceptableValueBase)(object)range)), B = config.Bind(section, labelEn + " Color B " + labelZh + "颜色B", num3, HiddenConfig.Desc(text + " Blue 0-255 / 蓝 0-255。", (AcceptableValueBase)(object)range)) }; } } internal static class MarkerDefaultColors { internal static readonly MarkerRgb Regular = MarkerRgb.FromColor(Color.white); internal static readonly MarkerRgb Big = MarkerRgb.FromColor(new Color(0.12f, 1f, 0f)); internal static readonly MarkerRgb Explorer = MarkerRgb.FromColor(new Color(0f, 0.44f, 0.87f)); internal static readonly MarkerRgb Ancient = MarkerRgb.FromColor(new Color(0.64f, 0.21f, 0.93f)); internal static readonly MarkerRgb Clown = MarkerRgb.FromColor(new Color(1f, 0.5f, 0f)); internal static readonly MarkerRgb Trick = MarkerRgb.FromColor(new Color(1f, 0.5f, 0f)); internal static readonly MarkerRgb Respawn = MarkerRgb.FromColor(new Color(1f, 0.13f, 0.13f)); internal static readonly MarkerRgb Amulet = MarkerRgb.FromColor(new Color(1f, 0.35f, 0.72f)); internal static readonly MarkerRgb GloomBell = MarkerRgb.FromColor(new Color(0.95f, 0.78f, 0.22f)); internal static readonly MarkerRgb OtherItem = MarkerRgb.FromColor(new Color(0.35f, 0.88f, 1f)); internal static MarkerRgb ForLuggage(LuggageKind kind) { return kind switch { LuggageKind.Regular => Regular, LuggageKind.Big => Big, LuggageKind.Explorer => Explorer, LuggageKind.Ancient => Ancient, LuggageKind.Clown => Clown, LuggageKind.Trick => Trick, LuggageKind.Respawn => Respawn, _ => Regular, }; } } internal static class MarkerL10n { private static readonly Dictionary En = new Dictionary { [LuggageKind.Regular] = "Luggage", [LuggageKind.Big] = "Large", [LuggageKind.Explorer] = "Explorer", [LuggageKind.Ancient] = "Ancient", [LuggageKind.Clown] = "Clown", [LuggageKind.Trick] = "Trick", [LuggageKind.Respawn] = "Statue", [LuggageKind.Unknown] = "?" }; private static readonly Dictionary ZhCn = new Dictionary { [LuggageKind.Regular] = "普通", [LuggageKind.Big] = "大型", [LuggageKind.Explorer] = "探险", [LuggageKind.Ancient] = "古代", [LuggageKind.Clown] = "小丑", [LuggageKind.Trick] = "假箱", [LuggageKind.Respawn] = "雕像", [LuggageKind.Unknown] = "?" }; private static readonly Dictionary ZhTw = new Dictionary { [LuggageKind.Regular] = "普通", [LuggageKind.Big] = "大型", [LuggageKind.Explorer] = "探險", [LuggageKind.Ancient] = "古代", [LuggageKind.Clown] = "小丑", [LuggageKind.Trick] = "假箱", [LuggageKind.Respawn] = "雕像", [LuggageKind.Unknown] = "?" }; private static readonly Dictionary Ja = new Dictionary { [LuggageKind.Regular] = "荷物", [LuggageKind.Big] = "大型", [LuggageKind.Explorer] = "探検", [LuggageKind.Ancient] = "古代", [LuggageKind.Clown] = "ピエロ", [LuggageKind.Trick] = "偽物", [LuggageKind.Respawn] = "像", [LuggageKind.Unknown] = "?" }; private static readonly Dictionary Ko = new Dictionary { [LuggageKind.Regular] = "일반", [LuggageKind.Big] = "대형", [LuggageKind.Explorer] = "탐험", [LuggageKind.Ancient] = "고대", [LuggageKind.Clown] = "광대", [LuggageKind.Trick] = "가짜", [LuggageKind.Respawn] = "동상", [LuggageKind.Unknown] = "?" }; private static readonly Dictionary Fr = new Dictionary { [LuggageKind.Regular] = "Bagage", [LuggageKind.Big] = "Grand", [LuggageKind.Explorer] = "Explorateur", [LuggageKind.Ancient] = "Ancien", [LuggageKind.Clown] = "Clown", [LuggageKind.Trick] = "Faux", [LuggageKind.Respawn] = "Statue", [LuggageKind.Unknown] = "?" }; private static readonly Dictionary It = new Dictionary { [LuggageKind.Regular] = "Bagaglio", [LuggageKind.Big] = "Grande", [LuggageKind.Explorer] = "Esploratore", [LuggageKind.Ancient] = "Antico", [LuggageKind.Clown] = "Clown", [LuggageKind.Trick] = "Finto", [LuggageKind.Respawn] = "Statua", [LuggageKind.Unknown] = "?" }; private static readonly Dictionary De = new Dictionary { [LuggageKind.Regular] = "Gepäck", [LuggageKind.Big] = "Groß", [LuggageKind.Explorer] = "Entdecker", [LuggageKind.Ancient] = "Antik", [LuggageKind.Clown] = "Clown", [LuggageKind.Trick] = "Trick", [LuggageKind.Respawn] = "Statue", [LuggageKind.Unknown] = "?" }; private static readonly Dictionary Es = new Dictionary { [LuggageKind.Regular] = "Equipaje", [LuggageKind.Big] = "Grande", [LuggageKind.Explorer] = "Explorador", [LuggageKind.Ancient] = "Antiguo", [LuggageKind.Clown] = "Payaso", [LuggageKind.Trick] = "Truco", [LuggageKind.Respawn] = "Estatua", [LuggageKind.Unknown] = "?" }; private static readonly Dictionary Pt = new Dictionary { [LuggageKind.Regular] = "Bagagem", [LuggageKind.Big] = "Grande", [LuggageKind.Explorer] = "Explorador", [LuggageKind.Ancient] = "Antigo", [LuggageKind.Clown] = "Palhaço", [LuggageKind.Trick] = "Truque", [LuggageKind.Respawn] = "Estátua", [LuggageKind.Unknown] = "?" }; private static readonly Dictionary Ru = new Dictionary { [LuggageKind.Regular] = "Багаж", [LuggageKind.Big] = "Большой", [LuggageKind.Explorer] = "Исслед.", [LuggageKind.Ancient] = "Древний", [LuggageKind.Clown] = "Клоун", [LuggageKind.Trick] = "Обман", [LuggageKind.Respawn] = "Статуя", [LuggageKind.Unknown] = "?" }; private static readonly Dictionary Uk = new Dictionary { [LuggageKind.Regular] = "Багаж", [LuggageKind.Big] = "Великий", [LuggageKind.Explorer] = "Дослід.", [LuggageKind.Ancient] = "Стародав.", [LuggageKind.Clown] = "Клоун", [LuggageKind.Trick] = "Обман", [LuggageKind.Respawn] = "Статуя", [LuggageKind.Unknown] = "?" }; private static readonly Dictionary Pl = new Dictionary { [LuggageKind.Regular] = "Bagaż", [LuggageKind.Big] = "Duży", [LuggageKind.Explorer] = "Odkrywca", [LuggageKind.Ancient] = "Starożytny", [LuggageKind.Clown] = "Klaun", [LuggageKind.Trick] = "Podróbka", [LuggageKind.Respawn] = "Posąg", [LuggageKind.Unknown] = "?" }; private static readonly Dictionary Tr = new Dictionary { [LuggageKind.Regular] = "Bagaj", [LuggageKind.Big] = "Büyük", [LuggageKind.Explorer] = "Kaşif", [LuggageKind.Ancient] = "Antik", [LuggageKind.Clown] = "Palyaço", [LuggageKind.Trick] = "Sahte", [LuggageKind.Respawn] = "Heykel", [LuggageKind.Unknown] = "?" }; internal static Language CurrentLanguage() { //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_000d: Unknown result type (might be due to invalid IL or missing references) try { return LocalizedText.CURRENT_LANGUAGE; } catch { } return (Language)0; } internal static string LuggageTypeLabel(LuggageKind kind) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) if (!TableFor(CurrentLanguage()).TryGetValue(kind, out string value) || string.IsNullOrEmpty(value)) { return En[kind]; } return value; } private static Dictionary TableFor(Language lang) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected I4, but got Unknown return (lang - 1) switch { 8 => ZhCn, 9 => ZhTw, 10 => Ja, 11 => Ko, 0 => Fr, 1 => It, 2 => De, 3 => Es, 4 => Es, 5 => Pt, 6 => Ru, 7 => Uk, 12 => Pl, 13 => Tr, _ => En, }; } internal static bool LooksLikeRawKey(string text) { if (string.IsNullOrWhiteSpace(text)) { return true; } if (text.IndexOf(' ') < 0 && text.IndexOf('_') >= 0 && text == text.ToUpperInvariant()) { return true; } return false; } } internal struct MarkerRgb { internal int R; internal int G; internal int B; internal Color Color => new Color((float)R / 255f, (float)G / 255f, (float)B / 255f, 1f); internal static MarkerRgb From(MarkerColorConfig cfg) { return new MarkerRgb { R = cfg.R.Value, G = cfg.G.Value, B = cfg.B.Value }; } internal void ApplyTo(MarkerColorConfig cfg) { cfg.R.Value = R; cfg.G.Value = G; cfg.B.Value = B; } internal static MarkerRgb FromColor(Color c) { //IL_000a: 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_0050: Unknown result type (might be due to invalid IL or missing references) return new MarkerRgb { R = Mathf.Clamp(Mathf.RoundToInt(c.r * 255f), 0, 255), G = Mathf.Clamp(Mathf.RoundToInt(c.g * 255f), 0, 255), B = Mathf.Clamp(Mathf.RoundToInt(c.b * 255f), 0, 255) }; } } internal sealed class MarkerPanelState { internal bool ModEnabled; internal bool ShowDistance; internal bool ShowTypePrefix; internal float MaxDistanceMeters; internal float HeightOffset; internal int FontSize; internal bool MarkGloomBells; internal float GloomBellMaxDistanceMeters; internal bool ShowScoutAmulets; internal float AmuletMaxDistanceMeters; internal float OtherItemsMaxDistanceMeters; internal string DisplayMode = "Toggle"; internal float TimedSeconds; internal bool StartVisible; internal KeyCode ToggleKeyCode; internal KeyCode ItemPanelKeyCode; internal bool ItemPanelUseAlt; internal bool ItemPanelAllowLeftCtrl; internal bool ShowLuggageRegular; internal bool ShowLuggageBig; internal bool ShowLuggageExplorer; internal bool ShowLuggageAncient; internal bool ShowLuggageClown; internal bool ShowLuggageTrick; internal bool MarkRespawnChests; internal MarkerRgb ColorRegular; internal MarkerRgb ColorBig; internal MarkerRgb ColorExplorer; internal MarkerRgb ColorAncient; internal MarkerRgb ColorClown; internal MarkerRgb ColorTrick; internal MarkerRgb ColorRespawn; internal MarkerRgb ColorAmulet; internal MarkerRgb ColorGloomBell; internal MarkerRgb ColorOtherItem; internal void LoadFromConfig() { //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: 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_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) ModEnabled = Plugin.ModEnabled.Value; ShowDistance = Plugin.ShowDistance.Value; ShowTypePrefix = Plugin.ShowTypePrefix.Value; MaxDistanceMeters = Plugin.MaxDistanceMeters.Value; HeightOffset = Plugin.HeightOffset.Value; FontSize = Plugin.FontSize.Value; MarkGloomBells = Plugin.MarkGloomBells.Value; GloomBellMaxDistanceMeters = Plugin.GloomBellMaxDistanceMeters.Value; ShowScoutAmulets = Plugin.ShowScoutAmulets.Value; AmuletMaxDistanceMeters = Plugin.AmuletMaxDistanceMeters.Value; OtherItemsMaxDistanceMeters = Plugin.OtherItemsMaxDistanceMeters.Value; DisplayMode = Plugin.DisplayMode.Value ?? "Toggle"; TimedSeconds = Plugin.TimedSeconds.Value; StartVisible = Plugin.StartVisible.Value; KeyboardShortcut value = Plugin.ToggleKey.Value; ToggleKeyCode = ((KeyboardShortcut)(ref value)).MainKey; ItemPanelKeyCode = Plugin.ItemPanelKey.Value; ItemPanelUseAlt = Plugin.ItemPanelUseAlt.Value; ItemPanelAllowLeftCtrl = Plugin.ItemPanelAllowLeftCtrl.Value; ShowLuggageRegular = Plugin.ShowLuggageRegular.Value; ShowLuggageBig = Plugin.ShowLuggageBig.Value; ShowLuggageExplorer = Plugin.ShowLuggageExplorer.Value; ShowLuggageAncient = Plugin.ShowLuggageAncient.Value; ShowLuggageClown = Plugin.ShowLuggageClown.Value; ShowLuggageTrick = Plugin.ShowLuggageTrick.Value; MarkRespawnChests = Plugin.MarkRespawnChests.Value; ColorRegular = MarkerRgb.From(Plugin.ColorRegularCfg); ColorBig = MarkerRgb.From(Plugin.ColorBigCfg); ColorExplorer = MarkerRgb.From(Plugin.ColorExplorerCfg); ColorAncient = MarkerRgb.From(Plugin.ColorAncientCfg); ColorClown = MarkerRgb.From(Plugin.ColorClownCfg); ColorTrick = MarkerRgb.From(Plugin.ColorTrickCfg); ColorRespawn = MarkerRgb.From(Plugin.ColorRespawnCfg); ColorAmulet = MarkerRgb.From(Plugin.ColorAmuletCfg); ColorGloomBell = MarkerRgb.From(Plugin.ColorGloomBellCfg); ColorOtherItem = MarkerRgb.From(Plugin.ColorOtherItemCfg); } internal void SaveToConfig(ConfigFile config) { //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) Plugin.ModEnabled.Value = ModEnabled; Plugin.ShowDistance.Value = ShowDistance; Plugin.ShowTypePrefix.Value = ShowTypePrefix; Plugin.MaxDistanceMeters.Value = MaxDistanceMeters; Plugin.HeightOffset.Value = HeightOffset; Plugin.FontSize.Value = FontSize; Plugin.MarkGloomBells.Value = MarkGloomBells; Plugin.GloomBellMaxDistanceMeters.Value = GloomBellMaxDistanceMeters; Plugin.ShowScoutAmulets.Value = ShowScoutAmulets; Plugin.AmuletMaxDistanceMeters.Value = AmuletMaxDistanceMeters; Plugin.OtherItemsMaxDistanceMeters.Value = OtherItemsMaxDistanceMeters; Plugin.DisplayMode.Value = DisplayMode; Plugin.TimedSeconds.Value = TimedSeconds; Plugin.StartVisible.Value = StartVisible; Plugin.ToggleKey.Value = new KeyboardShortcut(ToggleKeyCode, Array.Empty()); Plugin.ItemPanelKey.Value = ItemPanelKeyCode; Plugin.ItemPanelUseAlt.Value = ItemPanelUseAlt; Plugin.ItemPanelAllowLeftCtrl.Value = ItemPanelAllowLeftCtrl; Plugin.ShowLuggageRegular.Value = ShowLuggageRegular; Plugin.ShowLuggageBig.Value = ShowLuggageBig; Plugin.ShowLuggageExplorer.Value = ShowLuggageExplorer; Plugin.ShowLuggageAncient.Value = ShowLuggageAncient; Plugin.ShowLuggageClown.Value = ShowLuggageClown; Plugin.ShowLuggageTrick.Value = ShowLuggageTrick; Plugin.MarkRespawnChests.Value = MarkRespawnChests; ColorRegular.ApplyTo(Plugin.ColorRegularCfg); ColorBig.ApplyTo(Plugin.ColorBigCfg); ColorExplorer.ApplyTo(Plugin.ColorExplorerCfg); ColorAncient.ApplyTo(Plugin.ColorAncientCfg); ColorClown.ApplyTo(Plugin.ColorClownCfg); ColorTrick.ApplyTo(Plugin.ColorTrickCfg); ColorRespawn.ApplyTo(Plugin.ColorRespawnCfg); ColorAmulet.ApplyTo(Plugin.ColorAmuletCfg); ColorGloomBell.ApplyTo(Plugin.ColorGloomBellCfg); ColorOtherItem.ApplyTo(Plugin.ColorOtherItemCfg); config.Save(); } } internal readonly struct SpawnerMarker { internal readonly Vector3 Position; internal readonly string Label; internal SpawnerMarker(Vector3 position, string label) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) Position = position; Label = label; } } internal static class OtherItemRegistry { private static readonly List CachedItems = new List(); private static readonly List CachedKinematicItems = new List(); private static readonly List CachedFakes = new List(); private static readonly List CachedSpawnerMarkers = new List(); private static readonly HashSet ScratchIds = new HashSet(); private static float _nextRefreshAt; internal const float RefreshIntervalSeconds = 2f; private const float SpawnerItemMatchRadius = 2f; internal static void TickRefresh(bool shouldRun) { if (!shouldRun || SelectedItemStore.Count == 0) { CachedItems.Clear(); CachedKinematicItems.Clear(); CachedFakes.Clear(); CachedSpawnerMarkers.Clear(); } else if (!(Time.unscaledTime < _nextRefreshAt)) { _nextRefreshAt = Time.unscaledTime + 2f; RefreshKinematicItems(); RefreshItems(); RefreshFakes(); RefreshSpawnerMarkers(); } } internal static void CopyCachedItems(List into) { into.Clear(); ScratchIds.Clear(); AddUniqueItems(into, CachedItems); AddUniqueItems(into, CachedKinematicItems); } internal static void CopyCachedFakes(List into) { into.Clear(); for (int i = 0; i < CachedFakes.Count; i++) { FakeItem val = CachedFakes[i]; if ((Object)(object)val != (Object)null && IsMarkableWorldFakeItem(val)) { into.Add(val); } } } internal static void CopyCachedSpawnerMarkers(List into) { into.Clear(); into.AddRange(CachedSpawnerMarkers); } internal static void Invalidate() { _nextRefreshAt = 0f; CachedItems.Clear(); CachedKinematicItems.Clear(); CachedFakes.Clear(); CachedSpawnerMarkers.Clear(); } private static void AddUniqueItems(List into, List source) { for (int i = 0; i < source.Count; i++) { Item val = source[i]; if (!((Object)(object)val == (Object)null) && IsMarkableWorldItem(val)) { int instanceID = ((Object)val).GetInstanceID(); if (ScratchIds.Add(instanceID)) { into.Add(val); } } } } private static void RefreshItems() { CachedItems.Clear(); if (SelectedItemStore.Count == 0) { return; } try { List aLL_ACTIVE_ITEMS = Item.ALL_ACTIVE_ITEMS; if (aLL_ACTIVE_ITEMS == null) { return; } for (int i = 0; i < aLL_ACTIVE_ITEMS.Count; i++) { Item val = aLL_ACTIVE_ITEMS[i]; if (!((Object)(object)val == (Object)null) && IsMarkableWorldItem(val) && SelectedItemStore.Contains(val.itemID)) { CachedItems.Add(val); } } } catch { } } private static void RefreshKinematicItems() { CachedKinematicItems.Clear(); if (SelectedItemStore.Count == 0) { return; } try { Item[] array = Object.FindObjectsByType((FindObjectsInactive)0, (FindObjectsSortMode)0); if (array == null) { return; } foreach (Item val in array) { if ((Object)(object)val == (Object)null || !IsMarkableWorldItem(val) || !SelectedItemStore.Contains(val.itemID)) { continue; } try { if ((Object)(object)val.rig == (Object)null || !val.rig.isKinematic) { continue; } goto IL_0069; } catch { } continue; IL_0069: CachedKinematicItems.Add(val); } } catch { } } private static void RefreshSpawnerMarkers() { //IL_006a: 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_0071: 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) CachedSpawnerMarkers.Clear(); if (SelectedItemStore.Count == 0) { return; } try { SingleItemSpawner[] array = Object.FindObjectsByType((FindObjectsInactive)0, (FindObjectsSortMode)0); if (array == null) { return; } foreach (SingleItemSpawner val in array) { if ((Object)(object)val == (Object)null || (Object)(object)val.prefab == (Object)null) { continue; } Item component = val.prefab.GetComponent(); if (!((Object)(object)component == (Object)null) && SelectedItemStore.Contains(component.itemID)) { Vector3 position = ((Component)val).transform.position; if (!HasTrackedItemNear(position, component.itemID)) { string label = SafeName(component); CachedSpawnerMarkers.Add(new SpawnerMarker(position, label)); } } } } catch { } } private static bool HasTrackedItemNear(Vector3 pos, ushort itemId) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) if (HasItemNear(CachedKinematicItems, pos, itemId)) { return true; } if (HasItemNear(CachedItems, pos, itemId)) { return true; } return false; } private static bool HasItemNear(List items, Vector3 pos, ushort itemId) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0030: 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) float num = 4f; for (int i = 0; i < items.Count; i++) { Item val = items[i]; if (!((Object)(object)val == (Object)null) && val.itemID == itemId) { Vector3 val2 = ((Component)val).transform.position - pos; if (((Vector3)(ref val2)).sqrMagnitude <= num) { return true; } } } return false; } private static void RefreshFakes() { CachedFakes.Clear(); if (SelectedItemStore.Count == 0) { return; } try { FakeItem[] array = Object.FindObjectsByType((FindObjectsInactive)0, (FindObjectsSortMode)0); if (array == null) { return; } foreach (FakeItem val in array) { if (!((Object)(object)val == (Object)null) && IsMarkableWorldFakeItem(val)) { Item realItemPrefab = val.realItemPrefab; if (!((Object)(object)realItemPrefab == (Object)null) && SelectedItemStore.Contains(realItemPrefab.itemID)) { CachedFakes.Add(val); } } } } catch { } } internal static bool IsMarkableWorldItem(Item? item) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Invalid comparison between Unknown and I4 //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Invalid comparison between Unknown and I4 if ((Object)(object)item == (Object)null) { return false; } try { Scene scene = ((Component)item).gameObject.scene; if (!((Scene)(ref scene)).IsValid()) { return false; } if ((Object)(object)item.holderCharacter != (Object)null) { return false; } if ((Object)(object)item.wearerCharacter != (Object)null) { return false; } if ((int)item.itemState == 2) { return false; } if ((int)item.itemState == 1) { return false; } return true; } catch { return false; } } internal static bool IsMarkableWorldFakeItem(FakeItem? fake) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)fake == (Object)null) { return false; } try { Scene scene = ((Component)fake).gameObject.scene; if (!((Scene)(ref scene)).IsValid()) { return false; } if (fake.pickedUp) { return false; } if (!((Component)fake).gameObject.activeInHierarchy) { return false; } if ((Object)(object)fake.realItemPrefab == (Object)null) { return false; } return true; } catch { return false; } } internal static string SafeName(Item item) { try { string itemName = item.GetItemName((ItemInstanceData)null); if (!string.IsNullOrEmpty(itemName) && !MarkerL10n.LooksLikeRawKey(itemName)) { return itemName; } } catch { } try { string name = item.GetName(); if (!string.IsNullOrEmpty(name) && !MarkerL10n.LooksLikeRawKey(name)) { return name; } } catch { } if (!((Object)(object)((Component)item).gameObject != (Object)null)) { return "?"; } return ((Object)((Component)item).gameObject).name; } internal static string SafeName(FakeItem fake) { try { string name = fake.GetName(); if (!string.IsNullOrEmpty(name) && !MarkerL10n.LooksLikeRawKey(name)) { return name; } } catch { } Item realItemPrefab = fake.realItemPrefab; if ((Object)(object)realItemPrefab != (Object)null) { try { string name2 = realItemPrefab.GetName(); if (!string.IsNullOrEmpty(name2) && !MarkerL10n.LooksLikeRawKey(name2)) { return name2; } } catch { } } if (!((Object)(object)((Component)fake).gameObject != (Object)null)) { return "?"; } return ((Object)((Component)fake).gameObject).name; } internal static Vector3 GetWorldPos(Item item) { //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_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_002b: 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) try { if ((Object)(object)item.mainRenderer != (Object)null) { Bounds bounds = item.mainRenderer.bounds; return ((Bounds)(ref bounds)).center; } } catch { } try { return item.Center(); } catch { return ((Component)item).transform.position; } } internal static Vector3 GetWorldPos(FakeItem fake) { //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_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_002b: 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) try { if ((Object)(object)fake.mainRenderer != (Object)null) { Bounds bounds = fake.mainRenderer.bounds; return ((Bounds)(ref bounds)).center; } } catch { } try { return fake.Center(); } catch { return ((Component)fake).transform.position; } } } internal static class PanelL10n { internal enum Key { Title, TabSettings, TabLuggage, TabItems, EnableMod, SectionDisplay, ShowDistance, ShowNames, StartVisible, DisplayMode, ModeToggle, ModeTimed, TimedSeconds, LuggageMaxDistance, HeightOffset, FontSize, SectionHotkeys, ToggleMarkers, OpenPanel, PanelNeedAlt, PanelAllowLeftCtrl, PressKey, KeyUnset, SectionOtherMarkers, ScoutAmulets, AmuletMaxDistance, GloomBells, GloomMaxDistance, CustomItemsMaxDistance, SectionOtherColors, ColorAmulet, ColorGloom, ColorCustom, LuggageHint, SearchHint, TabSelected, TabFood, TabProp, NoMatches, Loading, ItemCount, SelectFiltered, ClearFiltered, ClearAll, Save, Cancel, CloseEsc, Reset } private static readonly Dictionary En = new Dictionary { [Key.Title] = "Item Display Settings (O)", [Key.TabSettings] = "Settings", [Key.TabLuggage] = "Luggage", [Key.TabItems] = "Items", [Key.EnableMod] = "Enable mod", [Key.SectionDisplay] = "— Display —", [Key.ShowDistance] = "Show distance", [Key.ShowNames] = "Show names", [Key.StartVisible] = "Start visible", [Key.DisplayMode] = "Display mode:", [Key.ModeToggle] = "Toggle", [Key.ModeTimed] = "Timed", [Key.TimedSeconds] = "Timed seconds", [Key.LuggageMaxDistance] = "Luggage max distance (m)", [Key.HeightOffset] = "Height offset", [Key.FontSize] = "Font size", [Key.SectionHotkeys] = "— Hotkeys —", [Key.ToggleMarkers] = "Toggle markers", [Key.OpenPanel] = "Open this panel", [Key.PanelNeedAlt] = "Hold Alt to open panel", [Key.PanelAllowLeftCtrl] = "Allow Left Ctrl to open panel", [Key.PressKey] = "Press a key… (Esc cancel)", [Key.KeyUnset] = "Not set", [Key.SectionOtherMarkers] = "— Other markers —", [Key.ScoutAmulets] = "Scout Amulets", [Key.AmuletMaxDistance] = " Amulet max distance (m)", [Key.GloomBells] = "Gloom bell towers", [Key.GloomMaxDistance] = " Bell max distance (m)", [Key.CustomItemsMaxDistance] = "Custom items max distance (m)", [Key.SectionOtherColors] = "— Other marker colors —", [Key.ColorAmulet] = "Scout Amulet", [Key.ColorGloom] = "Gloom bell", [Key.ColorCustom] = "Custom items", [Key.LuggageHint] = "Toggle luggage types and colors", [Key.SearchHint] = "Search name, prefab or ID", [Key.TabSelected] = "Selected", [Key.TabFood] = "Food", [Key.TabProp] = "Items", [Key.NoMatches] = "No matches", [Key.Loading] = "Loading…", [Key.ItemCount] = "Showing {0}, selected {1} / total {2}", [Key.SelectFiltered] = "Select filtered", [Key.ClearFiltered] = "Clear filtered", [Key.ClearAll] = "Clear all", [Key.Save] = "Save", [Key.Cancel] = "Cancel", [Key.CloseEsc] = "Close (Esc)", [Key.Reset] = "Reset" }; private static readonly Dictionary ZhCn = new Dictionary { [Key.Title] = "物品显示设置 (O)", [Key.TabSettings] = "设置", [Key.TabLuggage] = "行李箱", [Key.TabItems] = "物品", [Key.EnableMod] = "启用模组", [Key.SectionDisplay] = "— 显示 —", [Key.ShowDistance] = "显示距离", [Key.ShowNames] = "显示名称", [Key.StartVisible] = "开局默认显示", [Key.DisplayMode] = "显示模式:", [Key.ModeToggle] = "切换", [Key.ModeTimed] = "限时", [Key.TimedSeconds] = "限时秒数", [Key.LuggageMaxDistance] = "行李箱最大距离(米)", [Key.HeightOffset] = "高度偏移", [Key.FontSize] = "字号", [Key.SectionHotkeys] = "— 快捷键 —", [Key.ToggleMarkers] = "切换显示", [Key.OpenPanel] = "打开本面板", [Key.PanelNeedAlt] = "打开面板需按住 Alt", [Key.PanelAllowLeftCtrl] = "打开面板允许左 Ctrl", [Key.PressKey] = "请按键… (Esc取消)", [Key.KeyUnset] = "未设置", [Key.SectionOtherMarkers] = "— 其它标记 —", [Key.ScoutAmulets] = "童子军徽章", [Key.AmuletMaxDistance] = " 徽章最大距离(米)", [Key.GloomBells] = "雾沼钟楼", [Key.GloomMaxDistance] = " 钟楼最大距离(米)", [Key.CustomItemsMaxDistance] = "自定义物品最大距离(米)", [Key.SectionOtherColors] = "— 其它标记颜色 —", [Key.ColorAmulet] = "童子军徽章", [Key.ColorGloom] = "雾沼钟楼", [Key.ColorCustom] = "自定义物品", [Key.LuggageHint] = "勾选要显示的行李箱类型,并调整颜色", [Key.SearchHint] = "搜索名称、预制体名或 ID", [Key.TabSelected] = "已勾选", [Key.TabFood] = "食物", [Key.TabProp] = "道具", [Key.NoMatches] = "无匹配物品", [Key.Loading] = "物品列表加载中…", [Key.ItemCount] = "显示 {0} 项,已选 {1} / 总计 {2}", [Key.SelectFiltered] = "全选当前", [Key.ClearFiltered] = "取消当前", [Key.ClearAll] = "清空全部", [Key.Save] = "保存", [Key.Cancel] = "取消", [Key.CloseEsc] = "关闭 (Esc)", [Key.Reset] = "重置" }; private static readonly Dictionary ZhTw = new Dictionary { [Key.Title] = "物品顯示設定 (O)", [Key.TabSettings] = "設定", [Key.TabLuggage] = "行李箱", [Key.TabItems] = "物品", [Key.EnableMod] = "啟用模組", [Key.SectionDisplay] = "— 顯示 —", [Key.ShowDistance] = "顯示距離", [Key.ShowNames] = "顯示名稱", [Key.StartVisible] = "開局預設顯示", [Key.DisplayMode] = "顯示模式:", [Key.ModeToggle] = "切換", [Key.ModeTimed] = "限時", [Key.TimedSeconds] = "限時秒數", [Key.LuggageMaxDistance] = "行李箱最大距離(米)", [Key.HeightOffset] = "高度偏移", [Key.FontSize] = "字級", [Key.SectionHotkeys] = "— 快捷鍵 —", [Key.ToggleMarkers] = "切換顯示", [Key.OpenPanel] = "開啟本面板", [Key.PanelNeedAlt] = "開啟面板需按住 Alt", [Key.PanelAllowLeftCtrl] = "開啟面板允許左 Ctrl", [Key.PressKey] = "請按鍵… (Esc取消)", [Key.KeyUnset] = "未設定", [Key.SectionOtherMarkers] = "— 其他標記 —", [Key.ScoutAmulets] = "童子軍徽章", [Key.AmuletMaxDistance] = " 徽章最大距離(米)", [Key.GloomBells] = "霧沼鐘樓", [Key.GloomMaxDistance] = " 鐘樓最大距離(米)", [Key.CustomItemsMaxDistance] = "自訂物品最大距離(米)", [Key.SectionOtherColors] = "— 其他標記顏色 —", [Key.ColorAmulet] = "童子軍徽章", [Key.ColorGloom] = "霧沼鐘樓", [Key.ColorCustom] = "自訂物品", [Key.LuggageHint] = "勾選要顯示的行李箱類型,並調整顏色", [Key.SearchHint] = "搜尋名稱、預製體名或 ID", [Key.TabSelected] = "已勾選", [Key.TabFood] = "食物", [Key.TabProp] = "道具", [Key.NoMatches] = "無符合物品", [Key.Loading] = "物品列表載入中…", [Key.ItemCount] = "顯示 {0} 項,已選 {1} / 總計 {2}", [Key.SelectFiltered] = "全選目前", [Key.ClearFiltered] = "取消目前", [Key.ClearAll] = "清空全部", [Key.Save] = "儲存", [Key.Cancel] = "取消", [Key.CloseEsc] = "關閉 (Esc)", [Key.Reset] = "重設" }; private static readonly Dictionary Ja = new Dictionary { [Key.Title] = "アイテム表示設定 (O)", [Key.TabSettings] = "設定", [Key.TabLuggage] = "荷物", [Key.TabItems] = "アイテム", [Key.EnableMod] = "MODを有効化", [Key.SectionDisplay] = "— 表示 —", [Key.ShowDistance] = "距離を表示", [Key.ShowNames] = "名前を表示", [Key.StartVisible] = "開始時に表示", [Key.DisplayMode] = "表示モード:", [Key.ModeToggle] = "切替", [Key.ModeTimed] = "時間制限", [Key.TimedSeconds] = "表示秒数", [Key.LuggageMaxDistance] = "荷物の最大距離(m)", [Key.HeightOffset] = "高さオフセット", [Key.FontSize] = "フォントサイズ", [Key.SectionHotkeys] = "— ホットキー —", [Key.ToggleMarkers] = "表示切替", [Key.OpenPanel] = "このパネルを開く", [Key.PanelNeedAlt] = "パネルを開く時にAltを押す", [Key.PanelAllowLeftCtrl] = "左Ctrlでもパネルを開く", [Key.PressKey] = "キーを押してください… (Escで取消)", [Key.KeyUnset] = "未設定", [Key.SectionOtherMarkers] = "— その他のマーカー —", [Key.ScoutAmulets] = "スカウトアミュレット", [Key.AmuletMaxDistance] = " アミュレット最大距離(m)", [Key.GloomBells] = "グルームの鐘楼", [Key.GloomMaxDistance] = " 鐘楼の最大距離(m)", [Key.CustomItemsMaxDistance] = "カスタムアイテム最大距離(m)", [Key.SectionOtherColors] = "— その他の色 —", [Key.ColorAmulet] = "スカウトアミュレット", [Key.ColorGloom] = "グルームの鐘楼", [Key.ColorCustom] = "カスタムアイテム", [Key.LuggageHint] = "表示する荷物の種類と色を設定", [Key.SearchHint] = "名前・プレハブ名・IDで検索", [Key.TabSelected] = "選択済み", [Key.TabFood] = "食料", [Key.TabProp] = "道具", [Key.NoMatches] = "一致なし", [Key.Loading] = "読み込み中…", [Key.ItemCount] = "表示 {0}、選択 {1} / 合計 {2}", [Key.SelectFiltered] = "表示分を全選択", [Key.ClearFiltered] = "表示分を解除", [Key.ClearAll] = "すべて解除", [Key.Save] = "保存", [Key.Cancel] = "キャンセル", [Key.CloseEsc] = "閉じる (Esc)", [Key.Reset] = "リセット" }; private static readonly Dictionary Ko = new Dictionary { [Key.Title] = "아이템 표시 설정 (O)", [Key.TabSettings] = "설정", [Key.TabLuggage] = "가방", [Key.TabItems] = "아이템", [Key.EnableMod] = "모드 사용", [Key.SectionDisplay] = "— 표시 —", [Key.ShowDistance] = "거리 표시", [Key.ShowNames] = "이름 표시", [Key.StartVisible] = "시작 시 표시", [Key.DisplayMode] = "표시 모드:", [Key.ModeToggle] = "토글", [Key.ModeTimed] = "시간 제한", [Key.TimedSeconds] = "표시 시간(초)", [Key.LuggageMaxDistance] = "가방 최대 거리(m)", [Key.HeightOffset] = "높이 오프셋", [Key.FontSize] = "글자 크기", [Key.SectionHotkeys] = "— 단축키 —", [Key.ToggleMarkers] = "표시 전환", [Key.OpenPanel] = "이 패널 열기", [Key.PanelNeedAlt] = "패널 열 때 Alt 누르기", [Key.PanelAllowLeftCtrl] = "왼쪽 Ctrl로도 열기", [Key.PressKey] = "키를 누르세요… (Esc 취소)", [Key.KeyUnset] = "미설정", [Key.SectionOtherMarkers] = "— 기타 마커 —", [Key.ScoutAmulets] = "스카우트 아뮬렛", [Key.AmuletMaxDistance] = " 아뮬렛 최대 거리(m)", [Key.GloomBells] = "글룸 종탑", [Key.GloomMaxDistance] = " 종탑 최대 거리(m)", [Key.CustomItemsMaxDistance] = "사용자 아이템 최대 거리(m)", [Key.SectionOtherColors] = "— 기타 색상 —", [Key.ColorAmulet] = "스카우트 아뮬렛", [Key.ColorGloom] = "글룸 종탑", [Key.ColorCustom] = "사용자 아이템", [Key.LuggageHint] = "표시할 가방 종류와 색상 설정", [Key.SearchHint] = "이름, 프리팹 또는 ID 검색", [Key.TabSelected] = "선택됨", [Key.TabFood] = "음식", [Key.TabProp] = "도구", [Key.NoMatches] = "일치 항목 없음", [Key.Loading] = "불러오는 중…", [Key.ItemCount] = "표시 {0}, 선택 {1} / 합계 {2}", [Key.SelectFiltered] = "현재 전체 선택", [Key.ClearFiltered] = "현재 선택 해제", [Key.ClearAll] = "모두 해제", [Key.Save] = "저장", [Key.Cancel] = "취소", [Key.CloseEsc] = "닫기 (Esc)", [Key.Reset] = "초기화" }; private static readonly Dictionary Fr = new Dictionary { [Key.Title] = "Réglages Affichage d'objets (O)", [Key.TabSettings] = "Réglages", [Key.TabLuggage] = "Bagages", [Key.TabItems] = "Objets", [Key.EnableMod] = "Activer le mod", [Key.SectionDisplay] = "— Affichage —", [Key.ShowDistance] = "Afficher la distance", [Key.ShowNames] = "Afficher les noms", [Key.StartVisible] = "Visible au démarrage", [Key.DisplayMode] = "Mode d'affichage :", [Key.ModeToggle] = "Basculer", [Key.ModeTimed] = "Temporisé", [Key.TimedSeconds] = "Secondes temporisées", [Key.LuggageMaxDistance] = "Distance max bagages (m)", [Key.HeightOffset] = "Décalage hauteur", [Key.FontSize] = "Taille de police", [Key.SectionHotkeys] = "— Raccourcis —", [Key.ToggleMarkers] = "Basculer les marqueurs", [Key.OpenPanel] = "Ouvrir ce panneau", [Key.PanelNeedAlt] = "Maintenir Alt pour ouvrir", [Key.PanelAllowLeftCtrl] = "Autoriser Ctrl gauche", [Key.PressKey] = "Appuyez sur une touche… (Échap)", [Key.KeyUnset] = "Non défini", [Key.SectionOtherMarkers] = "— Autres marqueurs —", [Key.ScoutAmulets] = "Amulettes Scout", [Key.AmuletMaxDistance] = " Distance max amulettes (m)", [Key.GloomBells] = "Cloches Gloom", [Key.GloomMaxDistance] = " Distance max cloches (m)", [Key.CustomItemsMaxDistance] = "Distance max objets perso (m)", [Key.SectionOtherColors] = "— Couleurs autres —", [Key.ColorAmulet] = "Amulette Scout", [Key.ColorGloom] = "Cloche Gloom", [Key.ColorCustom] = "Objets perso", [Key.LuggageHint] = "Types de bagages et couleurs", [Key.SearchHint] = "Rechercher nom, prefab ou ID", [Key.TabSelected] = "Sélectionnés", [Key.TabFood] = "Nourriture", [Key.TabProp] = "Objets", [Key.NoMatches] = "Aucun résultat", [Key.Loading] = "Chargement…", [Key.ItemCount] = "Affichés {0}, sélectionnés {1} / total {2}", [Key.SelectFiltered] = "Tout sélectionner", [Key.ClearFiltered] = "Tout désélectionner", [Key.ClearAll] = "Tout effacer", [Key.Save] = "Enregistrer", [Key.Cancel] = "Annuler", [Key.CloseEsc] = "Fermer (Échap)", [Key.Reset] = "Réinit." }; private static readonly Dictionary It = new Dictionary { [Key.Title] = "Impostazioni Visualizzazione oggetti (O)", [Key.TabSettings] = "Impostazioni", [Key.TabLuggage] = "Bagagli", [Key.TabItems] = "Oggetti", [Key.EnableMod] = "Abilita mod", [Key.SectionDisplay] = "— Visualizzazione —", [Key.ShowDistance] = "Mostra distanza", [Key.ShowNames] = "Mostra nomi", [Key.StartVisible] = "Visibile all'avvio", [Key.DisplayMode] = "Modalità:", [Key.ModeToggle] = "Attiva/disattiva", [Key.ModeTimed] = "A tempo", [Key.TimedSeconds] = "Secondi a tempo", [Key.LuggageMaxDistance] = "Distanza max bagagli (m)", [Key.HeightOffset] = "Offset altezza", [Key.FontSize] = "Dimensione font", [Key.SectionHotkeys] = "— Tasti —", [Key.ToggleMarkers] = "Attiva/disattiva indicatori", [Key.OpenPanel] = "Apri questo pannello", [Key.PanelNeedAlt] = "Tieni Alt per aprire", [Key.PanelAllowLeftCtrl] = "Consenti Ctrl sinistro", [Key.PressKey] = "Premi un tasto… (Esc annulla)", [Key.KeyUnset] = "Non impostato", [Key.SectionOtherMarkers] = "— Altri indicatori —", [Key.ScoutAmulets] = "Amuleti Scout", [Key.AmuletMaxDistance] = " Distanza max amuleti (m)", [Key.GloomBells] = "Campane Gloom", [Key.GloomMaxDistance] = " Distanza max campane (m)", [Key.CustomItemsMaxDistance] = "Distanza max oggetti personalizzati (m)", [Key.SectionOtherColors] = "— Altri colori —", [Key.ColorAmulet] = "Amuleto Scout", [Key.ColorGloom] = "Campana Gloom", [Key.ColorCustom] = "Oggetti personalizzati", [Key.LuggageHint] = "Tipi di bagaglio e colori", [Key.SearchHint] = "Cerca nome, prefab o ID", [Key.TabSelected] = "Selezionati", [Key.TabFood] = "Cibo", [Key.TabProp] = "Oggetti", [Key.NoMatches] = "Nessun risultato", [Key.Loading] = "Caricamento…", [Key.ItemCount] = "Mostrati {0}, selezionati {1} / totale {2}", [Key.SelectFiltered] = "Seleziona filtrati", [Key.ClearFiltered] = "Deseleziona filtrati", [Key.ClearAll] = "Cancella tutto", [Key.Save] = "Salva", [Key.Cancel] = "Annulla", [Key.CloseEsc] = "Chiudi (Esc)", [Key.Reset] = "Reset" }; private static readonly Dictionary De = new Dictionary { [Key.Title] = "Item-Anzeige Einstellungen (O)", [Key.TabSettings] = "Einstellungen", [Key.TabLuggage] = "Gepäck", [Key.TabItems] = "Gegenstände", [Key.EnableMod] = "Mod aktivieren", [Key.SectionDisplay] = "— Anzeige —", [Key.ShowDistance] = "Entfernung anzeigen", [Key.ShowNames] = "Namen anzeigen", [Key.StartVisible] = "Beim Start sichtbar", [Key.DisplayMode] = "Anzeigemodus:", [Key.ModeToggle] = "Umschalten", [Key.ModeTimed] = "Zeitbegrenzt", [Key.TimedSeconds] = "Sekunden", [Key.LuggageMaxDistance] = "Gepäck max. Distanz (m)", [Key.HeightOffset] = "Höhenversatz", [Key.FontSize] = "Schriftgröße", [Key.SectionHotkeys] = "— Tasten —", [Key.ToggleMarkers] = "Markierungen umschalten", [Key.OpenPanel] = "Dieses Panel öffnen", [Key.PanelNeedAlt] = "Alt halten zum Öffnen", [Key.PanelAllowLeftCtrl] = "Linke Strg erlauben", [Key.PressKey] = "Taste drücken… (Esc abbrechen)", [Key.KeyUnset] = "Nicht gesetzt", [Key.SectionOtherMarkers] = "— Andere Markierungen —", [Key.ScoutAmulets] = "Scout-Amulette", [Key.AmuletMaxDistance] = " Amulett max. Distanz (m)", [Key.GloomBells] = "Gloom-Glockentürme", [Key.GloomMaxDistance] = " Glocke max. Distanz (m)", [Key.CustomItemsMaxDistance] = "Eigene Items max. Distanz (m)", [Key.SectionOtherColors] = "— Andere Farben —", [Key.ColorAmulet] = "Scout-Amulett", [Key.ColorGloom] = "Gloom-Glocke", [Key.ColorCustom] = "Eigene Items", [Key.LuggageHint] = "Gepäcktypen und Farben", [Key.SearchHint] = "Name, Prefab oder ID suchen", [Key.TabSelected] = "Ausgewählt", [Key.TabFood] = "Essen", [Key.TabProp] = "Gegenstände", [Key.NoMatches] = "Keine Treffer", [Key.Loading] = "Laden…", [Key.ItemCount] = "Angezeigt {0}, gewählt {1} / gesamt {2}", [Key.SelectFiltered] = "Gefilterte wählen", [Key.ClearFiltered] = "Gefilterte abwählen", [Key.ClearAll] = "Alles löschen", [Key.Save] = "Speichern", [Key.Cancel] = "Abbrechen", [Key.CloseEsc] = "Schließen (Esc)", [Key.Reset] = "Reset" }; private static readonly Dictionary Es = new Dictionary { [Key.Title] = "Ajustes Visualización de objetos (O)", [Key.TabSettings] = "Ajustes", [Key.TabLuggage] = "Equipaje", [Key.TabItems] = "Objetos", [Key.EnableMod] = "Activar mod", [Key.SectionDisplay] = "— Visualización —", [Key.ShowDistance] = "Mostrar distancia", [Key.ShowNames] = "Mostrar nombres", [Key.StartVisible] = "Visible al inicio", [Key.DisplayMode] = "Modo:", [Key.ModeToggle] = "Alternar", [Key.ModeTimed] = "Temporizado", [Key.TimedSeconds] = "Segundos", [Key.LuggageMaxDistance] = "Distancia máx. equipaje (m)", [Key.HeightOffset] = "Desplazamiento de altura", [Key.FontSize] = "Tamaño de fuente", [Key.SectionHotkeys] = "— Teclas —", [Key.ToggleMarkers] = "Alternar marcadores", [Key.OpenPanel] = "Abrir este panel", [Key.PanelNeedAlt] = "Mantener Alt para abrir", [Key.PanelAllowLeftCtrl] = "Permitir Ctrl izquierdo", [Key.PressKey] = "Pulsa una tecla… (Esc cancelar)", [Key.KeyUnset] = "Sin definir", [Key.SectionOtherMarkers] = "— Otros marcadores —", [Key.ScoutAmulets] = "Amuletos Scout", [Key.AmuletMaxDistance] = " Distancia máx. amuletos (m)", [Key.GloomBells] = "Campanas Gloom", [Key.GloomMaxDistance] = " Distancia máx. campanas (m)", [Key.CustomItemsMaxDistance] = "Distancia máx. objetos personalizados (m)", [Key.SectionOtherColors] = "— Otros colores —", [Key.ColorAmulet] = "Amuleto Scout", [Key.ColorGloom] = "Campana Gloom", [Key.ColorCustom] = "Objetos personalizados", [Key.LuggageHint] = "Tipos de equipaje y colores", [Key.SearchHint] = "Buscar nombre, prefab o ID", [Key.TabSelected] = "Seleccionados", [Key.TabFood] = "Comida", [Key.TabProp] = "Objetos", [Key.NoMatches] = "Sin coincidencias", [Key.Loading] = "Cargando…", [Key.ItemCount] = "Mostrando {0}, seleccionados {1} / total {2}", [Key.SelectFiltered] = "Seleccionar filtrados", [Key.ClearFiltered] = "Quitar filtrados", [Key.ClearAll] = "Borrar todo", [Key.Save] = "Guardar", [Key.Cancel] = "Cancelar", [Key.CloseEsc] = "Cerrar (Esc)", [Key.Reset] = "Restablecer" }; private static readonly Dictionary Pt = new Dictionary { [Key.Title] = "Configurações Exibição de itens (O)", [Key.TabSettings] = "Configurações", [Key.TabLuggage] = "Bagagens", [Key.TabItems] = "Itens", [Key.EnableMod] = "Ativar mod", [Key.SectionDisplay] = "— Exibição —", [Key.ShowDistance] = "Mostrar distância", [Key.ShowNames] = "Mostrar nomes", [Key.StartVisible] = "Visível no início", [Key.DisplayMode] = "Modo:", [Key.ModeToggle] = "Alternar", [Key.ModeTimed] = "Temporizado", [Key.TimedSeconds] = "Segundos", [Key.LuggageMaxDistance] = "Distância máx. bagagens (m)", [Key.HeightOffset] = "Deslocamento de altura", [Key.FontSize] = "Tamanho da fonte", [Key.SectionHotkeys] = "— Atalhos —", [Key.ToggleMarkers] = "Alternar marcadores", [Key.OpenPanel] = "Abrir este painel", [Key.PanelNeedAlt] = "Segurar Alt para abrir", [Key.PanelAllowLeftCtrl] = "Permitir Ctrl esquerdo", [Key.PressKey] = "Pressione uma tecla… (Esc cancelar)", [Key.KeyUnset] = "Não definido", [Key.SectionOtherMarkers] = "— Outros marcadores —", [Key.ScoutAmulets] = "Amuletos Scout", [Key.AmuletMaxDistance] = " Distância máx. amuletos (m)", [Key.GloomBells] = "Sinos Gloom", [Key.GloomMaxDistance] = " Distância máx. sinos (m)", [Key.CustomItemsMaxDistance] = "Distância máx. itens personalizados (m)", [Key.SectionOtherColors] = "— Outras cores —", [Key.ColorAmulet] = "Amuleto Scout", [Key.ColorGloom] = "Sino Gloom", [Key.ColorCustom] = "Itens personalizados", [Key.LuggageHint] = "Tipos de bagagem e cores", [Key.SearchHint] = "Pesquisar nome, prefab ou ID", [Key.TabSelected] = "Selecionados", [Key.TabFood] = "Comida", [Key.TabProp] = "Itens", [Key.NoMatches] = "Sem resultados", [Key.Loading] = "Carregando…", [Key.ItemCount] = "Mostrando {0}, selecionados {1} / total {2}", [Key.SelectFiltered] = "Selecionar filtrados", [Key.ClearFiltered] = "Limpar filtrados", [Key.ClearAll] = "Limpar tudo", [Key.Save] = "Salvar", [Key.Cancel] = "Cancelar", [Key.CloseEsc] = "Fechar (Esc)", [Key.Reset] = "Redefinir" }; private static readonly Dictionary Ru = new Dictionary { [Key.Title] = "Настройки отображения предметов (O)", [Key.TabSettings] = "Настройки", [Key.TabLuggage] = "Багаж", [Key.TabItems] = "Предметы", [Key.EnableMod] = "Включить мод", [Key.SectionDisplay] = "— Отображение —", [Key.ShowDistance] = "Показывать расстояние", [Key.ShowNames] = "Показывать названия", [Key.StartVisible] = "Видеть при старте", [Key.DisplayMode] = "Режим:", [Key.ModeToggle] = "Переключение", [Key.ModeTimed] = "По таймеру", [Key.TimedSeconds] = "Секунды", [Key.LuggageMaxDistance] = "Макс. дистанция багажа (м)", [Key.HeightOffset] = "Смещение по высоте", [Key.FontSize] = "Размер шрифта", [Key.SectionHotkeys] = "— Клавиши —", [Key.ToggleMarkers] = "Переключить метки", [Key.OpenPanel] = "Открыть эту панель", [Key.PanelNeedAlt] = "Удерживать Alt для открытия", [Key.PanelAllowLeftCtrl] = "Разрешить левый Ctrl", [Key.PressKey] = "Нажмите клавишу… (Esc отмена)", [Key.KeyUnset] = "Не задано", [Key.SectionOtherMarkers] = "— Другие метки —", [Key.ScoutAmulets] = "Амулеты скаута", [Key.AmuletMaxDistance] = " Макс. дистанция амулетов (м)", [Key.GloomBells] = "Колокольни Gloom", [Key.GloomMaxDistance] = " Макс. дистанция колоколен (м)", [Key.CustomItemsMaxDistance] = "Макс. дистанция своих предметов (м)", [Key.SectionOtherColors] = "— Другие цвета —", [Key.ColorAmulet] = "Амулет скаута", [Key.ColorGloom] = "Колокольня Gloom", [Key.ColorCustom] = "Свои предметы", [Key.LuggageHint] = "Типы багажа и цвета", [Key.SearchHint] = "Поиск по имени, префабу или ID", [Key.TabSelected] = "Выбранные", [Key.TabFood] = "Еда", [Key.TabProp] = "Предметы", [Key.NoMatches] = "Нет совпадений", [Key.Loading] = "Загрузка…", [Key.ItemCount] = "Показано {0}, выбрано {1} / всего {2}", [Key.SelectFiltered] = "Выбрать отфильтрованные", [Key.ClearFiltered] = "Снять отфильтрованные", [Key.ClearAll] = "Очистить всё", [Key.Save] = "Сохранить", [Key.Cancel] = "Отмена", [Key.CloseEsc] = "Закрыть (Esc)", [Key.Reset] = "Сброс" }; private static readonly Dictionary Uk = new Dictionary { [Key.Title] = "Налаштування відображення предметів (O)", [Key.TabSettings] = "Налаштування", [Key.TabLuggage] = "Багаж", [Key.TabItems] = "Предмети", [Key.EnableMod] = "Увімкнути мод", [Key.SectionDisplay] = "— Відображення —", [Key.ShowDistance] = "Показувати відстань", [Key.ShowNames] = "Показувати назви", [Key.StartVisible] = "Видно на старті", [Key.DisplayMode] = "Режим:", [Key.ModeToggle] = "Перемикання", [Key.ModeTimed] = "За таймером", [Key.TimedSeconds] = "Секунди", [Key.LuggageMaxDistance] = "Макс. дистанція багажу (м)", [Key.HeightOffset] = "Зміщення висоти", [Key.FontSize] = "Розмір шрифту", [Key.SectionHotkeys] = "— Клавіші —", [Key.ToggleMarkers] = "Перемкнути мітки", [Key.OpenPanel] = "Відкрити цю панель", [Key.PanelNeedAlt] = "Утримувати Alt для відкриття", [Key.PanelAllowLeftCtrl] = "Дозволити лівий Ctrl", [Key.PressKey] = "Натисніть клавішу… (Esc скасувати)", [Key.KeyUnset] = "Не задано", [Key.SectionOtherMarkers] = "— Інші мітки —", [Key.ScoutAmulets] = "Амулети скаута", [Key.AmuletMaxDistance] = " Макс. дистанція амулетів (м)", [Key.GloomBells] = "Дзвіниці Gloom", [Key.GloomMaxDistance] = " Макс. дистанція дзвіниць (м)", [Key.CustomItemsMaxDistance] = "Макс. дистанція своїх предметів (м)", [Key.SectionOtherColors] = "— Інші кольори —", [Key.ColorAmulet] = "Амулет скаута", [Key.ColorGloom] = "Дзвіниця Gloom", [Key.ColorCustom] = "Свої предмети", [Key.LuggageHint] = "Типи багажу та кольори", [Key.SearchHint] = "Пошук за назвою, префабом або ID", [Key.TabSelected] = "Обрані", [Key.TabFood] = "Їжа", [Key.TabProp] = "Предмети", [Key.NoMatches] = "Немає збігів", [Key.Loading] = "Завантаження…", [Key.ItemCount] = "Показано {0}, обрано {1} / всього {2}", [Key.SelectFiltered] = "Обрати відфільтровані", [Key.ClearFiltered] = "Зняти відфільтровані", [Key.ClearAll] = "Очистити все", [Key.Save] = "Зберегти", [Key.Cancel] = "Скасувати", [Key.CloseEsc] = "Закрити (Esc)", [Key.Reset] = "Скинути" }; private static readonly Dictionary Pl = new Dictionary { [Key.Title] = "Ustawienia Wyświetlania przedmiotów (O)", [Key.TabSettings] = "Ustawienia", [Key.TabLuggage] = "Bagaż", [Key.TabItems] = "Przedmioty", [Key.EnableMod] = "Włącz mod", [Key.SectionDisplay] = "— Wyświetlanie —", [Key.ShowDistance] = "Pokaż odległość", [Key.ShowNames] = "Pokaż nazwy", [Key.StartVisible] = "Widoczne na starcie", [Key.DisplayMode] = "Tryb:", [Key.ModeToggle] = "Przełącz", [Key.ModeTimed] = "Czasowy", [Key.TimedSeconds] = "Sekundy", [Key.LuggageMaxDistance] = "Maks. dystans bagażu (m)", [Key.HeightOffset] = "Przesunięcie wysokości", [Key.FontSize] = "Rozmiar czcionki", [Key.SectionHotkeys] = "— Skróty —", [Key.ToggleMarkers] = "Przełącz znaczniki", [Key.OpenPanel] = "Otwórz ten panel", [Key.PanelNeedAlt] = "Przytrzymaj Alt, by otworzyć", [Key.PanelAllowLeftCtrl] = "Zezwól na lewy Ctrl", [Key.PressKey] = "Naciśnij klawisz… (Esc anuluj)", [Key.KeyUnset] = "Nie ustawiono", [Key.SectionOtherMarkers] = "— Inne znaczniki —", [Key.ScoutAmulets] = "Amuety Scout", [Key.AmuletMaxDistance] = " Maks. dystans amuletów (m)", [Key.GloomBells] = "Dzwonnice Gloom", [Key.GloomMaxDistance] = " Maks. dystans dzwonnic (m)", [Key.CustomItemsMaxDistance] = "Maks. dystans własnych przedmiotów (m)", [Key.SectionOtherColors] = "— Inne kolory —", [Key.ColorAmulet] = "Amulet Scout", [Key.ColorGloom] = "Dzwonnica Gloom", [Key.ColorCustom] = "Własne przedmioty", [Key.LuggageHint] = "Typy bagażu i kolory", [Key.SearchHint] = "Szukaj nazwy, prefabu lub ID", [Key.TabSelected] = "Wybrane", [Key.TabFood] = "Jedzenie", [Key.TabProp] = "Przedmioty", [Key.NoMatches] = "Brak wyników", [Key.Loading] = "Ładowanie…", [Key.ItemCount] = "Pokazano {0}, wybrano {1} / łącznie {2}", [Key.SelectFiltered] = "Zaznacz filtrowane", [Key.ClearFiltered] = "Odznacz filtrowane", [Key.ClearAll] = "Wyczyść wszystko", [Key.Save] = "Zapisz", [Key.Cancel] = "Anuluj", [Key.CloseEsc] = "Zamknij (Esc)", [Key.Reset] = "Reset" }; private static readonly Dictionary Tr = new Dictionary { [Key.Title] = "Eşya Gösterimi Ayarları (O)", [Key.TabSettings] = "Ayarlar", [Key.TabLuggage] = "Bagaj", [Key.TabItems] = "Eşyalar", [Key.EnableMod] = "Modu etkinleştir", [Key.SectionDisplay] = "— Görünüm —", [Key.ShowDistance] = "Mesafeyi göster", [Key.ShowNames] = "İsimleri göster", [Key.StartVisible] = "Başlangıçta görünür", [Key.DisplayMode] = "Mod:", [Key.ModeToggle] = "Aç/Kapa", [Key.ModeTimed] = "Süreli", [Key.TimedSeconds] = "Saniye", [Key.LuggageMaxDistance] = "Bagaj maks. mesafe (m)", [Key.HeightOffset] = "Yükseklik ofseti", [Key.FontSize] = "Yazı boyutu", [Key.SectionHotkeys] = "— Kısayollar —", [Key.ToggleMarkers] = "İşaretleri aç/kapa", [Key.OpenPanel] = "Bu paneli aç", [Key.PanelNeedAlt] = "Açmak için Alt basılı tut", [Key.PanelAllowLeftCtrl] = "Sol Ctrl'ye izin ver", [Key.PressKey] = "Bir tuşa basın… (Esc iptal)", [Key.KeyUnset] = "Ayarlanmadı", [Key.SectionOtherMarkers] = "— Diğer işaretler —", [Key.ScoutAmulets] = "İzci muskaları", [Key.AmuletMaxDistance] = " Muska maks. mesafe (m)", [Key.GloomBells] = "Gloom çan kuleleri", [Key.GloomMaxDistance] = " Çan maks. mesafe (m)", [Key.CustomItemsMaxDistance] = "Özel eşya maks. mesafe (m)", [Key.SectionOtherColors] = "— Diğer renkler —", [Key.ColorAmulet] = "İzci muskası", [Key.ColorGloom] = "Gloom çanı", [Key.ColorCustom] = "Özel eşyalar", [Key.LuggageHint] = "Bagaj türleri ve renkler", [Key.SearchHint] = "İsim, prefab veya ID ara", [Key.TabSelected] = "Seçilenler", [Key.TabFood] = "Yiyecek", [Key.TabProp] = "Eşyalar", [Key.NoMatches] = "Eşleşme yok", [Key.Loading] = "Yükleniyor…", [Key.ItemCount] = "Gösterilen {0}, seçilen {1} / toplam {2}", [Key.SelectFiltered] = "Filtrelenenleri seç", [Key.ClearFiltered] = "Filtrelenenleri kaldır", [Key.ClearAll] = "Tümünü temizle", [Key.Save] = "Kaydet", [Key.Cancel] = "İptal", [Key.CloseEsc] = "Kapat (Esc)", [Key.Reset] = "Sıfırla" }; internal static string Get(Key key) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) if (TableFor(MarkerL10n.CurrentLanguage()).TryGetValue(key, out string value) && !string.IsNullOrEmpty(value)) { return value; } return En[key]; } internal static string ItemCountLine(int shown, int selectedShown, int total) { return string.Format(Get(Key.ItemCount), shown, selectedShown, total); } private static Dictionary TableFor(Language lang) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected I4, but got Unknown return (lang - 1) switch { 8 => ZhCn, 9 => ZhTw, 10 => Ja, 11 => Ko, 0 => Fr, 1 => It, 2 => De, 3 => Es, 4 => Es, 5 => Pt, 6 => Ru, 7 => Uk, 12 => Pl, 13 => Tr, _ => En, }; } } internal enum LuggageKind { Regular, Big, Explorer, Ancient, Clown, Trick, Respawn, Unknown } internal enum MarkerDisplayMode { Toggle, Timed } [BepInPlugin("youxia173.ItemDisplay", "ItemDisplay", "1.5.1")] public class Plugin : BaseUnityPlugin { internal static ManualLogSource Log; internal static Plugin Instance; public static ConfigEntry ModEnabled; public static ConfigEntry MaxDistanceMeters; public static ConfigEntry HeightOffset; public static ConfigEntry FontSize; public static ConfigEntry MarkRespawnChests; public static ConfigEntry MarkGloomBells; public static ConfigEntry GloomBellMaxDistanceMeters; public static ConfigEntry ShowScoutAmulets; public static ConfigEntry AmuletMaxDistanceMeters; public static ConfigEntry OtherItemsMaxDistanceMeters; public static ConfigEntry ShowDistance; public static ConfigEntry ShowTypePrefix; public static ConfigEntry ShowLuggageRegular; public static ConfigEntry ShowLuggageBig; public static ConfigEntry ShowLuggageExplorer; public static ConfigEntry ShowLuggageAncient; public static ConfigEntry ShowLuggageClown; public static ConfigEntry ShowLuggageTrick; public static ConfigEntry ToggleKey; public static ConfigEntry ItemPanelKey; public static ConfigEntry ItemPanelUseAlt; public static ConfigEntry ItemPanelAllowLeftCtrl; public static ConfigEntry DisplayMode; public static ConfigEntry TimedSeconds; public static ConfigEntry StartVisible; internal static MarkerColorConfig ColorRegularCfg; internal static MarkerColorConfig ColorBigCfg; internal static MarkerColorConfig ColorExplorerCfg; internal static MarkerColorConfig ColorAncientCfg; internal static MarkerColorConfig ColorClownCfg; internal static MarkerColorConfig ColorTrickCfg; internal static MarkerColorConfig ColorRespawnCfg; internal static MarkerColorConfig ColorAmuletCfg; internal static MarkerColorConfig ColorGloomBellCfg; internal static MarkerColorConfig ColorOtherItemCfg; private bool _visible; private float _timedHideAt; private GUIStyle? _labelStyle; private GUIStyle? _outlineStyle; private int _cachedFontSize = -1; private readonly List _amuletDrawList = new List(); private readonly List _fakeAmuletDrawList = new List(); private readonly List _otherItemDrawList = new List(); private readonly List _otherFakeDrawList = new List(); private readonly List _otherSpawnerDrawList = new List(); private float _amuletScanAt = -999f; private readonly ItemPickerWindow _itemPicker = new ItemPickerWindow(); private readonly List _gloomBellDrawList = new List(); private void Awake() { //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_0286: Unknown result type (might be due to invalid IL or missing references) //IL_02b9: Unknown result type (might be due to invalid IL or missing references) //IL_02ec: Unknown result type (might be due to invalid IL or missing references) //IL_031f: Unknown result type (might be due to invalid IL or missing references) //IL_0352: Unknown result type (might be due to invalid IL or missing references) //IL_0385: Unknown result type (might be due to invalid IL or missing references) //IL_03b8: Unknown result type (might be due to invalid IL or missing references) //IL_05bb: Unknown result type (might be due to invalid IL or missing references) //IL_066f: Unknown result type (might be due to invalid IL or missing references) //IL_0697: Unknown result type (might be due to invalid IL or missing references) Instance = this; Log = ((BaseUnityPlugin)this).Logger; ModEnabled = ((BaseUnityPlugin)this).Config.Bind("Panel 面板", "Enable Mod 启用模组", true, HiddenConfig.Desc("EN: When off, markers are hidden.\n中文:关闭后完全不显示。")); MaxDistanceMeters = ((BaseUnityPlugin)this).Config.Bind("Panel 面板", "Max Distance Meters 最大距离米", 150f, HiddenConfig.Desc("EN: Luggage max distance (meters). 0 = unlimited. Default 150.\n中文:行李箱最大距离(米)。0 = 不限制。默认 150。", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 5000f))); HeightOffset = ((BaseUnityPlugin)this).Config.Bind("Panel 面板", "Height Offset 高度偏移", 1.2f, HiddenConfig.Desc("EN: Text height above chest.\n中文:文字高度偏移。", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 10f))); FontSize = ((BaseUnityPlugin)this).Config.Bind("Panel 面板", "Font Size 字号", 18, HiddenConfig.Desc("EN: On-screen text size.\n中文:字号。", (AcceptableValueBase)(object)new AcceptableValueRange(10, 48))); MarkRespawnChests = ((BaseUnityPlugin)this).Config.Bind("Panel 面板", "Mark Respawn Chests 标记雕像棺材", false, HiddenConfig.Desc("EN: Mark statue coffins.\n中文:标记雕像棺材。")); ShowLuggageRegular = ((BaseUnityPlugin)this).Config.Bind("Panel 面板", "Show Regular Luggage 显示普通箱", true, HiddenConfig.Desc("EN: Mark regular luggage.\n中文:显示普通箱。")); ShowLuggageBig = ((BaseUnityPlugin)this).Config.Bind("Panel 面板", "Show Big Luggage 显示大型箱", true, HiddenConfig.Desc("EN: Mark big luggage.\n中文:显示大型箱。")); ShowLuggageExplorer = ((BaseUnityPlugin)this).Config.Bind("Panel 面板", "Show Explorer Luggage 显示探索箱", true, HiddenConfig.Desc("EN: Mark explorer luggage.\n中文:显示探索箱。")); ShowLuggageAncient = ((BaseUnityPlugin)this).Config.Bind("Panel 面板", "Show Ancient Luggage 显示古代箱", true, HiddenConfig.Desc("EN: Mark ancient luggage.\n中文:显示古代箱。")); ShowLuggageClown = ((BaseUnityPlugin)this).Config.Bind("Panel 面板", "Show Clown Luggage 显示小丑箱", true, HiddenConfig.Desc("EN: Mark clown luggage.\n中文:显示小丑箱。")); ShowLuggageTrick = ((BaseUnityPlugin)this).Config.Bind("Panel 面板", "Show Trick Luggage 显示假箱", true, HiddenConfig.Desc("EN: Mark trick luggage.\n中文:显示假箱。")); ColorRegularCfg = MarkerColorConfig.Bind(((BaseUnityPlugin)this).Config, "Panel 面板", "Regular", "普通箱", Color.white); ColorBigCfg = MarkerColorConfig.Bind(((BaseUnityPlugin)this).Config, "Panel 面板", "Big", "大型箱", new Color(0.12f, 1f, 0f)); ColorExplorerCfg = MarkerColorConfig.Bind(((BaseUnityPlugin)this).Config, "Panel 面板", "Explorer", "探索箱", new Color(0f, 0.44f, 0.87f)); ColorAncientCfg = MarkerColorConfig.Bind(((BaseUnityPlugin)this).Config, "Panel 面板", "Ancient", "古代箱", new Color(0.64f, 0.21f, 0.93f)); ColorClownCfg = MarkerColorConfig.Bind(((BaseUnityPlugin)this).Config, "Panel 面板", "Clown", "小丑箱", new Color(1f, 0.5f, 0f)); ColorTrickCfg = MarkerColorConfig.Bind(((BaseUnityPlugin)this).Config, "Panel 面板", "Trick", "假箱", new Color(1f, 0.5f, 0f)); ColorRespawnCfg = MarkerColorConfig.Bind(((BaseUnityPlugin)this).Config, "Panel 面板", "Respawn", "雕像棺材", new Color(1f, 0.13f, 0.13f)); ColorAmuletCfg = MarkerColorConfig.Bind(((BaseUnityPlugin)this).Config, "Panel 面板", "Amulet", "童子军徽章", new Color(1f, 0.35f, 0.72f)); ColorGloomBellCfg = MarkerColorConfig.Bind(((BaseUnityPlugin)this).Config, "Panel 面板", "Gloom Bell", "雾沼钟楼", new Color(0.95f, 0.78f, 0.22f)); ColorOtherItemCfg = MarkerColorConfig.Bind(((BaseUnityPlugin)this).Config, "Panel 面板", "Other Item", "其它物品", new Color(0.35f, 0.88f, 1f)); OtherItemsMaxDistanceMeters = ((BaseUnityPlugin)this).Config.Bind("Panel 面板", "Other Items Max Distance Meters 其它物品最大距离米", 100f, HiddenConfig.Desc("EN: Custom items max distance.\n中文:其它物品最大距离。", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 5000f))); MarkGloomBells = ((BaseUnityPlugin)this).Config.Bind("Panel 面板", "Mark Gloom Bell Towers 标记雾沼钟楼", true, HiddenConfig.Desc("EN: Mark unlit Gloom bells.\n中文:标记雾沼钟楼。")); GloomBellMaxDistanceMeters = ((BaseUnityPlugin)this).Config.Bind("Panel 面板", "Gloom Bell Max Distance Meters 钟楼最大距离米", 800f, HiddenConfig.Desc("EN: Gloom bell max distance.\n中文:钟楼最大距离。", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 5000f))); ShowScoutAmulets = ((BaseUnityPlugin)this).Config.Bind("Panel 面板", "Show Scout Amulets 显示童子军护身符", true, HiddenConfig.Desc("EN: Mark Scout Amulets.\n中文:显示童子军徽章。")); AmuletMaxDistanceMeters = ((BaseUnityPlugin)this).Config.Bind("Panel 面板", "Amulet Max Distance Meters 徽章最大距离米", 1000f, HiddenConfig.Desc("EN: Amulet max distance.\n中文:徽章最大距离。", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 5000f))); ShowDistance = ((BaseUnityPlugin)this).Config.Bind("Panel 面板", "Show Distance 显示距离", true, HiddenConfig.Desc("EN: Show distance text.\n中文:显示距离。")); ShowTypePrefix = ((BaseUnityPlugin)this).Config.Bind("Panel 面板", "Show Type Prefix 显示类型名称", true, HiddenConfig.Desc("EN: Show name labels.\n中文:显示名称。")); DisplayMode = ((BaseUnityPlugin)this).Config.Bind("Panel 面板", "Display Mode 显示模式", "Toggle", HiddenConfig.Desc("EN: Toggle or Timed display mode.\n中文:显示模式。", new AcceptableValueList(new string[2] { "Toggle", "Timed" }))); TimedSeconds = ((BaseUnityPlugin)this).Config.Bind("Panel 面板", "Timed Seconds 限时秒数", 10f, HiddenConfig.Desc("EN: Timed mode seconds.\n中文:限时秒数。", (AcceptableValueBase)(object)new AcceptableValueRange(1f, 120f))); StartVisible = ((BaseUnityPlugin)this).Config.Bind("Panel 面板", "Start Visible 开局默认显示", true, HiddenConfig.Desc("EN: Show markers on game start.\n中文:开局默认显示。")); ToggleKey = ((BaseUnityPlugin)this).Config.Bind("Hotkeys 快捷键", "Toggle Display 切换显示", new KeyboardShortcut((KeyCode)112, Array.Empty()), HiddenConfig.Desc("EN: Show/hide markers. Default P.\n中文:显示/隐藏标记。默认 P。")); ItemPanelKey = ((BaseUnityPlugin)this).Config.Bind("Hotkeys 快捷键", "Item Panel Key 物品面板按键", (KeyCode)111, HiddenConfig.Desc("EN: Main key to open the settings panel.\n中文:打开设置面板的主按键。默认 Alt+O。")); ItemPanelUseAlt = ((BaseUnityPlugin)this).Config.Bind("Hotkeys 快捷键", "Item Panel Use Alt 物品面板需按住Alt", false, HiddenConfig.Desc("EN: Hold Alt + panel key.\n中文:需按住 Alt。")); ItemPanelAllowLeftCtrl = ((BaseUnityPlugin)this).Config.Bind("Hotkeys 快捷键", "Item Panel Allow Left Ctrl 物品面板允许左Ctrl", false, HiddenConfig.Desc("EN: Also accept Left Ctrl + panel key.\n中文:也接受左 Ctrl。")); SelectedItemStore.Bind(((BaseUnityPlugin)this).Config); _visible = StartVisible.Value; _timedHideAt = 0f; new Harmony("youxia173.ItemDisplay").PatchAll(); Log.LogInfo((object)("ItemDisplay v1.5.1 by 游侠173 loaded. " + $"模式={DisplayMode.Value} 键={ToggleKey.Value} 开局显示={_visible}")); } internal void NotifyPanelSaved(bool startVisible) { if (!ModEnabled.Value) { _visible = false; } else if (string.Equals(DisplayMode.Value, "Toggle", StringComparison.OrdinalIgnoreCase)) { _visible = startVisible; } } private void Update() { //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) if (_itemPicker.IsOpen) { _itemPicker.MaintainUiCursor(); if (Input.GetKeyDown((KeyCode)27)) { _itemPicker.Close(); } return; } if (IsItemPickerKeyDown()) { if (!ModEnabled.Value) { Log.LogWarning((object)"物品选择界面:模组总开关已关闭,仍允许配置物品。"); } _itemPicker.Toggle(); return; } if (!ModEnabled.Value) { _visible = false; return; } TickMarkerScans(); if (IsTimedMode() && _visible && Time.unscaledTime >= _timedHideAt) { _visible = false; Log.LogInfo((object)"行李箱标记:限时结束,已隐藏"); } KeyboardShortcut value = ToggleKey.Value; if (((KeyboardShortcut)(ref value)).IsDown() && (!ItemPanelUseAlt.Value || (!Input.GetKey((KeyCode)308) && !Input.GetKey((KeyCode)307))) && (!ItemPanelAllowLeftCtrl.Value || !Input.GetKey((KeyCode)306))) { if (IsTimedMode()) { float num = Mathf.Max(0.1f, TimedSeconds.Value); _visible = true; _timedHideAt = Time.unscaledTime + num; Log.LogInfo((object)$"行李箱标记:显示 {num:0.#} 秒"); } else { _visible = !_visible; Log.LogInfo((object)(_visible ? "行李箱标记:已开启" : "行李箱标记:已关闭")); } } } private static bool IsItemPickerKeyDown() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) if (!Input.GetKeyDown(ItemPanelKey.Value)) { return false; } if (ItemPanelUseAlt.Value && (Input.GetKey((KeyCode)308) || Input.GetKey((KeyCode)307))) { return true; } if (ItemPanelAllowLeftCtrl.Value && Input.GetKey((KeyCode)306)) { return true; } if (!ItemPanelUseAlt.Value) { return !ItemPanelAllowLeftCtrl.Value; } return false; } private void TickMarkerScans() { if (ModEnabled.Value && _visible) { OtherItemRegistry.TickRefresh(SelectedItemStore.Count > 0); if (ShowScoutAmulets.Value && Time.unscaledTime - _amuletScanAt >= 2f) { _amuletScanAt = Time.unscaledTime; AmuletRegistry.SweepFakeAmulets("tick"); AmuletRegistry.RefreshActiveAmuletItems(); } } } private bool IsTimedMode() { return string.Equals(DisplayMode.Value, "Timed", StringComparison.OrdinalIgnoreCase); } private void OnGUI() { //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_014f: 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_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0187: 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_009e: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: 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_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) if (_itemPicker.IsOpen) { _itemPicker.Draw(); } if (!ModEnabled.Value || !_visible) { return; } Camera val = Camera.main; try { if ((Object)(object)MainCamera.instance != (Object)null) { Camera component = ((Component)MainCamera.instance).GetComponent(); if ((Object)(object)component != (Object)null) { val = component; } } } catch { } Character localCharacter = Character.localCharacter; if ((Object)(object)val == (Object)null || (Object)(object)localCharacter == (Object)null || (Object)(object)localCharacter.data == (Object)null || localCharacter.data.dead) { return; } EnsureStyles(); Vector3 center = localCharacter.Center; float value = MaxDistanceMeters.Value; float value2 = HeightOffset.Value; bool value3 = ShowDistance.Value; bool value4 = ShowTypePrefix.Value; List aLL_LUGGAGE = Luggage.ALL_LUGGAGE; if (aLL_LUGGAGE != null) { for (int i = 0; i < aLL_LUGGAGE.Count; i++) { Luggage val2; try { val2 = aLL_LUGGAGE[i]; } catch { continue; } if ((Object)(object)val2 == (Object)null || val2.IsOpen) { continue; } LuggageKind kind = Classify(val2); if (IsLuggageKindEnabled(kind)) { Vector3 center2; try { center2 = val2.Center(); } catch { center2 = ((Component)val2).transform.position; } string prefix = (value4 ? ResolveLuggageLabel(val2, kind) : ""); DrawWorldMarker(val, center, center2, value2, value, prefix, value3, ColorFor(kind)); } } } if (ShowScoutAmulets.Value) { DrawScoutAmuletMarkers(val, center, value2, AmuletMaxDistanceMeters.Value, value4, value3); } if (MarkGloomBells.Value) { DrawGloomBellMarkers(val, center, value2, GloomBellMaxDistanceMeters.Value, value4, value3); } if (SelectedItemStore.Count > 0) { DrawOtherItemMarkers(val, center, value2, OtherItemsMaxDistanceMeters.Value, value4, value3); } } private void DrawGloomBellMarkers(Camera cam, Vector3 playerPos, float yOff, float maxM, bool showPrefix, bool showDist) { //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_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) GloomBellRegistry.CopyUnlit(_gloomBellDrawList); for (int i = 0; i < _gloomBellDrawList.Count; i++) { GhostFire bell = _gloomBellDrawList[i]; Vector3 worldPos = GloomBellRegistry.GetWorldPos(bell); string prefix = (showPrefix ? GloomBellRegistry.SafeName(bell) : ""); DrawWorldMarker(cam, playerPos, worldPos, yOff, maxM, prefix, showDist, ColorGloomBellCfg.Color); } } private void DrawOtherItemMarkers(Camera cam, Vector3 playerPos, float yOff, float maxM, bool showPrefix, bool showDist) { //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_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: 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_009f: 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_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) OtherItemRegistry.CopyCachedFakes(_otherFakeDrawList); for (int i = 0; i < _otherFakeDrawList.Count; i++) { FakeItem fake = _otherFakeDrawList[i]; Vector3 worldPos = OtherItemRegistry.GetWorldPos(fake); string prefix = (showPrefix ? OtherItemRegistry.SafeName(fake) : ""); DrawWorldMarker(cam, playerPos, worldPos, yOff, maxM, prefix, showDist, ColorOtherItemCfg.Color); } OtherItemRegistry.CopyCachedItems(_otherItemDrawList); for (int j = 0; j < _otherItemDrawList.Count; j++) { Item item = _otherItemDrawList[j]; Vector3 worldPos2 = OtherItemRegistry.GetWorldPos(item); string prefix2 = (showPrefix ? OtherItemRegistry.SafeName(item) : ""); DrawWorldMarker(cam, playerPos, worldPos2, yOff, maxM, prefix2, showDist, ColorOtherItemCfg.Color); } OtherItemRegistry.CopyCachedSpawnerMarkers(_otherSpawnerDrawList); for (int k = 0; k < _otherSpawnerDrawList.Count; k++) { SpawnerMarker spawnerMarker = _otherSpawnerDrawList[k]; DrawWorldMarker(cam, playerPos, spawnerMarker.Position, yOff, maxM, showPrefix ? spawnerMarker.Label : "", showDist, ColorOtherItemCfg.Color); } } private void DrawScoutAmuletMarkers(Camera cam, Vector3 playerPos, float yOff, float maxM, bool showPrefix, bool showDist) { //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_0042: 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_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: 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_009e: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) AmuletRegistry.CollectMarkable(_amuletDrawList); AmuletRegistry.CollectMarkableFake(_fakeAmuletDrawList); for (int i = 0; i < _fakeAmuletDrawList.Count; i++) { FakeItem fake = _fakeAmuletDrawList[i]; Vector3 worldPos = AmuletRegistry.GetWorldPos(fake); string prefix = (showPrefix ? AmuletRegistry.SafeName(fake) : ""); DrawWorldMarker(cam, playerPos, worldPos, yOff, maxM, prefix, showDist, ColorAmuletCfg.Color); } for (int j = 0; j < _amuletDrawList.Count; j++) { Item item = _amuletDrawList[j]; Vector3 worldPos2 = AmuletRegistry.GetWorldPos(item); string prefix2 = (showPrefix ? AmuletRegistry.SafeName(item) : ""); DrawWorldMarker(cam, playerPos, worldPos2, yOff, maxM, prefix2, showDist, ColorAmuletCfg.Color); } TryDrawHoveredAmulet(cam, playerPos, yOff, maxM, showPrefix, showDist); } private void TryDrawHoveredAmulet(Camera cam, Vector3 playerPos, float yOff, float maxM, bool showPrefix, bool showDist) { //IL_00c5: 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_00a1: 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_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) IInteractible val = null; try { if ((Object)(object)Interaction.instance != (Object)null) { val = Interaction.instance.currentHovered; } } catch { return; } if (val == null) { return; } FakeItem val2 = (FakeItem)(object)((val is FakeItem) ? val : null); string how; if (val2 != null) { if (_fakeAmuletDrawList.Contains(val2) || !AmuletRegistry.LooksLikeScoutAmulet(val2, out how) || !AmuletRegistry.IsMarkableWorldAmulet(val2)) { return; } } else { Item val3 = (Item)(object)((val is Item) ? val : null); if (val3 == null || _amuletDrawList.Contains(val3) || !AmuletRegistry.LooksLikeScoutAmulet(val3, out how) || !AmuletRegistry.IsMarkableWorldAmulet(val3)) { return; } } string text = ""; try { text = val.GetName(); } catch { } if (string.IsNullOrEmpty(text)) { return; } Vector3 center; try { center = val.Center(); } catch { try { Transform transform = val.GetTransform(); center = (((Object)(object)transform != (Object)null) ? transform.position : Vector3.zero); } catch { return; } } DrawWorldMarker(cam, playerPos, center, yOff, maxM, showPrefix ? text : "", showDist, ColorAmuletCfg.Color); } private static bool IsLuggageKindEnabled(LuggageKind kind) { return kind switch { LuggageKind.Regular => ShowLuggageRegular.Value, LuggageKind.Big => ShowLuggageBig.Value, LuggageKind.Explorer => ShowLuggageExplorer.Value, LuggageKind.Ancient => ShowLuggageAncient.Value, LuggageKind.Clown => ShowLuggageClown.Value, LuggageKind.Trick => ShowLuggageTrick.Value, LuggageKind.Respawn => MarkRespawnChests.Value, _ => true, }; } private static string ResolveLuggageLabel(Luggage lug, LuggageKind kind) { try { string name = lug.GetName(); if (!MarkerL10n.LooksLikeRawKey(name)) { return name; } } catch { } return MarkerL10n.LuggageTypeLabel(kind); } private void DrawWorldMarker(Camera cam, Vector3 playerPos, Vector3 center, float yOff, float maxM, string prefix, bool showDist, Color color) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: 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_001e: 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_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) float num = Vector3.Distance(playerPos, center) * CharacterStats.unitsToMeters; if (!(maxM > 0f) || !(num > maxM)) { Vector3 val = center + Vector3.up * yOff; Vector3 val2 = cam.WorldToScreenPoint(val); if (!(val2.z <= 0f)) { float guiY = (float)Screen.height - val2.y; DrawLuggageMarker(val2.x, guiY, prefix, num, showDist, color); } } } private void DrawLuggageMarker(float screenX, float guiY, string prefix, float meters, bool showDist, Color color) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown //IL_003c: 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) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007b: 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_00a1: Expected O, but got Unknown //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Expected O, but got Unknown //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: 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_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0119: 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_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0148: 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_0162: Expected O, but got Unknown //IL_0164: 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_016d: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018e: 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) string text = (showDist ? $"{meters:0}m" : ""); if (string.IsNullOrEmpty(prefix) && string.IsNullOrEmpty(text)) { GUIContent content = new GUIContent("●"); Vector2 val = Measure(content); Rect rect = default(Rect); ((Rect)(ref rect))..ctor(screenX - val.x * 0.5f, guiY - val.y * 0.5f, val.x, val.y); DrawOutlinedLabel(rect, content, color); } else if (!string.IsNullOrEmpty(prefix) && !string.IsNullOrEmpty(text)) { GUIContent content2 = new GUIContent(prefix); GUIContent content3 = new GUIContent(text); Vector2 val2 = Measure(content2); Vector2 val3 = Measure(content3); float num = val2.x + 4f + val3.x; float num2 = Mathf.Max(val2.y, val3.y); float num3 = screenX - num * 0.5f; float num4 = guiY - num2 * 0.5f; Rect rect2 = default(Rect); ((Rect)(ref rect2))..ctor(num3, num4, val2.x, num2); Rect rect3 = default(Rect); ((Rect)(ref rect3))..ctor(num3 + val2.x + 4f, num4, val3.x, num2); DrawOutlinedLabel(rect2, content2, color); DrawOutlinedLabel(rect3, content3, color); } else { GUIContent content4 = new GUIContent((!string.IsNullOrEmpty(prefix)) ? prefix : text); Vector2 val4 = Measure(content4); Rect rect4 = default(Rect); ((Rect)(ref rect4))..ctor(screenX - val4.x * 0.5f, guiY - val4.y * 0.5f, val4.x, val4.y); DrawOutlinedLabel(rect4, content4, color); } } private Vector2 Measure(GUIContent content) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) Vector2 result = _labelStyle.CalcSize(content); result.x += Mathf.Max(2f, (float)_cachedFontSize * 0.35f); result.y += 2f; return result; } internal static LuggageKind Classify(Luggage lug) { if (lug is RespawnChest) { return LuggageKind.Respawn; } if (lug is LuggageCursed) { return LuggageKind.Ancient; } string text = CollectNames(lug); if (text.IndexOf("ancient", StringComparison.OrdinalIgnoreCase) >= 0 || text.IndexOf("cursed", StringComparison.OrdinalIgnoreCase) >= 0) { return LuggageKind.Ancient; } if (text.IndexOf("clown", StringComparison.OrdinalIgnoreCase) >= 0) { return LuggageKind.Clown; } if (text.IndexOf("trick", StringComparison.OrdinalIgnoreCase) >= 0) { return LuggageKind.Trick; } if (text.IndexOf("epic", StringComparison.OrdinalIgnoreCase) >= 0 || text.IndexOf("explorer", StringComparison.OrdinalIgnoreCase) >= 0) { return LuggageKind.Explorer; } if (text.IndexOf("luggagebig", StringComparison.OrdinalIgnoreCase) >= 0 || text.IndexOf("luggage_large", StringComparison.OrdinalIgnoreCase) >= 0 || text.IndexOf("luggage large", StringComparison.OrdinalIgnoreCase) >= 0 || (text.IndexOf("big", StringComparison.OrdinalIgnoreCase) >= 0 && text.IndexOf("luggage", StringComparison.OrdinalIgnoreCase) >= 0)) { return LuggageKind.Big; } text.IndexOf("small", StringComparison.OrdinalIgnoreCase); _ = 0; return LuggageKind.Regular; } private static string CollectNames(Luggage lug) { StringBuilder stringBuilder = new StringBuilder(64); if (!string.IsNullOrEmpty(lug.displayName)) { stringBuilder.Append(lug.displayName).Append(' '); } stringBuilder.Append(((object)lug).GetType().Name).Append(' '); Transform val = ((Component)lug).transform; while ((Object)(object)val != (Object)null) { stringBuilder.Append(((Object)val).name).Append(' '); if (stringBuilder.Length > 240) { break; } val = val.parent; } return stringBuilder.ToString(); } private static Color ColorFor(LuggageKind kind) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: 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) //IL_003b: 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_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: 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_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) return (Color)(kind switch { LuggageKind.Regular => ColorRegularCfg.Color, LuggageKind.Big => ColorBigCfg.Color, LuggageKind.Explorer => ColorExplorerCfg.Color, LuggageKind.Ancient => ColorAncientCfg.Color, LuggageKind.Clown => ColorClownCfg.Color, LuggageKind.Trick => ColorTrickCfg.Color, LuggageKind.Respawn => ColorRespawnCfg.Color, _ => ColorRegularCfg.Color, }); } private static string PrefixFor(LuggageKind kind) { return MarkerL10n.LuggageTypeLabel(kind); } private void EnsureStyles() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003b: 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_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Expected O, but got Unknown //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Expected O, but got Unknown //IL_00a8: Unknown result type (might be due to invalid IL or missing references) int value = FontSize.Value; if (_labelStyle == null || _cachedFontSize != value) { _cachedFontSize = value; _labelStyle = new GUIStyle(GUI.skin.label) { fontSize = value, fontStyle = (FontStyle)1, alignment = (TextAnchor)4, richText = false, wordWrap = false, clipping = (TextClipping)0 }; _labelStyle.normal.textColor = Color.white; _outlineStyle = new GUIStyle(_labelStyle); _outlineStyle.normal.textColor = new Color(0f, 0f, 0f, 0.85f); } } private void DrawOutlinedLabel(Rect rect, GUIContent content, Color color) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0055: 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_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: 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_00ee: 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) GUI.Label(new Rect(((Rect)(ref rect)).x - 1.5f, ((Rect)(ref rect)).y, ((Rect)(ref rect)).width, ((Rect)(ref rect)).height), content, _outlineStyle); GUI.Label(new Rect(((Rect)(ref rect)).x + 1.5f, ((Rect)(ref rect)).y, ((Rect)(ref rect)).width, ((Rect)(ref rect)).height), content, _outlineStyle); GUI.Label(new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).y - 1.5f, ((Rect)(ref rect)).width, ((Rect)(ref rect)).height), content, _outlineStyle); GUI.Label(new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).y + 1.5f, ((Rect)(ref rect)).width, ((Rect)(ref rect)).height), content, _outlineStyle); Color textColor = _labelStyle.normal.textColor; _labelStyle.normal.textColor = color; GUI.Label(rect, content, _labelStyle); _labelStyle.normal.textColor = textColor; } } internal static class SelectedItemStore { internal static ConfigEntry ConfigEntry = null; private static readonly HashSet Selected = new HashSet(); private static bool _dirty; internal static IReadOnlyCollection SelectedIds => Selected; internal static int Count => Selected.Count; internal static void Bind(ConfigFile config) { ConfigEntry = config.Bind("Panel 面板", "Selected Item IDs 已选物品ID", "", HiddenConfig.Desc("EN: Comma-separated item IDs. Edit in Alt+O panel.\n中文:已选物品 ID,在 Alt+O 面板编辑。")); LoadFromConfig(); ConfigEntry.SettingChanged += delegate { LoadFromConfig(); }; } internal static void LoadFromConfig() { Selected.Clear(); string text = ConfigEntry.Value ?? ""; if (string.IsNullOrWhiteSpace(text)) { return; } string[] array = text.Split(new char[3] { ',', ';', ' ' }, StringSplitOptions.RemoveEmptyEntries); for (int i = 0; i < array.Length; i++) { if (ushort.TryParse(array[i].Trim(), out var result)) { Selected.Add(result); } } } internal static bool Contains(ushort id) { return Selected.Contains(id); } internal static bool IsSelected(ushort id) { return Selected.Contains(id); } internal static void SetSelected(ushort id, bool on) { if (on) { Selected.Add(id); } else { Selected.Remove(id); } _dirty = true; } internal static void ApplyWorkingSet(IEnumerable ids) { Selected.Clear(); foreach (ushort id in ids) { Selected.Add(id); } _dirty = true; } internal static void SaveIfDirty() { if (!_dirty) { return; } _dirty = false; if (Selected.Count == 0) { ConfigEntry.Value = ""; return; } List list = new List(Selected); list.Sort(); StringBuilder stringBuilder = new StringBuilder(list.Count * 4); for (int i = 0; i < list.Count; i++) { if (i > 0) { stringBuilder.Append(','); } stringBuilder.Append(list[i]); } ConfigEntry.Value = stringBuilder.ToString(); } internal static HashSet CloneSelected() { return new HashSet(Selected); } } public static class MyPluginInfo { public const string PLUGIN_GUID = "youxia173.ItemDisplay"; public const string PLUGIN_NAME = "ItemDisplay"; public const string PLUGIN_VERSION = "1.5.1"; } }