Vixen
feb85697
csharp
public sealed class EditorSubmenuAttribute

Declares a submenu: its localised title and where among its siblings it goes.

Read the guide page for this →

As a annotation

Valid on
Class, repeatable

Remarks

Doc 50 § D5's other half. EditorMenuAttribute's path makes any submenu it names, titled with the path's own text and appended to its parent. That is the right default for a script and the wrong one for a built-in, whose submenus have translated titles and a place in a menu the application owns — Blockout's six go after Scene ▸ Measure, and a feature that could only append would reorder somebody's menu the day it stopped being compiled in.

[EditorSubmenu("Scene/Geometry", Title = nameof(BlockoutStrings.MenuGeometry), After = "editor.menu.elements")] public sealed class BlockoutModule : IEditorPlugin { … }

⚠ On a class, and any class. It describes the menu rather than a member, so it goes on whatever type owns the feature — the module, by convention.

Fields and properties (5)

  • public string Path

    The submenu. The first part is a menu on the bar, the last is this one.

  • public string Title

    Its title, as the name of a StringId in a declaration class.

  • public Type? Strings

    The declaration class Title is in, when it is not this assembly's.

  • public string After

    The title id of the sibling it goes after, or empty to append it.

  • public int Priority

    Which of two submenus declared for one menu is placed first. Lower is first.

Methods (1)

  • public EditorSubmenuAttribute(string path)

    Declares a submenu: its localised title and where among its siblings it goes.

Used by (5)

  • BlockoutModuleVixen.Editor.Blockout
  • DeclaredVixen.Editor.Blockout
  • DeclaredVixen.Editor.Water
  • DeclaredContributionsVixen.Editor.App
  • WaterModuleVixen.Editor.Water