KnightHawk75
Matrix Elite Guard

Posts: 1450
Joined: 11/15/2018 Status: offline
|
BTW for those wanting to know what the options are for the numeric option values for MsgBox, and the exact return values when different things are pressed here they. -- 6+ will result to 0 \ ie OkOnly. --[[
gKH.Constants.MsgBoxType={}
gKH.Constants.MsgBoxType.OKOnly=0;
gKH.Constants.MsgBoxType.OKCancel=1;
gKH.Constants.MsgBoxType.AbortRetryIgnore=2;
gKH.Constants.MsgBoxType.YesNoCancel=3;
gKH.Constants.MsgBoxType.YesNoOnly=4;
gKH.Constants.MsgBoxType.RetryCancel=5;
gKH.Constants.MsgBoxResult={}
gKH.Constants.MsgBoxResult.OK = "OK";
gKH.Constants.MsgBoxResult.No = "No";
gKH.Constants.MsgBoxResult.Yes = "Yes";
gKH.Constants.MsgBoxResult.Cancel = "Cancel";
gKH.Constants.MsgBoxResult.Retry = "Retry";
gKH.Constants.MsgBoxResult.Ignore = "Ignore";
--]] Example of getting input from user, and checking which button was pressed after you repeat their entry back to them.local msgboxresult = ScenEdit_MsgBox("You entered the text: \n\r" .. tostring(ScenEdit_InputBox("Please enter some text:")),
4);
if msgboxresult == "Yes" then
ScenEdit_MsgBox('You pressed Yes.',0);
elseif msgboxresult == "No" then
ScenEdit_MsgBox('You pressed No.',0);
elseif msgboxresult == "Cancel" then
ScenEdit_MsgBox('Hey, you close the window before answering!',0);
else
ScenEdit_MsgBox('Um, we should never get here.',0);
end
< Message edited by KnightHawk75 -- 5/9/2021 11:49:11 PM >
|