|
|
|
@@ -1,13 +1,8 @@
|
|
|
|
|
using __Project__.Scripts.Janitor;
|
|
|
|
|
using BepInEx;
|
|
|
|
|
using BepInEx;
|
|
|
|
|
using BepInEx.Configuration;
|
|
|
|
|
using BepInEx.Logging;
|
|
|
|
|
using BepInEx.Unity.IL2CPP;
|
|
|
|
|
using HarmonyLib;
|
|
|
|
|
using Il2CppInterop.Runtime.Injection;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
using UnityEngine.Events;
|
|
|
|
|
using UnityEngine.SceneManagement;
|
|
|
|
|
|
|
|
|
|
namespace BetterStuff;
|
|
|
|
|
|
|
|
|
@@ -16,12 +11,9 @@ public class Plugin : BasePlugin
|
|
|
|
|
{
|
|
|
|
|
public const string PLUGIN_GUID = "de.mpburgmann.BetterStuff";
|
|
|
|
|
public const string PLUGIN_NAME = "Better Stuff";
|
|
|
|
|
public const string PLUGIN_VERSION = "1.2.0";
|
|
|
|
|
public const string PLUGIN_VERSION = "1.1.0";
|
|
|
|
|
internal static new ManualLogSource Log;
|
|
|
|
|
|
|
|
|
|
public const float acceleration = 200f;
|
|
|
|
|
public const float angularSpeed = 200f;
|
|
|
|
|
|
|
|
|
|
private static ConfigEntry<float> scanTime;
|
|
|
|
|
private static ConfigEntry<float> finishDuration;
|
|
|
|
|
private static ConfigEntry<float> timeAfterScans;
|
|
|
|
@@ -30,9 +22,8 @@ public class Plugin : BasePlugin
|
|
|
|
|
private static ConfigEntry<float> selfcheckoutPlayerSpeed;
|
|
|
|
|
private static ConfigEntry<float> customerHelperScanningSpeed;
|
|
|
|
|
private static ConfigEntry<float> customerHelperSpeed;
|
|
|
|
|
public static ConfigEntry<float> securityGuardSpeed;
|
|
|
|
|
private static ConfigEntry<float> securityGuardSpeed;
|
|
|
|
|
private static ConfigEntry<float> janitorSpeed;
|
|
|
|
|
private static ConfigEntry<float> bakerSpeed;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public override void Load()
|
|
|
|
@@ -51,19 +42,15 @@ public class Plugin : BasePlugin
|
|
|
|
|
selfcheckoutPlayerSpeed = Config.Bind("Selfcheckout", "Player Speed", 0.3f, "Default vanilla value is 0.6.");
|
|
|
|
|
|
|
|
|
|
customerHelperScanningSpeed = Config.Bind("Customer Helper", "Scanning Speed", 0.5f, "Default vanilla value is 1.5.");
|
|
|
|
|
customerHelperSpeed = Config.Bind("Customer Helper", "Speed", 5f, "Default vanilla value is 2.");
|
|
|
|
|
customerHelperSpeed = Config.Bind("Customer Helper", "Speed", 5f, "Default value is 2.");
|
|
|
|
|
|
|
|
|
|
securityGuardSpeed = Config.Bind("Security Guard", "Speed", 5f, "Default vanilla value is 2.");
|
|
|
|
|
securityGuardSpeed = Config.Bind("Security Guard", "Speed", 5f, "Default value is 2.");
|
|
|
|
|
|
|
|
|
|
janitorSpeed = Config.Bind("Janitor", "Speed", 5f, "Default vanilla value is 2.");
|
|
|
|
|
|
|
|
|
|
bakerSpeed = Config.Bind("Baker", "Speed", 5f, "Default vanilla value is 2.");
|
|
|
|
|
janitorSpeed = Config.Bind("Janitor", "Speed", 5f, "Default value is 2.");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Harmony harmony = new(PLUGIN_GUID);
|
|
|
|
|
harmony.PatchAll();
|
|
|
|
|
|
|
|
|
|
SceneManager.sceneLoaded += (UnityAction<Scene, LoadSceneMode>) OnSceneLoaded;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[HarmonyPatch(typeof(Cashier), "Start")]
|
|
|
|
@@ -97,8 +84,8 @@ public class Plugin : BasePlugin
|
|
|
|
|
public static void Postfix(Restocker __instance)
|
|
|
|
|
{
|
|
|
|
|
__instance.m_Agent.speed = restockerSpeed.Value;
|
|
|
|
|
__instance.m_Agent.acceleration *= acceleration;
|
|
|
|
|
__instance.m_Agent.angularSpeed *= angularSpeed;
|
|
|
|
|
__instance.m_Agent.acceleration *= 200f;
|
|
|
|
|
__instance.m_Agent.angularSpeed *= 200f;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -126,23 +113,22 @@ public class Plugin : BasePlugin
|
|
|
|
|
__instance.m_CustomerHelperScanIntervals = new Il2CppSystem.Collections.Generic.List<float>(1);
|
|
|
|
|
__instance.m_CustomerHelperScanIntervals.Add(customerHelperScanningSpeed.Value);
|
|
|
|
|
__instance.m_Agent.speed = customerHelperSpeed.Value;
|
|
|
|
|
__instance.m_Agent.acceleration *= acceleration;
|
|
|
|
|
__instance.m_Agent.angularSpeed *= angularSpeed;
|
|
|
|
|
__instance.m_Agent.acceleration *= 200f;
|
|
|
|
|
__instance.m_Agent.angularSpeed *= 200f;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// [HarmonyPatch(typeof(SecurityGuardAnimationController), "Start")]
|
|
|
|
|
// public static class SecurityGuardAnimationController_Start_Patch
|
|
|
|
|
// {
|
|
|
|
|
// [HarmonyPostfix]
|
|
|
|
|
// public static void Postfix(SecurityGuardAnimationController __instance)
|
|
|
|
|
// {
|
|
|
|
|
// __instance.m_Agent.speed = securityGuardSpeed.Value;
|
|
|
|
|
// __instance.m_Agent.acceleration *= acceleration;
|
|
|
|
|
// __instance.m_Agent.angularSpeed *= angularSpeed;
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
[HarmonyPatch(typeof(SecurityGuard), "Start")]
|
|
|
|
|
public static class SecurityGuard_Start_Patch
|
|
|
|
|
{
|
|
|
|
|
[HarmonyPostfix]
|
|
|
|
|
public static void Postfix(SecurityGuard __instance)
|
|
|
|
|
{
|
|
|
|
|
__instance.m_AnimController.m_Agent.speed = securityGuardSpeed.Value;
|
|
|
|
|
__instance.m_AnimController.m_Agent.acceleration *= 200f;
|
|
|
|
|
__instance.m_AnimController.m_Agent.angularSpeed *= 200f;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[HarmonyPatch(typeof(Janitor), "Start")]
|
|
|
|
|
public static class Janitor_Start_Patch
|
|
|
|
@@ -151,41 +137,8 @@ public class Plugin : BasePlugin
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
__instance.m_Agent.acceleration *= 200f;
|
|
|
|
|
__instance.m_Agent.angularSpeed *= 200f;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|