mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-24 08:08:15 -05:00
Merge pull request #221 from GlenDC/master
Fixed issue #160 and updated my repository
This commit is contained in:
commit
43831c27ce
1 changed files with 9 additions and 4 deletions
|
@ -55,10 +55,15 @@ module.exports = class TomeView extends View
|
|||
afterRender: ->
|
||||
super()
|
||||
programmableThangs = _.filter @options.thangs, 'isProgrammable'
|
||||
@createSpells programmableThangs # Do before spellList, thangList, and castButton
|
||||
@spellList = @insertSubView new SpellListView spells: @spells, supermodel: @supermodel
|
||||
@thangList = @insertSubView new ThangListView spells: @spells, thangs: @options.thangs, supermodel: @supermodel
|
||||
@castButton = @insertSubView new CastButtonView spells: @spells
|
||||
|
||||
if programmableThangs.length
|
||||
@createSpells programmableThangs # Do before spellList, thangList, and castButton
|
||||
@spellList = @insertSubView new SpellListView spells: @spells, supermodel: @supermodel
|
||||
@thangList = @insertSubView new ThangListView spells: @spells, thangs: @options.thangs, supermodel: @supermodel
|
||||
@castButton = @insertSubView new CastButtonView spells: @spells
|
||||
else
|
||||
@cast()
|
||||
console.log "Warning: There are no Programmable Thangs in this level, which makes it unplayable."
|
||||
|
||||
createSpells: (programmableThangs) ->
|
||||
# If needed, we could make this able to update when programmableThangs changes.
|
||||
|
|
Loading…
Reference in a new issue