summaryrefslogtreecommitdiff
path: root/gui.js
diff options
context:
space:
mode:
Diffstat (limited to 'gui.js')
-rw-r--r--gui.js19
1 files changed, 15 insertions, 4 deletions
diff --git a/gui.js b/gui.js
index 38e70ac..28549df 100644
--- a/gui.js
+++ b/gui.js
@@ -3407,10 +3407,21 @@ IDE_Morph.prototype.toggleMuteSounds = function (isMuted) {
this.isMuted = isNil(isMuted) ? !this.isMuted : isMuted;
this.controlBar.muteSoundsButton.refresh();
- this.sprites.asArray().forEach(function (sprt) {
- sprt.refreshVolumeOfAllActiveSounds();
- });
- this.stage.refreshVolumeOfAllActiveSounds();
+ /* stage.activeSounds holds all active sounds
+ * a sprite's .activeSounds holds just its own
+ * so you have to use the stage to mute
+ * and the sprite to unmute, because the stage's volume
+ * overrides the sprite's one.
+ */
+
+ if (this.isMuted === false) {
+ this.stage.unmuteAllSounds();
+ this.sprites.asArray().forEach(function (sprt) {
+ sprt.unmuteAllSounds();
+ });
+ } else {
+ this.stage.muteAllSounds();
+ }
};
IDE_Morph.prototype.createNewProject = function () {