From d8863fe51ff22076e9b37ea08331e858ded797ce Mon Sep 17 00:00:00 2001 From: Dennis Postma <dennis@directonline.io> Date: Sat, 24 Aug 2024 03:14:19 +0200 Subject: [PATCH] Fixed reactivity in Inventory component --- src/components/gui/Inventory.vue | 10 +++++----- src/components/gui/partials/InventoryItems.vue | 2 +- src/components/zone/Zone.vue | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/gui/Inventory.vue b/src/components/gui/Inventory.vue index 9a24769..f5e28b7 100644 --- a/src/components/gui/Inventory.vue +++ b/src/components/gui/Inventory.vue @@ -10,7 +10,7 @@ <button @mousedown.stop class="btn-cyan py-1.5 px-4 min-w-24">Settings</button> </div> <div class="flex gap-2.5"> - <button class="w-5 h-5 m-0 p-0 relative hover:rotate-180 transition-transform duration-300 ease-in-out"> + <button class="w-5 h-5 m-0 p-0 relative hover:rotate-180 transition-transform duration-300 ease-in-out" @click="gameStore.toggleInventory"> <img alt="close" draggable="false" src="/assets/icons/close-button-white.svg" class="w-full h-full" /> </button> </div> @@ -27,19 +27,19 @@ </template> <script setup lang="ts"> -import { useGameStore } from '@/stores/game'; import { ref } from 'vue'; +import { useGameStore } from '@/stores/game'; import InventoryItems from '@/components/gui/partials/InventoryItems.vue'; const gameStore = useGameStore() -let inventory = false +let inventory = ref(true) let equipment = false let character = false let settings = false function inventoryActive() { - inventory = !inventory; - console.log(inventory); + inventory.value = !inventory.value; + console.log(inventory.value); } </script> \ No newline at end of file diff --git a/src/components/gui/partials/InventoryItems.vue b/src/components/gui/partials/InventoryItems.vue index bf3b474..5c550af 100644 --- a/src/components/gui/partials/InventoryItems.vue +++ b/src/components/gui/partials/InventoryItems.vue @@ -8,7 +8,7 @@ <div class="absolute -left-5 -bottom-5 w-[calc(100%_+_40px)] my-px h-px bg-cyan-200"></div> </div> <div class="m-5"> - <h4 class="m-auto font-medium text-lg max-w-[375px]">Quest items</h4> + <h4 class="m-auto font-medium text-lg max-w-[375px]">Chest items</h4> <div class="flex gap-3 mt-4 mx-auto flex-wrap max-w-[375px]"> <div v-for="n in 12" class="bg-gray-300/80 border-solid border-2 border-cyan-200 w-12 h-12 rounded-md aspect-square shrink-0 justify-self-stretch hover:bg-gray-200"></div> </div> diff --git a/src/components/zone/Zone.vue b/src/components/zone/Zone.vue index 749a979..03713bf 100644 --- a/src/components/zone/Zone.vue +++ b/src/components/zone/Zone.vue @@ -1,7 +1,7 @@ <template> <Tiles :key="zoneStore.zone?.id ?? 0" /> <Objects /> - <Characters /> +<!-- <Characters />--> </template> <script setup lang="ts">