swiftlys2/docs/api/ai/
API Reference Menus

MenuConfiguration

Class
Namespace: SwiftlyS2.Shared.Menus · Assembly: SwiftlyS2.CS2.dll
public record MenuConfiguration : IEquatable<MenuConfiguration>

Defines configuration settings that control menu behavior.

View source

Properties

AutoCloseAfter

Time in seconds before the menu automatically closes. Set to 0 or less to disable auto-close.

public float AutoCloseAfter { get; set; }
Property Value

AutoIncreaseVisibleItems

Whether to automatically increase MaxVisibleItems when HideTitle or HideFooter is enabled. Each hidden section adds 1 to the visible items count.

public bool AutoIncreaseVisibleItems { get; set; }
Property Value

This does not modify the actual MaxVisibleItems value. Instead, the increase is applied during rendering calculations only.

DefaultComment

The default comment text to use when a menu option's Comment is not set.

public string DefaultComment { get; set; }
Property Value

DisableExit

Whether to disable the exit button for this menu.

public bool DisableExit { get; set; }
Property Value

DisabledColor

The color of disabled menu options in hex format.

public string? DisabledColor { get; set; }
Property Value

Supports "#RGB", "#RGBA", "#RRGGBB", and "#RRGGBBAA" formats.

ExtraButtons

Extra buttons that can be bound to custom actions in the menu. These buttons are displayed in the footer and execute custom actions when pressed.

public List<MenuExtraButton> ExtraButtons { get; set; }
Property Value

FooterColor

The color of the menu footer in hex format.

public string? FooterColor { get; set; }
Property Value

Supports "#RGB", "#RGBA", "#RRGGBB", and "#RRGGBBAA" formats.

FreezePlayer

Whether to freeze player movement while the menu is open.

public bool FreezePlayer { get; set; }
Property Value

HideComment

Whether to hide comments for menu options.

public bool HideComment { get; set; }
Property Value

HideFooter

Whether to hide the menu footer.

public bool HideFooter { get; set; }
Property Value

HideTitle

Whether to hide the menu title.

public bool HideTitle { get; set; }
Property Value

HideTitleItemCount

Whether to hide the item count in the menu title.

public bool HideTitleItemCount { get; set; }
Property Value

MaxVisibleItems

Maximum number of menu options displayed on screen at once.

public int MaxVisibleItems { get; set; }
Property Value

Valid range is [1, 5]. If set to a value outside this range, an exception will be thrown and the value will be set to -1. When set to -1, the maximum visible items per page will use the ItemsPerPage value from the configuration file.

NavigationMarkerColor

The color of navigation markers (selection indicators, page indicators, etc.) in hex format.

public string? NavigationMarkerColor { get; set; }
Property Value

Supports "#RGB", "#RGBA", "#RRGGBB", and "#RRGGBBAA" formats.

PlaySound

Whether to play sounds when players interact with the menu.

public bool PlaySound { get; set; }
Property Value

Title

The title of the menu.

public string Title { get; set; }
Property Value

VisualGuideLineColor

The color of visual guide lines in hex format.

public string? VisualGuideLineColor { get; set; }
Property Value

Supports "#RGB", "#RGBA", "#RRGGBB", and "#RRGGBBAA" formats.