SwiftlyS2

SubmenuMenuOption

Class SubmenuMenuOption

Namespace: SwiftlyS2.Core.Menus.OptionsBase

Assembly: SwiftlyS2.CS2.dll

Represents a menu option that opens a submenu when clicked.

public sealed class SubmenuMenuOption : MenuOptionBase, IMenuOption, IDisposable

Inheritance

Implements

Inherited Members

Constructors

Creates an instance of SwiftlyS2.Core.Menus.OptionsBase.SubmenuMenuOption with a pre-built submenu.

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

When using this constructor, the SwiftlyS2.Core.Menus.OptionsBase.MenuOptionBase.Text property must be manually set to specify the initial text.

Creates an instance of SwiftlyS2.Core.Menus.OptionsBase.SubmenuMenuOption with a pre-built submenu.

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

Creates an instance of SwiftlyS2.Core.Menus.OptionsBase.SubmenuMenuOption with a synchronous builder.

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

When using this constructor, the SwiftlyS2.Core.Menus.OptionsBase.MenuOptionBase.Text property must be manually set to specify the initial text.

Creates an instance of SwiftlyS2.Core.Menus.OptionsBase.SubmenuMenuOption with a synchronous builder.

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

Creates an instance of SwiftlyS2.Core.Menus.OptionsBase.SubmenuMenuOption with an asynchronous builder.

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

When using this constructor, the SwiftlyS2.Core.Menus.OptionsBase.MenuOptionBase.Text property must be manually set to specify the initial text.

Creates an instance of SwiftlyS2.Core.Menus.OptionsBase.SubmenuMenuOption with an asynchronous builder.

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

On this page