Tabs are open documents: Scene, Game and Plugins stay as fixed tabs, every other asset opens in its own tab (double click or Enter in the asset panel, on creation, from the list button), several assets of one kind can be open at once, a tab is labelled with its kind dimmed before the name, cut at 160 px and renamed with its asset, closes with its x or a middle click and goes away when its asset is deleted; a tab always shows its own document instead of following the selection, the picker in the tab head is gone, zoom and scroll are kept per document for the session and dropped on close, a double click on a call node stays in the same tab with breadcrumbs per tab; one editor per kind is switched between documents, the placement rules live in the pure module documents.ts, and the test hook showTab stays as a compatibility path; new e2e module 44 documents (#171)
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4f546c0e08
commit
cc285af10a
33 files changed
+895
-225
No files matched your search
@@ -24,7 +24,7 @@ import { soundLibrary } from '../viewport/SoundLibrary';
|
||||
import { textureLibrary } from '../viewport/TextureLibrary';
|
||||
import { currentFramesDialog } from './animation/FramesDialog';
|
||||
import { currentRowDialog } from './animation/RowDialog';
|
||||
import type { Editor, TabId } from './Editor';
|
||||
import type { DocumentId, Editor, TabId } from './Editor';
|
||||
import { NodeBoard } from './plugins/NodeBoard';
|
||||
import { currentFontPicker } from './font/FontPicker';
|
||||
import { currentNodePalette } from './graph/NodePalette';
|
||||
@@ -365,15 +365,12 @@ export function installDebugHook(app: Application, state: EditorState, editor: E
|
||||
// The canvas, not the whole tab: a centre measured through the header sits above the
|
||||
// drawing area.
|
||||
center: () => centreOf(graphEditor.canvas),
|
||||
pickerWidth: () => graphEditor.picker.w,
|
||||
pickerAt: () => centreOf(graphEditor.picker),
|
||||
snapping: () => graphEditor.canvas.snapEnabled,
|
||||
zoom: () => graphEditor.canvas.zoomLevel,
|
||||
crumbs: () => graphEditor.breadcrumb.crumbsDrawn(),
|
||||
},
|
||||
stateMachine: {
|
||||
current: () => editor.stateMachineEditor.currentAssetId,
|
||||
pickerAt: () => centreOf(editor.stateMachineEditor.picker),
|
||||
nodeAt: (nodeId: string) => editor.stateMachineEditor.canvas.nodeGlobal(nodeId),
|
||||
nodeLabel: (nodeId: string) => editor.stateMachineEditor.canvas.nodeLabel(nodeId),
|
||||
nodeRect: (nodeId: string) => editor.stateMachineEditor.canvas.nodeRect(nodeId),
|
||||
@@ -401,7 +398,6 @@ export function installDebugHook(app: Application, state: EditorState, editor: E
|
||||
},
|
||||
particles: {
|
||||
current: () => editor.particlesEditor.currentAssetId,
|
||||
pickerAt: () => centreOf(editor.particlesEditor.picker),
|
||||
info: () => editor.particlesEditor.shownInfo,
|
||||
nodeAt: (nodeId: string) => editor.particlesEditor.canvas.nodeGlobal(nodeId),
|
||||
nodeLabel: (nodeId: string) => editor.particlesEditor.canvas.nodeLabel(nodeId),
|
||||
@@ -426,7 +422,6 @@ export function installDebugHook(app: Application, state: EditorState, editor: E
|
||||
},
|
||||
shader: {
|
||||
current: () => editor.shaderEditor.currentAssetId,
|
||||
pickerAt: () => centreOf(editor.shaderEditor.picker),
|
||||
info: () => editor.shaderEditor.shownInfo,
|
||||
nodeAt: (nodeId: string) => editor.shaderEditor.canvas.nodeGlobal(nodeId),
|
||||
nodeLabel: (nodeId: string) => editor.shaderEditor.canvas.nodeLabel(nodeId),
|
||||
@@ -474,7 +469,6 @@ export function installDebugHook(app: Application, state: EditorState, editor: E
|
||||
gameTextInfo: (id: string) => gameView.textInfo(id),
|
||||
texture: {
|
||||
current: () => textureEditor.currentAssetId,
|
||||
pickerWidth: () => textureEditor.picker.w,
|
||||
/** Where an image pixel of the shown sheet sits on screen (frames are dragged in image coordinates). */
|
||||
pointAt: (x: number, y: number) => textureEditor.imageToScreen(x, y),
|
||||
rect: () => textureEditor.canvasRect(),
|
||||
@@ -630,7 +624,6 @@ export function installDebugHook(app: Application, state: EditorState, editor: E
|
||||
},
|
||||
container: {
|
||||
current: () => containerEditor.currentAssetId,
|
||||
pickerWidth: () => containerEditor.picker.w,
|
||||
center: () => centreOf(containerEditor),
|
||||
rect: () => containerEditor.canvasRect(),
|
||||
/** Where a template object is drawn, so a check can click or sample it. */
|
||||
@@ -782,6 +775,10 @@ export function installDebugHook(app: Application, state: EditorState, editor: E
|
||||
?.desynchronized === true,
|
||||
tab: () => editor.tab,
|
||||
showTab: (tab: TabId) => editor.showTab(tab),
|
||||
/** The open documents in tab order and the one showing (#171); a document is `asset:<id>` or `list`. */
|
||||
documents: () => editor.openDocuments(),
|
||||
openDocument: (doc: DocumentId) => editor.openDocument(doc),
|
||||
closeDocument: (doc: DocumentId) => editor.closeDocument(doc),
|
||||
plugins: {
|
||||
/** Every file in `data/plugins/` and what became of it. */
|
||||
records: () => [...(editor.plugins?.records ?? [])],
|
||||
|
||||
Reference in new issue
Block a user