Disable hover debugger when spell changed

This commit is contained in:
Michael Schmatz 2014-05-18 11:51:31 -07:00
parent 5c72ccdce1
commit 38d732d8bc
2 changed files with 10 additions and 3 deletions

View file

@ -79,7 +79,7 @@ module.exports = class CastButtonView extends View
async.some _.values(@spells), (spell, callback) =>
spell.hasChangedSignificantly spell.getSource(), null, callback
, (castable) =>
Backbone.Mediator.publish 'tome:spell-has-changed-significantly-calculation', hasChangedSignificantly: castable
@castButtonGroup.toggleClass('castable', castable).toggleClass('casting', @casting)
if @casting
s = $.i18n.t("play_level.tome_cast_button_casting", defaultValue: "Casting")

View file

@ -17,6 +17,7 @@ module.exports = class DebugView extends View
'tome:spell-shown': 'changeCurrentThangAndSpell'
'tome:cast-spells': 'onTomeCast'
'surface:frame-changed': 'onFrameChanged'
'tome:spell-has-changed-significantly-calculation': 'onSpellChangedCalculation'
events: {}
@ -34,6 +35,8 @@ module.exports = class DebugView extends View
@cache = {}
@lastFrameRequested = -1
@workerIsSimulating = false
@spellHasChanged = false
pad2: (num) ->
@ -145,10 +148,14 @@ module.exports = class DebugView extends View
onFrameChanged: (data) ->
@currentFrame = data.frame
@frameRate = data.world.frameRate
onSpellChangedCalculation: (data) ->
@spellHasChanged = data.hasChangedSignificantly
update: ->
if @variableChain
if @variableChain.length is 2 and @variableChain[0] is "this"
if @spellHasChanged
@setTooltipText("You've changed this spell! \nPlease recast to use the hover debugger.")
else 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))