aboutsummaryrefslogtreecommitdiff
path: root/engines/lure
diff options
context:
space:
mode:
authorPaul Gilbert2007-12-29 10:38:30 +0000
committerPaul Gilbert2007-12-29 10:38:30 +0000
commit2c5ae92b4cac3e86da4e8721ca90c8350bf348b6 (patch)
treeadb0e3d8044f26d0428253a92de49cbd55ab0fea /engines/lure
parent99dfb8bcbc03ba54f9693e03ce7e0ffe7a9e1380 (diff)
downloadscummvm-rg350-2c5ae92b4cac3e86da4e8721ca90c8350bf348b6.tar.gz
scummvm-rg350-2c5ae92b4cac3e86da4e8721ca90c8350bf348b6.tar.bz2
scummvm-rg350-2c5ae92b4cac3e86da4e8721ca90c8350bf348b6.zip
Added ability for both middle and right mouse buttons to abort a conversation when waiting for user to select a conversation option from a list of topics
svn-id: r30071
Diffstat (limited to 'engines/lure')
-rw-r--r--engines/lure/hotspots.cpp44
-rw-r--r--engines/lure/hotspots.h1
2 files changed, 30 insertions, 15 deletions
diff --git a/engines/lure/hotspots.cpp b/engines/lure/hotspots.cpp
index cab41ea4b0..97a641e2e6 100644
--- a/engines/lure/hotspots.cpp
+++ b/engines/lure/hotspots.cpp
@@ -3379,12 +3379,20 @@ void HotspotTickHandlers::talkAnimHandler(Hotspot &h) {
screen.screen().writeString(r.left, r.top, buffer, false, colour);
}
- if ((!mouse.lButton() && !mouse.rButton()) || (selectedLine == 0))
- break;
+ if (mouse.mButton() || mouse.rButton()) {
+ // Abort the conversation
+ talkEndConversation();
+
+ // Have destination character show question speech bubble
+ charHotspot = res.getActiveHotspot(talkDestCharacter);
+ if (charHotspot != NULL)
+ charHotspot->showMessage(13, NOONE_ID);
- // Set the talk response index to use
- res.setTalkSelection(selectedLine);
- res.setTalkState(TALK_RESPOND);
+ } else if (mouse.lButton() && (selectedLine != 0)) {
+ // Set the talk response index to use
+ res.setTalkSelection(selectedLine);
+ res.setTalkState(TALK_RESPOND);
+ }
break;
case TALK_RESPOND:
@@ -3494,21 +3502,27 @@ void HotspotTickHandlers::talkAnimHandler(Hotspot &h) {
res.setTalkState(TALK_START);
} else {
// End the conversation
- res.getActiveHotspot(PLAYER_ID)->setTickProc(PLAYER_TICK_PROC_ID);
- if (charHotspot)
- {
- charHotspot->setUseHotspotId(0);
- charHotspot->resource()->talkerId = 0;
- charHotspot->setDelayCtr(24);
- }
- res.setTalkData(0);
- res.setCurrentAction(NONE);
- res.setTalkState(TALK_NONE);
+ talkEndConversation();
}
break;
}
}
+void HotspotTickHandlers::talkEndConversation() {
+ Resources &res = Resources::getReference();
+ Hotspot *charHotspot = res.getActiveHotspot(talkDestCharacter);
+ assert(charHotspot);
+
+ res.getActiveHotspot(PLAYER_ID)->setTickProc(PLAYER_TICK_PROC_ID);
+ charHotspot->setUseHotspotId(0);
+ charHotspot->resource()->talkerId = 0;
+ charHotspot->setDelayCtr(24);
+
+ res.setTalkData(0);
+ res.setCurrentAction(NONE);
+ res.setTalkState(TALK_NONE);
+}
+
void HotspotTickHandlers::fighterAnimHandler(Hotspot &h) {
Fights.fighterAnimHandler(h);
}
diff --git a/engines/lure/hotspots.h b/engines/lure/hotspots.h
index 4ff924f811..2c77dbdb86 100644
--- a/engines/lure/hotspots.h
+++ b/engines/lure/hotspots.h
@@ -56,6 +56,7 @@ class HotspotTickHandlers {
private:
// Support methods
static void npcRoomChange(Hotspot &h);
+ static void talkEndConversation();
// Handler methods
static void defaultHandler(Hotspot &h);