From 9eb03e38391a918e01bd1f5af52143c80f8f9c3c Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Tue, 6 Oct 2009 22:21:15 +1300 Subject: [PATCH] RMB to cancel orders --- OpenRa.Game/Controller.cs | 3 +++ OpenRa.Game/Game.cs | 2 +- OpenRa.Game/Graphics/Viewport.cs | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/OpenRa.Game/Controller.cs b/OpenRa.Game/Controller.cs index 07f1f26a3d..d4c78be2af 100644 --- a/OpenRa.Game/Controller.cs +++ b/OpenRa.Game/Controller.cs @@ -27,6 +27,9 @@ namespace OpenRa.Game orderGenerator.Order(game, new int2((int)xy.X, (int)xy.Y)).Apply(game); // todo: route all orders through netcode } + + if (mi.Button == MouseButtons.Right && mi.Event == MouseInputEvent.Down) + orderGenerator = null; } } } diff --git a/OpenRa.Game/Game.cs b/OpenRa.Game/Game.cs index 9e0d7c2a7b..70c40a5611 100644 --- a/OpenRa.Game/Game.cs +++ b/OpenRa.Game/Game.cs @@ -67,7 +67,7 @@ namespace OpenRa.Game var stuffFromOtherPlayers = network.Tick(); // todo: actually use the orders! world.Update(); - viewport.DrawRegions(this); + viewport.DrawRegions(); } } } diff --git a/OpenRa.Game/Graphics/Viewport.cs b/OpenRa.Game/Graphics/Viewport.cs index 30f601967f..abf58994f0 100644 --- a/OpenRa.Game/Graphics/Viewport.cs +++ b/OpenRa.Game/Graphics/Viewport.cs @@ -33,7 +33,7 @@ namespace OpenRa.Game.Graphics public void AddRegion(Region r) { regions.Add(r); } - public void DrawRegions(Game game) + public void DrawRegions() { float2 r1 = new float2(2, -2) / Size; float2 r2 = new float2(-1, 1);