Skip to content

Commit

Permalink
SHERLOCK: RT: Fix previous commit, and make talkTo virtual
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Aug 27, 2015
1 parent 55f9c36 commit ca3050c
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 10 deletions.
12 changes: 12 additions & 0 deletions engines/sherlock/scalpel/scalpel_talk.cpp
Expand Up @@ -171,6 +171,18 @@ ScalpelTalk::ScalpelTalk(SherlockEngine *vm) : Talk(vm) {

}

void ScalpelTalk::talkTo(const Common::String filename) {
ScalpelUserInterface &ui = *(ScalpelUserInterface *)_vm->_ui;

Talk::talkTo(filename);

if (filename == "Tube59c") {
// WORKAROUND: Original game bug causes the results of testing the powdery substance
// to disappear too quickly. Introduce a delay to allow it to be properly displayed
ui._menuCounter = 30;
}
}

void ScalpelTalk::talkInterface(const byte *&str) {
FixedText &fixedText = *_vm->_fixedText;
People &people = *_vm->_people;
Expand Down
10 changes: 10 additions & 0 deletions engines/sherlock/scalpel/scalpel_talk.h
Expand Up @@ -83,6 +83,16 @@ class ScalpelTalk : public Talk {
ScalpelTalk(SherlockEngine *vm);
virtual ~ScalpelTalk() {}

/**
* Called whenever a conversation or item script needs to be run. For standard conversations,
* it opens up a description window similar to how 'talk' does, but shows a 'reply' directly
* instead of waiting for a statement option.
* @remarks It seems that at some point, all item scripts were set up to use this as well.
* In their case, the conversation display is simply suppressed, and control is passed on to
* doScript to implement whatever action is required.
*/
virtual void talkTo(const Common::String filename);

/**
* Draws the interface for conversation display
*/
Expand Down
10 changes: 2 additions & 8 deletions engines/sherlock/talk.cpp
Expand Up @@ -127,7 +127,7 @@ Talk::Talk(SherlockEngine *vm) : _vm(vm) {
_talkHistory.resize(IS_ROSE_TATTOO ? 1500 : 500);
}

void Talk::talkTo(const Common::String &filename) {
void Talk::talkTo(const Common::String filename) {
Events &events = *_vm->_events;
Inventory &inv = *_vm->_inventory;
Journal &journal = *_vm->_journal;
Expand Down Expand Up @@ -440,12 +440,6 @@ void Talk::talkTo(const Common::String &filename) {
// previous script can continue
popStack();

if (IS_SERRATED_SCALPEL && filename == "Tube59c") {
// WORKAROUND: Original game bug causes the results of testing the powdery substance
// to disappear too quickly. Introduce a delay to allow it to be properly displayed
ui._menuCounter = 30;
}

events.setCursor(ARROW);
}

Expand Down Expand Up @@ -647,7 +641,7 @@ void Talk::pushSequence(int speaker) {
}
}

void Talk::doScript(const Common::String script) {
void Talk::doScript(const Common::String &script) {
People &people = *_vm->_people;
Scene &scene = *_vm->_scene;
Screen &screen = *_vm->_screen;
Expand Down
4 changes: 2 additions & 2 deletions engines/sherlock/talk.h
Expand Up @@ -283,13 +283,13 @@ class Talk {
* In their case, the conversation display is simply suppressed, and control is passed on to
* doScript to implement whatever action is required.
*/
void talkTo(const Common::String &filename);
virtual void talkTo(const Common::String filename);

/**
* Parses a reply for control codes and display text. The found text is printed within
* the text window, handles delays, animations, and animating portraits.
*/
void doScript(const Common::String script);
void doScript(const Common::String &script);

/**
* Main method for handling conversations when a character to talk to has been
Expand Down
4 changes: 4 additions & 0 deletions engines/sherlock/tattoo/tattoo_talk.cpp
Expand Up @@ -183,6 +183,10 @@ TattooTalk::TattooTalk(SherlockEngine *vm) : Talk(vm), _talkWidget(vm), _passwor
_opcodeTable = OPCODE_METHODS;
}

void TattooTalk::talkTo(const Common::String filename) {
Talk::talkTo(filename);
}

void TattooTalk::talkInterface(const byte *&str) {
TattooEngine &vm = *(TattooEngine *)_vm;
Sound &sound = *_vm->_sound;
Expand Down
10 changes: 10 additions & 0 deletions engines/sherlock/tattoo/tattoo_talk.h
Expand Up @@ -103,6 +103,16 @@ class TattooTalk : public Talk {
public:
TattooTalk(SherlockEngine *vm);
virtual ~TattooTalk() {}

/**
* Called whenever a conversation or item script needs to be run. For standard conversations,
* it opens up a description window similar to how 'talk' does, but shows a 'reply' directly
* instead of waiting for a statement option.
* @remarks It seems that at some point, all item scripts were set up to use this as well.
* In their case, the conversation display is simply suppressed, and control is passed on to
* doScript to implement whatever action is required.
*/
virtual void talkTo(const Common::String filename);

/**
* Push the details of a passed object onto the saved sequences stack
Expand Down

0 comments on commit ca3050c

Please sign in to comment.