Restarting level now doesn't clear anything except code unless you hold down shift.
This commit is contained in:
parent
6755c90f02
commit
f310719cee
3 changed files with 9 additions and 3 deletions
app
|
@ -35,7 +35,7 @@ module.exports =
|
||||||
|
|
||||||
'tome:toggle-spell-list': c.object {title: 'Toggle Spell List', description: 'Published when you toggle the dropdown for a thang\'s spells'}
|
'tome:toggle-spell-list': c.object {title: 'Toggle Spell List', description: 'Published when you toggle the dropdown for a thang\'s spells'}
|
||||||
|
|
||||||
'tome:reload-code': c.object {title: 'Reload Code', description: 'Published when you reset a spell to its original source', required: ['spell']},
|
'tome:reload-code': c.object {title: 'Reload Code', description: 'Published when you reset a spell to its original source', required: []},
|
||||||
spell: {type: 'object'}
|
spell: {type: 'object'}
|
||||||
|
|
||||||
'tome:palette-cleared': c.object {title: 'Palette Cleared', description: 'Published when the spell palette is about to be cleared and recreated.'},
|
'tome:palette-cleared': c.object {title: 'Palette Cleared', description: 'Published when the spell palette is about to be cleared and recreated.'},
|
||||||
|
|
|
@ -6,4 +6,10 @@ module.exports = class ReloadLevelModal extends ModalView
|
||||||
template: template
|
template: template
|
||||||
|
|
||||||
events:
|
events:
|
||||||
'click #restart-level-confirm-button': -> Backbone.Mediator.publish 'level:restart', {}
|
'click #restart-level-confirm-button': 'onClickRestart'
|
||||||
|
|
||||||
|
onClickRestart: (e) ->
|
||||||
|
if key.shift
|
||||||
|
Backbone.Mediator.publish 'level:restart', {}
|
||||||
|
else
|
||||||
|
Backbone.Mediator.publish 'tome:reload-code', {}
|
||||||
|
|
|
@ -394,7 +394,7 @@ module.exports = class SpellView extends CocoView
|
||||||
@focus() if cast
|
@focus() if cast
|
||||||
|
|
||||||
onCodeReload: (e) ->
|
onCodeReload: (e) ->
|
||||||
return unless e.spell is @spell
|
return unless e.spell is @spell or not e.spell
|
||||||
@reloadCode true
|
@reloadCode true
|
||||||
@ace.clearSelection()
|
@ace.clearSelection()
|
||||||
_.delay (=> @ace?.clearSelection()), 500 # Make double sure this gets done (saw some timing issues?)
|
_.delay (=> @ace?.clearSelection()), 500 # Make double sure this gets done (saw some timing issues?)
|
||||||
|
|
Reference in a new issue