diff --git a/OpenRA.Mods.Common/Console/ChatCommands.cs b/OpenRA.Mods.Common/Commands/ChatCommands.cs similarity index 97% rename from OpenRA.Mods.Common/Console/ChatCommands.cs rename to OpenRA.Mods.Common/Commands/ChatCommands.cs index fbea1f8e44..d6d5a189bd 100644 --- a/OpenRA.Mods.Common/Console/ChatCommands.cs +++ b/OpenRA.Mods.Common/Commands/ChatCommands.cs @@ -12,7 +12,7 @@ using System.Collections.Generic; using System.Linq; using OpenRA.Traits; -namespace OpenRA.Mods.Common +namespace OpenRA.Mods.Common.Commands { [Desc("Enables commands triggered by typing them into the chatbox. Attach this to the world actor.")] public class ChatCommandsInfo : TraitInfo { } diff --git a/OpenRA.Mods.Common/Console/DevCommands.cs b/OpenRA.Mods.Common/Commands/DevCommands.cs similarity index 92% rename from OpenRA.Mods.Common/Console/DevCommands.cs rename to OpenRA.Mods.Common/Commands/DevCommands.cs index def62aaed3..1bb576d5b3 100644 --- a/OpenRA.Mods.Common/Console/DevCommands.cs +++ b/OpenRA.Mods.Common/Commands/DevCommands.cs @@ -9,10 +9,11 @@ #endregion using System; +using System.Globalization; using OpenRA.Graphics; using OpenRA.Traits; -namespace OpenRA.Mods.Common +namespace OpenRA.Mods.Common.Commands { [Desc("Enables developer cheats via the chatbox. Attach this to the world actor.")] public class DevCommandsInfo : TraitInfo { } @@ -56,12 +57,12 @@ namespace OpenRA.Mods.Common { case "givecash": var order = new Order("DevGiveCash", world.LocalPlayer.PlayerActor, false); - var cash = 0; + int cash; if (int.TryParse(arg, out cash)) order.ExtraData = (uint)cash; - Game.Debug("Giving {0} credits to player {1}.", (cash == 0 ? "cheat default" : cash.ToString()), world.LocalPlayer.PlayerName); + Game.Debug("Giving {0} credits to player {1}.", cash == 0 ? "cheat default" : cash.ToString(CultureInfo.InvariantCulture), world.LocalPlayer.PlayerName); world.IssueOrder(order); break; diff --git a/OpenRA.Mods.Common/Console/HelpCommand.cs b/OpenRA.Mods.Common/Commands/HelpCommand.cs similarity index 92% rename from OpenRA.Mods.Common/Console/HelpCommand.cs rename to OpenRA.Mods.Common/Commands/HelpCommand.cs index 32384e5c08..7697ad1e16 100644 --- a/OpenRA.Mods.Common/Console/HelpCommand.cs +++ b/OpenRA.Mods.Common/Commands/HelpCommand.cs @@ -12,16 +12,17 @@ using System.Collections.Generic; using OpenRA.Graphics; using OpenRA.Traits; -namespace OpenRA.Mods.Common +namespace OpenRA.Mods.Common.Commands { [Desc("Shows a list of available commands in the chatbox. Attach this to the world actor.")] public class HelpCommandInfo : TraitInfo { } public class HelpCommand : IChatCommand, IWorldLoaded { + readonly Dictionary helpDescriptions; + World world; ChatCommands console; - Dictionary helpDescriptions; public HelpCommand() { @@ -43,7 +44,7 @@ namespace OpenRA.Mods.Common foreach (var key in console.Commands.Keys) { - var description = ""; + string description; if (!helpDescriptions.TryGetValue(key, out description)) description = "no description available."; diff --git a/OpenRA.Mods.Common/Console/PlayerCommands.cs b/OpenRA.Mods.Common/Commands/PlayerCommands.cs similarity index 97% rename from OpenRA.Mods.Common/Console/PlayerCommands.cs rename to OpenRA.Mods.Common/Commands/PlayerCommands.cs index 3051f2b73f..b19c5d8fc8 100644 --- a/OpenRA.Mods.Common/Console/PlayerCommands.cs +++ b/OpenRA.Mods.Common/Commands/PlayerCommands.cs @@ -11,7 +11,7 @@ using OpenRA.Graphics; using OpenRA.Traits; -namespace OpenRA.Mods.Common +namespace OpenRA.Mods.Common.Commands { [Desc("Allows the player to pause or surrender the game via the chatbox. Attach this to the world actor.")] public class PlayerCommandsInfo : TraitInfo { } diff --git a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj index 68c487a53d..ec24849a25 100644 --- a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj +++ b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj @@ -55,10 +55,10 @@ - - - - + + + + diff --git a/OpenRA.Mods.RA/Widgets/Logic/IngameChatLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/IngameChatLogic.cs index c7adba0af3..1301a81c49 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/IngameChatLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/IngameChatLogic.cs @@ -12,6 +12,7 @@ using System.Collections.Generic; using System.Drawing; using System.Linq; using OpenRA.Mods.Common; +using OpenRA.Mods.Common.Commands; using OpenRA.Network; using OpenRA.Widgets;