diff --git a/public/assets/icons/zoneEditor/cart.svg b/public/assets/icons/mapEditor/cart.svg similarity index 100% rename from public/assets/icons/zoneEditor/cart.svg rename to public/assets/icons/mapEditor/cart.svg diff --git a/public/assets/icons/zoneEditor/chevron.svg b/public/assets/icons/mapEditor/chevron.svg similarity index 100% rename from public/assets/icons/zoneEditor/chevron.svg rename to public/assets/icons/mapEditor/chevron.svg diff --git a/public/assets/icons/zoneEditor/eraser.svg b/public/assets/icons/mapEditor/eraser.svg similarity index 100% rename from public/assets/icons/zoneEditor/eraser.svg rename to public/assets/icons/mapEditor/eraser.svg diff --git a/public/assets/icons/zoneEditor/gear.svg b/public/assets/icons/mapEditor/gear.svg similarity index 100% rename from public/assets/icons/zoneEditor/gear.svg rename to public/assets/icons/mapEditor/gear.svg diff --git a/public/assets/icons/zoneEditor/move.svg b/public/assets/icons/mapEditor/move.svg similarity index 100% rename from public/assets/icons/zoneEditor/move.svg rename to public/assets/icons/mapEditor/move.svg diff --git a/public/assets/icons/zoneEditor/paint.svg b/public/assets/icons/mapEditor/paint.svg similarity index 100% rename from public/assets/icons/zoneEditor/paint.svg rename to public/assets/icons/mapEditor/paint.svg diff --git a/public/assets/icons/zoneEditor/pencil.svg b/public/assets/icons/mapEditor/pencil.svg similarity index 100% rename from public/assets/icons/zoneEditor/pencil.svg rename to public/assets/icons/mapEditor/pencil.svg diff --git a/public/assets/icons/zoneEditor/tiles.svg b/public/assets/icons/mapEditor/tiles.svg similarity index 100% rename from public/assets/icons/zoneEditor/tiles.svg rename to public/assets/icons/mapEditor/tiles.svg diff --git a/public/assets/zone/blank_tile.png b/public/assets/map/blank_tile.png similarity index 100% rename from public/assets/zone/blank_tile.png rename to public/assets/map/blank_tile.png diff --git a/public/assets/zone/bt_tile.png b/public/assets/map/bt_tile.png similarity index 100% rename from public/assets/zone/bt_tile.png rename to public/assets/map/bt_tile.png diff --git a/public/assets/zone/tp_tile.png b/public/assets/map/tp_tile.png similarity index 100% rename from public/assets/zone/tp_tile.png rename to public/assets/map/tp_tile.png diff --git a/public/assets/ui-elements/profile-ui-box-outer.svg b/public/assets/ui-elements/profile-ui-box-outer.svg index cd364f8..c5ea8f6 100644 --- a/public/assets/ui-elements/profile-ui-box-outer.svg +++ b/public/assets/ui-elements/profile-ui-box-outer.svg @@ -18,6 +18,6 @@ - + diff --git a/src/App.vue b/src/App.vue index 8b3dd1c..c42225c 100644 --- a/src/App.vue +++ b/src/App.vue @@ -10,27 +10,27 @@ import GmPanel from '@/components/gameMaster/GmPanel.vue' import Characters from '@/components/screens/Characters.vue' import Game from '@/components/screens/Game.vue' import Login from '@/components/screens/Login.vue' -import ZoneEditor from '@/components/screens/ZoneEditor.vue' +import MapEditor from '@/components/screens/MapEditor.vue' import BackgroundImageLoader from '@/components/utilities/BackgroundImageLoader.vue' import Notifications from '@/components/utilities/Notifications.vue' import { useGameStore } from '@/stores/gameStore' -import { useZoneEditorStore } from '@/stores/zoneEditorStore' +import { useMapEditorStore } from '@/stores/mapEditorStore' import { computed, watch } from 'vue' const gameStore = useGameStore() -const zoneEditorStore = useZoneEditorStore() +const mapEditorStore = useMapEditorStore() const currentScreen = computed(() => { if (!gameStore.connection) return Login if (!gameStore.token) return Login if (!gameStore.character) return Characters - if (zoneEditorStore.active) return ZoneEditor + if (mapEditorStore.active) return MapEditor return Game }) -// Watch zoneEditorStore.active and empty gameStore.game.loadedAssets +// Watch mapEditorStore.active and empty gameStore.game.loadedAssets watch( - () => zoneEditorStore.active, + () => mapEditorStore.active, () => { gameStore.game.loadedAssets = [] } diff --git a/src/application/types.ts b/src/application/types.ts index 4528b8e..2ea2bce 100644 --- a/src/application/types.ts +++ b/src/application/types.ts @@ -46,7 +46,7 @@ export type Object = { frameHeight: number createdAt: Date updatedAt: Date - ZoneObject: ZoneObject[] + MapObject: PlacedMapObject[] } export type Item = { @@ -65,34 +65,34 @@ export type Item = { export type ItemType = 'WEAPON' | 'HELMET' | 'CHEST' | 'LEGS' | 'BOOTS' | 'GLOVES' | 'RING' | 'NECKLACE' export type ItemRarity = 'COMMON' | 'UNCOMMON' | 'RARE' | 'EPIC' | 'LEGENDARY' -export type Zone = { +export type Map = { id: UUID name: string width: number height: number tiles: any | null pvp: boolean - zoneEffects: ZoneEffect[] - zoneEventTiles: ZoneEventTile[] - zoneObjects: ZoneObject[] + mapEffects: MapEffect[] + mapEventTiles: MapEventTile[] + mapObjects: PlacedMapObject[] characters: Character[] chats: Chat[] createdAt: Date updatedAt: Date } -export type ZoneEffect = { +export type MapEffect = { id: UUID - zoneId: UUID - zone: Zone + mapId: UUID + map: Map effect: string strength: number } -export type ZoneObject = { +export type PlacedMapObject = { id: UUID - zoneId: UUID - zone: Zone + mapId: UUID + map: Map objectId: UUID object: Object depth: number @@ -101,29 +101,29 @@ export type ZoneObject = { positionY: number } -export enum ZoneEventTileType { +export enum MapEventTileType { BLOCK = 'BLOCK', TELEPORT = 'TELEPORT', NPC = 'NPC', ITEM = 'ITEM' } -export type ZoneEventTile = { +export type MapEventTile = { id: UUID - zoneId: UUID - zone: Zone - type: ZoneEventTileType + mapId: UUID + map: Map + type: MapEventTileType positionX: number positionY: number - teleport?: ZoneEventTileTeleport + teleport?: MapEventTileTeleport } -export type ZoneEventTileTeleport = { +export type MapEventTileTeleport = { id: UUID - zoneEventTileId: UUID - zoneEventTile: ZoneEventTile - toZoneId: UUID - toZone: Zone + mapEventTileId: UUID + mapEventTile: MapEventTile + toMapId: UUID + toMap: Map toPositionX: number toPositionY: number toRotation: number @@ -188,14 +188,14 @@ export type Character = { characterType: CharacterType | null | string characterHairId: UUID | null characterHair: CharacterHair | null - zoneId: UUID - zone: Zone + mapId: UUID + map: Map chats: Chat[] items: CharacterItem[] equipment: CharacterEquipment[] } -export type ZoneCharacter = { +export type MapCharacter = { character: Character isMoving?: boolean } @@ -252,8 +252,8 @@ export type Chat = { id: UUID characterId: UUID character: Character - zoneId: UUID - zone: Zone + mapId: UUID + map: Map message: string createdAt: Date } @@ -272,7 +272,7 @@ export type WeatherState = { fogDensity: number } -export type zoneLoadData = { - zone: Zone - characters: ZoneCharacter[] +export type mapLoadData = { + map: Map + characters: MapCharacter[] } diff --git a/src/components/Effects.vue b/src/components/Effects.vue index 2ef8d2f..610e406 100644 --- a/src/components/Effects.vue +++ b/src/components/Effects.vue @@ -5,7 +5,7 @@ diff --git a/src/components/game/character/partials/Healthbar.vue b/src/components/game/character/partials/Healthbar.vue index 6e563bf..f2bcb1d 100644 --- a/src/components/game/character/partials/Healthbar.vue +++ b/src/components/game/character/partials/Healthbar.vue @@ -1,17 +1,17 @@ diff --git a/src/components/game/map/Map.vue b/src/components/game/map/Map.vue new file mode 100644 index 0000000..55c806d --- /dev/null +++ b/src/components/game/map/Map.vue @@ -0,0 +1,50 @@ + + + diff --git a/src/components/game/map/MapObjects.vue b/src/components/game/map/MapObjects.vue new file mode 100644 index 0000000..4eb463d --- /dev/null +++ b/src/components/game/map/MapObjects.vue @@ -0,0 +1,14 @@ + + + diff --git a/src/components/game/zone/ZoneTiles.vue b/src/components/game/map/MapTiles.vue similarity index 79% rename from src/components/game/zone/ZoneTiles.vue rename to src/components/game/map/MapTiles.vue index 2c5c28f..f72f0b9 100644 --- a/src/components/game/zone/ZoneTiles.vue +++ b/src/components/game/map/MapTiles.vue @@ -6,15 +6,15 @@ import config from '@/application/config' import { unduplicateArray } from '@/application/utilities' import Controls from '@/components/utilities/Controls.vue' -import { FlattenZoneArray, setLayerTiles } from '@/composables/zoneComposable' -import { useZoneStore } from '@/stores/zoneStore' +import { FlattenMapArray, setLayerTiles } from '@/composables/mapComposable' +import { useMapStore } from '@/stores/mapStore' import { useScene } from 'phavuer' import { onBeforeUnmount } from 'vue' const emit = defineEmits(['tileMap:create']) const scene = useScene() -const zoneStore = useZoneStore() +const mapStore = useMapStore() const tileMap = createTileMap() const tileLayer = createTileLayer() @@ -24,16 +24,16 @@ const tileLayer = createTileLayer() * A map can have one or more tilemap layers, which are the display objects that actually render the tiles. */ function createTileMap() { - const zoneData = new Phaser.Tilemaps.MapData({ - width: zoneStore.zone?.width, - height: zoneStore.zone?.height, + const mapData = new Phaser.Tilemaps.MapData({ + width: mapStore.map?.width, + height: mapStore.map?.height, tileWidth: config.tile_size.x, tileHeight: config.tile_size.y, orientation: Phaser.Tilemaps.Orientation.ISOMETRIC, format: Phaser.Tilemaps.Formats.ARRAY_2D }) - const newTileMap = new Phaser.Tilemaps.Tilemap(scene, zoneData) + const newTileMap = new Phaser.Tilemaps.Tilemap(scene, mapData) emit('tileMap:create', newTileMap) return newTileMap @@ -43,7 +43,7 @@ function createTileMap() { * A Tileset is a combination of a single image containing the tiles and a container for data about each tile. */ function createTileLayer() { - const tilesArray = unduplicateArray(FlattenZoneArray(zoneStore.zone?.tiles ?? [])) + const tilesArray = unduplicateArray(FlattenMapArray(mapStore.map?.tiles ?? [])) const tilesetImages = Array.from(tilesArray).map((tile: any, index: number) => { return tileMap.addTilesetImage(tile, tile, config.tile_size.x, config.tile_size.y, 1, 2, index + 1, { x: 0, y: -config.tile_size.y }) @@ -59,7 +59,7 @@ function createTileLayer() { return layer } -setLayerTiles(tileMap, tileLayer, zoneStore.zone?.tiles) +setLayerTiles(tileMap, tileLayer, mapStore.map?.tiles) onBeforeUnmount(() => { tileMap.destroyLayer('tiles') diff --git a/src/components/game/map/partials/MapObject.vue b/src/components/game/map/partials/MapObject.vue new file mode 100644 index 0000000..e5cdd26 --- /dev/null +++ b/src/components/game/map/partials/MapObject.vue @@ -0,0 +1,41 @@ + + + diff --git a/src/components/game/zone/Characters.vue b/src/components/game/zone/Characters.vue deleted file mode 100644 index c6819b9..0000000 --- a/src/components/game/zone/Characters.vue +++ /dev/null @@ -1,14 +0,0 @@ - - - diff --git a/src/components/game/zone/Zone.vue b/src/components/game/zone/Zone.vue deleted file mode 100644 index 256c93c..0000000 --- a/src/components/game/zone/Zone.vue +++ /dev/null @@ -1,50 +0,0 @@ - - - diff --git a/src/components/game/zone/ZoneObjects.vue b/src/components/game/zone/ZoneObjects.vue deleted file mode 100644 index c61f98d..0000000 --- a/src/components/game/zone/ZoneObjects.vue +++ /dev/null @@ -1,14 +0,0 @@ - - - diff --git a/src/components/game/zone/partials/ZoneObject.vue b/src/components/game/zone/partials/ZoneObject.vue deleted file mode 100644 index 446be1b..0000000 --- a/src/components/game/zone/partials/ZoneObject.vue +++ /dev/null @@ -1,41 +0,0 @@ - - - diff --git a/src/components/gameMaster/GmPanel.vue b/src/components/gameMaster/GmPanel.vue index 0dab0d4..0854219 100644 --- a/src/components/gameMaster/GmPanel.vue +++ b/src/components/gameMaster/GmPanel.vue @@ -6,7 +6,7 @@ - +