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.Logging;
using BepInEx.Unity.IL2CPP;
using HarmonyLib;
using Il2CppSystem;
using Il2CppSystem.Collections.Generic;
using Microsoft.CodeAnalysis;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("ChequePlease")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("More apartment items")]
[assembly: AssemblyFileVersion("0.1.0.0")]
[assembly: AssemblyInformationalVersion("0.1.0")]
[assembly: AssemblyProduct("ChequePlease")]
[assembly: AssemblyTitle("ChequePlease")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.1.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 com.shroudednight.ChequePlease
{
internal static class Extensions
{
public static void INFO(this ManualLogSource logSource, string data)
{
logSource.Log((LogLevel)16, (object)data);
}
public static void WARN(this ManualLogSource logSource, string data)
{
logSource.Log((LogLevel)4, (object)data);
}
public static void ERROR(this ManualLogSource logSource, string data)
{
logSource.Log((LogLevel)2, (object)data);
}
public static void FATAL(this ManualLogSource logSource, string data)
{
logSource.Log((LogLevel)1, (object)data);
}
internal static void RemoveInspectable(this List<InteractableActionsPreset> actionsPresetList)
{
Enumerator<InteractableActionsPreset> enumerator = actionsPresetList.GetEnumerator();
while (enumerator.MoveNext())
{
InteractableActionsPreset current = enumerator.Current;
if ("Inspectable".Equals(((Object)current).name))
{
actionsPresetList.Remove(current);
break;
}
}
}
internal static void AddIfAbscent(this List<InteractableActionsPreset> actionsPresetList, InteractableActionsPreset candidate)
{
if (!actionsPresetList.Contains(candidate))
{
actionsPresetList.Add(candidate);
}
}
}
[BepInPlugin("ChequePlease", "ChequePlease", "0.1.0")]
public class Plugin : BasePlugin
{
[HarmonyPatch(typeof(Player), "Start")]
public class Player_PatchStart
{
public static bool Prefix(Player __instance)
{
InteractableActionsPreset candidate = Toolbox.Instance.GetInteractablePreset("Screwdriver").actionsPreset.Find(Predicate<InteractableActionsPreset>.op_Implicit((Func<InteractableActionsPreset, bool>)((InteractableActionsPreset preset) => "InspectableInventory".Equals(((Object)preset).name))));
InteractablePreset interactablePreset = Toolbox.Instance.GetInteractablePreset("Receipt");
interactablePreset.actionsPreset.RemoveInspectable();
interactablePreset.actionsPreset.AddIfAbscent(candidate);
return true;
}
public static void Postfix(Player __instance)
{
}
}
public override void Load()
{
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
try
{
new Harmony("ChequePlease").PatchAll();
}
catch (Exception value)
{
((BasePlugin)this).Log.FATAL($"Plugin {"ChequePlease"} failed to load: {value}");
throw;
}
((BasePlugin)this).Log.INFO("Plugin ChequePlease is loaded!");
}
}
public static class MyPluginInfo
{
public const string PLUGIN_GUID = "ChequePlease";
public const string PLUGIN_NAME = "ChequePlease";
public const string PLUGIN_VERSION = "0.1.0";
}
}