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 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,
|
||||
Event = MouseInputEvent.Move,
|
||||
Location = new int2(e.Location)
|
||||
});
|
||||
|
||||
if (game.controller.orderGenerator != null)
|
||||
game.controller.orderGenerator.PrepareOverlay(game,
|
||||
new int2(e.Location.X / 24, e.Location.Y / 24));
|
||||
});
|
||||
|
||||
if (game.controller.orderGenerator != null)
|
||||
game.controller.orderGenerator.PrepareOverlay(game,
|
||||
((1 / 24f) * (new float2(e.Location) + game.viewport.Location)).ToInt2());
|
||||
}
|
||||
|
||||
protected override void OnMouseUp(MouseEventArgs e)
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace OpenRa.Game
|
||||
for (int i = 0; i < width; i++)
|
||||
for (int j = 0; j < height; j++)
|
||||
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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user