Improved file structure
This commit is contained in:
parent
a6278cedb1
commit
bca8fdf610
@ -21,6 +21,10 @@ func handle_packet(data: PackedByteArray, _peer: PacketPeer):
|
|||||||
return
|
return
|
||||||
|
|
||||||
var controller := player.controller as ProxyController
|
var controller := player.controller as ProxyController
|
||||||
|
|
||||||
|
if !controller:
|
||||||
|
return
|
||||||
|
|
||||||
controller.server_position.x = x
|
controller.server_position.x = x
|
||||||
controller.server_position.z = z
|
controller.server_position.z = z
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ window/vsync/vsync_mode=0
|
|||||||
|
|
||||||
[gui]
|
[gui]
|
||||||
|
|
||||||
theme/custom="res://ui/theme.tres"
|
theme/custom="res://ui/theme/theme.tres"
|
||||||
|
|
||||||
[input]
|
[input]
|
||||||
|
|
||||||
|
@ -3,13 +3,13 @@ extends Control
|
|||||||
|
|
||||||
signal chat_message_submitted(message: String)
|
signal chat_message_submitted(message: String)
|
||||||
|
|
||||||
var on_ping_changed: Signal
|
var ping_changed: Signal
|
||||||
var on_download_changed: Signal
|
var download_changed: Signal
|
||||||
var on_upload_changed: Signal
|
var upload_changed: Signal
|
||||||
var on_message_received: Signal
|
var message_received: Signal
|
||||||
|
|
||||||
func _enter_tree():
|
func _enter_tree():
|
||||||
on_ping_changed = %Ping.changed
|
ping_changed = %Ping.changed
|
||||||
on_download_changed = %Client.download_changed
|
download_changed = %Client.download_changed
|
||||||
on_upload_changed = %Client.upload_changed
|
upload_changed = %Client.upload_changed
|
||||||
on_message_received = %Chat.message_received
|
message_received = %Chat.message_received
|
||||||
|
@ -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/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/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/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/chat/ChatBox.gd" id="5_43juw"]
|
||||||
[ext_resource type="Script" path="res://ui/ChatInput.gd" id="6_70anv"]
|
[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/UploadLabel.gd" id="7_cfnpx"]
|
||||||
[ext_resource type="Script" path="res://ui/debug/DownloadLabel.gd" id="8_ogt38"]
|
[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
|
offset_right = 263.0
|
||||||
grow_vertical = 0
|
grow_vertical = 0
|
||||||
|
|
||||||
[node name="VBoxContainer" type="VBoxContainer" parent="CanvasLayer/BottomLeft"]
|
[node name="Chat" type="VBoxContainer" parent="CanvasLayer/BottomLeft"]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
alignment = 2
|
alignment = 2
|
||||||
|
|
||||||
[node name="ChatBox" type="RichTextLabel" parent="CanvasLayer/BottomLeft/VBoxContainer"]
|
[node name="ChatBox" type="RichTextLabel" parent="CanvasLayer/BottomLeft/Chat"]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
size_flags_vertical = 3
|
size_flags_vertical = 3
|
||||||
bbcode_enabled = true
|
bbcode_enabled = true
|
||||||
scroll_following = 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
|
layout_mode = 2
|
||||||
script = ExtResource("6_70anv")
|
script = ExtResource("6_cg2h5")
|
||||||
|
|
||||||
[node name="BottomRight" type="MarginContainer" parent="CanvasLayer"]
|
[node name="BottomRight" type="MarginContainer" parent="CanvasLayer"]
|
||||||
anchors_preset = 3
|
anchors_preset = 3
|
||||||
@ -102,6 +102,6 @@ layout_mode = 2
|
|||||||
alignment = 2
|
alignment = 2
|
||||||
script = ExtResource("5_8lm6a")
|
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_entered" from="CanvasLayer/BottomLeft/Chat/ChatInput" to="CanvasLayer/BottomLeft/Chat/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="focus_exited" from="CanvasLayer/BottomLeft/Chat/ChatInput" to="CanvasLayer/BottomLeft/Chat/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="text_submitted" from="CanvasLayer/BottomLeft/Chat/ChatInput" to="CanvasLayer/BottomLeft/Chat/ChatInput" method="_on_text_submitted"]
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
extends RichTextLabel
|
extends RichTextLabel
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
owner.on_message_received.connect(on_message_received)
|
owner.message_received.connect(on_message_received)
|
||||||
|
|
||||||
func on_message_received(bbcode: String):
|
func on_message_received(bbcode: String):
|
||||||
append_text(bbcode + "\n")
|
append_text(bbcode + "\n")
|
@ -1,7 +1,7 @@
|
|||||||
class_name DebugLabel
|
class_name DebugLabel
|
||||||
extends Control
|
extends Control
|
||||||
|
|
||||||
var text : String :
|
var text: String:
|
||||||
get:
|
get:
|
||||||
return get_child(1).text
|
return get_child(1).text
|
||||||
set(value):
|
set(value):
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
extends DebugLabel
|
extends DebugLabel
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
owner.on_download_changed.connect(on_download_changed)
|
owner.download_changed.connect(on_download_changed)
|
||||||
|
|
||||||
func on_download_changed(download):
|
func on_download_changed(download):
|
||||||
text = "%d bytes" % download
|
text = "%d bytes" % download
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
extends DebugLabel
|
extends DebugLabel
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
owner.on_ping_changed.connect(on_ping_changed)
|
owner.ping_changed.connect(on_ping_changed)
|
||||||
|
|
||||||
func on_ping_changed(ping):
|
func on_ping_changed(ping):
|
||||||
text = str(snapped(ping * 1000, 1)) + " ms"
|
text = str(snapped(ping * 1000, 1)) + " ms"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
extends DebugLabel
|
extends DebugLabel
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
owner.on_upload_changed.connect(on_upload_changed)
|
owner.upload_changed.connect(on_upload_changed)
|
||||||
|
|
||||||
func on_upload_changed(upload):
|
func on_upload_changed(upload):
|
||||||
text = "%d bytes" % upload
|
text = "%d bytes" % upload
|
||||||
|
@ -3,12 +3,12 @@
|
|||||||
importer="font_data_dynamic"
|
importer="font_data_dynamic"
|
||||||
type="FontFile"
|
type="FontFile"
|
||||||
uid="uid://b7mov13kwi8u8"
|
uid="uid://b7mov13kwi8u8"
|
||||||
path="res://.godot/imported/ubuntu_nf_regular.ttf-feed7a5a59b6d10a4a32843efe52a9da.fontdata"
|
path="res://.godot/imported/ubuntu_nf_regular.ttf-b453c07942f661257c0c0781f805a134.fontdata"
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://ui/ubuntu_nf_regular.ttf"
|
source_file="res://ui/font/ubuntu_nf_regular.ttf"
|
||||||
dest_files=["res://.godot/imported/ubuntu_nf_regular.ttf-feed7a5a59b6d10a4a32843efe52a9da.fontdata"]
|
dest_files=["res://.godot/imported/ubuntu_nf_regular.ttf-b453c07942f661257c0c0781f805a134.fontdata"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
@ -1,6 +1,6 @@
|
|||||||
[gd_resource type="Theme" load_steps=2 format=3 uid="uid://caqphxkvcu3tb"]
|
[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]
|
[resource]
|
||||||
default_font = ExtResource("1_1unma")
|
default_font = ExtResource("1_1unma")
|
Loading…
Reference in New Issue
Block a user