Merge branch 'master' into production

This commit is contained in:
Nick Winter 2014-09-10 21:56:30 -07:00
commit c3cf071299
4 changed files with 19 additions and 10 deletions

View file

@ -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

View file

@ -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'}

View file

@ -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: ->

View file

@ -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 = [