Split client and server
This commit is contained in:
8
client/ui/debug/DebugLabel.gd
Normal file
8
client/ui/debug/DebugLabel.gd
Normal 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
|
15
client/ui/debug/DebugLabel.tscn
Normal file
15
client/ui/debug/DebugLabel.tscn
Normal 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
|
5
client/ui/debug/DebugLabelText.gd
Normal file
5
client/ui/debug/DebugLabelText.gd
Normal file
@ -0,0 +1,5 @@
|
||||
@tool
|
||||
extends Label
|
||||
|
||||
func _ready():
|
||||
text = get_parent().name + ":"
|
4
client/ui/debug/FPSLabel.gd
Normal file
4
client/ui/debug/FPSLabel.gd
Normal file
@ -0,0 +1,4 @@
|
||||
extends DebugLabel
|
||||
|
||||
func _process(_delta):
|
||||
text = str(Engine.get_frames_per_second())
|
6
client/ui/debug/PerformanceLabel.gd
Normal file
6
client/ui/debug/PerformanceLabel.gd
Normal file
@ -0,0 +1,6 @@
|
||||
extends DebugLabel
|
||||
|
||||
@export var monitor: Performance.Monitor
|
||||
|
||||
func _process(_delta):
|
||||
text = str(Performance.get_monitor(monitor))
|
7
client/ui/debug/PingLabel.gd
Normal file
7
client/ui/debug/PingLabel.gd
Normal 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"
|
7
client/ui/debug/PositionLabel.gd
Normal file
7
client/ui/debug/PositionLabel.gd
Normal file
@ -0,0 +1,7 @@
|
||||
extends DebugLabel
|
||||
|
||||
func _process(_delta):
|
||||
if Global.player == null:
|
||||
return
|
||||
|
||||
text = str(Global.player.global_position)
|
7
client/ui/debug/VelocityLabel.gd
Normal file
7
client/ui/debug/VelocityLabel.gd
Normal file
@ -0,0 +1,7 @@
|
||||
extends DebugLabel
|
||||
|
||||
func _process(_delta):
|
||||
if Global.player == null:
|
||||
return
|
||||
|
||||
text = str(Global.player.velocity)
|
Reference in New Issue
Block a user