Decompiled source of BetterSMT v2.3.0
BepInEx/plugins/BetterSMT.dll
Decompiled 20 hours ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Threading.Tasks; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using BetterSMT.Patches; using Cinemachine; using HarmonyLib; using HighlightPlus; using HutongGames.PlayMaker; using HutongGames.PlayMaker.Actions; using Microsoft.CodeAnalysis; using Mirror; using StarterAssets; using TMPro; using UnityEngine; 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("2.3.0.0")] [assembly: AssemblyInformationalVersion("2.3.0+31d234747401f252b790c8a3ea93309f7dd246ea")] [assembly: AssemblyProduct("BetterSMT")] [assembly: AssemblyTitle("BetterSMT")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("2.3.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace BetterSMT { [BepInPlugin("BetterSMT", "BetterSMT", "2.3.0")] public class BetterSMT : BaseUnityPlugin { private readonly Harmony harmony = new Harmony("BetterSMT"); public static BetterSMT Instance; public static ConfigEntry<bool> AutoPayAllInvoices; public static ConfigEntry<int> SalesActiveAmount; public static ConfigEntry<KeyboardShortcut> ClearSales; public static ConfigEntry<bool> ToggleClearSalesHotkey; public static ConfigEntry<bool> SalesToggle; public static ConfigEntry<KeyboardShortcut> SalesHotkey; public static ConfigEntry<bool> AutoSaveEnabled; public static ConfigEntry<int> AutoSaveTimer; public static ConfigEntry<bool> AutoSaveDuringDay; public static ConfigEntry<int> CustomersPerPerk; public static ConfigEntry<int> MaxCustomerInStore; public static ConfigEntry<int> BaseCustomerSpawns; public static ConfigEntry<int> BaseCustomerCart; public static ConfigEntry<int> MaxCustomerCart; public static ConfigEntry<int> EmployeesLevel; public static ConfigEntry<bool> EmployeesEnabled; public static ConfigEntry<float> EmployeeSpeedPerPerk; public static ConfigEntry<float> EmployeeRestockPerPerk; public static ConfigEntry<float> EmployeeCheckoutPerPerk; public static ConfigEntry<float> EmployeExtraCheckoutMoney; public static ConfigEntry<bool> OneHitThief; public static ConfigEntry<bool> SelfCheckoutTheft; public static ConfigEntry<bool> DisableAllThieves; public static ConfigEntry<bool> AllNPCAreThieves; public static ConfigEntry<bool> FasterCheckout; public static ConfigEntry<bool> ShowFPS; public static ConfigEntry<bool> ShowPing; public static ConfigEntry<bool> DisableAllTrash; public static ConfigEntry<bool> AlwaysAbleToDeleteMode; public static ConfigEntry<bool> DeleteAllCheckouts; public static ConfigEntry<bool> AllTrashToRecyclers; public static ConfigEntry<bool> roundDown; public static ConfigEntry<bool> NearestFive; public static ConfigEntry<bool> NearestTen; public static bool doublePrice = true; public static ConfigEntry<bool> ToggleDoublePrice; public static ConfigEntry<bool> AutoAdjustPriceDaily; public static ConfigEntry<float> AutoAdjustPriceDailyValue; public static bool notify = false; public static string notificationType; public static ConfigEntry<bool> EnableMTV; public static ConfigEntry<int> MaxBoxes; public static ConfigEntry<float> AutoPickupRange; public static ConfigEntry<KeyboardShortcut> MTVHotkey; public static ConfigEntry<float> DropCooldown; public static ConfigEntry<bool> OneClickCheckMark; public static ConfigEntry<bool> AllowFreePlacement; public static ConfigEntry<bool> ProductStacking; public static ConfigEntry<bool> EnablePalletDisplaysPerk; public static ConfigEntry<bool> ReplaceCommasWithPeriods; public static ConfigEntry<string> CurrencyTypeToAny; public static ConfigEntry<bool> EmployeeRerolls; public static ConfigEntry<bool> StorageHighlighting; 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<bool> SledgeToggle; public static ConfigEntry<KeyboardShortcut> SledgeHotkey; public static ConfigEntry<bool> OsMartToggle; public static ConfigEntry<KeyboardShortcut> OsMartHotkey; public static ConfigEntry<bool> TrayToggle; public static ConfigEntry<KeyboardShortcut> TrayHotkey; public static ConfigEntry<KeyboardShortcut> LadderHotkey; public static ConfigEntry<bool> LadderToggle; public static ConfigEntry<KeyboardShortcut> ClockHotkey; public static ConfigEntry<bool> ClockToggle; public static ConfigEntry<bool> SaveGame; public static ConfigEntry<bool> LoanEarly; public static ConfigEntry<bool> Tutorial; public static ConfigEntry<bool> NumberKeys; public static ConfigEntry<int> SelfCheckoutLimit; public static ConfigEntry<bool> TooExpensiveNotifications; public static ConfigEntry<bool> MissingProductNotifications; public static ConfigEntry<int> MaxBoxSize; public static ConfigEntry<bool> DisableBoxCollisions; public static ConfigEntry<bool> FastBoxSpawns; public static ConfigEntry<float> ClockSpeed; public static ConfigEntry<bool> ClockMorning; public static ConfigEntry<bool> AutoOrdering; public static ConfigEntry<bool> QuickStocking; public static ConfigEntry<int> CardboardBalerValue; internal static ManualLogSource Logger { get; private set; } = null; [Obsolete] private void Awake() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Expected O, but got Unknown //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Expected O, but got Unknown //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Expected O, but got Unknown //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Expected O, but got Unknown //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Expected O, but got Unknown //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Expected O, but got Unknown //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Expected O, but got Unknown //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Expected O, but got Unknown //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Expected O, but got Unknown //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Expected O, but got Unknown //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Expected O, but got Unknown //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_028e: Expected O, but got Unknown //IL_02ba: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Expected O, but got Unknown //IL_02eb: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Expected O, but got Unknown //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0327: Expected O, but got Unknown //IL_035a: Unknown result type (might be due to invalid IL or missing references) //IL_0364: Expected O, but got Unknown //IL_0397: Unknown result type (might be due to invalid IL or missing references) //IL_03a1: Expected O, but got Unknown //IL_03c2: Unknown result type (might be due to invalid IL or missing references) //IL_03cc: Expected O, but got Unknown //IL_03ed: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: Expected O, but got Unknown //IL_0418: Unknown result type (might be due to invalid IL or missing references) //IL_0422: Expected O, but got Unknown //IL_0443: Unknown result type (might be due to invalid IL or missing references) //IL_044d: Expected O, but got Unknown //IL_046e: Unknown result type (might be due to invalid IL or missing references) //IL_0478: Expected O, but got Unknown //IL_04d1: Unknown result type (might be due to invalid IL or missing references) //IL_04db: Expected O, but got Unknown //IL_04fc: Unknown result type (might be due to invalid IL or missing references) //IL_0506: Expected O, but got Unknown //IL_0527: Unknown result type (might be due to invalid IL or missing references) //IL_0531: Expected O, but got Unknown //IL_0552: Unknown result type (might be due to invalid IL or missing references) //IL_055c: Expected O, but got Unknown //IL_057d: Unknown result type (might be due to invalid IL or missing references) //IL_0587: Expected O, but got Unknown //IL_05a8: Unknown result type (might be due to invalid IL or missing references) //IL_05b2: Expected O, but got Unknown //IL_05e5: Unknown result type (might be due to invalid IL or missing references) //IL_05ef: Expected O, but got Unknown //IL_0617: Unknown result type (might be due to invalid IL or missing references) //IL_0621: Expected O, but got Unknown //IL_063d: Unknown result type (might be due to invalid IL or missing references) //IL_064d: Unknown result type (might be due to invalid IL or missing references) //IL_0657: Expected O, but got Unknown //IL_068a: Unknown result type (might be due to invalid IL or missing references) //IL_0694: Expected O, but got Unknown //IL_06b5: Unknown result type (might be due to invalid IL or missing references) //IL_06bf: Expected O, but got Unknown //IL_06e0: Unknown result type (might be due to invalid IL or missing references) //IL_06ea: Expected O, but got Unknown //IL_070b: Unknown result type (might be due to invalid IL or missing references) //IL_0715: Expected O, but got Unknown //IL_0736: Unknown result type (might be due to invalid IL or missing references) //IL_0740: Expected O, but got Unknown //IL_0761: Unknown result type (might be due to invalid IL or missing references) //IL_076b: Expected O, but got Unknown //IL_078c: Unknown result type (might be due to invalid IL or missing references) //IL_0796: Expected O, but got Unknown //IL_07bb: Unknown result type (might be due to invalid IL or missing references) //IL_07c5: Expected O, but got Unknown //IL_07e1: Unknown result type (might be due to invalid IL or missing references) //IL_07f1: Unknown result type (might be due to invalid IL or missing references) //IL_07fb: Expected O, but got Unknown //IL_081c: Unknown result type (might be due to invalid IL or missing references) //IL_0826: Expected O, but got Unknown //IL_0842: Unknown result type (might be due to invalid IL or missing references) //IL_0852: Unknown result type (might be due to invalid IL or missing references) //IL_085c: Expected O, but got Unknown //IL_087d: Unknown result type (might be due to invalid IL or missing references) //IL_0887: Expected O, but got Unknown //IL_08a3: Unknown result type (might be due to invalid IL or missing references) //IL_08b3: Unknown result type (might be due to invalid IL or missing references) //IL_08bd: Expected O, but got Unknown //IL_08de: Unknown result type (might be due to invalid IL or missing references) //IL_08e8: Expected O, but got Unknown //IL_0904: Unknown result type (might be due to invalid IL or missing references) //IL_0914: Unknown result type (might be due to invalid IL or missing references) //IL_091e: Expected O, but got Unknown //IL_093f: Unknown result type (might be due to invalid IL or missing references) //IL_0949: Expected O, but got Unknown //IL_096a: Unknown result type (might be due to invalid IL or missing references) //IL_0974: Expected O, but got Unknown //IL_0990: Unknown result type (might be due to invalid IL or missing references) //IL_09a0: Unknown result type (might be due to invalid IL or missing references) //IL_09aa: Expected O, but got Unknown //IL_09c6: Unknown result type (might be due to invalid IL or missing references) //IL_09d6: Unknown result type (might be due to invalid IL or missing references) //IL_09e0: Expected O, but got Unknown //IL_0a01: Unknown result type (might be due to invalid IL or missing references) //IL_0a0b: Expected O, but got Unknown //IL_0a2c: Unknown result type (might be due to invalid IL or missing references) //IL_0a36: Expected O, but got Unknown //IL_0a52: Unknown result type (might be due to invalid IL or missing references) //IL_0a62: Unknown result type (might be due to invalid IL or missing references) //IL_0a6c: Expected O, but got Unknown //IL_0a8d: Unknown result type (might be due to invalid IL or missing references) //IL_0a97: Expected O, but got Unknown //IL_0ab3: Unknown result type (might be due to invalid IL or missing references) //IL_0ac3: Unknown result type (might be due to invalid IL or missing references) //IL_0acd: Expected O, but got Unknown //IL_0aee: Unknown result type (might be due to invalid IL or missing references) //IL_0af8: Expected O, but got Unknown //IL_0b14: Unknown result type (might be due to invalid IL or missing references) //IL_0b24: Unknown result type (might be due to invalid IL or missing references) //IL_0b2e: Expected O, but got Unknown //IL_0b4a: Unknown result type (might be due to invalid IL or missing references) //IL_0b5a: Unknown result type (might be due to invalid IL or missing references) //IL_0b64: Expected O, but got Unknown //IL_0b85: Unknown result type (might be due to invalid IL or missing references) //IL_0b8f: Expected O, but got Unknown //IL_0bc2: Unknown result type (might be due to invalid IL or missing references) //IL_0bcc: Expected O, but got Unknown //IL_0bed: Unknown result type (might be due to invalid IL or missing references) //IL_0bf7: Expected O, but got Unknown //IL_0c13: Unknown result type (might be due to invalid IL or missing references) //IL_0c23: Unknown result type (might be due to invalid IL or missing references) //IL_0c2d: Expected O, but got Unknown //IL_0c4e: Unknown result type (might be due to invalid IL or missing references) //IL_0c58: Expected O, but got Unknown //IL_0c79: Unknown result type (might be due to invalid IL or missing references) //IL_0c83: Expected O, but got Unknown //IL_0ca4: Unknown result type (might be due to invalid IL or missing references) //IL_0cae: Expected O, but got Unknown //IL_0cd3: Unknown result type (might be due to invalid IL or missing references) //IL_0ce3: Unknown result type (might be due to invalid IL or missing references) //IL_0ced: Expected O, but got Unknown //IL_0d1a: Unknown result type (might be due to invalid IL or missing references) //IL_0d2a: Unknown result type (might be due to invalid IL or missing references) //IL_0d34: Expected O, but got Unknown //IL_0d55: Unknown result type (might be due to invalid IL or missing references) //IL_0d5f: Expected O, but got Unknown //IL_0d80: Unknown result type (might be due to invalid IL or missing references) //IL_0d8a: Expected O, but got Unknown //IL_0dab: Unknown result type (might be due to invalid IL or missing references) //IL_0db5: Expected O, but got Unknown //IL_0dd6: Unknown result type (might be due to invalid IL or missing references) //IL_0de0: Expected O, but got Unknown //IL_0e09: Unknown result type (might be due to invalid IL or missing references) //IL_0e13: Expected O, but got Unknown //IL_0e34: Unknown result type (might be due to invalid IL or missing references) //IL_0e3e: Expected O, but got Unknown //IL_0e5f: Unknown result type (might be due to invalid IL or missing references) //IL_0e69: Expected O, but got Unknown //IL_0e8a: Unknown result type (might be due to invalid IL or missing references) //IL_0e94: Expected O, but got Unknown //IL_0ec7: Unknown result type (might be due to invalid IL or missing references) //IL_0ed1: Expected O, but got Unknown //IL_0ef2: Unknown result type (might be due to invalid IL or missing references) //IL_0efc: Expected O, but got Unknown //IL_0f1d: Unknown result type (might be due to invalid IL or missing references) //IL_0f27: Expected O, but got Unknown //IL_0f48: Unknown result type (might be due to invalid IL or missing references) //IL_0f52: Expected O, but got Unknown //IL_0f73: Unknown result type (might be due to invalid IL or missing references) //IL_0f7d: Expected O, but got Unknown //IL_0fa5: Unknown result type (might be due to invalid IL or missing references) //IL_0faf: Expected O, but got Unknown //IL_0fd7: Unknown result type (might be due to invalid IL or missing references) //IL_0fe1: Expected O, but got Unknown //IL_1002: Unknown result type (might be due to invalid IL or missing references) //IL_100c: Expected O, but got Unknown //IL_104a: Unknown result type (might be due to invalid IL or missing references) //IL_1050: Expected O, but got Unknown SalesHotkey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Sales Settings", "Sales Tablet Hotkey", new KeyboardShortcut((KeyCode)122, Array.Empty<KeyCode>()), new ConfigDescription("Hotkey to spawn a Sales Tablet in your hands.", (AcceptableValueBase)null, Array.Empty<object>())); SalesToggle = ((BaseUnityPlugin)this).Config.Bind<bool>("Sales Settings", "Sales Tablet Toggle", false, new ConfigDescription("Enables the hotkey to activate Sales Tablet", (AcceptableValueBase)null, Array.Empty<object>())); ClearSales = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Sales Settings", "Clear Sales", new KeyboardShortcut((KeyCode)120, Array.Empty<KeyCode>()), new ConfigDescription("Hotkey to clear current sales.", (AcceptableValueBase)null, Array.Empty<object>())); ToggleClearSalesHotkey = ((BaseUnityPlugin)this).Config.Bind<bool>("Sales Settings", "Enables or disables hotkey to clear sales", false, new ConfigDescription("Enables or disables the hotkey to clear sales", (AcceptableValueBase)null, Array.Empty<object>())); SalesActiveAmount = ((BaseUnityPlugin)this).Config.Bind<int>("Sales Settings", "Amount of sales unlocked each perk", 2, new ConfigDescription("Adjusts the amount of sales you unlock for each perk", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 100), Array.Empty<object>())); AutoSaveEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Auto Save Settings", "Enables Auto Saving", false, new ConfigDescription("Enables or disables automatic saving", (AcceptableValueBase)null, Array.Empty<object>())); AutoSaveTimer = ((BaseUnityPlugin)this).Config.Bind<int>("Auto Saving Settings", "Amount of time between saves", 120, new ConfigDescription("Adjusts the amount of time between auto saves in seconds, default is 120seconds or 2minutes", (AcceptableValueBase)(object)new AcceptableValueRange<int>(30, 900), Array.Empty<object>())); AutoSaveDuringDay = ((BaseUnityPlugin)this).Config.Bind<bool>("Auto Saving Settings", "Enables Auto Saving during the day", false, new ConfigDescription("Enables or disables saving while the store is open, default only autosaves while closed", (AcceptableValueBase)null, Array.Empty<object>())); EmployeExtraCheckoutMoney = ((BaseUnityPlugin)this).Config.Bind<float>("Employee & Customer Settings", "Employe Increased Income While Checking Customer Out Perk", 0.1f, new ConfigDescription("Adjust the amount of extra income you receive when an employee checks out a customer (Higher = more income)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 0.3f), Array.Empty<object>())); EmployeeCheckoutPerPerk = ((BaseUnityPlugin)this).Config.Bind<float>("Employee & Customer Settings", "Employee Checkout Time Reduction Perk 1", 0.15f, new ConfigDescription("Adjust the amount of time employees wait to scan items in checkout (Perk 1) (Lower = slower)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.01f, 0.24f), Array.Empty<object>())); MaxCustomerCart = ((BaseUnityPlugin)this).Config.Bind<int>("Employee & Customer Settings", "Maximum amount of product customers will buy", 25, new ConfigDescription("Adjust the maximum amount of product customers will buy", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 75), Array.Empty<object>())); BaseCustomerCart = ((BaseUnityPlugin)this).Config.Bind<int>("Employee & Customer Settings", "Minimum amount of product customers will buy", 5, new ConfigDescription("Adjust the minimum amount of product customers will buy", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 15), Array.Empty<object>())); BaseCustomerSpawns = ((BaseUnityPlugin)this).Config.Bind<int>("Employee & Customer Settings", "Minimum amount of customers that will spawn", 3, new ConfigDescription("Adjust the minimum amount of customer's that can spawn", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 9), Array.Empty<object>())); MaxCustomerInStore = ((BaseUnityPlugin)this).Config.Bind<int>("Employee & Customer Settings", "Max amount of customers in store", 70, new ConfigDescription("Adjust the amount of customers that can spawn at one time", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 210), Array.Empty<object>())); CustomersPerPerk = ((BaseUnityPlugin)this).Config.Bind<int>("Employee & Customer Settings", "Extra Customers per perk", 1, new ConfigDescription("Adjust the amount of customers you gain per perk (Higher number = more customers)", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 5), Array.Empty<object>())); EmployeesLevel = ((BaseUnityPlugin)this).Config.Bind<int>("Employee & Customer Settings", "Employees Level", 0, new ConfigDescription("Adjust the level of employee's that spawn (1 sets all of their stats to minimum, 30 sets them all to max)", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 30), Array.Empty<object>())); EmployeeSpeedPerPerk = ((BaseUnityPlugin)this).Config.Bind<float>("Employee & Customer Settings", "Employee Speed Per Perk", 0.2f, new ConfigDescription("Adjust the amount of speed employees gain per perk (Higher = faster)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.01f, 0.6f), Array.Empty<object>())); EmployeeRestockPerPerk = ((BaseUnityPlugin)this).Config.Bind<float>("Employee & Customer Settings", "Employee Restock Time Reduction Per Perk", 0.05f, new ConfigDescription("Adjust the amount of time it takes for employees to restock per perk (Lower = faster)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.01f, 0.15f), Array.Empty<object>())); AllNPCAreThieves = ((BaseUnityPlugin)this).Config.Bind<bool>("Thieves & Crime Settings", "All Thieves", false, new ConfigDescription("Causes every NPC to be a thief", (AcceptableValueBase)null, Array.Empty<object>())); SelfCheckoutTheft = ((BaseUnityPlugin)this).Config.Bind<bool>("Thieves & Crime Settings", "Self-Checkout Theft", true, new ConfigDescription("Enables or disables default game's theft from self checkout", (AcceptableValueBase)null, Array.Empty<object>())); DisableAllThieves = ((BaseUnityPlugin)this).Config.Bind<bool>("Thieves & Crime Settings", "Disable Thieves", false, new ConfigDescription("Prevent thieves from spawning (Does not stop checkout-related thieves)", (AcceptableValueBase)null, Array.Empty<object>())); OneHitThief = ((BaseUnityPlugin)this).Config.Bind<bool>("Thieves & Crime Settings", "Thiefs Drop Everything On Hit", false, new ConfigDescription("Thiefs Drop Everything On Hit", (AcceptableValueBase)null, Array.Empty<object>())); FasterCheckout = ((BaseUnityPlugin)this).Config.Bind<bool>("Gameplay Settings", "Faster Checkout", false, new ConfigDescription("Customers place all items instantly on to the checkout", (AcceptableValueBase)null, Array.Empty<object>())); ShowFPS = ((BaseUnityPlugin)this).Config.Bind<bool>("Gameplay Settings", "Show FPS Counter", false, (ConfigDescription)null); ShowPing = ((BaseUnityPlugin)this).Config.Bind<bool>("Gameplay Settings", "Show Ping Counter", false, (ConfigDescription)null); DisableAllTrash = ((BaseUnityPlugin)this).Config.Bind<bool>("Gameplay Settings", "Despawns trash", false, new ConfigDescription("Despawns all trash at the end of the day", (AcceptableValueBase)null, Array.Empty<object>())); AlwaysAbleToDeleteMode = ((BaseUnityPlugin)this).Config.Bind<bool>("Gameplay Settings", "Always access to delete", false, new ConfigDescription("Delete shelves and others while customers are in store and store is open", (AcceptableValueBase)null, Array.Empty<object>())); DeleteAllCheckouts = ((BaseUnityPlugin)this).Config.Bind<bool>("Gameplay Settings", "Enable or disable deleting all checkout lanes", false, new ConfigDescription("Adds the ability to delete every checkout lane", (AcceptableValueBase)null, Array.Empty<object>())); AllTrashToRecyclers = ((BaseUnityPlugin)this).Config.Bind<bool>("Gameplay Settings", "All Recyclers", false, new ConfigDescription("Turns the nearest trash can into a recycler without the perk.", (AcceptableValueBase)null, Array.Empty<object>())); StorageHighlighting = ((BaseUnityPlugin)this).Config.Bind<bool>("Highlighting", "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>())); EnableMTV = ((BaseUnityPlugin)this).Config.Bind<bool>("Mini Transport Vehicle", "Enable custom Mini Transport Vehicle features", false, new ConfigDescription("Enables or disables custom Mini Transport Vehicle features below.", (AcceptableValueBase)null, Array.Empty<object>())); AutoPickupRange = ((BaseUnityPlugin)this).Config.Bind<float>("Mini Transport Vehicle", "Change the range of auto-picking up boxes", 3f, new ConfigDescription("Adjusts how far away a box will be automatically picked up onto the Mini Transport Vehicle.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 30f), Array.Empty<object>())); MaxBoxes = ((BaseUnityPlugin)this).Config.Bind<int>("Mini Transport Vehicle", "Change the max boxes", 6, new ConfigDescription("Adjusts the max amount of boxes the Mini Transport Vehicle will hold at one time.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(6, 16), Array.Empty<object>())); MTVHotkey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Mini Transport Vehicle", "Change the drop hotkey", new KeyboardShortcut((KeyCode)108, Array.Empty<KeyCode>()), new ConfigDescription("Changes the hotkey used to dispense all boxes from the Mini Transport Vehicle instantly.", (AcceptableValueBase)null, Array.Empty<object>())); DropCooldown = ((BaseUnityPlugin)this).Config.Bind<float>("Mini Transport Vehicle", "Item Pickup Cooldown", 10f, new ConfigDescription("Changes how long it will wait to pickup boxes again after the drop hotkey has been pressed.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 30f), Array.Empty<object>())); EmployeeRerolls = ((BaseUnityPlugin)this).Config.Bind<bool>("Random Features", "Employee Rerolls", false, new ConfigDescription("Gives you unlimited rerolls to change your employees", (AcceptableValueBase)null, Array.Empty<object>())); OneClickCheckMark = ((BaseUnityPlugin)this).Config.Bind<bool>("Random Features", "Surveillance Camera One Click", false, new ConfigDescription("Makes all customers one click when using security console", (AcceptableValueBase)null, Array.Empty<object>())); AllowFreePlacement = ((BaseUnityPlugin)this).Config.Bind<bool>("Random Features", "Disable Placement Blocking", false, new ConfigDescription("Enables or disables you to place structures wherever, even overlapping", (AcceptableValueBase)null, Array.Empty<object>())); ProductStacking = ((BaseUnityPlugin)this).Config.Bind<bool>("Random Features", "Enable product stacking", false, new ConfigDescription("Enables or disables most products in the game to stack on shelves", (AcceptableValueBase)null, Array.Empty<object>())); EnablePalletDisplaysPerk = ((BaseUnityPlugin)this).Config.Bind<bool>("Random Features", "Enable pallet displays", false, new ConfigDescription("Enables pallet displays without unlocking the perk.", (AcceptableValueBase)null, Array.Empty<object>())); ReplaceCommasWithPeriods = ((BaseUnityPlugin)this).Config.Bind<bool>("Random Features", "Replace commas with periods", false, new ConfigDescription("Changes all commas in the game into periods.", (AcceptableValueBase)null, Array.Empty<object>())); CurrencyTypeToAny = ((BaseUnityPlugin)this).Config.Bind<string>("Random Features", "CurrencySymbol", "$", new ConfigDescription("Sets the currency symbol used in the game. Default is $.", (AcceptableValueBase)null, Array.Empty<object>())); LadderHotkey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Hotkey Configurations", "Sledgehammer Hotkey", new KeyboardShortcut((KeyCode)109, Array.Empty<KeyCode>()), new ConfigDescription("Hotkey to spawn a Sledgehammer in your hands.", (AcceptableValueBase)null, Array.Empty<object>())); LadderToggle = ((BaseUnityPlugin)this).Config.Bind<bool>("Hotkey Configurations", "Sledgehammer Toggle", false, new ConfigDescription("Enables the hotkey to activate Sledgehammer", (AcceptableValueBase)null, Array.Empty<object>())); SledgeHotkey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Hotkey Configurations", "Sledgehammer Hotkey", new KeyboardShortcut((KeyCode)106, Array.Empty<KeyCode>()), new ConfigDescription("Hotkey to spawn a Sledgehammer in your hands.", (AcceptableValueBase)null, Array.Empty<object>())); SledgeToggle = ((BaseUnityPlugin)this).Config.Bind<bool>("Hotkey Configurations", "Sledgehammer Toggle", false, new ConfigDescription("Enables the hotkey to activate Sledgehammer", (AcceptableValueBase)null, Array.Empty<object>())); OsMartHotkey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Hotkey Configurations", "Os Mart 2.0 Tablet Hotkey", new KeyboardShortcut((KeyCode)104, Array.Empty<KeyCode>()), new ConfigDescription("Hotkey to spawn a Os Mart 2.0 Tablet in your hands.", (AcceptableValueBase)null, Array.Empty<object>())); OsMartToggle = ((BaseUnityPlugin)this).Config.Bind<bool>("Hotkey Configurations", "Os Mart 2.0 Toggle", false, new ConfigDescription("Enables the hotkey to activate Os Mart 2.0", (AcceptableValueBase)null, Array.Empty<object>())); TrayHotkey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Hotkey Configurations", "Tray Hotkey", new KeyboardShortcut((KeyCode)107, Array.Empty<KeyCode>()), new ConfigDescription("Hotkey to spawn a Tray in your hands.", (AcceptableValueBase)null, Array.Empty<object>())); TrayToggle = ((BaseUnityPlugin)this).Config.Bind<bool>("Hotkey Configurations", "Tray Toggle", false, new ConfigDescription("Enables the hotkey to activate Tray", (AcceptableValueBase)null, Array.Empty<object>())); ClockToggle = ((BaseUnityPlugin)this).Config.Bind<bool>("Hotkey Configurations", "Enable hotkey for clock", false, new ConfigDescription("Enables or disabled hotkey activating clock.", (AcceptableValueBase)null, Array.Empty<object>())); ClockHotkey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Hotkey Configurations", "Toggle Clock", new KeyboardShortcut((KeyCode)111, Array.Empty<KeyCode>()), new ConfigDescription("Hotkey to enable/disable the clock", (AcceptableValueBase)null, Array.Empty<object>())); ThirdPersonHotkey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Hotkey Configurations", "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>("Hotkey Configurations", "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>())); PricingGunToggle = ((BaseUnityPlugin)this).Config.Bind<bool>("Hotkey Configurations", "Pricing Gun Toggle", false, new ConfigDescription("Enables the hotkey to activate Pricing Gun", (AcceptableValueBase)null, Array.Empty<object>())); PricingGunHotkey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Hotkey Configurations", "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>("Hotkey Configurations", "Broom Toggle", false, new ConfigDescription("Enables the hotkey to activate Broom", (AcceptableValueBase)null, Array.Empty<object>())); BroomHotkey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Hotkey Configurations", "Broom Hotkey", new KeyboardShortcut((KeyCode)117, Array.Empty<KeyCode>()), new ConfigDescription("Hotkey to spawn a Broom in your hands.", (AcceptableValueBase)null, Array.Empty<object>())); DLCTabletToggle = ((BaseUnityPlugin)this).Config.Bind<bool>("Hotkey Configurations", "DLC Tablet Toggle", false, new ConfigDescription("Enables the hotkey to activate DLC Tablet", (AcceptableValueBase)null, Array.Empty<object>())); DLCTabletHotkey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Hotkey Configurations", "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>())); EmptyHandsHotkey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Hotkey Configurations", "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>())); AutoAdjustPriceDaily = ((BaseUnityPlugin)this).Config.Bind<bool>("Pricing Assistance", "Auto Adjust Prices Daily", false, new ConfigDescription("Enables or disables automatically doubling the price of products daily", (AcceptableValueBase)null, Array.Empty<object>())); AutoAdjustPriceDailyValue = ((BaseUnityPlugin)this).Config.Bind<float>("Pricing Assistance", "Adjust the amount prices are automatically set to every day", 2f, new ConfigDescription("Adjusts the amount prices are set to be multiplied by daily. Value of 2x is 2$ * 2 = 4$. Value of 1.99x is 2$*1.99=3.98", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 2f), Array.Empty<object>())); ToggleDoublePrice = ((BaseUnityPlugin)this).Config.Bind<bool>("Double Price Gun", "Enable or disable double price module", false, new ConfigDescription("Enables or disables the price gun automatically having 2x the market price", (AcceptableValueBase)null, Array.Empty<object>())); KeyboardShortcutDoublePrice = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Double Price Gun", "Enable Double Price module", new KeyboardShortcut((KeyCode)113, Array.Empty<KeyCode>()), new ConfigDescription("Hotkey to enable and disable double price module", (AcceptableValueBase)null, Array.Empty<object>())); roundDown = ((BaseUnityPlugin)this).Config.Bind<bool>("Double Price Gun", "Enable rounding down", false, new ConfigDescription("Enables rounding down to prevent 'Too Expensive'", (AcceptableValueBase)null, Array.Empty<object>())); NearestFive = ((BaseUnityPlugin)this).Config.Bind<bool>("Double Price Gun", "Enable rounding down to nearest 0.05", true, new ConfigDescription("Enable rounding down to the nearest fifth", (AcceptableValueBase)null, Array.Empty<object>())); NearestTen = ((BaseUnityPlugin)this).Config.Bind<bool>("Double Price Gun", "Enable rounding down to nearest 0.10", false, new ConfigDescription("Enable rounding down to the nearest tenth", (AcceptableValueBase)null, Array.Empty<object>())); KeyboardShortcutRoundDownSwitch = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Double Price Gun", "Round Down Shortcuts", new KeyboardShortcut((KeyCode)113, (KeyCode[])(object)new KeyCode[1] { (KeyCode)306 }), new ConfigDescription("Hotkey to round down the double price", (AcceptableValueBase)null, Array.Empty<object>())); KeyboardShortcutRoundDownToggle = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Double Price Gun", "Round Down Hotkey", new KeyboardShortcut((KeyCode)113, (KeyCode[])(object)new KeyCode[2] { (KeyCode)306, (KeyCode)304 }), new ConfigDescription("Hotkey to round down to setting set", (AcceptableValueBase)null, Array.Empty<object>())); SaveGame = ((BaseUnityPlugin)this).Config.Bind<bool>("Random QoL", "Save Game Button", true, new ConfigDescription("Enables or disables the Save Game button in the ESC menu", (AcceptableValueBase)null, Array.Empty<object>())); LoanEarly = ((BaseUnityPlugin)this).Config.Bind<bool>("Random QoL", "Payoff Loans Early", false, new ConfigDescription("Enables or disables a button to pay off loans early", (AcceptableValueBase)null, Array.Empty<object>())); Tutorial = ((BaseUnityPlugin)this).Config.Bind<bool>("Random QoL", "Enables or disables the tutorial", false, new ConfigDescription("Enables or disables the tutorial at the start of a fresh save", (AcceptableValueBase)null, Array.Empty<object>())); NumberKeys = ((BaseUnityPlugin)this).Config.Bind<bool>("Random QoL", "Enables normal numbers", false, new ConfigDescription("Enables or disables using non-numpad numbers to set prices", (AcceptableValueBase)null, Array.Empty<object>())); CardboardBalerValue = ((BaseUnityPlugin)this).Config.Bind<int>("Random QoL", "Cardboard Baler", 10, new ConfigDescription("Adjust the amount of boxes required for the cardboard baler to spit out a bale", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 50), Array.Empty<object>())); QuickStocking = ((BaseUnityPlugin)this).Config.Bind<bool>("Random QoL", "Enables quick stocking", false, new ConfigDescription("Enables or disables stocking the entire box onto shelf in one click", (AcceptableValueBase)null, Array.Empty<object>())); AutoOrdering = ((BaseUnityPlugin)this).Config.Bind<bool>("Random QoL", "Enables auto-ordering items", false, new ConfigDescription("Enables or disables automatically adding enough stock to the shopping order when picking up the OS Mart device", (AcceptableValueBase)null, Array.Empty<object>())); ClockMorning = ((BaseUnityPlugin)this).Config.Bind<bool>("Random QoL", "Enables clock usage in morning", false, new ConfigDescription("Enables or disables using the clock in the morning", (AcceptableValueBase)null, Array.Empty<object>())); ClockSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("Random QoL", "Clock Speed", 5f, new ConfigDescription("Adjust the amount of speed enabling the clock gives", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 15f), Array.Empty<object>())); DisableBoxCollisions = ((BaseUnityPlugin)this).Config.Bind<bool>("Random QoL", "Enable or disable collision with boxes", false, new ConfigDescription("Enables or disables collision with boxes allowing them to stack inside of each other https://i.imgur.com/ffJrHOA.jpeg", (AcceptableValueBase)null, Array.Empty<object>())); FastBoxSpawns = ((BaseUnityPlugin)this).Config.Bind<bool>("Random QoL", "Enable or disable fast spawning of boxes", false, new ConfigDescription("Enables or disables making purchases boxes spawn quickly https://i.imgur.com/92Ex4V6.png", (AcceptableValueBase)null, Array.Empty<object>())); MissingProductNotifications = ((BaseUnityPlugin)this).Config.Bind<bool>("Random QoL", "Enable or disable notification Missing Product", false, new ConfigDescription("Enables or disables the notification for missing products", (AcceptableValueBase)null, Array.Empty<object>())); TooExpensiveNotifications = ((BaseUnityPlugin)this).Config.Bind<bool>("Random QoL", "Enable or disable notification Too Expensive", false, new ConfigDescription("Enables or disables the notification for too expensive products", (AcceptableValueBase)null, Array.Empty<object>())); SelfCheckoutLimit = ((BaseUnityPlugin)this).Config.Bind<int>("Random QoL", "Product limit on self checkout", 4, new ConfigDescription("Limits the amount of item's a customer can have before using the self checkout", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>())); MaxBoxSize = ((BaseUnityPlugin)this).Config.Bind<int>("Random QoL", "Modify amount of products in boxes", 1, new ConfigDescription("** WARNING THIS IS EXTREMELY BUGGY IN MULTIPLAYER ** Multiples the amount of product in a box, aswell as it's cost. Higher = more products in box and higher cost https://imgur.com/a/QT5l2Ky", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 25), Array.Empty<object>())); AutoPayAllInvoices = ((BaseUnityPlugin)this).Config.Bind<bool>("Debt", "Enables or disables automatic invoice payment", false, new ConfigDescription("Enables or disables paying for invoices automatically", (AcceptableValueBase)null, Array.Empty<object>())); Instance = this; Logger = ((BaseUnityPlugin)this).Logger; harmony.PatchAll(); Logger.LogInfo((object)"Plugin BetterSMT v2.3.0 is loaded!"); Harmony.DEBUG = true; GameObject val = new GameObject("ManualSaleClearHotkeyListener"); val.AddComponent<ManualSaleClearHotkeyListener>(); Object.DontDestroyOnLoad((Object)(object)val); } 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 = "2.3.0"; } } namespace BetterSMT.Patches { [HarmonyPatch(typeof(BoxData))] public static class BoxDataPatch { private static int _initialLayer = -1; [HarmonyPostfix] [HarmonyPatch("OnStartClient")] public static void OnStartClientPostfix(BoxData __instance) { ConfigEntry<bool> disableBoxCollisions = BetterSMT.DisableBoxCollisions; if (disableBoxCollisions != null && disableBoxCollisions.Value && !((Object)(object)((__instance != null) ? ((Component)__instance).gameObject : null) == (Object)null)) { ApplyCollisionChanges(((Component)__instance).gameObject); } } private static void ApplyCollisionChanges(GameObject boxObject) { _initialLayer = ((_initialLayer == -1) ? boxObject.layer : _initialLayer); boxObject.layer = 20; Physics.IgnoreLayerCollision(20, 20, true); } } [HarmonyPatch(typeof(Builder_Main))] public class Builder_MainPatch { public static float lastSellTime = 0f; private static bool wasBuildButtonPressedLastFrame = false; private static readonly float SellCooldownSeconds = 0.05f; [HarmonyPatch(typeof(Builder_Main), "RetrieveInitialBehaviours")] [HarmonyPriority(600)] [HarmonyPostfix] public static void ProductStackingWaitEndOfIEnumerable() { if (!BetterSMT.ProductStacking.Value) { return; } GameObject[] productPrefabs = ProductListing.Instance.productPrefabs; Data_Product val2 = default(Data_Product); foreach (GameObject val in productPrefabs) { if (!((Object)(object)val == (Object)null) && val.TryGetComponent<Data_Product>(ref val2)) { val2.isStackable = val2.productID != 0; } } } [HarmonyPatch("DeleteBehaviour")] [HarmonyPrefix] public static bool DeleteWheneverPatch(Builder_Main __instance) { HandleMovableObjects(__instance); HandleDecorations(__instance); return false; } [HarmonyPatch(typeof(Builder_Main), "BuildableBehaviour")] [HarmonyPrefix] public static bool BuildableBehaviourPatch(Builder_Main __instance) { //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_0276: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) __instance.correctSector = __instance.CheckCorrectGround(); if (BetterSMT.AllowFreePlacement.Value) { __instance.overlapping = false; __instance.canPlace = __instance.correctSector; HighlightEffect val = default(HighlightEffect); if (__instance.dummyOBJ.TryGetComponent<HighlightEffect>(ref val)) { val.glowHQColor = (__instance.canPlace ? Color.green : Color.red); } } else { __instance.overlapping = __instance.pmakerFSM.FsmVariables.GetFsmBool("Overlapping").Value; if (__instance.correctSector && !__instance.overlapping && !__instance.canPlace) { __instance.canPlace = true; HighlightEffect val2 = default(HighlightEffect); if (__instance.dummyOBJ.TryGetComponent<HighlightEffect>(ref val2)) { val2.glowHQColor = Color.green; } } if ((!__instance.correctSector || __instance.overlapping) && __instance.canPlace) { __instance.canPlace = false; HighlightEffect val3 = default(HighlightEffect); if (__instance.dummyOBJ.TryGetComponent<HighlightEffect>(ref val3)) { val3.glowHQColor = Color.red; } } } bool buttonDown = __instance.MainPlayer.GetButtonDown("Build"); if (buttonDown && !wasBuildButtonPressedLastFrame && __instance.canPlace) { wasBuildButtonPressedLastFrame = true; Quaternion rotation; if (__instance.currentElementIndex == 0) { NetworkIdentity val4 = default(NetworkIdentity); if ((Object)(object)__instance.currentMovedOBJ != (Object)null && __instance.currentMovedOBJ.TryGetComponent<NetworkIdentity>(ref val4)) { NetworkSpawner component = ((Component)GameData.Instance).GetComponent<NetworkSpawner>(); GameObject currentMovedOBJ = __instance.currentMovedOBJ; Vector3 position = __instance.dummyOBJ.transform.position; rotation = __instance.dummyOBJ.transform.rotation; component.GetMoveData(currentMovedOBJ, position, ((Quaternion)(ref rotation)).eulerAngles); __instance.currentMovedOBJ.GetComponent<Data_Container>().RemoveMoveEffect(); __instance.currentMovedOBJ = null; __instance.recentlyMoved = true; if ((Object)(object)__instance.dummyOBJ != (Object)null) { Object.Destroy((Object)(object)__instance.dummyOBJ); } } } else if (!BetterSMT.AllowFreePlacement.Value && GameData.Instance.gameFunds < __instance.buildableCost) { GameCanvas.Instance.CreateCanvasNotification("message6"); } else { NetworkSpawner component2 = ((Component)GameData.Instance).GetComponent<NetworkSpawner>(); int currentPropIndex = __instance.currentPropIndex; Vector3 position2 = __instance.dummyOBJ.transform.position; rotation = __instance.dummyOBJ.transform.rotation; component2.CmdSpawn(currentPropIndex, position2, ((Quaternion)(ref rotation)).eulerAngles); } } else if (!buttonDown) { wasBuildButtonPressedLastFrame = false; } __instance.SharedBehaviour(); return false; } private static bool HandleMovableObjects(Builder_Main __instance) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) if (Time.time - lastSellTime < SellCooldownSeconds) { return false; } 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)(object)__instance.oldHitOBJ2 != (Object)null && (Object)(object)((Component)((RaycastHit)(ref val)).transform).gameObject != (Object)(object)__instance.oldHitOBJ2 && (Object)(object)__instance.hEffect2 != (Object)null) { __instance.hEffect2.highlighted = false; } __instance.hEffect2 = ((Component)((RaycastHit)(ref val)).transform).GetComponent<HighlightEffect>(); if ((Object)(object)__instance.hEffect2 != (Object)null) { __instance.hEffect2.highlighted = true; } else { Debug.LogWarning((object)"HighlightEffect not found on Movable object!"); } if (__instance.MainPlayer.GetButtonDown("Build") || __instance.MainPlayer.GetButtonDown("Main Action") || __instance.MainPlayer.GetButtonDown("Secondary Action")) { if (!BetterSMT.AlwaysAbleToDeleteMode.Value) { if (GameData.Instance.isSupermarketOpen) { GameCanvas.Instance.CreateCanvasNotification("message15"); return false; } if (NPC_Manager.Instance.customersnpcParentOBJ.transform.childCount > 0) { GameCanvas.Instance.CreateCanvasNotification("message16"); return false; } } if (__instance.FurnitureContainsProduct(((RaycastHit)(ref val)).transform) && !__instance.MainPlayer.GetButton("Drop Item")) { GameCanvas.Instance.CreateCanvasNotification("message17a"); return false; } if ((Object)(object)((Component)((RaycastHit)(ref val)).transform).GetComponent<Data_Container>() != (Object)null) { int containerID = ((Component)((RaycastHit)(ref val)).transform).GetComponent<Data_Container>().containerID; if (!BetterSMT.DeleteAllCheckouts.Value && (containerID == 6 || containerID == 7) && ((Component)((Component)GameData.Instance).GetComponent<NetworkSpawner>().levelPropsOBJ.transform.GetChild(2)).transform.childCount == 1) { GameCanvas.Instance.CreateCanvasNotification("checkoutwarning"); return false; } } if ((Object)(object)((Component)((RaycastHit)(ref val)).transform).GetComponent<NetworkIdentity>() != (Object)null) { float num = (float)((Component)((RaycastHit)(ref val)).transform).GetComponent<Data_Container>().cost * 0.9f; if (__instance.MainPlayer.GetButton("Drop Item")) { try { MethodInfo method = typeof(Builder_Main).GetMethod("CalculateShelfProductCost", BindingFlags.Instance | BindingFlags.NonPublic); if (method != null) { num += (float)method.Invoke(__instance, new object[1] { ((RaycastHit)(ref val)).transform }); } } catch (Exception ex) { Debug.LogError((object)("Reflection error: " + ex.Message)); } } GameData.Instance.CmdAlterFundsWithoutExperience(num); ((Component)GameData.Instance).GetComponent<NetworkSpawner>().CmdDestroyBox(((Component)((RaycastHit)(ref val)).transform).gameObject); lastSellTime = Time.time; } } __instance.oldHitOBJ2 = ((Component)((RaycastHit)(ref val)).transform).gameObject; return true; } if ((Object)(object)__instance.hEffect2 != (Object)null) { __instance.hEffect2.highlighted = false; } } else if ((Object)(object)__instance.hEffect2 != (Object)null) { __instance.hEffect2.highlighted = false; } return false; } private static bool HandleDecorations(Builder_Main __instance) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) if (Time.time - lastSellTime < SellCooldownSeconds) { return false; } 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("Decoration")) { if ((Object)(object)__instance.oldHitOBJ != (Object)null && (Object)(object)((Component)((RaycastHit)(ref val)).transform).gameObject != (Object)(object)__instance.oldHitOBJ && (Object)(object)__instance.hEffect != (Object)null) { ((Behaviour)__instance.hEffect).enabled = false; } Transform obj = ((RaycastHit)(ref val)).transform.Find("Mesh"); HighlightEffect val2 = ((obj != null) ? ((Component)obj).GetComponent<HighlightEffect>() : null); if ((Object)(object)val2 != (Object)null) { __instance.hEffect = val2; ((Behaviour)__instance.hEffect).enabled = true; } else { Debug.LogWarning((object)"HighlightEffect not found on Decoration!"); } if ((__instance.MainPlayer.GetButtonDown("Build") || __instance.MainPlayer.GetButtonDown("Main Action") || __instance.MainPlayer.GetButtonDown("Secondary Action")) && (Object)(object)((Component)((RaycastHit)(ref val)).transform).GetComponent<NetworkIdentity>() != (Object)null) { float num = ((Component)((RaycastHit)(ref val)).transform).GetComponent<BuildableInfo>().cost * 0.9f; GameData.Instance.CmdAlterFundsWithoutExperience(num); ((Component)GameData.Instance).GetComponent<NetworkSpawner>().CmdDestroyBox(((Component)((RaycastHit)(ref val)).transform).gameObject); lastSellTime = Time.time; } __instance.oldHitOBJ = ((Component)((RaycastHit)(ref val)).transform).gameObject; return true; } if ((Object)(object)__instance.hEffect != (Object)null) { ((Behaviour)__instance.hEffect).enabled = false; } } else if ((Object)(object)__instance.hEffect != (Object)null) { ((Behaviour)__instance.hEffect).enabled = false; } return false; } } [HarmonyPatch(typeof(CardboardBaler))] public static class CardboardBalerPatch { private static readonly FieldInfo BoxesLimitField = typeof(CardboardBaler).GetField("boxesLimitToCreateACardboardBale", BindingFlags.Instance | BindingFlags.NonPublic); public static bool Prepare() { return BetterSMT.CardboardBalerValue.Value != 10; } [HarmonyPostfix] [HarmonyPatch(/*Could not decode attribute arguments.*/)] public static void SetBoxLimitPostfix(CardboardBaler __instance) { BoxesLimitField?.SetValue(__instance, BetterSMT.CardboardBalerValue.Value); } [HarmonyPatch("OnStartServer")] [HarmonyPostfix] private static void OnStartServerPatch() { float num = BetterSMT.CardboardBalerValue.Value; if (Mathf.Approximately(num, 10f)) { return; } PlayMakerFSM[] array = Object.FindObjectsOfType<PlayMakerFSM>(); foreach (PlayMakerFSM val in array) { if (val.FsmName != "Behaviour" || !((Object)((Component)val).gameObject).name.StartsWith("Trash_Recycle")) { continue; } FsmState[] fsmStates = val.FsmStates; foreach (FsmState val2 in fsmStates) { FsmStateAction[] actions = val2.Actions; foreach (FsmStateAction val3 in actions) { FloatOperator val4 = (FloatOperator)(object)((val3 is FloatOperator) ? val3 : null); if (val4 != null && Mathf.Approximately(val4.float1.Value, 15f)) { val4.float1.Value = num; } } } } } } [HarmonyPatch(typeof(CustomCameraController), "LateUpdate")] public class LateUpdateRaycastPatch { private static bool isThirdPersonEnabled; private static void Postfix(CustomCameraController __instance) { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: 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) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)__instance == (Object)null) && !FsmVariables.GlobalVariables.GetFsmBool("InChat").Value && !__instance.inVehicle && !__instance.isInCameraEvent && BetterSMT.ThirdPersonToggle.Value) { KeyboardShortcut value = BetterSMT.ThirdPersonHotkey.Value; if (((KeyboardShortcut)(ref value)).IsDown()) { isThirdPersonEnabled = !isThirdPersonEnabled; } __instance.inEmoteEvent = isThirdPersonEnabled; Cinemachine3rdPersonFollow thirdPersonFollow = __instance.thirdPersonFollow; if ((Object)(object)thirdPersonFollow != (Object)null) { thirdPersonFollow.CameraDistance = (isThirdPersonEnabled ? 2f : 0f); thirdPersonFollow.CameraCollisionFilter = (isThirdPersonEnabled ? __instance.thirdPersonDefaultLayerMask : LayerMask.op_Implicit(0)); } __instance.ShowCharacter(isThirdPersonEnabled); } } } [HarmonyPatch(typeof(Data_Container), "AddItemToRow")] internal class Patch_AddItemToRow { private static bool Prefix(Data_Container __instance, int containerNumber, int productIDToAdd) { //IL_00b3: 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_00c1: 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) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) if (!BetterSMT.QuickStocking.Value) { return true; } if (!((Component)FirstPersonController.Instance).GetComponent<PlayerPermissions>().RequestRP()) { return false; } bool flag = !((NetworkBehaviour)__instance).isServer && FsmVariables.GlobalVariables.FindFsmBool("HighLatencyMode").Value; if (flag && __instance.highLatencyCooldown) { return false; } if (!Object.op_Implicit((Object)(object)__instance.productlistComponent)) { __instance.productlistComponent = ((Component)GameData.Instance).GetComponent<ProductListing>(); } GameObject val = __instance.productlistComponent.productPrefabs[productIDToAdd]; Vector3 size = val.GetComponent<BoxCollider>().size; if (__instance.isVolumeRestricted && size.x * size.y * size.z < __instance.productVolumeLimit) { GameCanvas.Instance.CreateCanvasNotification("message20"); return false; } if (val.GetComponent<Data_Product>().productContainerClass != __instance.containerClass) { GameCanvas.Instance.CreateCanvasNotification("message0"); return false; } bool isStackable = val.GetComponent<Data_Product>().isStackable; int num = Mathf.FloorToInt(__instance.shelfLength / (size.x * 1.1f)); num = Mathf.Clamp(num, 1, 100); int num2 = Mathf.FloorToInt(__instance.shelfWidth / (size.z * 1.1f)); num2 = Mathf.Clamp(num2, 1, 100); int num3 = num * num2; if (isStackable) { int num4 = Mathf.FloorToInt(__instance.shelfHeight / (size.y * 1.1f)); num4 = Mathf.Clamp(num4, 1, 100); num3 = num * num2 * num4; } int num5 = containerNumber * 2; int num6 = __instance.productInfoArray[num5]; int num7 = __instance.productInfoArray[num5 + 1]; if (num7 >= num3) { GameCanvas.Instance.CreateCanvasNotification("message1"); return false; } if (num6 != productIDToAdd && num6 != -1 && num7 != 0) { GameCanvas.Instance.CreateCanvasNotification("message2"); return false; } PlayerNetwork component = ((Component)FirstPersonController.Instance).GetComponent<PlayerNetwork>(); if (flag) { ((MonoBehaviour)__instance).StartCoroutine(__instance.HighLatencyCoroutine()); int num8 = num3 - num7; int extraParameter = component.extraParameter2; int num9 = Mathf.Min(num8, extraParameter); if (num9 <= 0) { GameCanvas.Instance.CreateCanvasNotification("message1"); return false; } component.extraParameter2 -= num9; num7 += num9; AchievementsManager.Instance.CmdAddAchievementPoint(1, num9); } else { int extraParameter2 = component.extraParameter2; int num10 = num3 - num7; int num11 = Mathf.Min(extraParameter2, num10); if (num11 <= 0) { GameCanvas.Instance.CreateCanvasNotification("message1"); return false; } AchievementsManager.Instance.CmdAddAchievementPoint(1, num11); component.extraParameter2 -= num11; num7 += num11; } GameData.Instance.PlayPopSound(); __instance.productInfoArray[num5 + 1] = num7; __instance.CmdUpdateArrayValues(num5, productIDToAdd, num7); return 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.EmployeesLevel.Value != 0) { 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(GameCanvas))] internal class NotificationHandler { [HarmonyPatch("Update")] [HarmonyPostfix] public static void NotificationHandler_Postfix(GameCanvas __instance, ref bool ___inCooldown) { if (!BetterSMT.ToggleDoublePrice.Value || !BetterSMT.notify) { return; } ___inCooldown = false; BetterSMT.notify = false; string text = "`"; switch (BetterSMT.notificationType) { default: return; case "priceToggle": text = text + "Double Price: " + (BetterSMT.doublePrice ? "ON" : "OFF"); break; case "roundDownSwitch": text = text + "Rounding to nearest " + (BetterSMT.NearestTen.Value ? "ten" : "five"); if (!BetterSMT.roundDown.Value) { text += "\r\n(Currently disabled)"; } break; case "roundDownToggle": text = text + "Rounding has been " + (BetterSMT.roundDown.Value ? "enabled" : "disabled"); break; } __instance.CreateCanvasNotification(text); } } [HarmonyPatch(typeof(GameData))] public class GameDataPatch { public class BetterSMTLoanSystem : NetworkBehaviour { [Command(requiresAuthority = false)] public void CmdPayLoanEarly() { DebtManager component = ((Component)GameData.Instance).GetComponent<DebtManager>(); int networkloanAmount = component.NetworkloanAmount; if (networkloanAmount <= 0) { BetterSMT.CreateImportantNotification("No active loan to pay."); return; } if (GameData.Instance.gameFunds < (float)networkloanAmount) { BetterSMT.CreateImportantNotification("Not enough funds to pay off the loan."); return; } GameData.Instance.CmdAlterFundsWithoutExperience((float)(-networkloanAmount)); component.NetworkloanAmount = 0; component.NetworkloanPaymentPerDay = 0; int num = default(int); float num2 = default(float); int num3 = default(int); int num4 = default(int); string text2 = default(string); for (int i = 0; i < component.NetworkcurrentInvoicesData.Length; i++) { string text = component.NetworkcurrentInvoicesData[i]; if (!string.IsNullOrEmpty(text)) { component.GetInvoiceDataValues(text, ref num, ref num2, ref num3, ref num4, ref text2); if (num == 0) { component.NetworkcurrentInvoicesData[i] = ""; } } } if ((Object)(object)component.loanDisclaimerContainerOBJ != (Object)null && component.loanDisclaimerContainerOBJ.activeSelf) { component.loanDisclaimerContainerOBJ.SetActive(false); } component.GenerateExistingDebtsInUI(); BetterSMT.CreateImportantNotification("Loan paid off early."); } } [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static UnityAction <>9__3_0; public static UnityAction <>9__7_0; internal void <UpdateInvoiceMenu>b__3_0() { BetterSMT.Logger.LogInfo((object)"Pay Invoice Early button clicked."); if ((Object)(object)loanSystemInstance != (Object)null && NetworkClient.active) { loanSystemInstance.CmdPayLoanEarly(); } else { BetterSMT.CreateImportantNotification("Loan system not initialized."); } } internal void <UpdateEscapeMenu>b__7_0() { ((MonoBehaviour)GameData.Instance).StartCoroutine(SaveGame()); } } [CompilerGenerated] private sealed class <SaveGame>d__8 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private NetworkSpawner <spawner>5__1; private PlayMakerFSM <fsm>5__2; private FsmBool <isSavingVar>5__3; private float <timeout>5__4; private float <elapsed>5__5; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <SaveGame>d__8(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <spawner>5__1 = null; <fsm>5__2 = null; <isSavingVar>5__3 = null; <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <spawner>5__1 = ((Component)GameData.Instance).GetComponent<NetworkSpawner>(); if (<spawner>5__1.isSaving) { BetterSMT.CreateImportantNotification("Saving already in progress"); return false; } BetterSMT.CreateImportantNotification("Saving Game"); GameData.Instance.DoDaySaveBackup(); <fsm>5__2 = GameData.Instance.SaveOBJ.GetComponent<PlayMakerFSM>(); <isSavingVar>5__3 = <fsm>5__2.FsmVariables.GetFsmBool("IsSaving"); <isSavingVar>5__3.Value = true; <fsm>5__2.SendEvent("Send_Data"); <timeout>5__4 = 10f; <elapsed>5__5 = 0f; goto IL_0125; case 1: <>1__state = -1; goto IL_0125; case 2: { <>1__state = -1; BetterSMT.CreateImportantNotification("Saving Finished"); return false; } IL_0125: if (<isSavingVar>5__3.Value) { if (<elapsed>5__5 > <timeout>5__4) { BetterSMT.CreateImportantNotification("Save timed out."); return false; } <elapsed>5__5 += Time.deltaTime; <>2__current = null; <>1__state = 1; return true; } <>2__current = <spawner>5__1.SavePropsCoroutine(); <>1__state = 2; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static readonly Dictionary<int, string> productNames = new Dictionary<int, string> { { 0, "Pasta Penne" }, { 1, "Water Bottle" }, { 2, "Honey Cereals" }, { 3, "Rice" }, { 4, "Salt" }, { 5, "Sugar" }, { 6, "Margarine" }, { 7, "Flour" }, { 8, "Apple Juice" }, { 9, "Olive Oil" }, { 10, "Ketchup" }, { 11, "Sliced Bread" }, { 12, "Pepper" }, { 13, "Orange Juice" }, { 14, "Barbaque Sauce" }, { 15, "Mustard Sauce" }, { 16, "Spaghetti Box" }, { 17, "Tuna Pate" }, { 18, "Fiber Cereals" }, { 19, "Supreme Flour" }, { 20, "Black Coffee" }, { 21, "Egg Box" }, { 22, "Houmous" }, { 23, "White Flour" }, { 24, "Cane Sugar Box" }, { 25, "Sugar" }, { 26, "Macarroni" }, { 27, "Ecologic Sugar" }, { 28, "Brown Sugar" }, { 29, "Sunflower Oil" }, { 30, "Mash Potatoes" }, { 31, "Potato Bag" }, { 32, "Espresso Coffee" }, { 33, "Basmati Rice" }, { 34, "Long Grain Rice" }, { 35, "Coffee" }, { 36, "Supreme Pasta" }, { 37, "Chocolate Cereals" }, { 38, "Premium Water" }, { 39, "Spring Water" }, { 40, "Powdered Sugar" }, { 41, "Sugar - Big Box" }, { 42, "Brown Sugar - Big Box" }, { 43, "Emmental Cheese" }, { 44, "Gruyere Cheese" }, { 45, "Skimmed Cheese" }, { 46, "Fruit Yoghurt" }, { 47, "Vanilla Yoghurt" }, { 48, "Milk Brick" }, { 49, "Butter" }, { 50, "Parmigiano Cheese" }, { 51, "Reggiano Cheese" }, { 52, "Mozzarella Cheese" }, { 53, "Skimmed Yoghurt" }, { 54, "Cola Pack" }, { 55, "Soda Pack" }, { 56, "Decaf Soda Pack" }, { 57, "Soda Bottle" }, { 58, "Cola Bottle" }, { 59, "Sugar Free Soda Bottle" }, { 60, "Premium Soda" }, { 61, "Pizza Barbaque" }, { 62, "Fondue" }, { 63, "Crocanti Ham" }, { 64, "Ham Cheese Crepe" }, { 65, "French Fries" }, { 66, "Crispy Potato Pops" }, { 67, "Green Beans" }, { 68, "Four Cheese Pizza" }, { 69, "Four Seasons Pizza" }, { 70, "Vegetable Mix" }, { 71, "Chicken Mix" }, { 72, "Bolognaise Lasagna" }, { 73, "Vegetable Lasagna" }, { 74, "Toothpaste" }, { 75, "Toilet Paper" }, { 76, "Hand Soap" }, { 77, "Avocado Shampoo" }, { 78, "Egg Shampoo" }, { 79, "Bath Gel" }, { 80, "Toilet Paper" }, { 81, "Mango Soap" }, { 82, "Extra Soft Shampoo" }, { 83, "Jojoba Honey Shampoo" }, { 84, "Argan Oil Shampoo" }, { 85, "Paper Towel" }, { 86, "Double Side Toilet Paper" }, { 87, "Lemon Soap" }, { 88, "Premium Bath Gel" }, { 89, "Shampoo For Babies" }, { 90, "Detergent" }, { 91, "Stain Remover" }, { 92, "Glass Cleaner" }, { 93, "Detergent Tables" }, { 94, "Dishwasher" }, { 95, "Bleach" }, { 96, "Bleach - Big Bottle" }, { 97, "Softener" }, { 98, "Premium Detergent" }, { 99, "Insecticide" }, { 100, "Cleaning Cloths" }, { 101, "Premium Capsules" }, { 102, "Premium Bleach" }, { 103, "Ammonia" }, { 104, "Cookie Jar" }, { 105, "Maxi Cone" }, { 106, "Chocolate Spread" }, { 107, "Chocolate Powder" }, { 108, "Chips" }, { 109, "Sweet Bonbek" }, { 110, "Peach Jam" }, { 111, "Ice Cream Box" }, { 112, "Chocolate Box" }, { 113, "Chocolate Biscuit" }, { 114, "Vanilate Biscuit" }, { 115, "Madeleine" }, { 116, "Strawberry Jam" }, { 117, "Peanut Butter" }, { 118, "Chipos" }, { 119, "Marshmallow" }, { 120, "Lemon Biscuit" }, { 121, "Hazelnut Biscuit" }, { 122, "Premium Ice Cream" }, { 123, "Honey" }, { 124, "Premium Chocolate Box" }, { 125, "Foditos" }, { 126, "Premium Cake" }, { 127, "Chopped Beef" }, { 128, "Pure Beef" }, { 129, "Veal" }, { 130, "Chicken Wings" }, { 131, "Chicken" }, { 132, "Parma Ham" }, { 133, "Sliced Ham" }, { 134, "Peas - Big" }, { 135, "Tuna - Big" }, { 136, "Red Beans" }, { 137, "Cat Food" }, { 138, "Cat Food" }, { 139, "Dog Food" }, { 140, "Green Tea" }, { 141, "Lemon Tea" }, { 142, "Black Tea" }, { 143, "Peppermint" }, { 144, "Mint" }, { 145, "Valerian" }, { 146, "Big Sushi" }, { 147, "Small Sushi" }, { 148, "Smoked Salmon" }, { 149, "Crab Sticks" }, { 150, "Book - Electromagnetic" }, { 151, "Book - Surprise" }, { 152, "Book - ABC" }, { 153, "Book - Mother And Child" }, { 154, "Book - Colors" }, { 155, "Book - Piticha" }, { 156, "Book - OnceUpon" }, { 157, "Book - Krok" }, { 158, "Book - Adventures" }, { 159, "Book - Donnine" }, { 160, "Book - Vintage" }, { 161, "Book - I Wont Share" }, { 162, "Beer Pack" }, { 163, "Beer Pack" }, { 164, "Beer Pack" }, { 165, "Beer Barrel" }, { 166, "Beer Barrel" }, { 167, "Vodka" }, { 168, "Red Wine" }, { 169, "Rose Wine" }, { 170, "White Wine" }, { 171, "Beer Barrel" }, { 172, "Premium Vodka" }, { 173, "Japanese Whisky" }, { 174, "Premium Whisky" }, { 175, "Premium Whisky" }, { 176, "Hydrogen Peroxide" }, { 177, "Disinfectant" }, { 178, "Ibuprofen" }, { 179, "Paracetamol" }, { 180, "Adhesive Bandages" }, { 181, "Laxative" }, { 182, "Antihistamine" }, { 183, "Zinc Supplement" }, { 184, "Antioxidant" }, { 185, "Fish Oil" }, { 186, "Algae Pills" }, { 187, "Vitamins" }, { 188, "Melatonin" }, { 189, "Sunscreen" }, { 190, "Stretch Cream" }, { 191, "Red Apple Tray" }, { 192, "Green Apple Tray" }, { 193, "Clementine Tray" }, { 194, "Orange Tray" }, { 195, "Pear Tray" }, { 196, "Lemon Tray" }, { 197, "Mango Tray" }, { 198, "Avocado Tray" }, { 199, "Kiwi Tray" }, { 200, "Papaya Tray" }, { 201, "Strawberry Tray" }, { 202, "Cherry Tray" }, { 203, "Artichoke Tray" }, { 204, "Zucchini Tray" }, { 205, "Carrot Tray" }, { 206, "Tomato Tray" }, { 207, "Potato Tray" }, { 208, "Onion Tray" }, { 209, "Banana Pack" }, { 210, "Melon" }, { 211, "Pineapple" }, { 212, "Pumpkin" }, { 213, "Watermelon" }, { 214, "Baby Food: Vegetables" }, { 215, "Baby Food: Fish" }, { 216, "Baby Food: Fruits" }, { 217, "Baby Food: Meat" }, { 218, "Nutritive Milk Mix" }, { 219, "Nutritive Milk Powder" }, { 220, "Ecologic Diapers" }, { 221, "Basic Diapers" }, { 222, "Toddler Diapers" }, { 223, "Premium Diapers" }, { 224, "Aloe Baby Wipes " }, { 225, "Basic Baby Wipes" }, { 226, "Baby Powder" }, { 227, "Orange Soda" }, { 228, "Pineapple Soda" }, { 229, "Tropical Soda" }, { 230, "Green Tea Drink" }, { 231, "Red Tea Drink" }, { 232, "Lemon Tea Drink" }, { 233, "Cold Brew Coffee" }, { 234, "Blueberry Energy Drink" }, { 235, "Guava Energy Drink" }, { 236, "Lima Energy Drink" }, { 237, "Fruit Punch Energy Drink" }, { 238, "Mango Energy Drink" }, { 239, "Cola Energy Drink" }, { 240, "Sugar Free Energy Drink" }, { 241, "Basic Strawberry Ice Cream" }, { 242, "Lemon Ice Cream" }, { 243, "Coffee Ice Cream" }, { 244, "Stracciatella Ice Cream" }, { 245, "Strawberry Meringue Ice Cream" }, { 246, "Caramel Ice Cream" }, { 247, "Premium Strawberry Ice Cream" }, { 248, "Strawberry Cheesecake Ice Cream" }, { 249, "Premium Caramel Ice Cream" }, { 250, "Pink Strawberry Ice Cream" }, { 251, "Alcoholic Ice Cream" }, { 252, "Chickpeas" }, { 253, "Meatballs" }, { 254, "Lentils" }, { 255, "Tomato Soup" }, { 256, "Canned Corn" }, { 257, "Canned Peas" }, { 258, "Strawberry Seeds" }, { 259, "Raspberry Seeds" }, { 260, "Blueberry Seeds" }, { 261, "Pineapple Seeds" }, { 262, "Meyer Lemon Seeds" }, { 263, "Tomato Seeds" }, { 264, "Pepper Seeds" }, { 265, "Cucumber Seeds" }, { 266, "Radish Seeds" }, { 267, "Carrots Seeds" }, { 268, "Lawn Seeds" }, { 269, "Poppy Seeds" }, { 270, "Tulip Seeds" }, { 271, "Sunflower Seeds" }, { 272, "Petunia Seeds" }, { 273, "Hand Rake (A)" }, { 274, "Hand Rake (B)" }, { 275, "Hand Shovel" }, { 276, "Hand Cultivator" }, { 277, "Potting Soil" }, { 278, "Fertilizer" }, { 279, "Plant Pot Dish" }, { 280, "Plant Pot" }, { 281, "AA Batteries" }, { 282, "AAA Batteries" }, { 283, "C Batteries" }, { 284, "9V Batteries" }, { 285, "Universal TV Remote" }, { 286, "Universal Phone Charger" }, { 287, "Basic Prepaid Phone" }, { 288, "Basic Mouse" }, { 289, "Wifi Dongle" }, { 290, "Basic Earbuds" }, { 291, "Basic Keyboard" }, { 292, "Basic Gamepad" }, { 293, "USB Flash Drive (128GB)" }, { 294, "USB Flash Drive (256GB)" }, { 295, "USB Flash Drive (512GB)" }, { 296, "USB Flash Drive (1TB)" }, { 297, "Basic Speaker" }, { 298, "Basic Headphones" }, { 299, "Basic Gaming Console" } }; private static BetterSMTLoanSystem loanSystemInstance; [HarmonyPatch("OnStartClient")] [HarmonyPostfix] private static void AutopayInvoices(DebtManager __instance) { if (!((Object)(object)__instance == (Object)null)) { __instance.autopayInvoices = BetterSMT.AutoPayAllInvoices?.Value ?? false; } } [HarmonyPatch("OnStartClient")] [HarmonyPostfix] private static void UpdateInvoiceMenu() { //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Expected O, but got Unknown //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_011c: 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) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Expected O, but got Unknown //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: Unknown result type (might be due to invalid IL or missing references) //IL_029a: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Expected O, but got Unknown if (!BetterSMT.LoanEarly.Value) { return; } GameObject val = GameObject.Find("Interactables/Canvas_Manager/Tabs/Invoices_Tab/"); if ((Object)(object)val == (Object)null) { BetterSMT.Logger.LogWarning((object)"Invoice Menu not found."); return; } Transform obj = val.transform.Find("PayThisInvoiceButton"); GameObject val2 = ((obj != null) ? ((Component)obj).gameObject : null); if ((Object)(object)val2 == (Object)null) { BetterSMT.Logger.LogWarning((object)"PayThisInvoiceButton not found."); return; } GameObject val3 = new GameObject("PayInvoiceEarlyButton", new Type[4] { typeof(RectTransform), typeof(CanvasRenderer), typeof(Image), typeof(Button) }); val3.transform.SetParent(val.transform, false); RectTransform component = val3.GetComponent<RectTransform>(); RectTransform component2 = val2.GetComponent<RectTransform>(); component.anchorMin = component2.anchorMin; component.anchorMax = component2.anchorMax; component.pivot = component2.pivot; component.sizeDelta = component2.sizeDelta; component.anchoredPosition = new Vector2(431f, -109f); Image component3 = val3.GetComponent<Image>(); Image component4 = val2.GetComponent<Image>(); component3.sprite = component4.sprite; component3.type = component4.type; ((Graphic)component3).color = ((Graphic)component4).color; GameObject val4 = new GameObject("PayInvoiceEarly_Text", new Type[3] { typeof(RectTransform), typeof(CanvasRenderer), typeof(TextMeshProUGUI) }); val4.transform.SetParent(val3.transform, false); RectTransform component5 = val4.GetComponent<RectTransform>(); component5.anchorMin = Vector2.zero; component5.anchorMax = Vector2.one; component5.offsetMin = Vector2.zero; component5.offsetMax = Vector2.zero; TextMeshProUGUI component6 = val4.GetComponent<TextMeshProUGUI>(); ((TMP_Text)component6).text = "Pay Loan Early"; ((TMP_Text)component6).alignment = (TextAlignmentOptions)514; ((TMP_Text)component6).fontSize = 24f; ((Graphic)component6).color = Color.black; TextMeshProUGUI componentInChildren = val2.GetComponentInChildren<TextMeshProUGUI>(); if ((Object)(object)componentInChildren != (Object)null) { ((TMP_Text)component6).font = ((TMP_Text)componentInChildren).font; ((Graphic)component6).material = ((Graphic)componentInChildren).material; } Button component7 = val3.GetComponent<Button>(); ButtonClickedEvent onClick = component7.onClick; object obj2 = <>c.<>9__3_0; if (obj2 == null) { UnityAction val5 = delegate { BetterSMT.Logger.LogInfo((object)"Pay Invoice Early button clicked."); if ((Object)(object)loanSystemInstance != (Object)null && NetworkClient.active) { loanSystemInstance.CmdPayLoanEarly(); } else { BetterSMT.CreateImportantNotification("Loan system not initialized."); } }; <>c.<>9__3_0 = val5; obj2 = (object)val5; } ((UnityEvent)onClick).AddListener((UnityAction)obj2); Button component8 = val2.GetComponent<Button>(); ((Selectable)component7).transition = ((Selectable)component8).transition; ((Selectable)component7).colors = ((Selectable)component8).colors; ((Selectable)component7).navigation = ((Selectable)component8).navigation; if (!((NetworkBehaviour)GameData.Instance).isServer) { val3.SetActive(false); } } [HarmonyPatch("Awake")] [HarmonyPostfix] private static void EnsureLoanSystemComponent(GameData __instance) { loanSystemInstance = ((Component)__instance).GetComponent<BetterSMTLoanSystem>(); if ((Object)(object)loanSystemInstance == (Object)null) { loanSystemInstance = ((Component)__instance).gameObject.AddComponent<BetterSMTLoanSystem>(); } } [HarmonyPatch(typeof(GameData), "ServerCalculateNewInflation")] [HarmonyPostfix] public static void OptimizeProductPrices() { if (!BetterSMT.AutoAdjustPriceDaily.Value) { return; } ProductListing instance = ProductListing.Instance; GameObject[] productPrefabs = instance.productPrefabs; float[] tierInflation = instance.tierInflation; float value = BetterSMT.AutoAdjustPriceDailyValue.Value; for (int i = 0; i < productPrefabs.Length; i++) { Data_Product component = productPrefabs[i].GetComponent<Data_Product>(); if (!((Object)(object)component == (Object)null)) { float basePricePerUnit = component.basePricePerUnit; int productTier = component.productTier; float num = ((productTier >= 0 && productTier < tierInflation.Length) ? tierInflation[productTier] : 1f); float num2 = basePricePerUnit * num * value; float num3 = Mathf.Floor(num2 * 100f) / 100f; instance.CmdUpdateProductPrice(i, num3); } } } [HarmonyPatch("OnStartClient")] [HarmonyPostfix] private static void UpdateEscapeMenu() { //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: 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_0179: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Expected O, but got Unknown GameObject val = GameObject.Find("MasterOBJ/MasterCanvas/Menus/EscapeMenu/"); if ((Object)(object)val == (Object)null) { BetterSMT.Logger.LogWarning((object)"EscapeMenu not found."); return; } Transform obj = val.transform.Find("QuitButton"); GameObject val2 = ((obj != null) ? ((Component)obj).gameObject : null); Transform obj2 = val.transform.Find("MainMenuButton"); GameObject val3 = ((obj2 != null) ? ((Component)obj2).gameObject : null); Transform obj3 = val.transform.Find("OptionsButton"); GameObject val4 = ((obj3 != null) ? ((Component)obj3).gameObject : null); if ((Object)(object)val2 == (Object)null || (Object)(object)val3 == (Object)null) { BetterSMT.Logger.LogWarning((object)"Quit or MainMenu button not found."); return; } val2.transform.localPosition = new Vector3(0f, 0f, 0f); val3.transform.localPosition = new Vector3(0f, 85f, 0f); GameObject val5 = Object.Instantiate<GameObject>(val2, val.transform); ((Object)val5).name = "SaveButton"; PlayMakerFSM[] components = val5.GetComponents<PlayMakerFSM>(); foreach (PlayMakerFSM val6 in components) { Object.Destroy((Object)(object)val6); } Object.Destroy((Object)(object)val5.GetComponent<EventTrigger>()); val5.transform.localPosition = new Vector3(0f, -85f, 0f); val5.transform.localScale = val2.transform.localScale; TextMeshProUGUI componentInChildren = val5.GetComponentInChildren<TextMeshProUGUI>(); if ((Object)(object)componentInChildren != (Object)null) { ((TMP_Text)componentInChildren).text = "Save Game"; } Button component = val5.GetComponent<Button>(); ButtonClickedEvent onClick = component.onClick; object obj4 = <>c.<>9__7_0; if (obj4 == null) { UnityAction val7 = delegate { ((MonoBehaviour)GameData.Instance).StartCoroutine(SaveGame()); }; <>c.<>9__7_0 = val7; obj4 = (object)val7; } ((UnityEvent)onClick).AddListener((UnityAction)obj4); if (!((NetworkBehaviour)GameData.Instance).isServer) { val5.SetActive(false); } } [IteratorStateMachine(typeof(<SaveGame>d__8))] public static IEnumerator SaveGame() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <SaveGame>d__8(0); } [HarmonyPatch("OnStartClient")] [HarmonyPostfix] public static void ShowCounters() { if (BetterSMT.ShowPing.Value) { EnableUIElement("MasterOBJ/MasterCanvas/Ping", "Ping"); } if (BetterSMT.ShowFPS.Value) { EnableUIElement("MasterOBJ/MasterCanvas/FPSDisplay", "FPSDisplay"); } } private static void EnableUIElement(string path, string label) { GameObject val = GameObject.Find(path); if ((Object)(object)val == (Object)null) { BetterSMT.Logger.LogWarning((object)("Couldn't find " + label + " object at path '" + path + "'")); } else { val.SetActive(true); } } [HarmonyPatch("AddExpensiveList")] [HarmonyPostfix] public static void AddExpensiveListPatch(GameData __instance, int productID) { NotifyAndTrack(__instance.productsTooExpensiveList, productID, BetterSMT.TooExpensiveNotifications.Value, "{0} is too expensive.", __instance); } [HarmonyPatch("AddNotFoundList")] [HarmonyPostfix] public static void AddNotFoundListPatch(GameData __instance, int productID) { NotifyAndTrack(__instance.productsNotFoundList, productID, BetterSMT.MissingProductNotifications.Value, "{0} is not found on the shelf.", __instance); } private static void NotifyAndTrack(List<int> list, int productID, bool notifyEnabled, string messageTemplate, GameData __instance) { if (!list.Contains(productID)) { list.Add(productID); } if (notifyEnabled) { string value; string arg = (productNames.TryGetValue(productID, out value) ? value : $"Product {productID}"); PlayerObjectController val = Object.FindObjectOfType<PlayerObjectController>(); string text = string.Format(messageTemplate, arg); if (val != null) { val.CmdSendMessage(text, (NetworkConnectionToClient)null); } } } [HarmonyPatch(typeof(GameData), "UserCode_CmdOpenSupermarket")] [HarmonyPostfix] public static void MaxCustomersNPCsPatch(GameData __instance) { if (__instance.isSupermarketOpen || (__instance.timeOfDay > 8f && __instance.timeOfDay < 23f)) { int count = NetworkServer.connections.Count; int value = BetterSMT.BaseCustomerCart.Value; int value2 = BetterSMT.MaxCustomerCart.Value; int value3 = BetterSMT.BaseCustomerSpawns.Value; int value4 = BetterSMT.MaxCustomerInStore.Value; __instance.maxProductsCustomersToBuy = Mathf.Clamp(value + __instance.gameDay / 2 + count + __instance.difficulty, value, value2 + count + __instance.difficulty); __instance.maxCustomersNPCs = Mathf.Clamp(value3 + __instance.gameDay + (count - 1) * 4 + __instance.extraCustomersPerk + __instance.difficulty * 2, value3, value4 + count); } } [HarmonyPatch("TrashManager")] [HarmonyPostfix] public static void NextTimeToSpawnTrashPatch(GameData __instance) { if (BetterSMT.DisableAllTrash.Value) { __instance.nextTimeToSpawnTrash = float.MaxValue; } } } [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 ManagerBlackboardPatch { [CompilerGenerated] private sealed class <CalculateShoppingListTotalOverride>d__1 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public ManagerBlackboard __instance; private IEnumerator <>s__1; private Transform <item>5__2; private string <text>5__3; private string <cleanedText>5__4; private float <price>5__5; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <CalculateShoppingListTotalOverride>d__1(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>s__1 = null; <item>5__2 = null; <text>5__3 = null; <cleanedText>5__4 = null; <>1__state = -2; } private bool MoveNext() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; if (BetterSMT.ReplaceCommasWithPeriods.Value) { <>2__current = (object)new WaitForEndOfFrame(); <>1__state = 1; return true; } break; case 1: <>1__state = -1; __instance.shoppingTotalCharge = 0f; if (__instance.shoppingListParent.transform.childCount > 0) { <>s__1 = __instance.shoppingListParent.transform.GetEnumerator(); try { while (<>s__1.MoveNext()) { <item>5__2 = (Transform)<>s__1.Current; <text>5__3 = ((TMP_Text)((Component)((Component)<item>5__2).transform.Find("BoxPrice")).GetComponent<TextMeshProUGUI>()).text; string text = <text>5__3; <cleanedText>5__4 = text.Substring(2, text.Length - 2).Trim(); if (float.TryParse(<cleanedText>5__4, NumberStyles.Float, CultureInfo.InvariantCulture, out <price>5__5)) { ManagerBlackboard _instance = __instance; _instance.shoppingTotalCharge += <price>5__5; } <text>5__3 = null; <cleanedText>5__4 = null; <item>5__2 = null; } } finally { if (<>s__1 is IDisposable disposable) { disposable.Dispose(); } } <>s__1 = null; } ((TMP_Text)__instance.totalChargeOBJ).text = ProductListing.Instance.ConvertFloatToTextPrice(__instance.shoppingTotalCharge); break; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [HarmonyPatch(/*Could not decode attribute arguments.*/)] [HarmonyTranspiler] private static IEnumerable<CodeInstruction> InstantCargoSpawner(IEnumerable<CodeInstruction> instructions) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Expected O, but got Unknown return BetterSMT.FastBoxSpawns.Value ? new CodeMatcher(instructions, (ILGenerator)null).Start().MatchForward(false, (CodeMatch[])(object)new CodeMatch[1] { new CodeMatch((OpCode?)OpCodes.Newobj, (object)AccessTools.Constructor(typeof(WaitForSeconds), new Type[1] { typeof(float) }, false), (string)null) }).Repeat((Action<CodeMatcher>)delegate(CodeMatcher matcher) { matcher.Advance(-1); matcher.SetOperandAndAdvance((object)0.01f); matcher.Advance(1); }, (Action<string>)null) .InstructionEnumeration() : instructions; } [IteratorStateMachine(typeof(<CalculateShoppingListTotalOverride>d__1))] public static IEnumerator CalculateShoppingListTotalOverride(ManagerBlackboard __instance) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <CalculateShoppingListTotalOverride>d__1(0) { __instance = __instance }; } [HarmonyPatch(typeof(ManagerBlackboard), "RemoveShoppingListProduct")] [HarmonyPrefix] public static bool RemoveShoppingListProductPatch(ManagerBlackboard __instance, int indexToRemove) { if (BetterSMT.ReplaceCommasWithPeriods.Value) { if (__instance.shoppingListParent.transform.childCount > 0) { Object.Destroy((Object)(object)((Component)__instance.shoppingListParent.transform.GetChild(indexToRemove)).gameObject); } ((MonoBehaviour)__instance).StartCoroutine(CalculateShoppingListTotalOverride(__instance)); return false; } return true; } [HarmonyPatch(typeof(ManagerBlackboard), "RemoveAllShoppingList")] [HarmonyPrefix] public static bool RemoveAllShoppingListPatch(ManagerBlackboard __instance) { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown if (BetterSMT.ReplaceCommasWithPeriods.Value) { if (__instance.shoppingListParent.transform.childCount == 0) { return false; } foreach (Transform item in __instance.shoppingListParent.transform) { Transform val = item; Object.Destroy((Object)(object)((Component)val).gameObject); } ((MonoBehaviour)__instance).StartCoroutine(CalculateShoppingListTotalOverride(__instance)); return false; } return true; } [HarmonyPatch("AddShoppingListProduct")] [HarmonyPrefix] public static bool AddShoppingListProductPatch(ManagerBlackboard __instance, int productID, float boxPrice) { Debug.Log((object)$"Trying to add productID {productID} at {Time.time}"); if (!BetterSMT.ReplaceCommasWithPeriods.Value) { return true; } ProductListing component = ((Component)__instance).GetComponent<ProductListing>(); GameObject val = Object.Instantiate<GameObject>(__instance.UIShoppingListPrefab, __instance.shoppingListParent.transform); string text = "product" + productID; string localizationString = LocalizationManager.instance.GetLocalizationString(text); ((TMP_Text)((Component)val.transform.Find("ProductName