Add Reload keybind

This commit is contained in:
Tyfon
2024-08-23 19:19:21 -07:00
parent 4a829c112d
commit 135fb316e1
2 changed files with 15 additions and 0 deletions

View File

@@ -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]);

View File

@@ -99,6 +99,7 @@ internal class Settings
public static ConfigEntry<KeyboardShortcut> TopUpKeyBind { get; set; }
public static ConfigEntry<KeyboardShortcut> UseKeyBind { get; set; }
public static ConfigEntry<KeyboardShortcut> UseAllKeyBind { get; set; }
public static ConfigEntry<KeyboardShortcut> ReloadKeyBind { get; set; }
public static ConfigEntry<KeyboardShortcut> UnloadKeyBind { get; set; }
public static ConfigEntry<KeyboardShortcut> UnpackKeyBind { get; set; }
public static ConfigEntry<KeyboardShortcut> 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",