Improved UI event system
This commit is contained in:
11
client/ui/network/Network.gd
Normal file
11
client/ui/network/Network.gd
Normal file
@ -0,0 +1,11 @@
|
||||
class_name NetworkUI
|
||||
extends VBoxContainer
|
||||
|
||||
func set_ping(ping: float):
|
||||
%Ping.text = str(snapped(ping * 1000, 1)) + " ms"
|
||||
|
||||
func set_download(download: int):
|
||||
%Receive.text = "%d bytes" % download
|
||||
|
||||
func set_upload(upload: int):
|
||||
%Send.text = "%d bytes" % upload
|
23
client/ui/network/Network.tscn
Normal file
23
client/ui/network/Network.tscn
Normal file
@ -0,0 +1,23 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://bigr3od0vmicg"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://cch67vqpsmtej" path="res://ui/debug/DebugLabel.tscn" id="1_d3f0b"]
|
||||
[ext_resource type="Script" path="res://ui/network/Network.gd" id="1_dnvs4"]
|
||||
|
||||
[node name="Network" type="VBoxContainer"]
|
||||
alignment = 2
|
||||
script = ExtResource("1_dnvs4")
|
||||
|
||||
[node name="Ping" parent="." instance=ExtResource("1_d3f0b")]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
alignment = 2
|
||||
|
||||
[node name="Send" parent="." instance=ExtResource("1_d3f0b")]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
alignment = 2
|
||||
|
||||
[node name="Receive" parent="." instance=ExtResource("1_d3f0b")]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
alignment = 2
|
Reference in New Issue
Block a user