Improved solidity of victory modal. Fixed error with empty sound groups in Thang editor.

This commit is contained in:
Nick Winter 2014-09-22 21:50:48 -07:00
parent 149848c971
commit 8640369b26
5 changed files with 10 additions and 3 deletions

View file

@ -108,7 +108,7 @@ class AudioPlayer extends CocoClass
# TODO: load Interface sounds somehow, somewhere, somewhen
preloadSoundReference: (sound) ->
name = @nameForSoundReference sound
return unless name = @nameForSoundReference sound
filename = '/file/' + name
@preloadSound filename, name
filename

View file

@ -90,7 +90,7 @@ module.exports = CocoSprite = class CocoSprite extends CocoClass
setUpSprite: ->
for trigger, sounds of @thangType.get('soundTriggers') or {} when trigger isnt 'say'
AudioPlayer.preloadSoundReference sound for sound in sounds
AudioPlayer.preloadSoundReference sound for sound in sounds when sound
if @thangType.get('raster')
@stillLoading = false
@actions = {}

View file

@ -68,6 +68,7 @@ module.exports = class World
setThang: (thang) ->
for old, i in @thangs
console.error 'world trying to set', thang, 'over', old unless old? and thang?
if old.id is thang.id
@thangs[i] = thang
@thangMap[thang.id] = thang

View file

@ -17,7 +17,10 @@ block modal-footer-content
a.btn.btn-primary(href="/play/ladder/#{level.get('slug')}#my-matches", data-dismiss="modal", data-i18n="play_level.victory_go_ladder") Return to Ladder
else if hasNextLevel
button.btn.btn-success.next-level-button(data-dismiss="modal", data-i18n="play_level.victory_play_next_level") Play Next Level
a.btn.btn-primary(href="/play-hero", data-dismiss="modal", data-i18n="play_level.victory_go_home") Go Home
else if level.get('type', true) === 'hero'
a.btn.btn-success(href="/play-hero", data-dismiss="modal", data-i18n="play_level.victory_play_next_level") Play Next Level
else
a.btn.btn-primary(href="/", data-dismiss="modal", data-i18n="play_level.victory_go_home") Go Home
if me.get('anonymous')
p.sign-up-poke
button.btn.btn-success.sign-up-button.btn-large(data-toggle="coco-modal", data-target="modal/SignupModal", data-i18n="play_level.victory_sign_up") Sign Up to Save Progress

View file

@ -34,6 +34,9 @@ module.exports = class VictoryModal extends ModalView
@session = options.session
@saveReviewEventually = _.debounce(@saveReviewEventually, 2000)
@loadExistingFeedback()
if @level.get('type', true) is 'hero'
@closeButton = false
@closesOnClickOutside = false
super options
loadExistingFeedback: ->