Merge branch 'master' into production

This commit is contained in:
Nick Winter 2014-05-20 12:32:47 -07:00
commit 161c81772c
3 changed files with 11 additions and 2 deletions

View file

@ -758,7 +758,7 @@ module.exports = CocoSprite = class CocoSprite extends CocoClass
endFunc = => endFunc = =>
@lastTween = null @lastTween = null
@imageObject.gotoAndPlay(endAnimation) @imageObject.gotoAndPlay(endAnimation) unless @stillLoading
@shadow.action = 'idle' @shadow.action = 'idle'
@update true @update true
@possessed = false @possessed = false

View file

@ -281,6 +281,7 @@ module.exports = Surface = class Surface extends CocoClass
onSetPlaying: (e) -> onSetPlaying: (e) ->
@playing = (e ? {}).playing ? true @playing = (e ? {}).playing ? true
@setPlayingCalled = true
if @playing and @currentFrame >= (@world.totalFrames - 5) if @playing and @currentFrame >= (@world.totalFrames - 5)
@currentFrame = 0 @currentFrame = 0
if @fastForwarding and not @playing if @fastForwarding and not @playing
@ -352,6 +353,7 @@ module.exports = Surface = class Surface extends CocoClass
@casting = true @casting = true
@wasPlayingWhenCastingBegan = @playing @wasPlayingWhenCastingBegan = @playing
Backbone.Mediator.publish 'level-set-playing', { playing: false } Backbone.Mediator.publish 'level-set-playing', { playing: false }
@setPlayingCalled = false # don't overwrite playing settings if they changed by, say, scripts
if @coordinateDisplay? if @coordinateDisplay?
@surfaceTextLayer.removeChild @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 # 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. # 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 fastForwardTo = null
if @playing if @playing

View file

@ -47,6 +47,13 @@ module.exports = class WizardSprite extends IndieSprite
thang.pos.z += thang.bobHeight thang.pos.z += thang.bobHeight
thang thang
finishSetup: ->
@updateBaseScale()
@scaleFactor = @thang.scaleFactor if @thang?.scaleFactor
@updateScale()
@updateRotation()
# Don't call general update() because Thang isn't built yet
onPlayerStatesChanged: (e) -> onPlayerStatesChanged: (e) ->
for playerID, state of e.states for playerID, state of e.states
continue unless playerID is @thang.id continue unless playerID is @thang.id