From 2b56dffcb07b875f211ccc535344bdfd058b0d59 Mon Sep 17 00:00:00 2001 From: Scott Erickson Date: Tue, 20 May 2014 12:21:43 -0700 Subject: [PATCH 1/3] Fixed a bug where sometimes scripts setting playback would be overridden by the surface resetting playback after casting is done. --- app/lib/surface/Surface.coffee | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/lib/surface/Surface.coffee b/app/lib/surface/Surface.coffee index b82683ea3..14e3cf15e 100644 --- a/app/lib/surface/Surface.coffee +++ b/app/lib/surface/Surface.coffee @@ -281,6 +281,7 @@ module.exports = Surface = class Surface extends CocoClass onSetPlaying: (e) -> @playing = (e ? {}).playing ? true + @setPlayingCalled = true if @playing and @currentFrame >= (@world.totalFrames - 5) @currentFrame = 0 if @fastForwarding and not @playing @@ -352,6 +353,7 @@ module.exports = Surface = class Surface extends CocoClass @casting = true @wasPlayingWhenCastingBegan = @playing Backbone.Mediator.publish 'level-set-playing', { playing: false } + @setPlayingCalled = false # don't overwrite playing settings if they changed by, say, scripts if @coordinateDisplay? @surfaceTextLayer.removeChild @coordinateDisplay @@ -370,7 +372,7 @@ module.exports = Surface = class Surface extends CocoClass # This has a tendency to break scripts that are waiting for playback to change when the level is loaded # so only run it after the first world is created. - Backbone.Mediator.publish 'level-set-playing', { playing: @wasPlayingWhenCastingBegan } unless event.firstWorld + Backbone.Mediator.publish 'level-set-playing', { playing: @wasPlayingWhenCastingBegan } unless event.firstWorld or @setPlayingCalled fastForwardTo = null if @playing From 86736d8f4afbf555ec2f862bb8a9ce0938083826 Mon Sep 17 00:00:00 2001 From: Scott Erickson Date: Tue, 20 May 2014 12:22:24 -0700 Subject: [PATCH 2/3] Fixed a bug. --- app/lib/surface/CocoSprite.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/lib/surface/CocoSprite.coffee b/app/lib/surface/CocoSprite.coffee index cd63513c5..75c99088f 100644 --- a/app/lib/surface/CocoSprite.coffee +++ b/app/lib/surface/CocoSprite.coffee @@ -758,7 +758,7 @@ module.exports = CocoSprite = class CocoSprite extends CocoClass endFunc = => @lastTween = null - @imageObject.gotoAndPlay(endAnimation) + @imageObject.gotoAndPlay(endAnimation) unless @stillLoading @shadow.action = 'idle' @update true @possessed = false From 88a5685c37dbd607463c7f24de8fb6130d82af9d Mon Sep 17 00:00:00 2001 From: Nick Winter Date: Tue, 20 May 2014 12:32:26 -0700 Subject: [PATCH 3/3] Fix for WizardSprite scale thing. --- app/lib/surface/WizardSprite.coffee | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/lib/surface/WizardSprite.coffee b/app/lib/surface/WizardSprite.coffee index 3fa6de119..b502cce4c 100644 --- a/app/lib/surface/WizardSprite.coffee +++ b/app/lib/surface/WizardSprite.coffee @@ -47,6 +47,13 @@ module.exports = class WizardSprite extends IndieSprite thang.pos.z += thang.bobHeight thang + finishSetup: -> + @updateBaseScale() + @scaleFactor = @thang.scaleFactor if @thang?.scaleFactor + @updateScale() + @updateRotation() + # Don't call general update() because Thang isn't built yet + onPlayerStatesChanged: (e) -> for playerID, state of e.states continue unless playerID is @thang.id