diff --git a/OpenRA.Game/Graphics/Renderer.cs b/OpenRA.Game/Graphics/Renderer.cs
index 19211ff5be..39e02a12f3 100644
--- a/OpenRA.Game/Graphics/Renderer.cs
+++ b/OpenRA.Game/Graphics/Renderer.cs
@@ -260,5 +260,10 @@ namespace OpenRA.Graphics
if (fontSheetBuilder != null)
fontSheetBuilder.Dispose();
}
+
+ public string GetClipboardText()
+ {
+ return Device.GetClipboardText();
+ }
}
}
diff --git a/OpenRA.Game/OpenRA.Game.csproj b/OpenRA.Game/OpenRA.Game.csproj
index e86c309d37..3329e3bd84 100644
--- a/OpenRA.Game/OpenRA.Game.csproj
+++ b/OpenRA.Game/OpenRA.Game.csproj
@@ -172,38 +172,11 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -211,16 +184,12 @@
-
-
-
-
@@ -236,7 +205,6 @@
-
@@ -259,6 +227,12 @@
+
+
+
+
+
+
diff --git a/OpenRA.Mods.Cnc/Widgets/Logic/CncMainMenuLogic.cs b/OpenRA.Mods.Cnc/Widgets/Logic/CncMainMenuLogic.cs
index 274bb1959c..9fe3982b52 100644
--- a/OpenRA.Mods.Cnc/Widgets/Logic/CncMainMenuLogic.cs
+++ b/OpenRA.Mods.Cnc/Widgets/Logic/CncMainMenuLogic.cs
@@ -8,6 +8,7 @@
*/
#endregion
+using OpenRA.Mods.Common.Widgets;
using OpenRA.Mods.Common.Widgets.Logic;
using OpenRA.Widgets;
diff --git a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj
index aa251a9ed9..91f6d34f49 100644
--- a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj
+++ b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj
@@ -590,6 +590,32 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/OpenRA.Mods.Common/Scripting/Media.cs b/OpenRA.Mods.Common/Scripting/Media.cs
index 0365974830..9546fc5785 100644
--- a/OpenRA.Mods.Common/Scripting/Media.cs
+++ b/OpenRA.Mods.Common/Scripting/Media.cs
@@ -11,6 +11,7 @@
using System;
using System.IO;
using OpenRA.FileFormats;
+using OpenRA.Mods.Common.Widgets;
using OpenRA.Widgets;
namespace OpenRA.Mods.Common.Scripting
diff --git a/OpenRA.Game/Widgets/BackgroundWidget.cs b/OpenRA.Mods.Common/Widgets/BackgroundWidget.cs
similarity index 96%
rename from OpenRA.Game/Widgets/BackgroundWidget.cs
rename to OpenRA.Mods.Common/Widgets/BackgroundWidget.cs
index df034a717d..cba1dc820d 100644
--- a/OpenRA.Game/Widgets/BackgroundWidget.cs
+++ b/OpenRA.Mods.Common/Widgets/BackgroundWidget.cs
@@ -9,8 +9,9 @@
#endregion
using System.Drawing;
+using OpenRA.Widgets;
-namespace OpenRA.Widgets
+namespace OpenRA.Mods.Common.Widgets
{
public class BackgroundWidget : Widget
{
diff --git a/OpenRA.Game/Widgets/ButtonWidget.cs b/OpenRA.Mods.Common/Widgets/ButtonWidget.cs
similarity index 99%
rename from OpenRA.Game/Widgets/ButtonWidget.cs
rename to OpenRA.Mods.Common/Widgets/ButtonWidget.cs
index 7714572a23..9f3c7682af 100644
--- a/OpenRA.Game/Widgets/ButtonWidget.cs
+++ b/OpenRA.Mods.Common/Widgets/ButtonWidget.cs
@@ -10,8 +10,9 @@
using System;
using System.Drawing;
+using OpenRA.Widgets;
-namespace OpenRA.Widgets
+namespace OpenRA.Mods.Common.Widgets
{
public class ButtonWidget : Widget
{
diff --git a/OpenRA.Game/Widgets/ChatDisplayWidget.cs b/OpenRA.Mods.Common/Widgets/ChatDisplayWidget.cs
similarity index 97%
rename from OpenRA.Game/Widgets/ChatDisplayWidget.cs
rename to OpenRA.Mods.Common/Widgets/ChatDisplayWidget.cs
index 79e4889716..ebb046d489 100644
--- a/OpenRA.Game/Widgets/ChatDisplayWidget.cs
+++ b/OpenRA.Mods.Common/Widgets/ChatDisplayWidget.cs
@@ -12,8 +12,9 @@ using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
+using OpenRA.Widgets;
-namespace OpenRA.Widgets
+namespace OpenRA.Mods.Common.Widgets
{
public class ChatDisplayWidget : Widget
{
diff --git a/OpenRA.Game/Widgets/CheckboxWidget.cs b/OpenRA.Mods.Common/Widgets/CheckboxWidget.cs
similarity index 97%
rename from OpenRA.Game/Widgets/CheckboxWidget.cs
rename to OpenRA.Mods.Common/Widgets/CheckboxWidget.cs
index 016788c195..ec9b23bfe1 100644
--- a/OpenRA.Game/Widgets/CheckboxWidget.cs
+++ b/OpenRA.Mods.Common/Widgets/CheckboxWidget.cs
@@ -11,8 +11,9 @@
using System;
using System.Drawing;
using OpenRA.Graphics;
+using OpenRA.Widgets;
-namespace OpenRA.Widgets
+namespace OpenRA.Mods.Common.Widgets
{
public class CheckboxWidget : ButtonWidget
{
diff --git a/OpenRA.Game/Widgets/ClientTooltipRegionWidget.cs b/OpenRA.Mods.Common/Widgets/ClientTooltipRegionWidget.cs
similarity index 96%
rename from OpenRA.Game/Widgets/ClientTooltipRegionWidget.cs
rename to OpenRA.Mods.Common/Widgets/ClientTooltipRegionWidget.cs
index 79d1285546..3255d65b3e 100644
--- a/OpenRA.Game/Widgets/ClientTooltipRegionWidget.cs
+++ b/OpenRA.Mods.Common/Widgets/ClientTooltipRegionWidget.cs
@@ -10,8 +10,9 @@
using System;
using OpenRA.Network;
+using OpenRA.Widgets;
-namespace OpenRA.Widgets
+namespace OpenRA.Mods.Common.Widgets
{
public class ClientTooltipRegionWidget : Widget
{
diff --git a/OpenRA.Game/Widgets/ColorBlockWidget.cs b/OpenRA.Mods.Common/Widgets/ColorBlockWidget.cs
similarity index 93%
rename from OpenRA.Game/Widgets/ColorBlockWidget.cs
rename to OpenRA.Mods.Common/Widgets/ColorBlockWidget.cs
index eeceb1f9a6..0fc2d8d444 100644
--- a/OpenRA.Game/Widgets/ColorBlockWidget.cs
+++ b/OpenRA.Mods.Common/Widgets/ColorBlockWidget.cs
@@ -10,8 +10,9 @@
using System;
using System.Drawing;
+using OpenRA.Widgets;
-namespace OpenRA.Widgets
+namespace OpenRA.Mods.Common.Widgets
{
public class ColorBlockWidget : Widget
{
diff --git a/OpenRA.Game/Widgets/DropDownButtonWidget.cs b/OpenRA.Mods.Common/Widgets/DropDownButtonWidget.cs
similarity index 98%
rename from OpenRA.Game/Widgets/DropDownButtonWidget.cs
rename to OpenRA.Mods.Common/Widgets/DropDownButtonWidget.cs
index cdd33ad20b..4b557aac46 100644
--- a/OpenRA.Game/Widgets/DropDownButtonWidget.cs
+++ b/OpenRA.Mods.Common/Widgets/DropDownButtonWidget.cs
@@ -12,8 +12,9 @@ using System;
using System.Collections.Generic;
using System.Drawing;
using OpenRA.Graphics;
+using OpenRA.Widgets;
-namespace OpenRA.Widgets
+namespace OpenRA.Mods.Common.Widgets
{
public class DropDownButtonWidget : ButtonWidget
{
diff --git a/OpenRA.Game/Widgets/GridLayout.cs b/OpenRA.Mods.Common/Widgets/GridLayout.cs
similarity index 95%
rename from OpenRA.Game/Widgets/GridLayout.cs
rename to OpenRA.Mods.Common/Widgets/GridLayout.cs
index aa81a24287..9c5f2851f4 100644
--- a/OpenRA.Game/Widgets/GridLayout.cs
+++ b/OpenRA.Mods.Common/Widgets/GridLayout.cs
@@ -9,8 +9,9 @@
#endregion
using System;
+using OpenRA.Widgets;
-namespace OpenRA.Widgets
+namespace OpenRA.Mods.Common.Widgets
{
public class GridLayout : ILayout
{
diff --git a/OpenRA.Game/Widgets/HotkeyEntryWidget.cs b/OpenRA.Mods.Common/Widgets/HotkeyEntryWidget.cs
similarity index 98%
rename from OpenRA.Game/Widgets/HotkeyEntryWidget.cs
rename to OpenRA.Mods.Common/Widgets/HotkeyEntryWidget.cs
index 2c7fd40f03..afed6b72d5 100644
--- a/OpenRA.Game/Widgets/HotkeyEntryWidget.cs
+++ b/OpenRA.Mods.Common/Widgets/HotkeyEntryWidget.cs
@@ -11,8 +11,9 @@
using System;
using System.Drawing;
using System.Linq;
+using OpenRA.Widgets;
-namespace OpenRA.Widgets
+namespace OpenRA.Mods.Common.Widgets
{
public class HotkeyEntryWidget : Widget
{
diff --git a/OpenRA.Game/Widgets/ImageWidget.cs b/OpenRA.Mods.Common/Widgets/ImageWidget.cs
similarity index 96%
rename from OpenRA.Game/Widgets/ImageWidget.cs
rename to OpenRA.Mods.Common/Widgets/ImageWidget.cs
index 8309d52ef2..7f7c9746cf 100644
--- a/OpenRA.Game/Widgets/ImageWidget.cs
+++ b/OpenRA.Mods.Common/Widgets/ImageWidget.cs
@@ -10,8 +10,9 @@
using System;
using OpenRA.Graphics;
+using OpenRA.Widgets;
-namespace OpenRA.Widgets
+namespace OpenRA.Mods.Common.Widgets
{
public class ImageWidget : Widget
{
diff --git a/OpenRA.Game/Widgets/LabelWidget.cs b/OpenRA.Mods.Common/Widgets/LabelWidget.cs
similarity index 97%
rename from OpenRA.Game/Widgets/LabelWidget.cs
rename to OpenRA.Mods.Common/Widgets/LabelWidget.cs
index 3dbf6b312a..919f8bca80 100644
--- a/OpenRA.Game/Widgets/LabelWidget.cs
+++ b/OpenRA.Mods.Common/Widgets/LabelWidget.cs
@@ -11,8 +11,9 @@
using System;
using System.Drawing;
using OpenRA.Graphics;
+using OpenRA.Widgets;
-namespace OpenRA.Widgets
+namespace OpenRA.Mods.Common.Widgets
{
public enum TextAlign { Left, Center, Right }
public enum TextVAlign { Top, Middle, Bottom }
diff --git a/OpenRA.Game/Widgets/LineGraphWidget.cs b/OpenRA.Mods.Common/Widgets/LineGraphWidget.cs
similarity index 99%
rename from OpenRA.Game/Widgets/LineGraphWidget.cs
rename to OpenRA.Mods.Common/Widgets/LineGraphWidget.cs
index 7077e23070..b412dc9f9a 100644
--- a/OpenRA.Game/Widgets/LineGraphWidget.cs
+++ b/OpenRA.Mods.Common/Widgets/LineGraphWidget.cs
@@ -12,8 +12,9 @@ using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
+using OpenRA.Widgets;
-namespace OpenRA.Widgets
+namespace OpenRA.Mods.Common.Widgets
{
public class LineGraphWidget : Widget
{
diff --git a/OpenRA.Game/Widgets/ListLayout.cs b/OpenRA.Mods.Common/Widgets/ListLayout.cs
similarity index 94%
rename from OpenRA.Game/Widgets/ListLayout.cs
rename to OpenRA.Mods.Common/Widgets/ListLayout.cs
index fd40c31fef..15c22681d5 100644
--- a/OpenRA.Game/Widgets/ListLayout.cs
+++ b/OpenRA.Mods.Common/Widgets/ListLayout.cs
@@ -8,7 +8,9 @@
*/
#endregion
-namespace OpenRA.Widgets
+using OpenRA.Widgets;
+
+namespace OpenRA.Mods.Common.Widgets
{
public class ListLayout : ILayout
{
diff --git a/OpenRA.Game/Widgets/MapPreviewWidget.cs b/OpenRA.Mods.Common/Widgets/MapPreviewWidget.cs
similarity index 99%
rename from OpenRA.Game/Widgets/MapPreviewWidget.cs
rename to OpenRA.Mods.Common/Widgets/MapPreviewWidget.cs
index 4dec43de68..b017d481c6 100644
--- a/OpenRA.Game/Widgets/MapPreviewWidget.cs
+++ b/OpenRA.Mods.Common/Widgets/MapPreviewWidget.cs
@@ -14,8 +14,9 @@ using System.Drawing;
using System.Linq;
using OpenRA.Graphics;
using OpenRA.Network;
+using OpenRA.Widgets;
-namespace OpenRA.Widgets
+namespace OpenRA.Mods.Common.Widgets
{
public class SpawnOccupant
{
diff --git a/OpenRA.Game/Widgets/PasswordFieldWidget.cs b/OpenRA.Mods.Common/Widgets/PasswordFieldWidget.cs
similarity index 91%
rename from OpenRA.Game/Widgets/PasswordFieldWidget.cs
rename to OpenRA.Mods.Common/Widgets/PasswordFieldWidget.cs
index a12d75464a..c4b3202a24 100644
--- a/OpenRA.Game/Widgets/PasswordFieldWidget.cs
+++ b/OpenRA.Mods.Common/Widgets/PasswordFieldWidget.cs
@@ -8,7 +8,9 @@
*/
#endregion
-namespace OpenRA.Widgets
+using OpenRA.Widgets;
+
+namespace OpenRA.Mods.Common.Widgets
{
public class PasswordFieldWidget : TextFieldWidget
{
diff --git a/OpenRA.Game/Widgets/PerfGraphWidget.cs b/OpenRA.Mods.Common/Widgets/PerfGraphWidget.cs
similarity index 96%
rename from OpenRA.Game/Widgets/PerfGraphWidget.cs
rename to OpenRA.Mods.Common/Widgets/PerfGraphWidget.cs
index b96a87325f..e06c17a71b 100644
--- a/OpenRA.Game/Widgets/PerfGraphWidget.cs
+++ b/OpenRA.Mods.Common/Widgets/PerfGraphWidget.cs
@@ -11,8 +11,9 @@
using System.Drawing;
using System.Linq;
using OpenRA.Support;
+using OpenRA.Widgets;
-namespace OpenRA.Widgets
+namespace OpenRA.Mods.Common.Widgets
{
public class PerfGraphWidget : Widget
{
diff --git a/OpenRA.Game/Widgets/ProgressBarWidget.cs b/OpenRA.Mods.Common/Widgets/ProgressBarWidget.cs
similarity index 96%
rename from OpenRA.Game/Widgets/ProgressBarWidget.cs
rename to OpenRA.Mods.Common/Widgets/ProgressBarWidget.cs
index 722ed4e4de..dad4f024c5 100644
--- a/OpenRA.Game/Widgets/ProgressBarWidget.cs
+++ b/OpenRA.Mods.Common/Widgets/ProgressBarWidget.cs
@@ -10,8 +10,9 @@
using System;
using System.Drawing;
+using OpenRA.Widgets;
-namespace OpenRA.Widgets
+namespace OpenRA.Mods.Common.Widgets
{
public class ProgressBarWidget : Widget
{
diff --git a/OpenRA.Game/Widgets/RGBASpriteWidget.cs b/OpenRA.Mods.Common/Widgets/RGBASpriteWidget.cs
similarity index 93%
rename from OpenRA.Game/Widgets/RGBASpriteWidget.cs
rename to OpenRA.Mods.Common/Widgets/RGBASpriteWidget.cs
index 66dc4e6f04..bb6aed7994 100644
--- a/OpenRA.Game/Widgets/RGBASpriteWidget.cs
+++ b/OpenRA.Mods.Common/Widgets/RGBASpriteWidget.cs
@@ -10,8 +10,9 @@
using System;
using OpenRA.Graphics;
+using OpenRA.Widgets;
-namespace OpenRA.Widgets
+namespace OpenRA.Mods.Common.Widgets
{
public class RGBASpriteWidget : Widget
{
diff --git a/OpenRA.Game/Widgets/ScrollItemWidget.cs b/OpenRA.Mods.Common/Widgets/ScrollItemWidget.cs
similarity index 97%
rename from OpenRA.Game/Widgets/ScrollItemWidget.cs
rename to OpenRA.Mods.Common/Widgets/ScrollItemWidget.cs
index 9827b111e7..1f932f6cdb 100644
--- a/OpenRA.Game/Widgets/ScrollItemWidget.cs
+++ b/OpenRA.Mods.Common/Widgets/ScrollItemWidget.cs
@@ -9,8 +9,9 @@
#endregion
using System;
+using OpenRA.Widgets;
-namespace OpenRA.Widgets
+namespace OpenRA.Mods.Common.Widgets
{
public class ScrollItemWidget : ButtonWidget
{
diff --git a/OpenRA.Game/Widgets/ScrollPanelWidget.cs b/OpenRA.Mods.Common/Widgets/ScrollPanelWidget.cs
similarity index 99%
rename from OpenRA.Game/Widgets/ScrollPanelWidget.cs
rename to OpenRA.Mods.Common/Widgets/ScrollPanelWidget.cs
index 41880670e1..41485f57e4 100644
--- a/OpenRA.Game/Widgets/ScrollPanelWidget.cs
+++ b/OpenRA.Mods.Common/Widgets/ScrollPanelWidget.cs
@@ -13,8 +13,9 @@ using System.Drawing;
using System.Linq;
using OpenRA.Graphics;
using OpenRA.Primitives;
+using OpenRA.Widgets;
-namespace OpenRA.Widgets
+namespace OpenRA.Mods.Common.Widgets
{
public interface ILayout
{
diff --git a/OpenRA.Game/Widgets/SliderWidget.cs b/OpenRA.Mods.Common/Widgets/SliderWidget.cs
similarity index 98%
rename from OpenRA.Game/Widgets/SliderWidget.cs
rename to OpenRA.Mods.Common/Widgets/SliderWidget.cs
index db3e949e8b..9231cc8da7 100644
--- a/OpenRA.Game/Widgets/SliderWidget.cs
+++ b/OpenRA.Mods.Common/Widgets/SliderWidget.cs
@@ -11,8 +11,9 @@
using System;
using System.Drawing;
using OpenRA.Graphics;
+using OpenRA.Widgets;
-namespace OpenRA.Widgets
+namespace OpenRA.Mods.Common.Widgets
{
public class SliderWidget : Widget
{
diff --git a/OpenRA.Game/Widgets/SpriteWidget.cs b/OpenRA.Mods.Common/Widgets/SpriteWidget.cs
similarity index 96%
rename from OpenRA.Game/Widgets/SpriteWidget.cs
rename to OpenRA.Mods.Common/Widgets/SpriteWidget.cs
index 6e6d5f5409..cde5e4a9e8 100644
--- a/OpenRA.Game/Widgets/SpriteWidget.cs
+++ b/OpenRA.Mods.Common/Widgets/SpriteWidget.cs
@@ -10,8 +10,9 @@
using System;
using OpenRA.Graphics;
+using OpenRA.Widgets;
-namespace OpenRA.Widgets
+namespace OpenRA.Mods.Common.Widgets
{
public class SpriteWidget : Widget
{
diff --git a/OpenRA.Game/Widgets/TextFieldWidget.cs b/OpenRA.Mods.Common/Widgets/TextFieldWidget.cs
similarity index 98%
rename from OpenRA.Game/Widgets/TextFieldWidget.cs
rename to OpenRA.Mods.Common/Widgets/TextFieldWidget.cs
index 80734cc9b6..40b62ecb2a 100644
--- a/OpenRA.Game/Widgets/TextFieldWidget.cs
+++ b/OpenRA.Mods.Common/Widgets/TextFieldWidget.cs
@@ -10,8 +10,9 @@
using System;
using System.Drawing;
+using OpenRA.Widgets;
-namespace OpenRA.Widgets
+namespace OpenRA.Mods.Common.Widgets
{
public class TextFieldWidget : Widget
{
@@ -177,7 +178,7 @@ namespace OpenRA.Widgets
((Platform.CurrentPlatform != PlatformType.OSX && e.Modifiers.HasModifier(Modifiers.Ctrl)) ||
(Platform.CurrentPlatform == PlatformType.OSX && e.Modifiers.HasModifier(Modifiers.Meta))))
{
- var clipboardText = Game.Renderer.Device.GetClipboardText();
+ var clipboardText = Game.Renderer.GetClipboardText();
// Take only the first line of the clipboard contents
var nl = clipboardText.IndexOf('\n');
diff --git a/OpenRA.Game/Widgets/TooltipContainerWidget.cs b/OpenRA.Mods.Common/Widgets/TooltipContainerWidget.cs
similarity index 96%
rename from OpenRA.Game/Widgets/TooltipContainerWidget.cs
rename to OpenRA.Mods.Common/Widgets/TooltipContainerWidget.cs
index ca3ce5b7e4..545b9cdad3 100644
--- a/OpenRA.Game/Widgets/TooltipContainerWidget.cs
+++ b/OpenRA.Mods.Common/Widgets/TooltipContainerWidget.cs
@@ -11,8 +11,9 @@
using System;
using System.Drawing;
using OpenRA.Graphics;
+using OpenRA.Widgets;
-namespace OpenRA.Widgets
+namespace OpenRA.Mods.Common.Widgets
{
public class TooltipContainerWidget : Widget
{
diff --git a/OpenRA.Game/Widgets/ViewportControllerWidget.cs b/OpenRA.Mods.Common/Widgets/ViewportControllerWidget.cs
similarity index 99%
rename from OpenRA.Game/Widgets/ViewportControllerWidget.cs
rename to OpenRA.Mods.Common/Widgets/ViewportControllerWidget.cs
index f1c3d436ed..eb32bd562a 100644
--- a/OpenRA.Game/Widgets/ViewportControllerWidget.cs
+++ b/OpenRA.Mods.Common/Widgets/ViewportControllerWidget.cs
@@ -14,8 +14,9 @@ using System.Linq;
using OpenRA.Graphics;
using OpenRA.Orders;
using OpenRA.Traits;
+using OpenRA.Widgets;
-namespace OpenRA.Widgets
+namespace OpenRA.Mods.Common.Widgets
{
public enum WorldTooltipType { None, Unexplored, Actor, FrozenActor }
diff --git a/OpenRA.Game/Widgets/VqaPlayerWidget.cs b/OpenRA.Mods.Common/Widgets/VqaPlayerWidget.cs
similarity index 98%
rename from OpenRA.Game/Widgets/VqaPlayerWidget.cs
rename to OpenRA.Mods.Common/Widgets/VqaPlayerWidget.cs
index 5581166e18..f8df0654ba 100644
--- a/OpenRA.Game/Widgets/VqaPlayerWidget.cs
+++ b/OpenRA.Mods.Common/Widgets/VqaPlayerWidget.cs
@@ -13,8 +13,9 @@ using System.Drawing;
using OpenRA.FileFormats;
using OpenRA.FileSystem;
using OpenRA.Graphics;
+using OpenRA.Widgets;
-namespace OpenRA.Widgets
+namespace OpenRA.Mods.Common.Widgets
{
public class VqaPlayerWidget : Widget
{