Decompiled source of LostAndFound v1.2.5

LostAndFound.dll

Decompiled 2 weeks ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using Microsoft.CodeAnalysis;
using On.RoR2;
using RiskOfOptions;
using RiskOfOptions.OptionConfigs;
using RiskOfOptions.Options;
using RoR2;
using RoR2.UI;
using TMPro;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("LostAndFound")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+d7fd7eb8b4d68f6e2e12f0d7e52a3ae4cf049c7c")]
[assembly: AssemblyProduct("LostAndFound")]
[assembly: AssemblyTitle("LostAndFound")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace LostAndFound
{
	public static class Blacklists
	{
		public static readonly HashSet<string> blacklistedNames = new HashSet<string>
		{
			"FROG_NAME", "BAZAAR_CAULDRON_NAME", "MOON_BATTERY_SOUL_NAME", "MOON_BATTERY_BLOOD_NAME", "MOON_BATTERY_DESIGN_NAME", "MOON_BATTERY_MASS_NAME", "VENDING_MACHINE_NAME", "SHRINE_COMBAT_NAME", "SHRINE_BLOOD_NAME", "SHRINE_HEALING_NAME",
			"SHRINE_RESTACK_NAME", "SHRINE_COLOSSUS_NAME", "SHRINE_CLEANSE_NAME", "LOCKEDTREEBOT_NAME", "MULTISHOP_TERMINAL_NAME", "DRONE_VENDOR_TERMINAL_NAME", "FAN_NAME", "NULL_WARD_NAME", "DRIFTERBAGCHEST_NAME", "COINSLOT_STATUE_NAME",
			"BROKENROBOT_NAME", "COLLECTIVE_SHRINE_NAME"
		};

		public const string newtAltarName = "NEWT_STATUE_NAME";

		public const string lunarPodName = "LUNAR_CHEST_NAME";

		public const string droneScrapperName = "DRONE_SCRAPPER_NAME";

		public const string printerName = "DUPLICATOR_NAME";

		public const string powerPyramidName = "ITEM_POWERPYRAMID_NAME";

		public static readonly HashSet<string> droneNames = new HashSet<string>
		{
			"DRONE_GUNNER_INTERACTABLE_NAME", "DRONE_HEALING_INTERACTABLE_NAME", "DRONE_MISSILE_INTERACTABLE_NAME", "EQUIPMENTDRONE_INTERACTABLE_NAME", "FLAMEDRONE_INTERACTABLE_NAME", "EMERGENCYDRONE_INTERACTABLE_NAME", "TURRET1_INTERACTABLE_NAME", "DRONE_JUNK_INTERACTABLE_NAME", "DRONE_HAULER_INTERACTABLE_NAME", "DRONE_JAILER_INTERACTABLE_NAME",
			"DRONE_CLEANUP_INTERACTABLE_NAME", "DRONE_COPYCAT_INTERACTABLE_NAME", "DRONE_RECHARGE_INTERACTABLE_NAME", "DRONE_BOMBARDMENT_INTERACTABLE_NAME"
		};
	}
	public abstract class Interactable
	{
		public abstract bool IsAvailable { get; }

		public abstract Vector3 GetPosition();

		public virtual void SimulateDrop()
		{
		}

		internal void CreateDropOrb(Vector3 effectOrigin, GameObject targetObject, PickupDef pickupDef)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Expected O, but got Unknown
			EffectData val = new EffectData
			{
				origin = effectOrigin,
				genericFloat = 1.5f,
				genericUInt = (uint)(pickupDef.pickupIndex.value + 1)
			};
			val.SetNetworkedObjectReference(targetObject);
			EffectManager.SpawnEffect(LostAndFoundPlugin.effectPrefab, val, false);
		}

		protected void SimulatePurchaseDrop(PurchaseInteraction pi)
		{
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_014c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_0165: Unknown result type (might be due to invalid IL or missing references)
			//IL_016c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0171: Unknown result type (might be due to invalid IL or missing references)
			//IL_0176: Unknown result type (might be due to invalid IL or missing references)
			//IL_0178: Unknown result type (might be due to invalid IL or missing references)
			//IL_017d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0196: Unknown result type (might be due to invalid IL or missing references)
			//IL_019b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0281: Unknown result type (might be due to invalid IL or missing references)
			//IL_0295: Unknown result type (might be due to invalid IL or missing references)
			//IL_029a: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0377: Unknown result type (might be due to invalid IL or missing references)
			//IL_038b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0390: Unknown result type (might be due to invalid IL or missing references)
			//IL_0397: Unknown result type (might be due to invalid IL or missing references)
			//IL_039c: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ba: Unknown result type (might be due to invalid IL or missing references)
			if (pi.displayNameToken.Contains("CHEST") || pi.displayNameToken.Contains("EQUIPMENTBARREL") || pi.displayNameToken == "LOCKBOX_NAME")
			{
				ChestBehavior component = ((Component)pi).GetComponent<ChestBehavior>();
				if (Object.op_Implicit((Object)(object)component))
				{
					CreateDropOrb(((Component)pi).gameObject.transform.position + new Vector3(0f, 3.5f, 0f), ((Component)pi).gameObject, PickupCatalog.GetPickupDef(component.currentPickup.pickupIndex));
				}
			}
			else if (pi.displayNameToken.Contains("CHANCE"))
			{
				ShrineChanceBehavior component2 = ((Component)pi).GetComponent<ShrineChanceBehavior>();
				if (!Object.op_Implicit((Object)(object)component2))
				{
					return;
				}
				float num = 360f / (float)component2.maxPurchaseCount;
				Vector3 val = Quaternion.AngleAxis(90f, Vector3.up) * ((Component)pi).gameObject.transform.forward * 2f;
				int num2 = component2.successfulPurchaseCount;
				while (num2 < component2.maxPurchaseCount)
				{
					if (component2.rng.nextNormalizedFloat > component2.failureChance)
					{
						float num3 = num * (float)num2;
						CreateDropOrb(((Component)pi).gameObject.transform.position + new Vector3(0f, 3.5f, 0f) + Quaternion.AngleAxis(num3, Vector3.up) * val, ((Component)pi).gameObject, PickupCatalog.GetPickupDef(component2.dropTable.GeneratePickup(component2.rng).pickupIndex));
						num2++;
					}
				}
			}
			else if (pi.displayNameToken == "VOID_TRIPLE_NAME" || (pi.displayNameToken == "VOIDLOCKBOX_NAME" && !LostAndFoundPlugin.showVoidKeyContents.Value))
			{
				OptionChestBehavior component3 = ((Component)pi).GetComponent<OptionChestBehavior>();
				if (Object.op_Implicit((Object)(object)component3))
				{
					float num4 = 360f / (float)component3.generatedPickups.Count;
					Vector3 val2 = default(Vector3);
					((Vector3)(ref val2))..ctor(0f, 0f, 1f + 0.16f * (float)component3.generatedPickups.Count);
					for (int i = 0; i < component3.generatedPickups.Count; i++)
					{
						float num5 = num4 * (float)i;
						CreateDropOrb(((Component)pi).gameObject.transform.position + new Vector3(0f, 3.5f, 0f) + Quaternion.AngleAxis(num5, Vector3.up) * val2, ((Component)pi).gameObject, PickupCatalog.GetPickupDef(component3.generatedPickups[i].pickupIndex));
					}
				}
			}
			else
			{
				if (!(pi.displayNameToken == "SCAVBACKPACK_NAME"))
				{
					return;
				}
				ChestBehavior component4 = ((Component)pi).GetComponent<ChestBehavior>();
				if (!Object.op_Implicit((Object)(object)component4))
				{
					return;
				}
				float num6 = 36f;
				Vector3 val3 = default(Vector3);
				((Vector3)(ref val3))..ctor(0f, 0f, 4f);
				for (int j = 0; j < 10; j++)
				{
					float num7 = num6 * (float)j;
					component4.RollItem();
					CreateDropOrb(((Component)pi).gameObject.transform.position + new Vector3(0f, 6.5f, 0f) + Quaternion.AngleAxis(num7, Vector3.up) * val3, ((Component)pi).gameObject, PickupCatalog.GetPickupDef(component4.currentPickup.pickupIndex));
					for (int k = 0; k < component4.dropCount; k++)
					{
						component4.Roll();
					}
				}
			}
		}
	}
	public class PurchaseInteractable : Interactable
	{
		public readonly PurchaseInteraction pi;

		public override bool IsAvailable => Object.op_Implicit((Object)(object)pi) && pi.available;

		public PurchaseInteractable(PurchaseInteraction purchase)
		{
			pi = purchase;
		}

		public override Vector3 GetPosition()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			return ((Component)pi).transform.position;
		}

		public override void SimulateDrop()
		{
			SimulatePurchaseDrop(pi);
		}
	}
	public class Printer3DInteractable : Interactable
	{
		public static readonly HashSet<string> printerNames = new HashSet<string> { "DUPLICATOR_NAME", "DUPLICATOR_MILITARY_NAME", "DUPLICATOR_WILD_NAME", "DUPLICATOR_QUALITY_NAME", "DUPLICATOR_MILITARY_QUALITY_NAME", "DUPLICATOR_WILD_QUALITY_NAME" };

		public readonly PurchaseInteraction pi;

		public bool usedPrinter;

		public override bool IsAvailable => Object.op_Implicit((Object)(object)pi) && !usedPrinter;

		public Printer3DInteractable(PurchaseInteraction purchase)
		{
			pi = purchase;
		}

		public override Vector3 GetPosition()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			return ((Component)pi).transform.position;
		}
	}
	public class HollowChestInteractable : Interactable
	{
		public const string hollowChestName = "HOLLOWCHEST_NAME";

		public readonly PurchaseInteraction pi;

		public bool purchased;

		public override bool IsAvailable => Object.op_Implicit((Object)(object)pi) && !purchased;

		public HollowChestInteractable(PurchaseInteraction purchase)
		{
			pi = purchase;
		}

		public override Vector3 GetPosition()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			return ((Component)pi).transform.position;
		}

		public override void SimulateDrop()
		{
			SimulatePurchaseDrop(pi);
		}
	}
	public class MultiShopInteractable : Interactable
	{
		public readonly MultiShopController msc;

		public override bool IsAvailable => Object.op_Implicit((Object)(object)msc) && msc.available;

		public MultiShopInteractable(MultiShopController multiShop)
		{
			msc = multiShop;
		}

		public override Vector3 GetPosition()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			return ((Component)msc).transform.position;
		}

		public override void SimulateDrop()
		{
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: 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_0057: Unknown result type (might be due to invalid IL or missing references)
			GameObject[] terminalGameObjects = msc.terminalGameObjects;
			foreach (GameObject val in terminalGameObjects)
			{
				ShopTerminalBehavior component = val.GetComponent<ShopTerminalBehavior>();
				if (Object.op_Implicit((Object)(object)component))
				{
					CreateDropOrb(val.transform.position + new Vector3(0f, 5f, 0f), val, PickupCatalog.GetPickupDef(component.Networkpickup.pickupIndex));
				}
			}
		}
	}
	public class DroneMultiShopInteractable : Interactable
	{
		public readonly DroneVendorMultiShopController dvmsc;

		public override bool IsAvailable => Object.op_Implicit((Object)(object)dvmsc) && dvmsc.available;

		public DroneMultiShopInteractable(DroneVendorMultiShopController droneMultiShop)
		{
			dvmsc = droneMultiShop;
		}

		public override Vector3 GetPosition()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			return ((Component)dvmsc).transform.position;
		}
	}
	public class BarrelInteractable : Interactable
	{
		public readonly BarrelInteraction bi;

		public override bool IsAvailable => Object.op_Implicit((Object)(object)bi) && !bi.opened;

		public BarrelInteractable(BarrelInteraction barrel)
		{
			bi = barrel;
		}

		public override Vector3 GetPosition()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			return ((Component)bi).transform.position;
		}
	}
	public class ScrapperInteractable : Interactable
	{
		public readonly ScrapperController sc;

		public override bool IsAvailable => Object.op_Implicit((Object)(object)sc) && ((Component)sc).gameObject.activeInHierarchy && !LostAndFoundPlugin.didScrap;

		public ScrapperInteractable(ScrapperController scrapper)
		{
			sc = scrapper;
		}

		public override Vector3 GetPosition()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			return ((Component)sc).transform.position;
		}
	}
	public class GenericPickupControllerInteractable : Interactable
	{
		public readonly GenericPickupController gpc;

		public override bool IsAvailable => Object.op_Implicit((Object)(object)gpc) && !gpc.consumed;

		public GenericPickupControllerInteractable(GenericPickupController pickup)
		{
			gpc = pickup;
		}

		public override Vector3 GetPosition()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			return ((Component)gpc).transform.position;
		}
	}
	public class NtormatPageInteractable : GenericPickupControllerInteractable
	{
		public NtormatPageInteractable(GenericPickupController pickup)
			: base(pickup)
		{
		}

		public override void SimulateDrop()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			PickupDef pickupDef = PickupCatalog.GetPickupDef(gpc.pickup.pickupIndex);
			if (pickupDef != null)
			{
				CreateDropOrb(((Component)gpc).transform.position + new Vector3(0f, 3.5f, 0f), ((Component)gpc).gameObject, pickupDef);
			}
		}
	}
	public class PotentialInteractable : Interactable
	{
		public readonly PickupPickerController ppc;

		public override bool IsAvailable => Object.op_Implicit((Object)(object)ppc);

		public PotentialInteractable(PickupPickerController picker)
		{
			ppc = picker;
		}

		public override Vector3 GetPosition()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			return ((Component)ppc).transform.position;
		}

		public override void SimulateDrop()
		{
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			float num = 360f / (float)ppc.options.Length;
			Vector3 val = default(Vector3);
			((Vector3)(ref val))..ctor(0f, 0f, 1f + 0.16f * (float)ppc.options.Length);
			for (int i = 0; i < ppc.options.Length; i++)
			{
				if (ppc.options[i].available)
				{
					float num2 = num * (float)i;
					CreateDropOrb(((Component)ppc).gameObject.transform.position + new Vector3(0f, 3.5f, 0f) + Quaternion.AngleAxis(num2, Vector3.up) * val, ((Component)ppc).gameObject, PickupCatalog.GetPickupDef(ppc.options[i].pickup.pickupIndex));
				}
			}
		}
	}
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("Pudwinks.LostAndFound", "LostAndFound", "1.2.5")]
	public class LostAndFoundPlugin : BaseUnityPlugin
	{
		public const string PluginGUID = "Pudwinks.LostAndFound";

		public const string PluginAuthor = "Pudwinks";

		public const string PluginName = "LostAndFound";

		public const string PluginVersion = "1.2.5";

		public static readonly List<Interactable> interactables = new List<Interactable>();

		private static ConfigEntry<bool> showNewtAltars;

		private static ConfigEntry<bool> showLunarPods;

		private static ConfigEntry<bool> showPrinters;

		private static ConfigEntry<bool> showDrones;

		private static ConfigEntry<bool> showDroneScrappers;

		private static ConfigEntry<bool> showItemsOnGround;

		private static ConfigEntry<bool> showBarrels;

		private static ConfigEntry<bool> showContents;

		public static ConfigEntry<bool> showVoidKeyContents;

		public static ConfigEntry<bool> showSecretNtormatPages;

		private static ConfigEntry<bool> showText;

		private static ConfigEntry<int> textSize;

		private static ConfigEntry<int> textBottomOffset;

		internal static GameObject effectPrefab;

		private static GameObject textCanvas;

		private static HGTextMeshProUGUI recapText;

		public static bool didScrap;

		private static ConfigEntry<KeyboardShortcut> nextKey;

		private static ConfigEntry<KeyboardShortcut> previousKey;

		private static ConfigEntry<KeyboardShortcut> zoomOutKey;

		private static ConfigEntry<KeyboardShortcut> zoomInKey;

		private static ConfigEntry<KeyboardShortcut> finishKey;

		private static SceneExitController heldExit;

		private static bool releasing;

		private static int currentIndex = -1;

		private const float defaultOrbitYaw = 0f;

		private const float defaultOrbitPitch = 15f;

		private const float defaultOrbitDistance = 23f;

		private static float orbitYaw = 0f;

		private static float orbitPitch = 15f;

		private static float orbitDistance = 23f;

		private const float orbitPitchLimit = 89f;

		private const float zoomSpeed = 35f;

		private const float minOrbitDistance = 1f;

		private void Awake()
		{
			//IL_0202: Unknown result type (might be due to invalid IL or missing references)
			//IL_020c: Expected O, but got Unknown
			//IL_0246: Unknown result type (might be due to invalid IL or missing references)
			//IL_0250: Expected O, but got Unknown
			//IL_027a: 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_02e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_031f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0355: Unknown result type (might be due to invalid IL or missing references)
			//IL_0379: Unknown result type (might be due to invalid IL or missing references)
			//IL_037e: 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_039c: Expected O, but got Unknown
			//IL_03a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ae: Expected O, but got Unknown
			//IL_03b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c0: Expected O, but got Unknown
			//IL_03c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d2: Expected O, but got Unknown
			//IL_03da: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e4: Expected O, but got Unknown
			//IL_03ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f6: Expected O, but got Unknown
			//IL_03fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0408: Expected O, but got Unknown
			//IL_0410: Unknown result type (might be due to invalid IL or missing references)
			//IL_041a: Expected O, but got Unknown
			//IL_0422: Unknown result type (might be due to invalid IL or missing references)
			//IL_042c: Expected O, but got Unknown
			//IL_0434: Unknown result type (might be due to invalid IL or missing references)
			//IL_043e: Expected O, but got Unknown
			//IL_0446: Unknown result type (might be due to invalid IL or missing references)
			//IL_0450: Expected O, but got Unknown
			showNewtAltars = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Show newt altars", false, "Set to true if you want to see newt altars in the recap. Default is false to avoid potential spoilers.");
			RiskOfOptionsStuff.AddOption(showNewtAltars);
			showLunarPods = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Show lunar pods", false, "Set to true if you want to see lunar pods in the recap.");
			RiskOfOptionsStuff.AddOption(showLunarPods);
			showPrinters = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Show white/green 3D printers", true, "Set to true if you want to see white and green 3D printers in the recap. Setting this to false will only hide white and green printers, since they are the most common. Red and boss printers remain visible regardless of this setting.");
			RiskOfOptionsStuff.AddOption(showPrinters);
			showDrones = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Show drones", true, "Set to true if you want to see drones in the recap. TC-280 drone always shows up regardless of this setting. Because it's a cool drone.");
			RiskOfOptionsStuff.AddOption(showDrones);
			showDroneScrappers = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Show drone scrappers", false, "Set to true if you want to see drone scrappers in the recap.");
			RiskOfOptionsStuff.AddOption(showDroneScrappers);
			showItemsOnGround = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Show items on ground", true, "Set to true if you want to see items on the ground in the recap. If you forgot to pick something up, it'll show up. Does not show void items.");
			RiskOfOptionsStuff.AddOption(showItemsOnGround);
			showBarrels = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Show barrels", false, "Set to true if you want to see barrels in the recap.");
			RiskOfOptionsStuff.AddOption(showBarrels);
			showContents = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Show container contents", true, "Set to true if you want to see container contents in the recap.");
			RiskOfOptionsStuff.AddOption(showContents);
			showVoidKeyContents = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Show Encrusted Cache contents", true, "Set to true if you want to see the contents of Encrusted Caches (corrupted form of the Rusted Key lockbox). Irrelevant if \"Show container contents\" is false.");
			RiskOfOptionsStuff.AddOption(showVoidKeyContents);
			showSecretNtormatPages = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Show secret Ntormat pages", true, "Set to true if you want to see the secret Ntormat pages on the ground in the recap.");
			RiskOfOptionsStuff.AddOption(showSecretNtormatPages);
			showText = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Show recap text", true, "Set to true if you want to see the recap counter text (e.g. 3/17) at the bottom of the screen.");
			RiskOfOptionsStuff.AddOption(showText);
			textSize = ((BaseUnityPlugin)this).Config.Bind<int>("General", "Recap text size", 28, new ConfigDescription("Font size of the recap counter text.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(12, 200), Array.Empty<object>()));
			RiskOfOptionsStuff.AddOption(textSize);
			textBottomOffset = ((BaseUnityPlugin)this).Config.Bind<int>("General", "Recap text bottom offset", 200, new ConfigDescription("Distance in pixels between the bottom of the screen and the recap counter text.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 1000), Array.Empty<object>()));
			RiskOfOptionsStuff.AddOption(textBottomOffset);
			nextKey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Keybinds", "Next interactable", new KeyboardShortcut((KeyCode)323, Array.Empty<KeyCode>()), "Which key to use to show the next interactable in the recap.");
			RiskOfOptionsStuff.AddOption(nextKey);
			previousKey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Keybinds", "Previous interactable", new KeyboardShortcut((KeyCode)324, Array.Empty<KeyCode>()), "Which key to use to show the previous interactable in the recap.");
			RiskOfOptionsStuff.AddOption(previousKey);
			zoomOutKey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Keybinds", "Zoom out", new KeyboardShortcut((KeyCode)97, Array.Empty<KeyCode>()), "Which key to use to zoom out the camera in the recap.");
			RiskOfOptionsStuff.AddOption(zoomOutKey);
			zoomInKey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Keybinds", "Zoom in", new KeyboardShortcut((KeyCode)100, Array.Empty<KeyCode>()), "Which key to use to zoom in the camera in the recap.");
			RiskOfOptionsStuff.AddOption(zoomInKey);
			finishKey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Keybinds", "Finish recap", new KeyboardShortcut((KeyCode)115, Array.Empty<KeyCode>()), "Which key to use to finish the recap once it's started.");
			RiskOfOptionsStuff.AddOption(finishKey);
			effectPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC3/MealPrep/PickupTakenOrbEffect.prefab").WaitForCompletion();
			PurchaseInteraction.Start += new hook_Start(PurchaseInteraction_Start);
			PurchaseInteraction.OnInteractionBegin += new hook_OnInteractionBegin(PurchaseInteraction_OnInteractionBegin);
			ScrapperController.PreStartClient += new hook_PreStartClient(ScrapperController_PreStartClient);
			ScrapperController.BeginScrapping_UniquePickup += new hook_BeginScrapping_UniquePickup(ScrapperController_BeginScrapping_UniquePickup);
			MultiShopController.Start += new hook_Start(MultiShopController_Start);
			DroneVendorMultiShopController.Start += new hook_Start(DroneVendorMultiShopController_Start);
			GenericPickupController.Start += new hook_Start(GenericPickupController_Start);
			PickupPickerController.OnEnable += new hook_OnEnable(PickupPickerController_OnEnable);
			BarrelInteraction.OnEnable += new hook_OnEnable(BarrelInteraction_OnEnable);
			SceneExitController.SetState += new hook_SetState(SceneExitController_SetState);
			Run.OnDestroy += new hook_OnDestroy(Run_OnDestroy);
			SceneManager.activeSceneChanged += OnActiveSceneChanged;
		}

		private void OnDestroy()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Expected O, but got Unknown
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Expected O, but got Unknown
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Expected O, but got Unknown
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Expected O, but got Unknown
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Expected O, but got Unknown
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Expected O, but got Unknown
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Expected O, but got Unknown
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Expected O, but got Unknown
			PurchaseInteraction.Start -= new hook_Start(PurchaseInteraction_Start);
			PurchaseInteraction.OnInteractionBegin -= new hook_OnInteractionBegin(PurchaseInteraction_OnInteractionBegin);
			ScrapperController.PreStartClient -= new hook_PreStartClient(ScrapperController_PreStartClient);
			ScrapperController.BeginScrapping_UniquePickup -= new hook_BeginScrapping_UniquePickup(ScrapperController_BeginScrapping_UniquePickup);
			MultiShopController.Start -= new hook_Start(MultiShopController_Start);
			DroneVendorMultiShopController.Start -= new hook_Start(DroneVendorMultiShopController_Start);
			GenericPickupController.Start -= new hook_Start(GenericPickupController_Start);
			PickupPickerController.OnEnable -= new hook_OnEnable(PickupPickerController_OnEnable);
			BarrelInteraction.OnEnable -= new hook_OnEnable(BarrelInteraction_OnEnable);
			SceneExitController.SetState -= new hook_SetState(SceneExitController_SetState);
			Run.OnDestroy -= new hook_OnDestroy(Run_OnDestroy);
			SceneManager.activeSceneChanged -= OnActiveSceneChanged;
			if (Object.op_Implicit((Object)(object)textCanvas))
			{
				Object.Destroy((Object)(object)textCanvas);
			}
		}

		private void Update()
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: 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_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_013b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)heldExit == (Object)null || PauseManager.PauseScreenIsOpen())
			{
				return;
			}
			KeyboardShortcut value = nextKey.Value;
			if (Input.GetKeyDown(((KeyboardShortcut)(ref value)).MainKey))
			{
				MoveTo(currentIndex + 1);
			}
			value = previousKey.Value;
			if (Input.GetKeyDown(((KeyboardShortcut)(ref value)).MainKey))
			{
				MoveTo(currentIndex - 1);
			}
			value = finishKey.Value;
			if (Input.GetKeyDown(((KeyboardShortcut)(ref value)).MainKey))
			{
				Resume();
			}
			else if (currentIndex >= 0)
			{
				value = zoomOutKey.Value;
				if (Input.GetKey(((KeyboardShortcut)(ref value)).MainKey))
				{
					orbitDistance += 35f * Time.unscaledDeltaTime;
				}
				value = zoomInKey.Value;
				if (Input.GetKey(((KeyboardShortcut)(ref value)).MainKey))
				{
					orbitDistance -= 35f * Time.unscaledDeltaTime;
				}
				if (orbitDistance < 1f)
				{
					orbitDistance = 1f;
				}
				Vector2 val = ReadMouseLook();
				orbitYaw += val.x;
				orbitPitch = Mathf.Clamp(orbitPitch - val.y, -89f, 89f);
				ApplyCamera();
			}
		}

		private void LateUpdate()
		{
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)heldExit != (Object)null) || currentIndex < 0 || !showText.Value || PauseManager.PauseScreenIsOpen())
			{
				if (Object.op_Implicit((Object)(object)textCanvas))
				{
					textCanvas.SetActive(false);
				}
				return;
			}
			if (!Object.op_Implicit((Object)(object)textCanvas))
			{
				CreateRecapText();
			}
			textCanvas.SetActive(true);
			((TMP_Text)recapText).fontSize = textSize.Value;
			((TMP_Text)recapText).rectTransform.anchoredPosition = new Vector2(0f, (float)textBottomOffset.Value);
			((TMP_Text)recapText).text = $"{currentIndex + 1}/{interactables.Count}";
		}

		private static void CreateRecapText()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Expected O, but got Unknown
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Expected O, but got Unknown
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			textCanvas = new GameObject("LostAndFoundRecapCanvas");
			Object.DontDestroyOnLoad((Object)(object)textCanvas);
			Canvas val = textCanvas.AddComponent<Canvas>();
			val.renderMode = (RenderMode)0;
			val.sortingOrder = 100;
			GameObject val2 = new GameObject("RecapText", new Type[1] { typeof(RectTransform) });
			val2.transform.SetParent(textCanvas.transform, false);
			recapText = val2.AddComponent<HGTextMeshProUGUI>();
			((TMP_Text)recapText).alignment = (TextAlignmentOptions)1026;
			((TMP_Text)recapText).enableWordWrapping = false;
			((Graphic)recapText).raycastTarget = false;
			RectTransform rectTransform = ((TMP_Text)recapText).rectTransform;
			Vector2 val3 = default(Vector2);
			((Vector2)(ref val3))..ctor(0.5f, 0f);
			rectTransform.pivot = val3;
			Vector2 anchorMin = (rectTransform.anchorMax = val3);
			rectTransform.anchorMin = anchorMin;
			rectTransform.sizeDelta = new Vector2(2000f, 400f);
		}

		private static Vector2 ReadMouseLook()
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			LocalUser firstLocalUser = LocalUserManager.GetFirstLocalUser();
			UserProfile val = ((firstLocalUser != null) ? firstLocalUser.userProfile : null);
			if (((firstLocalUser != null) ? firstLocalUser.inputPlayer : null) == null || val == null)
			{
				return Vector2.zero;
			}
			Vector2 val2 = default(Vector2);
			((Vector2)(ref val2))..ctor(firstLocalUser.inputPlayer.GetAxisRaw(2), firstLocalUser.inputPlayer.GetAxisRaw(3));
			if (val.mouseLookInvertX)
			{
				val2.x = 0f - val2.x;
			}
			if (val.mouseLookInvertY)
			{
				val2.y = 0f - val2.y;
			}
			return val2 * new Vector2(val.mouseLookScaleX, val.mouseLookScaleY) * val.mouseLookSensitivity;
		}

		private void MoveTo(int index)
		{
			if (interactables.Count != 0)
			{
				currentIndex = Mathf.Clamp(index, 0, interactables.Count - 1);
			}
		}

		private void ApplyCamera()
		{
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: 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_007d: 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_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			LocalUser firstLocalUser = LocalUserManager.GetFirstLocalUser();
			CameraRigController val = ((firstLocalUser != null) ? firstLocalUser.cameraRigController : null);
			if (Object.op_Implicit((Object)(object)val))
			{
				Vector3 val2 = default(Vector3);
				((Vector3)(ref val2))..ctor(0f, 0.5f, 0f);
				Vector3 val3 = interactables[currentIndex].GetPosition() + val2;
				Vector3 val4 = val3 + Quaternion.Euler(orbitPitch, orbitYaw, 0f) * new Vector3(0f, 0f, 0f - orbitDistance);
				val.SetCameraState(new CameraState
				{
					position = val4,
					rotation = Quaternion.LookRotation(val3 - val4),
					fov = val.currentCameraState.fov
				});
			}
		}

		private void PurchaseInteraction_Start(orig_Start orig, PurchaseInteraction self)
		{
			orig.Invoke(self);
			if (Blacklists.blacklistedNames.Contains(self.displayNameToken) || (Blacklists.droneNames.Contains(self.displayNameToken) && !showDrones.Value) || (self.displayNameToken == "NEWT_STATUE_NAME" && !showNewtAltars.Value) || (self.displayNameToken == "LUNAR_CHEST_NAME" && !showLunarPods.Value) || (self.displayNameToken == "DUPLICATOR_NAME" && !showPrinters.Value) || (self.displayNameToken == "DRONE_SCRAPPER_NAME" && !showDroneScrappers.Value) || ((Object)self).name == "PortalDialer")
			{
				return;
			}
			GameObject gameObject = self.GetGameObject();
			if (!(((gameObject != null) ? ((Object)gameObject).name : null) ?? "").ToUpper().Contains("MIMIC"))
			{
				if (Printer3DInteractable.printerNames.Contains(self.displayNameToken))
				{
					interactables.Add(new Printer3DInteractable(self));
				}
				else if (self.displayNameToken == "HOLLOWCHEST_NAME")
				{
					interactables.Add(new HollowChestInteractable(self));
				}
				else
				{
					interactables.Add(new PurchaseInteractable(self));
				}
			}
		}

		private void PurchaseInteraction_OnInteractionBegin(orig_OnInteractionBegin orig, PurchaseInteraction self, Interactor activator)
		{
			orig.Invoke(self, activator);
			if (!Printer3DInteractable.printerNames.Contains(self.displayNameToken) && self.displayNameToken != "HOLLOWCHEST_NAME")
			{
				return;
			}
			foreach (Interactable interactable in interactables)
			{
				if (interactable is Printer3DInteractable printer3DInteractable && (Object)(object)printer3DInteractable.pi == (Object)(object)self)
				{
					printer3DInteractable.usedPrinter = true;
				}
				if (interactable is HollowChestInteractable hollowChestInteractable && (Object)(object)hollowChestInteractable.pi == (Object)(object)self)
				{
					hollowChestInteractable.purchased = true;
				}
			}
		}

		private void ScrapperController_PreStartClient(orig_PreStartClient orig, ScrapperController self)
		{
			orig.Invoke(self);
			interactables.Add(new ScrapperInteractable(self));
		}

		private void ScrapperController_BeginScrapping_UniquePickup(orig_BeginScrapping_UniquePickup orig, ScrapperController self, UniquePickup pickupToTake)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self, pickupToTake);
			didScrap = true;
		}

		private void MultiShopController_Start(orig_Start orig, MultiShopController self)
		{
			orig.Invoke(self);
			interactables.Add(new MultiShopInteractable(self));
		}

		private void DroneVendorMultiShopController_Start(orig_Start orig, DroneVendorMultiShopController self)
		{
			orig.Invoke(self);
			interactables.Add(new DroneMultiShopInteractable(self));
		}

		private void GenericPickupController_Start(orig_Start orig, GenericPickupController self)
		{
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Invalid comparison between Unknown and I4
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Invalid comparison between Unknown and I4
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Invalid comparison between Unknown and I4
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Invalid comparison between Unknown and I4
			orig.Invoke(self);
			if (!showItemsOnGround.Value)
			{
				return;
			}
			if (Object.op_Implicit((Object)(object)((Component)self).GetComponent<PagePotentialPicker>()) && showSecretNtormatPages.Value)
			{
				interactables.Add(new NtormatPageInteractable(self));
				return;
			}
			UniquePickup pickup = self.pickup;
			PickupDef pickupDef = ((PickupIndex)(ref pickup.pickupIndex)).pickupDef;
			if (pickupDef == null || pickupDef.nameToken == "ITEM_POWERPYRAMID_NAME" || (int)pickupDef.equipmentIndex != -1 || pickupDef.isLunar)
			{
				return;
			}
			pickup = self.pickup;
			if (!((UniquePickup)(ref pickup)).isTempItem)
			{
				ItemTier itemTier = pickupDef.itemTier;
				if ((int)itemTier != 6 && (int)itemTier != 7 && (int)itemTier != 8)
				{
					interactables.Add(new GenericPickupControllerInteractable(self));
				}
			}
		}

		private void PickupPickerController_OnEnable(orig_OnEnable orig, PickupPickerController self)
		{
			orig.Invoke(self);
			if (showItemsOnGround.Value && (((Object)self).name.Contains("FragmentPotentialPickup") || ((Object)self).name.Contains("OptionPickup")))
			{
				interactables.Add(new PotentialInteractable(self));
			}
		}

		private void BarrelInteraction_OnEnable(orig_OnEnable orig, BarrelInteraction self)
		{
			orig.Invoke(self);
			if (showBarrels.Value)
			{
				interactables.Add(new BarrelInteractable(self));
			}
		}

		private void SceneExitController_SetState(orig_SetState orig, SceneExitController self, ExitState newState)
		{
			//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Invalid comparison between Unknown and I4
			//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			if (!RoR2Application.isInSinglePlayer)
			{
				orig.Invoke(self, newState);
				return;
			}
			try
			{
				if ((int)newState == 3 && !releasing)
				{
					SceneDef currentSceneDef = SceneCatalog.currentSceneDef;
					string text = ((currentSceneDef != null) ? currentSceneDef.baseSceneName : null);
					switch (text)
					{
					default:
						if (!(text == "moon2"))
						{
							if (!((Object)(object)heldExit == (Object)null))
							{
								break;
							}
							interactables.RemoveAll((Interactable interactable) => !interactable.IsAvailable);
							if (interactables.Count == 0)
							{
								orig.Invoke(self, newState);
								break;
							}
							heldExit = self;
							currentIndex = -1;
							if (showContents.Value)
							{
								foreach (Interactable interactable in interactables)
								{
									try
									{
										interactable.SimulateDrop();
									}
									catch (Exception ex)
									{
										Debug.LogError((object)ex);
									}
								}
							}
							Time.timeScale = 0f;
							MoveTo(0);
							break;
						}
						goto case "bazaar";
					case "bazaar":
					case "solutionalhaunt":
					case "solusweb":
					case "computationalexchange":
						orig.Invoke(self, newState);
						break;
					}
					return;
				}
			}
			catch (Exception ex2)
			{
				Debug.LogError((object)ex2);
				heldExit = null;
				Time.timeScale = 1f;
				orig.Invoke(self, newState);
				return;
			}
			orig.Invoke(self, newState);
		}

		private void Resume()
		{
			SceneExitController val = heldExit;
			heldExit = null;
			Time.timeScale = 1f;
			if (Object.op_Implicit((Object)(object)val))
			{
				releasing = true;
				try
				{
					val.SetState((ExitState)3);
				}
				finally
				{
					releasing = false;
				}
			}
		}

		private void Run_OnDestroy(orig_OnDestroy orig, Run self)
		{
			orig.Invoke(self);
			EndRecap();
		}

		private static void EndRecap()
		{
			Time.timeScale = 1f;
			heldExit = null;
			releasing = false;
			currentIndex = -1;
			orbitYaw = 0f;
			orbitPitch = 15f;
			orbitDistance = 23f;
			didScrap = false;
			interactables.Clear();
		}

		private void OnActiveSceneChanged(Scene from, Scene to)
		{
			interactables.Clear();
			didScrap = false;
		}
	}
	public static class RiskOfOptionsStuff
	{
		private static bool? enabled;

		public static bool Enabled
		{
			get
			{
				if (!enabled.HasValue)
				{
					enabled = Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions");
				}
				return enabled.Value;
			}
		}

		public static void AddOption(ConfigEntry<bool> entry)
		{
			if (Enabled)
			{
				AddCheckBox(entry);
			}
		}

		public static void AddOption(ConfigEntry<KeyboardShortcut> entry)
		{
			if (Enabled)
			{
				AddKeyBind(entry);
			}
		}

		public static void AddOption(ConfigEntry<int> entry)
		{
			if (Enabled)
			{
				AddIntSlider(entry);
			}
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		private static void AddCheckBox(ConfigEntry<bool> entry)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(entry));
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		private static void AddKeyBind(ConfigEntry<KeyboardShortcut> entry)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			ModSettingsManager.AddOption((BaseOption)new KeyBindOption(entry));
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		private static void AddIntSlider(ConfigEntry<int> entry)
		{
			//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_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Expected O, but got Unknown
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Expected O, but got Unknown
			AcceptableValueRange<int> val = (AcceptableValueRange<int>)(object)((ConfigEntryBase)entry).Description.AcceptableValues;
			ModSettingsManager.AddOption((BaseOption)new IntSliderOption(entry, new IntSliderConfig
			{
				min = val.MinValue,
				max = val.MaxValue
			}));
		}
	}
}