swiftlys2/docs/api/ai/
API Reference Menus.OptionsBase

SubmenuMenuOption

Class
Namespace: SwiftlyS2.Core.Menus.OptionsBase · Assembly: SwiftlyS2.CS2.dll
public sealed class SubmenuMenuOption : MenuOptionBase, IMenuOption, IDisposable

Represents a menu option that opens a submenu when clicked.

View source

Constructors

SubmenuMenuOption(IMenuAPI, int, int)

Creates an instance of SubmenuMenuOption with a pre-built submenu.

public SubmenuMenuOption(IMenuAPI submenu, int updateIntervalMs = 120, int pauseIntervalMs = 1000)
Parameters
  • submenuIMenuAPIThe submenu to open when this option is clicked.
  • updateIntervalMsintoptionalThe interval in milliseconds between text updates. Defaults to 120ms.
  • pauseIntervalMsintoptionalThe pause duration in milliseconds before starting the next text update cycle. Defaults to 1000ms.

When using this constructor, the Text property must be manually set to specify the initial text.

SubmenuMenuOption(string, IMenuAPI, int, int)

Creates an instance of SubmenuMenuOption with a pre-built submenu.

public SubmenuMenuOption(string text, IMenuAPI submenu, int updateIntervalMs = 120, int pauseIntervalMs = 1000)
Parameters
  • textstringThe text content to display.
  • submenuIMenuAPIThe submenu to open when this option is clicked.
  • updateIntervalMsintoptionalThe interval in milliseconds between text updates. Defaults to 120ms.
  • pauseIntervalMsintoptionalThe pause duration in milliseconds before starting the next text update cycle. Defaults to 1000ms.

SubmenuMenuOption(Func<IMenuAPI>, int, int)

Creates an instance of SubmenuMenuOption with a synchronous builder.

public SubmenuMenuOption(Func<IMenuAPI> submenuBuilder, int updateIntervalMs = 120, int pauseIntervalMs = 1000)
Parameters
  • submenuBuilderFunc<IMenuAPI>Function that builds and returns the submenu.
  • updateIntervalMsintoptionalThe interval in milliseconds between text updates. Defaults to 120ms.
  • pauseIntervalMsintoptionalThe pause duration in milliseconds before starting the next text update cycle. Defaults to 1000ms.

When using this constructor, the Text property must be manually set to specify the initial text.

SubmenuMenuOption(string, Func<IMenuAPI>, int, int)

Creates an instance of SubmenuMenuOption with a synchronous builder.

public SubmenuMenuOption(string text, Func<IMenuAPI> submenuBuilder, int updateIntervalMs = 120, int pauseIntervalMs = 1000)
Parameters
  • textstringThe text content to display.
  • submenuBuilderFunc<IMenuAPI>Function that builds and returns the submenu.
  • updateIntervalMsintoptionalThe interval in milliseconds between text updates. Defaults to 120ms.
  • pauseIntervalMsintoptionalThe pause duration in milliseconds before starting the next text update cycle. Defaults to 1000ms.

SubmenuMenuOption(Func<Task<IMenuAPI>>, int, int)

Creates an instance of SubmenuMenuOption with an asynchronous builder.

public SubmenuMenuOption(Func<Task<IMenuAPI>> submenuBuilderAsync, int updateIntervalMs = 120, int pauseIntervalMs = 1000)
Parameters
  • submenuBuilderAsyncFunc<Task<IMenuAPI>>Async function that builds and returns the submenu.
  • updateIntervalMsintoptionalThe interval in milliseconds between text updates. Defaults to 120ms.
  • pauseIntervalMsintoptionalThe pause duration in milliseconds before starting the next text update cycle. Defaults to 1000ms.

When using this constructor, the Text property must be manually set to specify the initial text.

SubmenuMenuOption(string, Func<Task<IMenuAPI>>, int, int)

Creates an instance of SubmenuMenuOption with an asynchronous builder.

public SubmenuMenuOption(string text, Func<Task<IMenuAPI>> submenuBuilderAsync, int updateIntervalMs = 120, int pauseIntervalMs = 1000)
Parameters
  • textstringThe text content to display.
  • submenuBuilderAsyncFunc<Task<IMenuAPI>>Async function that builds and returns the submenu.
  • updateIntervalMsintoptionalThe interval in milliseconds between text updates. Defaults to 120ms.
  • pauseIntervalMsintoptionalThe pause duration in milliseconds before starting the next text update cycle. Defaults to 1000ms.