Decompiled source of BetterSMT v1.9.6

BepInEx/plugins/BetterSMT.dll

Decompiled 7 hours 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 BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using HighlightPlus;
using HutongGames.PlayMaker;
using Microsoft.CodeAnalysis;
using Mirror;
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("1.9.6.0")]
[assembly: AssemblyInformationalVersion("1.9.6+ff786a6163cb93a3881f721608048db8beee5a9f")]
[assembly: AssemblyProduct("BetterSMT")]
[assembly: AssemblyTitle("BetterSMT")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.9.6.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", "1.9.6")]
	public class BetterSMT : BaseUnityPlugin
	{
		private readonly Harmony harmony = new Harmony("BetterSMT");

		public static BetterSMT Instance;

		public static ConfigEntry<int> CustomersPerPerk;

		public static ConfigEntry<int> EmployeesLevel;

		public static ConfigEntry<bool> EmployeesEnabled;

		public static ConfigEntry<float> EmployeeSpeedPerPerk;

		public static ConfigEntry<float> EmployeeRestockPerPerk;

		public static ConfigEntry<float> EmployeeCheckoutPerPerk1;

		public static ConfigEntry<float> EmployeeCheckoutPerPerk2;

		public static ConfigEntry<float> EmployeeCheckoutPerPerk3;

		public static ConfigEntry<float> EmployeExtraCheckoutMoney;

		public static ConfigEntry<float> LightCostMod;

		public static ConfigEntry<float> RentCostMod;

		public static ConfigEntry<float> EmployeeCostMod;

		public static ConfigEntry<bool> OneHitThief;

		public static ConfigEntry<bool> SelfCheckoutTheft;

		public static ConfigEntry<bool> DisableAllThieves;

		public static ConfigEntry<bool> AllNPCAreThieves;

		public static ConfigEntry<bool> FasterCheckout;

		public static ConfigEntry<bool> ShowFPS;

		public static ConfigEntry<bool> ShowPing;

		public static ConfigEntry<bool> DisableTrash;

		public static ConfigEntry<bool> AlwaysDeleteMode;

		public static ConfigEntry<bool> DeleteProduct;

		public static ConfigEntry<bool> DeleteOnlyCheckout;

		public static ConfigEntry<bool> AutoAdjustPriceDaily;

		public static ConfigEntry<float> AutoAdjustPriceDailyValue;

		public static ConfigEntry<bool> DisableBoxCollision;

		public static ConfigEntry<bool> roundDown;

		public static ConfigEntry<bool> NearestFive;

		public static ConfigEntry<bool> NearestTen;

		public static ConfigEntry<bool> RemovePillars;

		public static bool doublePrice = true;

		public static ConfigEntry<bool> ToggleDoublePrice;

		public static ConfigEntry<bool> Highlighting;

		public static ConfigEntry<bool> ThirdPersonToggle;

		public static ConfigEntry<KeyboardShortcut> ThirdPersonHotkey;

		public static ConfigEntry<KeyboardShortcut> KeyboardShortcutDoublePrice;

		public static ConfigEntry<KeyboardShortcut> KeyboardShortcutRoundDownSwitch;

		public static ConfigEntry<KeyboardShortcut> KeyboardShortcutRoundDownToggle;

		public static ConfigEntry<KeyboardShortcut> PricingGunHotkey;

		public static ConfigEntry<bool> PricingGunToggle;

		public static ConfigEntry<KeyboardShortcut> BroomHotkey;

		public static ConfigEntry<bool> BroomToggle;

		public static ConfigEntry<KeyboardShortcut> DLCTabletHotkey;

		public static ConfigEntry<bool> DLCTabletToggle;

		public static ConfigEntry<KeyboardShortcut> EmptyHandsHotkey;

		public static ConfigEntry<KeyboardShortcut> PhoneHotkey;

		public static ConfigEntry<bool> PhoneToggle;

		public static bool notify = false;

		public static string notificationType;

		public static ConfigEntry<int> SelfCheckoutLimit;

		public static ConfigEntry<bool> TooExpensive;

		public static ConfigEntry<bool> MissingProduct;

		public static ConfigEntry<int> MaxBoxSize;

		public static ConfigEntry<bool> BoxCollision;

		public static ConfigEntry<bool> FastBoxSpawns;

		internal static ManualLogSource Logger { get; private set; } = null;


		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_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Expected O, but got Unknown
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Expected O, but got Unknown
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Expected O, but got Unknown
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: Expected O, but got Unknown
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: Expected O, but got Unknown
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0134: Expected O, but got Unknown
			//IL_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_015f: Expected O, but got Unknown
			//IL_0180: Unknown result type (might be due to invalid IL or missing references)
			//IL_018a: Expected O, but got Unknown
			//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b5: Expected O, but got Unknown
			//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e0: Expected O, but got Unknown
			//IL_01fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_020c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0216: Expected O, but got Unknown
			//IL_0237: Unknown result type (might be due to invalid IL or missing references)
			//IL_0241: Expected O, but got Unknown
			//IL_025d: Unknown result type (might be due to invalid IL or missing references)
			//IL_026d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0277: Expected O, but got Unknown
			//IL_0298: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a2: Expected O, but got Unknown
			//IL_02c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cd: Expected O, but got Unknown
			//IL_02e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0303: Expected O, but got Unknown
			//IL_031f: Unknown result type (might be due to invalid IL or missing references)
			//IL_032f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0339: Expected O, but got Unknown
			//IL_0355: Unknown result type (might be due to invalid IL or missing references)
			//IL_0365: Unknown result type (might be due to invalid IL or missing references)
			//IL_036f: Expected O, but got Unknown
			//IL_038b: Unknown result type (might be due to invalid IL or missing references)
			//IL_039b: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a5: Expected O, but got Unknown
			//IL_03c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d0: Expected O, but got Unknown
			//IL_03f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_03fb: Expected O, but got Unknown
			//IL_041c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0426: Expected O, but got Unknown
			//IL_044b: Unknown result type (might be due to invalid IL or missing references)
			//IL_045b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0465: Expected O, but got Unknown
			//IL_0492: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ac: Expected O, but got Unknown
			//IL_04d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_04de: Expected O, but got Unknown
			//IL_04ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0509: Expected O, but got Unknown
			//IL_0531: Unknown result type (might be due to invalid IL or missing references)
			//IL_053b: Expected O, but got Unknown
			//IL_0563: Unknown result type (might be due to invalid IL or missing references)
			//IL_056d: Expected O, but got Unknown
			//IL_05a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_05aa: Expected O, but got Unknown
			//IL_05dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e7: Expected O, but got Unknown
			//IL_061a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0624: Expected O, but got Unknown
			//IL_0645: Unknown result type (might be due to invalid IL or missing references)
			//IL_064f: Expected O, but got Unknown
			//IL_0670: Unknown result type (might be due to invalid IL or missing references)
			//IL_067a: Expected O, but got Unknown
			//IL_06ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_06b7: Expected O, but got Unknown
			//IL_06d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e2: Expected O, but got Unknown
			//IL_0703: Unknown result type (might be due to invalid IL or missing references)
			//IL_070d: Expected O, but got Unknown
			//IL_072e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0738: Expected O, but got Unknown
			//IL_076b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0775: Expected O, but got Unknown
			//IL_07a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_07b2: Expected O, but got Unknown
			//IL_07e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ef: Expected O, but got Unknown
			//IL_0822: Unknown result type (might be due to invalid IL or missing references)
			//IL_082c: Expected O, but got Unknown
			//IL_085f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0869: Expected O, but got Unknown
			//IL_089c: Unknown result type (might be due to invalid IL or missing references)
			//IL_08a6: Expected O, but got Unknown
			//IL_08ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_08d8: Expected O, but got Unknown
			//IL_08f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0903: Expected O, but got Unknown
			//IL_0924: Unknown result type (might be due to invalid IL or missing references)
			//IL_092e: Expected O, but got Unknown
			//IL_094f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0959: Expected O, but got Unknown
			//IL_097a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0984: Expected O, but got Unknown
			DeleteOnlyCheckout = ((BaseUnityPlugin)this).Config.Bind<bool>("Building", "Enable or disable deleting all checkout lanes", false, new ConfigDescription("Adds the ability to delete every checkout lane", (AcceptableValueBase)null, Array.Empty<object>()));
			BoxCollision = ((BaseUnityPlugin)this).Config.Bind<bool>("Boxes", "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>("Boxes", "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>()));
			MissingProduct = ((BaseUnityPlugin)this).Config.Bind<bool>("Notifications", "Enable or disable notification Missing Product", false, new ConfigDescription("Enables or disables the notification for missing products", (AcceptableValueBase)null, Array.Empty<object>()));
			TooExpensive = ((BaseUnityPlugin)this).Config.Bind<bool>("Notifications", "Enable or disable notification Too Expensive", false, new ConfigDescription("Enables or disables the notification for too expensive products", (AcceptableValueBase)null, Array.Empty<object>()));
			ThirdPersonHotkey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Third Person", "Third Person Hotkey", new KeyboardShortcut((KeyCode)103, Array.Empty<KeyCode>()), new ConfigDescription("Hotkey to enter and leave third person/first person.", (AcceptableValueBase)null, Array.Empty<object>()));
			ThirdPersonToggle = ((BaseUnityPlugin)this).Config.Bind<bool>("Third Person", "Enable or disable third person", false, new ConfigDescription("Enables or disables the hotkey to enter and leave third person/first person", (AcceptableValueBase)null, Array.Empty<object>()));
			ToggleDoublePrice = ((BaseUnityPlugin)this).Config.Bind<bool>("Double Price", "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>()));
			Highlighting = ((BaseUnityPlugin)this).Config.Bind<bool>("Misc", "Enable or disable highlighting", false, new ConfigDescription("Enables or disables highlighting of product and storage shelves when holding a box", (AcceptableValueBase)null, Array.Empty<object>()));
			RemovePillars = ((BaseUnityPlugin)this).Config.Bind<bool>("Utility", "Removes Pillars & Beams", false, new ConfigDescription("Removes most of the pillars & beams from the main portion of the store. **Be warned** camera UI does glitch out when standing where a pillar would usually go. For an idea what this does, check this link: https://i.imgur.com/OBeBj5i.jpeg", (AcceptableValueBase)null, Array.Empty<object>()));
			PricingGunToggle = ((BaseUnityPlugin)this).Config.Bind<bool>("Utility", "Pricing Gun Toggle", false, new ConfigDescription("Enables the hotkey to activate Pricing Gun", (AcceptableValueBase)null, Array.Empty<object>()));
			PricingGunHotkey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Utility", "Pricing Gun Hotkey", new KeyboardShortcut((KeyCode)121, Array.Empty<KeyCode>()), new ConfigDescription("Hotkey to spawn a Pricing Gun in your hands.", (AcceptableValueBase)null, Array.Empty<object>()));
			BroomToggle = ((BaseUnityPlugin)this).Config.Bind<bool>("Utility", "Broom Toggle", false, new ConfigDescription("Enables the hotkey to activate Broom", (AcceptableValueBase)null, Array.Empty<object>()));
			BroomHotkey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Utility", "Broom Hotkey", new KeyboardShortcut((KeyCode)117, Array.Empty<KeyCode>()), new ConfigDescription("Hotkey to spawn a Broom in your hands.", (AcceptableValueBase)null, Array.Empty<object>()));
			PhoneToggle = ((BaseUnityPlugin)this).Config.Bind<bool>("Utility", "Ordering Phone TOggle", false, new ConfigDescription("Enables the hotkey to activate Ordering Phone", (AcceptableValueBase)null, Array.Empty<object>()));
			DLCTabletToggle = ((BaseUnityPlugin)this).Config.Bind<bool>("Utility", "DLC Tablet Toggle", false, new ConfigDescription("Enables the hotkey to activate DLC Tablet", (AcceptableValueBase)null, Array.Empty<object>()));
			DLCTabletHotkey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Utility", "DLC Tablet Hotkey", new KeyboardShortcut((KeyCode)105, Array.Empty<KeyCode>()), new ConfigDescription("Hotkey to spawn a DLC Tablet in your hands.", (AcceptableValueBase)null, Array.Empty<object>()));
			PhoneHotkey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Utility", "Ordering Phone Hotkey", new KeyboardShortcut((KeyCode)104, Array.Empty<KeyCode>()), new ConfigDescription("Hotkey to spawn a Ordering Phone in your hands.", (AcceptableValueBase)null, Array.Empty<object>()));
			EmptyHandsHotkey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Utility", "Empty Hands Hotkey", new KeyboardShortcut((KeyCode)114, Array.Empty<KeyCode>()), new ConfigDescription("Hotkey to remove active item in your hand.", (AcceptableValueBase)null, Array.Empty<object>()));
			KeyboardShortcutDoublePrice = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Double Price", "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", "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", "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", "Enable rounding down to nearest 0.10", false, new ConfigDescription("Enable rounding down to the nearest tenth", (AcceptableValueBase)null, Array.Empty<object>()));
			KeyboardShortcutRoundDownSwitch = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Double Price", "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>()));
			KeyboardShortcutRoundDownToggle = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Double Price", "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>()));
			EmployeesLevel = ((BaseUnityPlugin)this).Config.Bind<int>("Employees", "Employees Level", 0, new ConfigDescription("Adjust the level of employee's that spawn (1 sets all of their stats to minimum, 11 sets them all to max)", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 11), Array.Empty<object>()));
			EmployeesEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Employees", "Employees Level Toggle", false, new ConfigDescription("Enables modifying employee levels", (AcceptableValueBase)null, Array.Empty<object>()));
			SelfCheckoutLimit = ((BaseUnityPlugin)this).Config.Bind<int>("Self-Checkout", "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>("Boxes", "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, 25), Array.Empty<object>()));
			EmployeeSpeedPerPerk = ((BaseUnityPlugin)this).Config.Bind<float>("Employees", "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.2f, 3f), Array.Empty<object>()));
			EmployeeRestockPerPerk = ((BaseUnityPlugin)this).Config.Bind<float>("Employees", "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.1f), Array.Empty<object>()));
			LightCostMod = ((BaseUnityPlugin)this).Config.Bind<float>("Immersion", "Adjust the cost of Lights at the end of the day", 10f, new ConfigDescription("Adjust the cost of lights at the end of the day (Higher = more expensive)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 50f), Array.Empty<object>()));
			AllNPCAreThieves = ((BaseUnityPlugin)this).Config.Bind<bool>("Thieves", "All Thieves", false, new ConfigDescription("Causes every NPC to be a thief", (AcceptableValueBase)null, Array.Empty<object>()));
			AutoAdjustPriceDaily = ((BaseUnityPlugin)this).Config.Bind<bool>("QoL", "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>("QoL", "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>()));
			SelfCheckoutTheft = ((BaseUnityPlugin)this).Config.Bind<bool>("Self-Checkout", "Self-Checkout Theft", true, new ConfigDescription("Enables or disables default game's theft from self checkout", (AcceptableValueBase)null, Array.Empty<object>()));
			DisableTrash = ((BaseUnityPlugin)this).Config.Bind<bool>("Trash", "Despawns trash", false, new ConfigDescription("Despawns all trash at the end of the day", (AcceptableValueBase)null, Array.Empty<object>()));
			DisableAllThieves = ((BaseUnityPlugin)this).Config.Bind<bool>("Thieves", "Disable Thieves", false, new ConfigDescription("Prevent thieves from spawning (Does not stop checkout-related thieves)", (AcceptableValueBase)null, Array.Empty<object>()));
			EmployeeCostMod = ((BaseUnityPlugin)this).Config.Bind<float>("Immersion", "Adjust the cost of Employee at the end of the day", 10f, new ConfigDescription("Adjust the cost of Employee at the end of the day (Higher = more expensive)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 50f), Array.Empty<object>()));
			RentCostMod = ((BaseUnityPlugin)this).Config.Bind<float>("Immersion", "Adjust the cost of Rent at the end of the day", 10f, new ConfigDescription("Adjust the cost of Rent at the end of the day (Higher = more expensive)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 50f), Array.Empty<object>()));
			EmployeExtraCheckoutMoney = ((BaseUnityPlugin)this).Config.Bind<float>("Employees", "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.25f), Array.Empty<object>()));
			EmployeeCheckoutPerPerk1 = ((BaseUnityPlugin)this).Config.Bind<float>("Employees", "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.25f), Array.Empty<object>()));
			EmployeeCheckoutPerPerk2 = ((BaseUnityPlugin)this).Config.Bind<float>("Employees", "Employee Checkout Time Reduction Perk 2", 0.2f, new ConfigDescription("Adjust the amount of time employees wait to scan items in checkout (Perk 2) (Lower = slower)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.01f, 0.25f), Array.Empty<object>()));
			EmployeeCheckoutPerPerk3 = ((BaseUnityPlugin)this).Config.Bind<float>("Employees", "Employee Checkout Time Reduction Perk 3", 0.15f, new ConfigDescription("Adjust the amount of time employees wait to scan items in checkout (Perk 3) (Lower = slower)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.01f, 0.25f), Array.Empty<object>()));
			CustomersPerPerk = ((BaseUnityPlugin)this).Config.Bind<int>("Customers", "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, 100), Array.Empty<object>()));
			AlwaysDeleteMode = ((BaseUnityPlugin)this).Config.Bind<bool>("Building", "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>()));
			DeleteProduct = ((BaseUnityPlugin)this).Config.Bind<bool>("Building", "Delete shelves with product", false, new ConfigDescription("***WARNING*** THIS WILL ALLOW YOU TO DELETE SHELVES WITH PRODUCT. THIS WILL NOT REFUND MONEY.", (AcceptableValueBase)null, Array.Empty<object>()));
			OneHitThief = ((BaseUnityPlugin)this).Config.Bind<bool>("Thieves", "Thiefs Drop Everything On Hit", false, new ConfigDescription("Thiefs Drop Everything On Hit", (AcceptableValueBase)null, Array.Empty<object>()));
			FasterCheckout = ((BaseUnityPlugin)this).Config.Bind<bool>("Customers", "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>("Other", "Show FPS Counter", false, (ConfigDescription)null);
			ShowPing = ((BaseUnityPlugin)this).Config.Bind<bool>("Other", "Show Ping Counter", false, (ConfigDescription)null);
			Instance = this;
			Logger = ((BaseUnityPlugin)this).Logger;
			harmony.PatchAll();
			Logger.LogInfo((object)"Plugin BetterSMT v1.9.6 is loaded!");
		}

		public static void CreateCanvasNotification(string text)
		{
			GameObject val = Object.Instantiate<GameObject>(GameCanvas.Instance.notificationPrefab, GameCanvas.Instance.notificationParentTransform);
			((TMP_Text)val.GetComponent<TextMeshProUGUI>()).text = text;
			val.SetActive(true);
		}

		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);
		}

		private void Update()
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			if (!ToggleDoublePrice.Value)
			{
				return;
			}
			KeyboardShortcut value = KeyboardShortcutDoublePrice.Value;
			if (((KeyboardShortcut)(ref value)).IsDown())
			{
				doublePrice = !doublePrice;
				notificationType = "priceToggle";
				notify = true;
				return;
			}
			value = KeyboardShortcutRoundDownSwitch.Value;
			if (((KeyboardShortcut)(ref value)).IsDown())
			{
				if (NearestTen.Value)
				{
					NearestTen.Value = false;
					NearestFive.Value = true;
				}
				else
				{
					NearestTen.Value = true;
					NearestFive.Value = false;
				}
				notificationType = "roundDownSwitch";
				notify = true;
			}
			else
			{
				value = KeyboardShortcutRoundDownToggle.Value;
				if (((KeyboardShortcut)(ref value)).IsDown())
				{
					roundDown.Value = !roundDown.Value;
					notificationType = "roundDownToggle";
					notify = true;
				}
			}
		}

		private void ConfigSettingChanged(object sender, EventArgs e)
		{
			if (NearestFive.Value && NearestTen.Value && NearestFive.Value)
			{
				NearestTen.Value = false;
			}
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "BetterSMT";

		public const string PLUGIN_NAME = "BetterSMT";

		public const string PLUGIN_VERSION = "1.9.6";
	}
}
namespace BetterSMT.Patches
{
	[HarmonyPatch(typeof(BoxData))]
	public static class BoxDataPatch
	{
		public static int InitialLayer = -1;

		[HarmonyPostfix]
		[HarmonyPatch("OnStartClient")]
		public static void OnStartClientPostfix(BoxData __instance)
		{
			if (BetterSMT.BoxCollision.Value && !((Object)(object)__instance == (Object)null) && !((Object)(object)((Component)__instance).gameObject == (Object)null))
			{
				if (InitialLayer == -1)
				{
					InitialLayer = ((Component)__instance).gameObject.layer;
				}
				((Component)__instance).gameObject.layer = 20;
				Physics.IgnoreLayerCollision(20, 20, true);
			}
		}
	}
	[HarmonyPatch(typeof(Builder_Main))]
	public class Builder_MainPatch
	{
		[HarmonyPatch("DeleteBehaviour")]
		[HarmonyPrefix]
		private static bool DeleteBehaviourPatch(Builder_Main __instance)
		{
			return DeleteWheneverPatch(__instance);
		}

		public static bool DeleteWheneverPatch(Builder_Main __instance)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_030e: Unknown result type (might be due to invalid IL or missing references)
			//IL_031b: Unknown result type (might be due to invalid IL or missing references)
			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.AlwaysDeleteMode.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 (!BetterSMT.DeleteOnlyCheckout.Value && __instance.FurnitureContainsProduct(((RaycastHit)(ref val)).transform))
						{
							GameCanvas.Instance.CreateCanvasNotification("message17");
							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 ((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 * 0.9f;
							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;
					return 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);
					}
					__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;
		}
	}
	[HarmonyPatch(typeof(CustomCameraController), "LateUpdate")]
	public class LateUpdateRaycastPatch
	{
		private static bool isThirdPersonEnabled;

		private static void Postfix(CustomCameraController __instance)
		{
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			if (FsmVariables.GlobalVariables.GetFsmBool("InChat").Value || !BetterSMT.ThirdPersonToggle.Value || (Object)(object)__instance == (Object)null || __instance.inVehicle || __instance.isInCameraEvent)
			{
				return;
			}
			KeyboardShortcut value = BetterSMT.ThirdPersonHotkey.Value;
			if (((KeyboardShortcut)(ref value)).IsDown())
			{
				isThirdPersonEnabled = !isThirdPersonEnabled;
			}
			if (isThirdPersonEnabled)
			{
				__instance.inEmoteEvent = true;
				if ((Object)(object)__instance.thirdPersonFollow != (Object)null)
				{
					__instance.thirdPersonFollow.CameraDistance = 2f;
					__instance.thirdPersonFollow.CameraCollisionFilter = __instance.thirdPersonDefaultLayerMask;
				}
				__instance.ShowCharacter(true);
			}
			else
			{
				__instance.inEmoteEvent = false;
				if ((Object)(object)__instance.thirdPersonFollow != (Object)null)
				{
					__instance.thirdPersonFollow.CameraDistance = 0f;
					__instance.thirdPersonFollow.CameraCollisionFilter = LayerMask.op_Implicit(0);
				}
				__instance.ShowCharacter(false);
			}
		}
	}
	[HarmonyPatch(typeof(EmployeesDataGeneration))]
	public class EmployeesDataGenerationPatch
	{
		[HarmonyPatch("GenerateTodayEmployeesData")]
		[HarmonyPostfix]
		private static void GenerateTodayEmployeesDataPatch(EmployeesDataGeneration __instance)
		{
			EmployeeLevelPatch(__instance);
		}

		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 num4;
				int num5;
				int num6;
				int num7;
				if (i == num)
				{
					num4 = Random.Range(6, 11);
					num5 = Random.Range(7, 11);
					num6 = Random.Range(6, 11);
					num7 = Random.Range(7, 11);
				}
				else if (i == num2)
				{
					num4 = Random.Range(5, 11);
					num5 = Random.Range(4, 11);
					num6 = Random.Range(5, 11);
					num7 = Random.Range(4, 11);
				}
				else
				{
					num4 = Random.Range(1, 11);
					num5 = Random.Range(1, 11);
					num6 = Random.Range(1, 11);
					num7 = Random.Range(1, 11);
				}
				if (BetterSMT.EmployeesEnabled.Value)
				{
					num4 = BetterSMT.EmployeesLevel.Value;
					num5 = BetterSMT.EmployeesLevel.Value;
					num6 = BetterSMT.EmployeesLevel.Value;
					num7 = BetterSMT.EmployeesLevel.Value;
				}
				int num8 = (num4 + num5 + num6 + num7) * Random.Range(3, 6) + Random.Range(-2, 3) * 10;
				num8 = Mathf.Clamp(num8, 30, 1000);
				string text = num3 + "|" + num8 + "|" + num4 + "|" + num5 + "|" + num6 + "|" + num7;
				__instance.managerComponent.todaysEmployeesData[i] = text;
				__instance.managerComponent.UpdateTodayEmployeesOnClients(i, text);
			}
		}
	}
	[HarmonyPatch(typeof(GameData), "WorkingDayControl")]
	public class GameDataPatch
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static UnityAction <>9__6_0;

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

		[HarmonyPatch(typeof(GameData), "ServerCalculateNewInflation")]
		[HarmonyPostfix]
		private static void OptimizePricesDaily()
		{
			OptimizeProductPrices();
		}

		[HarmonyPatch("OnStartClient")]
		[HarmonyPostfix]
		private static void OnStartClientPatch()
		{
			ShowCounters();
			UpdateEscapeMenu();
		}

		[HarmonyPatch("WorkingDayControl")]
		[HarmonyPostfix]
		private static void WorkingDayControlPatch(GameData __instance)
		{
			WorkingDayLightControlPatch(__instance);
			WorkingDayEmployeeControlPatch(__instance);
			WorkingDayRentControlPatch(__instance);
		}

		[HarmonyPatch("TrashManager")]
		[HarmonyPostfix]
		private static void TrashManagerPatch(GameData __instance)
		{
			NextTimeToSpawnTrashPatch(__instance);
		}

		[HarmonyPatch("UserCode_CmdOpenSupermarket")]
		[HarmonyPostfix]
		private static void UserCode_CmdOpenSupermarketPatch(GameData __instance)
		{
			MaxCustomersNPCsPatch(__instance);
		}

		public static void OptimizeProductPrices()
		{
			if (!BetterSMT.AutoAdjustPriceDaily.Value)
			{
				return;
			}
			GameObject[] productPrefabs = ProductListing.Instance.productPrefabs;
			ProductListing instance = ProductListing.Instance;
			List<float> list = new List<float>();
			for (int i = 0; i < productPrefabs.Length; i++)
			{
				if (i < productPrefabs.Length)
				{
					Data_Product component = productPrefabs[i].GetComponent<Data_Product>();
					list.Add(component.basePricePerUnit);
				}
			}
			float[] array = list.ToArray();
			float[] tierInflation = instance.tierInflation;
			float value = BetterSMT.AutoAdjustPriceDailyValue.Value;
			for (int j = 0; j < array.Length; j++)
			{
				Data_Product component2 = productPrefabs[j].GetComponent<Data_Product>();
				float num = array[j] * tierInflation[component2.productTier] * value;
				float num2 = Mathf.Floor(num * 100f) / 100f;
				instance.CmdUpdateProductPrice(j, num2);
			}
		}

		private static void UpdateEscapeMenu()
		{
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_010c: Unknown result type (might be due to invalid IL or missing references)
			//IL_012d: Unknown result type (might be due to invalid IL or missing references)
			//IL_016e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: Unknown result type (might be due to invalid IL or missing references)
			//IL_0179: Expected O, but got Unknown
			GameObject val = GameObject.Find("MasterOBJ/MasterCanvas/Menus/EscapeMenu/");
			GameObject gameObject = ((Component)val.transform.Find("OptionsButton")).gameObject;
			GameObject gameObject2 = ((Component)val.transform.Find("QuitButton")).gameObject;
			gameObject2.transform.localPosition = new Vector3(0f, 0f, 0f);
			GameObject gameObject3 = ((Component)val.transform.Find("MainMenuButton")).gameObject;
			gameObject3.transform.localPosition = new Vector3(0f, 85f, 0f);
			GameObject val2 = Object.Instantiate<GameObject>(gameObject2, val.transform);
			((Object)val2).name = "SaveButton";
			PlayMakerFSM[] components = val2.GetComponents<PlayMakerFSM>();
			components.ToList().ForEach((Action<PlayMakerFSM>)Object.Destroy);
			Object.Destroy((Object)(object)val2.GetComponent<EventTrigger>());
			val2.transform.position = gameObject2.transform.position;
			val2.transform.localScale = gameObject2.transform.localScale;
			val2.transform.localPosition = new Vector3(0f, -85f, 0f);
			((TMP_Text)val2.GetComponentInChildren<TextMeshProUGUI>()).text = "Save Game";
			Button component = val2.GetComponent<Button>();
			ButtonClickedEvent onClick = component.onClick;
			object obj = <>c.<>9__6_0;
			if (obj == null)
			{
				UnityAction val3 = delegate
				{
					((MonoBehaviour)GameData.Instance).StartCoroutine(SaveGame());
				};
				<>c.<>9__6_0 = val3;
				obj = (object)val3;
			}
			((UnityEvent)onClick).AddListener((UnityAction)obj);
			if (!((NetworkBehaviour)GameData.Instance).isServer)
			{
				val2.SetActive(false);
			}
		}

		public static IEnumerator SaveGame()
		{
			NetworkSpawner nSpawnerComponent = ((Component)GameData.Instance).GetComponent<NetworkSpawner>();
			if (!nSpawnerComponent.isSaving)
			{
				BetterSMT.CreateImportantNotification("Saving Game");
				GameData.Instance.DoDaySaveBackup();
				GameData.Instance.DoDaySaveBackup();
				PlayMakerFSM fsm = GameData.Instance.SaveOBJ.GetComponent<PlayMakerFSM>();
				fsm.FsmVariables.GetFsmBool("IsSaving").Value = true;
				fsm.SendEvent("Send_Data");
				while (fsm.FsmVariables.GetFsmBool("IsSaving").Value)
				{
					yield return null;
				}
				yield return nSpawnerComponent.SavePropsCoroutine();
				BetterSMT.CreateImportantNotification("Saving Finished");
			}
			else
			{
				BetterSMT.CreateImportantNotification("Saving already in progress");
			}
		}

		public static void ShowCounters()
		{
			if (BetterSMT.ShowPing.Value)
			{
				GameObject val = GameObject.Find("MasterOBJ/MasterCanvas/Ping");
				if ((Object)(object)val == (Object)null)
				{
					BetterSMT.Logger.LogWarning((object)"Couldnt find Ping object");
					return;
				}
				val.SetActive(true);
			}
			if (BetterSMT.ShowFPS.Value)
			{
				GameObject val2 = GameObject.Find("MasterOBJ/MasterCanvas/FPSDisplay");
				if ((Object)(object)val2 == (Object)null)
				{
					BetterSMT.Logger.LogWarning((object)"Couldnt find FPSDisplay object");
				}
				else
				{
					val2.SetActive(true);
				}
			}
		}

		public static void WorkingDayLightControlPatch(GameData __instance)
		{
			UpgradesManager component = ((Component)__instance).GetComponent<UpgradesManager>();
			if ((Object)(object)component != (Object)null)
			{
				float lightCost = BetterSMT.LightCostMod.Value + (float)component.spaceBought + (float)component.storageBought;
				__instance.lightCost = lightCost;
			}
			else
			{
				__instance.lightCost = 10f + (float)component.spaceBought + (float)component.storageBought;
			}
		}

		public static void MaxCustomersNPCsPatch(GameData __instance)
		{
			if (((Component)__instance).GetComponent<NetworkSpawner>().levelPropsOBJ.transform.GetChild(2).childCount == 0)
			{
				__instance.RpcNoCheckoutsMessage();
			}
			else if (!__instance.isSupermarketOpen || __instance.timeOfDay > 23f || __instance.timeOfDay < 8f)
			{
				__instance.NetworkisSupermarketOpen = true;
				__instance.timeFactor = 1f;
				__instance.maxProductsCustomersToBuy = 5 + __instance.gameDay / 2 + NetworkServer.connections.Count + __instance.difficulty;
				__instance.maxProductsCustomersToBuy = Mathf.Clamp(__instance.maxProductsCustomersToBuy, 5, 25 + NetworkServer.connections.Count + __instance.difficulty);
				__instance.maxCustomersNPCs = 3 + __instance.gameDay + (NetworkServer.connections.Count - 1) * 4 + __instance.extraCustomersPerk + __instance.difficulty * 2;
				__instance.maxCustomersNPCs = Mathf.Clamp(__instance.maxCustomersNPCs, 160, 700 + NetworkServer.connections.Count);
				__instance.RpcOpenSupermarket();
			}
		}

		public static void NextTimeToSpawnTrashPatch(GameData __instance)
		{
			if (BetterSMT.DisableTrash.Value)
			{
				__instance.nextTimeToSpawnTrash = 99999f;
			}
		}

		public static void WorkingDayRentControlPatch(GameData __instance)
		{
			UpgradesManager component = ((Component)__instance).GetComponent<UpgradesManager>();
			if ((Object)(object)component != (Object)null)
			{
				float rentCost = BetterSMT.RentCostMod.Value + (float)(component.spaceBought * 5) + (float)(component.storageBought * 10);
				__instance.rentCost = rentCost;
			}
			else
			{
				__instance.rentCost = 10f + (float)(component.spaceBought * 5) + (float)(component.storageBought * 10);
			}
		}

		public static void WorkingDayEmployeeControlPatch(GameData __instance)
		{
			UpgradesManager component = ((Component)__instance).GetComponent<UpgradesManager>();
			if ((Object)(object)component != (Object)null)
			{
				float employeesCost = BetterSMT.EmployeeCostMod.Value + (float)(NPC_Manager.Instance.maxEmployees * 60);
				__instance.employeesCost = employeesCost;
			}
			else
			{
				__instance.employeesCost = NPC_Manager.Instance.maxEmployees * 60;
			}
		}
	}
	[HarmonyPatch(typeof(LocalizationManager))]
	internal class LocalizationHandler
	{
		[HarmonyPatch("GetLocalizationString")]
		[HarmonyPrefix]
		public static bool NoLocalization_Prefix(ref string key, ref string __result)
		{
			if (key[0] == '`')
			{
				string text = key;
				__result = text.Substring(1, text.Length - 1);
				return false;
			}
			return true;
		}
	}
	[HarmonyPatch(typeof(ManagerBlackboard))]
	public class RemoveBoxSpawnTimePatch
	{
		[HarmonyPatch("ServerCargoSpawner")]
		[HarmonyPrefix]
		private static bool InstantCargoSpawner(ManagerBlackboard __instance, ref IEnumerator __result)
		{
			__result = CustomCargoSpawner(__instance);
			return false;
		}

		private static IEnumerator CustomCargoSpawner(ManagerBlackboard instance)
		{
			instance.isSpawning = true;
			new Vector3(0.3f, 0.3f, 0.45f);
			WaitForSeconds waitTime1;
			WaitForSeconds waitTime2;
			if (BetterSMT.FastBoxSpawns.Value)
			{
				waitTime1 = new WaitForSeconds(0.01f);
				waitTime2 = new WaitForSeconds(0.01f);
			}
			else
			{
				waitTime1 = new WaitForSeconds(0.5f);
				waitTime2 = new WaitForSeconds(0.2f);
			}
			while (instance.idsToSpawn.Count > 0)
			{
				Vector3 spawnPosition = instance.merchandiseSpawnpoint.transform.position + new Vector3(Random.Range(-2f, 2f), 0f, Random.Range(-2f, 2f));
				yield return waitTime1;
				int num = instance.idsToSpawn[0];
				GameObject gameObject = Object.Instantiate<GameObject>(instance.boxPrefab, spawnPosition, Quaternion.identity);
				gameObject.GetComponent<BoxData>().NetworkproductID = num;
				int maxItemsPerBox = ((Component)instance).GetComponent<ProductListing>().productPrefabs[num].GetComponent<Data_Product>().maxItemsPerBox;
				gameObject.GetComponent<BoxData>().NetworknumberOfProducts = maxItemsPerBox;
				Sprite sprite = ((Component)instance).GetComponent<ProductListing>().productSprites[num];
				((Component)gameObject.transform.Find("Canvas/Image1")).GetComponent<Image>().sprite = sprite;
				((Component)gameObject.transform.Find("Canvas/Image2")).GetComponent<Image>().sprite = sprite;
				gameObject.transform.SetParent(instance.boxParent);
				NetworkServer.Spawn(gameObject, (NetworkConnection)null);
				instance.RpcParentBoxOnClient(gameObject);
				instance.idsToSpawn.RemoveAt(0);
			}
			yield return waitTime2;
			instance.isSpawning = false;
		}
	}
	[HarmonyPatch(typeof(GameCanvas))]
	internal class NotificationHandler
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		public static void NotificationHandler_Postfix(GameCanvas __instance, ref bool ___inCooldown)
		{
			if (BetterSMT.ToggleDoublePrice.Value && BetterSMT.notify)
			{
				___inCooldown = false;
				BetterSMT.notify = false;
				string text = "`";
				switch (BetterSMT.notificationType)
				{
				case "priceToggle":
					text = text + "Double Price: " + (BetterSMT.doublePrice ? "ON" : "OFF");
					break;
				case "roundDownSwitch":
					text = text + "Rounding to nearest " + (BetterSMT.NearestTen.Value ? "ten" : "five") + ((!BetterSMT.roundDown.Value) ? "\r\n(Currently disabled)" : "");
					break;
				case "roundDownToggle":
					text = text + "Rounding has been " + (BetterSMT.roundDown.Value ? "enabled" : "disabled");
					break;
				}
				__instance.CreateCanvasNotification(text);
			}
		}
	}
	[HarmonyPatch(typeof(NPC_Info))]
	public class NPC_InfoPatch
	{
		[HarmonyPatch(typeof(NPC_Info))]
		public class DisableThievesPatch
		{
			[HarmonyPatch("CreateNPCCharacter")]
			[HarmonyPostfix]
			private static void MakeNPCsThieves(ref bool ___isAThief)
			{
				___isAThief = BetterSMT.AllNPCAreThieves.Value || (!BetterSMT.DisableAllThieves.Value & ___isAThief);
			}
		}

		[HarmonyPatch("PlaceProducts")]
		[HarmonyPrefix]
		private static void PlaceProductsPatch(NPC_Info __instance)
		{
			__instance.productItemPlaceWait = (BetterSMT.FasterCheckout.Value ? 0f : 0.5f);
		}

		[HarmonyPatch("AuxiliarAnimationPlay")]
		[HarmonyPrefix]
		private static bool AuxiliarAnimationPlayPatch(NPC_Info __instance, ref int animationIndex)
		{
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			if (!BetterSMT.OneHitThief.Value)
			{
				return true;
			}
			if (!__instance.beingPushed)
			{
				((MonoBehaviour)__instance).StartCoroutine(__instance.StopSpeed());
			}
			if (__instance.isAThief && __instance.productsIDCarrying.Count > 0)
			{
				int count = __instance.productsIDCarrying.Count;
				for (int i = 0; i < count; i++)
				{
					GameObject val = Object.Instantiate<GameObject>(__instance.stolenProductPrefab, NPC_Manager.Instance.droppedProductsParentOBJ.transform);
					val.transform.position = ((Component)__instance).transform.position + new Vector3(Random.Range(-0.4f, 0.4f), 0f, Random.Range(-0.4f, 0.4f));
					val.GetComponent<StolenProductSpawn>().NetworkproductID = __instance.productsIDCarrying[0];
					val.GetComponent<StolenProductSpawn>().NetworkproductCarryingPrice = __instance.productsCarryingPrice[0] * 0.8f;
					NetworkServer.Spawn(val, (NetworkConnection)null);
					__instance.productsIDCarrying.RemoveAt(0);
					__instance.productsCarryingPrice.RemoveAt(0);
				}
			}
			if (__instance.isAThief && __instance.productsIDCarrying.Count == 0 && Object.op_Implicit((Object)(object)((Component)((Component)__instance).transform.Find("ThiefCanvas")).gameObject) && ((Component)((Component)__instance).transform.Find("ThiefCanvas")).gameObject.activeSelf)
			{
				__instance.RpcHideThief();
			}
			int num = Random.Range(0, 9);
			__instance.RpcAnimationPlay(animationIndex);
			__instance.RPCNotificationAboveHead("NPCmessagehit" + num, "");
			return false;
		}
	}
	[HarmonyPatch(typeof(NPC_Manager))]
	public class NPC_ManagerPatch
	{
		[HarmonyPatch("GetAvailableSelfCheckout")]
		[HarmonyPostfix]
		private static void GetAvailableSelfCheckoutPatch(NPC_Info npcInfo, NPC_Manager __instance)
		{
			SelfCheckoutPatch(npcInfo, __instance);
		}

		[HarmonyPatch("CustomerNPCControl")]
		[HarmonyPostfix]
		private static void CustomerNPCControlPatch(NPC_Manager __instance, int NPCIndex)
		{
			TooExpensiveChatPatch(__instance, NPCIndex);
		}

		public static void TooExpensiveChatPatch(NPC_Manager __instance, int NPCIndex)
		{
			//IL_1018: Unknown result type (might be due to invalid IL or missing references)
			//IL_101d: Unknown result type (might be due to invalid IL or missing references)
			//IL_1176: Unknown result type (might be due to invalid IL or missing references)
			//IL_117b: Unknown result type (might be due to invalid IL or missing references)
			//IL_117f: Unknown result type (might be due to invalid IL or missing references)
			if (!BetterSMT.TooExpensive.Value && !BetterSMT.MissingProduct.Value)
			{
				return;
			}
			Dictionary<int, string> dictionary = 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, "Potatoe 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 Potatoe Pos" },
				{ 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" },
				{ 231, "Red Tea" },
				{ 232, "Lemon Tea" },
				{ 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" }
			};
			GameObject gameObject = ((Component)__instance.customersnpcParentOBJ.transform.GetChild(NPCIndex)).gameObject;
			NPC_Info component = gameObject.GetComponent<NPC_Info>();
			int state = component.state;
			NavMeshAgent component2 = gameObject.GetComponent<NavMeshAgent>();
			if (state == -1 || component2.pathPending || !(component2.remainingDistance <= component2.stoppingDistance))
			{
				return;
			}
			if (component2.hasPath)
			{
				Vector3 velocity = component2.velocity;
				if (((Vector3)(ref velocity)).sqrMagnitude != 0f)
				{
					return;
				}
			}
			if (component.productsIDToBuy.Count <= 0)
			{
				return;
			}
			switch (state)
			{
			case 0:
			{
				int num4 = component.productsIDToBuy[0];
				int num5 = __instance.WhichShelfHasItem(num4);
				if (num5 == -1)
				{
					GameData.Instance.AddNotFoundList(num4);
					component.productsIDToBuy.RemoveAt(0);
					component.RPCNotificationAboveHead("NPCmessage0", "product" + num4);
					component.StartWaitState(1.5f, 0);
					component.state = -1;
					if (BetterSMT.MissingProduct.Value)
					{
						string text3 = (dictionary.ContainsKey(num4) ? dictionary[num4] : $"Product {num4}");
						PlayerObjectController val2 = Object.FindObjectOfType<PlayerObjectController>();
						string text4 = text3 + " is not found on the shelf.";
						val2.CmdSendMessage(text4, (NetworkConnectionToClient)null);
						Debug.Log((object)text4);
					}
				}
				else
				{
					component.shelfThatHasTheItem = num5;
					Vector3 position = ((Component)__instance.shelvesOBJ.transform.GetChild(num5).Find("Standspot")).transform.position;
					component2.destination = position;
					component.state = 1;
				}
				break;
			}
			case 1:
			{
				int num = component.productsIDToBuy[0];
				if (__instance.IsItemInShelf(component.shelfThatHasTheItem, num))
				{
					float num2 = ProductListing.Instance.productPlayerPricing[num];
					Data_Product component3 = ProductListing.Instance.productPrefabs[num].GetComponent<Data_Product>();
					int productTier = component3.productTier;
					float num3 = component3.basePricePerUnit * ProductListing.Instance.tierInflation[productTier] * Random.Range(2f, 2.5f);
					component.productsIDToBuy.RemoveAt(0);
					if (num2 > num3)
					{
						component.StartWaitState(1.5f, 0);
						component.RPCNotificationAboveHead("NPCmessage1", "product" + num);
						GameData.Instance.AddExpensiveList(num);
						if (BetterSMT.TooExpensive.Value)
						{
							string text = (dictionary.ContainsKey(num) ? dictionary[num] : $"Product {num}");
							PlayerObjectController val = Object.FindObjectOfType<PlayerObjectController>();
							string text2 = text + " is too expensive.";
							val.CmdSendMessage(text2, (NetworkConnectionToClient)null);
							Debug.Log((object)text2);
						}
					}
					else
					{
						component.productsIDCarrying.Add(num);
						component.productsCarryingPrice.Add(num2);
						component.numberOfProductsCarried++;
						component.StartWaitState(1.5f, 0);
						((Component)__instance.shelvesOBJ.transform.GetChild(component.shelfThatHasTheItem)).GetComponent<Data_Container>().NPCGetsItemFromRow(num);
					}
					component.state = -1;
				}
				else
				{
					component.state = 0;
				}
				break;
			}
			default:
				Debug.Log((object)"npc case error");
				break;
			}
		}

		public static int SelfCheckoutPatch(NPC_Info npcInfo, NPC_Manager __instance)
		{
			if (npcInfo.productsIDCarrying.Count > 18 + __instance.selfcheckoutExtraProductsFromPerk || npcInfo.productsIDCarrying.Count == 0)
			{
				return -1;
			}
			float num = Mathf.Clamp((float)((18 + __instance.selfcheckoutExtraProductsFromPerk) / npcInfo.productsIDCarrying.Count), 0f, 1f);
			if (__instance.selfcheckoutChanceCurve.Evaluate(num) < Random.value)
			{
				for (int i = 0; i < __instance.selfCheckoutOBJ.transform.childCount; i++)
				{
					if (!((Component)__instance.selfCheckoutOBJ.transform.GetChild(i)).GetComponent<Data_Container>().checkoutQueue[0])
					{
						if (!BetterSMT.SelfCheckoutTheft.Value && npcInfo.productsIDCarrying.Count > 6 && Random.value < 0.02f + (float)GameData.Instance.difficulty * 0.005f)
						{
							int index = Random.Range(0, npcInfo.productsIDCarrying.Count);
							npcInfo.productsIDCarrying.RemoveAt(index);
							npcInfo.productsCarryingPrice.RemoveAt(index);
						}
						return i;
					}
				}
			}
			return -1;
		}
	}
	[HarmonyPatch(typeof(PlayerNetwork))]
	public class PlayerNetworkPatch
	{
		public enum ShelfType
		{
			ProductDisplay,
			Storage
		}

		private struct ShelfData
		{
			public string highlightsName;

			public string highlightsOriginalName;

			public ShelfType shelfType;

			public ShelfData(ShelfType shelfType)
			{
				if (shelfType == ShelfType.ProductDisplay)
				{
					highlightsName = "Labels";
					highlightsOriginalName = "";
					this.shelfType = ShelfType.ProductDisplay;
				}
				else
				{
					highlightsName = "HighlightsMarker";
					highlightsOriginalName = "Highlights";
					this.shelfType = ShelfType.Storage;
				}
			}
		}

		private static PlayerNetwork pNetwork = null;

		private static readonly Dictionary<int, Transform> highlightObjectCache = new Dictionary<int, Transform>();

		public static bool IsHighlightCacheUsed { get; set; } = true;


		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void UpdatePatch(PlayerNetwork __instance, ref float ___pPrice, TextMeshProUGUI ___marketPriceTMP, ref TextMeshProUGUI ___yourPriceTMP)
		{
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			if (FsmVariables.GlobalVariables.GetFsmBool("InChat").Value)
			{
				return;
			}
			KeyboardShortcut value;
			if (BetterSMT.PricingGunToggle.Value)
			{
				value = BetterSMT.PricingGunHotkey.Value;
				if (((KeyboardShortcut)(ref value)).IsDown())
				{
					__instance.CmdChangeEquippedItem(2);
				}
			}
			if (BetterSMT.BroomToggle.Value)
			{
				value = BetterSMT.BroomHotkey.Value;
				if (((KeyboardShortcut)(ref value)).IsDown())
				{
					__instance.CmdChangeEquippedItem(5);
				}
			}
			if (BetterSMT.DLCTabletToggle.Value)
			{
				value = BetterSMT.DLCTabletHotkey.Value;
				if (((KeyboardShortcut)(ref value)).IsDown())
				{
					__instance.CmdChangeEquippedItem(3);
				}
			}
			if (BetterSMT.PricingGunToggle.Value || BetterSMT.BroomToggle.Value || BetterSMT.DLCTabletToggle.Value)
			{
				value = BetterSMT.EmptyHandsHotkey.Value;
				if (((KeyboardShortcut)(ref value)).IsDown())
				{
					__instance.CmdChangeEquippedItem(0);
				}
			}
			if (BetterSMT.PhoneToggle.Value)
			{
				value = BetterSMT.PhoneHotkey.Value;
				if (((KeyboardShortcut)(ref value)).IsDown())
				{
					__instance.CmdChangeEquippedItem(6);
				}
			}
			if (!BetterSMT.ToggleDoublePrice.Value || !BetterSMT.doublePrice || !((Object)(object)___marketPriceTMP != (Object)null))
			{
				return;
			}
			string text = ((TMP_Text)___marketPriceTMP).text;
			if (float.TryParse(text.Substring(1, text.Length - 1).Replace(',', '.'), NumberStyles.Float, CultureInfo.InvariantCulture, out var result))
			{
				___pPrice = result * 2f;
				if (BetterSMT.roundDown.Value)
				{
					___pPrice = (BetterSMT.NearestTen.Value ? ((float)(Math.Floor(___pPrice * 10f) / 10.0)) : ((float)(Math.Floor(___pPrice * 20f) / 20.0)));
				}
				((TMP_Text)___yourPriceTMP).text = "$" + ___pPrice;
			}
		}

		public static void OptimizeProductPrices()
		{
			if (!BetterSMT.AutoAdjustPriceDaily.Value)
			{
				return;
			}
			GameObject[] productPrefabs = ProductListing.Instance.productPrefabs;
			ProductListing instance = ProductListing.Instance;
			List<float> list = new List<float>();
			for (int i = 0; i < productPrefabs.Length; i++)
			{
				if (i < productPrefabs.Length)
				{
					Data_Product component = productPrefabs[i].GetComponent<Data_Product>();
					list.Add(component.basePricePerUnit);
				}
			}
			float[] array = list.ToArray();
			float[] tierInflation = instance.tierInflation;
			float value = BetterSMT.AutoAdjustPriceDailyValue.Value;
			_ = new float[array.Length];
			for (int j = 0; j < array.Length; j++)
			{
				Data_Product component2 = productPrefabs[j].GetComponent<Data_Product>();
				float num = array[j] * tierInflation[component2.productTier] * value;
				float num2 = Mathf.Floor(num * 100f) / 100f;
				instance.CmdUpdateProductPrice(j, num2);
			}
		}

		[HarmonyPatch("ChangeEquipment")]
		[HarmonyPostfix]
		private static void ChangeEquipmentPatch(int newEquippedItem)
		{
			if (newEquippedItem == 0)
			{
				ClearHighlightedShelves();
			}
		}

		[HarmonyPatch(typeof(PlayerNetwork), "OnStartClient")]
		[HarmonyPrefix]
		private static bool OptimizePricesOnSpawn()
		{
			OptimizeProductPrices();
			return true;
		}

		[HarmonyPatch("Start")]
		[HarmonyPrefix]
		private static void StartPatch(PlayerNetwork __instance)
		{
			if (((NetworkBehaviour)__instance).isLocalPlayer)
			{
				pNetwork = __instance;
			}
		}

		[HarmonyPatch("UpdateBoxContents")]
		[HarmonyPostfix]
		private static void UpdateBoxContentsPatch(int productIndex)
		{
			HighlightShelvesByProduct(productIndex);
		}

		[HarmonyPatch(typeof(Data_Container), "BoxSpawner")]
		[HarmonyPostfix]
		private static void BoxSpawnerPatch(Data_Container __instance)
		{
			AddHighlightMarkersToStorage(((Component)__instance).transform);
		}

		[HarmonyPatch(typeof(NetworkSpawner), "UserCode_CmdSpawn__Int32__Vector3__Vector3")]
		[HarmonyPostfix]
		private static void NewBuildableConstructed(NetworkSpawner __instance, int prefabID)
		{
			GameObject val = __instance.buildables[prefabID];
			if (((Object)val).name.Contains("StorageShelf"))
			{
				int parentIndex = val.GetComponent<Data_Container>().parentIndex;
				Transform child = __instance.levelPropsOBJ.transform.GetChild(parentIndex);
				GameObject gameObject = ((Component)child.GetChild(child.childCount - 1)).gameObject;
				AddHighlightMarkersToStorage(gameObject.transform);
			}
		}

		public static int GetProductFromRaycast()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: 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_0132: Unknown result type (might be due to invalid IL or missing references)
			int result = -1;
			RaycastHit val = default(RaycastHit);
			RaycastHit val2 = default(RaycastHit);
			if (Physics.Raycast(((Component)Camera.main).transform.position, ((Component)Camera.main).transform.forward, ref val, 4f, LayerMask.op_Implicit(pNetwork.interactableMask)))
			{
				if (((Object)((Component)((RaycastHit)(ref val)).transform).gameObject).name == "SubContainer")
				{
					int siblingIndex = ((RaycastHit)(ref val)).transform.GetSiblingIndex();
					Transform transform = ((RaycastHit)(ref val)).transform;
					object obj;
					if (transform == null)
					{
						obj = null;
					}
					else
					{
						Transform parent = transform.parent;
						if (parent == null)
						{
							obj = null;
						}
						else
						{
							Transform transform2 = ((Component)parent).transform;
							obj = ((transform2 != null) ? transform2.parent : null);
						}
					}
					if (!Object.op_Implicit((Object)obj))
					{
						return result;
					}
					Data_Container component = ((Component)((Component)((RaycastHit)(ref val)).transform.parent).transform.parent).GetComponent<Data_Container>();
					if ((Object)(object)component != (Object)null && component.containerClass < 20)
					{
						result = component.productInfoArray[siblingIndex * 2];
					}
				}
			}
			else if (Physics.Raycast(((Component)Camera.main).transform.position, ((Component)Camera.main).transform.forward, ref val2, 4f, LayerMask.op_Implicit(pNetwork.lMask)))
			{
				if (((Component)((RaycastHit)(ref val2)).transform).gameObject.tag == "Interactable" && Object.op_Implicit((Object)(object)((Component)((RaycastHit)(ref val2)).transform).GetComponent<BoxData>()))
				{
					BoxData component2 = ((Component)((RaycastHit)(ref val2)).transform).GetComponent<BoxData>();
					if ((Object)(object)component2 != (Object)null)
					{
						result = component2.productID;
					}
				}
				else
				{
					int siblingIndex2 = ((RaycastHit)(ref val2)).transform.GetSiblingIndex();
					Transform transform3 = ((RaycastHit)(ref val2)).transform;
					object obj2;
					if (transform3 == null)
					{
						obj2 = null;
					}
					else
					{
						Transform parent2 = transform3.parent;
						if (parent2 == null)
						{
							obj2 = null;
						}
						else
						{
							Transform transform4 = ((Component)parent2).transform;
							obj2 = ((transform4 != null) ? transform4.parent : null);
						}
					}
					if (!Object.op_Implicit((Object)obj2))
					{
						return result;
					}
					Data_Container component3 = ((Component)((Component)((RaycastHit)(ref val2)).transform.parent).transform.parent).GetComponent<Data_Container>();
					if ((Object)(object)component3 != (Object)null && component3.containerClass == 69)
					{
						int num = component3.productInfoArray[siblingIndex2 * 2];
						result = num;
					}
				}
			}
			return result;
		}

		public static void HighlightShelvesByProduct(int productID)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			HighlightShelfTypeByProduct(productID, Color.yellow, ShelfType.ProductDisplay);
			HighlightShelfTypeByProduct(productID, Color.red, ShelfType.Storage);
		}

		public static void ClearHighlightedShelves()
		{
			if (IsHighlightCacheUsed)
			{
				foreach (KeyValuePair<int, Transform> item in highlightObjectCache)
				{
					HighlightShelf(item.Value, isEnableHighlight: false);
				}
				highlightObjectCache.Clear();
			}
			else
			{
				ClearHighlightShelvesByProduct(ShelfType.ProductDisplay);
				ClearHighlightShelvesByProduct(ShelfType.Storage);
			}
		}

		private static void ClearHighlightShelvesByProduct(ShelfType shelfType)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			HighlightShelfTypeByProduct(-1, Color.white, shelfType);
		}

		private static void HighlightShelfTypeByProduct(int productID, Color shelfHighlightColor, ShelfType shelfType)
		{
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = GameObject.Find(GetGameObjectStringPath(shelfType));
			for (int i = 0; i < val.transform.childCount; i++)
			{
				Transform child = val.transform.GetChild(i);
				int[] productInfoArray = ((Component)child).gameObject.GetComponent<Data_Container>().productInfoArray;
				int num = productInfoArray.Length / 2;
				bool isEnableHighlight = false;
				for (int j = 0; j < num; j++)
				{
					if (productID >= 0 && productInfoArray[j * 2] == productID)
					{
						isEnableHighlight = true;
						Transform val2 = child.Find(new ShelfData(shelfType).highlightsName);
						if ((Object)(object)val2 != (Object)null)
						{
							Transform t = ((shelfType == ShelfType.Storage) ? val2.GetChild(j).GetChild(0) : val2.GetChild(j));
							HighlightShelf(t, isEnableHighlight: true, Color.yellow);
						}
					}
				}
				HighlightShelf(child, isEnableHighlight, shelfHighlightColor);
			}
		}

		public static string GetGameObjectStringPath(ShelfType shelfType)
		{
			if (1 == 0)
			{
			}
			string result = shelfType switch
			{
				ShelfType.ProductDisplay => "Level_SupermarketProps/Shelves", 
				ShelfType.Storage => "Level_SupermarketProps/StorageShelves", 
				_ => throw new NotImplementedException(), 
			};
			if (1 == 0)
			{
			}
			return result;
		}

		public static void HighlightShelf(Transform t, bool isEnableHighlight, Color? color = null)
		{
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Expected O, but got Unknown
			//IL_016f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0177: Unknown result type (might be due to invalid IL or missing references)
			//IL_017f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0161: 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)
			HighlightEffect val = ((Component)t).GetComponent<HighlightEffect>() ?? ((Component)t).gameObject.AddComponent<HighlightEffect>();
			if (IsHighlightCacheUsed)
			{
				if (isEnableHighlight == val.highlighted)
				{
					return;
				}
				if (isEnableHighlight && !highlightObjectCache.ContainsKey(((Object)t).GetInstanceID()))
				{
					highlightObjectCache.Add(((Object)t).GetInstanceID(), t);
				}
				MeshRenderer component = ((Component)t).GetComponent<MeshRenderer>();
				if ((Object)(object)component != (Object)null)
				{
					((Renderer)component).allowOcclusionWhenDynamic = !isEnableHighlight;
				}
			}
			if (color.HasValue)
			{
				val.outlineColor = color.Value;
			}
			val.outlineQuality = (QualityLevel)1;
			val.outlineVisibility = (Visibility)1;
			val.outlineContourStyle = (ContourStyle)1;
			val.outlineIndependent = true;
			val.outline = (isEnableHighlight ? 1f : 0f);
			val.glow = (isEnableHighlight ? 0f : 1f);
			val.Refresh(false);
			val.highlighted = isEnableHighlight;
			foreach (Transform item in t)
			{
				Transform val2 = item;
				if (((Object)val2).name.Contains("PriceLabel"))
				{
					HighlightEffect val3 = ((Component)val2).GetComponent<HighlightEffect>() ?? ((Component)val2).gameObject.AddComponent<HighlightEffect>();
					if (color.HasValue)
					{
						val3.outlineColor = color.Value;
					}
					val3.outlineQuality = (QualityLevel)1;
					val3.outlineVisibility = (Visibility)1;
					val3.outlineContourStyle = (ContourStyle)1;
					val3.outlineIndependent = true;
					val3.outline = (isEnableHighlight ? 1f : 0f);
					val3.glow = (isEnableHighlight ? 0f : 1f);
					val3.Refresh(false);
					val3.highlighted = isEnableHighlight;
				}
			}
		}

		public static void AddHighlightMarkersToStorage(Transform storage)
		{
			ShelfData shelfData = new ShelfData(ShelfType.Storage);
			Transform val = ((Component)storage).transform.Find(shelfData.highlightsName);
			if (!((Object)(object)val != (Object)null))
			{
				val = Object.Instantiate<GameObject>(((Component)storage.Find(shelfData.highlightsOriginalName)).gameObject, storage).transform;
				((Object)val).name = shelfData.highlightsName;
				for (int i = 0; i < val.childCount; i++)
				{
					((Component)val.GetChild(i)).gameObject.SetActive(true);
					Transform child = val.GetChild(i).GetChild(0);
					((Component)child).gameObject.SetActive(true);
					HighlightShelf(child, isEnableHighlight: false);
				}
			}
		}
	}
	[HarmonyPatch(typeof(ProductListing))]
	public class ProductListingPatch
	{
		[HarmonyPatch(typeof(ProductListing))]
		[HarmonyPatch("OnStartClient")]
		public class Patch_ProductMaxItems
		{
			private static void Postfix(ProductListing __instance)
			{
				List<string> list = new List<string>(259)
				{
					"0_Pasta", "1_WaterBottle", "2_HoneyCereals", "3_Rice", "4_Salt", "5_Sugar", "6_Margarine", "7_Flour", "8_AppleJuice", "9_Oil",
					"10_Ketchup", "11_SliceBread", "12_Pepper", "13_OrangeJuice", "14_BarbaqueSauce", "15_MustardSauce", "16_SpaghettiBox", "17_TunaPate", "18_FiberCereals", "19_FlourSupremeQuality",
					"20_BlackCoffee", "21_EggBox", "22_Houmous", "23_WhiteFlour", "24_CaneSugarBox", "25_Sugar", "26_Macarroni", "27_SugarEcologic", "28_BrownSugar", "29_OliveOil",
					"30_MashPotatoes", "31_PotatoeBag", "32_CoffeeEspresso", "33_RiceBasmati", "34_RiceLongGrain", "35_Coffee", "36_PastaSpecial", "37_CerealsChocolate", "38_WaterPremium", "39_WaterSpring",
					"40_SugarGlass", "41_SugarBigBox", "42_SugarBrownBigBox", "43_CheeseEmmental", "44_CheeseGruyere", "45_CheeseSkimmed", "46_YoghurtFruit", "47_YoghurtVanilla", "48_MilkBrick", "49_Butter",
					"50_CheeseParmigiano", "51_CheeseReggiano", "52_CheeseMozzarella", "53_YoghurtSkimmed", "54_ColaPack", "55_SodaPack", "56_SodaDecafPack", "57_SodaBottle", "58_ColaBottle", "59_SodaDecafBottle",
					"60_PremiumSoda", "61_PizzaBarbaque", "62_Fondue", "63_HamCrocanti", "64_CrepeHamCheese", "65_FrenchFries", "66_CrispyPotatoPos", "67_GreenBeans", "68_PizzaFourCheese", "69_PizzaFourSeasons",
					"70_VegetableMix", "71_ChickenMix", "72_LasagnaBolognaise", "73_LasagnaVegetable", "74_Toothpaste", "75_ToiletPaperPetus", "76_HandSoap", "77_ShampooAvocado", "78_ShampooEgg", "79_BathGelPowerFresh",
					"80_ToiletPaperBidet", "81_SoapMango", "82_ShampooExtraSoft", "83_ShampooHoneyJojoba", "84_ShampooOilArgan", "85_PaperTowel", "86_ToiletPaperDoudou", "87_SoapLemon", "88_BathGelPremium", "89_ShampooBabies",
					"90_Detergent", "91_StainRemover", "92_GlassCleaner", "93_DetergentTables", "94_Dishwasher", "95_Bleach", "96_BleachBig", "97_Softener", "98_DetergentPremium", "99_Insecticide",
					"100_CleaningCloths", "101_CapsulesPremium", "102_BleachPremium", "103_Ammonia", "104_CookieJar", "105_MaxiCone", "106_ChocoSpread", "107_ChocoPowder", "108_Chips", "109_SweetBonbek",
					"110_PeachJam", "111_IceCreamBonbek", "112_ChocolateBox", "113_BiscuitChocolate", "114_BiscuitVanillaChoco", "115_Madeleine", "116_StrawberryJam", "117_PeanutButter", "118_Chipos", "119_Marshmallow",
					"120_BiscuitLemon", "121_BiscuitHazelnut", "122_IceCreamPremium", "123_Honey", "124_ChocolateBoxPremium", "125_Foditos", "126_CakePremium", "127_ChoppedBeef", "128_PureBeef", "129_Veal",
					"130_ChickenWings", "131_Chicken", "132_ParmaHam", "133_SlicedHam", "134_PeasBig", "135_TunaBig", "136_RedBeans", "137_CatFoodMiao", "138_CatFoodPatPat", "139_DogFoodPatPat",
					"140_GreenTea", "141_LemonTea", "142_BlackTea", "143_Peppermint", "144_Mint", "145_Valerian", "146_SushiBig", "147_SushiSmall", "148_SmokedSalmon", "149_CrabSticks",
					"150_BookElectromagneticTheory", "151_BookSurprise", "152_BookABC", "153_BookMotherAndChild", "154_BookColors", "155_BookPiticha", "156_BookOnceUpon", "157_BookKrok", "158_BookAdventures", "159_BookDonnine",
					"160_BookVintage", "161_BookIwontShare", "162_BeerPackBK", "163_BeerPackTeochew", "164_BeerPackFess", "165_BeerBarrelDEGL", "166_BeerBarrelFess", "167_VodkaMagnat", "168_RedWine", "169_RoseWine",
					"170_WhiteWine", "171_BeerBarrelTeochew", "172_VodkaPremiumEay", "173_JapaneseWhisky", "174_WhiskyPremiumGrandMarnier", "175_WhiskyPremiumJackSublett", "176_HydrogenPeroxide", "177_Disinfectant", "178_Ibuprofen", "179_Paracetamol",
					"180_BandAids", "181_Laxative", "182_Antihistamine", "183_ZincSupplement", "184_Antioxidant", "185_FishOil", "186_AlgaePills", "187_Vitamins", "188_Melatonin", "189_Sunscreen",
					"190_StretchCream", "191_RedAppleTray", "192_GreenAppleTray", "193_ClementineTray", "194_OrangeTray", "195_PearTray", "196_LemonTray", "197_MangoTray", "198_AvocadoTray", "199_KiwiTray",
					"200_PapayaTray", "201_StrawberryTray", "202_CherryTray", "203_ArtichokeTray", "204_ZucchiniTray", "205_CarrotTray", "206_TomatoTray", "207_PotatoTray", "208_OnionTray", "209_BananaPack",
					"210_Melon", "211_Pineapple", "212_Pumpkin", "213_Watermelon", "214_BabyFoodVegetables", "215_BabyFoodFish", "216_BabyFoodFruit", "217_BabyFoodMeat", "218_BabyMilkLiquid", "219_BabyMilkPowder",
					"220_EcoDiapers", "221_BasicDiapers", "222_ToddlerDiapers", "223_PremiumDiapers", "224_CleaningWipes", "225_BathWipes", "226_BabyPowder", "227_OrangeSoda", "", "228_PineappleSoda",
					"229_TropicalSoda", "230_GreenTea", "231_RedTea", "232_LemonTea", "233_ColdBrewCoffee", "234_BlueBerryEnergyDrink", "235_GuavaEnergyDrink", "236_LimeEnergyDrink", "237_FruitPunchEnergyDrink", "238_MangoEnergyDrink",
					"239_ColaEnergyDrink", "240_ZeroEnergyDrink", "241_IceCreamBasicStrawberry", "242_IceCreamBasicOrange", "243_IceCreamCoffee", "244_IceCreamStracciatella", "245_IceCreamStrawberryMeringue", "246_IceCream_Caramel", "247_IceCreamStrawberryPremium", "248_IceCreamStrawberryCheesecake",
					"249_IceCreamCaramelPremium", "250_IceCreamPinkStrawberries", "251_IceCreamAlcoholic", "252_Chickpeas", "253_Meatballs", "254_Lentils", "255_TomatoSoup", "256_CannedCorn", "257_CannedPeas"
				};
				GameObject[] productPrefabs = __instance.productPrefabs;
				foreach (GameObject val in productPrefabs)
				{
					if (list.Contains(((Object)val).name))
					{
						Data_Product component = val.GetComponent<Data_Product>();
						if ((Object)(object)component != (Object)null)
						{
							component.maxItemsPerBox *= BetterSMT.MaxBoxSize.Value;
						}
					}
				}
			}
		}

		[HarmonyPatch(typeof(ProductListing))]
		public class PillarPatch
		{
			[HarmonyPatch("OnStartClient")]
			[HarmonyPostfix]
			private static void PillarRemovalPatch()
			{
				if (!BetterSMT.RemovePillars.Value)
				{
					return;
				}
				HashSet<string> pillarSuffixes = new HashSet<string> { " (6)", " (4)", " (7)" };
				HashSet<string> beamSuffixes = new HashSet<string>
				{
					" (4)", " (13)", " (21)", " (24)", " (26)", " (12)", " (11)", " (2)", " (4)", " (29)",
					" (33)", " (1)", " (3)", " (5)", " (30)", " (34)"
				};
				Object[] source = Object.FindObjectsOfType<Object>();
				Object[] first = source.Where((Object pillar) => pillar.name.StartsWith("Pillar_BeamCross") && pillarSuffixes.Any((string suffix) => pillar.name.EndsWith(suffix))).ToArray();
				Object[] second = source.Where((Object pillar) => pillar.name.StartsWith("Beam") && beamSuffixes.Any((string suffix) => pillar.name.EndsWith(suffix))).ToArray();
				Object[] second2 = source.Where((Object pillar) => pillar.name.Equals("Beam")).ToArray();
				foreach (Object item in first.Concat(second).Concat(second2))
				{
					Object.Destroy(item);
				}
			}
		}
	}
	[HarmonyPatch(typeof(UpgradesManager))]
	public class UpgradesManagerPatch
	{
		[HarmonyPatch("ManageExtraPerks")]
		[HarmonyPrefix]
		private static bool ManageExtraPerksPatch(UpgradesManager __instance, int perkIndex)
		{
			if ((Object)(object)__instance == (Object)null)
			{
				Debug.LogError((object)"UpgradesManager instance is null in ManageExtraPerksPatch.");
			}
			switch (perkIndex)
			{
			case 5:
			{
				NPC_Manager instance12 = NPC_Manager.Instance;
				instance12.extraEmployeeSpeedFactor += BetterSMT.EmployeeSpeedPerPerk.Value;
				NPC_Manager.Instance.UpdateEmployeeStats();
				break;
			}
			case 6:
			{
				NPC_Manager instance11 = NPC_Manager.Instance;
				instance11.extraCheckoutMoney += BetterSMT.EmployeExtraCheckoutMoney.Value;
				NPC_Manager.Instance.UpdateEmployeeStats();
				break;
			}
			case 7:
			{
				NPC_Manager instance10 = NPC_Manager.Instance;
				instance10.extraEmployeeSpeedFactor += BetterSMT.EmployeeSpeedPerPerk.Value;
				NPC_Manager.Instance.UpdateEmployeeStats();
				break;
			}
			case 9:
			{
				GameData component2 = ((Component)__instance).GetComponent<GameData>();
				component2.extraCustomersPerk += BetterSMT.CustomersPerPerk.Value;
				break;
			}
			case 10:
			{
				GameData component = ((Component)__instance).GetComponent<GameData>();
				component.extraCustomersPerk += BetterSMT.CustomersPerPerk.Value;
				break;
			}
			case 16:
			{
				NPC_Manager instance9 = NPC_Manager.Instance;
				instance9.productCheckoutWait -= BetterSMT.EmployeeCheckoutPerPerk1.Value;
				break;
			}
			case 17:
			{
				NPC_Manager instance8 = NPC_Manager.Instance;
				instance8.productCheckoutWait -= BetterSMT.EmployeeCheckoutPerPerk2.Value;
				break;
			}
			case 18:
			{
				NPC_Manager instance7 = NPC_Manager.Instance;
				instance7.productCheckoutWait -= BetterSMT.EmployeeCheckoutPerPerk3.Value;
				break;
			}
			case 19:
			{
				NPC_Manager instance6 = NPC_Manager.Instance;
				instance6.employeeItemPlaceWait -= BetterSMT.EmployeeRestockPerPerk.Value;
				NPC_Manager.Instance.UpdateEmployeeStats();
				break;
			}
			case 20:
			{
				NPC_Manager instance5 = NPC_Manager.Instance;
				instance5.employeeItemPlaceWait -= BetterSMT.EmployeeRestockPerPerk.Value;
				NPC_Manager.Instance.UpdateEmployeeStats();
				break;
			}
			case 21:
			{
				NPC_Manager instance4 = NPC_Manager.Instance;
				instance4.extraEmployeeSpeedFactor += BetterSMT.EmployeeSpeedPerPerk.Value;
				NPC_Manager.Instance.UpdateEmployeeStats();
				break;
			}
			case 22:
			{
				NPC_Manager instance3 = NPC_Manager.Instance;
				instance3.extraEmployeeSpeedFactor += BetterSMT.EmployeeSpeedPerPerk.Value;
				NPC_Manager.Instance.UpdateEmployeeStats();
				break;
			}
			case 23:
			{
				NPC_Manager instance2 = NPC_Manager.Instance;
				instance2.extraEmployeeSpeedFactor += BetterSMT.EmployeeSpeedPerPerk.Value;
				NPC_Manager.Instance.UpdateEmployeeStats();
				break;
			}
			case 25:
			{
				NPC_Manager instance = NPC_Manager.Instance;
				instance.selfcheckoutExtraProductsFromPerk += BetterSMT.SelfCheckoutLimit.Value;
				break;
			}
			default:
				return true;
			}
			GameObject gameObject = ((Component)__instance.UIPerksParent.transform.GetChild(perkIndex)).gameObject;
			gameObject.GetComponent<CanvasGroup>().alpha = 1f;
			gameObject.tag = "Untagged";
			((Component)gameObject.transform.Find("Highlight2")).gameObject.SetActive(true);
			return false;
		}
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}