From e962cec448edfeb2c40cfc6e9da4336c51bd3ca3 Mon Sep 17 00:00:00 2001 From: Dylan Wilson Date: Tue, 9 Oct 2018 22:18:48 +1000 Subject: [PATCH] A mix between Tiled and GUI stuff (#553) * mostly restored the tiled importer unit tests * code cleanup * code cleanup * almost got tiled maps serialization independent of the content pipeline * refactored the tiled map content importer so that tiled maps can be loaded at runtime * code cleanup * removed nuspec files * experimenting with an XML based GUI markup parser * a few more markup parser features * finally got a working open file dialog * experimenting with markup bindings * attached properties * working on the gui stuff again * working on a better textbox * multiline textboxing * new text box is really coming along * removed the content explorer experiment * restored the old gui demo back to the way it was before (for now) --- .gitignore | 2 +- Source/Demos/Gui/Features/MainWindow.mgeml | 18 + Source/Demos/Gui/Features/StackPanelView.cs | 3 +- Source/Demos/Gui/Gui.csproj | 8 + Source/Demos/Gui/MainGame.cs | 16 + .../ContentImporterResult.cs | 6 +- .../ContentItem.cs | 37 ++ .../TextureAtlases/TexturePackerSize.cs | 2 +- .../Tiled/ContentWriterExtensions.cs | 4 +- .../Tiled/TiledMapContentItem.cs | 12 + .../Tiled/TiledMapGroupLayerContent.cs | 21 -- .../Tiled/TiledMapImporter.cs | 10 +- .../Tiled/TiledMapObjectContent.cs | 115 ------ .../Tiled/TiledMapObjectTemplateContent.cs | 21 -- .../Tiled/TiledMapObjectTemplateImporter.cs | 7 +- .../Tiled/TiledMapProcessor.cs | 181 ++++++--- .../Tiled/TiledMapTile.cs | 31 -- .../Tiled/TiledMapTilesetContentItem.cs | 12 + .../Tiled/TiledMapTilesetImporter.cs | 35 +- .../Tiled/TiledMapTilesetProcessor.cs | 31 +- .../Tiled/TiledMapTilesetWriter.cs | 23 +- .../Tiled/TiledMapWriter.cs | 46 +-- Source/MonoGame.Extended.Gui/Controls/Box.cs | 24 ++ .../MonoGame.Extended.Gui/Controls/Button.cs | 4 +- .../Controls/CheckBox.cs | 28 +- .../Controls/ContentControl.cs | 31 +- .../MonoGame.Extended.Gui/Controls/Control.cs | 22 +- .../Controls/DockPanel.cs | 9 + .../MonoGame.Extended.Gui/Controls/Submit.cs | 6 - .../MonoGame.Extended.Gui/Controls/TextBox.cs | 24 +- .../Controls/TextBox2.cs | 328 +++++++++++++++++ Source/MonoGame.Extended.Gui/Element.cs | 12 +- Source/MonoGame.Extended.Gui/GuiSystem.cs | 2 +- Source/MonoGame.Extended.Gui/LayoutHelper.cs | 17 - .../Markup/MarkupParser.cs | 147 ++++++++ Source/MonoGame.Extended.Gui/Skin.cs | 10 +- .../Serialization}/TiledMapContent.cs | 30 +- .../Serialization}/TiledMapEllipseContent.cs | 2 +- .../TiledMapGroupLayerContent.cs | 20 + .../Serialization}/TiledMapImageContent.cs | 10 +- .../TiledMapImageLayerContent.cs | 3 +- .../Serialization}/TiledMapLayerContent.cs | 19 +- .../TiledMapLayerModelContent.cs | 3 +- .../Serialization/TiledMapObjectContent.cs | 74 ++++ .../TiledMapObjectDrawOrderContent.cs | 2 +- .../TiledMapObjectLayerContent.cs | 17 +- .../TiledMapObjectTemplateContent.cs | 17 + .../TiledMapOrientationContent.cs | 2 +- .../Serialization}/TiledMapPolygonContent.cs | 2 +- .../Serialization}/TiledMapPolylineContent.cs | 2 +- .../Serialization}/TiledMapPropertyContent.cs | 2 +- .../TiledMapStaggerAxisContent.cs | 2 +- .../TiledMapStaggerIndexContent.cs | 2 +- .../Serialization}/TiledMapTileContent.cs | 2 +- .../TiledMapTileDrawOrderContent.cs | 2 +- .../TiledMapTileLayerContent.cs | 13 +- .../TiledMapTileLayerDataChunkContent.cs | 2 +- .../TiledMapTileLayerDataContent.cs | 14 +- .../TiledMapTileOffsetContent.cs | 2 +- .../Serialization}/TiledMapTilesetContent.cs | 21 +- .../TiledMapTilesetGridContent.cs | 2 +- ...iledMapTilesetTileAnimationFrameContent.cs | 2 +- .../TiledMapTilesetTileContent.cs | 2 +- .../MonoGame.Extended.Tiled/TiledMapReader.cs | 8 +- .../TiledMapTilesetReader.cs | 4 - Source/MonoGame.Extended.sln | 6 - .../BitmapFonts/BitmapFont.cs | 2 +- ...tended.Content.Pipeline.Tests.Tiled.csproj | 32 ++ .../TiledMapImporterProcessorTests.cs | 345 +++++++++--------- .../LoadContentTests.cs | 13 + 70 files changed, 1303 insertions(+), 683 deletions(-) create mode 100644 Source/Demos/Gui/Features/MainWindow.mgeml create mode 100644 Source/MonoGame.Extended.Content.Pipeline/ContentItem.cs create mode 100644 Source/MonoGame.Extended.Content.Pipeline/Tiled/TiledMapContentItem.cs delete mode 100644 Source/MonoGame.Extended.Content.Pipeline/Tiled/TiledMapGroupLayerContent.cs delete mode 100644 Source/MonoGame.Extended.Content.Pipeline/Tiled/TiledMapObjectContent.cs delete mode 100644 Source/MonoGame.Extended.Content.Pipeline/Tiled/TiledMapObjectTemplateContent.cs delete mode 100644 Source/MonoGame.Extended.Content.Pipeline/Tiled/TiledMapTile.cs create mode 100644 Source/MonoGame.Extended.Content.Pipeline/Tiled/TiledMapTilesetContentItem.cs create mode 100644 Source/MonoGame.Extended.Gui/Controls/Box.cs delete mode 100644 Source/MonoGame.Extended.Gui/Controls/Submit.cs create mode 100644 Source/MonoGame.Extended.Gui/Controls/TextBox2.cs create mode 100644 Source/MonoGame.Extended.Gui/Markup/MarkupParser.cs rename Source/{MonoGame.Extended.Content.Pipeline/Tiled => MonoGame.Extended.Tiled/Serialization}/TiledMapContent.cs (79%) rename Source/{MonoGame.Extended.Content.Pipeline/Tiled => MonoGame.Extended.Tiled/Serialization}/TiledMapEllipseContent.cs (51%) create mode 100644 Source/MonoGame.Extended.Tiled/Serialization/TiledMapGroupLayerContent.cs rename Source/{MonoGame.Extended.Content.Pipeline/Tiled => MonoGame.Extended.Tiled/Serialization}/TiledMapImageContent.cs (81%) rename Source/{MonoGame.Extended.Content.Pipeline/Tiled => MonoGame.Extended.Tiled/Serialization}/TiledMapImageLayerContent.cs (90%) rename Source/{MonoGame.Extended.Content.Pipeline/Tiled => MonoGame.Extended.Tiled/Serialization}/TiledMapLayerContent.cs (93%) rename Source/{MonoGame.Extended.Content.Pipeline/Tiled => MonoGame.Extended.Tiled/Serialization}/TiledMapLayerModelContent.cs (98%) create mode 100644 Source/MonoGame.Extended.Tiled/Serialization/TiledMapObjectContent.cs rename Source/{MonoGame.Extended.Content.Pipeline/Tiled => MonoGame.Extended.Tiled/Serialization}/TiledMapObjectDrawOrderContent.cs (78%) rename Source/{MonoGame.Extended.Content.Pipeline/Tiled => MonoGame.Extended.Tiled/Serialization}/TiledMapObjectLayerContent.cs (89%) create mode 100644 Source/MonoGame.Extended.Tiled/Serialization/TiledMapObjectTemplateContent.cs rename Source/{MonoGame.Extended.Content.Pipeline/Tiled => MonoGame.Extended.Tiled/Serialization}/TiledMapOrientationContent.cs (85%) rename Source/{MonoGame.Extended.Content.Pipeline/Tiled => MonoGame.Extended.Tiled/Serialization}/TiledMapPolygonContent.cs (77%) rename Source/{MonoGame.Extended.Content.Pipeline/Tiled => MonoGame.Extended.Tiled/Serialization}/TiledMapPolylineContent.cs (78%) rename Source/{MonoGame.Extended.Content.Pipeline/Tiled => MonoGame.Extended.Tiled/Serialization}/TiledMapPropertyContent.cs (87%) rename Source/{MonoGame.Extended.Content.Pipeline/Tiled => MonoGame.Extended.Tiled/Serialization}/TiledMapStaggerAxisContent.cs (71%) rename Source/{MonoGame.Extended.Content.Pipeline/Tiled => MonoGame.Extended.Tiled/Serialization}/TiledMapStaggerIndexContent.cs (73%) rename Source/{MonoGame.Extended.Content.Pipeline/Tiled => MonoGame.Extended.Tiled/Serialization}/TiledMapTileContent.cs (76%) rename Source/{MonoGame.Extended.Content.Pipeline/Tiled => MonoGame.Extended.Tiled/Serialization}/TiledMapTileDrawOrderContent.cs (85%) rename Source/{MonoGame.Extended.Content.Pipeline/Tiled => MonoGame.Extended.Tiled/Serialization}/TiledMapTileLayerContent.cs (84%) rename Source/{MonoGame.Extended.Content.Pipeline/Tiled => MonoGame.Extended.Tiled/Serialization}/TiledMapTileLayerDataChunkContent.cs (91%) rename Source/{MonoGame.Extended.Content.Pipeline/Tiled => MonoGame.Extended.Tiled/Serialization}/TiledMapTileLayerDataContent.cs (93%) rename Source/{MonoGame.Extended.Content.Pipeline/Tiled => MonoGame.Extended.Tiled/Serialization}/TiledMapTileOffsetContent.cs (87%) rename Source/{MonoGame.Extended.Content.Pipeline/Tiled => MonoGame.Extended.Tiled/Serialization}/TiledMapTilesetContent.cs (91%) rename Source/{MonoGame.Extended.Content.Pipeline/Tiled => MonoGame.Extended.Tiled/Serialization}/TiledMapTilesetGridContent.cs (87%) rename Source/{MonoGame.Extended.Content.Pipeline/Tiled => MonoGame.Extended.Tiled/Serialization}/TiledMapTilesetTileAnimationFrameContent.cs (89%) rename Source/{MonoGame.Extended.Content.Pipeline/Tiled => MonoGame.Extended.Tiled/Serialization}/TiledMapTilesetTileContent.cs (95%) create mode 100644 Source/Tests/MonoGame.Extended.Tiled.Tests/LoadContentTests.cs diff --git a/.gitignore b/.gitignore index 3eac4457..8f1aaf69 100644 --- a/.gitignore +++ b/.gitignore @@ -26,7 +26,7 @@ bld/ site/ # Cake -tools/ +/tools/ # NuGet Packages artifacts/ diff --git a/Source/Demos/Gui/Features/MainWindow.mgeml b/Source/Demos/Gui/Features/MainWindow.mgeml new file mode 100644 index 00000000..720fed59 --- /dev/null +++ b/Source/Demos/Gui/Features/MainWindow.mgeml @@ -0,0 +1,18 @@ + + + +