Skip to content

ShellState beta ​

Class of @v12-engine/editor

ts
export declare class ShellState

What is open in the editor's interface, apart from its panels (those are the dock's): a dialog, the list of keys, the tour, the command palette, the tuning box. Owned by the page that draws the editor and handed to it, so that a headless editor has the same state and nothing reads it. Each is a signal inside: what draws them follows it

Members ​

assetsFocus ​

ts
get assetsFocus(): string | undefined;

set assetsFocus(file: string | undefined);

The file the Assets panel shows first, picked: what openAssets was asked for before the panel was open

close ​

ts
close(): void;

Closes the dialog that is open

dialog ​

ts
get dialog(): ShellDialogId | undefined;

The dialog that is open, if one is

folds ​

ts
readonly folds: FoldAnchors;

The folds of the panels drawn, for revealFold to find

open ​

ts
open<K extends ShellDialogId>(id: K, ...args: ShellDialogArgs<K>): void;

Opens a dialog (the one open is replaced)

openPalette ​

ts
openPalette(query?: string, from?: Element | null): void;

Opens the command palette, with query typed, from where the keyboard is: in a panel, that panel's come first and the keyboard goes back to it before what is picked is done

paletteFrom ​

ts
paletteFrom?: HTMLElement;

What had the keyboard as the palette opened, in a panel: given it back before what is picked is done (the panel's keys ask for it)

paletteOpen ​

ts
get paletteOpen(): boolean;

set paletteOpen(open: boolean);

Whether the command palette (Ctrl+K) is open. Closed, what it was opened with (openPalette) goes

palettePanel ​

ts
palettePanel?: string;

The panel the keyboard was in as the palette opened: its own come first (EditorSearch.find's first)

paletteQuery ​

ts
paletteQuery: string;

What the command palette starts with typed (> for what the editor does alone, Ctrl+Shift+P)

prefabNaming ​

ts
get prefabNaming(): ShellDialogs['prefab-name'] | undefined;

What the prefab-name dialog was opened with, and what the Replace with dialog was: kept after they close, for the dialog to show while it goes

replacing ​

ts
get replacing(): ShellDialogs['replace'] | undefined;

What the Replace with dialog was last opened with, if it ever was

shortcutsShown ​

ts
get shortcutsShown(): boolean;

set shortcutsShown(shown: boolean);

Whether the list of every key is shown (?)

strip ​

ts
strip?: (id: string) => boolean;

Picks a tool of the strip by its id there, while the strip of tools is drawn (EditorClient.pickStripTool): set by the strip, taken away as it goes

tourShown ​

ts
get tourShown(): boolean;

set tourShown(shown: boolean);

Whether the tour of the editor is going on (Help › A tour of the editor)

tuningOpen ​

ts
get tuningOpen(): boolean;

set tuningOpen(open: boolean);

Whether the tuning of a game played here (its tunables, a scenario saved) is open over it: shut until asked