kopia lustrzana https://github.com/backface/turtlestitch
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 screenpull/3/merge
rodzic
da7d0da6c3
commit
4d694e6bfc
15
objects.js
15
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;
|
||||
|
|
Ładowanie…
Reference in New Issue