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

IMenuRenderer

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

Turns a composed menu frame into output and delivers it to a player.

A renderer never inspects concrete component types. It walks MenuNode trees, which is what lets a renderer added by a plugin draw the built-in components and vice versa.

View source

Properties

Id

The unique id menus use to select this renderer.

string Id { get; }
Property Value

Methods

Clear(IPlayer)

Removes anything this renderer is currently showing to a player.

void Clear(IPlayer player)
Parameters

Called on the game thread, unlike IMenuRenderContext) - it runs on session teardown, not on the per-tick hot path the background thread exists for.

Render(IMenuRenderContext)

Draws a frame for a player.

void Render(IMenuRenderContext context)
Parameters

Called on a single dedicated background thread, not the game thread - renders for one session are never reordered relative to each other, but never assume this runs where the rest of the framework does. context already carries everything the frame needs; a renderer should limit itself to that and to calls its underlying transport documents as safe off the game thread (such as sending text to the client), never reach back into live player, controller or pawn state itself.