diff --git a/Content.Client/Input/ContentContexts.cs b/Content.Client/Input/ContentContexts.cs index 26834dfd16..a01d9dc307 100644 --- a/Content.Client/Input/ContentContexts.cs +++ b/Content.Client/Input/ContentContexts.cs @@ -30,6 +30,7 @@ namespace Content.Client.Input human.AddFunction(ContentKeyFunctions.ThrowItemInHand); human.AddFunction(ContentKeyFunctions.TryPullObject); human.AddFunction(ContentKeyFunctions.MovePulledObject); + human.AddFunction(ContentKeyFunctions.ReleasePulledObject); human.AddFunction(ContentKeyFunctions.OpenContextMenu); human.AddFunction(ContentKeyFunctions.OpenCraftingMenu); human.AddFunction(ContentKeyFunctions.OpenInventoryMenu); diff --git a/Content.Client/UserInterface/OptionsMenu.KeyRebind.cs b/Content.Client/UserInterface/OptionsMenu.KeyRebind.cs index c158a48895..bf88e234be 100644 --- a/Content.Client/UserInterface/OptionsMenu.KeyRebind.cs +++ b/Content.Client/UserInterface/OptionsMenu.KeyRebind.cs @@ -147,6 +147,7 @@ namespace Content.Client.UserInterface AddButton(ContentKeyFunctions.ThrowItemInHand, "Throw item"); AddButton(ContentKeyFunctions.TryPullObject, "Pull object"); AddButton(ContentKeyFunctions.MovePulledObject, "Move pulled object"); + AddButton(ContentKeyFunctions.ReleasePulledObject, "Release pulled object"); AddButton(ContentKeyFunctions.Point, "Point at location"); diff --git a/Content.Client/UserInterface/TutorialWindow.cs b/Content.Client/UserInterface/TutorialWindow.cs index 606f3ff2b3..741a8798b8 100644 --- a/Content.Client/UserInterface/TutorialWindow.cs +++ b/Content.Client/UserInterface/TutorialWindow.cs @@ -83,6 +83,7 @@ Use targeted entity: [color=#a4885c]{11}[/color] Throw held item: [color=#a4885c]{12}[/color] Pull entity: [color=#a4885c]{30}[/color] Move pulled entity: [color=#a4885c]{29}[/color] +Stop pulling: [color=#a4885c]{32}[/color] Examine entity: [color=#a4885c]{13}[/color] Point somewhere: [color=#a4885c]{28}[/color] Open entity context menu: [color=#a4885c]{14}[/color] @@ -122,7 +123,8 @@ Toggle admin menu [color=#a4885c]{31}[/color]", Key(Point), Key(TryPullObject), Key(MovePulledObject), - Key(OpenAdminMenu))); + Key(OpenAdminMenu), + Key(ReleasePulledObject))); //Gameplay VBox.AddChild(new Label { FontOverride = headerFont, Text = "\nGameplay" }); diff --git a/Content.Server/GameObjects/EntitySystems/HandsSystem.cs b/Content.Server/GameObjects/EntitySystems/HandsSystem.cs index 8eb88fd9f9..b10fb320f2 100644 --- a/Content.Server/GameObjects/EntitySystems/HandsSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/HandsSystem.cs @@ -49,6 +49,7 @@ namespace Content.Server.GameObjects.EntitySystems .Bind(ContentKeyFunctions.SmartEquipBackpack, InputCmdHandler.FromDelegate(HandleSmartEquipBackpack)) .Bind(ContentKeyFunctions.SmartEquipBelt, InputCmdHandler.FromDelegate(HandleSmartEquipBelt)) .Bind(ContentKeyFunctions.MovePulledObject, new PointerInputCmdHandler(HandleMovePulledObject)) + .Bind(ContentKeyFunctions.ReleasePulledObject, InputCmdHandler.FromDelegate(HandleReleasePulledObject)) .Register(); } @@ -244,5 +245,14 @@ namespace Content.Server.GameObjects.EntitySystems return false; } + + private static void HandleReleasePulledObject(ICommonSession session) + { + if (!TryGetAttachedComponent(session as IPlayerSession, out HandsComponent handsComp)) + return; + + handsComp.StopPull(); + } + } } diff --git a/Content.Shared/Input/ContentKeyFunctions.cs b/Content.Shared/Input/ContentKeyFunctions.cs index e0a1bc62c6..cb4e5b233a 100644 --- a/Content.Shared/Input/ContentKeyFunctions.cs +++ b/Content.Shared/Input/ContentKeyFunctions.cs @@ -24,6 +24,7 @@ namespace Content.Shared.Input public static readonly BoundKeyFunction ThrowItemInHand = "ThrowItemInHand"; public static readonly BoundKeyFunction TryPullObject = "TryPullObject"; public static readonly BoundKeyFunction MovePulledObject = "MovePulledObject"; + public static readonly BoundKeyFunction ReleasePulledObject = "ReleasePulledObject"; public static readonly BoundKeyFunction ToggleCombatMode = "ToggleCombatMode"; public static readonly BoundKeyFunction MouseMiddle = "MouseMiddle"; public static readonly BoundKeyFunction OpenEntitySpawnWindow = "OpenEntitySpawnWindow"; diff --git a/Resources/keybinds.yml b/Resources/keybinds.yml index 8e7d10491c..a7cd07bfaa 100644 --- a/Resources/keybinds.yml +++ b/Resources/keybinds.yml @@ -1,4 +1,4 @@ -version: 1 # Not used right now, whatever. +version: 1 # Not used right now, whatever. binds: - function: UIClick type: State @@ -117,6 +117,9 @@ binds: type: State key: MouseRight mod1: Control +- function: ReleasePulledObject + type: State + key: H - function: OpenContextMenu type: State key: MouseRight