summaryrefslogtreecommitdiff
path: root/objects.js
diff options
context:
space:
mode:
authorGubolin <gubolin@fantasymail.de>2014-11-03 16:32:17 +0100
committerGubolin <gubolin@fantasymail.de>2014-11-03 16:32:17 +0100
commit1f750eb56047320f5c835c8b997f75e5e513d4eb (patch)
treea7ebc72198e802ac31e8fccc781a5ab26c28dbe2 /objects.js
parent5f3279990be3478fde79b94f7dbd5d7da80df84b (diff)
downloadsnap-1f750eb56047320f5c835c8b997f75e5e513d4eb.tar.gz
snap-1f750eb56047320f5c835c8b997f75e5e513d4eb.zip
add ANY KEY to key hat block (fix #387)
Diffstat (limited to 'objects.js')
-rw-r--r--objects.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/objects.js b/objects.js
index 4be213a..ecde750 100644
--- a/objects.js
+++ b/objects.js
@@ -3483,7 +3483,15 @@ SpriteMorph.prototype.allHatBlocksForKey = function (key) {
return this.scripts.children.filter(function (morph) {
if (morph.selector) {
if (morph.selector === 'receiveKey') {
- return morph.inputs()[0].evaluate()[0] === key;
+ var selectedOption = morph.inputs()[0].evaluate()[0];
+
+ if (selectedOption === 'any key') {
+ return true;
+ }
+ if (selectedOption === key) {
+ return true;
+ }
+ return false;
}
}
return false;