diff --git a/app/extraFiles/samples/AutoLayers_1_basic.ldtk b/app/extraFiles/samples/AutoLayers_1_basic.ldtk index d2439bcec..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": 473607, + "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 886346c74..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": 473607, + "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 3752e4bd2..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": 473607, + "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 ca330b06d..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": 473607, + "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 eb359f054..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": 473607, + "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 d1a7f35e9..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": 473607, + "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 3b489453c..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": 473607, + "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 cd38149ad..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": 473607, + "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 b007343ad..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": 473607, + "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 5264a8069..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": 473607, + "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 8df3a03f8..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": 473607, + "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 fb79a291f..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": 473607, + "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 3c2c23921..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": 473607, + "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 3eb080362..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": 473607, + "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" }, 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", diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 405eeb125..9106be7ab 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,3 +1,12 @@ +# 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 +- 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 - Fixed a bug with auto-layers on level edges. 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:
-`__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:
+`__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:
`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/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 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 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 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 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/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/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; } 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"; diff --git a/src/electron.renderer/data/Project.hx b/src/electron.renderer/data/Project.hx index d49a9236c..ac2c785fe 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) ) @@ -920,6 +920,39 @@ class Project { } + 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) ) { @@ -947,6 +980,7 @@ class Project { tex: texture, }); } + return imageCache.get(relPath); } catch( e:Dynamic ) { @@ -956,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() ) ); @@ -1188,6 +1255,7 @@ class Project { if( id==null ) return null; + id = Std.string(id); id = StringTools.trim(id); // Replace any invalid char with "_" 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/def/TilesetDef.hx b/src/electron.renderer/data/def/TilesetDef.hx index 821bbc230..f62bdbaef 100644 --- a/src/electron.renderer/data/def/TilesetDef.hx +++ b/src/electron.renderer/data/def/TilesetDef.hx @@ -67,6 +67,15 @@ class TilesetDef { 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) function unsafeRelPathChange(newRelPath:Null) { // should ONLY be used in specific circonstances relPath = newRelPath; @@ -889,9 +898,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 = 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'; new J(img); 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)); } 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; } 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(); } } 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); + } + }); } 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