mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-28 01:55:38 -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.availableItems = new Backbone.Collection()
|
||||||
@itemGroups.restrictedItems = new Backbone.Collection()
|
@itemGroups.restrictedItems = new Backbone.Collection()
|
||||||
@itemGroups.lockedItems = 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)
|
equipped = _.values(@equipment)
|
||||||
@sortItem(item, equipped) for item in @items.models
|
@sortItem(item, equipped) for item in @items.models
|
||||||
|
@ -89,6 +89,7 @@ module.exports = class InventoryModal extends ModalView
|
||||||
@itemGroups.lockedItems.add(item)
|
@itemGroups.lockedItems.add(item)
|
||||||
item.classes.push 'locked'
|
item.classes.push 'locked'
|
||||||
item.classes.push 'silhouette' if item.isSilhouettedItem()
|
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 ? {})
|
else if item.get('slug') in _.values(LevelOptions[@options.levelID]?.restrictedGear ? {})
|
||||||
@itemGroups.restrictedItems.add(item)
|
@itemGroups.restrictedItems.add(item)
|
||||||
item.classes.push 'restricted'
|
item.classes.push 'restricted'
|
||||||
|
|
|
@ -83,7 +83,7 @@ module.exports = class PlayItemsModal extends ModalView
|
||||||
category = slotToCategory[model.getAllowedSlots()[0]] or 'misc'
|
category = slotToCategory[model.getAllowedSlots()[0]] or 'misc'
|
||||||
@itemCategoryCollections[category] ?= new Backbone.Collection()
|
@itemCategoryCollections[category] ?= new Backbone.Collection()
|
||||||
collection = @itemCategoryCollections[category]
|
collection = @itemCategoryCollections[category]
|
||||||
collection.comparator = 'gems'
|
collection.comparator = (m) -> m.get('gems') ? m.get('tier')
|
||||||
collection.add(model)
|
collection.add(model)
|
||||||
model.name = utils.i18n model.attributes, 'name'
|
model.name = utils.i18n model.attributes, 'name'
|
||||||
model.affordable = cost <= gemsOwned
|
model.affordable = cost <= gemsOwned
|
||||||
|
|
Loading…
Reference in a new issue