diff options
| author | Gubolin <gubolin@fantasymail.de> | 2015-01-08 19:29:43 +0100 |
|---|---|---|
| committer | Gubolin <gubolin@fantasymail.de> | 2015-01-08 19:29:43 +0100 |
| commit | 8b7b751c04a0f41129a2d39de93c171e8e516c42 (patch) | |
| tree | ec627c704ed7f143b3b13f8c408797e738c47b29 /objects.js | |
| parent | 04b0e2e521e52aa4d812de2aa098ecc7f7c475f5 (diff) | |
| parent | 2b8d842592c0cf809408e4f14df1b23b55177206 (diff) | |
| download | snap-8b7b751c04a0f41129a2d39de93c171e8e516c42.tar.gz snap-8b7b751c04a0f41129a2d39de93c171e8e516c42.zip | |
Merge branch 'development' into gh-pages
Diffstat (limited to 'objects.js')
| -rw-r--r-- | objects.js | 27 |
1 files changed, 25 insertions, 2 deletions
@@ -125,7 +125,7 @@ PrototypeHatBlockMorph*/ // Global stuff //////////////////////////////////////////////////////// -modules.objects = '2014-December-04'; +modules.objects = '2014-December-17'; var SpriteMorph; var StageMorph; @@ -837,6 +837,12 @@ SpriteMorph.prototype.initBlocks = function () { category: 'sensing', spec: 'frames' }, + reportThreadCount: { + dev: true, + type: 'reporter', + category: 'sensing', + spec: 'processes' + }, doAsk: { type: 'command', category: 'sensing', @@ -1995,6 +2001,8 @@ SpriteMorph.prototype.blockTemplates = function (category) { txt.setColor(this.paletteTextColor); blocks.push(txt); blocks.push('-'); + blocks.push(watcherToggle('reportThreadCount')); + blocks.push(block('reportThreadCount')); blocks.push(block('colorFiltered')); blocks.push(block('reportStackSize')); blocks.push(block('reportFrameCount')); @@ -3716,6 +3724,16 @@ SpriteMorph.prototype.reportMouseY = function () { return 0; }; +// SpriteMorph thread count (for debugging) + +SpriteMorph.prototype.reportThreadCount = function () { + var stage = this.parentThatIsA(StageMorph); + if (stage) { + return stage.threads.processes.length; + } + return 0; +}; + // SpriteMorph variable watchers (for palette checkbox toggling) SpriteMorph.prototype.findVariableWatcher = function (varName) { @@ -5225,6 +5243,8 @@ StageMorph.prototype.blockTemplates = function (category) { txt.setColor(this.paletteTextColor); blocks.push(txt); blocks.push('-'); + blocks.push(watcherToggle('reportThreadCount')); + blocks.push(block('reportThreadCount')); blocks.push(block('colorFiltered')); blocks.push(block('reportStackSize')); blocks.push(block('reportFrameCount')); @@ -5702,6 +5722,9 @@ StageMorph.prototype.watcherFor = StageMorph.prototype.getLastAnswer = SpriteMorph.prototype.getLastAnswer; +StageMorph.prototype.reportThreadCount + = SpriteMorph.prototype.reportThreadCount; + // StageMorph message broadcasting StageMorph.prototype.allMessageNames @@ -6961,7 +6984,7 @@ WatcherMorph.prototype.object = function () { WatcherMorph.prototype.isGlobal = function (selector) { return contains( ['getLastAnswer', 'getKeysPressed', 'getLastMessage', 'getTempo', 'getTimer', - 'reportMouseX', 'reportMouseY'], + 'reportMouseX', 'reportMouseY', 'reportThreadCount'], selector ); }; |
