make messages scroll to bottom on new messages

This commit is contained in:
2025-02-14 01:05:40 +10:00
parent d90c0e5ee7
commit 76676f53f5
2 changed files with 43 additions and 11 deletions

View File

@@ -5,10 +5,11 @@
[node name="Chat" type="CanvasLayer"]
script = ExtResource("1_ulx3h")
[node name="Root" type="MarginContainer" parent="."]
[node name="MsgMargin" type="MarginContainer" parent="."]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_bottom = -70.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3
@@ -17,20 +18,19 @@ mouse_filter = 2
theme_override_constants/margin_left = 50
theme_override_constants/margin_top = 20
theme_override_constants/margin_right = 50
theme_override_constants/margin_bottom = 20
[node name="VBox" type="VBoxContainer" parent="Root"]
[node name="MsgVBox" type="VBoxContainer" parent="MsgMargin"]
layout_mode = 2
mouse_filter = 2
theme_override_constants/separation = 0
[node name="MsgScroll" type="ScrollContainer" parent="Root/VBox"]
[node name="MsgScroll" type="ScrollContainer" parent="MsgMargin/MsgVBox"]
layout_mode = 2
size_flags_vertical = 3
mouse_filter = 2
follow_focus = true
horizontal_scroll_mode = 0
[node name="MsgMargin" type="MarginContainer" parent="Root/VBox/MsgScroll"]
[node name="MsgMargin" type="MarginContainer" parent="MsgMargin/MsgVBox/MsgScroll"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
@@ -39,13 +39,33 @@ theme_override_constants/margin_left = 10
theme_override_constants/margin_right = 10
theme_override_constants/margin_bottom = 30
[node name="MsgContainer" type="VBoxContainer" parent="Root/VBox/MsgScroll/MsgMargin"]
[node name="MsgContainer" type="VBoxContainer" parent="MsgMargin/MsgVBox/MsgScroll/MsgMargin"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
mouse_filter = 2
alignment = 2
[node name="MessageEdit" type="LineEdit" parent="Root/VBox"]
[node name="EditMargin" type="MarginContainer" parent="."]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_top = 1016.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3
size_flags_vertical = 3
mouse_filter = 2
theme_override_constants/margin_left = 50
theme_override_constants/margin_right = 50
theme_override_constants/margin_bottom = 20
[node name="EditVBox" type="VBoxContainer" parent="EditMargin"]
layout_mode = 2
mouse_filter = 2
theme_override_constants/separation = 0
alignment = 2
[node name="MessageEdit" type="LineEdit" parent="EditMargin/EditVBox"]
layout_mode = 2
theme_override_font_sizes/font_size = 26