using System;
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 Rewired;
using RiskOfOptions;
using RiskOfOptions.Options;
using RoR2;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("LostAndFound")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[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]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.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 src
{
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("Pudwinks.LostAndFound", "LostAndFound", "1.1.0")]
public class LostAndFound : BaseUnityPlugin
{
public abstract class Interactable
{
public Vector3 position;
}
public class PurchaseInteractable : Interactable
{
public PurchaseInteraction pi;
public PurchaseInteractable(Vector3 position, PurchaseInteraction pi)
{
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
base.position = position;
this.pi = pi;
}
}
public class Printer3DInteractable : Interactable
{
public PurchaseInteraction pi;
public bool usedPrinter;
public Printer3DInteractable(Vector3 position, PurchaseInteraction pi)
{
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
base.position = position;
this.pi = pi;
}
}
public class MultiShopInteractable : Interactable
{
public MultiShopController msc;
public MultiShopInteractable(Vector3 position, MultiShopController msc)
{
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
base.position = position;
this.msc = msc;
}
}
public class GenericPickupControllerInteractable : Interactable
{
public GenericPickupController gpc;
public GenericPickupControllerInteractable(Vector3 position, GenericPickupController gpc)
{
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
base.position = position;
this.gpc = gpc;
}
}
public class ScrapperInteractable : Interactable
{
public ScrapperController sc;
public bool usedScrapper;
public ScrapperInteractable(Vector3 position, ScrapperController sc)
{
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
base.position = position;
this.sc = sc;
}
}
public class PotentialInteractable : Interactable
{
public PickupPickerController ppc;
public PotentialInteractable(Vector3 position, PickupPickerController ppc)
{
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
base.position = position;
this.ppc = ppc;
}
}
public class BarrelInteractable : Interactable
{
public BarrelInteraction bi;
public BarrelInteractable(Vector3 position, BarrelInteraction bi)
{
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
base.position = position;
this.bi = bi;
}
}
public const string PluginGUID = "Pudwinks.LostAndFound";
public const string PluginAuthor = "Pudwinks";
public const string PluginName = "LostAndFound";
public const string PluginVersion = "1.1.0";
public static bool recapRunning;
private int index = -1;
public ListWithEvents<Interactable> interactables = new ListWithEvents<Interactable>();
public ListWithEvents<Interactable> remainingInteractables = new ListWithEvents<Interactable>();
private ConfigEntry<bool> cnfgShowNewtAltars;
private ConfigEntry<bool> cnfgShowBarrels;
private ConfigEntry<bool> cnfgShowItemsOnGround;
private ConfigEntry<bool> cnfgShowDrones;
private ConfigEntry<bool> cnfgShow3DPrinters;
private ConfigEntry<bool> cnfgShowLunarPods;
private ConfigEntry<KeyboardShortcut> kbGoNext;
private ConfigEntry<KeyboardShortcut> kbGoPrevious;
private ConfigEntry<KeyboardShortcut> kbFinishRecap;
public static ConfigEntry<KeyboardShortcut> kbZoomIn;
public static ConfigEntry<KeyboardShortcut> kbZoomOut;
public bool didScrap;
private Camera cama;
private GameObject cam;
public static CameraRigController camera;
private void InitializeRiskOfOptions()
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0013: Expected O, but got Unknown
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
//IL_0023: Expected O, but got Unknown
//IL_0059: Unknown result type (might be due to invalid IL or missing references)
//IL_005f: Expected O, but got Unknown
//IL_0069: Unknown result type (might be due to invalid IL or missing references)
//IL_0070: Expected O, but got Unknown
//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
//IL_00b0: Expected O, but got Unknown
//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
//IL_00c1: Expected O, but got Unknown
//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
//IL_0102: Expected O, but got Unknown
//IL_010c: Unknown result type (might be due to invalid IL or missing references)
//IL_0113: Expected O, but got Unknown
//IL_014d: Unknown result type (might be due to invalid IL or missing references)
//IL_0154: Expected O, but got Unknown
//IL_015e: Unknown result type (might be due to invalid IL or missing references)
//IL_0165: Expected O, but got Unknown
//IL_019f: Unknown result type (might be due to invalid IL or missing references)
//IL_01a6: Expected O, but got Unknown
//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
//IL_01b7: Expected O, but got Unknown
//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
//IL_01f8: Expected O, but got Unknown
//IL_0202: Unknown result type (might be due to invalid IL or missing references)
//IL_0209: Expected O, but got Unknown
//IL_0223: Unknown result type (might be due to invalid IL or missing references)
//IL_0255: Unknown result type (might be due to invalid IL or missing references)
//IL_025c: Expected O, but got Unknown
//IL_0266: Unknown result type (might be due to invalid IL or missing references)
//IL_026d: Expected O, but got Unknown
//IL_0287: Unknown result type (might be due to invalid IL or missing references)
//IL_02b9: Unknown result type (might be due to invalid IL or missing references)
//IL_02c0: Expected O, but got Unknown
//IL_02ca: Unknown result type (might be due to invalid IL or missing references)
//IL_02d1: Expected O, but got Unknown
//IL_02e7: Unknown result type (might be due to invalid IL or missing references)
//IL_0318: Unknown result type (might be due to invalid IL or missing references)
//IL_031f: Expected O, but got Unknown
//IL_0329: Unknown result type (might be due to invalid IL or missing references)
//IL_0330: Expected O, but got Unknown
//IL_0346: 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_037e: Expected O, but got Unknown
//IL_0388: Unknown result type (might be due to invalid IL or missing references)
//IL_038f: Expected O, but got Unknown
//IL_03a6: Unknown result type (might be due to invalid IL or missing references)
ConfigDescription val = new ConfigDescription("Set to true if you want to see newt altars in the recap. Default is false to avoid potential spoilers.", (AcceptableValueBase)null, Array.Empty<object>());
ConfigDefinition val2 = new ConfigDefinition("General", "Show newt altars");
cnfgShowNewtAltars = ((BaseUnityPlugin)this).Config.Bind<bool>(val2, false, val);
if (RiskOfOptionsStuff.enabled)
{
RiskOfOptionsStuff.AddOption<bool>(cnfgShowNewtAltars);
}
ConfigDescription val3 = new ConfigDescription("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.", (AcceptableValueBase)null, Array.Empty<object>());
ConfigDefinition val4 = new ConfigDefinition("General", "Show items on ground");
cnfgShowItemsOnGround = ((BaseUnityPlugin)this).Config.Bind<bool>(val4, true, val3);
if (RiskOfOptionsStuff.enabled)
{
RiskOfOptionsStuff.AddOption<bool>(cnfgShowItemsOnGround);
}
ConfigDescription val5 = new ConfigDescription("Set to true if you want to see lunar pods in the recap.", (AcceptableValueBase)null, Array.Empty<object>());
ConfigDefinition val6 = new ConfigDefinition("General", "Show lunar pods");
cnfgShowLunarPods = ((BaseUnityPlugin)this).Config.Bind<bool>(val6, false, val5);
if (RiskOfOptionsStuff.enabled)
{
RiskOfOptionsStuff.AddOption<bool>(cnfgShowLunarPods);
}
ConfigDescription val7 = new ConfigDescription("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.", (AcceptableValueBase)null, Array.Empty<object>());
ConfigDefinition val8 = new ConfigDefinition("General", "Show white/green 3D printers");
cnfgShow3DPrinters = ((BaseUnityPlugin)this).Config.Bind<bool>(val8, true, val7);
if (RiskOfOptionsStuff.enabled)
{
RiskOfOptionsStuff.AddOption<bool>(cnfgShow3DPrinters);
}
ConfigDescription val9 = new ConfigDescription("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.", (AcceptableValueBase)null, Array.Empty<object>());
ConfigDefinition val10 = new ConfigDefinition("General", "Show drones");
cnfgShowDrones = ((BaseUnityPlugin)this).Config.Bind<bool>(val10, true, val9);
if (RiskOfOptionsStuff.enabled)
{
RiskOfOptionsStuff.AddOption<bool>(cnfgShowDrones);
}
ConfigDescription val11 = new ConfigDescription("Set to true if you want to see barrels in the recap.", (AcceptableValueBase)null, Array.Empty<object>());
ConfigDefinition val12 = new ConfigDefinition("General", "Show barrels");
cnfgShowBarrels = ((BaseUnityPlugin)this).Config.Bind<bool>(val12, false, val11);
if (RiskOfOptionsStuff.enabled)
{
RiskOfOptionsStuff.AddOption<bool>(cnfgShowBarrels);
}
ConfigDescription val13 = new ConfigDescription("Which key to use to show the next interactable in the recap.", (AcceptableValueBase)null, Array.Empty<object>());
ConfigDefinition val14 = new ConfigDefinition("Keybinds", "Next interactable");
KeyboardShortcut val15 = default(KeyboardShortcut);
((KeyboardShortcut)(ref val15))..ctor((KeyCode)323, Array.Empty<KeyCode>());
kbGoNext = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(val14, val15, val13);
if (RiskOfOptionsStuff.enabled)
{
RiskOfOptionsStuff.AddOption<KeyboardShortcut>(kbGoNext);
}
ConfigDescription val16 = new ConfigDescription("Which key to use to show the previous interactable in the recap.", (AcceptableValueBase)null, Array.Empty<object>());
ConfigDefinition val17 = new ConfigDefinition("Keybinds", "Previous interactable");
KeyboardShortcut val18 = default(KeyboardShortcut);
((KeyboardShortcut)(ref val18))..ctor((KeyCode)324, Array.Empty<KeyCode>());
kbGoPrevious = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(val17, val18, val16);
if (RiskOfOptionsStuff.enabled)
{
RiskOfOptionsStuff.AddOption<KeyboardShortcut>(kbGoPrevious);
}
ConfigDescription val19 = new ConfigDescription("Which key to use to zoom out the camera in the recap.", (AcceptableValueBase)null, Array.Empty<object>());
ConfigDefinition val20 = new ConfigDefinition("Keybinds", "Zoom out");
KeyboardShortcut val21 = default(KeyboardShortcut);
((KeyboardShortcut)(ref val21))..ctor((KeyCode)97, Array.Empty<KeyCode>());
kbZoomOut = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(val20, val21, val19);
if (RiskOfOptionsStuff.enabled)
{
RiskOfOptionsStuff.AddOption<KeyboardShortcut>(kbZoomOut);
}
ConfigDescription val22 = new ConfigDescription("Which key to use to zoom in the camera in the recap.", (AcceptableValueBase)null, Array.Empty<object>());
ConfigDefinition val23 = new ConfigDefinition("Keybinds", "Zoom in");
KeyboardShortcut val24 = default(KeyboardShortcut);
((KeyboardShortcut)(ref val24))..ctor((KeyCode)100, Array.Empty<KeyCode>());
kbZoomIn = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(val23, val24, val22);
if (RiskOfOptionsStuff.enabled)
{
RiskOfOptionsStuff.AddOption<KeyboardShortcut>(kbZoomIn);
}
ConfigDescription val25 = new ConfigDescription("Which key to use to finish the recap once it's started.", (AcceptableValueBase)null, Array.Empty<object>());
ConfigDefinition val26 = new ConfigDefinition("Keybinds", "Finish recap");
KeyboardShortcut val27 = default(KeyboardShortcut);
((KeyboardShortcut)(ref val27))..ctor((KeyCode)115, Array.Empty<KeyCode>());
kbFinishRecap = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(val26, val27, val25);
if (RiskOfOptionsStuff.enabled)
{
RiskOfOptionsStuff.AddOption<KeyboardShortcut>(kbFinishRecap);
}
}
public void Awake()
{
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
//IL_0019: Expected O, but got Unknown
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_002b: Expected O, but got Unknown
//IL_0033: Unknown result type (might be due to invalid IL or missing references)
//IL_003d: Expected O, but got Unknown
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
//IL_004f: Expected O, but got Unknown
//IL_0057: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: Expected O, but got Unknown
//IL_0069: Unknown result type (might be due to invalid IL or missing references)
//IL_0073: Expected O, but got Unknown
//IL_007b: Unknown result type (might be due to invalid IL or missing references)
//IL_0085: Expected O, but got Unknown
//IL_008d: Unknown result type (might be due to invalid IL or missing references)
//IL_0097: Expected O, but got Unknown
//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
//IL_00bb: Expected O, but got Unknown
InitializeRiskOfOptions();
BarrelInteraction.OnEnable += (hook_OnEnable)delegate(orig_OnEnable e, BarrelInteraction a)
{
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
e.Invoke(a);
if (cnfgShowBarrels.Value)
{
BarrelInteractable barrelInteractable = new BarrelInteractable(((Component)a).transform.position, a);
interactables.Add((Interactable)barrelInteractable);
}
};
ScrapperController.Start += (hook_Start)delegate(orig_Start e, ScrapperController a)
{
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
e.Invoke(a);
ScrapperInteractable scrapperInteractable = new ScrapperInteractable(((Component)a).transform.position, a);
interactables.Add((Interactable)scrapperInteractable);
};
PurchaseInteraction.OnInteractionBegin += (hook_OnInteractionBegin)delegate(orig_OnInteractionBegin e, PurchaseInteraction a, Interactor b)
{
e.Invoke(a, b);
if (a.displayNameToken == "DUPLICATOR_NAME" || a.displayNameToken == "DUPLICATOR_MILITARY_NAME" || a.displayNameToken == "DUPLICATOR_WILD_NAME")
{
for (int i = 0; i < interactables.Count; i++)
{
if (interactables[i] is Printer3DInteractable printer3DInteractable2 && (Object)(object)printer3DInteractable2.pi == (Object)(object)a)
{
printer3DInteractable2.usedPrinter = true;
}
}
}
};
ScrapperController.BeginScrapping += (hook_BeginScrapping)delegate(orig_BeginScrapping e, ScrapperController a, int b)
{
e.Invoke(a, b);
didScrap = true;
};
MultiShopController.Start += (hook_Start)delegate(orig_Start e, MultiShopController a)
{
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
e.Invoke(a);
MultiShopInteractable multiShopInteractable = new MultiShopInteractable(((Component)a).transform.position, a);
interactables.Add((Interactable)multiShopInteractable);
};
PurchaseInteraction.Start += (hook_Start)delegate(orig_Start e, PurchaseInteraction a)
{
//IL_0362: Unknown result type (might be due to invalid IL or missing references)
//IL_033d: Unknown result type (might be due to invalid IL or missing references)
e.Invoke(a);
if (!(a.displayNameToken == "FROG_NAME") && !(a.displayNameToken == "BAZAAR_CAULDRON_NAME") && !(a.displayNameToken == "MOON_BATTERY_SOUL_NAME") && !(a.displayNameToken == "MOON_BATTERY_BLOOD_NAME") && !(a.displayNameToken == "MOON_BATTERY_DESIGN_NAME") && !(a.displayNameToken == "MOON_BATTERY_MASS_NAME") && !(((Object)a).name == "PortalDialer") && !(a.displayNameToken == "VENDING_MACHINE_NAME") && !(a.displayNameToken == "SHRINE_COMBAT_NAME") && !(a.displayNameToken == "SHRINE_BLOOD_NAME") && !(a.displayNameToken == "SHRINE_HEALING_NAME") && !(a.displayNameToken == "LOCKEDTREEBOT_NAME") && !(a.displayNameToken == "MULTISHOP_TERMINAL_NAME") && !(a.displayNameToken == "FAN_NAME") && !(a.displayNameToken == "NULL_WARD_NAME") && (!(a.displayNameToken == "NEWT_STATUE_NAME") || cnfgShowNewtAltars.Value) && (!(a.displayNameToken == "LUNAR_CHEST_NAME") || cnfgShowLunarPods.Value) && (cnfgShow3DPrinters.Value || !(a.displayNameToken == "DUPLICATOR_NAME")) && (cnfgShowDrones.Value || (!(a.displayNameToken == "DRONE_GUNNER_INTERACTABLE_NAME") && !(a.displayNameToken == "DRONE_HEALING_INTERACTABLE_NAME") && !(a.displayNameToken == "DRONE_MISSILE_INTERACTABLE_NAME") && !(a.displayNameToken == "EQUIPMENTDRONE_INTERACTABLE_NAME") && !(a.displayNameToken == "FLAMEDRONE_INTERACTABLE_NAME") && !(a.displayNameToken == "EMERGENCYDRONE_INTERACTABLE_NAME") && !(a.displayNameToken == "TURRET1_INTERACTABLE_NAME"))))
{
if (a.displayNameToken == "DUPLICATOR_NAME" || a.displayNameToken == "DUPLICATOR_MILITARY_NAME" || a.displayNameToken == "DUPLICATOR_WILD_NAME")
{
Printer3DInteractable printer3DInteractable = new Printer3DInteractable(((Component)a).transform.position, a);
interactables.Add((Interactable)printer3DInteractable);
}
else
{
PurchaseInteractable purchaseInteractable = new PurchaseInteractable(((Component)a).transform.position, a);
interactables.Add((Interactable)purchaseInteractable);
}
}
};
PickupPickerController.OnEnable += (hook_OnEnable)delegate(orig_OnEnable e, PickupPickerController a)
{
//IL_004d: Unknown result type (might be due to invalid IL or missing references)
e.Invoke(a);
if (cnfgShowItemsOnGround.Value && (((Object)a).name.Contains("FragmentPotentialPickup") || ((Object)a).name.Contains("OptionPickup")))
{
PotentialInteractable potentialInteractable = new PotentialInteractable(((Component)a).transform.position, a);
interactables.Add((Interactable)potentialInteractable);
}
};
GenericPickupController.Start += (hook_Start)delegate(orig_Start e, GenericPickupController a)
{
//IL_0028: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_0044: Unknown result type (might be due to invalid IL or missing references)
//IL_0049: Unknown result type (might be due to invalid IL or missing references)
//IL_004a: Unknown result type (might be due to invalid IL or missing references)
//IL_004c: Invalid comparison between Unknown and I4
//IL_004e: Unknown result type (might be due to invalid IL or missing references)
//IL_0050: Invalid comparison between Unknown and I4
//IL_0052: Unknown result type (might be due to invalid IL or missing references)
//IL_0054: Invalid comparison between Unknown and I4
//IL_0067: Unknown result type (might be due to invalid IL or missing references)
e.Invoke(a);
if (cnfgShowItemsOnGround.Value && (int)((PickupIndex)(ref a.pickupIndex)).pickupDef.equipmentIndex == -1)
{
ItemTier itemTier = ((PickupIndex)(ref a.pickupIndex)).pickupDef.itemTier;
if ((int)itemTier != 6 && (int)itemTier != 7 && (int)itemTier != 8)
{
GenericPickupControllerInteractable genericPickupControllerInteractable = new GenericPickupControllerInteractable(((Component)a).transform.position, a);
interactables.Add((Interactable)genericPickupControllerInteractable);
}
}
};
SceneExitController.onFinishExit += delegate
{
if (RoR2Application.isInSinglePlayer && SceneCatalog.currentSceneDef.baseSceneName != "bazaar")
{
StartMissingInteractableFinder();
}
};
Run.OnDestroy += (hook_OnDestroy)delegate(orig_OnDestroy e, Run a)
{
e.Invoke(a);
EndMissingInteractableFinder();
};
}
private void EndMissingInteractableFinder()
{
Time.timeScale = 1f;
recapRunning = false;
didScrap = false;
cama.End();
ClearLists();
}
private void StartMissingInteractableFinder()
{
GetRemainingInteractables();
if (remainingInteractables.Count != 0)
{
index = -1;
Time.timeScale = 0f;
StartCamera();
recapRunning = true;
}
}
private void ClearLists()
{
interactables.Clear();
remainingInteractables.Clear();
}
private void GetRemainingInteractables()
{
remainingInteractables.Clear();
for (int i = 0; i < interactables.Count; i++)
{
Interactable interactable = interactables[i];
Interactable interactable2 = interactable;
if (!(interactable2 is PurchaseInteractable purchaseInteractable))
{
if (!(interactable2 is Printer3DInteractable printer3DInteractable))
{
if (!(interactable2 is ScrapperInteractable scrapperInteractable))
{
if (!(interactable2 is GenericPickupControllerInteractable genericPickupControllerInteractable))
{
if (!(interactable2 is PotentialInteractable potentialInteractable))
{
if (!(interactable2 is BarrelInteractable barrelInteractable))
{
if (interactable2 is MultiShopInteractable multiShopInteractable && !((Object)(object)multiShopInteractable.msc == (Object)null) && multiShopInteractable.msc.available)
{
remainingInteractables.Add(interactables[i]);
}
}
else if (!((Object)(object)barrelInteractable.bi == (Object)null) && !barrelInteractable.bi.opened)
{
remainingInteractables.Add(interactables[i]);
}
}
else if (!((Object)(object)potentialInteractable.ppc == (Object)null))
{
remainingInteractables.Add(interactables[i]);
}
}
else if (!((Object)(object)genericPickupControllerInteractable.gpc == (Object)null) && !genericPickupControllerInteractable.gpc.consumed)
{
remainingInteractables.Add(interactables[i]);
}
}
else if (!((Object)(object)scrapperInteractable.sc == (Object)null) && !didScrap)
{
remainingInteractables.Add(interactables[i]);
}
}
else if (!((Object)(object)printer3DInteractable.pi == (Object)null) && !printer3DInteractable.usedPrinter)
{
remainingInteractables.Add(interactables[i]);
}
}
else if (!((Object)(object)purchaseInteractable.pi == (Object)null) && purchaseInteractable.pi.available)
{
remainingInteractables.Add(interactables[i]);
}
}
}
private void IncrementCameraPosition()
{
//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)
index++;
if (remainingInteractables.Count != 0)
{
if (index < 0)
{
index = 0;
}
if (index >= remainingInteractables.Count)
{
index = remainingInteractables.Count - 1;
}
cama.SetCamPosition(remainingInteractables[index].position + new Vector3(0f, 0.5f, 0f));
}
}
private void DecrementCameraPosition()
{
//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)
index--;
if (remainingInteractables.Count != 0)
{
if (index < 0)
{
index = 0;
}
if (index >= remainingInteractables.Count)
{
index = remainingInteractables.Count - 1;
}
cama.SetCamPosition(remainingInteractables[index].position + new Vector3(0f, 0.5f, 0f));
}
}
private void StartCamera()
{
//IL_003d: Unknown result type (might be due to invalid IL or missing references)
//IL_0047: Expected O, but got Unknown
camera = PlayerCharacterMasterController.instances[0].networkUser.cameraRigController;
if ((Object)(object)cam != (Object)null)
{
Object.Destroy((Object)(object)cam);
}
cam = new GameObject("LostAndFound_Camera");
cama = cam.AddComponent<Camera>();
cama.Start();
IncrementCameraPosition();
}
private void Update()
{
//IL_001c: 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_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_0041: 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_0049: Unknown result type (might be due to invalid IL or missing references)
//IL_0066: Unknown result type (might be due to invalid IL or missing references)
//IL_006b: Unknown result type (might be due to invalid IL or missing references)
//IL_006e: Unknown result type (might be due to invalid IL or missing references)
if (recapRunning && !PauseManager.isPaused)
{
KeyboardShortcut value = kbGoNext.Value;
if (Input.GetKeyDown(((KeyboardShortcut)(ref value)).MainKey))
{
IncrementCameraPosition();
}
value = kbGoPrevious.Value;
if (Input.GetKeyDown(((KeyboardShortcut)(ref value)).MainKey))
{
DecrementCameraPosition();
}
value = kbFinishRecap.Value;
if (Input.GetKeyDown(((KeyboardShortcut)(ref value)).MainKey))
{
EndMissingInteractableFinder();
}
}
}
}
public class Camera : MonoBehaviour, ICameraStateProvider
{
internal class PhotoModeCameraState
{
internal float pitch;
internal float yaw;
internal float roll;
internal Vector3 position;
public Vector3 target;
public float distance = 16f;
internal float fov;
internal Quaternion Rotation
{
get
{
//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 Quaternion.Euler(pitch, yaw, roll);
}
set
{
//IL_0003: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
Vector3 eulerAngles = ((Quaternion)(ref value)).eulerAngles;
pitch = eulerAngles.x;
yaw = eulerAngles.y;
roll = eulerAngles.z;
}
}
}
private PhotoModeCameraState cameraState = new PhotoModeCameraState();
private CameraRigController cam => LostAndFound.camera;
public void SetCamPosition(Vector3 pos)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
cameraState.target = pos;
}
public void Start()
{
cam.SetOverrideCam((ICameraStateProvider)(object)this, 0f);
cameraState.fov = cam.baseFov;
}
public void End()
{
cam.SetOverrideCam((ICameraStateProvider)null, 0f);
}
private void Update()
{
//IL_0135: 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_0145: Unknown result type (might be due to invalid IL or missing references)
//IL_014a: Unknown result type (might be due to invalid IL or missing references)
//IL_015a: Unknown result type (might be due to invalid IL or missing references)
//IL_015f: Unknown result type (might be due to invalid IL or missing references)
//IL_0164: Unknown result type (might be due to invalid IL or missing references)
//IL_017a: Unknown result type (might be due to invalid IL or missing references)
//IL_0196: Unknown result type (might be due to invalid IL or missing references)
//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
//IL_01af: 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)
//IL_01e8: Unknown result type (might be due to invalid IL or missing references)
//IL_01ec: Unknown result type (might be due to invalid IL or missing references)
if (!LostAndFound.recapRunning || PauseManager.isPaused)
{
return;
}
UserProfile userProfile = cam.localUserViewer.userProfile;
Player inputPlayer = cam.localUserViewer.inputPlayer;
float axis = inputPlayer.GetAxis(23);
float axis2 = inputPlayer.GetAxis(24);
float mouseLookSensitivity = userProfile.mouseLookSensitivity;
float mouseLookScaleX = userProfile.mouseLookScaleX;
float mouseLookScaleY = userProfile.mouseLookScaleY;
float num = mouseLookScaleX * mouseLookSensitivity * Time.unscaledDeltaTime * axis;
float num2 = mouseLookScaleY * mouseLookSensitivity * Time.unscaledDeltaTime * axis2;
float num3 = cameraState.roll * (MathF.PI / 180f);
cameraState.yaw += cameraState.fov * (num * Mathf.Cos(num3) - num2 * Mathf.Sin(num3));
cameraState.pitch += cameraState.fov * ((0f - num2) * Mathf.Cos(num3) - num * Mathf.Sin(num3));
cameraState.pitch = Mathf.Clamp(cameraState.pitch, -89f, 89f);
cameraState.position = cameraState.target - cameraState.Rotation * Vector3.forward * cameraState.distance;
((Component)cam).transform.position = cameraState.position;
((Component)cam).transform.rotation = cameraState.Rotation;
KeyboardShortcut value = LostAndFound.kbZoomOut.Value;
if (Input.GetKey(((KeyboardShortcut)(ref value)).MainKey))
{
cameraState.distance += 35f * Time.unscaledDeltaTime;
}
value = LostAndFound.kbZoomIn.Value;
if (Input.GetKey(((KeyboardShortcut)(ref value)).MainKey))
{
cameraState.distance -= 35f * Time.unscaledDeltaTime;
if (cameraState.distance <= 1f)
{
cameraState.distance = 1f;
}
}
}
public void GetCameraState(CameraRigController cameraRigController, ref CameraState _cameraState)
{
}
public bool IsHudAllowed(CameraRigController cameraRigController)
{
return false;
}
public bool IsUserControlAllowed(CameraRigController cameraRigController)
{
return false;
}
public bool IsUserLookAllowed(CameraRigController cameraRigController)
{
return 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;
}
}
[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
public static void AddOption<T>(ConfigEntry<T> opt)
{
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
//IL_0028: Expected O, but got Unknown
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
//IL_0038: Expected O, but got Unknown
if (!(opt is ConfigEntry<bool> val))
{
if (opt is ConfigEntry<KeyboardShortcut> val2)
{
ModSettingsManager.AddOption((BaseOption)new KeyBindOption(val2));
}
}
else
{
ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(val));
}
}
}
}