From f6a14adaf750bfdf01d31f592fad40fa77ee487a Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Thu, 16 Jul 2020 21:08:05 -0400 Subject: [PATCH] Include custom names when exporting --- macrovision.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/macrovision.js b/macrovision.js index c2c7ee25..cdd21ed7 100644 --- a/macrovision.js +++ b/macrovision.js @@ -3465,6 +3465,7 @@ function exportScene() { const element = document.querySelector("#entity-" + key); results.entities.push({ name: entity.identifier, + customName: entity.name, scale: entity.scale, view: entity.view, x: element.dataset.x, @@ -3570,9 +3571,20 @@ const migrationDefs = [ entity.priority = 0; entity.brightness = 1; }); + }, + /* + Migration: 2 -> 3 + + Custom names are exported + */ + + data => { + data.entities.forEach(entity => { + entity.customName = entity.name + }); } ] - + function migrateScene(data) { if (data.version === undefined) { @@ -3593,6 +3605,7 @@ function importScene(data) { data.entities.forEach(entityInfo => { const entity = findEntity(entityInfo.name).constructor(); + entity.name = entityInfo.customName; entity.scale = entityInfo.scale; entity.priority = entityInfo.priority; entity.brightness = entityInfo.brightness;