29 lines
583 B
GDScript
29 lines
583 B
GDScript
extends TextEdit
|
|
|
|
|
|
func _ready() -> void:
|
|
text = Options.scoreboard_name
|
|
|
|
|
|
func _exit_tree() -> void:
|
|
Options.entry = false
|
|
|
|
|
|
func _on_text_changed() -> void:
|
|
text = text.substr(0, 10).to_lower().strip_escapes()
|
|
Options.scoreboard_name = text
|
|
cursor_set_column(text.length())
|
|
|
|
|
|
func _on_focus_entered() -> void:
|
|
Options.entry = true
|
|
cursor_set_column(text.length())
|
|
|
|
|
|
func _on_focus_exited() -> void:
|
|
Options.set_deferred("entry", false)
|
|
|
|
|
|
func _on_gui_input(event: InputEvent) -> void:
|
|
if event.is_action_pressed("text_enter"):
|
|
get_node(focus_neighbour_top).grab_focus()
|