Improved inventory

This commit is contained in:
2017-10-05 09:39:37 +02:00
parent 77ae39d330
commit 09d28e146c
5 changed files with 69 additions and 15 deletions

View File

@ -1,11 +1,11 @@
component Inventory(inventory *arn.Inventory)
component Inventory(inventory *arn.Inventory, viewUser *arn.User)
ShopTabs
.inventory
.inventory(data-api="/api/inventory/" + viewUser.ID)
for index, slot := range inventory.Slots
if slot.ItemID == ""
.inventory-slot.mountable(draggable="false", data-index=index)
else
.inventory-slot.mountable(title=slot.Item().Name, draggable="true", data-index=index)
.inventory-slot.mountable(title=slot.Item().Name, draggable="true", data-index=index, data-item-id=slot.ItemID, data-consumable=slot.Item().Consumable)
Icon(slot.Item().Icon)
if slot.Quantity > 1
.inventory-slot-quantity= slot.Quantity