mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-07 10:34:46 -04:00
Fixed frame-related bug
This commit is contained in:
parent
f05af0fbe7
commit
1bbd4e6c68
2 changed files with 7 additions and 3 deletions
app
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue