small racing game im working on
Diffstat (limited to 'ui/editor/undo.gd')
-rw-r--r--ui/editor/undo.gd13
1 files changed, 13 insertions, 0 deletions
diff --git a/ui/editor/undo.gd b/ui/editor/undo.gd
new file mode 100644
index 0000000..c66186b
--- /dev/null
+++ b/ui/editor/undo.gd
@@ -0,0 +1,13 @@
+extends Button
+
+@onready var hist: UndoRedo = owner.history
+
+func _pressed() -> void:
+ owner.reset_selected()
+ hist.undo()
+
+func _ready() -> void:
+ hist.version_changed.connect(
+ func():
+ disabled = !hist.has_undo()
+ )