From e8c643111c0bc50821a31fffcf355d8fe1d4e785 Mon Sep 17 00:00:00 2001 From: PhaserEditor2D Date: Sun, 1 Nov 2020 07:02:03 -0500 Subject: [PATCH 1/2] Fixes atlas thumbnail generation when atlas URL is pointing to a missing file. --- CHANGELOG.MD | 7 +++++++ source/editor/plugins/phasereditor2d.ide/src/IDEPlugin.ts | 2 +- .../plugins/phasereditor2d.pack/src/core/AssetPackItem.ts | 7 ++++++- .../src/core/ImageFrameContainerAssetPackItem.ts | 6 +++++- .../src/core/MultiAtlasAssetPackItem.ts | 1 - 5 files changed, 19 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index d5bcc90ce..e68802dce 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -1,5 +1,12 @@ # Change Log + +## Version 3.8.1 - Nov 1, 2020 + +### Fixed + +* Fixes atlas thumbnail generation when atlas URL is pointing to a missing file. + ## Version 3.8.0 - Oct 30, 2020 ### Added diff --git a/source/editor/plugins/phasereditor2d.ide/src/IDEPlugin.ts b/source/editor/plugins/phasereditor2d.ide/src/IDEPlugin.ts index 4fd25bec4..8f8016b56 100644 --- a/source/editor/plugins/phasereditor2d.ide/src/IDEPlugin.ts +++ b/source/editor/plugins/phasereditor2d.ide/src/IDEPlugin.ts @@ -289,7 +289,7 @@ namespace phasereditor2d.ide { /* program entry point */ - export const VER = "3.8.0"; + export const VER = "3.8.0-next"; async function main() { diff --git a/source/editor/plugins/phasereditor2d.pack/src/core/AssetPackItem.ts b/source/editor/plugins/phasereditor2d.pack/src/core/AssetPackItem.ts index 15b537081..b7345b603 100644 --- a/source/editor/plugins/phasereditor2d.pack/src/core/AssetPackItem.ts +++ b/source/editor/plugins/phasereditor2d.pack/src/core/AssetPackItem.ts @@ -46,8 +46,13 @@ namespace phasereditor2d.pack.core { protected addFilesFromUrls(files: Set, urls: string[]) { for (const url of urls) { + const file = AssetPackUtils.getFileFromPackUrl(url); - files.add(file); + + if (file) { + + files.add(file); + } } } diff --git a/source/editor/plugins/phasereditor2d.pack/src/core/ImageFrameContainerAssetPackItem.ts b/source/editor/plugins/phasereditor2d.pack/src/core/ImageFrameContainerAssetPackItem.ts index 96a5f1df0..d907af48f 100644 --- a/source/editor/plugins/phasereditor2d.pack/src/core/ImageFrameContainerAssetPackItem.ts +++ b/source/editor/plugins/phasereditor2d.pack/src/core/ImageFrameContainerAssetPackItem.ts @@ -65,7 +65,11 @@ namespace phasereditor2d.pack.core { this.computeUsedFiles(files); - const key = [...files].map(file => file.getFullName() + "@" + file.getModTime()).join(","); + const key = [...files] + + .filter(file => file !== null && file !== undefined) + + .map(file => file.getFullName() + "@" + file.getModTime()).join(","); return key; } diff --git a/source/editor/plugins/phasereditor2d.pack/src/core/MultiAtlasAssetPackItem.ts b/source/editor/plugins/phasereditor2d.pack/src/core/MultiAtlasAssetPackItem.ts index ded2dbb1d..96ff5599d 100644 --- a/source/editor/plugins/phasereditor2d.pack/src/core/MultiAtlasAssetPackItem.ts +++ b/source/editor/plugins/phasereditor2d.pack/src/core/MultiAtlasAssetPackItem.ts @@ -2,7 +2,6 @@ namespace phasereditor2d.pack.core { import io = colibri.core.io; import ide = colibri.ui.ide; - import controls = colibri.ui.controls; export class MultiatlasAssetPackItem extends BaseAtlasAssetPackItem { From 945ce3014f6c6e19bc08bf5f9d38cd949d8af01a Mon Sep 17 00:00:00 2001 From: PhaserEditor2D Date: Sun, 1 Nov 2020 07:03:03 -0500 Subject: [PATCH 2/2] Update version to 3.8.1. --- source/editor/plugins/phasereditor2d.ide/src/IDEPlugin.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/editor/plugins/phasereditor2d.ide/src/IDEPlugin.ts b/source/editor/plugins/phasereditor2d.ide/src/IDEPlugin.ts index 8f8016b56..c46c18bb1 100644 --- a/source/editor/plugins/phasereditor2d.ide/src/IDEPlugin.ts +++ b/source/editor/plugins/phasereditor2d.ide/src/IDEPlugin.ts @@ -289,7 +289,7 @@ namespace phasereditor2d.ide { /* program entry point */ - export const VER = "3.8.0-next"; + export const VER = "3.8.1"; async function main() {