Compare commits

1 Commits

6 changed files with 236 additions and 318 deletions

8
.gitignore vendored
View File

@@ -1,5 +1,5 @@
.git/ .git/
.vs/ .vs/
bin/ bin/
obj/ obj/
*.sln *.sln

View File

@@ -1,22 +0,0 @@
using UnityEngine;
namespace BetterStuff;
public class Behaviour : MonoBehaviour
{
private float timer = 2f;
private void Update()
{
timer += Time.deltaTime;
if(timer >= 2f)
{
timer = 0f;
foreach (SecurityGuardAnimationController controller in Resources.FindObjectsOfTypeAll<SecurityGuardAnimationController>())
{
controller.m_Agent.speed = Plugin.securityGuardSpeed.Value;
controller.m_Agent.acceleration *= Plugin.acceleration;
controller.m_Agent.angularSpeed *= Plugin.angularSpeed;
controller.m_AnimationWalkingSpeed = Plugin.securityGuardSpeed.Value;
}
}
}
}

View File

@@ -1,46 +1,46 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net6.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<AssemblyName>BetterStuff</AssemblyName> <AssemblyName>BetterStuff</AssemblyName>
<Product>Better Stuff</Product> <Product>Better Stuff</Product>
<Version>1.1.0</Version> <Version>1.1.0</Version>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>latest</LangVersion> <LangVersion>latest</LangVersion>
<RestoreAdditionalProjectSources> <RestoreAdditionalProjectSources>
https://api.nuget.org/v3/index.json; https://api.nuget.org/v3/index.json;
https://nuget.bepinex.dev/v3/index.json; https://nuget.bepinex.dev/v3/index.json;
https://nuget.samboy.dev/v3/index.json https://nuget.samboy.dev/v3/index.json
</RestoreAdditionalProjectSources> </RestoreAdditionalProjectSources>
<RootNamespace>BetterStuff</RootNamespace> <RootNamespace>BetterStuff</RootNamespace>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="BepInEx.Unity.IL2CPP" Version="6.0.0-be.*" IncludeAssets="compile" /> <PackageReference Include="BepInEx.Unity.IL2CPP" Version="6.0.0-be.*" IncludeAssets="compile" />
<PackageReference Include="BepInEx.PluginInfoProps" Version="2.*" /> <PackageReference Include="BepInEx.PluginInfoProps" Version="2.*" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Assembly-CSharp" Publicize="true"> <Reference Include="Assembly-CSharp" Publicize="true">
<HintPath>..\lib\Assembly-CSharp.dll</HintPath> <HintPath>..\lib\Assembly-CSharp.dll</HintPath>
</Reference> </Reference>
<Reference Include="MyBox" Publicize="true"> <Reference Include="MyBox" Publicize="true">
<HintPath>..\lib\MyBox.dll</HintPath> <HintPath>..\lib\MyBox.dll</HintPath>
</Reference> </Reference>
<Reference Include="Il2Cppmscorlib" Publicize="true"> <Reference Include="Il2Cppmscorlib" Publicize="true">
<HintPath>..\lib\Il2Cppmscorlib.dll</HintPath> <HintPath>..\lib\Il2Cppmscorlib.dll</HintPath>
</Reference> </Reference>
<Reference Include="UnityEngine.PhysicsModule" Publicize="true"> <Reference Include="UnityEngine.PhysicsModule" Publicize="true">
<HintPath>..\lib\UnityEngine.PhysicsModule.dll</HintPath> <HintPath>..\lib\UnityEngine.PhysicsModule.dll</HintPath>
</Reference> </Reference>
<Reference Include="UnityEngine.CoreModule" Publicize="true"> <Reference Include="UnityEngine.CoreModule" Publicize="true">
<HintPath>..\lib\UnityEngine.CoreModule.dll</HintPath> <HintPath>..\lib\UnityEngine.CoreModule.dll</HintPath>
</Reference> </Reference>
<Reference Include="Unity.InputSystem" Publicize="true"> <Reference Include="Unity.InputSystem" Publicize="true">
<HintPath>..\lib\Unity.InputSystem.dll</HintPath> <HintPath>..\lib\Unity.InputSystem.dll</HintPath>
</Reference> </Reference>
<Reference Include="UnityEngine.AIModule" Publicize="true"> <Reference Include="UnityEngine.AIModule" Publicize="true">
<HintPath>..\lib\UnityEngine.AIModule.dll</HintPath> <HintPath>..\lib\UnityEngine.AIModule.dll</HintPath>
</Reference> </Reference>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@@ -1,35 +1,22 @@
# Changelog # Changelog
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [1.2.0] - 2026-04-03 ## [1.1.0] - 2026-01-25
### Added ### Added
- Increased the walk speed of backer - Increased the walk speed of janitors, security guards and customer helpers
- Increased the scanning speed of customer helpers, customers and player on self checkouts
### Fixed - Config contains the default gamevalues of each option
- Fix securityguard walkspeed don't work
## [1.0.0] - 2026-01-09
## [1.1.1] - 2026-03-31
### Added
### Fixed - Initial release
- Fix janitor walkspeed don't work - Increased the scanning speed of cashiers
- Increased the time until the paymentprocess is finished
## [1.1.0] - 2026-01-25 - Increased the time between scanningprocess an paymentprocess
- Increased the walk speed of Restockers
### Added
- Increased the walk speed of janitors, security guards and customer helpers
- Increased the scanning speed of customer helpers, customers and player on self checkouts
- Config contains the default gamevalues of each option
## [1.0.0] - 2026-01-09
### Added
- Initial release
- Increased the scanning speed of cashiers
- Increased the time until the paymentprocess is finished
- Increased the time between scanningprocess an paymentprocess
- Increased the walk speed of restockers

42
LICENSE
View File

@@ -1,21 +1,21 @@
MIT License MIT License
Copyright (c) 2025 Marc Philipp Burgmann Copyright (c) 2025 Marc Philipp Burgmann
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.

333
Plugin.cs
View File

@@ -1,191 +1,144 @@
using __Project__.Scripts.Janitor; using BepInEx;
using BepInEx; using BepInEx.Configuration;
using BepInEx.Configuration; using BepInEx.Logging;
using BepInEx.Logging; using BepInEx.Unity.IL2CPP;
using BepInEx.Unity.IL2CPP; using HarmonyLib;
using HarmonyLib;
using Il2CppInterop.Runtime.Injection; namespace BetterStuff;
using UnityEngine;
using UnityEngine.Events; [BepInPlugin(PLUGIN_GUID, PLUGIN_NAME, PLUGIN_VERSION)]
using UnityEngine.SceneManagement; public class Plugin : BasePlugin
{
namespace BetterStuff; public const string PLUGIN_GUID = "de.mpburgmann.BetterStuff";
public const string PLUGIN_NAME = "Better Stuff";
[BepInPlugin(PLUGIN_GUID, PLUGIN_NAME, PLUGIN_VERSION)] public const string PLUGIN_VERSION = "1.1.0";
public class Plugin : BasePlugin internal static new ManualLogSource Log;
{
public const string PLUGIN_GUID = "de.mpburgmann.BetterStuff"; private static ConfigEntry<float> scanTime;
public const string PLUGIN_NAME = "Better Stuff"; private static ConfigEntry<float> finishDuration;
public const string PLUGIN_VERSION = "1.2.0"; private static ConfigEntry<float> timeAfterScans;
internal static new ManualLogSource Log; private static ConfigEntry<float> restockerSpeed;
private static ConfigEntry<float> selfcheckoutCustomerSpeed;
public const float acceleration = 200f; private static ConfigEntry<float> selfcheckoutPlayerSpeed;
public const float angularSpeed = 200f; private static ConfigEntry<float> customerHelperScanningSpeed;
private static ConfigEntry<float> customerHelperSpeed;
private static ConfigEntry<float> scanTime; private static ConfigEntry<float> securityGuardSpeed;
private static ConfigEntry<float> finishDuration; private static ConfigEntry<float> janitorSpeed;
private static ConfigEntry<float> timeAfterScans;
private static ConfigEntry<float> restockerSpeed;
private static ConfigEntry<float> selfcheckoutCustomerSpeed; public override void Load()
private static ConfigEntry<float> selfcheckoutPlayerSpeed; {
private static ConfigEntry<float> customerHelperScanningSpeed; // Plugin startup logic
private static ConfigEntry<float> customerHelperSpeed; Log = base.Log;
public static ConfigEntry<float> securityGuardSpeed; Log.LogInfo($"Plugin {MyPluginInfo.PLUGIN_GUID} is loaded!");
private static ConfigEntry<float> janitorSpeed;
private static ConfigEntry<float> bakerSpeed; scanTime = Config.Bind("Cashier", "Scanning Speed", 0.7f, "Default vanilla value is 1.5.");
finishDuration = Config.Bind("Cashier", "FinishingDuration", 1f, "Default vanilla value is 2.");
timeAfterScans = Config.Bind("Cashier", "TimeAfterAllScans", 0.5f, "Default vanilla value is 1.");
public override void Load()
{ restockerSpeed = Config.Bind("Restocker", "Speed", 5f, "Default value is 2.");
// Plugin startup logic
Log = base.Log; selfcheckoutCustomerSpeed = Config.Bind("Selfcheckout", "Customer Speed", 0.6f, "Default vanilla value is 1.8.");
Log.LogInfo($"Plugin {MyPluginInfo.PLUGIN_GUID} is loaded!"); selfcheckoutPlayerSpeed = Config.Bind("Selfcheckout", "Player Speed", 0.3f, "Default vanilla value is 0.6.");
scanTime = Config.Bind("Cashier", "Scanning Speed", 0.7f, "Default vanilla value is 1.5."); customerHelperScanningSpeed = Config.Bind("Customer Helper", "Scanning Speed", 0.5f, "Default vanilla value is 1.5.");
finishDuration = Config.Bind("Cashier", "FinishingDuration", 1f, "Default vanilla value is 2."); customerHelperSpeed = Config.Bind("Customer Helper", "Speed", 5f, "Default value is 2.");
timeAfterScans = Config.Bind("Cashier", "TimeAfterAllScans", 0.5f, "Default vanilla value is 1.");
securityGuardSpeed = Config.Bind("Security Guard", "Speed", 5f, "Default value is 2.");
restockerSpeed = Config.Bind("Restocker", "Speed", 5f, "Default value is 2.");
janitorSpeed = Config.Bind("Janitor", "Speed", 5f, "Default value is 2.");
selfcheckoutCustomerSpeed = Config.Bind("Selfcheckout", "Customer Speed", 0.6f, "Default vanilla value is 1.8.");
selfcheckoutPlayerSpeed = Config.Bind("Selfcheckout", "Player Speed", 0.3f, "Default vanilla value is 0.6.");
Harmony harmony = new(PLUGIN_GUID);
customerHelperScanningSpeed = Config.Bind("Customer Helper", "Scanning Speed", 0.5f, "Default vanilla value is 1.5."); harmony.PatchAll();
customerHelperSpeed = Config.Bind("Customer Helper", "Speed", 5f, "Default vanilla value is 2."); }
securityGuardSpeed = Config.Bind("Security Guard", "Speed", 5f, "Default vanilla value is 2."); [HarmonyPatch(typeof(Cashier), "Start")]
public static class Cashier_Start_Patch
janitorSpeed = Config.Bind("Janitor", "Speed", 5f, "Default vanilla value is 2."); {
[HarmonyPostfix]
bakerSpeed = Config.Bind("Baker", "Speed", 5f, "Default vanilla value is 2."); public static void Postfix(Cashier __instance)
{
__instance.ScanningInterval = scanTime.Value;
Harmony harmony = new(PLUGIN_GUID); }
harmony.PatchAll(); }
SceneManager.sceneLoaded += (UnityAction<Scene, LoadSceneMode>) OnSceneLoaded; [HarmonyPatch(typeof(Checkout), "FinishedScanning")]
} public static class Cashier_Checkout_Patch
{
[HarmonyPatch(typeof(Cashier), "Start")] [HarmonyPostfix]
public static class Cashier_Start_Patch public static void Postfix(Checkout __instance)
{ {
[HarmonyPostfix] if(!__instance.m_IsSelfCheckout)
public static void Postfix(Cashier __instance) {
{ __instance.m_AutomatedCheckout.m_FinishingPaymentDuration = finishDuration.Value;
__instance.ScanningInterval = scanTime.Value; __instance.m_AutomatedCheckout.m_IntervalAfterScanningAll = timeAfterScans.Value;
} }
} }
}
[HarmonyPatch(typeof(Checkout), "FinishedScanning")]
public static class Cashier_Checkout_Patch [HarmonyPatch(typeof(Restocker), "Start")]
{ public static class Restocker_Start_Patch
[HarmonyPostfix] {
public static void Postfix(Checkout __instance) [HarmonyPostfix]
{ public static void Postfix(Restocker __instance)
if(!__instance.m_IsSelfCheckout) {
{ __instance.m_Agent.speed = restockerSpeed.Value;
__instance.m_AutomatedCheckout.m_FinishingPaymentDuration = finishDuration.Value; __instance.m_Agent.acceleration *= 200f;
__instance.m_AutomatedCheckout.m_IntervalAfterScanningAll = timeAfterScans.Value; __instance.m_Agent.angularSpeed *= 200f;
} }
} }
}
[HarmonyPatch(typeof(Checkout), "Start")]
[HarmonyPatch(typeof(Restocker), "Start")] public static class Selfcheckout_Start_Patch
public static class Restocker_Start_Patch {
{ [HarmonyPostfix]
[HarmonyPostfix] public static void Postfix(Checkout __instance)
public static void Postfix(Restocker __instance) {
{ if (__instance.m_IsSelfCheckout)
__instance.m_Agent.speed = restockerSpeed.Value; {
__instance.m_Agent.acceleration *= acceleration; __instance.m_SelfCheckout.m_CustomerScanningInterval = selfcheckoutCustomerSpeed.Value;
__instance.m_Agent.angularSpeed *= angularSpeed; __instance.m_SelfCheckout.m_PlayerScanningInterval = selfcheckoutPlayerSpeed.Value;
} }
} }
}
[HarmonyPatch(typeof(Checkout), "Start")]
public static class Selfcheckout_Start_Patch [HarmonyPatch(typeof(CustomerHelper), "Start")]
{ public static class CustomerHelper_Start_Patch
[HarmonyPostfix] {
public static void Postfix(Checkout __instance) [HarmonyPostfix]
{ public static void Postfix(CustomerHelper __instance)
if (__instance.m_IsSelfCheckout) {
{ __instance.ScanningInterval = customerHelperScanningSpeed.Value;
__instance.m_SelfCheckout.m_CustomerScanningInterval = selfcheckoutCustomerSpeed.Value; __instance.m_CustomerHelperScanIntervals = new Il2CppSystem.Collections.Generic.List<float>(1);
__instance.m_SelfCheckout.m_PlayerScanningInterval = selfcheckoutPlayerSpeed.Value; __instance.m_CustomerHelperScanIntervals.Add(customerHelperScanningSpeed.Value);
} __instance.m_Agent.speed = customerHelperSpeed.Value;
} __instance.m_Agent.acceleration *= 200f;
} __instance.m_Agent.angularSpeed *= 200f;
}
[HarmonyPatch(typeof(CustomerHelper), "Start")] }
public static class CustomerHelper_Start_Patch
{ [HarmonyPatch(typeof(SecurityGuard), "Start")]
[HarmonyPostfix] public static class SecurityGuard_Start_Patch
public static void Postfix(CustomerHelper __instance) {
{ [HarmonyPostfix]
__instance.ScanningInterval = customerHelperScanningSpeed.Value; public static void Postfix(SecurityGuard __instance)
__instance.m_CustomerHelperScanIntervals = new Il2CppSystem.Collections.Generic.List<float>(1); {
__instance.m_CustomerHelperScanIntervals.Add(customerHelperScanningSpeed.Value); __instance.m_AnimController.m_Agent.speed = securityGuardSpeed.Value;
__instance.m_Agent.speed = customerHelperSpeed.Value; __instance.m_AnimController.m_Agent.acceleration *= 200f;
__instance.m_Agent.acceleration *= acceleration; __instance.m_AnimController.m_Agent.angularSpeed *= 200f;
__instance.m_Agent.angularSpeed *= angularSpeed; }
} }
}
[HarmonyPatch(typeof(Janitor), "Start")]
// [HarmonyPatch(typeof(SecurityGuardAnimationController), "Start")] public static class Janitor_Start_Patch
// public static class SecurityGuardAnimationController_Start_Patch {
// { [HarmonyPostfix]
// [HarmonyPostfix] public static void Postfix(Janitor __instance)
// public static void Postfix(SecurityGuardAnimationController __instance) {
// { __instance.m_Agent.speed = janitorSpeed.Value;
// __instance.m_Agent.speed = securityGuardSpeed.Value; __instance.m_Agent.acceleration *= 200f;
// __instance.m_Agent.acceleration *= acceleration; __instance.m_Agent.angularSpeed *= 200f;
// __instance.m_Agent.angularSpeed *= angularSpeed; }
}
// }
// }
[HarmonyPatch(typeof(Janitor), "Start")]
public static class Janitor_Start_Patch
{
[HarmonyPostfix]
public static void Postfix(Janitor __instance)
{
__instance.m_Agent.speed = janitorSpeed.Value;
__instance.m_Agent.acceleration *= acceleration;
__instance.m_Agent.angularSpeed *= angularSpeed;
}
}
[HarmonyPatch(typeof(Baker), "Start")]
public static class Baker_Start_Patch
{
[HarmonyPostfix]
public static void Postfix(Baker __instance)
{
__instance.m_Agent.speed = bakerSpeed.Value;
__instance.m_Agent.acceleration *= acceleration;
__instance.m_Agent.angularSpeed *= angularSpeed;
}
}
private static void OnSceneLoaded(Scene scene, LoadSceneMode mode)
{
if (scene.name == "Main Scene")
{
ClassInjector.RegisterTypeInIl2Cpp<Behaviour>();
GameObject gameObject = new("BetterStuffBehaviour");
Object.DontDestroyOnLoad(gameObject);
gameObject.AddComponent<Behaviour>();
}
if(scene.name == "Main Menu")
{
Object gameObject = GameObject.Find("BetterStuffBehaviour");
if(gameObject != null)
{
Object.Destroy(gameObject);
}
}
}
} }