Add Alt-click functionality (#4497)
* Fix ItemSlot Bug * Add Alt-use Key * Fix TransferAmount window bug * Alt-click functionality * Added AltInteract verbs * Add new verbs * verb icons * Changed Comments * Change Comments * Fix disposal verbs * Changed Get...() to Get...OrNull() * Changed alt-interact combat behaviour * Update verb icons * Inventory interact event * Add Alt+E secondary binding * Add alt-z keybinding * Rename AltUse -> AltActivateItemInWorld
This commit is contained in:
@@ -50,6 +50,7 @@ namespace Content.Server.Hands
|
||||
|
||||
CommandBinds.Builder
|
||||
.Bind(ContentKeyFunctions.ActivateItemInHand, InputCmdHandler.FromDelegate(HandleActivateItem))
|
||||
.Bind(ContentKeyFunctions.AltActivateItemInHand, InputCmdHandler.FromDelegate(HandleAltActivateItem))
|
||||
.Bind(ContentKeyFunctions.ThrowItemInHand, new PointerInputCmdHandler(HandleThrowItem))
|
||||
.Bind(ContentKeyFunctions.SmartEquipBackpack, InputCmdHandler.FromDelegate(HandleSmartEquipBackpack))
|
||||
.Bind(ContentKeyFunctions.SmartEquipBelt, InputCmdHandler.FromDelegate(HandleSmartEquipBelt))
|
||||
@@ -220,6 +221,14 @@ namespace Content.Server.Hands
|
||||
hands.UseActiveHeldEntity();
|
||||
}
|
||||
|
||||
private void HandleAltActivateItem(ICommonSession? session)
|
||||
{
|
||||
if (!TryGetHandsComp(session, out var hands))
|
||||
return;
|
||||
|
||||
hands.UseActiveHeldEntity(altInteract: true);
|
||||
}
|
||||
|
||||
private bool HandleThrowItem(ICommonSession? session, EntityCoordinates coords, EntityUid uid)
|
||||
{
|
||||
if (session is not IPlayerSession playerSession)
|
||||
|
||||
Reference in New Issue
Block a user