     e.stopPropagation()
     button = $(e.target).closest('button')
     item = @idToItem[button.data('item-id')]
-    affordable = item.affordable
+    gemsOwned = me.gems()
+    cost = item.get('gems') ? 0
+    affordable = cost <= gemsOwned
     if not affordable
       @playSound 'menu-button-click'
       @askToBuyGems button unless features.freeOnly

    'click .buy-gems-prompt-button': 'onBuyGemsPromptButtonClicked'
    'click #close-modal': 'hide'
    'click': 'onClickedSomewhere'
    'update .tab-pane .nano': 'onScrollItemPane'
    'click #hero-type-select label': 'onClickHeroTypeSelect'

  constructor: (options) ->
    @onScrollItemPane = _.throttle(_.bind(@onScrollItemPane, @), 200)
    super options
    @items = new Backbone.Collection()
    @itemCategoryCollections = {}

    if Level.levels['defense-of-plainswood'] not in earnedLevels
      @$el.find('#misc-tab').hide()
      @$el.find('#hero-type-select #warrior').click()  # Start on warrior tab, if low level.
    @showVisibleItemImages()

  onHidden: ->
    super()
