From d116f8a1cec3c13cac2dd357179bfcb97e06f108 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sat, 28 Dec 2013 19:00:13 +1300 Subject: [PATCH] Add FieldLoader support for Size. --- OpenRA.FileFormats/FieldLoader.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/OpenRA.FileFormats/FieldLoader.cs b/OpenRA.FileFormats/FieldLoader.cs index 824a70630b..d81a73fc60 100755 --- a/OpenRA.FileFormats/FieldLoader.cs +++ b/OpenRA.FileFormats/FieldLoader.cs @@ -282,6 +282,12 @@ namespace OpenRA.FileFormats return ret; } + else if (fieldType == typeof(Size)) + { + var parts = value.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); + return new Size(int.Parse(parts[0]), int.Parse(parts[1])); + } + else if (fieldType == typeof(int2)) { var parts = value.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);