From b18a11f7b0ff2273e766dfc6cb2fec5b94c66429 Mon Sep 17 00:00:00 2001 From: Sebastien Benard Date: Mon, 15 Jan 2024 10:06:56 +0100 Subject: [PATCH 01/21] Fixed cleanupIdentifier arg type (#1051) --- src/electron.renderer/data/Project.hx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/electron.renderer/data/Project.hx b/src/electron.renderer/data/Project.hx index d49a9236c..1f65a3b9e 100644 --- a/src/electron.renderer/data/Project.hx +++ b/src/electron.renderer/data/Project.hx @@ -1188,6 +1188,7 @@ class Project { if( id==null ) return null; + id = Std.string(id); id = StringTools.trim(id); // Replace any invalid char with "_" From 124bcb3f0e4ed2b85334146e2c73aa3ef5b24c7b Mon Sep 17 00:00:00 2001 From: Sebastien Benard Date: Mon, 15 Jan 2024 10:07:08 +0100 Subject: [PATCH 02/21] Fixed infinite loop in fixUniqueIdStr (#1051) --- src/electron.renderer/data/Project.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/electron.renderer/data/Project.hx b/src/electron.renderer/data/Project.hx index 1f65a3b9e..c8327eb82 100644 --- a/src/electron.renderer/data/Project.hx +++ b/src/electron.renderer/data/Project.hx @@ -229,7 +229,7 @@ class Project { public function fixUniqueIdStr(baseId:String, ?styleOverride:ldtk.Json.IdentifierStyle, isUnique:String->Bool) : String { baseId = cleanupIdentifier(baseId, styleOverride==null ? identifierStyle : styleOverride); - if( baseId=="_" ) + if( baseId=="_" || baseId==null ) baseId = "Unnamed"; if( isUnique(baseId) ) From 78e2fcf7c93c7e74ec21fdd74ed32764541f7044 Mon Sep 17 00:00:00 2001 From: Sebastien Benard Date: Mon, 15 Jan 2024 10:16:54 +0100 Subject: [PATCH 03/21] Fixed crash on async painting with no default Tileset (#1047) --- src/electron.renderer/data/def/LayerDef.hx | 4 ---- src/electron.renderer/data/inst/LayerInstance.hx | 6 +++++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/electron.renderer/data/def/LayerDef.hx b/src/electron.renderer/data/def/LayerDef.hx index 8c02b10cd..73013d477 100644 --- a/src/electron.renderer/data/def/LayerDef.hx +++ b/src/electron.renderer/data/def/LayerDef.hx @@ -467,10 +467,6 @@ class LayerDef { inline function set_tilePivotX(v) return tilePivotX = dn.M.fclamp(v, 0, 1); inline function set_tilePivotY(v) return tilePivotY = dn.M.fclamp(v, 0, 1); - public inline function getGridTileColor(tileId:Int) : dn.Col { - return _project.defs.getTilesetDef(tilesetDefUid).getAverageTileColor(tileId); - } - public inline function isAutoLayer() { return type==IntGrid && tilesetDefUid!=null || type==AutoLayer; diff --git a/src/electron.renderer/data/inst/LayerInstance.hx b/src/electron.renderer/data/inst/LayerInstance.hx index f590fad39..8a4e0f29f 100644 --- a/src/electron.renderer/data/inst/LayerInstance.hx +++ b/src/electron.renderer/data/inst/LayerInstance.hx @@ -737,6 +737,10 @@ class LayerInstance { /** TILES *******************/ + inline function getGridTileColor(tileId:Int) : dn.Col { + var td = _project.defs.getTilesetDef( getTilesetUid() ); + return td!=null ? td.getAverageTileColor(tileId) : White; + } public function addGridTile(cx:Int, cy:Int, tileId:Null, flips=0, stack:Bool, useAsyncRender=true) { if( !isValid(cx,cy) ) @@ -755,7 +759,7 @@ class LayerInstance { } if( useAsyncRender ) - asyncPaint(cx,cy, def.getGridTileColor(tileId)); + asyncPaint(cx,cy, getGridTileColor(tileId)); } From aa8d4c9f2b622d745a67e23369f0311efe9cdb62 Mon Sep 17 00:00:00 2001 From: Sebastien Benard Date: Mon, 15 Jan 2024 10:41:36 +0100 Subject: [PATCH 04/21] Fixed crash with new entities (#1050) --- src/electron.renderer/data/Definitions.hx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/electron.renderer/data/Definitions.hx b/src/electron.renderer/data/Definitions.hx index ed2dcf951..0c87c408d 100644 --- a/src/electron.renderer/data/Definitions.hx +++ b/src/electron.renderer/data/Definitions.hx @@ -353,6 +353,8 @@ class Definitions { id = "Entity"+(idx++); ed.identifier = id; + _project.tidy(); + return ed; } From 1a97ef952d62fddc833c612a6ae868bb3c0b8511 Mon Sep 17 00:00:00 2001 From: hnhhzy Date: Mon, 15 Jan 2024 17:54:46 +0800 Subject: [PATCH 05/21] Keep large image thumbnails from getting stuck (#1008) Keep large image thumbnails from getting stuck --- src/electron.renderer/data/Project.hx | 21 +++++++++++++++++++- src/electron.renderer/data/def/TilesetDef.hx | 10 +++++----- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/src/electron.renderer/data/Project.hx b/src/electron.renderer/data/Project.hx index c8327eb82..bd20da3c1 100644 --- a/src/electron.renderer/data/Project.hx +++ b/src/electron.renderer/data/Project.hx @@ -920,8 +920,13 @@ class Project { } - public function getOrLoadImage(relPath:String) : Null { + public function getOrLoadImage(relPath:String,x = -1, y = -1, w = -1, h = -1) : Null { try { + var thumbnailPath = ""; + if(x != -1 && y != -1 && w != -1 && h != -1) { + thumbnailPath = relPath + "_" + Std.string(x) + "_" + Std.string(y) + "_" + Std.string(w) + "_" + Std.string(h); + } + if( !imageCache.exists(relPath) ) { // Load it from the disk App.LOG.add("cache", 'Caching image $relPath...'); @@ -946,7 +951,21 @@ class Project { pixels: pixels, tex: texture, }); + if(thumbnailPath != "") { + var subPixels = pixels.sub(x, y, w, h); + var b64 = haxe.crypto.Base64.encode( subPixels.toPNG() ); + imageCache.set( thumbnailPath, { + fileName: dn.FilePath.extractFileWithExt(relPath), + relPath: thumbnailPath, + bytes: null, + base64: b64, + pixels: subPixels, + tex: null, + }); + relPath = thumbnailPath; + } } + return imageCache.get(relPath); } catch( e:Dynamic ) { diff --git a/src/electron.renderer/data/def/TilesetDef.hx b/src/electron.renderer/data/def/TilesetDef.hx index 821bbc230..0831d69fd 100644 --- a/src/electron.renderer/data/def/TilesetDef.hx +++ b/src/electron.renderer/data/def/TilesetDef.hx @@ -60,11 +60,11 @@ class TilesetDef { public inline function isUsingEmbedAtlas() return embedAtlas!=null; - function getOrLoadTilesetImage() { + function getOrLoadTilesetImage(x = -1, y = -1, w = -1, h = -1) { if( !hasAtlasPointer() ) return null; else - return embedAtlas!=null ? _project.getOrLoadEmbedImage(embedAtlas) : _project.getOrLoadImage(relPath); + return embedAtlas!=null ? _project.getOrLoadEmbedImage(embedAtlas) : _project.getOrLoadImage(relPath, x, y, w, h); } @:allow(data.Project) @@ -889,9 +889,9 @@ class TilesetDef { public function createTileHtmlImageFromRect(r:ldtk.Json.TilesetRect, ?imgWid:Int, ?imgHei:Int) : js.jquery.JQuery { var jImg = if( isAtlasLoaded() && isTileRectInBounds(r) ) { - var imgData = getOrLoadTilesetImage(); - var subPixels = imgData.pixels.sub(r.x, r.y, r.w, r.h); - var b64 = haxe.crypto.Base64.encode( subPixels.toPNG() ); + var imgData = getOrLoadTilesetImage(r.x, r.y, r.w, r.h); + var subPixels = imgData.pixels; + var b64 = imgData.base64; var img = new js.html.Image(subPixels.width, subPixels.height); img.src = 'data:image/png;base64,$b64'; new J(img); From 8d7166809a0f2b753abc22a14786859872e7db97 Mon Sep 17 00:00:00 2001 From: Sebastien Benard Date: Mon, 15 Jan 2024 10:43:24 +0100 Subject: [PATCH 06/21] Changelog --- docs/CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 405eeb125..dd5d55253 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,3 +1,10 @@ +# 1.5.3 + +- Fixed a crash when trying to add a newly created Entity +- Fixed crash on async painting with no default Tileset +- Fixed a crash with empty identifiers +- Fixed a potential infinite loop with empty identifiers + # 1.5.2 - Fixed a bug with auto-layers on level edges. From 12e045528a569519c977844c04d032097c2bb115 Mon Sep 17 00:00:00 2001 From: Sebastien Benard Date: Mon, 15 Jan 2024 11:10:31 +0100 Subject: [PATCH 07/21] Minor fixes (#1008) --- src/electron.renderer/data/Project.hx | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/electron.renderer/data/Project.hx b/src/electron.renderer/data/Project.hx index bd20da3c1..2d9d6bb5d 100644 --- a/src/electron.renderer/data/Project.hx +++ b/src/electron.renderer/data/Project.hx @@ -920,13 +920,8 @@ class Project { } - public function getOrLoadImage(relPath:String,x = -1, y = -1, w = -1, h = -1) : Null { + public function getOrLoadImage(relPath:String, x=-1, y=-1, w=-1, h=-1) : Null { try { - var thumbnailPath = ""; - if(x != -1 && y != -1 && w != -1 && h != -1) { - thumbnailPath = relPath + "_" + Std.string(x) + "_" + Std.string(y) + "_" + Std.string(w) + "_" + Std.string(h); - } - if( !imageCache.exists(relPath) ) { // Load it from the disk App.LOG.add("cache", 'Caching image $relPath...'); @@ -951,8 +946,14 @@ class Project { pixels: pixels, tex: texture, }); - if(thumbnailPath != "") { - var subPixels = pixels.sub(x, y, w, h); + + // Store thumbnail to cache + var thumbnailPath = ""; + if( x!=-1 && y!=-1 && w!=-1 && h!=-1 ) + thumbnailPath = relPath + "_" + Std.string(x) + "_" + Std.string(y) + "_" + Std.string(w) + "_" + Std.string(h); + + if( thumbnailPath!="" ) { + var subPixels = pixels.sub(x, y, w, h); var b64 = haxe.crypto.Base64.encode( subPixels.toPNG() ); imageCache.set( thumbnailPath, { fileName: dn.FilePath.extractFileWithExt(relPath), @@ -965,7 +966,7 @@ class Project { relPath = thumbnailPath; } } - + return imageCache.get(relPath); } catch( e:Dynamic ) { From 9f34fd060311a0a11d99f9b981f2b1eb93cc9713 Mon Sep 17 00:00:00 2001 From: Sebastien Benard Date: Mon, 15 Jan 2024 11:48:56 +0100 Subject: [PATCH 08/21] Added project cache debug --- src/electron.renderer/EditorTypes.hx | 1 + src/electron.renderer/page/Editor.hx | 79 +++++++++++++++++----------- 2 files changed, 48 insertions(+), 32 deletions(-) diff --git a/src/electron.renderer/EditorTypes.hx b/src/electron.renderer/EditorTypes.hx index 0b1789798..542520abc 100644 --- a/src/electron.renderer/EditorTypes.hx +++ b/src/electron.renderer/EditorTypes.hx @@ -308,4 +308,5 @@ enum AppCommand { enum DebugFlag { F_MainDebug; F_IntGridUseCounts; + F_ProjectImgCache; } \ No newline at end of file diff --git a/src/electron.renderer/page/Editor.hx b/src/electron.renderer/page/Editor.hx index 37014b77f..92845bdd7 100644 --- a/src/electron.renderer/page/Editor.hx +++ b/src/electron.renderer/page/Editor.hx @@ -2898,6 +2898,52 @@ class Editor extends Page { } + function updateDebug() { + // IntGrid use counts debugging + if( App.ME.hasDebugFlag(F_IntGridUseCounts) ) { + App.ME.clearDebug(); + @:privateAccess + for(li in curLevel.layerInstances) { + if( li.def.type==IntGrid ) { + // Show cached area counts + App.ME.debugPre(li.toString()); + for(iv in li.def.intGridValues) { + var n = 0; + if( li.areaIntGridUseCount.exists(iv.value) ) + for(areaCount in li.areaIntGridUseCount.get(iv.value)) + n++; + var nLayer = li.layerIntGridUseCount.get(iv.value); + if( n>0 ) + App.ME.debugPre(' #${iv.value} => $n area (layer count=$nLayer)', n<=0 ? dn.Col.midGray() : dn.Col.white()); + } + } + if( li.def.isAutoLayer() ) { + // Count relevant rules + for(rg in li.def.autoRuleGroups) { + var n = 0; + for(r in rg.rules) + if( r.isRelevantInLayer(li) ) + n++; + + if( n>0 ) + App.ME.debugPre(" Group "+rg.toString()+": "+n+" rule(s)", "#56b0ff"); + } + } + } + } + + // Project images cache + if( App.ME.hasDebugFlag(F_ProjectImgCache) ) { + App.ME.clearDebug(); + @:privateAccess + for(c in project.imageCache.keyValueIterator()) { + var cache = project.imageCache.get(c.key); + App.ME.debugPre('${c.key}: (${cache.pixels.width}x${cache.pixels.height})'); + } + } + } + + override function postUpdate() { super.postUpdate(); ge.onEndOfFrame(); @@ -2940,37 +2986,6 @@ class Editor extends Page { if( settings.v.zenMode && cd.has("pendingZenModeReHide") && !cd.has("zenModeReHideLock") ) setZenModeReveal(false); - // IntGrid use counts debugging - if( App.ME.hasDebugFlag(F_IntGridUseCounts) ) { - App.ME.clearDebug(); - @:privateAccess - for(li in curLevel.layerInstances) { - if( li.def.type==IntGrid ) { - // Show cached area counts - App.ME.debugPre(li.toString()); - for(iv in li.def.intGridValues) { - var n = 0; - if( li.areaIntGridUseCount.exists(iv.value) ) - for(areaCount in li.areaIntGridUseCount.get(iv.value)) - n++; - var nLayer = li.layerIntGridUseCount.get(iv.value); - if( n>0 ) - App.ME.debugPre(' #${iv.value} => $n area (layer count=$nLayer)', n<=0 ? dn.Col.midGray() : dn.Col.white()); - } - } - if( li.def.isAutoLayer() ) { - // Count relevant rules - for(rg in li.def.autoRuleGroups) { - var n = 0; - for(r in rg.rules) - if( r.isRelevantInLayer(li) ) - n++; - - if( n>0 ) - App.ME.debugPre(" Group "+rg.toString()+": "+n+" rule(s)", "#56b0ff"); - } - } - } - } + updateDebug(); } } From 15f68b9c3d817f57ab05241ee3e147976dfcd5d7 Mon Sep 17 00:00:00 2001 From: Sebastien Benard Date: Mon, 15 Jan 2024 11:49:28 +0100 Subject: [PATCH 09/21] Fixed various bugs & optim issues (#1008) --- src/electron.renderer/data/Project.hx | 87 +++++++++++++++----- src/electron.renderer/data/def/TilesetDef.hx | 17 +++- 2 files changed, 80 insertions(+), 24 deletions(-) diff --git a/src/electron.renderer/data/Project.hx b/src/electron.renderer/data/Project.hx index 2d9d6bb5d..ac2c785fe 100644 --- a/src/electron.renderer/data/Project.hx +++ b/src/electron.renderer/data/Project.hx @@ -920,7 +920,40 @@ class Project { } - public function getOrLoadImage(relPath:String, x=-1, y=-1, w=-1, h=-1) : Null { + public function getOrLoadEmbedImageSub(id:ldtk.Json.EmbedAtlas, x:Int, y:Int, w:Int, h:Int) : Null { + try { + var thumbnailPath = id.getName() + "_" + Std.string(x) + "_" + Std.string(y) + "_" + Std.string(w) + "_" + Std.string(h); + if( !imageCache.exists(thumbnailPath) ) { + // Load original image + var cachedImg = getOrLoadEmbedImage(id); + if( cachedImg==null ) + return null; + + // Create sub tile cache + var subPixels = cachedImg.pixels.sub(x, y, w, h); + var pngBytes = subPixels.clone().toPNG(); + var tex = h3d.mat.Texture.fromPixels(subPixels); + var b64 = haxe.crypto.Base64.encode(pngBytes); + imageCache.set( thumbnailPath, { + fileName: cachedImg.fileName, + relPath: cachedImg.relPath, + bytes: pngBytes, + base64: b64, + pixels: subPixels, + tex: tex, + }); + } + + return imageCache.get(thumbnailPath); + } + catch( e:Dynamic ) { + App.LOG.error(e); + return null; + } + } + + + public function getOrLoadImage(relPath:String) : Null { try { if( !imageCache.exists(relPath) ) { // Load it from the disk @@ -946,25 +979,6 @@ class Project { pixels: pixels, tex: texture, }); - - // Store thumbnail to cache - var thumbnailPath = ""; - if( x!=-1 && y!=-1 && w!=-1 && h!=-1 ) - thumbnailPath = relPath + "_" + Std.string(x) + "_" + Std.string(y) + "_" + Std.string(w) + "_" + Std.string(h); - - if( thumbnailPath!="" ) { - var subPixels = pixels.sub(x, y, w, h); - var b64 = haxe.crypto.Base64.encode( subPixels.toPNG() ); - imageCache.set( thumbnailPath, { - fileName: dn.FilePath.extractFileWithExt(relPath), - relPath: thumbnailPath, - bytes: null, - base64: b64, - pixels: subPixels, - tex: null, - }); - relPath = thumbnailPath; - } } return imageCache.get(relPath); @@ -976,6 +990,39 @@ class Project { } + public function getOrLoadImageSub(relPath:String, x:Int, y:Int, w:Int, h:Int) : Null { + try { + var thumbnailPath = relPath + "_" + Std.string(x) + "_" + Std.string(y) + "_" + Std.string(w) + "_" + Std.string(h); + if( !imageCache.exists(thumbnailPath) ) { + // Load original image + var cachedImg = getOrLoadImage(relPath); + if( cachedImg==null ) + return null; + + // Create sub tile cache + var subPixels = cachedImg.pixels.sub(x, y, w, h); + var pngBytes = subPixels.clone().toPNG(); + var tex = h3d.mat.Texture.fromPixels(subPixels); + var b64 = haxe.crypto.Base64.encode(pngBytes); + imageCache.set( thumbnailPath, { + fileName: cachedImg.fileName, + relPath: cachedImg.relPath, + bytes: pngBytes, + base64: b64, + pixels: subPixels, + tex: tex, + }); + } + + return imageCache.get(thumbnailPath); + } + catch( e:Dynamic ) { + App.LOG.error(e); + return null; + } + } + + public function getAllCachedImages() { var arr = Lambda.array(imageCache); arr.sort( (a,b)->Reflect.compare( a.fileName.toLowerCase(), b.fileName.toLowerCase() ) ); diff --git a/src/electron.renderer/data/def/TilesetDef.hx b/src/electron.renderer/data/def/TilesetDef.hx index 0831d69fd..f62bdbaef 100644 --- a/src/electron.renderer/data/def/TilesetDef.hx +++ b/src/electron.renderer/data/def/TilesetDef.hx @@ -60,11 +60,20 @@ class TilesetDef { public inline function isUsingEmbedAtlas() return embedAtlas!=null; - function getOrLoadTilesetImage(x = -1, y = -1, w = -1, h = -1) { + function getOrLoadTilesetImage() { if( !hasAtlasPointer() ) return null; else - return embedAtlas!=null ? _project.getOrLoadEmbedImage(embedAtlas) : _project.getOrLoadImage(relPath, x, y, w, h); + return embedAtlas!=null ? _project.getOrLoadEmbedImage(embedAtlas) : _project.getOrLoadImage(relPath); + } + + function getOrLoadTilesetImageSub(x:Int, y:Int, w:Int, h:Int) { + if( !hasAtlasPointer() ) + return null; + else if( embedAtlas!=null ) + return _project.getOrLoadEmbedImageSub(embedAtlas, x,y,w,h); + else + return _project.getOrLoadImageSub(relPath, x,y,w,h); } @:allow(data.Project) @@ -889,8 +898,8 @@ class TilesetDef { public function createTileHtmlImageFromRect(r:ldtk.Json.TilesetRect, ?imgWid:Int, ?imgHei:Int) : js.jquery.JQuery { var jImg = if( isAtlasLoaded() && isTileRectInBounds(r) ) { - var imgData = getOrLoadTilesetImage(r.x, r.y, r.w, r.h); - var subPixels = imgData.pixels; + var imgData = getOrLoadTilesetImageSub(r.x, r.y, r.w, r.h); + var subPixels = imgData.pixels; var b64 = imgData.base64; var img = new js.html.Image(subPixels.width, subPixels.height); img.src = 'data:image/png;base64,$b64'; From 43b71e583418ef0c86d3ace949e2659b26441700 Mon Sep 17 00:00:00 2001 From: Sebastien Benard Date: Mon, 15 Jan 2024 11:54:03 +0100 Subject: [PATCH 10/21] Fixed macos Copy/paste menu (#998) --- src/electron.main/ElectronMain.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/electron.main/ElectronMain.hx b/src/electron.main/ElectronMain.hx index d526cfb06..a838e2790 100644 --- a/src/electron.main/ElectronMain.hx +++ b/src/electron.main/ElectronMain.hx @@ -112,7 +112,7 @@ class ElectronMain { #if debug enableDebugMenu(); #else - electron.main.Menu.setApplicationMenu( electron.main.Menu.buildFromTemplate( [] ) ); // macos + // electron.main.Menu.setApplicationMenu( electron.main.Menu.buildFromTemplate( [] ) ); // macos mainWindow.removeMenu(); // windows #end From 613dc9c05d1c7f72e79b9c530ba12ecee7557b6c Mon Sep 17 00:00:00 2001 From: Sebastien Benard Date: Mon, 15 Jan 2024 11:56:37 +0100 Subject: [PATCH 11/21] Minor fix in deploy checklist --- docs/deploy/deployChecklist.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/deploy/deployChecklist.md b/docs/deploy/deployChecklist.md index 26a260482..18282eda5 100644 --- a/docs/deploy/deployChecklist.md +++ b/docs/deploy/deployChecklist.md @@ -1,5 +1,5 @@ ## Tools -- [ ] Define a `GH_TOKEN` env var ([link](https://github.com/settings/tokens), all repo, Actions+Contents) +- [ ] Define a `GH_TOKEN` env var ([link](https://github.com/settings/tokens?type=beta), all repo, Actions+Contents) - [ ] Install "**Itch.io Butler**" ([download](https://itchio.itch.io/butler)) & login (`butler login`, [doc](https://itch.io/docs/butler/)) - [ ] Add butler to env `PATH` - [ ] Add code signing files to env From c9bdfe89e1976279d1681f39e2dc71e0b684ed5f Mon Sep 17 00:00:00 2001 From: Sebastien Benard Date: Mon, 15 Jan 2024 14:34:52 +0100 Subject: [PATCH 12/21] Added CTRL+click to emulate right click (#1048) --- docs/CHANGELOG.md | 1 + src/electron.renderer/Tool.hx | 2 ++ src/electron.renderer/ui/modal/ContextMenu.hx | 10 ++++++++++ 3 files changed, 13 insertions(+) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index dd5d55253..f5b977c66 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -4,6 +4,7 @@ - Fixed crash on async painting with no default Tileset - Fixed a crash with empty identifiers - Fixed a potential infinite loop with empty identifiers +- On macOS, CTRL+Left click should now behave like Right Clicking for editing tools and open context menus # 1.5.2 diff --git a/src/electron.renderer/Tool.hx b/src/electron.renderer/Tool.hx index 346f8a74e..5758517c7 100644 --- a/src/electron.renderer/Tool.hx +++ b/src/electron.renderer/Tool.hx @@ -98,6 +98,8 @@ class Tool extends dn.Process { switch button { case 0: curMode = Add; + if( App.ME.isMacCtrlDown() ) + curMode = Remove; case 1: curMode = Remove; diff --git a/src/electron.renderer/ui/modal/ContextMenu.hx b/src/electron.renderer/ui/modal/ContextMenu.hx index b946ef152..fc87028cd 100644 --- a/src/electron.renderer/ui/modal/ContextMenu.hx +++ b/src/electron.renderer/ui/modal/ContextMenu.hx @@ -131,6 +131,16 @@ class ContextMenu extends ui.Modal { ev.preventDefault(); _open(ev); }); + + // Emulated right click on macOS + if( App.isMac() ) + jTarget.on("mousedown.context", (ev:js.jquery.Event)->{ + if( ev.button==0 && App.ME.isMacCtrlDown() ) { + ev.stopPropagation(); + ev.preventDefault(); + _open(ev); + } + }); } From 09ac799dfca5dc033eec4d5b5bbf578ac3c7e058 Mon Sep 17 00:00:00 2001 From: TomMalitz Date: Mon, 15 Jan 2024 07:38:38 -0600 Subject: [PATCH 13/21] Persist tile custom data to Tiled custom properties (#989) * adding tile custom data to tiled export custom properties * match style --- src/electron.renderer/exporter/Tiled.hx | 39 +++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/src/electron.renderer/exporter/Tiled.hx b/src/electron.renderer/exporter/Tiled.hx index 49247869f..ec3f114b0 100644 --- a/src/electron.renderer/exporter/Tiled.hx +++ b/src/electron.renderer/exporter/Tiled.hx @@ -1,5 +1,6 @@ package exporter; +import haxe.Json; import ldtk.Json; @@ -146,6 +147,44 @@ class Tiled extends Exporter { image.set("width", ""+td.pxWid); image.set("height", ""+td.pxHei); + if ( td.hasAnyTileCustomData() ) { + for ( tileId in 0...count ) { + var tileData = td.getTileCustomData(tileId); + if ( tileData != null ) { + var tile = Xml.createElement("tile"); + tile.set("id", "" + tileId); + var properties = Xml.createElement("properties"); + var dataFields = Json.parse(tileData); + for ( key in Reflect.fields(dataFields) ) { + var value = Reflect.field(dataFields, key); + if ( value is Array ) continue; + var property = Xml.createElement("property"); + property.set("name", key); + switch ( Type.typeof(value) ) { + case TBool: + property.set("type", "bool"); + case TInt: + property.set("type", "int"); + case TFloat: + property.set("type", "float"); + case TObject: + property = null; + case _: + } + if ( property != null ) { + property.set("value", ""+value); + properties.addChild(property); + } + } + if ( properties.firstChild() != null ) { + log.add("tileset", ' Adding custom properties for tile: ${tileId}'); + tile.addChild(properties); + tileset.addChild(tile); + } + } + } + } + tilesetGids.set(td.uid, gid); gid+=count; } From 4aec845bd3d4b58f6e0bb588fde256c15deb8a86 Mon Sep 17 00:00:00 2001 From: Sebastien Benard Date: Mon, 15 Jan 2024 15:03:50 +0100 Subject: [PATCH 14/21] Updated samples --- app/extraFiles/samples/AutoLayers_1_basic.ldtk | 2 +- app/extraFiles/samples/AutoLayers_2_stamps.ldtk | 2 +- app/extraFiles/samples/AutoLayers_3_Mosaic.ldtk | 2 +- app/extraFiles/samples/AutoLayers_4_Assistant.ldtk | 2 +- app/extraFiles/samples/AutoLayers_5_Advanced.ldtk | 2 +- app/extraFiles/samples/AutoLayers_6_OptionalRules.ldtk | 2 +- app/extraFiles/samples/AutoLayers_7_Biomes.ldtk | 2 +- app/extraFiles/samples/Entities.ldtk | 2 +- app/extraFiles/samples/SeparateLevelFiles.ldtk | 2 +- .../samples/Test_file_for_API_showing_all_features.ldtk | 2 +- app/extraFiles/samples/Typical_2D_platformer_example.ldtk | 2 +- app/extraFiles/samples/Typical_TopDown_example.ldtk | 2 +- app/extraFiles/samples/WorldMap_Free_layout.ldtk | 2 +- app/extraFiles/samples/WorldMap_GridVania_layout.ldtk | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/app/extraFiles/samples/AutoLayers_1_basic.ldtk b/app/extraFiles/samples/AutoLayers_1_basic.ldtk index d2439bcec..91c436898 100644 --- a/app/extraFiles/samples/AutoLayers_1_basic.ldtk +++ b/app/extraFiles/samples/AutoLayers_1_basic.ldtk @@ -10,7 +10,7 @@ }, "iid": "a22d35f0-7820-11ed-b6fd-213e885f30da", "jsonVersion": "1.5.2", - "appBuildId": 473607, + "appBuildId": 473701, "nextUid": 112, "identifierStyle": "Capitalize", "toc": [], diff --git a/app/extraFiles/samples/AutoLayers_2_stamps.ldtk b/app/extraFiles/samples/AutoLayers_2_stamps.ldtk index 886346c74..1d91c0e18 100644 --- a/app/extraFiles/samples/AutoLayers_2_stamps.ldtk +++ b/app/extraFiles/samples/AutoLayers_2_stamps.ldtk @@ -10,7 +10,7 @@ }, "iid": "a243f240-7820-11ed-b6fd-f550906acdc3", "jsonVersion": "1.5.2", - "appBuildId": 473607, + "appBuildId": 473701, "nextUid": 40, "identifierStyle": "Capitalize", "toc": [], diff --git a/app/extraFiles/samples/AutoLayers_3_Mosaic.ldtk b/app/extraFiles/samples/AutoLayers_3_Mosaic.ldtk index 3752e4bd2..992901941 100644 --- a/app/extraFiles/samples/AutoLayers_3_Mosaic.ldtk +++ b/app/extraFiles/samples/AutoLayers_3_Mosaic.ldtk @@ -10,7 +10,7 @@ }, "iid": "a2533480-7820-11ed-b6fd-e9108160ae94", "jsonVersion": "1.5.2", - "appBuildId": 473607, + "appBuildId": 473701, "nextUid": 64, "identifierStyle": "Capitalize", "toc": [], diff --git a/app/extraFiles/samples/AutoLayers_4_Assistant.ldtk b/app/extraFiles/samples/AutoLayers_4_Assistant.ldtk index ca330b06d..60d015978 100644 --- a/app/extraFiles/samples/AutoLayers_4_Assistant.ldtk +++ b/app/extraFiles/samples/AutoLayers_4_Assistant.ldtk @@ -10,7 +10,7 @@ }, "iid": "a2533480-7820-11ed-b6fd-e9108160ae94", "jsonVersion": "1.5.2", - "appBuildId": 473607, + "appBuildId": 473701, "nextUid": 652, "identifierStyle": "Capitalize", "toc": [], diff --git a/app/extraFiles/samples/AutoLayers_5_Advanced.ldtk b/app/extraFiles/samples/AutoLayers_5_Advanced.ldtk index eb359f054..0074e9956 100644 --- a/app/extraFiles/samples/AutoLayers_5_Advanced.ldtk +++ b/app/extraFiles/samples/AutoLayers_5_Advanced.ldtk @@ -10,7 +10,7 @@ }, "iid": "a26276c0-7820-11ed-b6fd-ed05d55c9a75", "jsonVersion": "1.5.2", - "appBuildId": 473607, + "appBuildId": 473701, "nextUid": 106, "identifierStyle": "Capitalize", "toc": [], diff --git a/app/extraFiles/samples/AutoLayers_6_OptionalRules.ldtk b/app/extraFiles/samples/AutoLayers_6_OptionalRules.ldtk index d1a7f35e9..0ca45a667 100644 --- a/app/extraFiles/samples/AutoLayers_6_OptionalRules.ldtk +++ b/app/extraFiles/samples/AutoLayers_6_OptionalRules.ldtk @@ -10,7 +10,7 @@ }, "iid": "a27ed860-7820-11ed-b6fd-7fbe30dcfa27", "jsonVersion": "1.5.2", - "appBuildId": 473607, + "appBuildId": 473701, "nextUid": 167, "identifierStyle": "Capitalize", "toc": [], diff --git a/app/extraFiles/samples/AutoLayers_7_Biomes.ldtk b/app/extraFiles/samples/AutoLayers_7_Biomes.ldtk index 3b489453c..cdff17c7a 100644 --- a/app/extraFiles/samples/AutoLayers_7_Biomes.ldtk +++ b/app/extraFiles/samples/AutoLayers_7_Biomes.ldtk @@ -10,7 +10,7 @@ }, "iid": "a27ed860-7820-11ed-b6fd-7fbe30dcfa27", "jsonVersion": "1.5.2", - "appBuildId": 473607, + "appBuildId": 473701, "nextUid": 181, "identifierStyle": "Capitalize", "toc": [], diff --git a/app/extraFiles/samples/Entities.ldtk b/app/extraFiles/samples/Entities.ldtk index cd38149ad..87a8ffa49 100644 --- a/app/extraFiles/samples/Entities.ldtk +++ b/app/extraFiles/samples/Entities.ldtk @@ -10,7 +10,7 @@ }, "iid": "a2a4fe00-7820-11ed-b6fd-9b53622ece75", "jsonVersion": "1.5.2", - "appBuildId": 473607, + "appBuildId": 473701, "nextUid": 198, "identifierStyle": "Capitalize", "toc": [{ diff --git a/app/extraFiles/samples/SeparateLevelFiles.ldtk b/app/extraFiles/samples/SeparateLevelFiles.ldtk index b007343ad..3a0962416 100644 --- a/app/extraFiles/samples/SeparateLevelFiles.ldtk +++ b/app/extraFiles/samples/SeparateLevelFiles.ldtk @@ -10,7 +10,7 @@ }, "iid": "a2d9f0b0-7820-11ed-b6fd-010ddaafa733", "jsonVersion": "1.5.2", - "appBuildId": 473607, + "appBuildId": 473701, "nextUid": 10, "identifierStyle": "Capitalize", "toc": [], diff --git a/app/extraFiles/samples/Test_file_for_API_showing_all_features.ldtk b/app/extraFiles/samples/Test_file_for_API_showing_all_features.ldtk index 5264a8069..5d4994e7f 100644 --- a/app/extraFiles/samples/Test_file_for_API_showing_all_features.ldtk +++ b/app/extraFiles/samples/Test_file_for_API_showing_all_features.ldtk @@ -10,7 +10,7 @@ }, "iid": "a2e6e900-7820-11ed-b6fd-61d0df8fd468", "jsonVersion": "1.5.2", - "appBuildId": 473607, + "appBuildId": 473701, "nextUid": 50, "identifierStyle": "Capitalize", "toc": [{ diff --git a/app/extraFiles/samples/Typical_2D_platformer_example.ldtk b/app/extraFiles/samples/Typical_2D_platformer_example.ldtk index 8df3a03f8..2033504c0 100644 --- a/app/extraFiles/samples/Typical_2D_platformer_example.ldtk +++ b/app/extraFiles/samples/Typical_2D_platformer_example.ldtk @@ -10,7 +10,7 @@ }, "iid": "a302fc80-7820-11ed-b6fd-0944dd561895", "jsonVersion": "1.5.2", - "appBuildId": 473607, + "appBuildId": 473701, "nextUid": 107, "identifierStyle": "Capitalize", "toc": [], diff --git a/app/extraFiles/samples/Typical_TopDown_example.ldtk b/app/extraFiles/samples/Typical_TopDown_example.ldtk index fb79a291f..9f41ecc6b 100644 --- a/app/extraFiles/samples/Typical_TopDown_example.ldtk +++ b/app/extraFiles/samples/Typical_TopDown_example.ldtk @@ -10,7 +10,7 @@ }, "iid": "a3386460-7820-11ed-b6fd-157a63b4d02d", "jsonVersion": "1.5.2", - "appBuildId": 473607, + "appBuildId": 473701, "nextUid": 170, "identifierStyle": "Capitalize", "toc": [{ diff --git a/app/extraFiles/samples/WorldMap_Free_layout.ldtk b/app/extraFiles/samples/WorldMap_Free_layout.ldtk index 3c2c23921..81a4b8bfd 100644 --- a/app/extraFiles/samples/WorldMap_Free_layout.ldtk +++ b/app/extraFiles/samples/WorldMap_Free_layout.ldtk @@ -10,7 +10,7 @@ }, "iid": "a3619740-7820-11ed-b6fd-4b64aa0352a1", "jsonVersion": "1.5.2", - "appBuildId": 473607, + "appBuildId": 473701, "nextUid": 125, "identifierStyle": "Capitalize", "toc": [], diff --git a/app/extraFiles/samples/WorldMap_GridVania_layout.ldtk b/app/extraFiles/samples/WorldMap_GridVania_layout.ldtk index 3eb080362..ab7a2180a 100644 --- a/app/extraFiles/samples/WorldMap_GridVania_layout.ldtk +++ b/app/extraFiles/samples/WorldMap_GridVania_layout.ldtk @@ -10,7 +10,7 @@ }, "iid": "a39fb1b0-7820-11ed-b6fd-87f9a01f3d6b", "jsonVersion": "1.5.2", - "appBuildId": 473607, + "appBuildId": 473701, "nextUid": 152, "identifierStyle": "Capitalize", "toc": [{ From 255fd67d61917e8215c1ae6c313c078f68c3ad5e Mon Sep 17 00:00:00 2001 From: Sebastien Benard Date: Mon, 15 Jan 2024 15:18:53 +0100 Subject: [PATCH 15/21] Added ne,nw,se,sw corners directions for __neighbours --- src/electron.renderer/data/Level.hx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/electron.renderer/data/Level.hx b/src/electron.renderer/data/Level.hx index 69f53fa5a..4dc7260b4 100644 --- a/src/electron.renderer/data/Level.hx +++ b/src/electron.renderer/data/Level.hx @@ -114,12 +114,17 @@ class Level { var nears = _world.levels.filter( (ol)-> ol!=this && getBoundsDist(ol)==0 && ol.worldDepth==worldDepth - && !( ( ol.worldX>=worldX+pxWid || ol.worldX+ol.pxWid<=worldX ) - && ( ol.worldY>=worldY+pxHei || ol.worldY+ol.pxHei<=worldY ) ) + // && !( ( ol.worldX>=worldX+pxWid || ol.worldX+ol.pxWid<=worldX ) + // && ( ol.worldY>=worldY+pxHei || ol.worldY+ol.pxHei<=worldY ) ) && !dn.Lib.rectangleOverlaps(worldX,worldY,pxWid,pxHei, ol.worldX,ol.worldY,ol.pxWid,ol.pxHei) ); nears.map( (l)->{ - var dir = l.worldX>=worldX+pxWid ? "e" + var dir = + l.worldX == worldX+pxWid && l.worldY == worldY+pxHei ? "se" + : l.worldX+l.pxWid == worldX && l.worldY == worldY+pxHei ? "sw" + : l.worldX == worldX+pxWid && l.worldY+l.pxHei == worldY ? "ne" + : l.worldX+l.pxWid == worldX && l.worldY+l.pxHei == worldY ? "nw" + : l.worldX>=worldX+pxWid ? "e" : l.worldX+l.pxWid<=worldX ? "w" : l.worldY+l.pxHei<=worldY ? "n" : "s"; From b70f4594ba7c3a9acfd4385dd36df7a3fabb6a17 Mon Sep 17 00:00:00 2001 From: Sebastien Benard Date: Mon, 15 Jan 2024 15:19:39 +0100 Subject: [PATCH 16/21] Changelog --- docs/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index f5b977c66..9106be7ab 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -5,6 +5,7 @@ - Fixed a crash with empty identifiers - Fixed a potential infinite loop with empty identifiers - On macOS, CTRL+Left click should now behave like Right Clicking for editing tools and open context menus +- Added `ne`,`nw`,`se`,`sw` corners directions for `Level.__neighbours` in JSON # 1.5.2 From 0ce21356c44ad0a4e2713681ea2426019885b240 Mon Sep 17 00:00:00 2001 From: Sebastien Benard Date: Mon, 15 Jan 2024 15:24:32 +0100 Subject: [PATCH 17/21] Increased version --- app/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/package.json b/app/package.json index b09a6b963..4c232c526 100644 --- a/app/package.json +++ b/app/package.json @@ -1,6 +1,6 @@ { "name": "ldtk", - "version": "1.5.2", + "version": "1.5.3", "main": "assets/main.js", "productName": "LDtk", "author": "Sebastien Benard", From c10f2648357b8aeada06c575702dd16f3fe3a260 Mon Sep 17 00:00:00 2001 From: Sebastien Benard Date: Mon, 15 Jan 2024 15:24:38 +0100 Subject: [PATCH 18/21] Docs --- docs/JSON_DOC.md | 4 ++-- docs/JSON_SCHEMA.json | 6 +++--- docs/MINIMAL_JSON_SCHEMA.json | 6 +++--- docs/version.txt | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/JSON_DOC.md b/docs/JSON_DOC.md index 643ef3787..a19b5b505 100644 --- a/docs/JSON_DOC.md +++ b/docs/JSON_DOC.md @@ -1,4 +1,4 @@ -# LDtk Json structure (version 1.5.2) +# LDtk Json structure (version 1.5.3) @@ -79,7 +79,7 @@ Value | Type | Description -- | -- | -- `__bgColor`
![Generic badge](https://img.shields.io/badge/Added_0.6.0-gray.svg) | String
*Hex color "#rrggbb"* | Background color of the level (same as `bgColor`, except the default value is automatically used here if its value is `null`) `__bgPos`
Only *If background image exists*
![Generic badge](https://img.shields.io/badge/Added_0.7.0-gray.svg) | Object *(can be `null`)* | Position informations of the background image, if there is one.
This object contains the following fields:
  • **`cropRect`** **(Array of Float**) : *An array of 4 float values describing the cropped sub-rectangle of the displayed background image. This cropping happens when original is larger than the level bounds. Array format: `[ cropX, cropY, cropWidth, cropHeight ]`*
  • **`scale`** **(Array of Float**) : *An array containing the `[scaleX,scaleY]` values of the **cropped** background image, depending on `bgPos` option.*
  • **`topLeftPx`** **(Array of Int**) : *An array containing the `[x,y]` pixel coordinates of the top-left corner of the **cropped** background image, depending on `bgPos` option.*
-`__neighbours`
![Generic badge](https://img.shields.io/badge/Added_0.6.0-gray.svg) ![Generic badge](https://img.shields.io/badge/Changed_1.4.0-gray.svg) | Array of Object | An array listing all other levels touching this one on the world map. Since 1.4.0, this includes levels that overlap in the same world layer, or in nearby world layers.
Only relevant for world layouts where level spatial positioning is manual (ie. GridVania, Free). For Horizontal and Vertical layouts, this array is always empty.
This array contains objects with the following fields:
  • **`dir`** **(String**) ![Generic badge](https://img.shields.io/badge/Changed_1.4.0-gray.svg) : *A single lowercase character tipping on the level location (`n`orth, `s`outh, `w`est, `e`ast).
    Since 1.4.0, this character value can also be `<` (neighbour depth is lower), `>` (neighbour depth is greater) or `o` (levels overlap and share the same world depth).*
  • **`levelIid`** **(String**) ![Generic badge](https://img.shields.io/badge/Added_1.0.0-gray.svg) : *Neighbour Instance Identifier*
  • **`levelUid`** **(Int *(can be `null`)***) ![Generic badge](https://img.shields.io/badge/Removed_1.2.0-gray.svg) : ***WARNING**: this deprecated value is no longer exported since version 1.2.0* ** *Replaced by: `levelIid`*
+`__neighbours`
![Generic badge](https://img.shields.io/badge/Added_0.6.0-gray.svg) ![Generic badge](https://img.shields.io/badge/Changed_1.4.0-gray.svg) | Array of Object | An array listing all other levels touching this one on the world map. Since 1.4.0, this includes levels that overlap in the same world layer, or in nearby world layers.
Only relevant for world layouts where level spatial positioning is manual (ie. GridVania, Free). For Horizontal and Vertical layouts, this array is always empty.
This array contains objects with the following fields:
  • **`dir`** **(String**) ![Generic badge](https://img.shields.io/badge/Changed_1.4.0-gray.svg) : *A lowercase string tipping on the level location (`n`orth, `s`outh, `w`est, `e`ast).
    Since 1.4.0, this value can also be `<` (neighbour depth is lower), `>` (neighbour depth is greater) or `o` (levels overlap and share the same world depth).
    Since 1.5.3, this value can also be `nw`,`ne`,`sw` or `se` for levels only touching corners.*
  • **`levelIid`** **(String**) ![Generic badge](https://img.shields.io/badge/Added_1.0.0-gray.svg) : *Neighbour Instance Identifier*
  • **`levelUid`** **(Int *(can be `null`)***) ![Generic badge](https://img.shields.io/badge/Removed_1.2.0-gray.svg) : ***WARNING**: this deprecated value is no longer exported since version 1.2.0* ** *Replaced by: `levelIid`*
`bgRelPath`
![Generic badge](https://img.shields.io/badge/Added_0.7.0-gray.svg) | String *(can be `null`)* | The *optional* relative path to the level background image. `externalRelPath`
![Generic badge](https://img.shields.io/badge/Added_0.7.0-gray.svg) | String *(can be `null`)* | This value is not null if the project option "*Save levels separately*" is enabled. In this case, this **relative** path points to the level Json file. `fieldInstances`
![Generic badge](https://img.shields.io/badge/Changed_0.8.0-gray.svg) | Array of [Field instance](#ldtk-FieldInstanceJson) | An array containing this level custom field values. diff --git a/docs/JSON_SCHEMA.json b/docs/JSON_SCHEMA.json index b6dca884d..f77e1e0f6 100644 --- a/docs/JSON_SCHEMA.json +++ b/docs/JSON_SCHEMA.json @@ -1,9 +1,9 @@ { "description": "This file is a JSON schema of files created by LDtk level editor (https://ldtk.io).", - "title": "LDtk 1.5.2 JSON schema", + "title": "LDtk 1.5.3 JSON schema", "$schema": "https://json-schema.org/draft-07/schema#", "$ref": "#/LdtkJsonRoot", - "version": "1.5.2", + "version": "1.5.3", "LdtkJsonRoot": { "description": "This is the root of any Project JSON file. It contains: - the project settings, - an array of levels, - a group of definitions (that can probably be safely ignored for most users).", "title": "LDtk Json root", @@ -1836,7 +1836,7 @@ ] }, "dir": { - "description": "A single lowercase character tipping on the level location (`n`orth, `s`outh, `w`est, `e`ast).
Since 1.4.0, this character value can also be `<` (neighbour depth is lower), `>` (neighbour depth is greater) or `o` (levels overlap and share the same world depth).", + "description": "A lowercase string tipping on the level location (`n`orth, `s`outh, `w`est, `e`ast).
Since 1.4.0, this value can also be `<` (neighbour depth is lower), `>` (neighbour depth is greater) or `o` (levels overlap and share the same world depth).
Since 1.5.3, this value can also be `nw`,`ne`,`sw` or `se` for levels only touching corners.", "type": [ "string" ] diff --git a/docs/MINIMAL_JSON_SCHEMA.json b/docs/MINIMAL_JSON_SCHEMA.json index 15bc6a96e..4b1c7a6e7 100644 --- a/docs/MINIMAL_JSON_SCHEMA.json +++ b/docs/MINIMAL_JSON_SCHEMA.json @@ -1,9 +1,9 @@ { "description": "This file is a JSON schema of files created by LDtk level editor (https://ldtk.io).", - "title": "LDtk 1.5.2 JSON schema", + "title": "LDtk 1.5.3 JSON schema", "$schema": "https://json-schema.org/draft-07/schema#", "$ref": "#/LdtkJsonRoot", - "version": "1.5.2", + "version": "1.5.3", "LdtkJsonRoot": { "description": "This is the root of any Project JSON file. It contains: - the project settings, - an array of levels, - a group of definitions (that can probably be safely ignored for most users).", "title": "LDtk Json root", @@ -917,7 +917,7 @@ ] }, "dir": { - "description": "A single lowercase character tipping on the level location (`n`orth, `s`outh, `w`est, `e`ast).
Since 1.4.0, this character value can also be `<` (neighbour depth is lower), `>` (neighbour depth is greater) or `o` (levels overlap and share the same world depth).", + "description": "A lowercase string tipping on the level location (`n`orth, `s`outh, `w`est, `e`ast).
Since 1.4.0, this value can also be `<` (neighbour depth is lower), `>` (neighbour depth is greater) or `o` (levels overlap and share the same world depth).
Since 1.5.3, this value can also be `nw`,`ne`,`sw` or `se` for levels only touching corners.", "type": [ "string" ] diff --git a/docs/version.txt b/docs/version.txt index a73b43254..1d5e9e0ba 100644 --- a/docs/version.txt +++ b/docs/version.txt @@ -1 +1 @@ -1.5.2 \ No newline at end of file +1.5.3 \ No newline at end of file From 1bb00471269f5ff98a17d9dad8c82b5980ded57b Mon Sep 17 00:00:00 2001 From: Sebastien Benard Date: Mon, 15 Jan 2024 15:26:05 +0100 Subject: [PATCH 19/21] Updated samples --- .../samples/AutoLayers_1_basic.ldtk | 6 +-- .../samples/AutoLayers_2_stamps.ldtk | 6 +-- .../samples/AutoLayers_3_Mosaic.ldtk | 6 +-- .../samples/AutoLayers_4_Assistant.ldtk | 6 +-- .../samples/AutoLayers_5_Advanced.ldtk | 6 +-- .../samples/AutoLayers_6_OptionalRules.ldtk | 6 +-- .../samples/AutoLayers_7_Biomes.ldtk | 6 +-- app/extraFiles/samples/Entities.ldtk | 6 +-- .../samples/SeparateLevelFiles.ldtk | 6 +-- .../SeparateLevelFiles/World_Level_0.ldtkl | 2 +- .../SeparateLevelFiles/World_Level_1.ldtkl | 2 +- .../SeparateLevelFiles/World_Level_2.ldtkl | 2 +- ...est_file_for_API_showing_all_features.ldtk | 6 +-- .../Typical_2D_platformer_example.ldtk | 6 +-- .../samples/Typical_TopDown_example.ldtk | 6 +-- .../samples/WorldMap_Free_layout.ldtk | 6 +-- .../samples/WorldMap_GridVania_layout.ldtk | 38 +++++++++++++++---- 17 files changed, 73 insertions(+), 49 deletions(-) diff --git a/app/extraFiles/samples/AutoLayers_1_basic.ldtk b/app/extraFiles/samples/AutoLayers_1_basic.ldtk index 91c436898..95e03852a 100644 --- a/app/extraFiles/samples/AutoLayers_1_basic.ldtk +++ b/app/extraFiles/samples/AutoLayers_1_basic.ldtk @@ -5,12 +5,12 @@ "doc": "https://ldtk.io/json", "schema": "https://ldtk.io/files/JSON_SCHEMA.json", "appAuthor": "Sebastien 'deepnight' Benard", - "appVersion": "1.5.2", + "appVersion": "1.5.3", "url": "https://ldtk.io" }, "iid": "a22d35f0-7820-11ed-b6fd-213e885f30da", - "jsonVersion": "1.5.2", - "appBuildId": 473701, + "jsonVersion": "1.5.3", + "appBuildId": 473702, "nextUid": 112, "identifierStyle": "Capitalize", "toc": [], diff --git a/app/extraFiles/samples/AutoLayers_2_stamps.ldtk b/app/extraFiles/samples/AutoLayers_2_stamps.ldtk index 1d91c0e18..eab92af16 100644 --- a/app/extraFiles/samples/AutoLayers_2_stamps.ldtk +++ b/app/extraFiles/samples/AutoLayers_2_stamps.ldtk @@ -5,12 +5,12 @@ "doc": "https://ldtk.io/json", "schema": "https://ldtk.io/files/JSON_SCHEMA.json", "appAuthor": "Sebastien 'deepnight' Benard", - "appVersion": "1.5.2", + "appVersion": "1.5.3", "url": "https://ldtk.io" }, "iid": "a243f240-7820-11ed-b6fd-f550906acdc3", - "jsonVersion": "1.5.2", - "appBuildId": 473701, + "jsonVersion": "1.5.3", + "appBuildId": 473702, "nextUid": 40, "identifierStyle": "Capitalize", "toc": [], diff --git a/app/extraFiles/samples/AutoLayers_3_Mosaic.ldtk b/app/extraFiles/samples/AutoLayers_3_Mosaic.ldtk index 992901941..f91589ebd 100644 --- a/app/extraFiles/samples/AutoLayers_3_Mosaic.ldtk +++ b/app/extraFiles/samples/AutoLayers_3_Mosaic.ldtk @@ -5,12 +5,12 @@ "doc": "https://ldtk.io/json", "schema": "https://ldtk.io/files/JSON_SCHEMA.json", "appAuthor": "Sebastien 'deepnight' Benard", - "appVersion": "1.5.2", + "appVersion": "1.5.3", "url": "https://ldtk.io" }, "iid": "a2533480-7820-11ed-b6fd-e9108160ae94", - "jsonVersion": "1.5.2", - "appBuildId": 473701, + "jsonVersion": "1.5.3", + "appBuildId": 473702, "nextUid": 64, "identifierStyle": "Capitalize", "toc": [], diff --git a/app/extraFiles/samples/AutoLayers_4_Assistant.ldtk b/app/extraFiles/samples/AutoLayers_4_Assistant.ldtk index 60d015978..8f95af9cf 100644 --- a/app/extraFiles/samples/AutoLayers_4_Assistant.ldtk +++ b/app/extraFiles/samples/AutoLayers_4_Assistant.ldtk @@ -5,12 +5,12 @@ "doc": "https://ldtk.io/json", "schema": "https://ldtk.io/files/JSON_SCHEMA.json", "appAuthor": "Sebastien 'deepnight' Benard", - "appVersion": "1.5.2", + "appVersion": "1.5.3", "url": "https://ldtk.io" }, "iid": "a2533480-7820-11ed-b6fd-e9108160ae94", - "jsonVersion": "1.5.2", - "appBuildId": 473701, + "jsonVersion": "1.5.3", + "appBuildId": 473702, "nextUid": 652, "identifierStyle": "Capitalize", "toc": [], diff --git a/app/extraFiles/samples/AutoLayers_5_Advanced.ldtk b/app/extraFiles/samples/AutoLayers_5_Advanced.ldtk index 0074e9956..ea292c372 100644 --- a/app/extraFiles/samples/AutoLayers_5_Advanced.ldtk +++ b/app/extraFiles/samples/AutoLayers_5_Advanced.ldtk @@ -5,12 +5,12 @@ "doc": "https://ldtk.io/json", "schema": "https://ldtk.io/files/JSON_SCHEMA.json", "appAuthor": "Sebastien 'deepnight' Benard", - "appVersion": "1.5.2", + "appVersion": "1.5.3", "url": "https://ldtk.io" }, "iid": "a26276c0-7820-11ed-b6fd-ed05d55c9a75", - "jsonVersion": "1.5.2", - "appBuildId": 473701, + "jsonVersion": "1.5.3", + "appBuildId": 473702, "nextUid": 106, "identifierStyle": "Capitalize", "toc": [], diff --git a/app/extraFiles/samples/AutoLayers_6_OptionalRules.ldtk b/app/extraFiles/samples/AutoLayers_6_OptionalRules.ldtk index 0ca45a667..db77c02fe 100644 --- a/app/extraFiles/samples/AutoLayers_6_OptionalRules.ldtk +++ b/app/extraFiles/samples/AutoLayers_6_OptionalRules.ldtk @@ -5,12 +5,12 @@ "doc": "https://ldtk.io/json", "schema": "https://ldtk.io/files/JSON_SCHEMA.json", "appAuthor": "Sebastien 'deepnight' Benard", - "appVersion": "1.5.2", + "appVersion": "1.5.3", "url": "https://ldtk.io" }, "iid": "a27ed860-7820-11ed-b6fd-7fbe30dcfa27", - "jsonVersion": "1.5.2", - "appBuildId": 473701, + "jsonVersion": "1.5.3", + "appBuildId": 473702, "nextUid": 167, "identifierStyle": "Capitalize", "toc": [], diff --git a/app/extraFiles/samples/AutoLayers_7_Biomes.ldtk b/app/extraFiles/samples/AutoLayers_7_Biomes.ldtk index cdff17c7a..48d1fd6b7 100644 --- a/app/extraFiles/samples/AutoLayers_7_Biomes.ldtk +++ b/app/extraFiles/samples/AutoLayers_7_Biomes.ldtk @@ -5,12 +5,12 @@ "doc": "https://ldtk.io/json", "schema": "https://ldtk.io/files/JSON_SCHEMA.json", "appAuthor": "Sebastien 'deepnight' Benard", - "appVersion": "1.5.2", + "appVersion": "1.5.3", "url": "https://ldtk.io" }, "iid": "a27ed860-7820-11ed-b6fd-7fbe30dcfa27", - "jsonVersion": "1.5.2", - "appBuildId": 473701, + "jsonVersion": "1.5.3", + "appBuildId": 473702, "nextUid": 181, "identifierStyle": "Capitalize", "toc": [], diff --git a/app/extraFiles/samples/Entities.ldtk b/app/extraFiles/samples/Entities.ldtk index 87a8ffa49..93a620511 100644 --- a/app/extraFiles/samples/Entities.ldtk +++ b/app/extraFiles/samples/Entities.ldtk @@ -5,12 +5,12 @@ "doc": "https://ldtk.io/json", "schema": "https://ldtk.io/files/JSON_SCHEMA.json", "appAuthor": "Sebastien 'deepnight' Benard", - "appVersion": "1.5.2", + "appVersion": "1.5.3", "url": "https://ldtk.io" }, "iid": "a2a4fe00-7820-11ed-b6fd-9b53622ece75", - "jsonVersion": "1.5.2", - "appBuildId": 473701, + "jsonVersion": "1.5.3", + "appBuildId": 473702, "nextUid": 198, "identifierStyle": "Capitalize", "toc": [{ diff --git a/app/extraFiles/samples/SeparateLevelFiles.ldtk b/app/extraFiles/samples/SeparateLevelFiles.ldtk index 3a0962416..15384d128 100644 --- a/app/extraFiles/samples/SeparateLevelFiles.ldtk +++ b/app/extraFiles/samples/SeparateLevelFiles.ldtk @@ -5,12 +5,12 @@ "doc": "https://ldtk.io/json", "schema": "https://ldtk.io/files/JSON_SCHEMA.json", "appAuthor": "Sebastien 'deepnight' Benard", - "appVersion": "1.5.2", + "appVersion": "1.5.3", "url": "https://ldtk.io" }, "iid": "a2d9f0b0-7820-11ed-b6fd-010ddaafa733", - "jsonVersion": "1.5.2", - "appBuildId": 473701, + "jsonVersion": "1.5.3", + "appBuildId": 473702, "nextUid": 10, "identifierStyle": "Capitalize", "toc": [], diff --git a/app/extraFiles/samples/SeparateLevelFiles/World_Level_0.ldtkl b/app/extraFiles/samples/SeparateLevelFiles/World_Level_0.ldtkl index f4fd78228..aaa8c0aea 100644 --- a/app/extraFiles/samples/SeparateLevelFiles/World_Level_0.ldtkl +++ b/app/extraFiles/samples/SeparateLevelFiles/World_Level_0.ldtkl @@ -5,7 +5,7 @@ "doc": "https://ldtk.io/json", "schema": "https://ldtk.io/files/JSON_SCHEMA.json", "appAuthor": "Sebastien 'deepnight' Benard", - "appVersion": "1.5.2", + "appVersion": "1.5.3", "url": "https://ldtk.io" }, "identifier": "World_Level_0", diff --git a/app/extraFiles/samples/SeparateLevelFiles/World_Level_1.ldtkl b/app/extraFiles/samples/SeparateLevelFiles/World_Level_1.ldtkl index e359e25cb..4985ab0bf 100644 --- a/app/extraFiles/samples/SeparateLevelFiles/World_Level_1.ldtkl +++ b/app/extraFiles/samples/SeparateLevelFiles/World_Level_1.ldtkl @@ -5,7 +5,7 @@ "doc": "https://ldtk.io/json", "schema": "https://ldtk.io/files/JSON_SCHEMA.json", "appAuthor": "Sebastien 'deepnight' Benard", - "appVersion": "1.5.2", + "appVersion": "1.5.3", "url": "https://ldtk.io" }, "identifier": "World_Level_1", diff --git a/app/extraFiles/samples/SeparateLevelFiles/World_Level_2.ldtkl b/app/extraFiles/samples/SeparateLevelFiles/World_Level_2.ldtkl index 40c7f825a..0f7e2a91f 100644 --- a/app/extraFiles/samples/SeparateLevelFiles/World_Level_2.ldtkl +++ b/app/extraFiles/samples/SeparateLevelFiles/World_Level_2.ldtkl @@ -5,7 +5,7 @@ "doc": "https://ldtk.io/json", "schema": "https://ldtk.io/files/JSON_SCHEMA.json", "appAuthor": "Sebastien 'deepnight' Benard", - "appVersion": "1.5.2", + "appVersion": "1.5.3", "url": "https://ldtk.io" }, "identifier": "World_Level_2", diff --git a/app/extraFiles/samples/Test_file_for_API_showing_all_features.ldtk b/app/extraFiles/samples/Test_file_for_API_showing_all_features.ldtk index 5d4994e7f..f393c26f2 100644 --- a/app/extraFiles/samples/Test_file_for_API_showing_all_features.ldtk +++ b/app/extraFiles/samples/Test_file_for_API_showing_all_features.ldtk @@ -5,12 +5,12 @@ "doc": "https://ldtk.io/json", "schema": "https://ldtk.io/files/JSON_SCHEMA.json", "appAuthor": "Sebastien 'deepnight' Benard", - "appVersion": "1.5.2", + "appVersion": "1.5.3", "url": "https://ldtk.io" }, "iid": "a2e6e900-7820-11ed-b6fd-61d0df8fd468", - "jsonVersion": "1.5.2", - "appBuildId": 473701, + "jsonVersion": "1.5.3", + "appBuildId": 473702, "nextUid": 50, "identifierStyle": "Capitalize", "toc": [{ diff --git a/app/extraFiles/samples/Typical_2D_platformer_example.ldtk b/app/extraFiles/samples/Typical_2D_platformer_example.ldtk index 2033504c0..2529e6350 100644 --- a/app/extraFiles/samples/Typical_2D_platformer_example.ldtk +++ b/app/extraFiles/samples/Typical_2D_platformer_example.ldtk @@ -5,12 +5,12 @@ "doc": "https://ldtk.io/json", "schema": "https://ldtk.io/files/JSON_SCHEMA.json", "appAuthor": "Sebastien 'deepnight' Benard", - "appVersion": "1.5.2", + "appVersion": "1.5.3", "url": "https://ldtk.io" }, "iid": "a302fc80-7820-11ed-b6fd-0944dd561895", - "jsonVersion": "1.5.2", - "appBuildId": 473701, + "jsonVersion": "1.5.3", + "appBuildId": 473702, "nextUid": 107, "identifierStyle": "Capitalize", "toc": [], diff --git a/app/extraFiles/samples/Typical_TopDown_example.ldtk b/app/extraFiles/samples/Typical_TopDown_example.ldtk index 9f41ecc6b..5b5b4df73 100644 --- a/app/extraFiles/samples/Typical_TopDown_example.ldtk +++ b/app/extraFiles/samples/Typical_TopDown_example.ldtk @@ -5,12 +5,12 @@ "doc": "https://ldtk.io/json", "schema": "https://ldtk.io/files/JSON_SCHEMA.json", "appAuthor": "Sebastien 'deepnight' Benard", - "appVersion": "1.5.2", + "appVersion": "1.5.3", "url": "https://ldtk.io" }, "iid": "a3386460-7820-11ed-b6fd-157a63b4d02d", - "jsonVersion": "1.5.2", - "appBuildId": 473701, + "jsonVersion": "1.5.3", + "appBuildId": 473702, "nextUid": 170, "identifierStyle": "Capitalize", "toc": [{ diff --git a/app/extraFiles/samples/WorldMap_Free_layout.ldtk b/app/extraFiles/samples/WorldMap_Free_layout.ldtk index 81a4b8bfd..5668c7463 100644 --- a/app/extraFiles/samples/WorldMap_Free_layout.ldtk +++ b/app/extraFiles/samples/WorldMap_Free_layout.ldtk @@ -5,12 +5,12 @@ "doc": "https://ldtk.io/json", "schema": "https://ldtk.io/files/JSON_SCHEMA.json", "appAuthor": "Sebastien 'deepnight' Benard", - "appVersion": "1.5.2", + "appVersion": "1.5.3", "url": "https://ldtk.io" }, "iid": "a3619740-7820-11ed-b6fd-4b64aa0352a1", - "jsonVersion": "1.5.2", - "appBuildId": 473701, + "jsonVersion": "1.5.3", + "appBuildId": 473702, "nextUid": 125, "identifierStyle": "Capitalize", "toc": [], diff --git a/app/extraFiles/samples/WorldMap_GridVania_layout.ldtk b/app/extraFiles/samples/WorldMap_GridVania_layout.ldtk index ab7a2180a..960d48319 100644 --- a/app/extraFiles/samples/WorldMap_GridVania_layout.ldtk +++ b/app/extraFiles/samples/WorldMap_GridVania_layout.ldtk @@ -5,12 +5,12 @@ "doc": "https://ldtk.io/json", "schema": "https://ldtk.io/files/JSON_SCHEMA.json", "appAuthor": "Sebastien 'deepnight' Benard", - "appVersion": "1.5.2", + "appVersion": "1.5.3", "url": "https://ldtk.io" }, "iid": "a39fb1b0-7820-11ed-b6fd-87f9a01f3d6b", - "jsonVersion": "1.5.2", - "appBuildId": 473701, + "jsonVersion": "1.5.3", + "appBuildId": 473702, "nextUid": 152, "identifierStyle": "Capitalize", "toc": [{ @@ -2814,7 +2814,13 @@ "entityInstances": [] } ], - "__neighbours": [ { "levelIid": "a36f8be0-66b0-11ec-9cd7-a9c628ac47cf", "dir": ">" }, { "levelIid": "a36811d0-66b0-11ec-9cd7-4367627fb745", "dir": "s" }, { "levelIid": "a36a34b0-66b0-11ec-9cd7-09ebc042e238", "dir": "w" }, { "levelIid": "a3727210-66b0-11ec-9cd7-aba0184f5034", "dir": "e" } ] + "__neighbours": [ + { "levelIid": "a36f8be0-66b0-11ec-9cd7-a9c628ac47cf", "dir": ">" }, + { "levelIid": "a36811d0-66b0-11ec-9cd7-4367627fb745", "dir": "s" }, + { "levelIid": "a36a34b0-66b0-11ec-9cd7-09ebc042e238", "dir": "w" }, + { "levelIid": "a3727210-66b0-11ec-9cd7-aba0184f5034", "dir": "e" }, + { "levelIid": "07caf540-66b0-11ec-a595-a55a7e13679d", "dir": "se" } + ] }, { "identifier": "Cross_roads", @@ -4162,6 +4168,7 @@ { "levelIid": "a367c3b0-66b0-11ec-9cd7-91690c910c97", "dir": "n" }, { "levelIid": "a36a34b0-66b0-11ec-9cd7-09ebc042e238", "dir": "w" }, { "levelIid": "a36fda00-66b0-11ec-9cd7-ffa8f8d0b484", "dir": "e" }, + { "levelIid": "a3727210-66b0-11ec-9cd7-aba0184f5034", "dir": "ne" }, { "levelIid": "07caf540-66b0-11ec-a595-a55a7e13679d", "dir": "e" } ] }, @@ -9428,7 +9435,7 @@ "entityInstances": [] } ], - "__neighbours": [ { "levelIid": "9312a0d0-66b0-11ec-a595-a934707bd447", "dir": ">" }, { "levelIid": "a36c5790-66b0-11ec-9cd7-0d08d7991930", "dir": "s" }, { "levelIid": "a36fda00-66b0-11ec-9cd7-ffa8f8d0b484", "dir": "n" } ] + "__neighbours": [ { "levelIid": "9312a0d0-66b0-11ec-a595-a934707bd447", "dir": ">" }, { "levelIid": "a36c5790-66b0-11ec-9cd7-0d08d7991930", "dir": "s" }, { "levelIid": "a36fda00-66b0-11ec-9cd7-ffa8f8d0b484", "dir": "n" }, { "levelIid": "a3707640-66b0-11ec-9cd7-59efc6b24075", "dir": "ne" } ] }, { "identifier": "Sewers_trash", @@ -14469,7 +14476,13 @@ "entityInstances": [] } ], - "__neighbours": [ { "levelIid": "a371aec0-66b0-11ec-9cd7-6f9e87cc2465", "dir": "e" }, { "levelIid": "a3727210-66b0-11ec-9cd7-aba0184f5034", "dir": "w" }, { "levelIid": "a3730e50-66b0-11ec-9cd7-65c84b0f9baa", "dir": "s" }, { "levelIid": "a37690c0-66b0-11ec-9cd7-5f87e3c093eb", "dir": "s" } ] + "__neighbours": [ + { "levelIid": "a370eb70-66b0-11ec-9cd7-ef1d13410308", "dir": "sw" }, + { "levelIid": "a371aec0-66b0-11ec-9cd7-6f9e87cc2465", "dir": "e" }, + { "levelIid": "a3727210-66b0-11ec-9cd7-aba0184f5034", "dir": "w" }, + { "levelIid": "a3730e50-66b0-11ec-9cd7-65c84b0f9baa", "dir": "s" }, + { "levelIid": "a37690c0-66b0-11ec-9cd7-5f87e3c093eb", "dir": "s" } + ] }, { "identifier": "Shop", @@ -19558,6 +19571,7 @@ ], "__neighbours": [ { "levelIid": "9312a0d0-66b0-11ec-a595-a934707bd447", "dir": ">" }, + { "levelIid": "a36b6d30-66b0-11ec-9cd7-8145d2a69a56", "dir": "sw" }, { "levelIid": "a36d41f0-66b0-11ec-9cd7-e962574817d4", "dir": "e" }, { "levelIid": "a36fda00-66b0-11ec-9cd7-ffa8f8d0b484", "dir": "w" }, { "levelIid": "a370eb70-66b0-11ec-9cd7-ef1d13410308", "dir": "n" }, @@ -20343,6 +20357,7 @@ ], "__neighbours": [ { "levelIid": "a36f8be0-66b0-11ec-9cd7-a9c628ac47cf", "dir": ">" }, + { "levelIid": "a36e7a70-66b0-11ec-9cd7-67ffb406aba0", "dir": "ne" }, { "levelIid": "a36fda00-66b0-11ec-9cd7-ffa8f8d0b484", "dir": "w" }, { "levelIid": "a3707640-66b0-11ec-9cd7-59efc6b24075", "dir": "s" }, { "levelIid": "a3727210-66b0-11ec-9cd7-aba0184f5034", "dir": "n" }, @@ -23091,8 +23106,10 @@ "__neighbours": [ { "levelIid": "a36f8be0-66b0-11ec-9cd7-a9c628ac47cf", "dir": ">" }, { "levelIid": "a367c3b0-66b0-11ec-9cd7-91690c910c97", "dir": "w" }, + { "levelIid": "a36811d0-66b0-11ec-9cd7-4367627fb745", "dir": "sw" }, { "levelIid": "a36e7a70-66b0-11ec-9cd7-67ffb406aba0", "dir": "e" }, { "levelIid": "a370eb70-66b0-11ec-9cd7-ef1d13410308", "dir": "s" }, + { "levelIid": "a3730e50-66b0-11ec-9cd7-65c84b0f9baa", "dir": "se" }, { "levelIid": "07caf540-66b0-11ec-a595-a55a7e13679d", "dir": "s" } ] }, @@ -23837,7 +23854,13 @@ "entityInstances": [] } ], - "__neighbours": [ { "levelIid": "a36e7a70-66b0-11ec-9cd7-67ffb406aba0", "dir": "n" }, { "levelIid": "a3707640-66b0-11ec-9cd7-59efc6b24075", "dir": "s" }, { "levelIid": "a370eb70-66b0-11ec-9cd7-ef1d13410308", "dir": "w" }, { "levelIid": "a37690c0-66b0-11ec-9cd7-5f87e3c093eb", "dir": "e" } ] + "__neighbours": [ + { "levelIid": "a36e7a70-66b0-11ec-9cd7-67ffb406aba0", "dir": "n" }, + { "levelIid": "a3707640-66b0-11ec-9cd7-59efc6b24075", "dir": "s" }, + { "levelIid": "a370eb70-66b0-11ec-9cd7-ef1d13410308", "dir": "w" }, + { "levelIid": "a3727210-66b0-11ec-9cd7-aba0184f5034", "dir": "nw" }, + { "levelIid": "a37690c0-66b0-11ec-9cd7-5f87e3c093eb", "dir": "e" } + ] }, { "identifier": "Flooded_rooms", @@ -30081,6 +30104,7 @@ ], "__neighbours": [ { "levelIid": "a36f8be0-66b0-11ec-9cd7-a9c628ac47cf", "dir": ">" }, + { "levelIid": "a367c3b0-66b0-11ec-9cd7-91690c910c97", "dir": "nw" }, { "levelIid": "a36811d0-66b0-11ec-9cd7-4367627fb745", "dir": "w" }, { "levelIid": "a36fda00-66b0-11ec-9cd7-ffa8f8d0b484", "dir": "s" }, { "levelIid": "a370eb70-66b0-11ec-9cd7-ef1d13410308", "dir": "e" }, From 60062d6610e82a1e56b245b5e943d909e3a13494 Mon Sep 17 00:00:00 2001 From: Sebastien Benard Date: Mon, 15 Jan 2024 15:26:26 +0100 Subject: [PATCH 20/21] Updated empty map --- tests/_empty.ldtk | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/_empty.ldtk b/tests/_empty.ldtk index 7fb70ceb9..4f0a16df0 100644 --- a/tests/_empty.ldtk +++ b/tests/_empty.ldtk @@ -5,12 +5,12 @@ "doc": "https://ldtk.io/json", "schema": "https://ldtk.io/files/JSON_SCHEMA.json", "appAuthor": "Sebastien 'deepnight' Benard", - "appVersion": "1.5.0", + "appVersion": "1.5.3", "url": "https://ldtk.io" }, - "iid": "1fae6730-8990-11ee-8d4a-6ded12b73511", - "jsonVersion": "1.5.0", - "appBuildId": 473297, + "iid": "07dbcce0-b0a0-11ee-8dc4-015831f656f8", + "jsonVersion": "1.5.3", + "appBuildId": 473702, "nextUid": 1, "identifierStyle": "Capitalize", "toc": [], @@ -44,7 +44,7 @@ "levels": [ { "identifier": "Level_0", - "iid": "1fae8e40-8990-11ee-8d4a-1b3a81b0d557", + "iid": "07dbf3f0-b0a0-11ee-8dc4-a5486c7b24b3", "uid": 0, "worldX": 0, "worldY": 0, @@ -67,5 +67,5 @@ } ], "worlds": [], - "dummyWorldIid": "1fae6731-8990-11ee-8d4a-e35245775fd3" + "dummyWorldIid": "07dbcce1-b0a0-11ee-8dc4-a5321c9ba8e2" } \ No newline at end of file From fcdd401453f525484a9992435e5c2b404e98deff Mon Sep 17 00:00:00 2001 From: Sebastien Benard Date: Mon, 15 Jan 2024 16:07:56 +0100 Subject: [PATCH 21/21] Quicktypes --- docs/quicktype/LdtkJson.cpp | 9 +++++---- docs/quicktype/LdtkJson.cs | 9 +++++---- docs/quicktype/LdtkJson.go | 9 +++++---- docs/quicktype/LdtkJson.py | 9 +++++---- docs/quicktype/LdtkJson.rs | 9 +++++---- 5 files changed, 25 insertions(+), 20 deletions(-) diff --git a/docs/quicktype/LdtkJson.cpp b/docs/quicktype/LdtkJson.cpp index dba3ef1dd..44776a052 100644 --- a/docs/quicktype/LdtkJson.cpp +++ b/docs/quicktype/LdtkJson.cpp @@ -2414,10 +2414,11 @@ namespace quicktype { public: /** - * A single lowercase character tipping on the level location (`n`orth, `s`outh, `w`est, - * `e`ast).
Since 1.4.0, this character value can also be `<` (neighbour depth is - * lower), `>` (neighbour depth is greater) or `o` (levels overlap and share the same world - * depth). + * A lowercase string tipping on the level location (`n`orth, `s`outh, `w`est, + * `e`ast).
Since 1.4.0, this value can also be `<` (neighbour depth is lower), `>` + * (neighbour depth is greater) or `o` (levels overlap and share the same world + * depth).
Since 1.5.3, this value can also be `nw`,`ne`,`sw` or `se` for levels only + * touching corners. */ const std::string & get_dir() const { return dir; } std::string & get_mutable_dir() { return dir; } diff --git a/docs/quicktype/LdtkJson.cs b/docs/quicktype/LdtkJson.cs index 4df3fcb66..b749d1342 100644 --- a/docs/quicktype/LdtkJson.cs +++ b/docs/quicktype/LdtkJson.cs @@ -2182,10 +2182,11 @@ public partial class LevelBackgroundPosition public partial class NeighbourLevel { /// - /// A single lowercase character tipping on the level location (`n`orth, `s`outh, `w`est, - /// `e`ast).
Since 1.4.0, this character value can also be `<` (neighbour depth is - /// lower), `>` (neighbour depth is greater) or `o` (levels overlap and share the same world - /// depth). + /// A lowercase string tipping on the level location (`n`orth, `s`outh, `w`est, + /// `e`ast).
Since 1.4.0, this value can also be `<` (neighbour depth is lower), `>` + /// (neighbour depth is greater) or `o` (levels overlap and share the same world + /// depth).
Since 1.5.3, this value can also be `nw`,`ne`,`sw` or `se` for levels only + /// touching corners. ///
[JsonProperty("dir")] public string Dir { get; set; } diff --git a/docs/quicktype/LdtkJson.go b/docs/quicktype/LdtkJson.go index 932af9075..5d83a1658 100644 --- a/docs/quicktype/LdtkJson.go +++ b/docs/quicktype/LdtkJson.go @@ -905,10 +905,11 @@ type LevelBackgroundPosition struct { // Nearby level info type NeighbourLevel struct { - // A single lowercase character tipping on the level location (`n`orth, `s`outh, `w`est, - // `e`ast).
Since 1.4.0, this character value can also be `<` (neighbour depth is - // lower), `>` (neighbour depth is greater) or `o` (levels overlap and share the same world - // depth). + // A lowercase string tipping on the level location (`n`orth, `s`outh, `w`est, + // `e`ast).
Since 1.4.0, this value can also be `<` (neighbour depth is lower), `>` + // (neighbour depth is greater) or `o` (levels overlap and share the same world + // depth).
Since 1.5.3, this value can also be `nw`,`ne`,`sw` or `se` for levels only + // touching corners. Dir string `json:"dir"` // Neighbour Instance Identifier LevelIid string `json:"levelIid"` diff --git a/docs/quicktype/LdtkJson.py b/docs/quicktype/LdtkJson.py index a214b43a3..cb758f517 100644 --- a/docs/quicktype/LdtkJson.py +++ b/docs/quicktype/LdtkJson.py @@ -2025,10 +2025,11 @@ class BgPos(Enum): class NeighbourLevel: """Nearby level info""" dir: str - """A single lowercase character tipping on the level location (`n`orth, `s`outh, `w`est, - `e`ast).
Since 1.4.0, this character value can also be `<` (neighbour depth is - lower), `>` (neighbour depth is greater) or `o` (levels overlap and share the same world - depth). + """A lowercase string tipping on the level location (`n`orth, `s`outh, `w`est, + `e`ast).
Since 1.4.0, this value can also be `<` (neighbour depth is lower), `>` + (neighbour depth is greater) or `o` (levels overlap and share the same world + depth).
Since 1.5.3, this value can also be `nw`,`ne`,`sw` or `se` for levels only + touching corners. """ level_iid: str """Neighbour Instance Identifier""" diff --git a/docs/quicktype/LdtkJson.rs b/docs/quicktype/LdtkJson.rs index b2edf4042..9732c8309 100644 --- a/docs/quicktype/LdtkJson.rs +++ b/docs/quicktype/LdtkJson.rs @@ -1590,10 +1590,11 @@ pub enum BgPos { #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct NeighbourLevel { - /// A single lowercase character tipping on the level location (`n`orth, `s`outh, `w`est, - /// `e`ast).
Since 1.4.0, this character value can also be `<` (neighbour depth is - /// lower), `>` (neighbour depth is greater) or `o` (levels overlap and share the same world - /// depth). + /// A lowercase string tipping on the level location (`n`orth, `s`outh, `w`est, + /// `e`ast).
Since 1.4.0, this value can also be `<` (neighbour depth is lower), `>` + /// (neighbour depth is greater) or `o` (levels overlap and share the same world + /// depth).
Since 1.5.3, this value can also be `nw`,`ne`,`sw` or `se` for levels only + /// touching corners. pub dir: String, /// Neighbour Instance Identifier