diff options
author | Paul Gilbert | 2015-08-27 08:55:27 -0400 |
---|---|---|
committer | Paul Gilbert | 2015-08-27 08:55:27 -0400 |
commit | ca3050c9121938a05b33517f9e6672ee1e80b11f (patch) | |
tree | abda72244dd1831fbcbbec252eacfd71d196e923 /engines/sherlock | |
parent | 55f9c364bcd717e3ae2b6c2b4effd942c930968e (diff) | |
download | scummvm-rg350-ca3050c9121938a05b33517f9e6672ee1e80b11f.tar.gz scummvm-rg350-ca3050c9121938a05b33517f9e6672ee1e80b11f.tar.bz2 scummvm-rg350-ca3050c9121938a05b33517f9e6672ee1e80b11f.zip |
SHERLOCK: RT: Fix previous commit, and make talkTo virtual
Diffstat (limited to 'engines/sherlock')
-rw-r--r-- | engines/sherlock/scalpel/scalpel_talk.cpp | 12 | ||||
-rw-r--r-- | engines/sherlock/scalpel/scalpel_talk.h | 10 | ||||
-rw-r--r-- | engines/sherlock/talk.cpp | 10 | ||||
-rw-r--r-- | engines/sherlock/talk.h | 4 | ||||
-rw-r--r-- | engines/sherlock/tattoo/tattoo_talk.cpp | 4 | ||||
-rw-r--r-- | engines/sherlock/tattoo/tattoo_talk.h | 10 |
6 files changed, 40 insertions, 10 deletions
diff --git a/engines/sherlock/scalpel/scalpel_talk.cpp b/engines/sherlock/scalpel/scalpel_talk.cpp index 9b38a95c64..69d14211fd 100644 --- a/engines/sherlock/scalpel/scalpel_talk.cpp +++ b/engines/sherlock/scalpel/scalpel_talk.cpp @@ -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; diff --git a/engines/sherlock/scalpel/scalpel_talk.h b/engines/sherlock/scalpel/scalpel_talk.h index 4d13258985..31f78cbf85 100644 --- a/engines/sherlock/scalpel/scalpel_talk.h +++ b/engines/sherlock/scalpel/scalpel_talk.h @@ -84,6 +84,16 @@ public: 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 */ void drawInterface(); diff --git a/engines/sherlock/talk.cpp b/engines/sherlock/talk.cpp index d0c74f8c4b..b31a273a88 100644 --- a/engines/sherlock/talk.cpp +++ b/engines/sherlock/talk.cpp @@ -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; @@ -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); } @@ -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; diff --git a/engines/sherlock/talk.h b/engines/sherlock/talk.h index b3868d7293..a22a39db94 100644 --- a/engines/sherlock/talk.h +++ b/engines/sherlock/talk.h @@ -283,13 +283,13 @@ public: * 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 diff --git a/engines/sherlock/tattoo/tattoo_talk.cpp b/engines/sherlock/tattoo/tattoo_talk.cpp index a341115137..7c57605f61 100644 --- a/engines/sherlock/tattoo/tattoo_talk.cpp +++ b/engines/sherlock/tattoo/tattoo_talk.cpp @@ -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; diff --git a/engines/sherlock/tattoo/tattoo_talk.h b/engines/sherlock/tattoo/tattoo_talk.h index d2ddda08a8..9b010513dc 100644 --- a/engines/sherlock/tattoo/tattoo_talk.h +++ b/engines/sherlock/tattoo/tattoo_talk.h @@ -103,6 +103,16 @@ protected: 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 |