]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Run actions on press (#31191)
authormetalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Sun, 25 Aug 2024 12:36:22 +0000 (22:36 +1000)
committerGitHub <noreply@github.com>
Sun, 25 Aug 2024 12:36:22 +0000 (22:36 +1000)
I know UI generallys want to do stuff on key-up not key-down. With that being said the delay on release for these is noticeable.
e.g.
ActivateInWorld / UseInHand / any in-world interactions are on-press. This is especially noticeable if you have the same event on action + verb.

Content.Client/UserInterface/Systems/Actions/ActionUIController.cs

index 1c76b30075516ea6f34c3edf956a0c02479b1cc2..d67c5cbcd63e5c310ec356e58738fae753bd5341 100644 (file)
@@ -121,7 +121,7 @@ public sealed class ActionUIController : UIController, IOnStateChanged<GameplayS
             var boundKey = hotbarKeys[i];
             builder = builder.Bind(boundKey, new PointerInputCmdHandler((in PointerInputCmdArgs args) =>
             {
-                if (args.State != BoundKeyState.Up)
+                if (args.State != BoundKeyState.Down)
                     return false;
 
                 TriggerAction(boundId);