using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using HarmonyLib; using MenuLib; using MenuLib.MonoBehaviors; using Microsoft.CodeAnalysis; using Photon.Pun; using TMPro; using TheEverythingMap.Helpers; using TheEverythingMap.Mod; using TheEverythingMap.Settings; using Unity.VisualScripting; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: IgnoresAccessChecksTo("")] [assembly: AssemblyCompany("Nubez")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+df36f684e79071a1661f04e61ffd0c3520c747fa")] [assembly: AssemblyProduct("TheEverythingMap")] [assembly: AssemblyTitle("TheEverythingMap")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.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 TheEverythingMap.Settings { public static class ConfigValues { public const string DEFAULT_TEAMMATE_COLOR = "white"; public const string DEFAULT_ENEMY_COLOR = "red"; public const string DEFAULT_ITEM_COLOR = "yellow"; public const string DEFAULT_DEAD_TEAMMATE_COLOR = "black"; internal static ConfigEntry Zoom; internal static ConfigEntry Opacity; internal static ConfigEntry Preset; internal static ConfigEntry WidthHeight; internal static ConfigEntry Buffer; internal static ConfigEntry SettingsKey; internal static ConfigEntry ZoomInKey; internal static ConfigEntry ZoomOutKey; internal static ConfigEntry TeammateColor; internal static ConfigEntry ShowEnemies; internal static ConfigEntry ShowItems; internal static ConfigEntry EnemyColor; internal static ConfigEntry ItemColor; internal static ConfigEntry DeadTeammateColor; internal static ConfigEntry ExploreMap; internal static void Configure(BaseUnityPlugin plugin) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Expected O, but got Unknown //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Expected O, but got Unknown //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Expected O, but got Unknown //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Expected O, but got Unknown //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Expected O, but got Unknown //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Expected O, but got Unknown //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Expected O, but got Unknown //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Expected O, but got Unknown //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Expected O, but got Unknown //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Expected O, but got Unknown //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Expected O, but got Unknown //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Expected O, but got Unknown //IL_0297: Unknown result type (might be due to invalid IL or missing references) //IL_02a1: Expected O, but got Unknown TeammateColor = plugin.Config.Bind("General", "Teammate Color", "white", new ConfigDescription("The color of teammates on the minimap. (Recommended value = white)", (AcceptableValueBase)null, Array.Empty())); DeadTeammateColor = plugin.Config.Bind("General", "Dead Teammate Color", "black", new ConfigDescription("The color of dead teammates on the minimap. (Recommended value = black)", (AcceptableValueBase)null, Array.Empty())); EnemyColor = plugin.Config.Bind("General", "Enemy Color", "red", new ConfigDescription("The color of enemies on the minimap. (Recommended value = red)", (AcceptableValueBase)null, Array.Empty())); ItemColor = plugin.Config.Bind("General", "Item Color", "yellow", new ConfigDescription("The color of items on the minimap. (Recommended value = yellow)", (AcceptableValueBase)null, Array.Empty())); ShowEnemies = plugin.Config.Bind("General", "Show Enemies", false, new ConfigDescription("Whether to show enemies on the minimap. (Recommended value = false)", (AcceptableValueBase)null, Array.Empty())); ShowItems = plugin.Config.Bind("General", "Show Items", false, new ConfigDescription("Whether to show items on the minimap. (Recommended value = false)", (AcceptableValueBase)null, Array.Empty())); ExploreMap = plugin.Config.Bind("General", "Explore Map", false, new ConfigDescription("Whether to explore the map automatically. (Recommended value = false)", (AcceptableValueBase)null, Array.Empty())); Zoom = plugin.Config.Bind("General", "Zoom", 2.25f, new ConfigDescription("The minimap zoom level. (Recommended value = 2.25)", (AcceptableValueBase)null, Array.Empty())); Opacity = plugin.Config.Bind("General", "Opacity", 0.85f, new ConfigDescription("The minimap opacity. (Recommended value = 0.85)", (AcceptableValueBase)null, Array.Empty())); Preset = plugin.Config.Bind("Position", "Preset", MinimapPosition.BottomLeft, new ConfigDescription("The minimap position preset. (Recommended value = BottomLeft)", (AcceptableValueBase)null, Array.Empty())); WidthHeight = plugin.Config.Bind("Dimensions", "WidthHeight", 500, new ConfigDescription("The width of the minimap. (Recommended value = 375)", (AcceptableValueBase)null, Array.Empty())); Buffer = plugin.Config.Bind("Dimensions", "Buffer", 12, new ConfigDescription("The buffer between edge of screen added to presets. (Recommended value = 12)", (AcceptableValueBase)null, Array.Empty())); SettingsKey = plugin.Config.Bind("Key Bindings", "Settings", (KeyCode)109, new ConfigDescription("The key to open the minimap settings. (Recommended value = M)", (AcceptableValueBase)null, Array.Empty())); ZoomInKey = plugin.Config.Bind("Key Bindings", "Zoom In", (KeyCode)61, new ConfigDescription("The key to zoom in on the minimap. (Recommended value = Equals)", (AcceptableValueBase)null, Array.Empty())); ZoomOutKey = plugin.Config.Bind("Key Bindings", "Zoom Out", (KeyCode)45, new ConfigDescription("The key to zoom out on the minimap. (Recommended value = Minus)", (AcceptableValueBase)null, Array.Empty())); } internal static void ResetDefaultValues() { //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) Zoom.Value = (float)((ConfigEntryBase)Zoom).DefaultValue; Opacity.Value = (float)((ConfigEntryBase)Opacity).DefaultValue; Preset.Value = (MinimapPosition)((ConfigEntryBase)Preset).DefaultValue; Buffer.Value = (int)((ConfigEntryBase)Buffer).DefaultValue; WidthHeight.Value = (int)((ConfigEntryBase)WidthHeight).DefaultValue; SettingsKey.Value = (KeyCode)((ConfigEntryBase)SettingsKey).DefaultValue; ZoomInKey.Value = (KeyCode)((ConfigEntryBase)ZoomInKey).DefaultValue; ZoomOutKey.Value = (KeyCode)((ConfigEntryBase)ZoomOutKey).DefaultValue; TeammateColor.Value = (string)((ConfigEntryBase)TeammateColor).DefaultValue; EnemyColor.Value = (string)((ConfigEntryBase)EnemyColor).DefaultValue; ShowEnemies.Value = (bool)((ConfigEntryBase)ShowEnemies).DefaultValue; ExploreMap.Value = (bool)((ConfigEntryBase)ExploreMap).DefaultValue; ItemColor.Value = (string)((ConfigEntryBase)ItemColor).DefaultValue; DeadTeammateColor.Value = (string)((ConfigEntryBase)DeadTeammateColor).DefaultValue; } } internal enum MinimapPosition { TopRight, TopLeft, MiddleRight, MiddleLeft, BottomRight, BottomLeft } internal class SettingsMenu { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static BuilderDelegate <>9__8_0; public static BuilderDelegate <>9__11_0; public static ScrollViewBuilderDelegate <>9__11_1; public static Action <>9__11_15; public static ScrollViewBuilderDelegate <>9__11_2; public static Action <>9__11_16; public static Action <>9__11_17; public static Action <>9__11_18; public static Action <>9__11_19; public static ScrollViewBuilderDelegate <>9__11_6; public static Action <>9__11_20; public static Action <>9__11_21; public static ScrollViewBuilderDelegate <>9__11_8; public static Action <>9__11_22; public static Action <>9__11_23; public static ScrollViewBuilderDelegate <>9__11_10; public static Action <>9__11_24; public static ScrollViewBuilderDelegate <>9__11_11; public static Action <>9__11_25; public static ScrollViewBuilderDelegate <>9__11_12; public static Action <>9__11_26; public static ScrollViewBuilderDelegate <>9__11_13; public static ScrollViewBuilderDelegate <>9__11_14; public static Action <>9__11_28; internal void b__8_0(Transform parent) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) MenuAPI.CreateREPOButton("Nubez Minimap", (Action)View, parent, new Vector2(225f, 252f)); } internal void b__11_0(Transform parent) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) MenuAPI.CreateREPOButton("Back", (Action)Close, parent, new Vector2(66f, 18f)); } internal RectTransform b__11_1(Transform parent) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) REPOLabel val = MenuAPI.CreateREPOLabel("General", parent, new Vector2(0f, 90f)); return ((REPOElement)val).rectTransform; } internal RectTransform b__11_2(Transform parent) { //IL_0030: 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_004e: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) REPOButton val = MenuAPI.CreateREPOButton("Reset to Default Settings", (Action)delegate { ConfigValues.ResetDefaultValues(); View(); }, parent, new Vector2(38f, 190f)); val.overrideButtonSize = new Vector2(val.GetLabelSize().x * 0.8f, val.GetLabelSize().y * 0.8f); ((Transform)((REPOElement)val).rectTransform).localScale = new Vector3(((Transform)((REPOElement)val).rectTransform).localScale.x * 0.8f, ((Transform)((REPOElement)val).rectTransform).localScale.y * 0.8f, ((Transform)((REPOElement)val).rectTransform).localScale.z); return ((REPOElement)val).rectTransform; } internal void b__11_15() { ConfigValues.ResetDefaultValues(); View(); } internal void b__11_16(string str) { ConfigValues.Preset.Value = OPTION_TO_PRESET[str]; } internal void b__11_17(int str) { ConfigValues.TeammateColor.Value = COLOR_DICTIONARY_KEYS[str]; } internal void b__11_18(int str) { ConfigValues.DeadTeammateColor.Value = COLOR_DICTIONARY_KEYS[str]; } internal RectTransform b__11_6(Transform parent) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) REPOToggle val = MenuAPI.CreateREPOToggle("Show Enemies", (Action)delegate(bool toggle) { ConfigValues.ShowEnemies.Value = toggle; }, parent, Vector2.zero, "Enabled", "Disabled", ConfigValues.ShowEnemies.Value); return ((REPOElement)val).rectTransform; } internal void b__11_19(bool toggle) { ConfigValues.ShowEnemies.Value = toggle; } internal void b__11_20(int str) { ConfigValues.EnemyColor.Value = COLOR_DICTIONARY_KEYS[str]; } internal RectTransform b__11_8(Transform parent) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) REPOToggle val = MenuAPI.CreateREPOToggle("Show Items ", (Action)delegate(bool toggle) { ConfigValues.ShowItems.Value = toggle; if (toggle) { TheEverythingMap.Mod.TheEverythingMap.ShowItems(); } }, parent, Vector2.zero, "Enabled", "Disabled", ConfigValues.ShowItems.Value); return ((REPOElement)val).rectTransform; } internal void b__11_21(bool toggle) { ConfigValues.ShowItems.Value = toggle; if (toggle) { TheEverythingMap.Mod.TheEverythingMap.ShowItems(); } } internal void b__11_22(int str) { ConfigValues.ItemColor.Value = COLOR_DICTIONARY_KEYS[str]; } internal RectTransform b__11_10(Transform parent) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) REPOToggle val = MenuAPI.CreateREPOToggle("Auto Explore Map ", (Action)delegate(bool toggle) { ConfigValues.ExploreMap.Value = toggle; if (toggle) { TheEverythingMap.Mod.TheEverythingMap.ExploreMap(); } }, parent, Vector2.zero, "Enabled", "Disabled", ConfigValues.ExploreMap.Value); return ((REPOElement)val).rectTransform; } internal void b__11_23(bool toggle) { ConfigValues.ExploreMap.Value = toggle; if (toggle) { TheEverythingMap.Mod.TheEverythingMap.ExploreMap(); } } internal RectTransform b__11_11(Transform parent) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) REPOSlider val = MenuAPI.CreateREPOSlider("Size", "Minimap Size Height / Width", (Action)delegate(float flt) { ConfigValues.WidthHeight.Value = (int)flt; }, parent, new Vector2(0f, 150f), 100f, 800f, 0, (float)Mathf.Max(ConfigValues.WidthHeight.Value, ConfigValues.WidthHeight.Value), "", "", (BarBehavior)0); return ((REPOElement)val).rectTransform; } internal void b__11_24(float flt) { ConfigValues.WidthHeight.Value = (int)flt; } internal RectTransform b__11_12(Transform parent) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) REPOSlider val = MenuAPI.CreateREPOSlider("Zoom Level", "Minimap Zoom Level", (Action)delegate(float flt) { ConfigValues.Zoom.Value = flt; }, parent, new Vector2(0f, 150f), 1.5f, 10f, 2, ConfigValues.Zoom.Value, "", "", (BarBehavior)0); return ((REPOElement)val).rectTransform; } internal void b__11_25(float flt) { ConfigValues.Zoom.Value = flt; } internal RectTransform b__11_13(Transform parent) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) REPOSlider val = MenuAPI.CreateREPOSlider("Opacity", "Minimap Opacity", (Action)delegate(float flt) { ConfigValues.Opacity.Value = flt; }, parent, new Vector2(0f, 150f), 0f, 1f, 2, ConfigValues.Opacity.Value, "", "", (BarBehavior)0); return ((REPOElement)val).rectTransform; } internal void b__11_26(float flt) { ConfigValues.Opacity.Value = flt; } internal RectTransform b__11_14(Transform parent) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) REPOLabel val = MenuAPI.CreateREPOLabel("Controls", parent, new Vector2(0f, 90f)); return ((REPOElement)val).rectTransform; } internal void b__11_28() { } } private static readonly string[] COLOR_DICTIONARY_KEYS = Extensions.VALID_COLORS.Keys.ToArray(); private static readonly Dictionary OPTION_TO_PRESET = new Dictionary { { "TopRight", MinimapPosition.TopRight }, { "TopLeft", MinimapPosition.TopLeft }, { "MiddleRight", MinimapPosition.MiddleRight }, { "MiddleLeft", MinimapPosition.MiddleLeft }, { "BottomRight", MinimapPosition.BottomRight }, { "BottomLeft", MinimapPosition.BottomLeft } }; private static List> BINDABLE_KEYS = new List>(3) { ConfigValues.SettingsKey, ConfigValues.ZoomInKey, ConfigValues.ZoomOutKey }; private static List DISALLOWED_BINDINGS = new List(3) { (KeyCode)323, (KeyCode)324, (KeyCode)27 }; private static REPOPopupPage? pageInstance; private static bool isSelectingKey = false; private static REPOButton? activatedButton; private static ConfigEntry? keyToSet; internal static void Initialize() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown object obj = <>c.<>9__8_0; if (obj == null) { BuilderDelegate val = delegate(Transform parent) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) MenuAPI.CreateREPOButton("Nubez Minimap", (Action)View, parent, new Vector2(225f, 252f)); }; <>c.<>9__8_0 = val; obj = (object)val; } MenuAPI.AddElementToSettingsMenu((BuilderDelegate)obj); } internal static void Update() { //IL_001b: 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_00be: 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_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) if (StateUtils.IsInLevel() && !StateUtils.IsChatActive() && !StateUtils.HasLocalMapToolActive() && Input.GetKeyDown(ConfigValues.SettingsKey.Value)) { if ((Object)(object)pageInstance == (Object)null) { View(); } else { Close(); } } if (StateUtils.IsInLevel() && StateUtils.HasLocalMapToolActive() && (Object)(object)pageInstance != (Object)null) { Close(); } if (!isSelectingKey || !Input.anyKeyDown) { return; } foreach (KeyCode value in Enum.GetValues(typeof(KeyCode))) { if (Input.GetKeyDown(value)) { if (!DISALLOWED_BINDINGS.Contains(value)) { keyToSet.Value = value; } TextMeshProUGUI labelTMP = activatedButton.labelTMP; string key = ((ConfigEntryBase)keyToSet).Definition.Key; ((TMP_Text)labelTMP).text = key + ": " + ((object)keyToSet.Value/*cast due to .constrained prefix*/).ToString(); isSelectingKey = false; keyToSet = null; activatedButton = null; break; } } } private static void Close() { if (!((Object)(object)pageInstance == (Object)null)) { MenuManager.instance.PageRemove(pageInstance.menuPage); Object.Destroy((Object)(object)((Component)pageInstance.menuPage).gameObject); pageInstance.ClosePage(true); pageInstance = null; isSelectingKey = false; keyToSet = null; activatedButton = null; } } private static void View() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected O, but got Unknown //IL_005b: 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) //IL_0066: Expected O, but got Unknown //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Expected O, but got Unknown //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Expected O, but got Unknown //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Expected O, but got Unknown //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Expected O, but got Unknown //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Expected O, but got Unknown //IL_02a6: Unknown result type (might be due to invalid IL or missing references) //IL_02ba: Expected O, but got Unknown //IL_02d0: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: Unknown result type (might be due to invalid IL or missing references) //IL_02db: Expected O, but got Unknown //IL_034c: Unknown result type (might be due to invalid IL or missing references) //IL_0360: Expected O, but got Unknown //IL_0376: Unknown result type (might be due to invalid IL or missing references) //IL_037b: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Expected O, but got Unknown //IL_03a6: Unknown result type (might be due to invalid IL or missing references) //IL_03ab: Unknown result type (might be due to invalid IL or missing references) //IL_03b1: Expected O, but got Unknown //IL_03d6: Unknown result type (might be due to invalid IL or missing references) //IL_03db: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Expected O, but got Unknown //IL_0406: Unknown result type (might be due to invalid IL or missing references) //IL_040b: Unknown result type (might be due to invalid IL or missing references) //IL_0411: Expected O, but got Unknown //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_043b: Unknown result type (might be due to invalid IL or missing references) //IL_0441: Expected O, but got Unknown //IL_047f: Unknown result type (might be due to invalid IL or missing references) //IL_0493: Expected O, but got Unknown Close(); REPOPopupPage val = MenuAPI.CreateREPOPopupPage("Nubezz Minimap", (PresetSide)0, false, true, 0f); object obj = <>c.<>9__11_0; if (obj == null) { BuilderDelegate val2 = delegate(Transform parent) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) MenuAPI.CreateREPOButton("Back", (Action)Close, parent, new Vector2(66f, 18f)); }; <>c.<>9__11_0 = val2; obj = (object)val2; } val.AddElement((BuilderDelegate)obj); object obj2 = <>c.<>9__11_1; if (obj2 == null) { ScrollViewBuilderDelegate val3 = delegate(Transform parent) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) REPOLabel val12 = MenuAPI.CreateREPOLabel("General", parent, new Vector2(0f, 90f)); return ((REPOElement)val12).rectTransform; }; <>c.<>9__11_1 = val3; obj2 = (object)val3; } val.AddElementToScrollView((ScrollViewBuilderDelegate)obj2, 0f, 0f); object obj3 = <>c.<>9__11_2; if (obj3 == null) { ScrollViewBuilderDelegate val4 = delegate(Transform parent) { //IL_0030: 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_004e: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) REPOButton val12 = MenuAPI.CreateREPOButton("Reset to Default Settings", (Action)delegate { ConfigValues.ResetDefaultValues(); View(); }, parent, new Vector2(38f, 190f)); val12.overrideButtonSize = new Vector2(val12.GetLabelSize().x * 0.8f, val12.GetLabelSize().y * 0.8f); ((Transform)((REPOElement)val12).rectTransform).localScale = new Vector3(((Transform)((REPOElement)val12).rectTransform).localScale.x * 0.8f, ((Transform)((REPOElement)val12).rectTransform).localScale.y * 0.8f, ((Transform)((REPOElement)val12).rectTransform).localScale.z); return ((REPOElement)val12).rectTransform; }; <>c.<>9__11_2 = val4; obj3 = (object)val4; } val.AddElementToScrollView((ScrollViewBuilderDelegate)obj3, 0f, 0f); string defaultMinimapOption = "BottomLeft"; foreach (KeyValuePair item2 in OPTION_TO_PRESET) { if (item2.Value == ConfigValues.Preset.Value) { defaultMinimapOption = item2.Key; break; } } val.AddElementToScrollView((ScrollViewBuilderDelegate)delegate(Transform parent) { //IL_004a: Unknown result type (might be due to invalid IL or missing references) REPOSlider val12 = MenuAPI.CreateREPOSlider("Position Preset", "Built-in preset positions", (Action)delegate(string str) { ConfigValues.Preset.Value = OPTION_TO_PRESET[str]; }, parent, OPTION_TO_PRESET.Keys.ToArray(), defaultMinimapOption, new Vector2(0f, 270f), "", "", (BarBehavior)0); return ((REPOElement)val12).rectTransform; }, 0f, 0f); string defaultTeammateColor = "white"; string[] cOLOR_DICTIONARY_KEYS = COLOR_DICTIONARY_KEYS; foreach (string text in cOLOR_DICTIONARY_KEYS) { if (text == ConfigValues.TeammateColor.Value) { defaultTeammateColor = ConfigValues.TeammateColor.Value; break; } } val.AddElementToScrollView((ScrollViewBuilderDelegate)delegate(Transform parent) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) REPOSlider val12 = MenuAPI.CreateREPOSlider("Teammate Colors", "Color of teammates on map", (Action)delegate(int str) { ConfigValues.TeammateColor.Value = COLOR_DICTIONARY_KEYS[str]; }, parent, COLOR_DICTIONARY_KEYS, defaultTeammateColor, new Vector2(0f, 270f), "", "", (BarBehavior)0); return ((REPOElement)val12).rectTransform; }, 0f, 0f); string defaultDeadTeammateColor = "black"; string[] cOLOR_DICTIONARY_KEYS2 = COLOR_DICTIONARY_KEYS; foreach (string text2 in cOLOR_DICTIONARY_KEYS2) { if (text2 == ConfigValues.DeadTeammateColor.Value) { defaultDeadTeammateColor = ConfigValues.DeadTeammateColor.Value; break; } } val.AddElementToScrollView((ScrollViewBuilderDelegate)delegate(Transform parent) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) REPOSlider val12 = MenuAPI.CreateREPOSlider("Dead Teammate Color", "Color of DEAD teammates on map", (Action)delegate(int str) { ConfigValues.DeadTeammateColor.Value = COLOR_DICTIONARY_KEYS[str]; }, parent, COLOR_DICTIONARY_KEYS, defaultDeadTeammateColor, new Vector2(0f, 270f), "", "", (BarBehavior)0); return ((REPOElement)val12).rectTransform; }, 0f, 0f); object obj4 = <>c.<>9__11_6; if (obj4 == null) { ScrollViewBuilderDelegate val5 = delegate(Transform parent) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) REPOToggle val12 = MenuAPI.CreateREPOToggle("Show Enemies", (Action)delegate(bool toggle) { ConfigValues.ShowEnemies.Value = toggle; }, parent, Vector2.zero, "Enabled", "Disabled", ConfigValues.ShowEnemies.Value); return ((REPOElement)val12).rectTransform; }; <>c.<>9__11_6 = val5; obj4 = (object)val5; } val.AddElementToScrollView((ScrollViewBuilderDelegate)obj4, 0f, 0f); string defaultEnemyColor = "red"; string[] cOLOR_DICTIONARY_KEYS3 = COLOR_DICTIONARY_KEYS; foreach (string text3 in cOLOR_DICTIONARY_KEYS3) { if (text3 == ConfigValues.EnemyColor.Value) { defaultEnemyColor = ConfigValues.EnemyColor.Value; break; } } val.AddElementToScrollView((ScrollViewBuilderDelegate)delegate(Transform parent) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) REPOSlider val12 = MenuAPI.CreateREPOSlider("Enemy Colors", "Color of enemies on map", (Action)delegate(int str) { ConfigValues.EnemyColor.Value = COLOR_DICTIONARY_KEYS[str]; }, parent, COLOR_DICTIONARY_KEYS, defaultEnemyColor, new Vector2(0f, 270f), "", "", (BarBehavior)0); return ((REPOElement)val12).rectTransform; }, 0f, 0f); object obj5 = <>c.<>9__11_8; if (obj5 == null) { ScrollViewBuilderDelegate val6 = delegate(Transform parent) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) REPOToggle val12 = MenuAPI.CreateREPOToggle("Show Items ", (Action)delegate(bool toggle) { ConfigValues.ShowItems.Value = toggle; if (toggle) { TheEverythingMap.Mod.TheEverythingMap.ShowItems(); } }, parent, Vector2.zero, "Enabled", "Disabled", ConfigValues.ShowItems.Value); return ((REPOElement)val12).rectTransform; }; <>c.<>9__11_8 = val6; obj5 = (object)val6; } val.AddElementToScrollView((ScrollViewBuilderDelegate)obj5, 0f, 0f); string defaultItemColor = "yellow"; string[] cOLOR_DICTIONARY_KEYS4 = COLOR_DICTIONARY_KEYS; foreach (string text4 in cOLOR_DICTIONARY_KEYS4) { if (text4 == ConfigValues.ItemColor.Value) { defaultItemColor = ConfigValues.ItemColor.Value; break; } } val.AddElementToScrollView((ScrollViewBuilderDelegate)delegate(Transform parent) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) REPOSlider val12 = MenuAPI.CreateREPOSlider("Item Colors", "Color of items on map", (Action)delegate(int str) { ConfigValues.ItemColor.Value = COLOR_DICTIONARY_KEYS[str]; }, parent, COLOR_DICTIONARY_KEYS, defaultItemColor, new Vector2(0f, 270f), "", "", (BarBehavior)0); return ((REPOElement)val12).rectTransform; }, 0f, 0f); object obj6 = <>c.<>9__11_10; if (obj6 == null) { ScrollViewBuilderDelegate val7 = delegate(Transform parent) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) REPOToggle val12 = MenuAPI.CreateREPOToggle("Auto Explore Map ", (Action)delegate(bool toggle) { ConfigValues.ExploreMap.Value = toggle; if (toggle) { TheEverythingMap.Mod.TheEverythingMap.ExploreMap(); } }, parent, Vector2.zero, "Enabled", "Disabled", ConfigValues.ExploreMap.Value); return ((REPOElement)val12).rectTransform; }; <>c.<>9__11_10 = val7; obj6 = (object)val7; } val.AddElementToScrollView((ScrollViewBuilderDelegate)obj6, 0f, 0f); object obj7 = <>c.<>9__11_11; if (obj7 == null) { ScrollViewBuilderDelegate val8 = delegate(Transform parent) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) REPOSlider val12 = MenuAPI.CreateREPOSlider("Size", "Minimap Size Height / Width", (Action)delegate(float flt) { ConfigValues.WidthHeight.Value = (int)flt; }, parent, new Vector2(0f, 150f), 100f, 800f, 0, (float)Mathf.Max(ConfigValues.WidthHeight.Value, ConfigValues.WidthHeight.Value), "", "", (BarBehavior)0); return ((REPOElement)val12).rectTransform; }; <>c.<>9__11_11 = val8; obj7 = (object)val8; } val.AddElementToScrollView((ScrollViewBuilderDelegate)obj7, 0f, 0f); object obj8 = <>c.<>9__11_12; if (obj8 == null) { ScrollViewBuilderDelegate val9 = delegate(Transform parent) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) REPOSlider val12 = MenuAPI.CreateREPOSlider("Zoom Level", "Minimap Zoom Level", (Action)delegate(float flt) { ConfigValues.Zoom.Value = flt; }, parent, new Vector2(0f, 150f), 1.5f, 10f, 2, ConfigValues.Zoom.Value, "", "", (BarBehavior)0); return ((REPOElement)val12).rectTransform; }; <>c.<>9__11_12 = val9; obj8 = (object)val9; } val.AddElementToScrollView((ScrollViewBuilderDelegate)obj8, 15f, 0f); object obj9 = <>c.<>9__11_13; if (obj9 == null) { ScrollViewBuilderDelegate val10 = delegate(Transform parent) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) REPOSlider val12 = MenuAPI.CreateREPOSlider("Opacity", "Minimap Opacity", (Action)delegate(float flt) { ConfigValues.Opacity.Value = flt; }, parent, new Vector2(0f, 150f), 0f, 1f, 2, ConfigValues.Opacity.Value, "", "", (BarBehavior)0); return ((REPOElement)val12).rectTransform; }; <>c.<>9__11_13 = val10; obj9 = (object)val10; } val.AddElementToScrollView((ScrollViewBuilderDelegate)obj9, 15f, 0f); object obj10 = <>c.<>9__11_14; if (obj10 == null) { ScrollViewBuilderDelegate val11 = delegate(Transform parent) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) REPOLabel val12 = MenuAPI.CreateREPOLabel("Controls", parent, new Vector2(0f, 90f)); return ((REPOElement)val12).rectTransform; }; <>c.<>9__11_14 = val11; obj10 = (object)val11; } val.AddElementToScrollView((ScrollViewBuilderDelegate)obj10, 15f, 0f); foreach (ConfigEntry item in BINDABLE_KEYS) { val.AddElementToScrollView((ScrollViewBuilderDelegate)delegate(Transform parent) { //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_006e: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: 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_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: 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_0121: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) string key = ((ConfigEntryBase)item).Definition.Key; REPOButton element = MenuAPI.CreateREPOButton(key + ": " + ((object)item.Value/*cast due to .constrained prefix*/).ToString(), (Action)delegate { }, parent, new Vector2(0f, 190f)); element.onClick = delegate { //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) if (!isSelectingKey) { ((TMP_Text)element.labelTMP).text = ((ConfigEntryBase)item).Definition.Key + ": "; keyToSet = item; activatedButton = element; isSelectingKey = true; } else { isSelectingKey = false; TextMeshProUGUI labelTMP = element.labelTMP; string key2 = ((ConfigEntryBase)item).Definition.Key; ((TMP_Text)labelTMP).text = key2 + ": " + ((object)item.Value/*cast due to .constrained prefix*/).ToString(); } }; element.overrideButtonSize = new Vector2(element.GetLabelSize().x * 0.8f, element.GetLabelSize().y * 0.8f); ((Transform)((REPOElement)element).rectTransform).localScale = new Vector3(((Transform)((REPOElement)element).rectTransform).localScale.x * 0.8f, ((Transform)((REPOElement)element).rectTransform).localScale.y * 0.8f, ((Transform)((REPOElement)element).rectTransform).localScale.z); return ((REPOElement)element).rectTransform; }, 0f, 0f); } pageInstance = val; val.OpenPage(false); } } } namespace TheEverythingMap.Mod { [BepInPlugin("Nubez.TheEverythingMap", "TheEverythingMap", "1.0.7")] public class TheEverythingMap : BaseUnityPlugin { [HarmonyPatch(typeof(PlayerAvatar))] public static class PlayerAvatarRPCPatch { [HarmonyPatch("ReviveRPC")] [HarmonyPostfix] public static void ReviveRPC(bool _revivedByTruck, PhotonMessageInfo _info = default(PhotonMessageInfo)) { ShowActivePlayersOnMap(); } [HarmonyPatch("PlayerDeathRPC")] [HarmonyPostfix] public static void PlayerDeathRPC(int enemyIndex, PhotonMessageInfo _info = default(PhotonMessageInfo)) { ShowActivePlayersOnMap(); } [HarmonyPatch("PlayerDeathDone")] [HarmonyPostfix] private static void PlayerDeathDone() { //IL_0064: 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) if ((Object)(object)GameDirector.instance != (Object)null && GameDirector.instance.PlayerList != null && GameDirector.instance.PlayerList.Any((PlayerAvatar player) => (Object)(object)player != (Object)null && (Object)(object)((Component)player).gameObject != (Object)null)) { PlayerDeathHead[] array = Object.FindObjectsOfType(); foreach (PlayerDeathHead val in array) { val.SeenSetRPC(true, default(PhotonMessageInfo)); } } } } [HarmonyPatch(typeof(LevelGenerator), "GenerateDone")] public static class LevelGeneratorGenerateDoneHookPatch { private static void Postfix(PhotonMessageInfo _info = default(PhotonMessageInfo)) { ShowActivePlayersOnMap(); ShowItems(); ExploreMap(); } } [HarmonyPatch(typeof(EnemyParent), "SpawnRPC")] public static class EnemySpawnRPCHookPatch { private static void Postfix(EnemyParent __instance, PhotonMessageInfo _info = default(PhotonMessageInfo)) { ShowAllEnemies(); } } [HarmonyPatch(typeof(EnemyParent), "DespawnRPC")] public static class EnemyDeSpawnRPCHookPatch { private static void Postfix(EnemyParent __instance, PhotonMessageInfo _info = default(PhotonMessageInfo)) { ShowAllEnemies(); } } [HarmonyPatch(typeof(EnemyHealth), "DeathRPC")] public static class EnemyDeathRPCHookPatch { private static void Postfix(EnemyHealth __instance, Vector3 _deathDirection, PhotonMessageInfo _info = default(PhotonMessageInfo)) { ShowAllEnemies(); } } private const string MOD_GUID = "Nubez.TheEverythingMap"; private const string VERSION_NUMBER = "1.0.7"; private const string SPECTATE_CAMERA_NAME = "Dirt Finder Map Camera"; internal const float GOAL_AND_HAUL_Y_OFFSET = -95f; private Camera? _camera; private RenderTexture? _renderTexture; private float defaultCameraZoom = -1f; private Vector2 _initialHaulShowPosition = Vector2.zero; private Vector2 targetHaulShowPosition = Vector2.zero; private Vector2 _initialGoalShowPosition = Vector2.zero; private Vector2 targetGoalShowPosition = Vector2.zero; private float targetSetHeight = -1f; private static Sprite? spriteCircle = SpriteHelper.CreateCircleSprite(); internal static TheEverythingMap Instance { get; private set; } = null; internal Harmony? Harmony { get; set; } private void Start() { SettingsMenu.Initialize(); } private void Awake() { Instance = this; Patch(); ((Component)this).gameObject.transform.parent = null; ((Object)((Component)this).gameObject).hideFlags = (HideFlags)61; ConfigValues.Configure((BaseUnityPlugin)(object)this); ((BaseUnityPlugin)this).Logger.LogInfo((object)$"{((BaseUnityPlugin)this).Info.Metadata.GUID} v{((BaseUnityPlugin)this).Info.Metadata.Version} has loaded!"); } internal void Patch() { //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_0021: Expected O, but got Unknown //IL_0026: Expected O, but got Unknown if (Harmony == null) { Harmony val = new Harmony(((BaseUnityPlugin)this).Info.Metadata.GUID); Harmony val2 = val; Harmony = val; } Harmony.PatchAll(); } internal void Unpatch() { Harmony? harmony = Harmony; if (harmony != null) { harmony.UnpatchSelf(); } } private void Update() { //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: 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_00d9: 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_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_0275: 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_028c: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: 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_02be: Unknown result type (might be due to invalid IL or missing references) //IL_0404: Unknown result type (might be due to invalid IL or missing references) //IL_040a: Invalid comparison between Unknown and I4 //IL_0451: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_0474: Unknown result type (might be due to invalid IL or missing references) //IL_047f: Unknown result type (might be due to invalid IL or missing references) //IL_048b: Unknown result type (might be due to invalid IL or missing references) //IL_0495: Unknown result type (might be due to invalid IL or missing references) //IL_04ac: Unknown result type (might be due to invalid IL or missing references) //IL_04b1: Unknown result type (might be due to invalid IL or missing references) //IL_04d4: Unknown result type (might be due to invalid IL or missing references) //IL_04ed: Unknown result type (might be due to invalid IL or missing references) //IL_04f2: Unknown result type (might be due to invalid IL or missing references) //IL_04fd: Unknown result type (might be due to invalid IL or missing references) //IL_0509: Unknown result type (might be due to invalid IL or missing references) //IL_0513: Unknown result type (might be due to invalid IL or missing references) Bindings.Update(); SettingsMenu.Update(); if (!StateUtils.IsInLevel()) { if ((Object)(object)_camera != (Object)null || (Object)(object)_renderTexture != (Object)null) { _camera = null; _renderTexture = null; } return; } if ((Object)(object)_camera == (Object)null && Object.FindObjectsOfType(true).Any((Camera cam) => ((Object)cam).name == "Dirt Finder Map Camera")) { _camera = Object.FindObjectsOfType(true).First((Camera cam) => ((Object)cam).name == "Dirt Finder Map Camera"); } if (targetHaulShowPosition == Vector2.zero || targetGoalShowPosition == Vector2.zero) { _initialHaulShowPosition = ((SemiUI)HaulUI.instance).showPosition; _initialGoalShowPosition = ((SemiUI)GoalUI.instance).showPosition; float num = (float)ConfigValues.WidthHeight.Value / 300f; targetHaulShowPosition = new Vector2(_initialHaulShowPosition.x, _initialHaulShowPosition.y + -95f * num); targetGoalShowPosition = new Vector2(_initialGoalShowPosition.x, _initialGoalShowPosition.y + -95f * num); } if (targetSetHeight != (float)ConfigValues.WidthHeight.Value) { float num2 = (float)ConfigValues.WidthHeight.Value / 300f; targetHaulShowPosition.y = _initialHaulShowPosition.y + -95f * num2; targetGoalShowPosition.y = _initialGoalShowPosition.y + -95f * num2; targetSetHeight = ConfigValues.WidthHeight.Value; } if (ConfigValues.Preset.Value == MinimapPosition.TopRight && (((SemiUI)HaulUI.instance).showPosition != targetHaulShowPosition || ((SemiUI)GoalUI.instance).showPosition != targetGoalShowPosition)) { ((SemiUI)HaulUI.instance).showPosition = targetHaulShowPosition; ((SemiUI)GoalUI.instance).showPosition = targetGoalShowPosition; } else if (ConfigValues.Preset.Value != MinimapPosition.TopRight && (((SemiUI)HaulUI.instance).showPosition != _initialHaulShowPosition || ((SemiUI)GoalUI.instance).showPosition != _initialGoalShowPosition)) { ((SemiUI)HaulUI.instance).showPosition = _initialHaulShowPosition; ((SemiUI)GoalUI.instance).showPosition = _initialGoalShowPosition; } if ((Object)(object)Map.Instance != (Object)null && !Map.Instance.Active) { Map.Instance.ActiveSet(true); } if ((Object)(object)_camera != (Object)null && ((Object)(object)_renderTexture == (Object)null || ((Object)(object)_camera.activeTexture != (Object)null && (Object)(object)_camera.activeTexture != (Object)(object)_renderTexture))) { _renderTexture = _camera.activeTexture; } if ((Object)(object)_camera != (Object)null) { if (defaultCameraZoom == -1f) { defaultCameraZoom = _camera.orthographicSize; } float num3 = ((!StateUtils.HasLocalMapToolActive()) ? ConfigValues.Zoom.Value : defaultCameraZoom); if (_camera.orthographicSize != num3) { _camera.orthographicSize = num3; } } if ((Object)(object)PlayerAvatar.instance != (Object)null && PlayerAvatar.instance.spectating && (Object)(object)SpectateCamera.instance != (Object)null && (int)SpectateCamera.instance.currentState == 1) { Transform transform = ((Component)SpectateCamera.instance).transform; PlayerAvatar player = SpectateCamera.instance.player; Quaternion rotation; if ((Object)(object)player != (Object)null) { DirtFinderMapPlayer.Instance.PlayerTransform.position = ((Component)player).transform.position; Transform playerTransform = DirtFinderMapPlayer.Instance.PlayerTransform; rotation = ((Component)player).transform.rotation; playerTransform.rotation = Quaternion.Euler(0f, ((Quaternion)(ref rotation)).eulerAngles.y, ((Quaternion)(ref rotation)).eulerAngles.z); PlayerController.instance.playerAvatarScript.LastNavmeshPosition = player.LastNavmeshPosition; } else if ((Object)(object)transform != (Object)null) { DirtFinderMapPlayer.Instance.PlayerTransform.position = transform.position; Transform playerTransform2 = DirtFinderMapPlayer.Instance.PlayerTransform; rotation = transform.rotation; playerTransform2.rotation = Quaternion.Euler(0f, ((Quaternion)(ref rotation)).eulerAngles.y, ((Quaternion)(ref rotation)).eulerAngles.z); } } } private void OnGUI() { //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) if (StateUtils.IsInLevel() && !((Object)(object)_renderTexture == (Object)null) && !StateUtils.HasLocalMapToolActive()) { int num; int num2; switch (ConfigValues.Preset.Value) { case MinimapPosition.TopLeft: num = ConfigValues.Buffer.Value; num2 = ConfigValues.Buffer.Value * 2; break; case MinimapPosition.MiddleRight: num = Screen.width - ConfigValues.WidthHeight.Value - ConfigValues.Buffer.Value; num2 = (Screen.height - ConfigValues.WidthHeight.Value) / 2; break; case MinimapPosition.TopRight: num = Screen.width - ConfigValues.WidthHeight.Value - ConfigValues.Buffer.Value; num2 = ConfigValues.Buffer.Value * 2; break; case MinimapPosition.BottomRight: num = Screen.width - ConfigValues.WidthHeight.Value - ConfigValues.Buffer.Value; num2 = Screen.height - ConfigValues.WidthHeight.Value - ConfigValues.Buffer.Value; break; case MinimapPosition.MiddleLeft: num = ConfigValues.Buffer.Value; num2 = (Screen.height - ConfigValues.WidthHeight.Value) / 2; break; default: num = ConfigValues.Buffer.Value; num2 = Screen.height - ConfigValues.WidthHeight.Value - ConfigValues.Buffer.Value; break; } Color color = GUI.color; if (ConfigValues.Opacity.Value != 1f) { GUI.color = new Color(1f, 1f, 1f, ConfigValues.Opacity.Value); } GUI.DrawTexture(new Rect((float)num, (float)num2, (float)ConfigValues.WidthHeight.Value, (float)ConfigValues.WidthHeight.Value), (Texture)(object)_renderTexture, (ScaleMode)0, false); if (ConfigValues.Opacity.Value != 1f) { GUI.color = color; } } } public static void ShowItems() { //IL_007e: Unknown result type (might be due to invalid IL or missing references) if (ConfigValues.ShowItems.Value && Object.FindObjectsOfType().Any()) { ValuableObject[] array = Object.FindObjectsOfType(); foreach (ValuableObject val in array) { val.discovered = true; val.Discover((State)0); Map.Instance.AddValuable(val); } MapValuable[] array2 = Object.FindObjectsOfType(); foreach (MapValuable val2 in array2) { val2.spriteRenderer.color = ConfigValues.ItemColor.Value.ToColor(); } ValuableDiscoverCustom[] array3 = Object.FindObjectsOfType(); foreach (ValuableDiscoverCustom val3 in array3) { val3.Discover(); } } } public static void ExploreMap() { if (ConfigValues.ExploreMap.Value && (Object)(object)Map.Instance != (Object)null) { RoomVolume[] array = Object.FindObjectsOfType(); foreach (RoomVolume val in array) { val.SetExplored(); } } } public static void ShowActivePlayersOnMap() { //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_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)GameDirector.instance != (Object)null) || GameDirector.instance.PlayerList == null || !GameDirector.instance.PlayerList.Any((PlayerAvatar player) => (Object)(object)player != (Object)null && (Object)(object)((Component)player).gameObject != (Object)null)) { return; } foreach (PlayerAvatar item in GameDirector.instance.PlayerList.Where((PlayerAvatar player) => (Object)(object)player != (Object)null && (Object)(object)((Component)player).gameObject != (Object)null)) { MapCustom component = ((Component)item).GetComponent(); if ((Object)(object)component != (Object)null) { Object.Destroy((Object)(object)((Component)item).GetComponent()); } ComponentHolderProtocol.AddComponent((Object)(object)item); component = ((Component)item).GetComponent(); component.sprite = spriteCircle; Color color = ConfigValues.TeammateColor.Value.ToColor(); component.color = color; component.Add(); } PlayerDeathHead[] array = Object.FindObjectsOfType(); foreach (PlayerDeathHead val in array) { val.mapCustom.color = ConfigValues.DeadTeammateColor.Value.ToColor(); } } private static void ShowAllEnemies() { //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) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 if (!ConfigValues.ShowEnemies.Value || !Object.FindObjectsOfType().Any((EnemyParent enemyParent) => (Object)(object)enemyParent != (Object)null && (Object)(object)((Component)enemyParent).gameObject != (Object)null)) { return; } foreach (EnemyParent item in EnemyDirector.instance.enemiesSpawned) { if ((Object)(object)item != (Object)null && ((Behaviour)item).isActiveAndEnabled && (Object)(object)item.Enemy.Health != (Object)null && !item.Enemy.Health.dead && (int)item.Enemy.CurrentState != 11 && (int)item.Enemy.CurrentState > 0) { MapCustom component = ((Component)item.Enemy).GetComponent(); if ((Object)(object)component == (Object)null) { component = ComponentHolderProtocol.AddComponent((Object)(object)item.Enemy); component.autoAdd = false; component.sprite = spriteCircle; component.color = ConfigValues.EnemyColor.Value.ToColor(); ((Component)component).transform.localScale = Vector3.one * item.Enemy.Type.ToScale(); component.Add(); } } else if ((Object)(object)item != (Object)null && (Object)(object)((Component)item).gameObject != (Object)null) { MapCustom component2 = ((Component)item.Enemy).GetComponent(); if ((Object)(object)component2 != (Object)null) { component2.mapCustomEntity.spriteRenderer.sprite = SpriteHelper.CreateClearSprite(); component2.Hide(); Object.Destroy((Object)(object)component2); } } } } } } namespace TheEverythingMap.Helpers { internal class Bindings { internal static void Update() { //IL_001d: 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) if (StateUtils.IsInLevel() && !StateUtils.IsChatActive()) { if (Input.GetKeyDown(ConfigValues.ZoomInKey.Value)) { ConfigValues.Zoom.Value = Mathf.Max(ConfigValues.Zoom.Value - 0.5f, 1.5f); } if (Input.GetKeyDown(ConfigValues.ZoomOutKey.Value)) { ConfigValues.Zoom.Value = Mathf.Min(ConfigValues.Zoom.Value + 0.5f, 10f); } } } } internal static class Extensions { public static Dictionary VALID_COLORS = new Dictionary { { "white", Color.white }, { "red", Color.red }, { "green", Color.green }, { "blue", Color.blue }, { "yellow", Color.yellow }, { "cyan", Color.cyan }, { "magenta", Color.magenta }, { "black", Color.black }, { "lilac", new Color(35f / 51f, 0.56078434f, 0.9137255f) }, { "purple", new Color(0.6431373f, 0.4392157f, 0.8901961f) } }; public static Color ToColor(this string color) { //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_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) Color value = Color.white; VALID_COLORS.TryGetValue(color.ToLower(), out value); return value; } public static float ToScale(this EnemyType enemyType) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected I4, but got Unknown if (1 == 0) { } float result = (int)enemyType switch { 0 => 0.55f, 1 => 0.7f, 2 => 0.85f, 3 => 1f, 4 => 1.15f, _ => 1f, }; if (1 == 0) { } return result; } } internal static class SpriteHelper { public static Sprite CreateCircleSprite() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_0083: 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_0072: 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) int num = 10; Texture2D val = new Texture2D(num, num, (TextureFormat)5, false); Color[] array = (Color[])(object)new Color[num * num]; float num2 = (float)num / 2f; float num3 = (float)num / 2f - 1f; for (int i = 0; i < num; i++) { for (int j = 0; j < num; j++) { int num4 = i * num + j; float num5 = (float)j - num2; float num6 = (float)i - num2; if (num5 * num5 + num6 * num6 <= num3 * num3) { array[num4] = Color.white; } else { array[num4] = Color.clear; } } } val.SetPixels(array); val.Apply(); return Sprite.Create(val, new Rect(0f, 0f, (float)num, (float)num), new Vector2(0.5f, 0.5f)); } public static Sprite CreateClearSprite() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) int num = 10; Texture2D val = new Texture2D(num, num, (TextureFormat)5, false); Color[] array = (Color[])(object)new Color[num * num]; float num2 = (float)num / 2f; float num3 = (float)num / 2f - 1f; for (int i = 0; i < num; i++) { for (int j = 0; j < num; j++) { int num4 = i * num + j; array[num4] = Color.clear; } } val.SetPixels(array); val.Apply(); return Sprite.Create(val, new Rect(0f, 0f, (float)num, (float)num), new Vector2(0.5f, 0.5f)); } } internal static class StateUtils { internal static bool HasLocalMapToolActive() { PlayerAvatar instance = PlayerAvatar.instance; return instance != null && (Object)(object)instance.playerAvatarVisuals.playerAvatarRightArm.mapToolController != (Object)null && instance.playerAvatarVisuals.playerAvatarRightArm.mapToolController.Active; } internal static bool IsInLevel() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Invalid comparison between Unknown and I4 return SemiFunc.RunIsLevel() && GameDirector.instance != null && (int)GameDirector.instance.currentState == 2; } internal static bool IsChatActive() { return ChatManager.instance != null && ChatManager.instance.chatActive; } } }