mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-14 05:55:00 -04:00
Make skipping real-time playback jump to final frame. Fix #2827.
This commit is contained in:
parent
96e6e0de9e
commit
4160058505
2 changed files with 5 additions and 4 deletions
app
|
@ -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))
|
||||
|
|
|
@ -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?
|
||||
|
|
Loading…
Add table
Reference in a new issue