close chat on submit
This commit is contained in:
parent
97c15d5b1b
commit
7ba087f6e1
@ -48,7 +48,6 @@ window/stretch/aspect="expand"
|
|||||||
[editor]
|
[editor]
|
||||||
|
|
||||||
movie_writer/movie_file="E:/Projects/Games/cadastery/build/records/movie.avi"
|
movie_writer/movie_file="E:/Projects/Games/cadastery/build/records/movie.avi"
|
||||||
movie_writer/fps=120
|
|
||||||
|
|
||||||
[filesystem]
|
[filesystem]
|
||||||
|
|
||||||
|
|||||||
@ -33,12 +33,14 @@ func _unhandled_input(event: InputEvent) -> void:
|
|||||||
return
|
return
|
||||||
|
|
||||||
if event.is_action_pressed("chat") and not open:
|
if event.is_action_pressed("chat") and not open:
|
||||||
open = true
|
_open()
|
||||||
_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 _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:
|
func _close() -> void:
|
||||||
open = false
|
open = false
|
||||||
@ -69,6 +71,7 @@ func _on_message_edit_text_submitted(message: String) -> void:
|
|||||||
if _message_edit.text == "":
|
if _message_edit.text == "":
|
||||||
return
|
return
|
||||||
_message_edit.text = ""
|
_message_edit.text = ""
|
||||||
|
_close()
|
||||||
_send_message.rpc(message)
|
_send_message.rpc(message)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user