[Scummvm-cvs-logs] scummvm master -> e02fbcebe7a9a04eee14bd2f04da455b0b312140

dreammaster dreammaster at scummvm.org
Fri Jul 3 23:21:51 CEST 2015


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
e02fbcebe7 SHERLOCK: RT: Hook talk widget refresh into talk logic


Commit: e02fbcebe7a9a04eee14bd2f04da455b0b312140
    https://github.com/scummvm/scummvm/commit/e02fbcebe7a9a04eee14bd2f04da455b0b312140
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-07-03T17:20:47-04:00

Commit Message:
SHERLOCK: RT: Hook talk widget refresh into talk logic

Changed paths:
    engines/sherlock/scalpel/scalpel_talk.cpp
    engines/sherlock/talk.cpp
    engines/sherlock/talk.h
    engines/sherlock/tattoo/tattoo_talk.cpp
    engines/sherlock/tattoo/tattoo_talk.h
    engines/sherlock/tattoo/widget_talk.cpp



diff --git a/engines/sherlock/scalpel/scalpel_talk.cpp b/engines/sherlock/scalpel/scalpel_talk.cpp
index a6bb6b6..a8a38fa 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 abd41b9..d7388fc 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 066a9d8..4ee7a09 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 54d327e..3ad64a1 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 e2fa60b..f9a4d01 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 6a3fd45..08982a5 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);
 }






More information about the Scummvm-git-logs mailing list