Impossible to select another slot and hide the available item the arrow is requiring you to equip.

This commit is contained in:
Nick Winter 2014-11-05 14:17:11 -08:00
parent 2e3755d2b9
commit 184e4c124a

View file

@ -166,6 +166,7 @@ module.exports = class InventoryView extends CocoView
@onSelectionChanged()
onItemSlotClick: (e) ->
return if @remainingRequiredEquipment?.length # Don't let them select a slot if we need them to first equip some require gear.
slot = $(e.target).closest('.item-slot')
wasActive = slot.hasClass('selected')
@unselectAllSlots()
@ -237,7 +238,9 @@ module.exports = class InventoryView extends CocoView
if itemID is itemIDToUnequip
unequipped = $(el).removeClass('equipped')
break
@requireLevelEquipment() if unequipped
if unequipped
@clearSelection()
@requireLevelEquipment()
return unequipped
equipSelectedItemToSlot: (slot) ->