(276e03242) Reset Use and Select inputs when releasing the Shoot input to prevent accidentally selecting/using items

This commit is contained in:
Joonas Rikkonen
2019-04-08 19:16:09 +03:00
parent 5d5979c58b
commit d482e6554d
3 changed files with 49 additions and 0 deletions
@@ -85,6 +85,25 @@ namespace Barotrauma
return false;
}
public override bool Equals(object obj)
{
if (obj is KeyOrMouse keyOrMouse )
{
if (MouseButton.HasValue)
{
return keyOrMouse.MouseButton.HasValue && keyOrMouse.MouseButton.Value == MouseButton.Value;
}
else
{
return keyOrMouse.Key.Equals(Key);
}
}
else
{
return false;
}
}
public override string ToString()
{
switch (MouseButton)
@@ -134,6 +153,16 @@ namespace Barotrauma
get { return binding; }
}
public void SetState()
{
hit = binding.IsHit();
if (hit) hitQueue = true;
held = binding.IsDown();
if (held) heldQueue = true;
}
#endif
public void SetState()
{
hit = binding.IsHit();