fixed broken UiOverlay
This commit is contained in:
@@ -82,5 +82,6 @@ namespace OpenRa
|
|||||||
public float2 Round() { return new float2((float)Math.Round(X), (float)Math.Round(Y)); }
|
public float2 Round() { return new float2((float)Math.Round(X), (float)Math.Round(Y)); }
|
||||||
|
|
||||||
public override string ToString() { return string.Format("({0},{1})", X, Y); }
|
public override string ToString() { return string.Format("({0},{1})", X, Y); }
|
||||||
|
public int2 ToInt2() { return new int2((int)X, (int)Y); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,11 +95,11 @@ namespace OpenRa.Game
|
|||||||
Button = e.Button,
|
Button = e.Button,
|
||||||
Event = MouseInputEvent.Move,
|
Event = MouseInputEvent.Move,
|
||||||
Location = new int2(e.Location)
|
Location = new int2(e.Location)
|
||||||
});
|
});
|
||||||
|
|
||||||
if (game.controller.orderGenerator != null)
|
if (game.controller.orderGenerator != null)
|
||||||
game.controller.orderGenerator.PrepareOverlay(game,
|
game.controller.orderGenerator.PrepareOverlay(game,
|
||||||
new int2(e.Location.X / 24, e.Location.Y / 24));
|
((1 / 24f) * (new float2(e.Location) + game.viewport.Location)).ToInt2());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnMouseUp(MouseEventArgs e)
|
protected override void OnMouseUp(MouseEventArgs e)
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ namespace OpenRa.Game
|
|||||||
for (int i = 0; i < width; i++)
|
for (int i = 0; i < width; i++)
|
||||||
for (int j = 0; j < height; j++)
|
for (int j = 0; j < height; j++)
|
||||||
spriteRenderer.DrawSprite(passableAt(position.X + i, position.Y + j) ? buildOk : buildBlocked,
|
spriteRenderer.DrawSprite(passableAt(position.X + i, position.Y + j) ? buildOk : buildBlocked,
|
||||||
24 * (position + new int2(i, j)) + game.viewport.Location, 0);
|
24 * (position + new int2(i, j)), 0);
|
||||||
|
|
||||||
spriteRenderer.Flush();
|
spriteRenderer.Flush();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user