mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-14 07:00:01 -04:00
Don't load ambient sound in CampaignView if muted
This commit is contained in:
parent
ca1cb9a084
commit
0a1be8e80e
1 changed files with 2 additions and 0 deletions
|
@ -552,6 +552,7 @@ module.exports = class CampaignView extends RootView
|
|||
@testParticles() if @particleMan
|
||||
|
||||
playAmbientSound: ->
|
||||
return unless me.get 'volume'
|
||||
return if @ambientSound
|
||||
return unless file = @campaign?.get('ambientSound')?[AudioPlayer.ext.substr 1]
|
||||
src = "/file/#{file}"
|
||||
|
@ -600,6 +601,7 @@ module.exports = class CampaignView extends RootView
|
|||
if volume isnt me.get 'volume'
|
||||
me.set 'volume', volume
|
||||
me.patch()
|
||||
@playAmbientSound() if volume
|
||||
|
||||
onToggleVolume: (e) ->
|
||||
button = $(e.target).closest('#volume-button')
|
||||
|
|
Loading…
Reference in a new issue