No save button when there's nothing to save. Messing with AudioPlayer playSound API a bit.

This commit is contained in:
Nick Winter 2014-03-01 16:57:29 -08:00
parent 488be26fd3
commit 6c48660922
4 changed files with 9 additions and 3 deletions

View file

@ -78,8 +78,9 @@ class AudioPlayer extends CocoClass
@preloadInterfaceSounds [name] unless filename of cache
@soundsToPlayWhenLoaded[name] = volume
playSound: (name, volume=1) ->
createjs.Sound.play name, {volume: (me.get('volume') ? 1) * volume}
playSound: (name, volume=1, delay=0) ->
instance = createjs.Sound.play name, {volume: (me.get('volume') ? 1) * volume, delay: delay}
instance
# # TODO: load Interface sounds somehow, somewhere, somewhen

View file

@ -475,6 +475,6 @@ module.exports = CocoSprite = class CocoSprite extends CocoClass
return null unless sound
delay = if withDelay and sound.delay then 1000 * sound.delay / createjs.Ticker.getFPS() else 0
name = AudioPlayer.nameForSoundReference sound
instance = createjs.Sound.play name, "none", delay, 0, 0, volume
instance = AudioPlayer.playSound name, volume, delay
# console.log @thang?.id, "played sound", name, "with delay", delay, "volume", volume, "and got sound instance", instance
instance

View file

@ -52,3 +52,7 @@ block modal-body-content
label.control-label(for=id + "-version-is-major") Major Changes?
input(id=id + "-version-is-major", name="version-is-major", type="checkbox")
span.help-block (Could this update break anything depending on this System?)
if noSaveButton
block modal-footer-content
button.btn(data-dismiss="modal", data-i18n="common.cancel") Cancel

View file

@ -23,6 +23,7 @@ module.exports = class LevelSaveView extends SaveVersionModal
context.levelNeedsSave = @level.hasLocalChanges()
context.modifiedComponents = _.filter @supermodel.getModels(LevelComponent), @shouldSaveEntity
context.modifiedSystems = _.filter @supermodel.getModels(LevelSystem), @shouldSaveEntity
context.noSaveButton = context.levelNeedsSave or context.modifiedComponents.length or context.modifiedSystems.length
context
shouldSaveEntity: (m) ->