Skip to content

EditorExtension beta ​

Interface of @v12-engine/editor

ts
export interface EditorExtension

An extension of the editor (defineEditorExtension): any of what EditorOptions declares, as one thing that comes and goes together, and something to do once it is all there (setup). Declared in EditorOptions.extensions (an editor scene's extensions), or added in code (editor.extensions.add)

Members ​

actions ​

ts
actions?: GameActions<EditorClient>;

Actions of its own (add, asked before the editor's), the editor's it leaves out (hide) and changes (change), until it goes

areas ​

ts
areas?: MapAreaDef[];

Areas of the map editor of its own (MapAreaDef), found by their ids (editor.doc.area(id))

icons ​

ts
icons?: Record<string, EditorIcon>;

Icons by name, its own or in the place of the editor's until it goes

id ​

ts
id: string;

What it is known by: one of each id, the later in the place of the earlier (said in the Console)

inspector ​

ts
inspector?: InspectorSectionDef[];

Sections it adds to the Inspector, taken away with it

kinds ​

ts
kinds?: MapKindDef[];

Kinds of thing of the game's own it adds to the map editor, taken away with it

lanes ​

ts
lanes?: AnyLane[];

Lanes of cinematics of its own (defineLane), drawn and edited by the Cinematic panel as the client's are, with their fields in the Inspector and their items in the scene; the game plays them through GameView.cinematics.lanes

layouts ​

ts
layouts?: EditorLayoutPreset[];

Layouts of its own, in Window › Layouts

ts
menus?: EditorMenu[];

Menus of its own, or lines at the end of one of the editor's (one of the same id)

name ​

ts
name?: string;

What its list calls it: its id when left out

panels ​

ts
panels?: EditorPanelDef[];

Panels it adds to the editor, which are taken away with it

ts
search?: SearchSource[];

Search sources it adds to Ctrl+K, taken away with it

setup ​

ts
setup?: (editor: EditorClient) => (() => void) | void;

Something to do once everything of it is in the editor: listen to the bus, open a panel. Gives back what undoes it, called before anything of the extension is taken away. One that throws is said in the Console, and the rest of the extension stays

themes ​

ts
themes?: EditorThemeDef[];

Colour themes it adds to the editor, taken away with it

tools ​

ts
tools?: GameToolDef[];

Tools it adds for the game's kinds of thing, taken away with it