diff options
| author | jmoenig <jens@moenig.org> | 2014-03-31 12:01:03 +0200 |
|---|---|---|
| committer | jmoenig <jens@moenig.org> | 2014-03-31 12:01:03 +0200 |
| commit | ca9445c245d6c36f9a53ff3afeef47ff6920b59b (patch) | |
| tree | be7c00892ffde541826242efce5585756eb6de73 /objects.js | |
| parent | 8badce6480d434653326684a953fccc6cf03c5d8 (diff) | |
| download | snap-byow-ca9445c245d6c36f9a53ff3afeef47ff6920b59b.tar.gz snap-byow-ca9445c245d6c36f9a53ff3afeef47ff6920b59b.zip | |
experimental “wardrobe” and “jukebox” reporters in dev mode
tentative preparations for first-class costumes and sounds
Diffstat (limited to 'objects.js')
| -rw-r--r-- | objects.js | 61 |
1 files changed, 60 insertions, 1 deletions
@@ -124,7 +124,7 @@ PrototypeHatBlockMorph*/ // Global stuff //////////////////////////////////////////////////////// -modules.objects = '2014-February-11'; +modules.objects = '2014-March-31'; var SpriteMorph; var StageMorph; @@ -389,6 +389,12 @@ SpriteMorph.prototype.initBlocks = function () { }, // Looks - Debugging primitives for development mode + reportCostumes: { + type: 'reporter', + category: 'looks', + spec: 'wardrobe' + }, + alert: { type: 'command', category: 'looks', @@ -446,6 +452,13 @@ SpriteMorph.prototype.initBlocks = function () { spec: 'tempo' }, + // Sound - Debugging primitives for development mode + reportSounds: { + type: 'reporter', + category: 'sound', + spec: 'jukebox' + }, + // Pen clear: { type: 'command', @@ -1620,6 +1633,8 @@ SpriteMorph.prototype.blockTemplates = function (category) { txt.setColor(this.paletteTextColor); blocks.push(txt); blocks.push('-'); + blocks.push(block('reportCostumes')); + blocks.push('-'); blocks.push(block('log')); blocks.push(block('alert')); } @@ -1641,6 +1656,20 @@ SpriteMorph.prototype.blockTemplates = function (category) { blocks.push(watcherToggle('getTempo')); blocks.push(block('getTempo')); + // for debugging: /////////////// + + if (this.world().isDevMode) { + blocks.push('-'); + txt = new TextMorph(localize( + 'development mode \ndebugging primitives:' + )); + txt.fontSize = 9; + txt.setColor(this.paletteTextColor); + blocks.push(txt); + blocks.push('-'); + blocks.push(block('reportSounds')); + } + } else if (cat === 'pen') { blocks.push(block('clear')); @@ -2292,6 +2321,10 @@ SpriteMorph.prototype.doSwitchToCostume = function (id) { this.wearCostume(costume); }; +SpriteMorph.prototype.reportCostumes = function () { + return this.costumes; +}; + // SpriteMorph sound management SpriteMorph.prototype.addSound = function (audio, name) { @@ -2317,6 +2350,10 @@ SpriteMorph.prototype.playSound = function (name) { } }; +SpriteMorph.prototype.reportSounds = function () { + return this.sounds; +}; + // SpriteMorph user menu SpriteMorph.prototype.userMenu = function () { @@ -4353,6 +4390,8 @@ StageMorph.prototype.blockTemplates = function (category) { txt.setColor(this.paletteTextColor); blocks.push(txt); blocks.push('-'); + blocks.push(block('reportCostumes')); + blocks.push('-'); blocks.push(block('log')); blocks.push(block('alert')); } @@ -4374,6 +4413,20 @@ StageMorph.prototype.blockTemplates = function (category) { blocks.push(watcherToggle('getTempo')); blocks.push(block('getTempo')); + // for debugging: /////////////// + + if (this.world().isDevMode) { + blocks.push('-'); + txt = new TextMorph(localize( + 'development mode \ndebugging primitives:' + )); + txt.fontSize = 9; + txt.setColor(this.paletteTextColor); + blocks.push(txt); + blocks.push('-'); + blocks.push(block('reportSounds')); + } + } else if (cat === 'pen') { blocks.push(block('clear')); @@ -4832,6 +4885,9 @@ StageMorph.prototype.doWearPreviousCostume StageMorph.prototype.doSwitchToCostume = SpriteMorph.prototype.doSwitchToCostume; +StageMorph.prototype.reportCostumes + = SpriteMorph.prototype.reportCostumes; + // StageMorph graphic effects StageMorph.prototype.setEffect @@ -4873,6 +4929,9 @@ StageMorph.prototype.resumeAllActiveSounds = function () { }); }; +StageMorph.prototype.reportSounds + = SpriteMorph.prototype.reportSounds; + // StageMorph non-variable watchers StageMorph.prototype.toggleWatcher |
