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

ChatColoredTextComponent

Class
Namespace: SwiftlyS2.Shared.Menu.Components · Assembly: SwiftlyS2.CS2.dll
public class ChatColoredTextComponent : MenuComponentBase, IMenuComponent

A line coloured with one of Helper.ChatColors ' tags rather than a hex Color. Can be scrolled to but never does anything when activated.

On the Chat renderer this prints with the actual chat colour code. On any other renderer, such as the default CenterHtml, IMenuComponentRenderContext) maps ChatColor to its closest hex equivalent instead of dropping colour entirely.

View source

Constructors

ChatColoredTextComponent(string, string?, string?)

Creates a chat-coloured text line.

public ChatColoredTextComponent(string text, string? chatColor = null, string? id = null)
Parameters
  • textstringThe text to display.
  • chatColorstring?optionalOne of Helper.ChatColors ' tags, or null for Default.
  • idstring?optionalA stable id, or null to generate one.

Properties

ChatColor

One of Helper.ChatColors ' tags, e.g. Green.

public string ChatColor { get; set; }
Property Value

IsFocusable

Whether the selection can land on this component.

public override bool IsFocusable { get; }
Property Value

A label can hold the selection like any other body entry; it just never does anything when activated.

Text

The text to display.

public string Text { get; set; }
Property Value

Methods

Render(IMenuComponentRenderContext)

Produces this component's renderer-agnostic output.

public override MenuNode Render(IMenuComponentRenderContext context)
Parameters
Returns
The nodes describing this component.

The generic fallback used by any renderer other than Chat.