forked from noxious/client
Showing placed map object works in both game and map editor, updated types, cleaned some logic
This commit is contained in:
@ -18,7 +18,7 @@ export const useMapStore = defineStore('map', {
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
setMapId(mapId: UUID) {
|
||||
setMapId(mapId: string) {
|
||||
this.mapId = mapId
|
||||
},
|
||||
setCharacters(characters: MapCharacter[]) {
|
||||
@ -27,11 +27,6 @@ export const useMapStore = defineStore('map', {
|
||||
addCharacter(character: MapCharacter) {
|
||||
this.characters.push(character)
|
||||
},
|
||||
updateCharacter(updatedCharacter: MapCharacter) {
|
||||
const index = this.characters.findIndex((char) => char.character.id === updatedCharacter.character.id)
|
||||
if (index !== -1) this.characters[index] = updatedCharacter
|
||||
},
|
||||
// Property is mapCharacter key
|
||||
updateCharacterProperty<K extends keyof MapCharacter>(characterId: UUID, property: K, value: MapCharacter[K]) {
|
||||
const character = this.characters.find((char) => char.character.id === characterId)
|
||||
if (character) {
|
||||
|
Reference in New Issue
Block a user