diff --git a/app/lib/AudioPlayer.coffee b/app/lib/AudioPlayer.coffee index 8f71d50e2..7208bd20e 100644 --- a/app/lib/AudioPlayer.coffee +++ b/app/lib/AudioPlayer.coffee @@ -81,7 +81,7 @@ class AudioPlayer extends CocoClass playInterfaceSound: (name, volume=1) -> filename = "/file/interface/#{name}#{@ext}" - if filename of cache and createjs.Sound.loadComplete filename + if @hasLoadedSound filename @playSound name, volume else @preloadInterfaceSounds [name] unless filename of cache @@ -89,15 +89,23 @@ class AudioPlayer extends CocoClass playSound: (name, volume=1, delay=0, pos=null) -> return console.error 'Trying to play empty sound?' unless name - audioOptions = {volume: (me.get('volume') ? 1) * volume, delay: delay} + audioOptions = {volume: volume, delay: delay} filename = if _.string.startsWith(name, '/file/') then name else '/file/' + name - unless (filename of cache) and createjs.Sound.loadComplete filename + unless @hasLoadedSound filename @soundsToPlayWhenLoaded[name] = audioOptions.volume audioOptions = @applyPanning audioOptions, pos if @camera and pos instance = createjs.Sound.play name, audioOptions + # For some reason, individual sound volume control doesn't work any more. + # I tried updating to SoundJS NEXT on 2014-09-10, but couldn't get any sounds to play with that one. + #console.log 'got instance with volume', instance.volume, instance._volume, instance.gainNode?.gain.value instance -# # TODO: load Interface sounds somehow, somewhere, somewhen + hasLoadedSound: (filename, name) -> + return false unless filename of cache + return false unless createjs.Sound.loadComplete filename + true + + # TODO: load Interface sounds somehow, somewhere, somewhen preloadSoundReference: (sound) -> name = @nameForSoundReference sound diff --git a/app/schemas/subscriptions/tome.coffee b/app/schemas/subscriptions/tome.coffee index d248b044f..3f20ebe78 100644 --- a/app/schemas/subscriptions/tome.coffee +++ b/app/schemas/subscriptions/tome.coffee @@ -41,7 +41,7 @@ module.exports = 'tome:palette-updated': c.object {title: 'Palette Updated', description: 'Published when the spell palette has just been updated.'}, thangID: {type: 'string'} - entryGroups: {type: 'object', additionalProperties: {type: 'string'}} + entryGroups: {type: 'string'} 'tome:palette-hovered': c.object {title: 'Palette Hovered', description: 'Published when you hover over a Thang in the spell palette', required: ['thang', 'prop', 'entry']}, thang: {type: 'object'} diff --git a/app/views/play/level/LevelPlaybackView.coffee b/app/views/play/level/LevelPlaybackView.coffee index fcf691500..8ffb10607 100644 --- a/app/views/play/level/LevelPlaybackView.coffee +++ b/app/views/play/level/LevelPlaybackView.coffee @@ -339,7 +339,7 @@ module.exports = class LevelPlaybackView extends CocoView @slideCount = 0 @wasPlaying = @playing Backbone.Mediator.publish 'level:set-playing', {playing: false} - Backbone.Mediator.publish 'audio-player:play-sound', trigger: 'playback-scrub-start', volume: 1 + Backbone.Mediator.publish 'audio-player:play-sound', trigger: 'playback-scrub-start', volume: 0.5 stop: (event, ui) => return if @shouldIgnore() @@ -351,7 +351,7 @@ module.exports = class LevelPlaybackView extends CocoView Backbone.Mediator.publish 'level:set-playing', {playing: false} @$el.find('.scrubber-handle').effect('bounce', {times: 2}) else - Backbone.Mediator.publish 'audio-player:play-sound', trigger: 'playback-scrub-end', volume: 1 + Backbone.Mediator.publish 'audio-player:play-sound', trigger: 'playback-scrub-end', volume: 0.5 ) getScrubRatio: -> diff --git a/server/users/User.coffee b/server/users/User.coffee index db1e76143..abdd629a0 100644 --- a/server/users/User.coffee +++ b/server/users/User.coffee @@ -124,7 +124,7 @@ UserSchema.statics.statsMapping = 'level.component': 'stats.levelComponentMiscPatches' 'level.system': 'stats.levelSystemMiscPatches' 'thang.type': 'stats.thangTypeMiscPatches' - + UserSchema.statics.incrementStat = (id, statName, done, inc=1) -> id = mongoose.Types.ObjectId id if _.isString id @findById id, (err, user) -> @@ -184,8 +184,9 @@ UserSchema.statics.hashPassword = (password) -> shasum.digest('hex') UserSchema.statics.privateProperties = [ - 'permissions', 'email', 'firstName', 'lastName', 'gender', 'facebookID', - 'gplusID', 'music', 'volume', 'aceConfig', 'employerAt', 'signedEmployerAgreement' + 'permissions', 'email', 'mailChimp', 'firstName', 'lastName', 'gender', 'facebookID', + 'gplusID', 'music', 'volume', 'aceConfig', 'employerAt', 'signedEmployerAgreement', + 'emailSubscriptions', 'emails', 'activity' ] UserSchema.statics.jsonSchema = jsonschema UserSchema.statics.editableProperties = [