forked from noxious/client
Feedback Shilo
the placement of map objects sometimes placed in a tile that the mouse wasnt over. but i didnt try reproducing the issue. opening map editor doesnt close the gm window (nor show the map editor). not obvious. side panels like map objects doesnt have a close button. so i was only able to close it by switching to "move" tool.
This commit is contained in:
parent
8bf67ab168
commit
bcf0d2832d
@ -1,11 +1,21 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="absolute border-0 border-l-2 border-solid border-gray-500 w-1/4 min-w-80 flex flex-col top-0 right-0 z-10 h-dvh bg-gray-800" v-if="mapEditor.tool.value === 'pencil' && mapEditor.drawMode.value === 'map_object'">
|
<div class="absolute border-0 border-l-2 border-solid border-gray-500 w-1/4 min-w-80 flex flex-col top-0 right-0 z-10 h-dvh bg-gray-800" v-if="mapEditor.tool.value === 'pencil' && mapEditor.drawMode.value === 'map_object'">
|
||||||
<div class="flex flex-col gap-2.5 p-2.5">
|
<div class="flex flex-col gap-2.5 p-2.5">
|
||||||
|
<div class="flex justify-between items-center">
|
||||||
|
<div class="flex-grow">
|
||||||
<div class="relative flex">
|
<div class="relative flex">
|
||||||
<img src="/assets/icons/mapEditor/search.svg" class="w-4 h-4 py-0.5 absolute top-1/2 -translate-y-1/2 left-2.5" alt="Search icon" />
|
<img src="/assets/icons/mapEditor/search.svg" class="w-4 h-4 py-0.5 absolute top-1/2 -translate-y-1/2 left-2.5" alt="Search icon" />
|
||||||
<label class="mb-1.5 font-titles hidden" for="search">Search</label>
|
<label class="mb-1.5 font-titles hidden" for="search">Search</label>
|
||||||
<input @mousedown.stop class="!pl-7 input-field w-full" type="text" name="search" placeholder="Search" v-model="searchQuery" />
|
<input @mousedown.stop class="!pl-7 input-field w-full" type="text" name="search" placeholder="Search" v-model="searchQuery" />
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
<img
|
||||||
|
src="/assets/icons/mapEditor/dropdown-chevron.svg"
|
||||||
|
class="w-12 h-12 ml-2 cursor-pointer hover:opacity-80 -rotate-90"
|
||||||
|
alt="Close"
|
||||||
|
@click="mapEditor.setTool('move')"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<select class="input-field w-full" name="lists" v-model="mapEditor.drawMode.value" @change="(event: any) => mapEditor.setDrawMode(event.target.value)">
|
<select class="input-field w-full" name="lists" v-model="mapEditor.drawMode.value" @change="(event: any) => mapEditor.setDrawMode(event.target.value)">
|
||||||
<option value="tile">Tiles</option>
|
<option value="tile">Tiles</option>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<Modal ref="modalRef" @modal:close="() => mapEditorStore.setTool('move')" :modal-width="300" :modal-height="350" :is-resizable="false" bg-style="none">
|
<Modal v-if="showTeleportModal" ref="modalRef" @modal:close="() => mapEditorStore.setTool('move')" :modal-width="300" :modal-height="350" :is-resizable="false" bg-style="none">
|
||||||
<template #modalHeader>
|
<template #modalHeader>
|
||||||
<h3 class="m-0 font-medium shrink-0 text-white">Teleport settings</h3>
|
<h3 class="m-0 font-medium shrink-0 text-white">Teleport settings</h3>
|
||||||
</template>
|
</template>
|
||||||
@ -39,31 +39,22 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { SocketEvent } from '@/application/enums'
|
|
||||||
import type { Map } from '@/application/types'
|
import type { Map } from '@/application/types'
|
||||||
import Modal from '@/components/utilities/Modal.vue'
|
import Modal from '@/components/utilities/Modal.vue'
|
||||||
import { useGameStore } from '@/stores/gameStore'
|
|
||||||
import { useMapEditorStore } from '@/stores/mapEditorStore'
|
import { useMapEditorStore } from '@/stores/mapEditorStore'
|
||||||
import { computed, onMounted, ref, useTemplateRef, watch } from 'vue'
|
import { computed, onMounted, ref, useTemplateRef, watch } from 'vue'
|
||||||
|
import {MapStorage} from "@/storage/storages";
|
||||||
|
|
||||||
const showTeleportModal = computed(() => mapEditorStore.tool === 'pencil' && mapEditorStore.drawMode === 'teleport')
|
const showTeleportModal = computed(() => mapEditorStore.tool === 'pencil' && mapEditorStore.drawMode === 'teleport')
|
||||||
|
const mapStorage = new MapStorage()
|
||||||
const mapEditorStore = useMapEditorStore()
|
const mapEditorStore = useMapEditorStore()
|
||||||
const gameStore = useGameStore()
|
|
||||||
const mapList = ref<Map[]>([])
|
|
||||||
const modalRef = useTemplateRef('modalRef')
|
const modalRef = useTemplateRef('modalRef')
|
||||||
|
const mapList = ref<Map[]>([])
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
open: () => modalRef.value?.open()
|
open: () => modalRef.value?.open()
|
||||||
})
|
})
|
||||||
|
|
||||||
onMounted(fetchMaps)
|
|
||||||
|
|
||||||
function fetchMaps() {
|
|
||||||
// gameStore.connection?.emit(SocketEvent.GM_MAP_LIST, {}, (response: Map[]) => {
|
|
||||||
// mapList.value = response
|
|
||||||
// })
|
|
||||||
}
|
|
||||||
|
|
||||||
const { toPositionX, toPositionY, toRotation, toMap } = useRefTeleportSettings()
|
const { toPositionX, toPositionY, toRotation, toMap } = useRefTeleportSettings()
|
||||||
|
|
||||||
function useRefTeleportSettings() {
|
function useRefTeleportSettings() {
|
||||||
@ -86,4 +77,12 @@ function updateTeleportSettings() {
|
|||||||
toMapId: toMap.value
|
toMapId: toMap.value
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function fetchMaps() {
|
||||||
|
mapList.value = await mapStorage.getAll()
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
await fetchMaps()
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,11 +1,21 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="absolute border-0 border-l-2 border-solid border-gray-500 w-1/4 min-w-80 flex flex-col top-0 right-0 z-10 h-dvh bg-gray-800" v-if="(mapEditor.tool.value === 'pencil' && mapEditor.drawMode.value === 'tile') || mapEditor.tool.value === 'paint'">
|
<div class="absolute border-0 border-l-2 border-solid border-gray-500 w-1/4 min-w-80 flex flex-col top-0 right-0 z-10 h-dvh bg-gray-800" v-if="(mapEditor.tool.value === 'pencil' && mapEditor.drawMode.value === 'tile') || mapEditor.tool.value === 'paint'">
|
||||||
<div class="flex flex-col gap-2.5 p-2.5">
|
<div class="flex flex-col gap-2.5 p-2.5">
|
||||||
|
<div class="flex justify-between items-center">
|
||||||
|
<div class="flex-grow">
|
||||||
<div class="relative flex">
|
<div class="relative flex">
|
||||||
<img src="/assets/icons/mapEditor/search.svg" class="w-4 h-4 py-0.5 absolute top-1/2 -translate-y-1/2 left-2.5" alt="Search icon" />
|
<img src="/assets/icons/mapEditor/search.svg" class="w-4 h-4 py-0.5 absolute top-1/2 -translate-y-1/2 left-2.5" alt="Search icon" />
|
||||||
<label class="mb-1.5 font-titles hidden" for="search">Search</label>
|
<label class="mb-1.5 font-titles hidden" for="search">Search</label>
|
||||||
<input @mousedown.stop class="!pl-7 input-field w-full" type="text" name="search" placeholder="Search" v-model="searchQuery" />
|
<input @mousedown.stop class="!pl-7 input-field w-full" type="text" name="search" placeholder="Search" v-model="searchQuery" />
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
<img
|
||||||
|
src="/assets/icons/mapEditor/dropdown-chevron.svg"
|
||||||
|
class="w-12 h-12 ml-2 cursor-pointer hover:opacity-80 -rotate-90"
|
||||||
|
alt="Close"
|
||||||
|
@click="mapEditor.setTool('move')"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<select class="input-field w-full" name="lists" v-model="mapEditor.drawMode.value" @change="(event: any) => mapEditor.setDrawMode(event.target.value)">
|
<select class="input-field w-full" name="lists" v-model="mapEditor.drawMode.value" @change="(event: any) => mapEditor.setDrawMode(event.target.value)">
|
||||||
<option value="tile">Tiles</option>
|
<option value="tile">Tiles</option>
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import type { Map, MapObject, PlacedMapObject, UUID } from '@/application/types'
|
import type { Map, MapObject, PlacedMapObject, UUID } from '@/application/types'
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
|
import {useGameStore} from "@/stores/gameStore";
|
||||||
|
|
||||||
export type TeleportSettings = {
|
export type TeleportSettings = {
|
||||||
toMapId: string
|
toMapId: string
|
||||||
@ -46,6 +47,8 @@ export function useMapEditorComposable() {
|
|||||||
const toggleActive = () => {
|
const toggleActive = () => {
|
||||||
if (active.value) reset()
|
if (active.value) reset()
|
||||||
active.value = !active.value
|
active.value = !active.value
|
||||||
|
const gameStore = useGameStore()
|
||||||
|
gameStore.toggleGmPanel()
|
||||||
}
|
}
|
||||||
|
|
||||||
const togglePlacedMapObjectPreview = () => {
|
const togglePlacedMapObjectPreview = () => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user