git-svn-id: svn://svn.ijw.co.nz/svn/OpenRa@1332 993157c7-ee19-0410-b2c4-bb4e9862e678

This commit is contained in:
(no author)
2007-07-24 04:53:11 +00:00
parent ac87f06ef1
commit 983f56e840
4 changed files with 58 additions and 5 deletions

View File

@@ -75,7 +75,14 @@ namespace OpenRa.Game
if (e.Button == MouseButtons.Left)
{
float2 xy = ( 1 / 24.0f ) * ( new float2( e.Location ) + game.viewport.Location );
float2 point = new float2(e.Location) + game.viewport.Location;
RectangleF rect = new RectangleF(sidebar.Location.ToPointF(), new SizeF(sidebar.Width, game.viewport.Height));
if (rect.Contains(point.ToPointF()))
{
sidebar.Build(sidebar.FindSpriteAtPoint(point));
return;
}
float2 xy = (1 / 24.0f) * point;
IOrder order = game.world.myUnit.Order( new int2( (int)xy.X, (int)xy.Y ) );
game.Issue( order );
}