Decompiled source of BetterScoutReport v0.2.6

plugins/com.atomic.details.dll

Decompiled a month ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Peak;
using TMPro;
using TerrainRandomiser;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
using Zorro.Core;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("com.atomic.details")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("0.2.6.0")]
[assembly: AssemblyInformationalVersion("0.2.6+652b6ee5791df3a1563fcb1711a0dc6e74e886f3")]
[assembly: AssemblyProduct("com.atomic.details")]
[assembly: AssemblyTitle("MoreRunDetails")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.2.6.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace BepInEx
{
	[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
	[Conditional("CodeGeneration")]
	internal sealed class BepInAutoPluginAttribute : Attribute
	{
		public BepInAutoPluginAttribute(string? id = null, string? name = null, string? version = null)
		{
		}
	}
}
namespace BepInEx.Preloader.Core.Patching
{
	[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
	[Conditional("CodeGeneration")]
	internal sealed class PatcherAutoPluginAttribute : Attribute
	{
		public PatcherAutoPluginAttribute(string? id = null, string? name = null, string? version = null)
		{
		}
	}
}
namespace MoreRunDetails
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.atomic.details", "MoreRunDetails", "0.2.6")]
	public class Plugin : BaseUnityPlugin
	{
		private Harmony harmony;

		public static List<SegmentInfo> sectionTimes = new List<SegmentInfo>();

		public static ConfigEntry<KeyCode> toggleKeybind;

		public static ConfigEntry<bool> showDayAndLevel;

		public static ConfigEntry<bool> showCurrentAscent;

		public static ConfigEntry<bool> autoOpen;

		public static ConfigEntry<bool> terrainRandomiserSeed;

		public static bool hasTerrainRandomiser = false;

		public const string Id = "com.atomic.details";

		internal static ManualLogSource Log { get; private set; } = null;

		public static Plugin Instance { get; private set; } = null;

		public static string Name => "MoreRunDetails";

		public static string Version => "0.2.6";

		private void Awake()
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Expected O, but got Unknown
			Log = ((BaseUnityPlugin)this).Logger;
			Instance = this;
			harmony = new Harmony("com.atomic.details");
			harmony.PatchAll();
			Log.LogInfo((object)("Plugin " + Name + " is loaded!"));
			autoOpen = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Auto Open UI", false, "Automatically open the UI when the end screen is shown.");
			toggleKeybind = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("General", "Toggle Keybind", (KeyCode)103, "Click this button to toggle the UI into view. (ONLY VISIBLE ON THE SCOUT REPORT)");
			showDayAndLevel = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Show Day and Level", true, "Show the current Day and Level on the UI, this is shown next to the timeline title.");
			showCurrentAscent = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Show Current Ascent", true, "Show the current Ascent on the UI, this is shown just below the scout report.");
			terrainRandomiserSeed = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Show Terrain Randomiser Seed", true, "Show the Terrain Randomiser Seed on the UI, if Terrain Randomiser is installed.");
			hasTerrainRandomiser = Chainloader.PluginInfos.ContainsKey("com.snosz.terrainrandomiser");
		}

		private void Update()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			if (Input.GetKeyDown(toggleKeybind.Value))
			{
				UICreator.ToggleUI();
			}
		}
	}
	public class SegmentInfo
	{
		public Segment segment;

		public float time;

		public float duration;

		public bool died;
	}
	[HarmonyPatch]
	public static class Patches
	{
		public static void TrackSegment(Segment currentSegment)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: 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_00a6: Unknown result type (might be due to invalid IL or missing references)
			float timeSinceRunStarted = RunManager.Instance.timeSinceRunStarted;
			if (!Plugin.sectionTimes.Any((SegmentInfo s) => s.segment == currentSegment))
			{
				float num = Plugin.sectionTimes.Sum((SegmentInfo s) => s.duration);
				float num2 = timeSinceRunStarted - num;
				if (!RunSettings.isMiniRun)
				{
					Plugin.sectionTimes.Add(new SegmentInfo
					{
						segment = currentSegment,
						time = timeSinceRunStarted,
						duration = num2,
						died = false
					});
					Plugin.Log.LogInfo((object)$"{currentSegment} recorded: {num2}s (Total: {timeSinceRunStarted:F2}s)");
				}
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(EndScreen), "Awake")]
		public static void EndScreenShown(EndScreen __instance)
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			int currentSegment = Singleton<MapHandler>.Instance.currentSegment;
			Segment currentSegment2 = (Segment)(byte)currentSegment;
			bool flag = Plugin.sectionTimes.Any((SegmentInfo s) => s.segment == currentSegment2);
			TrackSegment(currentSegment2);
			UICreator.CreateOrUpdate(__instance);
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(GUIManager), "SetHeroTitle")]
		public static void HeroTitleShown(GUIManager __instance, string text)
		{
			//IL_0019: 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)
			if (text.ToLower() == "peak")
			{
				MapHandler instance = Singleton<MapHandler>.Instance;
				Segment currentSegment = instance.GetCurrentSegment();
				TrackSegment(currentSegment);
			}
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(Action_WarpToBiome), "RunAction")]
		public static void TeleportToNadir()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			MapHandler instance = Singleton<MapHandler>.Instance;
			Segment currentSegment = instance.GetCurrentSegment();
			TrackSegment(currentSegment);
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(PeakGatePortal), "Interact_CastFinished")]
		public static void PEAKGatePoralTrack(PeakGatePortal __instance, Character interactor)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			MapHandler instance = Singleton<MapHandler>.Instance;
			Segment currentSegment = instance.GetCurrentSegment();
			TrackSegment(currentSegment);
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(Campfire), "Light_Rpc")]
		public static void OnCampfireLight(Campfire __instance)
		{
			//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_0007: 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_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			Segment advanceToSegment = __instance.advanceToSegment;
			Segment currentSegment = (Segment)(byte)(advanceToSegment - 1);
			TrackSegment(currentSegment);
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(RunManager), "StartRun")]
		public static void OnRunStart(RunManager __instance)
		{
			//IL_000f: 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_0047: 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)
			Plugin.sectionTimes.Clear();
			UICreator.ResetUI();
			Scene activeScene = SceneManager.GetActiveScene();
			if (((Scene)(ref activeScene)).name.Contains("Level"))
			{
				MapSegment[] segments = Singleton<MapHandler>.Instance.segments;
				foreach (MapSegment val in segments)
				{
					Plugin.Log.LogInfo((object)("Segment available: " + ((object)val.biome/*cast due to .constrained prefix*/).ToString()));
				}
			}
		}
	}
	internal class UICreator
	{
		private static List<GameObject> uiParts = new List<GameObject>();

		private static Dictionary<GameObject, Vector3> originalPositions = new Dictionary<GameObject, Vector3>();

		private static bool isVisible = false;

		private static Coroutine animationRoutine;

		private static float slideDistance = 700f;

		private static float lerpSpeed = 8f;

		private static Vector3 baseOffset = new Vector3(425f, 115f, 0f);

		private static Vector3 verticalPageOffset = new Vector3(0f, -230f, 0f);

		private static Vector3 entrySpacing = new Vector3(0f, -25f, 0f);

		private static Vector3 entryStartOffset = new Vector3(0f, -35f, 0f);

		public static void ResetUI()
		{
			uiParts.Clear();
			originalPositions.Clear();
			isVisible = false;
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		private static bool CheckRandomiserSettings()
		{
			if (Object.op_Implicit((Object)(object)Plugin.Instance))
			{
				return Plugin.Instance.mapSettings.enableRandomiser;
			}
			return false;
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		private static string GetRandomiserText()
		{
			if (Plugin.terrainRandomiserSeed.Value)
			{
				return $"TIMELINE (DAY: {DayNightManager.instance.dayCount}) (TERRAIN RANDOMISER SEED: {Plugin.Instance.mapSettings.seed})";
			}
			return $"TIMELINE (DAY: {DayNightManager.instance.dayCount}) (TERRAIN RANDOMISER)";
		}

		public static void CreateOrUpdate(EndScreen __instance)
		{
			//IL_0133: Unknown result type (might be due to invalid IL or missing references)
			//IL_0147: Unknown result type (might be due to invalid IL or missing references)
			//IL_014c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0163: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0240: Unknown result type (might be due to invalid IL or missing references)
			//IL_0260: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0303: Unknown result type (might be due to invalid IL or missing references)
			//IL_0329: Unknown result type (might be due to invalid IL or missing references)
			//IL_032e: Unknown result type (might be due to invalid IL or missing references)
			//IL_036c: Unknown result type (might be due to invalid IL or missing references)
			//IL_038e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0393: Unknown result type (might be due to invalid IL or missing references)
			//IL_0398: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_03fc: Unknown result type (might be due to invalid IL or missing references)
			Plugin.Log.LogInfo((object)"Creating custom end screen UI.");
			uiParts.Clear();
			originalPositions.Clear();
			GameObject gameObject = ((Component)((Component)__instance).transform.Find("Panel/HolePunch")).gameObject;
			GameObject gameObject2 = ((Component)((Component)__instance).transform.Find("Panel/BG")).gameObject;
			GameObject gameObject3 = ((Component)((Component)__instance).transform.Find("Panel/Margin/SCOUTING_REPORT")).gameObject;
			Transform panel = ((Component)__instance).transform.Find("Panel");
			if (Plugin.showDayAndLevel.Value)
			{
				GameObject gameObject4 = ((Component)((Component)__instance).transform.Find("Panel/Margin/Layout/Window_TIMELINE/Title")).gameObject;
				Object.Destroy((Object)(object)gameObject4.GetComponent<LocalizedText>());
				TextMeshProUGUI component = gameObject4.GetComponent<TextMeshProUGUI>();
				if (Plugin.hasTerrainRandomiser && CheckRandomiserSettings())
				{
					((TMP_Text)component).text = GetRandomiserText();
				}
				else
				{
					object arg = DayNightManager.instance.dayCount;
					Scene activeScene = SceneManager.GetActiveScene();
					((TMP_Text)component).text = $"TIMELINE (DAY: {arg}) ({((Scene)(ref activeScene)).name})";
				}
			}
			if (Plugin.showCurrentAscent.Value)
			{
				GameObject val = Object.Instantiate<GameObject>(gameObject3, gameObject3.transform.parent);
				((Object)val).name = "MoreDetailsAscent";
				val.transform.localPosition = gameObject3.transform.localPosition - new Vector3(0f, 15f, 0f);
				val.transform.localScale = gameObject3.transform.localScale;
				Object.Destroy((Object)(object)val.GetComponent<LocalizedText>());
				TextMeshProUGUI component2 = val.GetComponent<TextMeshProUGUI>();
				string text = "PEAK (ASCENT 0)";
				if (Ascents.currentAscent < 0)
				{
					text = "TENDERFOOT";
				}
				else if (Ascents.currentAscent > 0)
				{
					text = $"ASCENT {Ascents.currentAscent}";
				}
				if (RunSettings.isMiniRun)
				{
					text = "MINI RUN";
				}
				else if (RunSettings._isCustomRun)
				{
					text = "CUSTOM RUN";
				}
				((TMP_Text)component2).text = text;
				((TMP_Text)component2).fontSizeMin = 16f;
				((TMP_Text)component2).fontSizeMax = 16f;
				((TMP_Text)component2).fontSize = 16f;
			}
			if (RunSettings.isMiniRun)
			{
				return;
			}
			GameObject val2 = Object.Instantiate<GameObject>(gameObject, gameObject.transform.parent);
			((Object)val2).name = "MoreDetailsHolePunch";
			val2.transform.localPosition = new Vector3(221.4f, 0.1225f, 0f);
			val2.transform.localScale = new Vector3(0.99f, 0.99f, 0.99f);
			TrackObject(val2);
			GameObject val3 = Object.Instantiate<GameObject>(gameObject2, gameObject2.transform.parent);
			((Object)val3).name = "MoreDetailsKeybindFrame";
			val3.transform.localPosition = new Vector3(256.6f, 0f, 0f);
			val3.transform.localScale = new Vector3(0.12f, 0.11f, 0.1f);
			GameObject val4 = Object.Instantiate<GameObject>(gameObject3, val3.transform);
			((Object)val4).name = "MoreDetailsKeybind";
			val4.transform.localPosition = Vector3.zero;
			val4.transform.localScale = Vector3.one;
			Object.Destroy((Object)(object)val4.GetComponent<LocalizedText>());
			TextMeshProUGUI component3 = val4.GetComponent<TextMeshProUGUI>();
			((TMP_Text)component3).text = ((object)Plugin.toggleKeybind.Value/*cast due to .constrained prefix*/).ToString();
			((TMP_Text)component3).fontSizeMin = 250f;
			((TMP_Text)component3).fontSizeMax = 250f;
			((TMP_Text)component3).fontSize = 250f;
			GameObject titleTemplate = CreatePage(__instance, "Exited", baseOffset, "CAMPFIRE", gameObject2, panel, gameObject3);
			PopulateEntries(titleTemplate, useTotalTime: true);
			GameObject titleTemplate2 = CreatePage(__instance, "Spent", baseOffset + verticalPageOffset, "TIME SPENT", gameObject2, panel, gameObject3);
			PopulateEntries(titleTemplate2, useTotalTime: false);
			foreach (GameObject uiPart in uiParts)
			{
				if ((Object)(object)uiPart != (Object)null)
				{
					uiPart.transform.localPosition = originalPositions[uiPart] + new Vector3(slideDistance, 0f, 0f);
				}
			}
			isVisible = false;
			if (Plugin.autoOpen.Value)
			{
				ToggleUI();
			}
		}

		public static void ToggleUI()
		{
			if (uiParts.Count != 0)
			{
				isVisible = !isVisible;
				if (animationRoutine != null)
				{
					((MonoBehaviour)Plugin.Instance).StopCoroutine(animationRoutine);
				}
				animationRoutine = ((MonoBehaviour)Plugin.Instance).StartCoroutine(TweenIndividualParts());
			}
		}

		private static IEnumerator TweenIndividualParts()
		{
			float elapsed = 0f;
			float duration = 1f;
			while (elapsed < duration)
			{
				elapsed += Time.deltaTime;
				foreach (GameObject uiPart in uiParts)
				{
					if (!((Object)(object)uiPart == (Object)null))
					{
						Vector3 val = originalPositions[uiPart] + new Vector3(slideDistance, 0f, 0f);
						Vector3 val2 = originalPositions[uiPart];
						Vector3 val3 = (isVisible ? val2 : val);
						uiPart.transform.localPosition = Vector3.Lerp(uiPart.transform.localPosition, val3, Time.deltaTime * lerpSpeed);
					}
				}
				yield return null;
			}
			foreach (GameObject uiPart2 in uiParts)
			{
				if (!((Object)(object)uiPart2 == (Object)null))
				{
					uiPart2.transform.localPosition = (isVisible ? originalPositions[uiPart2] : (originalPositions[uiPart2] + new Vector3(slideDistance, 0f, 0f)));
				}
			}
			animationRoutine = null;
		}

		private static GameObject CreatePage(EndScreen __instance, string suffix, Vector3 offset, string title, GameObject BG, Transform panel, GameObject SCOUTING_REPORT)
		{
			//IL_000f: 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_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: 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_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_00a6: 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_00bf: 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)
			Vector3 val = new Vector3(-105f, 0f, 0f) + offset;
			GameObject val2 = Object.Instantiate<GameObject>(BG, panel);
			((Object)val2).name = "MoreDetailsBG_" + suffix;
			val2.transform.localPosition = BG.transform.localPosition + val;
			val2.transform.localScale = new Vector3(0.5f, 0.5f, 0.5f);
			TrackObject(val2);
			GameObject val3 = Object.Instantiate<GameObject>(SCOUTING_REPORT, panel);
			((Object)val3).name = "MoreDetailsTitle_" + suffix;
			val3.transform.localPosition = SCOUTING_REPORT.transform.localPosition + offset + new Vector3(-95f, -90f, 0f);
			val3.transform.localScale = Vector3.one;
			TrackObject(val3);
			LocalizedText val4 = default(LocalizedText);
			if (val3.TryGetComponent<LocalizedText>(ref val4))
			{
				Object.Destroy((Object)(object)val4);
			}
			TextMeshProUGUI component = val3.GetComponent<TextMeshProUGUI>();
			((TMP_Text)component).fontSizeMin = 32f;
			((TMP_Text)component).fontSizeMax = 32f;
			((TMP_Text)component).text = title;
			return val3;
		}

		private static void PopulateEntries(GameObject titleTemplate, bool useTotalTime)
		{
			//IL_0039: 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_0053: Invalid comparison between Unknown and I4
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Invalid comparison between Unknown and I4
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Invalid comparison between Unknown and I4
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Invalid comparison between Unknown and I4
			//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01be: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0207: Unknown result type (might be due to invalid IL or missing references)
			//IL_0213: Unknown result type (might be due to invalid IL or missing references)
			//IL_021f: Unknown result type (might be due to invalid IL or missing references)
			//IL_022e: 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_013d: Invalid comparison between Unknown and I4
			MapSegment[] segments = Singleton<MapHandler>.Instance.segments;
			int num = 0;
			foreach (SegmentInfo sectionTime in Plugin.sectionTimes)
			{
				string text = ((object)Unsafe.As<Segment, Segment>(ref sectionTime.segment)/*cast due to .constrained prefix*/).ToString();
				if ((int)sectionTime.segment == 0)
				{
					text = "Shore";
				}
				else if ((int)sectionTime.segment == 1 && segments.Any((MapSegment s) => ((object)s.biome/*cast due to .constrained prefix*/).ToString() == "Roots"))
				{
					text = "Roots";
				}
				else if ((int)sectionTime.segment == 2 && segments.Any((MapSegment s) => ((object)s.biome/*cast due to .constrained prefix*/).ToString() == "Mesa"))
				{
					text = "Mesa";
				}
				else if ((int)sectionTime.segment == 3 && segments.Any((MapSegment s) => ((object)s.biome/*cast due to .constrained prefix*/).ToString() == "Swamp"))
				{
					text = "Gloom";
				}
				else if ((int)sectionTime.segment == 4 && segments.Any((MapSegment s) => ((object)s.biome/*cast due to .constrained prefix*/).ToString() == "Swamp"))
				{
					text = "Citadel";
				}
				else if ((int)sectionTime.segment == 5)
				{
					text = "Nadir";
				}
				float num2 = (useTotalTime ? sectionTime.time : sectionTime.duration);
				TimeSpan timeSpan = TimeSpan.FromSeconds(num2);
				string text2 = $"{(int)timeSpan.TotalHours:D1}:{timeSpan.Minutes:D2}:{timeSpan.Seconds:D2}";
				GameObject val = Object.Instantiate<GameObject>(titleTemplate, titleTemplate.transform.parent);
				val.transform.localPosition = titleTemplate.transform.localPosition + entryStartOffset + entrySpacing * (float)num;
				val.transform.localScale = Vector3.one;
				((Object)val).name = text;
				TrackObject(val);
				TextMeshProUGUI component = val.GetComponent<TextMeshProUGUI>();
				((Graphic)component).color = new Color(((Graphic)component).color.r, ((Graphic)component).color.g, ((Graphic)component).color.b, 0.7f);
				((TMP_Text)component).fontSize = 20f;
				((TMP_Text)component).fontSizeMin = 20f;
				((TMP_Text)component).fontSizeMax = 20f;
				((TMP_Text)component).text = (sectionTime.died ? ("<s>" + text + " [X]: " + text2 + "</s>") : (text + ": " + text2));
				num++;
			}
		}

		private static void TrackObject(GameObject obj)
		{
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)obj == (Object)null))
			{
				uiParts.Add(obj);
				originalPositions[obj] = obj.transform.localPosition;
			}
		}
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}