scmJS docs

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.

TopMenutype

type TopMenu = "File" | "Edit" | "View" | "Layer" | "Scenario" | "Triggers" | "Tools" | "Plugins" | "Help";

scmJS 0.1.0 · Generated from the repository. StarCraft and Brood War are trademarks of Blizzard Entertainment; this project ships none of their data.