commit 6704b359f1405dffed4d05874aafe80b7562c08e Author: Marc Philipp Burgmann Date: Fri Jan 9 22:28:22 2026 +0100 Version 1.0.0 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a4f5d33 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +.git/ +.vs/ +bin/ +obj/ +*.sln \ No newline at end of file diff --git a/BetterStuff.csproj b/BetterStuff.csproj new file mode 100644 index 0000000..0c5d851 --- /dev/null +++ b/BetterStuff.csproj @@ -0,0 +1,46 @@ + + + + net6.0 + BetterStuff + Better Stuff + 1.0.0 + true + latest + + https://api.nuget.org/v3/index.json; + https://nuget.bepinex.dev/v3/index.json; + https://nuget.samboy.dev/v3/index.json + + BetterStuff + + + + + + + + + + ..\lib\Assembly-CSharp.dll + + + ..\lib\MyBox.dll + + + ..\lib\Il2Cppmscorlib.dll + + + ..\lib\UnityEngine.PhysicsModule.dll + + + ..\lib\UnityEngine.CoreModule.dll + + + ..\lib\Unity.InputSystem.dll + + + ..\lib\UnityEngine.AIModule.dll + + + diff --git a/Plugin.cs b/Plugin.cs new file mode 100644 index 0000000..a6fadad --- /dev/null +++ b/Plugin.cs @@ -0,0 +1,80 @@ +using System; +using BepInEx; +using BepInEx.Configuration; +using BepInEx.Logging; +using BepInEx.Unity.IL2CPP; +using HarmonyLib; +using UnityEngine; +using UnityEngine.Playables; + +namespace BetterStuff; + +[BepInPlugin(MyPluginInfo.PLUGIN_GUID, MyPluginInfo.PLUGIN_NAME, MyPluginInfo.PLUGIN_VERSION)] +public class Plugin : BasePlugin +{ + internal static new ManualLogSource Log; + + private static ConfigEntry scanTimeMin; + private static ConfigEntry scanTimeMax; + private static ConfigEntry finishDuration; + private static ConfigEntry timeAfterScans; + + private static ConfigEntry restockerSpeed; + + public override void Load() + { + // Plugin startup logic + Log = base.Log; + Log.LogInfo($"Plugin {MyPluginInfo.PLUGIN_GUID} is loaded!"); + + Plugin.scanTimeMin = Config.Bind("Cashier Scantime", "min", 0.2f); + Plugin.scanTimeMax = Config.Bind("Cashier Scantime", "max", 0.8f); + Plugin.finishDuration = Config.Bind("Cashier PaymentTime", "FinishingDuration", 1f); + Plugin.timeAfterScans = Config.Bind("Cashier PaymentTime", "TimeAfterAllScans", 0.5f); + + Plugin.restockerSpeed = Config.Bind("Restocker", "Speed", 5f); + + Harmony harmony = new(MyPluginInfo.PLUGIN_GUID); + harmony.PatchAll(); + } + + public static class CashierPatch + { + [HarmonyPatch(typeof(Cashier), "Start")] + public static class Cashier_Start_Patch + { + [HarmonyPostfix] + public static void Postfix(Cashier __instance) + { + __instance.ScanningInterval = UnityEngine.Random.Range(Plugin.scanTimeMin.Value, Plugin.scanTimeMax.Value); + } + } + + [HarmonyPatch(typeof(Checkout), "FinishedScanning")] + public static class Cashier_Checkout_Patch + { + [HarmonyPostfix] + public static void Postfix(Checkout __instance) + { + __instance.m_AutomatedCheckout.m_FinishingPaymentDuration = Plugin.finishDuration.Value; + __instance.m_AutomatedCheckout.m_IntervalAfterScanningAll = Plugin.timeAfterScans.Value; + } + } + } + + public static class RestockerPatch + { + [HarmonyPatch(typeof(Restocker), "Start")] + public static class Restocker_Start_Patch + { + [HarmonyPostfix] + public static void Postfix(Restocker __instance) + { + __instance.m_Agent.speed = Plugin.restockerSpeed.Value; + __instance.m_Agent.acceleration *= 200f; + __instance.m_Agent.angularSpeed *= 200f; + } + } + } + +}