Scripting API

Scripting API

EditorMenuItem

Record in Abyss.Core, from Abyss.Core.

An item a plugin put in one of the editor's menus: where, by the path it gave — folders and its name, between slashes — the plugin that put it there, and what it does. The editor puts it under the plugin's package's name, and the game's own items first; see ToolsMenu.

public record EditorMenuItem

Constructors

EditorMenuItem

public EditorMenuItem(EditorMenuPlace Place, string Path, Type? Plugin, ComponentId Component, Action<World, ulong> Run)

An item a plugin put in one of the editor's menus: where, by the path it gave — folders and its name, between slashes — the plugin that put it there, and what it does. The editor puts it under the plugin's package's name, and the game's own items first; see ToolsMenu.

Parameters

  • Place: The menu it is in.
  • Path: Its folders and its name, between slashes: Roads/Straight Road.
  • Plugin: The plugin that put it there, or null for none.
  • Component: The component it is on the menu of, for EditorMenuPlace.Component; none otherwise.
  • Run: What it does: given the world, and the entity it is made on or done to; none for a command.

Properties

Place

public EditorMenuPlace Place { get; init; }

The menu it is in.

Path

public string Path { get; init; }

Its folders and its name, between slashes: Roads/Straight Road.

Plugin

public Type? Plugin { get; init; }

The plugin that put it there, or null for none.

Component

public ComponentId Component { get; init; }

The component it is on the menu of, for EditorMenuPlace.Component; none otherwise.

Run

public Action<World, ulong> Run { get; init; }

What it does: given the world, and the entity it is made on or done to; none for a command.

Name

public string Name { get; }

What it reads: the last part of its path.

Folders

public IReadOnlyList<string> Folders { get; }

The folders it is in, outermost first: the parts of its path before its name.