From 93c0d6aa3b58ad386ba9ede8f7f953fe24778ac0 Mon Sep 17 00:00:00 2001 From: Cosmo Myzrail Gorynych Date: Mon, 10 Aug 2020 09:20:19 +1200 Subject: [PATCH 1/7] :bug: Fix loading error while migrating a project without tile layers to v1.4.0 --- src/js/migration/1.4.0.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/js/migration/1.4.0.js b/src/js/migration/1.4.0.js index 1415426df..17636c396 100644 --- a/src/js/migration/1.4.0.js +++ b/src/js/migration/1.4.0.js @@ -42,6 +42,10 @@ window.migrationProcess.push({ * Tile layers at rooms can now be extended and have an object `exts`. */ for (const room of project.rooms) { + if (!room.tiles) { + room.tiles = []; + continue; + } for (const layer of room.tiles) { layer.extends = layer.extends || {}; delete layer.exts; // Leftovers from development of v1.3.2 From 2f188ca4d839ec0d48bd9d995357fab86c9aa598 Mon Sep 17 00:00:00 2001 From: Cosmo Myzrail Gorynych Date: Mon, 10 Aug 2020 09:34:38 +1200 Subject: [PATCH 2/7] :bug: Fix indefinitive behavior after placing copies and switching to the properties tab in the room editor --- src/riotTags/rooms/room-editor.tag | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/riotTags/rooms/room-editor.tag b/src/riotTags/rooms/room-editor.tag index 2171a724e..7d83c631c 100644 --- a/src/riotTags/rooms/room-editor.tag +++ b/src/riotTags/rooms/room-editor.tag @@ -237,7 +237,7 @@ room-editor.panel.view this.tab = 'roomcopies'; this.changeTab = tab => () => { this.tab = tab; - if (tab === 'roombackgrounds') { + if (tab === 'roombackgrounds' || tab === 'properties') { this.roomUnpickType(); } }; From e3f096936c8c5c2fb2a78443a047dfad251f4a75 Mon Sep 17 00:00:00 2001 From: Cosmo Myzrail Gorynych Date: Mon, 10 Aug 2020 09:35:52 +1200 Subject: [PATCH 3/7] :bug: Fix type picker being empty right after opening the room editor --- src/riotTags/rooms/room-type-picker.tag | 29 ++++++++++++++++--------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/src/riotTags/rooms/room-type-picker.tag b/src/riotTags/rooms/room-type-picker.tag index f9e21a4f4..ad301e1ae 100644 --- a/src/riotTags/rooms/room-type-picker.tag +++ b/src/riotTags/rooms/room-type-picker.tag @@ -39,15 +39,6 @@ room-type-picker.room-editor-TypeSwatches.tabbed.tall this.getTypeTextureRevision = type => glob.texturemap[type.texture].g.lastmod; - this.updateTypeList = () => { - this.types = [...global.currentProject.types]; - this.types.sort((a, b) => a.name.localeCompare(b.name)); - this.fuseSearch(); - }; - var typesChanged = () => { - this.updateTypeList(); - this.update(); - }; window.signals.on('typesChanged', typesChanged); this.on('unmount', () => { window.signals.off('typesChanged', typesChanged); @@ -64,6 +55,10 @@ room-type-picker.room-editor-TypeSwatches.tabbed.tall }; const Fuse = require('fuse.js'); this.fuseSearch = e => { + if (!this.mounted) { + this.searchResults = null; + return; + } var val = (e ? e.target.value : this.refs.fusesearch.value).trim(); if (val) { var fuse = new Fuse(this.types, fuseOptions); @@ -76,4 +71,18 @@ room-type-picker.room-editor-TypeSwatches.tabbed.tall this.parent.currentType = type; this.parent.selectedCopies = false; }; - this.on('mount', this.updateTypeList); \ No newline at end of file + + this.updateTypeList = () => { + this.types = [...global.currentProject.types]; + this.types.sort((a, b) => a.name.localeCompare(b.name)); + this.fuseSearch(); + }; + this.updateTypeList(); + var typesChanged = () => { + this.updateTypeList(); + this.update(); + }; + + this.on('mount', () => { + this.mounted = true; + }); \ No newline at end of file From 3f3ba1b0061097e033db0283ff02f2626247d844 Mon Sep 17 00:00:00 2001 From: Cosmo Myzrail Gorynych Date: Mon, 10 Aug 2020 09:38:06 +1200 Subject: [PATCH 4/7] :bug: Icons in the room editor, on the left side, should be centered if no labels are shown next to them. --- src/riotTags/rooms/room-editor.tag | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/riotTags/rooms/room-editor.tag b/src/riotTags/rooms/room-editor.tag index 7d83c631c..bf51862f8 100644 --- a/src/riotTags/rooms/room-editor.tag +++ b/src/riotTags/rooms/room-editor.tag @@ -15,19 +15,19 @@ room-editor.panel.view li(onclick="{changeTab('roomcopies')}" title="{voc.copies}" class="{active: tab === 'roomcopies'}") svg.feather use(xlink:href="data/icons.svg#type") - span(show="{sidebarWidth > 500}") {voc.copies} + span(if="{sidebarWidth > 500}") {voc.copies} li(onclick="{changeTab('roombackgrounds')}" title="{voc.backgrounds}" class="{active: tab === 'roombackgrounds'}") svg.feather use(xlink:href="data/icons.svg#image") - span(show="{sidebarWidth > 500}") {voc.backgrounds} + span(if="{sidebarWidth > 500}") {voc.backgrounds} li(onclick="{changeTab('roomtiles')}" title="{voc.tiles}" class="{active: tab === 'roomtiles'}") svg.feather use(xlink:href="data/icons.svg#texture") - span(show="{sidebarWidth > 500}") {voc.tiles} + span(if="{sidebarWidth > 500}") {voc.tiles} li(onclick="{changeTab('properties')}" title="{voc.properties}" class="{active: tab === 'properties'}") svg.feather use(xlink:href="data/icons.svg#settings") - span(show="{sidebarWidth > 500}") {voc.properties} + span(if="{sidebarWidth > 500}") {voc.properties} .relative room-type-picker(show="{tab === 'roomcopies'}" current="{currentType}") room-backgrounds-editor(show="{tab === 'roombackgrounds'}" room="{room}") From dd4d70ab248b50304d6660a5f6ad3347162e5240 Mon Sep 17 00:00:00 2001 From: Cosmo Myzrail Gorynych Date: Mon, 10 Aug 2020 09:42:17 +1200 Subject: [PATCH 5/7] :bookmark: Bump version number --- app/package-lock.json | 2 +- app/package.json | 2 +- package-lock.json | 2 +- package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/package-lock.json b/app/package-lock.json index 3bda26f98..94c2209ef 100644 --- a/app/package-lock.json +++ b/app/package-lock.json @@ -1,6 +1,6 @@ { "name": "ctjs", - "version": "1.3.2", + "version": "1.4.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/app/package.json b/app/package.json index 1554138ed..dcff66c1a 100644 --- a/app/package.json +++ b/app/package.json @@ -2,7 +2,7 @@ "main": "index.html", "name": "ctjs", "description": "ct.js — a free 2D game engine", - "version": "1.4.0", + "version": "1.4.1", "homepage": "https://ctjs.rocks/", "author": { "name": "Cosmo Myzrail Gorynych", diff --git a/package-lock.json b/package-lock.json index ec32c2bd4..eff565937 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "ctjsbuildenvironment", - "version": "1.3.1", + "version": "1.4.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index bd6e6b810..b713f7472 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ctjsbuildenvironment", - "version": "1.4.0", + "version": "1.4.1", "description": "", "directories": { "doc": "docs" From f1d62ab00b743146d05e8daf8b48a9bdb74bac03 Mon Sep 17 00:00:00 2001 From: Cosmo Myzrail Gorynych Date: Mon, 10 Aug 2020 10:13:56 +1200 Subject: [PATCH 6/7] :bug: Fix regression with custom script typings: they were not loaded on project load --- src/js/loadProject.js | 8 ++++++++ src/riotTags/project-settings/scripts-setttings.tag | 7 ------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/js/loadProject.js b/src/js/loadProject.js index 3f359e3de..ee813f4ba 100644 --- a/src/js/loadProject.js +++ b/src/js/loadProject.js @@ -126,6 +126,14 @@ document.title = global.currentProject.settings.title + ' — ct.js'; } + glob.scriptTypings = {}; + for (const script of global.currentProject.scripts) { + glob.scriptTypings[script.name] = [ + monaco.languages.typescript.javascriptDefaults.addExtraLib(script.code), + monaco.languages.typescript.typescriptDefaults.addExtraLib(script.code) + ]; + } + const {loadAllTypedefs, resetTypedefs} = require('./data/node_requires/resources/modules/typedefs'); resetTypedefs(); loadAllTypedefs(); diff --git a/src/riotTags/project-settings/scripts-setttings.tag b/src/riotTags/project-settings/scripts-setttings.tag index b129710d4..cf36ec22e 100644 --- a/src/riotTags/project-settings/scripts-setttings.tag +++ b/src/riotTags/project-settings/scripts-setttings.tag @@ -25,13 +25,6 @@ scripts-settings this.currentProject.scripts = this.currentProject.scripts || []; const glob = require('./data/node_requires/glob'); - glob.scriptTypings = glob.scriptTypings || {}; - for (const script of global.currentProject.scripts) { - glob.scriptTypings[script.name] = [ - monaco.languages.typescript.javascriptDefaults.addExtraLib(script.code), - monaco.languages.typescript.typescriptDefaults.addExtraLib(script.code) - ]; - } this.addNewScript = () => { var script = { From 6d13523441bc9c10624a34dab49121ac7e5c1c5e Mon Sep 17 00:00:00 2001 From: Cosmo Myzrail Gorynych Date: Mon, 10 Aug 2020 10:20:58 +1200 Subject: [PATCH 7/7] :pencil: Update the changelog --- app/Changelog.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/Changelog.md b/app/Changelog.md index adae22be0..bb2b57c29 100644 --- a/app/Changelog.md +++ b/app/Changelog.md @@ -1,3 +1,15 @@ +## v1.4.1 + +*Sun Aug 10 2020* + +### 🐛 Bug Fixes + +* Fix indefinite behavior after placing copies and switching to the properties tab in the room editor +* Fix loading error while migrating a project without tile layers to v1.4.0 +* Fix regression with custom script typings: they were not loaded on project load +* Fix type picker being empty right after opening the room editor +* Icons in the room editor, on the left side, should be centered if no labels are shown next to them. + ## v1.4.0 *Sun Aug 09 2020*