forked from noxious/client
This commit is contained in:
@ -37,7 +37,6 @@ const props = defineProps<{
|
||||
character: ExtendedCharacter
|
||||
}>()
|
||||
|
||||
const isTextureLoaded = ref(false)
|
||||
const charChatContainer = refObj<Phaser.GameObjects.Container>()
|
||||
const charContainer = refObj<Phaser.GameObjects.Container>()
|
||||
const charSprite = refObj<Phaser.GameObjects.Sprite>()
|
||||
@ -183,13 +182,14 @@ watch(
|
||||
watch(() => props.character.isMoving, updateSprite)
|
||||
watch(() => props.character.rotation, updateSprite)
|
||||
|
||||
loadSpriteTextures(scene, props.character.characterType?.sprite as SpriteT).then((loaded) => {
|
||||
isTextureLoaded.value = loaded
|
||||
charSprite.value!.setTexture(charTexture.value)
|
||||
charSprite.value!.setFlipX(isFlippedX.value)
|
||||
}).catch((error) => {
|
||||
console.error('Error loading texture:', error)
|
||||
})
|
||||
loadSpriteTextures(scene, props.character.characterType?.sprite as SpriteT)
|
||||
.then(() => {
|
||||
charSprite.value!.setTexture(charTexture.value)
|
||||
charSprite.value!.setFlipX(isFlippedX.value)
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('Error loading texture:', error)
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
charChatContainer.value!.setName(`${props.character!.name}_chatContainer`)
|
||||
|
Reference in New Issue
Block a user