From a6bc1ee1a91d1ddbbebe7f4cd7ffce24b08c69f2 Mon Sep 17 00:00:00 2001 From: osquallo Date: Sat, 18 Aug 2018 12:25:49 +0200 Subject: [PATCH] fix d'un probeleme de scrolling de la fenetre de chat. --- addons/ui_window/ui_window.gd | 1 + scenes/GUI/HUD/chat_lines.gd | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/addons/ui_window/ui_window.gd b/addons/ui_window/ui_window.gd index d8566ad..4cae4a4 100644 --- a/addons/ui_window/ui_window.gd +++ b/addons/ui_window/ui_window.gd @@ -1,3 +1,4 @@ +tool extends MarginContainer export(bool) var is_movable = true diff --git a/scenes/GUI/HUD/chat_lines.gd b/scenes/GUI/HUD/chat_lines.gd index e9f3f0f..016535c 100644 --- a/scenes/GUI/HUD/chat_lines.gd +++ b/scenes/GUI/HUD/chat_lines.gd @@ -2,10 +2,13 @@ extends VBoxContainer var line_edit_path = "../../../../footer_box/footer/footer_line_edit" +var new_line_added = false func _process(delta): - var content_scroll = get_node( "../.." ) - content_scroll.scroll_vertical = 2*self.rect_size.y + if new_line_added: + var content_scroll = get_node( "../.." ) + content_scroll.scroll_vertical = 2*self.rect_size.y + new_line_added = false func _on_footer_line_edit_gui_input( event ): @@ -21,3 +24,4 @@ func _on_footer_line_edit_gui_input( event ): new_line.selection_enabled = true self.add_child( new_line ) line_edit.text = "" + new_line_added = true