small racing game im working on
1
2
3
4
5
6
7
8
9
10
11
12
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()
	)