Version 1.0.0
This commit is contained in:
5
.gitignore
vendored
Normal file
5
.gitignore
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
.git/
|
||||||
|
.vs/
|
||||||
|
bin/
|
||||||
|
obj/
|
||||||
|
*.sln
|
||||||
46
BetterStuff.csproj
Normal file
46
BetterStuff.csproj
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
|
<AssemblyName>BetterStuff</AssemblyName>
|
||||||
|
<Product>Better Stuff</Product>
|
||||||
|
<Version>1.0.0</Version>
|
||||||
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
|
<LangVersion>latest</LangVersion>
|
||||||
|
<RestoreAdditionalProjectSources>
|
||||||
|
https://api.nuget.org/v3/index.json;
|
||||||
|
https://nuget.bepinex.dev/v3/index.json;
|
||||||
|
https://nuget.samboy.dev/v3/index.json
|
||||||
|
</RestoreAdditionalProjectSources>
|
||||||
|
<RootNamespace>BetterStuff</RootNamespace>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="BepInEx.Unity.IL2CPP" Version="6.0.0-be.*" IncludeAssets="compile" />
|
||||||
|
<PackageReference Include="BepInEx.PluginInfoProps" Version="2.*" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="Assembly-CSharp" Publicize="true">
|
||||||
|
<HintPath>..\lib\Assembly-CSharp.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="MyBox" Publicize="true">
|
||||||
|
<HintPath>..\lib\MyBox.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Il2Cppmscorlib" Publicize="true">
|
||||||
|
<HintPath>..\lib\Il2Cppmscorlib.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="UnityEngine.PhysicsModule" Publicize="true">
|
||||||
|
<HintPath>..\lib\UnityEngine.PhysicsModule.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="UnityEngine.CoreModule" Publicize="true">
|
||||||
|
<HintPath>..\lib\UnityEngine.CoreModule.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Unity.InputSystem" Publicize="true">
|
||||||
|
<HintPath>..\lib\Unity.InputSystem.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="UnityEngine.AIModule" Publicize="true">
|
||||||
|
<HintPath>..\lib\UnityEngine.AIModule.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
80
Plugin.cs
Normal file
80
Plugin.cs
Normal file
@@ -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<float> scanTimeMin;
|
||||||
|
private static ConfigEntry<float> scanTimeMax;
|
||||||
|
private static ConfigEntry<float> finishDuration;
|
||||||
|
private static ConfigEntry<float> timeAfterScans;
|
||||||
|
|
||||||
|
private static ConfigEntry<float> 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user