From 6d6596a5621b26301246ebfccfce9a401d50ea8d Mon Sep 17 00:00:00 2001 From: yangwen Date: Wed, 21 May 2025 11:52:37 +0800 Subject: [PATCH] fix undo problem --- src/views/Stage.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/views/Stage.ts b/src/views/Stage.ts index 46a7c52..6d4887a 100644 --- a/src/views/Stage.ts +++ b/src/views/Stage.ts @@ -249,6 +249,12 @@ export class Stage extends Laya.Script { } this.onSetBlock(this.selectedBlock) this.onUpdateScore() + var undos = this.data.get_undos() + if (undos.length > 0) { + var last = undos[undos.length-1] + this.selectedBlock = this.blocks[last.index] + this.onApplyBlock(this.selectedBlock) + } } }