Add warning sounds when the user reaches a boundary of the workspace.

This commit is contained in:
Sean Lip
2016-11-17 17:45:42 -08:00
parent 602c1ba56e
commit 10a8844980

View File

@@ -556,6 +556,7 @@ blocklyApp.TreeService = ng.core.Class({
if (this.getParentListElement_(activeDesc)) {
statusMessage += ' Press left to go to parent list.';
}
this.audioService.playOopsSound();
this.notificationsService.setStatusMessage(statusMessage);
}
} else if (e.keyCode == 39) {
@@ -567,6 +568,7 @@ blocklyApp.TreeService = ng.core.Class({
if (nextSibling) {
this.setActiveDesc(nextSibling.id, treeId);
} else {
this.audioService.playOopsSound();
this.notificationsService.setStatusMessage(
'Reached bottom of list.');
}
@@ -582,6 +584,8 @@ blocklyApp.TreeService = ng.core.Class({
var firstChild = this.getFirstChild(activeDesc);
if (firstChild) {
this.setActiveDesc(firstChild.id, treeId);
} else {
this.audioService.playOopsSound();
}
},
moveUpOneLevel_: function(treeId) {
@@ -589,6 +593,8 @@ blocklyApp.TreeService = ng.core.Class({
var nextNode = this.getParentListElement_(activeDesc);
if (nextNode) {
this.setActiveDesc(nextNode.id, treeId);
} else {
this.audioService.playOopsSound();
}
},
getParentListElement_: function(element) {