diff --git a/app/lib/surface/PlaybackOverScreen.coffee b/app/lib/surface/PlaybackOverScreen.coffee index b92691795..dba87def5 100644 --- a/app/lib/surface/PlaybackOverScreen.coffee +++ b/app/lib/surface/PlaybackOverScreen.coffee @@ -1,6 +1,6 @@ CocoClass = require 'lib/CocoClass' -module.exports = class PlaybackoverScreen extends CocoClass +module.exports = class PlaybackOverScreen extends CocoClass constructor: (options) -> super() options ?= {} @@ -10,7 +10,7 @@ module.exports = class PlaybackoverScreen extends CocoClass console.error @toString(), "needs a layer." unless @layer @build() - toString: -> "<PlaybackoverScreen>" + toString: -> "<PlaybackOverScreen>" build: -> @dimLayer = new createjs.Container() @@ -23,18 +23,16 @@ module.exports = class PlaybackoverScreen extends CocoClass @layer.addChild @dimLayer show: -> - console.log 'show playback over screen', @showing return if @showing @showing = true - + @dimLayer.alpha = 0 createjs.Tween.removeTweens @dimLayer createjs.Tween.get(@dimLayer).to({alpha:1}, 500) hide: -> - console.log 'hide playback over screen', @showing return unless @showing @showing = false - + createjs.Tween.removeTweens @dimLayer createjs.Tween.get(@dimLayer).to({alpha:0}, 500) diff --git a/app/lib/surface/SpriteBoss.coffee b/app/lib/surface/SpriteBoss.coffee index fa43720cc..f2c18434c 100644 --- a/app/lib/surface/SpriteBoss.coffee +++ b/app/lib/surface/SpriteBoss.coffee @@ -151,8 +151,10 @@ module.exports = class SpriteBoss extends CocoClass removeSprite: (sprite) -> sprite.displayObject.parent.removeChild sprite.displayObject + thang = sprite.thang delete @sprites[sprite.thang.id] sprite.destroy() + sprite.thang = thang # Keep around so that we know which thang the destroyed thang was for updateSounds: -> sprite.playSounds() for thangID, sprite of @sprites # hmm; doesn't work for sprites which we didn't add yet in adjustSpriteExistence @@ -186,7 +188,6 @@ module.exports = class SpriteBoss extends CocoClass # mainly for handling selecting thangs from session when the thang is not always in existence if @willSelectThang and @sprites[@willSelectThang[0]] @selectThang @willSelectThang... - @willSelectThang = null cache: (update=false) -> return if @cached and not update @@ -273,6 +274,8 @@ module.exports = class SpriteBoss extends CocoClass originalEvent: e worldPos: worldPos + @willSelectThang = null if sprite # Now that we've done a real selection, don't reselect some other Thang later. + if alive and not @suppressSelectionSounds instance = sprite.playSound 'selected' if instance?.playState is 'playSucceeded' @@ -280,12 +283,15 @@ module.exports = class SpriteBoss extends CocoClass instance.addEventListener 'complete', -> Backbone.Mediator.publish 'thang-finished-talking', thang: sprite?.thang + # Marks updateSelection: -> if @selectedSprite?.thang and (not @selectedSprite.thang.exists or not @world.getThangByID @selectedSprite.thang.id) - @selectSprite null, null, null + thangID = @selectedSprite.thang.id + @selectedSprite = null # Don't actually trigger deselection, but remove the selected sprite. @selectionMark?.toggle false + @willSelectThang = [thangID, null] @updateTarget() return unless @selectionMark @selectedSprite = null unless @selectedSprite?.thang diff --git a/app/styles/play/level/hud.sass b/app/styles/play/level/hud.sass index c83b20933..b508a3158 100644 --- a/app/styles/play/level/hud.sass +++ b/app/styles/play/level/hud.sass @@ -95,6 +95,9 @@ height: 100px @include user-select(text) + &.nonexistent + visibility: hidden + .text-prop width: 50% diff --git a/app/views/play/level/hud_view.coffee b/app/views/play/level/hud_view.coffee index 324c5e68b..ed3403925 100644 --- a/app/views/play/level/hud_view.coffee +++ b/app/views/play/level/hud_view.coffee @@ -238,8 +238,9 @@ module.exports = class HUDView extends View update: -> return unless @thang and not @speaker - # Update properties - @updatePropElement(prop, @thang[prop]) for prop in @thang.hudProperties ? [] + @$el.find('.thang-props-column').toggleClass 'nonexistent', not @thang.exists + if @thang.exists + @updatePropElement(prop, @thang[prop]) for prop in @thang.hudProperties ? [] # Update action timeline @updateActions() @@ -305,7 +306,7 @@ module.exports = class HUDView extends View for actionName, action of @thang.actions @updateActionElement(actionName, @timespans[actionName], @thang.action is actionName) tableContainer = @$el.find('.table-container') - timelineWidth = tableContainer.find('.action-timeline').width() + timelineWidth = tableContainer.find('tr:not(.secret) .action-timeline').width() right = (1 - (@timeProgress ? 0)) * timelineWidth arrow = tableContainer.find('.progress-arrow') arrow.css 'right', right - arrow.width() / 2 diff --git a/app/views/play/level/tome/spell_view.coffee b/app/views/play/level/tome/spell_view.coffee index e8de8e198..e5b03b45f 100644 --- a/app/views/play/level/tome/spell_view.coffee +++ b/app/views/play/level/tome/spell_view.coffee @@ -419,7 +419,7 @@ module.exports = class SpellView extends View @ace.clearSelection() onFrameChanged: (e) -> - return unless e.selectedThang?.id is @thang?.id + return unless @spellThang and e.selectedThang?.id is @spellThang?.thang.id @thang = e.selectedThang # update our thang to the current version @highlightCurrentLine()