copy from thegates-jam repo

This commit is contained in:
Nordup 2024-03-31 09:25:42 +04:00
parent c1a7ad74e1
commit 1a335de566
523 changed files with 22408 additions and 0 deletions

29
ui/change_name.gd Normal file
View file

@ -0,0 +1,29 @@
extends LineEdit
var is_changing: bool
func _ready() -> void:
text_submitted.connect(on_text_submitted)
focus_entered.connect(start_edit)
func _input(event: InputEvent) -> void:
if not event.is_action_pressed("change_name"): return
if is_changing: return
start_edit.call_deferred()
func start_edit() -> void:
is_changing = true
EditMode.set_enabled(true)
grab_click_focus()
grab_focus()
caret_column = text.length()
func on_text_submitted(_text: String) -> void:
is_changing = false
EditMode.set_enabled(false)
release_focus()