diff --git a/OpenRa.Game/Chat.cs b/OpenRa.Game/Chat.cs index 2074073558..30d4186df6 100644 --- a/OpenRa.Game/Chat.cs +++ b/OpenRa.Game/Chat.cs @@ -15,7 +15,7 @@ namespace OpenRa public void Toggle() { if (isChatting && typing.Length > 0) - Game.orderManager.IssueOrder(Order.Chat(typing)); + Game.IssueOrder(Order.Chat(typing)); typing = ""; isChatting ^= true; diff --git a/OpenRa.Game/Chrome.cs b/OpenRa.Game/Chrome.cs index 20350c86c6..b8ecc67d9a 100644 --- a/OpenRa.Game/Chrome.cs +++ b/OpenRa.Game/Chrome.cs @@ -277,7 +277,7 @@ namespace OpenRa AddUiButton(new int2(r.Left + 200, r.Bottom - 40), "OK", _ => { - Game.orderManager.IssueOrder(Order.Chat("/map " + currentMap.Filename)); + Game.IssueOrder(Order.Chat("/map " + currentMap.Filename)); showMapChooser = false; }); @@ -343,19 +343,19 @@ namespace OpenRa while (!PaletteAvailable(newpalette) && newpalette != (int)Game.world.LocalPlayer.Palette) newpalette = (newpalette + d) % 8; - Game.orderManager.IssueOrder( + Game.IssueOrder( Order.Chat("/pal " + newpalette)); } void CycleRace(bool left) { - Game.orderManager.IssueOrder( + Game.IssueOrder( Order.Chat("/race " + (((int)Game.world.LocalPlayer.Race - 1) ^ 1))); } void CycleReady(bool left) { - Game.orderManager.IssueOrder( + Game.IssueOrder( new Order("ToggleReady", Game.world.LocalPlayer.PlayerActor, "") { IsImmediate = true }); } @@ -580,7 +580,7 @@ namespace OpenRa { var queue = world.LocalPlayer.PlayerActor.traits.Get(); foreach( var item in queue.AllItems( groupName ) ) - Game.orderManager.IssueOrder(Order.CancelProduction(world.LocalPlayer, item.Item)); + Game.IssueOrder(Order.CancelProduction(world.LocalPlayer, item.Item)); } void ChooseAvailableTab( World world ) @@ -958,7 +958,7 @@ namespace OpenRa { var unit = Rules.Info[item]; Sound.Play(unit.Traits.Contains() ? "abldgin1.aud" : "train1.aud"); - Game.orderManager.IssueOrder(Order.StartProduction(world.LocalPlayer, item)); + Game.IssueOrder(Order.StartProduction(world.LocalPlayer, item)); } void HandleBuildPalette( World world, string item, bool isLmb ) @@ -983,7 +983,7 @@ namespace OpenRa if (producing.Paused) { - Game.orderManager.IssueOrder(Order.PauseProduction(player, item, false)); + Game.IssueOrder(Order.PauseProduction(player, item, false)); return; } } @@ -998,12 +998,12 @@ namespace OpenRa if (producing.Paused || producing.Done || producing.TotalCost == producing.RemainingCost) { Sound.Play("cancld1.aud"); - Game.orderManager.IssueOrder(Order.CancelProduction(player, item)); + Game.IssueOrder(Order.CancelProduction(player, item)); } else { Sound.Play("onhold1.aud"); - Game.orderManager.IssueOrder(Order.PauseProduction(player, item, true)); + Game.IssueOrder(Order.PauseProduction(player, item, true)); } } } diff --git a/OpenRa.Game/Game.cs b/OpenRa.Game/Game.cs index 30b3812138..4e36437169 100644 --- a/OpenRa.Game/Game.cs +++ b/OpenRa.Game/Game.cs @@ -210,6 +210,8 @@ namespace OpenRa changePending = true; } + public static void IssueOrder(Order o) { orderManager.IssueOrder(o); } /* avoid exposing the OM to mod code */ + public static void StartGame() { var available = world.Map.SpawnPoints.ToList(); diff --git a/OpenRa.Game/OpenRa.Game.csproj b/OpenRa.Game/OpenRa.Game.csproj index ee9401be26..b1a4ae7ced 100644 --- a/OpenRa.Game/OpenRa.Game.csproj +++ b/OpenRa.Game/OpenRa.Game.csproj @@ -226,8 +226,6 @@ - - diff --git a/OpenRa.Game/PackageDownloader.cs b/OpenRa.Game/PackageDownloader.cs index e408df4bfc..1397c2a360 100644 --- a/OpenRa.Game/PackageDownloader.cs +++ b/OpenRa.Game/PackageDownloader.cs @@ -67,7 +67,7 @@ namespace OpenRa Game.chat.AddLine(Color.White, "Debug", "Requesting package: {0}".F(currentPackage)); - Game.orderManager.IssueOrder( + Game.IssueOrder( new Order("RequestFile", null, currentPackage) { IsImmediate = true }); Fraction = 0f; diff --git a/OpenRa.Mods.RA/OpenRa.Mods.RA.csproj b/OpenRa.Mods.RA/OpenRa.Mods.RA.csproj index 663892f2df..ccb41cc2ff 100644 --- a/OpenRa.Mods.RA/OpenRa.Mods.RA.csproj +++ b/OpenRa.Mods.RA/OpenRa.Mods.RA.csproj @@ -66,7 +66,9 @@ + + diff --git a/OpenRa.Game/Traits/SonarPulsePower.cs b/OpenRa.Mods.RA/SonarPulsePower.cs similarity index 76% rename from OpenRa.Game/Traits/SonarPulsePower.cs rename to OpenRa.Mods.RA/SonarPulsePower.cs index e20a0209aa..9e34e11e37 100644 --- a/OpenRa.Game/Traits/SonarPulsePower.cs +++ b/OpenRa.Mods.RA/SonarPulsePower.cs @@ -1,9 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using OpenRa.Orders; +using OpenRa.Traits; -namespace OpenRa.Traits +namespace OpenRa.Mods.RA { public class SonarPulsePowerInfo : SupportPowerInfo { @@ -19,7 +16,7 @@ namespace OpenRa.Traits protected override void OnActivate() { - Game.orderManager.IssueOrder(new Order("SonarPulse", Owner.PlayerActor)); + Game.IssueOrder(new Order("SonarPulse", Owner.PlayerActor)); } public void ResolveOrder(Actor self, Order order) diff --git a/OpenRa.Game/Traits/SpyPlanePower.cs b/OpenRa.Mods.RA/SpyPlanePower.cs similarity index 90% rename from OpenRa.Game/Traits/SpyPlanePower.cs rename to OpenRa.Mods.RA/SpyPlanePower.cs index 03da94c2ef..dc7eef7a72 100644 --- a/OpenRa.Game/Traits/SpyPlanePower.cs +++ b/OpenRa.Mods.RA/SpyPlanePower.cs @@ -1,10 +1,8 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; +using System.Collections.Generic; +using OpenRa.Traits; using OpenRa.Traits.Activities; -namespace OpenRa.Traits +namespace OpenRa.Mods.RA { class SpyPlanePowerInfo : SupportPowerInfo {