diff options
author | stuebinm | 2021-12-13 23:08:27 +0100 |
---|---|---|
committer | stuebinm | 2021-12-13 23:08:27 +0100 |
commit | b8e3d6eea571435eb95d15696457a254194b6280 (patch) | |
tree | 936250603a499f1ec60a110c28a92e1028ff36c4 | |
parent | de1b45be15f8bd1a2cba3491b6d0a17aeb3c8f3d (diff) |
changes to tiled map format
(found by running through rc3 2021 map submissions and looking at what failed)
-rw-r--r-- | lib/Properties.hs | 5 | ||||
-rw-r--r-- | lib/Tiled.hs | 6 |
2 files changed, 8 insertions, 3 deletions
diff --git a/lib/Properties.hs b/lib/Properties.hs index 0bd3d55..b15ea15 100644 --- a/lib/Properties.hs +++ b/lib/Properties.hs @@ -121,7 +121,7 @@ checkTileset = do $ complain "Tilesets must have tile size 32×32." unless (tilesetImageheight tileset < 4096 && tilesetImagewidth tileset < 4096) - $ warn "Tilesets should not be larger than 4096×4096 pixels in total." + $ warn "Tilesets should not be larger than 4096x4096 pixels in total." when (isJust (tilesetSource tileset)) $ complain "Tilesets must be embedded and cannot be loaded from external files." @@ -129,6 +129,9 @@ checkTileset = do unlessHasProperty "tilesetCopyright" $ forbid "property \"tilesetCopyright\" for tilesets must be set." + when (isJust (tilesetFileName tileset)) + $ complain "The \"filename\" property on tilesets was removed; use \"image\" instead (and perhaps a newer version of the Tiled Editor)." + -- check individual tileset properties mapM_ checkTilesetProperty (fromMaybe mempty $ tilesetProperties tileset) diff --git a/lib/Tiled.hs b/lib/Tiled.hs index 05839a7..f1d7ec6 100644 --- a/lib/Tiled.hs +++ b/lib/Tiled.hs @@ -217,8 +217,8 @@ data Layer = Layer { layerWidth :: Maybe Double , layerDraworder :: Maybe String -- ^ “topdown” (default) or “index”. objectgroup only. , layerId :: Int - , layerOffsetx :: Maybe Int - , layerOffsety :: Maybe Int + , layerOffsetx :: Maybe Float + , layerOffsety :: Maybe Float , layerParallaxx :: Maybe Float , layerParallaxy :: Maybe Float , layerTintColor :: Maybe Color @@ -227,6 +227,7 @@ data Layer = Layer { layerWidth :: Maybe Double , layerLayers :: Maybe [Layer] , layerStartX :: Maybe Int , layerStartY :: Maybe Int + , layerColor :: Maybe Color } deriving (Eq, Generic, Show) instance FromJSON Layer where @@ -331,6 +332,7 @@ data Tileset = Tileset { tilesetFirstgid :: GlobalId , tilesetVersion :: Maybe Value , tilesetWangsets :: Maybe Value , tilesetType :: Maybe Text + , tilesetFileName :: Maybe Text } deriving (Eq, Generic, Show) newtype TransitiveTilesetMap = TransitiveTilesetMap (Map LocalId Value) |