diff --git a/src/lib/compiler/compileData.ts b/src/lib/compiler/compileData.ts index fb397ac1c..c5595bc2e 100755 --- a/src/lib/compiler/compileData.ts +++ b/src/lib/compiler/compileData.ts @@ -975,7 +975,7 @@ export const precompileScenes = ( if (!backgroundWithCommonTileset) { warnings( - `Scene #${sceneIndex + 1} ${ + `Error in scene '${scene.symbol}' : ${ scene.name ? `'${scene.name}'` : "" } includes a common tileset that can't be located.` ); @@ -989,7 +989,7 @@ export const precompileScenes = ( if (!background) { throw new Error( - `Scene #${sceneIndex + 1} ${ + `Error in scene '${scene.symbol}' : ${ scene.name ? `'${scene.name}'` : "" } has missing or no background assigned.` ); @@ -999,7 +999,7 @@ export const precompileScenes = ( if (scene.actors.length > MAX_ACTORS) { warnings( - `Scene #${sceneIndex + 1} ${ + `Error in scene '${scene.symbol}' : ${ scene.name ? `'${scene.name}'` : "" } contains ${ scene.actors.length @@ -1009,7 +1009,7 @@ export const precompileScenes = ( if (scene.triggers.length > MAX_TRIGGERS) { warnings( - `Scene #${sceneIndex + 1} ${ + `Error in scene '${scene.symbol}' : ${ scene.name ? `'${scene.name}'` : "" } contains ${ scene.triggers.length diff --git a/src/store/features/console/consoleMiddleware.ts b/src/store/features/console/consoleMiddleware.ts index fb294b6c0..cb7758190 100644 --- a/src/store/features/console/consoleMiddleware.ts +++ b/src/store/features/console/consoleMiddleware.ts @@ -70,7 +70,7 @@ const getLinkToSymbol = ( } const scene = allScenes.find((s) => { - return symbol.startsWith(`${s.symbol}_`); + return symbol.startsWith(s.symbol); }); if (scene) { @@ -135,6 +135,23 @@ const consoleMiddleware: Middleware = }); } } + } else if (action.payload.text.startsWith("Error in scene")) { + const symbol = action.payload.text.match( + /Error in scene '([^']*)'/ + )?.[1]; + if (symbol) { + const state = store.getState(); + const link = getLinkToSymbol(symbol, state); + if (link) { + return next({ + ...action, + payload: { + text: action.payload.text, + link, + }, + }); + } + } } else if (action.payload.text.includes("removing")) { const symbol = action.payload.text.match( /removing .*[\\/]([^\\/]*).o/