Table of Contents

Interface IMessageBoxPrompter

Namespace
SkyrimForge
Assembly
SkyrimForge.dll

Puts a question on the screen and reports which button was pressed.

public interface IMessageBoxPrompter

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<TResult> containing the index in buttons of the button pressed.

The task completes in work queued through ITaskQueue.

The task is canceled where the game destroys the message box without a button press.

It is also canceled by cancellationToken, and a box canceled before it is queued is not shown. Pass NewGameOrSaveLoading so a box requested before a save loads or a new game starts does not open after it.

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 ID for QueueMessage, or queueing the message box faulted.