npm update, updated tile & sprite detail (remove>delete)

This commit is contained in:
Dennis Postma 2024-09-08 23:55:49 +02:00
parent 04bb488797
commit 69bee25c9d
3 changed files with 12 additions and 12 deletions

6
package-lock.json generated
View File

@ -6259,9 +6259,9 @@
} }
}, },
"node_modules/source-map-js": { "node_modules/source-map-js": {
"version": "1.2.0", "version": "1.2.1",
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz",
"integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==", "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==",
"license": "BSD-3-Clause", "license": "BSD-3-Clause",
"engines": { "engines": {
"node": ">=0.10.0" "node": ">=0.10.0"

View File

@ -9,7 +9,7 @@
<div class="w-full flex gap-2 mt-2 pb-4 relative"> <div class="w-full flex gap-2 mt-2 pb-4 relative">
<button class="btn-cyan px-4 py-2 flex-1 sm:flex-none sm:min-w-24" type="button" @click.prevent="saveSprite">Save</button> <button class="btn-cyan px-4 py-2 flex-1 sm:flex-none sm:min-w-24" type="button" @click.prevent="saveSprite">Save</button>
<button class="btn-bordeaux px-4 py-2 flex-1 sm:flex-none sm:min-w-24" type="button" @click.prevent="removeSprite">Remove</button> <button class="btn-bordeaux px-4 py-2 flex-1 sm:flex-none sm:min-w-24" type="button" @click.prevent="deleteSprite">Delete</button>
<div class="w-[calc(100%_+_32px)] absolute left-[-15px] bottom-0 h-px bg-cyan-200"></div> <div class="w-[calc(100%_+_32px)] absolute left-[-15px] bottom-0 h-px bg-cyan-200"></div>
</div> </div>
</div> </div>
@ -19,7 +19,7 @@
<template #header> <template #header>
<div class="flex justify-between items-center"> <div class="flex justify-between items-center">
{{ action.action }} {{ action.action }}
<button class="btn-bordeaux px-4 py-1.5 min-w-24" type="button" @click.prevent="() => spriteActions.splice(spriteActions.indexOf(action), 1)">Remove</button> <button class="btn-bordeaux px-4 py-1.5 min-w-24" type="button" @click.prevent="() => spriteActions.splice(spriteActions.indexOf(action), 1)">Delete</button>
</div> </div>
</template> </template>
<template #content> <template #content>
@ -90,10 +90,10 @@ if (selectedSprite.value) {
spriteActions.value = selectedSprite.value.spriteActions spriteActions.value = selectedSprite.value.spriteActions
} }
function removeSprite() { function deleteSprite() {
gameStore.connection?.emit('gm:sprite:remove', { id: selectedSprite.value?.id }, (response: boolean) => { gameStore.connection?.emit('gm:sprite:delete', { id: selectedSprite.value?.id }, (response: boolean) => {
if (!response) { if (!response) {
console.error('Failed to remove sprite') console.error('Failed to delete sprite')
return return
} }
refreshSpriteList() refreshSpriteList()

View File

@ -3,7 +3,7 @@
<div class="relative p-2.5 flex flex-col items-center justify-between h-72"> <div class="relative p-2.5 flex flex-col items-center justify-between h-72">
<div class="filler"></div> <div class="filler"></div>
<img class="max-h-72" :src="`${config.server_endpoint}/assets/tiles/${selectedTile?.id}.png`" :alt="'Tile ' + selectedTile?.id" /> <img class="max-h-72" :src="`${config.server_endpoint}/assets/tiles/${selectedTile?.id}.png`" :alt="'Tile ' + selectedTile?.id" />
<button class="btn-bordeaux px-4 py-1.5 min-w-24" type="button" @click.prevent="removeTile">Remove</button> <button class="btn-bordeaux px-4 py-1.5 min-w-24" type="button" @click.prevent="deleteTile">Delete</button>
<div class="absolute left-0 bottom-0 w-full h-px bg-cyan-200"></div> <div class="absolute left-0 bottom-0 w-full h-px bg-cyan-200"></div>
</div> </div>
<div class="m-2.5 p-2.5 block"> <div class="m-2.5 p-2.5 block">
@ -55,10 +55,10 @@ watch(selectedTile, (tile: Tile | null) => {
tileTags.value = tile.tags tileTags.value = tile.tags
}) })
function removeTile() { function deleteTile() {
gameStore.connection?.emit('gm:tile:remove', { tile: selectedTile.value?.id }, (response: boolean) => { gameStore.connection?.emit('gm:tile:delete', { id: selectedTile.value?.id }, (response: boolean) => {
if (!response) { if (!response) {
console.error('Failed to remove tile') console.error('Failed to delete tile')
return return
} }
refreshTileList() refreshTileList()