- Found in:
- MessageBox
intfunctionShow_NonBlocking(stringbodyText, stringbutton1, stringbutton2="", stringbutton3="", stringbutton4="", stringbutton5="", stringbutton6="", stringbutton7="", stringbutton8="", stringbutton9="", stringbutton10="")NativeGlobal
Description
Documentation Comment
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:
Example
int messageBoxId = SkyrMessage.Show_NonBlocking("body text", "button 1", "button 2", ...)
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)
Parameters
stringbodyText
stringbutton1
stringbutton2=""
stringbutton3=""
stringbutton4=""
stringbutton5=""
stringbutton6=""
stringbutton7=""
stringbutton8=""
stringbutton9=""
stringbutton10=""
Examples
Auto-Generated Example
string myString__bodyText
string myString__button1
string myString__button2
string myString__button3
string myString__button4
string myString__button5
string myString__button6
string myString__button7
string myString__button8
string myString__button9
string myString__button10
int returnedValue = SkyMessage.Show_NonBlocking(myString__bodyText, myString__button1, myString__button2, myString__button3, myString__button4, myString__button5, myString__button6, myString__button7, myString__button8, myString__button9, myString__button10)