diff --git a/Patches/ContextMenuShortcutPatch.cs b/Patches/ContextMenuShortcutPatch.cs index 4848d92..6694251 100644 --- a/Patches/ContextMenuShortcutPatch.cs +++ b/Patches/ContextMenuShortcutPatch.cs @@ -66,6 +66,12 @@ namespace UIFixes } } + if (Settings.UnloadAmmoKeyBind.Value.IsDown()) + { + __instance.GetItemContextInteractions(itemContext, null).ExecuteInteraction(EItemInfoButton.UnloadAmmo); + return; + } + if (Settings.FilterByKeyBind.Value.IsDown()) { __instance.GetItemContextInteractions(itemContext, null).ExecuteInteraction(EItemInfoButton.FilterSearch); diff --git a/Settings.cs b/Settings.cs index 2d80c2a..b172bc0 100644 --- a/Settings.cs +++ b/Settings.cs @@ -41,12 +41,12 @@ namespace UIFixes public static ConfigEntry UseHomeEnd { get; set; } public static ConfigEntry RebindPageUpDown { get; set; } public static ConfigEntry MouseScrollMulti { get; set; } - public static ConfigEntry InspectKeyBind { get; set; } public static ConfigEntry OpenKeyBind { get; set; } public static ConfigEntry TopUpKeyBind { get; set; } public static ConfigEntry UseKeyBind { get; set; } public static ConfigEntry UseAllKeyBind { get; set; } + public static ConfigEntry UnloadAmmoKeyBind { get; set; } public static ConfigEntry FilterByKeyBind { get; set; } public static ConfigEntry LinkedSearchKeyBind { get; set; } public static ConfigEntry UseRaidMouseScrollMulti { get; set; } // Advanced @@ -203,7 +203,7 @@ namespace UIFixes "Use Item Shortcut", new KeyboardShortcut(KeyCode.None), new ConfigDescription( - "Keybind to use an item, such a consumable.", + "Keybind to use an item, such a consumable", null, new ConfigurationManagerAttributes { }))); @@ -216,6 +216,15 @@ namespace UIFixes null, new ConfigurationManagerAttributes { }))); + configEntries.Add(UnloadAmmoKeyBind = config.Bind( + InputSection, + "Unload Ammo Shortcut", + new KeyboardShortcut(KeyCode.None), + new ConfigDescription( + "Keybind to unload the ammo in a magazine", + null, + new ConfigurationManagerAttributes { }))); + configEntries.Add(FilterByKeyBind = config.Bind( InputSection, "Filter by Item Shortcut",