diary/user_interface/chat_panel/message_box.gd
mono 7d285bd607 - reworked Chat Panel system
- added user switching
- added Topic Panel functionality (features are missing)
- some basic refactoring
2022-05-14 20:51:48 +02:00

26 lines
723 B
GDScript

extends PanelContainer
onready var text_edit = get_node("MarginContainer/ContentFitTextEdit")
onready var message_denied_sound = get_node("MessageDeniedSound")
func _ready():
# warning-ignore:return_value_discarded
Users.connect("switched", self, "_on_user_switched")
func _on_message_box_confirmed(content):
if PingSystem.unhandled_ping_count == 0 and not content.empty():
text_edit.text = ""
text_edit._on_text_changed() # To go back to minimum height.
else:
message_denied_sound.play()
func _on_user_switched():
Users.get_inactive().message_box_content = text_edit.text
text_edit.text = Users.get_current().message_box_content
text_edit._on_text_changed() # To adjust height.
text_edit.select_all()