refactor: scene control

This commit is contained in:
2026-04-14 11:10:14 +08:00
parent c639218b53
commit c9acb7f228
5 changed files with 47 additions and 12 deletions
@@ -167,20 +167,20 @@ export class GridViewerScene extends ReactiveScene {
const { width, height } = this.scale;
// Back button
this.createButton('返回菜单', 100, 40, () => {
this.scene.start('IndexScene');
this.createButton('返回菜单', 100, 40, async () => {
await this.sceneController.launch('IndexScene');
});
// Clear button
this.createButton('清空', width - 260, 40, () => {
this.createButton('清空', width - 260, 40, async () => {
this.inventory = createGridInventory(this.GRID_WIDTH, this.GRID_HEIGHT);
this.scene.restart();
await this.sceneController.restart();
});
// Random fill button
this.createButton('随机填充', width - 130, 40, () => {
this.createButton('随机填充', width - 130, 40, async () => {
this.randomFill();
this.scene.restart();
await this.sceneController.restart();
});
}