Table of Contents

Interface IMessageBoxPrompter

Namespace
SkyrimForge.Menus
Assembly
SkyrimForge.dll

Shows message boxes and returns the button pressed.

public interface IMessageBoxPrompter

Remarks

Call members on the game's thread.

Methods

ShowAsync(string, IReadOnlyList<string>, CancellationToken)

Shows a message box with one button for each entry of buttons.

Task<int> ShowAsync(string message, IReadOnlyList<string> buttons, CancellationToken cancellationToken = default)

Parameters

message string
buttons IReadOnlyList<string>
cancellationToken CancellationToken

Returns

Task<int>

A task containing the index in buttons of the button pressed. It completes in work queued through ITaskQueue. The task is canceled if the game destroys the message box without a button press.

It is also canceled by cancellationToken. No box is shown when the token is already canceled at the call. Otherwise canceling ends only the wait, and the box opens or stays open. Pass NewGameOrSaveLoading so the wait ends as a new game starts or a save starts loading.

Exceptions

ArgumentNullException

message or buttons is null.

ArgumentException

buttons is empty or contains null.

InvalidOperationException

The game has no message box factory, the address library has no identifier for the function that queues a message box, or that function faulted. The exception is stored in the returned task.