Make skipping real-time playback jump to final frame. Fix .

This commit is contained in:
Nick Winter 2016-05-31 08:50:17 -07:00
parent 96e6e0de9e
commit 4160058505
2 changed files with 5 additions and 4 deletions
app

View file

@ -57,11 +57,11 @@ module.exports = class CountdownScreen extends CocoClass
else
@endCountdown()
hide: ->
hide: (duration=500) ->
return unless @showing
@showing = false
createjs.Tween.removeTweens @dimLayer
createjs.Tween.get(@dimLayer).to({alpha: 0}, 500).call => @layer.removeChild @dimLayer unless @destroyed
createjs.Tween.get(@dimLayer).to({alpha: 0}, duration).call => @layer.removeChild @dimLayer unless @destroyed
decrementCountdown: =>
return if @destroyed
@ -85,4 +85,4 @@ module.exports = class CountdownScreen extends CocoClass
onRealTimePlaybackEnded: (e) ->
clearInterval @countdownInterval if @countdownInterval
@countdownInterval = null
@hide()
@hide Math.max(500, 1000 * (@secondsRemaining or 0))

View file

@ -641,7 +641,7 @@ module.exports = class PlayLevelView extends RootView
return unless @$el.hasClass 'real-time'
@$el.removeClass 'real-time'
@onWindowResize()
if @world.frames.length is @world.totalFrames
if @world.frames.length is @world.totalFrames and not @surface.countdownScreen?.showing
_.delay @onSubmissionComplete, 750 # Wait for transition to end.
else
@waitingForSubmissionComplete = true
@ -649,6 +649,7 @@ module.exports = class PlayLevelView extends RootView
onSubmissionComplete: =>
return if @destroyed
Backbone.Mediator.publish 'level:set-time', ratio: 1
return if @level.hasLocalChanges() # Don't award achievements when beating level changed in level editor
# TODO: Show a victory dialog specific to hero-ladder level
if @goalManager.checkOverallStatus() is 'success' and not @options.realTimeMultiplayerSessionID?