close chat on submit

This commit is contained in:
Teatov 2025-02-14 23:24:19 +10:00
parent 97c15d5b1b
commit 7ba087f6e1
2 changed files with 8 additions and 6 deletions

View File

@ -48,7 +48,6 @@ window/stretch/aspect="expand"
[editor]
movie_writer/movie_file="E:/Projects/Games/cadastery/build/records/movie.avi"
movie_writer/fps=120
[filesystem]

View File

@ -33,12 +33,14 @@ func _unhandled_input(event: InputEvent) -> void:
return
if event.is_action_pressed("chat") and not open:
open = true
_message_edit.visible = true
_message_edit.grab_focus()
_msg_scroll.vertical_scroll_mode = ScrollContainer.SCROLL_MODE_AUTO
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
_open()
func _open()->void:
open = true
_message_edit.visible = true
_message_edit.grab_focus()
_msg_scroll.vertical_scroll_mode = ScrollContainer.SCROLL_MODE_AUTO
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
func _close() -> void:
open = false
@ -69,6 +71,7 @@ func _on_message_edit_text_submitted(message: String) -> void:
if _message_edit.text == "":
return
_message_edit.text = ""
_close()
_send_message.rpc(message)