2018-08-18 08:22:19 +00:00
|
|
|
extends VBoxContainer
|
|
|
|
|
|
|
|
|
|
|
|
var line_edit_path = "../../../../footer_box/footer/footer_line_edit"
|
2018-08-18 10:25:49 +00:00
|
|
|
var new_line_added = false
|
2018-08-18 08:22:19 +00:00
|
|
|
|
|
|
|
func _process(delta):
|
2018-08-19 09:58:35 +00:00
|
|
|
if self.new_line_added:
|
2018-08-18 10:25:49 +00:00
|
|
|
var content_scroll = get_node( "../.." )
|
|
|
|
content_scroll.scroll_vertical = 2*self.rect_size.y
|
2018-08-19 09:58:35 +00:00
|
|
|
self.new_line_added = false
|
2018-08-18 08:22:19 +00:00
|
|
|
|
|
|
|
|
|
|
|
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 = ""
|
2018-08-19 09:58:35 +00:00
|
|
|
self.new_line_added = true
|