summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Dinsmore <queryselector@gmail.com>2013-04-13 10:16:15 -0400
committerNathan Dinsmore <queryselector@gmail.com>2013-04-13 10:16:15 -0400
commit4d694e6bfc950df32e423ce7c43e880e3389d07a (patch)
tree2ebef6d5aea4304a71a09fce70d131e49261fde6
parentda7d0da6c3ae3ca4487a061284d5a94009b8381e (diff)
downloadsnap-byow-4d694e6bfc950df32e423ce7c43e880e3389d07a.tar.gz
snap-byow-4d694e6bfc950df32e423ce7c43e880e3389d07a.zip
Fixed #22
Added a "help..." item to the context menus of the "Make a variable," "Delete a variable," and "Make a block" buttons which displays the appropriate help screen
-rw-r--r--objects.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/objects.js b/objects.js
index fca4a5f..50eda50 100644
--- a/objects.js
+++ b/objects.js
@@ -1410,6 +1410,12 @@ SpriteMorph.prototype.blockTemplates = function (category) {
);
}
+ function helpMenu() {
+ var menu = new MenuMorph(this);
+ menu.addItem('help...', 'showHelp');
+ return menu;
+ }
+
if (cat === 'motion') {
blocks.push(block('forward'));
@@ -1686,6 +1692,9 @@ SpriteMorph.prototype.blockTemplates = function (category) {
},
'Make a variable'
);
+ button.userMenu = helpMenu;
+ button.selector = 'addVariable';
+ button.showHelp = BlockMorph.prototype.showHelp;
blocks.push(button);
if (this.variables.allNames().length > 0) {
@@ -1704,6 +1713,9 @@ SpriteMorph.prototype.blockTemplates = function (category) {
},
'Delete a variable'
);
+ button.userMenu = helpMenu;
+ button.selector = 'deleteVariable';
+ button.showHelp = BlockMorph.prototype.showHelp;
blocks.push(button);
}
@@ -1770,6 +1782,9 @@ SpriteMorph.prototype.blockTemplates = function (category) {
},
'Make a block'
);
+ button.userMenu = helpMenu;
+ button.selector = 'addCustomBlock';
+ button.showHelp = BlockMorph.prototype.showHelp;
blocks.push(button);
}
return blocks;