mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-24 08:08:15 -05:00
No save button when there's nothing to save. Messing with AudioPlayer playSound API a bit.
This commit is contained in:
parent
488be26fd3
commit
6c48660922
4 changed files with 9 additions and 3 deletions
|
@ -78,8 +78,9 @@ class AudioPlayer extends CocoClass
|
||||||
@preloadInterfaceSounds [name] unless filename of cache
|
@preloadInterfaceSounds [name] unless filename of cache
|
||||||
@soundsToPlayWhenLoaded[name] = volume
|
@soundsToPlayWhenLoaded[name] = volume
|
||||||
|
|
||||||
playSound: (name, volume=1) ->
|
playSound: (name, volume=1, delay=0) ->
|
||||||
createjs.Sound.play name, {volume: (me.get('volume') ? 1) * volume}
|
instance = createjs.Sound.play name, {volume: (me.get('volume') ? 1) * volume, delay: delay}
|
||||||
|
instance
|
||||||
|
|
||||||
# # TODO: load Interface sounds somehow, somewhere, somewhen
|
# # TODO: load Interface sounds somehow, somewhere, somewhen
|
||||||
|
|
||||||
|
|
|
@ -475,6 +475,6 @@ module.exports = CocoSprite = class CocoSprite extends CocoClass
|
||||||
return null unless sound
|
return null unless sound
|
||||||
delay = if withDelay and sound.delay then 1000 * sound.delay / createjs.Ticker.getFPS() else 0
|
delay = if withDelay and sound.delay then 1000 * sound.delay / createjs.Ticker.getFPS() else 0
|
||||||
name = AudioPlayer.nameForSoundReference sound
|
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
|
# console.log @thang?.id, "played sound", name, "with delay", delay, "volume", volume, "and got sound instance", instance
|
||||||
instance
|
instance
|
||||||
|
|
|
@ -52,3 +52,7 @@ block modal-body-content
|
||||||
label.control-label(for=id + "-version-is-major") Major Changes?
|
label.control-label(for=id + "-version-is-major") Major Changes?
|
||||||
input(id=id + "-version-is-major", name="version-is-major", type="checkbox")
|
input(id=id + "-version-is-major", name="version-is-major", type="checkbox")
|
||||||
span.help-block (Could this update break anything depending on this System?)
|
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
|
||||||
|
|
|
@ -23,6 +23,7 @@ module.exports = class LevelSaveView extends SaveVersionModal
|
||||||
context.levelNeedsSave = @level.hasLocalChanges()
|
context.levelNeedsSave = @level.hasLocalChanges()
|
||||||
context.modifiedComponents = _.filter @supermodel.getModels(LevelComponent), @shouldSaveEntity
|
context.modifiedComponents = _.filter @supermodel.getModels(LevelComponent), @shouldSaveEntity
|
||||||
context.modifiedSystems = _.filter @supermodel.getModels(LevelSystem), @shouldSaveEntity
|
context.modifiedSystems = _.filter @supermodel.getModels(LevelSystem), @shouldSaveEntity
|
||||||
|
context.noSaveButton = context.levelNeedsSave or context.modifiedComponents.length or context.modifiedSystems.length
|
||||||
context
|
context
|
||||||
|
|
||||||
shouldSaveEntity: (m) ->
|
shouldSaveEntity: (m) ->
|
||||||
|
|
Loading…
Reference in a new issue