diff --git a/playlet-lib/src/components/Dialog/DialogUtils.bs b/playlet-lib/src/components/Dialog/DialogUtils.bs index 0ad23fd9..18661e73 100644 --- a/playlet-lib/src/components/Dialog/DialogUtils.bs +++ b/playlet-lib/src/components/Dialog/DialogUtils.bs @@ -1,8 +1,8 @@ -function ShowDialog(message as dynamic, title as string) as object - return ShowDialogButtons(message, title, ["Ok"]) +function ShowDialog(message as dynamic, title as string, large = false as boolean) as object + return ShowDialogButtons(message, title, ["Ok"], large) end function -function ShowDialogButtons(message as dynamic, title as string, buttons as object) as object +function ShowDialogButtons(message as dynamic, title as string, buttons as object, large = false as boolean) as object dialog = CreateObject("roSGNode", "SimpleDialog") if GetInterface(message, "ifArray") = invalid message = message.Tokenize(UnixNL()).ToArray() @@ -10,9 +10,11 @@ function ShowDialogButtons(message as dynamic, title as string, buttons as objec dialog.message = message dialog.title = title dialog.buttons = buttons - deviceInfo = CreateObject("roDeviceInfo") - displaySize = deviceInfo.GetDisplaySize() - dialog.width = displaySize.w - 100 + if large + deviceInfo = CreateObject("roDeviceInfo") + displaySize = deviceInfo.GetDisplaySize() + dialog.width = displaySize.w - 100 + end if m.top.getScene().dialog = dialog return dialog end function diff --git a/playlet-lib/src/components/VideoPlayer/VideoPlayer.bs b/playlet-lib/src/components/VideoPlayer/VideoPlayer.bs index 8b7cfcdc..e1d7b806 100644 --- a/playlet-lib/src/components/VideoPlayer/VideoPlayer.bs +++ b/playlet-lib/src/components/VideoPlayer/VideoPlayer.bs @@ -346,7 +346,7 @@ function OnVideoPlayerStateChange() as void for each info in errorInfo messageLines.push(`${info}: ${errorInfo[info]}`) end for - ShowDialog(messageLines, `Error playing video ${m.top.videoId}`) + ShowDialog(messageLines, `Error playing video ${m.top.videoId}`, true) CloseVideo() end if end function