From 89062ca06551d3ef0a484dc72537cdefc2c2390b Mon Sep 17 00:00:00 2001 From: Tchips46 Date: Tue, 9 Jun 2026 11:02:58 +0900 Subject: [PATCH 1/4] feat(core-editor): all events --- .../core-editor/src/editor/core-editor.ts | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/packages/core-editor/src/editor/core-editor.ts b/packages/core-editor/src/editor/core-editor.ts index 40e52ad..fb1b565 100644 --- a/packages/core-editor/src/editor/core-editor.ts +++ b/packages/core-editor/src/editor/core-editor.ts @@ -85,6 +85,35 @@ export class CoreEditor { this._isPaused = false; } + public hardReloadEvent(): void { + const reg = this.ecsLibrary.registry; + const save = this.editor.save; + save.entities.forEach(({ id, components }) => { + Object.entries(components).forEach(([componentName, params]) => { + const ogComponent = save.components.find(({ name }) => name === componentName); + if (!ogComponent) { + throw new NfNotFound("Component: " + componentName + " not found in saved components"); + } + const ecsEntity: Entity = this.getEntityFromEntityId(id); + const ecsComponent = reg.getEntityComponent(ecsEntity, { + name: componentName, + }); + Object.entries(params).forEach(([paramName, paramValue]) => { + ecsComponent[paramName] = paramValue; + }); + reg.addComponent(ecsEntity, ecsComponent); + }); + }); + this.lastLoadedSave = JSON.parse(JSON.stringify(save)); + } + + public pauseGameEvent(): void { + this._isPaused = true; + } + public unpauseGameEvent(): void { + this._isPaused = false; + } + public stopGameEvent(): void { this.core.getExecutionContext().application.setIsRunning(false); } From d909fbac955ac2cfe2d5f1d2fef824da97cd6569 Mon Sep 17 00:00:00 2001 From: Tchips46 Date: Tue, 9 Jun 2026 11:19:55 +0900 Subject: [PATCH 2/4] feat(graphic): clear konva js --- packages/graphics-2d/src/graphics-2d.library.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/graphics-2d/src/graphics-2d.library.ts b/packages/graphics-2d/src/graphics-2d.library.ts index 8781025..eaa60db 100644 --- a/packages/graphics-2d/src/graphics-2d.library.ts +++ b/packages/graphics-2d/src/graphics-2d.library.ts @@ -72,4 +72,9 @@ export class Graphics2DLibrary extends BaseGraphicsLibrary { /** @internal */ public async __run(): Promise {} + + /** @internal */ + public override async __clear(): Promise { + this._stage?.destroy(); + } } From f72e18037f290c25fdf95da68510a51f71317b14 Mon Sep 17 00:00:00 2001 From: Tchips46 Date: Tue, 9 Jun 2026 20:25:51 +0900 Subject: [PATCH 3/4] fix: conflict --- .../core-editor/src/editor/core-editor.ts | 31 +------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/packages/core-editor/src/editor/core-editor.ts b/packages/core-editor/src/editor/core-editor.ts index fb1b565..bc64803 100644 --- a/packages/core-editor/src/editor/core-editor.ts +++ b/packages/core-editor/src/editor/core-editor.ts @@ -35,7 +35,6 @@ export class CoreEditor { public hotReloadEvent(save: Save): void { const reg = this.ecsLibrary.registry; - this.lastLoadedSave = JSON.parse(JSON.stringify(save)); save.entities.forEach(({ id, components }) => { Object.entries(components).forEach(([componentName, params]) => { const ogComponent = save.components.find(({ name }) => name === componentName); @@ -54,6 +53,7 @@ export class CoreEditor { }); reg.addComponent(ecsEntity, ecsComponent); }); + this.lastLoadedSave = JSON.parse(JSON.stringify(save)); }); } @@ -85,35 +85,6 @@ export class CoreEditor { this._isPaused = false; } - public hardReloadEvent(): void { - const reg = this.ecsLibrary.registry; - const save = this.editor.save; - save.entities.forEach(({ id, components }) => { - Object.entries(components).forEach(([componentName, params]) => { - const ogComponent = save.components.find(({ name }) => name === componentName); - if (!ogComponent) { - throw new NfNotFound("Component: " + componentName + " not found in saved components"); - } - const ecsEntity: Entity = this.getEntityFromEntityId(id); - const ecsComponent = reg.getEntityComponent(ecsEntity, { - name: componentName, - }); - Object.entries(params).forEach(([paramName, paramValue]) => { - ecsComponent[paramName] = paramValue; - }); - reg.addComponent(ecsEntity, ecsComponent); - }); - }); - this.lastLoadedSave = JSON.parse(JSON.stringify(save)); - } - - public pauseGameEvent(): void { - this._isPaused = true; - } - public unpauseGameEvent(): void { - this._isPaused = false; - } - public stopGameEvent(): void { this.core.getExecutionContext().application.setIsRunning(false); } From 4efa85a1cf960bd48f780016df01181d5ab62eca Mon Sep 17 00:00:00 2001 From: Tchips46 Date: Tue, 9 Jun 2026 21:53:56 +0900 Subject: [PATCH 4/4] fix: conflict --- packages/core-editor/src/editor/core-editor.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core-editor/src/editor/core-editor.ts b/packages/core-editor/src/editor/core-editor.ts index bc64803..033a488 100644 --- a/packages/core-editor/src/editor/core-editor.ts +++ b/packages/core-editor/src/editor/core-editor.ts @@ -53,8 +53,8 @@ export class CoreEditor { }); reg.addComponent(ecsEntity, ecsComponent); }); - this.lastLoadedSave = JSON.parse(JSON.stringify(save)); }); + this.lastLoadedSave = JSON.parse(JSON.stringify(save)); } public hardReloadEvent(save: Save): void {