This created a messagebox, displays it, and returns immediately (while the message is still being displayed on the screen)
To discover when the player has selected an option, you are expected to 'poll' using the function IsMessageResultAvailable:
Useful for when you are not hard-coding the names of the buttons!
Button names
Any string array should work for button names.
string[] buttons = new string[2]
buttons[0] = "Ok"
buttons[1] = "Cancel"
Example
int messageBoxId = SkyrMessage.Show_NonBlocking("body text", buttons)
while ! SkyMessage.IsMessageResultAvailable(messageBoxId)
Utility.WaitMenuMode(1.0)
endWhile
Once IsMessageResultAvailable returns true, you can then find out which option the player selected via GetResultText() or GetResultIndex()
Get name of selected button
string buttonName = SkyMessage.GetResultText(messageboxId)
Get index of selected button
string buttonIndex = SkyMessage.GetResultIndex(messageboxId)
Gotcha!
After calling either GetResultText() or GetResultIndex(), the messageBoxId will become invalid, so you cannot get BOTH the index and the text. Unless you use deleteResultOnAccess = false
; Get the index -but- keep the messageBoxId valid!
string buttonIndex = SkyMessage.GetResultIndex(messageboxId, deleteResultOnAccess = false)
; So now you can get the name as well
string buttonName = SkyMessage.GetResultText(messageboxId)
If you ever have a reason to delete the messageBoxId without getting the result, you can call SkyMessage.Delete(messageBoxId)