api.menu
MenuApi
Items in the editor's menu bar. A path whose last segment names no submenu makes one.
Members
add
add(path: MenuPath, item: MenuItemSpec): Disposable;
Items in the editor's menu bar.
api.menu.add("Tools", {
label: "Count units\u2026",
icon: "plugin",
run: () => api.ui.alert(`Player 1 has ${api.query.unitsOf(0).length} units.`),
});
// A path whose last segment names no submenu makes one, at the end of that menu.
api.menu.add("Tools/My plugin", { label: "Settings\u2026", command: "settings" });
Types
Declarations only this group names.
PluginIcontype
type PluginIcon = {
kind: "text";
text: string;
} | {
kind: "image";
url: string;
};
A manifest icon after resolution: a glyph to print, or an image to show.