Can now equip a second ring slot.

This commit is contained in:
Nick Winter 2014-11-30 14:12:07 -08:00
parent 9471beafd9
commit 50eed15eed

View file

@ -260,7 +260,12 @@ module.exports = class InventoryModal extends ModalView
selectedItem = @items.get(selectedItemEl.data('item-id'))
return unless selectedItem
allowedSlots = selectedItem.getAllowedSlots()
slotEl = @$el.find(".item-slot[data-slot='#{allowedSlots[0]}']")
firstSlot = unequippedSlot = null
for allowedSlot in allowedSlots
slotEl = @$el.find(".item-slot[data-slot='#{allowedSlot}']")
firstSlot ?= slotEl
unequippedSlot ?= slotEl unless slotEl.find('img').length
slotEl = unequippedSlot ? firstSlot
selectedItemEl.effect('transfer', to: slotEl, duration: 500, easing: 'easeOutCubic')
unequipped = @unequipItemFromSlot(slotEl)
selectedItemEl.addClass('equipped')