From f03617bbe502a54abb6861f06b2231fa3d1c472d Mon Sep 17 00:00:00 2001 From: reaperrr Date: Fri, 3 Oct 2014 00:11:11 +0200 Subject: [PATCH] Move Console commands to Mods.Common --- OpenRA.Mods.Common/CommonTraitsInterfaces.cs | 17 +++++++++++++++++ .../Console/ChatCommands.cs | 2 +- .../Console/DevCommands.cs | 2 +- .../Console/HelpCommand.cs | 2 +- .../Console/PlayerCommands.cs | 2 +- OpenRA.Mods.Common/OpenRA.Mods.Common.csproj | 5 +++++ OpenRA.Mods.RA/OpenRA.Mods.RA.csproj | 4 ---- OpenRA.Mods.RA/TraitsInterfaces.cs | 1 - OpenRA.Mods.RA/Widgets/Logic/IngameChatLogic.cs | 1 + 9 files changed, 27 insertions(+), 9 deletions(-) create mode 100644 OpenRA.Mods.Common/CommonTraitsInterfaces.cs rename {OpenRA.Mods.RA => OpenRA.Mods.Common}/Console/ChatCommands.cs (98%) rename {OpenRA.Mods.RA => OpenRA.Mods.Common}/Console/DevCommands.cs (99%) rename {OpenRA.Mods.RA => OpenRA.Mods.Common}/Console/HelpCommand.cs (98%) rename {OpenRA.Mods.RA => OpenRA.Mods.Common}/Console/PlayerCommands.cs (98%) diff --git a/OpenRA.Mods.Common/CommonTraitsInterfaces.cs b/OpenRA.Mods.Common/CommonTraitsInterfaces.cs new file mode 100644 index 0000000000..59d5b7c6e8 --- /dev/null +++ b/OpenRA.Mods.Common/CommonTraitsInterfaces.cs @@ -0,0 +1,17 @@ +#region Copyright & License Information +/* + * Copyright 2007-2014 The OpenRA Developers (see AUTHORS) + * This file is part of OpenRA, which is free software. It is made + * available to you under the terms of the GNU General Public License + * as published by the Free Software Foundation. For more information, + * see COPYING. + */ +#endregion + +using System.Collections.Generic; +using OpenRA.Traits; + +namespace OpenRA.Mods.Common +{ + public interface INotifyChat { bool OnChat(string from, string message); } +} diff --git a/OpenRA.Mods.RA/Console/ChatCommands.cs b/OpenRA.Mods.Common/Console/ChatCommands.cs similarity index 98% rename from OpenRA.Mods.RA/Console/ChatCommands.cs rename to OpenRA.Mods.Common/Console/ChatCommands.cs index c3b65a1958..fbea1f8e44 100644 --- a/OpenRA.Mods.RA/Console/ChatCommands.cs +++ b/OpenRA.Mods.Common/Console/ChatCommands.cs @@ -12,7 +12,7 @@ using System.Collections.Generic; using System.Linq; using OpenRA.Traits; -namespace OpenRA.Mods.RA +namespace OpenRA.Mods.Common { [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.RA/Console/DevCommands.cs b/OpenRA.Mods.Common/Console/DevCommands.cs similarity index 99% rename from OpenRA.Mods.RA/Console/DevCommands.cs rename to OpenRA.Mods.Common/Console/DevCommands.cs index 7d0cf5ec52..def62aaed3 100644 --- a/OpenRA.Mods.RA/Console/DevCommands.cs +++ b/OpenRA.Mods.Common/Console/DevCommands.cs @@ -12,7 +12,7 @@ using System; using OpenRA.Graphics; using OpenRA.Traits; -namespace OpenRA.Mods.RA +namespace OpenRA.Mods.Common { [Desc("Enables developer cheats via the chatbox. Attach this to the world actor.")] public class DevCommandsInfo : TraitInfo { } diff --git a/OpenRA.Mods.RA/Console/HelpCommand.cs b/OpenRA.Mods.Common/Console/HelpCommand.cs similarity index 98% rename from OpenRA.Mods.RA/Console/HelpCommand.cs rename to OpenRA.Mods.Common/Console/HelpCommand.cs index cd38f68b9f..32384e5c08 100644 --- a/OpenRA.Mods.RA/Console/HelpCommand.cs +++ b/OpenRA.Mods.Common/Console/HelpCommand.cs @@ -12,7 +12,7 @@ using System.Collections.Generic; using OpenRA.Graphics; using OpenRA.Traits; -namespace OpenRA.Mods.RA +namespace OpenRA.Mods.Common { [Desc("Shows a list of available commands in the chatbox. Attach this to the world actor.")] public class HelpCommandInfo : TraitInfo { } diff --git a/OpenRA.Mods.RA/Console/PlayerCommands.cs b/OpenRA.Mods.Common/Console/PlayerCommands.cs similarity index 98% rename from OpenRA.Mods.RA/Console/PlayerCommands.cs rename to OpenRA.Mods.Common/Console/PlayerCommands.cs index 43ec351e73..3051f2b73f 100644 --- a/OpenRA.Mods.RA/Console/PlayerCommands.cs +++ b/OpenRA.Mods.Common/Console/PlayerCommands.cs @@ -11,7 +11,7 @@ using OpenRA.Graphics; using OpenRA.Traits; -namespace OpenRA.Mods.RA +namespace OpenRA.Mods.Common { [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 41165e5a8d..97a5eca20c 100644 --- a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj +++ b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj @@ -41,8 +41,13 @@ + + + + + diff --git a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj index 2a069ce852..9de3cbe00b 100644 --- a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj +++ b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj @@ -486,10 +486,6 @@ - - - - diff --git a/OpenRA.Mods.RA/TraitsInterfaces.cs b/OpenRA.Mods.RA/TraitsInterfaces.cs index 1239468277..a03d3885cc 100755 --- a/OpenRA.Mods.RA/TraitsInterfaces.cs +++ b/OpenRA.Mods.RA/TraitsInterfaces.cs @@ -50,6 +50,5 @@ namespace OpenRA.Mods.RA public interface INotifyParachuteLanded { void OnLanded(); } public interface INotifyTransform { void BeforeTransform(Actor self); void OnTransform(Actor self); void AfterTransform(Actor toActor); } public interface INotifyAttack { void Attacking(Actor self, Target target, Armament a, Barrel barrel); } - public interface INotifyChat { bool OnChat(string from, string message); } public interface IRenderActorPreviewInfo { IEnumerable RenderPreview(ActorPreviewInitializer init); } } diff --git a/OpenRA.Mods.RA/Widgets/Logic/IngameChatLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/IngameChatLogic.cs index fda765494a..c7adba0af3 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/IngameChatLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/IngameChatLogic.cs @@ -11,6 +11,7 @@ using System.Collections.Generic; using System.Drawing; using System.Linq; +using OpenRA.Mods.Common; using OpenRA.Network; using OpenRA.Widgets;