Selecting stairs based on WorldRect in editor, disable input if window not active, disable traveling if no locations are selected

This commit is contained in:
Regalis
2016-01-27 22:27:51 +02:00
parent 8cc12b6988
commit 7637bc441f
21 changed files with 95 additions and 77 deletions

View File

@@ -300,7 +300,7 @@ namespace Barotrauma
if (rect.Contains(PlayerInput.MousePosition))
{
clicked = (PlayerInput.GetMouseState.LeftButton == ButtonState.Pressed);
clicked = PlayerInput.LeftButtonDown();
color = clicked ? new Color(100, 100, 100) : new Color(250, 250, 250);

View File

@@ -152,7 +152,7 @@ namespace Barotrauma
if (rect.Contains(PlayerInput.MousePosition) && CanBeSelected && Enabled && (MouseOn == null || MouseOn == this || IsParentOf(MouseOn)))
{
state = ComponentState.Hover;
if (PlayerInput.GetMouseState.LeftButton == ButtonState.Pressed)
if (PlayerInput.LeftButtonDown())
{
if (OnPressed != null)
{

View File

@@ -152,7 +152,7 @@ namespace Barotrauma
if (style != null) style.Apply(textBlock, this);
textBlock.Padding = new Vector4(3.0f, 0.0f, 3.0f, 0.0f);
previousMouse = PlayerInput.GetMouseState;
//previousMouse = PlayerInput.GetMouseState;
CaretEnabled = true;
//SetTextPos();
@@ -171,7 +171,7 @@ namespace Barotrauma
if (keyboardDispatcher.Subscriber == this) keyboardDispatcher.Subscriber = null;
}
MouseState previousMouse;
//MouseState previousMouse;
public override void Update(float deltaTime)
{
if (!Visible) return;

View File

@@ -61,7 +61,7 @@ namespace Barotrauma
box.State = ComponentState.Hover;
if (PlayerInput.GetMouseState.LeftButton == ButtonState.Pressed)
if (PlayerInput.LeftButtonDown())
{
box.State = ComponentState.Selected;
}