Split client and server

This commit is contained in:
2024-01-24 00:09:50 +01:00
parent 532a1faa21
commit 26c52a00b3
59 changed files with 335 additions and 142 deletions

View File

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

View File

@ -0,0 +1,15 @@
[gd_scene load_steps=3 format=3 uid="uid://cch67vqpsmtej"]
[ext_resource type="Script" path="res://ui/debug/DebugLabel.gd" id="1_xfly0"]
[ext_resource type="Script" path="res://ui/debug/DebugLabelText.gd" id="2_i4ix0"]
[node name="Container" type="HBoxContainer"]
script = ExtResource("1_xfly0")
[node name="Text" type="Label" parent="."]
layout_mode = 2
text = ":"
script = ExtResource("2_i4ix0")
[node name="Value" type="Label" parent="."]
layout_mode = 2

View File

@ -0,0 +1,5 @@
@tool
extends Label
func _ready():
text = get_parent().name + ":"

View File

@ -0,0 +1,4 @@
extends DebugLabel
func _process(_delta):
text = str(Engine.get_frames_per_second())

View File

@ -0,0 +1,6 @@
extends DebugLabel
@export var monitor: Performance.Monitor
func _process(_delta):
text = str(Performance.get_monitor(monitor))

View File

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

View File

@ -0,0 +1,7 @@
extends DebugLabel
func _process(_delta):
if Global.player == null:
return
text = str(Global.player.global_position)

View File

@ -0,0 +1,7 @@
extends DebugLabel
func _process(_delta):
if Global.player == null:
return
text = str(Global.player.velocity)

1
client/ui/icon.svg Normal file
View File

@ -0,0 +1 @@
<svg height="128" width="128" xmlns="http://www.w3.org/2000/svg"><rect x="2" y="2" width="124" height="124" rx="14" fill="#363d52" stroke="#212532" stroke-width="4"/><g transform="scale(.101) translate(122 122)"><g fill="#fff"><path d="M105 673v33q407 354 814 0v-33z"/><path fill="#478cbf" d="m105 673 152 14q12 1 15 14l4 67 132 10 8-61q2-11 15-15h162q13 4 15 15l8 61 132-10 4-67q3-13 15-14l152-14V427q30-39 56-81-35-59-83-108-43 20-82 47-40-37-88-64 7-51 8-102-59-28-123-42-26 43-46 89-49-7-98 0-20-46-46-89-64 14-123 42 1 51 8 102-48 27-88 64-39-27-82-47-48 49-83 108 26 42 56 81zm0 33v39c0 276 813 276 813 0v-39l-134 12-5 69q-2 10-14 13l-162 11q-12 0-16-11l-10-65H447l-10 65q-4 11-16 11l-162-11q-12-3-14-13l-5-69z"/><path d="M483 600c3 34 55 34 58 0v-86c-3-34-55-34-58 0z"/><circle cx="725" cy="526" r="90"/><circle cx="299" cy="526" r="90"/></g><g fill="#414042"><circle cx="307" cy="532" r="60"/><circle cx="717" cy="532" r="60"/></g></g></svg>

After

Width:  |  Height:  |  Size: 950 B

37
client/ui/icon.svg.import Normal file
View File

@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://biplb56hj51h7"
path="res://.godot/imported/icon.svg-57a480398ce0db3d1582eb3ec78dffaa.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://ui/icon.svg"
dest_files=["res://.godot/imported/icon.svg-57a480398ce0db3d1582eb3ec78dffaa.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

10
client/ui/theme.tres Normal file
View File

@ -0,0 +1,10 @@
[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"]
[resource]
default_font = ExtResource("1_1unma")
MarginContainer/constants/margin_bottom = 5
MarginContainer/constants/margin_left = 5
MarginContainer/constants/margin_right = 5
MarginContainer/constants/margin_top = 5

View File

@ -0,0 +1,38 @@
[remap]
importer="font_data_dynamic"
type="FontFile"
uid="uid://b7mov13kwi8u8"
path="res://.godot/imported/ubuntu_nf_regular.ttf-feed7a5a59b6d10a4a32843efe52a9da.fontdata"
[deps]
source_file="res://ui/ubuntu_nf_regular.ttf"
dest_files=["res://.godot/imported/ubuntu_nf_regular.ttf-feed7a5a59b6d10a4a32843efe52a9da.fontdata"]
[params]
Rendering=null
antialiasing=1
generate_mipmaps=false
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
allow_system_fallback=true
force_autohinter=false
hinting=1
subpixel_positioning=1
oversampling=0.0
Fallbacks=null
fallbacks=[]
Compress=null
compress=true
preload=[{
"chars": [],
"glyphs": [],
"name": "New Configuration",
"size": Vector2i(16, 0)
}]
language_support={}
script_support={}
opentype_features={}