EditorTools beta
Class of @v12-engine/editor
export declare class EditorToolsThe tools of a game's own (editor.tools): those it declares (EditorOptions.tools), those an extension brings and those code adds. Each is made with the editor as it is added, and taken apart as it goes; the strip of tools, the keys that pick each and its own keys follow
Members
constructor
constructor(
host: ToolHost | undefined, changed?: () => void);Constructs a new instance of the EditorTools class
add
add(def: GameToolDef): () => void;Adds a tool, or one in the place of the tool of its id. Gives back what takes it away
get
get(id: string): GameToolDef | undefined;The definition of the game's tool with that id, or nothing
has
has(id: string): boolean;Whether the game has a tool of that id
list
list(): readonly GameToolDef[];Every tool of the game's own, in the order they came
onAdded
onAdded(listener: (def: GameToolDef) => void): () => void;Told of each tool added (or in the place of another). Gives back what stops it
onRemoved
onRemoved(listener: (def: GameToolDef) => void): () => void;Told of each tool taken away. Gives back what stops it
remove
remove(id: string): void;Takes a tool away: taken apart, its keys gone; the select tool picked where it was the one picked