Skip to content

Commit

Permalink
SHERLOCK: RT: Fixes to display talk window
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Jul 5, 2015
1 parent cae4935 commit 2466302
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 20 deletions.
3 changes: 1 addition & 2 deletions engines/sherlock/talk.cpp
Expand Up @@ -374,8 +374,7 @@ void Talk::talkTo(const Common::String &filename) {

// If the new conversion is a reply first, then we don't need
// to display any choices, since the reply needs to be shown
if (!newStatement._statement.hasPrefix("*") &&
!newStatement._statement.hasPrefix("^")) {
if (!newStatement._statement.hasPrefix("*") && !newStatement._statement.hasPrefix("^")) {
_talkIndex = select;
showTalk();

Expand Down
16 changes: 7 additions & 9 deletions engines/sherlock/tattoo/tattoo_talk.cpp
Expand Up @@ -198,9 +198,15 @@ void TattooTalk::talkInterface(const byte *&str) {
_wait = true;
}

void TattooTalk::openTalkWindow() {
void TattooTalk::showTalk() {
TattooPeople &people = *(TattooPeople *)_vm->_people;

_sequenceStack.clear();
people.setListenSequence(_talkTo, 129);

_talkWidget.load();
_talkWidget.summonWindow();
_talkWidget.refresh();
}

OpcodeReturn TattooTalk::cmdSwitchSpeaker(const byte *&str) {
Expand Down Expand Up @@ -861,14 +867,6 @@ 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
7 changes: 0 additions & 7 deletions engines/sherlock/tattoo/tattoo_talk.h
Expand Up @@ -79,13 +79,6 @@ class TattooTalk : public Talk {
OpcodeReturn cmdWalkNPCToCAnimation(const byte *&str);
OpcodeReturn cmdWalkNPCToCoords(const byte *&str);
OpcodeReturn cmdWalkHomesAndNPCToCoords(const byte *&str);
private:
void drawTalk(const char *str);

/**
* Open the talk window
*/
void openTalkWindow();
protected:
/**
* Display the talk interface window
Expand Down
6 changes: 4 additions & 2 deletions engines/sherlock/tattoo/widget_talk.cpp
Expand Up @@ -415,7 +415,9 @@ void WidgetTalk::handleEvents() {

// See if the new file is a standard file, a reply first file, or a Stealth Mode file
if (!talk._statements[select]._statement.hasPrefix("*") && !talk._statements[select]._statement.hasPrefix("^")) {
talk.openTalkWindow();
load();
summonWindow();

setStatementLines();
render(HL_NO_HIGHLIGHTING);
break;
Expand Down Expand Up @@ -557,7 +559,7 @@ void WidgetTalk::setStatementLines() {
// But if there isn't (and this shouldn't ever happen), just split the line right at that point
if (width > xSize) {
if (space) {
line = Common::String(str.c_str(), space - 1);
line = Common::String(str.c_str(), space);
str = Common::String(space + 1);
} else {
line = Common::String(str.c_str(), ch);
Expand Down

0 comments on commit 2466302

Please sign in to comment.