aboutsummaryrefslogtreecommitdiff
path: root/engines/sherlock/tattoo/widget_verbs.cpp
diff options
context:
space:
mode:
authorFilippos Karapetis2015-06-18 12:26:17 +0300
committerFilippos Karapetis2015-06-18 12:26:17 +0300
commit6238acff3c317bf4a9367a4dc1c2e2d9c149287e (patch)
treecb7fd1a071329f8a8c57b9424df36ef17bc7cb59 /engines/sherlock/tattoo/widget_verbs.cpp
parent5c8001224bc859cb7f04fdb8a7acc25b21c251fe (diff)
downloadscummvm-rg350-6238acff3c317bf4a9367a4dc1c2e2d9c149287e.tar.gz
scummvm-rg350-6238acff3c317bf4a9367a4dc1c2e2d9c149287e.tar.bz2
scummvm-rg350-6238acff3c317bf4a9367a4dc1c2e2d9c149287e.zip
SHERLOCK: RT: Initial work on activateVerbMenu()
Diffstat (limited to 'engines/sherlock/tattoo/widget_verbs.cpp')
-rw-r--r--engines/sherlock/tattoo/widget_verbs.cpp59
1 files changed, 59 insertions, 0 deletions
diff --git a/engines/sherlock/tattoo/widget_verbs.cpp b/engines/sherlock/tattoo/widget_verbs.cpp
index 5d7f42111b..dfe317b099 100644
--- a/engines/sherlock/tattoo/widget_verbs.cpp
+++ b/engines/sherlock/tattoo/widget_verbs.cpp
@@ -23,6 +23,7 @@
#include "sherlock/tattoo/widget_verbs.h"
#include "sherlock/tattoo/tattoo_scene.h"
#include "sherlock/tattoo/tattoo_user_interface.h"
+#include "sherlock/tattoo/tattoo_people.h"
#include "sherlock/tattoo/tattoo.h"
namespace Sherlock {
@@ -35,7 +36,65 @@ WidgetVerbs::WidgetVerbs(SherlockEngine *vm) : WidgetBase(vm) {
}
void WidgetVerbs::activateVerbMenu(bool objectsOn) {
+ Talk &talk = *_vm->_talk;
+ FixedText &fixedText = *_vm->_fixedText;
+ TattooUserInterface &ui = *(TattooUserInterface *)_vm->_ui;
+ TattooPeople &people = *(TattooPeople *)_vm->_people;
+ bool isWatson = false;
+ Common::String strLook = fixedText.getText(kFixedText_Verb_Look);
+ Common::String strTalk = fixedText.getText(kFixedText_Verb_Talk);
+ Common::String strJournal = fixedText.getText(kFixedText_Verb_Journal);
+
+ if (talk._talkToAbort)
+ return;
+
+ _outsideMenu = false;
+
+ _verbCommands.clear();
+
+ // Check if we need to show options for the highlighted object
+ if (objectsOn) {
+ // Set the verb list accordingly, depending on the target being a
+ // person or an object
+ if (ui._personFound) {
+ TattooPerson &person = people[ui._activeObj - 1000];
+ TattooPerson &npc = people[ui._activeObj - 1001];
+
+ if (!scumm_strnicmp(npc._npcName.c_str(), "WATS", 4))
+ isWatson = true;
+
+ if (!scumm_strnicmp(person._examine.c_str(), "_EXIT", 5))
+ _verbCommands.push_back(strLook);
+
+ _verbCommands.push_back(strTalk);
+
+ // Add any extra active verbs from the NPC's verb list
+ // TODO
+ } else {
+ if (!scumm_strnicmp(ui._bgShape->_name.c_str(), "WATS", 4))
+ isWatson = true;
+
+ if (!scumm_strnicmp(ui._bgShape->_examine.c_str(), "_EXIT", 5))
+ _verbCommands.push_back(strLook);
+
+ if (ui._bgShape->_aType == PERSON)
+ _verbCommands.push_back(strTalk);
+
+ // Add any extra active verbs from the NPC's verb list
+ // TODO
+ }
+ }
+
+ if (isWatson)
+ _verbCommands.push_back(strJournal);
+
+ // Add the system commands
// TODO
+
+ // Find the widest command
+ // TODO
+
+ // TODO: Finish this
}
void WidgetVerbs::execute() {