# Hurry Curry! - a game about cooking # Copyright 2024 nokoe # Copyright 2024 tpart # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, version 3 of the License only. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . # class_name ChatBubble extends MeshInstance3D signal submit_message @onready var label: Label = $SubViewport/ChatMessage/Label @onready var input: LineEdit = $LineEdit var editing := false func set_text(t: String): visible = true label.text = t func remove_text(): visible = false label.text = "" func edit(): visible = true label.text = "" editing = true input.grab_focus() func stop_edit(): visible = false editing = false input.release_focus() if input.text != "": submit_message.emit(input.text) input.text = "" func _on_line_edit_text_changed(new_text): label.text = new_text