scmJS docs

api.contextMenu

ContextMenuApi

Items in the right-click menus of the map and the terrain palette.

Members

add

add(surface: ContextSurface, item: ContextItemSpec): Disposable;

Types

Declarations only this group names.

ContextSurfacetype

type ContextSurface = "viewport" | "terrainPalette";

ContextMenuContextinterface

interface ContextMenuContext
surface: ContextSurface
tile: { x: number; y: number; } | null

The tile under the pointer (viewport only).

point: { px: number; py: number; } | null

The map pixel under the pointer (viewport only).

layer: EditorLayer
terrainMode: TerrainMode
terrain: number

The palette's active terrain id.

markedArea: Rect | null

ContextItemSpecinterface

interface ContextItemSpec
label: string | ((ctx: ContextMenuContext) => string)
enabled?: (ctx: ContextMenuContext) => boolean
visible?: (ctx: ContextMenuContext) => boolean
run?: (ctx: ContextMenuContext) => void

Give this or command (which is run with the context as its argument).

command?: string

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