Hid the misc tab until you have unlocked defense of plainswood, and by extension, the forest.

This commit is contained in:
Scott Erickson 2015-01-13 15:34:06 -08:00
parent 81569a5501
commit afe590c5cc
2 changed files with 5 additions and 1 deletions
app
templates/play/modal
views/play/modal

View file

@ -13,7 +13,7 @@
ul.nav.nav-pills.nav-stacked
for category, index in itemCategories
li(class=index ? "" : "active")
li(class=index ? "" : "active", id=category + '-tab')
a.one-line(href="#item-category-" + category, data-toggle="tab")
img.tab-icon(src="/images/pages/play/modal/item-icon-"+category+".png", draggable="false")
span.big-font= itemCategoryNames[index]

View file

@ -7,6 +7,7 @@ BuyGemsModal = require 'views/play/modal/BuyGemsModal'
CocoCollection = require 'collections/CocoCollection'
ThangType = require 'models/ThangType'
LevelComponent = require 'models/LevelComponent'
Level = require 'models/Level'
Purchase = require 'models/Purchase'
utils = require 'core/utils'
@ -120,6 +121,9 @@ module.exports = class PlayItemsModal extends ModalView
@itemDetailsView = new ItemDetailsView()
@insertSubView(@itemDetailsView)
@$el.find("a[href='#item-category-armor']").click() # Start on armor tab, if it's there.
earnedLevels = me.get('earned')?.levels or []
if Level.levels['defense-of-plainswood'] not in earnedLevels
@$el.find('#misc-tab').hide()
onHidden: ->
super()