Decompiled source of WorstsSMT v1.0.0
BepInEx/plugins/BetterSMT.dll
Decompiled a day 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.Linq; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using HighlightPlus; using HutongGames.PlayMaker; using Microsoft.CodeAnalysis; using Mirror; using TMPro; using UnityEngine; using UnityEngine.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.1.0.0")] [assembly: AssemblyInformationalVersion("2.1.0+a59b1dea6b1abbeda7841257c4bc2b49850a6f5a")] [assembly: AssemblyProduct("BetterSMT")] [assembly: AssemblyTitle("BetterSMT")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("2.1.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace BetterSMT { [BepInPlugin("BetterSMT", "BetterSMT", "2.1.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<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> EmployeeCheckoutPerPerk1; public static ConfigEntry<float> EmployeeCheckoutPerPerk2; public static ConfigEntry<float> EmployeeCheckoutPerPerk3; public static ConfigEntry<float> EmployeExtraCheckoutMoney; public static ConfigEntry<float> LightCostMod; public static ConfigEntry<float> RentCostMod; public static ConfigEntry<float> EmployeeCostMod; public static ConfigEntry<bool> OneHitThief; public static ConfigEntry<bool> SelfCheckoutTheft; public static ConfigEntry<bool> DisableAllThieves; public static ConfigEntry<bool> AllNPCAreThieves; public static ConfigEntry<bool> FasterCheckout; public static ConfigEntry<bool> ShowFPS; public static ConfigEntry<bool> ShowPing; public static ConfigEntry<bool> 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> EnablePalletDisplaysPerk; public static ConfigEntry<bool> ReplaceCommasWithPeriods; public static ConfigEntry<string> CurrencyTypeToAny; public static ConfigEntry<bool> StorageHighlighting; public static ConfigEntry<bool> SalesToggle; public static ConfigEntry<KeyboardShortcut> SalesHotkey; 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<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; internal static ManualLogSource Logger { get; private set; } = null; private void Awake() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Expected O, but got Unknown //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Expected O, but got Unknown //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Expected O, but got Unknown //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Expected O, but got Unknown //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Expected O, but got Unknown //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Expected O, but got Unknown //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Expected O, but got Unknown //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Expected O, but got Unknown //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Expected O, but got Unknown //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Expected O, but got Unknown //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Expected O, but got Unknown //IL_029d: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Expected O, but got Unknown //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: Expected O, but got Unknown //IL_0300: Unknown result type (might be due to invalid IL or missing references) //IL_030a: Expected O, but got Unknown //IL_032b: Unknown result type (might be due to invalid IL or missing references) //IL_0335: Expected O, but got Unknown //IL_0368: Unknown result type (might be due to invalid IL or missing references) //IL_0372: Expected O, but got Unknown //IL_03a5: Unknown result type (might be due to invalid IL or missing references) //IL_03af: Expected O, but got Unknown //IL_03e2: Unknown result type (might be due to invalid IL or missing references) //IL_03ec: Expected O, but got Unknown //IL_041f: Unknown result type (might be due to invalid IL or missing references) //IL_0429: Expected O, but got Unknown //IL_045c: Unknown result type (might be due to invalid IL or missing references) //IL_0466: Expected O, but got Unknown //IL_0487: Unknown result type (might be due to invalid IL or missing references) //IL_0491: Expected O, but got Unknown //IL_04b2: Unknown result type (might be due to invalid IL or missing references) //IL_04bc: Expected O, but got Unknown //IL_04dd: Unknown result type (might be due to invalid IL or missing references) //IL_04e7: Expected O, but got Unknown //IL_0508: Unknown result type (might be due to invalid IL or missing references) //IL_0512: Expected O, but got Unknown //IL_0533: Unknown result type (might be due to invalid IL or missing references) //IL_053d: Expected O, but got Unknown //IL_0596: Unknown result type (might be due to invalid IL or missing references) //IL_05a0: Expected O, but got Unknown //IL_05c1: Unknown result type (might be due to invalid IL or missing references) //IL_05cb: Expected O, but got Unknown //IL_05ec: Unknown result type (might be due to invalid IL or missing references) //IL_05f6: 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_0642: Unknown result type (might be due to invalid IL or missing references) //IL_064c: Expected O, but got Unknown //IL_066d: Unknown result type (might be due to invalid IL or missing references) //IL_0677: Expected O, but got Unknown //IL_0698: Unknown result type (might be due to invalid IL or missing references) //IL_06a2: Expected O, but got Unknown //IL_06c7: Unknown result type (might be due to invalid IL or missing references) //IL_06d1: Expected O, but got Unknown //IL_06ed: Unknown result type (might be due to invalid IL or missing references) //IL_06fd: Unknown result type (might be due to invalid IL or missing references) //IL_0707: Expected O, but got Unknown //IL_0728: Unknown result type (might be due to invalid IL or missing references) //IL_0732: Expected O, but got Unknown //IL_074e: Unknown result type (might be due to invalid IL or missing references) //IL_075e: Unknown result type (might be due to invalid IL or missing references) //IL_0768: Expected O, but got Unknown //IL_0789: Unknown result type (might be due to invalid IL or missing references) //IL_0793: Expected O, but got Unknown //IL_07af: Unknown result type (might be due to invalid IL or missing references) //IL_07bf: Unknown result type (might be due to invalid IL or missing references) //IL_07c9: Expected O, but got Unknown //IL_07ea: Unknown result type (might be due to invalid IL or missing references) //IL_07f4: Expected O, but got Unknown //IL_0810: Unknown result type (might be due to invalid IL or missing references) //IL_0820: Unknown result type (might be due to invalid IL or missing references) //IL_082a: Expected O, but got Unknown //IL_084b: Unknown result type (might be due to invalid IL or missing references) //IL_0855: Expected O, but got Unknown //IL_0871: Unknown result type (might be due to invalid IL or missing references) //IL_0881: Unknown result type (might be due to invalid IL or missing references) //IL_088b: Expected O, but got Unknown //IL_08ac: Unknown result type (might be due to invalid IL or missing references) //IL_08b6: Expected O, but got Unknown //IL_08d7: Unknown result type (might be due to invalid IL or missing references) //IL_08e1: Expected O, but got Unknown //IL_08fd: Unknown result type (might be due to invalid IL or missing references) //IL_090d: Unknown result type (might be due to invalid IL or missing references) //IL_0917: Expected O, but got Unknown //IL_0933: Unknown result type (might be due to invalid IL or missing references) //IL_0943: Unknown result type (might be due to invalid IL or missing references) //IL_094d: Expected O, but got Unknown //IL_096e: Unknown result type (might be due to invalid IL or missing references) //IL_0978: Expected O, but got Unknown //IL_0999: Unknown result type (might be due to invalid IL or missing references) //IL_09a3: Expected O, but got Unknown //IL_09bf: Unknown result type (might be due to invalid IL or missing references) //IL_09cf: Unknown result type (might be due to invalid IL or missing references) //IL_09d9: Expected O, but got Unknown //IL_09fa: Unknown result type (might be due to invalid IL or missing references) //IL_0a04: Expected O, but got Unknown //IL_0a20: Unknown result type (might be due to invalid IL or missing references) //IL_0a30: Unknown result type (might be due to invalid IL or missing references) //IL_0a3a: Expected O, but got Unknown //IL_0a5b: Unknown result type (might be due to invalid IL or missing references) //IL_0a65: Expected O, but got Unknown //IL_0a81: Unknown result type (might be due to invalid IL or missing references) //IL_0a91: Unknown result type (might be due to invalid IL or missing references) //IL_0a9b: Expected O, but got Unknown //IL_0ab7: Unknown result type (might be due to invalid IL or missing references) //IL_0ac7: Unknown result type (might be due to invalid IL or missing references) //IL_0ad1: Expected O, but got Unknown //IL_0af2: Unknown result type (might be due to invalid IL or missing references) //IL_0afc: Expected O, but got Unknown //IL_0b2f: Unknown result type (might be due to invalid IL or missing references) //IL_0b39: Expected O, but got Unknown //IL_0b5a: Unknown result type (might be due to invalid IL or missing references) //IL_0b64: Expected O, but got Unknown //IL_0b80: Unknown result type (might be due to invalid IL or missing references) //IL_0b90: Unknown result type (might be due to invalid IL or missing references) //IL_0b9a: Expected O, but got Unknown //IL_0bbb: Unknown result type (might be due to invalid IL or missing references) //IL_0bc5: Expected O, but got Unknown //IL_0be6: Unknown result type (might be due to invalid IL or missing references) //IL_0bf0: Expected O, but got Unknown //IL_0c11: Unknown result type (might be due to invalid IL or missing references) //IL_0c1b: Expected O, but got Unknown //IL_0c40: Unknown result type (might be due to invalid IL or missing references) //IL_0c50: Unknown result type (might be due to invalid IL or missing references) //IL_0c5a: Expected O, but got Unknown //IL_0c87: Unknown result type (might be due to invalid IL or missing references) //IL_0c97: Unknown result type (might be due to invalid IL or missing references) //IL_0ca1: Expected O, but got Unknown //IL_0cc2: Unknown result type (might be due to invalid IL or missing references) //IL_0ccc: Expected O, but got Unknown //IL_0cff: Unknown result type (might be due to invalid IL or missing references) //IL_0d09: Expected O, but got Unknown //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_0ddd: Unknown result type (might be due to invalid IL or missing references) //IL_0de7: Expected O, but got Unknown //IL_0e0f: Unknown result type (might be due to invalid IL or missing references) //IL_0e19: Expected O, but got Unknown 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>())); 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>())); EmployeeCheckoutPerPerk1 = ((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.45f), Array.Empty<object>())); EmployeeCheckoutPerPerk2 = ((BaseUnityPlugin)this).Config.Bind<float>("Employee & Customer Settings", "Employee Checkout Time Reduction Perk 2", 0.2f, new ConfigDescription("Adjust the amount of time employees wait to scan items in checkout (Perk 2) (Lower = slower)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.01f, 0.6f), Array.Empty<object>())); EmployeeCheckoutPerPerk3 = ((BaseUnityPlugin)this).Config.Bind<float>("Employee & Customer Settings", "Employee Checkout Time Reduction Perk 3", 0.15f, new ConfigDescription("Adjust the amount of time employees wait to scan items in checkout (Perk 3) (Lower = slower)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.01f, 0.45f), 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, 11 sets them all to max)", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 30), Array.Empty<object>())); EmployeesEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Employee & Customer Settings", "Employees Level Toggle", false, new ConfigDescription("Enables modifying employee levels", (AcceptableValueBase)null, 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>())); LightCostMod = ((BaseUnityPlugin)this).Config.Bind<float>("Cost Modifiers", "Adjust the cost of Lights at the end of the day", 10f, new ConfigDescription("Adjust the cost of lights at the end of the day (Higher = more expensive)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 30f), Array.Empty<object>())); EmployeeCostMod = ((BaseUnityPlugin)this).Config.Bind<float>("Cost Modifiers", "Adjust the cost of Employee at the end of the day", 10f, new ConfigDescription("Adjust the cost of Employee at the end of the day (Higher = more expensive)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 30f), Array.Empty<object>())); RentCostMod = ((BaseUnityPlugin)this).Config.Bind<float>("Cost Modifiers", "Adjust the cost of Rent at the end of the day", 10f, new ConfigDescription("Adjust the cost of Rent at the end of the day (Higher = more expensive)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 30f), 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>())); 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 commass 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>())); SalesHotkey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Sales Settings", "Sales Tablet Hotkey", new KeyboardShortcut((KeyCode)108, 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>())); 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>())); 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>())); Instance = this; Logger = ((BaseUnityPlugin)this).Logger; harmony.PatchAll(); Logger.LogInfo((object)"Plugin BetterSMT v2.1.0 is loaded!"); } public static void CreateCanvasNotification(string text) { GameObject val = Object.Instantiate<GameObject>(GameCanvas.Instance.notificationPrefab, GameCanvas.Instance.notificationParentTransform); ((TMP_Text)val.GetComponent<TextMeshProUGUI>()).text = text; val.SetActive(true); } public static void CreateImportantNotification(string text) { GameObject val = Object.Instantiate<GameObject>(GameCanvas.Instance.importantNotificationPrefab, GameCanvas.Instance.importantNotificationParentTransform); ((TMP_Text)val.GetComponent<TextMeshProUGUI>()).text = text; val.SetActive(true); } private void Update() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) if (!ToggleDoublePrice.Value) { return; } KeyboardShortcut value = KeyboardShortcutDoublePrice.Value; if (((KeyboardShortcut)(ref value)).IsDown()) { doublePrice = !doublePrice; notificationType = "priceToggle"; notify = true; return; } value = KeyboardShortcutRoundDownSwitch.Value; if (((KeyboardShortcut)(ref value)).IsDown()) { if (NearestTen.Value) { NearestTen.Value = false; NearestFive.Value = true; } else { NearestTen.Value = true; NearestFive.Value = false; } notificationType = "roundDownSwitch"; notify = true; } else { value = KeyboardShortcutRoundDownToggle.Value; if (((KeyboardShortcut)(ref value)).IsDown()) { roundDown.Value = !roundDown.Value; notificationType = "roundDownToggle"; notify = true; } } } private void ConfigSettingChanged(object sender, EventArgs e) { if (NearestFive.Value && NearestTen.Value && NearestFive.Value) { NearestTen.Value = false; } } } public static class PluginInfo { public const string PLUGIN_GUID = "BetterSMT"; public const string PLUGIN_NAME = "BetterSMT"; public const string PLUGIN_VERSION = "2.1.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 { [HarmonyPatch("DeleteBehaviour")] [HarmonyPrefix] private static bool DeleteBehaviourPatch(Builder_Main __instance) { return DeleteWheneverPatch(__instance); } public static bool DeleteWheneverPatch(Builder_Main __instance) { HandleMovableObjects(__instance); HandleDecorations(__instance); return false; } private static bool HandleMovableObjects(Builder_Main __instance) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) 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); } } __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_000b: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) 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); } __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(CustomCameraController), "LateUpdate")] public class LateUpdateRaycastPatch { private static bool isThirdPersonEnabled; private static void Postfix(CustomCameraController __instance) { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: 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 (!FsmVariables.GlobalVariables.GetFsmBool("InChat").Value && BetterSMT.ThirdPersonToggle.Value && !((Object)(object)__instance == (Object)null) && !__instance.inVehicle && !__instance.isInCameraEvent) { KeyboardShortcut value = BetterSMT.ThirdPersonHotkey.Value; if (((KeyboardShortcut)(ref value)).IsDown()) { isThirdPersonEnabled = !isThirdPersonEnabled; } __instance.inEmoteEvent = isThirdPersonEnabled; if ((Object)(object)__instance.thirdPersonFollow != (Object)null) { __instance.thirdPersonFollow.CameraDistance = (isThirdPersonEnabled ? 2f : 0f); __instance.thirdPersonFollow.CameraCollisionFilter = (isThirdPersonEnabled ? __instance.thirdPersonDefaultLayerMask : LayerMask.op_Implicit(0)); } __instance.ShowCharacter(isThirdPersonEnabled); } } } [HarmonyPatch(typeof(DebtManager), "OnStartClient")] public static class DebtManagerPatch { private static void Postfix(DebtManager __instance) { __instance.autopayInvoices = BetterSMT.AutoPayAllInvoices?.Value ?? false; } } [HarmonyPatch(typeof(EmployeesDataGeneration))] public class EmployeesDataGenerationPatch { [HarmonyPatch("GenerateTodayEmployeesData")] [HarmonyPostfix] private static void GenerateTodayEmployeesDataPatch(EmployeesDataGeneration __instance) { EmployeeLevelPatch(__instance); } public static void EmployeeLevelPatch(EmployeesDataGeneration __instance) { int num = Random.Range(0, 5); int num2 = Random.Range(5, 10); for (int i = 0; i < 10; i++) { int num3 = Random.Range(0, 7); int num4; int num5; int num6; int num7; if (i == num) { num4 = Random.Range(6, 11); num5 = Random.Range(7, 11); num6 = Random.Range(6, 11); num7 = Random.Range(7, 11); } else if (i == num2) { num4 = Random.Range(5, 11); num5 = Random.Range(4, 11); num6 = Random.Range(5, 11); num7 = Random.Range(4, 11); } else { num4 = Random.Range(1, 11); num5 = Random.Range(1, 11); num6 = Random.Range(1, 11); num7 = Random.Range(1, 11); } if (BetterSMT.EmployeesEnabled.Value) { num4 = BetterSMT.EmployeesLevel.Value; num5 = BetterSMT.EmployeesLevel.Value; num6 = BetterSMT.EmployeesLevel.Value; num7 = BetterSMT.EmployeesLevel.Value; } int num8 = (num4 + num5 + num6 + num7) * Random.Range(3, 6) + Random.Range(-2, 3) * 10; num8 = Mathf.Clamp(num8, 30, 1000); string text = num3 + "|" + num8 + "|" + num4 + "|" + num5 + "|" + num6 + "|" + num7; __instance.managerComponent.todaysEmployeesData[i] = text; __instance.managerComponent.UpdateTodayEmployeesOnClients(i, text); } } } [HarmonyPatch(typeof(GameCanvas))] internal class NotificationHandler { [HarmonyPatch("Update")] [HarmonyPostfix] public static void NotificationHandler_Postfix(GameCanvas __instance, ref bool ___inCooldown) { if (BetterSMT.ToggleDoublePrice.Value && BetterSMT.notify) { ___inCooldown = false; BetterSMT.notify = false; string text = "`"; switch (BetterSMT.notificationType) { case "priceToggle": text = text + "Double Price: " + (BetterSMT.doublePrice ? "ON" : "OFF"); break; case "roundDownSwitch": text = text + "Rounding to nearest " + (BetterSMT.NearestTen.Value ? "ten" : "five") + ((!BetterSMT.roundDown.Value) ? "\r\n(Currently disabled)" : ""); break; case "roundDownToggle": text = text + "Rounding has been " + (BetterSMT.roundDown.Value ? "enabled" : "disabled"); break; } __instance.CreateCanvasNotification(text); } } } [HarmonyPatch(typeof(GameData), "WorkingDayControl")] public class GameDataPatch { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static UnityAction <>9__7_0; internal void <UpdateEscapeMenu>b__7_0() { ((MonoBehaviour)GameData.Instance).StartCoroutine(SaveGame()); } } 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" } }; [HarmonyPatch("OnStartClient")] [HarmonyPostfix] private static void OnStartClientPatch() { ShowCounters(); UpdateEscapeMenu(); } [HarmonyPatch(typeof(GameData), "ServerCalculateNewInflation")] [HarmonyPostfix] private static void OptimizePricesDaily() { OptimizeProductPrices(); } [HarmonyPatch("WorkingDayControl")] [HarmonyPostfix] private static void WorkingDayControlPatch(GameData __instance) { WorkingDayLightControlPatch(__instance); WorkingDayEmployeeControlPatch(__instance); WorkingDayRentControlPatch(__instance); } [HarmonyPatch("TrashManager")] [HarmonyPostfix] private static void TrashManagerPatch(GameData __instance) { NextTimeToSpawnTrashPatch(__instance); } [HarmonyPatch(typeof(GameData), "UserCode_CmdOpenSupermarket")] [HarmonyPostfix] private static void UserCode_CmdOpenSupermarketPatch(GameData __instance) { MaxCustomersNPCsPatch(__instance); } public static void OptimizeProductPrices() { if (!BetterSMT.AutoAdjustPriceDaily.Value) { return; } GameObject[] productPrefabs = ProductListing.Instance.productPrefabs; ProductListing instance = ProductListing.Instance; List<float> list = new List<float>(); for (int i = 0; i < productPrefabs.Length; i++) { if (i < productPrefabs.Length) { Data_Product component = productPrefabs[i].GetComponent<Data_Product>(); list.Add(component.basePricePerUnit); } } float[] array = list.ToArray(); float[] tierInflation = instance.tierInflation; float value = BetterSMT.AutoAdjustPriceDailyValue.Value; for (int j = 0; j < array.Length; j++) { Data_Product component2 = productPrefabs[j].GetComponent<Data_Product>(); float num = array[j] * tierInflation[component2.productTier] * value; float num2 = Mathf.Floor(num * 100f) / 100f; instance.CmdUpdateProductPrice(j, num2); } } private static void UpdateEscapeMenu() { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Expected O, but got Unknown GameObject val = GameObject.Find("MasterOBJ/MasterCanvas/Menus/EscapeMenu/"); GameObject gameObject = ((Component)val.transform.Find("OptionsButton")).gameObject; GameObject gameObject2 = ((Component)val.transform.Find("QuitButton")).gameObject; gameObject2.transform.localPosition = new Vector3(0f, 0f, 0f); GameObject gameObject3 = ((Component)val.transform.Find("MainMenuButton")).gameObject; gameObject3.transform.localPosition = new Vector3(0f, 85f, 0f); GameObject val2 = Object.Instantiate<GameObject>(gameObject2, val.transform); ((Object)val2).name = "SaveButton"; PlayMakerFSM[] components = val2.GetComponents<PlayMakerFSM>(); components.ToList().ForEach((Action<PlayMakerFSM>)Object.Destroy); Object.Destroy((Object)(object)val2.GetComponent<EventTrigger>()); val2.transform.position = gameObject2.transform.position; val2.transform.localScale = gameObject2.transform.localScale; val2.transform.localPosition = new Vector3(0f, -85f, 0f); ((TMP_Text)val2.GetComponentInChildren<TextMeshProUGUI>()).text = "Save Game"; Button component = val2.GetComponent<Button>(); ButtonClickedEvent onClick = component.onClick; object obj = <>c.<>9__7_0; if (obj == null) { UnityAction val3 = delegate { ((MonoBehaviour)GameData.Instance).StartCoroutine(SaveGame()); }; <>c.<>9__7_0 = val3; obj = (object)val3; } ((UnityEvent)onClick).AddListener((UnityAction)obj); if (!((NetworkBehaviour)GameData.Instance).isServer) { val2.SetActive(false); } } public static IEnumerator SaveGame() { NetworkSpawner nSpawnerComponent = ((Component)GameData.Instance).GetComponent<NetworkSpawner>(); if (!nSpawnerComponent.isSaving) { BetterSMT.CreateImportantNotification("Saving Game"); GameData.Instance.DoDaySaveBackup(); GameData.Instance.DoDaySaveBackup(); PlayMakerFSM fsm = GameData.Instance.SaveOBJ.GetComponent<PlayMakerFSM>(); fsm.FsmVariables.GetFsmBool("IsSaving").Value = true; fsm.SendEvent("Send_Data"); while (fsm.FsmVariables.GetFsmBool("IsSaving").Value) { yield return null; } yield return nSpawnerComponent.SavePropsCoroutine(); BetterSMT.CreateImportantNotification("Saving Finished"); } else { BetterSMT.CreateImportantNotification("Saving already in progress"); } } public static void ShowCounters() { if (BetterSMT.ShowPing.Value) { GameObject val = GameObject.Find("MasterOBJ/MasterCanvas/Ping"); if ((Object)(object)val == (Object)null) { BetterSMT.Logger.LogWarning((object)"Couldnt find Ping object"); return; } val.SetActive(true); } if (BetterSMT.ShowFPS.Value) { GameObject val2 = GameObject.Find("MasterOBJ/MasterCanvas/FPSDisplay"); if ((Object)(object)val2 == (Object)null) { BetterSMT.Logger.LogWarning((object)"Couldnt find FPSDisplay object"); } else { val2.SetActive(true); } } } public static void WorkingDayLightControlPatch(GameData __instance) { UpgradesManager component = ((Component)__instance).GetComponent<UpgradesManager>(); if ((Object)(object)component != (Object)null) { float lightCost = BetterSMT.LightCostMod.Value + (float)component.spaceBought + (float)component.storageBought; __instance.lightCost = lightCost; } else { __instance.lightCost = 10f + (float)component.spaceBought + (float)component.storageBought; } } [HarmonyPatch("AddExpensiveList")] [HarmonyPostfix] public static void CustomerNPCControlPatch(GameData __instance, int productID) { AddExpensiveListPatch(__instance, productID); } [HarmonyPatch("AddNotFoundList")] [HarmonyPostfix] public static void AddNotFoundList(GameData __instance, int productID) { AddNotFoundListPatch(__instance, productID); } public static void AddExpensiveListPatch(GameData __instance, int productID) { if (__instance.productsTooExpensiveList.Count == 0) { __instance.productsTooExpensiveList.Add(productID); } foreach (int productsTooExpensive in __instance.productsTooExpensiveList) { if (productsTooExpensive == productID) { if (BetterSMT.MissingProductNotifications.Value) { string text = (productNames.ContainsKey(productID) ? productNames[productID] : $"Product {productID}"); PlayerObjectController val = Object.FindObjectOfType<PlayerObjectController>(); string text2 = text + " is not found on the shelf."; val.CmdSendMessage(text2, (NetworkConnectionToClient)null); Debug.Log((object)text2); } return; } } __instance.productsTooExpensiveList.Add(productID); } public static void AddNotFoundListPatch(GameData __instance, int productID) { if (__instance.productsNotFoundList.Count == 0) { __instance.productsNotFoundList.Add(productID); } foreach (int productsNotFound in __instance.productsNotFoundList) { if (productsNotFound == productID) { if (BetterSMT.MissingProductNotifications.Value) { string text = (productNames.ContainsKey(productID) ? productNames[productID] : $"Product {productID}"); PlayerObjectController val = Object.FindObjectOfType<PlayerObjectController>(); string text2 = text + " is not found on the shelf."; val.CmdSendMessage(text2, (NetworkConnectionToClient)null); Debug.Log((object)text2); } return; } } __instance.productsNotFoundList.Add(productID); } public static void MaxCustomersNPCsPatch(GameData __instance) { if (__instance.isSupermarketOpen || (__instance.timeOfDay < 23f && __instance.timeOfDay > 8f)) { __instance.maxProductsCustomersToBuy = BetterSMT.BaseCustomerCart.Value + __instance.gameDay / 2 + NetworkServer.connections.Count + __instance.difficulty; __instance.maxProductsCustomersToBuy = Mathf.Clamp(__instance.maxProductsCustomersToBuy, BetterSMT.BaseCustomerCart.Value, BetterSMT.MaxCustomerCart.Value + NetworkServer.connections.Count + __instance.difficulty); __instance.maxCustomersNPCs = BetterSMT.BaseCustomerSpawns.Value + __instance.gameDay + (NetworkServer.connections.Count - 1) * 4 + __instance.extraCustomersPerk + __instance.difficulty * 2; __instance.maxCustomersNPCs = Mathf.Clamp(__instance.maxCustomersNPCs, BetterSMT.BaseCustomerSpawns.Value, BetterSMT.MaxCustomerInStore.Value + NetworkServer.connections.Count); } } public static void NextTimeToSpawnTrashPatch(GameData __instance) { if (BetterSMT.DisableAllTrash.Value) { __instance.nextTimeToSpawnTrash = 99999f; } } public static void WorkingDayRentControlPatch(GameData __instance) { UpgradesManager component = ((Component)__instance).GetComponent<UpgradesManager>(); if ((Object)(object)component != (Object)null) { float rentCost = BetterSMT.RentCostMod.Value + (float)(component.spaceBought * 5) + (float)(component.storageBought * 10); __instance.rentCost = rentCost; } else { __instance.rentCost = 10f + (float)(component.spaceBought * 5) + (float)(component.storageBought * 10); } } public static void WorkingDayEmployeeControlPatch(GameData __instance) { UpgradesManager component = ((Component)__instance).GetComponent<UpgradesManager>(); if ((Object)(object)component != (Object)null) { float employeesCost = BetterSMT.EmployeeCostMod.Value + (float)(NPC_Manager.Instance.maxEmployees * 60); __instance.employeesCost = employeesCost; } else { __instance.employeesCost = NPC_Manager.Instance.maxEmployees * 60; } } } [HarmonyPatch(typeof(LocalizationManager))] internal class LocalizationHandler { [HarmonyPatch("GetLocalizationString")] [HarmonyPrefix] public static bool NoLocalization_Prefix(ref string key, ref string __result) { if (key[0] == '`') { string text = key; __result = text.Substring(1, text.Length - 1); return false; } return true; } } [HarmonyPatch(typeof(ManagerBlackboard))] public class RemoveBoxSpawnTimePatch { [HarmonyPatch(/*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; } } [HarmonyPatch(typeof(NPC_Info))] public class NPC_InfoPatch { [HarmonyPatch(typeof(NPC_Info))] public class DisableThievesPatch { [HarmonyPatch("CreateNPCCharacter")] [HarmonyPostfix] private static void MakeNPCsThieves(ref bool ___isAThief) { ___isAThief = BetterSMT.AllNPCAreThieves.Value || (!BetterSMT.DisableAllThieves.Value & ___isAThief); } } [HarmonyPatch("PlaceProducts")] [HarmonyPrefix] private static void PlaceProductsPatch(NPC_Info __instance) { __instance.productItemPlaceWait = (BetterSMT.FasterCheckout.Value ? 0f : 0.5f); } [HarmonyPatch("AuxiliarAnimationPlay")] [HarmonyPrefix] private static bool AuxiliarAnimationPlayPatch(NPC_Info __instance, ref int animationIndex) { //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) if (!BetterSMT.OneHitThief.Value) { return true; } if (!__instance.beingPushed) { ((MonoBehaviour)__instance).StartCoroutine(__instance.StopSpeed()); } if (__instance.isAThief && __instance.productsIDCarrying.Count > 0) { int count = __instance.productsIDCarrying.Count; for (int i = 0; i < count; i++) { GameObject val = Object.Instantiate<GameObject>(__instance.stolenProductPrefab, NPC_Manager.Instance.droppedProductsParentOBJ.transform); val.transform.position = ((Component)__instance).transform.position + new Vector3(Random.Range(-0.4f, 0.4f), 0f, Random.Range(-0.4f, 0.4f)); val.GetComponent<StolenProductSpawn>().NetworkproductID = __instance.productsIDCarrying[0]; val.GetComponent<StolenProductSpawn>().NetworkproductCarryingPrice = __instance.productsCarryingPrice[0] * 0.8f; NetworkServer.Spawn(val, (NetworkConnection)null); __instance.productsIDCarrying.RemoveAt(0); __instance.productsCarryingPrice.RemoveAt(0); } } if (__instance.isAThief && __instance.productsIDCarrying.Count == 0 && Object.op_Implicit((Object)(object)((Component)((Component)__instance).transform.Find("ThiefCanvas")).gameObject) && ((Component)((Component)__instance).transform.Find("ThiefCanvas")).gameObject.activeSelf) { __instance.RpcHideThief(); } int num = Random.Range(0, 9); __instance.RpcAnimationPlay(animationIndex); __instance.RPCNotificationAboveHead("NPCmessagehit" + num, ""); return false; } } [HarmonyPatch(typeof(NPC_Manager))] public class NPC_ManagerPatch { [HarmonyPatch("GetAvailableSelfCheckout")] [HarmonyPostfix] private static void GetAvailableSelfCheckoutPatch(NPC_Info npcInfo, NPC_Manager __instance) { SelfCheckoutPatch(npcInfo, __instance); } public static int SelfCheckoutPatch(NPC_Info npcInfo, NPC_Manager __instance) { if (npcInfo.productsIDCarrying.Count > 18 + __instance.selfcheckoutExtraProductsFromPerk || npcInfo.productsIDCarrying.Count == 0) { return -1; } float num = Mathf.Clamp((float)((18 + __instance.selfcheckoutExtraProductsFromPerk) / npcInfo.productsIDCarrying.Count), 0f, 1f); if (__instance.selfcheckoutChanceCurve.Evaluate(num) < Random.value) { for (int i = 0; i < __instance.selfCheckoutOBJ.transform.childCount; i++) { if (!((Component)__instance.selfCheckoutOBJ.transform.GetChild(i)).GetComponent<Data_Container>().checkoutQueue[0]) { if (!BetterSMT.SelfCheckoutTheft.Value && npcInfo.productsIDCarrying.Count > 6 && Random.value < 0.02f + (float)GameData.Instance.difficulty * 0.005f) { int index = Random.Range(0, npcInfo.productsIDCarrying.Count); npcInfo.productsIDCarrying.RemoveAt(index); npcInfo.productsCarryingPrice.RemoveAt(index); } return i; } } } return -1; } } [HarmonyPatch(typeof(PlayerNetwork))] public class PlayerNetworkPatch { public enum ShelfType { ProductDisplay, Storage } private struct ShelfData { public string highlightsName; public string highlightsOriginalName; public ShelfType shelfType; public ShelfData(ShelfType shelfType) { if (shelfType == ShelfType.ProductDisplay) { highlightsName = "Labels"; highlightsOriginalName = ""; this.shelfType = ShelfType.ProductDisplay; } else { highlightsName = "HighlightsMarker"; highlightsOriginalName = "Highlights"; this.shelfType = ShelfType.Storage; } } } [HarmonyPatch(typeof(PlayerNetwork), "UserCode_CmdChangeEquippedItem__Int32")] public static class PatchEquippedItemChange { [HarmonyPrefix] public static void Prefix(int selectedItem) { Debug.Log((object)selectedItem); } } 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 readonly Stopwatch stopwatch = new Stopwatch(); private static PlayerNetwork pNetwork = null; private static UpgradesManager upgradesManager; private static readonly Dictionary<int, Transform> highlightObjectCache = new Dictionary<int, Transform>(); public static bool IsHighlightCacheUsed { get; set; } = true; private static void HandleAutoSave() { ConfigEntry<bool> autoSaveEnabled = BetterSMT.AutoSaveEnabled; if (autoSaveEnabled == null || !autoSaveEnabled.Value || !((NetworkBehaviour)GameData.Instance).isServer) { return; } if (!stopwatch.IsRunning) { stopwatch.Start(); } if (!(stopwatch.Elapsed.TotalSeconds <= (double?)BetterSMT.AutoSaveTimer?.Value)) { stopwatch.Restart(); ConfigEntry<bool> autoSaveDuringDay = BetterSMT.AutoSaveDuringDay; if ((autoSaveDuringDay != null && autoSaveDuringDay.Value) || !GameData.Instance.NetworkisSupermarketOpen) { ((MonoBehaviour)GameData.Instance).StartCoroutine(GameDataPatch.SaveGame()); } } } [HarmonyPatch("Update")] [HarmonyPostfix] private static void UpdatePatch(PlayerNetwork __instance, ref float ___pPrice, TextMeshProUGUI ___marketPriceTMP, ref TextMeshProUGUI ___yourPriceTMP) { //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_02fe: Unknown result type (might be due to invalid IL or missing references) //IL_0303: Unknown result type (might be due to invalid IL or missing references) //IL_02c2: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: Unknown result type (might be due to invalid IL or missing references) //IL_033e: Unknown result type (might be due to invalid IL or missing references) //IL_0343: Unknown result type (might be due to invalid IL or missing references) HandleAutoSave(); if (FsmVariables.GlobalVariables.GetFsmBool("InChat").Value) { return; } bool flag = false; (bool?, KeyboardShortcut?, int)[] array = new(bool?, KeyboardShortcut?, int)[8] { (BetterSMT.SledgeToggle?.Value, BetterSMT.SledgeHotkey?.Value, 7), (BetterSMT.OsMartToggle?.Value, BetterSMT.OsMartHotkey?.Value, 6), (BetterSMT.TrayToggle?.Value, BetterSMT.TrayHotkey?.Value, 9), (BetterSMT.SalesToggle?.Value, BetterSMT.SalesHotkey?.Value, 10), (BetterSMT.PricingGunToggle?.Value, BetterSMT.PricingGunHotkey?.Value, 2), (BetterSMT.BroomToggle?.Value, BetterSMT.BroomHotkey?.Value, 3), (BetterSMT.LadderToggle?.Value, BetterSMT.LadderHotkey?.Value, 8), (BetterSMT.DLCTabletToggle?.Value, BetterSMT.DLCTabletHotkey?.Value, 5) }; (bool?, KeyboardShortcut?, int)[] array2 = array; KeyboardShortcut val2; for (int i = 0; i < array2.Length; i++) { var (flag2, val, num) = array2[i]; if (flag2.GetValueOrDefault() && val.HasValue) { val2 = val.GetValueOrDefault(); if (((KeyboardShortcut)(ref val2)).IsDown()) { __instance.CmdChangeEquippedItem(num); flag = true; break; } } } if (!flag) { val2 = BetterSMT.EmptyHandsHotkey.Value; if (((KeyboardShortcut)(ref val2)).IsDown()) { __instance.CmdChangeEquippedItem(0); } } ConfigEntry<bool> clockToggle = BetterSMT.ClockToggle; if (clockToggle != null && clockToggle.Value) { ConfigEntry<KeyboardShortcut> clockHotkey = BetterSMT.ClockHotkey; if (clockHotkey != null) { val2 = clockHotkey.Value; if (((KeyboardShortcut)(ref val2)).IsDown()) { if (upgradesManager == null) { TimeAccelerationWatcher obj = Object.FindObjectOfType<TimeAccelerationWatcher>(); upgradesManager = ((obj != null) ? ((Component)obj).GetComponent<UpgradesManager>() : null); } if ((Object)(object)upgradesManager != (Object)null) { bool flag3 = !upgradesManager.NetworkacceleratedTime; upgradesManager.NetworkacceleratedTime = flag3; upgradesManager.RpcTimeAcceleration(flag3); } } } } if (!BetterSMT.ToggleDoublePrice.Value || !BetterSMT.doublePrice || !((Object)(object)___marketPriceTMP != (Object)null)) { return; } string text = ((TMP_Text)___marketPriceTMP).text; if (float.TryParse(text.Substring(1, text.Length - 1).Replace(',', '.'), NumberStyles.Float, CultureInfo.InvariantCulture, out var result)) { ___pPrice = result * 2f; if (BetterSMT.roundDown.Value) { ___pPrice = (BetterSMT.NearestTen.Value ? ((float)(Math.Floor(___pPrice * 10f) / 10.0)) : ((float)(Math.Floor(___pPrice * 20f) / 20.0))); } ((TMP_Text)___yourPriceTMP).text = "$" + ___pPrice; } } [HarmonyPatch("ChangeEquipment")] [HarmonyPostfix] private static void ChangeEquipmentPatch(int newEquippedItem) { if (newEquippedItem == 0) { ClearHighlightedShelves(); } } [HarmonyPatch("Start")] [HarmonyPrefix] private static void StartPatch(PlayerNetwork __instance) { if (((NetworkBehaviour)__instance).isLocalPlayer) { pNetwork = __instance; } } [HarmonyPatch("UpdateBoxContents")] [HarmonyPostfix] private static void UpdateBoxContentsPatch(int productIndex) { HighlightShelvesByProduct(productIndex); } [HarmonyPatch(typeof(Data_Container), "BoxSpawner")] [HarmonyPostfix] private static void BoxSpawnerPatch(Data_Container __instance) { AddHighlightMarkersToStorage(((Component)__instance).transform); } [HarmonyPatch(typeof(NetworkSpawner), "UserCode_CmdSpawn__Int32__Vector3__Vector3")] [HarmonyPostfix] private static void NewBuildableConstructed(NetworkSpawner __instance, int prefabID) { if (BetterSMT.StorageHighlighting.Value) { GameObject val = __instance.buildables[prefabID]; if (((Object)val).name.Contains("StorageShelf")) { int parentIndex = val.GetComponent<Data_Container>().parentIndex; Transform child = __instance.levelPropsOBJ.transform.GetChild(parentIndex); GameObject gameObject = ((Component)child.GetChild(child.childCount - 1)).gameObject; AddHighlightMarkersToStorage(gameObject.transform); } } } public static int GetProductFromRaycast() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) if (!BetterSMT.StorageHighlighting.Value) { return -1; } int result = -1; RaycastHit val = default(RaycastHit); RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(((Component)Camera.main).transform.position, ((Component)Camera.main).transform.forward, ref val, 4f, LayerMask.op_Implicit(pNetwork.interactableMask))) { if (((Object)((Component)((RaycastHit)(ref val)).transform).gameObject).name == "SubContainer") { int siblingIndex = ((RaycastHit)(ref val)).transform.GetSiblingIndex(); Transform transform = ((RaycastHit)(ref val)).transform; object obj; if (transform == null) { obj = null; } else { Transform parent = transform.parent; if (parent == null) { obj = null; } else { Transform transform2 = ((Component)parent).transform; obj = ((transform2 != null) ? transform2.parent : null); } } if (!Object.op_Implicit((Object)obj)) { return result; } Data_Container component = ((Component)((Component)((RaycastHit)(ref val)).transform.parent).transform.parent).GetComponent<Data_Container>(); if ((Object)(object)component != (Object)null && component.containerClass < 20) { result = component.productInfoArray[siblingIndex * 2]; } } } else if (Physics.Raycast(((Component)Camera.main).transform.position, ((Component)Camera.main).transform.forward, ref val2, 4f, LayerMask.op_Implicit(pNetwork.lMask))) { if (((Component)((RaycastHit)(ref val2)).transform).gameObject.tag == "Interactable" && Object.op_Implicit((Object)(object)((Component)((RaycastHit)(ref val2)).transform).GetComponent<BoxData>())) { BoxData component2 = ((Component)((RaycastHit)(ref val2)).transform).GetComponent<BoxData>(); if ((Object)(object)component2 != (Object)null) { result = component2.productID; } } else { int siblingIndex2 = ((RaycastHit)(ref val2)).transform.GetSiblingIndex(); Transform transform3 = ((RaycastHit)(ref val2)).transform; object obj2; if (transform3 == null) { obj2 = null; } else { Transform parent2 = transform3.parent; if (parent2 == null) { obj2 = null; } else { Transform transform4 = ((Component)parent2).transform; obj2 = ((transform4 != null) ? transform4.parent : null); } } if (!Object.op_Implicit((Object)obj2)) { return result; } Data_Container component3 = ((Component)((Component)((RaycastHit)(ref val2)).transform.parent).transform.parent).GetComponent<Data_Container>(); if ((Object)(object)component3 != (Object)null && component3.containerClass == 69) { int num = component3.productInfoArray[siblingIndex2 * 2]; result = num; } } } return result; } public static void HighlightShelvesByProduct(int productID) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) if (BetterSMT.StorageHighlighting.Value) { HighlightShelfTypeByProduct(productID, Color.yellow, ShelfType.ProductDisplay); HighlightShelfTypeByProduct(productID, Color.red, ShelfType.Storage); } } public static void ClearHighlightedShelves() { if (!BetterSMT.StorageHighlighting.Value) { return; } if (IsHighlightCacheUsed) { foreach (KeyValuePair<int, Transform> item in highlightObjectCache) { HighlightShelf(item.Value, isEnableHighlight: false); } highlightObjectCache.Clear(); } else { ClearHighlightShelvesByProduct(ShelfType.ProductDisplay); ClearHighlightShelvesByProduct(ShelfType.Storage); } } private static void ClearHighlightShelvesByProduct(ShelfType shelfType) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) HighlightShelfTypeByProduct(-1, Color.white, shelfType); } private static void HighlightShelfTypeByProduct(int productID, Color shelfHighlightColor, ShelfType shelfType) { //IL_00f2: 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 (!BetterSMT.StorageHighlighting.Value) { return; } GameObject val = GameObject.Find(GetGameObjectStringPath(shelfType)); for (int i = 0; i < val.transform.childCount; i++) { Transform child = val.transform.GetChild(i); int[] productInfoArray = ((Component)child).gameObject.GetComponent<Data_Container>().productInfoArray; int num = productInfoArray.Length / 2; bool isEnableHighlight = false; for (int j = 0; j < num; j++) { if (productID >= 0 && productInfoArray[j * 2] == productID) { isEnableHighlight = true; Transform val2 = child.Find(new ShelfData(shelfType).highlightsName); if ((Object)(object)val2 != (Object)null) { Transform t = ((shelfType == ShelfType.Storage) ? val2.GetChild(j).GetChild(0) : val2.GetChild(j)); HighlightShelf(t, isEnableHighlight: true, Color.yellow); } } } HighlightShelf(child, isEnableHighlight, shelfHighlightColor); } } public static string GetGameObjectStringPath(ShelfType shelfType) { if (1 == 0) { } string result = shelfType switch { ShelfType.ProductDisplay => "Level_SupermarketProps/Shelves", ShelfType.Storage => "Level_SupermarketProps/StorageShelves", _ => throw new NotImplementedException(), }; if (1 == 0) { } return result; } public static void HighlightShelf(Transform t, bool isEnableHighlight, Color? color = null) { //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Expected O, but got Unknown //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) if (!BetterSMT.StorageHighlighting.Value) { return; } HighlightEffect val = ((Component)t).GetComponent<HighlightEffect>() ?? ((Component)t).gameObject.AddComponent<HighlightEffect>(); if (IsHighlightCacheUsed) { if (isEnableHighlight == val.highlighted) { return; } if (isEnableHighlight && !highlightObjectCache.ContainsKey(((Object)t).GetInstanceID())) { highlightObjectCache.Add(((Object)t).GetInstanceID(), t); } MeshRenderer component = ((Component)t).GetComponent<MeshRenderer>(); if ((Object)(object)component != (Object)null) { ((Renderer)component).allowOcclusionWhenDynamic = !isEnableHighlight; } } if (color.HasValue) { val.outlineColor = color.Value; } val.outlineQuality = (QualityLevel)1; val.outlineVisibility = (Visibility)1; val.outlineContourStyle = (ContourStyle)1; val.outlineIndependent = true; val.outline = (isEnableHighlight ? 1f : 0f); val.glow = (isEnableHighlight ? 0f : 1f); val.Refresh(false); val.highlighted = isEnableHighlight; foreach (Transform item in t) { Transform val2 = item; if (((Object)val2).name.Contains("PriceLabel")) { HighlightEffect val3 = ((Component)val2).GetComponent<HighlightEffect>() ?? ((Component)val2).gameObject.AddComponent<HighlightEffect>(); if (color.HasValue) {
BepInEx/plugins/WorstsSMT.dll
Decompiled a day agousing System; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using StarterAssets; using UnityEngine; using UnityEngine.Rendering; [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: IgnoresAccessChecksTo("Unity.StarterAssets")] [assembly: AssemblyCompany("WorstsSMT")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("WorstsSMT")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+84718a476cb578d3240e1a00900c5f2a7469092e")] [assembly: AssemblyProduct("WorstsSMT")] [assembly: AssemblyTitle("WorstsSMT")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.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 WorstsSMT { [BepInPlugin("WorstsSMT", "WorstsSMT", "1.0.0")] public class WorstsSMT : BaseUnityPlugin { private readonly Harmony harmony = new Harmony("WorstsSMT"); public static WorstsSMT Instance; internal static ConfigEntry<bool> EnableMod; internal static ConfigEntry<bool> ApplyBaseQualityLevel; internal static ConfigEntry<bool> DisableShadows; internal static ConfigEntry<bool> DisableSoftEffects; internal static ConfigEntry<bool> DisableReflectionProbes; internal static ConfigEntry<bool> DisableFogAndAmbient; internal static ConfigEntry<int> TextureMipmapLimit; internal static ConfigEntry<bool> DisableAntialiasing; internal static ConfigEntry<bool> DisableAnisotropic; internal static ConfigEntry<bool> DisableVSync; internal static ConfigEntry<float> LODBias; internal static ConfigEntry<bool> DisableSceneLights; internal static ConfigEntry<bool> DisableLightProbes; internal static ConfigEntry<bool> DisableLensFlares; internal static ConfigEntry<bool> DisableParticles; internal static ConfigEntry<bool> DisableTerrainDetails; internal static ConfigEntry<int> TerrainPixelError; internal static ConfigEntry<bool> DisableOcclusionCulling; internal static ConfigEntry<float> CameraFarClipPlane; internal static ConfigEntry<bool> DisableHDR; internal static ConfigEntry<bool> DisableMSAA; internal static ConfigEntry<bool> LimitAudioListeners; internal static ConfigEntry<float> FixedDeltaTime; internal static ConfigEntry<int> SolverIterations; internal static ConfigEntry<int> SolverVelocityIterations; internal static ManualLogSource Logger { get; private set; } private void Awake() { EnableMod = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "enabled", false, "Master toggle for the graphics mod.\ntrue = apply all enabled graphics-lowering settings.\nfalse = mod does nothing, game runs as normal."); ApplyBaseQualityLevel = ((BaseUnityPlugin)this).Config.Bind<bool>("Quality", "apply_base_quality_level", false, "Sets Unity's internal quality preset to the lowest available.\nRecommended: true for ultra-low graphics. Default: false (retain game setting)."); DisableShadows = ((BaseUnityPlugin)this).Config.Bind<bool>("Quality", "disable_shadows", false, "Disables all real-time shadows.\ntrue = removes all shadow rendering.\nfalse = keep shadows as the game configures them."); DisableSoftEffects = ((BaseUnityPlugin)this).Config.Bind<bool>("Quality", "disable_soft_effects", false, "Disables soft particles and soft vegetation blending.\nDefault: false (preserve visual effects)."); DisableReflectionProbes = ((BaseUnityPlugin)this).Config.Bind<bool>("Quality", "disable_reflection_probes", false, "Disables real-time reflection probes used for glossy materials.\nDefault: false = keep dynamic reflections."); DisableFogAndAmbient = ((BaseUnityPlugin)this).Config.Bind<bool>("Quality", "disable_fog_and_flat_ambient", false, "Disables fog and switches ambient lighting to flat color.\nDefault: false = retain original lighting atmosphere."); TextureMipmapLimit = ((BaseUnityPlugin)this).Config.Bind<int>("Textures", "texture_mipmap_limit", 0, "Controls global texture resolution (mipmap bias).\n0 = full res (default), 1 = half, 2 = quarter, up to 4 = lowest.\nRecommended: 2–4 on low-memory systems."); DisableAntialiasing = ((BaseUnityPlugin)this).Config.Bind<bool>("Textures", "disable_antialiasing", false, "Disables MSAA (multi-sample anti-aliasing).\nDefault: false (keep anti-aliasing enabled if present)."); DisableAnisotropic = ((BaseUnityPlugin)this).Config.Bind<bool>("Textures", "disable_anisotropic", false, "Disables anisotropic texture filtering.\nDefault: false = preserve sharp distant textures."); DisableVSync = ((BaseUnityPlugin)this).Config.Bind<bool>("Performance", "disable_vsync", false, "Disables vertical sync.\nDefault: false = use game’s framerate and tearing policy."); LODBias = ((BaseUnityPlugin)this).Config.Bind<float>("Performance", "lod_bias", 1f, "LOD bias factor. 1.0 = Unity default.\nRange: 0.1 (most aggressive) to 2.0+ (high fidelity)."); DisableSceneLights = ((BaseUnityPlugin)this).Config.Bind<bool>("Lighting", "disable_scene_lights", false, "Disables all Light components in the scene.\nDefault: false = preserve lighting setup."); DisableLightProbes = ((BaseUnityPlugin)this).Config.Bind<bool>("Lighting", "disable_light_probes", false, "Disables baked LightProbeGroups.\nDefault: false = dynamic lighting works normally."); DisableLensFlares = ((BaseUnityPlugin)this).Config.Bind<bool>("Lighting", "disable_lens_flares", false, "Disables lens flare effects from lights.\nDefault: false = preserve visual flares."); DisableParticles = ((BaseUnityPlugin)this).Config.Bind<bool>("Particles", "disable_particles", false, "Disables all ParticleSystems.\nDefault: false = preserve all visual effects."); DisableTerrainDetails = ((BaseUnityPlugin)this).Config.Bind<bool>("Terrain", "disable_terrain_details", false, "Disables terrain grass, trees, and mesh details.\nDefault: false = preserve outdoor detail."); TerrainPixelError = ((BaseUnityPlugin)this).Config.Bind<int>("Terrain", "terrain_pixel_error", 5, "Controls how blocky terrain appears.\n5 = default (very detailed), up to 500 = extremely simplified."); DisableOcclusionCulling = ((BaseUnityPlugin)this).Config.Bind<bool>("Cameras", "disable_occlusion_culling", false, "Disables occlusion culling (CPU-side visibility optimization).\nDefault: false = preserve Unity's visibility logic."); CameraFarClipPlane = ((BaseUnityPlugin)this).Config.Bind<float>("Cameras", "camera_far_clip_plane", 1000f, "Far clipping distance for all cameras.\nDefault: 1000 (typical). Lower = less rendering at distance."); DisableHDR = ((BaseUnityPlugin)this).Config.Bind<bool>("Cameras", "disable_hdr", false, "Disables High Dynamic Range rendering.\nDefault: false = keep bloom/glow effects."); DisableMSAA = ((BaseUnityPlugin)this).Config.Bind<bool>("Cameras", "disable_msaa", false, "Disables multi-sample anti-aliasing.\nDefault: false = preserve smoother edges."); LimitAudioListeners = ((BaseUnityPlugin)this).Config.Bind<bool>("Audio", "limit_audio_listeners", false, "Ensures only one active AudioListener exists.\nDefault: false = do not interfere with game’s audio setup."); FixedDeltaTime = ((BaseUnityPlugin)this).Config.Bind<float>("Physics", "fixed_delta_time", 0.02f, "Physics update interval.\n0.02 = Unity default (50 updates/sec). Higher = fewer updates."); SolverIterations = ((BaseUnityPlugin)this).Config.Bind<int>("Physics", "solver_iterations", 6, "Physics constraint solver passes.\nDefault: 6 (Unity standard). Lower = faster, less accurate."); SolverVelocityIterations = ((BaseUnityPlugin)this).Config.Bind<int>("Physics", "solver_velocity_iterations", 2, "Physics velocity solver passes.\nDefault: 2. Lower = better performance, lower simulation quality."); Instance = this; Logger = ((BaseUnityPlugin)this).Logger; harmony.PatchAll(); Logger.LogInfo((object)"Plugin WorstsSMT v1.0.0 is loaded!"); } } public static class PluginInfo { public const string PLUGIN_GUID = "WorstsSMT"; public const string PLUGIN_NAME = "WorstsSMT"; public const string PLUGIN_VERSION = "1.0.0"; } } namespace WorstsSMT.Patches { [HarmonyPatch(typeof(FirstPersonController), "Start")] public class LateUpdateRaycastPatch { private static void Postfix() { if (!WorstsSMT.EnableMod.Value) { return; } if (WorstsSMT.ApplyBaseQualityLevel.Value) { QualitySettings.SetQualityLevel(0, true); } if (WorstsSMT.DisableShadows.Value) { QualitySettings.shadows = (ShadowQuality)0; QualitySettings.shadowResolution = (ShadowResolution)0; QualitySettings.shadowCascades = 0; QualitySettings.shadowDistance = 0f; } if (WorstsSMT.DisableAntialiasing.Value) { QualitySettings.antiAliasing = 0; } if (WorstsSMT.DisableAnisotropic.Value) { QualitySettings.anisotropicFiltering = (AnisotropicFiltering)0; } QualitySettings.globalTextureMipmapLimit = WorstsSMT.TextureMipmapLimit.Value; if (WorstsSMT.DisableVSync.Value) { QualitySettings.vSyncCount = 0; } QualitySettings.lodBias = WorstsSMT.LODBias.Value; if (WorstsSMT.DisableReflectionProbes.Value) { QualitySettings.realtimeReflectionProbes = false; } if (WorstsSMT.DisableSoftEffects.Value) { QualitySettings.softParticles = false; QualitySettings.softVegetation = false; } if (WorstsSMT.DisableSceneLights.Value) { Light[] array = Object.FindObjectsOfType<Light>(); foreach (Light val in array) { ((Behaviour)val).enabled = false; } } if (WorstsSMT.DisableFogAndAmbient.Value) { RenderSettings.fog = false; RenderSettings.ambientIntensity = 0.5f; RenderSettings.ambientMode = (AmbientMode)3; } if (WorstsSMT.DisableParticles.Value) { ParticleSystem[] array2 = Object.FindObjectsOfType<ParticleSystem>(); foreach (ParticleSystem val2 in array2) { val2.Stop(true, (ParticleSystemStopBehavior)0); ((Component)val2).gameObject.SetActive(false); } } if (WorstsSMT.DisableReflectionProbes.Value) { ReflectionProbe[] array3 = Object.FindObjectsOfType<ReflectionProbe>(); foreach (ReflectionProbe val3 in array3) { ((Behaviour)val3).enabled = false; val3.mode = (ReflectionProbeMode)2; } } if (WorstsSMT.DisableLightProbes.Value) { LightProbeGroup[] array4 = Object.FindObjectsOfType<LightProbeGroup>(); foreach (LightProbeGroup val4 in array4) { ((Behaviour)val4).enabled = false; } } if (WorstsSMT.DisableLensFlares.Value) { LensFlare[] array5 = Object.FindObjectsOfType<LensFlare>(); foreach (LensFlare val5 in array5) { ((Behaviour)val5).enabled = false; } } if (WorstsSMT.DisableTerrainDetails.Value) { Terrain[] array6 = Object.FindObjectsOfType<Terrain>(); foreach (Terrain val6 in array6) { val6.detailObjectDistance = 0f; val6.treeDistance = 0f; val6.heightmapPixelError = WorstsSMT.TerrainPixelError.Value; val6.basemapDistance = 0f; } } SkinnedMeshRenderer[] array7 = Object.FindObjectsOfType<SkinnedMeshRenderer>(); foreach (SkinnedMeshRenderer val7 in array7) { val7.updateWhenOffscreen = false; } Camera[] array8 = Object.FindObjectsOfType<Camera>(); foreach (Camera val8 in array8) { if (WorstsSMT.DisableOcclusionCulling.Value) { val8.useOcclusionCulling = false; } val8.farClipPlane = WorstsSMT.CameraFarClipPlane.Value; if (WorstsSMT.DisableHDR.Value) { val8.allowHDR = false; } if (WorstsSMT.DisableMSAA.Value) { val8.allowMSAA = false; } } if (WorstsSMT.LimitAudioListeners.Value) { AudioListener[] array9 = Object.FindObjectsOfType<AudioListener>(); for (int num3 = 1; num3 < array9.Length; num3++) { ((Behaviour)array9[num3]).enabled = false; } } Time.fixedDeltaTime = WorstsSMT.FixedDeltaTime.Value; Physics.defaultSolverIterations = WorstsSMT.SolverIterations.Value; Physics.defaultSolverVelocityIterations = WorstsSMT.SolverVelocityIterations.Value; Debug.Log((object)"[WorstsSMT] Graphics settings applied from config."); } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } }