(53c44ee8a) Disallow shooting and attacking when hovering over a GUIComponent + added guimessagebox command

This commit is contained in:
Joonas Rikkonen
2019-06-09 17:36:48 +03:00
parent aefa46eaa5
commit 85d19d7f3c
3 changed files with 34 additions and 1 deletions
@@ -157,6 +157,33 @@ namespace Barotrauma
get { return GameMain.Config.KeyBind(inputType); }
}
private static bool AllowOnGUI(InputType input)
{
switch (input)
{
case InputType.Attack:
case InputType.Shoot:
return GUI.MouseOn == null;
default:
return true;
}
}
public KeyOrMouse State
{
get { return binding; }
}
public void SetState()
{
hit = binding.IsHit() && AllowOnGUI(inputType);
if (hit) hitQueue = true;
held = binding.IsDown() && AllowOnGUI(inputType);
if (held) heldQueue = true;
}
#endif
public KeyOrMouse State
{
get { return binding; }