diff --git a/app/assets/javascripts/workers/worker_world.js b/app/assets/javascripts/workers/worker_world.js index f5d91cf18..7547c282a 100644 --- a/app/assets/javascripts/workers/worker_world.js +++ b/app/assets/javascripts/workers/worker_world.js @@ -188,10 +188,17 @@ self.retrieveValueFromFrame = function retrieveValueFromFrame(args) { { try { - var flowStates = self.debugWorld.userCodeMap[currentThangID][currentSpellID].flow.states; - //we have to go to the second last flowState as we run the world for one additional frame - //to collect the flow - value = _.last(flowStates[flowStates.length - 1].statements).variables[prop]; + if (Aether.globals[prop]) + { + value = Aether.globals[prop]; + } + else + { + var flowStates = self.debugWorld.userCodeMap[currentThangID][currentSpellID].flow.states; + //we have to go to the second last flowState as we run the world for one additional frame + //to collect the flow + value = _.last(flowStates[flowStates.length - 1].statements).variables[prop]; + } } catch (e) { diff --git a/app/views/play/level/tome/spell_debug_view.coffee b/app/views/play/level/tome/spell_debug_view.coffee index a8a03cbd7..f0505b513 100644 --- a/app/views/play/level/tome/spell_debug_view.coffee +++ b/app/views/play/level/tome/spell_debug_view.coffee @@ -150,6 +150,8 @@ module.exports = class DebugView extends View if @variableChain if @variableChain.length is 2 and @variableChain[0] is "this" @setTooltipKeyAndValue(@variableChain.join("."),@stringifyValue(@thang[@variableChain[1]],0)) + else if @variableChain.length is 1 and Aether.globals[@variableChain[0]] + @setTooltipKeyAndValue(@variableChain.join("."),@stringifyValue(Aether.globals[@variableChain[0]],0)) else if @workerIsSimulating @setTooltipText("World is simulating, please wait...") else if @currentFrame is @lastFrameRequested and (cacheValue = @retrieveValueFromCache(@thang.id, @spell.name, @variableChain, @currentFrame))