Skip to content
Snippets Groups Projects
Commit b8e3d6ee authored by stuebinm's avatar stuebinm
Browse files

changes to tiled map format

(found by running through rc3 2021 map submissions and looking at what failed)
parent de1b45be
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment