hurrmmm/godot/UI/TAS UI/TAS UI.gd

29 lines
601 B
GDScript

extends Control
func _input(event):
var f: Callable
if event.is_pressed():
f = press
else:
f = release
if event.is_action("regress"):
f.call($FrameButtons/RegressButton)
elif event.is_action("advance"):
f.call($FrameButtons/AdvanceButton)
elif event.is_action("increment"):
if TAS_System.IsIncrementingFrames:
f.call($TASButtons/StopIncrementButton)
else:
f.call($TASButtons/StartIncrementButton)
func press(btn: Button):
btn.button_pressed = true
btn.pressed.emit()
btn.button_down.emit()
func release(btn: Button):
btn.button_pressed = false
btn.button_up.emit()