Skip to content

EditorClient ​

Class of @v12-engine/editor

ts
export declare class EditorClient implements ToolHost

The map editor: shows a map the way the game would, and changes it with brushes and by putting things down. It draws with the same pieces as the game, fed from the map instead of from a session.

What a click does is the picked tool's business (see Tool): the editor holds the scene, the camera, the selection and what is shown, and hands the tool the pointer, the keys and every frame.

Everything the editor does is here by name. Much of it is done by its parts, a file each in parts/, which hold what they need to themselves: what is drawn (EditorDrawing), the lines and names over it (EditorLines), the screen and the map (EditorPicking), the pointer and the keys (EditorInput), the selection (EditorSelection), copying (EditorClipboard), the map's files (EditorMapFiles), playing it (EditorPlaying), its checks (EditorChecks) and where the view looks (EditorFraming). A part reaches the editor as host, and another part through it

Members ​

constructor ​

ts
constructor(options: EditorOptions);

Constructs a new instance of the EditorClient class

addGroundLayer ​

ts
addGroundLayer(id: string, layer?: MapGroundLayer): number;

Lays a layer over a ground of the map's own (MapTile.layers, MapGroundLayer), last: moss in patches when nothing is said, with a seed of its own. A step of the history; the layer's place among them, or -1 for no ground

addMapArea beta ​

ts
addMapArea(def: MapAreaDef): () => void;

Adds an area of the game's own to the map editor (MapAreaDef): made now with the map's editor, and with the editor of every map opened after. One of the same id is in the place of the one before. Gives back what takes it away

addTheme beta ​

ts
addTheme(theme: EditorThemeDef): void;

Adds a theme of the game's, or changes the one of its id: in the settings at once, and on the page if it is the one the editor is in

animationFiles beta ​

ts
animationFiles(): Promise<string[]>;

The animation files of the game and the map (animations/<name>.anim.glb), by the paths a ModelDef.animationFiles gives them

applyAnimation beta ​

ts
applyAnimation(type: string, file: string, options?: {
        as?: AnimationKind;
        bones?: BoneMap;
        table?: Readonly<BoneMap>;
    }): Promise<EditorResult<{
        bones: BoneMap;
    }>>;

Applies an animation file to a unit type's look, in code what the Animation panel's Apply does: written to its looks.json as ModelDef.animationFiles with the table of bones (bones; else as guessBones tells, by name and by table), and as what the type plays for as (walk, attack...), with the file's marks and loop. Gives back the table

applyEnvironment ​

ts
applyEnvironment(name: string): boolean;

Puts one of the game's named looks on the map (GameView.world.environments), by its name: every part of its look at once, one step to undo. False where the game has none of that name

applyTerrainRules ​

ts
applyTerrainRules(): number;

Paints the tiles by the bands once: one step of the history. Says how many cells changed

arrange ​

ts
arrange(how: Arrangement): void;

Lines what is selected up, or spreads it out evenly (see Arrangement)

askFaceToward ​

ts
askFaceToward(away?: boolean): void;

Asks for a click in the scene, then turns what is selected toward it (Shift held: away from it)

askPrefabName ​

ts
askPrefabName(purpose: 'rename' | 'duplicate' | 'variant', name: string): void;

The prefab-name dialog opened, to rename (and tag) a prefab, copy it under another name or make a variant of it

askReplace ​

ts
askReplace(ref: Extract<Reference, {
        type: string;
    } | {
        model: string;
    } | {
        prefab: string;
    }>, where?: 'selection' | 'everywhere'): void;

Opens the Replace with dialog for a type, a doodad's model or a prefab: on the selection, or everywhere on the map

assetCategories ​

ts
assetCategories(): AssetCategory[];

The game's categories of asset files: those its view declares (GameView.files.assetCategories), then those of its folder's assets.json. A folder or a group of @v12-engine/assets is a category too, without being declared

assetCategoryName ​

ts
assetCategoryName(id: string, groupName?: string): string;

What a category is called where it is shown: as declared, as its group of @v12-engine/assets is, or its id in words

assetCategoryOf ​

ts
assetCategoryOf(file: CategorizedFile): string | undefined;

The category of a file, by its id, as the game says it (see assetCategoryOf): nothing for none

assetIndex beta ​

ts
readonly assetIndex: AssetIndex;

Every file the editor knows, as one index: the map's, the game's folder, the project's shared folders and @v12-engine/assets, each with its place, kind, tags, credit and where it is used (AssetIndex)

assets ​

ts
readonly assets: Assets;

Where the files of the game are: its own folder, then the shared ones

boxTakes ​

ts
readonly boxTakes: {
        trees: boolean;
        doodads: boolean;
    };

What the box takes besides the rest: trees, which a box over a forest would otherwise take by the hundred, and doodads

brushPresets ​

ts
brushPresets(): BrushPreset[];

The brushes kept by name (EditorPrefs.brushes), in the order they were kept

bus beta ​

ts
readonly bus: EditorBus;

Its bus: events with data, by name, between the panels and from the editor (EditorEvents: selection, map.changed with which parts, tool, file.opened, file.saved, undo, redo, play.started, play.stopped, play.tick, panel.opened, panel.closed). on(name, listener), once, emit(name, data)

camera ​

ts
readonly camera: RtsCamera;

The camera that looks at the map

campaign beta ​

ts
readonly campaign: EditorCampaign;

The game's campaign (campaign plan EQ8), as its campaign.json says it: its chapters, and its missions with their maps, pictures, briefing, loading screen, debrief and difficulty, each change a step of the history written into the file; a mission's map opened in a tab of its own (what the Campaign panel shows)

canPlay ​

ts
get canPlay(): boolean;

Whether the map can be played, and tried out in the sandbox, from here: there are scenes for that

canSandbox ​

ts
get canSandbox(): boolean;

Whether the map can be tried out in the sandbox from here

cellLayers ​

ts
get cellLayers(): readonly CellLayerDef[];

The game's layers of cells, for the editor to paint (Rules.cellLayers)

changed ​

ts
changed(settled?: boolean): void;

Tells the editor the map changed: marks the file unsaved, redraws and pushes the edit to the game played here; settled marks a finished step

changes beta ​

ts
readonly changes: EditorChanges;

What of the editor changed, by its part (EditorChangeKind): what the panels follow (changes.of('map', 'selection')), and what each part says as it changes (changes.mark('tool')). In the middle of an operation made over time (a drag, a number dragged) a change is said a few times a second, and at once as it ends

checks beta ​

ts
readonly checks: EditorChecks;

What is wrong with the map (the Problems panel): shown, gone to, and kept quiet

cinematics beta ​

ts
get cinematics(): CinematicCatalog;

The game's cinematics, every file of cinematics/ read and kept as it changes (defs(), ids(), failed()): what the Problems panel checks against the map's names, the search finds, and Content lists

clipboard beta ​

ts
readonly clipboard: EditorClipboard;

Copying and pasting, here and between maps, duplicating what is selected, and the game's prefabs: saved, edited on their stage, placed and kept up with their files

code beta ​

ts
readonly code: EditorCode;

The game's code, shown and not edited (E2E plan EDF6): its files with the definitions found in them, one read, searched, and opened in the code editor (what the Code panel shows)

contextMenu ​

ts
contextMenu(screen: {
        x: number;
        y: number;
    }, view: {
        x: number;
        y: number;
    }, ground: Vec2 | null): void;

The menu of a right click: opened at screen (the page's pixels), about what is at view (the view's pixels). What is there is selected first (alone, unless it already was), then the menu has what can be done with what is selected, or on the ground there (ground); and the lines games and code add

contextMenus beta ​

ts
readonly contextMenus: ContextMenus;

The right-click menu by what is clicked (EditorMenus): contextMenus.for('object', (context) => [...]) adds lines for a kind (object, doodad, camp, region, point, path, light, effect, a game's own kind, ground, or '*'), the editor's own among them, and gives back what takes them away

data ​

ts
readonly data: EditorData;

The game's data (S61): the fields of its definitions it lets be changed (Rules.editable), changed here and in a game played here at once, and kept in its data.json (data.keep()). What the Data panel draws

debugView ​

ts
debugView(kind: DebugViewKind | null): Promise<void>;

Draws the scene to look into it (View › Debug view), and a game played here with it: a debug view, one at a time, or none (null). Nothing of the map changes, and it is not kept

debugViewShown ​

ts
get debugViewShown(): DebugViewKind | null;

The debug view the scene is drawn as (debugView), or null

deleteModel beta ​

ts
deleteModel(src: string): Promise<EditorResult>;

Takes a model's file away, with its levels (<model>.lod1.glb...) and its file of clips: out of the files the map brings, or deleted from the game's folder (through the dev server). A shared one is not: refused. What still names it (a unit's look, a doodad of a map) draws a box instead; assetUses says what does, before

detail beta ​

ts
get detail(): WorldDetail;

The level each thing is drawn at by its distance (WorldDetail), as in play: the models', the game's (GameView.world.detail) and the map's (MapEnvironment.detail) say

dispose ​

ts
dispose(): void;

Takes everything apart. Safe at any moment, halfway through being made too, and twice: each step is taken whatever the one before did

disposed ​

ts
get disposed(): boolean;

Whether it was disposed: what it started loading lets it be

doc ​

ts
doc: MapEditor;

The map being edited, with its history

dock ​

ts
dock?: EditorDock;

Its dock, while its interface has one: open, close and arrange its panels (its layouts, its sides, pinning). The panels themselves are panels, there whether the dock is or not

doodads ​

ts
readonly doodads: EditorDrawing['doodads'];

The scenery of the map, drawn as it is

drafts ​

ts
drafts: Draft[];

The drafts of maps from before, a map each, newer than what was saved of them: offered to be taken up again

drawing ​

ts
readonly drawing: EditorDrawing;

The parts the editor hands on to, a file each in parts/: what is drawn, the lines and names over it, the screen and the map, the pointer and the keys, the selection, the clipboard, the map's files, playing it, its checks, where the view looks

dropAt ​

ts
dropAt(tool: EditorTool, x: number, y: number): boolean;

Puts something down where it is dropped from a palette, as Unity does: what tool puts down (a unit, a doodad, a prefab) at a point of the page, done the tool's own way (mirrored, snapped, one step to undo); then the tool it was is back, and what was put down is selected. Whether anything was

edit ​

ts
edit(action: (editor: MapEditor) => void, name?: string): void;

Changes to the map as a whole or its players, from the panels: whatever action does is one operation, under name when it is given one

editorState beta ​

ts
readonly editorState: EditorState;

The editor's own over the map (FC1): things hidden or locked by id and the groups, kept with the map under the map's editor table (GameMap.editor, no game reads it); what is isolated, not kept

endEdit beta ​

ts
endEdit(): void;

Ends the step begun by beginEdit: one step of the history, where anything changed

endNudge ​

ts
endNudge(): void;

The arrows' run of moves (nudgeSelection with run) ended: one step of the history, if it moved anything

engine ​

ts
readonly engine: EngineFace;

The loop, the clock and the canvas's size the editor draws by (stage.engine)

extensions beta ​

ts
readonly extensions: EditorExtensions;

The extensions in the editor (EditorExtension, defineEditorExtension): declared (EditorOptions.extensions) or added in code. add(extension) puts all it brings into the editor and gives back what takes all of it away again; remove(id), get, has, list

faceAlong ​

ts
faceAlong(pathId?: number): void;

Turns what is selected along a path, each the way the path goes nearest it: the path given, the selected one, or one clicked

faceToward ​

ts
faceToward(point: Vec2, away?: boolean): void;

Turns what is selected toward a point of the map, or away from it, each where it stands: one step

file ​

ts
file: string | undefined;

The map file of the project this map is, by its name without .vgmap.json: where saving it goes, while developing. None for a map that has not been saved to the project yet, and in a built editor

files beta ​

ts
readonly files: EditorGameFiles;

The game's own files, as its panels read and write them (waves.json): in the game's folder of the project, this browser without one, or the game's own store (EditorOptions.files). What is written is a change until the map is saved (Ctrl+S), unless written { now: true }

find beta ​

ts
find(ref: Reference): ReferenceUse[];

Where a thing is named: on the map (placed objects, camps and their groups, random groups, the game's fields on objects, camps, regions and the kinds' things), in the prefabs, in the cinematics, and as the game says (MapEditorDef.references); a file's uses are the asset index's (AssetIndex.usesOf). Each with what names it and where, and what a click selects on the map

firstMap ​

ts
firstMap(): GameMap;

A map to start on: the game's (a copy of it), or an empty one

flipSelection beta ​

ts
flipSelection(): void;

Flips what is selected where it stands, as the map's symmetry mirrors or turns it (across x on a map with none), its middle kept: one step (MapEditor.batch.flipInPlace, campaign plan EQ17)

forgetBrushPreset ​

ts
forgetBrushPreset(name: string): void;

Forgets a brush kept, by its name

frameWanted ​

ts
frameWanted: boolean;

Whether a frame was asked for (redraw) since the last was drawn

framing beta ​

ts
readonly framing: EditorFraming;

Where the view looks: at what is selected, straight down, closely, through a camera of the map

fullScreen ​

ts
get fullScreen(): boolean;

Whether the editor fills the screen (the browser's full screen, toggleFullScreen)

game ​

ts
get game(): string;

The id of the game this editor makes maps for

gameTools ​

ts
get gameTools(): readonly GameToolDef[];

The game's own tools and panels (EditorScene.tools, panels)

generate ​

ts
generate(options: GeneratorOptions): {
        map: GameMap;
        problems: MapProblem[];
        seed: number;
    } | undefined;

A map made by the game's generator (generateMap), with what is wrong with it: not opened. What the dialog's preview shows; openGenerated opens one

generator ​

ts
get generator(): MapGenerator | undefined;

The game's generator of maps (Rules.generator): what New map from a generator makes a map with. None, no such line

grassBrush ​

ts
readonly grassBrush: GrassBrush;

The grass brush of Play here (the Cheats panel's Grass): Ignite, Extinguish, Cut or Regrow armed on the game played here, done where its map is clicked and dragged over (debug.foliage)

groundFromMix ​

ts
groundFromMix(first: string, second: string, name?: string): EditorResult<MapTile>;

A ground of the map's own mixed of two others, by id (the game's tiles or the map's own), in patches of a noise (MapTile.mix): half of each, in a colour between theirs, picked to paint with

groundFromPattern ​

ts
groundFromPattern(name?: string, pattern?: NonNullable<MapTile['pattern']>, color?: Rgb): EditorResult<MapTile>;

A ground of the map's own made in code (MapTile.pattern): a pattern of the client's or of the game's own (GameView.ground.patterns, by id) in a colour, with a seed of its own, picked to paint with. Grass in a meadow's green when nothing is said

groundFromPicture ​

ts
groundFromPicture(file: File, name?: string): Promise<EditorResult<MapTile>>;

A ground of the map's own made from a picture (PNG, JPEG or WebP): the picture is brought by the map (in its textures/), the ground is coloured as the picture is on average, named as the file is, and picked to paint with. Refused, saying why, where it cannot be

groundFromTexture ​

ts
groundFromTexture(texture: string, name?: string): Promise<EditorResult<MapTile>>;

A ground of the map's own made of a texture there is already, by its path in textures/: the map's own files first, then the game's and the shared ones (as Assets.textureUrl finds it). Coloured as it is on average, named as its file is, and picked to paint with. A texture taken in by the Assets panel is painted with this way

groundPatternToPicture ​

ts
groundPatternToPicture(id: string): EditorResult<string>;

A ground made in code made a picture: drawn as its texture is, kept among the map's files (textures/), and the ground the picture from then on. For a picture to work on further. Refused for a ground that is no pattern

groundPicture ​

ts
groundPicture(id: string, file: File): Promise<EditorResult>;

Another picture for a ground of the map's own: brought by the map, and the ground coloured as it is

groupSelection ​

ts
groupSelection(name?: string): EditorGroup | undefined;

Makes a group of what is selected (Group n when no name is said), kept with the map; nothing for an empty selection

groupTargets ​

ts
groupTargets(targets: Iterable<Named>, options?: {
        name?: string;
        parent?: number;
    }): EditorGroup | undefined;

Makes a group of things: under another when said (one level only)

guide ​

ts
guide?: EditorOptions['guide'];

The game's guide to its editor, for Help: an address, or what opens it

heightmap ​

ts
heightmap(): Promise<{
        png: Blob;
        low: number;
        high: number;
    }>;

The ground as a picture, a pixel a corner, the lowest black and the highest white: a PNG, and how low and high that is

hidden ​

ts
readonly hidden: Set<OutlineGroup>;

Kinds of thing not drawn, and kinds not picked, while working on the rest (see OutlineGroup)

hideSelection ​

ts
hideSelection(hidden?: boolean): void;

Hides, or shows again, everything selected

hideTargets ​

ts
hideTargets(targets: Iterable<Named>, hidden?: boolean): void;

Hides things by id, or shows them again: kept with the map. What is hidden is selected no more

history ​

ts
readonly history: EditorHistory;

The history, the map's steps and the game's own in one list (EditorHistory): step(own) makes a step of the game's own (a wave in waves.json, a tuned effect), undone and redone with the map's by Ctrl+Z and the History drawer; begin/commit make one step of several; undo, redo, names, watch. Follows the map's editor as another map is opened

hovered ​

ts
hovered: Vec2 | null;

The ground under the pointer, for the status bar

hoverLook ​

ts
hoverLook: HoverLook;

How the line around what the pointer is over in the scene looks (EditorPrefs.hoverOutline turns it off)

icons ​

ts
readonly icons: Record<string, EditorIcon>;

Icons of the game's own, by name, over the editor's: from EditorOptions.icons, and setIcon

idle beta ​

ts
readonly idle: EditorIdle;

When the editor is left alone (EditorPrefs.whenIdle): whether it is idle now, and wake() to draw as always again

importClips beta ​

ts
importClips(src: string, files: File | readonly File[], options?: {
        bones?: BoneMap;
        table?: Readonly<BoneMap>;
        clips?: readonly {
            from: string;
            name: string;
        }[];
        existing?: string;
    }): Promise<EditorResult<{
        clipsFile: string;
        clips: RetargetedClip[];
        kept: string[];
    }>>;

Clips of another model's file put on a model and written beside it, in code what Model Setup's Import clips does: a GLB (or a glTF with what it names, an FBX where the dev server has fbx2gltf), its bones matched to the model's by name and by table (RETARGET_PRESETS; bones says which outright), its clips retargeted (makeClipsFile). Gives back the path to put in the model's ModelDef.clipsFile, and what came out; a look that names it is the caller's to write (saveLook)

importFiles ​

ts
importFiles(files: FileList | readonly File[]): void;

Takes files in (models, pictures, sounds) as the Assets panel does when they are dropped on it: the panel opened and brought to the front, so what was taken in is seen there, one file alone picked. Where they go is the panel's to say (the map, or the game's folder while developing). What the search's Import files and a drop on the page do

importMedia beta ​

ts
importMedia(file: File, as: 'sound' | 'music' | 'video', into?: 'game' | 'map'): Promise<EditorResult<string>>;

Takes a sound, a music track or a video in: an MP3 into sounds/ or sounds/music/, an MP4 or a WebM into videos/ (what the game plays, as it is), where importModel puts a model (the game's folder while the project is open, else the files the map brings). Gives back the name a field gives it (assetFieldValue): a sound by its name (hit of sounds/hit_2.mp3, one more take of it where the game has a hit), a track by its name in sounds/music/, a video by its path in videos/

importModel beta ​

ts
importModel(file: File | readonly File[], into?: 'game' | 'map'): Promise<EditorResult<string>>;

Takes a model in: a GLB, or a glTF with the files it names (scene.bin, its pictures) given with it, made one GLB (modelFiles). Into the game's folder while the project is open (made smaller on the way in, as the Assets panel does), or into the files the map brings, as into says (the game's where it can). Gives back the path a ModelDef.src gives it: the first model's, where several were given

inspect beta ​

ts
inspect(part: Inspected | undefined, options?: {
        open?: boolean;
        id?: string;
    }): void;

Shows a panel's part in the Inspector in the place of the map's selection (the Cinematic panel's keys and clips), or none (undefined); with an id, takes away only that one. Opens the Inspector where open

inspected beta ​

ts
inspected?: Inspected;

What a panel shows in the Inspector now in the place of the map's selection (inspect): gone when something on the map is selected

inspectedModel beta ​

ts
inspectedModel?: InspectedModel;

The model the Inspector looks into (its Model view): what it is made of, drawn to look at, part by part. Picked in Content or the Assets panel; gone when something on the map is selected

inspecting ​

ts
inspecting?: InspectTarget | null;

What the Inspector shows of the game played here, in the place of what is selected in it: opened from the Hierarchy

inspectModel beta ​

ts
inspectModel(inspected: InspectedModel | undefined): void;

Looks into a model in the Inspector, and opens the Inspector for it. Nothing closes the Model view

inspectModelOf beta ​

ts
inspectModelOf(of: {
        doodad: number;
    } | {
        type: string;
        look?: string;
    }): boolean;

Looks into the model a doodad of the map or a unit type is drawn with, in the Inspector: the model, not the one copy of it. False where there is none (no such doodad, a type with no model). A type drawn in kinds (looks): the kind named, or its first

inspector ​

ts
readonly inspector: EditorInspector;

The Inspector's sections of the game's own, and the editor's own it leaves out (S33): from EditorOptions.inspector, and in code (inspector.add(section, { before }), remove, restore)

isolateSelection ​

ts
isolateSelection(): void;

Hides everything but what is selected (and the kinds stay as they are), until stopIsolating or Escape

isolating ​

ts
get isolating(): boolean;

Whether everything but the isolated is hidden now (isolateSelection)

keys beta ​

ts
readonly keys: Actions<EditorClient>;

What the editor's keys and the pointer's buttons do, by name (S33): its own actions (EDITOR_ACTIONS), the game's (EditorOptions.actions) and its tools' (GameToolDef.key, actions), each on the keys it comes with or on those the one who uses the editor gave it (bind, add, remove, reset), kept in the browser. One more as the editor goes with define, one less with forget; done in code with press; key(id) is what a menu's line shows

kinds beta ​

ts
readonly kinds: EditorKinds;

The kinds of thing of the game's own (S33): from EditorOptions.kinds, and in code (kinds.add(kind), remove). Each has a tool on the strip (the action tool.thing.<id> picks it), a group of the Hierarchy, the Inspector, and a place in the selection, the clipboard and the history, as the editor's own kinds have

lanes beta ​

ts
get lanes(): EditorLanes;

The lanes of cinematics the editor knows: the client's own, the game's view's, and those of the editor's extensions (defineEditorExtension({ lanes })) or added in code (editor.lanes.add)

languages beta ​

ts
readonly languages: EditorLanguages;

The game's words in each of its languages (campaign plan LO2): every key and name with its source and its words in each language, stale where the source changed since; set as steps of the history into the game's languages/<id>.json, laid at once over the view and a game played here; out to CSV and back in (what the Languages panel shows)

layouts beta ​

ts
readonly layouts: EditorLayouts;

Layouts of the game's or an extension's, in Window › Layouts after the editor's own (add(preset) gives back what takes it away)

limits ​

ts
readonly limits: Limits;

The game's caps (GameView.world.limits): the editor's scene draws as many lights, sounds, areas of mist as the game's does

locked ​

ts
readonly locked: Set<OutlineGroup>;

The kinds of thing that are not picked

lockSelection ​

ts
lockSelection(locked?: boolean): void;

Locks, or unlocks, everything selected

lockTargets ​

ts
lockTargets(targets: Iterable<Named>, locked?: boolean): void;

Locks things by id, or lets them go: kept with the map. What is locked is selected no more

logs ​

ts
readonly logs: LogRing;

The last 1000 things said while the editor is open, for its Console: the editor's own lines (say), the client's, a game's played here, errors nobody caught. Everything under rootLogger, from info up

looksEntry ​

ts
looksEntry(type: string): Promise<LooksEntry | undefined>;

What the game's looks.json says of a unit type now: nothing where it says nothing, or there is no project

makeModelLevels beta ​

ts
makeModelLevels(src: string, ratios?: number[]): Promise<{
        full: number;
        levels: {
            path: string;
            triangles: number;
        }[];
    }>;

Makes a model's lighter levels (npm run lod, through the dev server), each a part of its triangles (ratios, 40% and 15% when left out); drawn with them from far at once. A model of the game's folder has them beside it; a shared one (the project's own under public, or @v12-engine/assets's) has them made into the project's own public/models, beside where it is served. Not for a model the map brings (modelFileOf): import it first

map ​

ts
get map(): GameMap;

The map being edited

mapAreas ​

ts
get mapAreas(): readonly MapAreaDef[];

The map editor's areas of the game's own (MapAreaDef): made with the map editor of every map opened

mapFieldChanged ​

ts
mapFieldChanged(field: string): boolean;

Whether a field of the map is set apart from its default (mapFieldDefault): what the dot beside it says

mapFieldDefault ​

ts
mapFieldDefault(field: string): unknown;

What a field of the map is on a new map of its size (createMap): the default a reset takes it back to. The fields the Map settings have a dot for (RESETTABLE_MAP_FIELDS), and the game's own as data.<id> (nothing kept: the field's default)

mapFiles beta ​

ts
readonly mapFiles: EditorMapFiles;

Where the map is kept: saving it, opening another, importing and exporting, the files it brings, its drafts

mapId ​

ts
mapId: string | undefined;

Id of the map in the browser's storage, once kept there

mayDiscard ​

ts
mayDiscard(): Promise<boolean>;

Whether the map can be left for another: nothing is unsaved (the map, or a game file a panel wrote), or the person said so when asked (the kit's question, which holds nothing of the page while it waits, RV65)

ts
readonly menus: EditorMenus;

The menus of the editor, by id, with the game's and extensions' lines

mirrorSelection ​

ts
mirrorSelection(): void;

Copies of what is selected where the map's symmetry mirrors it (Map › Symmetry): one step

modelAnatomy beta ​

ts
modelAnatomy(src: string): Promise<ModelAnatomy>;

What a model of the game's folder or the shared one is made of, read from its file: its nodes and their parts, vertices and triangles, materials, textures, skeleton, clips and what it costs (modelAnatomy). A character whose clips are its rig's, in files beside it (file.clipsIn), has those clips first, as it plays them

modelBytes beta ​

ts
modelBytes(src: string): Promise<ArrayBuffer>;

A model's file as its bytes, by the path a ModelDef.src gives it: from what the map brings, the game's folder or the shared files

modelFileOf beta ​

ts
modelFileOf(src: string): 'map' | 'game' | 'shared';

Where a model's file is, by the path a ModelDef.src gives it: brought by the map, in the game's folder (its own), or shared (@v12-engine/assets, and the files of other packages), which the editor does not change

modelOfType beta ​

ts
modelOfType(type: string, look?: string): ModelDef | undefined;

The model a unit type is drawn with (UnitLook.model), or the kind it comes in (looks: the one named, or the first of them). Nothing for a type drawn as parts alone

moveGroundLayer ​

ts
moveGroundLayer(id: string, from: number, to: number): void;

Moves a layer of a ground of the map's own to another place among them: later is over more of them

movePaletteGroup beta ​

ts
movePaletteGroup(from: number, to: number): void;

Moves a group of the palette to another place among them (the Place panel's, as they are shown): kept with the editor's prefs for this game, not the map's

moveSelectionTo ​

ts
moveSelectionTo(point: Partial<Vec2>): EditorResult;

Moves the selected objects to a point given in numbers. Refused, saying why, where they cannot go there

newMap ​

ts
newMap(size: number): GameMap;

An empty map for the game this editor is on

nudgeSelection ​

ts
nudgeSelection(by: Vec2, options?: {
        run?: boolean;
    }): boolean;

Moves everything selected by so far over the ground (EQ5: the arrows, a cell, Shift a quarter, Alt ten), as one step of the history; with run, one step for every move until endNudge (a key held, or pressed again and again before it is let go of, as a drag is one). False with nothing selected or a tool in the middle of something

objectives beta ​

ts
readonly objectives: EditorObjectives;

The map's objectives (campaign plan EQ3), kept in its data for the map objectives pack to give (mapObjectives): added, changed, moved and taken away, each a step of the history; their words in the view's, and the quest log they make (what the Objectives panel shows)

offsetMap beta ​

ts
offsetMap(by: Vec2): EditorResult;

Moves everything of the map over by whole cells, its size kept (MapEditor.ground.offset, campaign plan EQ17): what goes past an edge is gone. Refused, saying why, where it would move everything off

open ​

ts
open(map: GameMap, id: string | undefined, file?: string | undefined, pack?: MapPack): boolean;

Starts afresh on another map. False when it cannot be opened here, with the reason in the status line. id is where the browser keeps it, file the map file of the project it is, when it comes from either

openAssets ​

ts
openAssets(file?: string): void;

Opens the Assets panel: at a file, picked and in view, when one is said (its path: sounds/hit.mp3, the map's own first, then the game's, the shared ones)

openDefinition ​

ts
openDefinition(id: string, key?: string): void;

Opens where something of the game is defined, in the code editor (see openDefinition). While developing

openGenerated ​

ts
openGenerated(options: GeneratorOptions, made?: GameMap): Promise<boolean>;

Makes a map with the game's generator and opens it, as a new map not saved yet: what the dialog's Make does. A map already made of the same options (the dialog's preview) is opened as it is. False where there is no generator, or the map open now is not to be let go

openGuide ​

ts
openGuide(page?: string): void;

Opens the game's guide to its editor (guide): its address in a tab of its own, or what the game does, told the page of the docs asked for (page, a panel's: editor/look#add-sounds-and-music-to-the-map) where it is a function

openMapFile ​

ts
openMapFile(): void;

Opens the map's own file in the code editor, when it is a file of the project

openPanelDocs ​

ts
openPanelDocs(id?: string | undefined): boolean;

Opens the docs of a panel (campaign plan EQ14, F1): the one the keyboard is in when none is said, its page of the docs in a tab of its own (panelDocs), or the game's guide told the page (openGuide); the guide itself outside of a panel. False where there is nothing to open

options ​

ts
readonly options: EditorOptions;

What the editor was made with

overlays ​

ts
readonly overlays: Set<ViewOverlay>;

What is shown over the map of what the rules make of it (ViewOverlay)

overview beta ​

ts
readonly overview: EditorOverview;

The game as a whole (E2E plan EDF4): the app's scenes, the game's maps, cinematics and campaign, what the project is and what its code imports, each opened in the editor, in the game or in the code editor (what the Project panel shows)

ownerFrom ​

ts
ownerFrom(group: MapPaletteGroup, def: UnitTypeDef, picked: number): number;

Whose what is put down from a group of the palette is: the group's, nobody's for a resource, or the one picked

pack ​

ts
pack: MapPack;

The files the map brings with it (MapPack): what it uses that is not the game's. Kept with it, exported in a .vgmap

paintCells ​

ts
paintCells(layer: string, value?: number): void;

Picks the brush that paints one of the game's layers of cells, with a value: 0 takes the layer away under it. What the Layers buttons of the Terrain panel do

paintCliffLook ​

ts
paintCliffLook(id: number): void;

Picks the brush that paints a look of the walls of cliffs on the map (MapCliff.looks, by its id), or takes the looks away with 0: the cells brush on the map's layer CLIFF_LOOKS_LAYER. What is painted shows while it is picked, each look in its colour (cliffLookColor)

paintPathing ​

ts
paintPathing(value: number): void;

Picks the brush that keeps things off the ground by hand (GameMap.pathing): BLOCKS_BUILD for no building, BLOCKS_WALK for an invisible wall, 0 to take either away. What the Pathing buttons of the Terrain panel do; what is kept off shows while it is picked

palette ​

ts
palette(): MapPaletteGroup[];

Unit types for the palette, grouped the way the editor shows them, each group saying whose what it puts down is and whether it makes camps: the page's (EditorOptions.palette), the game's (MapEditorDef.palette), or today's

panelDocs ​

ts
panelDocs(id: string): string | undefined;

The page of the docs of a panel (EditorPanelDef.docs under EditorOptions.docs): none where the editor is not told where its docs are, or the panel has no page

panels beta ​

ts
readonly panels: EditorPanels;

Its panels, there as long as the editor is (with its dock or not): add, remove, get, list, open, close, handle(id) for one open. The editor's own, then the game's (EditorOptions.panels)

panelsHidden ​

ts
panelsHidden: boolean;

The panels are put away, to see the map alone

perf ​

ts
readonly perf: LitePerf;

How the frame is spent and what is drawn (the Metrics panel): the renderer's measures, and the editor's own work (perf.client). Measuring costs a little: on while someone looks (perf.enabled)

pickStripTool ​

ts
pickStripTool(id: string): boolean;

Picks a tool of the strip by its id there (point, family.height): a family's picks the one of it used last, and its next one when it is the one picked, as the tools' keys do. False for no tool of it, and where there is no strip

pictureOf ​

ts
pictureOf(map?: GameMap, size?: number, more?: {
        doodads?: boolean;
    }, key?: string): string;

A picture of a map seen from above, as lists of maps show it (mapPicture, with the game's tiles), at most size across, as an address for the page: the map open now when none is given; its scenery as dots with doodads. With a key (what the map is known by and when it changed), it is kept, and not drawn again

pictures ​

ts
get pictures(): ModelPictures;

Pictures of models, for the Content drawer: made one at a time as they are asked for, and kept in the browser (S29)

pin beta ​

ts
readonly pin: EditorPin;

The Inspector pinned to what is selected, to stay on it while others are picked (pin(), unpin())

pingHere ​

ts
pingHere(def: PingDef, at?: Vec2): boolean;

Pings a kind (PingDef, as the Pings fold shows it) at a spot, or where the camera looks: while the map is played here, sent as the player (client.pings.send: through the rules, to its audience; false where they refuse it); else its mark and its effect drawn on the editor's scene for its seconds, a look at it and nothing sent

placeable ​

ts
placeable(group: MapPaletteGroup): UnitTypeDef[];

What of a group of the palette can be put down for the player picked (placing.owner): what their race may have, where the map fixes it (MapPlayer.race), and what is nobody's

placeThing ​

ts
placeThing(kind: string, at: Vec2): MapThing[];

Puts down a thing of a map kind at a point, as one step; selects what was made and gives it back (none when the kind is unknown)

playAs ​

ts
get playAs(): PlayerId | undefined;

set playAs(player: PlayerId | undefined);

Who plays a game played here (as the game says, without), and whether all of the map is seen

played ​

ts
get played(): GameClient | undefined;

set played(game: GameClient | undefined);

The game played here, once it is on (S30): what the bar's pause, step and stop speak to, and what the Hierarchy and the Inspector look at while it runs. Set by the editor's interface; the bus says play.started and play.stopped as it is

playedFoliage ​

ts
readonly playedFoliage: PlayedFoliageOverlay;

The overlays of grass and bushes as the rules have them (View › Grass state, Hiding patches) over the ground of the game played here, laid again as it plays (PlayedFoliageOverlay): what they found last is counts

playing ​

ts
playing(): boolean;

Whether the map is played here now (Play here), as a signal: read in Solid, it follows as the game starts and stops. The bus says play.started and play.stopped too

playRevealed ​

ts
get playRevealed(): boolean;

set playRevealed(revealed: boolean);

Whether the whole map is seen in a game played here, fog and shroud included

plays beta ​

ts
readonly plays: EditorPlaying;

Playing the map: here over the editor (Play here: paused, stepped, stopped), or in a scene of its own

playState ​

ts
get playState(): 'stopped' | 'starting' | 'running' | 'paused';

Where Play here is: no game, one being made, one running, one paused

prefabEditing beta ​

ts
prefabEditing?: {
        name: string;
        parts: PrefabParts;
        kept: {
            map: GameMap;
            id: string | undefined;
            file: string | undefined;
            pack: MapPack;
            history: MapHistory;
            files: FilesMark;
        };
        at: Vec2;
        chance: Record<string, Record<number, number>>;
        turn?: 'random' | 'quarters';
        nested?: Record<number, number>;
    };

The prefab open on a stage of its own (editPrefab), while one is: its name, the prefab's ids of its parts to the stage's, the map that was open (back with leavePrefab), and where the prefab's middle is on the stage

prefabFiles beta ​

ts
prefabFiles: Map<string, PrefabFile>;

The game's prefabs, by name: from the project's files while developing, from this browser otherwise

prefabs ​

ts
prefabs: Map<string, MapClip>;

The game's prefabs' contents, by name: what prefabFiles holds, for what puts one down

prefs ​

ts
prefs: EditorPrefs;

What the one who uses the editor set it to, kept in the browser, in its app's storage (EditorPrefs)

previewPicture ​

ts
previewPicture(size?: number): string;

A picture of the ground for lists of maps: its paint, its water and its slopes lit from one side, a pixel a cell or less, as a PNG data URL of at most size across

problems ​

ts
get problems(): MapProblem[];

What is wrong with the map now (checkMap), and doodads of models there is no file of. Worked out again when the map changed, at most twice a second: a map of thousands of objects takes a moment

project ​

ts
readonly project: Project;

The project the editor keeps its maps and the game's files in, where there is one (Project): its own

putInCategory ​

ts
putInCategory(path: string | undefined, to: string | undefined, name?: string): Promise<void>;

Puts a file into a category (to, by id; made, called name, when the game has none of it), or out of the one its folder's assets.json listed it in (nothing): written into that assets.json through the dev server. Only while developing, for a game with a folder of its own (GameView.files.assets). A category is made empty with no path

randomiseSelection ​

ts
randomiseSelection(range?: {
        turn?: number;
        size?: number;
    }): void;

Gives what is selected a turn and a size of its own each, at random: any way round and within the Place panel's random size (a tenth when that is off) unless a range is given (turn in radians either way, size as a part)

readHeightmap ​

ts
readHeightmap(file: Blob, low: number, high: number): Promise<EditorResult>;

Reads a picture into the ground: dark at low, light at high. Refused where it is no picture that can be read

recent beta ​

ts
readonly recent: EditorRecentMaps;

The maps opened last, for this game, kept in this browser (File › Open Recent): opened again, the one before, the list forgotten

recentTiles beta ​

ts
readonly recentTiles: EditorRecentTiles;

The tiles painted with last, for this game, kept in this browser: the Terrain panel's Recent row, to pick one again

redo ​

ts
redo(steps?: number): void;

Redoes the last undone operations, steps of them; does nothing while a tool is busy

redraw ​

ts
redraw(): void;

Asks for a frame to be drawn, for what a panel changed in the scene to be seen. The editor draws every frame while it is shown, so there is nothing to ask for today: here for a page that draws it on demand, where what a panel changes between frames would otherwise wait for the next hand on the view. Nothing while a game is played over the editor, which draws in its place

regenerate ​

ts
regenerate(seed?: number): Promise<boolean>;

The map open now made again by the game's generator, of the options it was made with (GameMap.generated), with another seed (the next when not said): a new map, not saved. Asks before letting go of changes made since it was generated, and only then. False for a map no generator made

registry ​

ts
get registry(): Registry;

The game's registry of unit types, items, tiles and so on

removeGround ​

ts
removeGround(id: string): void;

Takes a ground of the map's own away: where it was painted is unpainted. Its picture stays among the map's files

removeGroundLayer ​

ts
removeGroundLayer(id: string, index: number): void;

Takes a layer of a ground of the map's own away

removeModelLevels beta ​

ts
removeModelLevels(src: string): Promise<void>;

Takes away the lighter levels made of a model: from beside it in the game's folder, or the ones of a shared model made into the project's own public/models

removeTheme beta ​

ts
removeTheme(id: string): void;

Takes a theme of the game's away: the editor in it goes back to Dark

replaceable ​

ts
replaceable(ref: Extract<Reference, {
        type: string;
    } | {
        model: string;
    } | {
        prefab: string;
    }>, where: 'selection' | 'everywhere'): number[];

The ids of what would be replaced: the objects of the type, the doodads of the model, the instances of the prefab, on the selection or everywhere

replaceTile ​

ts
replaceTile(from: number, to: number): void;

Paints every cell of one tile with another, all over the map: the paint panel's Replace

replaceWith beta ​

ts
replaceWith(ref: Extract<Reference, {
        type: string;
    } | {
        model: string;
    } | {
        prefab: string;
    }>, to: string, where?: 'selection' | 'everywhere'): {
        replaced: number;
        refused: {
            id: number;
            why: string;
        }[];
    };

Replaces a type with another on the selection or everywhere (place, owner, facing, name and fields kept; refused where the new footprint does not fit, and said), a doodad's model with another (turn and size kept), or a prefab with another (its instances placed anew where they stand): one step to undo (MapEditor.replaceType, replaceModel, replacePrefabInstances). How many were, and which were refused and why

resetMapField ​

ts
resetMapField(field: string): EditorResult;

Takes a field of the map back to its default (mapFieldDefault), as one step: nothing for one that is at it, or has no dot

resetSelectionField ​

ts
resetSelectionField(field: string): EditorResult;

Takes a field of the things selected back to its default (selectionFieldChanged), on every one, as one step: nothing where none is set apart

resize ​

ts
resize(): void;

Fits the view to the size of its canvas, now: resizeSoon is what keeps it from flickering

resizeMap ​

ts
resizeMap(sides: MapSides): EditorResult;

Grows or cuts the map (MapEditor.resize). Refused, saying why, where it cannot be that size

resizeSoon ​

ts
resizeSoon(): void;

Fits the view to its canvas once its size stops changing, at the start of a frame, just before it is drawn. Resizing a canvas clears it, and a resize between a frame and the page being painted (where a ResizeObserver is told) shows that cleared canvas for a moment: as a window is dragged bigger, a flicker every step. And a panel sliding open or shut changes the view's size every frame of its slide (some 28 sizes in a quarter of a second at 120 frames a second): resized each time, Chrome showed the view black for the whole slide (reported by the owner), though each frame was drawn whole. So the size is followed only once it holds from one frame to the next, or every SIZE_AT_MOST while it goes on changing (a window dragged); until then the last picture is shown cropped to the view (object-fit: cover, pageView)

revealEffect ​

ts
revealEffect(name: string): void;

Opens the FX panel at an effect, by its name (a ready-made one's as preset:<name>): what the panel offers (reveal)

rules beta ​

ts
readonly rules: EditorRules;

The map's rules (campaign plan MS1), kept in its data for the mission rules pack to run (missionRules): added, changed, moved and taken away, their actions too, each a step of the history; and the names a rule picks from (what the Rules panel shows)

run beta ​

ts
readonly run: EditorRun;

The project run from the editor (E2E plan EDF5): its scripts started and stopped by the dev server, what they print, and the web game opened in a tab, watched and closed (what the Run panel shows)

runtime ​

ts
readonly runtime: ClientRuntime;

What the app runs with: where the editor keeps maps, drafts, prefabs and files in the browser (runtime.storage)

said ​

ts
said<T>(result: EditorResult<T>): EditorResult<T>;

Says why an operation was refused (EditorResult.why), in the status line, and gives the result back: how the editor's own panels, menus and keys call an operation, for the person who asked to read why. Code reads why itself. Nothing is said of one that was done

editor.said(editor.setName(target, name)) const made = editor.said(await editor.groundFromPicture(file))

save ​

ts
save(options?: {
        force?: boolean;
    }): Promise<boolean>;

Saves the map: to its file in the project while developing, in the browser otherwise. Resolves to false when it could not be saved, with the reason in the status line. A file changed on disk since it was opened is not written over without asking (shell.resolveConflict)

saveAnimation beta ​

ts
saveAnimation(src: string, clip: string | KeyedClip, options?: {
        name?: string;
        def?: ClipDef;
        clipsFile?: string;
        into?: 'game' | 'map';
    }): Promise<EditorResult<{
        file: string;
    }>>;

Saves a clip as it is as an animation file (animations/<name>.anim.glb, E2E plan AN5): a thing of its own in the game's folder (the map's without one), with the bones and rest of the model it is on, its marks and loop (def), owned by no model. clip is a clip of the model's own file, of its file of clips (clipsFile), by its name, or as its keys (KeyedClip: the Animation panel's, with what was edited). Gives back its path. The same name writes it again

saveBrushPreset ​

ts
saveBrushPreset(name?: string): BrushPreset | undefined;

Keeps the brush picked as it is set (its size, strength, softness, shape) by a name, in the place of one of that name: Brush n when none is given. Nothing with no brush picked

saveLook ​

ts
saveLook(type: string, entry: LooksEntry): Promise<void>;

Writes what a unit type looks like into the game's looks.json (the model setup, the Model view's Death, Going up and Damage tabs), field by field over what the file has (a field given as undefined is taken out of it), and draws it at once: the game's view has it over its code's from now on in this page, and from the file after

say ​

ts
say(text: string): void;

Tells the user something, in the status line

scatterLooks ​

ts
get scatterLooks(): string[];

The kinds of what the scatter brush puts down: the looks of its type, like the kinds of tree

scene ​

ts
readonly scene: EditorDrawing['world']['scene'];

What the drawing reads a frame by (its stand-in of a scene: what runs after a frame, the live portraits' stage): the browser tests'

scenes ​

ts
readonly scenes: {
        editor: string;
        play?: string;
        sandbox?: string;
        list?: () => Promise<readonly EditorSceneInfo[]>;
    };

The names of the scenes the editor moves between: its own, the game played, the sandbox, and a function listing the scenes

screen beta ​

ts
readonly screen: EditorScreen;

The scene the map is drawn in, as the editor shows it: what is under a point of the view, what a tool shows over the map, what is done each frame, pictures of models, the map's sounds and its hour

ts
readonly search: EditorSearch;

Search everything (Ctrl+K, the field in the bar): where it looks, the editor's own places and a game's (EditorOptions.search, search.add), and what was used last

selectedTargets ​

ts
selectedTargets(): Named[];

Everything selected, as targets, kind by kind

selectGroup ​

ts
selectGroup(id: number): void;

Selects the things of a group (and of the groups in it)

selection beta ​

ts
readonly selection: EditorSelection;

What is selected, and what can be: picking a thing alone, everything, all of a type; hiding and locking kinds of thing; deleting what is selected

selectionFieldChanged ​

ts
selectionFieldChanged(field: string): boolean;

Whether a field of the things selected is set apart from its default on any of them: an object's facing (0) and scale (1), what it starts as (ObjectProperty: nothing set, as its type), the game's own as data.<id> on the objects, camps and regions selected (nothing kept: the field's default)

selectLook ​

ts
selectLook: OutlineLook;

How the line around the objects selected looks (EditorPrefs.selectionOutline turns it off): the theme's blue, thin

selectTargets ​

ts
selectTargets(targets: Iterable<Named>): void;

Selects these things alone, with the select tool

setCampUnits ​

ts
setCampUnits(id: number, units: string[]): void;

Sets the units of a camp, by the camp's object id, as one step of the history

setField ​

ts
setField(id: string, value: unknown): EditorResult;

Sets a field of the game's own on what is selected. Refused, saying why, where it cannot be that

setGround ​

ts
setGround(id: string, change: Partial<Omit<MapTile, 'id'>>): void;

Changes a ground of the map's own (MapTile): its name, picture or colour

setGroundLayer ​

ts
setGroundLayer(id: string, index: number, change: Partial<MapGroundLayer>): void;

Changes a layer of a ground of the map's own: what is said of it over what it was (undefined takes a field away)

setGroundMix ​

ts
setGroundMix(id: string, change: Partial<NonNullable<MapTile['mix']>>): void;

Changes how a mixed ground is mixed: what of, how much of each, its patches. Its colour follows

setIcon ​

ts
setIcon(name: string, icon: EditorIcon): void;

Gives an icon by a name: one of the game's own, or in the place of the editor's of that name

setName ​

ts
setName(target: Named, name: string | undefined): EditorResult;

Names something on the map, or takes its name away with none. Refused, saying why, where it cannot have that name

setPrefabChance ​

ts
setPrefabChance(kind: string, id: number, chance: number): void;

On a prefab's stage: a part's chance to be placed (0..1) set, by kind and the stage's id; kept with the prefab as it is saved

setPrefabTurn ​

ts
setPrefabTurn(turn: 'random' | 'quarters' | undefined): void;

On a prefab's stage: how placements turn, kept with the prefab as it is saved

setPrefs ​

ts
setPrefs(change: Partial<EditorPrefs>): void;

Changes the editor's settings, and keeps them

setProperties ​

ts
setProperties(change: Parameters<MapEditor['objects']['setProperties']>[1]): void;

Sets what the selected objects start as: hurt, at a level, with items (see MapEditor.setProperties)

setScatterLooks ​

ts
setScatterLooks(looks: string[]): void;

Picks the kinds the scatter brush puts down. None: the game picks from its mix

setScatterType ​

ts
setScatterType(type: string): void;

Picks what the scatter brush puts down, with none of its kinds chosen: the game's mix

setScatterVariance ​

ts
setScatterVariance(variance: number): void;

How much the size of what is scattered varies, 0..1

setSelectionOwner ​

ts
setSelectionOwner(owner: PlayerId): void;

Sets the owner of the selected objects to the player

setTerrainRules ​

ts
setTerrainRules(rules: TerrainRules): void;

Sets the terrain rule of the map (kept with it, no step of the history); a rule kept live paints at once

setTool ​

ts
setTool(tool: EditorTool): void;

Picks a tool; cancels what the one before was doing, clears the status and says it on the bus (tool)

shared beta ​

ts
shared<K extends keyof EditorSharedValues>(key: K, initial: EditorSharedValues[K], options?: SharedOptions): EditorShared<EditorSharedValues[K]>;

A value two panels both follow (EditorShared): the picked wave, a filter by player. One of each key, made the first time it is asked for as initial; read as a function (it follows in Solid) or get(), changed with set, followed with subscribe. Kept in this browser per game with { keep: true }, as a panel's state is. Typed by EditorSharedValues, which a game adds to

shared ​

ts
shared<T>(key: string, initial: T, options?: SharedOptions): EditorShared<T>;

A value shared between the editor's parts and the person's panels, by key, with its initial value; keyed values of EditorSharedValues are typed

shell beta ​

ts
readonly shell: EditorShell;

What the editor asks of the page that draws it: a menu opened, a dialog, whether changes may be lost, a file to open, playing the map here, the way out, a conflict with the file on disk. The page's own when it gave one (EditorOptions.shell), else one that asks nobody and plays nothing

shellState beta ​

ts
readonly shellState: ShellState;

What is open in the interface apart from the panels: a dialog, the list of keys, the tour, the palette, the tuning box. The page's own when it gave one (EditorOptions.shellState), else the editor's

showEverything ​

ts
showEverything(): void;

Shows and unlocks everything: every kind, every thing hidden or locked by id, and what was isolated

showReferences beta ​

ts
showReferences(ref: Reference): number;

Selects every use of a thing on the map, and says how many there are and where else it is named. How many uses

showSetting ​

ts
showSetting(panel: string, fold?: string): void;

Opens a panel at one of its folds, by the fold's title: the fold opened, scrolled to and shown for a moment. What the search does with a setting (SETTING_PLACES)

snapToGround ​

ts
snapToGround(): void;

Puts what is selected and was lifted off the ground back on it: one step

sounds beta ​

ts
readonly sounds: EditorSounds;

How the game's sounds are played (campaign plan EQ9), as its sounds.json says: each one's volume, pitch, reach, cutoff and bus, set as a step of the history, laid at once here and in a game played here, and played as it says (what the Sounds panel shows)

spreadAlong ​

ts
spreadAlong(shape: SpreadShape): void;

Spreads what is selected evenly along the line between its two farthest things, or round a circle: one step

stage ​

ts
readonly stage: EditorLiteStage;

The editor's stage (EditorOptions.stage): what draws the map, what picks on it, the handles, the panels' views

start ​

ts
start(): void;

Starts the editor's frames, and its idle watch

startFile ​

ts
startFile?: string;

The map file of the project the editor starts on (EditorOptions.startFile), read as it opens. Later, in code: openFile(name)

startLayout ​

ts
get startLayout(): string | EditorLayoutPreset | undefined;

The layout the editor starts with, as the game says (EditorOptions.layout)

startMap ​

ts
startMap?: GameMap | (() => GameMap);

The map the game starts its editor on (EditorOptions.startMap): set in code too. An empty one of 128 when there is none

statistics beta ​

ts
readonly statistics: EditorStatistics;

What is on the map, counted (campaign plan EQ7): each player's units, buildings and supply, the resources at each start, the shares of the ground walked and built on, the triangles drawn against the quality's budget; a count's things selected (what the Statistics panel shows)

status ​

ts
status: string;

Something to tell the user, like why something could not go there

statusInfo ​

ts
get statusInfo(): {
        cell?: {
            x: number;
            z: number;
            height: number;
            level: number;
            tile: string;
            water: string;
        };
        selected: number;
        objects: number;
        doodads: number;
        fps: number;
        renderer: string;
    };

What the status bar says: the cell under the pointer, what is selected, how much is on the map

styles ​

ts
readonly styles: EditorFoliageStyles;

The styles of the game's layers of grass and bushes on this map (the Terrain panel's Patch tool and Styles): the cells picked with the Patch tool (styles.selection, never saved), the layer's styles (the game's values with the map's own), and every change to them as a step of the map's history. A style's name, colour and rules go to the map's definitions or the game's data.json; its look to the map's environment.bushes or the game's cellLayers.json

symmetry ​

ts
get symmetry(): Symmetry;

set symmetry(symmetry: Symmetry);

How the map is kept fair while it is made: what brushes do and what is put down is done again mirrored or turned

tabs beta ​

ts
readonly tabs: EditorMapTabs;

Several maps open, pinned as tabs: each kept with its history and its files while another is open, and taken up again as it was

takeFile ​

ts
takeFile<T>(def: ViewFile<T>, file: T): void;

A file of the game's as a panel writes it (hud.json, fx.json, quality.json...), laid again over what the code says (relayFile) at once: drawn here and played in the game played here, before it is saved. In the game's own view too: a game started from here (Play) plays it, not the file as the page was loaded with

templates beta ​

ts
readonly templates: EditorTemplates;

Maps to start from (campaign plan EQ12): the map open now kept as a template without what stands or is painted on it, among the game's files (templates/<name>.vgmap.json), and a new map made of one (File › Save as template, File › New)

terrainRules ​

ts
terrainRules(): TerrainRules;

The map's terrain rule (MF6): the bands that paint the tiles by height and slope, and whether they are kept live

testComputer beta ​

ts
testComputer(player: PlayerId): boolean;

Plays the map here to try a computer player (master plan OC4): the game played here, the Inspector on that seat (what it is thinking, its goals and decisions) and the game's AI overlay on where its view has one. Whether it could be played (the editor's interface plays it, and the map has no error)

themeLook beta ​

ts
themeLook(): {
        base: EditorTheme;
        tokens?: Partial<Tokens>;
    };

The theme the editor is in, as its settings say: one of its own (the stylesheet's variables for it), or a game's (its values, over the one of the editor's it is made over). Dark for a theme it does not have

themes beta ​

ts
get themes(): readonly EditorThemeDef[];

The game's themes for its editor, in its settings after the editor's own (EditorOptions.themes)

tiles ​

ts
get tiles(): {
        index: number;
        id: string;
        name: string;
        color: Rgb;
        own?: boolean;
        picture?: string;
        adjust?: MapTile['adjust'];
        speed?: number;
    }[];

The ground's tiles of the map: its tileset in order, each with name, swatch colour, picture and its speed

toast beta ​

ts
toast(text: string, options?: {
        tone?: 'default' | 'success' | 'danger';
        seconds?: number;
        undo?: boolean;
    }): void;

Tells the user something for a moment, over the editor (the page's toast: EditorShell.toast), and in the status line besides: a file taken in, what went wrong with it. undo puts an Undo on it (campaign plan EQ17), for what was just done as one step (Delete, Replace with): it undoes that step while it is still the last, and says so where something was done since

toggleFullScreen ​

ts
toggleFullScreen(): void;

Has the editor fill the screen, its element alone, or back in its page

toggleOverlay ​

ts
toggleOverlay(overlay: ViewOverlay, on?: boolean): void;

Shows or hides what is shown over the map of what the rules make of it

tool beta ​

ts
readonly tool: ToolState;

The tool picked and what it works with (ToolState): the brush, the facing, the handles, the measure, what the picking tools picked, the game's tools' options. A tool is picked with setTool

tools beta ​

ts
readonly tools: EditorTools;

The tools of the game's own (GameToolDef): declared (EditorOptions.tools), an extension's, or added in code (add(def) gives back what takes it away, remove(id), get, list). The strip of tools, the keys that pick each and its own keys follow

transformSelection ​

ts
transformSelection(change: {
        facing?: number;
        turn?: number;
        scale?: number;
    }): void;

Turns, scales or faces the selected objects by the change: facing sets their facing, turn adds to it, scale sets their size

undo ​

ts
undo(steps?: number): void;

Takes back the last operations, steps of them. What a tool is in the middle of is taken back instead, as one

ungroupSelection ​

ts
ungroupSelection(): void;

Takes away the groups of what is selected

unsaved ​

ts
get unsaved(): boolean;

Whether there is anything not saved: the map (mapFiles.dirty), or the game's files a panel wrote (files)

untouchedSinceGenerated ​

ts
get untouchedSinceGenerated(): boolean;

Whether the map open now is as the generator made it: nothing changed since

useBrushPreset ​

ts
useBrushPreset(name: string): boolean;

Picks a brush kept, by its name: the brush, set as it was kept. False where none is of that name, or its brush is not the editor's

versions beta ​

ts
readonly versions: EditorVersions;

The versions of the map open (campaign plan EQ15): a snapshot of its file kept in this browser at each save, the last 20, what changed since one, one taken back as a change to save (what the Versions panel shows)

view ​

ts
get view(): GameView;

How the game looks and sounds, as its view says

viewPicture beta ​

ts
readonly viewPicture: EditorViewPicture;

Pictures of the view (campaign plan EQ13): what the camera looks at, at 1×, 2× or 4× its pixels, with nothing of the editor's in it, kept among the map's files (images/<name>.png) or made the map's preview (View › A picture of the view)

world ​

ts
get world(): World | undefined;

The world of the game played here (played, its GameClient), while it is played in this page (a LocalSession): the simulation itself, to read (world.entities, world.tick), as the Hierarchy and the Inspector do. None while nothing is played, or while the game runs elsewhere (a worker, a server): then played.session is all there is, as for a player. To change the game, send commands through played.session, so that what a panel does in Play here is what a player could do

writeClips beta ​

ts
writeClips(src: string, data: Uint8Array, into?: 'game' | 'map'): Promise<string>;

Writes a model's file of clips beside it (clipsFilePath: <model>.clips.glb), where importModel puts a model: the path a ModelDef.clipsFile gives it. What draws the model now has its clips again

writeModels beta ​

ts
writeModels(models: readonly ModelFileData[], into?: 'game' | 'map'): Promise<string[]>;

Writes models cut out of one (the Split dialog: cutOut), each by its file name (tree.glb, rock.gltf), where importModel puts them: the paths a ModelDef.src gives them