diff --git a/src/App.vue b/src/App.vue
index 3e46ff1..b7e41f6 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -1,11 +1,11 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/src/components/World.vue b/src/components/World.vue
index a676700..d7d95b9 100644
--- a/src/components/World.vue
+++ b/src/components/World.vue
@@ -1,104 +1,165 @@
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/forms/ChipsInput.vue b/src/components/forms/ChipsInput.vue
index 237d346..30d3784 100644
--- a/src/components/forms/ChipsInput.vue
+++ b/src/components/forms/ChipsInput.vue
@@ -34,4 +34,4 @@ const backspaceDelete = (event) => {
modelValue.value = modelValue.value.slice(0, -1)
}
}
-
\ No newline at end of file
+
diff --git a/src/components/gui/Hud.vue b/src/components/gui/Hud.vue
index 75af626..5726d1e 100644
--- a/src/components/gui/Hud.vue
+++ b/src/components/gui/Hud.vue
@@ -7,22 +7,22 @@

@@ -31,12 +31,12 @@
- {{ game.character.name }}
- lvl. {{ socket.character.level }}
+ {{ gameStore.character.name }}
+ lvl. {{ gameStore.character.level }}
-
+
diff --git a/src/components/sprites/Character.vue b/src/components/sprites/Character.vue
index 041ba1c..f53bb29 100644
--- a/src/components/sprites/Character.vue
+++ b/src/components/sprites/Character.vue
@@ -1,13 +1,13 @@
-
-
+
+
-
+
@@ -35,7 +35,7 @@ const props = defineProps({
})
const scene = useScene()
-const isSelf = props.character.id === socket.character.id
+const isSelf = props.character?.id === gameStore.character?.id
const createText = (text: Phaser.GameObjects.Text) => {
text.setLetterSpacing(1.5)
@@ -60,7 +60,7 @@ function onPointerClick(pointer: Phaser.Input.Pointer) {
return
}
- gameStore.connection.emit('character:move', { position_x: pointer_tile.x, position_y: pointer_tile.y })
+ gameStore.connection?.emit('character:move', { position_x: pointer_tile.x, position_y: pointer_tile.y })
//Directions for player sprites + animations
if (px < 0 && py > 0) {
diff --git a/src/components/utilities/assetManager/partials/TileDetails.vue b/src/components/utilities/assetManager/partials/TileDetails.vue
index a00639b..518b800 100644
--- a/src/components/utilities/assetManager/partials/TileDetails.vue
+++ b/src/components/utilities/assetManager/partials/TileDetails.vue
@@ -13,7 +13,7 @@
-
+
@@ -88,7 +88,7 @@ function saveTile() {
{
id: selectedTile.value.id,
name: tileName.value,
- tags: tileTags.value,
+ tags: tileTags.value
},
(response: boolean) => {
if (!response) {
diff --git a/src/components/utilities/zoneEditor/Objects.vue b/src/components/utilities/zoneEditor/Objects.vue
index 48c5370..1179a0f 100644
--- a/src/components/utilities/zoneEditor/Objects.vue
+++ b/src/components/utilities/zoneEditor/Objects.vue
@@ -7,14 +7,7 @@
-
+
@@ -68,9 +61,7 @@ const filteredObjects = computed(() => {
if (!searchQuery.value) {
return zoneEditorStore.objectList
}
- return zoneEditorStore.objectList.filter(object =>
- object.name.toLowerCase().includes(searchQuery.value.toLowerCase())
- )
+ return zoneEditorStore.objectList.filter((object) => object.name.toLowerCase().includes(searchQuery.value.toLowerCase()))
})
onMounted(async () => {
@@ -81,4 +72,4 @@ onMounted(async () => {
zoneEditorStore.setObjectList(response)
})
})
-
\ No newline at end of file
+
diff --git a/src/components/utilities/zoneEditor/Tiles.vue b/src/components/utilities/zoneEditor/Tiles.vue
index d66e6db..e8222ae 100644
--- a/src/components/utilities/zoneEditor/Tiles.vue
+++ b/src/components/utilities/zoneEditor/Tiles.vue
@@ -7,14 +7,7 @@
@@ -59,9 +52,7 @@ const filteredTiles = computed(() => {
if (!searchQuery.value) {
return zoneEditorStore.tileList
}
- return zoneEditorStore.tileList.filter(tile =>
- tile.name.toLowerCase().includes(searchQuery.value.toLowerCase())
- )
+ return zoneEditorStore.tileList.filter((tile) => tile.name.toLowerCase().includes(searchQuery.value.toLowerCase()))
})
onMounted(async () => {
@@ -70,4 +61,4 @@ onMounted(async () => {
zoneEditorStore.setTileList(response)
})
})
-
\ No newline at end of file
+
diff --git a/src/components/utilities/zoneEditor/Toolbar.vue b/src/components/utilities/zoneEditor/Toolbar.vue
index 98a41ff..0c03b17 100644
--- a/src/components/utilities/zoneEditor/Toolbar.vue
+++ b/src/components/utilities/zoneEditor/Toolbar.vue
@@ -149,7 +149,7 @@ scene.input.on(Phaser.Input.Events.POINTER_MOVE, drawTiles)
onMounted(() => {
addEventListener('keydown', initKeyShortcuts)
-});
+})
onBeforeUnmount(() => {
scene.input.off(Phaser.Input.Events.POINTER_UP, drawTile)
@@ -157,9 +157,8 @@ onBeforeUnmount(() => {
removeEventListener('keydown', initKeyShortcuts)
})
-
// Key bindings
-function initKeyShortcuts (event: KeyboardEvent) {
+function initKeyShortcuts(event: KeyboardEvent) {
if (!zoneEditorStore.zone) return
// prevent if focussed on input
diff --git a/src/components/utilities/zoneEditor/ZoneEditor.vue b/src/components/utilities/zoneEditor/ZoneEditor.vue
index 9bca68b..c68031a 100644
--- a/src/components/utilities/zoneEditor/ZoneEditor.vue
+++ b/src/components/utilities/zoneEditor/ZoneEditor.vue
@@ -1,9 +1,18 @@
-
+
-
+
@@ -37,9 +46,7 @@ import Tileset = Phaser.Tilemaps.Tileset
import TilemapLayer = Phaser.Tilemaps.TilemapLayer
function uuidv4() {
- return "10000000-1000-4000-8000-100000000000".replace(/[018]/g, c =>
- (+c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> +c / 4).toString(16)
- );
+ return '10000000-1000-4000-8000-100000000000'.replace(/[018]/g, (c) => (+c ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (+c / 4)))).toString(16))
}
const scene = useScene()
@@ -65,7 +72,7 @@ const zoneData = new Phaser.Tilemaps.MapData({
*/
const tilesetImages: Tileset[] = []
const zoneTilemap = new Phaser.Tilemaps.Tilemap(scene, zoneData)
-let zoneTiles = [] as string[][];
+let zoneTiles = [] as string[][]
const zoneObjects = ref([])
const zoneEventTiles = ref([])
@@ -163,7 +170,7 @@ function pencil(tile: Phaser.Tilemaps.Tile) {
function paint(tile: Phaser.Tilemaps.Tile) {
if (zoneEditorStore.selectedTile === null) return
exampleTilesArray.forEach((row, y) => row.forEach((tile, x) => placeTile(zoneTilemap, tiles, x, y, zoneEditorStore.selectedTile.id)))
- zoneTiles.forEach((row, y) => row.forEach((tile, x) => zoneTiles[y][x] = zoneEditorStore.selectedTile.id))
+ zoneTiles.forEach((row, y) => row.forEach((tile, x) => (zoneTiles[y][x] = zoneEditorStore.selectedTile.id)))
}
function save() {
@@ -175,14 +182,14 @@ function save() {
width: zoneEditorStore.zone.width,
height: zoneEditorStore.zone.height,
tiles: zoneTiles,
- zoneEventTiles: toRaw(zoneEventTiles.value).map(tile => ({
+ zoneEventTiles: toRaw(zoneEventTiles.value).map((tile) => ({
id: tile.id,
zoneId: tile.zoneId,
type: tile.type,
position_x: tile.position_x,
position_y: tile.position_y
})),
- zoneObjects: toRaw(zoneObjects.value).map(obj => ({
+ zoneObjects: toRaw(zoneObjects.value).map((obj) => ({
id: obj.id,
zoneId: obj.zoneId,
objectId: obj.objectId,
@@ -190,13 +197,13 @@ function save() {
position_x: obj.position_x,
position_y: obj.position_y
}))
- };
+ }
- gameStore.connection.emit('gm:zone_editor:zone:update', data);
+ gameStore.connection.emit('gm:zone_editor:zone:update', data)
gameStore.connection.emit('gm:zone_editor:zone:request', { zoneId: zoneEditorStore.zone.id }, (response: Zone) => {
zoneEditorStore.setZone(response)
- });
+ })
if (zoneEditorStore.isSettingsModalShown) {
zoneEditorStore.toggleSettingsModal()
@@ -215,27 +222,27 @@ onBeforeMount(() => {
zoneTiles = exampleTilesArray
if (zoneEditorStore.zone && zoneEditorStore.zone.tiles) {
- setAllTiles(zoneTilemap, tiles, zoneEditorStore.zone.tiles);
- zoneTiles = zoneEditorStore.zone.tiles;
+ setAllTiles(zoneTilemap, tiles, zoneEditorStore.zone.tiles)
+ zoneTiles = zoneEditorStore.zone.tiles
// Determine the current zone dimensions
- const currentZoneWidth = zoneEditorStore.zone.width ?? 0;
- const currentZoneHeight = zoneEditorStore.zone.height ?? 0;
+ const currentZoneWidth = zoneEditorStore.zone.width ?? 0
+ const currentZoneHeight = zoneEditorStore.zone.height ?? 0
// Ensure zoneTiles matches the current zone dimensions, filling new spaces with 'blank_tile'
for (let y = 0; y < currentZoneHeight; y++) {
- zoneTiles[y] = zoneTiles[y] || []; // Ensure the row exists
+ zoneTiles[y] = zoneTiles[y] || [] // Ensure the row exists
for (let x = 0; x < currentZoneWidth; x++) {
- zoneTiles[y][x] = zoneTiles[y][x] || 'blank_tile'; // Fill missing tiles with 'blank_tile'
+ zoneTiles[y][x] = zoneTiles[y][x] || 'blank_tile' // Fill missing tiles with 'blank_tile'
}
}
// Update the tilemap with any new 'blank_tile' entries
zoneTiles.forEach((row, y) => {
row.forEach((tileId, x) => {
- placeTile(zoneTilemap, tiles, x, y, tileId);
- });
- });
+ placeTile(zoneTilemap, tiles, x, y, tileId)
+ })
+ })
}
zoneEventTiles.value = zoneEditorStore.zone?.zoneEventTiles ?? []
diff --git a/src/components/utilities/zoneEditor/ZoneList.vue b/src/components/utilities/zoneEditor/ZoneList.vue
index ed451da..b57283b 100644
--- a/src/components/utilities/zoneEditor/ZoneList.vue
+++ b/src/components/utilities/zoneEditor/ZoneList.vue
@@ -53,7 +53,7 @@ function loadZone(id: number) {
console.log('loadZone', id)
gameStore.connection.emit('gm:zone_editor:zone:request', { zoneId: id }, (response: Zone) => {
zoneEditorStore.setZone(response)
- });
+ })
zoneEditorStore.toggleZoneListModal()
}
diff --git a/src/config.ts b/src/config.ts
index f6f5756..763f5d6 100644
--- a/src/config.ts
+++ b/src/config.ts
@@ -1,4 +1,4 @@
-const dev: boolean = true;
+const dev: boolean = true
export default {
name: 'New Quest',
diff --git a/src/screens/Game.vue b/src/screens/Game.vue
index 6cc3a49..37b012b 100644
--- a/src/screens/Game.vue
+++ b/src/screens/Game.vue
@@ -1,7 +1,7 @@
-
-
+
+
@@ -9,7 +9,7 @@
-
+
@@ -28,10 +28,11 @@