test-client-godot/scenes/GUI/HUD/chat_lines.gd
2018-08-18 10:22:19 +02:00

23 lines
800 B
GDScript

extends VBoxContainer
var line_edit_path = "../../../../footer_box/footer/footer_line_edit"
func _process(delta):
var content_scroll = get_node( "../.." )
content_scroll.scroll_vertical = 2*self.rect_size.y
func _on_footer_line_edit_gui_input( event ):
if event is InputEventKey:
if event.is_action_released( "chat_accept" ):
var line_edit = get_node( line_edit_path )
var new_text = line_edit.text
var new_line = RichTextLabel.new()
new_line.bbcode_enabled = true
new_line.bbcode_text = new_text
new_line.rect_min_size.y = global.font_size+4
new_line.scroll_active = false
new_line.selection_enabled = true
self.add_child( new_line )
line_edit.text = ""