diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/mads/nebular/dialogs_nebular.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/engines/mads/nebular/dialogs_nebular.cpp b/engines/mads/nebular/dialogs_nebular.cpp index a5c6a56049..ede16e1f99 100644 --- a/engines/mads/nebular/dialogs_nebular.cpp +++ b/engines/mads/nebular/dialogs_nebular.cpp @@ -82,11 +82,14 @@ bool DialogsNebular::show(int messageId, int objectId) { if (centerFlag) { crFlag = true; } else { - if (objectId == -1) { + if (dialog) + delete dialog; + + if (objectId == -1) dialog = new TextDialog(_vm, FONT_INTERFACE, _defaultPosition, _dialogWidth); - } else { + else dialog = new PictureDialog(_vm, _defaultPosition, _dialogWidth, objectId); - } + dialog->wordWrap(dialogText); dialog->incNumLines(); } @@ -146,11 +149,10 @@ bool DialogsNebular::show(int messageId, int objectId) { } if (!dialog) { - if (objectId == -1) { + if (objectId == -1) dialog = new TextDialog(_vm, FONT_INTERFACE, _defaultPosition, _dialogWidth); - } else { + else dialog = new PictureDialog(_vm, _defaultPosition, _dialogWidth, objectId); - } } if (centerFlag) { |