moved chat to new ChatPanel and added smooth bottom scrolling when new message is received

This commit is contained in:
2025-07-20 13:36:30 +02:00
parent 4fe629d012
commit 3cf036db42
8 changed files with 274 additions and 79 deletions
+7
View File
@@ -0,0 +1,7 @@
class_name ChatMessage
extends Control
@export var text_label: Label
func set_message(message: String) -> void:
text_label.text = message
+1
View File
@@ -0,0 +1 @@
uid://bacaxh2y0sjss
+35
View File
@@ -0,0 +1,35 @@
[gd_scene load_steps=2 format=3 uid="uid://docnx7algl78k"]
[ext_resource type="Script" uid="uid://bacaxh2y0sjss" path="res://ui/chat_message.gd" id="1_vmwh1"]
[node name="ChatMessage" type="MarginContainer" node_paths=PackedStringArray("text_label")]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/margin_left = 4
theme_override_constants/margin_top = 2
theme_override_constants/margin_right = 4
theme_override_constants/margin_bottom = 2
script = ExtResource("1_vmwh1")
text_label = NodePath("MarginContainer/Label")
[node name="ColorRect" type="ColorRect" parent="."]
show_behind_parent = true
layout_mode = 2
color = Color(1, 0.33, 0.33, 1)
metadata/_edit_use_anchors_ = true
[node name="MarginContainer" type="MarginContainer" parent="."]
layout_mode = 2
theme_override_constants/margin_left = 2
theme_override_constants/margin_top = 2
theme_override_constants/margin_right = 2
theme_override_constants/margin_bottom = 2
[node name="Label" type="Label" parent="MarginContainer"]
custom_minimum_size = Vector2(20, 10)
layout_mode = 2
text = "asdf asdufasdoiufoias doifaosid ofiuasoi djhfas df as f"
autowrap_mode = 3