kopia lustrzana https://github.com/backface/turtlestitch
experimental “wardrobe” and “jukebox” reporters in dev mode
tentative preparations for first-class costumes and soundspull/3/merge
rodzic
8badce6480
commit
ca9445c245
|
@ -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
|
||||
|
|
61
objects.js
61
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
|
||||
|
|
Ładowanie…
Reference in New Issue