[Scummvm-git-logs] scummvm master -> ea158a850bcc08f47adc043be26dc38168d3d3dd

moralrecordings code at moral.net.au
Mon Jun 1 10:10:44 UTC 2020


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
ea158a850b DIRECTOR: LINGO: Implement c_whencode


Commit: ea158a850bcc08f47adc043be26dc38168d3d3dd
    https://github.com/scummvm/scummvm/commit/ea158a850bcc08f47adc043be26dc38168d3d3dd
Author: Scott Percival (code at moral.net.au)
Date: 2020-06-01T18:10:16+08:00

Commit Message:
DIRECTOR: LINGO: Implement c_whencode

Changed paths:
    engines/director/lingo/lingo-code.cpp


diff --git a/engines/director/lingo/lingo-code.cpp b/engines/director/lingo/lingo-code.cpp
index 12b6ad293a..ecc120fe1f 100644
--- a/engines/director/lingo/lingo-code.cpp
+++ b/engines/director/lingo/lingo-code.cpp
@@ -1170,9 +1170,21 @@ void LC::c_exitRepeat(void) {
 
 void LC::c_whencode() {
 	Common::String eventname(g_lingo->readString());
-	Common::String code = g_lingo->pop().asString();
-
-	warning("STUB: c_whencode('%s', '%s'", eventname.c_str(), code.c_str());
+	Datum code = g_lingo->pop();
+	Datum nullId;
+
+	// the following when events are supported by D3
+	if (eventname.equalsIgnoreCase("keyDown")) {
+		g_lingo->setTheEntity(kTheKeyDownScript, nullId, kTheNOField, code);
+	} else if (eventname.equalsIgnoreCase("mouseDown")) {
+		g_lingo->setTheEntity(kTheMouseDownScript, nullId, kTheNOField, code);
+	} else if (eventname.equalsIgnoreCase("mouseUp")) {
+		g_lingo->setTheEntity(kTheMouseUpScript, nullId, kTheNOField, code);
+	} else if (eventname.equalsIgnoreCase("timeOut")) {
+		g_lingo->setTheEntity(kTheTimeoutScript, nullId, kTheNOField, code);
+	} else {
+		warning("c_whencode(): unsupported event handler %s", eventname.c_str());
+	}
 }
 
 void LC::c_tellcode() {




More information about the Scummvm-git-logs mailing list