|
|
@ -80,13 +80,15 @@ |
|
|
|
Takes <span class="number-marker">{{ selectedItem.cropData.timeToGrow }}</span> minutes to grow. |
|
|
|
Takes <span class="number-marker">{{ selectedItem.cropData.timeToGrow }}</span> minutes to grow. |
|
|
|
<hr> |
|
|
|
<hr> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="col-12" v-if="selectedItem.cropData"> |
|
|
|
<div class="col-12 trash-section"> |
|
|
|
<div class="float-end"> |
|
|
|
<div class="row"> |
|
|
|
<img :src="selectedSeedFieldProductIcon" alt=""> |
|
|
|
<div class="col-8"> |
|
|
|
|
|
|
|
<input type="number" class="trash-quantity-input pixel-border-red" v-model="trashQuantity"> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="col-4"> |
|
|
|
|
|
|
|
<div class="btn btn-sm btn-pixel-danger col-4" v-on:click="trashItems()" data-bs-dismiss="modal">Trash</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<small class="text-muted">Seed info</small><br/> |
|
|
|
|
|
|
|
Sells for <span class="number-marker">{{ selectedItem.economy.sell }}$</span> when harvested.<br/> |
|
|
|
|
|
|
|
Takes <span class="number-marker">{{ selectedItem.cropData.timeToGrow }}</span> minutes to grow. |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -107,12 +109,14 @@ |
|
|
|
import {ItemTypeFrameClasses, ItemTypes} from "@/data/ItemTypes"; |
|
|
|
import {ItemTypeFrameClasses, ItemTypes} from "@/data/ItemTypes"; |
|
|
|
import {openModal} from "@/helpers"; |
|
|
|
import {openModal} from "@/helpers"; |
|
|
|
import ItemService from "@/services/ItemService"; |
|
|
|
import ItemService from "@/services/ItemService"; |
|
|
|
|
|
|
|
import iziToast from "izitoast"; |
|
|
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
export default { |
|
|
|
name: "InventoryView", |
|
|
|
name: "InventoryView", |
|
|
|
data() { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
return { |
|
|
|
selectedItem: null, |
|
|
|
selectedItem: null, |
|
|
|
|
|
|
|
trashQuantity: 0 |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
computed: { |
|
|
@ -140,6 +144,17 @@ export default { |
|
|
|
return product.icon; |
|
|
|
return product.icon; |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
watch: { |
|
|
|
|
|
|
|
trashQuantity() { |
|
|
|
|
|
|
|
if (this.trashQuantity > this.selectedItem.quantity) { |
|
|
|
|
|
|
|
this.trashQuantity = this.selectedItem.quantity; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (this.trashQuantity < 0) { |
|
|
|
|
|
|
|
this.trashQuantity = 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
getFrameClass(type) { |
|
|
|
getFrameClass(type) { |
|
|
|
return ItemTypeFrameClasses[type]; |
|
|
|
return ItemTypeFrameClasses[type]; |
|
|
@ -148,6 +163,14 @@ export default { |
|
|
|
this.selectedItem = item; |
|
|
|
this.selectedItem = item; |
|
|
|
openModal('itemInfoModal'); |
|
|
|
openModal('itemInfoModal'); |
|
|
|
console.log(item); |
|
|
|
console.log(item); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
trashItems() { |
|
|
|
|
|
|
|
this.$store.commit('removeItemFromInventory', {item: this.selectedItem, quantity: this.trashQuantity}); |
|
|
|
|
|
|
|
iziToast.success({ |
|
|
|
|
|
|
|
title: 'Threw away '+this.trashQuantity+' of '+this.selectedItem.name |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.trashQuantity = 0; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -190,4 +213,14 @@ export default { |
|
|
|
border-radius: 20px; |
|
|
|
border-radius: 20px; |
|
|
|
color: black; |
|
|
|
color: black; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.trash-quantity-input { |
|
|
|
|
|
|
|
text-align: right; |
|
|
|
|
|
|
|
max-width: 100%; |
|
|
|
|
|
|
|
height: 2.7em; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.trash-section .col-8 *, .trash-section .col-4 * { |
|
|
|
|
|
|
|
width: 100% |
|
|
|
|
|
|
|
} |
|
|
|
</style> |
|
|
|
</style> |