[Scummvm-cvs-logs] SF.net SVN: scummvm:[47164] scummvm/trunk/engines/sci/graphics/menu.cpp

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Fri Jan 8 18:25:52 CET 2010


Revision: 47164
          http://scummvm.svn.sourceforge.net/scummvm/?rev=47164&view=rev
Author:   m_kiewitz
Date:     2010-01-08 17:25:39 +0000 (Fri, 08 Jan 2010)

Log Message:
-----------
SCI: support "Ctrl-" prefix keys in menu, makes Ctrl-keys work in lsl6

Modified Paths:
--------------
    scummvm/trunk/engines/sci/graphics/menu.cpp

Modified: scummvm/trunk/engines/sci/graphics/menu.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/menu.cpp	2010-01-08 16:52:45 UTC (rev 47163)
+++ scummvm/trunk/engines/sci/graphics/menu.cpp	2010-01-08 17:25:39 UTC (rev 47164)
@@ -66,6 +66,7 @@
 	int separatorCount;
 	int curPos, beginPos, endPos, tempPos;
 	int tagPos, rightAlignedPos, functionPos, altPos, controlPos;
+	const char *tempPtr;
 
 	// Sierra SCI starts with id 1, so we do so as well
 	_listCount++;
@@ -180,6 +181,14 @@
 		} else {
 			EngineState *s = ((SciEngine *)g_engine)->getEngineState();	// HACK: needed for strSplit()
 			itemEntry->text = s->strSplit(Common::String(content.c_str() + beginPos, tempPos - beginPos).c_str());
+
+			// LSL6 uses "Ctrl-" prefix string instead of ^ like all the other games do
+			tempPtr = itemEntry->text.c_str();
+			tempPtr = strstr(tempPtr, "Ctrl-");
+			if (tempPtr) {
+				itemEntry->keyModifier = SCI_KEYMOD_CTRL;
+				itemEntry->keyPress = tolower(tempPtr[5]);
+			}
 		}
 		itemEntry->textVmPtr = contentVmPtr;
 		itemEntry->textVmPtr.offset += beginPos;
@@ -193,10 +202,11 @@
 				tempPos = tagPos;
 			itemEntry->textRightAligned = Common::String(content.c_str() + rightAlignedPos, tempPos - rightAlignedPos);
 			// - and + are used sometimes for volume control
-			if (itemEntry->textRightAligned == "-")
+			if (itemEntry->textRightAligned == "-") {
 				itemEntry->keyPress = '-';
-			if (itemEntry->textRightAligned == "+")
+			} else if (itemEntry->textRightAligned == "+") {
 				itemEntry->keyPress = '+';
+			}
 		}
 
 		if (tagPos) {


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