mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-26 22:13:32 -04:00
Add support for Aether globals in hover debugger
This commit is contained in:
parent
9df34875ee
commit
5c72ccdce1
2 changed files with 13 additions and 4 deletions
app
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue