summaryrefslogtreecommitdiff
path: root/chat_window.gd
diff options
context:
space:
mode:
authorDaniel Weipert <git@mail.dweipert.de>2024-12-12 02:12:52 +0100
committerDaniel Weipert <git@mail.dweipert.de>2024-12-12 02:12:52 +0100
commita22381eff3bf2286ee27f4d15ddf4c431ea063be (patch)
tree965bdcf12e5e0cf63c88cbba1bd5a52ba474f81f /chat_window.gd
parente3c185e05823e30eccd7728ceda2ee57cc66fd4d (diff)
next commit
Diffstat (limited to 'chat_window.gd')
-rw-r--r--chat_window.gd19
1 files changed, 19 insertions, 0 deletions
diff --git a/chat_window.gd b/chat_window.gd
new file mode 100644
index 0000000..cbf9d6f
--- /dev/null
+++ b/chat_window.gd
@@ -0,0 +1,19 @@
+extends PanelContainer
+
+
+func add_message(message: String):
+ var label = Label.new()
+ label.text = message
+ %ChatWindow.add_child(label)
+
+ %ScrollContainer.set_deferred("scroll_vertical", %ScrollContainer.get_v_scroll_bar().max_value)
+ # TODO: doesn't reach bottom?
+
+
+func _on_line_edit_text_submitted(new_text: String) -> void:
+ %LineEdit.text = ""
+ #add_message(new_text)
+
+ var send_chat_message_packet := SendChatMessagePacket.new()
+ send_chat_message_packet.message = "%s : %s" % ["secondi", new_text]
+ Network.map_server.send(send_chat_message_packet)