diff options
| author | jmoenig <jens@moenig.org> | 2013-05-14 16:16:21 +0200 |
|---|---|---|
| committer | jmoenig <jens@moenig.org> | 2013-05-14 16:16:21 +0200 |
| commit | d267b696af1e7a429c4b31dc87b46dc638c3509f (patch) | |
| tree | 55ea3f81aa2f60b552ad0a649e58fc2d43debbc9 /blocks.js | |
| parent | 4c44efdc1e7a2c1bb06274b206de7a982fb03d12 (diff) | |
| download | snap-d267b696af1e7a429c4b31dc87b46dc638c3509f.tar.gz snap-d267b696af1e7a429c4b31dc87b46dc638c3509f.zip | |
Broadcast & Message enhancements, fixed #93
* When I receive <any msg> option
* getLastMessage reporter + watcher
Diffstat (limited to 'blocks.js')
| -rw-r--r-- | blocks.js | 38 |
1 files changed, 35 insertions, 3 deletions
@@ -153,7 +153,7 @@ DialogBoxMorph, BlockInputFragmentMorph, PrototypeHatBlockMorph*/ // Global stuff //////////////////////////////////////////////////////// -modules.blocks = '2013-April-30'; +modules.blocks = '2013-May-14'; var SyntaxElementMorph; var BlockMorph; @@ -195,7 +195,7 @@ WorldMorph.prototype.customMorphs = function () { new Color(20, 20, 20) ) ]; - +*/ /* var sm = new ScriptsMorph(); sm.setExtent(new Point(800, 600)); @@ -936,7 +936,7 @@ SyntaxElementMorph.prototype.labelPart = function (spec) { part = new InputSlotMorph( null, false, - 'messagesMenu', + 'messagesReceivedMenu', true ); part.isStatic = true; @@ -5734,6 +5734,38 @@ InputSlotMorph.prototype.messagesMenu = function () { return dict; }; +InputSlotMorph.prototype.messagesReceivedMenu = function () { + var dict = {'any message': ['any message']}, + rcvr = this.parentThatIsA(BlockMorph).receiver(), + stage = rcvr.parentThatIsA(StageMorph), + myself = this, + allNames = []; + + stage.children.concat(stage).forEach(function (morph) { + if (morph instanceof SpriteMorph || morph instanceof StageMorph) { + allNames = allNames.concat(morph.allMessageNames()); + } + }); + allNames.forEach(function (name) { + dict[name] = name; + }); + dict['~'] = null; + dict['new...'] = function () { + + new DialogBoxMorph( + myself, + myself.setContents, + myself + ).prompt( + 'Message name', + null, + myself.world() + ); + }; + + return dict; +}; + InputSlotMorph.prototype.collidablesMenu = function () { var dict = { 'mouse-pointer' : ['mouse-pointer'], |
