Add support for Aether globals in hover debugger

This commit is contained in:
Michael Schmatz 2014-05-18 11:41:42 -07:00
parent 9df34875ee
commit 5c72ccdce1
2 changed files with 13 additions and 4 deletions
app
assets/javascripts/workers
views/play/level/tome

View file

@ -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)
{

View file

@ -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))