[Scummvm-cvs-logs] SF.net SVN: scummvm: [30071] scummvm/trunk/engines/lure

dreammaster at users.sourceforge.net dreammaster at users.sourceforge.net
Sat Dec 29 11:38:30 CET 2007


Revision: 30071
          http://scummvm.svn.sourceforge.net/scummvm/?rev=30071&view=rev
Author:   dreammaster
Date:     2007-12-29 02:38:30 -0800 (Sat, 29 Dec 2007)

Log Message:
-----------
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

Modified Paths:
--------------
    scummvm/trunk/engines/lure/hotspots.cpp
    scummvm/trunk/engines/lure/hotspots.h

Modified: scummvm/trunk/engines/lure/hotspots.cpp
===================================================================
--- scummvm/trunk/engines/lure/hotspots.cpp	2007-12-29 09:51:25 UTC (rev 30070)
+++ scummvm/trunk/engines/lure/hotspots.cpp	2007-12-29 10:38:30 UTC (rev 30071)
@@ -3379,12 +3379,20 @@
 			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 @@
 			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);
 }

Modified: scummvm/trunk/engines/lure/hotspots.h
===================================================================
--- scummvm/trunk/engines/lure/hotspots.h	2007-12-29 09:51:25 UTC (rev 30070)
+++ scummvm/trunk/engines/lure/hotspots.h	2007-12-29 10:38:30 UTC (rev 30071)
@@ -56,6 +56,7 @@
 private:
 	// Support methods
 	static void npcRoomChange(Hotspot &h);
+	static void talkEndConversation();
 
 	// Handler methods
 	static void defaultHandler(Hotspot &h);


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list