Fixed frame-related bug

This commit is contained in:
Michael Schmatz 2014-05-09 15:05:50 -07:00
parent f05af0fbe7
commit 1bbd4e6c68
2 changed files with 7 additions and 3 deletions
app
lib/world
views/play/level/tome

View file

@ -77,7 +77,7 @@ module.exports = class World
console.log "Warning: loadFrames called on empty World (no thangs)."
t1 = now()
@t0 ?= t1
if frameToLoadUntil
if loadUntilFrame
frameToLoadUntil = loadUntilFrame + 1
else
frameToLoadUntil = @totalFrames

View file

@ -15,6 +15,7 @@ module.exports = class DebugView extends View
'god:new-world-created': 'onNewWorld'
'god:debug-value-return': 'handleDebugValue'
'tome:spell-shown': 'changeCurrentThangAndSpell'
'surface:frame-changed': 'onFrameChanged'
events: {}
@ -24,7 +25,6 @@ module.exports = class DebugView extends View
@thang = options.thang
@spell = options.spell
@variableStates = {}
@globals = {Math: Math, _: _, String: String, Number: Number, Array: Array, Object: Object} # ... add more as documented
for className, serializedClass of serializedClasses
@globals[className] = serializedClass
@ -93,13 +93,17 @@ module.exports = class DebugView extends View
onNewWorld: (e) ->
@thang = @options.thang = e.world.thangMap[@thang.id] if @thang
onFrameChanged: (data) ->
@currentFrame = data.frame
update: ->
if @variableChain
Backbone.Mediator.publish 'tome:spell-debug-value-request',
thangID: @thang.id
spellID: @spell.name
variableChain: @variableChain
frame: @currentFrame
@$el.find("code").text "Finding value..."
@$el.show().css(@pos)
else