mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-30 10:56:53 -05:00
A few fixes for unequippable cross-class item state.
This commit is contained in:
parent
3ad67130c7
commit
96ff44017e
5 changed files with 16 additions and 13 deletions
|
@ -438,6 +438,9 @@ $itemSlotGridHeight: 70px
|
|||
#selected-item-unlock-button
|
||||
left: 646px
|
||||
|
||||
.unequippable
|
||||
display: none
|
||||
|
||||
|
||||
//- Equip/unequip/extra
|
||||
|
||||
|
|
|
@ -33,14 +33,12 @@
|
|||
p Only admins will see it for now.
|
||||
|
||||
if item && !item.owned
|
||||
if item.equippable
|
||||
if item.unequippable
|
||||
// Temp, while we only have Warriors: prevent them from buying non-Warrior stuff
|
||||
button.btn.big-font.disabled.unequippable #{item.get('heroClass')} Only
|
||||
else
|
||||
button#selected-item-unlock-button.btn.big-font.unlock-button(disabled=!item.affordable, data-item-id=item.id)
|
||||
span(data-i18n="play.unlock") Unlock
|
||||
span.spl= '('+item.get('gems')
|
||||
img(src="/images/common/gem.png")
|
||||
span )
|
||||
else
|
||||
// Temp, while we only have Warriors: prevent them from buying non-Warrior stuff
|
||||
button.btn.big-font.disabled.unequippable #{item.get('heroClass')} Only
|
||||
|
||||
|
|
@ -86,7 +86,9 @@ module.exports = class InventoryModal extends ModalView
|
|||
locked = not (item.get('original') in me.items())
|
||||
locked = false if me.get('slug') is 'nick'
|
||||
|
||||
if locked and item.get('slug') isnt 'simple-boots'
|
||||
if not item.getFrontFacingStats().props.length and not _.size item.getFrontFacingStats().stats # Temp: while there are placeholder items
|
||||
null # Don't put into a collection
|
||||
else if locked and item.get('slug') isnt 'simple-boots'
|
||||
@itemGroups.lockedItems.add(item)
|
||||
item.classes.push 'locked'
|
||||
item.classes.push 'silhouette' if item.isSilhouettedItem()
|
||||
|
|
|
@ -89,7 +89,7 @@ module.exports = class PlayItemsModal extends ModalView
|
|||
model.affordable = cost <= gemsOwned
|
||||
model.silhouetted = not model.owned and model.isSilhouettedItem()
|
||||
model.level = model.levelRequiredForItem() if model.get('tier')?
|
||||
model.equippable = 'Warrior' in model.getAllowedHeroClasses() # Temp: while there are no wizards/rangers
|
||||
model.unequippable = not ('Warrior' in model.getAllowedHeroClasses()) # Temp: while there are no wizards/rangers
|
||||
model.comingSoon = not model.getFrontFacingStats().props.length and not _.size model.getFrontFacingStats().stats and not model.owned # Temp: while there are placeholder items
|
||||
@idToItem[model.id] = model
|
||||
|
||||
|
|
Loading…
Reference in a new issue