aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2015-07-03 17:20:47 -0400
committerPaul Gilbert2015-07-03 17:20:47 -0400
commite02fbcebe7a9a04eee14bd2f04da455b0b312140 (patch)
tree99b5c5ae46e29c1dd4417caa44f6152d90ea0e4c
parent1e37f0b2efd2acd343bc199fa051c2f8a5da34df (diff)
downloadscummvm-rg350-e02fbcebe7a9a04eee14bd2f04da455b0b312140.tar.gz
scummvm-rg350-e02fbcebe7a9a04eee14bd2f04da455b0b312140.tar.bz2
scummvm-rg350-e02fbcebe7a9a04eee14bd2f04da455b0b312140.zip
SHERLOCK: RT: Hook talk widget refresh into talk logic
-rw-r--r--engines/sherlock/scalpel/scalpel_talk.cpp14
-rw-r--r--engines/sherlock/talk.cpp13
-rw-r--r--engines/sherlock/talk.h2
-rw-r--r--engines/sherlock/tattoo/tattoo_talk.cpp8
-rw-r--r--engines/sherlock/tattoo/tattoo_talk.h5
-rw-r--r--engines/sherlock/tattoo/widget_talk.cpp3
6 files changed, 31 insertions, 14 deletions
diff --git a/engines/sherlock/scalpel/scalpel_talk.cpp b/engines/sherlock/scalpel/scalpel_talk.cpp
index a6bb6b6fcd..a8a38fa6b4 100644
--- a/engines/sherlock/scalpel/scalpel_talk.cpp
+++ b/engines/sherlock/scalpel/scalpel_talk.cpp
@@ -807,6 +807,20 @@ void ScalpelTalk::showTalk() {
Common::String fixedText_Exit = fixedText.getText(kFixedText_Window_Exit);
byte color = ui._endKeyActive ? COMMAND_FOREGROUND : COMMAND_NULL;
+ clearSequences();
+ pushSequence(_talkTo);
+ setStillSeq(_talkTo);
+
+ ui._selector = ui._oldSelector = -1;
+
+ if (!ui._windowOpen) {
+ // Draw the talk interface on the back buffer
+ drawInterface();
+ displayTalk(false);
+ } else {
+ displayTalk(true);
+ }
+
// If the window is already open, simply draw. Otherwise, do it
// to the back buffer and then summon the window
if (ui._windowOpen) {
diff --git a/engines/sherlock/talk.cpp b/engines/sherlock/talk.cpp
index abd41b94b9..d7388fc32b 100644
--- a/engines/sherlock/talk.cpp
+++ b/engines/sherlock/talk.cpp
@@ -376,20 +376,7 @@ void Talk::talkTo(const Common::String &filename) {
// to display any choices, since the reply needs to be shown
if (!newStatement._statement.hasPrefix("*") &&
!newStatement._statement.hasPrefix("^")) {
- clearSequences();
- pushSequence(_talkTo);
- setStillSeq(_talkTo);
_talkIndex = select;
- ui._selector = ui._oldSelector = -1;
-
- if (!ui._windowOpen) {
- // Draw the talk interface on the back buffer
- drawInterface();
- displayTalk(false);
- } else {
- displayTalk(true);
- }
-
showTalk();
// Break out of loop now that we're waiting for player input
diff --git a/engines/sherlock/talk.h b/engines/sherlock/talk.h
index 066a9d8425..4ee7a09e56 100644
--- a/engines/sherlock/talk.h
+++ b/engines/sherlock/talk.h
@@ -265,7 +265,7 @@ protected:
/**
* Show the talk display
*/
- virtual void showTalk() {}
+ virtual void showTalk() = 0;
public:
TalkSequence _talkSequenceStack[TALK_SEQUENCE_STACK_SIZE];
Common::Array<Statement> _statements;
diff --git a/engines/sherlock/tattoo/tattoo_talk.cpp b/engines/sherlock/tattoo/tattoo_talk.cpp
index 54d327e92a..3ad64a1757 100644
--- a/engines/sherlock/tattoo/tattoo_talk.cpp
+++ b/engines/sherlock/tattoo/tattoo_talk.cpp
@@ -861,6 +861,14 @@ OpcodeReturn TattooTalk::cmdWalkHomesAndNPCToCoords(const byte *&str) {
return RET_SUCCESS;
}
+void TattooTalk::showTalk() {
+ TattooPeople &people = *(TattooPeople *)_vm->_people;
+
+ _sequenceStack.clear();
+ people.setListenSequence(_talkTo, 129);
+ _talkWidget.refresh();
+}
+
} // End of namespace Tattoo
} // End of namespace Sherlock
diff --git a/engines/sherlock/tattoo/tattoo_talk.h b/engines/sherlock/tattoo/tattoo_talk.h
index e2fa60b384..f9a4d01f4f 100644
--- a/engines/sherlock/tattoo/tattoo_talk.h
+++ b/engines/sherlock/tattoo/tattoo_talk.h
@@ -91,6 +91,11 @@ protected:
* Display the talk interface window
*/
virtual void talkInterface(const byte *&str);
+
+ /**
+ * Show the talk display
+ */
+ virtual void showTalk();
public:
TattooTalk(SherlockEngine *vm);
virtual ~TattooTalk() {}
diff --git a/engines/sherlock/tattoo/widget_talk.cpp b/engines/sherlock/tattoo/widget_talk.cpp
index 6a3fd4575d..08982a557d 100644
--- a/engines/sherlock/tattoo/widget_talk.cpp
+++ b/engines/sherlock/tattoo/widget_talk.cpp
@@ -576,6 +576,9 @@ void WidgetTalk::setStatementLines() {
}
void WidgetTalk::refresh() {
+ _talkScrollIndex = 0;
+ _selector = _oldSelector = -1;
+
setStatementLines();
render(HL_NO_HIGHLIGHTING);
}