mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-28 10:06:08 -05:00
fixed issue of multiple insertions due to multiple event handlers
This commit is contained in:
parent
c01d29907d
commit
5c97fea363
1 changed files with 6 additions and 1 deletions
|
@ -117,7 +117,8 @@ module.exports = Surface = class Surface extends CocoClass
|
||||||
@updateState true if @loaded
|
@updateState true if @loaded
|
||||||
# TODO: synchronize both ways of choosing whether to show coords (@world via UI System or @options via World Select modal)
|
# TODO: synchronize both ways of choosing whether to show coords (@world via UI System or @options via World Select modal)
|
||||||
if @world.showCoordinates and @options.coords
|
if @world.showCoordinates and @options.coords
|
||||||
@surfaceTextLayer.addChild new CoordinateDisplay camera: @camera
|
@coordinateDisplay = new CoordinateDisplay camera: @camera
|
||||||
|
@surfaceTextLayer.addChild @coordinateDisplay
|
||||||
@onFrameChanged()
|
@onFrameChanged()
|
||||||
Backbone.Mediator.publish 'surface:world-set-up'
|
Backbone.Mediator.publish 'surface:world-set-up'
|
||||||
|
|
||||||
|
@ -320,6 +321,10 @@ module.exports = Surface = class Surface extends CocoClass
|
||||||
@wasPlayingWhenCastingBegan = @playing
|
@wasPlayingWhenCastingBegan = @playing
|
||||||
Backbone.Mediator.publish 'level-set-playing', { playing: false }
|
Backbone.Mediator.publish 'level-set-playing', { playing: false }
|
||||||
|
|
||||||
|
if @coordinateDisplay?
|
||||||
|
@surfaceTextLayer.removeChild @coordinateDisplay
|
||||||
|
@coordinateDisplay.destroy()
|
||||||
|
|
||||||
createjs.Tween.removeTweens(@surfaceLayer)
|
createjs.Tween.removeTweens(@surfaceLayer)
|
||||||
createjs.Tween.get(@surfaceLayer).to({alpha:0.9}, 1000, createjs.Ease.getPowOut(4.0))
|
createjs.Tween.get(@surfaceLayer).to({alpha:0.9}, 1000, createjs.Ease.getPowOut(4.0))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue