ToolHost beta
Interface of @v12-engine/editor
export interface ToolHostWhat the editor is to a tool
Members
changed
changed(settled?: boolean): void;After the map changed: it has changes to save, and is shown as it is now. settled says an operation just ended or was cancelled: if it left no step in the history, nothing changed (a stroke that did nothing)
changes
readonly changes: EditorChanges;What of the editor changed, said by the tools as they change it (the brush, the facing, the measure)
clipboard
readonly clipboard: EditorClipboard;The game's prefabs: as saved (prefab, prefabFile), put down as an instance (placePrefab), an instance selected
doc
readonly doc: MapEditor;The map's editor, through which a tool changes the map as steps that can be undone
placeThing
placeThing(kind: string, at: Vec2): MapThing[];Puts a thing of a kind of the game's own down at a place, as its kind says a new one is (MapKindDef.create), and again where the map's symmetry says: one step, the new ones selected. None when the kind refuses the place
prefs
readonly prefs: EditorPrefs;What the one who uses the editor set it to: what snapping steps by (grid, angleStep, scaleStep)
recentTiles
readonly recentTiles?: Pick<EditorRecentTiles, 'used'>;The tiles painted with last (EditorRecentTiles): a stroke of paint or fill notes its tile there
registry
readonly registry: Registry;The game's types, which a tool looks units and other things up in
said
said<T>(result: EditorResult<T>): EditorResult<T>;Says why an operation was refused, in the status line, and gives it back (EditorClient.said)
say
say(text: string): void;Tells the user something, in the status line
screen
readonly screen: EditorScreen;What is under a point of the view, and what a tool shows over the map while it works: a box, a brush, a ghost, a draft
selection
readonly selection: EditorSelection;What is selected, and selecting: the sets by kind (ids), a region, light, effect, area, point or path alone, nothing
setTool
setTool(tool: EditorTool): void;Picks a tool in place of the one picked now
sounds
readonly sounds?: Pick<EditorSounds, 'defs'>;How the game's sounds are played (EditorSounds.defs): a sound put down on the map starts at its reach and volume
stage
readonly stage: Pick<EditorLiteStage, 'gizmo'>;The editor's stage: what makes the handles on the selection
styles
readonly styles?: Pick<EditorFoliageStyles, 'select' | 'selection' | 'clearSelection' | 'layers' | 'isFoliage'>;The styles of the layers of grass and bushes, and the cells the Patch tool picks (EditorFoliageStyles); which layers are grass and bushes, for a brush that clears them
tool
readonly tool: ToolState;The tool picked and what it works with: the brush, the facing, the handles, what the picking tools picked…
transformSelection
transformSelection(change: {
facing?: number;
turn?: number;
scale?: number;
}): void;Turns the selection by turn radians, sets its facing to facing and scales it by scale, each for those given