Decompiled source of BetterSMT v3.1.0

BepInEx/plugins/BetterSMT.dll

Decompiled a week ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Threading.Tasks;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using BetterSMT.Patches;
using HarmonyLib;
using HighlightPlus;
using HutongGames.PlayMaker;
using HutongGames.PlayMaker.Actions;
using Microsoft.CodeAnalysis;
using Mirror;
using StarterAssets;
using TMPro;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.EventSystems;
using UnityEngine.Events;
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: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: IgnoresAccessChecksTo("Mirror")]
[assembly: IgnoresAccessChecksTo("PlayMaker")]
[assembly: IgnoresAccessChecksTo("Rewired_Core")]
[assembly: AssemblyCompany("BetterSMT")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("BetterSMT")]
[assembly: AssemblyFileVersion("3.1.0.0")]
[assembly: AssemblyInformationalVersion("3.1.0+14f09ccef0c8b8fece8221271b1bbb6f29998517")]
[assembly: AssemblyProduct("BetterSMT")]
[assembly: AssemblyTitle("BetterSMT")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("3.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 BetterSMT
{
	[BepInPlugin("BetterSMT", "BetterSMT", "3.1.0")]
	public class BetterSMT : BaseUnityPlugin
	{
		private readonly Harmony harmony = new Harmony("BetterSMT");

		public static BetterSMT Instance;

		public static ConfigEntry<float> PillarPrice;

		public static ConfigEntry<bool> PillarRubble;

		public static ConfigEntry<bool> AutoPayAllInvoices;

		public static ConfigEntry<int> SalesActiveAmount;

		public static ConfigEntry<KeyboardShortcut> ClearSales;

		public static ConfigEntry<bool> ToggleClearSalesHotkey;

		public static ConfigEntry<bool> LowStockAlertEnabled;

		public static ConfigEntry<int> LowStockThreshold;

		public static ConfigEntry<bool> AutoOrderEnabled;

		public static ConfigEntry<int> AutoOrderCheckInterval;

		public static ConfigEntry<int> CustomersPerPerk;

		public static ConfigEntry<int> MaxCustomerInStore;

		public static ConfigEntry<int> BaseCustomerSpawns;

		public static ConfigEntry<int> BaseCustomerCart;

		public static ConfigEntry<int> MaxCustomerCart;

		public static ConfigEntry<int> EmployeesLevel;

		public static ConfigEntry<bool> EmployeesEnabled;

		public static ConfigEntry<float> EmployeeSpeedPerPerk;

		public static ConfigEntry<float> EmployeeRestockPerPerk;

		public static ConfigEntry<float> EmployeeCheckoutPerPerk;

		public static ConfigEntry<float> EmployeExtraCheckoutMoney;

		public static ConfigEntry<bool> OneHitThief;

		public static ConfigEntry<bool> SelfCheckoutTheft;

		public static ConfigEntry<bool> DisableAllThieves;

		public static ConfigEntry<bool> AllNPCAreThieves;

		public static ConfigEntry<bool> InstantSelfCheckout;

		public static ConfigEntry<bool> FasterCheckout;

		public static ConfigEntry<bool> ShowFPS;

		public static ConfigEntry<bool> ShowPing;

		public static ConfigEntry<bool> DisableAllTrash;

		public static ConfigEntry<bool> AlwaysAbleToDeleteMode;

		public static ConfigEntry<bool> DeleteAllCheckouts;

		public static ConfigEntry<bool> FullDeletionRefund;

		public static ConfigEntry<bool> AllTrashToRecyclers;

		public static ConfigEntry<bool> RoundDown;

		public static ConfigEntry<bool> NearestFive;

		public static ConfigEntry<bool> NearestTen;

		public static ConfigEntry<bool> ToggleDoublePrice;

		public static ConfigEntry<bool> AutoAdjustPriceDaily;

		public static ConfigEntry<float> AutoAdjustPriceDailyValue;

		public static ConfigEntry<bool> EnableMTV;

		public static ConfigEntry<int> MaxBoxes;

		public static ConfigEntry<float> AutoPickupRange;

		public static ConfigEntry<KeyboardShortcut> MTVHotkey;

		public static ConfigEntry<float> DropCooldown;

		public static ConfigEntry<int> ExpRate;

		public static ConfigEntry<bool> ShoplifterDetectionNotif;

		public static ConfigEntry<bool> OneClickCheckMark;

		public static ConfigEntry<bool> AllowFreePlacement;

		public static ConfigEntry<bool> CheatPlacement;

		public static ConfigEntry<bool> ProductStacking;

		public static ConfigEntry<bool> EnablePalletDisplaysPerk;

		public static ConfigEntry<bool> ReplaceCommasWithPeriods;

		public static ConfigEntry<string> CurrencyTypeToAny;

		public static ConfigEntry<bool> StructuresBreaking;

		public static ConfigEntry<bool> CloserBoxSpawning;

		public static ConfigEntry<bool> StorageHighlighting;

		public static ConfigEntry<KeyboardShortcut> DoublePrice;

		public static ConfigEntry<KeyboardShortcut> RoundDownSwitch;

		public static ConfigEntry<KeyboardShortcut> RoundDownToggle;

		public static ConfigEntry<KeyboardShortcut> ClockHotkey;

		public static ConfigEntry<bool> ClockToggle;

		public static ConfigEntry<bool> LoanEarly;

		public static ConfigEntry<bool> NumberKeys;

		public static ConfigEntry<int> SelfCheckoutLimit;

		public static ConfigEntry<bool> TooExpensiveNotifications;

		public static ConfigEntry<bool> MissingProductNotifications;

		public static ConfigEntry<int> MaxBoxSize;

		public static ConfigEntry<bool> DisableBoxCollisions;

		public static ConfigEntry<bool> FastBoxSpawns;

		public static ConfigEntry<float> ClockSpeed;

		public static ConfigEntry<bool> ClockMorning;

		public static ConfigEntry<bool> AutoOrdering;

		public static ConfigEntry<bool> QuickStocking;

		public static ConfigEntry<bool> QuickRemoving;

		public static ConfigEntry<int> CardboardBalerValue;

		public static ConfigEntry<bool> PalletProduct;

		public static ConfigEntry<bool> AllProduct;

		public static ConfigEntry<float> FireExtinguisher;

		public static ConfigEntry<bool> OrderPackaging;

		public static ConfigEntry<bool> OrderPackagingAlways;

		public static ConfigEntry<float> OrderSpeedUp;

		public static ConfigEntry<float> OrderIncreasedMax;

		public static ConfigEntry<bool> AutoSaveEnabled;

		public static ConfigEntry<int> AutoSaveTimer;

		public static ConfigEntry<bool> AutoSaveDuringDay;

		public static ConfigEntry<bool> SaveGame;

		internal static ManualLogSource Logger { get; private set; }

		[Obsolete]
		private void Awake()
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Expected O, but got Unknown
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Expected O, but got Unknown
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: 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_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Expected O, but got Unknown
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Expected O, but got Unknown
			//IL_014f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: Expected O, but got Unknown
			//IL_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0184: Expected O, but got Unknown
			//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01af: Expected O, but got Unknown
			//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ec: Expected O, but got Unknown
			//IL_0208: Unknown result type (might be due to invalid IL or missing references)
			//IL_0218: Unknown result type (might be due to invalid IL or missing references)
			//IL_0222: Expected O, but got Unknown
			//IL_0243: Unknown result type (might be due to invalid IL or missing references)
			//IL_024d: Expected O, but got Unknown
			//IL_0275: Unknown result type (might be due to invalid IL or missing references)
			//IL_027f: Expected O, but got Unknown
			//IL_02a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02aa: Expected O, but got Unknown
			//IL_02d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e1: Expected O, but got Unknown
			//IL_0302: Unknown result type (might be due to invalid IL or missing references)
			//IL_030c: Expected O, but got Unknown
			//IL_0337: Unknown result type (might be due to invalid IL or missing references)
			//IL_0341: Expected O, but got Unknown
			//IL_0374: Unknown result type (might be due to invalid IL or missing references)
			//IL_037e: Expected O, but got Unknown
			//IL_03b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_03bb: Expected O, but got Unknown
			//IL_03e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ee: Expected O, but got Unknown
			//IL_0416: Unknown result type (might be due to invalid IL or missing references)
			//IL_0420: Expected O, but got Unknown
			//IL_0448: Unknown result type (might be due to invalid IL or missing references)
			//IL_0452: Expected O, but got Unknown
			//IL_047e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0488: Expected O, but got Unknown
			//IL_04af: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b9: Expected O, but got Unknown
			//IL_04e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_04eb: Expected O, but got Unknown
			//IL_051e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0528: Expected O, but got Unknown
			//IL_055b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0565: Expected O, but got Unknown
			//IL_0586: Unknown result type (might be due to invalid IL or missing references)
			//IL_0590: Expected O, but got Unknown
			//IL_05b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_05bb: Expected O, but got Unknown
			//IL_05dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e6: Expected O, but got Unknown
			//IL_0607: Unknown result type (might be due to invalid IL or missing references)
			//IL_0611: Expected O, but got Unknown
			//IL_0632: Unknown result type (might be due to invalid IL or missing references)
			//IL_063c: Expected O, but got Unknown
			//IL_065d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0667: Expected O, but got Unknown
			//IL_06c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ca: Expected O, but got Unknown
			//IL_06eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_06f5: Expected O, but got Unknown
			//IL_0716: Unknown result type (might be due to invalid IL or missing references)
			//IL_0720: Expected O, but got Unknown
			//IL_0741: Unknown result type (might be due to invalid IL or missing references)
			//IL_074b: Expected O, but got Unknown
			//IL_076c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0776: Expected O, but got Unknown
			//IL_0797: Unknown result type (might be due to invalid IL or missing references)
			//IL_07a1: Expected O, but got Unknown
			//IL_07c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_07cc: Expected O, but got Unknown
			//IL_07ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0809: Expected O, but got Unknown
			//IL_0831: Unknown result type (might be due to invalid IL or missing references)
			//IL_083b: Expected O, but got Unknown
			//IL_0857: Unknown result type (might be due to invalid IL or missing references)
			//IL_0867: Unknown result type (might be due to invalid IL or missing references)
			//IL_0871: Expected O, but got Unknown
			//IL_08a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_08ae: Expected O, but got Unknown
			//IL_08d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_08e0: Expected O, but got Unknown
			//IL_0901: Unknown result type (might be due to invalid IL or missing references)
			//IL_090b: Expected O, but got Unknown
			//IL_092c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0936: Expected O, but got Unknown
			//IL_0957: Unknown result type (might be due to invalid IL or missing references)
			//IL_0961: Expected O, but got Unknown
			//IL_0982: Unknown result type (might be due to invalid IL or missing references)
			//IL_098c: Expected O, but got Unknown
			//IL_09ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_09b7: Expected O, but got Unknown
			//IL_09d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_09e2: Expected O, but got Unknown
			//IL_0a03: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a0d: Expected O, but got Unknown
			//IL_0a2e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a38: Expected O, but got Unknown
			//IL_0a5d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a67: Expected O, but got Unknown
			//IL_0a88: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a92: Expected O, but got Unknown
			//IL_0ab3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0abd: Expected O, but got Unknown
			//IL_0ad9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ae9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0af3: Expected O, but got Unknown
			//IL_0b14: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b1e: Expected O, but got Unknown
			//IL_0b51: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b5b: Expected O, but got Unknown
			//IL_0b7c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b86: Expected O, but got Unknown
			//IL_0ba2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bb2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bbc: Expected O, but got Unknown
			//IL_0bdd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0be7: Expected O, but got Unknown
			//IL_0c08: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c12: Expected O, but got Unknown
			//IL_0c33: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c3d: Expected O, but got Unknown
			//IL_0c62: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c72: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c7c: Expected O, but got Unknown
			//IL_0ca9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cb9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cc3: Expected O, but got Unknown
			//IL_0cf6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d00: Expected O, but got Unknown
			//IL_0d21: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d2b: Expected O, but got Unknown
			//IL_0d4c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d56: Expected O, but got Unknown
			//IL_0d77: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d81: Expected O, but got Unknown
			//IL_0da2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0dac: Expected O, but got Unknown
			//IL_0dd5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ddf: Expected O, but got Unknown
			//IL_0e00: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e0a: Expected O, but got Unknown
			//IL_0e2b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e35: Expected O, but got Unknown
			//IL_0e56: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e60: Expected O, but got Unknown
			//IL_0e81: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e8b: Expected O, but got Unknown
			//IL_0ebe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ec8: Expected O, but got Unknown
			//IL_0ee9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ef3: Expected O, but got Unknown
			//IL_0f14: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f1e: Expected O, but got Unknown
			//IL_0f3f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f49: Expected O, but got Unknown
			//IL_0f6a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f74: Expected O, but got Unknown
			//IL_0f9c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fa6: Expected O, but got Unknown
			//IL_0fce: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fd8: Expected O, but got Unknown
			//IL_0ff9: Unknown result type (might be due to invalid IL or missing references)
			//IL_1003: Expected O, but got Unknown
			//IL_1041: Unknown result type (might be due to invalid IL or missing references)
			//IL_1047: Expected O, but got Unknown
			AutoSaveEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Save Settings", "Enables Auto Saving", false, new ConfigDescription("Enables or disables automatic saving", (AcceptableValueBase)null, Array.Empty<object>()));
			AutoSaveTimer = ((BaseUnityPlugin)this).Config.Bind<int>("Save Settings", "Amount of time between saves", 120, new ConfigDescription("Adjusts the amount of time between auto saves in seconds, default is 120seconds or 2minutes", (AcceptableValueBase)(object)new AcceptableValueRange<int>(30, 900), Array.Empty<object>()));
			AutoSaveDuringDay = ((BaseUnityPlugin)this).Config.Bind<bool>("Save Settings", "Enables Auto Saving during the day", false, new ConfigDescription("Enables or disables saving while the store is open, default only autosaves while closed", (AcceptableValueBase)null, Array.Empty<object>()));
			SaveGame = ((BaseUnityPlugin)this).Config.Bind<bool>("Save Settings", "Save Game Button", true, new ConfigDescription("Enables or disables the Save Game button in the ESC menu", (AcceptableValueBase)null, Array.Empty<object>()));
			OrderPackaging = ((BaseUnityPlugin)this).Config.Bind<bool>("Order Packaging", "Enables custom order packaging", false, new ConfigDescription("Enables the other Order Packaging options. This must be enabled for them to work.", (AcceptableValueBase)null, Array.Empty<object>()));
			OrderSpeedUp = ((BaseUnityPlugin)this).Config.Bind<float>("Order Packaging", "Speeds up how often orders come", 0f, new ConfigDescription("Works as a percent multiplier. 1.1 = 10% faster. 2.3 = 130% faster.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 500f), Array.Empty<object>()));
			OrderIncreasedMax = ((BaseUnityPlugin)this).Config.Bind<float>("Order Packaging", "Increases max amount of orders per day", 0f, new ConfigDescription("Flat number to increase the max amount of orders you get per day. Default was random value of 2 through 40.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 240f), Array.Empty<object>()));
			OrderPackagingAlways = ((BaseUnityPlugin)this).Config.Bind<bool>("Random Features", "Enables Order Packaging everyday", false, new ConfigDescription("Automatically enables order packaging everyday so you can't forget.", (AcceptableValueBase)null, Array.Empty<object>()));
			PillarRubble = ((BaseUnityPlugin)this).Config.Bind<bool>("Pillar Mods", "Disable Rubble", false, new ConfigDescription("Optionally does not spawn rubble when destroying a pillar", (AcceptableValueBase)null, Array.Empty<object>()));
			PillarPrice = ((BaseUnityPlugin)this).Config.Bind<float>("Pillar Mods", "Change Price", 4000f, new ConfigDescription("Changes the price of destroying a pillar.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 50000f), Array.Empty<object>()));
			ClearSales = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Sales Settings", "Clear Sales", new KeyboardShortcut((KeyCode)120, Array.Empty<KeyCode>()), new ConfigDescription("Hotkey to clear current sales.", (AcceptableValueBase)null, Array.Empty<object>()));
			ToggleClearSalesHotkey = ((BaseUnityPlugin)this).Config.Bind<bool>("Sales Settings", "Enables or disables hotkey to clear sales", false, new ConfigDescription("Enables or disables the hotkey to clear sales", (AcceptableValueBase)null, Array.Empty<object>()));
			SalesActiveAmount = ((BaseUnityPlugin)this).Config.Bind<int>("Sales Settings", "Amount of sales unlocked each perk", 2, new ConfigDescription("Adjusts the amount of sales you unlock for each perk", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 100), Array.Empty<object>()));
			AutoOrderEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Auto Ordering", "Enable Auto Ordering", false, new ConfigDescription("Automatically orders products on interval below, ordering enough to fill the store. Only works when Ordering Tablet is in your hands.", (AcceptableValueBase)null, Array.Empty<object>()));
			AutoOrderCheckInterval = ((BaseUnityPlugin)this).Config.Bind<int>("Auto Ordering", "Auto Order Check Interval", 30, new ConfigDescription("Time interval (in seconds) for checking product stock", (AcceptableValueBase)(object)new AcceptableValueRange<int>(10, 600), Array.Empty<object>()));
			LowStockAlertEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Low Stock Alerts", "Enable Low Stock Alerts", false, new ConfigDescription("Show alerts when products drop below the threshold", (AcceptableValueBase)null, Array.Empty<object>()));
			LowStockThreshold = ((BaseUnityPlugin)this).Config.Bind<int>("Low Stock Alerts", "Low Stock Threshold", 2, new ConfigDescription("The stock count at which alerts are triggered", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 1000), Array.Empty<object>()));
			EmployeExtraCheckoutMoney = ((BaseUnityPlugin)this).Config.Bind<float>("Employee & Customer Settings", "Employe Increased Income While Checking Customer Out Perk", 0.1f, new ConfigDescription("Adjust the amount of extra income you receive when an employee checks out a customer (Higher = more income)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 0.3f), Array.Empty<object>()));
			EmployeeCheckoutPerPerk = ((BaseUnityPlugin)this).Config.Bind<float>("Employee & Customer Settings", "Employee Checkout Time Reduction Perk 1", 0.15f, new ConfigDescription("Adjust the amount of time employees wait to scan items in checkout (Perk 1) (Lower = slower)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.01f, 0.24f), Array.Empty<object>()));
			MaxCustomerCart = ((BaseUnityPlugin)this).Config.Bind<int>("Employee & Customer Settings", "Maximum amount of product customers will buy", 25, new ConfigDescription("Adjust the maximum amount of product customers will buy", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 75), Array.Empty<object>()));
			BaseCustomerCart = ((BaseUnityPlugin)this).Config.Bind<int>("Employee & Customer Settings", "Minimum amount of product customers will buy", 5, new ConfigDescription("Adjust the minimum amount of product customers will buy", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 15), Array.Empty<object>()));
			BaseCustomerSpawns = ((BaseUnityPlugin)this).Config.Bind<int>("Employee & Customer Settings", "Minimum amount of customers that will spawn", 3, new ConfigDescription("Adjust the minimum amount of customer's that can spawn", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 9), Array.Empty<object>()));
			MaxCustomerInStore = ((BaseUnityPlugin)this).Config.Bind<int>("Employee & Customer Settings", "Max amount of customers in store", 70, new ConfigDescription("Adjust the amount of customers that can spawn at one time", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 210), Array.Empty<object>()));
			CustomersPerPerk = ((BaseUnityPlugin)this).Config.Bind<int>("Employee & Customer Settings", "Extra Customers per perk", 1, new ConfigDescription("Adjust the amount of customers you gain per perk (Higher number = more customers)", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 5), Array.Empty<object>()));
			EmployeesLevel = ((BaseUnityPlugin)this).Config.Bind<int>("Employee & Customer Settings", "Employees Level", 0, new ConfigDescription("Adjust the level of employee's that spawn (1 sets all of their stats to minimum, 30 sets them all to max)", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 30), Array.Empty<object>()));
			EmployeeSpeedPerPerk = ((BaseUnityPlugin)this).Config.Bind<float>("Employee & Customer Settings", "Employee Speed Per Perk", 0.2f, new ConfigDescription("Adjust the amount of speed employees gain per perk (Higher = faster)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.01f, 0.6f), Array.Empty<object>()));
			EmployeeRestockPerPerk = ((BaseUnityPlugin)this).Config.Bind<float>("Employee & Customer Settings", "Employee Restock Time Reduction Per Perk", 0.05f, new ConfigDescription("Adjust the amount of time it takes for employees to restock per perk (Lower = faster)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.01f, 0.15f), Array.Empty<object>()));
			AllNPCAreThieves = ((BaseUnityPlugin)this).Config.Bind<bool>("Thieves & Crime Settings", "All Thieves", false, new ConfigDescription("Causes every NPC to be a thief", (AcceptableValueBase)null, Array.Empty<object>()));
			SelfCheckoutTheft = ((BaseUnityPlugin)this).Config.Bind<bool>("Thieves & Crime Settings", "Self-Checkout Theft", true, new ConfigDescription("Enables or disables default game's theft from self checkout", (AcceptableValueBase)null, Array.Empty<object>()));
			DisableAllThieves = ((BaseUnityPlugin)this).Config.Bind<bool>("Thieves & Crime Settings", "Disable Thieves", false, new ConfigDescription("Prevent thieves from spawning (Does not stop checkout-related thieves)", (AcceptableValueBase)null, Array.Empty<object>()));
			OneHitThief = ((BaseUnityPlugin)this).Config.Bind<bool>("Thieves & Crime Settings", "Thiefs Drop Everything On Hit", false, new ConfigDescription("Thiefs Drop Everything On Hit", (AcceptableValueBase)null, Array.Empty<object>()));
			InstantSelfCheckout = ((BaseUnityPlugin)this).Config.Bind<bool>("Gameplay Setting", "Faster Self-Checkout", false, new ConfigDescription("Customers place all items instantly on to the self-checkout", (AcceptableValueBase)null, Array.Empty<object>()));
			FasterCheckout = ((BaseUnityPlugin)this).Config.Bind<bool>("Gameplay Settings", "Faster Checkout", false, new ConfigDescription("Customers place all items instantly on to the checkout", (AcceptableValueBase)null, Array.Empty<object>()));
			ShowFPS = ((BaseUnityPlugin)this).Config.Bind<bool>("Gameplay Settings", "Show FPS Counter", false, (ConfigDescription)null);
			ShowPing = ((BaseUnityPlugin)this).Config.Bind<bool>("Gameplay Settings", "Show Ping Counter", false, (ConfigDescription)null);
			DisableAllTrash = ((BaseUnityPlugin)this).Config.Bind<bool>("Gameplay Settings", "Despawns trash", false, new ConfigDescription("Despawns all trash at the end of the day", (AcceptableValueBase)null, Array.Empty<object>()));
			AlwaysAbleToDeleteMode = ((BaseUnityPlugin)this).Config.Bind<bool>("Gameplay Settings", "Always access to delete", false, new ConfigDescription("Delete shelves and others while customers are in store and store is open", (AcceptableValueBase)null, Array.Empty<object>()));
			DeleteAllCheckouts = ((BaseUnityPlugin)this).Config.Bind<bool>("Gameplay Settings", "Enable or disable deleting all checkout lanes", false, new ConfigDescription("Adds the ability to delete every checkout lane", (AcceptableValueBase)null, Array.Empty<object>()));
			FullDeletionRefund = ((BaseUnityPlugin)this).Config.Bind<bool>("Gameplay Settings", "Full refund on buildings", false, new ConfigDescription("Provides 100% of the cost of buildings when being deleted", (AcceptableValueBase)null, Array.Empty<object>()));
			AllTrashToRecyclers = ((BaseUnityPlugin)this).Config.Bind<bool>("Gameplay Settings", "All Recyclers", false, new ConfigDescription("Turns the nearest trash can into a recycler without the perk.", (AcceptableValueBase)null, Array.Empty<object>()));
			StorageHighlighting = ((BaseUnityPlugin)this).Config.Bind<bool>("Highlighting", "This feature has been deprecated from BetterSMT and moved to SuperQoLity.", false, new ConfigDescription("This feature has been deprecated from BetterSMT and moved to SuperQoLity.", (AcceptableValueBase)null, Array.Empty<object>()));
			EnableMTV = ((BaseUnityPlugin)this).Config.Bind<bool>("Mini Transport Vehicle", "Enable custom Mini Transport Vehicle features", false, new ConfigDescription("Enables or disables custom Mini Transport Vehicle features below.", (AcceptableValueBase)null, Array.Empty<object>()));
			AutoPickupRange = ((BaseUnityPlugin)this).Config.Bind<float>("Mini Transport Vehicle", "Change the range of auto-picking up boxes", 3f, new ConfigDescription("Adjusts how far away a box will be automatically picked up onto the Mini Transport Vehicle.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 30f), Array.Empty<object>()));
			MaxBoxes = ((BaseUnityPlugin)this).Config.Bind<int>("Mini Transport Vehicle", "Change the max boxes", 6, new ConfigDescription("Adjusts the max amount of boxes the Mini Transport Vehicle will hold at one time.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(6, 16), Array.Empty<object>()));
			MTVHotkey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Mini Transport Vehicle", "Change the drop hotkey", new KeyboardShortcut((KeyCode)108, Array.Empty<KeyCode>()), new ConfigDescription("Changes the hotkey used to dispense all boxes from the Mini Transport Vehicle instantly.", (AcceptableValueBase)null, Array.Empty<object>()));
			DropCooldown = ((BaseUnityPlugin)this).Config.Bind<float>("Mini Transport Vehicle", "Item Pickup Cooldown", 10f, new ConfigDescription("Changes how long it will wait to pickup boxes again after the drop hotkey has been pressed.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 30f), Array.Empty<object>()));
			ExpRate = ((BaseUnityPlugin)this).Config.Bind<int>("Random Features", "EXP Rate", 1, new ConfigDescription("Adjusts how much EXP you earn per transaction.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 10), Array.Empty<object>()));
			ShoplifterDetectionNotif = ((BaseUnityPlugin)this).Config.Bind<bool>("Random Features", "Shoplifter Notification", false, new ConfigDescription("Adds a visual que to notify you when a shoplifter runs through anti-theft doors.", (AcceptableValueBase)null, Array.Empty<object>()));
			CloserBoxSpawning = ((BaseUnityPlugin)this).Config.Bind<bool>("Random Features", "Closer Box Spawning", false, new ConfigDescription("Causes boxes to spawn closer to the storage area", (AcceptableValueBase)null, Array.Empty<object>()));
			OneClickCheckMark = ((BaseUnityPlugin)this).Config.Bind<bool>("Random Features", "Surveillance Camera One Click", false, new ConfigDescription("Makes all customers one click when using security console", (AcceptableValueBase)null, Array.Empty<object>()));
			AllowFreePlacement = ((BaseUnityPlugin)this).Config.Bind<bool>("Random Features", "Disable Placement Blocking", false, new ConfigDescription("Enables or disables you to place structures wherever in the main area, even overlapping", (AcceptableValueBase)null, Array.Empty<object>()));
			CheatPlacement = ((BaseUnityPlugin)this).Config.Bind<bool>("Random Features", "Disable PLacement Checks", false, new ConfigDescription("Similar to Free Placement, but allows building anywhere and everywhere", (AcceptableValueBase)null, Array.Empty<object>()));
			ProductStacking = ((BaseUnityPlugin)this).Config.Bind<bool>("Random Features", "Enable product stacking", false, new ConfigDescription("Enables or disables most products in the game to stack on shelves", (AcceptableValueBase)null, Array.Empty<object>()));
			EnablePalletDisplaysPerk = ((BaseUnityPlugin)this).Config.Bind<bool>("Random Features", "Enable pallet displays", false, new ConfigDescription("Enables pallet displays without unlocking the perk.", (AcceptableValueBase)null, Array.Empty<object>()));
			ReplaceCommasWithPeriods = ((BaseUnityPlugin)this).Config.Bind<bool>("Random Features", "Replace commas with periods", false, new ConfigDescription("Changes all commas in the game into periods.", (AcceptableValueBase)null, Array.Empty<object>()));
			CurrencyTypeToAny = ((BaseUnityPlugin)this).Config.Bind<string>("Random Features", "CurrencySymbol", "$", new ConfigDescription("Sets the currency symbol used in the game. Default is $.", (AcceptableValueBase)null, Array.Empty<object>()));
			StructuresBreaking = ((BaseUnityPlugin)this).Config.Bind<bool>("Random Features", "Enable or disable structures breaking", false, new ConfigDescription("Enables or disables structures breaking requiring them to be repaired.", (AcceptableValueBase)null, Array.Empty<object>()));
			ClockToggle = ((BaseUnityPlugin)this).Config.Bind<bool>("Hotkey Configurations", "Enable hotkey for clock", false, new ConfigDescription("Enables or disabled hotkey activating clock.", (AcceptableValueBase)null, Array.Empty<object>()));
			ClockHotkey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Hotkey Configurations", "Toggle Clock", new KeyboardShortcut((KeyCode)111, Array.Empty<KeyCode>()), new ConfigDescription("Hotkey to enable/disable the clock", (AcceptableValueBase)null, Array.Empty<object>()));
			AutoAdjustPriceDaily = ((BaseUnityPlugin)this).Config.Bind<bool>("Pricing Assistance", "Auto Adjust Prices Daily", false, new ConfigDescription("Enables or disables automatically doubling the price of products daily", (AcceptableValueBase)null, Array.Empty<object>()));
			AutoAdjustPriceDailyValue = ((BaseUnityPlugin)this).Config.Bind<float>("Pricing Assistance", "Adjust the amount prices are automatically set to every day", 2f, new ConfigDescription("Adjusts the amount prices are set to be multiplied by daily. Value of 2x is 2$ * 2 = 4$. Value of 1.99x is 2$*1.99=3.98", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 2f), Array.Empty<object>()));
			ToggleDoublePrice = ((BaseUnityPlugin)this).Config.Bind<bool>("Double Price Gun", "Enable or disable double price module", false, new ConfigDescription("Enables or disables the price gun automatically having 2x the market price", (AcceptableValueBase)null, Array.Empty<object>()));
			DoublePrice = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Double Price Gun", "Enable Double Price module", new KeyboardShortcut((KeyCode)113, Array.Empty<KeyCode>()), new ConfigDescription("Hotkey to enable and disable double price module", (AcceptableValueBase)null, Array.Empty<object>()));
			RoundDown = ((BaseUnityPlugin)this).Config.Bind<bool>("Double Price Gun", "Enable rounding down", false, new ConfigDescription("Enables rounding down to prevent 'Too Expensive'", (AcceptableValueBase)null, Array.Empty<object>()));
			NearestFive = ((BaseUnityPlugin)this).Config.Bind<bool>("Double Price Gun", "Enable rounding down to nearest 0.05", true, new ConfigDescription("Enable rounding down to the nearest fifth", (AcceptableValueBase)null, Array.Empty<object>()));
			NearestTen = ((BaseUnityPlugin)this).Config.Bind<bool>("Double Price Gun", "Enable rounding down to nearest 0.10", false, new ConfigDescription("Enable rounding down to the nearest tenth", (AcceptableValueBase)null, Array.Empty<object>()));
			RoundDownSwitch = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Double Price Gun", "Round Down Shortcuts", new KeyboardShortcut((KeyCode)113, (KeyCode[])(object)new KeyCode[1] { (KeyCode)306 }), new ConfigDescription("Hotkey to round down the double price", (AcceptableValueBase)null, Array.Empty<object>()));
			RoundDownToggle = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Double Price Gun", "Round Down Hotkey", new KeyboardShortcut((KeyCode)113, (KeyCode[])(object)new KeyCode[2]
			{
				(KeyCode)306,
				(KeyCode)304
			}), new ConfigDescription("Hotkey to round down to setting set", (AcceptableValueBase)null, Array.Empty<object>()));
			FireExtinguisher = ((BaseUnityPlugin)this).Config.Bind<float>("Random QoL", "Fire Extinguisher Chance", 0.66f, new ConfigDescription("Changes the percentage chance a bystander turns into a customer when hit with the fire extinguisher. 0.01 is a 1% chance, 1 is a 100% chance. ", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.01f, 1f), Array.Empty<object>()));
			PalletProduct = ((BaseUnityPlugin)this).Config.Bind<bool>("Random QoL", "More Product on Pallets", false, new ConfigDescription("Enables or disables allowing smaller products on pallets **Note: fully stocked pallets with smaller products can cause lag when being looked at", (AcceptableValueBase)null, Array.Empty<object>()));
			AllProduct = ((BaseUnityPlugin)this).Config.Bind<bool>("Random QoL", "No Product Requirement", false, new ConfigDescription("Enables or disables the need for freezers, pegboards, fridges, etc. **Note: fully stocked pallets with smaller products can cause lag when being looked at", (AcceptableValueBase)null, Array.Empty<object>()));
			LoanEarly = ((BaseUnityPlugin)this).Config.Bind<bool>("Random QoL", "Payoff Loans Early", false, new ConfigDescription("Enables or disables a button to pay off loans early", (AcceptableValueBase)null, Array.Empty<object>()));
			NumberKeys = ((BaseUnityPlugin)this).Config.Bind<bool>("Random QoL", "Enables normal numbers", false, new ConfigDescription("Enables or disables using non-numpad numbers to set prices", (AcceptableValueBase)null, Array.Empty<object>()));
			CardboardBalerValue = ((BaseUnityPlugin)this).Config.Bind<int>("Random QoL", "Cardboard Baler", 10, new ConfigDescription("Adjust the amount of boxes required for the cardboard baler to spit out a bale", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 50), Array.Empty<object>()));
			QuickStocking = ((BaseUnityPlugin)this).Config.Bind<bool>("Random QoL", "Enables quick stocking", false, new ConfigDescription("Enables or disables stocking the entire box onto shelf in one click", (AcceptableValueBase)null, Array.Empty<object>()));
			QuickRemoving = ((BaseUnityPlugin)this).Config.Bind<bool>("Random QoL", "Enables quick removing", false, new ConfigDescription("Enables or disables removing as much stock as possible from a shelf in 1 click", (AcceptableValueBase)null, Array.Empty<object>()));
			AutoOrdering = ((BaseUnityPlugin)this).Config.Bind<bool>("Random QoL", "Enables auto-ordering items", false, new ConfigDescription("Enables or disables automatically adding enough stock to the shopping order when picking up the OS Mart device", (AcceptableValueBase)null, Array.Empty<object>()));
			ClockMorning = ((BaseUnityPlugin)this).Config.Bind<bool>("Random QoL", "Enables clock usage in morning", false, new ConfigDescription("Enables or disables using the clock in the morning", (AcceptableValueBase)null, Array.Empty<object>()));
			ClockSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("Random QoL", "Clock Speed", 5f, new ConfigDescription("Adjust the amount of speed enabling the clock gives", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 15f), Array.Empty<object>()));
			DisableBoxCollisions = ((BaseUnityPlugin)this).Config.Bind<bool>("Random QoL", "Enable or disable collision with boxes", false, new ConfigDescription("Enables or disables collision with boxes allowing them to stack inside of each other https://i.imgur.com/ffJrHOA.jpeg", (AcceptableValueBase)null, Array.Empty<object>()));
			FastBoxSpawns = ((BaseUnityPlugin)this).Config.Bind<bool>("Random QoL", "Enable or disable fast spawning of boxes", false, new ConfigDescription("Enables or disables making purchases boxes spawn quickly https://i.imgur.com/92Ex4V6.png", (AcceptableValueBase)null, Array.Empty<object>()));
			MissingProductNotifications = ((BaseUnityPlugin)this).Config.Bind<bool>("Random QoL", "Enable or disable notification Missing Product", false, new ConfigDescription("Enables or disables the notification for missing products", (AcceptableValueBase)null, Array.Empty<object>()));
			TooExpensiveNotifications = ((BaseUnityPlugin)this).Config.Bind<bool>("Random QoL", "Enable or disable notification Too Expensive", false, new ConfigDescription("Enables or disables the notification for too expensive products", (AcceptableValueBase)null, Array.Empty<object>()));
			SelfCheckoutLimit = ((BaseUnityPlugin)this).Config.Bind<int>("Random QoL", "Product limit on self checkout", 4, new ConfigDescription("Limits the amount of item's a customer can have before using the self checkout", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>()));
			MaxBoxSize = ((BaseUnityPlugin)this).Config.Bind<int>("Random QoL", "Modify amount of products in boxes", 1, new ConfigDescription("** WARNING THIS IS EXTREMELY BUGGY IN MULTIPLAYER ** Multiples the amount of product in a box, aswell as it's cost. Higher = more products in box and higher cost https://imgur.com/a/QT5l2Ky", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 50), Array.Empty<object>()));
			AutoPayAllInvoices = ((BaseUnityPlugin)this).Config.Bind<bool>("Debt", "Enables or disables automatic invoice payment", false, new ConfigDescription("Enables or disables paying for invoices automatically", (AcceptableValueBase)null, Array.Empty<object>()));
			Instance = this;
			Logger = ((BaseUnityPlugin)this).Logger;
			harmony.PatchAll();
			Logger.LogInfo((object)"Plugin BetterSMT v3.1.0 is loaded!");
			Harmony.DEBUG = true;
			GameObject val = new GameObject("ManualSaleClearHotkeyListener");
			val.AddComponent<ManualSaleClearHotkeyListener>();
			Object.DontDestroyOnLoad((Object)(object)val);
		}

		public static void CreateImportantNotification(string text)
		{
			GameObject val = Object.Instantiate<GameObject>(GameCanvas.Instance.importantNotificationPrefab, GameCanvas.Instance.importantNotificationParentTransform);
			((TMP_Text)val.GetComponent<TextMeshProUGUI>()).text = text;
			val.SetActive(true);
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "BetterSMT";

		public const string PLUGIN_NAME = "BetterSMT";

		public const string PLUGIN_VERSION = "3.1.0";
	}
}
namespace BetterSMT.Patches
{
	[HarmonyPatch(typeof(AntiTheftBehaviour))]
	public static class AntiTheftBehaviourPatch
	{
		[CompilerGenerated]
		private sealed class <CustomAlarmBehaviour>d__1 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public AntiTheftBehaviour __instance;

			private MeshRenderer <rend1>5__1;

			private MeshRenderer <rend2>5__2;

			private bool <set>5__3;

			private int <i>5__4;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <CustomAlarmBehaviour>d__1(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<rend1>5__1 = null;
				<rend2>5__2 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e2: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					__instance.alarmIsPlaying = true;
					<rend1>5__1 = __instance.lightOBJ1.GetComponent<MeshRenderer>();
					<rend2>5__2 = __instance.lightOBJ2.GetComponent<MeshRenderer>();
					<set>5__3 = true;
					BetterSMT.CreateImportantNotification("Shoplifter Detected!");
					<i>5__4 = 0;
					break;
				case 1:
					<>1__state = -1;
					<set>5__3 = !<set>5__3;
					<i>5__4++;
					break;
				}
				if (<i>5__4 < 20)
				{
					((Renderer)<rend1>5__1).material = (<set>5__3 ? __instance.lightOn : __instance.lightOff);
					((Renderer)<rend2>5__2).material = (<set>5__3 ? __instance.lightOn : __instance.lightOff);
					<>2__current = (object)new WaitForSeconds(0.25f);
					<>1__state = 1;
					return true;
				}
				__instance.alarmIsPlaying = false;
				return false;
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		[HarmonyPrefix]
		[HarmonyPatch("AlarmBehaviour")]
		public static bool AlarmBehaviourPrefix(AntiTheftBehaviour __instance, ref IEnumerator __result)
		{
			ConfigEntry<bool> shoplifterDetectionNotif = BetterSMT.ShoplifterDetectionNotif;
			if (shoplifterDetectionNotif != null && shoplifterDetectionNotif.Value)
			{
				__result = CustomAlarmBehaviour(__instance);
				return false;
			}
			return true;
		}

		[IteratorStateMachine(typeof(<CustomAlarmBehaviour>d__1))]
		private static IEnumerator CustomAlarmBehaviour(AntiTheftBehaviour __instance)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <CustomAlarmBehaviour>d__1(0)
			{
				__instance = __instance
			};
		}
	}
	[HarmonyPatch(typeof(BoxData))]
	public static class BoxDataPatch
	{
		private static int _initialLayer = -1;

		[HarmonyPostfix]
		[HarmonyPatch("OnStartClient")]
		public static void OnStartClientPostfix(BoxData __instance)
		{
			ConfigEntry<bool> disableBoxCollisions = BetterSMT.DisableBoxCollisions;
			if (disableBoxCollisions != null && disableBoxCollisions.Value && !((Object)(object)((__instance != null) ? ((Component)__instance).gameObject : null) == (Object)null))
			{
				ApplyCollisionChanges(((Component)__instance).gameObject);
			}
		}

		private static void ApplyCollisionChanges(GameObject boxObject)
		{
			_initialLayer = ((_initialLayer == -1) ? boxObject.layer : _initialLayer);
			boxObject.layer = 20;
			Physics.IgnoreLayerCollision(20, 20, true);
		}
	}
	[HarmonyPatch(typeof(Builder_Main))]
	public class Builder_MainPatch
	{
		[HarmonyPatch(typeof(Builder_Main), "RetrieveInitialBehaviours")]
		[HarmonyPostfix]
		public static void ProductStackingWaitEndOfIEnumerable()
		{
			ConfigEntry<bool> productStacking = BetterSMT.ProductStacking;
			if (productStacking == null || !productStacking.Value)
			{
				return;
			}
			Data_Product val = default(Data_Product);
			foreach (GameObject item in ProductListing.Instance.productPrefabs.Where((GameObject p) => (Object)(object)p != (Object)null))
			{
				if (item.TryGetComponent<Data_Product>(ref val))
				{
					val.isStackable = true;
				}
			}
		}

		[HarmonyPatch("DeleteBehaviour")]
		[HarmonyPrefix]
		public static bool DeleteWheneverPatch(Builder_Main __instance)
		{
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_0373: Unknown result type (might be due to invalid IL or missing references)
			//IL_0382: Unknown result type (might be due to invalid IL or missing references)
			//IL_038f: Unknown result type (might be due to invalid IL or missing references)
			if (BetterSMT.AlwaysAbleToDeleteMode.Value || BetterSMT.DeleteAllCheckouts.Value)
			{
				RaycastHit val = default(RaycastHit);
				if (Physics.Raycast(((Component)Camera.main).transform.position, ((Component)Camera.main).transform.forward, ref val, 4f, LayerMask.op_Implicit(__instance.lMask)))
				{
					if (((Component)((RaycastHit)(ref val)).transform).gameObject.CompareTag("Movable"))
					{
						if (Object.op_Implicit((Object)(object)__instance.oldHitOBJ2) && (Object)(object)((Component)((RaycastHit)(ref val)).transform).gameObject != (Object)(object)__instance.oldHitOBJ2 && Object.op_Implicit((Object)(object)__instance.hEffect2))
						{
							__instance.hEffect2.highlighted = false;
						}
						__instance.hEffect2 = ((Component)((RaycastHit)(ref val)).transform).GetComponent<HighlightEffect>();
						__instance.hEffect2.highlighted = true;
						if (__instance.MainPlayer.GetButtonDown("Build") || __instance.MainPlayer.GetButtonDown("Main Action") || __instance.MainPlayer.GetButtonDown("Secondary Action"))
						{
							if (!BetterSMT.AlwaysAbleToDeleteMode.Value)
							{
								if (GameData.Instance.isSupermarketOpen)
								{
									GameCanvas.Instance.CreateCanvasNotification("message15");
									return false;
								}
								if (NPC_Manager.Instance.customersnpcParentOBJ.transform.childCount > 0)
								{
									GameCanvas.Instance.CreateCanvasNotification("message16");
									return false;
								}
							}
							if (__instance.FurnitureContainsProduct(((RaycastHit)(ref val)).transform) && !__instance.MainPlayer.GetButton("Drop Item"))
							{
								GameCanvas.Instance.CreateCanvasNotification("message17a");
								return false;
							}
							if (Object.op_Implicit((Object)(object)((Component)((RaycastHit)(ref val)).transform).GetComponent<Data_Container>()))
							{
								int containerID = ((Component)((RaycastHit)(ref val)).transform).GetComponent<Data_Container>().containerID;
								if (!BetterSMT.DeleteAllCheckouts.Value && (containerID == 6 || containerID == 7) && ((Component)((Component)GameData.Instance).GetComponent<NetworkSpawner>().levelPropsOBJ.transform.GetChild(2)).transform.childCount == 1)
								{
									GameCanvas.Instance.CreateCanvasNotification("checkoutwarning");
									return false;
								}
							}
							if (Object.op_Implicit((Object)(object)((Component)((RaycastHit)(ref val)).transform).GetComponent<NetworkIdentity>()))
							{
								float num = (float)((Component)((RaycastHit)(ref val)).transform).GetComponent<Data_Container>().cost * (BetterSMT.FullDeletionRefund.Value ? 1f : 0.9f);
								if (__instance.MainPlayer.GetButton("Drop Item"))
								{
									num += __instance.CalculateShelfProductCost(((RaycastHit)(ref val)).transform);
								}
								GameData.Instance.CmdAlterFundsWithoutExperience(num);
								((Component)GameData.Instance).GetComponent<NetworkSpawner>().CmdDestroyBox(((Component)((RaycastHit)(ref val)).transform).gameObject);
							}
						}
						__instance.oldHitOBJ2 = ((Component)((RaycastHit)(ref val)).transform).gameObject;
					}
					else if (Object.op_Implicit((Object)(object)__instance.hEffect2))
					{
						__instance.hEffect2.highlighted = false;
					}
				}
				else if (Object.op_Implicit((Object)(object)__instance.hEffect2))
				{
					__instance.hEffect2.highlighted = false;
				}
				RaycastHit val2 = default(RaycastHit);
				if (Physics.Raycast(((Component)Camera.main).transform.position, ((Component)Camera.main).transform.forward, ref val2, 4f, LayerMask.op_Implicit(__instance.lMask)))
				{
					if (((Component)((RaycastHit)(ref val2)).transform).gameObject.CompareTag("Decoration"))
					{
						if (Object.op_Implicit((Object)(object)__instance.oldHitOBJ) && (Object)(object)((Component)((RaycastHit)(ref val2)).transform).gameObject != (Object)(object)__instance.oldHitOBJ && Object.op_Implicit((Object)(object)__instance.hEffect))
						{
							((Behaviour)__instance.hEffect).enabled = false;
						}
						__instance.hEffect = ((Component)((RaycastHit)(ref val2)).transform.Find("Mesh")).GetComponent<HighlightEffect>();
						((Behaviour)__instance.hEffect).enabled = true;
						if ((__instance.MainPlayer.GetButtonDown("Build") || __instance.MainPlayer.GetButtonDown("Main Action") || __instance.MainPlayer.GetButtonDown("Secondary Action")) && Object.op_Implicit((Object)(object)((Component)((RaycastHit)(ref val2)).transform).GetComponent<NetworkIdentity>()))
						{
							float num2 = ((Component)((RaycastHit)(ref val2)).transform).GetComponent<BuildableInfo>().cost * 0.9f;
							GameData.Instance.CmdAlterFundsWithoutExperience(num2);
							((Component)GameData.Instance).GetComponent<NetworkSpawner>().CmdDestroyBox(((Component)((RaycastHit)(ref val2)).transform).gameObject);
							if (__instance.currentTabIndex == 4 && !GameData.Instance.removeLightsLimit)
							{
								((MonoBehaviour)__instance).StartCoroutine(__instance.DelayedSetLightsInfo());
							}
						}
						__instance.oldHitOBJ = ((Component)((RaycastHit)(ref val2)).transform).gameObject;
					}
					else if (Object.op_Implicit((Object)(object)__instance.hEffect))
					{
						((Behaviour)__instance.hEffect).enabled = false;
					}
				}
				else if (Object.op_Implicit((Object)(object)__instance.hEffect))
				{
					((Behaviour)__instance.hEffect).enabled = false;
				}
				return false;
			}
			return true;
		}

		[HarmonyPatch(typeof(Builder_Main), "DecorationBehaviour")]
		[HarmonyPrefix]
		public static bool DecorationBehaviourPatch(Builder_Main __instance)
		{
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0153: Unknown result type (might be due to invalid IL or missing references)
			//IL_0163: Unknown result type (might be due to invalid IL or missing references)
			//IL_0168: 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_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_0256: Unknown result type (might be due to invalid IL or missing references)
			//IL_0266: Unknown result type (might be due to invalid IL or missing references)
			//IL_026b: Unknown result type (might be due to invalid IL or missing references)
			//IL_026f: Unknown result type (might be due to invalid IL or missing references)
			if (BetterSMT.CheatPlacement.Value || BetterSMT.AllowFreePlacement.Value)
			{
				if (BetterSMT.CheatPlacement.Value)
				{
					__instance.inCorrectBounds = true;
					__instance.overlapping = false;
					__instance.raycastIsCorrect = true;
					__instance.canPlace = true;
					HighlightEffect val = default(HighlightEffect);
					if (__instance.dummyOBJ.TryGetComponent<HighlightEffect>(ref val))
					{
						val.glowHQColor = Color.green;
					}
				}
				else if (BetterSMT.AllowFreePlacement.Value)
				{
					__instance.inCorrectBounds = __instance.InCorrectBounds();
					__instance.overlapping = false;
					__instance.raycastIsCorrect = __instance.RaycastCheck();
					__instance.canPlace = __instance.inCorrectBounds && __instance.raycastIsCorrect;
					HighlightEffect val2 = default(HighlightEffect);
					if (__instance.dummyOBJ.TryGetComponent<HighlightEffect>(ref val2))
					{
						val2.glowHQColor = (__instance.canPlace ? Color.green : Color.red);
					}
				}
				if (__instance.MainPlayer.GetButtonDown("Build") && __instance.canPlace)
				{
					Quaternion rotation;
					if (__instance.currentElementIndex == 0)
					{
						if (!Object.op_Implicit((Object)(object)__instance.currentMovedOBJ.GetComponent<MiniTransportBehaviour>()))
						{
							NetworkSpawner component = ((Component)GameData.Instance).GetComponent<NetworkSpawner>();
							GameObject currentMovedOBJ = __instance.currentMovedOBJ;
							Vector3 position = __instance.dummyOBJ.transform.position;
							rotation = __instance.dummyOBJ.transform.rotation;
							component.GetMoveData(currentMovedOBJ, position, ((Quaternion)(ref rotation)).eulerAngles);
						}
						__instance.currentMovedOBJ = null;
						__instance.recentlyMoved = true;
						if (Object.op_Implicit((Object)(object)__instance.dummyOBJ))
						{
							Object.Destroy((Object)(object)__instance.dummyOBJ);
						}
					}
					else
					{
						if (__instance.currentTabIndex == 4 && !GameData.Instance.removeLightsLimit && __instance.GetLightsCounter() >= 240)
						{
							GameCanvas.Instance.CreateCanvasNotification("lghtlimit00");
							return false;
						}
						if (GameData.Instance.gameFunds < __instance.decorationCost)
						{
							GameCanvas.Instance.CreateCanvasNotification("message6");
							return false;
						}
						GameData.Instance.CmdAlterFunds(0f - __instance.decorationCost);
						NetworkSpawner component2 = ((Component)GameData.Instance).GetComponent<NetworkSpawner>();
						int currentPropIndex = __instance.currentPropIndex;
						Vector3 position2 = __instance.dummyOBJ.transform.position;
						rotation = __instance.dummyOBJ.transform.rotation;
						component2.CmdSpawnDecoration(currentPropIndex, position2, ((Quaternion)(ref rotation)).eulerAngles);
						if (__instance.currentTabIndex == 4 && !GameData.Instance.removeLightsLimit)
						{
							((MonoBehaviour)__instance).StartCoroutine(__instance.DelayedSetLightsInfo());
						}
					}
				}
				__instance.SharedBehaviour();
				return false;
			}
			return true;
		}

		[HarmonyPatch(typeof(Builder_Main), "BuildableBehaviour")]
		[HarmonyPrefix]
		public static bool BuildableBehaviourPatch(Builder_Main __instance)
		{
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: 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_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_02de: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0186: Unknown result type (might be due to invalid IL or missing references)
			//IL_018b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0204: Unknown result type (might be due to invalid IL or missing references)
			//IL_0214: Unknown result type (might be due to invalid IL or missing references)
			//IL_0219: Unknown result type (might be due to invalid IL or missing references)
			//IL_021d: Unknown result type (might be due to invalid IL or missing references)
			if (BetterSMT.CheatPlacement.Value || BetterSMT.AllowFreePlacement.Value)
			{
				if (BetterSMT.CheatPlacement.Value)
				{
					__instance.correctSector = __instance.CheckCorrectGround();
					__instance.correctSector = true;
					__instance.overlapping = false;
					__instance.canPlace = true;
					HighlightEffect val = default(HighlightEffect);
					if (__instance.dummyOBJ.TryGetComponent<HighlightEffect>(ref val))
					{
						val.glowHQColor = Color.green;
					}
				}
				else if (BetterSMT.AllowFreePlacement.Value)
				{
					__instance.correctSector = __instance.CheckCorrectGround();
					__instance.overlapping = false;
					__instance.canPlace = __instance.correctSector;
					HighlightEffect val2 = default(HighlightEffect);
					if (__instance.dummyOBJ.TryGetComponent<HighlightEffect>(ref val2))
					{
						val2.glowHQColor = (__instance.canPlace ? Color.green : Color.red);
					}
				}
				else
				{
					__instance.overlapping = __instance.pmakerFSM.FsmVariables.GetFsmBool("Overlapping").Value;
					if (__instance.correctSector && !__instance.overlapping && !__instance.canPlace)
					{
						__instance.canPlace = true;
						HighlightEffect val3 = default(HighlightEffect);
						if (__instance.dummyOBJ.TryGetComponent<HighlightEffect>(ref val3))
						{
							val3.glowHQColor = Color.green;
						}
					}
					if ((!__instance.correctSector || __instance.overlapping) && __instance.canPlace)
					{
						__instance.canPlace = false;
						HighlightEffect val4 = default(HighlightEffect);
						if (__instance.dummyOBJ.TryGetComponent<HighlightEffect>(ref val4))
						{
							val4.glowHQColor = Color.red;
						}
					}
				}
				if (__instance.MainPlayer.GetButtonDown("Build") && __instance.canPlace)
				{
					Quaternion rotation;
					if (__instance.currentElementIndex == 0)
					{
						GameObject currentMovedOBJ = __instance.currentMovedOBJ;
						if (Object.op_Implicit((Object)(object)((currentMovedOBJ != null) ? currentMovedOBJ.GetComponent<NetworkIdentity>() : null)))
						{
							NetworkSpawner component = ((Component)GameData.Instance).GetComponent<NetworkSpawner>();
							GameObject currentMovedOBJ2 = __instance.currentMovedOBJ;
							Vector3 position = __instance.dummyOBJ.transform.position;
							rotation = __instance.dummyOBJ.transform.rotation;
							component.GetMoveData(currentMovedOBJ2, position, ((Quaternion)(ref rotation)).eulerAngles);
							__instance.currentMovedOBJ.GetComponent<Data_Container>().RemoveMoveEffect();
							__instance.currentMovedOBJ = null;
							__instance.recentlyMoved = true;
							if (Object.op_Implicit((Object)(object)__instance.dummyOBJ))
							{
								Object.Destroy((Object)(object)__instance.dummyOBJ);
							}
						}
					}
					else
					{
						if (GameData.Instance.gameFunds < __instance.buildableCost)
						{
							GameCanvas.Instance.CreateCanvasNotification("message6");
							return false;
						}
						GameData.Instance.CmdAlterFunds(0f - __instance.buildableCost);
						NetworkSpawner component2 = ((Component)GameData.Instance).GetComponent<NetworkSpawner>();
						int currentPropIndex = __instance.currentPropIndex;
						Vector3 position2 = __instance.dummyOBJ.transform.position;
						rotation = __instance.dummyOBJ.transform.rotation;
						component2.CmdSpawn(currentPropIndex, position2, ((Quaternion)(ref rotation)).eulerAngles);
					}
				}
				__instance.SharedBehaviour();
				return false;
			}
			return true;
		}
	}
	[HarmonyPatch(typeof(CardboardBaler))]
	public static class CardboardBalerPatch
	{
		private static readonly FieldInfo BoxesLimitField = typeof(CardboardBaler).GetField("boxesLimitToCreateACardboardBale", BindingFlags.Instance | BindingFlags.NonPublic);

		public static bool Prepare()
		{
			ConfigEntry<int> cardboardBalerValue = BetterSMT.CardboardBalerValue;
			return cardboardBalerValue == null || cardboardBalerValue.Value != 10;
		}

		[HarmonyPostfix]
		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		public static void SetBoxLimitPostfix(CardboardBaler __instance)
		{
			BoxesLimitField?.SetValue(__instance, BetterSMT.CardboardBalerValue.Value);
		}

		[HarmonyPatch("OnStartServer")]
		[HarmonyPostfix]
		private static void OnStartServerPatch()
		{
			float num = BetterSMT.CardboardBalerValue.Value;
			if (Mathf.Approximately(num, 10f))
			{
				return;
			}
			PlayMakerFSM[] array = Object.FindObjectsOfType<PlayMakerFSM>();
			foreach (PlayMakerFSM val in array)
			{
				if (val.FsmName != "Behaviour" || !((Object)((Component)val).gameObject).name.StartsWith("Trash_Recycle"))
				{
					continue;
				}
				FsmState[] fsmStates = val.FsmStates;
				foreach (FsmState val2 in fsmStates)
				{
					FsmStateAction[] actions = val2.Actions;
					foreach (FsmStateAction val3 in actions)
					{
						FloatOperator val4 = (FloatOperator)(object)((val3 is FloatOperator) ? val3 : null);
						if (val4 != null && Mathf.Approximately(val4.float1.Value, 15f))
						{
							val4.float1.Value = num;
						}
					}
				}
			}
		}
	}
	[HarmonyPatch(typeof(Data_Container))]
	public class Patch_Data_Container
	{
		public static bool GetExternalConfigValue(string modGUID, string configKey, out object value)
		{
			value = null;
			if (Chainloader.PluginInfos.TryGetValue(modGUID, out var value2))
			{
				ConfigFile config = value2.Instance.Config;
				ConfigEntryBase val = (from c in (IEnumerable<KeyValuePair<ConfigDefinition, ConfigEntryBase>>)config
					where c.Key.Key == configKey
					select c.Value).FirstOrDefault();
				if (val != null)
				{
					value = val.BoxedValue;
					return true;
				}
			}
			return false;
		}

		[HarmonyPatch("AddItemToRow")]
		[HarmonyPrefix]
		private static bool AddItemToRowPatch(Data_Container __instance, int containerNumber, int productIDToAdd)
		{
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_013e: 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_01be: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0219: Unknown result type (might be due to invalid IL or missing references)
			if (GetExternalConfigValue("es.damntry.SuperQoLity", "*Enable ·Item Transfer Speed Module· (**)", out var value))
			{
				bool flag = default(bool);
				int num;
				if (value is bool)
				{
					flag = (bool)value;
					num = 1;
				}
				else
				{
					num = 0;
				}
				if (((uint)num & (flag ? 1u : 0u)) != 0)
				{
					BetterSMT.QuickStocking.Value = true;
				}
			}
			if (!BetterSMT.QuickStocking.Value && !BetterSMT.PalletProduct.Value && !BetterSMT.AllProduct.Value)
			{
				return true;
			}
			FirstPersonController instance = FirstPersonController.Instance;
			PlayerPermissions component = ((Component)instance).GetComponent<PlayerPermissions>();
			if (!component.RequestRP())
			{
				return false;
			}
			bool flag2 = !((NetworkBehaviour)__instance).isServer && FsmVariables.GlobalVariables.FindFsmBool("HighLatencyMode").Value;
			if (flag2 && __instance.highLatencyCooldown)
			{
				return false;
			}
			if (__instance.productlistComponent == null)
			{
				__instance.productlistComponent = ((Component)GameData.Instance).GetComponent<ProductListing>();
			}
			GameObject val = __instance.productlistComponent.productPrefabs[productIDToAdd];
			Data_Product component2 = val.GetComponent<Data_Product>();
			BoxCollider component3 = val.GetComponent<BoxCollider>();
			Vector3 size = component3.size;
			if (!BetterSMT.PalletProduct.Value && __instance.isVolumeRestricted && size.x * size.y * size.z < __instance.productVolumeLimit)
			{
				GameCanvas.Instance.CreateCanvasNotification("message20");
				return false;
			}
			if (!BetterSMT.AllProduct.Value && component2.productContainerClass != __instance.containerClass)
			{
				GameCanvas.Instance.CreateCanvasNotification("message0");
				return false;
			}
			int num2 = Mathf.Clamp(Mathf.FloorToInt(__instance.shelfLength / (size.x * 1.1f)), 1, 100);
			int num3 = Mathf.Clamp(Mathf.FloorToInt(__instance.shelfWidth / (size.z * 1.1f)), 1, 100);
			int num4 = num2 * num3;
			if (component2.isStackable)
			{
				int num5 = Mathf.Clamp(Mathf.FloorToInt(__instance.shelfHeight / (size.y * 1.1f)), 1, 100);
				num4 *= num5;
			}
			int num6 = containerNumber * 2;
			int num7 = __instance.productInfoArray[num6];
			int num8 = __instance.productInfoArray[num6 + 1];
			if (num8 >= num4)
			{
				GameCanvas.Instance.CreateCanvasNotification("message1");
				return false;
			}
			if (num7 != productIDToAdd && num7 != -1 && num8 != 0)
			{
				GameCanvas.Instance.CreateCanvasNotification("message2");
				return false;
			}
			PlayerNetwork component4 = ((Component)instance).GetComponent<PlayerNetwork>();
			int extraParameter = component4.extraParameter2;
			int num9 = num4 - num8;
			int num10;
			if (BetterSMT.QuickStocking.Value)
			{
				num10 = Mathf.Min(extraParameter, num9);
			}
			else if (flag2)
			{
				((MonoBehaviour)__instance).StartCoroutine(__instance.HighLatencyCoroutine());
				int num11 = Mathf.Clamp(num9, 1, 5);
				int num12 = Mathf.Clamp(extraParameter, 1, 5);
				num10 = Mathf.Min(num11, num12);
			}
			else
			{
				num10 = ((extraParameter > 0 && num9 > 0) ? 1 : 0);
			}
			if (num10 <= 0)
			{
				GameCanvas.Instance.CreateCanvasNotification("message1");
				return false;
			}
			component4.extraParameter2 -= num10;
			num8 += num10;
			AchievementsManager.Instance.CmdAddAchievementPoint(1, num10);
			GameData.Instance.PlayPopSound();
			__instance.productInfoArray[num6 + 1] = num8;
			__instance.CmdUpdateArrayValues(num6, productIDToAdd, num8);
			return false;
		}

		[HarmonyPatch("RemoveItemFromRow")]
		[HarmonyPrefix]
		public static bool QuickRemovePrefix(Data_Container __instance, int containerNumber)
		{
			if (!BetterSMT.QuickRemoving.Value)
			{
				return true;
			}
			FirstPersonController instance = FirstPersonController.Instance;
			PlayerPermissions component = ((Component)instance).GetComponent<PlayerPermissions>();
			PlayerNetwork component2 = ((Component)instance).GetComponent<PlayerNetwork>();
			if (!component.RequestRP())
			{
				return false;
			}
			int num = containerNumber * 2;
			int num2 = __instance.productInfoArray[num];
			int num3 = __instance.productInfoArray[num + 1];
			if (num2 == -1 || num3 <= 0)
			{
				return false;
			}
			if (component2.equippedItem != 1)
			{
				return false;
			}
			if (component2.extraParameter1 != num2 && component2.extraParameter2 > 0)
			{
				GameCanvas.Instance.CreateCanvasNotification("message13");
				return false;
			}
			int maxItemsPerBox = ProductListing.Instance.productPrefabs[num2].GetComponent<Data_Product>().maxItemsPerBox;
			if (component2.extraParameter2 >= maxItemsPerBox)
			{
				GameCanvas.Instance.CreateCanvasNotification("message12");
				return false;
			}
			if (component2.extraParameter2 == 0 && Object.op_Implicit((Object)(object)component2.instantiatedOBJ))
			{
				component2.extraParameter1 = num2;
				component2.UpdateBoxContents(num2);
			}
			int num4 = maxItemsPerBox - component2.extraParameter2;
			int num5 = Mathf.Min(num4, num3);
			component2.extraParameter2 += num5;
			num3 -= num5;
			GameData.Instance.PlayPop2Sound();
			__instance.productInfoArray[num + 1] = num3;
			__instance.CmdUpdateArrayValues(num, num2, num3);
			return false;
		}
	}
	[HarmonyPatch]
	public class Patch_DemolishableManager
	{
		private static MethodBase TargetMethod()
		{
			return AccessTools.Method(typeof(DemolishableManager), "UserCode_CmdDemolishItem__Int32__Int32", new Type[2]
			{
				typeof(int),
				typeof(int)
			}, (Type[])null);
		}

		private static bool Prefix(DemolishableManager __instance, int parentIndex, int whichObjectToDemolish)
		{
			if (BetterSMT.PillarPrice.Value == 4000f)
			{
				return true;
			}
			Transform transform = __instance.demolishableParentRootOBJ.transform;
			if (parentIndex >= transform.childCount || parentIndex >= __instance.demolishableValues.Length || parentIndex >= __instance.demolishingCosts.Length)
			{
				return false;
			}
			GameObject gameObject = ((Component)transform.GetChild(parentIndex)).gameObject;
			if (whichObjectToDemolish >= gameObject.transform.childCount)
			{
				return false;
			}
			float num = __instance.demolishingCosts[parentIndex];
			float num2 = ((!Mathf.Approximately(BetterSMT.PillarPrice.Value, num)) ? BetterSMT.PillarPrice.Value : num);
			if (num2 > GameData.Instance.gameFunds)
			{
				return false;
			}
			GameData component = ((Component)__instance).GetComponent<GameData>();
			component.AlterFundsFromEmployee(0f - num2);
			component.otherCosts += num2;
			string text = __instance.demolishableValues[parentIndex];
			if (!string.IsNullOrEmpty(text))
			{
				char c = text[whichObjectToDemolish];
				if (c != __instance.nullValue[0])
				{
					return false;
				}
			}
			__instance.demolishableValues[parentIndex] = __instance.AssembleValue(parentIndex, whichObjectToDemolish);
			if (!BetterSMT.PillarRubble.Value)
			{
				MethodInfo methodInfo = AccessTools.Method(((object)__instance).GetType(), "DelayedDemolishEffectInstantiation", (Type[])null, (Type[])null);
				IEnumerator enumerator = (IEnumerator)methodInfo.Invoke(__instance, new object[2] { parentIndex, whichObjectToDemolish });
				((MonoBehaviour)__instance).StartCoroutine(enumerator);
			}
			__instance.RpcDemolishItem(parentIndex, whichObjectToDemolish);
			return false;
		}
	}
	[HarmonyPatch(typeof(EmployeesDataGeneration))]
	public class EmployeesDataGenerationPatch
	{
		[HarmonyPatch("GenerateTodayEmployeesData")]
		[HarmonyPrefix]
		private static bool GenerateTodayEmployeesDataPatch(EmployeesDataGeneration __instance)
		{
			if (BetterSMT.EmployeesLevel.Value != 0)
			{
				EmployeeLevelPatch(__instance);
				return false;
			}
			return true;
		}

		public static void EmployeeLevelPatch(EmployeesDataGeneration __instance)
		{
			int num = Random.Range(0, 5);
			int num2 = Random.Range(5, 10);
			for (int i = 0; i < 10; i++)
			{
				int num3 = Random.Range(0, 7);
				int[] array = new int[7];
				if (i == num)
				{
					for (int j = 0; j < array.Length; j++)
					{
						array[j] = Random.Range((j % 2 == 0) ? 6 : 7, 11);
					}
				}
				else if (i == num2)
				{
					for (int k = 0; k < array.Length; k++)
					{
						array[k] = Random.Range((k % 2 == 0) ? 5 : 4, 11);
					}
				}
				else
				{
					for (int l = 0; l < array.Length; l++)
					{
						array[l] = Random.Range(1, 11);
					}
				}
				if (BetterSMT.EmployeesLevel.Value != 0)
				{
					for (int m = 0; m < array.Length; m++)
					{
						array[m] = BetterSMT.EmployeesLevel.Value;
					}
				}
				int num4 = (array[0] + array[1] + array[2] + array[3]) * Random.Range(3, 6) + Random.Range(-2, 3) * 10;
				num4 = Mathf.Clamp(num4, 30, 1000);
				string text = num3 + "|" + num4 + "|" + string.Join("|", array);
				__instance.managerComponent.todaysEmployeesData[i] = text;
				__instance.managerComponent.UpdateTodayEmployeesOnClients(i, text);
			}
		}
	}
	[HarmonyPatch(typeof(GameCanvas))]
	internal class NotificationHandler
	{
		public static bool doublePrice = true;

		public static bool notify = false;

		public static string notificationType;

		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		public static void NotificationHandler_Postfix(ref bool ___inCooldown)
		{
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0138: Unknown result type (might be due to invalid IL or missing references)
			//IL_013d: Unknown result type (might be due to invalid IL or missing references)
			if (!BetterSMT.ToggleDoublePrice.Value)
			{
				return;
			}
			string text = null;
			FirstPersonController instance = FirstPersonController.Instance;
			PlayerNetwork val = ((instance != null) ? ((Component)instance).GetComponent<PlayerNetwork>() : null);
			if ((Object)(object)val == (Object)null)
			{
				return;
			}
			float num = val.pPrice;
			TextMeshProUGUI marketPriceTMP = val.marketPriceTMP;
			TextMeshProUGUI yourPriceTMP = val.yourPriceTMP;
			KeyboardShortcut value = BetterSMT.DoublePrice.Value;
			if (((KeyboardShortcut)(ref value)).IsDown())
			{
				doublePrice = !doublePrice;
				text = "Double Price: " + (doublePrice ? "ON" : "OFF");
			}
			else
			{
				value = BetterSMT.RoundDownSwitch.Value;
				if (((KeyboardShortcut)(ref value)).IsDown())
				{
					BetterSMT.NearestTen.Value = !BetterSMT.NearestTen.Value;
					BetterSMT.NearestFive.Value = !BetterSMT.NearestFive.Value;
					text = "Rounding to nearest " + (BetterSMT.NearestTen.Value ? "ten" : "five");
					if (!BetterSMT.RoundDown.Value)
					{
						text += "\r\n(Currently disabled)";
					}
				}
				else
				{
					value = BetterSMT.RoundDownToggle.Value;
					if (((KeyboardShortcut)(ref value)).IsDown())
					{
						BetterSMT.RoundDown.Value = !BetterSMT.RoundDown.Value;
						text = "Rounding has been " + (BetterSMT.RoundDown.Value ? "enabled" : "disabled");
					}
				}
			}
			if (BetterSMT.NearestFive.Value && BetterSMT.NearestTen.Value)
			{
				BetterSMT.NearestTen.Value = false;
			}
			if (doublePrice && (Object)(object)marketPriceTMP != (Object)null)
			{
				string text2 = ((TMP_Text)marketPriceTMP).text;
				if (float.TryParse(text2.Substring(1, text2.Length - 1).Replace(',', '.'), NumberStyles.Float, CultureInfo.InvariantCulture, out var result))
				{
					num = result * 2f;
					if (BetterSMT.RoundDown.Value)
					{
						num = (BetterSMT.NearestTen.Value ? ((float)(Math.Floor(num * 10f) / 10.0)) : ((float)(Math.Floor(num * 20f) / 20.0)));
					}
					((TMP_Text)yourPriceTMP).text = "$" + num;
				}
			}
			val.pPrice = num;
			val.yourPriceTMP = yourPriceTMP;
			val.marketPriceTMP = marketPriceTMP;
			if (!string.IsNullOrEmpty(text))
			{
				___inCooldown = false;
				BetterSMT.CreateImportantNotification(text);
			}
		}
	}
	[HarmonyPatch(typeof(GameData))]
	public class GameDataPatch
	{
		public class BetterSMTLoanSystem : NetworkBehaviour
		{
			[Command(requiresAuthority = false)]
			public void CmdPayLoanEarly()
			{
				DebtManager component = ((Component)GameData.Instance).GetComponent<DebtManager>();
				int networkloanAmount = component.NetworkloanAmount;
				if (networkloanAmount <= 0)
				{
					BetterSMT.CreateImportantNotification("No active loan to pay.");
					return;
				}
				if (GameData.Instance.gameFunds < (float)networkloanAmount)
				{
					BetterSMT.CreateImportantNotification("Not enough funds to pay off the loan.");
					return;
				}
				GameData.Instance.CmdAlterFundsWithoutExperience((float)(-networkloanAmount));
				component.NetworkloanAmount = 0;
				component.NetworkloanPaymentPerDay = 0;
				int num = default(int);
				float num2 = default(float);
				int num3 = default(int);
				int num4 = default(int);
				string text2 = default(string);
				for (int i = 0; i < component.NetworkcurrentInvoicesData.Length; i++)
				{
					string text = component.NetworkcurrentInvoicesData[i];
					if (!string.IsNullOrEmpty(text))
					{
						component.GetInvoiceDataValues(text, ref num, ref num2, ref num3, ref num4, ref text2);
						if (num == 0)
						{
							component.NetworkcurrentInvoicesData[i] = "";
						}
					}
				}
				if ((Object)(object)component.loanDisclaimerContainerOBJ != (Object)null && component.loanDisclaimerContainerOBJ.activeSelf)
				{
					component.loanDisclaimerContainerOBJ.SetActive(false);
				}
				component.GenerateExistingDebtsInUI();
				BetterSMT.CreateImportantNotification("Loan paid off early.");
			}
		}

		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static UnityAction <>9__2_0;

			public static UnityAction <>9__6_0;

			internal void <UpdateEscapeMenu>b__2_0()
			{
				((MonoBehaviour)GameData.Instance).StartCoroutine(SaveGame());
			}

			internal void <UpdateInvoiceMenu>b__6_0()
			{
				if ((Object)(object)loanSystemInstance != (Object)null && NetworkClient.active)
				{
					loanSystemInstance.CmdPayLoanEarly();
				}
			}
		}

		[CompilerGenerated]
		private sealed class <SaveGame>d__3 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			private NetworkSpawner <spawner>5__1;

			private PlayMakerFSM <fsm>5__2;

			private FsmBool <isSavingVar>5__3;

			private float <timeout>5__4;

			private float <elapsed>5__5;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <SaveGame>d__3(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<spawner>5__1 = null;
				<fsm>5__2 = null;
				<isSavingVar>5__3 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<spawner>5__1 = ((Component)GameData.Instance).GetComponent<NetworkSpawner>();
					if (<spawner>5__1.isSaving)
					{
						BetterSMT.CreateImportantNotification("Saving already in progress");
						return false;
					}
					BetterSMT.CreateImportantNotification("Saving Game");
					GameData.Instance.DoDaySaveBackup();
					<fsm>5__2 = GameData.Instance.SaveOBJ.GetComponent<PlayMakerFSM>();
					<isSavingVar>5__3 = <fsm>5__2.FsmVariables.GetFsmBool("IsSaving");
					<isSavingVar>5__3.Value = true;
					<fsm>5__2.SendEvent("Send_Data");
					<timeout>5__4 = 10f;
					<elapsed>5__5 = 0f;
					goto IL_0125;
				case 1:
					<>1__state = -1;
					goto IL_0125;
				case 2:
					{
						<>1__state = -1;
						BetterSMT.CreateImportantNotification("Saving Finished");
						return false;
					}
					IL_0125:
					if (<isSavingVar>5__3.Value)
					{
						if (<elapsed>5__5 > <timeout>5__4)
						{
							BetterSMT.CreateImportantNotification("Save timed out.");
							return false;
						}
						<elapsed>5__5 += Time.deltaTime;
						<>2__current = null;
						<>1__state = 1;
						return true;
					}
					<>2__current = <spawner>5__1.SavePropsCoroutine(false);
					<>1__state = 2;
					return true;
				}
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		public static readonly Dictionary<int, string> productNames = new Dictionary<int, string>
		{
			{ 0, "Pasta Penne" },
			{ 1, "Water Bottle" },
			{ 2, "Honey Cereals" },
			{ 3, "Rice" },
			{ 4, "Salt" },
			{ 5, "Sugar" },
			{ 6, "Margarine" },
			{ 7, "Flour" },
			{ 8, "Apple Juice" },
			{ 9, "Olive Oil" },
			{ 10, "Ketchup" },
			{ 11, "Sliced Bread" },
			{ 12, "Pepper" },
			{ 13, "Orange Juice" },
			{ 14, "Barbaque Sauce" },
			{ 15, "Mustard Sauce" },
			{ 16, "Spaghetti Box" },
			{ 17, "Tuna Pate" },
			{ 18, "Fiber Cereals" },
			{ 19, "Supreme Flour" },
			{ 20, "Black Coffee" },
			{ 21, "Egg Box" },
			{ 22, "Houmous" },
			{ 23, "White Flour" },
			{ 24, "Cane Sugar Box" },
			{ 25, "Sugar" },
			{ 26, "Macarroni" },
			{ 27, "Ecologic Sugar" },
			{ 28, "Brown Sugar" },
			{ 29, "Sunflower Oil" },
			{ 30, "Mash Potatoes" },
			{ 31, "Potato Bag" },
			{ 32, "Espresso Coffee" },
			{ 33, "Basmati Rice" },
			{ 34, "Long Grain Rice" },
			{ 35, "Coffee" },
			{ 36, "Supreme Pasta" },
			{ 37, "Chocolate Cereals" },
			{ 38, "Premium Water" },
			{ 39, "Spring Water" },
			{ 40, "Powdered Sugar" },
			{ 41, "Sugar - Big Box" },
			{ 42, "Brown Sugar - Big Box" },
			{ 43, "Emmental Cheese" },
			{ 44, "Gruyere Cheese" },
			{ 45, "Skimmed Cheese" },
			{ 46, "Fruit Yoghurt" },
			{ 47, "Vanilla Yoghurt" },
			{ 48, "Milk Brick" },
			{ 49, "Butter" },
			{ 50, "Parmigiano Cheese" },
			{ 51, "Reggiano Cheese" },
			{ 52, "Mozzarella Cheese" },
			{ 53, "Skimmed Yoghurt" },
			{ 54, "Cola Pack" },
			{ 55, "Soda Pack" },
			{ 56, "Decaf Soda Pack" },
			{ 57, "Soda Bottle" },
			{ 58, "Cola Bottle" },
			{ 59, "Sugar Free Soda Bottle" },
			{ 60, "Premium Soda" },
			{ 61, "Pizza Barbaque" },
			{ 62, "Fondue" },
			{ 63, "Crocanti Ham" },
			{ 64, "Ham Cheese Crepe" },
			{ 65, "French Fries" },
			{ 66, "Crispy Potato Pops" },
			{ 67, "Green Beans" },
			{ 68, "Four Cheese Pizza" },
			{ 69, "Four Seasons Pizza" },
			{ 70, "Vegetable Mix" },
			{ 71, "Chicken Mix" },
			{ 72, "Bolognaise Lasagna" },
			{ 73, "Vegetable Lasagna" },
			{ 74, "Toothpaste" },
			{ 75, "Toilet Paper" },
			{ 76, "Hand Soap" },
			{ 77, "Avocado Shampoo" },
			{ 78, "Egg Shampoo" },
			{ 79, "Bath Gel" },
			{ 80, "Toilet Paper" },
			{ 81, "Mango Soap" },
			{ 82, "Extra Soft Shampoo" },
			{ 83, "Jojoba Honey Shampoo" },
			{ 84, "Argan Oil Shampoo" },
			{ 85, "Paper Towel" },
			{ 86, "Double Side Toilet Paper" },
			{ 87, "Lemon Soap" },
			{ 88, "Premium Bath Gel" },
			{ 89, "Shampoo For Babies" },
			{ 90, "Detergent" },
			{ 91, "Stain Remover" },
			{ 92, "Glass Cleaner" },
			{ 93, "Detergent Tables" },
			{ 94, "Dishwasher" },
			{ 95, "Bleach" },
			{ 96, "Bleach - Big Bottle" },
			{ 97, "Softener" },
			{ 98, "Premium Detergent" },
			{ 99, "Insecticide" },
			{ 100, "Cleaning Cloths" },
			{ 101, "Premium Capsules" },
			{ 102, "Premium Bleach" },
			{ 103, "Ammonia" },
			{ 104, "Cookie Jar" },
			{ 105, "Maxi Cone" },
			{ 106, "Chocolate Spread" },
			{ 107, "Chocolate Powder" },
			{ 108, "Chips" },
			{ 109, "Sweet Bonbek" },
			{ 110, "Peach Jam" },
			{ 111, "Ice Cream Box" },
			{ 112, "Chocolate Box" },
			{ 113, "Chocolate Biscuit" },
			{ 114, "Vanilate Biscuit" },
			{ 115, "Madeleine" },
			{ 116, "Strawberry Jam" },
			{ 117, "Peanut Butter" },
			{ 118, "Chipos" },
			{ 119, "Marshmallow" },
			{ 120, "Lemon Biscuit" },
			{ 121, "Hazelnut Biscuit" },
			{ 122, "Premium Ice Cream" },
			{ 123, "Honey" },
			{ 124, "Premium Chocolate Box" },
			{ 125, "Foditos" },
			{ 126, "Premium Cake" },
			{ 127, "Chopped Beef" },
			{ 128, "Pure Beef" },
			{ 129, "Veal" },
			{ 130, "Chicken Wings" },
			{ 131, "Chicken" },
			{ 132, "Parma Ham" },
			{ 133, "Sliced Ham" },
			{ 134, "Peas - Big" },
			{ 135, "Tuna - Big" },
			{ 136, "Red Beans" },
			{ 137, "Cat Food" },
			{ 138, "Cat Food" },
			{ 139, "Dog Food" },
			{ 140, "Green Tea" },
			{ 141, "Lemon Tea" },
			{ 142, "Black Tea" },
			{ 143, "Peppermint" },
			{ 144, "Mint" },
			{ 145, "Valerian" },
			{ 146, "Big Sushi" },
			{ 147, "Small Sushi" },
			{ 148, "Smoked Salmon" },
			{ 149, "Crab Sticks" },
			{ 150, "Book - Electromagnetic" },
			{ 151, "Book - Surprise" },
			{ 152, "Book - ABC" },
			{ 153, "Book - Mother And Child" },
			{ 154, "Book - Colors" },
			{ 155, "Book - Piticha" },
			{ 156, "Book - OnceUpon" },
			{ 157, "Book - Krok" },
			{ 158, "Book - Adventures" },
			{ 159, "Book - Donnine" },
			{ 160, "Book - Vintage" },
			{ 161, "Book - I Wont Share" },
			{ 162, "Beer Pack" },
			{ 163, "Beer Pack" },
			{ 164, "Beer Pack" },
			{ 165, "Beer Barrel" },
			{ 166, "Beer Barrel" },
			{ 167, "Vodka" },
			{ 168, "Red Wine" },
			{ 169, "Rose Wine" },
			{ 170, "White Wine" },
			{ 171, "Beer Barrel" },
			{ 172, "Premium Vodka" },
			{ 173, "Japanese Whisky" },
			{ 174, "Premium Whisky" },
			{ 175, "Premium Whisky" },
			{ 176, "Hydrogen Peroxide" },
			{ 177, "Disinfectant" },
			{ 178, "Ibuprofen" },
			{ 179, "Paracetamol" },
			{ 180, "Adhesive Bandages" },
			{ 181, "Laxative" },
			{ 182, "Antihistamine" },
			{ 183, "Zinc Supplement" },
			{ 184, "Antioxidant" },
			{ 185, "Fish Oil" },
			{ 186, "Algae Pills" },
			{ 187, "Vitamins" },
			{ 188, "Melatonin" },
			{ 189, "Sunscreen" },
			{ 190, "Stretch Cream" },
			{ 191, "Red Apple Tray" },
			{ 192, "Green Apple Tray" },
			{ 193, "Clementine Tray" },
			{ 194, "Orange Tray" },
			{ 195, "Pear Tray" },
			{ 196, "Lemon Tray" },
			{ 197, "Mango Tray" },
			{ 198, "Avocado Tray" },
			{ 199, "Kiwi Tray" },
			{ 200, "Papaya Tray" },
			{ 201, "Strawberry Tray" },
			{ 202, "Cherry Tray" },
			{ 203, "Artichoke Tray" },
			{ 204, "Zucchini Tray" },
			{ 205, "Carrot Tray" },
			{ 206, "Tomato Tray" },
			{ 207, "Potato Tray" },
			{ 208, "Onion Tray" },
			{ 209, "Banana Pack" },
			{ 210, "Melon" },
			{ 211, "Pineapple" },
			{ 212, "Pumpkin" },
			{ 213, "Watermelon" },
			{ 214, "Baby Food: Vegetables" },
			{ 215, "Baby Food: Fish" },
			{ 216, "Baby Food: Fruits" },
			{ 217, "Baby Food: Meat" },
			{ 218, "Nutritive Milk Mix" },
			{ 219, "Nutritive Milk Powder" },
			{ 220, "Ecologic Diapers" },
			{ 221, "Basic Diapers" },
			{ 222, "Toddler Diapers" },
			{ 223, "Premium Diapers" },
			{ 224, "Aloe Baby Wipes " },
			{ 225, "Basic Baby Wipes" },
			{ 226, "Baby Powder" },
			{ 227, "Orange Soda" },
			{ 228, "Pineapple Soda" },
			{ 229, "Tropical Soda" },
			{ 230, "Green Tea Drink" },
			{ 231, "Red Tea Drink" },
			{ 232, "Lemon Tea Drink" },
			{ 233, "Cold Brew Coffee" },
			{ 234, "Blueberry Energy Drink" },
			{ 235, "Guava Energy Drink" },
			{ 236, "Lima Energy Drink" },
			{ 237, "Fruit Punch Energy Drink" },
			{ 238, "Mango Energy Drink" },
			{ 239, "Cola Energy Drink" },
			{ 240, "Sugar Free Energy Drink" },
			{ 241, "Basic Strawberry Ice Cream" },
			{ 242, "Lemon Ice Cream" },
			{ 243, "Coffee Ice Cream" },
			{ 244, "Stracciatella Ice Cream" },
			{ 245, "Strawberry Meringue Ice Cream" },
			{ 246, "Caramel Ice Cream" },
			{ 247, "Premium Strawberry Ice Cream" },
			{ 248, "Strawberry Cheesecake Ice Cream" },
			{ 249, "Premium Caramel Ice Cream" },
			{ 250, "Pink Strawberry Ice Cream" },
			{ 251, "Alcoholic Ice Cream" },
			{ 252, "Chickpeas" },
			{ 253, "Meatballs" },
			{ 254, "Lentils" },
			{ 255, "Tomato Soup" },
			{ 256, "Canned Corn" },
			{ 257, "Canned Peas" },
			{ 258, "Strawberry Seeds" },
			{ 259, "Raspberry Seeds" },
			{ 260, "Blueberry Seeds" },
			{ 261, "Pineapple Seeds" },
			{ 262, "Meyer Lemon Seeds" },
			{ 263, "Tomato Seeds" },
			{ 264, "Pepper Seeds" },
			{ 265, "Cucumber Seeds" },
			{ 266, "Radish Seeds" },
			{ 267, "Carrots Seeds" },
			{ 268, "Lawn Seeds" },
			{ 269, "Poppy Seeds" },
			{ 270, "Tulip Seeds" },
			{ 271, "Sunflower Seeds" },
			{ 272, "Petunia Seeds" },
			{ 273, "Hand Rake (A)" },
			{ 274, "Hand Rake (B)" },
			{ 275, "Hand Shovel" },
			{ 276, "Hand Cultivator" },
			{ 277, "Potting Soil" },
			{ 278, "Fertilizer" },
			{ 279, "Plant Pot Dish" },
			{ 280, "Plant Pot" },
			{ 281, "AA Batteries" },
			{ 282, "AAA Batteries" },
			{ 283, "C Batteries" },
			{ 284, "9V Batteries" },
			{ 285, "Universal TV Remote" },
			{ 286, "Universal Phone Charger" },
			{ 287, "Basic Prepaid Phone" },
			{ 288, "Basic Mouse" },
			{ 289, "Wifi Dongle" },
			{ 290, "Basic Earbuds" },
			{ 291, "Basic Keyboard" },
			{ 292, "Basic Gamepad" },
			{ 293, "USB Flash Drive (128GB)" },
			{ 294, "USB Flash Drive (256GB)" },
			{ 295, "USB Flash Drive (512GB)" },
			{ 296, "USB Flash Drive (1TB)" },
			{ 297, "Basic Speaker" },
			{ 298, "Basic Headphones" },
			{ 299, "Basic Gaming Console" },
			{ 300, "Garlic Tray" },
			{ 301, "Mushroom Tray" },
			{ 302, "Bell Pepper Tray" },
			{ 303, "Lettuce Tray" },
			{ 304, "Coconut" },
			{ 305, "Cauliflower" },
			{ 306, "Peanuts" },
			{ 307, "Almonds" },
			{ 308, "Hazelnuts" },
			{ 309, "Pistachios" },
			{ 310, "Raisins" },
			{ 311, "Cashew Nuts" },
			{ 312, "Shelled Walnuts" },
			{ 313, "Coconut Chips" },
			{ 314, "Baking Powder" },
			{ 315, "Baking Soda" },
			{ 316, "Cake Mix" },
			{ 317, "Cocoa Powder" },
			{ 318, "Cornstarch" },
			{ 319, "Icing Tube" },
			{ 320, "Candy Sprinkles" },
			{ 321, "Vanilla Extract" }
		};

		private static BetterSMTLoanSystem loanSystemInstance;

		[HarmonyPatch("OnStartClient")]
		[HarmonyPostfix]
		private static void UpdateEscapeMenu()
		{
			//IL_0078: 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_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_017c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0181: Unknown result type (might be due to invalid IL or missing references)
			//IL_0187: Expected O, but got Unknown
			GameObject val = GameObject.Find("MasterOBJ/MasterCanvas/Menus/EscapeMenu/");
			Transform obj = val.transform.Find("QuitButton");
			GameObject val2 = ((obj != null) ? ((Component)obj).gameObject : null);
			Transform obj2 = val.transform.Find("MainMenuButton");
			GameObject val3 = ((obj2 != null) ? ((Component)obj2).gameObject : null);
			Transform obj3 = val.transform.Find("OptionsButton");
			GameObject val4 = ((obj3 != null) ? ((Component)obj3).gameObject : null);
			val2.transform.localPosition = new Vector3(0f, 0f, 0f);
			val3.transform.localPosition = new Vector3(0f, 85f, 0f);
			GameObject val5 = Object.Instantiate<GameObject>(val2, val.transform);
			((Object)val5).name = "SaveButton";
			PlayMakerFSM[] components = val5.GetComponents<PlayMakerFSM>();
			foreach (PlayMakerFSM val6 in components)
			{
				Object.Destroy((Object)(object)val6);
			}
			Object.Destroy((Object)(object)val5.GetComponent<EventTrigger>());
			val5.transform.localPosition = new Vector3(0f, -125f, 0f);
			val5.transform.localScale = val2.transform.localScale;
			TextMeshProUGUI componentInChildren = val5.GetComponentInChildren<TextMeshProUGUI>();
			if ((Object)(object)componentInChildren != (Object)null)
			{
				((TMP_Text)componentInChildren).text = "Save Game (BSMT)";
			}
			Button component = val5.GetComponent<Button>();
			ButtonClickedEvent onClick = component.onClick;
			object obj4 = <>c.<>9__2_0;
			if (obj4 == null)
			{
				UnityAction val7 = delegate
				{
					((MonoBehaviour)GameData.Instance).StartCoroutine(SaveGame());
				};
				<>c.<>9__2_0 = val7;
				obj4 = (object)val7;
			}
			((UnityEvent)onClick).AddListener((UnityAction)obj4);
			if (!((NetworkBehaviour)GameData.Instance).isServer)
			{
				val5.SetActive(false);
			}
		}

		[IteratorStateMachine(typeof(<SaveGame>d__3))]
		public static IEnumerator SaveGame()
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <SaveGame>d__3(0);
		}

		[HarmonyPatch("OnStartClient")]
		[HarmonyPostfix]
		private static void AutopayInvoices(DebtManager __instance)
		{
			if (!((Object)(object)__instance == (Object)null))
			{
				((Component)__instance).GetComponent<DebtManager>().autopayInvoices = BetterSMT.AutoPayAllInvoices?.Value ?? false;
			}
		}

		[HarmonyPatch("UserCode_CmdAlterFunds__Single")]
		[HarmonyPrefix]
		private static bool UserCode_CmdAlterFunds__SinglePatch(float fundsToAdd, GameData __instance)
		{
			if (BetterSMT.ExpRate.Value != 1)
			{
				float num = __instance.gameFunds + fundsToAdd;
				num = Mathf.Clamp(num, 0f, 2.14E+09f);
				__instance.NetworkgameFunds = Mathf.Round(num * 100f) / 100f;
				if (fundsToAdd > 0f)
				{
					float num2 = 0.5f - (float)__instance.gameFranchiseLevel * 0.004f;
					num2 = Mathf.Clamp(num2, 0.05f, 1f);
					__instance.NetworkgameFranchiseExperience = (__instance.gameFranchiseExperience + (int)(fundsToAdd * num2)) * BetterSMT.ExpRate.Value;
					__instance.todaysFranchiseExperience += (int)(fundsToAdd * num2) * BetterSMT.ExpRate.Value;
					__instance.dayBenefits += (float)(int)fundsToAdd;
				}
				else
				{
					__instance.otherCosts += fundsToAdd;
				}
				__instance.RpcAlterFunds(fundsToAdd);
				int num3 = 0;
				for (int i = 1; (float)i < float.PositiveInfinity; i++)
				{
					num3 += i * 100;
					if (num3 > __instance.gameFranchiseExperience)
					{
						if (i > __instance.lastAwardedFranchiseLevel)
						{
							__instance.NetworkgameFranchisePoints = __instance.gameFranchisePoints + 1;
							__instance.lastAwardedFranchiseLevel = i;
						}
						break;
					}
				}
				return false;
			}
			return true;
		}

		[HarmonyPatch("OnStartClient")]
		[HarmonyPostfix]
		private static void UpdateInvoiceMenu()
		{
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Expected O, but got Unknown
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: 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_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			//IL_0166: Unknown result type (might be due to invalid IL or missing references)
			//IL_016d: Expected O, but got Unknown
			//IL_018c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0199: 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_01b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0261: Unknown result type (might be due to invalid IL or missing references)
			//IL_0270: Unknown result type (might be due to invalid IL or missing references)
			//IL_027f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0244: Unknown result type (might be due to invalid IL or missing references)
			//IL_0249: Unknown result type (might be due to invalid IL or missing references)
			//IL_024f: Expected O, but got Unknown
			if (!BetterSMT.LoanEarly.Value)
			{
				return;
			}
			GameObject val = GameObject.Find("Interactables/Canvas_Manager/Tabs/Invoices_Tab/");
			Transform obj = val.transform.Find("PayThisInvoiceButton");
			GameObject val2 = ((obj != null) ? ((Component)obj).gameObject : null);
			GameObject val3 = new GameObject("PayInvoiceEarlyButton", new Type[4]
			{
				typeof(RectTransform),
				typeof(CanvasRenderer),
				typeof(Image),
				typeof(Button)
			});
			val3.transform.SetParent(val.transform, false);
			RectTransform component = val3.GetComponent<RectTransform>();
			RectTransform component2 = val2.GetComponent<RectTransform>();
			component.anchorMin = component2.anchorMin;
			component.anchorMax = component2.anchorMax;
			component.pivot = component2.pivot;
			component.sizeDelta = component2.sizeDelta;
			component.anchoredPosition = new Vector2(431f, -109f);
			Image component3 = val3.GetComponent<Image>();
			Image component4 = val2.GetComponent<Image>();
			component3.sprite = component4.sprite;
			component3.type = component4.type;
			((Graphic)component3).color = ((Graphic)component4).color;
			GameObject val4 = new GameObject("PayInvoiceEarly_Text", new Type[3]
			{
				typeof(RectTransform),
				typeof(CanvasRenderer),
				typeof(TextMeshProUGUI)
			});
			val4.transform.SetParent(val3.transform, false);
			RectTransform component5 = val4.GetComponent<RectTransform>();
			component5.anchorMin = Vector2.zero;
			component5.anchorMax = Vector2.one;
			component5.offsetMin = Vector2.zero;
			component5.offsetMax = Vector2.zero;
			TextMeshProUGUI component6 = val4.GetComponent<TextMeshProUGUI>();
			((TMP_Text)component6).text = "Pay Loan Early";
			((TMP_Text)component6).alignment = (TextAlignmentOptions)514;
			((TMP_Text)component6).fontSize = 24f;
			((Graphic)component6).color = Color.black;
			TextMeshProUGUI componentInChildren = val2.GetComponentInChildren<TextMeshProUGUI>();
			((TMP_Text)component6).font = ((TMP_Text)componentInChildren).font;
			((Graphic)component6).material = ((Graphic)componentInChildren).material;
			Button component7 = val3.GetComponent<Button>();
			ButtonClickedEvent onClick = component7.onClick;
			object obj2 = <>c.<>9__6_0;
			if (obj2 == null)
			{
				UnityAction val5 = delegate
				{
					if ((Object)(object)loanSystemInstance != (Object)null && NetworkClient.active)
					{
						loanSystemInstance.CmdPayLoanEarly();
					}
				};
				<>c.<>9__6_0 = val5;
				obj2 = (object)val5;
			}
			((UnityEvent)onClick).AddListener((UnityAction)obj2);
			Button component8 = val2.GetComponent<Button>();
			((Selectable)component7).transition = ((Selectable)component8).transition;
			((Selectable)component7).colors = ((Selectable)component8).colors;
			((Selectable)component7).navigation = ((Selectable)component8).navigation;
			if (!((NetworkBehaviour)GameData.Instance).isServer)
			{
				val3.SetActive(false);
			}
		}

		[HarmonyPatch("Awake")]
		[HarmonyPostfix]
		private static void EnsureLoanSystemComponent(GameData __instance)
		{
			loanSystemInstance = ((Component)__instance).GetComponent<BetterSMTLoanSystem>();
			if ((Object)(object)loanSystemInstance == (Object)null)
			{
				loanSystemInstance = ((Component)__instance).gameObject.AddComponent<BetterSMTLoanSystem>();
			}
		}

		[HarmonyPatch("ServerCalculateNewInflation")]
		[HarmonyPostfix]
		public static void OptimizeP