summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjmoenig <jens@moenig.org>2014-03-31 12:01:03 +0200
committerjmoenig <jens@moenig.org>2014-03-31 12:01:03 +0200
commitca9445c245d6c36f9a53ff3afeef47ff6920b59b (patch)
treebe7c00892ffde541826242efce5585756eb6de73
parent8badce6480d434653326684a953fccc6cf03c5d8 (diff)
downloadsnap-yow-ca9445c245d6c36f9a53ff3afeef47ff6920b59b.tar.gz
snap-yow-ca9445c245d6c36f9a53ff3afeef47ff6920b59b.zip
experimental “wardrobe” and “jukebox” reporters in dev mode
tentative preparations for first-class costumes and sounds
-rwxr-xr-xhistory.txt4
-rw-r--r--objects.js61
2 files changed, 64 insertions, 1 deletions
diff --git a/history.txt b/history.txt
index 2096b08..4c4201e 100755
--- a/history.txt
+++ b/history.txt
@@ -2103,3 +2103,7 @@ ______
* Widgets: new “promptVector” dialog box feature
* GUI: Use new vector prompter for stage dimensions
* German translation update
+
+140331
+------
+* Objects: experimental “wardrobe” and “jukebox” reporters in dev mode
diff --git a/objects.js b/objects.js
index 46a951f..37daa69 100644
--- a/objects.js
+++ b/objects.js
@@ -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