From 21068c799a1543fbd6f8c0b9b3cc188d60fb2f6d Mon Sep 17 00:00:00 2001 From: Renge Date: Wed, 6 Apr 2022 14:37:02 -0400 Subject: [PATCH] fix: deleted animatedsprites in story not finish loading function yet --- src/shattered_sword/Scenes/SceneWithStory.ts | 18 +++++++++--------- src/shattered_sword/Tools/DataTypes/Story.ts | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/shattered_sword/Scenes/SceneWithStory.ts b/src/shattered_sword/Scenes/SceneWithStory.ts index 4765450..f5f8da7 100644 --- a/src/shattered_sword/Scenes/SceneWithStory.ts +++ b/src/shattered_sword/Scenes/SceneWithStory.ts @@ -136,15 +136,15 @@ export default class SceneWithStory extends Scene { }) } break; - case "loadAnimatedSprite": - this.load.spritesheet(action.key, action.path); - this.load.loadResourcesFromQueue(() => { - tmp = this.add.animatedSprite(action.key, "story"); - tmp.position.set(action.positon[0], action.positon[1]); - tmp.scale.set(action.scale[0], action.scale[1]); - this.storySprites.push(tmp); - }); - break; + // case "loadAnimatedSprite": + // this.load.spritesheet(action.key, action.path); + // this.load.loadResourcesFromQueue(() => { + // tmp = this.add.animatedSprite(action.key, "story"); + // tmp.position.set(action.positon[0], action.positon[1]); + // tmp.scale.set(action.scale[0], action.scale[1]); + // this.storySprites.push(tmp); + // }); + // break; case "moveSprite": tmp = this.storySprites.find(function (sprite) { return sprite.imageId === action.key; diff --git a/src/shattered_sword/Tools/DataTypes/Story.ts b/src/shattered_sword/Tools/DataTypes/Story.ts index af2dec4..d0e53fc 100644 --- a/src/shattered_sword/Tools/DataTypes/Story.ts +++ b/src/shattered_sword/Tools/DataTypes/Story.ts @@ -10,7 +10,7 @@ export class Text { } export class Action { - type: "loadSprite" | "loadAnimatedSprite" | "moveSprite" | "showSprite" | "hideSprite"; + type: "loadSprite" /*| "loadAnimatedSprite"*/ | "moveSprite" | "showSprite" | "hideSprite"; key: string; path?: string; positon?: [number, number];