add a chat window

This commit is contained in:
2026-01-11 14:07:53 +01:00
parent 26de2ca6e0
commit 7b030cb3af
6 changed files with 496 additions and 3 deletions

66
src/scenes/chat_ui.tscn Normal file
View File

@@ -0,0 +1,66 @@
[gd_scene format=3 uid="uid://chatui1234567"]
[ext_resource type="Script" path="res://scripts/chat_ui.gd" id="1_chat_ui"]
[ext_resource type="FontFile" path="res://assets/fonts/Metropolis/TrueType/Metropolis-Regular.ttf" id="2_metropolis"]
[sub_resource type="Theme" id="Theme_metropolis"]
default_font = ExtResource("2_metropolis")
default_font_size = 12
[node name="ChatUI" type="CanvasLayer" unique_id=2000000000]
layer = 200
script = ExtResource("1_chat_ui")
[node name="ChatContainer" type="Control" parent="." unique_id=3000000000]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 1
[node name="BottomLeft" type="MarginContainer" parent="ChatContainer" unique_id=4000000000]
layout_mode = 1
anchors_preset = 1
anchor_left = 0.0
anchor_top = 1.0
anchor_right = 0.0
anchor_bottom = 1.0
offset_left = 10.0
offset_top = -200.0
offset_right = 400.0
offset_bottom = -10.0
grow_horizontal = 0
grow_vertical = 0
[node name="Background" type="ColorRect" parent="ChatContainer/BottomLeft" unique_id=5000000000]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
color = Color(0, 0, 0, 0.5)
mouse_filter = 1
visible = false
[node name="VBox" type="VBoxContainer" parent="ChatContainer/BottomLeft" unique_id=6000000000]
layout_mode = 2
[node name="MessageScroll" type="ScrollContainer" parent="ChatContainer/BottomLeft/VBox" unique_id=7000000000]
layout_mode = 2
size_flags_vertical = 3
custom_minimum_size = Vector2(380, 150)
[node name="MessageList" type="VBoxContainer" parent="ChatContainer/BottomLeft/VBox/MessageScroll" unique_id=8000000000]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="ChatInput" type="LineEdit" parent="ChatContainer/BottomLeft/VBox" unique_id=10000000000]
layout_mode = 2
size_flags_horizontal = 3
theme = SubResource("Theme_metropolis")
placeholder_text = "Type a message..."
visible = false