EditorSetup beta
Interface of @v12-engine/editor
export interface EditorSetupWhat a game sets its map editor up with, however the editor is opened (EditorOptions for the client, EditorAppProps on a page, EditorSceneDef as a scene of an app, OpenEditorOptions from openEditor): its palette, extensions, tools, panels, actions, icons, kinds, areas, files, Inspector sections, menus, search, themes, the map it starts on, its guide and its layout. Each of those takes it whole and hands it on
Members
actions
actions?: GameActions<EditorClient>;What the game says of the editor's actions and their keys (editor.keys): its own, asked before the editor's (add), those of the editor it leaves out (hide, by id) and those it changes (change: other keys to come with, other words, something else to do). In code: editor.keys.define, forget, bind
docs
docs?: string;Where the editor's docs are (https://…/docs): a panel's help (EditorPanelDef.docs) links to its page there. No link when left out
extensions
extensions?: EditorExtension[];Extensions of the editor (EditorExtension, defineEditorExtension): panels, tools, actions, menus, search, Inspector sections, kinds, icons, themes and layouts as one thing each, a package's or a mod's, put in after what the rest of these options say. editor.extensions.add in code
files
files?: EditorFiles;Where the game's own files its panels read and write are kept (editor.files): a store of the game's own (EditorFiles: an editor shipped to players, with downloads or a desktop shell). The project's through the dev server, or this browser's without one, when left out
guide
guide?: string | ((editor: PanelClient, page?: string) => void);Help › The guide: the address of the game's guide to its editor, or what opens it (given the editor: its project opens a file of the code, editor.project.openInEditor; and with F1 in a panel, the panel's page of the docs, EditorPanelDef.docs: editor/play#use-cheats). No line when left out
icons
icons?: Record<string, EditorIcon>;Icons of the game's own, by name: for its panels and tools, or in the place of the editor's (save, terrain…, see EditorIcon). The editor's own are Lucide's
inspector
inspector?: InspectorSectionDef[];Sections of the Inspector of the game's own, for what is selected (InspectorSectionDef): among the editor's own, or in the place of one of them. In code: editor.inspector.add, remove
kinds
kinds?: MapKindDef[];Kinds of thing of the game's own (MapKindDef): what its editor puts down that the engine's kinds do not say, kept in the map's data for its rules to read. Each has a tool, a look, a group of the Hierarchy and the Inspector. In code: editor.kinds.add, remove
layout
layout?: string | EditorLayoutPreset;The layout the editor starts with, and Reset goes back to: one of the editor's by its id (scene, the scene alone, when left out; terrain, objects), or the game's own, said as the panels docked open
mapAreas
mapAreas?: MapAreaDef[];Areas of the map editor of the game's own (MapAreaDef): made with the map editor of every map opened, and found by their ids (editor.doc.area(id)). In code: editor.addMapArea
menus
menus?: EditorMenu[];Menus of the game's own on the bar, before Window; one with the id of the editor's (file, map…) adds its lines to that one
palette
palette?: (registry: Registry) => MapPaletteGroup[];The groups of unit types to place. Units, heroes, buildings, resources and creeps when left out
panels
panels?: EditorPanelDef[];Panels of the game's own added to the editor (EditorPanelDef)
sandboxCheck
sandboxCheck?: (map: GameMap) => string | undefined;What keeps a map from being tried in the sandbox, in words, as the game the sandbox plays says: nothing for a map that can be. Asked before the sandbox is opened; every map can be, when left out
search
search?: SearchSource[];Where the search (Ctrl+K) looks too, after the editor's own places (see SearchSource; client.search.add in code)
startFile
startFile?: string;The map file of the project a new editor starts on, where nothing was kept, by its name (road, for maps/road.vgmap.json): opened as File › Open opens it, so Save writes it back. Where the dev server has the editor's plugin (editorFiles); startMap until it is read, and where there is no project or no such file. editor.mapFiles.openFile(name) in code
startMap
startMap?: GameMap | (() => GameMap);The map a new editor starts on, where nothing was kept, and File › New's first line: the game's own (a road already laid, its players). An empty one of 128 when left out. editor.startMap in code
themes
themes?: EditorThemeDef[];Themes of the game's own for its editor (EditorThemeDef), in its settings after the editor's own. editor.addTheme and removeTheme in code, editor.setPrefs({ theme }) to put one on
tools
tools?: GameToolDef[];Tools and panels of the game's own (see GameToolDef, EditorPanelDef)