From 85628b293999f71fb8918096a273ba63651a9152 Mon Sep 17 00:00:00 2001 From: lukaslw Date: Mon, 16 Jun 2014 22:06:53 +0200 Subject: PRINCE: O_INITDIALOG(), O_SHOWDIALOGBOX() update --- engines/prince/script.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'engines/prince') diff --git a/engines/prince/script.cpp b/engines/prince/script.cpp index 944de69c29..c559d3f54c 100644 --- a/engines/prince/script.cpp +++ b/engines/prince/script.cpp @@ -1220,6 +1220,14 @@ void Interpreter::O_SUBSTRING() { void Interpreter::O_INITDIALOG() { debugInterpreter("O_INITDIALOG"); + for (uint i = 0; i < _vm->_dialogBoxList.size(); i++) { + _vm->_dialogBoxList[i].clear(); + } + _vm->_dialogBoxList.clear(); + + // cut string to dialogs + // cut dialogs to nr and lines + // push them to dialogBoxList } void Interpreter::O_ENABLEDIALOGOPT() { @@ -1236,6 +1244,13 @@ void Interpreter::O_SHOWDIALOGBOX() { uint16 box = readScriptFlagValue(); debugInterpreter("O_SHOWDIALOGBOX box %d", box); _vm->createDialogBox(_vm->_dialogBoxList[box]); + int dialogLines = _vm->_dialogBoxList[box].size(); + _flags->setFlagValue(Flags::DIALINES, dialogLines); + if (dialogLines != 0) { + _vm->changeCursor(1); + _vm->runDialog(); + _vm->changeCursor(0); + } } void Interpreter::O_STOPSAMPLE() { -- cgit v1.2.3