mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-27 09:35:39 -05:00
Disable hover debugger when spell changed
This commit is contained in:
parent
5c72ccdce1
commit
38d732d8bc
2 changed files with 10 additions and 3 deletions
|
@ -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")
|
||||
|
|
|
@ -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))
|
||||
|
|
Loading…
Reference in a new issue