From 1195b085e31c44bc8fec6817d64063de9022eb66 Mon Sep 17 00:00:00 2001
From: Leonardo Bishop <me@leonardobishop.com>
Date: Thu, 15 Feb 2024 23:04:33 +0000
Subject: Partially add itemstack support

---
 src/components/Editor/Quest/Task/TaskConfigurationRow.vue | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

(limited to 'src/components/Editor/Quest/Task/TaskConfigurationRow.vue')

diff --git a/src/components/Editor/Quest/Task/TaskConfigurationRow.vue b/src/components/Editor/Quest/Task/TaskConfigurationRow.vue
index d77e450..f68ce97 100644
--- a/src/components/Editor/Quest/Task/TaskConfigurationRow.vue
+++ b/src/components/Editor/Quest/Task/TaskConfigurationRow.vue
@@ -2,7 +2,8 @@
 import { useSessionStore } from '@/stores/session';
 import { computed, ref, toRefs, watch } from 'vue';
 import TrueFalseSwitch from '@/components/Control/TrueFalseSwitch.vue';
-import materials from '@/data/materials.json';
+import ItemStackPicker from '@/components/Control/ItemStackPicker.vue';
+import materials from '@/lib/materials';
 
 const props = defineProps({
   taskType: {
@@ -33,7 +34,9 @@ const currentValue = ref(props.initialValue ||
     ? false
     : (props.type === 'material-list' || props.type === 'string-list'
       ? []
-      : ''
+      : props.type === 'itemstack'
+        ? null
+        : ''
     )));
 
 if (props.initialValue !== currentValue.value) {
@@ -81,6 +84,9 @@ const addValue = (searchQuery: any) => {
         <!-- Data type 'string-list' -->
         <multiselect v-else-if="props.type === 'string-list'" v-model="currentValue" :options="[]" @tag="addValue"
           :multiple="true" :taggable="true" :searchable="true" placeholder="Enter string" />
+        
+        <!-- Data type 'itemstack' -->
+        <ItemStackPicker v-else-if="props.type === 'itemstack'" :value="currentValue" @update="updateValue" />
 
         <div v-if="showDescription || error" id="task-configuration-row-info">
           <p v-if="error" class="error">A value is required.</p>
-- 
cgit v1.2.3-70-g09d2

