feat(scene): video map editor parity and help updates

Enable scene editor, overlays, effects, and darkness on video scenes; brighten GM trap markers; document snap, NPC types, materials, and control controls in RU/EN help.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Ivan Fontosh
2026-08-07 08:23:08 +08:00
parent 8d5a68c71e
commit 1fbaaa6e77
17 changed files with 443 additions and 98 deletions
+3 -1
View File
@@ -267,7 +267,9 @@ function emitScenePlayerTokensSessionState(): void {
function syncSceneDarknessForProject(project: Project): void {
const cacheKey = project.currentGraphNodeId ?? project.currentSceneId ?? null;
const scene = project.currentSceneId ? project.scenes[project.currentSceneId] : undefined;
const enabled = Boolean(scene?.darkenScene) && scene?.previewAssetType === 'image';
const enabled =
Boolean(scene?.darkenScene) &&
(scene?.previewAssetType === 'image' || scene?.previewAssetType === 'video');
sceneDarknessStore.switchScene(cacheKey, enabled);
}
+21 -1
View File
@@ -1,10 +1,30 @@
/**
* Lazy `sharp` load so a corrupt/missing native install does not crash Electron at import time.
* Call only from image-processing paths; errors are recoverable for the rest of the app.
*
* Note: main is bundled to CJS (esbuild). `import.meta.url` is empty there — prefer `__filename`.
*/
import { createRequire } from 'node:module';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
const require = createRequire(import.meta.url);
/**
* @returns {string}
*/
function requireBaseFilename() {
// CJS bundle / Electron main
if (typeof __filename === 'string' && __filename.length > 0) {
return __filename;
}
// Direct ESM (unit tests)
const metaUrl = import.meta.url;
if (typeof metaUrl === 'string' && metaUrl.startsWith('file:')) {
return fileURLToPath(metaUrl);
}
return path.join(process.cwd(), 'package.json');
}
const require = createRequire(requireBaseFilename());
/** @type {typeof import('sharp') | null} */
let cached = null;