Merge pull request #221 from GlenDC/master

Fixed issue #160 and updated my repository
This commit is contained in:
Nick Winter 2014-01-16 13:58:14 -08:00
commit 43831c27ce

View file

@ -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.