shorten inventory operation queue time
This commit is contained in:
24
Patches/OperationQueuePatch.cs
Normal file
24
Patches/OperationQueuePatch.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System.Reflection;
|
||||
using HarmonyLib;
|
||||
using SPT.Reflection.Patching;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UIFixes;
|
||||
|
||||
public class OperationQueuePatch : ModulePatch
|
||||
{
|
||||
protected override MethodBase GetTargetMethod()
|
||||
{
|
||||
return AccessTools.Method(typeof(ProfileEndpointFactoryAbstractClass), nameof(ProfileEndpointFactoryAbstractClass.TrySendCommands));
|
||||
}
|
||||
|
||||
[PatchPrefix]
|
||||
public static void Prefix(ref float ___float_0)
|
||||
{
|
||||
// The target method is hardcoded to 60 seconds. Rather than try to change that, just lie to it about when it last sent
|
||||
if (Time.realtimeSinceStartup - ___float_0 > Settings.OperationQueueTime.Value)
|
||||
{
|
||||
___float_0 = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -78,6 +78,7 @@ public class Plugin : BaseUnityPlugin
|
||||
TagPatches.Enable();
|
||||
TacticalBindsPatches.Enable();
|
||||
AddOfferContextMenuPatches.Enable();
|
||||
new OperationQueuePatch().Enable();
|
||||
}
|
||||
|
||||
public static bool InRaid()
|
||||
|
||||
10
Settings.cs
10
Settings.cs
@@ -80,6 +80,7 @@ internal class Settings
|
||||
public static ConfigEntry<bool> AutoSwitchTrading { get; set; }
|
||||
public static ConfigEntry<bool> ClickOutOfDialogs { get; set; } // Advanced
|
||||
public static ConfigEntry<bool> RestoreAsyncScrollPositions { get; set; } // Advanced
|
||||
public static ConfigEntry<int> OperationQueueTime { get; set; } // Advanced
|
||||
|
||||
// Input
|
||||
public static ConfigEntry<bool> ToggleOrHoldAim { get; set; }
|
||||
@@ -248,6 +249,15 @@ internal class Settings
|
||||
null,
|
||||
new ConfigurationManagerAttributes { IsAdvanced = true })));
|
||||
|
||||
configEntries.Add(OperationQueueTime = config.Bind(
|
||||
GeneralSection,
|
||||
"Server Operation Queue Time",
|
||||
15,
|
||||
new ConfigDescription(
|
||||
"The client waits this long to batch inventory operations before sending them to the server. Vanilla Tarkov is 60 (!)",
|
||||
new AcceptableValueRange<int>(0, 60),
|
||||
new ConfigurationManagerAttributes { IsAdvanced = true })));
|
||||
|
||||
// Input
|
||||
configEntries.Add(ToggleOrHoldAim = config.Bind(
|
||||
InputSection,
|
||||
|
||||
Reference in New Issue
Block a user