1
0
forked from noxious/client

Update origin X and Y values in real-time

This commit is contained in:
2025-02-06 14:02:50 +01:00
parent 15b212160d
commit 7071d934b4
3 changed files with 24 additions and 4 deletions

View File

@ -4,7 +4,7 @@
<button @mousedown.stop @click="handleDelete" class="btn-red py-1.5 px-4">
<img src="/assets/icons/trashcan.svg" class="w-4 h-4" alt="Delete" />
</button>
<button @mousedown.stop @click="showMapObjectSettings = true" class="btn-indigo py-1.5 px-4">
<button @mousedown.stop @click="showMapObjectSettings = !showMapObjectSettings" class="btn-indigo py-1.5 px-4">
<img src="/assets/icons/mapEditor/gear.svg" class="w-4 h-4 invert" alt="Delete" />
</button>
<button @mousedown.stop @click="handleRotate" class="btn-cyan py-1.5 px-4">Rotate</button>
@ -12,7 +12,7 @@
</div>
</div>
<Modal :is-modal-open="showMapObjectSettings" :modal-height="320" bg-style="none">
<Modal :is-modal-open="showMapObjectSettings" @modal:close="showMapObjectSettings = false" :modal-height="320" bg-style="none">
<template #modalHeader>
<h3 class="m-0 font-medium shrink-0 text-white">Map object settings</h3>
</template>
@ -90,12 +90,12 @@ async function handleUpdate() {
},
async (response: boolean) => {
if (!response) return
// Update mapObject in storage
await mapObjectStorage.update(mapObject.value!.id, {
name: mapObjectName.value,
originX: mapObjectOriginX.value,
originY: mapObjectOriginY.value
})
mapEditor.triggerMapObjectRefresh() // Add this line
}
)
}