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
messagestringbuttonsIReadOnlyList<string>cancellationTokenCancellationToken
Returns
- Task<int>
A Task<TResult> containing the index in
buttonsof 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
messageorbuttonsisnull.- ArgumentException
buttonsis 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.