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 # TODO: load Interface sounds somehow, somewhere, somewhen
preloadSoundReference: (sound) -> preloadSoundReference: (sound) ->
name = @nameForSoundReference sound return unless name = @nameForSoundReference sound
filename = '/file/' + name filename = '/file/' + name
@preloadSound filename, name @preloadSound filename, name
filename filename

View file

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

View file

@ -68,6 +68,7 @@ module.exports = class World
setThang: (thang) -> setThang: (thang) ->
for old, i in @thangs for old, i in @thangs
console.error 'world trying to set', thang, 'over', old unless old? and thang?
if old.id is thang.id if old.id is thang.id
@thangs[i] = thang @thangs[i] = thang
@thangMap[thang.id] = 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 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 else if hasNextLevel
button.btn.btn-success.next-level-button(data-dismiss="modal", data-i18n="play_level.victory_play_next_level") Play Next Level 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') if me.get('anonymous')
p.sign-up-poke 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 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 @session = options.session
@saveReviewEventually = _.debounce(@saveReviewEventually, 2000) @saveReviewEventually = _.debounce(@saveReviewEventually, 2000)
@loadExistingFeedback() @loadExistingFeedback()
if @level.get('type', true) is 'hero'
@closeButton = false
@closesOnClickOutside = false
super options super options
loadExistingFeedback: -> loadExistingFeedback: ->