Improved UI event system

This commit is contained in:
2024-02-25 23:01:17 +01:00
parent 44fd041c60
commit 0a489e5d2f
16 changed files with 138 additions and 152 deletions

View 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

View 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