mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-24 08:08:15 -05:00
Fixed awardable items showing up in inventory/store items list when not earnned, and showing up at the end when earned.
This commit is contained in:
parent
b6570236d8
commit
0d68ad250d
2 changed files with 3 additions and 2 deletions
|
@ -67,7 +67,7 @@ module.exports = class InventoryModal extends ModalView
|
|||
@itemGroups.availableItems = new Backbone.Collection()
|
||||
@itemGroups.restrictedItems = new Backbone.Collection()
|
||||
@itemGroups.lockedItems = new Backbone.Collection()
|
||||
itemGroup.comparator = 'gems' for itemGroup in _.values @itemGroups
|
||||
itemGroup.comparator = ((m) -> m.get('gems') ? m.get('tier')) for itemGroup in _.values @itemGroups
|
||||
|
||||
equipped = _.values(@equipment)
|
||||
@sortItem(item, equipped) for item in @items.models
|
||||
|
@ -89,6 +89,7 @@ module.exports = class InventoryModal extends ModalView
|
|||
@itemGroups.lockedItems.add(item)
|
||||
item.classes.push 'locked'
|
||||
item.classes.push 'silhouette' if item.isSilhouettedItem()
|
||||
item.classes.push 'hidden' unless item.get('gems')
|
||||
else if item.get('slug') in _.values(LevelOptions[@options.levelID]?.restrictedGear ? {})
|
||||
@itemGroups.restrictedItems.add(item)
|
||||
item.classes.push 'restricted'
|
||||
|
|
|
@ -83,7 +83,7 @@ module.exports = class PlayItemsModal extends ModalView
|
|||
category = slotToCategory[model.getAllowedSlots()[0]] or 'misc'
|
||||
@itemCategoryCollections[category] ?= new Backbone.Collection()
|
||||
collection = @itemCategoryCollections[category]
|
||||
collection.comparator = 'gems'
|
||||
collection.comparator = (m) -> m.get('gems') ? m.get('tier')
|
||||
collection.add(model)
|
||||
model.name = utils.i18n model.attributes, 'name'
|
||||
model.affordable = cost <= gemsOwned
|
||||
|
|
Loading…
Reference in a new issue