Modified code to compile on Linux

This commit is contained in:
joonas
2015-08-19 23:34:20 +03:00
parent e19ac600ff
commit bb295a7444
18 changed files with 82 additions and 41 deletions

View File

@@ -274,7 +274,7 @@ namespace Subsurface
bool clicked = false;
if (rect.Contains(PlayerInput.GetMouseState.Position))
if (rect.Contains(PlayerInput.MousePosition))
{
clicked = (PlayerInput.GetMouseState.LeftButton == ButtonState.Pressed);

View File

@@ -60,7 +60,7 @@ namespace Subsurface
public override void Draw(SpriteBatch spriteBatch)
{
if (rect.Contains(PlayerInput.GetMouseState.Position) && Enabled && (MouseOn == null || MouseOn == this || IsParentOf(MouseOn)))
if (rect.Contains(PlayerInput.MousePosition) && Enabled && (MouseOn == null || MouseOn == this || IsParentOf(MouseOn)))
{
state = ComponentState.Hover;
if (PlayerInput.GetMouseState.LeftButton == ButtonState.Pressed)

View File

@@ -284,7 +284,7 @@ namespace Subsurface
if (CheckSelected() != selected.UserData) selected = null;
}
}
else if (enabled && (MouseOn == this || (MouseOn != null && this.IsParentOf(MouseOn))) && child.Rect.Contains(PlayerInput.GetMouseState.Position))
else if (enabled && (MouseOn == this || (MouseOn != null && this.IsParentOf(MouseOn))) && child.Rect.Contains(PlayerInput.MousePosition))
{
child.State = ComponentState.Hover;
if (PlayerInput.LeftButtonClicked())

View File

@@ -155,14 +155,14 @@ namespace Subsurface
int moveAmount;
if (isHorizontal)
{
moveAmount = PlayerInput.GetMouseState.Position.X - PlayerInput.GetOldMouseState.Position.X;
moveAmount = (int)PlayerInput.MouseSpeed.X;
newX = Math.Min(Math.Max(newX + moveAmount, 0), frame.Rect.Width - bar.Rect.Width);
barScroll = (float)newX / ((float)frame.Rect.Width - (float)bar.Rect.Width);
}
else
{
moveAmount = PlayerInput.GetMouseState.Position.Y - PlayerInput.GetOldMouseState.Position.Y;
moveAmount = (int)PlayerInput.MouseSpeed.Y;
newY = Math.Min(Math.Max(newY+moveAmount, 0), frame.Rect.Height - bar.Rect.Height);
barScroll = (float)newY / ((float)frame.Rect.Height - (float)bar.Rect.Height);

View File

@@ -158,7 +158,7 @@ namespace Subsurface
caretTimer += deltaTime;
caretVisible = ((caretTimer*1000.0f) % 1000) < 500;
if (rect.Contains(PlayerInput.GetMouseState.Position))
if (rect.Contains(PlayerInput.MousePosition))
{
state = ComponentState.Hover;
if (PlayerInput.LeftButtonClicked()) Select();

View File

@@ -56,7 +56,7 @@ namespace Subsurface
if (!Enabled) return;
if (box.Rect.Contains(PlayerInput.GetMouseState.Position))
if (box.Rect.Contains(PlayerInput.MousePosition))
{