From 3342f8383dc16d5e15d5b8de3f8f05d1c691ac6e Mon Sep 17 00:00:00 2001 From: SimpleStation14 Date: Mon, 22 Apr 2024 05:50:59 -0400 Subject: [PATCH] Cherry-picked commit e69723153dc571e1461c99ac5c7d82a1992e011d from space-wizards/space-station-14/master --- .../Systems/Actions/Controls/ActionButtonContainer.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Content.Client/UserInterface/Systems/Actions/Controls/ActionButtonContainer.cs b/Content.Client/UserInterface/Systems/Actions/Controls/ActionButtonContainer.cs index a2aa972625d..c5f8adbdea3 100644 --- a/Content.Client/UserInterface/Systems/Actions/Controls/ActionButtonContainer.cs +++ b/Content.Client/UserInterface/Systems/Actions/Controls/ActionButtonContainer.cs @@ -42,11 +42,12 @@ ActionButton MakeButton(int index) { var button = new ActionButton(_entity); - if (keys.TryGetValue(index, out var boundKey)) - { - button.KeyBind = boundKey; + if (!keys.TryGetValue(index, out var boundKey)) + return button; - var binding = _input.GetKeyBinding(boundKey); + button.KeyBind = boundKey; + if (_input.TryGetKeyBinding(boundKey, out var binding)) + { button.Label.Text = binding.GetKeyString(); }