1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-28 15:01:53 +08:00
Files
Dog-Lynx-And-HCN/scripts/Statemachine/Composables.gd
T

17 lines
383 B
GDScript
Raw Normal View History

class_name Composables
static func useHistoryStack(input: LineEdit):
var stack = Reference.new([input.text])
var lastText = Reference.new("")
var getLast = func(index: int):
return stack.getData()[stack.getData().size() - index - 1]
input.text_changed.connect(func(text):
lastText.setData(text)
stack.getData().append(text)
)
return [
stack,
getLast,
lastText
]