fix: control UX — no default tool, launch loader, NPC layout

Deselect effect tools by default and on re-click, block the editor during session launch, and fix NPC overlay/window empty-state layout.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Ivan Fontosh
2026-07-25 14:41:27 +08:00
parent fed5674468
commit 9d82e74272
10 changed files with 88 additions and 57 deletions
+5
View File
@@ -3,6 +3,11 @@ import test from 'node:test';
import { EffectsStore } from './effectsStore';
void test('defaultTool: при старте инструмент не выбран', () => {
const store = new EffectsStore();
assert.equal(store.getState().tool.tool, 'none');
});
void test('pruneExpired: лёд не удаляется по времени', () => {
const store = new EffectsStore();
const createdAtMs = Date.now() - 365 * 24 * 60 * 60 * 1000;
+6 -1
View File
@@ -8,7 +8,12 @@ function nowMs(): number {
}
function defaultTool(): EffectToolState {
return { tool: 'fog', radiusN: 0.08, intensity: 0.6 };
return { tool: 'none', radiusN: 0.08, intensity: 0.6 };
}
/** Сброс выбранного инструмента (при старте сессии). */
export function effectsDefaultTool(): EffectToolState {
return defaultTool();
}
export class EffectsStore {
+3 -1
View File
@@ -19,7 +19,7 @@ import {
} from '../shared/project/projectZipExtension';
import type { Project } from '../shared/types';
import { EffectsStore } from './effects/effectsStore';
import { EffectsStore, effectsDefaultTool } from './effects/effectsStore';
import { SceneDarknessStore } from './effects/sceneDarknessStore';
import { SceneTrapsStore } from './sceneTraps/sceneTrapsStore';
import { installIpcRouter, registerHandler, setLicenseAssert } from './ipc/router';
@@ -378,6 +378,7 @@ async function main() {
registerHandler(ipcChannels.windows.openMultiWindow, () => {
sceneDarknessStore.resetSession();
sceneTrapsStore.resetSession();
effectsStore.dispatch({ kind: 'tool.set', tool: effectsDefaultTool() });
openMultiWindow();
const project = projectStore.getOpenProject();
if (project) {
@@ -386,6 +387,7 @@ async function main() {
}
emitSceneDarknessState();
emitSceneTrapsState();
emitEffectsState();
return { ok: true };
});
registerHandler(ipcChannels.windows.closeMultiWindow, () => {