diff --git a/README.md b/README.md index 2dda13db..ebd12ab7 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,7 @@ for additional level-loading options. ### Compatibility | bevy | bevy_ecs_tilemap | LDtk | bevy_ecs_ldtk | | --- | --- | --- | --- | -| 0.11 | 0.11 | 1.3.3 | main | +| 0.11 | 0.11 | 1.4.1 | main | | 0.11 | 0.11 | 1.3.3 | 0.8 | | 0.10 | 0.10 | 1.1 | 0.7 | | 0.10 | 0.10 | 1.1 | 0.6 | diff --git a/assets/Typical_2D_platformer_example.ldtk b/assets/Typical_2D_platformer_example.ldtk index 9fa9f031..841500f6 100755 --- a/assets/Typical_2D_platformer_example.ldtk +++ b/assets/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.3.3", + "appVersion": "1.4.1", "url": "https://ldtk.io" }, "iid": "39227760-c640-11ed-bac6-0b5f56187457", - "jsonVersion": "1.3.3", - "appBuildId": 468555, + "jsonVersion": "1.4.1", + "appBuildId": 471698, "nextUid": 107, "identifierStyle": "Capitalize", "toc": [], @@ -22,6 +22,8 @@ "defaultPivotX": 0.5, "defaultPivotY": 1, "defaultGridSize": 16, + "defaultEntityWidth": 16, + "defaultEntityHeight": 16, "bgColor": "#806262", "defaultLevelBgColor": "#50506A", "minifyJson": false, @@ -63,6 +65,7 @@ "requiredTags": [], "excludedTags": [], "intGridValues": [], + "intGridValuesGroups": [], "autoRuleGroups": [], "autoSourceLayerDefUid": null, "tilesetDefUid": null, @@ -93,7 +96,8 @@ "requiredTags": [], "excludedTags": [], "intGridValues": [], - "autoRuleGroups": [{ "uid": 98, "name": "shadows", "active": true, "isOptional": false, "rules": [ + "intGridValuesGroups": [], + "autoRuleGroups": [{ "uid": 98, "name": "shadows", "color": null, "icon": null, "active": true, "isOptional": false, "rules": [ { "uid": 100, "active": true, @@ -186,12 +190,13 @@ "requiredTags": [], "excludedTags": [], "intGridValues": [ - { "value": 1, "identifier": "dirt", "color": "#93573E", "tile": null }, - { "value": 2, "identifier": "ladder", "color": "#BBAA96", "tile": null }, - { "value": 3, "identifier": "stone", "color": "#BD9261", "tile": null } + { "value": 1, "identifier": "dirt", "color": "#93573E", "tile": null, "groupUid": 0 }, + { "value": 2, "identifier": "ladder", "color": "#BBAA96", "tile": null, "groupUid": 0 }, + { "value": 3, "identifier": "stone", "color": "#BD9261", "tile": null, "groupUid": 0 } ], + "intGridValuesGroups": [], "autoRuleGroups": [ - { "uid": 101, "name": "Inner wall fog", "active": true, "isOptional": false, "rules": [ + { "uid": 101, "name": "Inner wall fog", "color": null, "icon": null, "active": true, "isOptional": false, "rules": [ { "uid": 102, "active": true, @@ -224,7 +229,7 @@ "perlinOctaves": 2 } ], "usesWizard": false }, - { "uid": 40, "name": "ladders", "active": true, "isOptional": false, "rules": [ + { "uid": 40, "name": "ladders", "color": null, "icon": null, "active": true, "isOptional": false, "rules": [ { "uid": 41, "active": true, @@ -257,7 +262,7 @@ "perlinOctaves": 2 } ], "usesWizard": false }, - { "uid": 43, "name": "thin platforms", "active": true, "isOptional": false, "rules": [ + { "uid": 43, "name": "thin platforms", "color": null, "icon": null, "active": true, "isOptional": false, "rules": [ { "uid": 85, "active": true, @@ -352,7 +357,7 @@ "perlinOctaves": 2 } ], "usesWizard": false }, - { "uid": 20, "name": "Vegetation", "active": true, "isOptional": false, "rules": [ + { "uid": 20, "name": "Vegetation", "color": null, "icon": null, "active": true, "isOptional": false, "rules": [ { "uid": 35, "active": true, @@ -509,7 +514,7 @@ "perlinOctaves": 2 } ], "usesWizard": false }, - { "uid": 57, "name": "Stone walls", "active": true, "isOptional": false, "rules": [ + { "uid": 57, "name": "Stone walls", "color": null, "icon": null, "active": true, "isOptional": false, "rules": [ { "uid": 69, "active": true, @@ -697,7 +702,7 @@ "perlinOctaves": 2 } ], "usesWizard": false }, - { "uid": 11, "name": "Dirt walls", "active": true, "isOptional": false, "rules": [ + { "uid": 11, "name": "Dirt walls", "color": null, "icon": null, "active": true, "isOptional": false, "rules": [ { "uid": 36, "active": true, @@ -1101,8 +1106,9 @@ "requiredTags": [], "excludedTags": [], "intGridValues": [], + "intGridValuesGroups": [], "autoRuleGroups": [ - { "uid": 82, "name": "Architecture props", "active": true, "isOptional": false, "rules": [ + { "uid": 82, "name": "Architecture props", "color": null, "icon": null, "active": true, "isOptional": false, "rules": [ { "uid": 72, "active": true, @@ -1135,7 +1141,7 @@ "perlinOctaves": 2 } ], "usesWizard": false }, - { "uid": 76, "name": "Bg vegetation", "active": true, "isOptional": false, "rules": [ + { "uid": 76, "name": "Bg vegetation", "color": null, "icon": null, "active": true, "isOptional": false, "rules": [ { "uid": 80, "active": true, @@ -1261,7 +1267,7 @@ "perlinOctaves": 2 } ], "usesWizard": false }, - { "uid": 25, "name": "Bg walls", "active": true, "isOptional": false, "rules": [ + { "uid": 25, "name": "Bg walls", "color": null, "icon": null, "active": true, "isOptional": false, "rules": [ { "uid": 77, "active": true, @@ -1450,6 +1456,7 @@ "tilesetId": 105, "tileRenderMode": "FitInside", "tileRect": { "tilesetUid": 105, "x": 96, "y": 2720, "w": 32, "h": 32 }, + "uiTileRect": null, "nineSliceBorders": [], "maxCount": 1, "limitScope": "PerWorld", @@ -1471,6 +1478,7 @@ "editorDisplayScale": 1, "editorDisplayPos": "Above", "editorLinkStyle": "StraightArrow", + "editorDisplayColor": null, "editorAlwaysShow": false, "editorShowInWorld": true, "editorCutLongValues": true, @@ -1518,6 +1526,7 @@ "tilesetId": 105, "tileRenderMode": "FitInside", "tileRect": { "tilesetUid": 105, "x": 64, "y": 192, "w": 32, "h": 32 }, + "uiTileRect": null, "nineSliceBorders": [], "maxCount": 0, "limitScope": "PerLevel", @@ -1539,6 +1548,7 @@ "editorDisplayScale": 1, "editorDisplayPos": "Above", "editorLinkStyle": "StraightArrow", + "editorDisplayColor": null, "editorAlwaysShow": false, "editorShowInWorld": true, "editorCutLongValues": true, @@ -1586,6 +1596,7 @@ "tilesetId": 105, "tileRenderMode": "Cover", "tileRect": { "tilesetUid": 105, "x": 160, "y": 2720, "w": 32, "h": 32 }, + "uiTileRect": null, "nineSliceBorders": [], "maxCount": 0, "limitScope": "PerLevel", @@ -1607,6 +1618,7 @@ "editorDisplayScale": 1, "editorDisplayPos": "Above", "editorLinkStyle": "StraightArrow", + "editorDisplayColor": null, "editorAlwaysShow": false, "editorShowInWorld": true, "editorCutLongValues": true, @@ -1641,6 +1653,7 @@ "editorDisplayScale": 1, "editorDisplayPos": "Above", "editorLinkStyle": "StraightArrow", + "editorDisplayColor": null, "editorAlwaysShow": false, "editorShowInWorld": true, "editorCutLongValues": true, @@ -1688,6 +1701,7 @@ "tilesetId": null, "tileRenderMode": "Stretch", "tileRect": null, + "uiTileRect": null, "nineSliceBorders": [], "maxCount": 0, "limitScope": "PerLevel", @@ -1709,6 +1723,7 @@ "editorDisplayScale": 1, "editorDisplayPos": "Above", "editorLinkStyle": "StraightArrow", + "editorDisplayColor": null, "editorAlwaysShow": false, "editorShowInWorld": true, "editorCutLongValues": true, @@ -1756,6 +1771,7 @@ "tilesetId": 105, "tileRenderMode": "FitInside", "tileRect": { "tilesetUid": 105, "x": 128, "y": 320, "w": 96, "h": 32 }, + "uiTileRect": null, "nineSliceBorders": [], "maxCount": 0, "limitScope": "PerLevel", @@ -1828,12 +1844,12 @@ } } ], "enums": [{ "identifier": "Item", "uid": 49, "values": [ - { "id": "Knife", "tileRect": { "tilesetUid": 105, "x": 96, "y": 32, "w": 32, "h": 32 }, "tileId": -1, "color": 12363427, "__tileSrcRect": [96,32,32,32] }, - { "id": "Healing_Plant", "tileRect": { "tilesetUid": 105, "x": 320, "y": 416, "w": 32, "h": 32 }, "tileId": -1, "color": 8563009, "__tileSrcRect": [320,416,32,32] }, - { "id": "Meat", "tileRect": { "tilesetUid": 105, "x": 32, "y": 224, "w": 32, "h": 32 }, "tileId": -1, "color": 13201487, "__tileSrcRect": [32,224,32,32] }, - { "id": "Boots", "tileRect": { "tilesetUid": 105, "x": 64, "y": 128, "w": 32, "h": 32 }, "tileId": -1, "color": 8876139, "__tileSrcRect": [64,128,32,32] }, - { "id": "Water", "tileRect": { "tilesetUid": 105, "x": 32, "y": 160, "w": 32, "h": 32 }, "tileId": -1, "color": 7901620, "__tileSrcRect": [32,160,32,32] }, - { "id": "Gem", "tileRect": { "tilesetUid": 105, "x": 352, "y": 2944, "w": 32, "h": 32 }, "tileId": -1, "color": 15035447, "__tileSrcRect": [352,2944,32,32] } + { "id": "Knife", "tileRect": { "tilesetUid": 105, "x": 96, "y": 32, "w": 32, "h": 32 }, "color": 12363427 }, + { "id": "Healing_Plant", "tileRect": { "tilesetUid": 105, "x": 320, "y": 416, "w": 32, "h": 32 }, "color": 8563009 }, + { "id": "Meat", "tileRect": { "tilesetUid": 105, "x": 32, "y": 224, "w": 32, "h": 32 }, "color": 13201487 }, + { "id": "Boots", "tileRect": { "tilesetUid": 105, "x": 64, "y": 128, "w": 32, "h": 32 }, "color": 8876139 }, + { "id": "Water", "tileRect": { "tilesetUid": 105, "x": 32, "y": 160, "w": 32, "h": 32 }, "color": 7901620 }, + { "id": "Gem", "tileRect": { "tilesetUid": 105, "x": 352, "y": 2944, "w": 32, "h": 32 }, "color": 15035447 } ], "iconTilesetUid": 105, "externalRelPath": null, "externalFileChecksum": null, "tags": [] }], "externalEnums": [], "levelFields": [] }, "levels": [ { @@ -1888,6 +1904,8 @@ "__tags": [], "__tile": { "tilesetUid": 105, "x": 96, "y": 2720, "w": 32, "h": 32 }, "__smartColor": "#A7FF24", + "__worldX": 184, + "__worldY": 208, "iid": "a315d323-66b0-11ec-9cd7-8ddce09157bc", "width": 24, "height": 24, @@ -1908,6 +1926,8 @@ "__tags": [], "__tile": { "tilesetUid": 105, "x": 64, "y": 192, "w": 32, "h": 32 }, "__smartColor": "#6ADDEC", + "__worldX": 504, + "__worldY": 288, "iid": "a315d324-66b0-11ec-9cd7-0d0128b37734", "width": 32, "height": 24, @@ -1931,6 +1951,8 @@ "__tags": [], "__tile": { "tilesetUid": 105, "x": 160, "y": 2720, "w": 32, "h": 32 }, "__smartColor": "#FF0000", + "__worldX": 328, + "__worldY": 160, "iid": "a315d325-66b0-11ec-9cd7-f9e1c56d6020", "width": 20, "height": 20, @@ -1954,6 +1976,8 @@ "__tags": [], "__tile": { "tilesetUid": 105, "x": 160, "y": 2720, "w": 32, "h": 32 }, "__smartColor": "#FF0000", + "__worldX": 264, + "__worldY": 288, "iid": "a315d326-66b0-11ec-9cd7-cf3ea20f8dff", "width": 20, "height": 20, @@ -1974,6 +1998,8 @@ "__tags": [], "__tile": null, "__smartColor": "#B7A87A", + "__worldX": 440, + "__worldY": 288, "iid": "a315d327-66b0-11ec-9cd7-35c28e76b04b", "width": 8, "height": 32, @@ -1988,6 +2014,8 @@ "__tags": [], "__tile": null, "__smartColor": "#B7A87A", + "__worldX": 568, + "__worldY": 128, "iid": "a315d328-66b0-11ec-9cd7-c30477cb5ff1", "width": 8, "height": 48, @@ -2002,6 +2030,8 @@ "__tags": [], "__tile": { "tilesetUid": 105, "x": 128, "y": 320, "w": 96, "h": 32 }, "__smartColor": "#BE4A2F", + "__worldX": 680, + "__worldY": 288, "iid": "6f7e6760-9f30-11ed-b47d-6b8c4f8b2877", "width": 48, "height": 16, @@ -2621,13 +2651,13 @@ { "px": [704,240], "src": [0,64], "f": 0, "t": 92, "d": [17,839], "a": 1 }, { "px": [496,32], "src": [48,160], "f": 0, "t": 233, "d": [29,137], "a": 1 }, { "px": [496,32], "src": [48,160], "f": 1, "t": 233, "d": [29,137], "a": 1 }, - { "px": [352,48], "src": [48,160], "f": 1, "t": 233, "d": [29,181], "a": 1 }, + { "px": [352,48], "src": [64,144], "f": 1, "t": 211, "d": [29,181], "a": 1 }, { "px": [464,48], "src": [48,160], "f": 0, "t": 233, "d": [29,188], "a": 1 }, { "px": [528,48], "src": [48,160], "f": 0, "t": 233, "d": [29,192], "a": 1 }, - { "px": [384,64], "src": [64,144], "f": 1, "t": 211, "d": [29,236], "a": 1 }, + { "px": [384,64], "src": [48,160], "f": 1, "t": 233, "d": [29,236], "a": 1 }, { "px": [432,64], "src": [48,160], "f": 0, "t": 233, "d": [29,239], "a": 1 }, { "px": [256,112], "src": [64,144], "f": 0, "t": 211, "d": [29,387], "a": 1 }, - { "px": [352,224], "src": [64,144], "f": 1, "t": 211, "d": [29,764], "a": 1 }, + { "px": [352,224], "src": [48,160], "f": 1, "t": 233, "d": [29,764], "a": 1 }, { "px": [656,240], "src": [48,160], "f": 0, "t": 233, "d": [29,836], "a": 1 }, { "px": [688,240], "src": [64,144], "f": 1, "t": 211, "d": [29,838], "a": 1 }, { "px": [640,256], "src": [64,144], "f": 0, "t": 211, "d": [29,888], "a": 1 }, @@ -3489,13 +3519,13 @@ { "px": [688,272], "src": [144,320], "f": 0, "t": 469, "d": [71,945], "a": 1 }, { "px": [704,256], "src": [160,304], "f": 0, "t": 447, "d": [71,945], "a": 1 }, { "px": [704,272], "src": [160,320], "f": 0, "t": 470, "d": [71,945], "a": 1 }, - { "px": [352,48], "src": [176,272], "f": 2, "t": 402, "d": [39,181], "a": 1 }, - { "px": [528,48], "src": [144,272], "f": 2, "t": 400, "d": [39,192], "a": 1 }, - { "px": [512,64], "src": [192,304], "f": 2, "t": 449, "d": [39,244], "a": 1 }, + { "px": [352,48], "src": [160,304], "f": 2, "t": 447, "d": [39,181], "a": 1 }, + { "px": [528,48], "src": [176,272], "f": 2, "t": 402, "d": [39,192], "a": 1 }, + { "px": [512,64], "src": [144,272], "f": 2, "t": 400, "d": [39,244], "a": 1 }, { "px": [400,80], "src": [160,304], "f": 2, "t": 447, "d": [39,290], "a": 1 }, { "px": [272,112], "src": [144,272], "f": 2, "t": 400, "d": [39,388], "a": 1 }, - { "px": [176,144], "src": [160,304], "f": 2, "t": 447, "d": [39,488], "a": 1 }, - { "px": [192,144], "src": [176,272], "f": 2, "t": 402, "d": [39,489], "a": 1 }, + { "px": [176,144], "src": [176,272], "f": 2, "t": 402, "d": [39,488], "a": 1 }, + { "px": [192,144], "src": [160,304], "f": 2, "t": 447, "d": [39,489], "a": 1 }, { "px": [224,144], "src": [160,304], "f": 2, "t": 447, "d": [39,491], "a": 1 }, { "px": [336,144], "src": [144,272], "f": 0, "t": 400, "d": [39,498], "a": 1 }, { "px": [416,144], "src": [144,272], "f": 0, "t": 400, "d": [39,503], "a": 1 }, @@ -3503,19 +3533,19 @@ { "px": [448,144], "src": [144,272], "f": 0, "t": 400, "d": [39,505], "a": 1 }, { "px": [464,144], "src": [160,304], "f": 0, "t": 447, "d": [39,506], "a": 1 }, { "px": [496,144], "src": [176,272], "f": 0, "t": 402, "d": [39,508], "a": 1 }, - { "px": [688,240], "src": [176,272], "f": 2, "t": 402, "d": [39,838], "a": 1 }, + { "px": [688,240], "src": [144,272], "f": 2, "t": 400, "d": [39,838], "a": 1 }, { "px": [288,272], "src": [160,304], "f": 0, "t": 447, "d": [39,919], "a": 1 }, { "px": [336,272], "src": [176,272], "f": 0, "t": 402, "d": [39,922], "a": 1 }, { "px": [352,272], "src": [160,304], "f": 0, "t": 447, "d": [39,923], "a": 1 }, { "px": [416,272], "src": [176,272], "f": 0, "t": 402, "d": [39,927], "a": 1 }, { "px": [640,272], "src": [176,272], "f": 0, "t": 402, "d": [39,941], "a": 1 }, { "px": [672,272], "src": [144,272], "f": 0, "t": 400, "d": [39,943], "a": 1 }, - { "px": [464,48], "src": [144,272], "f": 3, "t": 400, "d": [65,188], "a": 1 }, - { "px": [384,64], "src": [128,320], "f": 2, "t": 468, "d": [65,236], "a": 1 }, - { "px": [256,112], "src": [144,272], "f": 3, "t": 400, "d": [65,387], "a": 1 }, + { "px": [464,48], "src": [128,320], "f": 3, "t": 468, "d": [65,188], "a": 1 }, + { "px": [384,64], "src": [144,272], "f": 2, "t": 400, "d": [65,236], "a": 1 }, + { "px": [256,112], "src": [144,304], "f": 3, "t": 446, "d": [65,387], "a": 1 }, { "px": [528,144], "src": [144,304], "f": 0, "t": 446, "d": [65,510], "a": 1 }, - { "px": [352,224], "src": [144,304], "f": 2, "t": 446, "d": [65,764], "a": 1 }, - { "px": [384,240], "src": [144,272], "f": 2, "t": 400, "d": [65,819], "a": 1 }, + { "px": [352,224], "src": [128,320], "f": 2, "t": 468, "d": [65,764], "a": 1 }, + { "px": [384,240], "src": [144,304], "f": 2, "t": 446, "d": [65,819], "a": 1 }, { "px": [304,272], "src": [144,272], "f": 0, "t": 400, "d": [65,920], "a": 1 }, { "px": [624,48], "src": [208,304], "f": 2, "t": 450, "d": [80,198], "a": 1 }, { "px": [720,48], "src": [208,304], "f": 3, "t": 450, "d": [80,204], "a": 1 }, @@ -3599,6 +3629,8 @@ "__tags": [], "__tile": { "tilesetUid": 105, "x": 160, "y": 2720, "w": 32, "h": 32 }, "__smartColor": "#FF0000", + "__worldX": 808, + "__worldY": -112, "iid": "a316bd86-66b0-11ec-9cd7-837d4383ebc8", "width": 20, "height": 20, @@ -3619,6 +3651,8 @@ "__tags": [], "__tile": { "tilesetUid": 105, "x": 160, "y": 2720, "w": 32, "h": 32 }, "__smartColor": "#FF0000", + "__worldX": 776, + "__worldY": -16, "iid": "a316bd87-66b0-11ec-9cd7-df8b07359531", "width": 20, "height": 20, @@ -3639,6 +3673,8 @@ "__tags": [], "__tile": { "tilesetUid": 105, "x": 160, "y": 2720, "w": 32, "h": 32 }, "__smartColor": "#FF0000", + "__worldX": 552, + "__worldY": -128, "iid": "a316bd88-66b0-11ec-9cd7-cbd4e685a38f", "width": 48, "height": 48, @@ -3662,6 +3698,8 @@ "__tags": [], "__tile": null, "__smartColor": "#B7A87A", + "__worldX": 680, + "__worldY": -128, "iid": "a316bd89-66b0-11ec-9cd7-69448da578ed", "width": 8, "height": 64, @@ -3676,6 +3714,8 @@ "__tags": [], "__tile": { "tilesetUid": 105, "x": 64, "y": 192, "w": 32, "h": 32 }, "__smartColor": "#6ADDEC", + "__worldX": 424, + "__worldY": -192, "iid": "a316bd8a-66b0-11ec-9cd7-a986f709d9f8", "width": 24, "height": 24, @@ -3696,6 +3736,8 @@ "__tags": [], "__tile": null, "__smartColor": "#B7A87A", + "__worldX": 472, + "__worldY": -208, "iid": "a316bd8b-66b0-11ec-9cd7-27e78e24a888", "width": 8, "height": 32, @@ -4948,6 +4990,8 @@ "__tags": [], "__tile": { "tilesetUid": 105, "x": 160, "y": 2720, "w": 32, "h": 32 }, "__smartColor": "#FF0000", + "__worldX": 392, + "__worldY": 512, "iid": "a317cef6-66b0-11ec-9cd7-a5ccf047f66e", "width": 20, "height": 20, diff --git a/assets/WorldMap_Free_layout.ldtk b/assets/WorldMap_Free_layout.ldtk index bb925742..de66a499 100755 --- a/assets/WorldMap_Free_layout.ldtk +++ b/assets/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.3.3", + "appVersion": "1.4.1", "url": "https://ldtk.io" }, "iid": "3c8c0830-c640-11ed-bac6-cb5e82dbaf1d", - "jsonVersion": "1.3.3", - "appBuildId": 468555, + "jsonVersion": "1.4.1", + "appBuildId": 471698, "nextUid": 125, "identifierStyle": "Capitalize", "toc": [], @@ -22,6 +22,8 @@ "defaultPivotX": 0, "defaultPivotY": 0, "defaultGridSize": 16, + "defaultEntityWidth": 16, + "defaultEntityHeight": 16, "bgColor": "#37494E", "defaultLevelBgColor": "#37494E", "minifyJson": false, @@ -63,6 +65,7 @@ "requiredTags": [], "excludedTags": [], "intGridValues": [], + "intGridValuesGroups": [], "autoRuleGroups": [], "autoSourceLayerDefUid": null, "tilesetDefUid": null, @@ -92,9 +95,13 @@ "parallaxScaling": true, "requiredTags": [], "excludedTags": [], - "intGridValues": [ { "value": 1, "identifier": "walls", "color": "#B1824C", "tile": null }, { "value": 2, "identifier": "water", "color": "#7297E5", "tile": null } ], + "intGridValues": [ + { "value": 1, "identifier": "walls", "color": "#B1824C", "tile": null, "groupUid": 0 }, + { "value": 2, "identifier": "water", "color": "#7297E5", "tile": null, "groupUid": 0 } + ], + "intGridValuesGroups": [], "autoRuleGroups": [ - { "uid": 107, "name": "Wall inner shadows", "active": true, "isOptional": false, "rules": [ + { "uid": 107, "name": "Wall inner shadows", "color": null, "icon": null, "active": true, "isOptional": false, "rules": [ { "uid": 109, "active": true, @@ -158,7 +165,7 @@ "perlinOctaves": 2 } ], "usesWizard": false }, - { "uid": 103, "name": "Deep walls", "active": true, "isOptional": false, "rules": [ + { "uid": 103, "name": "Deep walls", "color": null, "icon": null, "active": true, "isOptional": false, "rules": [ { "uid": 104, "active": true, @@ -191,7 +198,7 @@ "perlinOctaves": 2 } ], "usesWizard": false }, - { "uid": 92, "name": "Grass", "active": true, "isOptional": false, "rules": [ + { "uid": 92, "name": "Grass", "color": null, "icon": null, "active": true, "isOptional": false, "rules": [ { "uid": 101, "active": true, @@ -255,7 +262,7 @@ "perlinOctaves": 2 } ], "usesWizard": false }, - { "uid": 94, "name": "Rock details", "active": true, "isOptional": false, "rules": [ + { "uid": 94, "name": "Rock details", "color": null, "icon": null, "active": true, "isOptional": false, "rules": [ { "uid": 98, "active": true, @@ -381,7 +388,7 @@ "perlinOctaves": 2 } ], "usesWizard": false }, - { "uid": 20, "name": "Water", "active": true, "isOptional": false, "rules": [ + { "uid": 20, "name": "Water", "color": null, "icon": null, "active": true, "isOptional": false, "rules": [ { "uid": 99, "active": true, @@ -538,7 +545,7 @@ "perlinOctaves": 2 } ], "usesWizard": false }, - { "uid": 7, "name": "Walls", "active": true, "isOptional": false, "rules": [ + { "uid": 7, "name": "Walls", "color": null, "icon": null, "active": true, "isOptional": false, "rules": [ { "uid": 14, "active": true, @@ -849,8 +856,9 @@ "requiredTags": [], "excludedTags": [], "intGridValues": [], + "intGridValuesGroups": [], "autoRuleGroups": [ - { "uid": 87, "name": "Wall shadows", "active": true, "isOptional": false, "rules": [ + { "uid": 87, "name": "Wall shadows", "color": null, "icon": null, "active": true, "isOptional": false, "rules": [ { "uid": 88, "active": true, @@ -945,7 +953,7 @@ "perlinOctaves": 2 } ], "usesWizard": false }, - { "uid": 49, "name": "Bg walls", "active": true, "isOptional": false, "rules": [ + { "uid": 49, "name": "Bg walls", "color": null, "icon": null, "active": true, "isOptional": false, "rules": [ { "uid": 70, "active": true, @@ -1103,6 +1111,7 @@ "tilesetId": 117, "tileRenderMode": "FitInside", "tileRect": { "tilesetUid": 117, "x": 112, "y": 64, "w": 16, "h": 16 }, + "uiTileRect": null, "nineSliceBorders": [], "maxCount": 0, "limitScope": "PerLevel", @@ -1124,6 +1133,7 @@ "editorDisplayScale": 1, "editorDisplayPos": "Above", "editorLinkStyle": "StraightArrow", + "editorDisplayColor": null, "editorAlwaysShow": false, "editorShowInWorld": true, "editorCutLongValues": true, @@ -1158,6 +1168,7 @@ "editorDisplayScale": 1, "editorDisplayPos": "Above", "editorLinkStyle": "StraightArrow", + "editorDisplayColor": null, "editorAlwaysShow": false, "editorShowInWorld": true, "editorCutLongValues": true, @@ -1205,6 +1216,7 @@ "tilesetId": 117, "tileRenderMode": "FitInside", "tileRect": { "tilesetUid": 117, "x": 160, "y": 32, "w": 16, "h": 16 }, + "uiTileRect": null, "nineSliceBorders": [], "maxCount": 0, "limitScope": "PerLevel", @@ -1226,6 +1238,7 @@ "editorDisplayScale": 1, "editorDisplayPos": "Above", "editorLinkStyle": "CurvedArrow", + "editorDisplayColor": null, "editorAlwaysShow": false, "editorShowInWorld": true, "editorCutLongValues": true, @@ -1316,12 +1329,12 @@ } } ], "enums": [{ "identifier": "Plants", "uid": 120, "values": [ - { "id": "Clover", "tileRect": { "tilesetUid": 117, "x": 240, "y": 288, "w": 16, "h": 16 }, "tileId": -1, "color": 4561204, "__tileSrcRect": [240,288,16,16] }, - { "id": "Golden", "tileRect": { "tilesetUid": 117, "x": 48, "y": 288, "w": 16, "h": 16 }, "tileId": -1, "color": 13278289, "__tileSrcRect": [48,288,16,16] }, - { "id": "Fruit", "tileRect": { "tilesetUid": 117, "x": 48, "y": 304, "w": 16, "h": 16 }, "tileId": -1, "color": 9345445, "__tileSrcRect": [48,304,16,16] }, - { "id": "Rose", "tileRect": { "tilesetUid": 117, "x": 176, "y": 288, "w": 16, "h": 16 }, "tileId": -1, "color": 9326891, "__tileSrcRect": [176,288,16,16] }, - { "id": "Root", "tileRect": { "tilesetUid": 117, "x": 0, "y": 336, "w": 16, "h": 16 }, "tileId": -1, "color": 10184273, "__tileSrcRect": [0,336,16,16] }, - { "id": "Water_shroom", "tileRect": { "tilesetUid": 117, "x": 32, "y": 336, "w": 16, "h": 16 }, "tileId": -1, "color": 6059166, "__tileSrcRect": [32,336,16,16] } + { "id": "Clover", "tileRect": { "tilesetUid": 117, "x": 240, "y": 288, "w": 16, "h": 16 }, "color": 4561204 }, + { "id": "Golden", "tileRect": { "tilesetUid": 117, "x": 48, "y": 288, "w": 16, "h": 16 }, "color": 13278289 }, + { "id": "Fruit", "tileRect": { "tilesetUid": 117, "x": 48, "y": 304, "w": 16, "h": 16 }, "color": 9345445 }, + { "id": "Rose", "tileRect": { "tilesetUid": 117, "x": 176, "y": 288, "w": 16, "h": 16 }, "color": 9326891 }, + { "id": "Root", "tileRect": { "tilesetUid": 117, "x": 0, "y": 336, "w": 16, "h": 16 }, "color": 10184273 }, + { "id": "Water_shroom", "tileRect": { "tilesetUid": 117, "x": 32, "y": 336, "w": 16, "h": 16 }, "color": 6059166 } ], "iconTilesetUid": 117, "externalRelPath": null, "externalFileChecksum": null, "tags": [] }], "externalEnums": [], "levelFields": [] }, "levels": [ { @@ -1376,6 +1389,8 @@ "__tags": [], "__tile": { "tilesetUid": 117, "x": 0, "y": 336, "w": 16, "h": 16 }, "__smartColor": "#9FFF00", + "__worldX": 296, + "__worldY": -144, "iid": "bb084530-66b0-11ec-8fc6-c11dfd63d53e", "width": 20, "height": 20, @@ -1396,6 +1411,8 @@ "__tags": [], "__tile": { "tilesetUid": 117, "x": 240, "y": 288, "w": 16, "h": 16 }, "__smartColor": "#9FFF00", + "__worldX": 264, + "__worldY": -272, "iid": "003047c0-66b0-11ec-8fc6-71e179b25f67", "width": 20, "height": 20, @@ -1416,6 +1433,8 @@ "__tags": [], "__tile": { "tilesetUid": 117, "x": 160, "y": 32, "w": 16, "h": 16 }, "__smartColor": "#00FF30", + "__worldX": 272, + "__worldY": -32, "iid": "2a789b40-8dc0-11ec-a525-a942e9459e5c", "width": 16, "height": 16, @@ -1597,7 +1616,7 @@ { "px": [176,368], "src": [48,96], "f": 0, "t": 219, "d": [9,379], "a": 1 }, { "px": [96,0], "src": [0,128], "f": 1, "t": 288, "d": [10,6], "a": 1 }, { "px": [144,0], "src": [0,112], "f": 0, "t": 252, "d": [10,9], "a": 1 }, - { "px": [96,16], "src": [0,128], "f": 1, "t": 288, "d": [10,22], "a": 1 }, + { "px": [96,16], "src": [0,112], "f": 1, "t": 252, "d": [10,22], "a": 1 }, { "px": [144,16], "src": [0,112], "f": 0, "t": 252, "d": [10,25], "a": 1 }, { "px": [96,32], "src": [0,112], "f": 1, "t": 252, "d": [10,38], "a": 1 }, { "px": [144,32], "src": [0,112], "f": 0, "t": 252, "d": [10,41], "a": 1 }, @@ -1605,34 +1624,34 @@ { "px": [144,64], "src": [0,112], "f": 0, "t": 252, "d": [10,73], "a": 1 }, { "px": [32,80], "src": [0,128], "f": 1, "t": 288, "d": [10,82], "a": 1 }, { "px": [144,80], "src": [0,112], "f": 0, "t": 252, "d": [10,89], "a": 1 }, - { "px": [32,96], "src": [0,128], "f": 1, "t": 288, "d": [10,98], "a": 1 }, + { "px": [32,96], "src": [0,112], "f": 1, "t": 252, "d": [10,98], "a": 1 }, { "px": [144,96], "src": [0,128], "f": 0, "t": 288, "d": [10,105], "a": 1 }, - { "px": [32,112], "src": [0,128], "f": 1, "t": 288, "d": [10,114], "a": 1 }, + { "px": [32,112], "src": [0,112], "f": 1, "t": 252, "d": [10,114], "a": 1 }, { "px": [96,128], "src": [0,128], "f": 0, "t": 288, "d": [10,134], "a": 1 }, { "px": [96,144], "src": [0,112], "f": 0, "t": 252, "d": [10,150], "a": 1 }, { "px": [96,160], "src": [0,128], "f": 0, "t": 288, "d": [10,166], "a": 1 }, - { "px": [128,160], "src": [0,128], "f": 1, "t": 288, "d": [10,168], "a": 1 }, + { "px": [128,160], "src": [0,112], "f": 1, "t": 252, "d": [10,168], "a": 1 }, { "px": [96,176], "src": [0,128], "f": 0, "t": 288, "d": [10,182], "a": 1 }, { "px": [96,192], "src": [0,128], "f": 0, "t": 288, "d": [10,198], "a": 1 }, - { "px": [112,192], "src": [0,128], "f": 1, "t": 288, "d": [10,199], "a": 1 }, + { "px": [112,192], "src": [0,112], "f": 1, "t": 252, "d": [10,199], "a": 1 }, { "px": [96,208], "src": [0,112], "f": 0, "t": 252, "d": [10,214], "a": 1 }, { "px": [112,208], "src": [0,112], "f": 1, "t": 252, "d": [10,215], "a": 1 }, { "px": [224,208], "src": [0,112], "f": 0, "t": 252, "d": [10,222], "a": 1 }, - { "px": [0,224], "src": [0,112], "f": 1, "t": 252, "d": [10,224], "a": 1 }, + { "px": [0,224], "src": [0,128], "f": 1, "t": 288, "d": [10,224], "a": 1 }, { "px": [96,224], "src": [0,128], "f": 0, "t": 288, "d": [10,230], "a": 1 }, - { "px": [112,224], "src": [0,112], "f": 1, "t": 252, "d": [10,231], "a": 1 }, + { "px": [112,224], "src": [0,128], "f": 1, "t": 288, "d": [10,231], "a": 1 }, { "px": [224,224], "src": [0,112], "f": 0, "t": 252, "d": [10,238], "a": 1 }, { "px": [0,240], "src": [0,128], "f": 1, "t": 288, "d": [10,240], "a": 1 }, { "px": [224,240], "src": [0,112], "f": 0, "t": 252, "d": [10,254], "a": 1 }, - { "px": [0,256], "src": [0,128], "f": 1, "t": 288, "d": [10,256], "a": 1 }, + { "px": [0,256], "src": [0,112], "f": 1, "t": 252, "d": [10,256], "a": 1 }, { "px": [224,256], "src": [0,128], "f": 0, "t": 288, "d": [10,270], "a": 1 }, - { "px": [0,272], "src": [0,128], "f": 1, "t": 288, "d": [10,272], "a": 1 }, + { "px": [0,272], "src": [0,112], "f": 1, "t": 252, "d": [10,272], "a": 1 }, { "px": [224,272], "src": [0,128], "f": 0, "t": 288, "d": [10,286], "a": 1 }, { "px": [0,288], "src": [0,112], "f": 1, "t": 252, "d": [10,288], "a": 1 }, { "px": [224,288], "src": [0,128], "f": 0, "t": 288, "d": [10,302], "a": 1 }, { "px": [32,320], "src": [0,112], "f": 1, "t": 252, "d": [10,322], "a": 1 }, { "px": [208,320], "src": [0,128], "f": 0, "t": 288, "d": [10,333], "a": 1 }, - { "px": [32,336], "src": [0,112], "f": 1, "t": 252, "d": [10,338], "a": 1 }, + { "px": [32,336], "src": [0,128], "f": 1, "t": 288, "d": [10,338], "a": 1 }, { "px": [208,336], "src": [0,112], "f": 0, "t": 252, "d": [10,349], "a": 1 }, { "px": [96,48], "src": [0,144], "f": 1, "t": 324, "d": [77,54], "a": 1 }, { "px": [48,64], "src": [0,144], "f": 1, "t": 324, "d": [77,67], "a": 1 }, @@ -1728,7 +1747,7 @@ { "px": [144,160], "src": [80,128], "f": 0, "t": 293, "d": [95,169], "a": 1 }, { "px": [128,192], "src": [80,112], "f": 0, "t": 257, "d": [95,200], "a": 1 }, { "px": [32,208], "src": [80,112], "f": 0, "t": 257, "d": [95,210], "a": 1 }, - { "px": [208,208], "src": [80,112], "f": 1, "t": 257, "d": [95,221], "a": 1 }, + { "px": [208,208], "src": [80,128], "f": 1, "t": 293, "d": [95,221], "a": 1 }, { "px": [16,224], "src": [80,112], "f": 0, "t": 257, "d": [95,225], "a": 1 }, { "px": [64,272], "src": [80,128], "f": 1, "t": 293, "d": [95,276], "a": 1 }, { "px": [160,272], "src": [80,128], "f": 0, "t": 293, "d": [95,282], "a": 1 }, @@ -1736,11 +1755,11 @@ { "px": [80,224], "src": [80,160], "f": 1, "t": 365, "d": [96,229], "a": 1 }, { "px": [128,224], "src": [80,160], "f": 0, "t": 365, "d": [96,232], "a": 1 }, { "px": [16,288], "src": [80,144], "f": 0, "t": 329, "d": [96,289], "a": 1 }, - { "px": [208,288], "src": [80,144], "f": 1, "t": 329, "d": [96,301], "a": 1 }, + { "px": [208,288], "src": [80,160], "f": 1, "t": 365, "d": [96,301], "a": 1 }, { "px": [48,336], "src": [80,160], "f": 0, "t": 365, "d": [96,339], "a": 1 }, - { "px": [192,336], "src": [80,160], "f": 1, "t": 365, "d": [96,348], "a": 1 }, + { "px": [192,336], "src": [80,144], "f": 1, "t": 329, "d": [96,348], "a": 1 }, { "px": [80,352], "src": [80,160], "f": 0, "t": 365, "d": [96,357], "a": 1 }, - { "px": [176,352], "src": [80,144], "f": 1, "t": 329, "d": [96,363], "a": 1 }, + { "px": [176,352], "src": [80,160], "f": 1, "t": 365, "d": [96,363], "a": 1 }, { "px": [96,96], "src": [16,80], "f": 0, "t": 181, "d": [97,102], "a": 1 }, { "px": [128,96], "src": [112,112], "f": 0, "t": 259, "d": [97,104], "a": 1 }, { "px": [0,160], "src": [128,112], "f": 0, "t": 260, "d": [97,160], "a": 1 }, @@ -1769,12 +1788,12 @@ { "px": [160,352], "src": [32,80], "f": 0, "t": 182, "d": [97,362], "a": 1 }, { "px": [176,352], "src": [0,80], "f": 0, "t": 180, "d": [97,363], "a": 1 }, { "px": [112,0], "src": [64,128], "f": 0, "t": 292, "d": [98,7], "a": 1 }, - { "px": [128,16], "src": [64,128], "f": 1, "t": 292, "d": [98,24], "a": 1 }, + { "px": [128,16], "src": [64,112], "f": 1, "t": 256, "d": [98,24], "a": 1 }, { "px": [112,32], "src": [64,112], "f": 0, "t": 256, "d": [98,39], "a": 1 }, { "px": [112,48], "src": [64,112], "f": 0, "t": 256, "d": [98,55], "a": 1 }, { "px": [64,64], "src": [64,128], "f": 0, "t": 292, "d": [98,68], "a": 1 }, { "px": [48,80], "src": [64,112], "f": 0, "t": 256, "d": [98,83], "a": 1 }, - { "px": [128,80], "src": [64,112], "f": 1, "t": 256, "d": [98,88], "a": 1 }, + { "px": [128,80], "src": [64,128], "f": 1, "t": 292, "d": [98,88], "a": 1 }, { "px": [48,96], "src": [64,112], "f": 0, "t": 256, "d": [98,99], "a": 1 }, { "px": [128,96], "src": [64,112], "f": 1, "t": 256, "d": [98,104], "a": 1 }, { "px": [48,112], "src": [64,112], "f": 0, "t": 256, "d": [98,115], "a": 1 }, @@ -1785,23 +1804,23 @@ { "px": [80,176], "src": [64,128], "f": 1, "t": 292, "d": [98,181], "a": 1 }, { "px": [144,176], "src": [64,112], "f": 0, "t": 256, "d": [98,185], "a": 1 }, { "px": [48,192], "src": [64,112], "f": 0, "t": 256, "d": [98,195], "a": 1 }, - { "px": [80,192], "src": [64,128], "f": 1, "t": 292, "d": [98,197], "a": 1 }, + { "px": [80,192], "src": [64,112], "f": 1, "t": 256, "d": [98,197], "a": 1 }, { "px": [128,192], "src": [64,128], "f": 0, "t": 292, "d": [98,200], "a": 1 }, { "px": [176,192], "src": [64,128], "f": 1, "t": 292, "d": [98,203], "a": 1 }, { "px": [32,208], "src": [64,112], "f": 0, "t": 256, "d": [98,210], "a": 1 }, - { "px": [80,208], "src": [64,128], "f": 1, "t": 292, "d": [98,213], "a": 1 }, + { "px": [80,208], "src": [64,112], "f": 1, "t": 256, "d": [98,213], "a": 1 }, { "px": [128,208], "src": [64,128], "f": 0, "t": 292, "d": [98,216], "a": 1 }, { "px": [208,208], "src": [64,128], "f": 1, "t": 292, "d": [98,221], "a": 1 }, { "px": [80,224], "src": [64,112], "f": 1, "t": 256, "d": [98,229], "a": 1 }, { "px": [128,224], "src": [64,112], "f": 0, "t": 256, "d": [98,232], "a": 1 }, - { "px": [208,224], "src": [64,112], "f": 1, "t": 256, "d": [98,237], "a": 1 }, + { "px": [208,224], "src": [64,128], "f": 1, "t": 292, "d": [98,237], "a": 1 }, { "px": [16,240], "src": [64,128], "f": 0, "t": 292, "d": [98,241], "a": 1 }, { "px": [16,256], "src": [64,112], "f": 0, "t": 256, "d": [98,257], "a": 1 }, { "px": [48,256], "src": [64,128], "f": 1, "t": 292, "d": [98,259], "a": 1 }, { "px": [192,256], "src": [64,112], "f": 0, "t": 256, "d": [98,268], "a": 1 }, - { "px": [208,256], "src": [64,112], "f": 1, "t": 256, "d": [98,269], "a": 1 }, + { "px": [208,256], "src": [64,128], "f": 1, "t": 292, "d": [98,269], "a": 1 }, { "px": [16,272], "src": [64,128], "f": 0, "t": 292, "d": [98,273], "a": 1 }, - { "px": [64,272], "src": [64,128], "f": 1, "t": 292, "d": [98,276], "a": 1 }, + { "px": [64,272], "src": [64,112], "f": 1, "t": 256, "d": [98,276], "a": 1 }, { "px": [160,272], "src": [64,112], "f": 0, "t": 256, "d": [98,282], "a": 1 }, { "px": [16,288], "src": [64,128], "f": 0, "t": 292, "d": [98,289], "a": 1 }, { "px": [208,288], "src": [64,112], "f": 1, "t": 256, "d": [98,301], "a": 1 }, @@ -2368,7 +2387,14 @@ "entityInstances": [] } ], - "__neighbours": [ { "levelIid": "a35944c0-66b0-11ec-9cd7-6b4e2322a69e", "dir": "n" }, { "levelIid": "a35992e0-66b0-11ec-9cd7-8b2ebd1b98e2", "dir": "w" }, { "levelIid": "a359b9f0-66b0-11ec-9cd7-25dfb937d033", "dir": "e" } ] + "__neighbours": [ + { "levelIid": "5cbed650-66b0-11ec-895f-23240977178f", "dir": ">" }, + { "levelIid": "720af480-66b0-11ec-895f-a114f0383ca2", "dir": "<" }, + { "levelIid": "b7a1be70-66b0-11ec-895f-f7a843c40618", "dir": ">" }, + { "levelIid": "a35944c0-66b0-11ec-9cd7-6b4e2322a69e", "dir": "n" }, + { "levelIid": "a35992e0-66b0-11ec-9cd7-8b2ebd1b98e2", "dir": "w" }, + { "levelIid": "a359b9f0-66b0-11ec-9cd7-25dfb937d033", "dir": "e" } + ] }, { "identifier": "Top", @@ -2422,6 +2448,8 @@ "__tags": [], "__tile": { "tilesetUid": 117, "x": 32, "y": 336, "w": 16, "h": 16 }, "__smartColor": "#9FFF00", + "__worldX": 520, + "__worldY": -416, "iid": "c0d54170-66b0-11ec-8fc6-fd3592ec5dfc", "width": 20, "height": 20, @@ -2442,6 +2470,8 @@ "__tags": [], "__tile": { "tilesetUid": 117, "x": 32, "y": 336, "w": 16, "h": 16 }, "__smartColor": "#9FFF00", + "__worldX": 456, + "__worldY": -416, "iid": "d7f84280-66b0-11ec-8fc6-2721b8395e4d", "width": 20, "height": 20, @@ -3607,7 +3637,7 @@ "entityInstances": [] } ], - "__neighbours": [ { "levelIid": "a3591db0-66b0-11ec-9cd7-43878cf4d0ab", "dir": "s" }, { "levelIid": "a35992e0-66b0-11ec-9cd7-8b2ebd1b98e2", "dir": "s" }, { "levelIid": "a359b9f0-66b0-11ec-9cd7-25dfb937d033", "dir": "s" } ] + "__neighbours": [ { "levelIid": "5cbed650-66b0-11ec-895f-23240977178f", "dir": ">" }, { "levelIid": "a3591db0-66b0-11ec-9cd7-43878cf4d0ab", "dir": "s" }, { "levelIid": "a35992e0-66b0-11ec-9cd7-8b2ebd1b98e2", "dir": "s" }, { "levelIid": "a359b9f0-66b0-11ec-9cd7-25dfb937d033", "dir": "s" } ] }, { "identifier": "Large_room", @@ -3661,6 +3691,8 @@ "__tags": [], "__tile": { "tilesetUid": 117, "x": 240, "y": 288, "w": 16, "h": 16 }, "__smartColor": "#9FFF00", + "__worldX": -72, + "__worldY": -160, "iid": "4c636150-66b0-11ec-8fc6-81b4e785f3d6", "width": 20, "height": 20, @@ -3681,6 +3713,8 @@ "__tags": [], "__tile": { "tilesetUid": 117, "x": 0, "y": 336, "w": 16, "h": 16 }, "__smartColor": "#9FFF00", + "__worldX": 104, + "__worldY": -208, "iid": "b7de7c80-66b0-11ec-8fc6-259fa2c94af6", "width": 20, "height": 20, @@ -3701,6 +3735,8 @@ "__tags": [], "__tile": { "tilesetUid": 117, "x": 160, "y": 32, "w": 16, "h": 16 }, "__smartColor": "#00FF30", + "__worldX": -24, + "__worldY": -160, "iid": "7e1072a0-8dc0-11ec-a525-4d0952d12de1", "width": 16, "height": 16, @@ -4866,7 +4902,14 @@ "entityInstances": [] } ], - "__neighbours": [ { "levelIid": "a3591db0-66b0-11ec-9cd7-43878cf4d0ab", "dir": "e" }, { "levelIid": "a35944c0-66b0-11ec-9cd7-6b4e2322a69e", "dir": "n" }, { "levelIid": "a35aa451-66b0-11ec-9cd7-438de356526d", "dir": "w" } ] + "__neighbours": [ + { "levelIid": "5cbed650-66b0-11ec-895f-23240977178f", "dir": ">" }, + { "levelIid": "720af480-66b0-11ec-895f-a114f0383ca2", "dir": "<" }, + { "levelIid": "b7a1be70-66b0-11ec-895f-f7a843c40618", "dir": ">" }, + { "levelIid": "a3591db0-66b0-11ec-9cd7-43878cf4d0ab", "dir": "e" }, + { "levelIid": "a35944c0-66b0-11ec-9cd7-6b4e2322a69e", "dir": "n" }, + { "levelIid": "a35aa451-66b0-11ec-9cd7-438de356526d", "dir": "w" } + ] }, { "identifier": "Secret_passage", @@ -4920,6 +4963,8 @@ "__tags": [], "__tile": { "tilesetUid": 117, "x": 176, "y": 288, "w": 16, "h": 16 }, "__smartColor": "#9FFF00", + "__worldX": 568, + "__worldY": -304, "iid": "bcef0690-66b0-11ec-8fc6-a50e4075387f", "width": 20, "height": 20, @@ -4940,6 +4985,8 @@ "__tags": [], "__tile": { "tilesetUid": 117, "x": 160, "y": 32, "w": 16, "h": 16 }, "__smartColor": "#00FF30", + "__worldX": 488, + "__worldY": -320, "iid": "5c9ee4d0-8dc0-11ec-a525-4ddce479fcbc", "width": 16, "height": 16, @@ -5599,7 +5646,14 @@ "entityInstances": [] } ], - "__neighbours": [ { "levelIid": "a3591db0-66b0-11ec-9cd7-43878cf4d0ab", "dir": "w" }, { "levelIid": "a35944c0-66b0-11ec-9cd7-6b4e2322a69e", "dir": "n" }, { "levelIid": "a35a2f20-66b0-11ec-9cd7-db6f994e2834", "dir": "s" } ] + "__neighbours": [ + { "levelIid": "5cbed650-66b0-11ec-895f-23240977178f", "dir": ">" }, + { "levelIid": "720af480-66b0-11ec-895f-a114f0383ca2", "dir": "<" }, + { "levelIid": "b7a1be70-66b0-11ec-895f-f7a843c40618", "dir": ">" }, + { "levelIid": "a3591db0-66b0-11ec-9cd7-43878cf4d0ab", "dir": "w" }, + { "levelIid": "a35944c0-66b0-11ec-9cd7-6b4e2322a69e", "dir": "n" }, + { "levelIid": "a35a2f20-66b0-11ec-9cd7-db6f994e2834", "dir": "s" } + ] }, { "identifier": "Underwater_cove", @@ -5653,6 +5707,8 @@ "__tags": [], "__tile": { "tilesetUid": 117, "x": 240, "y": 288, "w": 16, "h": 16 }, "__smartColor": "#9FFF00", + "__worldX": 648, + "__worldY": -32, "iid": "392a2820-66b0-11ec-8fc6-3f3e416501f0", "width": 20, "height": 20, @@ -6775,7 +6831,7 @@ "entityInstances": [] } ], - "__neighbours": [ { "levelIid": "a359b9f0-66b0-11ec-9cd7-25dfb937d033", "dir": "n" }, { "levelIid": "a35acb61-66b0-11ec-9cd7-f76e35cfda30", "dir": "s" }, { "levelIid": "a35b8eb0-66b0-11ec-9cd7-3d16ec48af10", "dir": "s" } ] + "__neighbours": [ { "levelIid": "720af480-66b0-11ec-895f-a114f0383ca2", "dir": "<" }, { "levelIid": "a359b9f0-66b0-11ec-9cd7-25dfb937d033", "dir": "n" }, { "levelIid": "a35acb61-66b0-11ec-9cd7-f76e35cfda30", "dir": "s" }, { "levelIid": "a35b8eb0-66b0-11ec-9cd7-3d16ec48af10", "dir": "s" } ] }, { "identifier": "World_Level_5", @@ -6829,6 +6885,8 @@ "__tags": [], "__tile": { "tilesetUid": 117, "x": 48, "y": 304, "w": 16, "h": 16 }, "__smartColor": "#9FFF00", + "__worldX": 728, + "__worldY": -176, "iid": "f0d74b70-66b0-11ec-8fc6-0114fc134676", "width": 20, "height": 20, @@ -6849,6 +6907,8 @@ "__tags": [], "__tile": { "tilesetUid": 117, "x": 160, "y": 32, "w": 16, "h": 16 }, "__smartColor": "#00FF30", + "__worldX": 936, + "__worldY": -304, "iid": "58a45ea0-8dc0-11ec-a525-2786470df187", "width": 16, "height": 16, @@ -7774,6 +7834,8 @@ "__tags": [], "__tile": { "tilesetUid": 117, "x": 32, "y": 336, "w": 16, "h": 16 }, "__smartColor": "#9FFF00", + "__worldX": -296, + "__worldY": -32, "iid": "e3136e10-66b0-11ec-8fc6-1dfe1e43cabd", "width": 20, "height": 20, @@ -8553,6 +8615,8 @@ "__tags": [], "__tile": { "tilesetUid": 117, "x": 32, "y": 336, "w": 16, "h": 16 }, "__smartColor": "#9FFF00", + "__worldX": 760, + "__worldY": 288, "iid": "dc494d20-66b0-11ec-8fc6-5d62b5efd8bd", "width": 20, "height": 20, @@ -9487,6 +9551,8 @@ "__tags": [], "__tile": { "tilesetUid": 117, "x": 48, "y": 288, "w": 16, "h": 16 }, "__smartColor": "#9FFF00", + "__worldX": 408, + "__worldY": 256, "iid": "dfdcd420-66b0-11ec-8fc6-d3872b388a2a", "width": 20, "height": 20, @@ -9507,6 +9573,8 @@ "__tags": [], "__tile": { "tilesetUid": 117, "x": 48, "y": 288, "w": 16, "h": 16 }, "__smartColor": "#9FFF00", + "__worldX": 472, + "__worldY": 256, "iid": "340fda10-66b0-11ec-8fc6-ff45663f8d26", "width": 20, "height": 20, @@ -9982,7 +10050,7 @@ "entityInstances": [] } ], - "__neighbours": [ { "levelIid": "a35a2f20-66b0-11ec-9cd7-db6f994e2834", "dir": "n" }, { "levelIid": "a35acb61-66b0-11ec-9cd7-f76e35cfda30", "dir": "e" } ] + "__neighbours": [ { "levelIid": "720af480-66b0-11ec-895f-a114f0383ca2", "dir": "<" }, { "levelIid": "a35a2f20-66b0-11ec-9cd7-db6f994e2834", "dir": "n" }, { "levelIid": "a35acb61-66b0-11ec-9cd7-f76e35cfda30", "dir": "e" } ] }, { "identifier": "World_Level_9", @@ -10036,6 +10104,8 @@ "__tags": [], "__tile": { "tilesetUid": 117, "x": 240, "y": 288, "w": 16, "h": 16 }, "__smartColor": "#9FFF00", + "__worldX": 344, + "__worldY": -368, "iid": "464c9560-66b0-11ec-8fc6-bb54b59cd6ba", "width": 20, "height": 20, @@ -11634,7 +11704,14 @@ "entityInstances": [] } ], - "__neighbours": [ { "levelIid": "a35a7d40-66b0-11ec-9cd7-b57d32c8e175", "dir": "e" }, { "levelIid": "b7a1be70-66b0-11ec-895f-f7a843c40618", "dir": "s" } ] + "__neighbours": [ + { "levelIid": "a3591db0-66b0-11ec-9cd7-43878cf4d0ab", "dir": "<" }, + { "levelIid": "a35944c0-66b0-11ec-9cd7-6b4e2322a69e", "dir": "<" }, + { "levelIid": "a35992e0-66b0-11ec-9cd7-8b2ebd1b98e2", "dir": "<" }, + { "levelIid": "a359b9f0-66b0-11ec-9cd7-25dfb937d033", "dir": "<" }, + { "levelIid": "a35a7d40-66b0-11ec-9cd7-b57d32c8e175", "dir": "e" }, + { "levelIid": "b7a1be70-66b0-11ec-895f-f7a843c40618", "dir": "s" } + ] }, { "identifier": "World_Level_10", @@ -11688,6 +11765,8 @@ "__tags": [], "__tile": { "tilesetUid": 117, "x": 32, "y": 336, "w": 16, "h": 16 }, "__smartColor": "#9FFF00", + "__worldX": 248, + "__worldY": 64, "iid": "f50abbf0-66b0-11ec-8fc6-c5d946a7cef2", "width": 20, "height": 20, @@ -11708,6 +11787,8 @@ "__tags": [], "__tile": { "tilesetUid": 117, "x": 32, "y": 336, "w": 16, "h": 16 }, "__smartColor": "#9FFF00", + "__worldX": 72, + "__worldY": -32, "iid": "f6462220-66b0-11ec-8fc6-6b22bff34df9", "width": 20, "height": 20, @@ -11728,6 +11809,8 @@ "__tags": [], "__tile": { "tilesetUid": 117, "x": 160, "y": 32, "w": 16, "h": 16 }, "__smartColor": "#00FF30", + "__worldX": 64, + "__worldY": 48, "iid": "33bf7c00-8dc0-11ec-a525-05f96cc4b971", "width": 16, "height": 16, @@ -13524,7 +13607,13 @@ "entityInstances": [] } ], - "__neighbours": [] + "__neighbours": [ + { "levelIid": "a3591db0-66b0-11ec-9cd7-43878cf4d0ab", "dir": ">" }, + { "levelIid": "a35992e0-66b0-11ec-9cd7-8b2ebd1b98e2", "dir": ">" }, + { "levelIid": "a359b9f0-66b0-11ec-9cd7-25dfb937d033", "dir": ">" }, + { "levelIid": "a35a2f20-66b0-11ec-9cd7-db6f994e2834", "dir": ">" }, + { "levelIid": "a35b8eb0-66b0-11ec-9cd7-3d16ec48af10", "dir": ">" } + ] }, { "identifier": "World_Level_11", @@ -13578,6 +13667,8 @@ "__tags": [], "__tile": { "tilesetUid": 117, "x": 48, "y": 304, "w": 16, "h": 16 }, "__smartColor": "#9FFF00", + "__worldX": -8, + "__worldY": 32, "iid": "e883cb60-66b0-11ec-8fc6-b1b7ad86c0ce", "width": 20, "height": 20, @@ -13598,6 +13689,8 @@ "__tags": [], "__tile": { "tilesetUid": 117, "x": 0, "y": 336, "w": 16, "h": 16 }, "__smartColor": "#9FFF00", + "__worldX": 72, + "__worldY": 32, "iid": "ea28c8d0-66b0-11ec-8fc6-77aa2f817608", "width": 20, "height": 20, @@ -13618,6 +13711,8 @@ "__tags": [], "__tile": { "tilesetUid": 117, "x": 240, "y": 288, "w": 16, "h": 16 }, "__smartColor": "#9FFF00", + "__worldX": -72, + "__worldY": -32, "iid": "ec1f1a90-66b0-11ec-8fc6-a72b61561d5e", "width": 20, "height": 20, @@ -13638,6 +13733,8 @@ "__tags": [], "__tile": { "tilesetUid": 117, "x": 160, "y": 32, "w": 16, "h": 16 }, "__smartColor": "#00FF30", + "__worldX": -24, + "__worldY": 32, "iid": "796d2950-8dc0-11ec-a525-75b5a5ce20f8", "width": 16, "height": 16, @@ -14478,7 +14575,7 @@ "entityInstances": [] } ], - "__neighbours": [{ "levelIid": "5cbed650-66b0-11ec-895f-23240977178f", "dir": "n" }] + "__neighbours": [ { "levelIid": "a3591db0-66b0-11ec-9cd7-43878cf4d0ab", "dir": "<" }, { "levelIid": "a35992e0-66b0-11ec-9cd7-8b2ebd1b98e2", "dir": "<" }, { "levelIid": "a359b9f0-66b0-11ec-9cd7-25dfb937d033", "dir": "<" }, { "levelIid": "5cbed650-66b0-11ec-895f-23240977178f", "dir": "n" } ] } ], "worlds": [], diff --git a/assets/field_instances.ldtk b/assets/field_instances.ldtk index e9045929..2f38c4e1 100644 --- a/assets/field_instances.ldtk +++ b/assets/field_instances.ldtk @@ -5,12 +5,12 @@ "doc": "https://ldtk.io/json", "schema": "https://ldtk.io/files/JSON_SCHEMA.json", "appAuthor": "Sebastien 'deepnight' Benard", - "appVersion": "1.3.3", + "appVersion": "1.4.1", "url": "https://ldtk.io" }, "iid": "e5d71f40-c640-11ed-8b6c-3f97242aa928", - "jsonVersion": "1.3.3", - "appBuildId": 468555, + "jsonVersion": "1.4.1", + "appBuildId": 471698, "nextUid": 96, "identifierStyle": "Capitalize", "toc": [], @@ -22,6 +22,8 @@ "defaultPivotX": 0, "defaultPivotY": 0, "defaultGridSize": 16, + "defaultEntityWidth": 16, + "defaultEntityHeight": 16, "bgColor": "#40465B", "defaultLevelBgColor": "#696A79", "minifyJson": false, @@ -63,6 +65,7 @@ "requiredTags": [], "excludedTags": [], "intGridValues": [], + "intGridValuesGroups": [], "autoRuleGroups": [], "autoSourceLayerDefUid": null, "tilesetDefUid": null, @@ -92,8 +95,9 @@ "parallaxScaling": true, "requiredTags": [], "excludedTags": [], - "intGridValues": [{ "value": 1, "identifier": "Wall", "color": "#000000", "tile": null }], - "autoRuleGroups": [{ "uid": 80, "name": "Walls", "active": true, "isOptional": false, "rules": [ + "intGridValues": [{ "value": 1, "identifier": "Wall", "color": "#000000", "tile": null, "groupUid": 0 }], + "intGridValuesGroups": [], + "autoRuleGroups": [{ "uid": 80, "name": "Walls", "color": null, "icon": null, "active": true, "isOptional": false, "rules": [ { "uid": 82, "active": true, @@ -341,7 +345,8 @@ "requiredTags": [], "excludedTags": [], "intGridValues": [], - "autoRuleGroups": [{ "uid": 91, "name": "Background", "active": true, "isOptional": false, "rules": [ + "intGridValuesGroups": [], + "autoRuleGroups": [{ "uid": 91, "name": "Background", "color": null, "icon": null, "active": true, "isOptional": false, "rules": [ { "uid": 93, "active": true, @@ -436,6 +441,7 @@ "tilesetId": 31, "tileRenderMode": "FitInside", "tileRect": { "tilesetUid": 31, "x": 64, "y": 2720, "w": 32, "h": 32 }, + "uiTileRect": null, "nineSliceBorders": [], "maxCount": 0, "limitScope": "PerLevel", @@ -457,6 +463,7 @@ "editorDisplayScale": 1, "editorDisplayPos": "Above", "editorLinkStyle": "StraightArrow", + "editorDisplayColor": null, "editorAlwaysShow": false, "editorShowInWorld": true, "editorCutLongValues": true, @@ -491,6 +498,7 @@ "editorDisplayScale": 1, "editorDisplayPos": "Above", "editorLinkStyle": "StraightArrow", + "editorDisplayColor": null, "editorAlwaysShow": false, "editorShowInWorld": true, "editorCutLongValues": true, @@ -525,6 +533,7 @@ "editorDisplayScale": 1, "editorDisplayPos": "Above", "editorLinkStyle": "StraightArrow", + "editorDisplayColor": null, "editorAlwaysShow": false, "editorShowInWorld": true, "editorCutLongValues": true, @@ -559,6 +568,7 @@ "editorDisplayScale": 1, "editorDisplayPos": "Above", "editorLinkStyle": "CurvedArrow", + "editorDisplayColor": null, "editorAlwaysShow": false, "editorShowInWorld": true, "editorCutLongValues": true, @@ -627,11 +637,11 @@ } } ], "enums": [{ "identifier": "Equipment", "uid": 2, "values": [ - { "id": "Helmet", "tileRect": { "tilesetUid": 31, "x": 0, "y": 32, "w": 32, "h": 32 }, "tileId": -1, "color": 12496031, "__tileSrcRect": [0,32,32,32] }, - { "id": "Armor", "tileRect": { "tilesetUid": 31, "x": 32, "y": 32, "w": 32, "h": 32 }, "tileId": -1, "color": 10777205, "__tileSrcRect": [32,32,32,32] }, - { "id": "Boots", "tileRect": { "tilesetUid": 31, "x": 64, "y": 32, "w": 32, "h": 32 }, "tileId": -1, "color": 8869439, "__tileSrcRect": [64,32,32,32] }, - { "id": "Sword", "tileRect": { "tilesetUid": 31, "x": 96, "y": 32, "w": 32, "h": 32 }, "tileId": -1, "color": 12363427, "__tileSrcRect": [96,32,32,32] }, - { "id": "Shield", "tileRect": { "tilesetUid": 31, "x": 128, "y": 32, "w": 32, "h": 32 }, "tileId": -1, "color": 10662597, "__tileSrcRect": [128,32,32,32] } + { "id": "Helmet", "tileRect": { "tilesetUid": 31, "x": 0, "y": 32, "w": 32, "h": 32 }, "color": 12496031 }, + { "id": "Armor", "tileRect": { "tilesetUid": 31, "x": 32, "y": 32, "w": 32, "h": 32 }, "color": 10777205 }, + { "id": "Boots", "tileRect": { "tilesetUid": 31, "x": 64, "y": 32, "w": 32, "h": 32 }, "color": 8869439 }, + { "id": "Sword", "tileRect": { "tilesetUid": 31, "x": 96, "y": 32, "w": 32, "h": 32 }, "color": 12363427 }, + { "id": "Shield", "tileRect": { "tilesetUid": 31, "x": 128, "y": 32, "w": 32, "h": 32 }, "color": 10662597 } ], "iconTilesetUid": 31, "externalRelPath": null, "externalFileChecksum": null, "tags": [] }], "externalEnums": [], "levelFields": [ { "identifier": "title", @@ -647,6 +657,7 @@ "editorDisplayScale": 1, "editorDisplayPos": "Above", "editorLinkStyle": "StraightArrow", + "editorDisplayColor": null, "editorAlwaysShow": false, "editorShowInWorld": true, "editorCutLongValues": true, @@ -724,6 +735,8 @@ "__tags": [], "__tile": { "tilesetUid": 31, "x": 64, "y": 2720, "w": 32, "h": 32 }, "__smartColor": "#FF0000", + "__worldX": 64, + "__worldY": 112, "iid": "69b312b0-c640-11ed-8b6c-8f6519e0d2b4", "width": 32, "height": 32, @@ -767,6 +780,8 @@ "__tags": [], "__tile": { "tilesetUid": 31, "x": 64, "y": 2720, "w": 32, "h": 32 }, "__smartColor": "#FF0000", + "__worldX": 96, + "__worldY": 160, "iid": "1a554610-c640-11ed-8b6c-15b1960faff2", "width": 16, "height": 16, @@ -803,6 +818,8 @@ "__tags": [], "__tile": { "tilesetUid": 31, "x": 64, "y": 2720, "w": 32, "h": 32 }, "__smartColor": "#FF0000", + "__worldX": 144, + "__worldY": 144, "iid": "1ac45b90-c640-11ed-8b6c-a59b01c5c306", "width": 16, "height": 16, @@ -839,6 +856,8 @@ "__tags": [], "__tile": { "tilesetUid": 31, "x": 64, "y": 2720, "w": 32, "h": 32 }, "__smartColor": "#FF0000", + "__worldX": 112, + "__worldY": 96, "iid": "1b396480-c640-11ed-8b6c-f56e35f68eb2", "width": 16, "height": 16, @@ -872,6 +891,8 @@ "__tags": [], "__tile": { "tilesetUid": 31, "x": 64, "y": 2720, "w": 32, "h": 32 }, "__smartColor": "#FF0000", + "__worldX": 192, + "__worldY": 128, "iid": "1b9232e0-c640-11ed-8b6c-ab2c2d42f439", "width": 16, "height": 16, @@ -905,6 +926,8 @@ "__tags": [], "__tile": { "tilesetUid": 31, "x": 64, "y": 2720, "w": 32, "h": 32 }, "__smartColor": "#FF0000", + "__worldX": 160, + "__worldY": 80, "iid": "240e2280-c640-11ed-8b6c-ad0787b6f408", "width": 16, "height": 16, diff --git a/assets/my_project.ldtk b/assets/my_project.ldtk index 7dbb80e2..6423375d 100644 --- a/assets/my_project.ldtk +++ b/assets/my_project.ldtk @@ -5,12 +5,12 @@ "doc": "https://ldtk.io/json", "schema": "https://ldtk.io/files/JSON_SCHEMA.json", "appAuthor": "Sebastien 'deepnight' Benard", - "appVersion": "1.3.3", + "appVersion": "1.4.1", "url": "https://ldtk.io" }, "iid": "369ed9c0-c640-11ed-bac6-cfa00fd378d5", - "jsonVersion": "1.3.3", - "appBuildId": 468555, + "jsonVersion": "1.4.1", + "appBuildId": 471698, "nextUid": 6, "identifierStyle": "Capitalize", "toc": [], @@ -22,6 +22,8 @@ "defaultPivotX": 0, "defaultPivotY": 0, "defaultGridSize": 16, + "defaultEntityWidth": 16, + "defaultEntityHeight": 16, "bgColor": "#40465B", "defaultLevelBgColor": "#696A79", "minifyJson": false, @@ -63,6 +65,7 @@ "requiredTags": [], "excludedTags": [], "intGridValues": [], + "intGridValuesGroups": [], "autoRuleGroups": [], "autoSourceLayerDefUid": null, "tilesetDefUid": null, @@ -93,6 +96,7 @@ "requiredTags": [], "excludedTags": [], "intGridValues": [], + "intGridValuesGroups": [], "autoRuleGroups": [], "autoSourceLayerDefUid": null, "tilesetDefUid": 1, @@ -125,6 +129,7 @@ "tilesetId": 5, "tileRenderMode": "FitInside", "tileRect": { "tilesetUid": 5, "x": 160, "y": 192, "w": 32, "h": 32 }, + "uiTileRect": null, "nineSliceBorders": [], "maxCount": 0, "limitScope": "PerLevel", @@ -232,6 +237,8 @@ "__tags": [], "__tile": { "tilesetUid": 5, "x": 160, "y": 192, "w": 32, "h": 32 }, "__smartColor": "#94D9B3", + "__worldX": 128, + "__worldY": 112, "iid": "cbcc78c0-8dc0-11ec-9045-d14d83e99362", "width": 64, "height": 64, @@ -246,6 +253,8 @@ "__tags": [], "__tile": { "tilesetUid": 5, "x": 160, "y": 192, "w": 32, "h": 32 }, "__smartColor": "#94D9B3", + "__worldX": 80, + "__worldY": 128, "iid": "cbcc78c1-8dc0-11ec-9045-3f386f00e6d6", "width": 32, "height": 32, diff --git a/src/ldtk/field_instance.rs b/src/ldtk/field_instance.rs index abd9e700..24fe34b9 100644 --- a/src/ldtk/field_instance.rs +++ b/src/ldtk/field_instance.rs @@ -7,7 +7,8 @@ use regex::Regex; use crate::ldtk::color; -#[derive(PartialEq, Debug, Clone, Serialize, Reflect)] +#[derive(Debug, Clone, Serialize, PartialEq, Reflect)] +#[serde(rename_all = "camelCase")] pub struct FieldInstance { /// Field definition identifier #[serde(rename = "__identifier")] @@ -37,12 +38,10 @@ pub struct FieldInstance { pub value: FieldValue, /// Reference of the **Field definition** UID - #[serde(rename = "defUid")] pub def_uid: i32, /// Editor internal raw values #[reflect(ignore)] - #[serde(rename = "realEditorValues")] pub real_editor_values: Vec>, } diff --git a/src/ldtk/mod.rs b/src/ldtk/mod.rs index 08e758ae..1ed36cfa 100644 --- a/src/ldtk/mod.rs +++ b/src/ldtk/mod.rs @@ -7,27 +7,23 @@ //! this plugin in the future. //! However, some usability concerns have been addressed. //! Any changes should be documented here for maintenance purposes: -//! 1. [serde] has been imported with `use` instead of `extern` -//! 2. All struct fields have been made public. -//! 3. [Copy], [Clone], [Default], [Debug], [Eq], [PartialEq], and [Reflect] have been derived -//! wherever possible. -//! 4. [i64] and [f64] have been changed to [i32] and [f32]. -//! 5. All enums have [Default] derived. The first variant is selected as default, exception for +//! 1. Comment at the top of the file has been replaced with this documentation. +//! 2. All enums have [Default] derived. The first variant is selected as default, exception for //! [LimitBehavior], [LimitScope], [RenderMode], [TileRenderMode], and [Type]. -//! 6. `Component` has been derived for [EntityInstance]. -//! 7. Documentation added for [EntityInstance], which required the unused import of [LdtkEntity]. -//! 8. [FieldInstance] has been moved to its own module, and is re-exported here. -//! 9. Comment at the top of the file has been replaced with this documentation. -//! 10. Some "coordinate" fields on [LevelBackgroundPosition], [EntityInstance], and [TileInstance] -//! have been changed from vectors to [IVec2] and [Vec2]. -//! 11. Some "color" fields on [LdtkJson], [EntityDefinition], [IntGridValueDefinition], -//! [LayerDefinition], [Level], and [EntityInstance] have been changed from [String]s to -//! [Color]. They also are given a serde attribute for using the "color" or "color::optional" -//! modules. -//! 12. All urls in docs have been changed to hyperlinks with `<>` -//! 13. `Reflect` has been derived for [Type]. -//! 14. `From<&EntityInstance>` implemented for [`EntityInstance]` -//! 15. [`LayerInstance::layer_instance_type`] changed from [`String`] to [`Type`]. +//! 3. [Copy], [Default], [Eq], [PartialEq], and [Reflect] have been derived wherever possible. +//! 4. [i64] and [f64] have been changed to [i32] and [f32]. +//! 5. `Component` has been derived for [EntityInstance]. +//! 6. Documentation added for [EntityInstance], which required the unused import of [LdtkEntity]. +//! 7. [FieldInstance] has been moved to its own module, and is re-exported here. +//! 8. Some "coordinate" fields on [LevelBackgroundPosition], [EntityInstance], and [TileInstance] +//! have been changed from vectors to [IVec2] and [Vec2]. +//! 9. Some "color" fields on [LdtkJson], [EntityDefinition], [IntGridValueDefinition], +//! [LayerDefinition], [Level], and [EntityInstance] have been changed from [String]s to +//! [Color]. They also are given a serde attribute for using the "color" or "color::optional" +//! modules. +//! 10. All urls in docs have been changed to hyperlinks with `<>` +//! 11. `From<&EntityInstance>` implemented for [`EntityInstance]` +//! 12. [`LayerInstance::layer_instance_type`] changed from [`String`] to [`Type`]. use bevy::{ prelude::{Color, Component, IVec2, Vec2}, @@ -56,7 +52,8 @@ pub use field_instance::*; /// 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). -#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize, Reflect)] +#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Reflect)] +#[serde(rename_all = "camelCase")] pub struct LdtkJson { /// This object is not actually used by LDtk. It ONLY exists to force explicit references to /// all types, to make sure QuickType finds them and integrate all of them. Otherwise, @@ -69,156 +66,131 @@ pub struct LdtkJson { /// Note that the build identifier is just the date of the release, so it's not unique to /// each user (one single global ID per LDtk public release), and as a result, completely /// anonymous. - #[serde(rename = "appBuildId")] pub app_build_id: f32, /// Number of backup files to keep, if the `backupOnSave` is TRUE - #[serde(rename = "backupLimit")] pub backup_limit: i32, /// If TRUE, an extra copy of the project will be created in a sub folder, when saving. - #[serde(rename = "backupOnSave")] pub backup_on_save: bool, /// Target relative path to store backup files - #[serde(rename = "backupRelPath")] pub backup_rel_path: Option, /// Project background color - #[serde(rename = "bgColor", with = "color")] + #[serde(with = "color")] pub bg_color: Color, /// An array of command lines that can be ran manually by the user - #[serde(rename = "customCommands")] pub custom_commands: Vec, + /// Default height for new entities + pub default_entity_height: i32, + + /// Default width for new entities + pub default_entity_width: i32, + /// Default grid size for new layers - #[serde(rename = "defaultGridSize")] pub default_grid_size: i32, /// Default background color of levels - #[serde(rename = "defaultLevelBgColor", with = "color")] + #[serde(with = "color")] pub default_level_bg_color: Color, /// **WARNING**: this field will move to the `worlds` array after the "multi-worlds" update. /// It will then be `null`. You can enable the Multi-worlds advanced project option to enable /// the change immediately.

Default new level height - #[serde(rename = "defaultLevelHeight")] pub default_level_height: Option, /// **WARNING**: this field will move to the `worlds` array after the "multi-worlds" update. /// It will then be `null`. You can enable the Multi-worlds advanced project option to enable /// the change immediately.

Default new level width - #[serde(rename = "defaultLevelWidth")] pub default_level_width: Option, /// Default X pivot (0 to 1) for new entities - #[serde(rename = "defaultPivotX")] pub default_pivot_x: f32, /// Default Y pivot (0 to 1) for new entities - #[serde(rename = "defaultPivotY")] pub default_pivot_y: f32, /// A structure containing all the definitions of this project - #[serde(rename = "defs")] pub defs: Definitions, /// If the project isn't in MultiWorlds mode, this is the IID of the internal "dummy" World. - #[serde(rename = "dummyWorldIid")] pub dummy_world_iid: String, /// If TRUE, the exported PNGs will include the level background (color or image). - #[serde(rename = "exportLevelBg")] pub export_level_bg: bool, /// **WARNING**: this deprecated value is no longer exported since version 0.9.3 Replaced /// by: `imageExportMode` - #[serde(rename = "exportPng")] pub export_png: Option, /// If TRUE, a Tiled compatible file will also be generated along with the LDtk JSON file /// (default is FALSE) - #[serde(rename = "exportTiled")] pub export_tiled: bool, /// If TRUE, one file will be saved for the project (incl. all its definitions) and one file /// in a sub-folder for each level. - #[serde(rename = "externalLevels")] pub external_levels: bool, /// An array containing various advanced flags (ie. options or other states). Possible /// values: `DiscardPreCsvIntGrid`, `ExportPreCsvIntGridFormat`, `IgnoreBackupSuggest`, /// `PrependIndexToLevelFileNames`, `MultiWorlds`, `UseMultilinesType` - #[serde(rename = "flags")] pub flags: Vec, /// Naming convention for Identifiers (first-letter uppercase, full uppercase etc.) Possible /// values: `Capitalize`, `Uppercase`, `Lowercase`, `Free` - #[serde(rename = "identifierStyle")] pub identifier_style: IdentifierStyle, /// Unique project identifier - #[serde(rename = "iid")] pub iid: String, /// "Image export" option when saving project. Possible values: `None`, `OneImagePerLayer`, /// `OneImagePerLevel`, `LayersAndLevels` - #[serde(rename = "imageExportMode")] pub image_export_mode: ImageExportMode, /// File format version - #[serde(rename = "jsonVersion")] pub json_version: String, /// The default naming convention for level identifiers. - #[serde(rename = "levelNamePattern")] pub level_name_pattern: String, /// All levels. The order of this array is only relevant in `LinearHorizontal` and /// `linearVertical` world layouts (see `worldLayout` value).
Otherwise, you should /// refer to the `worldX`,`worldY` coordinates of each Level. - #[serde(rename = "levels")] pub levels: Vec, /// If TRUE, the Json is partially minified (no indentation, nor line breaks, default is /// FALSE) - #[serde(rename = "minifyJson")] pub minify_json: bool, /// Next Unique integer ID available - #[serde(rename = "nextUid")] pub next_uid: i32, /// File naming pattern for exported PNGs - #[serde(rename = "pngFilePattern")] pub png_file_pattern: Option, /// If TRUE, a very simplified will be generated on saving, for quicker & easier engine /// integration. - #[serde(rename = "simplifiedExport")] pub simplified_export: bool, /// All instances of entities that have their `exportToToc` flag enabled are listed in this /// array. - #[serde(rename = "toc")] pub toc: Vec, /// This optional description is used by LDtk Samples to show up some informations and /// instructions. - #[serde(rename = "tutorialDesc")] pub tutorial_desc: Option, /// **WARNING**: this field will move to the `worlds` array after the "multi-worlds" update. /// It will then be `null`. You can enable the Multi-worlds advanced project option to enable /// the change immediately.

Height of the world grid in pixels. - #[serde(rename = "worldGridHeight")] pub world_grid_height: Option, /// **WARNING**: this field will move to the `worlds` array after the "multi-worlds" update. /// It will then be `null`. You can enable the Multi-worlds advanced project option to enable /// the change immediately.

Width of the world grid in pixels. - #[serde(rename = "worldGridWidth")] pub world_grid_width: Option, /// **WARNING**: this field will move to the `worlds` array after the "multi-worlds" update. @@ -226,7 +198,6 @@ pub struct LdtkJson { /// the change immediately.

An enum that describes how levels are organized in /// this project (ie. linearly or in a 2D space). Possible values: <`null`>, `Free`, /// `GridVania`, `LinearHorizontal`, `LinearVertical` - #[serde(rename = "worldLayout")] pub world_layout: Option, /// This array will be empty, unless you enable the Multi-Worlds in the project advanced @@ -238,20 +209,33 @@ pub struct LdtkJson { /// layout related values (eg. `worldGridWidth` etc).

If you want to start /// supporting this future update easily, please refer to this documentation: /// - #[serde(rename = "worlds")] pub worlds: Vec, } -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize, Reflect)] +#[derive(Debug, Clone, Serialize, Deserialize, Default, Eq, PartialEq, Reflect)] pub struct LdtkCustomCommand { - #[serde(rename = "command")] pub command: String, /// Possible values: `Manual`, `AfterLoad`, `BeforeSave`, `AfterSave` - #[serde(rename = "when")] pub when: When, } +/// Possible values: `Manual`, `AfterLoad`, `BeforeSave`, `AfterSave` +#[derive(Debug, Clone, Serialize, Deserialize, Copy, Default, Eq, PartialEq, Reflect)] +pub enum When { + #[default] + #[serde(rename = "AfterLoad")] + AfterLoad, + + #[serde(rename = "AfterSave")] + AfterSave, + + #[serde(rename = "BeforeSave")] + BeforeSave, + + Manual, +} + /// If you're writing your own LDtk importer, you should probably just ignore *most* stuff in /// the `defs` section, as it contains data that are mostly important to the editor. To keep /// you away from the `defs` section and avoid some unnecessary JSON parsing, important data @@ -260,172 +244,141 @@ pub struct LdtkCustomCommand { /// **Tilesets** and **Enums**. /// /// A structure containing all the definitions of this project -#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize, Reflect)] +#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Reflect)] +#[serde(rename_all = "camelCase")] pub struct Definitions { /// All entities definitions, including their custom fields - #[serde(rename = "entities")] pub entities: Vec, /// All internal enums - #[serde(rename = "enums")] pub enums: Vec, /// Note: external enums are exactly the same as `enums`, except they have a `relPath` to /// point to an external source file. - #[serde(rename = "externalEnums")] pub external_enums: Vec, /// All layer definitions - #[serde(rename = "layers")] pub layers: Vec, /// All custom fields available to all levels. - #[serde(rename = "levelFields")] pub level_fields: Vec, /// All tilesets - #[serde(rename = "tilesets")] pub tilesets: Vec, } -#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize, Reflect)] +#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Reflect)] +#[serde(rename_all = "camelCase")] pub struct EntityDefinition { /// Base entity color - #[serde(rename = "color", with = "color")] + #[serde(with = "color")] pub color: Color, /// User defined documentation for this element to provide help/tips to level designers. - #[serde(rename = "doc")] pub doc: Option, /// If enabled, all instances of this entity will be listed in the project "Table of content" /// object. - #[serde(rename = "exportToToc")] pub export_to_toc: bool, /// Array of field definitions - #[serde(rename = "fieldDefs")] pub field_defs: Vec, - #[serde(rename = "fillOpacity")] pub fill_opacity: f32, /// Pixel height - #[serde(rename = "height")] pub height: i32, - #[serde(rename = "hollow")] pub hollow: bool, /// User defined unique identifier - #[serde(rename = "identifier")] pub identifier: String, /// Only applies to entities resizable on both X/Y. If TRUE, the entity instance width/height /// will keep the same aspect ratio as the definition. - #[serde(rename = "keepAspectRatio")] pub keep_aspect_ratio: bool, /// Possible values: `DiscardOldOnes`, `PreventAdding`, `MoveLastOne` - #[serde(rename = "limitBehavior")] pub limit_behavior: LimitBehavior, /// If TRUE, the maxCount is a "per world" limit, if FALSE, it's a "per level". Possible /// values: `PerLayer`, `PerLevel`, `PerWorld` - #[serde(rename = "limitScope")] pub limit_scope: LimitScope, - #[serde(rename = "lineOpacity")] pub line_opacity: f32, /// Max instances count - #[serde(rename = "maxCount")] pub max_count: i32, /// Max pixel height (only applies if the entity is resizable on Y) - #[serde(rename = "maxHeight")] pub max_height: Option, /// Max pixel width (only applies if the entity is resizable on X) - #[serde(rename = "maxWidth")] pub max_width: Option, /// Min pixel height (only applies if the entity is resizable on Y) - #[serde(rename = "minHeight")] pub min_height: Option, /// Min pixel width (only applies if the entity is resizable on X) - #[serde(rename = "minWidth")] pub min_width: Option, /// An array of 4 dimensions for the up/right/down/left borders (in this order) when using /// 9-slice mode for `tileRenderMode`.
If the tileRenderMode is not NineSlice, then /// this array is empty.
See: - #[serde(rename = "nineSliceBorders")] pub nine_slice_borders: Vec, /// Pivot X coordinate (from 0 to 1.0) - #[serde(rename = "pivotX")] pub pivot_x: f32, /// Pivot Y coordinate (from 0 to 1.0) - #[serde(rename = "pivotY")] pub pivot_y: f32, /// Possible values: `Rectangle`, `Ellipse`, `Tile`, `Cross` - #[serde(rename = "renderMode")] pub render_mode: RenderMode, /// If TRUE, the entity instances will be resizable horizontally - #[serde(rename = "resizableX")] pub resizable_x: bool, /// If TRUE, the entity instances will be resizable vertically - #[serde(rename = "resizableY")] pub resizable_y: bool, /// Display entity name in editor - #[serde(rename = "showName")] pub show_name: bool, /// An array of strings that classifies this entity - #[serde(rename = "tags")] pub tags: Vec, /// **WARNING**: this deprecated value is no longer exported since version 1.2.0 Replaced /// by: `tileRect` - #[serde(rename = "tileId")] pub tile_id: Option, - #[serde(rename = "tileOpacity")] pub tile_opacity: f32, /// An object representing a rectangle from an existing Tileset - #[serde(rename = "tileRect")] pub tile_rect: Option, /// An enum describing how the the Entity tile is rendered inside the Entity bounds. Possible /// values: `Cover`, `FitInside`, `Repeat`, `Stretch`, `FullSizeCropped`, /// `FullSizeUncropped`, `NineSlice` - #[serde(rename = "tileRenderMode")] pub tile_render_mode: TileRenderMode, /// Tileset ID used for optional tile display - #[serde(rename = "tilesetId")] pub tileset_id: Option, /// Unique Int identifier - #[serde(rename = "uid")] pub uid: i32, + /// This tile overrides the one defined in `tileRect` in the UI + pub ui_tile_rect: Option, + /// Pixel width - #[serde(rename = "width")] pub width: i32, } /// This section is mostly only intended for the LDtk editor app itself. You can safely /// ignore it. -#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize, Reflect)] +#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Reflect)] +#[serde(rename_all = "camelCase")] pub struct FieldDefinition { /// Human readable value type. Possible values: `Int, Float, String, Bool, Color, /// ExternEnum.XXX, LocalEnum.XXX, Point, FilePath`.
If the field is an array, this @@ -437,112 +390,86 @@ pub struct FieldDefinition { /// Optional list of accepted file extensions for FilePath value type. Includes the dot: /// `.ext` - #[serde(rename = "acceptFileTypes")] pub accept_file_types: Option>, /// Possible values: `Any`, `OnlySame`, `OnlyTags`, `OnlySpecificEntity` - #[serde(rename = "allowedRefs")] pub allowed_refs: AllowedRefs, - #[serde(rename = "allowedRefsEntityUid")] pub allowed_refs_entity_uid: Option, - #[serde(rename = "allowedRefTags")] pub allowed_ref_tags: Vec, - #[serde(rename = "allowOutOfLevelRef")] pub allow_out_of_level_ref: bool, /// Array max length - #[serde(rename = "arrayMaxLength")] pub array_max_length: Option, /// Array min length - #[serde(rename = "arrayMinLength")] pub array_min_length: Option, - #[serde(rename = "autoChainRef")] pub auto_chain_ref: bool, /// TRUE if the value can be null. For arrays, TRUE means it can contain null values /// (exception: array of Points can't have null values). - #[serde(rename = "canBeNull")] pub can_be_null: bool, /// Default value if selected value is null or invalid. #[reflect(ignore)] - #[serde(rename = "defaultOverride")] pub default_override: Option, /// User defined documentation for this field to provide help/tips to level designers about /// accepted values. - #[serde(rename = "doc")] pub doc: Option, - #[serde(rename = "editorAlwaysShow")] pub editor_always_show: bool, - #[serde(rename = "editorCutLongValues")] pub editor_cut_long_values: bool, + pub editor_display_color: Option, + /// Possible values: `Hidden`, `ValueOnly`, `NameAndValue`, `EntityTile`, `LevelTile`, /// `Points`, `PointStar`, `PointPath`, `PointPathLoop`, `RadiusPx`, `RadiusGrid`, /// `ArrayCountWithLabel`, `ArrayCountNoLabel`, `RefLinkBetweenPivots`, /// `RefLinkBetweenCenters` - #[serde(rename = "editorDisplayMode")] pub editor_display_mode: EditorDisplayMode, /// Possible values: `Above`, `Center`, `Beneath` - #[serde(rename = "editorDisplayPos")] pub editor_display_pos: EditorDisplayPos, - #[serde(rename = "editorDisplayScale")] pub editor_display_scale: f32, /// Possible values: `ZigZag`, `StraightArrow`, `CurvedArrow`, `ArrowsLine`, `DashedLine` - #[serde(rename = "editorLinkStyle")] pub editor_link_style: EditorLinkStyle, - #[serde(rename = "editorShowInWorld")] pub editor_show_in_world: bool, - #[serde(rename = "editorTextPrefix")] pub editor_text_prefix: Option, - #[serde(rename = "editorTextSuffix")] pub editor_text_suffix: Option, /// User defined unique identifier - #[serde(rename = "identifier")] pub identifier: String, /// TRUE if the value is an array of multiple values - #[serde(rename = "isArray")] pub is_array: bool, /// Max limit for value, if applicable - #[serde(rename = "max")] pub max: Option, /// Min limit for value, if applicable - #[serde(rename = "min")] pub min: Option, /// Optional regular expression that needs to be matched to accept values. Expected format: /// `/some_reg_ex/g`, with optional "i" flag. - #[serde(rename = "regex")] pub regex: Option, - #[serde(rename = "symmetricalRef")] pub symmetrical_ref: bool, /// Possible values: <`null`>, `LangPython`, `LangRuby`, `LangJS`, `LangLua`, `LangC`, /// `LangHaxe`, `LangMarkdown`, `LangJson`, `LangXml`, `LangLog` - #[serde(rename = "textLanguageMode")] pub text_language_mode: Option, /// UID of the tileset used for a Tile - #[serde(rename = "tilesetUid")] pub tileset_uid: Option, /// Internal enum representing the possible field types. Possible values: F_Int, F_Float, @@ -551,210 +478,373 @@ pub struct FieldDefinition { pub purple_type: String, /// Unique Int identifier - #[serde(rename = "uid")] pub uid: i32, /// If TRUE, the color associated with this field will override the Entity or Level default /// color in the editor UI. For Enum fields, this would be the color associated to their /// values. - #[serde(rename = "useForSmartColor")] pub use_for_smart_color: bool, } +/// Possible values: `Any`, `OnlySame`, `OnlyTags`, `OnlySpecificEntity` +#[derive(Debug, Clone, Serialize, Deserialize, Copy, Default, Eq, PartialEq, Reflect)] +pub enum AllowedRefs { + #[default] + Any, + + #[serde(rename = "OnlySame")] + OnlySame, + + #[serde(rename = "OnlySpecificEntity")] + OnlySpecificEntity, + + #[serde(rename = "OnlyTags")] + OnlyTags, +} + +/// Possible values: `Hidden`, `ValueOnly`, `NameAndValue`, `EntityTile`, `LevelTile`, +/// `Points`, `PointStar`, `PointPath`, `PointPathLoop`, `RadiusPx`, `RadiusGrid`, +/// `ArrayCountWithLabel`, `ArrayCountNoLabel`, `RefLinkBetweenPivots`, +/// `RefLinkBetweenCenters` +#[derive(Debug, Clone, Serialize, Deserialize, Copy, Default, Eq, PartialEq, Reflect)] +pub enum EditorDisplayMode { + #[default] + #[serde(rename = "ArrayCountNoLabel")] + ArrayCountNoLabel, + + #[serde(rename = "ArrayCountWithLabel")] + ArrayCountWithLabel, + + #[serde(rename = "EntityTile")] + EntityTile, + + Hidden, + + #[serde(rename = "LevelTile")] + LevelTile, + + #[serde(rename = "NameAndValue")] + NameAndValue, + + #[serde(rename = "PointPath")] + PointPath, + + #[serde(rename = "PointPathLoop")] + PointPathLoop, + + #[serde(rename = "PointStar")] + PointStar, + + Points, + + #[serde(rename = "RadiusGrid")] + RadiusGrid, + + #[serde(rename = "RadiusPx")] + RadiusPx, + + #[serde(rename = "RefLinkBetweenCenters")] + RefLinkBetweenCenters, + + #[serde(rename = "RefLinkBetweenPivots")] + RefLinkBetweenPivots, + + #[serde(rename = "ValueOnly")] + ValueOnly, +} + +/// Possible values: `Above`, `Center`, `Beneath` +#[derive(Debug, Clone, Serialize, Deserialize, Copy, Default, Eq, PartialEq, Reflect)] +pub enum EditorDisplayPos { + #[default] + Above, + + Beneath, + + Center, +} + +/// Possible values: `ZigZag`, `StraightArrow`, `CurvedArrow`, `ArrowsLine`, `DashedLine` +#[derive(Debug, Clone, Serialize, Deserialize, Copy, Default, Eq, PartialEq, Reflect)] +pub enum EditorLinkStyle { + #[default] + #[serde(rename = "ArrowsLine")] + ArrowsLine, + + #[serde(rename = "CurvedArrow")] + CurvedArrow, + + #[serde(rename = "DashedLine")] + DashedLine, + + #[serde(rename = "StraightArrow")] + StraightArrow, + + #[serde(rename = "ZigZag")] + ZigZag, +} + +#[derive(Debug, Clone, Serialize, Deserialize, Copy, Default, Eq, PartialEq, Reflect)] +pub enum TextLanguageMode { + #[default] + #[serde(rename = "LangC")] + LangC, + + #[serde(rename = "LangHaxe")] + LangHaxe, + + #[serde(rename = "LangJS")] + LangJs, + + #[serde(rename = "LangJson")] + LangJson, + + #[serde(rename = "LangLog")] + LangLog, + + #[serde(rename = "LangLua")] + LangLua, + + #[serde(rename = "LangMarkdown")] + LangMarkdown, + + #[serde(rename = "LangPython")] + LangPython, + + #[serde(rename = "LangRuby")] + LangRuby, + + #[serde(rename = "LangXml")] + LangXml, +} + +/// Possible values: `DiscardOldOnes`, `PreventAdding`, `MoveLastOne` +#[derive(Debug, Clone, Serialize, Deserialize, Copy, Default, Eq, PartialEq, Reflect)] +pub enum LimitBehavior { + #[serde(rename = "DiscardOldOnes")] + DiscardOldOnes, + + #[default] + #[serde(rename = "MoveLastOne")] + MoveLastOne, + + #[serde(rename = "PreventAdding")] + PreventAdding, +} + +/// If TRUE, the maxCount is a "per world" limit, if FALSE, it's a "per level". Possible +/// values: `PerLayer`, `PerLevel`, `PerWorld` +#[derive(Debug, Clone, Serialize, Deserialize, Copy, Default, Eq, PartialEq, Reflect)] +pub enum LimitScope { + #[serde(rename = "PerLayer")] + PerLayer, + + #[default] + #[serde(rename = "PerLevel")] + PerLevel, + + #[serde(rename = "PerWorld")] + PerWorld, +} + +/// Possible values: `Rectangle`, `Ellipse`, `Tile`, `Cross` +#[derive(Debug, Clone, Serialize, Deserialize, Copy, Default, Eq, PartialEq, Reflect)] +pub enum RenderMode { + Cross, + + Ellipse, + + #[default] + Rectangle, + + Tile, +} + /// This object represents a custom sub rectangle in a Tileset image. -#[derive(Copy, Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize, Reflect)] +#[derive(Debug, Clone, Serialize, Deserialize, Copy, Default, Eq, PartialEq, Reflect)] +#[serde(rename_all = "camelCase")] pub struct TilesetRectangle { /// Height in pixels - #[serde(rename = "h")] pub h: i32, /// UID of the tileset - #[serde(rename = "tilesetUid")] pub tileset_uid: i32, /// Width in pixels - #[serde(rename = "w")] pub w: i32, /// X pixels coordinate of the top-left corner in the Tileset image - #[serde(rename = "x")] pub x: i32, /// Y pixels coordinate of the top-left corner in the Tileset image - #[serde(rename = "y")] pub y: i32, } -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize, Reflect)] +/// An enum describing how the the Entity tile is rendered inside the Entity bounds. Possible +/// values: `Cover`, `FitInside`, `Repeat`, `Stretch`, `FullSizeCropped`, +/// `FullSizeUncropped`, `NineSlice` +#[derive(Debug, Clone, Serialize, Deserialize, Copy, Default, Eq, PartialEq, Reflect)] +pub enum TileRenderMode { + Cover, + + #[default] + #[serde(rename = "FitInside")] + FitInside, + + #[serde(rename = "FullSizeCropped")] + FullSizeCropped, + + #[serde(rename = "FullSizeUncropped")] + FullSizeUncropped, + + #[serde(rename = "NineSlice")] + NineSlice, + + Repeat, + + Stretch, +} + +#[derive(Debug, Clone, Serialize, Deserialize, Default, Eq, PartialEq, Reflect)] +#[serde(rename_all = "camelCase")] pub struct EnumDefinition { - #[serde(rename = "externalFileChecksum")] pub external_file_checksum: Option, /// Relative path to the external file providing this Enum - #[serde(rename = "externalRelPath")] pub external_rel_path: Option, /// Tileset UID if provided - #[serde(rename = "iconTilesetUid")] pub icon_tileset_uid: Option, /// User defined unique identifier - #[serde(rename = "identifier")] pub identifier: String, /// An array of user-defined tags to organize the Enums - #[serde(rename = "tags")] pub tags: Vec, /// Unique Int identifier - #[serde(rename = "uid")] pub uid: i32, /// All possible enum values, with their optional Tile infos. - #[serde(rename = "values")] pub values: Vec, } -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize, Reflect)] +#[derive(Debug, Clone, Serialize, Deserialize, Default, Eq, PartialEq, Reflect)] +#[serde(rename_all = "camelCase")] pub struct EnumValueDefinition { - /// **WARNING**: this deprecated value will be *removed* completely on version 1.4.0+ - /// Replaced by: `tileRect` + /// **WARNING**: this deprecated value is no longer exported since version 1.4.0 Replaced + /// by: `tileRect` #[serde(rename = "__tileSrcRect")] pub tile_src_rect: Option>, /// Optional color - #[serde(rename = "color")] pub color: i32, /// Enum value - #[serde(rename = "id")] pub id: String, - /// **WARNING**: this deprecated value will be *removed* completely on version 1.4.0+ - /// Replaced by: `tileRect` - #[serde(rename = "tileId")] + /// **WARNING**: this deprecated value is no longer exported since version 1.4.0 Replaced + /// by: `tileRect` pub tile_id: Option, /// Optional tileset rectangle to represents this value - #[serde(rename = "tileRect")] pub tile_rect: Option, } -#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize, Reflect)] +#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Reflect)] +#[serde(rename_all = "camelCase")] pub struct LayerDefinition { /// Type of the layer (*IntGrid, Entities, Tiles or AutoLayer*) #[serde(rename = "__type")] pub layer_definition_type: String, /// Contains all the auto-layer rule definitions. - #[serde(rename = "autoRuleGroups")] pub auto_rule_groups: Vec, - #[serde(rename = "autoSourceLayerDefUid")] pub auto_source_layer_def_uid: Option, /// **WARNING**: this deprecated value is no longer exported since version 1.2.0 Replaced /// by: `tilesetDefUid` - #[serde(rename = "autoTilesetDefUid")] pub auto_tileset_def_uid: Option, /// Allow editor selections when the layer is not currently active. - #[serde(rename = "canSelectWhenInactive")] pub can_select_when_inactive: bool, /// Opacity of the layer (0 to 1.0) - #[serde(rename = "displayOpacity")] pub display_opacity: f32, /// User defined documentation for this element to provide help/tips to level designers. - #[serde(rename = "doc")] pub doc: Option, /// An array of tags to forbid some Entities in this layer - #[serde(rename = "excludedTags")] pub excluded_tags: Vec, /// Width and height of the grid in pixels - #[serde(rename = "gridSize")] pub grid_size: i32, /// Height of the optional "guide" grid in pixels - #[serde(rename = "guideGridHei")] pub guide_grid_hei: i32, /// Width of the optional "guide" grid in pixels - #[serde(rename = "guideGridWid")] pub guide_grid_wid: i32, - #[serde(rename = "hideFieldsWhenInactive")] pub hide_fields_when_inactive: bool, /// Hide the layer from the list on the side of the editor view. - #[serde(rename = "hideInList")] pub hide_in_list: bool, /// User defined unique identifier - #[serde(rename = "identifier")] pub identifier: String, /// Alpha of this layer when it is not the active one. - #[serde(rename = "inactiveOpacity")] pub inactive_opacity: f32, /// An array that defines extra optional info for each IntGrid value.
WARNING: the /// array order is not related to actual IntGrid values! As user can re-order IntGrid values /// freely, you may value "2" before value "1" in this array. - #[serde(rename = "intGridValues")] pub int_grid_values: Vec, + /// Group informations for IntGrid values + pub int_grid_values_groups: Vec, + /// Parallax horizontal factor (from -1 to 1, defaults to 0) which affects the scrolling /// speed of this layer, creating a fake 3D (parallax) effect. - #[serde(rename = "parallaxFactorX")] pub parallax_factor_x: f32, /// Parallax vertical factor (from -1 to 1, defaults to 0) which affects the scrolling speed /// of this layer, creating a fake 3D (parallax) effect. - #[serde(rename = "parallaxFactorY")] pub parallax_factor_y: f32, /// If true (default), a layer with a parallax factor will also be scaled up/down accordingly. - #[serde(rename = "parallaxScaling")] pub parallax_scaling: bool, /// X offset of the layer, in pixels (IMPORTANT: this should be added to the `LayerInstance` /// optional offset) - #[serde(rename = "pxOffsetX")] pub px_offset_x: i32, /// Y offset of the layer, in pixels (IMPORTANT: this should be added to the `LayerInstance` /// optional offset) - #[serde(rename = "pxOffsetY")] pub px_offset_y: i32, /// If TRUE, the content of this layer will be used when rendering levels in a simplified way /// for the world view - #[serde(rename = "renderInWorldView")] pub render_in_world_view: bool, /// An array of tags to filter Entities that can be added to this layer - #[serde(rename = "requiredTags")] pub required_tags: Vec, /// If the tiles are smaller or larger than the layer grid, the pivot value will be used to /// position the tile relatively its grid cell. - #[serde(rename = "tilePivotX")] pub tile_pivot_x: f32, /// If the tiles are smaller or larger than the layer grid, the pivot value will be used to /// position the tile relatively its grid cell. - #[serde(rename = "tilePivotY")] pub tile_pivot_y: f32, /// Reference to the default Tileset UID being used by this layer definition.
/// **WARNING**: some layer *instances* might use a different tileset. So most of the time, /// you should probably use the `__tilesetDefUid` value found in layer instances.
Note: /// since version 1.0.0, the old `autoTilesetDefUid` was removed and merged into this value. - #[serde(rename = "tilesetDefUid")] pub tileset_def_uid: Option, /// Type of the layer as Haxe Enum Possible values: `IntGrid`, `Entities`, `Tiles`, @@ -763,180 +853,200 @@ pub struct LayerDefinition { pub purple_type: Type, /// User defined color for the UI - #[serde(rename = "uiColor", with = "color::optional")] + #[serde(with = "color::optional")] pub ui_color: Option, /// Unique Int identifier - #[serde(rename = "uid")] pub uid: i32, } -#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize, Reflect)] +#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Reflect)] +#[serde(rename_all = "camelCase")] pub struct AutoLayerRuleGroup { - #[serde(rename = "active")] pub active: bool, /// *This field was removed in 1.0.0 and should no longer be used.* - #[serde(rename = "collapsed")] pub collapsed: Option, - #[serde(rename = "isOptional")] + pub color: Option, + + pub icon: Option, + pub is_optional: bool, - #[serde(rename = "name")] pub name: String, - #[serde(rename = "rules")] pub rules: Vec, - #[serde(rename = "uid")] pub uid: i32, - #[serde(rename = "usesWizard")] pub uses_wizard: bool, } /// This complex section isn't meant to be used by game devs at all, as these rules are /// completely resolved internally by the editor before any saving. You should just ignore /// this part. -#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize, Reflect)] +#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Reflect)] +#[serde(rename_all = "camelCase")] pub struct AutoLayerRuleDefinition { /// If FALSE, the rule effect isn't applied, and no tiles are generated. - #[serde(rename = "active")] pub active: bool, - #[serde(rename = "alpha")] pub alpha: f32, /// When TRUE, the rule will prevent other rules to be applied in the same cell if it matches /// (TRUE by default). - #[serde(rename = "breakOnMatch")] pub break_on_match: bool, /// Chances for this rule to be applied (0 to 1) - #[serde(rename = "chance")] pub chance: f32, /// Checker mode Possible values: `None`, `Horizontal`, `Vertical` - #[serde(rename = "checker")] pub checker: Checker, /// If TRUE, allow rule to be matched by flipping its pattern horizontally - #[serde(rename = "flipX")] pub flip_x: bool, /// If TRUE, allow rule to be matched by flipping its pattern vertically - #[serde(rename = "flipY")] pub flip_y: bool, /// Default IntGrid value when checking cells outside of level bounds - #[serde(rename = "outOfBoundsValue")] pub out_of_bounds_value: Option, /// Rule pattern (size x size) - #[serde(rename = "pattern")] pub pattern: Vec, /// If TRUE, enable Perlin filtering to only apply rule on specific random area - #[serde(rename = "perlinActive")] pub perlin_active: bool, - #[serde(rename = "perlinOctaves")] pub perlin_octaves: f32, - #[serde(rename = "perlinScale")] pub perlin_scale: f32, - #[serde(rename = "perlinSeed")] pub perlin_seed: f32, /// X pivot of a tile stamp (0-1) - #[serde(rename = "pivotX")] pub pivot_x: f32, /// Y pivot of a tile stamp (0-1) - #[serde(rename = "pivotY")] pub pivot_y: f32, /// Pattern width & height. Should only be 1,3,5 or 7. - #[serde(rename = "size")] pub size: i32, /// Array of all the tile IDs. They are used randomly or as stamps, based on `tileMode` value. - #[serde(rename = "tileIds")] pub tile_ids: Vec, /// Defines how tileIds array is used Possible values: `Single`, `Stamp` - #[serde(rename = "tileMode")] pub tile_mode: TileMode, /// Max random offset for X tile pos - #[serde(rename = "tileRandomXMax")] pub tile_random_x_max: i32, /// Min random offset for X tile pos - #[serde(rename = "tileRandomXMin")] pub tile_random_x_min: i32, /// Max random offset for Y tile pos - #[serde(rename = "tileRandomYMax")] pub tile_random_y_max: i32, /// Min random offset for Y tile pos - #[serde(rename = "tileRandomYMin")] pub tile_random_y_min: i32, /// Tile X offset - #[serde(rename = "tileXOffset")] pub tile_x_offset: i32, /// Tile Y offset - #[serde(rename = "tileYOffset")] pub tile_y_offset: i32, /// Unique Int identifier - #[serde(rename = "uid")] pub uid: i32, /// X cell coord modulo - #[serde(rename = "xModulo")] pub x_modulo: i32, /// X cell start offset - #[serde(rename = "xOffset")] pub x_offset: i32, /// Y cell coord modulo - #[serde(rename = "yModulo")] pub y_modulo: i32, /// Y cell start offset - #[serde(rename = "yOffset")] pub y_offset: i32, } +/// Checker mode Possible values: `None`, `Horizontal`, `Vertical` +#[derive(Debug, Clone, Serialize, Deserialize, Copy, Default, Eq, PartialEq, Reflect)] +pub enum Checker { + #[default] + Horizontal, + + None, + + Vertical, +} + +/// Defines how tileIds array is used Possible values: `Single`, `Stamp` +#[derive(Debug, Clone, Serialize, Deserialize, Copy, Default, Eq, PartialEq, Reflect)] +pub enum TileMode { + #[default] + Single, + + Stamp, +} + /// IntGrid value definition -#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize, Reflect)] +#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Reflect)] +#[serde(rename_all = "camelCase")] pub struct IntGridValueDefinition { - #[serde(rename = "color", with = "color")] + #[serde(with = "color")] pub color: Color, + /// Parent group identifier (0 if none) + pub group_uid: i32, + /// User defined unique identifier - #[serde(rename = "identifier")] pub identifier: Option, - #[serde(rename = "tile")] pub tile: Option, /// The IntGrid value itself - #[serde(rename = "value")] pub value: i32, } +/// IntGrid value group definition +#[derive(Debug, Clone, Serialize, Deserialize, Default, Eq, PartialEq, Reflect)] +pub struct IntGridValueGroupDefinition { + /// User defined color + pub color: Option, + + /// User defined string identifier + pub identifier: Option, + + /// Group unique ID + pub uid: i32, +} + +/// Type of the layer as Haxe Enum Possible values: `IntGrid`, `Entities`, `Tiles`, +/// `AutoLayer` +#[derive(Debug, Clone, Serialize, Deserialize, Copy, Default, Eq, PartialEq, Reflect)] +pub enum Type { + #[serde(rename = "AutoLayer")] + AutoLayer, + + Entities, + + #[serde(rename = "IntGrid")] + IntGrid, + + #[default] + Tiles, +} + /// The `Tileset` definition is the most important part among project definitions. It /// contains some extra informations about each integrated tileset. If you only had to parse /// one definition section, that would be the one. -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize, Reflect)] +#[derive(Debug, Clone, Serialize, Deserialize, Default, Eq, PartialEq, Reflect)] +#[serde(rename_all = "camelCase")] pub struct TilesetDefinition { /// Grid-based height #[serde(rename = "__cHei")] @@ -949,170 +1059,159 @@ pub struct TilesetDefinition { /// The following data is used internally for various optimizations. It's always synced with /// source image changes. #[reflect(ignore)] - #[serde(rename = "cachedPixelData")] pub cached_pixel_data: Option>>, /// An array of custom tile metadata - #[serde(rename = "customData")] pub custom_data: Vec, /// If this value is set, then it means that this atlas uses an internal LDtk atlas image /// instead of a loaded one. Possible values: <`null`>, `LdtkIcons` - #[serde(rename = "embedAtlas")] pub embed_atlas: Option, /// Tileset tags using Enum values specified by `tagsSourceEnumId`. This array contains 1 /// element per Enum value, which contains an array of all Tile IDs that are tagged with it. - #[serde(rename = "enumTags")] pub enum_tags: Vec, /// User defined unique identifier - #[serde(rename = "identifier")] pub identifier: String, /// Distance in pixels from image borders - #[serde(rename = "padding")] pub padding: i32, /// Image height in pixels - #[serde(rename = "pxHei")] pub px_hei: i32, /// Image width in pixels - #[serde(rename = "pxWid")] pub px_wid: i32, /// Path to the source file, relative to the current project JSON file
It can be null /// if no image was provided, or when using an embed atlas. - #[serde(rename = "relPath")] pub rel_path: Option, - #[reflect(ignore)] /// Array of group of tiles selections, only meant to be used in the editor - #[serde(rename = "savedSelections")] + #[reflect(ignore)] pub saved_selections: Vec>>, /// Space in pixels between all tiles - #[serde(rename = "spacing")] pub spacing: i32, /// An array of user-defined tags to organize the Tilesets - #[serde(rename = "tags")] pub tags: Vec, /// Optional Enum definition UID used for this tileset meta-data - #[serde(rename = "tagsSourceEnumUid")] pub tags_source_enum_uid: Option, - #[serde(rename = "tileGridSize")] pub tile_grid_size: i32, /// Unique Intidentifier - #[serde(rename = "uid")] pub uid: i32, } /// In a tileset definition, user defined meta-data of a tile. -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize, Reflect)] +#[derive(Debug, Clone, Serialize, Deserialize, Default, Eq, PartialEq, Reflect)] +#[serde(rename_all = "camelCase")] pub struct TileCustomMetadata { - #[serde(rename = "data")] pub data: String, - #[serde(rename = "tileId")] pub tile_id: i32, } +#[derive(Debug, Clone, Serialize, Deserialize, Copy, Default, Eq, PartialEq, Reflect)] +pub enum EmbedAtlas { + #[default] + #[serde(rename = "LdtkIcons")] + LdtkIcons, +} + /// In a tileset definition, enum based tag infos -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize, Reflect)] +#[derive(Debug, Clone, Serialize, Deserialize, Default, Eq, PartialEq, Reflect)] +#[serde(rename_all = "camelCase")] pub struct EnumTagValue { - #[serde(rename = "enumValueId")] pub enum_value_id: String, - #[serde(rename = "tileIds")] pub tile_ids: Vec, } +#[derive(Debug, Clone, Serialize, Deserialize, Copy, Default, Eq, PartialEq, Reflect)] +pub enum Flag { + #[default] + #[serde(rename = "DiscardPreCsvIntGrid")] + DiscardPreCsvIntGrid, + + #[serde(rename = "ExportPreCsvIntGridFormat")] + ExportPreCsvIntGridFormat, + + #[serde(rename = "IgnoreBackupSuggest")] + IgnoreBackupSuggest, + + #[serde(rename = "MultiWorlds")] + MultiWorlds, + + #[serde(rename = "PrependIndexToLevelFileNames")] + PrependIndexToLevelFileNames, + + #[serde(rename = "UseMultilinesType")] + UseMultilinesType, +} + /// This object is not actually used by LDtk. It ONLY exists to force explicit references to /// all types, to make sure QuickType finds them and integrate all of them. Otherwise, /// Quicktype will drop types that are not explicitely used. -#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize, Reflect)] +#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Reflect)] +#[serde(rename_all = "PascalCase")] pub struct ForcedRefs { - #[serde(rename = "AutoLayerRuleGroup")] pub auto_layer_rule_group: Option, - #[serde(rename = "AutoRuleDef")] pub auto_rule_def: Option, - #[serde(rename = "CustomCommand")] pub custom_command: Option, - #[serde(rename = "Definitions")] pub definitions: Option, - #[serde(rename = "EntityDef")] pub entity_def: Option, - #[serde(rename = "EntityInstance")] pub entity_instance: Option, - #[serde(rename = "EntityReferenceInfos")] pub entity_reference_infos: Option, - #[serde(rename = "EnumDef")] pub enum_def: Option, - #[serde(rename = "EnumDefValues")] pub enum_def_values: Option, - #[serde(rename = "EnumTagValue")] pub enum_tag_value: Option, - #[serde(rename = "FieldDef")] pub field_def: Option, - #[serde(rename = "FieldInstance")] pub field_instance: Option, - #[serde(rename = "GridPoint")] pub grid_point: Option, - #[serde(rename = "IntGridValueDef")] pub int_grid_value_def: Option, - #[serde(rename = "IntGridValueInstance")] + pub int_grid_value_group_def: Option, + pub int_grid_value_instance: Option, - #[serde(rename = "LayerDef")] pub layer_def: Option, - #[serde(rename = "LayerInstance")] pub layer_instance: Option, - #[serde(rename = "Level")] pub level: Option, - #[serde(rename = "LevelBgPosInfos")] pub level_bg_pos_infos: Option, - #[serde(rename = "NeighbourLevel")] pub neighbour_level: Option, - #[serde(rename = "TableOfContentEntry")] pub table_of_content_entry: Option, - #[serde(rename = "Tile")] pub tile: Option, - #[serde(rename = "TileCustomMetadata")] pub tile_custom_metadata: Option, - #[serde(rename = "TilesetDef")] pub tileset_def: Option, - #[serde(rename = "TilesetRect")] pub tileset_rect: Option, - #[serde(rename = "World")] pub world: Option, } @@ -1121,7 +1220,8 @@ pub struct ForcedRefs { /// When loading levels, you can flesh out LDtk entities in your own system by querying for /// `Added`. /// Or, you can hook into the entity's spawning process using [LdtkEntity]. -#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize, Component, Reflect)] +#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Reflect, Component)] +#[serde(rename_all = "camelCase")] pub struct EntityInstance { /// Grid-based coordinates (`[x,y]` format) #[serde(rename = "__grid")] @@ -1149,31 +1249,33 @@ pub struct EntityInstance { #[serde(rename = "__tile")] pub tile: Option, + /// X world coordinate in pixels + #[serde(rename = "__worldX")] + pub world_x: i32, + + /// Y world coordinate in pixels + #[serde(rename = "__worldY")] + pub world_y: i32, + /// Reference of the **Entity definition** UID - #[serde(rename = "defUid")] pub def_uid: i32, /// An array of all custom fields and their values. - #[serde(rename = "fieldInstances")] pub field_instances: Vec, /// Entity height in pixels. For non-resizable entities, it will be the same as Entity /// definition. - #[serde(rename = "height")] pub height: i32, /// Unique instance identifier - #[serde(rename = "iid")] pub iid: String, /// Pixel coordinates (`[x,y]` format) in current level coordinate space. Don't forget /// optional layer offsets, if they exist! - #[serde(rename = "px")] pub px: IVec2, /// Entity width in pixels. For non-resizable entities, it will be the same as Entity /// definition. - #[serde(rename = "width")] pub width: i32, } @@ -1184,50 +1286,45 @@ impl From<&EntityInstance> for EntityInstance { } /// This object describes the "location" of an Entity instance in the project worlds. -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize, Reflect)] +#[derive(Debug, Clone, Serialize, Deserialize, Default, Eq, PartialEq, Reflect)] +#[serde(rename_all = "camelCase")] pub struct ReferenceToAnEntityInstance { /// IID of the refered EntityInstance - #[serde(rename = "entityIid")] pub entity_iid: String, /// IID of the LayerInstance containing the refered EntityInstance - #[serde(rename = "layerIid")] pub layer_iid: String, /// IID of the Level containing the refered EntityInstance - #[serde(rename = "levelIid")] pub level_iid: String, /// IID of the World containing the refered EntityInstance - #[serde(rename = "worldIid")] pub world_iid: String, } /// This object is just a grid-based coordinate used in Field values. -#[derive(Copy, Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize, Reflect)] +#[derive(Debug, Clone, Serialize, Deserialize, Copy, Default, Eq, PartialEq, Reflect)] pub struct GridPoint { /// X grid-based coordinate - #[serde(rename = "cx")] pub cx: i32, /// Y grid-based coordinate - #[serde(rename = "cy")] pub cy: i32, } /// IntGrid value instance -#[derive(Copy, Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize, Reflect)] +#[derive(Debug, Clone, Serialize, Deserialize, Copy, Default, Eq, PartialEq, Reflect)] +#[serde(rename_all = "camelCase")] pub struct IntGridValueInstance { /// Coordinate ID in the layer grid - #[serde(rename = "coordId")] pub coord_id: i32, /// IntGrid value - #[serde(rename = "v")] pub v: i32, } -#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize, Reflect)] +#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Reflect)] +#[serde(rename_all = "camelCase")] pub struct LayerInstance { /// Grid-based height #[serde(rename = "__cHei")] @@ -1273,98 +1370,78 @@ pub struct LayerInstance { /// in display order (ie. 1st tile is beneath 2nd, which is beneath 3rd etc.).

/// Note: if multiple tiles are stacked in the same cell as the result of different rules, /// all tiles behind opaque ones will be discarded. - #[serde(rename = "autoLayerTiles")] pub auto_layer_tiles: Vec, - #[serde(rename = "entityInstances")] pub entity_instances: Vec, - #[serde(rename = "gridTiles")] pub grid_tiles: Vec, /// Unique layer instance identifier - #[serde(rename = "iid")] pub iid: String, /// **WARNING**: this deprecated value is no longer exported since version 1.0.0 Replaced /// by: `intGridCsv` - #[serde(rename = "intGrid")] pub int_grid: Option>, /// A list of all values in the IntGrid layer, stored in CSV format (Comma Separated /// Values).
Order is from left to right, and top to bottom (ie. first row from left to /// right, followed by second row, etc).
`0` means "empty cell" and IntGrid values /// start at 1.
The array size is `__cWid` x `__cHei` cells. - #[serde(rename = "intGridCsv")] pub int_grid_csv: Vec, /// Reference the Layer definition UID - #[serde(rename = "layerDefUid")] pub layer_def_uid: i32, /// Reference to the UID of the level containing this layer instance - #[serde(rename = "levelId")] pub level_id: i32, /// An Array containing the UIDs of optional rules that were enabled in this specific layer /// instance. - #[serde(rename = "optionalRules")] pub optional_rules: Vec, /// This layer can use another tileset by overriding the tileset UID here. - #[serde(rename = "overrideTilesetUid")] pub override_tileset_uid: Option, /// X offset in pixels to render this layer, usually 0 (IMPORTANT: this should be added to /// the `LayerDef` optional offset, so you should probably prefer using `__pxTotalOffsetX` /// which contains the total offset value) - #[serde(rename = "pxOffsetX")] pub px_offset_x: i32, /// Y offset in pixels to render this layer, usually 0 (IMPORTANT: this should be added to /// the `LayerDef` optional offset, so you should probably prefer using `__pxTotalOffsetX` /// which contains the total offset value) - #[serde(rename = "pxOffsetY")] pub px_offset_y: i32, /// Random seed used for Auto-Layers rendering - #[serde(rename = "seed")] pub seed: i32, /// Layer instance visibility - #[serde(rename = "visible")] pub visible: bool, } /// This structure represents a single tile from a given Tileset. -#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize, Reflect)] +#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Reflect)] pub struct TileInstance { /// Alpha/opacity of the tile (0-1, defaults to 1) - #[serde(rename = "a")] pub a: f32, /// Internal data used by the editor.
For auto-layer tiles: `[ruleId, coordId]`.
/// For tile-layer tiles: `[coordId]`. - #[serde(rename = "d")] pub d: Vec, /// "Flip bits", a 2-bits integer to represent the mirror transformations of the tile.
/// - Bit 0 = X flip
- Bit 1 = Y flip
Examples: f=0 (no flip), f=1 (X flip /// only), f=2 (Y flip only), f=3 (both flips) - #[serde(rename = "f")] pub f: i32, /// Pixel coordinates of the tile in the **layer** (`[x,y]` format). Don't forget optional /// layer offsets, if they exist! - #[serde(rename = "px")] pub px: IVec2, /// Pixel coordinates of the tile in the **tileset** (`[x,y]` format) - #[serde(rename = "src")] pub src: IVec2, /// The *Tile ID* in the corresponding tileset. - #[serde(rename = "t")] pub t: i32, } @@ -1376,7 +1453,8 @@ pub struct TileInstance { /// except heavy sections, like the `layerInstances` array (which will be null). The /// `externalRelPath` string points to the `ldtkl` file. A `ldtkl` file is just a JSON file /// containing exactly what is described below. -#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize, Reflect)] +#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Reflect)] +#[serde(rename_all = "camelCase")] pub struct Level { /// Background color of the level (same as `bgColor`, except the default value is /// automatically used here if its value is `null`) @@ -1387,9 +1465,10 @@ pub struct Level { #[serde(rename = "__bgPos")] pub bg_pos: Option, - /// An array listing all other levels touching this one on the world map.
Only relevant - /// for world layouts where level spatial positioning is manual (ie. GridVania, Free). For - /// Horizontal and Vertical layouts, this array is always empty. + /// 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. #[serde(rename = "__neighbours")] pub neighbours: Vec, @@ -1404,11 +1483,9 @@ pub struct Level { pub level_bg_color: Option, /// Background image X pivot (0-1) - #[serde(rename = "bgPivotX")] pub bg_pivot_x: f32, /// Background image Y pivot (0-1) - #[serde(rename = "bgPivotY")] pub bg_pivot_y: f32, /// An enum defining the way the background image (if any) is positioned on the level. See @@ -1418,481 +1495,151 @@ pub struct Level { pub level_bg_pos: Option, /// The *optional* relative path to the level background image. - #[serde(rename = "bgRelPath")] pub bg_rel_path: Option, /// 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. - #[serde(rename = "externalRelPath")] pub external_rel_path: Option, /// An array containing this level custom field values. - #[serde(rename = "fieldInstances")] pub field_instances: Vec, /// User defined unique identifier - #[serde(rename = "identifier")] pub identifier: String, /// Unique instance identifier - #[serde(rename = "iid")] pub iid: String, /// An array containing all Layer instances. **IMPORTANT**: if the project option "*Save /// levels separately*" is enabled, this field will be `null`.
This array is **sorted /// in display order**: the 1st layer is the top-most and the last is behind. - #[serde(rename = "layerInstances")] pub layer_instances: Option>, /// Height of the level in pixels - #[serde(rename = "pxHei")] pub px_hei: i32, /// Width of the level in pixels - #[serde(rename = "pxWid")] pub px_wid: i32, /// Unique Int identifier - #[serde(rename = "uid")] pub uid: i32, /// If TRUE, the level identifier will always automatically use the naming pattern as defined /// in `Project.levelNamePattern`. Becomes FALSE if the identifier is manually modified by /// user. - #[serde(rename = "useAutoIdentifier")] pub use_auto_identifier: bool, /// Index that represents the "depth" of the level in the world. Default is 0, greater means /// "above", lower means "below".
This value is mostly used for display only and is /// intended to make stacking of levels easier to manage. - #[serde(rename = "worldDepth")] pub world_depth: i32, /// World X coordinate in pixels.
Only relevant for world layouts where level spatial /// positioning is manual (ie. GridVania, Free). For Horizontal and Vertical layouts, the /// value is always -1 here. - #[serde(rename = "worldX")] pub world_x: i32, /// World Y coordinate in pixels.
Only relevant for world layouts where level spatial /// positioning is manual (ie. GridVania, Free). For Horizontal and Vertical layouts, the /// value is always -1 here. - #[serde(rename = "worldY")] pub world_y: i32, } /// Level background image position info -#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize, Reflect)] +#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Reflect)] +#[serde(rename_all = "camelCase")] pub struct LevelBackgroundPosition { /// 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 ]` - #[serde(rename = "cropRect")] pub crop_rect: Vec, /// An array containing the `[scaleX,scaleY]` values of the **cropped** background image, /// depending on `bgPos` option. - #[serde(rename = "scale")] pub scale: Vec2, /// An array containing the `[x,y]` pixel coordinates of the top-left corner of the /// **cropped** background image, depending on `bgPos` option. - #[serde(rename = "topLeftPx")] pub top_left_px: IVec2, } +#[derive(Debug, Clone, Serialize, Deserialize, Copy, Default, Eq, PartialEq, Reflect)] +pub enum BgPos { + #[default] + Contain, + + Cover, + + #[serde(rename = "CoverDirty")] + CoverDirty, + + Repeat, + + Unscaled, +} + /// Nearby level info -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize, Reflect)] +#[derive(Debug, Clone, Serialize, Deserialize, Default, Eq, PartialEq, Reflect)] +#[serde(rename_all = "camelCase")] pub struct NeighbourLevel { /// A single lowercase character tipping on the level location (`n`orth, `s`outh, `w`est, - /// `e`ast). - #[serde(rename = "dir")] + /// `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). pub dir: String, /// Neighbour Instance Identifier - #[serde(rename = "levelIid")] pub level_iid: String, /// **WARNING**: this deprecated value is no longer exported since version 1.2.0 Replaced /// by: `levelIid` - #[serde(rename = "levelUid")] pub level_uid: Option, } -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize, Reflect)] +#[derive(Debug, Clone, Serialize, Deserialize, Default, Eq, PartialEq, Reflect)] pub struct LdtkTableOfContentEntry { - #[serde(rename = "identifier")] pub identifier: String, - #[serde(rename = "instances")] pub instances: Vec, } /// **IMPORTANT**: this type is available as a preview. You can rely on it to update your /// importers, for when it will be officially available. A World contains multiple levels, /// and it has its own layout settings. -#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize, Reflect)] +#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Reflect)] +#[serde(rename_all = "camelCase")] pub struct World { /// Default new level height - #[serde(rename = "defaultLevelHeight")] pub default_level_height: i32, /// Default new level width - #[serde(rename = "defaultLevelWidth")] pub default_level_width: i32, /// User defined unique identifier - #[serde(rename = "identifier")] pub identifier: String, /// Unique instance identifer - #[serde(rename = "iid")] pub iid: String, /// All levels from this world. The order of this array is only relevant in /// `LinearHorizontal` and `linearVertical` world layouts (see `worldLayout` value). /// Otherwise, you should refer to the `worldX`,`worldY` coordinates of each Level. - #[serde(rename = "levels")] pub levels: Vec, /// Height of the world grid in pixels. - #[serde(rename = "worldGridHeight")] pub world_grid_height: i32, /// Width of the world grid in pixels. - #[serde(rename = "worldGridWidth")] pub world_grid_width: i32, /// An enum that describes how levels are organized in this project (ie. linearly or in a 2D /// space). Possible values: `Free`, `GridVania`, `LinearHorizontal`, `LinearVertical`, `null` - #[serde(rename = "worldLayout")] pub world_layout: Option, } -/// Possible values: `Manual`, `AfterLoad`, `BeforeSave`, `AfterSave` -#[derive(Copy, Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize, Reflect)] -pub enum When { - #[default] - #[serde(rename = "AfterLoad")] - AfterLoad, - - #[serde(rename = "AfterSave")] - AfterSave, - - #[serde(rename = "BeforeSave")] - BeforeSave, - - #[serde(rename = "Manual")] - Manual, -} - -/// Possible values: `Any`, `OnlySame`, `OnlyTags`, `OnlySpecificEntity` -#[derive(Copy, Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize, Reflect)] -pub enum AllowedRefs { - #[default] - #[serde(rename = "Any")] - Any, - - #[serde(rename = "OnlySame")] - OnlySame, - - #[serde(rename = "OnlySpecificEntity")] - OnlySpecificEntity, - - #[serde(rename = "OnlyTags")] - OnlyTags, -} - -/// Possible values: `Hidden`, `ValueOnly`, `NameAndValue`, `EntityTile`, `LevelTile`, -/// `Points`, `PointStar`, `PointPath`, `PointPathLoop`, `RadiusPx`, `RadiusGrid`, -/// `ArrayCountWithLabel`, `ArrayCountNoLabel`, `RefLinkBetweenPivots`, -/// `RefLinkBetweenCenters` -#[derive(Copy, Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize, Reflect)] -pub enum EditorDisplayMode { - #[default] - #[serde(rename = "ArrayCountNoLabel")] - ArrayCountNoLabel, - - #[serde(rename = "ArrayCountWithLabel")] - ArrayCountWithLabel, - - #[serde(rename = "EntityTile")] - EntityTile, - - #[serde(rename = "Hidden")] - Hidden, - - #[serde(rename = "LevelTile")] - LevelTile, - - #[serde(rename = "NameAndValue")] - NameAndValue, - - #[serde(rename = "PointPath")] - PointPath, - - #[serde(rename = "PointPathLoop")] - PointPathLoop, - - #[serde(rename = "PointStar")] - PointStar, - - #[serde(rename = "Points")] - Points, - - #[serde(rename = "RadiusGrid")] - RadiusGrid, - - #[serde(rename = "RadiusPx")] - RadiusPx, - - #[serde(rename = "RefLinkBetweenCenters")] - RefLinkBetweenCenters, - - #[serde(rename = "RefLinkBetweenPivots")] - RefLinkBetweenPivots, - - #[serde(rename = "ValueOnly")] - ValueOnly, -} - -/// Possible values: `Above`, `Center`, `Beneath` -#[derive(Copy, Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize, Reflect)] -pub enum EditorDisplayPos { - #[default] - #[serde(rename = "Above")] - Above, - - #[serde(rename = "Beneath")] - Beneath, - - #[serde(rename = "Center")] - Center, -} - -/// Possible values: `ZigZag`, `StraightArrow`, `CurvedArrow`, `ArrowsLine`, `DashedLine` -#[derive(Copy, Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize, Reflect)] -pub enum EditorLinkStyle { - #[default] - #[serde(rename = "ArrowsLine")] - ArrowsLine, - - #[serde(rename = "CurvedArrow")] - CurvedArrow, - - #[serde(rename = "DashedLine")] - DashedLine, - - #[serde(rename = "StraightArrow")] - StraightArrow, - - #[serde(rename = "ZigZag")] - ZigZag, -} - -#[derive(Copy, Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize, Reflect)] -pub enum TextLanguageMode { - #[default] - #[serde(rename = "LangC")] - LangC, - - #[serde(rename = "LangHaxe")] - LangHaxe, - - #[serde(rename = "LangJS")] - LangJs, - - #[serde(rename = "LangJson")] - LangJson, - - #[serde(rename = "LangLog")] - LangLog, - - #[serde(rename = "LangLua")] - LangLua, - - #[serde(rename = "LangMarkdown")] - LangMarkdown, - - #[serde(rename = "LangPython")] - LangPython, - - #[serde(rename = "LangRuby")] - LangRuby, - - #[serde(rename = "LangXml")] - LangXml, -} - -/// Possible values: `DiscardOldOnes`, `PreventAdding`, `MoveLastOne` -#[derive(Copy, Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize, Reflect)] -pub enum LimitBehavior { - #[serde(rename = "DiscardOldOnes")] - DiscardOldOnes, - - #[default] - #[serde(rename = "MoveLastOne")] - MoveLastOne, - - #[serde(rename = "PreventAdding")] - PreventAdding, -} - -/// If TRUE, the maxCount is a "per world" limit, if FALSE, it's a "per level". Possible -/// values: `PerLayer`, `PerLevel`, `PerWorld` -#[derive(Copy, Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize, Reflect)] -pub enum LimitScope { - #[serde(rename = "PerLayer")] - PerLayer, - - #[default] - #[serde(rename = "PerLevel")] - PerLevel, - - #[serde(rename = "PerWorld")] - PerWorld, -} - -/// Possible values: `Rectangle`, `Ellipse`, `Tile`, `Cross` -#[derive(Copy, Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize, Reflect)] -pub enum RenderMode { - #[serde(rename = "Cross")] - Cross, - - #[serde(rename = "Ellipse")] - Ellipse, - - #[default] - #[serde(rename = "Rectangle")] - Rectangle, - - #[serde(rename = "Tile")] - Tile, -} - -/// An enum describing how the the Entity tile is rendered inside the Entity bounds. Possible -/// values: `Cover`, `FitInside`, `Repeat`, `Stretch`, `FullSizeCropped`, -/// `FullSizeUncropped`, `NineSlice` -#[derive(Copy, Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize, Reflect)] -pub enum TileRenderMode { - #[serde(rename = "Cover")] - Cover, - - #[default] - #[serde(rename = "FitInside")] - FitInside, - - #[serde(rename = "FullSizeCropped")] - FullSizeCropped, - - #[serde(rename = "FullSizeUncropped")] - FullSizeUncropped, - - #[serde(rename = "NineSlice")] - NineSlice, - - #[serde(rename = "Repeat")] - Repeat, - - #[serde(rename = "Stretch")] - Stretch, -} - -/// Checker mode Possible values: `None`, `Horizontal`, `Vertical` -#[derive(Copy, Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize, Reflect)] -pub enum Checker { - #[default] - #[serde(rename = "Horizontal")] - Horizontal, - - #[serde(rename = "None")] - None, - - #[serde(rename = "Vertical")] - Vertical, -} - -/// Defines how tileIds array is used Possible values: `Single`, `Stamp` -#[derive(Copy, Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize, Reflect)] -pub enum TileMode { - #[default] - #[serde(rename = "Single")] - Single, - - #[serde(rename = "Stamp")] - Stamp, -} - -/// Type of the layer as Haxe Enum Possible values: `IntGrid`, `Entities`, `Tiles`, -/// `AutoLayer` -#[derive(Copy, Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize, Reflect)] -pub enum Type { - #[serde(rename = "AutoLayer")] - AutoLayer, - - #[serde(rename = "Entities")] - Entities, - - #[serde(rename = "IntGrid")] - IntGrid, - - #[default] - #[serde(rename = "Tiles")] - Tiles, -} - -#[derive(Copy, Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize, Reflect)] -pub enum EmbedAtlas { - #[default] - #[serde(rename = "LdtkIcons")] - LdtkIcons, -} - -#[derive(Copy, Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize, Reflect)] -pub enum Flag { - #[default] - #[serde(rename = "DiscardPreCsvIntGrid")] - DiscardPreCsvIntGrid, - - #[serde(rename = "ExportPreCsvIntGridFormat")] - ExportPreCsvIntGridFormat, - - #[serde(rename = "IgnoreBackupSuggest")] - IgnoreBackupSuggest, - - #[serde(rename = "MultiWorlds")] - MultiWorlds, - - #[serde(rename = "PrependIndexToLevelFileNames")] - PrependIndexToLevelFileNames, - - #[serde(rename = "UseMultilinesType")] - UseMultilinesType, -} - -#[derive(Copy, Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize, Reflect)] -pub enum BgPos { - #[default] - #[serde(rename = "Contain")] - Contain, - - #[serde(rename = "Cover")] - Cover, - - #[serde(rename = "CoverDirty")] - CoverDirty, - - #[serde(rename = "Repeat")] - Repeat, - - #[serde(rename = "Unscaled")] - Unscaled, -} - -#[derive(Copy, Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize, Reflect)] +#[derive(Debug, Clone, Serialize, Deserialize, Copy, Default, Eq, PartialEq, Reflect)] pub enum WorldLayout { #[default] - #[serde(rename = "Free")] Free, #[serde(rename = "GridVania")] @@ -1907,31 +1654,26 @@ pub enum WorldLayout { /// Naming convention for Identifiers (first-letter uppercase, full uppercase etc.) Possible /// values: `Capitalize`, `Uppercase`, `Lowercase`, `Free` -#[derive(Copy, Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize, Reflect)] +#[derive(Debug, Clone, Serialize, Deserialize, Copy, Default, Eq, PartialEq, Reflect)] pub enum IdentifierStyle { #[default] - #[serde(rename = "Capitalize")] Capitalize, - #[serde(rename = "Free")] Free, - #[serde(rename = "Lowercase")] Lowercase, - #[serde(rename = "Uppercase")] Uppercase, } /// "Image export" option when saving project. Possible values: `None`, `OneImagePerLayer`, /// `OneImagePerLevel`, `LayersAndLevels` -#[derive(Copy, Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize, Reflect)] +#[derive(Debug, Clone, Serialize, Deserialize, Copy, Default, Eq, PartialEq, Reflect)] pub enum ImageExportMode { #[default] #[serde(rename = "LayersAndLevels")] LayersAndLevels, - #[serde(rename = "None")] None, #[serde(rename = "OneImagePerLayer")]