Skip to content

EditorTool beta ​

TypeAlias of @v12-engine/editor

ts
export type EditorTool = {
    kind: 'select';
} | {
    kind: 'place';
    type: string;
    owner: PlayerId;
} | {
    kind: 'camp';
    units: string[];
} | {
    kind: 'start';
    player: PlayerId;
} | {
    kind: 'brush';
    brush: BrushTool;
}
/** Regions of the map: new ones get this shape */
 | {
    kind: 'region';
    shape: AreaShape['kind'];
    cinematic?: string;
}
/** Areas of the map that are no region (`AreaFor`): mist in places. Drawn, picked, moved and resized as regions are */
 | {
    kind: 'area';
    shape: AreaShape['kind'];
    for: AreaFor;
}
/** Points the rules know by name */
 | {
    kind: 'point';
}
/** Lights standing on the map (`MapLightSource`): new ones are put down as the last one set */
 | {
    kind: 'light';
}
/** Effects playing at places of the map (`MapFx`): new ones play what the last one set does */
 | {
    kind: 'effect';
}
/** Paths the rules know by name */
 | {
    kind: 'path';
}
/** Sounds that keep playing at places of the map: new ones play this */
 | {
    kind: 'sound';
    sound: string;
}
/** Waterfalls put down by hand (`MapWaterfall`): new ones face the way `[` and `]` turned the next one */
 | {
    kind: 'waterfall';
}
/**
 * Marks laid on the ground (`MapDecal`): new ones are of this look, a decal look of the game's by its id
 * (`GameView.ground.decals`) or a picture by its path in `textures/`, as big as the look says
 */
 | {
    kind: 'decal';
    look: string;
}
/** Scenery: new doodads are of this model, by its path in `models/` */
 | {
    kind: 'doodad';
    model: string;
}
/** A tool of the game's own (`GameToolDef`), by its id */
 | {
    kind: 'custom';
    id: string;
}
/** Measures between two clicks: straight, and on foot */
 | {
    kind: 'measure';
}
/** A prefab of the game's, put down where it is clicked, by its name */
 | {
    kind: 'prefab';
    name: string;
}
/** A thing of a kind of the game's own (`MapKindDef`), put down where it is clicked, by the kind's id */
 | {
    kind: 'thing';
    thing: string;
}
/**
 * Cells of a layer of grass or bushes picked to change together (`editor.styles.selection`): by a rectangle, a circle
 * or a polygon, the patch under the pointer (`wand`, of its style or of `any`), or every cell of the style under it
 * (`style`). Shift adds, Alt takes away
 */
 | {
    kind: 'patch';
    layer: string;
    shape: PatchShape;
    any?: boolean;
};

Which tool is picked, and with what