Keybind to stop pulling. (#2094)

* keybind to stop pulling.

* smug
This commit is contained in:
derek
2020-09-16 14:58:50 -07:00
committed by GitHub
parent 84230a47ad
commit 158f765895
6 changed files with 20 additions and 2 deletions

View File

@@ -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);

View File

@@ -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");

View File

@@ -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" });

View File

@@ -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<HandsSystem>();
}
@@ -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();
}
}
}

View File

@@ -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";

View File

@@ -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