Don't start drawing Surface until needed.

This commit is contained in:
Nick Winter 2014-05-03 09:13:26 -07:00
parent db9a82d58a
commit 73222a1a98

View file

@ -185,10 +185,6 @@ module.exports = class PlayLevelView extends View
@levelLoader = null
@initSurface()
@initScriptManager()
@surface.showLevel()
if @otherSession
# TODO: colorize name and cloud by team, colorize wizard by user's color config
@surface.createOpponentWizard id: @otherSession.get('creator'), name: @otherSession.get('creatorName'), team: @otherSession.get('team')
grabLevelLoaderData: ->
@session = @levelLoader.session
@ -215,6 +211,10 @@ module.exports = class PlayLevelView extends View
@session.set 'multiplayer', false
onLevelStarted: (e) ->
@surface.showLevel()
if @otherSession
# TODO: colorize name and cloud by team, colorize wizard by user's color config
@surface.createOpponentWizard id: @otherSession.get('creator'), name: @otherSession.get('creatorName'), team: @otherSession.get('team')
@loadingView?.unveil()
onLoadingViewUnveiled: (e) ->