EditorShell beta
Interface of @v12-engine/editor
export interface EditorShellWhat the editor asks of the page that draws it: the one object its interface gives it (EditorOptions.shell), in the place of functions set one by one after it is made. A page that cannot do one of these leaves it out (headlessShell says why not), a game's page that does it its own way gives its own
Members
confirmDiscard
confirmDiscard(): Promise<boolean>;Asks whether changes that are not saved may be lost: the kit's question, not the browser's. Yes, without a page to ask
element
element?(): HTMLElement | undefined;The element of the page the editor is drawn in: what fills the screen (toggleFullScreen). The whole page when left out
leave
leave?: {
label: string;
tip?: string;
run: () => void;
};The way out of the editor, when the page gave one: what the File menu's last line says and does
openDialog
openDialog<K extends ShellDialogId>(id: K, ...args: ShellDialogArgs<K>): void;Opens a dialog of the editor's (ShellDialogs): the page may draw it as it likes, or give another
openMenu
openMenu(at: {
x: number;
y: number;
}, items: EditorMenuItem[]): void;Opens a menu at a point of the screen. Nothing happens on a right click where it does nothing
pickAssets
pickAssets(): void;Asks for files to take in (models, pictures, sounds): the page's file dialog, then the editor imports them (importFiles)
pickFile
pickFile(): void;Asks for a map file to open: the page's file dialog, then the file is opened by the editor
playHere
playHere?(from?: WorldSave): void;Plays the map here, as the bar's Play does; from a save, a test point's (plays.playFrom), where one is given, the game played here started again from it. Left out where the page cannot play it over the editor
resolveConflict
resolveConflict(file: string): Promise<ConflictChoice | undefined>;The map's file changed on disk since it was opened: the person says what to keep. Nothing is saved, and the status line says why, where the page asks nobody (undefined)
revealFold
revealFold(fold: string): void;Shows a fold of a panel (Fold) by its title, once the panel is open: opened, scrolled to and marked for a moment. What the search does with a setting
stop
stop?(): void;Ends the game played here, back to the map as it was. Left out with playHere
toast
toast?(message: string, options?: {
tone?: 'default' | 'success' | 'danger';
seconds?: number;
action?: {
label: string;
run: () => void;
};
}): void;Says something for a moment, over the editor, and lets it go by itself (a file taken in, what went wrong with it): the kit's toast, with a button where action is given (Undo). Said in the status line where the page gives none
watchReplay
watchReplay?(replay: Replay, name: string): void;Plays a replay of the map back here, in the game's place (plays.watchReplay), with its bar: in the place of a game played here, and stopped as one is. Left out with playHere