(53c44ee8a) Disallow shooting and attacking when hovering over a GUIComponent + added guimessagebox command
This commit is contained in:
@@ -1172,6 +1172,12 @@ namespace Barotrauma
|
|||||||
if (args.Length == 0) return;
|
if (args.Length == 0) return;
|
||||||
LocalizationCSVtoXML.Convert(args[0]);
|
LocalizationCSVtoXML.Convert(args[0]);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
commands.Add(new Command("guimessagebox", "guimessagebox [msg] -> Creates a message box with the parameter as a message.", (string[] args) =>
|
||||||
|
{
|
||||||
|
if (args.Length == 0) return;
|
||||||
|
var dialog = new GUIMessageBox("Message box", args[0]);
|
||||||
|
}));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
commands.Add(new Command("cleanbuild", "", (string[] args) =>
|
commands.Add(new Command("cleanbuild", "", (string[] args) =>
|
||||||
|
|||||||
@@ -179,7 +179,7 @@ namespace Barotrauma
|
|||||||
public bool Close(GUIButton button, object obj)
|
public bool Close(GUIButton button, object obj)
|
||||||
{
|
{
|
||||||
Close();
|
Close();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -157,6 +157,33 @@ namespace Barotrauma
|
|||||||
get { return GameMain.Config.KeyBind(inputType); }
|
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
|
public KeyOrMouse State
|
||||||
{
|
{
|
||||||
get { return binding; }
|
get { return binding; }
|
||||||
|
|||||||
Reference in New Issue
Block a user