Sorting items by tier instead of gems so that the unlock order will be consistent, and so that we can show the Ring of Speed early despite its high price.

This commit is contained in:
Nick Winter 2014-11-26 09:22:30 -08:00
parent 2c0bf2fef1
commit c701ca9eb0
2 changed files with 2 additions and 2 deletions
app/views

View file

@ -72,7 +72,7 @@ module.exports = class InventoryModal extends ModalView
@itemGroups.availableItems = new Backbone.Collection()
@itemGroups.restrictedItems = new Backbone.Collection()
@itemGroups.lockedItems = new Backbone.Collection()
itemGroup.comparator = ((m) -> m.get('gems') ? m.get('tier')) for itemGroup in _.values @itemGroups
itemGroup.comparator = ((m) -> m.get('tier') ? m.get('gems')) for itemGroup in _.values @itemGroups
equipped = _.values(@equipment)
@sortItem(item, equipped) for item in @items.models

View file

@ -87,7 +87,7 @@ module.exports = class PlayItemsModal extends ModalView
category = slotToCategory[model.getAllowedSlots()[0]] or 'misc'
@itemCategoryCollections[category] ?= new Backbone.Collection()
collection = @itemCategoryCollections[category]
collection.comparator = (m) -> m.get('gems') ? m.get('tier')
collection.comparator = (m) -> m.get('tier') ? m.get('gems')
collection.add(model)
model.name = utils.i18n model.attributes, 'name'
model.affordable = cost <= gemsOwned