using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Text; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using ExitGames.Client.Photon; using HarmonyLib; using Microsoft.CodeAnalysis; using Photon.Pun; using Photon.Realtime; using UnityEngine; using UnityEngine.UI; [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("MiniMapAndMapPlus")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+d95114520ab333a0cad57a4a343d955ed9503877")] [assembly: AssemblyProduct("MiniMapAndMapPlus")] [assembly: AssemblyTitle("MiniMapAndMapPlus")] [assembly: AssemblyVersion("1.0.0.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [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 RepoMapFix { internal static class ConfigLocalization { internal const string RepoConfigGuid = "nickklmao.repoconfig"; private const string RepoConfigTypeName = "REPOConfig.ConfigMenu"; private const string RepoConfigMethodName = "FixNaming"; private static readonly Dictionary Translations = new Dictionary { { "全般", "General" }, { "ミニマップ", "Minimap" }, { "画質", "Quality" }, { "マーカー", "Markers" }, { "納品場所の色", "Extraction Colors" }, { "自分の位置", "Player Marker" }, { "Tabマップ", "Tab Map" }, { "部屋チェック", "Room Check" }, { "デバッグ", "Debug" }, { "有効", "Enabled" }, { "解像度プリセット", "Resolution Preset" }, { "表示する", "Show" }, { "北向きに固定", "Fix North" }, { "表示方式", "Display Mode" }, { "ズーム", "Zoom" }, { "表示位置", "Position" }, { "大きさ", "Size" }, { "画面端の余白", "Screen Margin" }, { "不透明度", "Opacity" }, { "Tab中は隠す", "Hide While Tab Open" }, { "右上の下げ幅", "Right Offset" }, { "左上の下げ幅", "Left Offset" }, { "描画解像度", "Render Resolution" }, { "アンチエイリアス", "Anti-Aliasing" }, { "映す階", "Floor Mode" }, { "発見済み納品場所", "Discovered Extraction Points" }, { "味方の位置を表示", "Show Teammates" }, { "マーカーの大きさ", "Marker Size" }, { "納品場所の印の大きさ", "Extraction Marker Size" }, { "起動中の納品場所に波紋", "Ripple Active Points" }, { "起動中の納品場所の波紋の広がり", "Active Ripple Spread" }, { "ドアを目立たせる", "Highlight Doors" }, { "ドアの色", "Door Color" }, { "未起動", "Inactive" }, { "起動中", "Active" }, { "納品済み", "Completed" }, { "色", "Color" }, { "光らせる", "Glow" }, { "波紋を出す", "Ripple" }, { "波紋の大きさ", "Ripple Size" }, { "拡大率を変更", "Override Zoom" }, { "拡大率", "Zoom" }, { "味方マーカー", "Teammate Marker" }, { "自分の色", "My Color" }, { "自分を光らせる", "Glow Self" }, { "自分の波紋", "My Ripple" }, { "印のキー", "Mark Key" }, { "印のキーを設定", "Set Mark Key" }, { "印の色", "Mark Color" }, { "印の大きさ", "Mark Size" }, { "Tabにも表示", "Also on Tab Map" }, { "解除済み", "Unlocked" }, { "構造ログのキー", "Diagnostics Key" }, { "ログの保存先", "Log Save Path" } }; private static readonly Dictionary ColorNames = new Dictionary { { "標準のまま", "Default" }, { "黄色", "Yellow" }, { "水色", "Cyan" }, { "赤", "Red" }, { "オレンジ", "Orange" }, { "緑", "Green" }, { "青", "Blue" }, { "紫", "Purple" }, { "ピンク", "Pink" }, { "白", "White" }, { "灰色", "Gray" }, { "黒", "Black" } }; private static readonly Dictionary CornerNames = new Dictionary { { "右上", "Top Right" }, { "左上", "Top Left" }, { "右下", "Bottom Right" }, { "左下", "Bottom Left" } }; private static readonly Dictionary ViewModeNames = new Dictionary { { "ステージ全体を固定表示", "Fit Whole Stage" }, { "プレイヤーに追従", "Follow Player" } }; private static readonly Dictionary FloorModeNames = new Dictionary { { "自分のいる階", "Current Floor" }, { "全ての階", "All Floors" }, { "地上1階で固定", "Fixed Ground Floor" } }; private static readonly List> EnumValueSets = new List> { ColorNames, CornerNames, ViewModeNames, FloorModeNames }; private const string LanguageSettingKey = "言語"; internal static void TryPatch(Harmony harmony, ManualLogSource logger) { //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Expected O, but got Unknown try { Type type = AccessTools.TypeByName("REPOConfig.ConfigMenu"); if (type == null) { return; } MethodInfo methodInfo = AccessTools.Method(type, "FixNaming", (Type[])null, (Type[])null); if (methodInfo == null) { logger.LogWarning((object)"REPOConfigの表示名の作り方が変わっているため、英語表示は使えません。"); return; } harmony.Patch((MethodBase)methodInfo, new HarmonyMethod(AccessTools.Method(typeof(ConfigLocalization), "Prefix", (Type[])null, (Type[])null)), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); logger.LogInfo((object)"設定画面の英語表示を用意しました。"); } catch (Exception ex) { logger.LogWarning((object)("設定画面の英語表示を用意できませんでした(日本語表示のまま動作します): " + ex.Message)); } TryPatchSliderOptions(harmony, logger); } private static void TryPatchSliderOptions(Harmony harmony, ManualLogSource logger) { //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Expected O, but got Unknown try { Type type = AccessTools.TypeByName("MenuLib.MenuAPI"); Type type2 = AccessTools.TypeByName("MenuLib.MonoBehaviors.REPOSlider"); Type type3 = ((type2 != null) ? AccessTools.Inner(type2, "BarBehavior") : null); if (!(type == null) && !(type3 == null)) { MethodInfo methodInfo = AccessTools.Method(type, "CreateREPOSlider", new Type[10] { typeof(string), typeof(string), typeof(Action), typeof(Transform), typeof(string[]), typeof(string), typeof(Vector2), typeof(string), typeof(string), type3 }, (Type[])null); if (methodInfo == null) { logger.LogWarning((object)"選択肢一覧の作り方が変わっているため、選択肢の英語表示は使えません。"); } else { harmony.Patch((MethodBase)methodInfo, new HarmonyMethod(AccessTools.Method(typeof(ConfigLocalization), "SliderOptionsPrefix", (Type[])null, (Type[])null)), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } } } catch (Exception ex) { logger.LogWarning((object)("選択肢一覧の英語表示を用意できませんでした(日本語表示のまま動作します): " + ex.Message)); } } private static bool SliderOptionsPrefix(ref string[] stringOptions, ref string defaultOption) { if (Plugin.CurrentLanguage != Plugin.Language.English || stringOptions == null) { return true; } Dictionary dictionary = MatchEnumSet(stringOptions); if (dictionary == null) { return true; } string[] array = new string[stringOptions.Length]; for (int i = 0; i < stringOptions.Length; i++) { array[i] = (dictionary.TryGetValue(stringOptions[i], out var value) ? value : stringOptions[i]); } stringOptions = array; if (defaultOption != null && dictionary.TryGetValue(defaultOption, out var value2)) { defaultOption = value2; } return true; } private static Dictionary MatchEnumSet(string[] options) { foreach (Dictionary enumValueSet in EnumValueSets) { if (options.Length != enumValueSet.Count) { continue; } bool flag = true; foreach (string key in options) { if (!enumValueSet.ContainsKey(key)) { flag = false; break; } } if (flag) { return enumValueSet; } } return null; } private static bool Prefix(string input, ref string __result) { if (input == "言語") { __result = ((Plugin.CurrentLanguage == Plugin.Language.English) ? "Language / 言語" : "言語 / Language"); return false; } if (Plugin.CurrentLanguage != Plugin.Language.English) { return true; } if (input != null && Translations.TryGetValue(input, out var value)) { __result = value; return false; } return true; } internal static bool TryShowPopup(string header, Color headerColor, string content) { //IL_008a: Unknown result type (might be due to invalid IL or missing references) try { Type type = AccessTools.TypeByName("MenuLib.MenuAPI"); if (type == null) { return false; } MethodInfo methodInfo = AccessTools.Method(type, "OpenPopup", new Type[5] { typeof(string), typeof(Color), typeof(string), typeof(Action), typeof(Action) }, (Type[])null); if (methodInfo == null) { return false; } methodInfo.Invoke(null, new object[5] { header, headerColor, content, null, null }); return true; } catch (Exception) { return false; } } } internal static class Diagnostics { internal static void Dump(ManualLogSource logger, MinimapView view, EntityMarkers markers, FullMapView fullMap, string savePath) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.AppendLine(); stringBuilder.AppendLine("========== RepoMapFix Diagnostics =========="); DumpScreen(stringBuilder); DumpMinimapCamera(stringBuilder, view); view?.DescribeFitInto(stringBuilder); markers?.DescribeInto(stringBuilder); fullMap?.DescribeInto(stringBuilder); DumpExtractionColors(stringBuilder); DumpCamera(stringBuilder); DumpMapRoot(stringBuilder); DumpPlayerMarker(stringBuilder); DumpModules(stringBuilder); stringBuilder.AppendLine("========== End Diagnostics =========="); logger.LogInfo((object)stringBuilder.ToString()); Save(logger, stringBuilder.ToString(), savePath); } private static void Save(ManualLogSource logger, string text, string savePath) { try { string text2 = (string.IsNullOrEmpty(savePath) ? Path.Combine(Paths.BepInExRootPath, "RepoMapFix_diagnostics.txt") : savePath); string directoryName = Path.GetDirectoryName(text2); if (!string.IsNullOrEmpty(directoryName) && !Directory.Exists(directoryName)) { Directory.CreateDirectory(directoryName); } File.WriteAllText(text2, text); logger.LogInfo((object)("診断内容を書き出しました: " + text2)); } catch (Exception ex) { logger.LogWarning((object)("診断内容の書き出しに失敗しました: " + ex.Message)); } } private static void DumpScreen(StringBuilder sb) { //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) sb.AppendLine("--- 画面とUIの拡大率 ---"); sb.AppendLine($"画面 : {Screen.width}x{Screen.height}"); Canvas[] array = Object.FindObjectsOfType(); foreach (Canvas val in array) { if (val.isRootCanvas) { sb.AppendLine($" [{((Object)val).name}] 拡大率={val.scaleFactor:F3}"); CanvasScaler component = ((Component)val).GetComponent(); if ((Object)(object)component != (Object)null) { sb.AppendLine($" 方式={component.uiScaleMode} 基準={component.referenceResolution}"); } } } } private static void DumpMinimapCamera(StringBuilder sb, MinimapView view) { //IL_0085: 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) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) sb.AppendLine("--- Minimap Camera (self) ---"); if (view == null || (Object)(object)view.Camera == (Object)null) { sb.AppendLine("NOT BUILT"); return; } Camera camera = view.Camera; sb.AppendLine("path : " + GetPath(((Component)camera).transform)); sb.AppendLine($"enabled : {((Behaviour)camera).enabled} activeInHierarchy={((Component)camera).gameObject.activeInHierarchy}"); sb.AppendLine($"world position : {((Component)camera).transform.position}"); Quaternion rotation = ((Component)camera).transform.rotation; sb.AppendLine($"world rotation : {((Quaternion)(ref rotation)).eulerAngles}"); sb.AppendLine($"orthographic : {camera.orthographic} size={camera.orthographicSize}"); sb.AppendLine($"clip : near={camera.nearClipPlane} far={camera.farClipPlane}"); sb.AppendLine($"cullingMask : {camera.cullingMask}"); sb.AppendLine($"clearFlags : {camera.clearFlags} color={camera.backgroundColor}"); sb.AppendLine($"depth : {camera.depth} rect={camera.rect}"); DumpTexture(sb, "targetTexture", camera.targetTexture); if ((Object)(object)view.Texture != (Object)null) { sb.AppendLine($"texture created : {view.Texture.IsCreated()}"); } } private static void DumpExtractionColors(StringBuilder sb) { sb.AppendLine("--- 納品所の地図タイルの色 ---"); if ((Object)(object)Map.Instance == (Object)null) { sb.AppendLine("NOT FOUND"); return; } DumpPrefabColor(sb, "起動中(Active)相当の通常床", Map.Instance.FloorObject1x1); DumpPrefabColor(sb, "納品済み(Used)の床", Map.Instance.FloorUsed); DumpPrefabColor(sb, "納品済み(Used)の壁", Map.Instance.WallUsed); DumpPrefabColor(sb, "未起動(Inactive)の床", Map.Instance.FloorInactive); DumpPrefabColor(sb, "未起動(Inactive)の壁", Map.Instance.WallInactive); DumpPrefabColor(sb, "トラックの床", Map.Instance.FloorTruck); DumpExtractionPoints(sb); } private static void DumpExtractionPoints(StringBuilder sb) { //IL_0079: Unknown result type (might be due to invalid IL or missing references) ExtractionPoint[] array = Object.FindObjectsOfType(); sb.AppendLine($"--- 納品所 {array.Length}個 ---"); FieldInfo fieldInfo = AccessTools.Field(typeof(ExtractionPoint), "currentState"); sb.AppendLine($" プレイヤーの階 : {Map.Instance.PlayerLayer}"); for (int i = 0; i < array.Length; i++) { ExtractionPoint val = array[i]; object obj = fieldInfo?.GetValue(val); int layer = Map.Instance.GetLayerParent(((Component)val).transform.position.y + 0.01f).layer; int num = Mathf.Abs(layer - Map.Instance.PlayerLayer); string arg = ((num <= 1) ? "表示される階" : $"表示されない階({num}階ぶん離れている)"); sb.AppendLine(string.Format(" [{0}] 状態={1} 施錠={2}", i, obj ?? "取得不可", val.isLocked)); sb.AppendLine($" 階={layer} → {arg}"); sb.AppendLine(" 未起動時のタイル : " + DescribeTypes(val.mapInactive)); sb.AppendLine(" 起動中のタイル : " + DescribeTypes(val.mapActive)); sb.AppendLine(" 納品済みのタイル : " + DescribeTypes(val.mapUsed)); } } private static string DescribeTypes(DirtFinderMapFloor[] floors) { if (floors == null || floors.Length == 0) { return "なし"; } HashSet hashSet = new HashSet(); foreach (DirtFinderMapFloor val in floors) { if ((Object)(object)val != (Object)null) { hashSet.Add(((object)Unsafe.As(ref val.Type)/*cast due to .constrained prefix*/).ToString()); } } return string.Format("{0}枚 [{1}]", floors.Length, string.Join(", ", hashSet)); } private static void DumpPrefabColor(StringBuilder sb, string label, GameObject prefab) { //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: 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_00a8: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)prefab == (Object)null) { sb.AppendLine($"{label,-26}: なし"); return; } Renderer[] componentsInChildren = prefab.GetComponentsInChildren(true); if (componentsInChildren.Length == 0) { sb.AppendLine($"{label,-26}: 描画物なし"); return; } Renderer[] array = componentsInChildren; for (int i = 0; i < array.Length; i++) { Material sharedMaterial = array[i].sharedMaterial; if (!((Object)(object)sharedMaterial == (Object)null)) { string text = (sharedMaterial.HasProperty("_Color") ? ((object)sharedMaterial.GetColor("_Color")/*cast due to .constrained prefix*/).ToString() : "(色の項目なし)"); string text2 = (sharedMaterial.HasProperty("_EmissionColor") ? ((object)sharedMaterial.GetColor("_EmissionColor")/*cast due to .constrained prefix*/).ToString() : "-"); object[] obj = new object[4] { label, null, null, null }; Shader shader = sharedMaterial.shader; obj[1] = ((shader != null) ? ((Object)shader).name : null); obj[2] = text; obj[3] = text2; sb.AppendLine(string.Format("{0,-26}: shader={1} color={2} emission={3}", obj)); return; } } sb.AppendLine($"{label,-26}: 素材なし"); } private static void DumpCamera(StringBuilder sb) { //IL_007e: 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_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: 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_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Expected O, but got Unknown //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) Camera val = null; Camera[] array = Object.FindObjectsOfType(true); foreach (Camera val2 in array) { if (((Object)val2).name == "Dirt Finder Map Camera") { val = val2; break; } } sb.AppendLine("--- Map Camera ---"); if ((Object)(object)val == (Object)null) { sb.AppendLine("NOT FOUND"); return; } sb.AppendLine("path : " + GetPath(((Component)val).transform)); Quaternion val3 = ((Component)val).transform.rotation; sb.AppendLine($"world rotation : {((Quaternion)(ref val3)).eulerAngles}"); val3 = ((Component)val).transform.localRotation; sb.AppendLine($"local rotation : {((Quaternion)(ref val3)).eulerAngles}"); sb.AppendLine($"local position : {((Component)val).transform.localPosition}"); sb.AppendLine($"orthographic : {val.orthographic} size={val.orthographicSize}"); sb.AppendLine($"cullingMask : {val.cullingMask}"); DumpTexture(sb, "targetTexture", val.targetTexture); DumpTexture(sb, "activeTexture", val.activeTexture); sb.AppendLine("--- Camera ancestors (rotation of each) ---"); Transform parent = ((Component)val).transform.parent; while ((Object)(object)parent != (Object)null) { string name = ((Object)parent).name; val3 = parent.localRotation; object arg = ((Quaternion)(ref val3)).eulerAngles; val3 = parent.rotation; sb.AppendLine($" {name,-32} localRot={arg} worldRot={((Quaternion)(ref val3)).eulerAngles}"); parent = parent.parent; } if (!((Object)(object)((Component)val).transform.parent != (Object)null)) { return; } sb.AppendLine("--- Siblings under camera's parent ---"); foreach (Transform item in ((Component)val).transform.parent) { Transform val4 = item; Renderer component = ((Component)val4).GetComponent(); object[] obj = new object[4] { ((Object)val4).name, ((Component)val4).gameObject.activeSelf, ((Object)(object)component == (Object)null) ? "-" : ((object)component).GetType().Name, null }; val3 = val4.localRotation; obj[3] = ((Quaternion)(ref val3)).eulerAngles; sb.AppendLine(string.Format(" {0,-32} active={1} renderer={2} localRot={3}", obj)); } } private static void DumpTexture(StringBuilder sb, string label, RenderTexture rt) { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)rt == (Object)null) { sb.AppendLine($"{label,-16}: null"); return; } sb.AppendLine($"{label,-16}: {((Texture)rt).width}x{((Texture)rt).height} AA={rt.antiAliasing} filter={((Texture)rt).filterMode} format={rt.format}"); } private static void DumpMapRoot(StringBuilder sb) { //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: 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_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_010c: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Expected O, but got Unknown //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) sb.AppendLine("--- Map.Instance ---"); if ((Object)(object)Map.Instance == (Object)null) { sb.AppendLine("NOT FOUND"); return; } sb.AppendLine("path : " + GetPath(((Component)Map.Instance).transform)); Quaternion rotation = ((Component)Map.Instance).transform.rotation; sb.AppendLine($"world rotation : {((Quaternion)(ref rotation)).eulerAngles}"); sb.AppendLine($"Active : {Map.Instance.Active}"); sb.AppendLine($"Scale : {Map.Instance.Scale}"); sb.AppendLine($"PlayerLayer : {Map.Instance.PlayerLayer}"); if ((Object)(object)Map.Instance.OverLayerParent != (Object)null) { string path = GetPath(Map.Instance.OverLayerParent); rotation = Map.Instance.OverLayerParent.rotation; sb.AppendLine($"OverLayerParent : {path} worldRot={((Quaternion)(ref rotation)).eulerAngles}"); } if (!((Object)(object)Map.Instance.ActiveParent != (Object)null)) { return; } sb.AppendLine("--- Children under Map.ActiveParent ---"); foreach (Transform item in Map.Instance.ActiveParent.transform) { Transform val = item; Renderer component = ((Component)val).GetComponent(); object[] obj = new object[4] { ((Object)val).name, ((Component)val).gameObject.activeSelf, ((Object)(object)component == (Object)null) ? "-" : ((object)component).GetType().Name, null }; rotation = val.rotation; obj[3] = ((Quaternion)(ref rotation)).eulerAngles; sb.AppendLine(string.Format(" {0,-32} active={1} renderer={2} worldRot={3}", obj)); } } private static void DumpPlayerMarker(StringBuilder sb) { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: 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_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: 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_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Expected O, but got Unknown //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: 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_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) sb.AppendLine("--- DirtFinderMapPlayer ---"); if ((Object)(object)DirtFinderMapPlayer.Instance == (Object)null) { sb.AppendLine("NOT FOUND"); return; } Transform transform = ((Component)DirtFinderMapPlayer.Instance).transform; sb.AppendLine("path : " + GetPath(transform)); Quaternion val = transform.rotation; sb.AppendLine($"world rotation : {((Quaternion)(ref val)).eulerAngles}"); val = transform.localRotation; sb.AppendLine($"local rotation : {((Quaternion)(ref val)).eulerAngles}"); sb.AppendLine("--- Children ---"); foreach (Transform item in transform) { Transform val2 = item; string name = ((Object)val2).name; val = val2.localRotation; sb.AppendLine($" {name,-32} localRot={((Quaternion)(ref val)).eulerAngles}"); } if ((Object)(object)Map.Instance != (Object)null && (Object)(object)Map.Instance.PlayerGraphicTransform != (Object)null) { Transform playerGraphicTransform = Map.Instance.PlayerGraphicTransform; string path = GetPath(playerGraphicTransform); val = playerGraphicTransform.rotation; sb.AppendLine($"PlayerGraphic : {path} worldRot={((Quaternion)(ref val)).eulerAngles}"); } } private static void DumpModules(StringBuilder sb) { //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_007a: 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_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) sb.AppendLine("--- MapModule (first 3) ---"); MapModule[] array = Object.FindObjectsOfType(); sb.AppendLine($"count : {array.Length}"); int num = ((array.Length < 3) ? array.Length : 3); for (int i = 0; i < num; i++) { MapModule val = array[i]; sb.AppendLine($" [{i}] {GetPath(((Component)val).transform)}"); Quaternion rotation = ((Component)val).transform.rotation; sb.AppendLine($" worldRot={((Quaternion)(ref rotation)).eulerAngles} scale={((Component)val).transform.localScale}"); if ((Object)(object)val.graphic != (Object)null) { string path = GetPath(val.graphic); rotation = val.graphic.rotation; sb.AppendLine($" graphic={path} worldRot={((Quaternion)(ref rotation)).eulerAngles}"); } } } private static string GetPath(Transform t) { if ((Object)(object)t == (Object)null) { return "(null)"; } StringBuilder stringBuilder = new StringBuilder(((Object)t).name); Transform parent = t.parent; while ((Object)(object)parent != (Object)null) { stringBuilder.Insert(0, ((Object)parent).name + "/"); parent = parent.parent; } return stringBuilder.ToString(); } } internal sealed class DoorMarkers { private sealed class DoorMarkerWidth : MonoBehaviour { internal float Width = 1f; } private const float ScanIntervalSeconds = 2f; private const float SettleSeconds = 3f; private readonly Dictionary _markers = new Dictionary(); private readonly List _stale = new List(); private Transform _boundOverlay; private Sprite _sprite; private float _timer; private float _settle; private const float Thickness = 0.5f; internal int Count => _markers.Count; internal void Tick(float deltaTime, bool enabled, PaletteColor colorChoice) { Map instance = Map.Instance; if (!enabled || (Object)(object)instance == (Object)null || (Object)(object)instance.OverLayerParent == (Object)null) { Clear(); return; } if ((Object)(object)_boundOverlay != (Object)(object)instance.OverLayerParent) { Clear(); _boundOverlay = instance.OverLayerParent; } if ((Object)(object)LevelGenerator.Instance == (Object)null || !LevelGenerator.Instance.Generated) { _settle = 0f; return; } if (_settle < 3f) { _settle += deltaTime; return; } _timer -= deltaTime; if (_timer <= 0f) { _timer = 2f; Scan(instance); } Apply(colorChoice); } internal void Clear() { foreach (GameObject value in _markers.Values) { if ((Object)(object)value != (Object)null) { Object.Destroy((Object)(object)value); } } _markers.Clear(); _boundOverlay = null; _settle = 0f; } private void Scan(Map map) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) DirtFinderMapWall[] array = Object.FindObjectsOfType(); foreach (DirtFinderMapWall val in array) { if (!((Object)(object)val == (Object)null) && !_markers.ContainsKey(val) && TryGetDoorWidth(val.Type, out var width)) { GameObject val2 = Create(map, val, width); if ((Object)(object)val2 != (Object)null) { _markers[val] = val2; } } } _stale.Clear(); foreach (KeyValuePair marker in _markers) { if ((Object)(object)marker.Key == (Object)null || (Object)(object)marker.Value == (Object)null) { _stale.Add(marker.Key); } } foreach (DirtFinderMapWall item in _stale) { if ((Object)(object)item != (Object)null && _markers.TryGetValue(item, out var value) && (Object)(object)value != (Object)null) { Object.Destroy((Object)(object)value); } _markers.Remove(item); } } private static bool TryGetDoorWidth(WallType type, out float width) { //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_0018: Expected I4, but got Unknown //IL_0018: 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_0039: Expected I4, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Invalid comparison between Unknown and I4 switch (type - 1) { default: switch (type - 10) { default: if ((int)type == 19) { break; } goto end_IL_0003; case 0: case 4: width = 0.5f; return true; case 1: case 5: break; case 2: case 3: goto end_IL_0003; } goto case 0; case 1: width = 2f; return true; case 0: case 3: width = 1f; return true; case 2: break; end_IL_0003: break; } width = 0f; return false; } private void Apply(PaletteColor colorChoice) { //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: 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_00a8: 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_00b7: Unknown result type (might be due to invalid IL or missing references) Color color; bool flag = MapPalette.TryResolve(colorChoice, out color); Vector3 val = default(Vector3); foreach (KeyValuePair marker in _markers) { GameObject value = marker.Value; if (!((Object)(object)value == (Object)null)) { DoorMarkerWidth component = value.GetComponent(); float num = (((Object)(object)component != (Object)null) ? component.Width : 1f); ((Vector3)(ref val))..ctor(num, 0.5f, 1f); if (value.transform.localScale != val) { value.transform.localScale = val; } SpriteRenderer component2 = value.GetComponent(); if ((Object)(object)component2 != (Object)null && flag && component2.color != color) { component2.color = color; } } } } private GameObject Create(Map map, DirtFinderMapWall wall, float width) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0027: 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_003e: 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_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_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) //IL_00a7: 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_00b6: 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_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Expected O, but got Unknown MapLayer layerParent = map.GetLayerParent(((Component)wall).transform.position.y); if ((Object)(object)layerParent == (Object)null) { return null; } GameObject val = new GameObject("RepoMapFix Door Marker"); val.transform.SetParent(((Component)layerParent).transform, false); val.layer = ((Component)layerParent).gameObject.layer; val.AddComponent().Width = width; SpriteRenderer obj = val.AddComponent(); obj.sprite = GetSprite(); ((Renderer)obj).sortingOrder = 60; val.transform.position = ((Component)wall).transform.position * map.Scale + ((Component)layerParent).transform.position + map.GetLayerPosition(layerParent.layer); val.transform.rotation = Quaternion.Euler(90f, ((Component)wall).transform.eulerAngles.y, 0f); return val; } private Sprite GetSprite() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002b: 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_003a: Expected O, but got Unknown //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_sprite != (Object)null) { return _sprite; } Texture2D val = new Texture2D(64, 64, (TextureFormat)4, false) { name = "RepoMapFix Door", filterMode = (FilterMode)1, wrapMode = (TextureWrapMode)1 }; Color32[] array = (Color32[])(object)new Color32[4096]; for (int i = 0; i < 64; i++) { for (int j = 0; j < 64; j++) { float num = Mathf.Abs(((float)i + 0.5f) / 64f - 0.5f) * 2f; float num2 = Mathf.Clamp01((0.22f - num) / 0.03f); array[i * 64 + j] = new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, (byte)(num2 * 255f)); } } val.SetPixels32(array); val.Apply(false, true); _sprite = Sprite.Create(val, new Rect(0f, 0f, 64f, 64f), new Vector2(0.5f, 0.5f), 64f); ((Object)_sprite).name = "RepoMapFix Door"; return _sprite; } } internal sealed class EntityMarkers { private sealed class Marker { internal GameObject Object; internal SpriteRenderer Renderer; } private const float ScanIntervalSeconds = 0.5f; private static readonly FieldInfo PlayerDisabledField = AccessTools.Field(typeof(PlayerAvatar), "isDisabled"); private static readonly FieldInfo ColorsEquippedField = AccessTools.Field(typeof(PlayerCosmetics), "colorsEquipped"); private const int HeadColorSlot = 5; private static readonly Color DeadPlayerColor = new Color(0.75f, 0.75f, 0.75f); private static readonly Color FallbackPlayerColor = Color.cyan; private readonly Dictionary _players = new Dictionary(); private readonly List _stalePlayers = new List(); private Transform _boundOverlay; private Sprite _sprite; private float _scanTimer; private List _overrides; internal void DescribeInto(StringBuilder sb) { sb.AppendLine("--- Entity Markers ---"); List list = (((Object)(object)GameDirector.instance != (Object)null) ? GameDirector.instance.PlayerList : null); sb.AppendLine("GameDirector : " + (((Object)(object)GameDirector.instance != (Object)null) ? "あり" : "なし")); sb.AppendLine("プレイヤー総数 : " + ((list != null) ? list.Count.ToString() : "取得不可") + "(自分を含む)"); if (list != null) { int num = 0; foreach (PlayerAvatar item in list) { if ((Object)(object)item != (Object)null && (Object)(object)item != (Object)(object)PlayerAvatar.instance) { num++; } } sb.AppendLine($"自分以外 : {num}"); } sb.AppendLine($"作成済みマーカー: 味方={_players.Count}"); sb.AppendLine("差し替え登録数 : " + ((_overrides != null) ? _overrides.Count.ToString() : "未設定")); DescribeFirstMarker(sb, "味方", _players.Values); } private static void DescribeFirstMarker(StringBuilder sb, string label, IEnumerable markers) { //IL_00ba: 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_010b: Unknown result type (might be due to invalid IL or missing references) foreach (Marker marker in markers) { if (!((Object)(object)marker?.Object == (Object)null) && !((Object)(object)marker.Renderer == (Object)null)) { sb.AppendLine($" [{label}] active={marker.Object.activeSelf} renderer={((Renderer)marker.Renderer).enabled} " + "sprite=" + (((Object)(object)marker.Renderer.sprite != (Object)null) ? ((Object)marker.Renderer.sprite).name : "なし") + " " + $"color={marker.Renderer.color} layer={marker.Object.layer}"); sb.AppendLine($" pos={marker.Object.transform.position} scale={marker.Object.transform.localScale}"); return; } } sb.AppendLine(" [" + label + "] マーカーなし"); } internal void Tick(float deltaTime, bool showPlayers, bool playersOnFullMap, float scale, List overrides) { _overrides = overrides; Map instance = Map.Instance; if ((Object)(object)instance == (Object)null || (Object)(object)instance.CustomObject == (Object)null || (Object)(object)instance.OverLayerParent == (Object)null) { Clear(); return; } if ((Object)(object)_boundOverlay != (Object)(object)instance.OverLayerParent) { Clear(); _boundOverlay = instance.OverLayerParent; } if (!showPlayers) { ClearPlayers(); } _scanTimer -= deltaTime; if (_scanTimer <= 0f) { _scanTimer = 0.5f; if (showPlayers) { ScanPlayers(instance); } } UpdatePlayers(instance, scale); RefreshRendererList(playersOnFullMap); } internal void Clear() { foreach (Marker value in _players.Values) { Destroy(value); } _players.Clear(); _boundOverlay = null; } private void ClearPlayers() { if (_players.Count == 0) { return; } foreach (Marker value in _players.Values) { Destroy(value); } _players.Clear(); } private static void Destroy(Marker marker) { if ((Object)(object)marker?.Object != (Object)null) { Object.Destroy((Object)(object)marker.Object); } } private void ScanPlayers(Map map) { List list = (((Object)(object)GameDirector.instance != (Object)null) ? GameDirector.instance.PlayerList : null); if (list == null) { return; } foreach (PlayerAvatar item in list) { if (!((Object)(object)item == (Object)null) && !((Object)(object)item == (Object)(object)PlayerAvatar.instance) && !_players.ContainsKey(item)) { Marker marker = Create(map, "Player"); if (marker != null) { _players[item] = marker; } } } _stalePlayers.Clear(); foreach (KeyValuePair player in _players) { if ((Object)(object)player.Key == (Object)null || !list.Contains(player.Key)) { _stalePlayers.Add(player.Key); } } foreach (PlayerAvatar stalePlayer in _stalePlayers) { if (_players.TryGetValue(stalePlayer, out var value)) { Destroy(value); _players.Remove(stalePlayer); } } } private void UpdatePlayers(Map map, float scale) { //IL_0057: 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) foreach (KeyValuePair player in _players) { PlayerAvatar key = player.Key; Marker value = player.Value; if (!((Object)(object)key == (Object)null) && !((Object)(object)value.Object == (Object)null)) { bool flag = IsDisabled(key); value.Renderer.color = (flag ? DeadPlayerColor : ResolvePlayerColor(key)); Place(map, value, ((Component)key).transform, visible: true, scale); } } } private static void Place(Map map, Marker marker, Transform target, bool visible, float scale) { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //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) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) if (marker.Object.activeSelf != visible) { marker.Object.SetActive(visible); } if (visible && !((Object)(object)target == (Object)null)) { map.CustomPositionSet(marker.Object.transform, target); Vector3 val = Vector3.one * scale; if (marker.Object.transform.localScale != val) { marker.Object.transform.localScale = val; } } } private void RefreshRendererList(bool playersOnFullMap) { foreach (Marker value in _players.Values) { RegisterRenderer(value, playersOnFullMap); } } private void RegisterRenderer(Marker marker, bool showOnFullMap) { if (!((Object)(object)marker.Renderer == (Object)null)) { if (showOnFullMap) { ((Renderer)marker.Renderer).enabled = true; return; } ((Renderer)marker.Renderer).enabled = false; _overrides?.Add(new MinimapView.RendererOverride((Renderer)(object)marker.Renderer, enabled: true)); } } private Marker Create(Map map, string kind) { GameObject val = Object.Instantiate(map.CustomObject, map.OverLayerParent); ((Object)val).name = "RepoMapFix " + kind + " Marker"; MapCustomEntity component = val.GetComponent(); SpriteRenderer val2 = (((Object)(object)component != (Object)null) ? component.spriteRenderer : val.GetComponentInChildren()); if ((Object)(object)val2 == (Object)null) { Object.Destroy((Object)(object)val); return null; } if ((Object)(object)val2.sprite == (Object)null) { val2.sprite = GetSprite(); } if ((Object)(object)component != (Object)null) { Object.Destroy((Object)(object)component); } return new Marker { Object = val, Renderer = val2 }; } private Sprite GetSprite() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002b: 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_003a: Expected O, but got Unknown //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0113: 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_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_sprite != (Object)null) { return _sprite; } Texture2D val = new Texture2D(32, 32, (TextureFormat)4, false) { name = "RepoMapFix Marker", filterMode = (FilterMode)1, wrapMode = (TextureWrapMode)1 }; Color32 val2 = default(Color32); ((Color32)(ref val2))..ctor(byte.MaxValue, byte.MaxValue, byte.MaxValue, (byte)0); Color32 val3 = default(Color32); ((Color32)(ref val3))..ctor(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue); Vector2 val4 = default(Vector2); ((Vector2)(ref val4))..ctor(15.5f, 15.5f); float num = 15f; Color32[] array = (Color32[])(object)new Color32[1024]; for (int i = 0; i < 32; i++) { for (int j = 0; j < 32; j++) { float num2 = Vector2.Distance(new Vector2((float)j, (float)i), val4); array[i * 32 + j] = ((num2 <= num) ? val3 : val2); } } val.SetPixels32(array); val.Apply(false, true); _sprite = Sprite.Create(val, new Rect(0f, 0f, 32f, 32f), new Vector2(0.5f, 0.5f), 32f); ((Object)_sprite).name = "RepoMapFix Marker"; return _sprite; } private static bool IsDisabled(PlayerAvatar player) { bool flag = default(bool); int num; if (PlayerDisabledField != null) { object value = PlayerDisabledField.GetValue(player); if (value is bool) { flag = (bool)value; num = 1; } else { num = 0; } } else { num = 0; } return (byte)((uint)num & (flag ? 1u : 0u)) != 0; } private static Color ResolvePlayerColor(PlayerAvatar player) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: 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_00b9: Unknown result type (might be due to invalid IL or missing references) if (ColorsEquippedField == null || (Object)(object)player.playerCosmetics == (Object)null || (Object)(object)MetaManager.instance == (Object)null || MetaManager.instance.colors == null) { return FallbackPlayerColor; } if (!(ColorsEquippedField.GetValue(player.playerCosmetics) is int[] array) || array.Length <= 5) { return FallbackPlayerColor; } int num = array[5]; if (num < 0 || num >= MetaManager.instance.colors.Count || (Object)(object)MetaManager.instance.colors[num] == (Object)null) { return FallbackPlayerColor; } Color color = MetaManager.instance.colors[num].color; color.a = 1f; return color; } } internal sealed class ExtractionColors { private sealed class Painted { internal Renderer Renderer; internal Color Color; internal Color Emission; internal bool HasEmission; } private const float RefreshIntervalSeconds = 1f; private static readonly FieldInfo MapObjectField = AccessTools.Field(typeof(DirtFinderMapFloor), "MapObject"); private readonly List _painted = new List(); private float _timer; internal void Tick(float deltaTime, bool enabled, PaletteColor inactiveChoice, PaletteColor activeChoice, PaletteColor usedChoice) { //IL_008b: 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_00ae: Unknown result type (might be due to invalid IL or missing references) if (!enabled || (Object)(object)Map.Instance == (Object)null) { Restore(); return; } _timer -= deltaTime; if (_timer > 0f) { return; } _timer = 1f; Color color; bool flag = MapPalette.TryResolve(inactiveChoice, out color); Color color2; bool flag2 = MapPalette.TryResolve(activeChoice, out color2); Color color3; bool flag3 = MapPalette.TryResolve(usedChoice, out color3); if (!flag && !flag2 && !flag3) { Restore(); return; } ExtractionPoint[] array = Object.FindObjectsOfType(); foreach (ExtractionPoint val in array) { if (flag) { Paint(val.mapInactive, color); } if (flag2) { Paint(val.mapActive, color2); } if (flag3) { Paint(val.mapUsed, color3); } } } internal void Restore() { //IL_005b: 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) if (_painted.Count == 0) { return; } foreach (Painted item in _painted) { if ((Object)(object)item.Renderer == (Object)null) { continue; } Material material = item.Renderer.material; if (!((Object)(object)material == (Object)null)) { if (material.HasProperty("_Color")) { material.SetColor("_Color", item.Color); } if (item.HasEmission && material.HasProperty("_EmissionColor")) { material.SetColor("_EmissionColor", item.Emission); } } } _painted.Clear(); } private void Paint(DirtFinderMapFloor[] floors, Color color) { //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) if (floors == null || MapObjectField == null) { return; } foreach (DirtFinderMapFloor val in floors) { if ((Object)(object)val == (Object)null) { continue; } object? value = MapObjectField.GetValue(val); MapObject val2 = (MapObject)((value is MapObject) ? value : null); if (val2 == null || (Object)(object)val2 == (Object)null) { continue; } Renderer[] componentsInChildren = ((Component)val2).GetComponentsInChildren(true); foreach (Renderer val3 in componentsInChildren) { Material material = val3.material; if (!((Object)(object)material == (Object)null) && material.HasProperty("_Color")) { Remember(val3, material); if (material.GetColor("_Color") != color) { material.SetColor("_Color", color); } if (material.HasProperty("_EmissionColor")) { material.SetColor("_EmissionColor", color); } } } } } private void Remember(Renderer renderer, Material material) { //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: 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_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0078: 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) foreach (Painted item in _painted) { if ((Object)(object)item.Renderer == (Object)(object)renderer) { return; } } bool flag = material.HasProperty("_EmissionColor"); _painted.Add(new Painted { Renderer = renderer, Color = material.GetColor("_Color"), Emission = (Color)(flag ? material.GetColor("_EmissionColor") : default(Color)), HasEmission = flag }); } } internal sealed class ExtractionMarkers { private sealed class Marker { internal GameObject Root; internal SpriteRenderer Icon; internal readonly SpriteRenderer[] Ripples = (SpriteRenderer[])(object)new SpriteRenderer[2]; } private const float SettleSeconds = 3f; private const int RippleCount = 2; private const float RippleSeconds = 2f; private static readonly FieldInfo StateField = AccessTools.Field(typeof(ExtractionPoint), "currentState"); private readonly Dictionary _markers = new Dictionary(); private readonly List _stale = new List(); private Transform _boundOverlay; private Sprite _sprite; private Sprite _ringSprite; private float _scanTimer; private float _settle; private float _time; private static bool _missingStateFieldWarned; internal int Count => _markers.Count; internal void Tick(float deltaTime, bool enabled, float scale, PaletteColor inactiveChoice, PaletteColor activeChoice, PaletteColor usedChoice, bool rippleEnabled, float rippleScale) { Map instance = Map.Instance; if (!enabled || (Object)(object)instance == (Object)null || (Object)(object)instance.OverLayerParent == (Object)null) { Clear(); return; } if ((Object)(object)_boundOverlay != (Object)(object)instance.OverLayerParent) { Clear(); _boundOverlay = instance.OverLayerParent; } if ((Object)(object)LevelGenerator.Instance == (Object)null || !LevelGenerator.Instance.Generated) { _settle = 0f; return; } if (_settle < 3f) { _settle += deltaTime; return; } _time += deltaTime; _scanTimer -= deltaTime; if (_scanTimer <= 0f) { _scanTimer = 1f; Scan(instance); } Apply(scale, inactiveChoice, activeChoice, usedChoice, rippleEnabled, rippleScale); } internal void Clear() { foreach (Marker value in _markers.Values) { if ((Object)(object)value.Root != (Object)null) { Object.Destroy((Object)(object)value.Root); } } _markers.Clear(); _boundOverlay = null; _settle = 0f; } private void Scan(Map map) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) ExtractionPoint[] array = Object.FindObjectsOfType(); foreach (ExtractionPoint val in array) { if (!((Object)(object)val == (Object)null) && !_markers.ContainsKey(val) && IsDiscovered(map, val)) { _markers[val] = Create(map, ((Component)val).transform.position); } } _stale.Clear(); foreach (KeyValuePair marker in _markers) { if ((Object)(object)marker.Key == (Object)null || (Object)(object)marker.Value.Root == (Object)null) { _stale.Add(marker.Key); } } foreach (ExtractionPoint item in _stale) { if ((Object)(object)item != (Object)null && _markers.TryGetValue(item, out var value) && (Object)(object)value.Root != (Object)null) { Object.Destroy((Object)(object)value.Root); } _markers.Remove(item); } } private static bool IsDiscovered(Map map, ExtractionPoint point) { Module componentInParent = ((Component)point).GetComponentInParent(); if ((Object)(object)componentInParent == (Object)null || map.MapModules == null) { return true; } foreach (MapModule mapModule in map.MapModules) { if ((Object)(object)mapModule != (Object)null && (Object)(object)mapModule.module == (Object)(object)componentInParent) { return false; } } return true; } private void Apply(float scale, PaletteColor inactiveChoice, PaletteColor activeChoice, PaletteColor usedChoice, bool rippleEnabled, float rippleScale) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: 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) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Invalid comparison between Unknown and I4 //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: 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) Vector3 val = Vector3.one * scale; foreach (KeyValuePair marker in _markers) { ExtractionPoint key = marker.Key; Marker value = marker.Value; if (!((Object)(object)key == (Object)null) && !((Object)(object)value.Root == (Object)null) && !((Object)(object)value.Icon == (Object)null)) { if (((Component)value.Icon).transform.localScale != val) { ((Component)value.Icon).transform.localScale = val; } State val2 = ResolveState(key); Color color; bool flag = MapPalette.TryResolve(ResolveChoice(val2, inactiveChoice, activeChoice, usedChoice), out color); if (flag && value.Icon.color != color) { value.Icon.color = color; } bool show = rippleEnabled && (int)val2 == 2; ApplyRipples(value, show, scale, rippleScale, flag ? color : Color.white); } } } private void ApplyRipples(Marker marker, bool show, float baseScale, float rippleScale, Color color) { //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0082: 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_008f: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < marker.Ripples.Length; i++) { SpriteRenderer val = marker.Ripples[i]; if (!((Object)(object)val == (Object)null)) { if (((Renderer)val).enabled != show) { ((Renderer)val).enabled = show; } if (show) { float num = Mathf.Repeat(_time / 2f + (float)i / (float)marker.Ripples.Length, 1f); float a = (1f - num) * 0.55f; float num2 = Mathf.Lerp(baseScale, baseScale * rippleScale, num); ((Component)val).transform.localScale = Vector3.one * num2; Color color2 = color; color2.a = a; val.color = color2; } } } } private static State ResolveState(ExtractionPoint point) { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: 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) if (StateField == null) { if (!_missingStateFieldWarned) { _missingStateFieldWarned = true; ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)"納品場所の状態を読み取れません(currentStateが見つかりません)。ゲームの更新で内部の作りが変わった可能性があります。全ての納品場所が起動中として表示されます。"); } } return (State)2; } object value = StateField.GetValue(point); if (value is State) { return (State)value; } return (State)2; } private static PaletteColor ResolveChoice(State state, PaletteColor inactiveChoice, PaletteColor activeChoice, PaletteColor usedChoice) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Invalid comparison between Unknown and I4 //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Invalid comparison between Unknown and I4 if ((int)state != 1) { if ((int)state == 7) { return usedChoice; } return activeChoice; } return inactiveChoice; } private Marker Create(Map map, Vector3 worldPosition) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004b: 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_0066: 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_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_0137: 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_0148: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("RepoMapFix Extraction Marker"); val.transform.SetParent(map.OverLayerParent, false); val.layer = ((Component)map.OverLayerParent).gameObject.layer; val.transform.position = worldPosition * map.Scale + map.OverLayerParent.position; val.transform.localPosition = new Vector3(val.transform.localPosition.x, 0f, val.transform.localPosition.z); val.transform.rotation = Quaternion.Euler(90f, 0f, 0f); Marker marker = new Marker { Root = val }; for (int i = 0; i < marker.Ripples.Length; i++) { GameObject val2 = new GameObject($"Ripple {i + 1}") { layer = val.layer }; val2.transform.SetParent(val.transform, false); SpriteRenderer val3 = val2.AddComponent(); val3.sprite = GetRingSprite(); ((Renderer)val3).sortingOrder = 94; ((Renderer)val3).enabled = false; marker.Ripples[i] = val3; } GameObject val4 = new GameObject("Icon") { layer = val.layer }; val4.transform.SetParent(val.transform, false); SpriteRenderer val5 = val4.AddComponent(); val5.sprite = GetSprite(); ((Renderer)val5).sortingOrder = 95; marker.Icon = val5; return marker; } private Sprite GetSprite() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002b: 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_003a: Expected O, but got Unknown //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: 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) if ((Object)(object)_sprite != (Object)null) { return _sprite; } Texture2D val = new Texture2D(32, 32, (TextureFormat)4, false) { name = "RepoMapFix Extraction", filterMode = (FilterMode)1, wrapMode = (TextureWrapMode)1 }; Color32[] array = (Color32[])(object)new Color32[1024]; for (int i = 0; i < 32; i++) { for (int j = 0; j < 32; j++) { float num = Mathf.Abs(((float)j + 0.5f) / 32f - 0.5f) * 2f; float num2 = Mathf.Abs(((float)i + 0.5f) / 32f - 0.5f) * 2f; float num3 = Mathf.Max(num, num2); float num4 = Mathf.Clamp01((0.92f - num3) / 0.08f); array[i * 32 + j] = new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, (byte)(num4 * 255f)); } } val.SetPixels32(array); val.Apply(false, true); _sprite = Sprite.Create(val, new Rect(0f, 0f, 32f, 32f), new Vector2(0.5f, 0.5f), 32f); ((Object)_sprite).name = "RepoMapFix Extraction"; return _sprite; } private Sprite GetRingSprite() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002b: 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_003a: Expected O, but got Unknown //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_ringSprite != (Object)null) { return _ringSprite; } Texture2D val = new Texture2D(64, 64, (TextureFormat)4, false) { name = "RepoMapFix Extraction Ripple", filterMode = (FilterMode)1, wrapMode = (TextureWrapMode)1 }; Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(31.5f, 31.5f); float num = 32f; Color32[] array = (Color32[])(object)new Color32[4096]; for (int i = 0; i < 64; i++) { for (int j = 0; j < 64; j++) { float num2 = Vector2.Distance(new Vector2((float)j, (float)i), val2) / num; float num3 = 1f - Mathf.Abs(num2 - 0.85f) / 0.15f; float num4 = ((num2 > 1f) ? 0f : Mathf.Clamp01(num3)); array[i * 64 + j] = new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, (byte)(num4 * 255f)); } } val.SetPixels32(array); val.Apply(false, true); _ringSprite = Sprite.Create(val, new Rect(0f, 0f, 64f, 64f), new Vector2(0.5f, 0.5f), 64f); ((Object)_ringSprite).name = "RepoMapFix Extraction Ripple"; return _ringSprite; } } internal sealed class FullMapView { private static readonly Quaternion LookDown = Quaternion.Euler(90f, 0f, 0f); private static readonly Quaternion PlayerGraphicDefault = Quaternion.Euler(90f, 0f, 0f); private const float MapFitMargin = 1.1f; private const float BackdropMargin = 1.6f; private Camera _camera; private float _vanillaZoom = -1f; private bool _zoomApplied; private bool _northApplied; private Vector3 _cameraLocalPosition; private bool _cameraMoved; private readonly List _backdrop = new List(); private readonly List _backdropScales = new List(); private readonly List _backdropPositions = new List(); private readonly List _backdropSizes = new List(); private float _lastRequiredSize; private float _lastFactor; internal void Tick(bool northFixed, bool centerOnMap, bool overrideZoom, float zoom, int resolution, int antiAliasing) { if ((Object)(object)Map.Instance == (Object)null) { Forget(); return; } ResolveCamera(); CollectBackdrop(); ApplyNorthFix(northFixed); ApplyBackdropScale(ApplyView(centerOnMap, overrideZoom, zoom)); ApplyQuality(resolution, antiAliasing); } internal void Forget() { _camera = null; _vanillaZoom = -1f; _zoomApplied = false; _northApplied = false; _cameraMoved = false; _backdrop.Clear(); _backdropScales.Clear(); _backdropPositions.Clear(); _backdropSizes.Clear(); } private void ResolveCamera() { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_camera != (Object)null) { return; } Camera[] array = Object.FindObjectsOfType(true); foreach (Camera val in array) { if (((Object)val).name == "Dirt Finder Map Camera") { _camera = val; _vanillaZoom = val.orthographicSize; _cameraLocalPosition = ((Component)val).transform.localPosition; break; } } } private void CollectBackdrop() { //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Expected O, but got Unknown //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) if (_backdrop.Count > 0 && (Object)(object)_backdrop[0] != (Object)null) { return; } _backdrop.Clear(); _backdropScales.Clear(); _backdropPositions.Clear(); _backdropSizes.Clear(); DirtFinderMapPlayer instance = DirtFinderMapPlayer.Instance; if ((Object)(object)instance == (Object)null) { return; } foreach (Transform item in ((Component)instance).transform) { Transform val = item; if (!(((Object)val).name != "Background") || !(((Object)val).name != "Fog") || !(((Object)val).name != "Scanlines")) { _backdrop.Add(val); _backdropScales.Add(val.localScale); _backdropPositions.Add(val.localPosition); Quaternion rotation = val.rotation; val.rotation = Quaternion.identity; _backdropSizes.Add(MeasureSize(val)); val.rotation = rotation; } } } private float ApplyView(bool centerOnMap, bool overrideZoom, float zoom) { //IL_00b0: 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_0034: 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_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0054: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_camera == (Object)null) { return _vanillaZoom; } if (centerOnMap && MapBounds.TryGet(out var bounds)) { Vector3 position = ((Component)_camera).transform.position; ((Component)_camera).transform.position = new Vector3(((Bounds)(ref bounds)).center.x, position.y, ((Bounds)(ref bounds)).center.z); _cameraMoved = true; float num = Mathf.Max(((Bounds)(ref bounds)).extents.x, ((Bounds)(ref bounds)).extents.z) * 1.1f; SetZoom(num); return num; } if (_cameraMoved) { ((Component)_camera).transform.localPosition = _cameraLocalPosition; _cameraMoved = false; } if (overrideZoom) { SetZoom(zoom); return zoom; } if (_zoomApplied && _vanillaZoom > 0f) { _camera.orthographicSize = _vanillaZoom; _zoomApplied = false; } return _vanillaZoom; } private void SetZoom(float zoom) { if (_camera.orthographicSize != zoom) { _camera.orthographicSize = zoom; } _zoomApplied = true; } private void ApplyNorthFix(bool northFixed) { //IL_0059: 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_0061: 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) //IL_0089: 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_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: 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_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: 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) DirtFinderMapPlayer instance = DirtFinderMapPlayer.Instance; if ((Object)(object)instance == (Object)null) { return; } if (!northFixed) { if (_northApplied) { _northApplied = false; ((Component)instance).transform.rotation = GetPlayerRotation(); if ((Object)(object)Map.Instance.PlayerGraphicTransform != (Object)null) { Map.Instance.PlayerGraphicTransform.localRotation = PlayerGraphicDefault; } } return; } Quaternion playerRotation = GetPlayerRotation(); float y = ((Quaternion)(ref playerRotation)).eulerAngles.y; if (((Component)instance).transform.rotation != Quaternion.identity) { ((Component)instance).transform.rotation = Quaternion.identity; } Transform playerGraphicTransform = Map.Instance.PlayerGraphicTransform; if ((Object)(object)playerGraphicTransform != (Object)null) { Quaternion val = Quaternion.Euler(0f, y, 0f) * LookDown; if (playerGraphicTransform.localRotation != val) { playerGraphicTransform.localRotation = val; } } MapModule[] array = Object.FindObjectsOfType(); for (int i = 0; i < array.Length; i++) { Transform graphic = array[i].graphic; if ((Object)(object)graphic != (Object)null && graphic.rotation != LookDown) { graphic.rotation = LookDown; } } _northApplied = true; } private void ApplyBackdropScale(float zoom) { //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_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0112: 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_00cf: 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_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: 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_00f2: 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_0126: Unknown result type (might be due to invalid IL or missing references) if (_backdrop.Count == 0 || zoom <= 0f) { return; } float num = (_lastRequiredSize = zoom * 2f * 1.6f); Vector3 val3 = default(Vector3); for (int i = 0; i < _backdrop.Count; i++) { Transform val = _backdrop[i]; float num2 = _backdropSizes[i]; if (!((Object)(object)val == (Object)null) && !(num2 <= 0.0001f)) { float num3 = (_lastFactor = Mathf.Max(1f, num / num2)); Vector3 val2 = _backdropScales[i]; ((Vector3)(ref val3))..ctor(val2.x * num3, val2.y, val2.z * num3); if (val.localScale != val3) { val.localScale = val3; } if (_cameraMoved) { Vector3 position = val.position; Vector3 position2 = ((Component)_camera).transform.position; val.position = new Vector3(position2.x, position.y, position2.z); } else if (val.localPosition != _backdropPositions[i]) { val.localPosition = _backdropPositions[i]; } } } } internal void DescribeInto(StringBuilder sb) { //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) sb.AppendLine("--- Tabマップ ---"); if ((Object)(object)_camera == (Object)null) { sb.AppendLine("カメラ : 未検出"); return; } sb.AppendLine($"本来の拡大率 : {_vanillaZoom:F2}"); sb.AppendLine($"現在の拡大率 : {_camera.orthographicSize:F2}"); sb.AppendLine($"カメラ位置 : {((Component)_camera).transform.position}(中心へ移動={_cameraMoved})"); sb.AppendLine($"視界の広さ : {_camera.orthographicSize * 2f:F2}"); sb.AppendLine($"背景の必要広さ: {_lastRequiredSize:F2}(余白{1.6f}倍込み)"); sb.AppendLine($"背景の倍率 : {_lastFactor:F2}"); for (int i = 0; i < _backdrop.Count; i++) { Transform val = _backdrop[i]; if ((Object)(object)val == (Object)null) { sb.AppendLine($" [{i}] 失われた参照"); continue; } sb.AppendLine($" [{((Object)val).name}] 本来の広さ={_backdropSizes[i]:F2} 現在の広さ={MeasureSize(val):F2}"); sb.AppendLine($" 位置={val.position} 大きさ={val.localScale}"); } } private void ApplyQuality(int resolution, int antiAliasing) { if (!((Object)(object)_camera == (Object)null)) { RenderTexture targetTexture = _camera.targetTexture; if (!((Object)(object)targetTexture == (Object)null) && (((Texture)targetTexture).width != resolution || ((Texture)targetTexture).height != resolution || targetTexture.antiAliasing != antiAliasing)) { targetTexture.Release(); ((Texture)targetTexture).width = resolution; ((Texture)targetTexture).height = resolution; targetTexture.antiAliasing = antiAliasing; targetTexture.Create(); } } } private static float MeasureSize(Transform target) { //IL_0004: 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_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_004d: 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) bool flag = false; Bounds val = default(Bounds); Renderer[] componentsInChildren = ((Component)target).GetComponentsInChildren(true); foreach (Renderer val2 in componentsInChildren) { if (!flag) { val = val2.bounds; flag = true; } else { ((Bounds)(ref val)).Encapsulate(val2.bounds); } } if (!flag) { return 0f; } return Mathf.Max(((Bounds)(ref val)).size.x, ((Bounds)(ref val)).size.z); } private static Quaternion GetPlayerRotation() { //IL_002b: 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) Transform val = (((Object)(object)Map.Instance != (Object)null) ? Map.Instance.playerTransformSource : null); if (!((Object)(object)val != (Object)null)) { return Quaternion.identity; } return val.rotation; } } internal sealed class HudShift { private sealed class Target { internal SemiUI Ui; internal Vector2 Origin; internal bool IsLeft; } private readonly List _targets = new List(); internal void Apply(bool shiftRight, bool shiftLeft, float rightOffset, float leftOffset) { //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) Track((SemiUI)(object)HaulUI.instance, isLeft: false); Track((SemiUI)(object)GoalUI.instance, isLeft: false); Track((SemiUI)(object)HealthUI.instance, isLeft: true); Track((SemiUI)(object)EnergyUI.instance, isLeft: true); Vector2 val = default(Vector2); foreach (Target target in _targets) { if (!((Object)(object)target.Ui == (Object)null)) { bool flag = (target.IsLeft ? shiftLeft : shiftRight); float num = (target.IsLeft ? leftOffset : rightOffset); ((Vector2)(ref val))..ctor(target.Origin.x, target.Origin.y + (flag ? (0f - num) : 0f)); if (target.Ui.showPosition != val) { target.Ui.showPosition = val; } } } } internal void Forget() { _targets.Clear(); } private void Track(SemiUI ui, bool isLeft) { //IL_0092: 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) if ((Object)(object)ui == (Object)null) { return; } foreach (Target target in _targets) { if ((Object)(object)target.Ui == (Object)(object)ui) { return; } if (target.IsLeft == isLeft && (Object)(object)target.Ui == (Object)null) { _targets.Remove(target); break; } } if (!((Object)(object)ui.textRectTransform == (Object)null)) { _targets.Add(new Target { Ui = ui, Origin = ui.showPosition, IsLeft = isLeft }); } } } internal sealed class LogMirror : ILogListener, IDisposable { private const string DevelopmentFolder = "C:\\repo_mod\\logs"; private const int KeepFiles = 15; private StreamWriter _writer; internal string Path { get; private set; } public LogLevel LogLevelFilter => (LogLevel)63; internal bool Start(string configuredFolder) { try { string text = ResolveFolder(configuredFolder); Directory.CreateDirectory(text); Path = System.IO.Path.Combine(text, $"MiniMapAndMapPlus-{DateTime.Now:yyyyMMdd-HHmmss}.log"); _writer = new StreamWriter(new FileStream(Path, FileMode.Create, FileAccess.Write, FileShare.ReadWrite)) { AutoFlush = true }; _writer.WriteLine(string.Format("=== {0} {1} / {2:yyyy-MM-dd HH:mm:ss} ===", "Mini Map & Map+", "3.18.0", DateTime.Now)); Prune(text); Logger.Listeners.Add((ILogListener)(object)this); return true; } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("ログの書き写しを始められませんでした: " + ex.Message)); } _writer = null; return false; } } private static string ResolveFolder(string configuredFolder) { if (!string.IsNullOrEmpty(configuredFolder)) { return configuredFolder; } string text = Directory.GetParent("C:\\repo_mod\\logs")?.FullName; if (!string.IsNullOrEmpty(text) && Directory.Exists(text)) { return "C:\\repo_mod\\logs"; } return System.IO.Path.Combine(Paths.BepInExRootPath, "MiniMapAndMapPlus-logs"); } private static void Prune(string folder) { try { List list = new List(new DirectoryInfo(folder).GetFiles("MiniMapAndMapPlus-*.log")); if (list.Count > 15) { list.Sort((FileInfo a, FileInfo b) => b.LastWriteTimeUtc.CompareTo(a.LastWriteTimeUtc)); for (int num = 15; num < list.Count; num++) { list[num].Delete(); } } } catch (Exception) { } } public void LogEvent(object sender, LogEventArgs eventArgs) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) StreamWriter writer = _writer; if (writer == null) { return; } try { writer.WriteLine($"{DateTime.Now:HH:mm:ss.fff} [{eventArgs.Level,-7}:{eventArgs.Source.SourceName}] {eventArgs.Data}"); } catch (Exception) { _writer = null; } } internal void Mark(string reason) { StreamWriter writer = _writer; if (writer == null) { return; } try { writer.WriteLine($"--- {DateTime.Now:HH:mm:ss.fff} {reason} ---"); writer.WriteLine(Environment.StackTrace); } catch (Exception) { _writer = null; } } public void Dispose() { try { Logger.Listeners.Remove((ILogListener)(object)this); } catch (Exception) { } StreamWriter writer = _writer; _writer = null; try { writer?.Dispose(); } catch (Exception) { } } } internal static class MapBounds { private const float RefreshSeconds = 1f; private static Bounds _bounds; private static bool _has; private static float _nextRefresh; internal static void Forget() { _has = false; _nextRefresh = 0f; } internal static bool TryGet(out Bounds bounds) { //IL_0052: 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_0033: 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_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: 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_0097: Unknown result type (might be due to invalid IL or missing references) if (_has && Time.time < _nextRefresh) { bounds = _bounds; return true; } if ((Object)(object)Map.Instance == (Object)null) { bounds = _bounds; return _has; } _nextRefresh = Time.time + 1f; bool flag = false; Bounds bounds2 = default(Bounds); Renderer[] componentsInChildren = ((Component)Map.Instance).GetComponentsInChildren(); foreach (Renderer val in componentsInChildren) { if (!flag) { bounds2 = val.bounds; flag = true; } else { ((Bounds)(ref bounds2)).Encapsulate(val.bounds); } } if (flag) { _bounds = bounds2; _has = true; } bounds = _bounds; return _has; } } internal enum PaletteColor { 標準のまま, 黄色, 水色, 赤, オレンジ, 緑, 青, 紫, ピンク, 白, 灰色, 黒 } internal static class MapPalette { internal static bool TryResolve(PaletteColor choice, out Color color) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: 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_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: 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_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0118: 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_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_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_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) color = default(Color); switch (choice) { case PaletteColor.標準のまま: return false; case PaletteColor.黄色: color = new Color(1f, 0.83f, 0f); return true; case PaletteColor.水色: color = new Color(0f, 0.8f, 0.85f); return true; case PaletteColor.赤: color = new Color(0.85f, 0.09f, 0.09f); return true; case PaletteColor.オレンジ: color = new Color(1f, 0.5f, 0f); return true; case PaletteColor.緑: color = new Color(0.13f, 0.8f, 0.2f); return true; case PaletteColor.青: color = new Color(0.16f, 0.4f, 1f); return true; case PaletteColor.紫: color = new Color(0.65f, 0.3f, 0.95f); return true; case PaletteColor.ピンク: color = new Color(1f, 0.35f, 0.65f); return true; case PaletteColor.白: color = Color.white; return true; case PaletteColor.灰色: color = new Color(0.45f, 0.45f, 0.45f); return true; case PaletteColor.黒: color = new Color(0.05f, 0.05f, 0.05f); return true; default: return false; } } } internal sealed class MinimapView { internal readonly struct RendererOverride { internal readonly Renderer Renderer; internal readonly bool Enabled; internal RendererOverride(Renderer renderer, bool enabled) { Renderer = renderer; Enabled = enabled; } } internal readonly struct ScaleOverride { internal readonly Transform Transform; internal readonly Vector3 Scale; internal ScaleOverride(Transform transform, Vector3 scale) { //IL_0008: 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) Transform = transform; Scale = scale; } } internal readonly struct ColorOverride { internal readonly SpriteRenderer Renderer; internal readonly Color Color; internal ColorOverride(SpriteRenderer renderer, Color color) { //IL_0008: 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) Renderer = renderer; Color = color; } } private const string RigName = "RepoMapFix Minimap Rig"; private const float MapFitMargin = 1.1f; private const float BackdropMargin = 1.8f; private static readonly Quaternion LookDown = Quaternion.Euler(90f, 0f, 0f); private Transform _rig; private Camera _camera; private Color? _backdropColor; private RenderTexture _texture; private readonly List _sharedBackdrop = new List(); private readonly List _swappedModules = new List(); private readonly List _swappedRotations = new List(); private bool _northFixed = true; private float _appliedZoom = -1f; private int _appliedResolution; private int _appliedAntiAliasing; private readonly List _moduleCache = new List(); private float _moduleCacheTimer; private Bounds _bounds; private bool _hasBounds; private readonly List _ownBackdrop = new List(); private readonly List _ownBackdropScales = new List(); private readonly List _ownBackdropSizes = new List(); private readonly List _swappedRenderers = new List(); private readonly List _originalEnabled = new List(); private readonly List _swappedScales = new List(); private readonly List _originalScales = new List(); private readonly List _recoloredRenderers = new List(); private readonly List _originalColors = new List(); internal RenderTexture Texture => _texture; internal bool IsReady { get { if ((Object)(object)_camera != (Object)null) { return (Object)(object)_texture != (Object)null; } return false; } } internal Camera Camera => _camera; internal List RendererOverrides { get; set; } internal List ScaleOverrides { get; set; } internal List ColorOverrides { get; set; } internal List UprightTransforms { get; set; } internal void DescribeFitInto(StringBuilder sb) { //IL_002d: 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_006f: 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_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) sb.AppendLine("--- Map Fit ---"); if (!_hasBounds) { sb.AppendLine("地図の広がり : 未計測"); return; } sb.AppendLine($"中心 : {((Bounds)(ref _bounds)).center}"); sb.AppendLine($"大きさ : {((Bounds)(ref _bounds)).size}"); sb.AppendLine($"半径(X,Z) : {((Bounds)(ref _bounds)).extents.x:F2}, {((Bounds)(ref _bounds)).extents.z:F2}"); sb.AppendLine($"適用ズーム : {_appliedZoom:F2}(必要値の{1.1f}倍)"); if ((Object)(object)_rig != (Object)null) { sb.AppendLine($"カメラ中心 : {_rig.position}"); sb.AppendLine($"中心とのズレ : X={_rig.position.x - ((Bounds)(ref _bounds)).center.x:F2} Z={_rig.position.z - ((Bounds)(ref _bounds)).center.z:F2}"); } } internal MinimapView() { //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Expected O, but got Unknown //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Expected O, but got Unknown //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Expected O, but got Unknown //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Expected O, but got Unknown Camera.onPreCull = (CameraCallback)Delegate.Combine((Delegate?)(object)Camera.onPreCull, (Delegate?)new CameraCallback(HandlePreCull)); Camera.onPostRender = (CameraCallback)Delegate.Combine((Delegate?)(object)Camera.onPostRender, (Delegate?)new CameraCallback(HandlePostRender)); } internal void Dispose() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected O, but got Unknown Camera.onPreCull = (CameraCallback)Delegate.Remove((Delegate?)(object)Camera.onPreCull, (Delegate?)new CameraCallback(HandlePreCull)); Camera.onPostRender = (CameraCallback)Delegate.Remove((Delegate?)(object)Camera.onPostRender, (Delegate?)new CameraCallback(HandlePostRender)); Teardown(); } internal void Teardown() { RestoreSharedState(); if ((Object)(object)_rig != (Object)null) { Object.Destroy((Object)(object)((Component)_rig).gameObject); } if ((Object)(object)_texture != (Object)null) { _texture.Release(); Object.Destroy((Object)(object)_texture); } _rig = null; _camera = null; _texture = null; ResetAppliedState(); } private void ResetAppliedState() { _sharedBackdrop.Clear(); _ownBackdrop.Clear(); _ownBackdropScales.Clear(); _ownBackdropSizes.Clear(); _backdropColor = null; _hasBounds = false; _swappedModules.Clear(); _swappedRotations.Clear(); _appliedZoom = -1f; _appliedResolution = 0; _appliedAntiAliasing = 0; _moduleCache.Clear(); _moduleCacheTimer = 0f; } internal void Tick(float zoom, int resolution, int antiAliasing, bool centerOnMap, bool northFixed) { //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0111: 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) //IL_00bb: 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_00d1: 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_00ea: Unknown result type (might be due to invalid IL or missing references) DirtFinderMapPlayer instance = DirtFinderMapPlayer.Instance; if ((Object)(object)Map.Instance == (Object)null || (Object)(object)instance == (Object)null) { return; } if ((Object)(object)_rig == (Object)null || (Object)(object)_camera == (Object)null) { Teardown(); Build(instance); if ((Object)(object)_rig == (Object)null) { return; } } ApplyTexture(resolution, antiAliasing); _northFixed = northFixed; _rig.rotation = (northFixed ? Quaternion.identity : Quaternion.Euler(0f, GetPlayerYaw(), 0f)); RefreshModuleCache(); if (centerOnMap && TryGetMapBounds(out var bounds)) { _rig.position = new Vector3(((Bounds)(ref bounds)).center.x, ((Component)instance).transform.position.y, ((Bounds)(ref bounds)).center.z); ApplyZoom(Mathf.Max(((Bounds)(ref bounds)).extents.x, ((Bounds)(ref bounds)).extents.z) * 1.1f); } else { _rig.position = ((Component)instance).transform.position; ApplyZoom(zoom); } } private static float GetPlayerYaw() { //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) //IL_0033: Unknown result type (might be due to invalid IL or missing references) Transform val = (((Object)(object)Map.Instance != (Object)null) ? Map.Instance.playerTransformSource : null); if (!((Object)(object)val != (Object)null)) { return 0f; } Quaternion rotation = val.rotation; return ((Quaternion)(ref rotation)).eulerAngles.y; } private void RefreshModuleCache() { _moduleCacheTimer -= Time.deltaTime; if (!(_moduleCacheTimer > 0f)) { _moduleCacheTimer = 2f; _moduleCache.Clear(); _moduleCache.AddRange(Object.FindObjectsOfType()); } } private bool TryGetMapBounds(out Bounds bounds) { //IL_000b: 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) bool num = MapBounds.TryGet(out bounds); if (num) { _bounds = bounds; _hasBounds = true; } return num; } private void Build(DirtFinderMapPlayer mapPlayer) { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Expected O, but got Unknown //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Expected O, but got Unknown //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) Camera val = FindMapCamera(); if (!((Object)(object)val == (Object)null)) { Transform val2 = (((Object)(object)((Component)Map.Instance).transform.parent != (Object)null) ? ((Component)Map.Instance).transform.parent : ((Component)Map.Instance).transform); GameObject val3 = new GameObject("RepoMapFix Minimap Rig"); val3.transform.SetParent(val2, false); _rig = val3.transform; GameObject val4 = new GameObject("Minimap Camera"); val4.transform.SetParent(_rig, false); val4.transform.localPosition = new Vector3(0f, ((Component)val).transform.localPosition.y, 0f); _camera = val4.AddComponent(); _camera.CopyFrom(val); val4.transform.localRotation = LookDown; _camera.targetTexture = null; _camera.rect = new Rect(0f, 0f, 1f, 1f); CollectSharedBackdrop(mapPlayer); _camera.clearFlags = (CameraClearFlags)2; _camera.backgroundColor = (Color)(((??)_backdropColor) ?? Color.black); ManualLogSource log = Plugin.Log; if (log != null) { log.LogInfo((object)($"ミニマップカメラを作成: 元カメラのrect={val.rect} aspect={val.aspect} " + $"元カメラの背景色={val.backgroundColor}(未使用) " + $"板から取得した色={_backdropColor} / " + $"背景の描画物={_sharedBackdrop.Count}件(複製{_ownBackdrop.Count}件)")); } } } private void CollectSharedBackdrop(DirtFinderMapPlayer mapPlayer) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown //IL_00a1: 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) //IL_00c2: 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) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0126: 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_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0178: 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_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) foreach (Transform item in ((Component)mapPlayer).transform) { Transform val = item; if (((Object)val).name != "Background" && ((Object)val).name != "Fog" && ((Object)val).name != "Scanlines") { continue; } _sharedBackdrop.AddRange(((Component)val).GetComponentsInChildren(true)); if (((Object)val).name != "Background") { continue; } GameObject val2 = Object.Instantiate(((Component)val).gameObject, _rig); ((Object)val2).name = "Minimap Background"; val2.transform.localPosition = val.localPosition; val2.transform.localScale = val.localScale; val2.transform.rotation = Quaternion.identity; Renderer[] componentsInChildren = val2.GetComponentsInChildren(true); foreach (Renderer val3 in componentsInChildren) { val3.enabled = false; Bounds bounds = val3.bounds; Vector3 size = ((Bounds)(ref bounds)).size; _ownBackdrop.Add(val3); _ownBackdropScales.Add(((Component)val3).transform.localScale); _ownBackdropSizes.Add(Mathf.Max(size.x, size.z)); if (!_backdropColor.HasValue) { Material sharedMaterial = val3.sharedMaterial; if ((Object)(object)sharedMaterial != (Object)null && sharedMaterial.HasProperty("_Color")) { Color color = sharedMaterial.GetColor("_Color"); _backdropColor = new Color(color.r, color.g, color.b, 1f); } } } val2.transform.localRotation = val.localRotation; } } private void ScaleBackdrop(float zoom) { //IL_0082: 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_008f: 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_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) float num = zoom * 2f * 1.8f; int num2 = Mathf.Min(_ownBackdrop.Count, Mathf.Min(_ownBackdropScales.Count, _ownBackdropSizes.Count)); for (int i = 0; i < num2; i++) { Renderer val = _ownBackdrop[i]; float num3 = _ownBackdropSizes[i]; if (!((Object)(object)val == (Object)null) && !(num3 <= 0.0001f)) { float num4 = Mathf.Max(1f, num / num3); Vector3 val2 = _ownBackdropScales[i]; ((Component)val).transform.localScale = new Vector3(val2.x * num4, val2.y, val2.z * num4); } } } private void ApplyTexture(int resolution, int antiAliasing) { //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: 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_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Expected O, but got Unknown if (!((Object)(object)_texture != (Object)null) || _appliedResolution != resolution || _appliedAntiAliasing != antiAliasing || !((Object)(object)_camera.targetTexture == (Object)(object)_texture)) { if ((Object)(object)_texture != (Object)null) { _texture.Release(); Object.Destroy((Object)(object)_texture); } _texture = new RenderTexture(resolution, resolution, 16, (RenderTextureFormat)0) { name = "RepoMapFix Minimap", filterMode = (FilterMode)0, antiAliasing = antiAliasing }; _texture.Create(); _camera.targetTexture = _texture; _appliedResolution = resolution; _appliedAntiAliasing = antiAliasing; } } private void ApplyZoom(float zoom) { if (_appliedZoom != zoom) { _camera.orthographicSize = zoom; _appliedZoom = zoom; ScaleBackdrop(zoom); } } private static Camera FindMapCamera() { Camera[] array = Object.FindObjectsOfType(true); foreach (Camera val in array) { if (((Object)val).name == "Dirt Finder Map Camera") { return val; } } return null; } private void HandlePreCull(Camera camera) { //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)camera == (Object)null || (Object)(object)camera != (Object)(object)_camera) { return; } SetSharedBackdropVisible(visible: false); SetRenderers(_ownBackdrop, enabled: true); ApplyRendererOverrides(); ApplyScaleOverrides(); ApplyColorOverrides(); _swappedModules.Clear(); _swappedRotations.Clear(); if (!_northFixed) { return; } foreach (MapModule item in _moduleCache) { if (!((Object)(object)item == (Object)null)) { Transform graphic = item.graphic; if (!((Object)(object)graphic == (Object)null)) { _swappedModules.Add(graphic); _swappedRotations.Add(graphic.rotation); graphic.rotation = LookDown; } } } if (UprightTransforms == null) { return; } foreach (Transform uprightTransform in UprightTransforms) { if (!((Object)(object)uprightTransform == (Object)null)) { _swappedModules.Add(uprightTransform); _swappedRotations.Add(uprightTransform.rotation); uprightTransform.rotation = LookDown; } } } private void HandlePostRender(Camera camera) { if (!((Object)(object)camera == (Object)null) && !((Object)(object)camera != (Object)(object)_camera)) { RestoreSharedState(); } } private void RestoreSharedState() { //IL_0047: Unknown result type (might be due to invalid IL or missing references) SetSharedBackdropVisible(visible: true); SetRenderers(_ownBackdrop, enabled: false); RestoreRendererOverrides(); RestoreScaleOverrides(); RestoreColorOverrides(); for (int i = 0; i < _swappedModules.Count; i++) { Transform val = _swappedModules[i]; if ((Object)(object)val != (Object)null) { val.rotation = _swappedRotations[i]; } } _swappedModules.Clear(); _swappedRotations.Clear(); } private void SetSharedBackdropVisible(bool visible) { SetRenderers(_sharedBackdrop, visible); } private void ApplyColorOverrides() { //IL_0060: 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) _recoloredRenderers.Clear(); _originalColors.Clear(); if (ColorOverrides == null) { return; } foreach (ColorOverride colorOverride in ColorOverrides) { if (!((Object)(object)colorOverride.Renderer == (Object)null)) { _recoloredRenderers.Add(colorOverride.Renderer); _originalColors.Add(colorOverride.Renderer.color); colorOverride.Renderer.color = colorOverride.Color; } } } private void RestoreColorOverrides() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < _recoloredRenderers.Count; i++) { SpriteRenderer val = _recoloredRenderers[i]; if ((Object)(object)val != (Object)null) { val.color = _originalColors[i]; } } _recoloredRenderers.Clear(); _originalColors.Clear(); } private static void SetRenderers(List renderers, bool enabled) { foreach (Renderer renderer in renderers) { if ((Object)(object)renderer != (Object)null && renderer.enabled != enabled) { renderer.enabled = enabled; } } } private void ApplyRendererOverrides() { _swappedRenderers.Clear(); _originalEnabled.Clear(); if (RendererOverrides == null) { return; } foreach (RendererOverride rendererOverride in RendererOverrides) { if (!((Object)(object)rendererOverride.Renderer == (Object)null)) { _swappedRenderers.Add(rendererOverride.Renderer); _originalEnabled.Add(rendererOverride.Renderer.enabled); rendererOverride.Renderer.enabled = rendererOverride.Enabled; } } } private void RestoreRendererOverrides() { for (int i = 0; i < _swappedRenderers.Count; i++) { Renderer val = _swappedRenderers[i]; if ((Object)(object)val != (Object)null) { val.enabled = _originalEnabled[i]; } } _swappedRenderers.Clear(); _originalEnabled.Clear(); } private void ApplyScaleOverrides() { //IL_0060: 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) _swappedScales.Clear(); _originalScales.Clear(); if (ScaleOverrides == null) { return; } foreach (ScaleOverride scaleOverride in ScaleOverrides) { if (!((Object)(object)scaleOverride.Transform == (Object)null)) { _swappedScales.Add(scaleOverride.Transform); _originalScales.Add(scaleOverride.Transform.localScale); scaleOverride.Transform.localScale = scaleOverride.Scale; } } } private void RestoreScaleOverrides() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < _swappedScales.Count; i++) { Transform val = _swappedScales[i]; if ((Object)(object)val != (Object)null) { val.localScale = _originalScales[i]; } } _swappedScales.Clear(); _originalScales.Clear(); } } internal static class MinimapVisibilityPatch { internal static bool DrawMinimapPrefix() { return !Plugin.ShouldSuppressOtherMinimap(); } } internal sealed class PlayerMarker { internal readonly struct Settings { internal readonly PaletteColor Color; internal readonly bool Glow; internal readonly bool Ripple; internal readonly float RippleScale; internal Settings(PaletteColor color, bool glow, bool ripple, float rippleScale) { Color = color; Glow = glow; Ripple = ripple; RippleScale = rippleScale; } } private const int RippleCount = 2; private const float RippleSeconds = 2f; private const float RippleStartScale = 0.6f; private Transform _boundGraphic; private SpriteRenderer _graphicRenderer; private Color _originalColor; private SpriteRenderer _glow; private readonly List _ripples = new List(); private Sprite _glowSprite; private Sprite _ringSprite; private float _time; internal void Tick(float deltaTime, Settings minimap, Settings fullMap, List rendererOverrides, List scaleOverrides, List colorOverrides) { //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0097: 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_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: 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_00d6: 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_00e4: 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_00c8: Unknown result type (might be due to invalid IL or missing references) Transform val = (((Object)(object)Map.Instance != (Object)null) ? Map.Instance.PlayerGraphicTransform : null); if ((Object)(object)val == (Object)null) { return; } if ((Object)(object)_boundGraphic != (Object)(object)val || (Object)(object)_graphicRenderer == (Object)null) { Bind(val); if ((Object)(object)_graphicRenderer == (Object)null) { return; } } _time += deltaTime; Color color; Color val2 = (MapPalette.TryResolve(fullMap.Color, out color) ? color : _originalColor); Color color2; Color val3 = (MapPalette.TryResolve(minimap.Color, out color2) ? color2 : _originalColor); if (_graphicRenderer.color != val2) { _graphicRenderer.color = val2; } if (val3 != val2) { colorOverrides.Add(new MinimapView.ColorOverride(_graphicRenderer, val3)); } ApplyGlow(minimap, fullMap, val3, val2, rendererOverrides, colorOverrides); ApplyRipples(minimap, fullMap, val3, val2, rendererOverrides, scaleOverrides, colorOverrides); } private void ApplyGlow(Settings minimap, Settings fullMap, Color minimapColor, Color fullMapColor, List rendererOverrides, List colorOverrides) { //IL_001a: 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_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0080: 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_0092: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_glow == (Object)null)) { ((Component)_glow).transform.localScale = Vector3.one * 2.2f; ((Renderer)_glow).enabled = fullMap.Glow; _glow.color = WithGlowAlpha(fullMapColor); if (minimap.Glow != fullMap.Glow) { rendererOverrides.Add(new MinimapView.RendererOverride((Renderer)(object)_glow, minimap.Glow)); } if (minimap.Glow && minimapColor != fullMapColor) { colorOverrides.Add(new MinimapView.ColorOverride(_glow, WithGlowAlpha(minimapColor))); } } } private void ApplyRipples(Settings minimap, Settings fullMap, Color minimapColor, Color fullMapColor, List rendererOverrides, List scaleOverrides, List colorOverrides) { //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_007c: 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_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: 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) for (int i = 0; i < _ripples.Count; i++) { SpriteRenderer val = _ripples[i]; if ((Object)(object)val == (Object)null) { continue; } float num = Mathf.Repeat(_time / 2f + (float)i / (float)_ripples.Count, 1f); float alpha = (1f - num) * 0.55f; ((Renderer)val).enabled = fullMap.Ripple; val.color = WithAlpha(fullMapColor, alpha); ((Component)val).transform.localScale = RippleScale(num, fullMap.RippleScale); if (minimap.Ripple != fullMap.Ripple) { rendererOverrides.Add(new MinimapView.RendererOverride((Renderer)(object)val, minimap.Ripple)); } if (minimap.Ripple) { if (minimap.RippleScale != fullMap.RippleScale) { scaleOverrides.Add(new MinimapView.ScaleOverride(((Component)val).transform, RippleScale(num, minimap.RippleScale))); } if (minimapColor != fullMapColor) { colorOverrides.Add(new MinimapView.ColorOverride(val, WithAlpha(minimapColor, alpha))); } } } } private static Vector3 RippleScale(float phase, float maxScale) { //IL_0000: 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) return Vector3.one * Mathf.Lerp(0.6f, maxScale, phase); } private static Color WithAlpha(Color color, float alpha) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) color.a = alpha; return color; } private static Color WithGlowAlpha(Color color) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) color.a = 0.35f; return color; } internal void Clear() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_graphicRenderer != (Object)null) { _graphicRenderer.color = _originalColor; } if ((Object)(object)_glow != (Object)null) { Object.Destroy((Object)(object)((Component)_glow).gameObject); } foreach (SpriteRenderer ripple in _ripples) { if ((Object)(object)ripple != (Object)null) { Object.Destroy((Object)(object)((Component)ripple).gameObject); } } _ripples.Clear(); _glow = null; _graphicRenderer = null; _boundGraphic = null; } private void Bind(Transform graphic) { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) Clear(); _boundGraphic = graphic; _graphicRenderer = ((Component)graphic).GetComponent() ?? ((Component)graphic).GetComponentInChildren(); if (!((Object)(object)_graphicRenderer == (Object)null)) { _originalColor = _graphicRenderer.color; _glow = CreateSprite(graphic, "Minimap Player Glow", GetGlowSprite(), -2); for (int i = 0; i < 2; i++) { _ripples.Add(CreateSprite(graphic, $"Minimap Player Ripple {i + 1}", GetRingSprite(), -1)); } } } private SpriteRenderer CreateSprite(Transform parent, string name, Sprite sprite, int sortingOffset) { //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_0017: 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_002a: 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_003a: 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_004a: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name) { layer = ((Component)parent).gameObject.layer }; val.transform.SetParent(parent, false); val.transform.localPosition = Vector3.zero; val.transform.localRotation = Quaternion.identity; val.transform.localScale = Vector3.one; SpriteRenderer obj = val.AddComponent(); obj.sprite = sprite; ((Renderer)obj).sharedMaterial = ((Renderer)_graphicRenderer).sharedMaterial; ((Renderer)obj).sortingLayerID = ((Renderer)_graphicRenderer).sortingLayerID; ((Renderer)obj).sortingOrder = ((Renderer)_graphicRenderer).sortingOrder + sortingOffset; ((Renderer)obj).enabled = false; return obj; } private Sprite GetGlowSprite() { if ((Object)(object)_glowSprite != (Object)null) { return _glowSprite; } _glowSprite = CreateRadialSprite("RepoMapFix Player Glow", 64, delegate(float distance) { float num = Mathf.Clamp01(1f - distance); return num * num; }); return _glowSprite; } private Sprite GetRingSprite() { if ((Object)(object)_ringSprite != (Object)null) { return _ringSprite; } _ringSprite = CreateRadialSprite("RepoMapFix Player Ripple", 64, (float distance) => Mathf.Clamp01(1f - Mathf.Abs(distance - 0.85f) / 0.15f)); return _ringSprite; } private static Sprite CreateRadialSprite(string name, int size, Func alphaAt) { //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_0010: 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_001f: Expected O, but got Unknown //IL_00e8: 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_005c: 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_00aa: 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) Texture2D val = new Texture2D(size, size, (TextureFormat)4, false) { name = name, filterMode = (FilterMode)1, wrapMode = (TextureWrapMode)1 }; Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor((float)(size - 1) * 0.5f, (float)(size - 1) * 0.5f); float num = (float)size * 0.5f; Color32[] array = (Color32[])(object)new Color32[size * size]; for (int i = 0; i < size; i++) { for (int j = 0; j < size; j++) { float num2 = Vector2.Distance(new Vector2((float)j, (float)i), val2) / num; float num3 = ((num2 > 1f) ? 0f : Mathf.Clamp01(alphaAt(num2))); array[i * size + j] = new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, (byte)(num3 * 255f)); } } val.SetPixels32(array); val.Apply(false, true); Sprite obj = Sprite.Create(val, new Rect(0f, 0f, (float)size, (float)size), new Vector2(0.5f, 0.5f), (float)size); ((Object)obj).name = name; return obj; } } [BepInPlugin("asuty.repo.mapfix", "Mini Map & Map+", "3.18.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { internal enum Language { 日本語, English } internal enum Corner { 右上, 左上, 右下, 左下 } internal enum ViewMode { ステージ全体を固定表示, プレイヤーに追従 } internal enum FloorMode { 自分のいる階, 全ての階, 地上1階で固定 } internal enum ScreenPreset { HD, _4K } public const string PluginGuid = "asuty.repo.mapfix"; public const string PluginName = "Mini Map & Map+"; public const string PluginVersion = "3.18.0"; internal static ManualLogSource Log; private static ConfigEntry _modEnabled; private static ConfigEntry _language; private static ConfigEntry _preset; private static ConfigEntry _minimapEnabled; private static ConfigEntry _minimapNorthFixed; private static ConfigEntry _viewMode; private static ConfigEntry _zoom; private static ConfigEntry _corner; private static ConfigEntry _size; private static ConfigEntry _margin; private static ConfigEntry _opacity; private static ConfigEntry _hideWhileFullMapOpen; private static ConfigEntry _hudOffsetRight; private static ConfigEntry _hudOffsetLeft; private static ConfigEntry _resolution; private static ConfigEntry _antiAliasing; private static ConfigEntry _alwaysShowMarkers; private static ConfigEntry _extractionMarkerScale; private static ConfigEntry _extractionRipple; private static ConfigEntry _extractionRippleScale; private static ConfigEntry _doorMarkers; private static ConfigEntry _doorColor; private static ConfigEntry _showPlayers; private static ConfigEntry _entityMarkerScale; private static ConfigEntry _colorInactive; private static ConfigEntry _colorActive; private static ConfigEntry _colorUsed; private static ConfigEntry _playerColor; private static ConfigEntry _playerGlow; private static ConfigEntry _playerRipple; private static ConfigEntry _playerRippleScale; private static ConfigEntry _fullMapNorthFixed; private static ConfigEntry _fullMapViewMode; private static ConfigEntry _fullMapOverrideZoom; private static ConfigEntry _fullMapZoom; private static ConfigEntry _fullMapResolution; private static ConfigEntry _fullMapAntiAliasing; private static ConfigEntry _showPlayersOnFullMap; private static ConfigEntry _fullMapPlayerColor; private static ConfigEntry _fullMapPlayerGlow; private static ConfigEntry _fullMapPlayerRipple; private static ConfigEntry _fullMapPlayerRippleScale; private static ConfigEntry _roomMarkEnabled; private static ConfigEntry _roomMarkKey; private static ConfigEntry _roomMarkKeyCapture; private static ConfigEntry _roomMarkColor; private static ConfigEntry _roomMarkScale; private static ConfigEntry _roomMarkOnFullMap; private static ConfigEntry _debugUnlocked; private static ConfigEntry _diagnosticsKey; private static ConfigEntry _diagnosticsPath; private static ConfigEntry _floorMode; private const int GroundFloor = 0; private const string DebugPhrase = "takasi"; private static readonly object[] HideTag = new object[1] { "HideREPOConfig" }; private static readonly object[] NoTags = new object[0]; private string _typed = string.Empty; private KeyCode _roomMarkKeyCode = (KeyCode)118; private string _roomMarkKeyCached = string.Empty; private static FieldInfo _mapToolActiveField; private MinimapView _view; private EntityMarkers _markers; private ExtractionColors _extractionColors; private DoorMarkers _doorMarkerView; private ExtractionMarkers _extractionMarkerView; private PlayerMarker _playerMarker; private FullMapView _fullMap; private RoomMarks _roomMarks; private readonly List _rendererOverrides = new List(); private readonly List _scaleOverrides = new List(); private readonly List _colorOverrides = new List(); private readonly List _uprightOnMinimap = new List(); private bool _failed; private readonly HudShift _hudShift = new HudShift(); private readonly LogMirror _logMirror = new LogMirror(); private ScreenPreset _appliedPreset; private string _languagePopupMessage; private float _languagePopupUntil; private readonly Dictionary _forcedMarkerAlpha = new Dictionary(); private float _forceMarkerTimer; internal static Language CurrentLanguage { get { if (_language == null) { return Language.日本語; } return _language.Value; } } private void Awake() { //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Expected O, but got Unknown //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Expected O, but got Unknown //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Expected O, but got Unknown //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Expected O, but got Unknown //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Expected O, but got Unknown //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Expected O, but got Unknown //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: Expected O, but got Unknown //IL_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_02f4: Expected O, but got Unknown //IL_0387: Unknown result type (might be due to invalid IL or missing references) //IL_0391: Expected O, but got Unknown //IL_03c4: Unknown result type (might be due to invalid IL or missing references) //IL_03ce: Expected O, but got Unknown //IL_0421: Unknown result type (might be due to invalid IL or missing references) //IL_042b: Expected O, but got Unknown //IL_0560: Unknown result type (might be due to invalid IL or missing references) //IL_056a: Expected O, but got Unknown //IL_05fd: Unknown result type (might be due to invalid IL or missing references) //IL_0607: Expected O, but got Unknown //IL_063a: Unknown result type (might be due to invalid IL or missing references) //IL_0644: Expected O, but got Unknown //IL_067a: Unknown result type (might be due to invalid IL or missing references) //IL_0684: Expected O, but got Unknown //IL_0737: Unknown result type (might be due to invalid IL or missing references) //IL_0741: Expected O, but got Unknown //IL_0778: Unknown result type (might be due to invalid IL or missing references) //IL_0804: Unknown result type (might be due to invalid IL or missing references) //IL_080e: Expected O, but got Unknown //IL_084f: Unknown result type (might be due to invalid IL or missing references) //IL_0859: Expected O, but got Unknown //IL_0893: Unknown result type (might be due to invalid IL or missing references) //IL_089d: Expected O, but got Unknown //IL_08be: Unknown result type (might be due to invalid IL or missing references) //IL_08c8: Expected O, but got Unknown //IL_09dd: Unknown result type (might be due to invalid IL or missing references) //IL_09ed: Expected O, but got Unknown _modEnabled = ((BaseUnityPlugin)this).Config.Bind("全般", "有効", true, "このModの全ての機能をまとめて切り替える。OFFでゲーム本来の状態に戻る。"); _language = ((BaseUnityPlugin)this).Config.Bind("全般", "言語", Language.English, "設定画面の表示言語。保存される項目名は変わらないため設定は失われない。\n切り替えたら、この設定画面を一度閉じてから開き直すと反映される。"); _preset = ((BaseUnityPlugin)this).Config.Bind("全般", "解像度プリセット", ScreenPreset.HD, "画面解像度に合わせた既定値の組。選ぶとその場で反映され、初期状態に戻すときの基準にもなる。"); _minimapEnabled = ((BaseUnityPlugin)this).Config.Bind("ミニマップ", "表示する", true, "画面隅のミニマップを表示する。OFFにしてもTabの地図への設定は効く。"); _minimapNorthFixed = ((BaseUnityPlugin)this).Config.Bind("ミニマップ", "北向きに固定", false, "ONで常に北が上。OFFならゲーム本来の地図と同じく自分の向きに合わせて回る。"); _viewMode = ((BaseUnityPlugin)this).Config.Bind("ミニマップ", "表示方式", ViewMode.プレイヤーに追従, "ステージ全体を固定表示:中心を固定し常に全体を映す。端まで行っても切れない。\nプレイヤーに追従:自分を中心に映す。ズーム設定が有効になる。"); _zoom = ((BaseUnityPlugin)this).Config.Bind("ミニマップ", "ズーム", 4f, new ConfigDescription("数値が大きいほど広い範囲が映る。表示方式が「プレイヤーに追従」のときだけ有効。", (AcceptableValueBase)(object)new AcceptableValueRange(1f, 30f), Array.Empty())); _corner = ((BaseUnityPlugin)this).Config.Bind("ミニマップ", "表示位置", Corner.右上, "ミニマップを画面のどの隅に表示するか。"); _size = ((BaseUnityPlugin)this).Config.Bind("ミニマップ", "大きさ", 350, new ConfigDescription("画面上でのミニマップの一辺の大きさ(ピクセル)。", (AcceptableValueBase)(object)new AcceptableValueRange(100, 2400), Array.Empty())); _margin = ((BaseUnityPlugin)this).Config.Bind("ミニマップ", "画面端の余白", 12, new ConfigDescription("画面の端とミニマップの間隔(ピクセル)。", (AcceptableValueBase)(object)new AcceptableValueRange(0, 800), Array.Empty())); _opacity = ((BaseUnityPlugin)this).Config.Bind("ミニマップ", "不透明度", 0.85f, new ConfigDescription("1で完全に不透明。小さくすると背後が透ける。", (AcceptableValueBase)(object)new AcceptableValueRange(0.1f, 1f), Array.Empty())); _hideWhileFullMapOpen = ((BaseUnityPlugin)this).Config.Bind("ミニマップ", "Tab中は隠す", true, "Tabで地図を開いている間、画面隅のミニマップを隠す。"); _hudOffsetRight = ((BaseUnityPlugin)this).Config.Bind("ミニマップ", "右上の下げ幅", MigrateInt("ミニマップ", "右側の下げ幅", 130), new ConfigDescription("ミニマップが右上のとき、所持金と納品数を下げる量。", (AcceptableValueBase)(object)new AcceptableValueRange(0, 1600), Array.Empty())); _hudOffsetLeft = ((BaseUnityPlugin)this).Config.Bind("ミニマップ", "左上の下げ幅", MigrateInt("ミニマップ", "左側の下げ幅", 130), new ConfigDescription("ミニマップが左上のとき、体力とスタミナを下げる量。", (AcceptableValueBase)(object)new AcceptableValueRange(0, 1600), Array.Empty())); _resolution = ((BaseUnityPlugin)this).Config.Bind("画質", "描画解像度", 800, new ConfigDescription("ミニマップの描画解像度。低いと未探索エリアの点線が1ピクセル未満に潰れてチラつく。", (AcceptableValueBase)(object)new AcceptableValueRange(200, 4096), Array.Empty())); _antiAliasing = ((BaseUnityPlugin)this).Config.Bind("画質", "アンチエイリアス", 4, new ConfigDescription("細い線が消えるのを抑える。1で無効(ドット感が強い見た目)。", (AcceptableValueBase)(object)new AcceptableValueList(new int[4] { 1, 2, 4, 8 }), Array.Empty())); _floorMode = ((BaseUnityPlugin)this).Config.Bind("全般", "映す階", FloorMode.地上1階で固定, "自分のいる階:ゲーム本来の動き。階を移動すると地図が切り替わる。\n全ての階:全部を重ねて映す。切り替わらないが混み合って見える。\n地上1階で固定:常に地上1階だけを映す。切り替わらず一番読みやすい。\nいずれの場合も納品場所の位置は別に印で示すので見失わない。"); _alwaysShowMarkers = ((BaseUnityPlugin)this).Config.Bind("マーカー", "発見済み納品場所", true, "ONにしている間、発見済みの納品場所を必ず地図に表示する。\nどの階を映していても、納品場所がどの状態でも、位置が分かるよう印を出す。"); _showPlayers = ((BaseUnityPlugin)this).Config.Bind("マーカー", "味方の位置を表示", false, "他のプレイヤーの位置を表示する。色はその人が装備している頭の色。倒れている人は灰色。"); _entityMarkerScale = ((BaseUnityPlugin)this).Config.Bind("マーカー", "マーカーの大きさ", 1f, new ConfigDescription("味方マーカーの大きさ。", (AcceptableValueBase)(object)new AcceptableValueRange(0.2f, 6f), Array.Empty())); _extractionMarkerScale = ((BaseUnityPlugin)this).Config.Bind("マーカー", "納品場所の印の大きさ", 0.5f, new ConfigDescription("納品場所を示す印の大きさ。", (AcceptableValueBase)(object)new AcceptableValueRange(0.2f, 6f), Array.Empty())); _extractionRipple = ((BaseUnityPlugin)this).Config.Bind("マーカー", "起動中の納品場所に波紋", false, "起動中の納品場所から、自分の位置と同じように波紋を広げて目立たせる。"); _extractionRippleScale = ((BaseUnityPlugin)this).Config.Bind("マーカー", "起動中の納品場所の波紋の広がり", 2.2f, new ConfigDescription("波紋が広がる大きさ。印そのものの大きさに対する倍率。", (AcceptableValueBase)(object)new AcceptableValueRange(1.5f, 10f), Array.Empty())); _doorMarkers = ((BaseUnityPlugin)this).Config.Bind("マーカー", "ドアを目立たせる", true, "地図のドアの位置に白い帯を重ねて見やすくする。\nゲームもドアを描いているが細くて壁に紛れるため、同じ位置に同じ向きで重ねる。\nふさがれて通れないドアには出さない。"); _doorColor = ((BaseUnityPlugin)this).Config.Bind("マーカー", "ドアの色", PaletteColor.白, "ドアの印の色。大きさは常に実際のドアの幅に合わせるため設定はない。"); _colorInactive = ((BaseUnityPlugin)this).Config.Bind("納品場所の色", "未起動", PaletteColor.黄色, "まだ起動していない納品場所の色。「標準のまま」でゲーム本来の色(オレンジ)になる。"); _colorActive = ((BaseUnityPlugin)this).Config.Bind("納品場所の色", "起動中", PaletteColor.水色, "今まさに納品すべき納品場所の色。"); _colorUsed = ((BaseUnityPlugin)this).Config.Bind("納品場所の色", "納品済み", PaletteColor.黄色, "納品が終わった納品場所の色。"); _playerColor = ((BaseUnityPlugin)this).Config.Bind("自分の位置", "色", PaletteColor.白, "自分の位置マーカーの色。"); _playerGlow = ((BaseUnityPlugin)this).Config.Bind("自分の位置", "光らせる", true, "マーカーの周りに淡い光をまとわせて見つけやすくする。"); _playerRipple = ((BaseUnityPlugin)this).Config.Bind("自分の位置", "波紋を出す", true, "マーカーから波紋を広げて見つけやすくする。"); _playerRippleScale = ((BaseUnityPlugin)this).Config.Bind("自分の位置", "波紋の大きさ", 3.5f, new ConfigDescription("波紋が広がる大きさ。", (AcceptableValueBase)(object)new AcceptableValueRange(1.5f, 10f), Array.Empty())); _fullMapNorthFixed = ((BaseUnityPlugin)this).Config.Bind("Tabマップ", "北向きに固定", false, "Tabで開く地図を回転させず北向きで固定する。自分の向きは位置マーカーで示される。"); _fullMapViewMode = ((BaseUnityPlugin)this).Config.Bind("Tabマップ", "表示方式", ViewMode.プレイヤーに追従, "ステージ全体を固定表示:中心を固定し常に全体を映す。拡大率の設定は使わない。\nプレイヤーに追従:ゲーム標準どおり自分を中心に映す。"); _fullMapOverrideZoom = ((BaseUnityPlugin)this).Config.Bind("Tabマップ", "拡大率を変更", false, "Tabで開く地図の拡大率を下の設定に置き換える。OFFならゲーム標準のまま。"); _fullMapZoom = ((BaseUnityPlugin)this).Config.Bind("Tabマップ", "拡大率", 4f, new ConfigDescription("数値が大きいほど広い範囲が映る。ゲーム標準はおよそ2.25。", (AcceptableValueBase)(object)new AcceptableValueRange(1f, 30f), Array.Empty())); _fullMapResolution = ((BaseUnityPlugin)this).Config.Bind("Tabマップ", "描画解像度", 800, new ConfigDescription("ゲーム標準は200。拡大率を上げると壁の細い線が潰れて途切れるため、上げると解消する。", (AcceptableValueBase)(object)new AcceptableValueRange(200, 4096), Array.Empty())); _fullMapAntiAliasing = ((BaseUnityPlugin)this).Config.Bind("Tabマップ", "アンチエイリアス", 4, new ConfigDescription("細い線が消えるのを抑える。1で無効(ゲーム標準)。", (AcceptableValueBase)(object)new AcceptableValueList(new int[4] { 1, 2, 4, 8 }), Array.Empty())); _showPlayersOnFullMap = ((BaseUnityPlugin)this).Config.Bind("Tabマップ", "味方マーカー", false, "味方の位置マーカーをTabの地図にも表示する。OFFならミニマップだけに出る。"); _fullMapPlayerColor = ((BaseUnityPlugin)this).Config.Bind("Tabマップ", "自分の色", PaletteColor.標準のまま, "Tabの地図での自分の位置マーカーの色。ミニマップとは別に決められる。"); _fullMapPlayerGlow = ((BaseUnityPlugin)this).Config.Bind("Tabマップ", "自分を光らせる", false, "Tabの地図で自分のマーカーの周りに淡い光をまとわせる。"); _fullMapPlayerRipple = ((BaseUnityPlugin)this).Config.Bind("Tabマップ", "自分の波紋", true, "Tabの地図で自分のマーカーから波紋を広げる。"); _fullMapPlayerRippleScale = ((BaseUnityPlugin)this).Config.Bind("Tabマップ", "波紋の大きさ", 3.5f, new ConfigDescription("Tabの地図での波紋が広がる大きさ。", (AcceptableValueBase)(object)new AcceptableValueRange(1.5f, 10f), Array.Empty())); _roomMarkEnabled = ((BaseUnityPlugin)this).Config.Bind("部屋チェック", "有効", true, "調べ終えた部屋に印を付ける機能を使う。OFFにすると印は隠れるが、付けた印は残る。"); _roomMarkKey = ((BaseUnityPlugin)this).Config.Bind("部屋チェック", "印のキー", ((object)(KeyCode)99/*cast due to .constrained prefix*/).ToString(), "今いる部屋に地図上の印を付けるキー。下の項目から割り当てられる。"); _roomMarkKeyCapture = ((BaseUnityPlugin)this).Config.Bind("部屋チェック", "印のキーを設定", false, "ONにするとキーの入力待ちになる。割り当てたいキーを押すと決まる。Escで取り消し。"); _roomMarkColor = ((BaseUnityPlugin)this).Config.Bind("部屋チェック", "印の色", PaletteColor.白, "地図に付ける印の色。"); _roomMarkScale = ((BaseUnityPlugin)this).Config.Bind("部屋チェック", "印の大きさ", 0.8f, new ConfigDescription("地図に付ける印の大きさ。", (AcceptableValueBase)(object)new AcceptableValueRange(0.3f, 8f), Array.Empty())); _roomMarkOnFullMap = ((BaseUnityPlugin)this).Config.Bind("部屋チェック", "Tabにも表示", true, "OFFならミニマップにだけ表示する。"); _debugUnlocked = ((BaseUnityPlugin)this).Config.Bind("デバッグ", "解除済み", false, new ConfigDescription("内部用。", (AcceptableValueBase)null, HideTag)); object[] array = (_debugUnlocked.Value ? NoTags : HideTag); _diagnosticsKey = ((BaseUnityPlugin)this).Config.Bind("デバッグ", "構造ログのキー", (KeyCode)291, new ConfigDescription("地図まわりの実際のシーン構造と描画設定を書き出すキー。調査用。", (AcceptableValueBase)null, array)); _diagnosticsPath = ((BaseUnityPlugin)this).Config.Bind("デバッグ", "ログの保存先", string.Empty, new ConfigDescription("構造ログを書き出すファイルの場所。空欄ならBepInExのフォルダに置く。書き出した場所はログに残す。", (AcceptableValueBase)null, array)); Log = ((BaseUnityPlugin)this).Logger; _appliedPreset = _preset.Value; if (_logMirror.Start(_diagnosticsPath.Value)) { ((BaseUnityPlugin)this).Logger.LogInfo((object)("ログを書き写します: " + _logMirror.Path)); } _view = new MinimapView(); _markers = new EntityMarkers(); _extractionColors = new ExtractionColors(); _doorMarkerView = new DoorMarkers(); _extractionMarkerView = new ExtractionMarkers(); _playerMarker = new PlayerMarker(); _fullMap = new FullMapView(); _roomMarks = new RoomMarks(); _view.RendererOverrides = _rendererOverrides; _view.ScaleOverrides = _scaleOverrides; _view.ColorOverrides = _colorOverrides; _view.UprightTransforms = _uprightOnMinimap; ((BaseUnityPlugin)this).Config.SettingChanged += delegate(object sender, SettingChangedEventArgs args) { string text = "[" + args.ChangedSetting.Definition.Section + "] " + $"{args.ChangedSetting.Definition.Key} = {args.ChangedSetting.BoxedValue}"; ((BaseUnityPlugin)this).Logger.LogInfo((object)("設定変更: " + text)); _logMirror.Mark("設定変更: " + text); if ((object)args.ChangedSetting == _language) { ShowLanguagePopup(); } }; SuppressDigMinimapDrawing(); ConfigLocalization.TryPatch(new Harmony("asuty.repo.mapfix"), ((BaseUnityPlugin)this).Logger); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Mini Map & Map+ 3.18.0 loaded."); } private void OnDestroy() { _view?.Dispose(); _roomMarks?.StopListening(); _logMirror?.Dispose(); } private void SuppressDigMinimapDrawing() { //IL_0047: 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_0071: Expected O, but got Unknown try { Type type = AccessTools.TypeByName("Minimap.Plugin"); if (!(type == null)) { MethodInfo methodInfo = AccessTools.Method(type, "OnGUI", (Type[])null, (Type[])null); if (methodInfo == null) { ((BaseUnityPlugin)this).Logger.LogWarning((object)"dig-Minimapの描画を止められませんでした。ミニマップが二重に表示される場合はdig-Minimapを外してください。"); return; } new Harmony("asuty.repo.mapfix").Patch((MethodBase)methodInfo, new HarmonyMethod(AccessTools.Method(typeof(MinimapVisibilityPatch), "DrawMinimapPrefix", (Type[])null, (Type[])null)), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); ((BaseUnityPlugin)this).Logger.LogInfo((object)"dig-Minimapを検出したため、そちらのミニマップ描画は停止しました。dig-Minimapは不要です。"); } } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogWarning((object)("dig-Minimapの描画停止に失敗しました: " + ex.Message)); } } internal static bool ShouldSuppressOtherMinimap() { if (_modEnabled != null) { return _modEnabled.Value; } return false; } private void Update() { if (_failed) { return; } try { UpdateInput(); } catch (Exception arg) { _failed = true; ((BaseUnityPlugin)this).Logger.LogError((object)$"入力の処理で例外が発生したため、以降の処理を停止します: {arg}"); } } private void UpdateInput() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) HandleKeyCapture(); HandleDebugPhrase(); HandlePresetChange(); HandleRoomMarkRequest(); if (Input.GetKeyDown(_diagnosticsKey.Value)) { Diagnostics.Dump(((BaseUnityPlugin)this).Logger, _view, _markers, _fullMap, _diagnosticsPath.Value); } } private void LateUpdate() { if (_failed) { return; } try { UpdateMinimap(); } catch (Exception arg) { _failed = true; ((BaseUnityPlugin)this).Logger.LogError((object)$"ミニマップの処理で例外が発生したため、以降の処理を停止します: {arg}"); _view.Teardown(); _markers.Clear(); _playerMarker.Clear(); _roomMarks.Clear(); _extractionMarkerView.Clear(); _doorMarkerView.Clear(); _extractionColors.Restore(); RestoreCustomMarkerVisibility(); _fullMap.Forget(); _hudShift.Forget(); MapBounds.Forget(); } } private void UpdateMinimap() { if ((Object)(object)Map.Instance == (Object)null || !SemiFunc.RunIsLevel()) { _view.Teardown(); _markers.Clear(); _playerMarker.Clear(); _roomMarks.Clear(); _extractionMarkerView.Clear(); _doorMarkerView.Clear(); _extractionColors.Restore(); RestoreCustomMarkerVisibility(); _fullMap.Forget(); _hudShift.Forget(); MapBounds.Forget(); _rendererOverrides.Clear(); _scaleOverrides.Clear(); _colorOverrides.Clear(); _uprightOnMinimap.Clear(); return; } if (!_modEnabled.Value) { _view.Teardown(); _markers.Clear(); _playerMarker.Clear(); _roomMarks.Clear(); _extractionMarkerView.Clear(); _doorMarkerView.Clear(); _extractionColors.Restore(); RestoreCustomMarkerVisibility(); _fullMap.Forget(); _hudShift.Forget(); _rendererOverrides.Clear(); _scaleOverrides.Clear(); _colorOverrides.Clear(); _uprightOnMinimap.Clear(); return; } _fullMap.Tick(_fullMapNorthFixed.Value, _fullMapViewMode.Value == ViewMode.ステージ全体を固定表示, _fullMapOverrideZoom.Value, _fullMapZoom.Value, _fullMapResolution.Value, _fullMapAntiAliasing.Value); if (!_minimapEnabled.Value) { _view.Teardown(); } if (!Map.Instance.Active) { Map.Instance.ActiveSet(true); } ApplyLayerVisibility(); if (_minimapEnabled.Value) { _view.Tick(_zoom.Value, _resolution.Value, _antiAliasing.Value, _viewMode.Value == ViewMode.ステージ全体を固定表示, _minimapNorthFixed.Value); } ApplyHudOffset(); _rendererOverrides.Clear(); _scaleOverrides.Clear(); _colorOverrides.Clear(); _uprightOnMinimap.Clear(); _markers.Tick(Time.deltaTime, _showPlayers.Value, _showPlayersOnFullMap.Value, _entityMarkerScale.Value, _rendererOverrides); _roomMarks.StartListening(); _roomMarks.Tick(_roomMarkEnabled.Value, _roomMarkScale.Value, _roomMarkOnFullMap.Value, _rendererOverrides, _uprightOnMinimap, _roomMarkColor.Value); _playerMarker.Tick(Time.deltaTime, new PlayerMarker.Settings(_playerColor.Value, _playerGlow.Value, _playerRipple.Value, _playerRippleScale.Value), new PlayerMarker.Settings(_fullMapPlayerColor.Value, _fullMapPlayerGlow.Value, _fullMapPlayerRipple.Value, _fullMapPlayerRippleScale.Value), _rendererOverrides, _scaleOverrides, _colorOverrides); _doorMarkerView.Tick(Time.deltaTime, _doorMarkers.Value, _doorColor.Value); _extractionMarkerView.Tick(Time.deltaTime, _alwaysShowMarkers.Value, _extractionMarkerScale.Value, _colorInactive.Value, _colorActive.Value, _colorUsed.Value, _extractionRipple.Value, _extractionRippleScale.Value); _extractionColors.Tick(Time.deltaTime, enabled: true, _colorInactive.Value, _colorActive.Value, _colorUsed.Value); if (_alwaysShowMarkers.Value) { ForceCustomMarkerVisibility(Time.deltaTime); } else { RestoreCustomMarkerVisibility(); } } private void HandleKeyCapture() { //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_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Invalid comparison between Unknown and I4 //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Invalid comparison between Unknown and I4 //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) if (!_roomMarkKeyCapture.Value) { return; } if (Input.GetKeyDown((KeyCode)27)) { _roomMarkKeyCapture.Value = false; ((BaseUnityPlugin)this).Logger.LogInfo((object)"キーの割り当てを取り消しました。"); } else { if (!Input.anyKeyDown) { return; } foreach (KeyCode value in Enum.GetValues(typeof(KeyCode))) { if ((int)value != 323 && (int)value != 324 && Input.GetKeyDown(value)) { _roomMarkKey.Value = ((object)value/*cast due to .constrained prefix*/).ToString(); _roomMarkKeyCapture.Value = false; ((BaseUnityPlugin)this).Logger.LogInfo((object)$"印のキーを {(object)value} に設定しました。"); break; } } } } private KeyCode GetRoomMarkKey() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0078: 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_004e: Unknown result type (might be due to invalid IL or missing references) if (_roomMarkKey.Value == _roomMarkKeyCached) { return _roomMarkKeyCode; } _roomMarkKeyCached = _roomMarkKey.Value; try { _roomMarkKeyCode = (KeyCode)Enum.Parse(typeof(KeyCode), _roomMarkKey.Value, ignoreCase: true); } catch (Exception) { ((BaseUnityPlugin)this).Logger.LogWarning((object)("キーの名前を読み解けませんでした: " + _roomMarkKey.Value)); } return _roomMarkKeyCode; } private void HandleDebugPhrase() { if (!_debugUnlocked.Value && !string.IsNullOrEmpty(Input.inputString)) { _typed += Input.inputString.ToLowerInvariant(); if (_typed.Length > "takasi".Length) { _typed = _typed.Substring(_typed.Length - "takasi".Length); } if (!(_typed != "takasi")) { _typed = string.Empty; _debugUnlocked.Value = true; RevealDebugEntries(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"調査用の項目を表示しました。設定画面を開き直すと現れます。"); } } } private void RevealDebugEntries() { try { FieldInfo fieldInfo = AccessTools.Field(typeof(ConfigEntryBase), "k__BackingField"); if (!(fieldInfo == null)) { Reveal(fieldInfo, (ConfigEntryBase)(object)_diagnosticsKey); Reveal(fieldInfo, (ConfigEntryBase)(object)_diagnosticsPath); } } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogWarning((object)("表示の切り替えに失敗しました。次回の起動時には現れます: " + ex.Message)); } } private static void Reveal(FieldInfo field, ConfigEntryBase entry) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown field.SetValue(entry, (object?)new ConfigDescription(entry.Description.Description, (AcceptableValueBase)null, NoTags)); } private int MigrateInt(string oldSection, string oldKey, int fallback) { try { string configFilePath = ((BaseUnityPlugin)this).Config.ConfigFilePath; if (!File.Exists(configFilePath)) { return fallback; } string text = "[" + oldSection + "]"; string text2 = oldKey + " ="; bool flag = false; string[] array = File.ReadAllLines(configFilePath); for (int i = 0; i < array.Length; i++) { string text3 = array[i].Trim(); int result; if (text3.StartsWith("[") && text3.EndsWith("]")) { flag = text3 == text; } else if (flag && text3.StartsWith(text2) && int.TryParse(text3.Substring(text2.Length).Trim(), out result)) { return result; } } } catch (Exception) { } return fallback; } private void HandlePresetChange() { if (_preset != null && _appliedPreset != _preset.Value) { _appliedPreset = _preset.Value; ApplyPreset(_preset.Value); } } private void ApplyPreset(ScreenPreset preset) { bool flag = preset == ScreenPreset._4K; ((BaseUnityPlugin)this).Logger.LogWarning((object)($"解像度プリセット {preset} の既定値を書き込みます。" + "ミニマップの大きさ・余白・画質・Tabの画質・HUDの下げ幅・納品場所の印の大きさが上書きされます。")); _size.Value = (flag ? 550 : 350); _margin.Value = (flag ? 24 : 12); _resolution.Value = (flag ? 1600 : 800); _fullMapResolution.Value = (flag ? 1600 : 800); _hudOffsetRight.Value = (flag ? 100 : 130); _hudOffsetLeft.Value = (flag ? 100 : 130); _extractionMarkerScale.Value = 0.5f; } private void HandleRoomMarkRequest() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) if (_roomMarkEnabled.Value && !_roomMarkKeyCapture.Value && Input.GetKeyDown(GetRoomMarkKey()) && SemiFunc.RunIsLevel() && SemiFunc.NoTextInputsActive()) { _roomMarks.Toggle(out var message); if (!string.IsNullOrEmpty(message)) { ((BaseUnityPlugin)this).Logger.LogInfo((object)message); } } } private void ApplyLayerVisibility() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) FloorMode value = _floorMode.Value; if (value == FloorMode.自分のいる階 || (Object)(object)Map.Instance == (Object)null || Map.Instance.Layers == null) { return; } float y = Map.Instance.GetLayerPosition(3).y; foreach (MapLayer layer in Map.Instance.Layers) { if ((Object)(object)layer == (Object)null) { continue; } float num; if (value == FloorMode.地上1階で固定) { num = ((layer.layer == 0) ? 0f : (-5f)); } else { if (Mathf.Abs(layer.layer - Map.Instance.PlayerLayer) <= 1) { continue; } num = y; } Vector3 localPosition = ((Component)layer).transform.localPosition; if (localPosition.y != num) { ((Component)layer).transform.localPosition = new Vector3(localPosition.x, num, localPosition.z); } } } private void ApplyHudOffset() { bool value = _minimapEnabled.Value; bool shiftRight = value && _corner.Value == Corner.右上; bool shiftLeft = value && _corner.Value == Corner.左上; _hudShift.Apply(shiftRight, shiftLeft, _hudOffsetRight.Value, _hudOffsetLeft.Value); } private void OnGUI() { //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) DrawKeyCapturePrompt(); DrawLanguagePopup(); if (!_failed && _modEnabled.Value && _minimapEnabled.Value && _view != null && _view.IsReady && SemiFunc.RunIsLevel() && (!_hideWhileFullMapOpen.Value || !IsMapToolVisible())) { float num = _size.Value; float num2 = _margin.Value; float num3 = ((_corner.Value == Corner.左上 || _corner.Value == Corner.左下) ? num2 : ((float)Screen.width - num - num2)); float num4 = ((_corner.Value == Corner.右上 || _corner.Value == Corner.左上) ? num2 : ((float)Screen.height - num - num2)); Color color = GUI.color; GUI.color = new Color(1f, 1f, 1f, _opacity.Value); GUI.DrawTexture(new Rect(num3, num4, num, num), (Texture)(object)_view.Texture, (ScaleMode)2, false); GUI.color = color; } } private void DrawKeyCapturePrompt() { //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: 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_0070: 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_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: 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_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: 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) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Expected O, but got Unknown //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) if (!_failed && _roomMarkKeyCapture != null && _roomMarkKeyCapture.Value) { Rect val = default(Rect); ((Rect)(ref val))..ctor(((float)Screen.width - 520f) * 0.5f, ((float)Screen.height - 64f) * 0.5f, 520f, 64f); Color color = GUI.color; GUI.color = new Color(0.15f, 0.45f, 1f); GUI.DrawTexture(val, (Texture)(object)Texture2D.whiteTexture, (ScaleMode)0, false); Rect val2 = new Rect(((Rect)(ref val)).x + 3f, ((Rect)(ref val)).y + 3f, ((Rect)(ref val)).width - 6f, ((Rect)(ref val)).height - 6f); GUI.color = new Color(0.85f, 0.33f, 0.05f); GUI.DrawTexture(val2, (Texture)(object)Texture2D.whiteTexture, (ScaleMode)0, false); GUI.color = color; GUIStyle val3 = new GUIStyle(GUI.skin.label) { alignment = (TextAnchor)4, fontSize = 26, fontStyle = (FontStyle)1 }; val3.normal.textColor = new Color(0.25f, 0.09f, 0.02f); GUIStyle val4 = val3; GUI.Label(val2, "[PRESS NEW BUTTON]", val4); val4.fontSize = 14; val4.fontStyle = (FontStyle)0; val4.normal.textColor = Color.white; GUI.Label(new Rect(((Rect)(ref val)).x, ((Rect)(ref val)).yMax + 6f, 520f, 22f), $"現在: {GetRoomMarkKey()} Esc で取り消し", val4); } } private void ShowLanguagePopup() { //IL_003c: Unknown result type (might be due to invalid IL or missing references) bool num = _language.Value == Language.English; string header = (num ? "Settings" : "設定"); string text = (num ? "Close and reopen this settings screen to see it in English." : "設定画面を開き直すと日本語に反映されます。"); if (!ConfigLocalization.TryShowPopup(header, new Color(0.2f, 0.55f, 1f), text)) { _languagePopupMessage = text; _languagePopupUntil = Time.time + 6f; } } private void DrawLanguagePopup() { //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_0065: 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_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: 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_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0112: 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: Expected O, but got Unknown if (!string.IsNullOrEmpty(_languagePopupMessage) && !(Time.time >= _languagePopupUntil)) { Rect val = default(Rect); ((Rect)(ref val))..ctor(((float)Screen.width - 780f) * 0.5f, ((float)Screen.height - 160f) * 0.5f, 780f, 160f); Color color = GUI.color; GUI.color = new Color(0.2f, 0.55f, 1f); GUI.DrawTexture(val, (Texture)(object)Texture2D.whiteTexture, (ScaleMode)0, false); Rect val2 = new Rect(((Rect)(ref val)).x + 4f, ((Rect)(ref val)).y + 4f, ((Rect)(ref val)).width - 8f, ((Rect)(ref val)).height - 8f); GUI.color = new Color(0.08f, 0.08f, 0.1f, 0.97f); GUI.DrawTexture(val2, (Texture)(object)Texture2D.whiteTexture, (ScaleMode)0, false); GUI.color = color; GUIStyle val3 = new GUIStyle(GUI.skin.label) { alignment = (TextAnchor)4, fontSize = 28, fontStyle = (FontStyle)1, wordWrap = true }; val3.normal.textColor = Color.white; GUIStyle val4 = val3; GUI.Label(val2, _languagePopupMessage, val4); } } private static bool IsMapToolVisible() { MapToolController instance = MapToolController.instance; if ((Object)(object)instance == (Object)null) { return false; } if ((Object)(object)instance.VisualTransform != (Object)null && ((Component)instance.VisualTransform).gameObject.activeSelf) { return true; } if (_mapToolActiveField == null) { _mapToolActiveField = typeof(MapToolController).GetField("Active", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (_mapToolActiveField == null) { return false; } } return (bool)_mapToolActiveField.GetValue(instance); } private void ForceCustomMarkerVisibility(float deltaTime) { //IL_0069: 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_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) _forceMarkerTimer -= deltaTime; if (_forceMarkerTimer > 0f) { return; } _forceMarkerTimer = 0.5f; MapCustomEntity[] array = Object.FindObjectsOfType(); for (int i = 0; i < array.Length; i++) { SpriteRenderer spriteRenderer = array[i].spriteRenderer; if (!((Object)(object)spriteRenderer == (Object)null)) { if (!_forcedMarkerAlpha.ContainsKey(spriteRenderer)) { _forcedMarkerAlpha[spriteRenderer] = spriteRenderer.color.a; } Color color = spriteRenderer.color; if (color.a != 1f) { color.a = 1f; spriteRenderer.color = color; } } } } private void RestoreCustomMarkerVisibility() { //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_003c: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) if (_forcedMarkerAlpha.Count == 0) { return; } foreach (KeyValuePair item in _forcedMarkerAlpha) { SpriteRenderer key = item.Key; if (!((Object)(object)key == (Object)null)) { Color color = key.color; if (color.a != item.Value) { color.a = item.Value; key.color = color; } } } _forcedMarkerAlpha.Clear(); _forceMarkerTimer = 0f; } } internal sealed class RoomMarks { private const byte EventCode = 173; private const float KeyQuantize = 2f; private readonly Dictionary _marks = new Dictionary(); private readonly Dictionary _positions = new Dictionary(); private readonly List _stale = new List(); private Transform _boundOverlay; private Sprite _sprite; private bool _listening; private int _knownPlayers; internal int Count => _marks.Count; internal void StartListening() { if (!_listening && PhotonNetwork.NetworkingClient != null) { PhotonNetwork.NetworkingClient.EventReceived += HandleEvent; _listening = true; } } internal void StopListening() { if (_listening && PhotonNetwork.NetworkingClient != null) { PhotonNetwork.NetworkingClient.EventReceived -= HandleEvent; _listening = false; } } internal void Toggle(out string message) { //IL_0018: 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_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_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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_0062: Unknown result type (might be due to invalid IL or missing references) Transform currentAnchor = GetCurrentAnchor(); if ((Object)(object)currentAnchor == (Object)null) { message = "今いる部屋を特定できませんでした。"; return; } Vector3 position = currentAnchor.position; Vector3Int key = ToKey(position); bool flag = !_marks.ContainsKey(key); if (flag) { if (!Place(key, position)) { message = "印を置けませんでした。"; return; } message = "この部屋に印を付けました。"; } else { Remove(key); message = "この部屋の印を消しました。"; } Broadcast(position, flag); } internal void Tick(bool enabled, float scale, bool showOnFullMap, List overrides, List uprightOnMinimap, PaletteColor colorChoice) { //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_008a: 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_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: 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) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_011c: 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) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) Map instance = Map.Instance; if ((Object)(object)instance == (Object)null || (Object)(object)instance.OverLayerParent == (Object)null) { Clear(); return; } if (!enabled) { Hide(); return; } if ((Object)(object)_boundOverlay != (Object)(object)instance.OverLayerParent) { Clear(); _boundOverlay = instance.OverLayerParent; } ShareWithNewcomers(); Color color; bool flag = MapPalette.TryResolve(colorChoice, out color); float num; if (!((Object)(object)DirtFinderMapPlayer.Instance != (Object)null)) { num = 0f; } else { Quaternion rotation = ((Component)DirtFinderMapPlayer.Instance).transform.rotation; num = ((Quaternion)(ref rotation)).eulerAngles.y; } float num2 = num; Quaternion val = Quaternion.Euler(90f, num2, 0f); _stale.Clear(); foreach (KeyValuePair mark in _marks) { if ((Object)(object)mark.Value == (Object)null) { _stale.Add(mark.Key); continue; } Transform transform = mark.Value.transform; if (transform.localScale != Vector3.one * scale) { transform.localScale = Vector3.one * scale; } if (transform.rotation != val) { transform.rotation = val; } uprightOnMinimap?.Add(transform); SpriteRenderer component = mark.Value.GetComponent(); if (!((Object)(object)component == (Object)null)) { if (flag && component.color != color) { component.color = color; } if (showOnFullMap) { ((Renderer)component).enabled = true; continue; } ((Renderer)component).enabled = false; overrides.Add(new MinimapView.RendererOverride((Renderer)(object)component, enabled: true)); } } foreach (Vector3Int item in _stale) { _marks.Remove(item); _positions.Remove(item); } } private void Hide() { foreach (GameObject value in _marks.Values) { if (!((Object)(object)value == (Object)null)) { SpriteRenderer component = value.GetComponent(); if ((Object)(object)component != (Object)null && ((Renderer)component).enabled) { ((Renderer)component).enabled = false; } } } } internal void Clear() { foreach (GameObject value in _marks.Values) { if ((Object)(object)value != (Object)null) { Object.Destroy((Object)(object)value); } } _marks.Clear(); _positions.Clear(); _boundOverlay = null; _knownPlayers = 0; } private void ShareWithNewcomers() { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) if (!PhotonNetwork.InRoom || PhotonNetwork.CurrentRoom == null) { _knownPlayers = 0; return; } int playerCount = PhotonNetwork.CurrentRoom.PlayerCount; if (playerCount <= _knownPlayers) { _knownPlayers = playerCount; return; } _knownPlayers = playerCount; foreach (Vector3 value in _positions.Values) { Broadcast(value, added: true); } } private void Broadcast(Vector3 position, bool added) { //IL_0010: 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_002c: 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) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown if (PhotonNetwork.InRoom) { object[] array = new object[4] { position.x, position.y, position.z, added }; PhotonNetwork.RaiseEvent((byte)173, (object)array, new RaiseEventOptions { Receivers = (ReceiverGroup)0 }, SendOptions.SendReliable); } } private void HandleEvent(EventData data) { //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: 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) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) if (data.Code != 173 || !(data.CustomData is object[] array) || array.Length < 4 || !(array[0] is float num) || !(array[1] is float num2) || !(array[2] is float num3) || !(array[3] is bool flag)) { return; } Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(num, num2, num3); Vector3Int key = ToKey(val); if (flag) { if (!_marks.ContainsKey(key)) { Place(key, val); } } else { Remove(key); } } private void Remove(Vector3Int key) { //IL_0006: 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_0032: Unknown result type (might be due to invalid IL or missing references) if (_marks.TryGetValue(key, out var value) && (Object)(object)value != (Object)null) { Object.Destroy((Object)(object)value); } _marks.Remove(key); _positions.Remove(key); } private static Vector3Int ToKey(Vector3 position) { //IL_0000: 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_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) return new Vector3Int(Mathf.RoundToInt(position.x * 2f), Mathf.RoundToInt(position.y * 2f), Mathf.RoundToInt(position.z * 2f)); } private static Transform GetCurrentAnchor() { PlayerAvatar instance = PlayerAvatar.instance; if ((Object)(object)instance == (Object)null || (Object)(object)instance.RoomVolumeCheck == (Object)null) { return null; } List currentRooms = instance.RoomVolumeCheck.CurrentRooms; if (currentRooms == null) { return null; } foreach (RoomVolume item in currentRooms) { if (!((Object)(object)item == (Object)null)) { return ((Object)(object)item.Module != (Object)null) ? ((Component)item.Module).transform : ((Component)item).transform; } } return null; } private bool Place(Vector3Int key, Vector3 worldPosition) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0078: 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_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: 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_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) Map instance = Map.Instance; if ((Object)(object)instance == (Object)null || (Object)(object)instance.OverLayerParent == (Object)null) { return false; } GameObject val = new GameObject("RepoMapFix Room Mark"); val.transform.SetParent(instance.OverLayerParent, false); val.layer = ((Component)instance.OverLayerParent).gameObject.layer; SpriteRenderer obj = val.AddComponent(); obj.sprite = GetSprite(); ((Renderer)obj).sortingOrder = 100; val.transform.position = worldPosition * instance.Scale + instance.OverLayerParent.position; val.transform.localPosition = new Vector3(val.transform.localPosition.x, 0f, val.transform.localPosition.z); _marks[key] = val; _positions[key] = worldPosition; return true; } private Sprite GetSprite() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002b: 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_003a: Expected O, but got Unknown //IL_014c: 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_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: 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_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_sprite != (Object)null) { return _sprite; } Texture2D val = new Texture2D(64, 64, (TextureFormat)4, false) { name = "RepoMapFix Room Mark", filterMode = (FilterMode)1, wrapMode = (TextureWrapMode)1 }; Vector2 start = default(Vector2); ((Vector2)(ref start))..ctor(0.2f, 0.52f); Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(0.42f, 0.28f); Vector2 end = default(Vector2); ((Vector2)(ref end))..ctor(0.8f, 0.76f); Color32[] array = (Color32[])(object)new Color32[4096]; Vector2 point = default(Vector2); for (int i = 0; i < 64; i++) { for (int j = 0; j < 64; j++) { ((Vector2)(ref point))..ctor(((float)j + 0.5f) / 64f, ((float)i + 0.5f) / 64f); float num = Mathf.Min(DistanceToSegment(point, start, val2), DistanceToSegment(point, val2, end)); float num2 = Mathf.Clamp01((0.085f - num) / 0.0425f); array[i * 64 + j] = new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, (byte)(num2 * 255f)); } } val.SetPixels32(array); val.Apply(false, true); _sprite = Sprite.Create(val, new Rect(0f, 0f, 64f, 64f), new Vector2(0.5f, 0.5f), 64f); ((Object)_sprite).name = "RepoMapFix Room Mark"; return _sprite; } private static float DistanceToSegment(Vector2 point, Vector2 start, Vector2 end) { //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_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: 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_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0036: 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_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0018: 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) Vector2 val = end - start; float sqrMagnitude = ((Vector2)(ref val)).sqrMagnitude; if (sqrMagnitude <= 1E-06f) { return Vector2.Distance(point, start); } float num = Mathf.Clamp01(Vector2.Dot(point - start, val) / sqrMagnitude); return Vector2.Distance(point, start + val * num); } } }