From eb7a08980e85c492789d899b2e18520002233f27 Mon Sep 17 00:00:00 2001
From: SimpleStation14 <130339894+SimpleStation14@users.noreply.github.com>
Date: Mon, 20 May 2024 15:56:20 -0700
Subject: [PATCH] Mirror: Store keybind priority (#365)
## Mirror of PR #26356: [Store keybind
priority](https://github.com/space-wizards/space-station-14/pull/26356)
from
[space-wizards](https://github.com/space-wizards)/[space-station-14](https://github.com/space-wizards/space-station-14)
###### `f7a1ffd0aab25d70ac185753d596469fc1e87480`
PR opened by
wrexbe at
2024-03-23 02:49:07 UTC
---
PR changed 2 files with 2 additions and 1 deletions.
The PR had the following labels:
- Changes: UI
---
Original Body
> Changed it so the priority isn't lost when you set a binding in the
UI.
> Also added a priority to MoveStoredItem so it doesn't conflict with
Use.
> Fixes https://github.com/space-wizards/space-station-14/issues/26142
> Does not fix old keybinds files, so they will need to reset it, and
rebind it.
>
> A better solution might be to change it so the keybinds are always in
the order they appear in the default keybinds folder, to prevent the
ordering from changing unpredictably based on what the user overrides.
Co-authored-by: SimpleStation14
---
Content.Client/Options/UI/Tabs/KeyRebindTab.xaml.cs | 2 +-
Resources/keybinds.yml | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/Content.Client/Options/UI/Tabs/KeyRebindTab.xaml.cs b/Content.Client/Options/UI/Tabs/KeyRebindTab.xaml.cs
index ce5cf421aef..f0537079b97 100644
--- a/Content.Client/Options/UI/Tabs/KeyRebindTab.xaml.cs
+++ b/Content.Client/Options/UI/Tabs/KeyRebindTab.xaml.cs
@@ -403,7 +403,7 @@ private void InputManagerOnFirstChanceOnKeyEvent(KeyEventArgs keyEvent, KeyEvent
Mod1 = mods[0],
Mod2 = mods[1],
Mod3 = mods[2],
- Priority = 0,
+ Priority = _currentlyRebinding.Binding?.Priority ?? 0,
Type = bindType,
CanFocus = key == Keyboard.Key.MouseLeft
|| key == Keyboard.Key.MouseRight
diff --git a/Resources/keybinds.yml b/Resources/keybinds.yml
index b8cfc40c1c4..346156159a7 100644
--- a/Resources/keybinds.yml
+++ b/Resources/keybinds.yml
@@ -167,6 +167,7 @@ binds:
type: State
key: MouseLeft
canFocus: true
+ priority: 10
- function: RotateStoredItem
type: State
key: MouseRight