using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using SliderSens.Patches;
using TMPro;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.Controls;
using UnityEngine.UI;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("SliderSens")]
[assembly: AssemblyDescription("Adds a decimal place to the sensitivity sliders in Super Battle Golf.")]
[assembly: AssemblyProduct("SliderSens")]
[assembly: AssemblyCompany("lmkHenlo")]
[assembly: AssemblyCopyright("Copyright (c) 2026 lmkHenlo")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace SliderSens
{
internal static class GamepadFineAdjust
{
internal const float Step = 0.01f;
internal const float TriggerStep = 0.1f;
internal static Func<bool> IsOn = () => false;
private static FieldInfo _previousDirection;
private static int _horizontalBits;
private static FieldRef<MenuNavigation, float> _autoShiftTimer;
private static MenuNavigation _navigation;
private static Slider _slider;
private static bool _engaged;
private static HoldRepeat _repeat;
private static bool _failed;
internal static void FindGameFields()
{
_previousDirection = AccessTools.Field(typeof(MenuNavigation), "previousNavigationDirection");
if (_previousDirection == null || !_previousDirection.FieldType.IsEnum)
{
throw new MissingFieldException("MenuNavigation", "previousNavigationDirection");
}
_horizontalBits = Convert.ToInt32(Enum.Parse(_previousDirection.FieldType, "Horizontal"));
if (_horizontalBits == 0)
{
throw new MissingFieldException(_previousDirection.FieldType.FullName, "Horizontal");
}
_autoShiftTimer = AccessTools.FieldRefAccess<MenuNavigation, float>("autoShiftTimer");
}
internal static bool Owns(Slider slider)
{
if (_engaged && (Object)(object)slider != (Object)null)
{
return slider == _slider;
}
return false;
}
internal static void BeforeNavigationUpdate(MenuNavigation navigation)
{
if (_failed || !IsOn())
{
if (navigation == _navigation)
{
Release();
}
return;
}
try
{
Update(navigation);
}
catch (Exception arg)
{
_failed = true;
Release();
Plugin.Log.LogError((object)$"Gamepad fine adjustment is off for this session after an error: {arg}");
}
}
private static void Update(MenuNavigation navigation)
{
SensitivitySlider found = null;
Gamepad val = null;
if (navigation.CanUpdate())
{
val = InputManager.CurrentGamepad;
ControllerSelectable selected = navigation.Selected;
if (val != null && (Object)(object)selected != (Object)null && selected.IsSlider && selected.IsActiveAtAll && selected.IsEffectivelyInteractable())
{
SensitivitySliders.TryGet(selected.AsSlider, out found);
}
}
if (found == null)
{
if (navigation == _navigation || (Object)(object)_navigation == (Object)null)
{
Release();
}
return;
}
if (navigation != _navigation || found.Slider != _slider)
{
Release();
_navigation = navigation;
_slider = found.Slider;
}
int num = Horizontal(val);
bool flag = val.leftTrigger.isPressed || val.rightTrigger.isPressed;
_engaged = true;
if (num != 0)
{
HoldBackGameStep(navigation);
}
if (_repeat.Tick(num, Time.unscaledDeltaTime))
{
SensitivitySliders.Step(found, (float)num * (flag ? 0.1f : 0.01f), found.SnapOnGamepad);
}
}
private static int Horizontal(Gamepad gamepad)
{
if (gamepad.leftStick.left.isPressed || gamepad.dpad.left.isPressed)
{
return -1;
}
if (gamepad.leftStick.right.isPressed || gamepad.dpad.right.isPressed)
{
return 1;
}
return 0;
}
private static void HoldBackGameStep(MenuNavigation navigation)
{
int num = Convert.ToInt32(_previousDirection.GetValue(navigation));
if ((num & _horizontalBits) != _horizontalBits)
{
_previousDirection.SetValue(navigation, Enum.ToObject(_previousDirection.FieldType, num | _horizontalBits));
}
_autoShiftTimer.Invoke(navigation) = 0.4f;
}
private static void Release()
{
_engaged = false;
_navigation = null;
_slider = null;
_repeat.Reset();
}
}
internal struct HoldRepeat
{
internal const float FirstDelay = 0.4f;
internal const float Interval = 0.1f;
private int _direction;
private float _timer;
internal bool Tick(int direction, float deltaTime)
{
if (direction == 0)
{
_direction = 0;
return false;
}
if (direction != _direction)
{
_direction = direction;
_timer = 0.4f;
return true;
}
_timer -= deltaTime;
if (_timer > 0f)
{
return false;
}
_timer = 0.1f;
return true;
}
internal void Reset()
{
_direction = 0;
}
}
internal sealed class KeyboardFineAdjust : MonoBehaviour
{
internal const float Step = 0.01f;
internal const float ShiftStep = 0.1f;
internal static Func<bool> IsOn = () => false;
private static readonly List<KeyboardFineAdjust> Open = new List<KeyboardFineAdjust>();
private static bool _failed;
private SettingsMenu _menu;
private HoldRepeat _repeat;
internal static void AddTo(SettingsMenu menu)
{
if (!((Object)(object)menu == (Object)null) && !((Object)(object)((Component)menu).GetComponent<KeyboardFineAdjust>() != (Object)null))
{
((Component)menu).gameObject.AddComponent<KeyboardFineAdjust>()._menu = menu;
}
}
private void OnEnable()
{
Open.Add(this);
}
private void OnDisable()
{
Open.Remove(this);
_repeat.Reset();
}
private void Update()
{
if (_failed || !IsOn())
{
return;
}
try
{
Keyboard current = Keyboard.current;
SensitivitySlider sensitivitySlider = ((current != null && InputManager.UsingKeyboard) ? Target() : null);
if (sensitivitySlider == null)
{
_repeat.Reset();
return;
}
int num = (((ButtonControl)current.rightArrowKey).isPressed ? 1 : 0) - (((ButtonControl)current.leftArrowKey).isPressed ? 1 : 0);
if (_repeat.Tick(num, Time.unscaledDeltaTime))
{
float num2 = (current.shiftKey.isPressed ? 0.1f : 0.01f);
SensitivitySliders.Step(sensitivitySlider, (float)num * num2, sensitivitySlider.SnapOnKeyboard);
}
}
catch (Exception arg)
{
_failed = true;
Plugin.Log.LogError((object)$"Keyboard fine adjustment is off for this session after an error: {arg}");
}
}
internal static bool OwnsArrowKeys()
{
if (_failed || !IsOn() || !InputManager.UsingKeyboard)
{
return false;
}
Keyboard current = Keyboard.current;
if (current == null || (!((ButtonControl)current.leftArrowKey).isPressed && !((ButtonControl)current.rightArrowKey).isPressed))
{
return false;
}
foreach (KeyboardFineAdjust item in Open)
{
if (item.Target() != null)
{
return true;
}
}
return false;
}
private SensitivitySlider Target()
{
//IL_005d: Unknown result type (might be due to invalid IL or missing references)
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_008b: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)_menu == (Object)null)
{
return null;
}
GameObject val = (((Object)(object)EventSystem.current != (Object)null) ? EventSystem.current.currentSelectedGameObject : null);
if ((Object)(object)val != (Object)null)
{
TMP_InputField component = val.GetComponent<TMP_InputField>();
if ((Object)(object)component != (Object)null && component.isFocused)
{
return null;
}
}
Mouse current = Mouse.current;
if (current != null)
{
Vector2 pointer = ((InputControl<Vector2>)(object)((Pointer)current).position).ReadValue();
foreach (SliderOption item in MenuSliders())
{
SensitivitySlider sensitivitySlider = Usable(item);
if (sensitivitySlider != null && IsUnder(sensitivitySlider.Slider, pointer))
{
return sensitivitySlider;
}
}
}
if ((Object)(object)val != (Object)null)
{
Slider component2 = val.GetComponent<Slider>();
foreach (SliderOption item2 in MenuSliders())
{
SensitivitySlider sensitivitySlider2 = Usable(item2);
if (sensitivitySlider2 != null && sensitivitySlider2.Slider == component2)
{
return sensitivitySlider2;
}
}
}
return null;
}
private IEnumerable<SliderOption> MenuSliders()
{
yield return _menu.mouseSensitivity;
yield return _menu.mouseAimSensitivity;
yield return _menu.controllerSensitivity;
yield return _menu.controllerAimSensitivity;
}
private static SensitivitySlider Usable(SliderOption option)
{
SensitivitySlider sensitivitySlider = SensitivitySliders.Find(option);
if (sensitivitySlider == null)
{
return null;
}
Slider slider = sensitivitySlider.Slider;
if (!((Object)(object)slider != (Object)null) || !((UIBehaviour)slider).IsActive() || !((Selectable)slider).IsInteractable())
{
return null;
}
return sensitivitySlider;
}
private static bool IsUnder(Slider slider, Vector2 pointer)
{
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
//IL_004a: Unknown result type (might be due to invalid IL or missing references)
Transform transform = ((Component)slider).transform;
RectTransform val = (RectTransform)(object)((transform is RectTransform) ? transform : null);
if ((Object)(object)val == (Object)null)
{
return false;
}
Canvas val2 = ((Component)slider).GetComponentInParent<Canvas>();
if ((Object)(object)val2 != (Object)null)
{
val2 = val2.rootCanvas;
}
Camera val3 = (((Object)(object)val2 == (Object)null || (int)val2.renderMode == 0) ? null : val2.worldCamera);
return RectTransformUtility.RectangleContainsScreenPoint(val, pointer, val3);
}
}
[BepInPlugin("com.slidersens", "SliderSens", "1.0.0")]
public class Plugin : BaseUnityPlugin
{
public const string Guid = "com.slidersens";
public const string Name = "SliderSens";
public const string Version = "1.0.0";
internal static ManualLogSource Log;
internal static bool Running;
internal static ConfigEntry<bool> Enabled;
internal static ConfigEntry<bool> KeyboardFineAdjustSetting;
internal static ConfigEntry<bool> GamepadFineAdjustSetting;
internal static readonly PatchModule[] CorePatches = new PatchModule[2]
{
new PatchModule(typeof(SliderLoadPatch), "Saved sensitivity on load"),
new PatchModule(typeof(SensitivityValuePatch), "Sensitivity sliders: 0.01 steps")
};
internal static readonly PatchModule MovePatch = new PatchModule(typeof(SliderMovePatch), "Arrow keys: the game's own slider step held back");
internal static readonly PatchModule KeyboardPatch = new PatchModule(typeof(SettingsMenuPatch), "Arrow keys: fine adjustment");
internal static readonly PatchModule GamepadPatch = new PatchModule(typeof(MenuNavigationPatch), "Gamepad: fine steps");
private void Awake()
{
//IL_0037: Unknown result type (might be due to invalid IL or missing references)
//IL_003d: Expected O, but got Unknown
Log = ((BaseUnityPlugin)this).Logger;
BindConfig(((BaseUnityPlugin)this).Config);
if (!Enabled.Value)
{
Log.LogInfo((object)"SliderSens 1.0.0 loaded. Off (General.Enabled = false): the game's own sensitivity sliders.");
return;
}
Harmony harmony = new Harmony("com.slidersens");
if (ApplyCore(harmony, Log))
{
Log.LogInfo((object)string.Format("{0} {1} loaded. Sensitivity sliders in steps of {2:0.00}.", "SliderSens", "1.0.0", 0.01f));
ApplyFineAdjust(harmony, KeyboardFineAdjustSetting.Value, GamepadFineAdjustSetting.Value, Log);
}
}
internal static bool ApplyCore(Harmony harmony, ManualLogSource log)
{
try
{
SensitivitySliders.UseGameConversions();
}
catch (Exception ex)
{
log.LogError((object)("[FAILED] The game's sensitivity slider curve: " + ex.Message));
log.LogError((object)"SliderSens is off: the game's sensitivity sliders have changed. The game keeps its own sliders.");
return false;
}
bool flag = true;
PatchModule[] corePatches = CorePatches;
foreach (PatchModule patchModule in corePatches)
{
flag &= patchModule.TryApply(harmony, log);
}
if (flag)
{
Running = true;
return true;
}
try
{
harmony.UnpatchSelf();
log.LogError((object)"SliderSens is off: a patch failed (see [FAILED] above), so every patch was removed again. The game keeps its own sensitivity sliders.");
}
catch (Exception arg)
{
log.LogError((object)("SliderSens is off: a patch failed (see [FAILED] above), and removing the others " + $"failed too: {arg}"));
}
return false;
}
internal static void ApplyFineAdjust(Harmony harmony, bool keyboard, bool gamepad, ManualLogSource log)
{
KeyboardFineAdjust.IsOn = () => false;
GamepadFineAdjust.IsOn = () => false;
bool flag = (keyboard || gamepad) && MovePatch.TryApply(harmony, log);
if (!keyboard)
{
log.LogInfo((object)"Arrow keys off (Keyboard.FineAdjust = false).");
}
else if (!flag)
{
log.LogWarning((object)"Arrow keys are off: without the patch above, one key press could move a slider twice. The 0.01 steps and the rest of the mod work as before.");
}
else if (KeyboardPatch.TryApply(harmony, log))
{
KeyboardFineAdjust.IsOn = () => Running;
}
else
{
log.LogWarning((object)"Arrow keys are off: their patch failed (see [FAILED] above). The 0.01 steps and the rest of the mod work as before.");
}
if (!gamepad)
{
log.LogInfo((object)"Gamepad fine steps off (Gamepad.FineAdjust = false).");
return;
}
try
{
GamepadFineAdjust.FindGameFields();
}
catch (Exception ex)
{
log.LogError((object)("[FAILED] " + GamepadPatch.Label + ": the game's menu navigation has changed (" + ex.Message + ")"));
log.LogWarning((object)"Gamepad fine steps are off. The 0.01 steps and the rest of the mod work as before.");
return;
}
if (GamepadPatch.TryApply(harmony, log))
{
GamepadFineAdjust.IsOn = () => Running;
}
else
{
log.LogWarning((object)"Gamepad fine steps are off: their patch failed (see [FAILED] above). The 0.01 steps and the rest of the mod work as before.");
}
}
internal static void Stop(string label, Exception e)
{
if (Running)
{
Running = false;
Log.LogError((object)("SliderSens is off for this session after an error in \"" + label + "\"; the game's own sensitivity " + $"sliders take over: {e}"));
}
}
internal static void BindConfig(ConfigFile config)
{
Enabled = config.Bind<bool>("General", "Enabled", true, "Sensitivity sliders in steps of 0.01, with two decimal places on screen. Off = the game's own sliders, with one decimal place.");
KeyboardFineAdjustSetting = config.Bind<bool>("Keyboard", "FineAdjust", true, "The Left and Right arrow keys step the sensitivity slider under the mouse pointer (or, if there isn't one, the one you last clicked) by 0.01; hold Shift for 0.1. Off = the arrow keys do what they do in the game.");
GamepadFineAdjustSetting = config.Bind<bool>("Gamepad", "FineAdjust", true, "On a gamepad, Left and Right move a sensitivity slider by 0.01; hold either trigger for 0.1. Off = the game's own steps (5% of the slider).");
}
}
internal sealed class PatchModule
{
internal readonly Type Type;
internal readonly string Label;
internal PatchModule(Type type, string label)
{
Type = type;
Label = label;
}
internal bool TryApply(Harmony harmony, ManualLogSource log)
{
try
{
List<MethodInfo> list = harmony.CreateClassProcessor(Type).Patch();
if (list == null || list.Count == 0)
{
log.LogError((object)("[FAILED] " + Label + ": no game method to patch"));
return false;
}
log.LogInfo((object)("[ok] " + Label));
return true;
}
catch (Exception arg)
{
log.LogError((object)$"[FAILED] {Label}: {arg}");
return false;
}
}
}
internal static class Sensitivity
{
internal const int Decimals = 2;
internal const int StepsPerUnit = 100;
internal const float FineStep = 0.01f;
internal const string LabelFormat = "{0:0.00}x";
internal const float Middle = 1f;
internal const float SnapPosition = 0.5f;
internal const float SnapTolerance = 0.05f;
internal const float GridTolerance = 5E-05f;
internal static Func<float, float, float, float, float> ToValue;
internal static Func<float, float, float, float, float> ToPosition;
private static readonly Dictionary<long, float[]> Edges = new Dictionary<long, float[]>();
internal static float Round(float value, float min, float max)
{
if (float.IsNaN(value))
{
value = 1f;
}
float num = (float)Math.Round((double)value * 100.0, MidpointRounding.AwayFromZero) / 100f;
if (num < min)
{
return min;
}
if (num > max)
{
return max;
}
return num;
}
internal static float FromLoaded(float value, float min, float max)
{
float num = Round(value, min, max);
if (!(Math.Abs(value - num) <= 5E-05f))
{
return value;
}
return num;
}
internal static float Position(float value, float min, float max)
{
return ToPosition(value, min, max, 1f);
}
internal static float Value(float position, float min, float max)
{
return ToValue(position, min, max, 1f);
}
internal static bool InSnapZone(float value, float min, float max)
{
return Snaps(Position(value, min, max));
}
internal static bool Snaps(float position)
{
return FloatExtensions.Approximately(position, 0.5f, 0.05f);
}
internal static float Step(float current, float delta, float min, float max, bool snaps)
{
float num = Round(current, min, max);
float num2 = Round(current + delta, min, max);
if (!snaps || num2 == 1f || !InSnapZone(num2, min, max))
{
return num2;
}
float[] array = SnapZoneEdges(min, max);
if (delta > 0f)
{
if (!(num < 1f))
{
return array[1];
}
return 1f;
}
if (!(num > 1f))
{
return array[0];
}
return 1f;
}
internal static float[] SnapZoneEdges(float min, float max)
{
long key = ((long)Math.Round(min * 100f) << 32) | (uint)Math.Round(max * 100f);
if (Edges.TryGetValue(key, out var value))
{
return value;
}
int num = (int)Math.Round(100.0);
int num2 = (int)Math.Round(min * 100f);
int num3 = (int)Math.Round(max * 100f);
float num4 = min;
float num5 = max;
for (int num6 = num - 1; num6 >= num2; num6--)
{
float num7 = (float)num6 / 100f;
if (!InSnapZone(num7, min, max))
{
num4 = num7;
break;
}
}
for (int i = num + 1; i <= num3; i++)
{
float num8 = (float)i / 100f;
if (!InSnapZone(num8, min, max))
{
num5 = num8;
break;
}
}
value = new float[2] { num4, num5 };
Edges[key] = value;
return value;
}
}
internal sealed class SensitivitySlider
{
internal readonly SliderOption Option;
internal float Min;
internal float Max;
internal bool SnapOnKeyboard;
internal bool SnapOnGamepad;
internal Slider Slider
{
get
{
if (!((Object)(object)Option == (Object)null))
{
return Option.Slider;
}
return null;
}
}
internal SensitivitySlider(SliderOption option)
{
Option = option;
}
}
internal static class SensitivitySliders
{
private static readonly List<SensitivitySlider> Known = new List<SensitivitySlider>();
internal static SliderOption Loading;
internal static void UseGameConversions()
{
MethodInfo methodInfo = AccessTools.Method(typeof(SliderOption), "RemapSliderValueToValueMiddleLinear", new Type[4]
{
typeof(float),
typeof(float),
typeof(float),
typeof(float)
}, (Type[])null);
if (methodInfo == null || !methodInfo.IsStatic || methodInfo.ReturnType != typeof(float))
{
throw new MissingMethodException("SliderOption", "RemapSliderValueToValueMiddleLinear(float, float, float, float)");
}
Sensitivity.ToValue = (Func<float, float, float, float, float>)Delegate.CreateDelegate(typeof(Func<float, float, float, float, float>), methodInfo);
Sensitivity.ToPosition = SliderOption.RemapValueSliderValueMiddleLinear;
}
internal static SensitivitySlider Register(SliderOption option, float min, float max, bool snapOnKeyboard, bool snapOnGamepad)
{
SensitivitySlider sensitivitySlider = Find(option);
if (sensitivitySlider == null)
{
Known.RemoveAll((SensitivitySlider s) => (Object)(object)s.Option == (Object)null);
sensitivitySlider = new SensitivitySlider(option);
Known.Add(sensitivitySlider);
KeepOnOneLine((TMP_Text)(object)option.label);
}
sensitivitySlider.Min = min;
sensitivitySlider.Max = max;
sensitivitySlider.SnapOnKeyboard = snapOnKeyboard;
sensitivitySlider.SnapOnGamepad = snapOnGamepad;
return sensitivitySlider;
}
private static void KeepOnOneLine(TMP_Text label)
{
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Invalid comparison between Unknown and I4
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Invalid comparison between Unknown and I4
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)label == (Object)null)
{
return;
}
try
{
if ((int)label.textWrappingMode == 1)
{
label.textWrappingMode = (TextWrappingModes)0;
}
else if ((int)label.textWrappingMode == 2)
{
label.textWrappingMode = (TextWrappingModes)3;
}
if ((int)label.overflowMode != 0)
{
label.overflowMode = (TextOverflowModes)0;
}
}
catch (Exception ex)
{
Plugin.Log.LogWarning((object)("Sensitivity label: couldn't keep it on one line (" + ex.Message + ")."));
}
}
internal static SensitivitySlider Find(SliderOption option)
{
if ((Object)(object)option == (Object)null)
{
return null;
}
foreach (SensitivitySlider item in Known)
{
if (item.Option == option)
{
return item;
}
}
return null;
}
internal static bool TryGet(Slider slider, out SensitivitySlider found)
{
found = null;
if ((Object)(object)slider == (Object)null)
{
return false;
}
foreach (SensitivitySlider item in Known)
{
if ((Object)(object)item.Option != (Object)null && item.Option.Slider == slider)
{
found = item;
return true;
}
}
return false;
}
internal static float SetValue(SliderOption option, float min, float max, bool snapOnKeyboard, bool snapOnGamepad)
{
Register(option, min, max, snapOnKeyboard, snapOnGamepad);
Slider slider = option.Slider;
bool num = Loading == option;
if (!num && (InputManager.UsingKeyboard ? snapOnKeyboard : snapOnGamepad))
{
float value = slider.value;
option.valueWithoutNotify = (Sensitivity.Snaps(value) ? 0.5f : value);
}
float value2 = Sensitivity.Value(slider.value, min, max);
float num2 = (num ? Sensitivity.FromLoaded(value2, min, max) : Sensitivity.Round(value2, min, max));
option.SetValueText($"{num2:0.00}x");
return num2;
}
internal static void Step(SensitivitySlider s, float delta, bool snaps)
{
Slider slider = s.Slider;
if (!((Object)(object)slider == (Object)null))
{
float num = Sensitivity.Position(Sensitivity.Step(Sensitivity.Value(slider.value, s.Min, s.Max), delta, s.Min, s.Max, snaps), s.Min, s.Max);
if (num != slider.value)
{
slider.value = num;
}
}
}
}
}
namespace SliderSens.Patches
{
[HarmonyPatch(typeof(MenuNavigation), "Update")]
internal static class MenuNavigationPatch
{
private static void Prefix(MenuNavigation __instance)
{
GamepadFineAdjust.BeforeNavigationUpdate(__instance);
}
}
[HarmonyPatch(typeof(SliderOption), "SetSensitivityValue")]
internal static class SensitivityValuePatch
{
private static bool Prefix(SliderOption __instance, float __0, float __1, bool __2, bool __3, ref float __result)
{
if (!Plugin.Running)
{
return true;
}
try
{
__result = SensitivitySliders.SetValue(__instance, __0, __1, __2, __3);
return false;
}
catch (Exception e)
{
Plugin.Stop("Sensitivity sliders", e);
return true;
}
}
}
[HarmonyPatch(typeof(SettingsMenu), "Start")]
internal static class SettingsMenuPatch
{
private static void Postfix(SettingsMenu __instance)
{
KeyboardFineAdjust.AddTo(__instance);
}
}
[HarmonyPatch(typeof(SliderOption), "Initialize")]
internal static class SliderLoadPatch
{
private static void Prefix(SliderOption __instance)
{
SensitivitySliders.Loading = __instance;
}
private static Exception Finalizer(Exception __exception)
{
SensitivitySliders.Loading = null;
return __exception;
}
}
[HarmonyPatch(typeof(Slider), "OnMove")]
internal static class SliderMovePatch
{
private static bool Prefix(Slider __instance, AxisEventData __0)
{
//IL_0004: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Invalid comparison between Unknown and I4
if (__0 == null || ((int)__0.moveDir != 0 && (int)__0.moveDir != 2))
{
return true;
}
try
{
return !KeyboardFineAdjust.OwnsArrowKeys() && !GamepadFineAdjust.Owns(__instance);
}
catch (Exception)
{
return true;
}
}
}
}