aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--saga/interface.cpp3
-rw-r--r--saga/script.h3
-rw-r--r--saga/sfuncs.cpp17
3 files changed, 21 insertions, 2 deletions
diff --git a/saga/interface.cpp b/saga/interface.cpp
index 30b4f751a1..57eb1dbca4 100644
--- a/saga/interface.cpp
+++ b/saga/interface.cpp
@@ -940,8 +940,7 @@ void Interface::converseSetPos(int key) {
ct = &_converseText[_conversePos];
- //finishDialog( ct->replyID, ct->replyFlags, ct->replyBit );
- // FIXME: TODO: finish dialog thread
+ _vm->_script->finishDialog(ct->replyId, ct->replyFlags, ct->replyBit);
// FIXME: TODO: Puzzle
diff --git a/saga/script.h b/saga/script.h
index b1389cfe18..a6e4c088fb 100644
--- a/saga/script.h
+++ b/saga/script.h
@@ -344,6 +344,9 @@ private:
private:
ScriptThread *_conversingThread;
+public:
+ void finishDialog(int replyID, int flags, int bitOffset);
+
private:
typedef int (Script::*ScriptFunctionType)(SCRIPTFUNC_PARAMS);
diff --git a/saga/sfuncs.cpp b/saga/sfuncs.cpp
index c951692e51..ec89ab2a5e 100644
--- a/saga/sfuncs.cpp
+++ b/saga/sfuncs.cpp
@@ -1529,4 +1529,21 @@ int Script::SF_playVoice(SCRIPTFUNC_PARAMS) {
return SUCCESS;
}
+void Script::finishDialog(int replyID, int flags, int bitOffset) {
+ if (_conversingThread) {
+ _vm->_interface->setMode(kPanelNull);
+
+ _conversingThread->flags &= ~kTFlagWaiting;
+
+ _conversingThread->push(replyID);
+
+ if (flags & kReplyOnce) {
+ // TODO:
+ }
+ }
+
+ _conversingThread = NULL;
+ wakeUpThreads(kWaitTypeDialogBegin);
+}
+
} // End of namespace Saga