Skip to content

EditorDock beta ​

Interface of @v12-engine/editor

ts
export interface EditorDock

The editor's dock: its panels opened from the rails, pinned into the layout or shown over the scene, moved, tabbed and floated by the one who uses it, and by code. The editor's own are in EDITOR_PANELS (hierarchy, place, terrain, markers, inspector, look, map, data, content, problems, history, cinematic), around scene

Members ​

add ​

ts
add(panel: EditorPanelDef): () => void;

A panel of its own, or one in the place of the editor's of that id: gives back what takes it away

all ​

ts
all(): readonly EditorPanelDef[];

Every panel there is, open or not: the editor's own, the game's, and those added

close ​

ts
close(id: string): void;

Closes a panel: it leaves the layout, or is put away from over the scene

float ​

ts
float(id: string): void;

Has a panel float on its own, over everything

focus ​

ts
focus(id: string): void;

Brings a panel to the front, if it is behind another's tab

layout ​

ts
layout(): unknown;

The whole layout as plain data (KeptLayout), to keep or hand over; and putting one in place

layouts ​

ts
readonly layouts: {
        list(): {
            id: string;
            name: string;
            own: boolean;
        }[];
        use(id: string): void;
        save(name: string): void;
        remove(id: string): void;
    };

The layouts by name: the editor's own (LAYOUT_PRESETS), the game's, and those the one who uses it kept

move ​

ts
move(id: string, side: DockSide, before?: string): void;

Puts a panel's icon on a rail (it opens on that side from then on), before the icon of another panel there (before), or last: the rails' order is kept with the layout

open ​

ts
open(id: string, options?: {
        over?: boolean;
    }): void;

Opens a panel (or brings it to the front, open already): the way it opens, or as said (over)

panel ​

ts
panel(id: string): EditorPanel | undefined;

The handle of a panel that is open (EditorPanel): what it shows, its title and its badge. None while it is closed

panels ​

ts
panels(): string[];

The panels open now, by id: in the layout, floating, or over the scene

pin ​

ts
pin(id: string, pinned: boolean): void;

Pins a panel into the layout, or has it open over the scene: now too, when it is open

pinned ​

ts
pinned(id: string): boolean;

Whether a panel opens docked into the layout (pinned) or over the scene

remove ​

ts
remove(id: string): void;

Takes a panel away for good, one of the editor's own too: its icon goes with it

reset ​

ts
reset(): void;

Back to the layout the editor starts with (EditorOptions.layout, the scene alone without)

setLayout ​

ts
setLayout(layout: unknown): void;

Puts a layout in place as layout gave it; a layout that cannot be read is replaced by the starting preset

sideOf ​

ts
sideOf(id: string): DockSide;

The rail a panel's icon is on

sideOpen ​

ts
sideOpen(side: DockSide): boolean;

Whether a side has a panel of its rail open: in the layout, behind another's tab, or over the scene

stateOf ​

ts
stateOf(id: string): DockPanelState;

Where a panel is now

toggle ​

ts
toggle(id: string): void;

What a click on its icon does: opens it, brings it to the front, or closes it

toggleSide ​

ts
toggleSide(side: DockSide): void;

What the bar's buttons for a side do: its panels put away, or back (those put away last, or the first of its rail)