From b4ffac6cdab6f684396992a3e60ba03c9ad92e31 Mon Sep 17 00:00:00 2001 From: John Date: Sun, 3 Aug 2014 11:17:08 +0200 Subject: Update blocks.js --- blocks.js | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'blocks.js') diff --git a/blocks.js b/blocks.js index 2e297ab..9f9e505 100644 --- a/blocks.js +++ b/blocks.js @@ -7714,6 +7714,8 @@ SymbolMorph.prototype.names = [ 'pointRight', 'gears', 'file', + 'mutedSounds', + 'unmutedSounds', 'fullScreen', 'normalScreen', 'smallStage', @@ -7838,6 +7840,10 @@ SymbolMorph.prototype.symbolCanvasColored = function (aColor) { return this.drawSymbolGears(canvas, aColor); case 'file': return this.drawSymbolFile(canvas, aColor); + case 'mutedSounds': + return this.drawSymbolMutedSounds(canvas, aColor); + case 'unmutedSounds': + return this.drawSymbolUnmutedSounds(canvas, aColor); case 'fullScreen': return this.drawSymbolFullScreen(canvas, aColor); case 'normalScreen': @@ -8040,6 +8046,34 @@ SymbolMorph.prototype.drawSymbolFile = function (canvas, color) { return canvas; }; +SymbolMorph.prototype.drawSymbolMutedSounds = function (canvas, color) { + // answer a canvas showing a muted sounds toggling symbol + var ctx = canvas.getContext('2d'), + w = canvas.width, + h = canvas.height, + w2 = w / 2, + h2 = h / 2; + + ctx.fillStyle = color.darker(40).toString(); + ctx.fillRect(0, 0, w, h); + + return canvas; +}; + +SymbolMorph.prototype.drawSymbolUnmutedSounds = function (canvas, color) { + // answer a canvas showing a UNmuted sounds toggling symbol + var ctx = canvas.getContext('2d'), + w = canvas.width, + h = canvas.height, + w2 = w / 2, + h2 = h / 2; + + ctx.fillStyle = color.darker(60).toString(); + ctx.fillRect(0, 0, w, h); + + return canvas; +}; + SymbolMorph.prototype.drawSymbolFullScreen = function (canvas, color) { // answer a canvas showing two arrows pointing diagonally outwards var ctx = canvas.getContext('2d'), -- cgit v1.3.1 From 51387ddfbc536c5ecc88658682f1894411f60631 Mon Sep 17 00:00:00 2001 From: Gubolin Date: Sun, 3 Aug 2014 12:15:15 +0200 Subject: adjust indentation --- blocks.js | 6 +++--- gui.js | 15 +++++++-------- 2 files changed, 10 insertions(+), 11 deletions(-) (limited to 'blocks.js') diff --git a/blocks.js b/blocks.js index 9f9e505..bb1c898 100644 --- a/blocks.js +++ b/blocks.js @@ -7714,7 +7714,7 @@ SymbolMorph.prototype.names = [ 'pointRight', 'gears', 'file', - 'mutedSounds', + 'mutedSounds', 'unmutedSounds', 'fullScreen', 'normalScreen', @@ -7840,9 +7840,9 @@ SymbolMorph.prototype.symbolCanvasColored = function (aColor) { return this.drawSymbolGears(canvas, aColor); case 'file': return this.drawSymbolFile(canvas, aColor); - case 'mutedSounds': + case 'mutedSounds': return this.drawSymbolMutedSounds(canvas, aColor); - case 'unmutedSounds': + case 'unmutedSounds': return this.drawSymbolUnmutedSounds(canvas, aColor); case 'fullScreen': return this.drawSymbolFullScreen(canvas, aColor); diff --git a/gui.js b/gui.js index 1fe6047..38e70ac 100644 --- a/gui.js +++ b/gui.js @@ -212,7 +212,7 @@ IDE_Morph.prototype.init = function (isAutoFill) { this.corral = null; this.isAutoFill = isAutoFill || true; - this.isMuted = false; + this.isMuted = false; this.isAppMode = false; this.isSmallStage = false; this.filePicker = null; @@ -456,7 +456,7 @@ IDE_Morph.prototype.createControlBar = function () { stopButton, pauseButton, startButton, - muteSoundsButton, + muteSoundsButton, projectButton, settingsButton, stageSizeButton, @@ -546,7 +546,7 @@ IDE_Morph.prototype.createControlBar = function () { this.controlBar.add(appModeButton); this.controlBar.appModeButton = appModeButton; // for refreshing - //muteSoundsButton + //muteSoundsButton button = new ToggleButtonMorph( null, //colors, myself, // the IDE is the target @@ -3404,14 +3404,13 @@ IDE_Morph.prototype.toggleStageSize = function (isSmall) { }; IDE_Morph.prototype.toggleMuteSounds = function (isMuted) { - this.isMuted = isNil(isMuted) ? !this.isMuted : isMuted; - this.controlBar.muteSoundsButton.refresh(); + this.isMuted = isNil(isMuted) ? !this.isMuted : isMuted; + this.controlBar.muteSoundsButton.refresh(); this.sprites.asArray().forEach(function (sprt) { - sprt.refreshVolumeOfAllActiveSounds(); + sprt.refreshVolumeOfAllActiveSounds(); }); - this.stage.refreshVolumeOfAllActiveSounds(); - + this.stage.refreshVolumeOfAllActiveSounds(); }; IDE_Morph.prototype.createNewProject = function () { -- cgit v1.3.1