Decompiled source of SellMoreScrap v1.0.0

SellMoreScrap.dll

Decompiled a day ago
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using SellMoreScrap.Patches;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("SellMoreScrap")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SellMoreScrap")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("500e0454-e81a-46d4-bd7a-14859861c14f")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace SellMoreScrap
{
	[BepInPlugin("Silvision.SellMoreScrapBase", "Sell More Scrap", "1.0.0.0")]
	public class SellMoreScrapBase : BaseUnityPlugin
	{
		private const string modGUID = "Silvision.SellMoreScrapBase";

		private const string modName = "Sell More Scrap";

		private const string modVersion = "1.0.0.0";

		private readonly Harmony harmony = new Harmony("Silvision.SellMoreScrapBase");

		private static SellMoreScrapBase instance;

		internal ManualLogSource mls;

		private void Awake()
		{
			if ((Object)(object)instance == (Object)null)
			{
				instance = this;
			}
			mls = Logger.CreateLogSource("Silvision.SellMoreScrapBase");
			mls.LogInfo((object)"The Sell More Scrap mod has started");
			harmony.PatchAll(typeof(SellMoreScrapBase));
			harmony.PatchAll(typeof(DepositItemsDeskPatch));
		}
	}
}
namespace SellMoreScrap.Patches
{
	[HarmonyPatch(typeof(DepositItemsDesk))]
	internal class DepositItemsDeskPatch
	{
		[HarmonyPatch("PlaceItemOnCounter")]
		[HarmonyTranspiler]
		private static IEnumerable<CodeInstruction> PlaceItemOnCounterTranspiler(IEnumerable<CodeInstruction> instructions)
		{
			foreach (CodeInstruction instruction in instructions)
			{
				if (instruction.opcode == OpCodes.Ldc_I4_S && (sbyte)instruction.operand == 12)
				{
					yield return new CodeInstruction(OpCodes.Ldc_I4, (object)100);
				}
				else
				{
					yield return instruction;
				}
			}
		}
	}
}