Fixes hand double click from CanFocus
This commit is contained in:
@@ -7,6 +7,7 @@ using Robust.Client.Interfaces.ResourceManagement;
|
|||||||
using Robust.Client.Player;
|
using Robust.Client.Player;
|
||||||
using Robust.Client.UserInterface;
|
using Robust.Client.UserInterface;
|
||||||
using Robust.Client.UserInterface.Controls;
|
using Robust.Client.UserInterface.Controls;
|
||||||
|
using Robust.Shared.Input;
|
||||||
using Robust.Shared.Interfaces.GameObjects;
|
using Robust.Shared.Interfaces.GameObjects;
|
||||||
using Robust.Shared.IoC;
|
using Robust.Shared.IoC;
|
||||||
using Robust.Shared.Timing;
|
using Robust.Shared.Timing;
|
||||||
@@ -132,7 +133,7 @@ namespace Content.Client.UserInterface
|
|||||||
var entity = hands.GetEntity(handIndex);
|
var entity = hands.GetEntity(handIndex);
|
||||||
if (entity == null)
|
if (entity == null)
|
||||||
{
|
{
|
||||||
if (args.CanFocus && hands.ActiveIndex != handIndex)
|
if (args.Function == EngineKeyFunctions.UIClick && hands.ActiveIndex != handIndex)
|
||||||
{
|
{
|
||||||
hands.SendChangeHand(handIndex);
|
hands.SendChangeHand(handIndex);
|
||||||
}
|
}
|
||||||
@@ -142,7 +143,7 @@ namespace Content.Client.UserInterface
|
|||||||
if (_itemSlotManager.OnButtonPressed(args, entity))
|
if (_itemSlotManager.OnButtonPressed(args, entity))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (args.CanFocus)
|
if (args.Function == EngineKeyFunctions.UIClick)
|
||||||
{
|
{
|
||||||
if (hands.ActiveIndex == handIndex)
|
if (hands.ActiveIndex == handIndex)
|
||||||
{
|
{
|
||||||
@@ -158,7 +159,7 @@ namespace Content.Client.UserInterface
|
|||||||
|
|
||||||
private void _OnStoragePressed(GUIBoundKeyEventArgs args, string handIndex)
|
private void _OnStoragePressed(GUIBoundKeyEventArgs args, string handIndex)
|
||||||
{
|
{
|
||||||
if (!args.CanFocus)
|
if (args.Function != EngineKeyFunctions.UIClick)
|
||||||
return;
|
return;
|
||||||
if (!TryGetHands(out var hands))
|
if (!TryGetHands(out var hands))
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user