EditorMenus beta
Class of @v12-engine/editor
export declare class EditorMenusThe menus of an editor: its own, and what a game or code adds to them (add, addMenu). Read as they are shown, so a line added shows the next time its menu opens
Members
constructor
constructor(menus?: EditorMenu[], changed?: () => void);Constructs a new instance of the EditorMenus class
add
add(menu: string, entry: EditorMenuEntry, options?: {
before?: string;
}): () => void;Adds a line to a menu, at its end or before another of its lines. Gives back what takes it out again
addMenu
addMenu(menu: EditorMenu, options?: {
before?: string;
}): () => void;Adds a menu to the bar, before another (before Window when nothing is said: the last two are the editor's own, as everywhere), or puts it in the place of one with its id. Gives back what takes it out again
declare
declare(menu: EditorMenu): () => void;A menu as a game declares it (EditorOptions.menus): a new one on the bar, before Window; or, with the id of one there is (file, map…), its lines at the end of that one. To put a menu in the place of one of the editor's, addMenu. Gives back what takes it out again
items
items(menu: string, client: EditorClient): EditorMenuEntry[];The lines of a menu now: its own, with those added, without those that are left out now
list
list(): readonly EditorMenu[];The menus, in the order they are on the bar
remove
remove(menu: string): void;Takes a menu off the bar