From 135fb316e1712affa714a583d9841b9dc7d2a215 Mon Sep 17 00:00:00 2001 From: Tyfon <29051038+tyfon7@users.noreply.github.com> Date: Fri, 23 Aug 2024 19:19:21 -0700 Subject: [PATCH] Add Reload keybind --- Patches/ContextMenuShortcutPatches.cs | 5 +++++ Settings.cs | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/Patches/ContextMenuShortcutPatches.cs b/Patches/ContextMenuShortcutPatches.cs index e2de8f9..5171029 100644 --- a/Patches/ContextMenuShortcutPatches.cs +++ b/Patches/ContextMenuShortcutPatches.cs @@ -78,6 +78,11 @@ public static class ContextMenuShortcutPatches TryInteraction(__instance, itemContext, EItemInfoButton.UseAll, [EItemInfoButton.Use]); } + if (Settings.ReloadKeyBind.Value.IsDown()) + { + TryInteraction(__instance, itemContext, EItemInfoButton.Reload); + } + if (Settings.UnloadKeyBind.Value.IsDown()) { TryInteraction(__instance, itemContext, EItemInfoButton.Unload, [EItemInfoButton.UnloadAmmo]); diff --git a/Settings.cs b/Settings.cs index e4ba108..b3b5116 100644 --- a/Settings.cs +++ b/Settings.cs @@ -99,6 +99,7 @@ internal class Settings public static ConfigEntry TopUpKeyBind { get; set; } public static ConfigEntry UseKeyBind { get; set; } public static ConfigEntry UseAllKeyBind { get; set; } + public static ConfigEntry ReloadKeyBind { get; set; } public static ConfigEntry UnloadKeyBind { get; set; } public static ConfigEntry UnpackKeyBind { get; set; } public static ConfigEntry FilterByKeyBind { get; set; } @@ -399,6 +400,15 @@ internal class Settings null, new ConfigurationManagerAttributes { }))); + configEntries.Add(ReloadKeyBind = config.Bind( + InputSection, + "Reload Weapon Shortcut", + new KeyboardShortcut(KeyCode.R), + new ConfigDescription( + "Keybind to reload a weapon. Note that this is solely in the menus, and doesn't affect the normal reload key.", + null, + new ConfigurationManagerAttributes { }))); + configEntries.Add(UnloadKeyBind = config.Bind( InputSection, "Unload Mag/Ammo Shortcut",