Merge remote-tracking branch 'origin/main' into feature/map-refactor

This commit is contained in:
2025-01-28 01:59:29 +01:00
6 changed files with 59 additions and 94 deletions

View File

@ -73,18 +73,17 @@ export async function loadSpriteTextures(scene: Phaser.Scene, sprite_id: string)
await loadTexture(scene, {
key,
data: '/textures/sprites/' + sprite.id + '/' + sprite_action.action + '.png',
group: sprite_action.isAnimated ? 'sprite_animations' : 'sprites',
group: sprite_action.frameCount > 1 ? 'sprite_animations' : 'sprites',
updatedAt: sprite_action.updatedAt,
originX: sprite_action.originX,
originY: sprite_action.originY,
isAnimated: sprite_action.isAnimated,
frameWidth: sprite_action.frameWidth,
frameHeight: sprite_action.frameHeight,
frameRate: sprite_action.frameRate
} as TextureData)
// If the sprite is not animated, skip
if (!sprite_action.isAnimated) continue
// If the sprite has no more than one frame, skip
if (sprite_action.frameCount <= 1) continue
// Check if animation already exists
if (scene.anims.get(key)) continue