swiftlys2/docs/api/ai/
API Reference › Menu

IMenuRendererRegistry

Interface
Namespace: SwiftlyS2.Shared.Menu · Assembly: SwiftlyS2.CS2.dll
public interface IMenuRendererRegistry

The catalogue of available renderers and their component specialisations.

Registrations made through a plugin's own menu service are released when that plugin unloads.

View source

Properties

RendererIds

The ids of every currently registered renderer.

IReadOnlyList<string> RendererIds { get; }
Property Value

Methods

Register(IMenuRenderer)

Adds a renderer, replacing any renderer already registered under the same id.

IDisposable Register(IMenuRenderer renderer)
Parameters
Returns
A handle that removes the renderer when disposed.

RegisterComponentRenderer(IComponentRenderer)

Adds a renderer-specific way of drawing one component type.

IDisposable RegisterComponentRenderer(IComponentRenderer componentRenderer)
Parameters
Returns
A handle that removes the specialisation when disposed.

ResolveComponentRenderer(string, Type)

Resolves the specialisation to use for a component on a renderer.

IComponentRenderer? ResolveComponentRenderer(string rendererId, Type componentType)
Parameters
  • rendererIdstringThe renderer drawing the component.
  • componentTypeTypeThe concrete component type.
Returns
The specialisation, or null when the component should draw itself.

TryGet(string, out IMenuRenderer)

Looks up a renderer by id.

bool TryGet(string rendererId, out IMenuRenderer renderer)
Parameters
Returns
true when the renderer exists.