Skip to content

ToolState beta ​

Class of @v12-engine/editor

ts
export declare class ToolState

The tool picked and what it works with: the brush, the facing and the random turn and size of what is put down, the handles on the selection, what the measure tool measured, the next light and effect, what the region, point, path, sound and area tools picked, and what the game's own tools are set to. Picking a tool is editor.setTool, which does what goes with it (the tool before let go, the overlay of a layer of cells, what it starts on).

A part of the editor, as it gives it (editor.tool), and of what a tool is made with (ToolHost.tool)

Members ​

constructor ​

ts
constructor(host: ToolStateHost);

Constructs a new instance of the ToolState class

area ​

ts
get area(): number | null;

The place picked with the area tool (of the mist, the weather or the clouds), by its id: the selection's primary

brush ​

ts
brush: BrushOptions;

What the brushes paint with: their size, strength, ground, scenery… Set by the editor as its map is first read

decal ​

ts
get decal(): number | null;

The decal picked with the decal tool, by its id: the selection's primary, where it is a decal

emitter ​

ts
get emitter(): number | null;

The sound of the map picked with the sound tool, by its id: the selection's primary, where it is a sound

facing ​

ts
facing: number;

Direction what is put down faces

gizmo ​

ts
readonly gizmo: GizmoOptions;

The gizmo's options: snapping as the editor's settings say (snapByDefault), set as the editor reads them

marker ​

ts
get marker(): PickedMarker | null;

The point or the path picked with their tools, and the point of a path picked: the selection's primary

measureFor ​

ts
measureFor?: string;

The unit type the measure tool times the way on foot for

measurement ​

ts
measurement: Measurement | null;

What the measure tool measured: from, to, and the way on foot between, when there is one

moveMirrors ​

ts
moveMirrors: boolean;

A drag of the selection moves the things standing where the map's symmetry puts them again too, mirrored (RV100): opt in, in the select tool's options, while the map has a symmetry

newDecal ​

ts
newDecal(look: string): Omit<MapDecal, 'id' | 'x' | 'z'>;

What the next decal laid with the decal tool is, but where and of what look (MapDecal): as big as its look says (DecalLook.size), turned as [ and ] turned the next one, and turned any way and sized as the placing says (placing.randomTurn). Its look's own tint and fade under its own

newEffect ​

ts
get newEffect(): Partial<Omit<MapFx, 'id' | 'x' | 'z'>>;

set newEffect(look: Partial<Omit<MapFx, 'id' | 'x' | 'z'>>);

What the next effect put down with the effect tool is, but where (MapFx): set in its bar or panel, or from an effect ("New ones like this"). The game's first effect that plays on (looped, or never ending: a fire, smoke) when nothing says, else its first: one that ends by itself (a burst of blood) is not what a map is dressed with

newLight ​

ts
get newLight(): Partial<Omit<MapLightSource, 'id' | 'x' | 'z'>>;

set newLight(look: Partial<Omit<MapLightSource, 'id' | 'x' | 'z'>>);

What the next light put down with the light tool is, but where (MapLightSource): set in its panel, or from a light ("New ones like this")

optionsOf ​

ts
optionsOf(tool: string): Record<string, unknown>;

What a tool of the game's own is set to (GameToolDef.options), by the options' ids: what was set on the bar over the scene or in code (setOption), or each one's default

picked ​

ts
picked: EditorTool;

The tool picked, with what it was picked with

placing ​

ts
readonly placing: {
        randomTurn: boolean;
        randomSize: number;
        owner: number;
    };

What is put down gets a turn of its own each time, and a size up to so much bigger or smaller; and whose it is (a group of the palette may say otherwise: creeps are the creeps')

region ​

ts
get region(): number | null;

The region picked with the region tool, by its id: the selection's primary, where it is a region

setOption ​

ts
setOption(tool: string, id: string, value: unknown): void;

Sets something a tool of the game's own can be set to (GameToolDef.options), as its field on the bar over the scene does; undefined puts it back to what it is when nothing was said