mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-23 23:58:02 -05:00
Added a workaround for Surface resize failure on realtime playback end that Maksym had seen.
This commit is contained in:
parent
867279b6b8
commit
9ea24f4c74
2 changed files with 5 additions and 1 deletions
|
@ -19,6 +19,8 @@ PointChooser = require './PointChooser'
|
|||
RegionChooser = require './RegionChooser'
|
||||
MusicPlayer = require './MusicPlayer'
|
||||
|
||||
resizeDelay = 500 # At least as much as $level-resize-transition-time.
|
||||
|
||||
module.exports = Surface = class Surface extends CocoClass
|
||||
stage: null
|
||||
|
||||
|
@ -88,7 +90,7 @@ module.exports = Surface = class Surface extends CocoClass
|
|||
@options = _.extend(@options, givenOptions) if givenOptions
|
||||
@initEasel()
|
||||
@initAudio()
|
||||
@onResize = _.debounce @onResize, 500 # At least as much as $level-resize-transition-time.
|
||||
@onResize = _.debounce @onResize, resizeDelay
|
||||
$(window).on 'resize', @onResize
|
||||
if @world.ended
|
||||
_.defer => @setWorld @world
|
||||
|
@ -545,6 +547,7 @@ module.exports = Surface = class Surface extends CocoClass
|
|||
return unless @realTime
|
||||
@realTime = false
|
||||
@onResize()
|
||||
_.delay @onResize, resizeDelay + 100 # Do it again just to be double sure that we don't stay zoomed in due to timing problems.
|
||||
@spriteBoss.selfWizardSprite?.toggle true
|
||||
@canvas.removeClass 'flag-color-selected'
|
||||
if @previousCameraZoom
|
||||
|
|
|
@ -312,6 +312,7 @@ module.exports = class LevelPlaybackView extends CocoView
|
|||
Backbone.Mediator.publish 'audio-player:play-sound', trigger: 'real-time-playback-end', volume: 1
|
||||
|
||||
onStopRealTimePlayback: (e) ->
|
||||
Backbone.Mediator.publish 'level:set-letterbox', on: false
|
||||
Backbone.Mediator.publish 'playback:real-time-playback-ended', {}
|
||||
|
||||
onSetDebug: (e) ->
|
||||
|
|
Loading…
Reference in a new issue