Decompiled source of ExpeditionSaveManager v1.8.49

BepInEx/plugins/scr.TSave.dll

Decompiled a day ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
using System.Threading.Tasks;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using ExitGames.Client.Photon;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Peak;
using Peak.Network;
using Photon.Pun;
using Photon.Realtime;
using TMPro;
using TSave;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.Events;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
using Zorro.Core;
using Zorro.Core.Serizalization;
using Zorro.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("scr.TSave")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("0.1.0.0")]
[assembly: AssemblyInformationalVersion("0.1.0")]
[assembly: AssemblyProduct("scr.TSave")]
[assembly: AssemblyTitle("TSave")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.1.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
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;
		}
	}
}
internal sealed class ButtonTextColorState : MonoBehaviour
{
	private static readonly Color EnabledColor = Color.white;

	private static readonly Color DisabledColor = Color.black;

	private Button button;

	private TMP_Text[] tmpTexts = Array.Empty<TMP_Text>();

	private Text[] uiTexts = Array.Empty<Text>();

	private bool hasLastState;

	private bool lastInteractable;

	internal void Bind(Button targetButton)
	{
		button = targetButton;
		RefreshCache();
		Apply(force: true);
	}

	private void Awake()
	{
		if ((Object)(object)button == (Object)null)
		{
			button = ((Component)this).GetComponent<Button>();
		}
		RefreshCache();
	}

	private void OnEnable()
	{
		Apply(force: true);
	}

	private void LateUpdate()
	{
		Apply(force: false);
	}

	private void RefreshCache()
	{
		tmpTexts = ((Component)this).GetComponentsInChildren<TMP_Text>(true);
		uiTexts = ((Component)this).GetComponentsInChildren<Text>(true);
	}

	private void Apply(bool force)
	{
		//IL_005c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0055: Unknown result type (might be due to invalid IL or missing references)
		//IL_0061: Unknown result type (might be due to invalid IL or missing references)
		//IL_0094: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)button == (Object)null)
		{
			return;
		}
		bool interactable = ((Selectable)button).interactable;
		if (!force && hasLastState && interactable == lastInteractable)
		{
			return;
		}
		hasLastState = true;
		lastInteractable = interactable;
		Color color = (interactable ? EnabledColor : DisabledColor);
		if (tmpTexts != null)
		{
			for (int i = 0; i < tmpTexts.Length; i++)
			{
				TMP_Text val = tmpTexts[i];
				if ((Object)(object)val != (Object)null)
				{
					((Graphic)val).color = color;
				}
			}
		}
		if (uiTexts == null)
		{
			return;
		}
		for (int j = 0; j < uiTexts.Length; j++)
		{
			Text val2 = uiTexts[j];
			if ((Object)(object)val2 != (Object)null)
			{
				((Graphic)val2).color = color;
			}
		}
	}
}
[Serializable]
public sealed class CampfireSnapshot
{
	public int segmentIndex;

	public string campfireName;

	public int state;

	public float beenBurningFor;

	public int advanceToSegment;
}
[Serializable]
public sealed class CharacterSnapshot
{
	public bool dead;

	public bool passedOut;

	public bool fullyPassedOut;

	public bool isGrounded;

	public bool isClimbing;

	public bool isRopeClimbing;

	public bool isVineClimbing;

	public bool isSprinting;

	public float currentStamina;

	public float extraStamina;

	public float sinceGrounded;

	public Vector2Snapshot lookValues = new Vector2Snapshot();

	public List<string> checkpointFlagPaths = new List<string>();

	public List<CharacterStatusSnapshot> statuses = new List<CharacterStatusSnapshot>();
}
[Serializable]
public sealed class CharacterStatusSnapshot
{
	public string statusType;

	public float amount;
}
[Serializable]
public sealed class ContainerSnapshot
{
	public string containerType;

	public string objectName;

	public string objectPath;

	public Vector3Snapshot position = new Vector3Snapshot();

	public int state;

	public bool boolA;

	public bool boolB;

	public float floatA;
}
[Serializable]
public sealed class GroundItemSnapshot
{
	public ushort itemId = ushort.MaxValue;

	public string objectName;

	public string objectPath;

	public Vector3Snapshot position = new Vector3Snapshot();

	public Vector3Snapshot rotation = new Vector3Snapshot();

	public Vector3Snapshot velocity = new Vector3Snapshot();

	public Vector3Snapshot angularVelocity = new Vector3Snapshot();

	public bool isKinematic;

	public int? itemUses;

	public int? petterItemUses;

	public float? useRemainingPercentage;

	public bool? used;

	public float? fuel;

	public int? cookedAmount;

	public bool? flareActive;

	public float? screamTime;

	public bool? spawnedBees;

	public List<ItemDataEntrySnapshot> dataEntries = new List<ItemDataEntrySnapshot>();
}
[Serializable]
public sealed class InventorySnapshot
{
	public List<ItemSlotSnapshot> mainSlots = new List<ItemSlotSnapshot>();

	public ItemSlotSnapshot tempSlot = ItemSlotSnapshot.Empty();

	public bool hasBackpack;

	public ItemSlotSnapshot backpackItemSlot = ItemSlotSnapshot.Empty();

	public List<ItemSlotSnapshot> backpackSlots = new List<ItemSlotSnapshot>();

	public int? selectedSlotId;

	public int? equippedMainSlotIndex;

	public bool equippedTempSlot;

	public int? equippedBackpackSlotIndex;

	public ushort heldItemId = ushort.MaxValue;
}
[Serializable]
public sealed class ItemDataEntrySnapshot
{
	public int keyValue;

	public string keyName;

	public string valueType;

	public bool hasValue;

	public int? intValue;

	public float? floatValue;

	public bool? boolValue;

	public string stringValue;

	public Vector4Snapshot colorValue = new Vector4Snapshot();

	public bool hasColorValue;

	public string serializedJson;

	public List<ItemSlotSnapshot> backpackSlots = new List<ItemSlotSnapshot>();
}
[Serializable]
public sealed class ItemSlotSnapshot
{
	public ushort itemId = ushort.MaxValue;

	public int? itemUses;

	public int? petterItemUses;

	public float? useRemainingPercentage;

	public bool? used;

	public float? fuel;

	public int? cookedAmount;

	public bool? flareActive;

	public float? screamTime;

	public bool? spawnedBees;

	public List<ItemDataEntrySnapshot> dataEntries = new List<ItemDataEntrySnapshot>();

	public static ItemSlotSnapshot Empty()
	{
		return new ItemSlotSnapshot
		{
			itemId = ushort.MaxValue
		};
	}

	public bool HasItem()
	{
		return itemId != ushort.MaxValue;
	}
}
[HarmonyPatch(typeof(LevelGeneration), "Generate")]
internal static class LevelGenerationGeneratePatch
{
	private static void Prefix(LevelGeneration __instance)
	{
		if (SaveManagerPlugin.TryGetPendingSeed(out var seed))
		{
			__instance.seed = seed;
			Random.InitState(seed);
		}
	}
}
[HarmonyPatch(typeof(LevelGeneration), "RandomizeBiomeVariants")]
internal static class LevelGenerationRandomizeBiomeVariantsPatch
{
	private static void Prefix()
	{
		if (SaveManagerPlugin.TryGetPendingSeed(out var seed))
		{
			Random.InitState(seed);
		}
	}
}
[Serializable]
public sealed class LuggageSnapshot
{
	public string objectName;

	public string objectPath;

	public Vector3Snapshot position = new Vector3Snapshot();

	public int state;

	public bool isRespawnChest;

	public bool respawnChestSpent;

	public bool respawnChestRevivedPlayers;
}
[HarmonyPatch(typeof(PauseMenuMainPage), "OnEnable")]
internal static class PauseMenuMainPageOnEnablePatch
{
	private static void Postfix(PauseMenuMainPage __instance)
	{
		SaveManagerPlugin.TryAttachPauseMenuButton(__instance);
	}
}
[HarmonyPatch(typeof(PauseMenuMainPage), "OnQuitClicked")]
internal static class PauseMenuMainPageOnQuitClickedPatch
{
	private static bool Prefix(PauseMenuMainPage __instance)
	{
		return !SaveManagerPlugin.TryInterceptPauseQuit(__instance);
	}
}
[HarmonyPatch(typeof(PauseMenuMainPage), "Start")]
internal static class PauseMenuMainPageStartPatch
{
	private static void Postfix(PauseMenuMainPage __instance)
	{
		SaveManagerPlugin.TryAttachPauseMenuButton(__instance);
	}
}
[Serializable]
public sealed class PlayerSnapshot
{
	public string playerName;

	public int actorNumber;

	public string userId;

	public Vector3Snapshot position = new Vector3Snapshot();

	public Vector3Snapshot rotation = new Vector3Snapshot();

	public Vector3Snapshot velocity = new Vector3Snapshot();

	public Vector3Snapshot angularVelocity = new Vector3Snapshot();

	public CharacterSnapshot character = new CharacterSnapshot();

	public InventorySnapshot inventory = new InventorySnapshot();
}
[Serializable]
public sealed class SaveEnvelope
{
	public string pluginName = "Expedition Save Manager";

	public string pluginGuid = "com.scr.peakexpeditionsavemanager";

	public string pluginVersion = "1.8.49";

	public int formatVersion = 6;

	public SaveMetadata metadata = new SaveMetadata();

	public List<PlayerSnapshot> players = new List<PlayerSnapshot>();

	public List<CampfireSnapshot> campfires = new List<CampfireSnapshot>();

	public List<LuggageSnapshot> luggageStates = new List<LuggageSnapshot>();

	public List<ContainerSnapshot> containerStates = new List<ContainerSnapshot>();

	public List<GroundItemSnapshot> groundItems = new List<GroundItemSnapshot>();

	public List<WorldObjectSnapshot> worldObjects = new List<WorldObjectSnapshot>();

	public List<SpawnHistorySnapshot> spawnHistory = new List<SpawnHistorySnapshot>();
}
public sealed class SaveListEntry
{
	public string fileName;

	public string fullPath;

	public bool isCompatible;

	public string incompatibilityReason;

	public SaveMetadata metadata;

	public DateTime fileTime;

	public long fileSize;
}
[Serializable]
public sealed class SaveMetadata
{
	public string saveName;

	public DateTime savedAtUtc;

	public string sceneName;

	public string levelName;

	public int? levelNumber;

	public int? dailyLevelIndex;

	public string biomeId;

	public int levelSeed;

	public int currentSegment;

	public string currentSegmentName;

	public int ascent;

	public int playerCount;

	public int? runDay;

	public float? runTimeSeconds;

	public bool? runTimerActive;

	public float? timeOfDay;

	public string inGameTime;

	public float? fogProgressPercent;

	public int? fogCurrentID;

	public float? fogCurrentSize;

	public bool? fogHasArrived;

	public bool? fogIsMoving;

	public float? fogCurrentWaitTime;

	public string expeditionName;
}
[Serializable]
public sealed class SpawnRecordSnapshot
{
	public ushort itemId;

	public Vector3Snapshot position = new Vector3Snapshot();

	public Vector3Snapshot rotationEuler = new Vector3Snapshot();
}
[Serializable]
public sealed class SpawnHistorySnapshot
{
	public string spawnerId;

	public List<SpawnRecordSnapshot> items = new List<SpawnRecordSnapshot>();
}
[Serializable]
public sealed class Vector2Snapshot
{
	public float x;

	public float y;

	public Vector2Snapshot()
	{
	}

	public Vector2Snapshot(Vector2 source)
	{
		//IL_0009: 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)
		x = source.x;
		y = source.y;
	}

	public Vector2 ToUnity()
	{
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		return new Vector2(x, y);
	}
}
[Serializable]
public sealed class Vector3Snapshot
{
	public float x;

	public float y;

	public float z;

	public Vector3Snapshot()
	{
	}

	public Vector3Snapshot(Vector3 source)
	{
		//IL_0009: 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_0021: Unknown result type (might be due to invalid IL or missing references)
		x = source.x;
		y = source.y;
		z = source.z;
	}

	public Vector3 ToUnity()
	{
		//IL_0013: 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_001b: Unknown result type (might be due to invalid IL or missing references)
		return new Vector3(x, y, z);
	}
}
[Serializable]
public sealed class Vector4Snapshot
{
	public float x;

	public float y;

	public float z;

	public float w;

	public Vector4Snapshot()
	{
	}

	public Vector4Snapshot(Vector4 source)
	{
		//IL_0009: 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_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		x = source.x;
		y = source.y;
		z = source.z;
		w = source.w;
	}

	public Vector4 ToUnity()
	{
		//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_0021: Unknown result type (might be due to invalid IL or missing references)
		return new Vector4(x, y, z, w);
	}
}
[Serializable]
public sealed class WorldObjectSnapshot
{
	public string kind;

	public string objectName;

	public string objectPath;

	public Vector3Snapshot position = new Vector3Snapshot();

	public Vector3Snapshot rotation = new Vector3Snapshot();

	public bool boolA;

	public float floatA;

	public float floatB;

	public int intA;

	public string stringA;

	public string stringB;

	public List<float> floatListA = new List<float>();
}
namespace BepInEx
{
	[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
	[Conditional("CodeGeneration")]
	[Embedded]
	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")]
	[Embedded]
	internal sealed class PatcherAutoPluginAttribute : Attribute
	{
		public PatcherAutoPluginAttribute(string? id = null, string? name = null, string? version = null)
		{
		}
	}
}
namespace Microsoft.CodeAnalysis
{
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace TSave
{
	internal sealed class SaveManagerPausePage : UIPage
	{
		private enum ButtonVisualStyle
		{
			Greens,
			Blues,
			Grays,
			Reds,
			Purple,
			Pink,
			Yellow,
			Cyan,
			DarkBlue,
			Orange,
			ExpeditionDarkAmber,
			ExpeditionOchre,
			ExpeditionKhaki
		}

		private SaveManagerPlugin plugin;

		private UIPageHandler handler;

		private UIPage returnPage;

		private Button templateButton;

		private TMP_Text templateButtonText;

		private bool uiBuilt;

		private RectTransform rootContainer;

		private TextMeshProUGUI statusLabel;

		private RectTransform quitDecisionRow;

		private RectTransform standardSaveRow;

		private string selectedExpeditionPrefix;

		private Button mainButton;

		private Button autosaveSlotsButton;

		private Button quickSaveButton;

		private Button saveButton;

		private TextMeshProUGUI sectionHeaderLabel;

		private RectTransform saveListContent;

		private GameObject slotActionPanel;

		private TextMeshProUGUI slotActionLabel;

		private Button loadSelectedButton;

		private Button overwriteSelectedButton;

		private Button deleteSelectedButton;

		private GameObject confirmPanel;

		private TextMeshProUGUI confirmLabel;

		private Action confirmAction;

		private GameObject nameEntryPanel;

		private GameObject multiNameEntryPanel;

		private TMP_InputField nameEntryInput;

		private TMP_InputField nameEntryInput1;

		private TMP_InputField nameEntryInput2;

		private TMP_InputField nameEntryInput3;

		private TMP_InputField nameEntryInput4;

		private TMP_InputField nameEntryInput5;

		private TextMeshProUGUI nameEntryTitle;

		private TextMeshProUGUI nameEntryTitle1;

		private TextMeshProUGUI nameEntryTitle2;

		private TextMeshProUGUI nameEntryTitle3;

		private TextMeshProUGUI nameEntryTitle4;

		private TextMeshProUGUI nameEntryTitle5;

		private Action<string> nameEntryConfirmAction;

		private Action<string, string, string, string, string> nameEntryMultiConfirmAction;

		private float nextStatusRefresh;

		private MonoBehaviour templateClickSfxComponent;

		private MethodInfo templateClickSfxPlayMethod;

		private MonoBehaviour templateHoverFeedbackComponent;

		private MethodInfo templateHoverOnClickMethod;

		private readonly Dictionary<RectTransform, Coroutine> activePressAnimations = new Dictionary<RectTransform, Coroutine>();

		private readonly List<SaveListEntry> displayedEntries = new List<SaveListEntry>();

		private readonly List<Image> displayedSlotBackgrounds = new List<Image>();

		private readonly List<Outline> displayedSlotOutlines = new List<Outline>();

		private readonly List<TextMeshProUGUI> displayedSlotTitles = new List<TextMeshProUGUI>();

		private int selectedSaveIndex = -1;

		public void Initialize(SaveManagerPlugin plugin, UIPageHandler handler, UIPage returnPage, Button templateButton)
		{
			this.plugin = plugin;
			this.handler = handler;
			this.returnPage = returnPage;
			this.templateButton = templateButton;
			templateButtonText = (((Object)(object)templateButton != (Object)null) ? ((Component)templateButton).GetComponentInChildren<TMP_Text>(true) : null);
			CacheTemplateFeedbackComponents();
			if (!uiBuilt)
			{
				BuildUi();
			}
		}

		public override void OnPageEnter()
		{
			((PageBase)this).OnPageEnter();
			if ((Object)(object)EventSystem.current != (Object)null)
			{
				EventSystem.current.SetSelectedGameObject((GameObject)null);
			}
			RefreshFromSource();
		}

		public override void OnPageExit()
		{
			((PageBase)this).OnPageExit();
			StopAllPressAnimations();
			HideSlotActionPanel();
			HideConfirmation();
			HideNameEntryPanel();
			HideMultiNameEntryPanel();
		}

		public void PrepareForLoad()
		{
			StopAllPressAnimations();
			HideSlotActionPanel();
			HideConfirmation();
			HideNameEntryPanel();
			HideMultiNameEntryPanel();
			if (((Component)this).gameObject.activeSelf)
			{
				((Component)this).gameObject.SetActive(false);
			}
		}

		private void Update()
		{
			if (!((Component)this).gameObject.activeInHierarchy)
			{
				return;
			}
			if (Input.GetKeyDown((KeyCode)27))
			{
				if ((Object)(object)nameEntryPanel != (Object)null && nameEntryPanel.activeSelf)
				{
					HideNameEntryPanel();
				}
				if ((Object)(object)multiNameEntryPanel != (Object)null && multiNameEntryPanel.activeSelf)
				{
					HideMultiNameEntryPanel();
				}
				else if ((Object)(object)confirmPanel != (Object)null && confirmPanel.activeSelf)
				{
					HideConfirmation();
				}
				else if ((Object)(object)slotActionPanel != (Object)null && slotActionPanel.activeSelf)
				{
					HideSlotActionPanel();
				}
				else
				{
					GoBack();
				}
			}
			else if (!(Time.unscaledTime < nextStatusRefresh))
			{
				UpdateStatusLabel();
				UpdateSlotActionPanelState();
				UpdateSaveButtonsVisibility();
				nextStatusRefresh = Time.unscaledTime + 0.25f;
			}
		}

		public void RefreshFromSource()
		{
			if (!((Object)(object)plugin == (Object)null))
			{
				string preferredPath = GetSelectedEntry()?.fullPath;
				plugin.UiRefreshSaveList();
				if ((Object)(object)mainButton != (Object)null)
				{
					((Component)mainButton).gameObject.SetActive(selectedExpeditionPrefix != null);
				}
				RebuildSaveRows(preferredPath);
				UpdateStatusLabel();
				UpdateQuitDecisionRow();
				UpdateSaveButtonsVisibility();
				UpdateAutosaveSlotsLabel();
				HideSlotActionPanel();
				HideConfirmation();
				HideNameEntryPanel();
				HideMultiNameEntryPanel();
			}
		}

		private void BuildUi()
		{
			//IL_0068: 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_00b0: 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_00d2: 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_0128: Unknown result type (might be due to invalid IL or missing references)
			//IL_0132: Expected O, but got Unknown
			//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fc: 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_022a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0241: Unknown result type (might be due to invalid IL or missing references)
			//IL_0258: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0306: Unknown result type (might be due to invalid IL or missing references)
			//IL_030b: Unknown result type (might be due to invalid IL or missing references)
			//IL_030d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0322: Unknown result type (might be due to invalid IL or missing references)
			//IL_0334: Unknown result type (might be due to invalid IL or missing references)
			//IL_034b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0481: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_04cd: Expected O, but got Unknown
			//IL_05c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_062c: Unknown result type (might be due to invalid IL or missing references)
			//IL_061f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0669: Unknown result type (might be due to invalid IL or missing references)
			//IL_069f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0742: Unknown result type (might be due to invalid IL or missing references)
			//IL_075b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0768: Unknown result type (might be due to invalid IL or missing references)
			//IL_077f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0796: Unknown result type (might be due to invalid IL or missing references)
			//IL_07bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0808: Unknown result type (might be due to invalid IL or missing references)
			//IL_0836: Unknown result type (might be due to invalid IL or missing references)
			//IL_0851: Unknown result type (might be due to invalid IL or missing references)
			//IL_086c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0887: Unknown result type (might be due to invalid IL or missing references)
			//IL_08a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_08cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_08d7: Expected O, but got Unknown
			uiBuilt = true;
			Transform transform = ((Component)this).transform;
			RectTransform val = (RectTransform)(object)((transform is RectTransform) ? transform : null);
			if (!((Object)(object)val == (Object)null))
			{
				rootContainer = new GameObject("ExpeditionSaveManagerRoot", new Type[4]
				{
					typeof(RectTransform),
					typeof(Image),
					typeof(VerticalLayoutGroup),
					typeof(ContentSizeFitter)
				}).GetComponent<RectTransform>();
				((Transform)rootContainer).SetParent((Transform)(object)val, false);
				rootContainer.anchorMin = new Vector2(0.09f, 0.07f);
				rootContainer.anchorMax = new Vector2(0.91f, 0.93f);
				rootContainer.offsetMin = Vector2.zero;
				rootContainer.offsetMax = Vector2.zero;
				((Graphic)((Component)rootContainer).GetComponent<Image>()).color = new Color(0f, 0f, 0f, 0.22f);
				VerticalLayoutGroup component = ((Component)rootContainer).GetComponent<VerticalLayoutGroup>();
				((HorizontalOrVerticalLayoutGroup)component).spacing = 8f;
				((LayoutGroup)component).padding = new RectOffset(16, 16, 14, 14);
				((HorizontalOrVerticalLayoutGroup)component).childControlHeight = true;
				((HorizontalOrVerticalLayoutGroup)component).childControlWidth = true;
				((HorizontalOrVerticalLayoutGroup)component).childForceExpandHeight = false;
				((HorizontalOrVerticalLayoutGroup)component).childForceExpandWidth = true;
				ContentSizeFitter component2 = ((Component)rootContainer).GetComponent<ContentSizeFitter>();
				component2.verticalFit = (FitMode)0;
				component2.horizontalFit = (FitMode)0;
				TMP_Text val2 = (TMP_Text)(object)CreateLabel((Transform)(object)rootContainer, "Expedition Save Manager - 1.8.49", 40f, (TextAlignmentOptions)514, 36);
				val2.overflowMode = (TextOverflowModes)0;
				val2.fontStyle = (FontStyles)16;
				((Graphic)val2).color = new Color(0.72f, 0.59f, 0.33f, 1f);
				RectTransform rectTransform = val2.rectTransform;
				LayoutElement component3 = ((Component)val2).GetComponent<LayoutElement>();
				if ((Object)(object)component3 != (Object)null)
				{
					component3.ignoreLayout = true;
				}
				rectTransform.anchorMin = new Vector2(0.5f, 1f);
				rectTransform.anchorMax = new Vector2(0.5f, 1f);
				rectTransform.pivot = new Vector2(0.5f, 1f);
				rectTransform.sizeDelta = new Vector2(600f, 44f);
				rectTransform.anchoredPosition = new Vector2(0f, -14f);
				autosaveSlotsButton = CreateButton((Transform)(object)rootContainer, "xxxAutosaves: 10", OpenAutosaveSlotsPanelClicked, 140f, ButtonVisualStyle.Greens);
				RectTransform component4 = ((Component)autosaveSlotsButton).GetComponent<RectTransform>();
				LayoutElement component5 = ((Component)autosaveSlotsButton).GetComponent<LayoutElement>();
				if ((Object)(object)component5 != (Object)null)
				{
					component5.ignoreLayout = true;
				}
				component4.anchorMin = new Vector2(1f, 1f);
				component4.anchorMax = new Vector2(1f, 1f);
				component4.pivot = new Vector2(1f, 1f);
				Vector2 sizeDelta = component4.sizeDelta;
				float num = ((sizeDelta.y > 0f) ? sizeDelta.y : 40f);
				component4.sizeDelta = new Vector2(240f, num);
				component4.anchoredPosition = new Vector2(-16f, -122f);
				RectTransform parent = CreateRow((Transform)(object)rootContainer, 44f);
				CreateButton((Transform)(object)parent, "BACK TO PEAK", GoBack, 156f, ButtonVisualStyle.Reds);
				mainButton = CreateButton((Transform)(object)parent, "EXPEDITIONS MENU", GoToExpeditionList, 186f, ButtonVisualStyle.ExpeditionKhaki);
				((Component)mainButton).gameObject.SetActive(false);
				standardSaveRow = CreateRow((Transform)(object)rootContainer, 40f);
				quickSaveButton = CreateButton((Transform)(object)standardSaveRow, "QUICK SAVE", QuickSaveClicked, 150f, ButtonVisualStyle.Blues);
				saveButton = CreateButton((Transform)(object)standardSaveRow, "SAVE", SaveClicked, 120f, ButtonVisualStyle.Greens);
				CreateButton((Transform)(object)standardSaveRow, "REFRESH", RefreshFromSource, 114f, ButtonVisualStyle.Grays);
				quitDecisionRow = new GameObject("QuitDecisionRow", new Type[3]
				{
					typeof(RectTransform),
					typeof(VerticalLayoutGroup),
					typeof(LayoutElement)
				}).GetComponent<RectTransform>();
				((Transform)quitDecisionRow).SetParent((Transform)(object)rootContainer, false);
				VerticalLayoutGroup component6 = ((Component)quitDecisionRow).GetComponent<VerticalLayoutGroup>();
				((HorizontalOrVerticalLayoutGroup)component6).spacing = 6f;
				((LayoutGroup)component6).padding = new RectOffset(0, 0, 0, 0);
				((HorizontalOrVerticalLayoutGroup)component6).childControlHeight = true;
				((HorizontalOrVerticalLayoutGroup)component6).childControlWidth = true;
				((HorizontalOrVerticalLayoutGroup)component6).childForceExpandHeight = false;
				((HorizontalOrVerticalLayoutGroup)component6).childForceExpandWidth = true;
				LayoutElement component7 = ((Component)quitDecisionRow).GetComponent<LayoutElement>();
				component7.minHeight = 44f;
				component7.preferredHeight = 44f;
				RectTransform parent2 = CreateRow((Transform)(object)quitDecisionRow, 42f);
				CreateButton((Transform)(object)parent2, "SAVE & QUIT", SaveAndQuitClicked, 176f, ButtonVisualStyle.Blues);
				CreateButton((Transform)(object)parent2, "CANCEL QUIT", CancelQuitClicked, 156f, ButtonVisualStyle.Grays);
				((Component)quitDecisionRow).gameObject.SetActive(false);
				sectionHeaderLabel = CreateLabel((Transform)(object)rootContainer, "Expeditions:", 60f, (TextAlignmentOptions)513, 36);
				((TMP_Text)sectionHeaderLabel).fontStyle = (FontStyles)16;
				((Graphic)sectionHeaderLabel).color = new Color(0.3f, 0.55f, 1f, 1f);
				statusLabel = CreateLabel((Transform)(object)rootContainer, string.Empty, 26f, (TextAlignmentOptions)513, 16);
				((Graphic)statusLabel).color = (Color)(((Object)(object)templateButtonText != (Object)null) ? ((Graphic)templateButtonText).color : new Color(0.9f, 0.9f, 0.9f, 0.95f));
				RectTransform component8 = new GameObject("SaveListContainer", new Type[3]
				{
					typeof(RectTransform),
					typeof(Image),
					typeof(LayoutElement)
				}).GetComponent<RectTransform>();
				((Transform)component8).SetParent((Transform)(object)rootContainer, false);
				((Graphic)((Component)component8).GetComponent<Image>()).color = new Color(0f, 0f, 0f, 0.35f);
				LayoutElement component9 = ((Component)component8).GetComponent<LayoutElement>();
				component9.preferredHeight = 488f;
				component9.minHeight = 360f;
				component9.flexibleHeight = 1f;
				ScrollRect val3 = ((Component)component8).gameObject.AddComponent<ScrollRect>();
				val3.horizontal = false;
				val3.vertical = true;
				val3.movementType = (MovementType)2;
				val3.scrollSensitivity = 32f;
				RectTransform component10 = new GameObject("Viewport", new Type[3]
				{
					typeof(RectTransform),
					typeof(Image),
					typeof(Mask)
				}).GetComponent<RectTransform>();
				((Transform)component10).SetParent((Transform)(object)component8, false);
				component10.anchorMin = Vector2.zero;
				component10.anchorMax = Vector2.one;
				component10.offsetMin = new Vector2(10f, 10f);
				component10.offsetMax = new Vector2(-28f, -10f);
				((Graphic)((Component)component10).GetComponent<Image>()).color = new Color(0f, 0f, 0f, 0.12f);
				((Component)component10).GetComponent<Mask>().showMaskGraphic = false;
				saveListContent = new GameObject("Content", new Type[3]
				{
					typeof(RectTransform),
					typeof(VerticalLayoutGroup),
					typeof(ContentSizeFitter)
				}).GetComponent<RectTransform>();
				((Transform)saveListContent).SetParent((Transform)(object)component10, false);
				saveListContent.anchorMin = new Vector2(0f, 1f);
				saveListContent.anchorMax = new Vector2(1f, 1f);
				saveListContent.pivot = new Vector2(0.5f, 1f);
				saveListContent.offsetMin = new Vector2(2f, 0f);
				saveListContent.offsetMax = new Vector2(-2f, 0f);
				VerticalLayoutGroup component11 = ((Component)saveListContent).GetComponent<VerticalLayoutGroup>();
				((HorizontalOrVerticalLayoutGroup)component11).spacing = 8f;
				((LayoutGroup)component11).padding = new RectOffset(2, 2, 2, 2);
				((HorizontalOrVerticalLayoutGroup)component11).childControlHeight = true;
				((HorizontalOrVerticalLayoutGroup)component11).childControlWidth = true;
				((HorizontalOrVerticalLayoutGroup)component11).childForceExpandHeight = false;
				((HorizontalOrVerticalLayoutGroup)component11).childForceExpandWidth = true;
				ContentSizeFitter component12 = ((Component)saveListContent).GetComponent<ContentSizeFitter>();
				component12.verticalFit = (FitMode)2;
				component12.horizontalFit = (FitMode)0;
				Scrollbar verticalScrollbar = CreateVerticalScrollbar((Transform)(object)component8);
				val3.viewport = component10;
				val3.content = saveListContent;
				val3.verticalScrollbar = verticalScrollbar;
				val3.verticalScrollbarVisibility = (ScrollbarVisibility)0;
				if ((Object)(object)autosaveSlotsButton != (Object)null)
				{
					((Transform)((Component)autosaveSlotsButton).GetComponent<RectTransform>()).SetAsLastSibling();
				}
				BuildSlotActionPanel();
				BuildNameEntryPanel();
				BuildMultiNameEntryPanel();
				BuildConfirmationPanel();
			}
		}

		private IEnumerator LogTitleLabelDiagnostics(TMP_Text titleLabel)
		{
			yield return null;
			yield return null;
			if ((Object)(object)titleLabel == (Object)null)
			{
				Debug.Log((object)"[TitleDebug] titleLabel is null.");
				yield break;
			}
			RectTransform rt = ((Component)titleLabel).GetComponent<RectTransform>();
			Transform parent = ((Transform)rt).parent;
			RectTransform parentRow = (RectTransform)(object)((parent is RectTransform) ? parent : null);
			object[] obj = new object[12]
			{
				titleLabel.text,
				((Component)titleLabel).gameObject.activeInHierarchy,
				null,
				null,
				null,
				null,
				null,
				null,
				null,
				null,
				null,
				null
			};
			Rect rect = rt.rect;
			obj[2] = ((Rect)(ref rect)).width;
			rect = rt.rect;
			obj[3] = ((Rect)(ref rect)).height;
			obj[4] = rt.anchoredPosition;
			obj[5] = ((Graphic)titleLabel).color;
			obj[6] = titleLabel.fontSize;
			obj[7] = (((Object)(object)titleLabel.font != (Object)null) ? ((Object)titleLabel.font).name : "NULL");
			object obj2;
			if (!((Object)(object)parentRow != (Object)null))
			{
				obj2 = "N/A";
			}
			else
			{
				rect = parentRow.rect;
				obj2 = ((Rect)(ref rect)).width.ToString();
			}
			obj[8] = obj2;
			object obj3;
			if (!((Object)(object)parentRow != (Object)null))
			{
				obj3 = "N/A";
			}
			else
			{
				rect = parentRow.rect;
				obj3 = ((Rect)(ref rect)).height.ToString();
			}
			obj[9] = obj3;
			obj[10] = ((Transform)rt).GetSiblingIndex();
			obj[11] = ((Transform)rt).parent.childCount;
			Debug.Log((object)string.Format("[TitleDebug] text='{0}' activeInHierarchy={1} rectSize={2}x{3} anchoredPos={4} color={5} fontSize={6} font={7} parentRowSize={8}x{9} siblingIndex={10} siblingCount={11}", obj));
			for (int i = 0; i < ((Transform)rt).parent.childCount; i++)
			{
				Transform sib = ((Transform)rt).parent.GetChild(i);
				RectTransform sibRt = (RectTransform)(object)((sib is RectTransform) ? sib : null);
				object[] obj4 = new object[5]
				{
					i,
					((Object)sib).name,
					((Component)sib).gameObject.activeSelf,
					null,
					null
				};
				object obj5;
				if (!((Object)(object)sibRt != (Object)null))
				{
					obj5 = "?";
				}
				else
				{
					rect = sibRt.rect;
					obj5 = ((Rect)(ref rect)).width.ToString();
				}
				obj4[3] = obj5;
				object obj6;
				if (!((Object)(object)sibRt != (Object)null))
				{
					obj6 = "?";
				}
				else
				{
					rect = sibRt.rect;
					obj6 = ((Rect)(ref rect)).height.ToString();
				}
				obj4[4] = obj6;
				Debug.Log((object)string.Format("[TitleDebug]   sibling[{0}] name={1} active={2} size={3}x{4}", obj4));
			}
		}

		private void BuildSlotActionPanel()
		{
			//IL_0034: 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_006a: 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_0082: 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_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0150: Unknown result type (might be due to invalid IL or missing references)
			//IL_0166: Unknown result type (might be due to invalid IL or missing references)
			//IL_018b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bc: Expected O, but got Unknown
			slotActionPanel = new GameObject("SlotActionOverlay", new Type[3]
			{
				typeof(RectTransform),
				typeof(Image),
				typeof(LayoutElement)
			}).gameObject;
			RectTransform component = slotActionPanel.GetComponent<RectTransform>();
			((Transform)component).SetParent((Transform)(object)rootContainer, false);
			component.anchorMin = Vector2.zero;
			component.anchorMax = Vector2.one;
			component.offsetMin = Vector2.zero;
			component.offsetMax = Vector2.zero;
			slotActionPanel.GetComponent<LayoutElement>().ignoreLayout = true;
			Image component2 = slotActionPanel.GetComponent<Image>();
			((Graphic)component2).color = new Color(0f, 0f, 0f, 0.62f);
			((Graphic)component2).raycastTarget = true;
			RectTransform component3 = new GameObject("SlotActionPanel", new Type[3]
			{
				typeof(RectTransform),
				typeof(Image),
				typeof(VerticalLayoutGroup)
			}).GetComponent<RectTransform>();
			((Transform)component3).SetParent((Transform)(object)component, false);
			component3.anchorMin = new Vector2(0.5f, 0.5f);
			component3.anchorMax = new Vector2(0.5f, 0.5f);
			component3.pivot = new Vector2(0.5f, 0.5f);
			component3.sizeDelta = new Vector2(700f, 250f);
			((Graphic)((Component)component3).GetComponent<Image>()).color = new Color(0.49f, 0.44f, 0.33f, 0.74f);
			VerticalLayoutGroup component4 = ((Component)component3).GetComponent<VerticalLayoutGroup>();
			((HorizontalOrVerticalLayoutGroup)component4).spacing = 10f;
			((LayoutGroup)component4).padding = new RectOffset(18, 18, 16, 16);
			((HorizontalOrVerticalLayoutGroup)component4).childControlHeight = true;
			((HorizontalOrVerticalLayoutGroup)component4).childControlWidth = true;
			((HorizontalOrVerticalLayoutGroup)component4).childForceExpandHeight = false;
			((HorizontalOrVerticalLayoutGroup)component4).childForceExpandWidth = true;
			CreateLabel((Transform)(object)component3, "LOAD EXPEDITION", 40f, (TextAlignmentOptions)514, 24);
			slotActionLabel = CreateLabel((Transform)(object)component3, "Select an action.", 54f, (TextAlignmentOptions)514, 18);
			((TMP_Text)slotActionLabel).textWrappingMode = (TextWrappingModes)1;
			((TMP_Text)slotActionLabel).overflowMode = (TextOverflowModes)0;
			RectTransform val = CreateRow((Transform)(object)component3, 44f);
			HorizontalLayoutGroup component5 = ((Component)val).GetComponent<HorizontalLayoutGroup>();
			if ((Object)(object)component5 != (Object)null)
			{
				((LayoutGroup)component5).childAlignment = (TextAnchor)4;
				((HorizontalOrVerticalLayoutGroup)component5).spacing = 12f;
			}
			loadSelectedButton = CreateButton((Transform)(object)val, "LOAD", LoadSelectedClicked, 168f, ButtonVisualStyle.Greens);
			overwriteSelectedButton = CreateButton((Transform)(object)val, "OVERWRITE", OverwriteSelectedClicked, 180f, ButtonVisualStyle.Blues);
			deleteSelectedButton = CreateButton((Transform)(object)val, "DELETE", DeleteSelectedClicked, 138f, ButtonVisualStyle.Reds);
			RectTransform val2 = CreateRow((Transform)(object)component3, 40f);
			HorizontalLayoutGroup component6 = ((Component)val2).GetComponent<HorizontalLayoutGroup>();
			if ((Object)(object)component6 != (Object)null)
			{
				((LayoutGroup)component6).childAlignment = (TextAnchor)4;
				((HorizontalOrVerticalLayoutGroup)component6).spacing = 0f;
			}
			CreateButton((Transform)(object)val2, "CANCEL", HideSlotActionPanel, 160f, ButtonVisualStyle.Grays);
			slotActionPanel.SetActive(false);
		}

		private void BuildConfirmationPanel()
		{
			//IL_0034: 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_006a: 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_0082: 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_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0150: Unknown result type (might be due to invalid IL or missing references)
			//IL_0166: Unknown result type (might be due to invalid IL or missing references)
			//IL_018b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bc: Expected O, but got Unknown
			confirmPanel = new GameObject("ConfirmOverlay", new Type[3]
			{
				typeof(RectTransform),
				typeof(Image),
				typeof(LayoutElement)
			}).gameObject;
			RectTransform component = confirmPanel.GetComponent<RectTransform>();
			((Transform)component).SetParent((Transform)(object)rootContainer, false);
			component.anchorMin = Vector2.zero;
			component.anchorMax = Vector2.one;
			component.offsetMin = Vector2.zero;
			component.offsetMax = Vector2.zero;
			confirmPanel.GetComponent<LayoutElement>().ignoreLayout = true;
			Image component2 = confirmPanel.GetComponent<Image>();
			((Graphic)component2).color = new Color(0f, 0f, 0f, 0.62f);
			((Graphic)component2).raycastTarget = true;
			RectTransform component3 = new GameObject("ConfirmPanel", new Type[3]
			{
				typeof(RectTransform),
				typeof(Image),
				typeof(VerticalLayoutGroup)
			}).GetComponent<RectTransform>();
			((Transform)component3).SetParent((Transform)(object)component, false);
			component3.anchorMin = new Vector2(0.5f, 0.5f);
			component3.anchorMax = new Vector2(0.5f, 0.5f);
			component3.pivot = new Vector2(0.5f, 0.5f);
			component3.sizeDelta = new Vector2(620f, 250f);
			((Graphic)((Component)component3).GetComponent<Image>()).color = new Color(0f, 0f, 0f, 0.88f);
			VerticalLayoutGroup component4 = ((Component)component3).GetComponent<VerticalLayoutGroup>();
			((HorizontalOrVerticalLayoutGroup)component4).spacing = 10f;
			((LayoutGroup)component4).padding = new RectOffset(18, 18, 16, 16);
			((HorizontalOrVerticalLayoutGroup)component4).childControlHeight = true;
			((HorizontalOrVerticalLayoutGroup)component4).childControlWidth = true;
			((HorizontalOrVerticalLayoutGroup)component4).childForceExpandHeight = false;
			((HorizontalOrVerticalLayoutGroup)component4).childForceExpandWidth = true;
			CreateLabel((Transform)(object)component3, "ARE YOU SURE?", 28f, (TextAlignmentOptions)514, 24);
			confirmLabel = CreateLabel((Transform)(object)component3, string.Empty, 92f, (TextAlignmentOptions)514, 18);
			((TMP_Text)confirmLabel).textWrappingMode = (TextWrappingModes)1;
			((TMP_Text)confirmLabel).overflowMode = (TextOverflowModes)0;
			RectTransform val = CreateRow((Transform)(object)component3, 42f);
			HorizontalLayoutGroup component5 = ((Component)val).GetComponent<HorizontalLayoutGroup>();
			if ((Object)(object)component5 != (Object)null)
			{
				((LayoutGroup)component5).childAlignment = (TextAnchor)4;
				((HorizontalOrVerticalLayoutGroup)component5).spacing = 12f;
			}
			CreateButton((Transform)(object)val, "CANCEL", HideConfirmation, 144f, ButtonVisualStyle.Grays);
			CreateButton((Transform)(object)val, "CONFIRM", ConfirmActionClicked, 148f, ButtonVisualStyle.Greens);
			confirmPanel.SetActive(false);
		}

		private void BuildNameEntryPanel()
		{
			//IL_0034: 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_006a: 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_0082: 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_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0150: Unknown result type (might be due to invalid IL or missing references)
			//IL_0166: Unknown result type (might be due to invalid IL or missing references)
			//IL_018b: 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_01c8: Expected O, but got Unknown
			nameEntryPanel = new GameObject("SaveNameOverlay", new Type[3]
			{
				typeof(RectTransform),
				typeof(Image),
				typeof(LayoutElement)
			}).gameObject;
			RectTransform component = nameEntryPanel.GetComponent<RectTransform>();
			((Transform)component).SetParent((Transform)(object)rootContainer, false);
			component.anchorMin = Vector2.zero;
			component.anchorMax = Vector2.one;
			component.offsetMin = Vector2.zero;
			component.offsetMax = Vector2.zero;
			nameEntryPanel.GetComponent<LayoutElement>().ignoreLayout = true;
			Image component2 = nameEntryPanel.GetComponent<Image>();
			((Graphic)component2).color = new Color(0f, 0f, 0f, 0.62f);
			((Graphic)component2).raycastTarget = true;
			RectTransform component3 = new GameObject("SaveNamePanel", new Type[3]
			{
				typeof(RectTransform),
				typeof(Image),
				typeof(VerticalLayoutGroup)
			}).GetComponent<RectTransform>();
			((Transform)component3).SetParent((Transform)(object)component, false);
			component3.anchorMin = new Vector2(0.5f, 0.5f);
			component3.anchorMax = new Vector2(0.5f, 0.5f);
			component3.pivot = new Vector2(0.5f, 0.5f);
			component3.sizeDelta = new Vector2(620f, 200f);
			((Graphic)((Component)component3).GetComponent<Image>()).color = new Color(0.49f, 0.44f, 0.33f, 0.74f);
			VerticalLayoutGroup component4 = ((Component)component3).GetComponent<VerticalLayoutGroup>();
			((HorizontalOrVerticalLayoutGroup)component4).spacing = 10f;
			((HorizontalOrVerticalLayoutGroup)component4).spacing = 20f;
			((LayoutGroup)component4).padding = new RectOffset(18, 18, 16, 16);
			((HorizontalOrVerticalLayoutGroup)component4).childControlHeight = true;
			((HorizontalOrVerticalLayoutGroup)component4).childControlWidth = true;
			((HorizontalOrVerticalLayoutGroup)component4).childForceExpandHeight = false;
			((HorizontalOrVerticalLayoutGroup)component4).childForceExpandWidth = true;
			nameEntryTitle = CreateLabel((Transform)(object)component3, "NAME SAVE", 32f, (TextAlignmentOptions)514, 24);
			LayoutElement val = ((Component)nameEntryTitle).gameObject.AddComponent<LayoutElement>();
			val.preferredHeight = 38f;
			val.minHeight = 38f;
			nameEntryInput = CreateInput((Transform)(object)component3);
			RectTransform val2 = CreateRow((Transform)(object)component3, 42f);
			HorizontalLayoutGroup component5 = ((Component)val2).GetComponent<HorizontalLayoutGroup>();
			if ((Object)(object)component5 != (Object)null)
			{
				((LayoutGroup)component5).childAlignment = (TextAnchor)4;
				((HorizontalOrVerticalLayoutGroup)component5).spacing = 12f;
			}
			CreateButton((Transform)(object)val2, "CANCEL", HideNameEntryPanel, 146f, ButtonVisualStyle.Reds);
			CreateButton((Transform)(object)val2, "CONFIRM", ConfirmNameEntry, 146f, ButtonVisualStyle.Greens);
			nameEntryPanel.SetActive(false);
		}

		private void BuildMultiNameEntryPanel()
		{
			//IL_0034: 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_006a: 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_0082: 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_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0150: Unknown result type (might be due to invalid IL or missing references)
			//IL_0166: Unknown result type (might be due to invalid IL or missing references)
			//IL_018b: 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_01c8: Expected O, but got Unknown
			//IL_0233: Unknown result type (might be due to invalid IL or missing references)
			//IL_029d: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_034d: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0455: Unknown result type (might be due to invalid IL or missing references)
			multiNameEntryPanel = new GameObject("SaveMultiNameOverlay", new Type[3]
			{
				typeof(RectTransform),
				typeof(Image),
				typeof(LayoutElement)
			}).gameObject;
			RectTransform component = multiNameEntryPanel.GetComponent<RectTransform>();
			((Transform)component).SetParent((Transform)(object)rootContainer, false);
			component.anchorMin = Vector2.zero;
			component.anchorMax = Vector2.one;
			component.offsetMin = Vector2.zero;
			component.offsetMax = Vector2.zero;
			multiNameEntryPanel.GetComponent<LayoutElement>().ignoreLayout = true;
			Image component2 = multiNameEntryPanel.GetComponent<Image>();
			((Graphic)component2).color = new Color(0f, 0f, 0f, 0.62f);
			((Graphic)component2).raycastTarget = true;
			RectTransform component3 = new GameObject("SaveMultiNamePanel", new Type[3]
			{
				typeof(RectTransform),
				typeof(Image),
				typeof(VerticalLayoutGroup)
			}).GetComponent<RectTransform>();
			((Transform)component3).SetParent((Transform)(object)component, false);
			component3.anchorMin = new Vector2(0.5f, 0.5f);
			component3.anchorMax = new Vector2(0.5f, 0.5f);
			component3.pivot = new Vector2(0.5f, 0.5f);
			component3.sizeDelta = new Vector2(620f, 720f);
			((Graphic)((Component)component3).GetComponent<Image>()).color = new Color(0.49f, 0.44f, 0.33f, 0.74f);
			VerticalLayoutGroup component4 = ((Component)component3).GetComponent<VerticalLayoutGroup>();
			((HorizontalOrVerticalLayoutGroup)component4).spacing = 10f;
			((HorizontalOrVerticalLayoutGroup)component4).spacing = 20f;
			((LayoutGroup)component4).padding = new RectOffset(18, 18, 16, 16);
			((HorizontalOrVerticalLayoutGroup)component4).childControlHeight = true;
			((HorizontalOrVerticalLayoutGroup)component4).childControlWidth = true;
			((HorizontalOrVerticalLayoutGroup)component4).childForceExpandHeight = false;
			((HorizontalOrVerticalLayoutGroup)component4).childForceExpandWidth = true;
			nameEntryTitle1 = CreateLabel((Transform)(object)component3, "Multi NAME SAVE", 32f, (TextAlignmentOptions)514, 24);
			LayoutElement val = ((Component)nameEntryTitle1).gameObject.AddComponent<LayoutElement>();
			((Graphic)nameEntryTitle1).color = new Color(0.44f, 0.67f, 0.4f, 1f);
			val.preferredHeight = 38f;
			val.minHeight = 38f;
			nameEntryInput1 = CreateInput((Transform)(object)component3);
			nameEntryTitle2 = CreateLabel((Transform)(object)component3, "Multi NAME SAVE 2", 32f, (TextAlignmentOptions)514, 24);
			((Graphic)nameEntryTitle2).color = new Color(0.44f, 0.67f, 0.4f, 1f);
			TMP_Text val2 = (TMP_Text)(object)nameEntryTitle2;
			val2.fontSizeMin = 48f;
			val2.outlineColor = Color32.op_Implicit(Color.black);
			val2.outlineWidth = 0.025f;
			LayoutElement val3 = ((Component)nameEntryTitle2).gameObject.AddComponent<LayoutElement>();
			val3.preferredHeight = 38f;
			val3.minHeight = 38f;
			nameEntryInput2 = CreateInput((Transform)(object)component3);
			nameEntryTitle3 = CreateLabel((Transform)(object)component3, "Multi NAME SAVE 3", 32f, (TextAlignmentOptions)514, 24);
			((Graphic)nameEntryTitle3).color = new Color(0.44f, 0.67f, 0.4f, 1f);
			TMP_Text val4 = (TMP_Text)(object)nameEntryTitle3;
			LayoutElement val5 = ((Component)nameEntryTitle3).gameObject.AddComponent<LayoutElement>();
			val5.preferredHeight = 38f;
			val5.minHeight = 38f;
			nameEntryInput3 = CreateInput((Transform)(object)component3);
			nameEntryTitle4 = CreateLabel((Transform)(object)component3, "Multi NAME SAVE 4", 32f, (TextAlignmentOptions)514, 24);
			((Graphic)nameEntryTitle4).color = new Color(0.44f, 0.67f, 0.4f, 1f);
			TMP_Text val6 = (TMP_Text)(object)nameEntryTitle4;
			LayoutElement val7 = ((Component)nameEntryTitle4).gameObject.AddComponent<LayoutElement>();
			val7.preferredHeight = 38f;
			val7.minHeight = 38f;
			nameEntryInput4 = CreateInput((Transform)(object)component3);
			nameEntryTitle5 = CreateLabel((Transform)(object)component3, "Multi NAME SAVE 5", 32f, (TextAlignmentOptions)514, 24);
			((Graphic)nameEntryTitle5).color = new Color(0.44f, 0.67f, 0.4f, 1f);
			TMP_Text val8 = (TMP_Text)(object)nameEntryTitle5;
			LayoutElement val9 = ((Component)nameEntryTitle5).gameObject.AddComponent<LayoutElement>();
			val9.preferredHeight = 38f;
			val9.minHeight = 38f;
			nameEntryInput5 = CreateInput((Transform)(object)component3);
			RectTransform val10 = CreateRow((Transform)(object)component3, 12f);
			val10 = CreateRow((Transform)(object)component3, 20f);
			HorizontalLayoutGroup component5 = ((Component)val10).GetComponent<HorizontalLayoutGroup>();
			if ((Object)(object)component5 != (Object)null)
			{
				((LayoutGroup)component5).childAlignment = (TextAnchor)4;
				((HorizontalOrVerticalLayoutGroup)component5).spacing = 12f;
			}
			CreateButton((Transform)(object)val10, "CANCEL", HideMultiNameEntryPanel, 146f, ButtonVisualStyle.Reds);
			CreateButton((Transform)(object)val10, "CONFIRM", ConfirmMultiNameEntry, 146f, ButtonVisualStyle.Greens);
			multiNameEntryPanel.SetActive(false);
		}

		private void CacheTemplateFeedbackComponents()
		{
			templateClickSfxComponent = null;
			templateClickSfxPlayMethod = null;
			templateHoverFeedbackComponent = null;
			templateHoverOnClickMethod = null;
			if ((Object)(object)templateButton == (Object)null)
			{
				return;
			}
			MonoBehaviour[] componentsInChildren = ((Component)templateButton).GetComponentsInChildren<MonoBehaviour>(true);
			MonoBehaviour[] array = componentsInChildren;
			foreach (MonoBehaviour val in array)
			{
				if ((Object)(object)val == (Object)null)
				{
					continue;
				}
				Type type = ((object)val).GetType();
				if ((Object)(object)templateClickSfxComponent == (Object)null && string.Equals(type.Name, "SFX_PlayOneShot", StringComparison.Ordinal))
				{
					MethodInfo method = type.GetMethod("Play", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, Type.EmptyTypes, null);
					if (method != null)
					{
						templateClickSfxComponent = val;
						templateClickSfxPlayMethod = method;
					}
				}
				if ((Object)(object)templateHoverFeedbackComponent == (Object)null && string.Equals(type.Name, "ButtonHoverFeedback", StringComparison.Ordinal))
				{
					MethodInfo method2 = type.GetMethod("OnClick", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, Type.EmptyTypes, null);
					if (method2 != null)
					{
						templateHoverFeedbackComponent = val;
						templateHoverOnClickMethod = method2;
					}
				}
			}
		}

		private void PlayButtonFeedback(RectTransform rectTransform)
		{
			if (!((Object)(object)rectTransform != (Object)null) || !TriggerObjectClickHooks(((Component)rectTransform).gameObject))
			{
				TriggerTemplateClickHooks();
			}
			if (!((Object)(object)rectTransform == (Object)null))
			{
				if (activePressAnimations.TryGetValue(rectTransform, out var value) && value != null)
				{
					((MonoBehaviour)this).StopCoroutine(value);
					activePressAnimations.Remove(rectTransform);
				}
				Coroutine value2 = ((MonoBehaviour)this).StartCoroutine(AnimateButtonPress(rectTransform));
				activePressAnimations[rectTransform] = value2;
			}
		}

		private bool TriggerObjectClickHooks(GameObject gameObject)
		{
			if ((Object)(object)gameObject == (Object)null)
			{
				return false;
			}
			bool result = false;
			MonoBehaviour[] componentsInChildren = gameObject.GetComponentsInChildren<MonoBehaviour>(true);
			MonoBehaviour[] array = componentsInChildren;
			foreach (MonoBehaviour val in array)
			{
				if ((Object)(object)val == (Object)null)
				{
					continue;
				}
				Type type = ((object)val).GetType();
				if (string.Equals(type.Name, "ButtonHoverFeedback", StringComparison.Ordinal))
				{
					MethodInfo method = type.GetMethod("OnClick", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, Type.EmptyTypes, null);
					if (TryInvokeClickMethod(val, method))
					{
						result = true;
					}
				}
				else if (string.Equals(type.Name, "SFX_PlayOneShot", StringComparison.Ordinal))
				{
					MethodInfo method2 = type.GetMethod("Play", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, Type.EmptyTypes, null);
					if (TryInvokeClickMethod(val, method2))
					{
						result = true;
					}
				}
			}
			return result;
		}

		private bool TriggerTemplateClickHooks()
		{
			bool result = false;
			if (TryInvokeClickMethod(templateHoverFeedbackComponent, templateHoverOnClickMethod))
			{
				result = true;
			}
			if (TryInvokeClickMethod(templateClickSfxComponent, templateClickSfxPlayMethod))
			{
				result = true;
			}
			return result;
		}

		private static bool TryInvokeClickMethod(MonoBehaviour behaviour, MethodInfo method)
		{
			if ((Object)(object)behaviour == (Object)null || method == null)
			{
				return false;
			}
			try
			{
				method.Invoke(behaviour, null);
				return true;
			}
			catch
			{
				return false;
			}
		}

		private IEnumerator AnimateButtonPress(RectTransform rectTransform)
		{
			if (!((Object)(object)rectTransform == (Object)null))
			{
				Vector3 originalScale = ((Transform)rectTransform).localScale;
				Vector3 pressedScale = new Vector3(originalScale.x * 0.965f, originalScale.y * 0.965f, originalScale.z);
				float elapsed = 0f;
				while (elapsed < 0.045f && (Object)(object)rectTransform != (Object)null)
				{
					elapsed += Time.unscaledDeltaTime;
					float num = Mathf.Clamp01(elapsed / 0.045f);
					((Transform)rectTransform).localScale = Vector3.LerpUnclamped(originalScale, pressedScale, num);
					yield return null;
				}
				elapsed = 0f;
				while (elapsed < 0.08f && (Object)(object)rectTransform != (Object)null)
				{
					elapsed += Time.unscaledDeltaTime;
					float num2 = Mathf.Clamp01(elapsed / 0.08f);
					((Transform)rectTransform).localScale = Vector3.LerpUnclamped(pressedScale, originalScale, num2);
					yield return null;
				}
				if ((Object)(object)rectTransform != (Object)null)
				{
					((Transform)rectTransform).localScale = originalScale;
					activePressAnimations.Remove(rectTransform);
				}
			}
		}

		private void StopAllPressAnimations()
		{
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			foreach (KeyValuePair<RectTransform, Coroutine> activePressAnimation in activePressAnimations)
			{
				if (activePressAnimation.Value != null)
				{
					((MonoBehaviour)this).StopCoroutine(activePressAnimation.Value);
				}
				if ((Object)(object)activePressAnimation.Key != (Object)null)
				{
					((Transform)activePressAnimation.Key).localScale = Vector3.one;
				}
			}
			activePressAnimations.Clear();
		}

		private Scrollbar CreateVerticalScrollbar(Transform parent)
		{
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: 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_007e: 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_00aa: 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_00f2: 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_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: Unknown result type (might be due to invalid IL or missing references)
			//IL_015b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0170: Unknown result type (might be due to invalid IL or missing references)
			//IL_017c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0192: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a8: 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_01e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ef: Expected O, but got Unknown
			RectTransform component = new GameObject("Scrollbar", new Type[3]
			{
				typeof(RectTransform),
				typeof(Image),
				typeof(Scrollbar)
			}).GetComponent<RectTransform>();
			((Transform)component).SetParent(parent, false);
			component.anchorMin = new Vector2(1f, 0f);
			component.anchorMax = new Vector2(1f, 1f);
			component.pivot = new Vector2(1f, 0.5f);
			component.offsetMin = new Vector2(-18f, 10f);
			component.offsetMax = new Vector2(-6f, -10f);
			((Graphic)((Component)component).GetComponent<Image>()).color = new Color(0f, 0f, 0f, 0.32f);
			RectTransform component2 = new GameObject("Sliding Area", new Type[1] { typeof(RectTransform) }).GetComponent<RectTransform>();
			((Transform)component2).SetParent((Transform)(object)component, false);
			component2.anchorMin = Vector2.zero;
			component2.anchorMax = Vector2.one;
			component2.offsetMin = Vector2.zero;
			component2.offsetMax = Vector2.zero;
			RectTransform component3 = new GameObject("Handle", new Type[2]
			{
				typeof(RectTransform),
				typeof(Image)
			}).GetComponent<RectTransform>();
			((Transform)component3).SetParent((Transform)(object)component2, false);
			component3.anchorMin = Vector2.zero;
			component3.anchorMax = Vector2.one;
			component3.offsetMin = new Vector2(1f, 1f);
			component3.offsetMax = new Vector2(-1f, -1f);
			Image component4 = ((Component)component3).GetComponent<Image>();
			((Graphic)component4).color = new Color(0.92f, 0.92f, 0.92f, 0.95f);
			Scrollbar component5 = ((Component)component).GetComponent<Scrollbar>();
			((Selectable)component5).targetGraphic = (Graphic)component4;
			component5.handleRect = component3;
			component5.direction = (Direction)2;
			component5.size = 0.28f;
			return component5;
		}

		private RectTransform CreateRow(Transform parent, float minHeight)
		{
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Expected O, but got Unknown
			RectTransform component = new GameObject("Row", new Type[3]
			{
				typeof(RectTransform),
				typeof(HorizontalLayoutGroup),
				typeof(LayoutElement)
			}).GetComponent<RectTransform>();
			((Transform)component).SetParent(parent, false);
			HorizontalLayoutGroup component2 = ((Component)component).GetComponent<HorizontalLayoutGroup>();
			((HorizontalOrVerticalLayoutGroup)component2).spacing = 8f;
			((LayoutGroup)component2).padding = new RectOffset(0, 0, 0, 0);
			((HorizontalOrVerticalLayoutGroup)component2).childControlHeight = true;
			((HorizontalOrVerticalLayoutGroup)component2).childControlWidth = true;
			((HorizontalOrVerticalLayoutGroup)component2).childForceExpandHeight = false;
			((HorizontalOrVerticalLayoutGroup)component2).childForceExpandWidth = false;
			LayoutElement component3 = ((Component)component).GetComponent<LayoutElement>();
			component3.minHeight = minHeight;
			component3.preferredHeight = minHeight;
			return component;
		}

		private TextMeshProUGUI CreateLabel(Transform parent, string text, float minHeight, TextAlignmentOptions alignment, int fontSize)
		{
			//IL_0026: 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_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			RectTransform component = new GameObject("Label", new Type[2]
			{
				typeof(RectTransform),
				typeof(LayoutElement)
			}).GetComponent<RectTransform>();
			((Transform)component).SetParent(parent, false);
			LayoutElement component2 = ((Component)component).GetComponent<LayoutElement>();
			component2.minHeight = minHeight;
			component2.preferredHeight = minHeight;
			component2.flexibleWidth = 1f;
			TextMeshProUGUI val = ((Component)component).gameObject.AddComponent<TextMeshProUGUI>();
			if ((Object)(object)templateButtonText != (Object)null)
			{
				((TMP_Text)val).font = templateButtonText.font;
				((TMP_Text)val).fontSharedMaterial = templateButtonText.fontSharedMaterial;
				((Graphic)val).color = ((Graphic)templateButtonText).color;
			}
			else
			{
				((Graphic)val).color = Color.white;
			}
			((TMP_Text)val).enableAutoSizing = false;
			((TMP_Text)val).fontSize = fontSize;
			((TMP_Text)val).alignment = alignment;
			((TMP_Text)val).textWrappingMode = (TextWrappingModes)0;
			((TMP_Text)val).overflowMode = (TextOverflowModes)1;
			((TMP_Text)val).text = text;
			return val;
		}

		private TMP_InputField CreateInput(Transform parent)
		{
			//IL_0040: 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_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: 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_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_016b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fd: Expected O, but got Unknown
			//IL_0202: Unknown result type (might be due to invalid IL or missing references)
			//IL_020c: Expected O, but got Unknown
			RectTransform component = new GameObject("SaveNameInput", new Type[4]
			{
				typeof(RectTransform),
				typeof(Image),
				typeof(LayoutElement),
				typeof(TMP_InputField)
			}).GetComponent<RectTransform>();
			((Transform)component).SetParent(parent, false);
			LayoutElement component2 = ((Component)component).GetComponent<LayoutElement>();
			component2.minWidth = 260f;
			component2.preferredWidth = 420f;
			component2.flexibleWidth = 1f;
			component2.minHeight = 42f;
			component2.preferredHeight = 42f;
			((Graphic)((Component)component).GetComponent<Image>()).color = new Color(0.06f, 0.1f, 0.13f, 1f);
			Outline val = ((Component)component).gameObject.AddComponent<Outline>();
			((Shadow)val).effectColor = new Color(0.25f, 0.33f, 0.38f, 0.46f);
			((Shadow)val).effectDistance = new Vector2(1f, -1f);
			((Shadow)val).useGraphicAlpha = true;
			RectTransform component3 = new GameObject("TextArea", new Type[1] { typeof(RectTransform) }).GetComponent<RectTransform>();
			((Transform)component3).SetParent((Transform)(object)component, false);
			component3.anchorMin = Vector2.zero;
			component3.anchorMax = Vector2.one;
			component3.offsetMin = new Vector2(10f, 6f);
			component3.offsetMax = new Vector2(-10f, -6f);
			TextMeshProUGUI val2 = CreateTextElement((Transform)(object)component3, "InputText");
			((TMP_Text)val2).alignment = (TextAlignmentOptions)513;
			((TMP_Text)val2).text = string.Empty;
			TextMeshProUGUI val3 = CreateTextElement((Transform)(object)component3, "Placeholder");
			((TMP_Text)val3).alignment = (TextAlignmentOptions)513;
			((TMP_Text)val3).text = "Save name";
			((Graphic)val3).color = new Color(0.7f, 0.8f, 0.9f, 0.55f);
			TMP_InputField component4 = ((Component)component).GetComponent<TMP_InputField>();
			component4.textComponent = (TMP_Text)val2;
			component4.placeholder = (Graphic)val3;
			component4.lineType = (LineType)0;
			component4.characterLimit = 64;
			return component4;
		}

		private TextMeshProUGUI CreateTextElement(Transform parent, string name)
		{
			//IL_0015: 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_0036: 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_004e: 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_00a1: Unknown result type (might be due to invalid IL or missing references)
			RectTransform component = new GameObject(name, new Type[1] { typeof(RectTransform) }).GetComponent<RectTransform>();
			((Transform)component).SetParent(parent, false);
			component.anchorMin = Vector2.zero;
			component.anchorMax = Vector2.one;
			component.offsetMin = Vector2.zero;
			component.offsetMax = Vector2.zero;
			TextMeshProUGUI val = ((Component)component).gameObject.AddComponent<TextMeshProUGUI>();
			if ((Object)(object)templateButtonText != (Object)null)
			{
				((TMP_Text)val).font = templateButtonText.font;
				((TMP_Text)val).fontSharedMaterial = templateButtonText.fontSharedMaterial;
				((Graphic)val).color = ((Graphic)templateButtonText).color;
			}
			else
			{
				((Graphic)val).color = Color.white;
			}
			((TMP_Text)val).enableAutoSizing = false;
			((TMP_Text)val).fontSize = 20f;
			((TMP_Text)val).richText = false;
			return val;
		}

		private Button CreateButton(Transform parent, string label, Action action, float minWidth)
		{
			return CreateButton(parent, label, action, minWidth, ButtonVisualStyle.Blues);
		}

		private Button CreateButton(Transform parent, string label, Action action, float minWidth, ButtonVisualStyle style)
		{
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Expected O, but got Unknown
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: 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_01c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d8: 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_00a0: 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_022f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0239: Expected O, but got Unknown
			float num = 40f;
			GameObject val;
			Button component;
			if ((Object)(object)templateButton != (Object)null)
			{
				val = Object.Instantiate<GameObject>(((Component)templateButton).gameObject, parent, false);
				component = val.GetComponent<Button>();
				RemoveLocalizedTextComponents(val);
				Transform transform = ((Component)templateButton).transform;
				RectTransform val2 = (RectTransform)(object)((transform is RectTransform) ? transform : null);
				if ((Object)(object)val2 != (Object)null)
				{
					Rect rect = val2.rect;
					Rect val3 = rect;
					if (((Rect)(ref val3)).height > 0f)
					{
						rect = val2.rect;
						val3 = rect;
						num = Mathf.Clamp(((Rect)(ref val3)).height, 34f, 54f);
					}
				}
			}
			else
			{
				val = new GameObject("Button", new Type[3]
				{
					typeof(RectTransform),
					typeof(Image),
					typeof(Button)
				});
				((Transform)val.GetComponent<RectTransform>()).SetParent(parent, false);
				Image component2 = val.GetComponent<Image>();
				((Graphic)component2).color = new Color(0.14f, 0.36f, 0.31f, 0.98f);
				component2.type = (Type)1;
				component = val.GetComponent<Button>();
			}
			ApplyButtonVisualStyle(component, style);
			LayoutElement val4 = val.GetComponent<LayoutElement>();
			if ((Object)(object)val4 == (Object)null)
			{
				val4 = val.AddComponent<LayoutElement>();
			}
			val4.minWidth = Mathf.Max(80f, minWidth * 0.7f);
			val4.preferredWidth = minWidth;
			val4.minHeight = num;
			val4.preferredHeight = num;
			val4.flexibleWidth = 0f;
			SetButtonText(val, label);
			ApplyButtonLabelStyle(val, style);
			Navigation navigation = ((Selectable)component).navigation;
			((Navigation)(ref navigation)).mode = (Mode)0;
			((Selectable)component).navigation = navigation;
			((UnityEventBase)component.onClick).RemoveAllListeners();
			if (action != null)
			{
				Transform transform2 = val.transform;
				RectTransform buttonRect = (RectTransform)(object)((transform2 is RectTransform) ? transform2 : null);
				((UnityEvent)component.onClick).AddListener((UnityAction)delegate
				{
					if ((Object)(object)EventSystem.current != (Object)null)
					{
						EventSystem.current.SetSelectedGameObject((GameObject)null);
					}
					PlayButtonFeedback(buttonRect);
					action();
				});
			}
			AttachButtonTextColorState(val, component);
			return component;
		}

		private void ApplyButtonLabelStyle(GameObject buttonObject, ButtonVisualStyle style)
		{
			//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_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: 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_00e3: 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)
			if ((Object)(object)buttonObject == (Object)null)
			{
				return;
			}
			Color buttonLabelColor = GetButtonLabelColor(style);
			TMP_FontAsset val = (((Object)(object)templateButtonText != (Object)null) ? templateButtonText.font : null);
			Material val2 = (((Object)(object)templateButtonText != (Object)null) ? templateButtonText.fontSharedMaterial : null);
			FontStyles fontStyle = (FontStyles)(((Object)(object)templateButtonText != (Object)null) ? (templateButtonText.fontStyle & -2) : 0);
			TMP_Text[] componentsInChildren = buttonObject.GetComponentsInChildren<TMP_Text>(true);
			TMP_Text[] array = componentsInChildren;
			foreach (TMP_Text val3 in array)
			{
				if (!((Object)(object)val3 == (Object)null))
				{
					if ((Object)(object)val != (Object)null)
					{
						val3.font = val;
					}
					if ((Object)(object)val2 != (Object)null)
					{
						val3.fontSharedMaterial = val2;
					}
					((Graphic)val3).color = buttonLabelColor;
					val3.fontStyle = fontStyle;
					val3.enableAutoSizing = true;
					val3.fontSizeMin = 11f;
					val3.fontSizeMax = 18f;
					val3.textWrappingMode = (TextWrappingModes)0;
					val3.overflowMode = (TextOverflowModes)1;
					val3.alignment = (TextAlignmentOptions)514;
				}
			}
			Text[] componentsInChildren2 = buttonObject.GetComponentsInChildren<Text>(true);
			Text[] array2 = componentsInChildren2;
			foreach (Text val4 in array2)
			{
				if (!((Object)(object)val4 == (Object)null))
				{
					((Graphic)val4).color = buttonLabelColor;
					val4.fontStyle = (FontStyle)0;
					val4.resizeTextForBestFit = true;
					val4.resizeTextMinSize = 11;
					val4.resizeTextMaxSize = 18;
					val4.horizontalOverflow = (HorizontalWrapMode)1;
					val4.verticalOverflow = (VerticalWrapMode)0;
					val4.alignment = (TextAnchor)4;
				}
			}
		}

		private static Color GetButtonLabelColor(ButtonVisualStyle style)
		{
			//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_0009: Unknown result type (might be due to invalid IL or missing references)
			return Color.white;
		}

		private static void AttachButtonTextColorState(GameObject buttonObject, Button button)
		{
			if (!((Object)(object)buttonObject == (Object)null) && !((Object)(object)button == (Object)null))
			{
				ButtonTextColorState buttonTextColorState = buttonObject.GetComponent<ButtonTextColorState>();
				if ((Object)(object)buttonTextColorState == (Object)null)
				{
					buttonTextColorState = buttonObject.AddComponent<ButtonTextColorState>();
				}
				buttonTextColorState.Bind(button);
			}
		}

		private static void RemoveLocalizedTextComponents(GameObject buttonObject)
		{
			if ((Object)(object)buttonObject == (Object)null)
			{
				return;
			}
			MonoBehaviour[] componentsInChildren = buttonObject.GetComponentsInChildren<MonoBehaviour>(true);
			MonoBehaviour[] array = componentsInChildren;
			foreach (MonoBehaviour val in array)
			{
				if (!((Object)(object)val == (Object)null) && string.Equals(((object)val).GetType().Name, "LocalizedText", StringComparison.Ordinal))
				{
					Object.Destroy((Object)(object)val);
				}
			}
		}

		private void ApplyButtonVisualStyle(Button button, ButtonVisualStyle style)
		{
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Expected O, but got Unknown
			//IL_0056: 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_0093: 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_00e6: 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_0116: 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_0143: 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_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0152: 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_01eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_020c: Unknown result type (might be due to invalid IL or missing references)
			//IL_021b: Unknown result type (might be due to invalid IL or missing references)
			//IL_023c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0262: Unknown result type (might be due to invalid IL or missing references)
			//IL_0283: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_031b: Unknown result type (might be due to invalid IL or missing references)
			//IL_033c: Unknown result type (might be due to invalid IL or missing references)
			//IL_034b: 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_0392: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d4: 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_0404: Unknown result type (might be due to invalid IL or missing references)
			//IL_042a: Unknown result type (might be due to invalid IL or missing references)
			//IL_044b: Unknown result type (might be due to invalid IL or missing references)
			//IL_046c: Unknown result type (might be due to invalid IL or missing references)
			//IL_047b: Unknown result type (might be due to invalid IL or missing references)
			//IL_049c: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0504: Unknown result type (might be due to invalid IL or missing references)
			//IL_0513: Unknown result type (might be due to invalid IL or missing references)
			//IL_0534: Unknown result type (might be due to invalid IL or missing references)
			//IL_055a: Unknown result type (might be due to invalid IL or missing references)
			//IL_057b: Unknown result type (might be due to invalid IL or missing references)
			//IL_059c: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_05cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_05f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0613: Unknown result type (might be due to invalid IL or missing references)
			//IL_0634: Unknown result type (might be due to invalid IL or missing references)
			//IL_0643: Unknown result type (might be due to invalid IL or missing references)
			//IL_0664: Unknown result type (might be due to invalid IL or missing references)
			//IL_068a: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_06cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_06db: Unknown result type (might be due to invalid IL or missing references)
			//IL_06fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0722: Unknown result type (might be due to invalid IL or missing references)
			//IL_0743: Unknown result type (might be due to invalid IL or missing references)
			//IL_0764: Unknown result type (might be due to invalid IL or missing references)
			//IL_0773: Unknown result type (might be due to invalid IL or missing references)
			//IL_0794: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_07db: Unknown result type (might be due to invalid IL or missing references)
			//IL_07fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_080b: Unknown result type (might be due to invalid IL or missing references)
			//IL_082c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0852: Unknown result type (might be due to invalid IL or missing references)
			//IL_0873: Unknown result type (might be due to invalid IL or missing references)
			//IL_0894: Unknown result type (might be due to invalid IL or missing references)
			//IL_08a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_08c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_08ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_090b: Unknown result type (might be due to invalid IL or missing references)
			//IL_092c: Unknown result type (might be due to invalid IL or missing references)
			//IL_093b: Unknown result type (might be due to invalid IL or missing references)
			//IL_095c: Unknown result type (might be due to invalid IL or missing references)
			//IL_096a: Unknown result type (might be due to invalid IL or missing references)
			//IL_098c: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)button == (Object)null)
			{
				return;
			}
			((Selectable)button).transition = (Transition)1;
			if ((Object)(object)((Selectable)button).targetGraphic == (Object)null)
			{
				((Selectable)button).targetGraphic = (Graphic)((Component)button).GetComponent<Image>();
			}
			if ((Object)(object)templateButton != (Object)null)
			{
				((Selectable)button).colors = ((Selectable)templateButton).colors;
			}
			else
			{
				Graphic targetGraphic = ((Selectable)button).targetGraphic;
				if ((Object)(object)targetGraphic != (Object)null)
				{
					targetGraphic.color = Color.white;
				}
				ColorBlock colors = ((Selectable)button).colors;
				((ColorBlock)(ref colors)).colorMultiplier = 1f;
				((ColorBlock)(ref colors)).fadeDuration = 0.08f;
				((ColorBlock)(ref colors)).normalColor = new Color(0.95f, 0.95f, 0.95f, 1f);
				((ColorBlock)(ref colors)).highlightedColor = new Color(1f, 1f, 1f, 1f);
				((ColorBlock)(ref colors)).pressedColor = new Color(0.82f, 0.82f, 0.82f, 1f);
				((ColorBlock)(ref colors)).selectedColor = ((ColorBlock)(ref colors)).highlightedColor;
				((ColorBlock)(ref colors)).disabledColor = new Color(0.62f, 0.62f, 0.62f, 0.84f);
				((Selectable)button).colors = colors;
			}
			ColorBlock colors2 = ((Selectable)button).colors;
			((ColorBlock)(ref colors2)).colorMultiplier = 1f;
			((ColorBlock)(ref colors2)).fadeDuration = 0.08f;
			switch (style)
			{
			case ButtonVisualStyle.Greens:
				((ColorBlock)(ref colors2)).normalColor = new Color(0.54f, 0.82f, 0.49f, 1f);
				((ColorBlock)(ref colors2)).highlightedColor = new Color(0.61f, 0.88f, 0.56f, 1f);
				((ColorBlock)(ref colors2)).pressedColor = new Color(0.44f, 0.67f, 0.4f, 1f);
				((ColorBlock)(ref colors2)).selectedColor = ((ColorBlock)(ref colors2)).highlightedColor;
				((ColorBlock)(ref colors2)).disabledColor = new Color(0.38f, 0.48f, 0.35f, 0.74f);
				break;
			case ButtonVisualStyle.Blues:
				((ColorBlock)(ref colors2)).normalColor = new Color(0.44f, 0.66f, 0.88f, 1f);
				((ColorBlock)(ref colors2)).highlightedColor = new Color(0.52f, 0.74f, 0.95f, 1f);
				((ColorBlock)(ref colors2)).pressedColor = new Color(0.35f, 0.53f, 0.72f, 1f);
				((ColorBlock)(ref colors2)).selectedColor = ((ColorBlock)(ref colors2)).highlightedColor;
				((ColorBlock)(ref colors2)).disabledColor = new Color(0.33f, 0.4f, 0.49f, 0.74f);
				break;
			case ButtonVisualStyle.Grays:
				((ColorBlock)(ref colors2)).normalColor = new Color(0.7f, 0.7f, 0.7f, 1f);
				((ColorBlock)(ref colors2)).highlightedColor = new Color(0.78f, 0.78f, 0.78f, 1f);
				((ColorBlock)(ref colors2)).pressedColor = new Color(0.58f, 0.58f, 0.58f, 1f);
				((ColorBlock)(ref colors2)).selectedColor = ((ColorBlock)(ref colors2)).highlightedColor;
				((ColorBlock)(ref colors2)).disabledColor = new Color(0.44f, 0.44f, 0.44f, 0.74f);
				break;
			case ButtonVisualStyle.Reds:
				((ColorBlock)(ref colors2)).normalColor = new Color(0.86f, 0.4f, 0.4f, 1f);
				((ColorBlock)(ref colors2)).highlightedColor = new Color(0.92f, 0.48f, 0.48f, 1f);
				((ColorBlock)(ref colors2)).pressedColor = new Color(0.7f, 0.3f, 0.3f, 1f);
				((ColorBlock)(ref colors2)).selectedColor = ((ColorBlock)(ref colors2)).highlightedColor;
				((ColorBlock)(ref colors2)).disabledColor = new Color(0.49f, 0.3f, 0.3f, 0.74f);
				break;
			case ButtonVisualStyle.Purple:
				((ColorBlock)(ref colors2)).normalColor = new Color(0.68f, 0.52f, 0.88f, 1f);
				((ColorBlock)(ref colors2)).highlightedColor = new Color(0.75f, 0.61f, 0.94f, 1f);
				((ColorBlock)(ref colors2)).pressedColor = new Color(0.55f, 0.4f, 0.73f, 1f);
				((ColorBlock)(ref colors2)).selectedColor = ((ColorBlock)(ref colors2)).highlightedColor;
				((ColorBlock)(ref colors2)).disabledColor = new Color(0.42f, 0.35f, 0.49f, 0.74f);
				break;
			case ButtonVisualStyle.Pink:
				((ColorBlock)(ref colors2)).normalColor = new Color(0.88f, 0.52f, 0.72f, 1f);
				((ColorBlock)(ref colors2)).highlightedColor = new Color(0.94f, 0.61f, 0.81f, 1f);
				((ColorBlock)(ref colors2)).pressedColor = new Color(0.73f, 0.4f, 0.58f, 1f);
				((ColorBlock)(ref colors2)).selectedColor = ((ColorBlock)(ref colors2)).highlightedColor;
				((ColorBlock)(ref colors2)).disabledColor = new Color(0.49f, 0.35f, 0.43f, 0.74f);
				break;
			case ButtonVisualStyle.Yellow:
				((ColorBlock)(ref colors2)).normalColor = new Color(0.88f, 0.74f, 0.44f, 1f);
				((ColorBlock)(ref colors2)).highlightedColor = new Color(0.95f, 0.82f, 0.54f, 1f);
				((ColorBlock)(ref colors2)).pressedColor = new Color(0.72f, 0.59f, 0.33f, 1f);
				((ColorBlock)(ref colors2)).selectedColor = ((ColorBlock)(ref colors2)).highlightedColor;
				((ColorBlock)(ref colors2)).disabledColor = new Color(0.49f, 0.44f, 0.33f, 0.74f);
				break;
			case ButtonVisualStyle.Cyan:
				((ColorBlock)(ref colors2)).normalColor = new Color(0.44f, 0.84f, 0.88f, 1f);
				((ColorBlock)(ref colors2)).highlightedColor = new Color(0.54f, 0.91f, 0.95f, 1f);
				((ColorBlock)(ref colors2)).pressedColor = new Color(0.33f, 0.69f, 0.72f, 1f);
				((ColorBlock)(ref colors2)).selectedColor = ((ColorBlock)(ref colors2)).highlightedColor;
				((ColorBlock)(ref colors2)).disabledColor = new Color(0.33f, 0.46f, 0.49f, 0.74f);
				break;
			case ButtonVisualStyle.DarkBlue:
				((ColorBlock)(ref colors2)).normalColor = new Color(0.24f, 0.35f, 0.55f, 1f);
				((ColorBlock)(ref colors2)).highlightedColor = new Color(0.31f, 0.44f, 0.67f, 1f);
				((ColorBlock)(ref colors2)).pressedColor = new Color(0.16f, 0.25f, 0.42f, 1f);
				((ColorBlock)(ref colors2)).selectedColor = ((ColorBlock)(ref colors2)).highlightedColor;
				((ColorBlock)(ref colors2)).disabledColor = new Color(0.24f, 0.27f, 0.33f, 0.74f);
				break;
			case ButtonVisualStyle.Orange:
				((ColorBlock)(ref colors2)).normalColor = new Color(0.88f, 0.58f, 0.44f, 1f);
				((ColorBlock)(ref colors2)).highlightedColor = new Color(0.95f, 0.67f, 0.54f, 1f);
				((ColorBlock)(ref colors2)).pressedColor = new Color(0.72f, 0.45f, 0.33f, 1f);
				((ColorBlock)(ref colors2)).selectedColor = ((ColorBlock)(ref colors2)).highlightedColor;
				((ColorBlock)(ref colors2)).disabledColor = new Color(0.49f, 0.38f, 0.33f, 0.74f);
				break;
			case ButtonVisualStyle.ExpeditionDarkAmber:
				((ColorBlock)(ref colors2)).normalColor = new Color(0.72f, 0.59f, 0.33f, 1f);
				((ColorBlock)(ref colors2)).highlightedColor = new Color(0.82f, 0.69f, 0.43f, 1f);
				((ColorBlock)(ref colors2)).pressedColor = new Color(0.56f, 0.44f, 0.22f, 1f);
				((ColorBlock)(ref colors2)).selectedColor = ((ColorBlock)(ref colors2)).highlightedColor;
				((ColorBlock)(ref colors2)).disabledColor = new Color(0.44f, 0.4f, 0.33f, 0.74f);
				break;
			case ButtonVisualStyle.ExpeditionOchre:
				((ColorBlock)(ref colors2)).normalColor = new Color(0.49f, 0.44f, 0.33f, 1f);
				((ColorBlock)(ref colors2)).highlightedColor = new Color(0.56f, 0.5f, 0.4f, 1f);
				((ColorBlock)(ref colors2)).pressedColor = new Color(0.39f, 0.34f, 0.24f, 1f);
				((ColorBlock)(ref colors2)).selectedColor = ((ColorBlock)(ref colors2)).highlightedColor;
				((ColorBlock)(ref colors2)).disabledColor = new Color(0.33f, 0.28f, 0.19f, 0.74f);
				break;
			case ButtonVisualStyle.ExpeditionKhaki:
				((ColorBlock)(ref colors2)).normalColor = new Color(0.76f, 0.69f, 0.57f, 1f);
				((ColorBlock)(ref colors2)).highlightedColor = new Color(0.83f, 0.77f, 0.66f, 1f);
				((ColorBlock)(ref colors2)).pressedColor = new Color(0.62f, 0.56f, 0.45f, 1f);
				((ColorBlock)(ref colors2)).selectedColor = ((ColorBlock)(ref colors2)).highlightedColor;
				((ColorBlock)(ref colors2)).disabledColor = new Color(0.44f, 0.42f, 0.36f, 0.74f);
				break;
			}
			((Selectable)button).colors = colors2;
			if ((Object)(object)((Selectable)button).targetGraphic != (Object)null)
			{
				((Selectable)button).targetGraphic.color = ((ColorBlock)(ref colors2)).normalColor;
			}
		}

		private void SetButtonText(GameObject buttonObject, string text)
		{
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_0145: 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)
			//IL_016f: 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_0189: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)buttonObject == (Object)null)
			{
				return;
			}
			TMP_Text[] componentsInChildren = buttonObject.GetComponentsInChildren<TMP_Text>(true);
			bool flag = false;
			TMP_Text[] array = componentsInChildren;
			foreach (TMP_Text val in array)
			{
				if (!((Object)(object)val == (Object)null))
				{
					val.text = text;
					val.enableAutoSizing = true;
					val.fontSizeMin = 11f;
					val.fontSizeMax = 18f;
					val.fontStyle = (FontStyles)(val.fontStyle & -2);
					val.overflowMode = (TextOverflowModes)1;
					val.textWrappingMode = (TextWrappingModes)0;
					flag = true;
				}
			}
			Text[] componentsInChildren2 = buttonObject.GetComponentsInChildren<Text>(true);
			Text[] array2 = componentsInChildren2;
			foreach (Text val2 in array2)
			{
				if (!((Object)(object)val2 == (Object)null))
				{
					val2.text = text;
					val2.resizeTextForBestFit = true;
					val2.resizeTextMinSize = 11;
					val2.resizeTextMaxSize = 18;
					val2.fontStyle = (FontStyle)0;
					val2.horizontalOverflow = (HorizontalWrapMode)1;
					val2.verticalOverflow = (VerticalWrapMode)0;
					flag = true;
				}
			}
			if (!flag)
			{
				RectTransform component = new GameObject("Text", new Type[1] { typeof(RectTransform) }).GetComponent<RectTransform>();
				((Transform)component).SetParent(buttonObject.transform, false);
				component.anchorMin = Vector2.zero;
				component.anchorMax = Vector2.one;
				component.offsetMin = Vector2.zero;
				component.offsetMax = Vector2.zero;
				TextMeshProUGUI val3 = ((Component)component).gameObject.AddComponent<TextMeshProUGUI>();
				if ((Object)(object)templateButtonText != (Object)null)
				{
					((TMP_Text)val3).font = templateButtonText.font;
					((TMP_Text)val3).fontSharedMaterial = templateButtonText.fontSharedMaterial;
					((Graphic)val3).color = ((Graphic)templateButtonText).color;
				}
				else
				{
					((Graphic)val3).color = Color.white;
				}
				((TMP_Text)val3).alignment = (TextAlignmentOptions)514;
				((TMP_Text)val3).enableAutoSizing = true;
				((TMP_Text)val3).fontSizeMin = 11f;
				((TMP_Text)val3).fontSizeMax = 18f;
				((TMP_Text)val3).fontStyle = (FontStyles)0;
				((TMP_Text)val3).overflowMode = (TextOverflowModes)1;
				((TMP_Text)val3).textWrappingMode = (TextWrappingModes)0;
				((TMP_Text)val3).text = text;
				ApplyButtonLabelStyle(buttonObject, ButtonVisualStyle.Blues);
			}
		}

		private static string GetDisplaySaveName(SaveListEntry entry)
		{
			if (entry != null && entry.metadata != null && !string.IsNullOrWhiteSpace(entry.metadata.saveName))
			{
				return PrettySaveName(entry.metadata.saveName.Trim());
			}
			if (entry == null || string.IsNullOrWhiteSpace(entry.fileName))
			{
				return "Unnamed Save";
			}
			string fileName = entry.fileName;
			fileName = ((!fileName.EndsWith(".peaksave.json", StringComparison.OrdinalIgnoreCase)) ? Path.GetFileNameWithoutExtension(fileName) : fileName.Substring(0, fileName.Length - ".peaksave.json".Length));
			if (!string.IsNullOrWhiteSpace(fileName))
			{
				return PrettySaveName(fileName);
			}
			return "Unnamed Save";
		}

		private static string PrettySaveName(string name)
		{
			if (string.IsNullOrWhiteSpace(name))
			{
				return "Unnamed Save";
			}
			string text = name.Trim();
			if (text.EndsWith(".peaksave.json", StringComparison.OrdinalIgnoreCase))
			{
				text = text.Substring(0, text.Length - ".peaksave.json".Length);
			}
			else if (text.EndsWith(".json", StringComparison.OrdinalIgnoreCase))
			{
				text = text.Substring(0, text.Length - ".json".Length);
			}
			else if (text.EndsWith(".peaksave", StringComparison.OrdinalIgnoreCase))
			{
				text = text.Substring(0, text.Length - ".peaksave".Length);
			}
			if (string.IsNullOrWhiteSpace(text))
			{
				text = "Unnamed Save";
			}
			int num = text.IndexOf("--", StringComparison.Ordinal);
			if (num > 0)
			{
				text = text.Substring(num + 2);
			}
			if (text.StartsWith("quicksave_", StringComparison.OrdinalIgnoreCase) || text.StartsWith("quit_save_", StringComparison.OrdinalIgnoreCase))
			{
				return "Quick Save";
			}
			if (text.StartsWith("autosave", StringComparison.OrdinalIgnoreCase))
			{
				string text2 = text.Substring("autosave".Length).TrimStart('-', '_', ' ');
				return string.IsNullOrWhiteSpace(text2) ? "Autosave" : ("Settings - AS:" + text2);
			}
			if (text.StartsWith("Expedition", StringComparison.OrdinalIgnoreCase))
			{
				string value = text.Substring("Expedition".Length).TrimStart('-', '_', ' ');
				return string.IsNullOrWhiteSpace(value) ? "Expedition" : "Expedition Save Manager";
			}
			return text;
		}

		private static string FormatSavedTime(SaveListEntry entry)
		{
			if (entry == null)
			{
				return "Saved: -";
			}
			DateTime dateTime = entry.fileTime;
			if (entry.metadata != null && entry.metadata.savedAtUtc != default(DateTime))
			{
				dateTime = entry.metadata.savedAtUtc.ToLocalTime();
			}
			return "Saved: " + dateTime.ToString("M/d/yyyy h:mm:ss tt", CultureInfo.InvariantCulture);
		}

		private static string FormatLevelDisplayName(SaveMetadata metadata)
		{
			if (metadata == null)
			{
				return "-";
			}
			i