![Tile]()
@@ -76,22 +70,17 @@ const filteredTiles = computed(() => {
if (!searchQuery.value) {
return assetManagerStore.tileList
}
- return assetManagerStore.tileList.filter((tile) =>
- tile.name.toLowerCase().includes(searchQuery.value.toLowerCase())
- )
+ return assetManagerStore.tileList.filter((tile) => tile.name.toLowerCase().includes(searchQuery.value.toLowerCase()))
})
-const { list, containerProps, wrapperProps, scrollTo } = useVirtualList(
- filteredTiles,
- {
- itemHeight: 48,
- },
-)
+const { list, containerProps, wrapperProps, scrollTo } = useVirtualList(filteredTiles, {
+ itemHeight: 48
+})
const virtualList = ref({ scrollTo })
const onScroll = () => {
- let scrollTop = elementToScroll.value.style.marginTop.replace('px', '');
+ let scrollTop = elementToScroll.value.style.marginTop.replace('px', '')
if (scrollTop > 80) {
hasScrolled.value = true
@@ -109,4 +98,4 @@ onMounted(() => {
assetManagerStore.setTileList(response)
})
})
-
\ No newline at end of file
+
diff --git a/src/components/utilities/zoneEditor/Objects.vue b/src/components/utilities/zoneEditor/Objects.vue
index 237aec0..e2d82b5 100644
--- a/src/components/utilities/zoneEditor/Objects.vue
+++ b/src/components/utilities/zoneEditor/Objects.vue
@@ -19,13 +19,7 @@
-
@@ -70,21 +64,21 @@ watch(objectDepth, (depth) => {
})
const uniqueTags = computed(() => {
- const allTags = zoneEditorStore.objectList.flatMap(obj => obj.tags || [])
+ const allTags = zoneEditorStore.objectList.flatMap((obj) => obj.tags || [])
return Array.from(new Set(allTags))
})
const filteredObjects = computed(() => {
return zoneEditorStore.objectList.filter((object) => {
- const matchesSearch = !searchQuery.value || object.name.toLowerCase().includes(searchQuery.value.toLowerCase());
- const matchesTags = selectedTags.value.length === 0 || (object.tags && selectedTags.value.some(tag => object.tags.includes(tag)));
- return matchesSearch && matchesTags;
+ const matchesSearch = !searchQuery.value || object.name.toLowerCase().includes(searchQuery.value.toLowerCase())
+ const matchesTags = selectedTags.value.length === 0 || (object.tags && selectedTags.value.some((tag) => object.tags.includes(tag)))
+ return matchesSearch && matchesTags
})
-});
+})
const toggleTag = (tag: string) => {
if (selectedTags.value.includes(tag)) {
- selectedTags.value = selectedTags.value.filter(t => t !== tag)
+ selectedTags.value = selectedTags.value.filter((t) => t !== tag)
} else {
selectedTags.value.push(tag)
}
@@ -98,4 +92,4 @@ onMounted(async () => {
zoneEditorStore.setObjectList(response)
})
})
-
\ No newline at end of file
+
diff --git a/src/components/utilities/zoneEditor/SelectedZoneObject.vue b/src/components/utilities/zoneEditor/SelectedZoneObject.vue
index 3c8a3af..9b3d3c4 100644
--- a/src/components/utilities/zoneEditor/SelectedZoneObject.vue
+++ b/src/components/utilities/zoneEditor/SelectedZoneObject.vue
@@ -3,41 +3,13 @@
@@ -53,9 +25,12 @@ const objectDepth = ref(zoneEditorStore.objectDepth)
const isObjectSelected = computed(() => !!zoneEditorStore.selectedZoneObject)
-watch(() => zoneEditorStore.selectedZoneObject, (selectedZoneObject) => {
- objectDepth.value = selectedZoneObject?.depth ?? 0
-})
+watch(
+ () => zoneEditorStore.selectedZoneObject,
+ (selectedZoneObject) => {
+ objectDepth.value = selectedZoneObject?.depth ?? 0
+ }
+)
const handleDepthInput = () => {
const depth = parseFloat(objectDepth.value)
@@ -72,4 +47,4 @@ const handleDelete = () => {
emit('delete', zoneEditorStore.selectedZoneObject?.id)
zoneEditorStore.setSelectedZoneObject(null)
}
-
\ No newline at end of file
+
diff --git a/src/components/utilities/zoneEditor/Tiles.vue b/src/components/utilities/zoneEditor/Tiles.vue
index 80a4105..7eb0311 100644
--- a/src/components/utilities/zoneEditor/Tiles.vue
+++ b/src/components/utilities/zoneEditor/Tiles.vue
@@ -15,13 +15,7 @@
-
+
{{ tag }}
@@ -64,29 +58,26 @@ const searchQuery = ref('')
const selectedTags = ref
([])
const uniqueTags = computed(() => {
- const allTags = zoneEditorStore.tileList.flatMap(tile => tile.tags || [])
+ const allTags = zoneEditorStore.tileList.flatMap((tile) => tile.tags || [])
return Array.from(new Set(allTags))
})
const filteredTiles = computed(() => {
return zoneEditorStore.tileList.filter((tile) => {
- const matchesSearch = !searchQuery.value || tile.name.toLowerCase().includes(searchQuery.value.toLowerCase());
- const matchesTags = selectedTags.value.length === 0 || (tile.tags && selectedTags.value.some(tag => tile.tags.includes(tag)));
- return matchesSearch && matchesTags;
+ const matchesSearch = !searchQuery.value || tile.name.toLowerCase().includes(searchQuery.value.toLowerCase())
+ const matchesTags = selectedTags.value.length === 0 || (tile.tags && selectedTags.value.some((tag) => tile.tags.includes(tag)))
+ return matchesSearch && matchesTags
})
-});
+})
-const { list, containerProps, wrapperProps, scrollTo } = useVirtualList(
- filteredTiles,
- {
- itemHeight: 40,
- itemWidth: 72,
- },
-)
+const { list, containerProps, wrapperProps, scrollTo } = useVirtualList(filteredTiles, {
+ itemHeight: 40,
+ itemWidth: 72
+})
const toggleTag = (tag: string) => {
if (selectedTags.value.includes(tag)) {
- selectedTags.value = selectedTags.value.filter(t => t !== tag)
+ selectedTags.value = selectedTags.value.filter((t) => t !== tag)
} else {
selectedTags.value.push(tag)
}
@@ -98,4 +89,4 @@ onMounted(async () => {
zoneEditorStore.setTileList(response)
})
})
-
\ No newline at end of file
+
diff --git a/src/screens/Game.vue b/src/screens/Game.vue
index e5b88ee..06aa84c 100644
--- a/src/screens/Game.vue
+++ b/src/screens/Game.vue
@@ -4,7 +4,7 @@
-
+
@@ -21,7 +21,7 @@
-
+
diff --git a/src/types.ts b/src/types.ts
index 5a2e2f8..45dc508 100644
--- a/src/types.ts
+++ b/src/types.ts
@@ -11,17 +11,17 @@ export type Asset = {
}
export type Sprite = {
- id: string;
- name: string;
- origin_x: number;
- origin_y: number;
- frameSpeed: number;
- isAnimated: boolean;
- isLooping: boolean;
- isPlayableCharacter: boolean;
- isEnemy: boolean;
- createdAt: Date;
- updatedAt: Date;
+ id: string
+ name: string
+ origin_x: number
+ origin_y: number
+ frameSpeed: number
+ isAnimated: boolean
+ isLooping: boolean
+ isPlayableCharacter: boolean
+ isEnemy: boolean
+ createdAt: Date
+ updatedAt: Date
}
export type Tile = {