Improved file structure

This commit is contained in:
Eduard Urbach 2024-01-29 00:55:49 +01:00
parent a6278cedb1
commit bca8fdf610
Signed by: akyoto
GPG Key ID: C874F672B1AF20C0
12 changed files with 32 additions and 28 deletions

View File

@ -21,6 +21,10 @@ func handle_packet(data: PackedByteArray, _peer: PacketPeer):
return
var controller := player.controller as ProxyController
if !controller:
return
controller.server_position.x = x
controller.server_position.z = z

View File

@ -31,7 +31,7 @@ window/vsync/vsync_mode=0
[gui]
theme/custom="res://ui/theme.tres"
theme/custom="res://ui/theme/theme.tres"
[input]

View File

@ -3,13 +3,13 @@ extends Control
signal chat_message_submitted(message: String)
var on_ping_changed: Signal
var on_download_changed: Signal
var on_upload_changed: Signal
var on_message_received: Signal
var ping_changed: Signal
var download_changed: Signal
var upload_changed: Signal
var message_received: Signal
func _enter_tree():
on_ping_changed = %Ping.changed
on_download_changed = %Client.download_changed
on_upload_changed = %Client.upload_changed
on_message_received = %Chat.message_received
ping_changed = %Ping.changed
download_changed = %Client.download_changed
upload_changed = %Client.upload_changed
message_received = %Chat.message_received

View File

@ -6,8 +6,8 @@
[ext_resource type="Script" path="res://ui/debug/PingLabel.gd" id="3_xjdws"]
[ext_resource type="Script" path="res://ui/debug/PositionLabel.gd" id="4_beqf6"]
[ext_resource type="Script" path="res://ui/debug/VelocityLabel.gd" id="5_8lm6a"]
[ext_resource type="Script" path="res://ui/ChatBox.gd" id="5_vdqtm"]
[ext_resource type="Script" path="res://ui/ChatInput.gd" id="6_70anv"]
[ext_resource type="Script" path="res://ui/chat/ChatBox.gd" id="5_43juw"]
[ext_resource type="Script" path="res://ui/chat/ChatInput.gd" id="6_cg2h5"]
[ext_resource type="Script" path="res://ui/debug/UploadLabel.gd" id="7_cfnpx"]
[ext_resource type="Script" path="res://ui/debug/DownloadLabel.gd" id="8_ogt38"]
@ -41,20 +41,20 @@ offset_top = -134.0
offset_right = 263.0
grow_vertical = 0
[node name="VBoxContainer" type="VBoxContainer" parent="CanvasLayer/BottomLeft"]
[node name="Chat" type="VBoxContainer" parent="CanvasLayer/BottomLeft"]
layout_mode = 2
alignment = 2
[node name="ChatBox" type="RichTextLabel" parent="CanvasLayer/BottomLeft/VBoxContainer"]
[node name="ChatBox" type="RichTextLabel" parent="CanvasLayer/BottomLeft/Chat"]
layout_mode = 2
size_flags_vertical = 3
bbcode_enabled = true
scroll_following = true
script = ExtResource("5_vdqtm")
script = ExtResource("5_43juw")
[node name="ChatInput" type="LineEdit" parent="CanvasLayer/BottomLeft/VBoxContainer"]
[node name="ChatInput" type="LineEdit" parent="CanvasLayer/BottomLeft/Chat"]
layout_mode = 2
script = ExtResource("6_70anv")
script = ExtResource("6_cg2h5")
[node name="BottomRight" type="MarginContainer" parent="CanvasLayer"]
anchors_preset = 3
@ -102,6 +102,6 @@ layout_mode = 2
alignment = 2
script = ExtResource("5_8lm6a")
[connection signal="focus_entered" from="CanvasLayer/BottomLeft/VBoxContainer/ChatInput" to="CanvasLayer/BottomLeft/VBoxContainer/ChatInput" method="_on_focus_entered"]
[connection signal="focus_exited" from="CanvasLayer/BottomLeft/VBoxContainer/ChatInput" to="CanvasLayer/BottomLeft/VBoxContainer/ChatInput" method="_on_focus_exited"]
[connection signal="text_submitted" from="CanvasLayer/BottomLeft/VBoxContainer/ChatInput" to="CanvasLayer/BottomLeft/VBoxContainer/ChatInput" method="_on_text_submitted"]
[connection signal="focus_entered" from="CanvasLayer/BottomLeft/Chat/ChatInput" to="CanvasLayer/BottomLeft/Chat/ChatInput" method="_on_focus_entered"]
[connection signal="focus_exited" from="CanvasLayer/BottomLeft/Chat/ChatInput" to="CanvasLayer/BottomLeft/Chat/ChatInput" method="_on_focus_exited"]
[connection signal="text_submitted" from="CanvasLayer/BottomLeft/Chat/ChatInput" to="CanvasLayer/BottomLeft/Chat/ChatInput" method="_on_text_submitted"]

View File

@ -1,7 +1,7 @@
extends RichTextLabel
func _ready():
owner.on_message_received.connect(on_message_received)
owner.message_received.connect(on_message_received)
func on_message_received(bbcode: String):
append_text(bbcode + "\n")

View File

@ -1,7 +1,7 @@
class_name DebugLabel
extends Control
var text : String :
var text: String:
get:
return get_child(1).text
set(value):

View File

@ -1,7 +1,7 @@
extends DebugLabel
func _ready():
owner.on_download_changed.connect(on_download_changed)
owner.download_changed.connect(on_download_changed)
func on_download_changed(download):
text = "%d bytes" % download

View File

@ -1,7 +1,7 @@
extends DebugLabel
func _ready():
owner.on_ping_changed.connect(on_ping_changed)
owner.ping_changed.connect(on_ping_changed)
func on_ping_changed(ping):
text = str(snapped(ping * 1000, 1)) + " ms"

View File

@ -1,7 +1,7 @@
extends DebugLabel
func _ready():
owner.on_upload_changed.connect(on_upload_changed)
owner.upload_changed.connect(on_upload_changed)
func on_upload_changed(upload):
text = "%d bytes" % upload

View File

@ -3,12 +3,12 @@
importer="font_data_dynamic"
type="FontFile"
uid="uid://b7mov13kwi8u8"
path="res://.godot/imported/ubuntu_nf_regular.ttf-feed7a5a59b6d10a4a32843efe52a9da.fontdata"
path="res://.godot/imported/ubuntu_nf_regular.ttf-b453c07942f661257c0c0781f805a134.fontdata"
[deps]
source_file="res://ui/ubuntu_nf_regular.ttf"
dest_files=["res://.godot/imported/ubuntu_nf_regular.ttf-feed7a5a59b6d10a4a32843efe52a9da.fontdata"]
source_file="res://ui/font/ubuntu_nf_regular.ttf"
dest_files=["res://.godot/imported/ubuntu_nf_regular.ttf-b453c07942f661257c0c0781f805a134.fontdata"]
[params]

View File

@ -1,6 +1,6 @@
[gd_resource type="Theme" load_steps=2 format=3 uid="uid://caqphxkvcu3tb"]
[ext_resource type="FontFile" uid="uid://b7mov13kwi8u8" path="res://ui/ubuntu_nf_regular.ttf" id="1_1unma"]
[ext_resource type="FontFile" uid="uid://b7mov13kwi8u8" path="res://ui/font/ubuntu_nf_regular.ttf" id="1_1unma"]
[resource]
default_font = ExtResource("1_1unma")