mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-25 16:47:58 -05:00
Merge branch 'master' into production
This commit is contained in:
commit
c3cf071299
4 changed files with 19 additions and 10 deletions
|
@ -81,7 +81,7 @@ class AudioPlayer extends CocoClass
|
||||||
|
|
||||||
playInterfaceSound: (name, volume=1) ->
|
playInterfaceSound: (name, volume=1) ->
|
||||||
filename = "/file/interface/#{name}#{@ext}"
|
filename = "/file/interface/#{name}#{@ext}"
|
||||||
if filename of cache and createjs.Sound.loadComplete filename
|
if @hasLoadedSound filename
|
||||||
@playSound name, volume
|
@playSound name, volume
|
||||||
else
|
else
|
||||||
@preloadInterfaceSounds [name] unless filename of cache
|
@preloadInterfaceSounds [name] unless filename of cache
|
||||||
|
@ -89,15 +89,23 @@ class AudioPlayer extends CocoClass
|
||||||
|
|
||||||
playSound: (name, volume=1, delay=0, pos=null) ->
|
playSound: (name, volume=1, delay=0, pos=null) ->
|
||||||
return console.error 'Trying to play empty sound?' unless name
|
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
|
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
|
@soundsToPlayWhenLoaded[name] = audioOptions.volume
|
||||||
audioOptions = @applyPanning audioOptions, pos if @camera and pos
|
audioOptions = @applyPanning audioOptions, pos if @camera and pos
|
||||||
instance = createjs.Sound.play name, audioOptions
|
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
|
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) ->
|
preloadSoundReference: (sound) ->
|
||||||
name = @nameForSoundReference sound
|
name = @nameForSoundReference sound
|
||||||
|
|
|
@ -41,7 +41,7 @@ module.exports =
|
||||||
|
|
||||||
'tome:palette-updated': c.object {title: 'Palette Updated', description: 'Published when the spell palette has just been updated.'},
|
'tome:palette-updated': c.object {title: 'Palette Updated', description: 'Published when the spell palette has just been updated.'},
|
||||||
thangID: {type: 'string'}
|
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']},
|
'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'}
|
thang: {type: 'object'}
|
||||||
|
|
|
@ -339,7 +339,7 @@ module.exports = class LevelPlaybackView extends CocoView
|
||||||
@slideCount = 0
|
@slideCount = 0
|
||||||
@wasPlaying = @playing
|
@wasPlaying = @playing
|
||||||
Backbone.Mediator.publish 'level:set-playing', {playing: false}
|
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) =>
|
stop: (event, ui) =>
|
||||||
return if @shouldIgnore()
|
return if @shouldIgnore()
|
||||||
|
@ -351,7 +351,7 @@ module.exports = class LevelPlaybackView extends CocoView
|
||||||
Backbone.Mediator.publish 'level:set-playing', {playing: false}
|
Backbone.Mediator.publish 'level:set-playing', {playing: false}
|
||||||
@$el.find('.scrubber-handle').effect('bounce', {times: 2})
|
@$el.find('.scrubber-handle').effect('bounce', {times: 2})
|
||||||
else
|
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: ->
|
getScrubRatio: ->
|
||||||
|
|
|
@ -124,7 +124,7 @@ UserSchema.statics.statsMapping =
|
||||||
'level.component': 'stats.levelComponentMiscPatches'
|
'level.component': 'stats.levelComponentMiscPatches'
|
||||||
'level.system': 'stats.levelSystemMiscPatches'
|
'level.system': 'stats.levelSystemMiscPatches'
|
||||||
'thang.type': 'stats.thangTypeMiscPatches'
|
'thang.type': 'stats.thangTypeMiscPatches'
|
||||||
|
|
||||||
UserSchema.statics.incrementStat = (id, statName, done, inc=1) ->
|
UserSchema.statics.incrementStat = (id, statName, done, inc=1) ->
|
||||||
id = mongoose.Types.ObjectId id if _.isString id
|
id = mongoose.Types.ObjectId id if _.isString id
|
||||||
@findById id, (err, user) ->
|
@findById id, (err, user) ->
|
||||||
|
@ -184,8 +184,9 @@ UserSchema.statics.hashPassword = (password) ->
|
||||||
shasum.digest('hex')
|
shasum.digest('hex')
|
||||||
|
|
||||||
UserSchema.statics.privateProperties = [
|
UserSchema.statics.privateProperties = [
|
||||||
'permissions', 'email', 'firstName', 'lastName', 'gender', 'facebookID',
|
'permissions', 'email', 'mailChimp', 'firstName', 'lastName', 'gender', 'facebookID',
|
||||||
'gplusID', 'music', 'volume', 'aceConfig', 'employerAt', 'signedEmployerAgreement'
|
'gplusID', 'music', 'volume', 'aceConfig', 'employerAt', 'signedEmployerAgreement',
|
||||||
|
'emailSubscriptions', 'emails', 'activity'
|
||||||
]
|
]
|
||||||
UserSchema.statics.jsonSchema = jsonschema
|
UserSchema.statics.jsonSchema = jsonschema
|
||||||
UserSchema.statics.editableProperties = [
|
UserSchema.statics.editableProperties = [
|
||||||
|
|
Loading…
Reference in a new issue