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:
@@ -0,0 +1,48 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import test from 'node:test';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
const here = path.dirname(fileURLToPath(import.meta.url));
|
||||
const rendererRoot = path.resolve(here, '..');
|
||||
|
||||
void test('video scenes share map overlays / effects with image scenes', () => {
|
||||
const control = fs.readFileSync(path.join(rendererRoot, 'control/ControlApp.tsx'), 'utf8');
|
||||
const presentation = fs.readFileSync(path.join(rendererRoot, 'shared/PresentationView.tsx'), 'utf8');
|
||||
const sceneEditor = fs.readFileSync(path.join(rendererRoot, 'sceneEditor/SceneEditorApp.tsx'), 'utf8');
|
||||
const editor = fs.readFileSync(path.join(rendererRoot, 'editor/EditorApp.tsx'), 'utf8');
|
||||
const main = fs.readFileSync(path.join(rendererRoot, '../main/index.ts'), 'utf8');
|
||||
|
||||
assert.equal(control.includes('isVideoPreviewScene'), false);
|
||||
assert.ok(fs.readFileSync(path.join(rendererRoot, 'control/ControlScenePreview.tsx'), 'utf8').includes('ContainedVideo'));
|
||||
|
||||
assert.ok(presentation.includes('ContainedVideo'));
|
||||
assert.ok(presentation.includes("previewAssetType === 'video'"));
|
||||
assert.ok(presentation.includes('SceneTrapsOverlay'));
|
||||
assert.ok(presentation.includes('PixiEffectsOverlay'));
|
||||
assert.ok(presentation.includes('SceneDarknessOverlay'));
|
||||
|
||||
assert.ok(sceneEditor.includes('ContainedVideo'));
|
||||
assert.ok(sceneEditor.includes('hasMapMedia'));
|
||||
assert.ok(sceneEditor.includes('Нужно изображение или видео сцены'));
|
||||
|
||||
assert.ok(editor.includes("previewAssetType === 'image' || previewAssetType === 'video'"));
|
||||
assert.ok(editor.includes('windows.openSceneEditor'));
|
||||
|
||||
assert.ok(main.includes("scene?.previewAssetType === 'video'"));
|
||||
assert.ok(main.includes('syncSceneDarknessForProject'));
|
||||
assert.match(
|
||||
main,
|
||||
/darkenScene[\s\S]{0,120}previewAssetType === 'image'[\s\S]{0,80}previewAssetType === 'video'/,
|
||||
);
|
||||
});
|
||||
|
||||
void test('control traps: GM-hidden markers stay relatively bright', () => {
|
||||
const css = fs.readFileSync(
|
||||
path.join(rendererRoot, 'shared/traps/SceneTrapsOverlay.module.css'),
|
||||
'utf8',
|
||||
);
|
||||
assert.ok(css.includes('.trapGmHidden'));
|
||||
assert.doesNotMatch(css, /\.trapGmHidden\s*\{[^}]*opacity:\s*0\.[0-6]/);
|
||||
});
|
||||
Reference in New Issue
Block a user