updates
125
addons/GD-Sync/UI/ConfigMenu/ConfigMenu.gd
Normal file
|
|
@ -0,0 +1,125 @@
|
|||
@tool
|
||||
extends Control
|
||||
|
||||
#Copyright (c) 2023-present GD-Sync.
|
||||
#All rights reserved.
|
||||
#
|
||||
#Redistribution and use in source form, with or without modification,
|
||||
#are permitted provided that the following conditions are met:
|
||||
#
|
||||
#1. Redistributions of source code must retain the above copyright notice,
|
||||
# this list of conditions and the following disclaimer.
|
||||
#
|
||||
#2. Neither the name of GD-Sync nor the names of its contributors may be used
|
||||
# to endorse or promote products derived from this software without specific
|
||||
# prior written permission.
|
||||
#
|
||||
#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
#EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
#OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
#SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
#INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
||||
#TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
#BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
#CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
#ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
#SUCH DAMAGE.
|
||||
|
||||
const KeyStore = preload("res://addons/GD-Sync/Scripts/KeyStore.gd")
|
||||
|
||||
var plugin
|
||||
|
||||
var menu_open : bool = false
|
||||
|
||||
var updater : Updater
|
||||
|
||||
func _ready():
|
||||
if plugin == null: return
|
||||
|
||||
var keys : Dictionary = KeyStore.load_keys()
|
||||
%PublicKey.text = keys["PublicKey"]
|
||||
%PrivateKey.text = keys["PrivateKey"]
|
||||
|
||||
if ProjectSettings.has_setting("GD-Sync/protectedMode"):
|
||||
%Protected.button_pressed = ProjectSettings.get_setting("GD-Sync/protectedMode")
|
||||
if ProjectSettings.has_setting("GD-Sync/csharp"):
|
||||
%CSharpSupport.button_pressed = ProjectSettings.get_setting("GD-Sync/csharp")
|
||||
if ProjectSettings.has_setting("GD-Sync/uniqueUsername"):
|
||||
%UniqueUsernames.button_pressed = ProjectSettings.get_setting("GD-Sync/uniqueUsername")
|
||||
if ProjectSettings.has_setting("GD-Sync/scriptValidation"):
|
||||
%ScriptValidation.button_pressed = ProjectSettings.get_setting("GD-Sync/scriptValidation")
|
||||
|
||||
updater = Updater.new()
|
||||
updater.update_label = %UpdateLabel
|
||||
add_child(updater)
|
||||
|
||||
func update_ready() -> void:
|
||||
%DefaultPannel.visible = false
|
||||
%UpdatePanel.visible = true
|
||||
|
||||
func _input(event):
|
||||
if !menu_open: return
|
||||
if event is InputEventKey:
|
||||
if event.is_pressed() and event.keycode == KEY_ESCAPE:
|
||||
close()
|
||||
|
||||
func open():
|
||||
menu_open = true
|
||||
$AnimationPlayer.play("Open")
|
||||
|
||||
var scale : float = size.y/1080.0
|
||||
$CenterContainer/LogoAnchor/Logo.scale = Vector2.ONE*scale
|
||||
$CenterContainer/UIAnchor/UI.scale = Vector2.ONE*scale
|
||||
|
||||
func close():
|
||||
menu_open = false
|
||||
$AnimationPlayer.play_backwards("Open")
|
||||
|
||||
func _on_PublicKey_text_changed(new_text):
|
||||
KeyStore.ensure_gitignore()
|
||||
KeyStore.save_keys(new_text, %PrivateKey.text)
|
||||
|
||||
func _on_PrivateKey_text_changed(new_text):
|
||||
KeyStore.ensure_gitignore()
|
||||
KeyStore.save_keys(%PublicKey.text, new_text)
|
||||
|
||||
func _on_c_sharp_support_toggled(button_pressed):
|
||||
ProjectSettings.set_setting("GD-Sync/csharp", button_pressed)
|
||||
ProjectSettings.save()
|
||||
|
||||
if button_pressed:
|
||||
plugin.enable_csharp_api()
|
||||
else:
|
||||
plugin.disable_csharp_api()
|
||||
|
||||
func _on_protected_toggled(button_pressed):
|
||||
ProjectSettings.set_setting("GD-Sync/protectedMode", button_pressed)
|
||||
ProjectSettings.save()
|
||||
|
||||
func _on_unique_usernames_toggled(button_pressed):
|
||||
ProjectSettings.set_setting("GD-Sync/uniqueUsername", button_pressed)
|
||||
ProjectSettings.save()
|
||||
|
||||
func _on_script_validation_toggled(button_pressed) -> void:
|
||||
ProjectSettings.set_setting("GD-Sync/scriptValidation", button_pressed)
|
||||
ProjectSettings.save()
|
||||
|
||||
func _on_description_meta_clicked(meta):
|
||||
if meta == "log":
|
||||
meta = OS.get_user_data_dir()+"/GD-Sync/logs"
|
||||
OS.shell_open(meta)
|
||||
|
||||
func _on_update_button_pressed() -> void:
|
||||
%LoadIcon.play()
|
||||
$AnimationPlayer.play("Downloading")
|
||||
|
||||
var result : bool = await updater.update_repo()
|
||||
|
||||
%DefaultPannel.visible = true
|
||||
%UpdatePanel.visible = false
|
||||
$AnimationPlayer.play_backwards("Downloading")
|
||||
|
||||
if result:
|
||||
plugin.show_message("[color=#61ff71][b]The newest version of GD-Sync has been installed. Please restart the engine to complete the update.[/b][/color]", 10.0)
|
||||
else:
|
||||
plugin.show_message("[color=indianred][b]GD-Sync failed to update. Please try downloading it from the Godot Asset Library instead.[/b][/color]")
|
||||
1
addons/GD-Sync/UI/ConfigMenu/ConfigMenu.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://ctbm12j05lk6h
|
||||
916
addons/GD-Sync/UI/ConfigMenu/ConfigMenu.tscn
Normal file
|
|
@ -0,0 +1,916 @@
|
|||
[gd_scene format=3 uid="uid://1ho7vq1qum7y"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://ctbm12j05lk6h" path="res://addons/GD-Sync/UI/ConfigMenu/ConfigMenu.gd" id="1"]
|
||||
[ext_resource type="Theme" uid="uid://5whm1igkt23h" path="res://addons/GD-Sync/UI/ConfigMenu/GD-Theme.tres" id="2_wd24h"]
|
||||
[ext_resource type="Texture2D" uid="uid://d2pl6xyfyub5k" path="res://addons/GD-Sync/UI/ConfigMenu/GDSLogo.png" id="3_eccmp"]
|
||||
[ext_resource type="Texture2D" uid="uid://o7408i2pu2eb" path="res://addons/GD-Sync/UI/Icons/LoadIcon.png" id="3_k7k3v"]
|
||||
|
||||
[sub_resource type="Animation" id="Animation_p5x7e"]
|
||||
resource_name = "Downloading"
|
||||
length = 1.8
|
||||
step = 0.1
|
||||
tracks/0/type = "bezier"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("CenterContainer/LogoAnchor/Logo/Logo:position:y")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"handle_modes": PackedInt32Array(0, 0),
|
||||
"points": PackedFloat32Array(-350, -0.25, 0, 0.25, 0, 0, -0.25, 0, 0.25, 0),
|
||||
"times": PackedFloat32Array(0, 1)
|
||||
}
|
||||
tracks/1/type = "bezier"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("CenterContainer/LogoAnchor/Logo/Logo:scale:x")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"handle_modes": PackedInt32Array(0, 0),
|
||||
"points": PackedFloat32Array(0.5, -0.25, 0, 0.25, 0, 1, -0.25, 0, 0.25, 0),
|
||||
"times": PackedFloat32Array(0, 1)
|
||||
}
|
||||
tracks/2/type = "bezier"
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/path = NodePath("CenterContainer/LogoAnchor/Logo/Logo:scale:y")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/keys = {
|
||||
"handle_modes": PackedInt32Array(0, 0),
|
||||
"points": PackedFloat32Array(0.5, -0.25, 0, 0.25, 0, 1, -0.25, 0, 0.25, 0),
|
||||
"times": PackedFloat32Array(0, 1)
|
||||
}
|
||||
tracks/3/type = "value"
|
||||
tracks/3/imported = false
|
||||
tracks/3/enabled = true
|
||||
tracks/3/path = NodePath("CenterContainer/UIAnchor:modulate")
|
||||
tracks/3/interp = 1
|
||||
tracks/3/loop_wrap = true
|
||||
tracks/3/keys = {
|
||||
"times": PackedFloat32Array(0.0333333, 0.366667),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 0,
|
||||
"values": [Color(1, 1, 1, 1), Color(1, 1, 1, 0)]
|
||||
}
|
||||
tracks/4/type = "value"
|
||||
tracks/4/imported = false
|
||||
tracks/4/enabled = true
|
||||
tracks/4/path = NodePath("CenterContainer/LogoAnchor/Logo/LoadIcon:modulate")
|
||||
tracks/4/interp = 1
|
||||
tracks/4/loop_wrap = true
|
||||
tracks/4/keys = {
|
||||
"times": PackedFloat32Array(0, 1, 1.76667),
|
||||
"transitions": PackedFloat32Array(1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 0), Color(1, 1, 1, 1)]
|
||||
}
|
||||
tracks/5/type = "value"
|
||||
tracks/5/imported = false
|
||||
tracks/5/enabled = true
|
||||
tracks/5/path = NodePath("CenterContainer/LogoAnchor/Logo/UpdateLabel:modulate")
|
||||
tracks/5/interp = 1
|
||||
tracks/5/loop_wrap = true
|
||||
tracks/5/keys = {
|
||||
"times": PackedFloat32Array(0, 1, 1.8),
|
||||
"transitions": PackedFloat32Array(1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 0), Color(1, 1, 1, 1)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_x05bw"]
|
||||
resource_name = "Open"
|
||||
length = 1.8
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath(".:visible")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.1),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 1,
|
||||
"values": [false, true]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("Background:modulate")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0.1, 0.3),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 0,
|
||||
"values": [Color(0, 0, 0, 0), Color(0, 0, 0, 0.78431374)]
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/path = NodePath("CenterContainer/LogoAnchor:modulate")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/keys = {
|
||||
"times": PackedFloat32Array(0.2, 0.5),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 0,
|
||||
"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1)]
|
||||
}
|
||||
tracks/3/type = "bezier"
|
||||
tracks/3/imported = false
|
||||
tracks/3/enabled = true
|
||||
tracks/3/path = NodePath("CenterContainer/LogoAnchor/Logo/Logo:position:y")
|
||||
tracks/3/interp = 1
|
||||
tracks/3/loop_wrap = true
|
||||
tracks/3/keys = {
|
||||
"handle_modes": PackedInt32Array(0, 0),
|
||||
"points": PackedFloat32Array(0, -0.25, 0, 0.25, 0, -350, -0.25, 0, 0.25, 0),
|
||||
"times": PackedFloat32Array(1, 1.5)
|
||||
}
|
||||
tracks/4/type = "bezier"
|
||||
tracks/4/imported = false
|
||||
tracks/4/enabled = true
|
||||
tracks/4/path = NodePath("CenterContainer/LogoAnchor/Logo/Logo:scale:x")
|
||||
tracks/4/interp = 1
|
||||
tracks/4/loop_wrap = true
|
||||
tracks/4/keys = {
|
||||
"handle_modes": PackedInt32Array(0, 0),
|
||||
"points": PackedFloat32Array(1, -0.25, 0, 0.25, 0, 0.5, -0.25, 0, 0.25, 0),
|
||||
"times": PackedFloat32Array(1, 1.5)
|
||||
}
|
||||
tracks/5/type = "bezier"
|
||||
tracks/5/imported = false
|
||||
tracks/5/enabled = true
|
||||
tracks/5/path = NodePath("CenterContainer/LogoAnchor/Logo/Logo:scale:y")
|
||||
tracks/5/interp = 1
|
||||
tracks/5/loop_wrap = true
|
||||
tracks/5/keys = {
|
||||
"handle_modes": PackedInt32Array(0, 0),
|
||||
"points": PackedFloat32Array(1, -0.25, 0, 0.25, 0, 0.5, -0.25, 0, 0.25, 0),
|
||||
"times": PackedFloat32Array(1, 1.5)
|
||||
}
|
||||
tracks/6/type = "value"
|
||||
tracks/6/imported = false
|
||||
tracks/6/enabled = true
|
||||
tracks/6/path = NodePath("CenterContainer/UIAnchor:modulate")
|
||||
tracks/6/interp = 1
|
||||
tracks/6/loop_wrap = true
|
||||
tracks/6/keys = {
|
||||
"times": PackedFloat32Array(1.3, 1.8),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 0,
|
||||
"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_qx43o"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath(".:visible")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [false]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("Background:modulate")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Color(0, 0, 0, 0)]
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/path = NodePath("CenterContainer/LogoAnchor:modulate")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Color(1, 1, 1, 0)]
|
||||
}
|
||||
tracks/3/type = "bezier"
|
||||
tracks/3/imported = false
|
||||
tracks/3/enabled = true
|
||||
tracks/3/path = NodePath("CenterContainer/LogoAnchor/Logo/Logo:position:y")
|
||||
tracks/3/interp = 1
|
||||
tracks/3/loop_wrap = true
|
||||
tracks/3/keys = {
|
||||
"handle_modes": PackedInt32Array(0),
|
||||
"points": PackedFloat32Array(0, -0.25, 0, 0.25, 0),
|
||||
"times": PackedFloat32Array(0)
|
||||
}
|
||||
tracks/4/type = "bezier"
|
||||
tracks/4/imported = false
|
||||
tracks/4/enabled = true
|
||||
tracks/4/path = NodePath("CenterContainer/LogoAnchor/Logo/Logo:scale:x")
|
||||
tracks/4/interp = 1
|
||||
tracks/4/loop_wrap = true
|
||||
tracks/4/keys = {
|
||||
"handle_modes": PackedInt32Array(0),
|
||||
"points": PackedFloat32Array(1, -0.25, 0, 0.25, 0),
|
||||
"times": PackedFloat32Array(0)
|
||||
}
|
||||
tracks/5/type = "bezier"
|
||||
tracks/5/imported = false
|
||||
tracks/5/enabled = true
|
||||
tracks/5/path = NodePath("CenterContainer/LogoAnchor/Logo/Logo:scale:y")
|
||||
tracks/5/interp = 1
|
||||
tracks/5/loop_wrap = true
|
||||
tracks/5/keys = {
|
||||
"handle_modes": PackedInt32Array(0),
|
||||
"points": PackedFloat32Array(1, -0.25, 0, 0.25, 0),
|
||||
"times": PackedFloat32Array(0)
|
||||
}
|
||||
tracks/6/type = "value"
|
||||
tracks/6/imported = false
|
||||
tracks/6/enabled = true
|
||||
tracks/6/path = NodePath("CenterContainer/UIAnchor:modulate")
|
||||
tracks/6/interp = 1
|
||||
tracks/6/loop_wrap = true
|
||||
tracks/6/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Color(1, 1, 1, 0)]
|
||||
}
|
||||
tracks/7/type = "value"
|
||||
tracks/7/imported = false
|
||||
tracks/7/enabled = true
|
||||
tracks/7/path = NodePath("CenterContainer/LogoAnchor/Logo/LoadIcon:modulate")
|
||||
tracks/7/interp = 1
|
||||
tracks/7/loop_wrap = true
|
||||
tracks/7/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Color(1, 1, 1, 0)]
|
||||
}
|
||||
tracks/8/type = "value"
|
||||
tracks/8/imported = false
|
||||
tracks/8/enabled = true
|
||||
tracks/8/path = NodePath("CenterContainer/LogoAnchor/Logo/UpdateLabel:modulate")
|
||||
tracks/8/interp = 1
|
||||
tracks/8/loop_wrap = true
|
||||
tracks/8/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Color(1, 1, 1, 0)]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_d74rd"]
|
||||
_data = {
|
||||
&"Downloading": SubResource("Animation_p5x7e"),
|
||||
&"Open": SubResource("Animation_x05bw"),
|
||||
&"RESET": SubResource("Animation_qx43o")
|
||||
}
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_gw5my"]
|
||||
bg_color = Color(1, 1, 1, 1)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_7n4q8"]
|
||||
atlas = ExtResource("3_k7k3v")
|
||||
region = Rect2(0, 0, 166, 166)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_cpyqf"]
|
||||
atlas = ExtResource("3_k7k3v")
|
||||
region = Rect2(166, 0, 166, 166)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_xrhuh"]
|
||||
atlas = ExtResource("3_k7k3v")
|
||||
region = Rect2(332, 0, 166, 166)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_yg1kq"]
|
||||
atlas = ExtResource("3_k7k3v")
|
||||
region = Rect2(498, 0, 166, 166)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_q6pvr"]
|
||||
atlas = ExtResource("3_k7k3v")
|
||||
region = Rect2(664, 0, 166, 166)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_dr3eh"]
|
||||
atlas = ExtResource("3_k7k3v")
|
||||
region = Rect2(0, 166, 166, 166)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_l308m"]
|
||||
atlas = ExtResource("3_k7k3v")
|
||||
region = Rect2(166, 166, 166, 166)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_bo1b1"]
|
||||
atlas = ExtResource("3_k7k3v")
|
||||
region = Rect2(332, 166, 166, 166)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_qnxdd"]
|
||||
atlas = ExtResource("3_k7k3v")
|
||||
region = Rect2(498, 166, 166, 166)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_1m25y"]
|
||||
atlas = ExtResource("3_k7k3v")
|
||||
region = Rect2(664, 166, 166, 166)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_3ir2b"]
|
||||
atlas = ExtResource("3_k7k3v")
|
||||
region = Rect2(0, 332, 166, 166)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_psoh2"]
|
||||
atlas = ExtResource("3_k7k3v")
|
||||
region = Rect2(166, 332, 166, 166)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_f7j2m"]
|
||||
atlas = ExtResource("3_k7k3v")
|
||||
region = Rect2(332, 332, 166, 166)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ucpbx"]
|
||||
atlas = ExtResource("3_k7k3v")
|
||||
region = Rect2(498, 332, 166, 166)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_nbmvf"]
|
||||
atlas = ExtResource("3_k7k3v")
|
||||
region = Rect2(664, 332, 166, 166)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_38ar6"]
|
||||
atlas = ExtResource("3_k7k3v")
|
||||
region = Rect2(0, 498, 166, 166)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_h5tbl"]
|
||||
atlas = ExtResource("3_k7k3v")
|
||||
region = Rect2(166, 498, 166, 166)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ijnjl"]
|
||||
atlas = ExtResource("3_k7k3v")
|
||||
region = Rect2(332, 498, 166, 166)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_u7mul"]
|
||||
atlas = ExtResource("3_k7k3v")
|
||||
region = Rect2(498, 498, 166, 166)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_vpehh"]
|
||||
atlas = ExtResource("3_k7k3v")
|
||||
region = Rect2(664, 498, 166, 166)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_4max4"]
|
||||
atlas = ExtResource("3_k7k3v")
|
||||
region = Rect2(0, 664, 166, 166)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ud1gk"]
|
||||
atlas = ExtResource("3_k7k3v")
|
||||
region = Rect2(166, 664, 166, 166)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_1qysi"]
|
||||
atlas = ExtResource("3_k7k3v")
|
||||
region = Rect2(332, 664, 166, 166)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_1ygi4"]
|
||||
atlas = ExtResource("3_k7k3v")
|
||||
region = Rect2(498, 664, 166, 166)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_qtqjo"]
|
||||
atlas = ExtResource("3_k7k3v")
|
||||
region = Rect2(664, 664, 166, 166)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_bcmcd"]
|
||||
atlas = ExtResource("3_k7k3v")
|
||||
region = Rect2(0, 830, 166, 166)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ukgla"]
|
||||
atlas = ExtResource("3_k7k3v")
|
||||
region = Rect2(166, 830, 166, 166)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_5m3dn"]
|
||||
atlas = ExtResource("3_k7k3v")
|
||||
region = Rect2(332, 830, 166, 166)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_pgi17"]
|
||||
atlas = ExtResource("3_k7k3v")
|
||||
region = Rect2(498, 830, 166, 166)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_o14da"]
|
||||
atlas = ExtResource("3_k7k3v")
|
||||
region = Rect2(664, 830, 166, 166)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_wnnec"]
|
||||
atlas = ExtResource("3_k7k3v")
|
||||
region = Rect2(0, 996, 166, 166)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_wm8ux"]
|
||||
atlas = ExtResource("3_k7k3v")
|
||||
region = Rect2(166, 996, 166, 166)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_fa2em"]
|
||||
atlas = ExtResource("3_k7k3v")
|
||||
region = Rect2(332, 996, 166, 166)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_2dq2p"]
|
||||
atlas = ExtResource("3_k7k3v")
|
||||
region = Rect2(498, 996, 166, 166)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_p0gcl"]
|
||||
atlas = ExtResource("3_k7k3v")
|
||||
region = Rect2(664, 996, 166, 166)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_hd6io"]
|
||||
atlas = ExtResource("3_k7k3v")
|
||||
region = Rect2(0, 1162, 166, 166)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_hrq83"]
|
||||
atlas = ExtResource("3_k7k3v")
|
||||
region = Rect2(166, 1162, 166, 166)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_gvthg"]
|
||||
atlas = ExtResource("3_k7k3v")
|
||||
region = Rect2(332, 1162, 166, 166)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_wkeq8"]
|
||||
atlas = ExtResource("3_k7k3v")
|
||||
region = Rect2(498, 1162, 166, 166)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_oxpxj"]
|
||||
atlas = ExtResource("3_k7k3v")
|
||||
region = Rect2(664, 1162, 166, 166)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_m25b5"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_7n4q8")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_cpyqf")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_xrhuh")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_yg1kq")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_q6pvr")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_dr3eh")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_l308m")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_bo1b1")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_qnxdd")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_1m25y")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_3ir2b")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_psoh2")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_f7j2m")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_ucpbx")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_nbmvf")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_38ar6")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_h5tbl")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_ijnjl")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_u7mul")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_vpehh")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_4max4")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_ud1gk")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_1qysi")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_1ygi4")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_qtqjo")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_bcmcd")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_ukgla")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_5m3dn")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_pgi17")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_o14da")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_wnnec")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_wm8ux")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_fa2em")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_2dq2p")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_p0gcl")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_hd6io")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_hrq83")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_gvthg")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_wkeq8")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_oxpxj")
|
||||
}],
|
||||
"loop": 1,
|
||||
"name": &"default",
|
||||
"speed": 25.0
|
||||
}]
|
||||
|
||||
[node name="ConfigMenu" type="Control" unique_id=1575433482]
|
||||
visible = false
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
mouse_filter = 2
|
||||
script = ExtResource("1")
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="." unique_id=1828917672]
|
||||
libraries/ = SubResource("AnimationLibrary_d74rd")
|
||||
speed_scale = 2.0
|
||||
|
||||
[node name="Background" type="PanelContainer" parent="." unique_id=981966733]
|
||||
modulate = Color(0, 0, 0, 0)
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
mouse_filter = 2
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_gw5my")
|
||||
|
||||
[node name="CenterContainer" type="CenterContainer" parent="." unique_id=776130872]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="LogoAnchor" type="Control" parent="CenterContainer" unique_id=802190337]
|
||||
modulate = Color(1, 1, 1, 0)
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Logo" type="Control" parent="CenterContainer/LogoAnchor" unique_id=169430659]
|
||||
anchors_preset = 0
|
||||
theme = ExtResource("2_wd24h")
|
||||
|
||||
[node name="Logo" type="Sprite2D" parent="CenterContainer/LogoAnchor/Logo" unique_id=1768483165]
|
||||
unique_name_in_owner = true
|
||||
texture = ExtResource("3_eccmp")
|
||||
|
||||
[node name="LoadIcon" type="AnimatedSprite2D" parent="CenterContainer/LogoAnchor/Logo" unique_id=981153261]
|
||||
unique_name_in_owner = true
|
||||
modulate = Color(1, 1, 1, 0)
|
||||
position = Vector2(0, 172.975)
|
||||
scale = Vector2(0.5, 0.5)
|
||||
sprite_frames = SubResource("SpriteFrames_m25b5")
|
||||
autoplay = "default"
|
||||
frame_progress = 0.471284
|
||||
|
||||
[node name="UpdateLabel" type="Label" parent="CenterContainer/LogoAnchor/Logo" unique_id=1648919198]
|
||||
unique_name_in_owner = true
|
||||
modulate = Color(1, 1, 1, 0)
|
||||
custom_minimum_size = Vector2(400, 30)
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -200.0
|
||||
offset_top = 220.0
|
||||
offset_right = 200.0
|
||||
offset_bottom = 250.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
text = "Updating gd-sync"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="UIAnchor" type="Control" parent="CenterContainer" unique_id=72271274]
|
||||
modulate = Color(1, 1, 1, 0)
|
||||
layout_mode = 2
|
||||
|
||||
[node name="UI" type="Control" parent="CenterContainer/UIAnchor" unique_id=1371490478]
|
||||
anchors_preset = 0
|
||||
|
||||
[node name="PanelContainer" type="PanelContainer" parent="CenterContainer/UIAnchor/UI" unique_id=2130273074]
|
||||
layout_mode = 0
|
||||
offset_left = -475.0
|
||||
offset_top = -275.0
|
||||
offset_right = 475.0
|
||||
offset_bottom = 342.0
|
||||
theme = ExtResource("2_wd24h")
|
||||
|
||||
[node name="DefaultPannel" type="PanelContainer" parent="CenterContainer/UIAnchor/UI" unique_id=649474670]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 0
|
||||
offset_left = -450.0
|
||||
offset_top = -250.0
|
||||
offset_right = -50.0
|
||||
theme = ExtResource("2_wd24h")
|
||||
theme_type_variation = &"GDPanel"
|
||||
|
||||
[node name="Description" type="RichTextLabel" parent="CenterContainer/UIAnchor/UI/DefaultPannel" unique_id=644519758]
|
||||
layout_mode = 2
|
||||
theme = ExtResource("2_wd24h")
|
||||
bbcode_enabled = true
|
||||
text = "Welcome to the GD-Sync configuration menu. Here you can find basic settings and links to official resources.
|
||||
|
||||
- [url=https://www.gd-sync.com]Official Website[/url]
|
||||
- [url=https://www.gd-sync.com/documentation]Documentation[/url]
|
||||
- [url=https://www.gd-sync.com/app/api-keys-settings]API Key Generation[/url]
|
||||
|
||||
- [url=log]Log Directory[/url]"
|
||||
|
||||
[node name="UpdatePanel" type="PanelContainer" parent="CenterContainer/UIAnchor/UI" unique_id=162433719]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 0
|
||||
offset_left = -450.0
|
||||
offset_top = -250.0
|
||||
offset_right = -50.0
|
||||
theme = ExtResource("2_wd24h")
|
||||
theme_type_variation = &"GDPanel"
|
||||
|
||||
[node name="Description" type="RichTextLabel" parent="CenterContainer/UIAnchor/UI/UpdatePanel" unique_id=1740086594]
|
||||
layout_mode = 2
|
||||
theme = ExtResource("2_wd24h")
|
||||
bbcode_enabled = true
|
||||
text = "A new update for GD-Sync is available. Press the button below to automatically update to the newest version.
|
||||
|
||||
- [url=https://www.gd-sync.com]Official Website[/url]
|
||||
- [url=https://www.gd-sync.com/documentation]Documentation[/url]
|
||||
- [url=https://www.gd-sync.com/app/api-keys-settings]API Key Generation[/url]"
|
||||
|
||||
[node name="ButtonContainer" type="PanelContainer" parent="CenterContainer/UIAnchor/UI/UpdatePanel" unique_id=965317605]
|
||||
clip_children = 1
|
||||
clip_contents = true
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 8
|
||||
focus_mode = 2
|
||||
theme_type_variation = &"EmptyPanel"
|
||||
|
||||
[node name="UpdateButton" type="Button" parent="CenterContainer/UIAnchor/UI/UpdatePanel/ButtonContainer" unique_id=1679435974]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 8
|
||||
theme_type_variation = &"UpdateButton"
|
||||
text = "Update"
|
||||
|
||||
[node name="Panel2" type="PanelContainer" parent="CenterContainer/UIAnchor/UI" unique_id=221407985]
|
||||
layout_mode = 0
|
||||
offset_left = -450.0
|
||||
offset_top = 25.0
|
||||
offset_right = -50.0
|
||||
offset_bottom = 250.0
|
||||
theme = ExtResource("2_wd24h")
|
||||
theme_type_variation = &"GDPanel"
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer/UIAnchor/UI/Panel2" unique_id=196865433]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="RichTextLabel" type="RichTextLabel" parent="CenterContainer/UIAnchor/UI/Panel2/VBoxContainer" unique_id=437873018]
|
||||
layout_mode = 2
|
||||
theme = ExtResource("2_wd24h")
|
||||
text = "Please fill in an API Key so the engine may connect to the GD-Sync network."
|
||||
fit_content = true
|
||||
|
||||
[node name="PublicLabel" type="Label" parent="CenterContainer/UIAnchor/UI/Panel2/VBoxContainer" unique_id=44499523]
|
||||
layout_mode = 2
|
||||
theme = ExtResource("2_wd24h")
|
||||
text = "Public Key"
|
||||
|
||||
[node name="PublicKey" type="LineEdit" parent="CenterContainer/UIAnchor/UI/Panel2/VBoxContainer" unique_id=372373993]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
theme = ExtResource("2_wd24h")
|
||||
caret_blink = true
|
||||
|
||||
[node name="PrivateLabel" type="Label" parent="CenterContainer/UIAnchor/UI/Panel2/VBoxContainer" unique_id=206925556]
|
||||
layout_mode = 2
|
||||
theme = ExtResource("2_wd24h")
|
||||
text = "Private Key"
|
||||
|
||||
[node name="PrivateKey" type="LineEdit" parent="CenterContainer/UIAnchor/UI/Panel2/VBoxContainer" unique_id=1449264830]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
theme = ExtResource("2_wd24h")
|
||||
caret_blink = true
|
||||
|
||||
[node name="Settings" type="PanelContainer" parent="CenterContainer/UIAnchor/UI" unique_id=1034112752]
|
||||
layout_mode = 0
|
||||
offset_left = 50.0
|
||||
offset_top = -250.0
|
||||
offset_right = 450.0
|
||||
offset_bottom = 250.0
|
||||
theme = ExtResource("2_wd24h")
|
||||
theme_type_variation = &"GDPanel"
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="CenterContainer/UIAnchor/UI/Settings" unique_id=453237216]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer/UIAnchor/UI/Settings/ScrollContainer" unique_id=1339546343]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="ProtectionMode2" type="VBoxContainer" parent="CenterContainer/UIAnchor/UI/Settings/ScrollContainer/VBoxContainer" unique_id=596699874]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="CenterContainer/UIAnchor/UI/Settings/ScrollContainer/VBoxContainer/ProtectionMode2" unique_id=1142965809]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="CSharpSupport" type="CheckButton" parent="CenterContainer/UIAnchor/UI/Settings/ScrollContainer/VBoxContainer/ProtectionMode2/HBoxContainer" unique_id=1143148508]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
theme = ExtResource("2_wd24h")
|
||||
|
||||
[node name="Label" type="Label" parent="CenterContainer/UIAnchor/UI/Settings/ScrollContainer/VBoxContainer/ProtectionMode2/HBoxContainer" unique_id=2048167211]
|
||||
layout_mode = 2
|
||||
theme = ExtResource("2_wd24h")
|
||||
text = "C# Support"
|
||||
|
||||
[node name="RichTextLabel" type="RichTextLabel" parent="CenterContainer/UIAnchor/UI/Settings/ScrollContainer/VBoxContainer/ProtectionMode2" unique_id=2131636992]
|
||||
custom_minimum_size = Vector2(0, 125)
|
||||
layout_mode = 2
|
||||
theme = ExtResource("2_wd24h")
|
||||
bbcode_enabled = true
|
||||
text = "If enabled, the C# API of the GD-Sync plugin will be installed and enabled.
|
||||
|
||||
After enabling you need to restart and build your project."
|
||||
fit_content = true
|
||||
|
||||
[node name="Spacing1" type="Control" parent="CenterContainer/UIAnchor/UI/Settings/ScrollContainer/VBoxContainer" unique_id=1495858133]
|
||||
custom_minimum_size = Vector2(0, 35)
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ProtectionMode" type="VBoxContainer" parent="CenterContainer/UIAnchor/UI/Settings/ScrollContainer/VBoxContainer" unique_id=951164412]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="CenterContainer/UIAnchor/UI/Settings/ScrollContainer/VBoxContainer/ProtectionMode" unique_id=2007314682]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Protected" type="CheckButton" parent="CenterContainer/UIAnchor/UI/Settings/ScrollContainer/VBoxContainer/ProtectionMode/HBoxContainer" unique_id=1544686272]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
theme = ExtResource("2_wd24h")
|
||||
button_pressed = true
|
||||
|
||||
[node name="Label" type="Label" parent="CenterContainer/UIAnchor/UI/Settings/ScrollContainer/VBoxContainer/ProtectionMode/HBoxContainer" unique_id=935600713]
|
||||
layout_mode = 2
|
||||
theme = ExtResource("2_wd24h")
|
||||
text = "Protected Mode"
|
||||
|
||||
[node name="RichTextLabel" type="RichTextLabel" parent="CenterContainer/UIAnchor/UI/Settings/ScrollContainer/VBoxContainer/ProtectionMode" unique_id=471701220]
|
||||
custom_minimum_size = Vector2(0, 100)
|
||||
layout_mode = 2
|
||||
theme = ExtResource("2_wd24h")
|
||||
bbcode_enabled = true
|
||||
text = "Blocks remote calls on Nodes. Use [color=#408eab]GDSync.expose_func()[/color] and [color=#408eab]GDSync.expose_var()[/color] to allow the plugin to access Nodes remotely.
|
||||
|
||||
[color=indianred]WARNING: Disabling this will allow other clients to call any function on any Node. Use at your own risk and only during testing."
|
||||
fit_content = true
|
||||
|
||||
[node name="Spacing2" type="Control" parent="CenterContainer/UIAnchor/UI/Settings/ScrollContainer/VBoxContainer" unique_id=1664573910]
|
||||
custom_minimum_size = Vector2(0, 35)
|
||||
layout_mode = 2
|
||||
|
||||
[node name="UniqueUsernames" type="VBoxContainer" parent="CenterContainer/UIAnchor/UI/Settings/ScrollContainer/VBoxContainer" unique_id=779527313]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="CenterContainer/UIAnchor/UI/Settings/ScrollContainer/VBoxContainer/UniqueUsernames" unique_id=860810844]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="UniqueUsernames" type="CheckButton" parent="CenterContainer/UIAnchor/UI/Settings/ScrollContainer/VBoxContainer/UniqueUsernames/HBoxContainer" unique_id=1468164783]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
theme = ExtResource("2_wd24h")
|
||||
|
||||
[node name="Label" type="Label" parent="CenterContainer/UIAnchor/UI/Settings/ScrollContainer/VBoxContainer/UniqueUsernames/HBoxContainer" unique_id=73397071]
|
||||
layout_mode = 2
|
||||
theme = ExtResource("2_wd24h")
|
||||
text = "Unique Usernames"
|
||||
|
||||
[node name="RichTextLabel" type="RichTextLabel" parent="CenterContainer/UIAnchor/UI/Settings/ScrollContainer/VBoxContainer/UniqueUsernames" unique_id=134873602]
|
||||
custom_minimum_size = Vector2(0, 100)
|
||||
layout_mode = 2
|
||||
theme = ExtResource("2_wd24h")
|
||||
bbcode_enabled = true
|
||||
text = "Tells the server whether it should allow duplicate usernames when joining a lobby. If enabled, a username can only appear once inside a lobby.
|
||||
|
||||
Usernames can be set using [color=#408eab]GDSync.player_set_username()[/color]."
|
||||
fit_content = true
|
||||
|
||||
[node name="Spacing3" type="Control" parent="CenterContainer/UIAnchor/UI/Settings/ScrollContainer/VBoxContainer" unique_id=688157772]
|
||||
custom_minimum_size = Vector2(0, 35)
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ScriptValidation" type="VBoxContainer" parent="CenterContainer/UIAnchor/UI/Settings/ScrollContainer/VBoxContainer" unique_id=1790531497]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="CenterContainer/UIAnchor/UI/Settings/ScrollContainer/VBoxContainer/ScriptValidation" unique_id=1585099442]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ScriptValidation" type="CheckButton" parent="CenterContainer/UIAnchor/UI/Settings/ScrollContainer/VBoxContainer/ScriptValidation/HBoxContainer" unique_id=1439107572]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
theme = ExtResource("2_wd24h")
|
||||
button_pressed = true
|
||||
|
||||
[node name="Label" type="Label" parent="CenterContainer/UIAnchor/UI/Settings/ScrollContainer/VBoxContainer/ScriptValidation/HBoxContainer" unique_id=1198682568]
|
||||
layout_mode = 2
|
||||
theme = ExtResource("2_wd24h")
|
||||
text = "Script Validation"
|
||||
|
||||
[node name="RichTextLabel" type="RichTextLabel" parent="CenterContainer/UIAnchor/UI/Settings/ScrollContainer/VBoxContainer/ScriptValidation" unique_id=2054963013]
|
||||
custom_minimum_size = Vector2(0, 100)
|
||||
layout_mode = 2
|
||||
theme = ExtResource("2_wd24h")
|
||||
bbcode_enabled = true
|
||||
text = "Script validation scans the script you are currently working on to detect possible mistakes and errors. If the plugin detects incorrect function usage or unexposed remote calls, a warning will be displayed in the Godot editor. This helps you catch common issues early, reducing debugging time and preventing runtime errors."
|
||||
fit_content = true
|
||||
|
||||
[node name="ButtonContainer" type="PanelContainer" parent="CenterContainer/UIAnchor/UI" unique_id=1736452814]
|
||||
clip_children = 1
|
||||
clip_contents = true
|
||||
layout_mode = 0
|
||||
offset_left = -135.0
|
||||
offset_top = 280.0
|
||||
offset_right = 115.0
|
||||
offset_bottom = 320.0
|
||||
focus_mode = 2
|
||||
theme = ExtResource("2_wd24h")
|
||||
theme_type_variation = &"EmptyPanel"
|
||||
|
||||
[node name="Close" type="Button" parent="CenterContainer/UIAnchor/UI/ButtonContainer" unique_id=1256304310]
|
||||
layout_mode = 2
|
||||
theme = ExtResource("2_wd24h")
|
||||
text = "Close"
|
||||
|
||||
[connection signal="meta_clicked" from="CenterContainer/UIAnchor/UI/DefaultPannel/Description" to="." method="_on_description_meta_clicked"]
|
||||
[connection signal="meta_clicked" from="CenterContainer/UIAnchor/UI/UpdatePanel/Description" to="." method="_on_description_meta_clicked"]
|
||||
[connection signal="pressed" from="CenterContainer/UIAnchor/UI/UpdatePanel/ButtonContainer/UpdateButton" to="." method="_on_update_button_pressed"]
|
||||
[connection signal="text_changed" from="CenterContainer/UIAnchor/UI/Panel2/VBoxContainer/PublicKey" to="." method="_on_PublicKey_text_changed"]
|
||||
[connection signal="text_changed" from="CenterContainer/UIAnchor/UI/Panel2/VBoxContainer/PrivateKey" to="." method="_on_PrivateKey_text_changed"]
|
||||
[connection signal="toggled" from="CenterContainer/UIAnchor/UI/Settings/ScrollContainer/VBoxContainer/ProtectionMode2/HBoxContainer/CSharpSupport" to="." method="_on_c_sharp_support_toggled"]
|
||||
[connection signal="toggled" from="CenterContainer/UIAnchor/UI/Settings/ScrollContainer/VBoxContainer/ProtectionMode/HBoxContainer/Protected" to="." method="_on_protected_toggled"]
|
||||
[connection signal="toggled" from="CenterContainer/UIAnchor/UI/Settings/ScrollContainer/VBoxContainer/UniqueUsernames/HBoxContainer/UniqueUsernames" to="." method="_on_unique_usernames_toggled"]
|
||||
[connection signal="toggled" from="CenterContainer/UIAnchor/UI/Settings/ScrollContainer/VBoxContainer/ScriptValidation/HBoxContainer/ScriptValidation" to="." method="_on_script_validation_toggled"]
|
||||
[connection signal="pressed" from="CenterContainer/UIAnchor/UI/ButtonContainer/Close" to="." method="close"]
|
||||
200
addons/GD-Sync/UI/ConfigMenu/GD-Theme.tres
Normal file
|
|
@ -0,0 +1,200 @@
|
|||
[gd_resource type="Theme" format=3 uid="uid://5whm1igkt23h"]
|
||||
|
||||
[ext_resource type="FontFile" uid="uid://bnjmhin4fqi2u" path="res://addons/GD-Sync/UI/Fonts/Outfit-Regular.ttf" id="1_15q4e"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_0vk81"]
|
||||
bg_color = Color(0.18431373, 0.18431373, 0.18431373, 0)
|
||||
border_width_left = 1
|
||||
border_width_top = 1
|
||||
border_width_right = 1
|
||||
border_width_bottom = 1
|
||||
border_color = Color(0.3125, 0.3125, 0.3125, 1)
|
||||
corner_radius_top_left = 10
|
||||
corner_radius_top_right = 10
|
||||
corner_radius_bottom_right = 10
|
||||
corner_radius_bottom_left = 10
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ywbrc"]
|
||||
bg_color = Color(0.2509804, 0.5568628, 0.67058825, 1)
|
||||
border_width_left = 1
|
||||
border_width_top = 1
|
||||
border_width_right = 1
|
||||
border_width_bottom = 1
|
||||
corner_radius_top_left = 10
|
||||
corner_radius_top_right = 10
|
||||
corner_radius_bottom_right = 10
|
||||
corner_radius_bottom_left = 10
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_g3h2g"]
|
||||
bg_color = Color(0.2509804, 0.5568628, 0.67058825, 1)
|
||||
border_width_left = 1
|
||||
border_width_top = 1
|
||||
border_width_right = 1
|
||||
border_width_bottom = 1
|
||||
border_color = Color(0.2509804, 0.5568628, 0.67058825, 1)
|
||||
corner_radius_top_left = 10
|
||||
corner_radius_top_right = 10
|
||||
corner_radius_bottom_right = 10
|
||||
corner_radius_bottom_left = 10
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_egfui"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_ltv7d"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_nr1xf"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_ywlyk"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_4x111"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_ggeya"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_d26q0"]
|
||||
bg_color = Color(1, 1, 1, 1)
|
||||
corner_radius_top_left = 10
|
||||
corner_radius_top_right = 10
|
||||
corner_radius_bottom_right = 10
|
||||
corner_radius_bottom_left = 10
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_3a5b6"]
|
||||
content_margin_left = 15.0
|
||||
content_margin_top = 15.0
|
||||
content_margin_right = 15.0
|
||||
content_margin_bottom = 15.0
|
||||
bg_color = Color(0.08235294, 0.08235294, 0.08235294, 1)
|
||||
corner_radius_top_left = 20
|
||||
corner_radius_top_right = 20
|
||||
corner_radius_bottom_right = 20
|
||||
corner_radius_bottom_left = 20
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_rqrgd"]
|
||||
content_margin_left = 15.0
|
||||
content_margin_top = 8.0
|
||||
content_margin_right = 15.0
|
||||
content_margin_bottom = 8.0
|
||||
bg_color = Color(0.18028846, 0.18028846, 0.1875, 1)
|
||||
border_width_left = 1
|
||||
border_width_top = 1
|
||||
border_width_right = 1
|
||||
border_width_bottom = 1
|
||||
border_color = Color(0.25098, 0.556863, 0.670588, 1)
|
||||
corner_radius_top_left = 10
|
||||
corner_radius_top_right = 10
|
||||
corner_radius_bottom_right = 10
|
||||
corner_radius_bottom_left = 10
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_w5agy"]
|
||||
content_margin_left = 15.0
|
||||
content_margin_top = 8.0
|
||||
content_margin_right = 15.0
|
||||
content_margin_bottom = 8.0
|
||||
bg_color = Color(0.13719513, 0.13719513, 0.140625, 1)
|
||||
border_width_left = 1
|
||||
border_width_top = 1
|
||||
border_width_right = 1
|
||||
border_width_bottom = 1
|
||||
border_color = Color(0.25098, 0.556863, 0.670588, 1)
|
||||
corner_radius_top_left = 10
|
||||
corner_radius_top_right = 10
|
||||
corner_radius_bottom_right = 10
|
||||
corner_radius_bottom_left = 10
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_15q4e"]
|
||||
content_margin_left = 15.0
|
||||
content_margin_top = 15.0
|
||||
content_margin_right = 15.0
|
||||
content_margin_bottom = 15.0
|
||||
bg_color = Color(0.10980392, 0.10980392, 0.11372549, 1)
|
||||
border_width_left = 2
|
||||
border_width_top = 2
|
||||
border_width_right = 2
|
||||
border_width_bottom = 2
|
||||
border_color = Color(0.25098, 0.556863, 0.670588, 1)
|
||||
corner_radius_top_left = 20
|
||||
corner_radius_top_right = 20
|
||||
corner_radius_bottom_right = 20
|
||||
corner_radius_bottom_left = 20
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_7410l"]
|
||||
content_margin_left = 15.0
|
||||
content_margin_top = 15.0
|
||||
content_margin_right = 15.0
|
||||
content_margin_bottom = 15.0
|
||||
bg_color = Color(0.10980392, 0.10980392, 0.11372549, 1)
|
||||
border_width_left = 1
|
||||
border_width_top = 1
|
||||
border_width_right = 1
|
||||
border_width_bottom = 1
|
||||
border_color = Color(0.25098, 0.556863, 0.670588, 1)
|
||||
corner_radius_top_left = 20
|
||||
corner_radius_top_right = 20
|
||||
corner_radius_bottom_right = 20
|
||||
corner_radius_bottom_left = 20
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_eb10s"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_tcim6"]
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_d26q0"]
|
||||
offsets = PackedFloat32Array(0.0016835016, 0.99579126)
|
||||
colors = PackedColorArray(0.16470589, 0.5254902, 0.21176471, 1, 0.3372549, 0.7882353, 0.27058825, 1)
|
||||
|
||||
[sub_resource type="GradientTexture2D" id="GradientTexture2D_ywbrc"]
|
||||
gradient = SubResource("Gradient_d26q0")
|
||||
fill_from = Vector2(0, 1)
|
||||
fill_to = Vector2(0, 0)
|
||||
|
||||
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_0vk81"]
|
||||
content_margin_top = 5.0
|
||||
content_margin_bottom = 5.0
|
||||
texture = SubResource("GradientTexture2D_ywbrc")
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_oeli6"]
|
||||
offsets = PackedFloat32Array(0.0016835016, 0.99579126)
|
||||
colors = PackedColorArray(0.20796129, 0.6584021, 0.26671442, 1, 0.39228585, 0.9027938, 0.31681958, 1)
|
||||
|
||||
[sub_resource type="GradientTexture2D" id="GradientTexture2D_jlle7"]
|
||||
gradient = SubResource("Gradient_oeli6")
|
||||
fill_from = Vector2(0, 1)
|
||||
fill_to = Vector2(0, 0)
|
||||
|
||||
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_sr822"]
|
||||
content_margin_top = 5.0
|
||||
content_margin_bottom = 5.0
|
||||
texture = SubResource("GradientTexture2D_jlle7")
|
||||
|
||||
[resource]
|
||||
default_font = ExtResource("1_15q4e")
|
||||
default_font_size = 16
|
||||
Button/colors/font_color = Color(0.87723213, 0.87723213, 0.87723213, 1)
|
||||
Button/colors/font_focus_color = Color(1, 1, 1, 1)
|
||||
Button/colors/font_hover_color = Color(1, 1, 1, 1)
|
||||
Button/colors/font_hover_pressed_color = Color(1, 1, 1, 1)
|
||||
Button/styles/disabled = SubResource("StyleBoxFlat_0vk81")
|
||||
Button/styles/hover = SubResource("StyleBoxFlat_ywbrc")
|
||||
Button/styles/normal = SubResource("StyleBoxFlat_g3h2g")
|
||||
Button/styles/pressed = SubResource("StyleBoxFlat_g3h2g")
|
||||
CheckButton/styles/disabled = SubResource("StyleBoxEmpty_egfui")
|
||||
CheckButton/styles/focus = SubResource("StyleBoxEmpty_ltv7d")
|
||||
CheckButton/styles/hover = SubResource("StyleBoxEmpty_nr1xf")
|
||||
CheckButton/styles/hover_pressed = SubResource("StyleBoxEmpty_ywlyk")
|
||||
CheckButton/styles/normal = SubResource("StyleBoxEmpty_4x111")
|
||||
CheckButton/styles/pressed = SubResource("StyleBoxEmpty_ggeya")
|
||||
EmptyPanel/base_type = &"PanelContainer"
|
||||
EmptyPanel/styles/panel = SubResource("StyleBoxFlat_d26q0")
|
||||
GDPanel/base_type = &"PanelContainer"
|
||||
GDPanel/styles/panel = SubResource("StyleBoxFlat_3a5b6")
|
||||
Label/colors/font_color = Color(1, 1, 1, 1)
|
||||
LineEdit/colors/font_color = Color(1, 1, 1, 1)
|
||||
LineEdit/styles/focus = SubResource("StyleBoxFlat_rqrgd")
|
||||
LineEdit/styles/normal = SubResource("StyleBoxFlat_w5agy")
|
||||
MessageLabel/base_type = &"RichTextLabel"
|
||||
MessageLabel/styles/normal = SubResource("StyleBoxFlat_15q4e")
|
||||
PanelContainer/styles/panel = SubResource("StyleBoxFlat_7410l")
|
||||
RichTextLabel/styles/focus = SubResource("StyleBoxEmpty_eb10s")
|
||||
RichTextLabel/styles/normal = SubResource("StyleBoxEmpty_tcim6")
|
||||
UpdateButton/base_type = &"Button"
|
||||
UpdateButton/styles/focus = SubResource("StyleBoxTexture_0vk81")
|
||||
UpdateButton/styles/hover = SubResource("StyleBoxTexture_sr822")
|
||||
UpdateButton/styles/normal = SubResource("StyleBoxTexture_0vk81")
|
||||
UpdateButton/styles/pressed = SubResource("StyleBoxTexture_0vk81")
|
||||
BIN
addons/GD-Sync/UI/ConfigMenu/GDSLogo.png
Normal file
|
After Width: | Height: | Size: 42 KiB |
40
addons/GD-Sync/UI/ConfigMenu/GDSLogo.png.import
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://d2pl6xyfyub5k"
|
||||
path="res://.godot/imported/GDSLogo.png-f71dad2ce9e497aa8e805547e20fd4d7.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://addons/GD-Sync/UI/ConfigMenu/GDSLogo.png"
|
||||
dest_files=["res://.godot/imported/GDSLogo.png-f71dad2ce9e497aa8e805547e20fd4d7.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
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/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
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
|
||||
BIN
addons/GD-Sync/UI/Fonts/Outfit-Regular.ttf
Normal file
41
addons/GD-Sync/UI/Fonts/Outfit-Regular.ttf.import
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
[remap]
|
||||
|
||||
importer="font_data_dynamic"
|
||||
type="FontFile"
|
||||
uid="uid://bnjmhin4fqi2u"
|
||||
path="res://.godot/imported/Outfit-Regular.ttf-b3e20891c08db9fe7cabafc627c030a5.fontdata"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://addons/GD-Sync/UI/Fonts/Outfit-Regular.ttf"
|
||||
dest_files=["res://.godot/imported/Outfit-Regular.ttf-b3e20891c08db9fe7cabafc627c030a5.fontdata"]
|
||||
|
||||
[params]
|
||||
|
||||
Rendering=null
|
||||
antialiasing=1
|
||||
generate_mipmaps=false
|
||||
disable_embedded_bitmaps=true
|
||||
multichannel_signed_distance_field=false
|
||||
msdf_pixel_range=8
|
||||
msdf_size=48
|
||||
allow_system_fallback=true
|
||||
force_autohinter=false
|
||||
modulate_color_glyphs=false
|
||||
hinting=1
|
||||
subpixel_positioning=4
|
||||
keep_rounding_remainders=true
|
||||
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={}
|
||||
BIN
addons/GD-Sync/UI/Icons/InterestObject.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
40
addons/GD-Sync/UI/Icons/InterestObject.png.import
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://daa7ckgyvsm1f"
|
||||
path="res://.godot/imported/InterestObject.png-c5a7a47000021e80ac7852ab8cf2f77d.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://addons/GD-Sync/UI/Icons/InterestObject.png"
|
||||
dest_files=["res://.godot/imported/InterestObject.png-c5a7a47000021e80ac7852ab8cf2f77d.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
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/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
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
|
||||
BIN
addons/GD-Sync/UI/Icons/InterestViewer.png
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
40
addons/GD-Sync/UI/Icons/InterestViewer.png.import
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://qx5gljo241ff"
|
||||
path="res://.godot/imported/InterestViewer.png-53536e16fa71a8ef727b5e731ddd842e.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://addons/GD-Sync/UI/Icons/InterestViewer.png"
|
||||
dest_files=["res://.godot/imported/InterestViewer.png-53536e16fa71a8ef727b5e731ddd842e.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
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/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
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
|
||||
BIN
addons/GD-Sync/UI/Icons/LoadIcon.png
Normal file
|
After Width: | Height: | Size: 8.3 KiB |
40
addons/GD-Sync/UI/Icons/LoadIcon.png.import
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://o7408i2pu2eb"
|
||||
path="res://.godot/imported/LoadIcon.png-be6aa56249fc38ca15dc8abba0037a0c.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://addons/GD-Sync/UI/Icons/LoadIcon.png"
|
||||
dest_files=["res://.godot/imported/LoadIcon.png-be6aa56249fc38ca15dc8abba0037a0c.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
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/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
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
|
||||
BIN
addons/GD-Sync/UI/Icons/NodeInstantiator.png
Normal file
|
After Width: | Height: | Size: 2 KiB |
40
addons/GD-Sync/UI/Icons/NodeInstantiator.png.import
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dixhk6d1hn2et"
|
||||
path="res://.godot/imported/NodeInstantiator.png-40efd1f6857451b6a0ca56562b4c914b.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://addons/GD-Sync/UI/Icons/NodeInstantiator.png"
|
||||
dest_files=["res://.godot/imported/NodeInstantiator.png-40efd1f6857451b6a0ca56562b4c914b.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
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/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
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
|
||||
BIN
addons/GD-Sync/UI/Icons/SynchronizeIcon.png
Normal file
|
After Width: | Height: | Size: 5.4 KiB |
40
addons/GD-Sync/UI/Icons/SynchronizeIcon.png.import
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://waebdswld7o0"
|
||||
path="res://.godot/imported/SynchronizeIcon.png-1ab42da4ce082c51caf3ddd6acec7d17.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://addons/GD-Sync/UI/Icons/SynchronizeIcon.png"
|
||||
dest_files=["res://.godot/imported/SynchronizeIcon.png-1ab42da4ce082c51caf3ddd6acec7d17.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
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/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
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
|
||||
BIN
addons/GD-Sync/UI/Icons/SynchronizedAnimatedSprite.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
|
|
@ -0,0 +1,40 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cblirsycl5x8s"
|
||||
path="res://.godot/imported/SynchronizedAnimatedSprite.png-7403a5b0d42ca34336b023409e59a6da.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://addons/GD-Sync/UI/Icons/SynchronizedAnimatedSprite.png"
|
||||
dest_files=["res://.godot/imported/SynchronizedAnimatedSprite.png-7403a5b0d42ca34336b023409e59a6da.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
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/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
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
|
||||
BIN
addons/GD-Sync/UI/Icons/SynchronizedAnimationPlayer.png
Normal file
|
After Width: | Height: | Size: 284 B |
|
|
@ -0,0 +1,40 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cyuilt0ssxo1l"
|
||||
path="res://.godot/imported/SynchronizedAnimationPlayer.png-cf401b327846a3ae860c30dae862914e.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://addons/GD-Sync/UI/Icons/SynchronizedAnimationPlayer.png"
|
||||
dest_files=["res://.godot/imported/SynchronizedAnimationPlayer.png-cf401b327846a3ae860c30dae862914e.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
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/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
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
|
||||
BIN
addons/GD-Sync/UI/Icons/SynchronizedAnimationTree.png
Normal file
|
After Width: | Height: | Size: 385 B |
40
addons/GD-Sync/UI/Icons/SynchronizedAnimationTree.png.import
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cjm4ioceaef46"
|
||||
path="res://.godot/imported/SynchronizedAnimationTree.png-c98b0b98c2f6a99853b10a2d7f88422f.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://addons/GD-Sync/UI/Icons/SynchronizedAnimationTree.png"
|
||||
dest_files=["res://.godot/imported/SynchronizedAnimationTree.png-c98b0b98c2f6a99853b10a2d7f88422f.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
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/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
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
|
||||
BIN
addons/GD-Sync/UI/Icons/SynchronizedAudioStreamPlayer.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
|
|
@ -0,0 +1,40 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cymoc01vc7y44"
|
||||
path="res://.godot/imported/SynchronizedAudioStreamPlayer.png-1b503a1d618928852a445ac19a62d5bb.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://addons/GD-Sync/UI/Icons/SynchronizedAudioStreamPlayer.png"
|
||||
dest_files=["res://.godot/imported/SynchronizedAudioStreamPlayer.png-1b503a1d618928852a445ac19a62d5bb.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
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/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
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
|
||||
BIN
addons/GD-Sync/UI/Icons/SynchronizedGPUParticles.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
40
addons/GD-Sync/UI/Icons/SynchronizedGPUParticles.png.import
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dlmumb0bych13"
|
||||
path="res://.godot/imported/SynchronizedGPUParticles.png-d319605cd8face1d60a71c5fed589c03.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://addons/GD-Sync/UI/Icons/SynchronizedGPUParticles.png"
|
||||
dest_files=["res://.godot/imported/SynchronizedGPUParticles.png-d319605cd8face1d60a71c5fed589c03.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
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/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
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
|
||||
BIN
addons/GD-Sync/UI/Icons/SynchronizedRigidBody3D.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
40
addons/GD-Sync/UI/Icons/SynchronizedRigidBody3D.png.import
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cx5aov1b58ju2"
|
||||
path="res://.godot/imported/SynchronizedRigidBody3D.png-31f6bd5e655d6d4c7f4d4ca500c52d26.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://addons/GD-Sync/UI/Icons/SynchronizedRigidBody3D.png"
|
||||
dest_files=["res://.godot/imported/SynchronizedRigidBody3D.png-31f6bd5e655d6d4c7f4d4ca500c52d26.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
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/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
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
|
||||
BIN
addons/GD-Sync/UI/Icons/VoiceChatIcon.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
40
addons/GD-Sync/UI/Icons/VoiceChatIcon.png.import
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://coo0gdr0wbjah"
|
||||
path="res://.godot/imported/VoiceChatIcon.png-e78177b9beb132e5a547d5c650bc9a37.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://addons/GD-Sync/UI/Icons/VoiceChatIcon.png"
|
||||
dest_files=["res://.godot/imported/VoiceChatIcon.png-e78177b9beb132e5a547d5c650bc9a37.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
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/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
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
|
||||
88
addons/GD-Sync/UI/Messages/ToastMessage.gd
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
@tool
|
||||
extends Control
|
||||
#Copyright (c) 2023-present GD-Sync.
|
||||
#All rights reserved.
|
||||
#
|
||||
#Redistribution and use in source form, with or without modification,
|
||||
#are permitted provided that the following conditions are met:
|
||||
#
|
||||
#1. Redistributions of source code must retain the above copyright notice,
|
||||
# this list of conditions and the following disclaimer.
|
||||
#
|
||||
#2. Neither the name of GD-Sync nor the names of its contributors may be used
|
||||
# to endorse or promote products derived from this software without specific
|
||||
# prior written permission.
|
||||
#
|
||||
#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
#EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
#OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
#SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
#INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
||||
#TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
#BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
#CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
#ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
#SUCH DAMAGE.
|
||||
|
||||
var slide_tween : Tween = null
|
||||
var main_tween : Tween = null
|
||||
var is_hovered : bool = false
|
||||
var can_pause : bool = false
|
||||
|
||||
func set_message(message : String, destroy : bool = true, duration : float = 5.0) -> void:
|
||||
var scale : float = size.y/1080.0
|
||||
$Anchor.scale = Vector2.ONE*scale
|
||||
|
||||
var label : Control = $Anchor/Label
|
||||
label.text = message
|
||||
label.visible = true
|
||||
|
||||
var original_position : Vector2 = label.position
|
||||
var offscreen_position : Vector2 = original_position + Vector2(1000, 0)
|
||||
label.position = offscreen_position
|
||||
|
||||
main_tween = create_tween()
|
||||
main_tween.set_ease(Tween.EASE_OUT)
|
||||
main_tween.set_trans(Tween.TRANS_CUBIC)
|
||||
main_tween.tween_property(label, "position", original_position, 0.5)
|
||||
main_tween.tween_callback(func():
|
||||
can_pause = true
|
||||
if is_hovered: main_tween.pause())
|
||||
|
||||
if destroy:
|
||||
main_tween.tween_interval(duration)
|
||||
main_tween.tween_callback(func(): can_pause = false)
|
||||
|
||||
main_tween.set_ease(Tween.EASE_IN)
|
||||
main_tween.tween_property(label, "position", offscreen_position, 0.5)
|
||||
|
||||
await main_tween.finished
|
||||
queue_free()
|
||||
|
||||
func update_position(target_height : float) -> void:
|
||||
var target_y : float = -target_height
|
||||
|
||||
if slide_tween:
|
||||
slide_tween.kill()
|
||||
|
||||
slide_tween = create_tween()
|
||||
slide_tween.set_ease(Tween.EASE_OUT)
|
||||
slide_tween.set_trans(Tween.TRANS_CUBIC)
|
||||
slide_tween.tween_property(self, "position:y", target_y, 0.3)
|
||||
|
||||
func get_height() -> float:
|
||||
var scale : float = size.y/1080.0
|
||||
return ($Anchor/Label.size.y + 20)*scale
|
||||
|
||||
func _on_label_meta_clicked(meta: Variant) -> void:
|
||||
OS.shell_open(str(meta))
|
||||
|
||||
func _on_label_mouse_entered() -> void:
|
||||
is_hovered = true
|
||||
if main_tween and main_tween.is_running() and can_pause:
|
||||
main_tween.pause()
|
||||
|
||||
func _on_label_mouse_exited() -> void:
|
||||
is_hovered = false
|
||||
if main_tween and main_tween.is_valid() and can_pause:
|
||||
main_tween.play()
|
||||
1
addons/GD-Sync/UI/Messages/ToastMessage.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://cv2owqer2ekyg
|
||||
48
addons/GD-Sync/UI/Messages/ToastMessage.tscn
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
[gd_scene load_steps=3 format=3 uid="uid://dewhdphifjt15"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cv2owqer2ekyg" path="res://addons/GD-Sync/UI/Messages/ToastMessage.gd" id="1_2ijdd"]
|
||||
[ext_resource type="Theme" uid="uid://5whm1igkt23h" path="res://addons/GD-Sync/UI/ConfigMenu/GD-Theme.tres" id="1_nql3a"]
|
||||
|
||||
[node name="ToastMessage" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
mouse_filter = 2
|
||||
theme = ExtResource("1_nql3a")
|
||||
script = ExtResource("1_2ijdd")
|
||||
|
||||
[node name="Anchor" type="Control" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 3
|
||||
anchor_left = 1.0
|
||||
anchor_top = 1.0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 0
|
||||
grow_vertical = 0
|
||||
mouse_filter = 2
|
||||
|
||||
[node name="Label" type="RichTextLabel" parent="Anchor"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 3
|
||||
anchor_left = 1.0
|
||||
anchor_top = 1.0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -553.0
|
||||
offset_top = -66.0
|
||||
offset_right = -13.880005
|
||||
offset_bottom = -15.0
|
||||
grow_horizontal = 0
|
||||
grow_vertical = 0
|
||||
theme_type_variation = &"MessageLabel"
|
||||
bbcode_enabled = true
|
||||
text = "Epic cool message!"
|
||||
fit_content = true
|
||||
|
||||
[connection signal="meta_clicked" from="Anchor/Label" to="." method="_on_label_meta_clicked"]
|
||||
[connection signal="mouse_entered" from="Anchor/Label" to="." method="_on_label_mouse_entered"]
|
||||
[connection signal="mouse_exited" from="Anchor/Label" to="." method="_on_label_mouse_exited"]
|
||||
266
addons/GD-Sync/UI/Profiler/GDSyncProfiler.gd
Normal file
|
|
@ -0,0 +1,266 @@
|
|||
@tool
|
||||
extends Control
|
||||
|
||||
#Copyright (c) 2023-present GD-Sync.
|
||||
#All rights reserved.
|
||||
#
|
||||
#Redistribution and use in source form, with or without modification,
|
||||
#are permitted provided that the following conditions are met:
|
||||
#
|
||||
#1. Redistributions of source code must retain the above copyright notice,
|
||||
# this list of conditions and the following disclaimer.
|
||||
#
|
||||
#2. Neither the name of GD-Sync nor the names of its contributors may be used
|
||||
# to endorse or promote products derived from this software without specific
|
||||
# prior written permission.
|
||||
#
|
||||
#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
#EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
#OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
#SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
#INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
||||
#TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
#BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
#CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
#ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
#SUCH DAMAGE.
|
||||
|
||||
signal stats_updated(client_id : int, stats : Dictionary)
|
||||
signal custom_data_updated(data : Dictionary)
|
||||
signal message_details_updated(details : Dictionary)
|
||||
signal client_joined(client_id : int)
|
||||
signal client_left(client_id : int)
|
||||
signal ping_measured(client_id : int, ping : float, perceived_ping : float)
|
||||
signal start_monitoring_connections
|
||||
signal stop_monitoring_connections
|
||||
signal artificial_latency_changed(latency_ms : int)
|
||||
signal profiler_cleared()
|
||||
signal profiler_started()
|
||||
signal profiler_stopped()
|
||||
|
||||
@export var start_button : Button = null : set = _set_start_button
|
||||
@export var stop_button : Button = null : set = _set_stop_button
|
||||
|
||||
var auto_start : bool = false
|
||||
var artificial_latency_ms : int = 0
|
||||
|
||||
var valid_session : bool = false
|
||||
var global_stats : Dictionary = {
|
||||
"up":0,"down":0,"pkts_up":0,"pkts_down":0,
|
||||
"up_sec":0.0,"down_sec":0.0,"pkts_up_sec":0.0,"pkts_down_sec":0.0,
|
||||
"avg_msg_up":0.0,"avg_msg_down":0.0,"avg_msg_up_sec":0.0,"avg_msg_down_sec":0.0,
|
||||
"last":0.0,"hist":[],
|
||||
"total_sec": 0.0
|
||||
}
|
||||
var client_stats : Dictionary = {}
|
||||
var custom_data : Dictionary = {}
|
||||
var message_details_up : Dictionary = {}
|
||||
var message_details_down : Dictionary = {}
|
||||
var last_details_emit : float = 0.0
|
||||
const DETAILS_EMIT_INTERVAL : float = 5.0
|
||||
|
||||
func _ready() -> void:
|
||||
stop()
|
||||
clear()
|
||||
invalidate_session()
|
||||
_update_button_states()
|
||||
|
||||
func _on_auto_start_toggled(toggled_on: bool) -> void:
|
||||
auto_start = true
|
||||
|
||||
func _on_artificial_latency_changed(value : float) -> void:
|
||||
artificial_latency_ms = int(value)
|
||||
artificial_latency_changed.emit(artificial_latency_ms)
|
||||
|
||||
func _set_start_button(btn) -> void:
|
||||
start_button = btn
|
||||
_update_button_states()
|
||||
|
||||
func _set_stop_button(btn) -> void:
|
||||
stop_button = btn
|
||||
_update_button_states()
|
||||
|
||||
func _update_button_states() -> void:
|
||||
if start_button:
|
||||
start_button.disabled = is_processing() or !valid_session
|
||||
if stop_button:
|
||||
stop_button.disabled = !is_processing() or !valid_session
|
||||
|
||||
func start() -> void:
|
||||
if is_processing(): return
|
||||
set_process(true)
|
||||
profiler_started.emit()
|
||||
_update_button_states()
|
||||
|
||||
func stop() -> void:
|
||||
if not is_processing(): return
|
||||
set_process(false)
|
||||
profiler_stopped.emit()
|
||||
_update_button_states()
|
||||
|
||||
func clear() -> void:
|
||||
global_stats = {
|
||||
"up":0,"down":0,"pkts_up":0,"pkts_down":0,
|
||||
"up_sec":0.0,"down_sec":0.0,"pkts_up_sec":0.0,"pkts_down_sec":0.0,
|
||||
"avg_msg_up":0.0,"avg_msg_down":0.0,"avg_msg_up_sec":0.0,"avg_msg_down_sec":0.0,
|
||||
"last":0.0,"hist":[],
|
||||
"total_sec": 0.0
|
||||
}
|
||||
client_stats.clear()
|
||||
custom_data.clear()
|
||||
message_details_up.clear()
|
||||
message_details_down.clear()
|
||||
last_details_emit = 0.0
|
||||
profiler_cleared.emit()
|
||||
custom_data_updated.emit(custom_data)
|
||||
message_details_updated.emit({"up": {}, "down": {}})
|
||||
|
||||
func validate_session() -> void:
|
||||
valid_session = true
|
||||
_update_button_states()
|
||||
|
||||
func invalidate_session() -> void:
|
||||
valid_session = false
|
||||
_update_button_states()
|
||||
|
||||
func game_started() -> void:
|
||||
if auto_start:
|
||||
start()
|
||||
|
||||
func register_transfer_usage(client_id : int, origin : Dictionary, byte_count : int, upload : bool, details : String) -> void:
|
||||
if client_id <= 0: return
|
||||
var dir = "up" if upload else "down"
|
||||
var pkt_key = "pkts_" + dir
|
||||
global_stats[dir] += byte_count
|
||||
global_stats[pkt_key] += 1
|
||||
var c = client_stats.get(client_id, {
|
||||
"up":0,"down":0,"pkts_up":0,"pkts_down":0,
|
||||
"up_sec":0.0,"down_sec":0.0,"pkts_up_sec":0.0,"pkts_down_sec":0.0,
|
||||
"avg_msg_up":0.0,"avg_msg_down":0.0,"avg_msg_up_sec":0.0,"avg_msg_down_sec":0.0,
|
||||
"last":0.0,"hist":[],
|
||||
"total_sec": 0.0
|
||||
})
|
||||
c[dir] += byte_count
|
||||
c[pkt_key] += 1
|
||||
client_stats[client_id] = c
|
||||
|
||||
var key = "%s-%s-%s" % [origin.get("type", ""), origin.get("object", ""), origin.get("target", "")]
|
||||
if key == "--":
|
||||
return
|
||||
|
||||
var details_dict = message_details_up if upload else message_details_down
|
||||
var entry = details_dict.get(key, {
|
||||
"type": origin.get("type", ""),
|
||||
"object": origin.get("object", ""),
|
||||
"target": origin.get("target", ""),
|
||||
"count": 0,
|
||||
"total_bytes": 0,
|
||||
"avg_bytes": 0.0,
|
||||
"percent": 0.0,
|
||||
"last_details": []
|
||||
})
|
||||
entry.count += 1
|
||||
entry.total_bytes += byte_count
|
||||
entry.avg_bytes = entry.total_bytes / entry.count
|
||||
|
||||
entry.last_details.append(details)
|
||||
if entry.last_details.size() > 3:
|
||||
entry.last_details.pop_front()
|
||||
|
||||
details_dict[key] = entry
|
||||
|
||||
func register_custom_data(data : Dictionary) -> void:
|
||||
for key in data.keys():
|
||||
custom_data[key] = data[key]
|
||||
custom_data_updated.emit(custom_data)
|
||||
|
||||
func _process(_delta):
|
||||
var now = Time.get_ticks_msec() / 1000.0
|
||||
if now - global_stats.last >= 1.0:
|
||||
_update_rates(global_stats, now)
|
||||
_update_rates_all_clients(now)
|
||||
_emit_all()
|
||||
global_stats.last = now
|
||||
|
||||
if now - last_details_emit >= DETAILS_EMIT_INTERVAL:
|
||||
_update_message_percentages()
|
||||
var combined = {
|
||||
"up": message_details_up.duplicate(),
|
||||
"down": message_details_down.duplicate()
|
||||
}
|
||||
message_details_updated.emit(combined)
|
||||
last_details_emit = now
|
||||
|
||||
func _update_message_percentages() -> void:
|
||||
_update_percentages_for(message_details_up)
|
||||
_update_percentages_for(message_details_down)
|
||||
|
||||
func _update_percentages_for(dict : Dictionary) -> void:
|
||||
var total_bytes : int = 0
|
||||
for key in dict.keys():
|
||||
total_bytes += dict[key].total_bytes
|
||||
if total_bytes == 0:
|
||||
for key in dict.keys():
|
||||
dict[key].percent = 0.0
|
||||
else:
|
||||
for key in dict.keys():
|
||||
var entry = dict[key]
|
||||
entry.percent = (entry.total_bytes as float / total_bytes) * 100.0
|
||||
dict[key] = entry
|
||||
|
||||
func _update_rates(stats : Dictionary, now : float) -> void:
|
||||
var h = stats.hist
|
||||
h.append({
|
||||
"t":now,
|
||||
"up":stats.up,"down":stats.down,
|
||||
"pkts_up":stats.pkts_up,"pkts_down":stats.pkts_down
|
||||
})
|
||||
while h.size() > 0 and now - h[0].t > 5.0:
|
||||
h.pop_front()
|
||||
if h.size() < 2:
|
||||
stats.up_sec = 0.0
|
||||
stats.down_sec = 0.0
|
||||
stats.pkts_up_sec = 0.0
|
||||
stats.pkts_down_sec = 0.0
|
||||
stats.avg_msg_up = 0.0
|
||||
stats.avg_msg_down = 0.0
|
||||
stats.avg_msg_up_sec = 0.0
|
||||
stats.avg_msg_down_sec = 0.0
|
||||
stats.total_sec = 0.0
|
||||
return
|
||||
var first = h[0]
|
||||
var last = h[-1]
|
||||
var dt = last.t - first.t
|
||||
if dt <= 0.0:
|
||||
stats.up_sec = 0.0
|
||||
stats.down_sec = 0.0
|
||||
stats.pkts_up_sec = 0.0
|
||||
stats.pkts_down_sec = 0.0
|
||||
stats.avg_msg_up_sec = 0.0
|
||||
stats.avg_msg_down_sec = 0.0
|
||||
stats.total_sec = 0.0
|
||||
return
|
||||
var delta_up = last.up - first.up
|
||||
var delta_down = last.down - first.down
|
||||
var delta_pkts_up = last.pkts_up - first.pkts_up
|
||||
var delta_pkts_down = last.pkts_down - first.pkts_down
|
||||
stats.up_sec = delta_up / dt
|
||||
stats.down_sec = delta_down / dt
|
||||
stats.pkts_up_sec = delta_pkts_up / dt
|
||||
stats.pkts_down_sec = delta_pkts_down / dt
|
||||
stats.avg_msg_up_sec = delta_up / delta_pkts_up if delta_pkts_up > 0 else 0.0
|
||||
stats.avg_msg_down_sec = delta_down / delta_pkts_down if delta_pkts_down > 0 else 0.0
|
||||
var total_pkts_up = stats.pkts_up
|
||||
var total_pkts_down = stats.pkts_down
|
||||
stats.avg_msg_up = stats.up / total_pkts_up if total_pkts_up > 0 else 0.0
|
||||
stats.avg_msg_down = stats.down / total_pkts_down if total_pkts_down > 0 else 0.0
|
||||
stats.total_sec = stats.up_sec + stats.down_sec
|
||||
|
||||
func _update_rates_all_clients(now : float) -> void:
|
||||
for cid in client_stats.keys():
|
||||
_update_rates(client_stats[cid], now)
|
||||
|
||||
func _emit_all() -> void:
|
||||
stats_updated.emit(-1, global_stats)
|
||||
for cid in client_stats.keys():
|
||||
stats_updated.emit(cid, client_stats[cid])
|
||||
1
addons/GD-Sync/UI/Profiler/GDSyncProfiler.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://c00gfpya5uiw0
|
||||
810
addons/GD-Sync/UI/Profiler/GDSyncProfiler.tscn
Normal file
|
|
@ -0,0 +1,810 @@
|
|||
[gd_scene load_steps=6 format=3 uid="uid://c3udn6jwoy6an"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://c00gfpya5uiw0" path="res://addons/GD-Sync/UI/Profiler/GDSyncProfiler.gd" id="1_ysct5"]
|
||||
[ext_resource type="Script" uid="uid://b3p26nyamgl8j" path="res://addons/GD-Sync/UI/Profiler/ProfilerLabel.gd" id="2_5m75r"]
|
||||
[ext_resource type="Script" uid="uid://8618gttywoy6" path="res://addons/GD-Sync/UI/Profiler/ProfilerGraph.gd" id="3_hrjsf"]
|
||||
[ext_resource type="Script" uid="uid://4b1i1ihfsqdf" path="res://addons/GD-Sync/UI/Profiler/ProfilerDetailsDisplay.gd" id="4_bk6j0"]
|
||||
[ext_resource type="Script" uid="uid://frgb8qcxxcoj" path="res://addons/GD-Sync/UI/Profiler/ProfilerConnectionMonitor.gd" id="4_gnjya"]
|
||||
|
||||
[node name="GDSyncProfiler" type="Control" node_paths=PackedStringArray("start_button", "stop_button")]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_ysct5")
|
||||
start_button = NodePath("VBoxContainer/HBoxContainer/Start")
|
||||
stop_button = NodePath("VBoxContainer/HBoxContainer/Stop")
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Title" type="Label" parent="VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "GD-Sync Network Profiler"
|
||||
|
||||
[node name="VSeparator" type="VSeparator" parent="VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Start" type="Button" parent="VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
disabled = true
|
||||
text = "Start Profiler"
|
||||
|
||||
[node name="Stop" type="Button" parent="VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
disabled = true
|
||||
text = "Stop Profiler"
|
||||
|
||||
[node name="Clear" type="Button" parent="VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Clear Profiler"
|
||||
|
||||
[node name="VSeparator2" type="VSeparator" parent="VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="AutoStart" type="CheckButton" parent="VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Auto Start"
|
||||
|
||||
[node name="VSeparator3" type="VSeparator" parent="VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="LatencyLabel" type="Label" parent="VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
tooltip_text = "Adds artificial send and receive latency to this client for debugging. Set to 0 to disable."
|
||||
text = "Artificial Latency (ms)"
|
||||
|
||||
[node name="LatencySpinBox" type="SpinBox" parent="VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
tooltip_text = "Adds artificial send and receive latency to this client for debugging. Set to 0 to disable."
|
||||
max_value = 5000.0
|
||||
prefix = ""
|
||||
suffix = "ms"
|
||||
|
||||
[node name="HSeparator" type="HSeparator" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="TabContainer" type="TabContainer" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
current_tab = 1
|
||||
|
||||
[node name="General" type="TabBar" parent="VBoxContainer/TabContainer"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
metadata/_tab_index = 0
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="VBoxContainer/TabContainer/General"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/TabContainer/General/ScrollContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="PanelContainer" type="PanelContainer" parent="VBoxContainer/TabContainer/General/ScrollContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/TabContainer/General/ScrollContainer/VBoxContainer/PanelContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/TabContainer/General/ScrollContainer/VBoxContainer/PanelContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/TabContainer/General/ScrollContainer/VBoxContainer/PanelContainer/HBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="Incoming" type="Label" parent="VBoxContainer/TabContainer/General/ScrollContainer/VBoxContainer/PanelContainer/HBoxContainer/HBoxContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Incoming:"
|
||||
|
||||
[node name="Label1" type="RichTextLabel" parent="VBoxContainer/TabContainer/General/ScrollContainer/VBoxContainer/PanelContainer/HBoxContainer/HBoxContainer/VBoxContainer" node_paths=PackedStringArray("profiler")]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
tooltip_text = "The total amount of bytes that have been received from both the server and other clients."
|
||||
bbcode_enabled = true
|
||||
text = "[color=#ffffff]Total Bytes Received: ...[/color]"
|
||||
fit_content = true
|
||||
script = ExtResource("2_5m75r")
|
||||
profiler = NodePath("../../../../../../../../../..")
|
||||
stat_key = "down"
|
||||
decimal_places = 2
|
||||
suffix = ""
|
||||
label_text = "Total Bytes Received"
|
||||
|
||||
[node name="Label2" type="RichTextLabel" parent="VBoxContainer/TabContainer/General/ScrollContainer/VBoxContainer/PanelContainer/HBoxContainer/HBoxContainer/VBoxContainer" node_paths=PackedStringArray("profiler")]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
tooltip_text = "The total amount of messages that have been received from both the server and other clients."
|
||||
bbcode_enabled = true
|
||||
text = "[color=#ffffff]Total Messages Received: ...[/color]"
|
||||
fit_content = true
|
||||
script = ExtResource("2_5m75r")
|
||||
profiler = NodePath("../../../../../../../../../..")
|
||||
stat_key = "pkts_down"
|
||||
is_bytes = false
|
||||
decimal_places = 0
|
||||
suffix = ""
|
||||
label_text = "Total Messages Received"
|
||||
|
||||
[node name="Label3" type="RichTextLabel" parent="VBoxContainer/TabContainer/General/ScrollContainer/VBoxContainer/PanelContainer/HBoxContainer/HBoxContainer/VBoxContainer" node_paths=PackedStringArray("profiler")]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
tooltip_text = "The total amount of bytes that are being received per second from both the server and other clients."
|
||||
bbcode_enabled = true
|
||||
text = "[color=#ffffff]Bytes Received Per Second: ...[/color]"
|
||||
fit_content = true
|
||||
script = ExtResource("2_5m75r")
|
||||
profiler = NodePath("../../../../../../../../../..")
|
||||
stat_key = "down_sec"
|
||||
decimal_places = 2
|
||||
label_text = "Bytes Received Per Second"
|
||||
|
||||
[node name="Label4" type="RichTextLabel" parent="VBoxContainer/TabContainer/General/ScrollContainer/VBoxContainer/PanelContainer/HBoxContainer/HBoxContainer/VBoxContainer" node_paths=PackedStringArray("profiler")]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
tooltip_text = "The total amount of messages that are being received per second from both the server and other clients."
|
||||
bbcode_enabled = true
|
||||
text = "[color=#ffffff]Messages Received Per Second: ...[/color]"
|
||||
fit_content = true
|
||||
script = ExtResource("2_5m75r")
|
||||
profiler = NodePath("../../../../../../../../../..")
|
||||
stat_key = "pkts_down_sec"
|
||||
is_bytes = false
|
||||
decimal_places = 0
|
||||
label_text = "Messages Received Per Second"
|
||||
|
||||
[node name="Label5" type="RichTextLabel" parent="VBoxContainer/TabContainer/General/ScrollContainer/VBoxContainer/PanelContainer/HBoxContainer/HBoxContainer/VBoxContainer" node_paths=PackedStringArray("profiler")]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
tooltip_text = "The average size of all received messages."
|
||||
bbcode_enabled = true
|
||||
text = "[color=#ffffff]Average Message Size: ...[/color]"
|
||||
fit_content = true
|
||||
script = ExtResource("2_5m75r")
|
||||
profiler = NodePath("../../../../../../../../../..")
|
||||
stat_key = "avg_msg_down"
|
||||
suffix = ""
|
||||
label_text = "Average Message Size"
|
||||
|
||||
[node name="VBoxContainer3" type="VBoxContainer" parent="VBoxContainer/TabContainer/General/ScrollContainer/VBoxContainer/PanelContainer/HBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="Outgoing" type="Label" parent="VBoxContainer/TabContainer/General/ScrollContainer/VBoxContainer/PanelContainer/HBoxContainer/HBoxContainer/VBoxContainer3"]
|
||||
layout_mode = 2
|
||||
text = "Outgoing:"
|
||||
|
||||
[node name="Label1" type="RichTextLabel" parent="VBoxContainer/TabContainer/General/ScrollContainer/VBoxContainer/PanelContainer/HBoxContainer/HBoxContainer/VBoxContainer3" node_paths=PackedStringArray("profiler")]
|
||||
layout_mode = 2
|
||||
tooltip_text = "The total amount of bytes that have been sent to both the server and other clients."
|
||||
bbcode_enabled = true
|
||||
text = "[color=#ffffff]Total Bytes Sent: ...[/color]"
|
||||
fit_content = true
|
||||
script = ExtResource("2_5m75r")
|
||||
profiler = NodePath("../../../../../../../../../..")
|
||||
stat_key = "up"
|
||||
decimal_places = 2
|
||||
suffix = ""
|
||||
label_text = "Total Bytes Sent"
|
||||
|
||||
[node name="Label2" type="RichTextLabel" parent="VBoxContainer/TabContainer/General/ScrollContainer/VBoxContainer/PanelContainer/HBoxContainer/HBoxContainer/VBoxContainer3" node_paths=PackedStringArray("profiler")]
|
||||
layout_mode = 2
|
||||
tooltip_text = "The total amount of messages that have been sent to both the server and other clients."
|
||||
bbcode_enabled = true
|
||||
text = "[color=#ffffff]Total Messages Sent: ...[/color]"
|
||||
fit_content = true
|
||||
script = ExtResource("2_5m75r")
|
||||
profiler = NodePath("../../../../../../../../../..")
|
||||
stat_key = "pkts_up"
|
||||
is_bytes = false
|
||||
decimal_places = 0
|
||||
suffix = ""
|
||||
label_text = "Total Messages Sent"
|
||||
|
||||
[node name="Label3" type="RichTextLabel" parent="VBoxContainer/TabContainer/General/ScrollContainer/VBoxContainer/PanelContainer/HBoxContainer/HBoxContainer/VBoxContainer3" node_paths=PackedStringArray("profiler")]
|
||||
layout_mode = 2
|
||||
tooltip_text = "The total amount of bytes that are being sent per second to both the server and other clients."
|
||||
bbcode_enabled = true
|
||||
text = "[color=#ffffff]Bytes Sent Per Second: ...[/color]"
|
||||
fit_content = true
|
||||
script = ExtResource("2_5m75r")
|
||||
profiler = NodePath("../../../../../../../../../..")
|
||||
decimal_places = 2
|
||||
label_text = "Bytes Sent Per Second"
|
||||
|
||||
[node name="Label4" type="RichTextLabel" parent="VBoxContainer/TabContainer/General/ScrollContainer/VBoxContainer/PanelContainer/HBoxContainer/HBoxContainer/VBoxContainer3" node_paths=PackedStringArray("profiler")]
|
||||
layout_mode = 2
|
||||
tooltip_text = "The total amount of messages that are being sent per second to both the server and other clients."
|
||||
bbcode_enabled = true
|
||||
text = "[color=#ffffff]Messages Sent Per Second: ...[/color]"
|
||||
fit_content = true
|
||||
script = ExtResource("2_5m75r")
|
||||
profiler = NodePath("../../../../../../../../../..")
|
||||
stat_key = "pkts_up_sec"
|
||||
is_bytes = false
|
||||
decimal_places = 0
|
||||
label_text = "Messages Sent Per Second"
|
||||
|
||||
[node name="Label5" type="RichTextLabel" parent="VBoxContainer/TabContainer/General/ScrollContainer/VBoxContainer/PanelContainer/HBoxContainer/HBoxContainer/VBoxContainer3" node_paths=PackedStringArray("profiler")]
|
||||
layout_mode = 2
|
||||
tooltip_text = "The average size of all sent messages."
|
||||
bbcode_enabled = true
|
||||
text = "[color=#ffffff]Average Message Size: ...[/color]"
|
||||
fit_content = true
|
||||
script = ExtResource("2_5m75r")
|
||||
profiler = NodePath("../../../../../../../../../..")
|
||||
stat_key = "avg_msg_up"
|
||||
suffix = ""
|
||||
label_text = "Average Message Size"
|
||||
|
||||
[node name="VSeparator2" type="VSeparator" parent="VBoxContainer/TabContainer/General/ScrollContainer/VBoxContainer/PanelContainer/HBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="VBoxContainer2" type="VBoxContainer" parent="VBoxContainer/TabContainer/General/ScrollContainer/VBoxContainer/PanelContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="Graph" type="Control" parent="VBoxContainer/TabContainer/General/ScrollContainer/VBoxContainer/PanelContainer/HBoxContainer/VBoxContainer2" node_paths=PackedStringArray("profiler")]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
script = ExtResource("3_hrjsf")
|
||||
profiler = NodePath("../../../../../../../../..")
|
||||
series = Array[Dictionary]([{
|
||||
"color": Color(0.290196, 0.870588, 0.501961, 1),
|
||||
"key": "down_sec",
|
||||
"label": "Incoming"
|
||||
}, {
|
||||
"color": Color(0.376471, 0.647059, 0.980392, 1),
|
||||
"key": "up_sec",
|
||||
"label": "Outgoing"
|
||||
}, {
|
||||
"color": Color(0.574867, 0.498099, 0.980392, 1),
|
||||
"key": "total_sec",
|
||||
"label": "Total"
|
||||
}])
|
||||
|
||||
[node name="Connections" type="TabBar" parent="VBoxContainer/TabContainer"]
|
||||
layout_mode = 2
|
||||
metadata/_tab_index = 1
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="VBoxContainer/TabContainer/Connections"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/TabContainer/Connections/ScrollContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="PanelContainer" type="PanelContainer" parent="VBoxContainer/TabContainer/Connections/ScrollContainer/VBoxContainer" node_paths=PackedStringArray("profiler", "button_template", "latency_graph_template", "jitter_graph_template")]
|
||||
layout_mode = 2
|
||||
script = ExtResource("4_gnjya")
|
||||
profiler = NodePath("../../../../../..")
|
||||
button_template = NodePath("HBoxContainer/HBoxContainer/VBoxContainer/ButtonTemplate")
|
||||
latency_graph_template = NodePath("HBoxContainer/VBoxContainer2/LatencyGraph")
|
||||
jitter_graph_template = NodePath("HBoxContainer/VBoxContainer3/JitterGraph")
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/TabContainer/Connections/ScrollContainer/VBoxContainer/PanelContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/TabContainer/Connections/ScrollContainer/VBoxContainer/PanelContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/TabContainer/Connections/ScrollContainer/VBoxContainer/PanelContainer/HBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="HSeparator" type="HSeparator" parent="VBoxContainer/TabContainer/Connections/ScrollContainer/VBoxContainer/PanelContainer/HBoxContainer/HBoxContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="MonitorButton" type="CheckButton" parent="VBoxContainer/TabContainer/Connections/ScrollContainer/VBoxContainer/PanelContainer/HBoxContainer/HBoxContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
tooltip_text = "Start monitoring the connections between clients. This will measure the ping and jitter and slightly increase transfer usage will enabled."
|
||||
text = "Monitor Connections"
|
||||
|
||||
[node name="HSeparator2" type="HSeparator" parent="VBoxContainer/TabContainer/Connections/ScrollContainer/VBoxContainer/PanelContainer/HBoxContainer/HBoxContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ButtonTemplate" type="Button" parent="VBoxContainer/TabContainer/Connections/ScrollContainer/VBoxContainer/PanelContainer/HBoxContainer/HBoxContainer/VBoxContainer"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
tooltip_text = "Press to show the latency and jitter to this client."
|
||||
text = "Client: 123"
|
||||
|
||||
[node name="VSeparator2" type="VSeparator" parent="VBoxContainer/TabContainer/Connections/ScrollContainer/VBoxContainer/PanelContainer/HBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="VBoxContainer2" type="VBoxContainer" parent="VBoxContainer/TabContainer/Connections/ScrollContainer/VBoxContainer/PanelContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="LatencyGraph" type="Control" parent="VBoxContainer/TabContainer/Connections/ScrollContainer/VBoxContainer/PanelContainer/HBoxContainer/VBoxContainer2" node_paths=PackedStringArray("profiler")]
|
||||
custom_minimum_size = Vector2(0, 200)
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
tooltip_text = "Latency is the raw network round-trip time in milliseconds: the time for a message to go to the other client and return.
|
||||
|
||||
Perceived latency is the same trip, plus extra delay from frame timing and message handling, representing what the player actually experiences."
|
||||
script = ExtResource("3_hrjsf")
|
||||
profiler = NodePath("../../..")
|
||||
series = Array[Dictionary]([{
|
||||
"color": Color(0.376471, 0.647059, 0.980392, 1),
|
||||
"key": "latency",
|
||||
"label": "Latency"
|
||||
}, {
|
||||
"color": Color(0.6431373, 1, 0.76932174, 1),
|
||||
"key": "perceived_latency",
|
||||
"label": "Perceived Latency"
|
||||
}])
|
||||
display_mode = 1
|
||||
|
||||
[node name="VBoxContainer3" type="VBoxContainer" parent="VBoxContainer/TabContainer/Connections/ScrollContainer/VBoxContainer/PanelContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="JitterGraph" type="Control" parent="VBoxContainer/TabContainer/Connections/ScrollContainer/VBoxContainer/PanelContainer/HBoxContainer/VBoxContainer3" node_paths=PackedStringArray("profiler")]
|
||||
custom_minimum_size = Vector2(0, 200)
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
tooltip_text = "The jitter between this and the selected client. Jitter is the difference between latency between now and last second.
|
||||
|
||||
High jitter indicates an unstable connection. Little to no jitter indicates a stable connection."
|
||||
script = ExtResource("3_hrjsf")
|
||||
profiler = NodePath("../../..")
|
||||
series = Array[Dictionary]([{
|
||||
"color": Color(0.952941, 0.545098, 0.658824, 1),
|
||||
"key": "jitter",
|
||||
"label": "Jitter"
|
||||
}])
|
||||
display_mode = 1
|
||||
|
||||
[node name="Session" type="TabBar" parent="VBoxContainer/TabContainer"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
metadata/_tab_index = 2
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="VBoxContainer/TabContainer/Session"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/TabContainer/Session/ScrollContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="VBoxContainer2" type="VBoxContainer" parent="VBoxContainer/TabContainer/Session/ScrollContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="Label" type="Label" parent="VBoxContainer/TabContainer/Session/ScrollContainer/HBoxContainer/VBoxContainer2"]
|
||||
layout_mode = 2
|
||||
text = "Session Information"
|
||||
|
||||
[node name="HSeparator" type="HSeparator" parent="VBoxContainer/TabContainer/Session/ScrollContainer/HBoxContainer/VBoxContainer2"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/TabContainer/Session/ScrollContainer/HBoxContainer/VBoxContainer2"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="Label1" type="RichTextLabel" parent="VBoxContainer/TabContainer/Session/ScrollContainer/HBoxContainer/VBoxContainer2/VBoxContainer" node_paths=PackedStringArray("profiler")]
|
||||
layout_mode = 2
|
||||
tooltip_text = "The Client ID that is assigned to this session."
|
||||
bbcode_enabled = true
|
||||
text = "[color=#ffffff]Client ID: N/A[/color]"
|
||||
fit_content = true
|
||||
script = ExtResource("2_5m75r")
|
||||
profiler = NodePath("../../../../../../../..")
|
||||
stat_key = "client_id"
|
||||
is_bytes = false
|
||||
suffix = ""
|
||||
label_text = "Client ID"
|
||||
use_custom_data = true
|
||||
|
||||
[node name="Label2" type="RichTextLabel" parent="VBoxContainer/TabContainer/Session/ScrollContainer/HBoxContainer/VBoxContainer2/VBoxContainer" node_paths=PackedStringArray("profiler")]
|
||||
layout_mode = 2
|
||||
tooltip_text = "If the client in this session is the host of the current lobby or not."
|
||||
bbcode_enabled = true
|
||||
text = "[color=#ffffff]Is Host: N/A[/color]"
|
||||
fit_content = true
|
||||
script = ExtResource("2_5m75r")
|
||||
profiler = NodePath("../../../../../../../..")
|
||||
stat_key = "is_host"
|
||||
is_bytes = false
|
||||
suffix = ""
|
||||
label_text = "Is Host"
|
||||
use_custom_data = true
|
||||
|
||||
[node name="Label3" type="RichTextLabel" parent="VBoxContainer/TabContainer/Session/ScrollContainer/HBoxContainer/VBoxContainer2/VBoxContainer" node_paths=PackedStringArray("profiler")]
|
||||
layout_mode = 2
|
||||
tooltip_text = "If the client in this session is the host of the current lobby or not."
|
||||
bbcode_enabled = true
|
||||
text = "[color=#ffffff]Host ID: N/A[/color]"
|
||||
fit_content = true
|
||||
script = ExtResource("2_5m75r")
|
||||
profiler = NodePath("../../../../../../../..")
|
||||
stat_key = "host"
|
||||
is_bytes = false
|
||||
suffix = ""
|
||||
label_text = "Host ID"
|
||||
use_custom_data = true
|
||||
|
||||
[node name="HSeparator2" type="HSeparator" parent="VBoxContainer/TabContainer/Session/ScrollContainer/HBoxContainer/VBoxContainer2"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="VBoxContainer2" type="VBoxContainer" parent="VBoxContainer/TabContainer/Session/ScrollContainer/HBoxContainer/VBoxContainer2"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="Label3" type="RichTextLabel" parent="VBoxContainer/TabContainer/Session/ScrollContainer/HBoxContainer/VBoxContainer2/VBoxContainer2" node_paths=PackedStringArray("profiler")]
|
||||
layout_mode = 2
|
||||
tooltip_text = "The name of the lobby the client of this session is currently in."
|
||||
bbcode_enabled = true
|
||||
text = "[color=#ffffff]Lobby Name: N/A[/color]"
|
||||
fit_content = true
|
||||
script = ExtResource("2_5m75r")
|
||||
profiler = NodePath("../../../../../../../..")
|
||||
stat_key = "lobby_name"
|
||||
is_bytes = false
|
||||
suffix = ""
|
||||
label_text = "Lobby Name"
|
||||
use_custom_data = true
|
||||
|
||||
[node name="Label4" type="RichTextLabel" parent="VBoxContainer/TabContainer/Session/ScrollContainer/HBoxContainer/VBoxContainer2/VBoxContainer2" node_paths=PackedStringArray("profiler")]
|
||||
layout_mode = 2
|
||||
tooltip_text = "The password of the lobby the client of this session is currently in."
|
||||
bbcode_enabled = true
|
||||
text = "[color=#ffffff]Lobby Password: N/A[/color]"
|
||||
fit_content = true
|
||||
script = ExtResource("2_5m75r")
|
||||
profiler = NodePath("../../../../../../../..")
|
||||
stat_key = "lobby_password"
|
||||
is_bytes = false
|
||||
suffix = ""
|
||||
label_text = "Lobby Password"
|
||||
use_custom_data = true
|
||||
|
||||
[node name="VSeparator" type="VSeparator" parent="VBoxContainer/TabContainer/Session/ScrollContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/TabContainer/Session/ScrollContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="Label" type="Label" parent="VBoxContainer/TabContainer/Session/ScrollContainer/HBoxContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Player Data"
|
||||
|
||||
[node name="HSeparator" type="HSeparator" parent="VBoxContainer/TabContainer/Session/ScrollContainer/HBoxContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label1" type="RichTextLabel" parent="VBoxContainer/TabContainer/Session/ScrollContainer/HBoxContainer/VBoxContainer" node_paths=PackedStringArray("profiler")]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
focus_mode = 2
|
||||
bbcode_enabled = true
|
||||
text = "[color=#ffffff]{}[/color]"
|
||||
selection_enabled = true
|
||||
script = ExtResource("2_5m75r")
|
||||
profiler = NodePath("../../../../../../..")
|
||||
stat_key = "player_data"
|
||||
is_bytes = false
|
||||
suffix = ""
|
||||
label_text = "Player Data"
|
||||
show_label_text = false
|
||||
use_custom_data = true
|
||||
missing_text = "{}"
|
||||
|
||||
[node name="VSeparator2" type="VSeparator" parent="VBoxContainer/TabContainer/Session/ScrollContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="VBoxContainer3" type="VBoxContainer" parent="VBoxContainer/TabContainer/Session/ScrollContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="Label" type="Label" parent="VBoxContainer/TabContainer/Session/ScrollContainer/HBoxContainer/VBoxContainer3"]
|
||||
layout_mode = 2
|
||||
text = "Lobby Data"
|
||||
|
||||
[node name="HSeparator" type="HSeparator" parent="VBoxContainer/TabContainer/Session/ScrollContainer/HBoxContainer/VBoxContainer3"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label1" type="RichTextLabel" parent="VBoxContainer/TabContainer/Session/ScrollContainer/HBoxContainer/VBoxContainer3" node_paths=PackedStringArray("profiler")]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
focus_mode = 2
|
||||
bbcode_enabled = true
|
||||
text = "[color=#ffffff]{}[/color]"
|
||||
selection_enabled = true
|
||||
script = ExtResource("2_5m75r")
|
||||
profiler = NodePath("../../../../../../..")
|
||||
stat_key = "lobby_data"
|
||||
is_bytes = false
|
||||
suffix = ""
|
||||
label_text = "Player Data"
|
||||
show_label_text = false
|
||||
use_custom_data = true
|
||||
missing_text = "{}"
|
||||
|
||||
[node name="Incoming Details" type="TabBar" parent="VBoxContainer/TabContainer"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
metadata/_tab_index = 3
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="VBoxContainer/TabContainer/Incoming Details"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/TabContainer/Incoming Details/ScrollContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/TabContainer/Incoming Details/ScrollContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="VBoxContainer2" type="VBoxContainer" parent="VBoxContainer/TabContainer/Incoming Details/ScrollContainer/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="Label" type="Label" parent="VBoxContainer/TabContainer/Incoming Details/ScrollContainer/VBoxContainer/HBoxContainer/VBoxContainer2"]
|
||||
layout_mode = 2
|
||||
text = "Incoming Usage Details"
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/TabContainer/Incoming Details/ScrollContainer/VBoxContainer/HBoxContainer/VBoxContainer2"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Button" parent="VBoxContainer/TabContainer/Incoming Details/ScrollContainer/VBoxContainer/HBoxContainer/VBoxContainer2/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Type"
|
||||
|
||||
[node name="Label2" type="Button" parent="VBoxContainer/TabContainer/Incoming Details/ScrollContainer/VBoxContainer/HBoxContainer/VBoxContainer2/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Object"
|
||||
|
||||
[node name="Label3" type="Button" parent="VBoxContainer/TabContainer/Incoming Details/ScrollContainer/VBoxContainer/HBoxContainer/VBoxContainer2/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Target"
|
||||
|
||||
[node name="Label4" type="Button" parent="VBoxContainer/TabContainer/Incoming Details/ScrollContainer/VBoxContainer/HBoxContainer/VBoxContainer2/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Count"
|
||||
|
||||
[node name="Label5" type="Button" parent="VBoxContainer/TabContainer/Incoming Details/ScrollContainer/VBoxContainer/HBoxContainer/VBoxContainer2/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Total Bytes (descending)"
|
||||
|
||||
[node name="Label6" type="Button" parent="VBoxContainer/TabContainer/Incoming Details/ScrollContainer/VBoxContainer/HBoxContainer/VBoxContainer2/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Percent"
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/TabContainer/Incoming Details/ScrollContainer/VBoxContainer/HBoxContainer/VBoxContainer2" node_paths=PackedStringArray("type_sort_button", "object_sort_button", "target_sort_button", "count_sort_button", "usage_sort_button", "percent_sort_button", "profiler", "label_template")]
|
||||
layout_mode = 2
|
||||
script = ExtResource("4_bk6j0")
|
||||
type_sort_button = NodePath("../HBoxContainer/Label")
|
||||
object_sort_button = NodePath("../HBoxContainer/Label2")
|
||||
target_sort_button = NodePath("../HBoxContainer/Label3")
|
||||
count_sort_button = NodePath("../HBoxContainer/Label4")
|
||||
usage_sort_button = NodePath("../HBoxContainer/Label5")
|
||||
percent_sort_button = NodePath("../HBoxContainer/Label6")
|
||||
listen_key = "down"
|
||||
profiler = NodePath("../../../../../../../..")
|
||||
label_template = NodePath("PanelContainer")
|
||||
|
||||
[node name="PanelContainer" type="PanelContainer" parent="VBoxContainer/TabContainer/Incoming Details/ScrollContainer/VBoxContainer/HBoxContainer/VBoxContainer2/VBoxContainer"]
|
||||
visible = false
|
||||
self_modulate = Color(0.734375, 0.734375, 0.734375, 1)
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Data" type="HBoxContainer" parent="VBoxContainer/TabContainer/Incoming Details/ScrollContainer/VBoxContainer/HBoxContainer/VBoxContainer2/VBoxContainer/PanelContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Type" type="RichTextLabel" parent="VBoxContainer/TabContainer/Incoming Details/ScrollContainer/VBoxContainer/HBoxContainer/VBoxContainer2/VBoxContainer/PanelContainer/Data"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
bbcode_enabled = true
|
||||
text = "Sync Var"
|
||||
fit_content = true
|
||||
|
||||
[node name="Object" type="RichTextLabel" parent="VBoxContainer/TabContainer/Incoming Details/ScrollContainer/VBoxContainer/HBoxContainer/VBoxContainer2/VBoxContainer/PanelContainer/Data"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
bbcode_enabled = true
|
||||
text = "Node123"
|
||||
fit_content = true
|
||||
|
||||
[node name="Target" type="RichTextLabel" parent="VBoxContainer/TabContainer/Incoming Details/ScrollContainer/VBoxContainer/HBoxContainer/VBoxContainer2/VBoxContainer/PanelContainer/Data"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
bbcode_enabled = true
|
||||
text = "Property Name"
|
||||
fit_content = true
|
||||
|
||||
[node name="Count" type="RichTextLabel" parent="VBoxContainer/TabContainer/Incoming Details/ScrollContainer/VBoxContainer/HBoxContainer/VBoxContainer2/VBoxContainer/PanelContainer/Data"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
bbcode_enabled = true
|
||||
text = "0"
|
||||
fit_content = true
|
||||
|
||||
[node name="Usage" type="RichTextLabel" parent="VBoxContainer/TabContainer/Incoming Details/ScrollContainer/VBoxContainer/HBoxContainer/VBoxContainer2/VBoxContainer/PanelContainer/Data"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
bbcode_enabled = true
|
||||
text = "0B"
|
||||
fit_content = true
|
||||
|
||||
[node name="Percentage" type="RichTextLabel" parent="VBoxContainer/TabContainer/Incoming Details/ScrollContainer/VBoxContainer/HBoxContainer/VBoxContainer2/VBoxContainer/PanelContainer/Data"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
bbcode_enabled = true
|
||||
text = "0%"
|
||||
fit_content = true
|
||||
|
||||
[node name="Outgoing Details" type="TabBar" parent="VBoxContainer/TabContainer"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
metadata/_tab_index = 4
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="VBoxContainer/TabContainer/Outgoing Details"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/TabContainer/Outgoing Details/ScrollContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/TabContainer/Outgoing Details/ScrollContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="VBoxContainer2" type="VBoxContainer" parent="VBoxContainer/TabContainer/Outgoing Details/ScrollContainer/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="Label" type="Label" parent="VBoxContainer/TabContainer/Outgoing Details/ScrollContainer/VBoxContainer/HBoxContainer/VBoxContainer2"]
|
||||
layout_mode = 2
|
||||
text = "Incoming Usage Details"
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/TabContainer/Outgoing Details/ScrollContainer/VBoxContainer/HBoxContainer/VBoxContainer2"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Button" parent="VBoxContainer/TabContainer/Outgoing Details/ScrollContainer/VBoxContainer/HBoxContainer/VBoxContainer2/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Type"
|
||||
|
||||
[node name="Label2" type="Button" parent="VBoxContainer/TabContainer/Outgoing Details/ScrollContainer/VBoxContainer/HBoxContainer/VBoxContainer2/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Object"
|
||||
|
||||
[node name="Label3" type="Button" parent="VBoxContainer/TabContainer/Outgoing Details/ScrollContainer/VBoxContainer/HBoxContainer/VBoxContainer2/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Target"
|
||||
|
||||
[node name="Label4" type="Button" parent="VBoxContainer/TabContainer/Outgoing Details/ScrollContainer/VBoxContainer/HBoxContainer/VBoxContainer2/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Count"
|
||||
|
||||
[node name="Label5" type="Button" parent="VBoxContainer/TabContainer/Outgoing Details/ScrollContainer/VBoxContainer/HBoxContainer/VBoxContainer2/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Total Bytes (descending)"
|
||||
|
||||
[node name="Label6" type="Button" parent="VBoxContainer/TabContainer/Outgoing Details/ScrollContainer/VBoxContainer/HBoxContainer/VBoxContainer2/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Percent"
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/TabContainer/Outgoing Details/ScrollContainer/VBoxContainer/HBoxContainer/VBoxContainer2" node_paths=PackedStringArray("type_sort_button", "object_sort_button", "target_sort_button", "count_sort_button", "usage_sort_button", "percent_sort_button", "profiler", "label_template")]
|
||||
layout_mode = 2
|
||||
script = ExtResource("4_bk6j0")
|
||||
type_sort_button = NodePath("../HBoxContainer/Label")
|
||||
object_sort_button = NodePath("../HBoxContainer/Label2")
|
||||
target_sort_button = NodePath("../HBoxContainer/Label3")
|
||||
count_sort_button = NodePath("../HBoxContainer/Label4")
|
||||
usage_sort_button = NodePath("../HBoxContainer/Label5")
|
||||
percent_sort_button = NodePath("../HBoxContainer/Label6")
|
||||
profiler = NodePath("../../../../../../../..")
|
||||
label_template = NodePath("PanelContainer")
|
||||
|
||||
[node name="PanelContainer" type="PanelContainer" parent="VBoxContainer/TabContainer/Outgoing Details/ScrollContainer/VBoxContainer/HBoxContainer/VBoxContainer2/VBoxContainer"]
|
||||
visible = false
|
||||
self_modulate = Color(0.734375, 0.734375, 0.734375, 1)
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Data" type="HBoxContainer" parent="VBoxContainer/TabContainer/Outgoing Details/ScrollContainer/VBoxContainer/HBoxContainer/VBoxContainer2/VBoxContainer/PanelContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Type" type="RichTextLabel" parent="VBoxContainer/TabContainer/Outgoing Details/ScrollContainer/VBoxContainer/HBoxContainer/VBoxContainer2/VBoxContainer/PanelContainer/Data"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
bbcode_enabled = true
|
||||
text = "Sync Var"
|
||||
fit_content = true
|
||||
|
||||
[node name="Object" type="RichTextLabel" parent="VBoxContainer/TabContainer/Outgoing Details/ScrollContainer/VBoxContainer/HBoxContainer/VBoxContainer2/VBoxContainer/PanelContainer/Data"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
bbcode_enabled = true
|
||||
text = "Node123"
|
||||
fit_content = true
|
||||
|
||||
[node name="Target" type="RichTextLabel" parent="VBoxContainer/TabContainer/Outgoing Details/ScrollContainer/VBoxContainer/HBoxContainer/VBoxContainer2/VBoxContainer/PanelContainer/Data"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
bbcode_enabled = true
|
||||
text = "Property Name"
|
||||
fit_content = true
|
||||
|
||||
[node name="Count" type="RichTextLabel" parent="VBoxContainer/TabContainer/Outgoing Details/ScrollContainer/VBoxContainer/HBoxContainer/VBoxContainer2/VBoxContainer/PanelContainer/Data"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
bbcode_enabled = true
|
||||
text = "0"
|
||||
fit_content = true
|
||||
|
||||
[node name="Usage" type="RichTextLabel" parent="VBoxContainer/TabContainer/Outgoing Details/ScrollContainer/VBoxContainer/HBoxContainer/VBoxContainer2/VBoxContainer/PanelContainer/Data"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
bbcode_enabled = true
|
||||
text = "0B"
|
||||
fit_content = true
|
||||
|
||||
[node name="Percentage" type="RichTextLabel" parent="VBoxContainer/TabContainer/Outgoing Details/ScrollContainer/VBoxContainer/HBoxContainer/VBoxContainer2/VBoxContainer/PanelContainer/Data"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
bbcode_enabled = true
|
||||
text = "0%"
|
||||
fit_content = true
|
||||
|
||||
[connection signal="pressed" from="VBoxContainer/HBoxContainer/Start" to="." method="start"]
|
||||
[connection signal="pressed" from="VBoxContainer/HBoxContainer/Stop" to="." method="stop"]
|
||||
[connection signal="pressed" from="VBoxContainer/HBoxContainer/Clear" to="." method="clear"]
|
||||
[connection signal="toggled" from="VBoxContainer/HBoxContainer/AutoStart" to="." method="_on_auto_start_toggled"]
|
||||
[connection signal="value_changed" from="VBoxContainer/HBoxContainer/LatencySpinBox" to="." method="_on_artificial_latency_changed"]
|
||||
[connection signal="toggled" from="VBoxContainer/TabContainer/Connections/ScrollContainer/VBoxContainer/PanelContainer/HBoxContainer/HBoxContainer/VBoxContainer/MonitorButton" to="VBoxContainer/TabContainer/Connections/ScrollContainer/VBoxContainer/PanelContainer" method="_on_monitor_button_toggled"]
|
||||
207
addons/GD-Sync/UI/Profiler/ProfilerConnectionMonitor.gd
Normal file
|
|
@ -0,0 +1,207 @@
|
|||
@tool
|
||||
extends Node
|
||||
|
||||
#Copyright (c) 2023-present GD-Sync.
|
||||
#All rights reserved.
|
||||
#
|
||||
#Redistribution and use in source form, with or without modification,
|
||||
#are permitted provided that the following conditions are met:
|
||||
#
|
||||
#1. Redistributions of source code must retain the above copyright notice,
|
||||
# this list of conditions and the following disclaimer.
|
||||
#
|
||||
#2. Neither the name of GD-Sync nor the names of its contributors may be used
|
||||
# to endorse or promote products derived from this software without specific
|
||||
# prior written permission.
|
||||
#
|
||||
#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
#EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
#OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
#SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
#INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
||||
#TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
#BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
#CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
#ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
#SUCH DAMAGE.
|
||||
|
||||
signal stats_updated(client_id : int, stats : Dictionary)
|
||||
signal profiler_cleared
|
||||
|
||||
@export var profiler : Node = null : set = _set_profiler
|
||||
@export var button_template : Control = null
|
||||
@export var latency_graph_template : Control = null
|
||||
@export var jitter_graph_template : Control = null
|
||||
|
||||
var client_data : Dictionary = {}
|
||||
var client_buttons : Dictionary = {}
|
||||
var client_latency_graphs : Dictionary = {}
|
||||
var client_jitter_graphs : Dictionary = {}
|
||||
var own_id : int = -1
|
||||
var monitoring : bool = false
|
||||
|
||||
func _ready():
|
||||
button_template.visible = false
|
||||
|
||||
if profiler:
|
||||
_connect_signal()
|
||||
|
||||
func _set_profiler(v):
|
||||
if profiler == v: return
|
||||
if profiler:
|
||||
_disconnect_signal()
|
||||
profiler = v
|
||||
if profiler:
|
||||
_connect_signal()
|
||||
|
||||
func _connect_signal():
|
||||
if not profiler: return
|
||||
if profiler.has_signal("profiler_started") and not profiler.profiler_started.is_connected(_on_profiler_started):
|
||||
profiler.profiler_started.connect(_on_profiler_started)
|
||||
if profiler.has_signal("profiler_stopped") and not profiler.profiler_stopped.is_connected(_on_profiler_stopped):
|
||||
profiler.profiler_stopped.connect(_on_profiler_stopped)
|
||||
if profiler.has_signal("client_joined") and not profiler.client_joined.is_connected(_on_client_joined):
|
||||
profiler.client_joined.connect(_on_client_joined)
|
||||
if profiler.has_signal("client_left") and not profiler.client_left.is_connected(_on_client_left):
|
||||
profiler.client_left.connect(_on_client_left)
|
||||
if profiler.has_signal("ping_measured") and not profiler.ping_measured.is_connected(_on_ping_measured):
|
||||
profiler.ping_measured.connect(_on_ping_measured)
|
||||
if profiler.has_signal("profiler_cleared") and not profiler.profiler_cleared.is_connected(_on_profiler_cleared):
|
||||
profiler.profiler_cleared.connect(_on_profiler_cleared)
|
||||
if profiler.has_signal("custom_data_updated") and not profiler.custom_data_updated.is_connected(_on_custom_data):
|
||||
profiler.custom_data_updated.connect(_on_custom_data)
|
||||
|
||||
func _disconnect_signal():
|
||||
if not profiler: return
|
||||
if profiler.has_signal("profiler_started") and profiler.profiler_started.is_connected(_on_profiler_started):
|
||||
profiler.profiler_started.disconnect(_on_profiler_started)
|
||||
if profiler.has_signal("profiler_stopped") and profiler.profiler_stopped.is_connected(_on_profiler_stopped):
|
||||
profiler.profiler_stopped.disconnect(_on_profiler_stopped)
|
||||
if profiler.has_signal("client_joined") and profiler.client_joined.is_connected(_on_client_joined):
|
||||
profiler.client_joined.disconnect(_on_client_joined)
|
||||
if profiler.has_signal("client_left") and profiler.client_left.is_connected(_on_client_left):
|
||||
profiler.client_left.disconnect(_on_client_left)
|
||||
if profiler.has_signal("ping_measured") and profiler.ping_measured.is_connected(_on_ping_measured):
|
||||
profiler.ping_measured.disconnect(_on_ping_measured)
|
||||
if profiler.has_signal("profiler_cleared") and profiler.profiler_cleared.is_connected(_on_profiler_cleared):
|
||||
profiler.profiler_cleared.disconnect(_on_profiler_cleared)
|
||||
if profiler.has_signal("custom_data_updated") and profiler.custom_data_updated.is_connected(_on_custom_data):
|
||||
profiler.custom_data_updated.disconnect(_on_custom_data)
|
||||
|
||||
func _on_custom_data(data : Dictionary) -> void:
|
||||
if !data.has("client_id"): return
|
||||
own_id = data["client_id"]
|
||||
|
||||
func _on_monitor_button_toggled(toggled_on: bool) -> void:
|
||||
monitoring = toggled_on
|
||||
|
||||
if monitoring:
|
||||
profiler.start_monitoring_connections.emit()
|
||||
else:
|
||||
profiler.stop_monitoring_connections.emit()
|
||||
|
||||
func _on_profiler_started() -> void:
|
||||
if monitoring:
|
||||
profiler.start_monitoring_connections.emit()
|
||||
|
||||
func _on_profiler_stopped() -> void:
|
||||
profiler.stop_monitoring_connections.emit()
|
||||
|
||||
func _on_profiler_cleared() -> void:
|
||||
client_data.clear()
|
||||
|
||||
for button in client_buttons.values():
|
||||
button.queue_free()
|
||||
|
||||
for graph in client_latency_graphs.values():
|
||||
graph.queue_free()
|
||||
|
||||
for graph in client_jitter_graphs.values():
|
||||
graph.queue_free()
|
||||
|
||||
client_buttons.clear()
|
||||
client_latency_graphs.clear()
|
||||
client_jitter_graphs.clear()
|
||||
|
||||
latency_graph_template.visible = true
|
||||
jitter_graph_template.visible = true
|
||||
|
||||
profiler_cleared.emit()
|
||||
|
||||
func _on_client_joined(client_id : int) -> void:
|
||||
if client_id == own_id: return
|
||||
|
||||
client_data[client_id] = {"latency" : 0.0, "jitter" : 0.0}
|
||||
|
||||
var button : Button = button_template.duplicate()
|
||||
button_template.get_parent().add_child(button)
|
||||
|
||||
button.text = "Client %s" % [client_id]
|
||||
button.pressed.connect(_show_client_graph.bind(client_id))
|
||||
button.visible = true
|
||||
client_buttons[client_id] = button
|
||||
|
||||
var latency_graph : Control = latency_graph_template.duplicate()
|
||||
latency_graph_template.get_parent().add_child(latency_graph)
|
||||
|
||||
latency_graph.visible = true
|
||||
latency_graph.client_id = client_id
|
||||
latency_graph.data_series[0]["label"] = "Latency to client "+str(client_id)
|
||||
latency_graph.data_series[1]["label"] = "Perceived latency to client "+str(client_id)
|
||||
client_latency_graphs[client_id] = latency_graph
|
||||
|
||||
var jitter_graph : Control = jitter_graph_template.duplicate()
|
||||
jitter_graph_template.get_parent().add_child(jitter_graph)
|
||||
|
||||
jitter_graph.visible = true
|
||||
jitter_graph.client_id = client_id
|
||||
jitter_graph.data_series[0]["label"] = "Jitter to client "+str(client_id)
|
||||
client_jitter_graphs[client_id] = jitter_graph
|
||||
|
||||
if client_data.size() == 1:
|
||||
_show_client_graph(client_id)
|
||||
|
||||
func _show_client_graph(client_id : int) -> void:
|
||||
latency_graph_template.visible = false
|
||||
jitter_graph_template.visible = false
|
||||
|
||||
for graph in client_latency_graphs.values():
|
||||
graph.visible = false
|
||||
for graph in client_jitter_graphs.values():
|
||||
graph.visible = false
|
||||
|
||||
client_latency_graphs[client_id].visible = true
|
||||
client_jitter_graphs[client_id].visible = true
|
||||
|
||||
func _on_client_left(client_id : int) -> void:
|
||||
if client_data.has(client_id):
|
||||
client_data.erase(client_id)
|
||||
|
||||
if client_buttons.has(client_id):
|
||||
client_buttons[client_id].queue_free()
|
||||
client_buttons.erase(client_id)
|
||||
|
||||
if client_latency_graphs.has(client_id):
|
||||
client_latency_graphs[client_id].queue_free()
|
||||
client_latency_graphs.erase(client_id)
|
||||
|
||||
if client_jitter_graphs.has(client_id):
|
||||
client_jitter_graphs[client_id].queue_free()
|
||||
client_jitter_graphs.erase(client_id)
|
||||
|
||||
func _on_ping_measured(client_id : int, ping : float, perceived_ping : float) -> void:
|
||||
if !client_latency_graphs.has(client_id): return
|
||||
ping *= 1000.0
|
||||
perceived_ping *= 1000.0
|
||||
|
||||
ping = max(0, ping)
|
||||
perceived_ping = max(0, perceived_ping)
|
||||
|
||||
var data : Dictionary = client_data[client_id]
|
||||
var last_latency : float = data["latency"]
|
||||
var jitter : float = abs(last_latency-ping) if last_latency > 0 else 0.0
|
||||
data["latency"] = ping
|
||||
data["perceived_latency"] = perceived_ping
|
||||
data["jitter"] = jitter
|
||||
|
||||
stats_updated.emit(client_id, data)
|
||||
|
|
@ -0,0 +1 @@
|
|||
uid://frgb8qcxxcoj
|
||||
216
addons/GD-Sync/UI/Profiler/ProfilerDetailsBar.gd
Normal file
|
|
@ -0,0 +1,216 @@
|
|||
@tool
|
||||
extends HBoxContainer
|
||||
|
||||
#Copyright (c) 2023-present GD-Sync.
|
||||
#All rights reserved.
|
||||
#
|
||||
#Redistribution and use in source form, with or without modification,
|
||||
#are permitted provided that the following conditions are met:
|
||||
#
|
||||
#1. Redistributions of source code must retain the above copyright notice,
|
||||
# this list of conditions and the following disclaimer.
|
||||
#
|
||||
#2. Neither the name of GD-Sync nor the names of its contributors may be used
|
||||
# to endorse or promote products derived from this software without specific
|
||||
# prior written permission.
|
||||
#
|
||||
#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
#EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
#OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
#SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
#INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
||||
#TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
#BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
#CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
#ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
#SUCH DAMAGE.
|
||||
|
||||
@export var profiler : Node = null
|
||||
@export var listen_key : String = "up"
|
||||
@export var other_threshold : float = 2.0
|
||||
@export var bar_segment_template : Control = null
|
||||
@export var other_color : Color = Color("#888888")
|
||||
@export var color_palette : Array[Color] = [
|
||||
Color("#e6194b"), Color("#3cb44b"), Color("#ffe119"), Color("#4363d8"),
|
||||
Color("#f58231"), Color("#911eb4"), Color("#46f0f0"), Color("#f032e6"),
|
||||
Color("#bcf60c"), Color("#fabebe"), Color("#008080"), Color("#e6beff")
|
||||
]
|
||||
|
||||
var segment_cache : Dictionary = {}
|
||||
var data_cache : Dictionary = {}
|
||||
var rebuild_scheduled : bool = false
|
||||
|
||||
func _ready() -> void:
|
||||
if bar_segment_template:
|
||||
bar_segment_template.visible = false
|
||||
|
||||
if profiler:
|
||||
_connect_signals()
|
||||
|
||||
func _connect_signals() -> void:
|
||||
if profiler.has_signal("message_details_updated") and not profiler.message_details_updated.is_connected(_on_details):
|
||||
profiler.message_details_updated.connect(_on_details)
|
||||
if profiler.has_signal("profiler_cleared") and not profiler.profiler_cleared.is_connected(_on_clear):
|
||||
profiler.profiler_cleared.connect(_on_clear)
|
||||
|
||||
func _disconnect_signals() -> void:
|
||||
if profiler and profiler.message_details_updated.is_connected(_on_details):
|
||||
profiler.message_details_updated.disconnect(_on_details)
|
||||
if profiler and profiler.profiler_cleared.is_connected(_on_clear):
|
||||
profiler.profiler_cleared.disconnect(_on_clear)
|
||||
|
||||
func _on_clear() -> void:
|
||||
for seg in segment_cache.values():
|
||||
seg.queue_free()
|
||||
segment_cache.clear()
|
||||
data_cache.clear()
|
||||
_schedule_rebuild()
|
||||
|
||||
func _on_details(details : Dictionary) -> void:
|
||||
if !details.has(listen_key): return
|
||||
var raw_data : Dictionary = details[listen_key]
|
||||
|
||||
var object_stats : Dictionary = {}
|
||||
for key in raw_data.keys():
|
||||
var entry = raw_data[key]
|
||||
var obj = entry.object
|
||||
if not object_stats.has(obj):
|
||||
object_stats[obj] = { "total_bytes": 0, "percent": 0.0, "keys": [] }
|
||||
object_stats[obj].total_bytes += entry.total_bytes
|
||||
object_stats[obj].keys.append(key)
|
||||
|
||||
var total_bytes : int = 0
|
||||
for obj in object_stats.keys():
|
||||
total_bytes += object_stats[obj].total_bytes
|
||||
|
||||
if total_bytes == 0:
|
||||
_clear_all_segments()
|
||||
return
|
||||
|
||||
for obj in object_stats.keys():
|
||||
var bytes = object_stats[obj].total_bytes
|
||||
object_stats[obj].percent = (bytes as float / total_bytes) * 100.0
|
||||
|
||||
var major_objects : Array = []
|
||||
var other_bytes : int = 0
|
||||
var other_keys : Array = []
|
||||
|
||||
for obj in object_stats.keys():
|
||||
var pct = object_stats[obj].percent
|
||||
if pct >= other_threshold:
|
||||
major_objects.append({
|
||||
"name": obj,
|
||||
"percent": pct,
|
||||
"bytes": object_stats[obj].total_bytes,
|
||||
"keys": object_stats[obj].keys
|
||||
})
|
||||
else:
|
||||
other_bytes += object_stats[obj].total_bytes
|
||||
other_keys.append_array(object_stats[obj].keys)
|
||||
|
||||
var other_pct = (other_bytes as float / total_bytes) * 100.0 if total_bytes > 0 else 0.0
|
||||
if other_pct > 0.0:
|
||||
major_objects.append({
|
||||
"name": "Other",
|
||||
"percent": other_pct,
|
||||
"bytes": other_bytes,
|
||||
"keys": other_keys
|
||||
})
|
||||
|
||||
major_objects.sort_custom(func(a, b): return a.percent > b.percent)
|
||||
|
||||
data_cache.clear()
|
||||
for item in major_objects:
|
||||
data_cache[item.name] = item
|
||||
|
||||
_schedule_rebuild()
|
||||
|
||||
func _schedule_rebuild() -> void:
|
||||
if rebuild_scheduled: return
|
||||
rebuild_scheduled = true
|
||||
call_deferred("_rebuild_bar_deferred")
|
||||
|
||||
func _rebuild_bar_deferred() -> void:
|
||||
if not rebuild_scheduled: return
|
||||
rebuild_scheduled = false
|
||||
|
||||
var ordered_names : Array = data_cache.keys()
|
||||
ordered_names.sort_custom(func(a, b):
|
||||
return data_cache[a].percent > data_cache[b].percent
|
||||
)
|
||||
|
||||
var total_percent : float = 0.0
|
||||
for item in data_cache.values():
|
||||
total_percent += item.percent
|
||||
total_percent = max(total_percent, 100.0)
|
||||
|
||||
var color_idx = 0
|
||||
for obj_name in ordered_names:
|
||||
var item = data_cache[obj_name]
|
||||
var seg = _get_or_create_segment(obj_name)
|
||||
|
||||
var col = other_color if obj_name == "Other" else color_palette[color_idx % color_palette.size()]
|
||||
seg.modulate = col
|
||||
color_idx += 1
|
||||
|
||||
var ratio = item.percent / total_percent * 100.0
|
||||
seg.size_flags_stretch_ratio = ratio
|
||||
|
||||
var tooltip = "%s\n%.2f%% (%s)" % [
|
||||
obj_name,
|
||||
item.percent,
|
||||
_format_bytes(item.bytes)
|
||||
]
|
||||
seg.tooltip_text = tooltip
|
||||
|
||||
seg.set_meta("keys", item.keys)
|
||||
|
||||
if seg.get_index() != get_child_count() - 1:
|
||||
move_child(seg, -1)
|
||||
|
||||
_remove_unused_segments(ordered_names)
|
||||
|
||||
func _get_or_create_segment(obj_name : String) -> Control:
|
||||
if segment_cache.has(obj_name):
|
||||
return segment_cache[obj_name]
|
||||
|
||||
var seg = bar_segment_template.duplicate()
|
||||
add_child(seg)
|
||||
seg.visible = true
|
||||
seg.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
seg.mouse_filter = Control.MOUSE_FILTER_PASS
|
||||
|
||||
seg.connect("mouse_entered", func():
|
||||
seg.modulate.a = 0.8
|
||||
)
|
||||
seg.connect("mouse_exited", func():
|
||||
seg.modulate.a = 1.0
|
||||
)
|
||||
|
||||
segment_cache[obj_name] = seg
|
||||
return seg
|
||||
|
||||
func _remove_unused_segments(current_objects : Array) -> void:
|
||||
var to_remove = []
|
||||
for name in segment_cache.keys():
|
||||
if !current_objects.has(name):
|
||||
to_remove.append(name)
|
||||
|
||||
for name in to_remove:
|
||||
segment_cache[name].queue_free()
|
||||
segment_cache.erase(name)
|
||||
|
||||
func _clear_all_segments() -> void:
|
||||
for seg in segment_cache.values():
|
||||
seg.queue_free()
|
||||
segment_cache.clear()
|
||||
|
||||
func _format_bytes(b : int) -> String:
|
||||
if b <= 0: return "0 B"
|
||||
var u = ["B","KB","MB","GB"]
|
||||
var i = 0
|
||||
var v = float(b)
|
||||
while v >= 1000.0 and i < 3:
|
||||
v /= 1000.0
|
||||
i += 1
|
||||
return "%.*f %s" % [1 if i > 0 else 0, v, u[i]]
|
||||
1
addons/GD-Sync/UI/Profiler/ProfilerDetailsBar.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://bvluikq25m4rv
|
||||
384
addons/GD-Sync/UI/Profiler/ProfilerDetailsDisplay.gd
Normal file
|
|
@ -0,0 +1,384 @@
|
|||
@tool
|
||||
extends Control
|
||||
|
||||
#Copyright (c) 2023-present GD-Sync.
|
||||
#All rights reserved.
|
||||
#
|
||||
#Redistribution and use in source form, with or without modification,
|
||||
#are permitted provided that the following conditions are met:
|
||||
#
|
||||
#1. Redistributions of source code must retain the above copyright notice,
|
||||
# this list of conditions and the following disclaimer.
|
||||
#
|
||||
#2. Neither the name of GD-Sync nor the names of its contributors may be used
|
||||
# to endorse or promote products derived from this software without specific
|
||||
# prior written permission.
|
||||
#
|
||||
#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
#EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
#OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
#SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
#INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
||||
#TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
#BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
#CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
#ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
#SUCH DAMAGE.
|
||||
|
||||
@export var type_sort_button : Button
|
||||
@export var object_sort_button : Button
|
||||
@export var target_sort_button : Button
|
||||
@export var count_sort_button : Button
|
||||
@export var usage_sort_button : Button
|
||||
@export var percent_sort_button : Button
|
||||
@export var listen_key : String = "up"
|
||||
@export var profiler : Node = null
|
||||
@export var label_template : Node = null
|
||||
|
||||
var existing_labels : Dictionary = {}
|
||||
var current_sort_key : String = "total_bytes"
|
||||
var sort_reversed : bool = false
|
||||
var sorted_keys : Array = []
|
||||
var data_cache : Dictionary = {}
|
||||
|
||||
var sort_thread : Thread
|
||||
var data_mutex : Mutex
|
||||
var pending_data_update : Dictionary = {}
|
||||
var pending_remove_keys : Array = []
|
||||
var has_pending_changes : bool = false
|
||||
var should_stop_thread : bool = false
|
||||
|
||||
func _ready() -> void:
|
||||
data_mutex = Mutex.new()
|
||||
|
||||
if label_template:
|
||||
label_template.visible = false
|
||||
|
||||
if profiler:
|
||||
_connect_signals()
|
||||
|
||||
_connect_sort_buttons()
|
||||
_update_button_states()
|
||||
|
||||
func _exit_tree() -> void:
|
||||
_stop_thread()
|
||||
_disconnect_signals()
|
||||
|
||||
func _stop_thread() -> void:
|
||||
should_stop_thread = true
|
||||
if sort_thread and sort_thread.is_started():
|
||||
sort_thread.wait_to_finish()
|
||||
|
||||
func _start_thread_if_needed() -> void:
|
||||
if not sort_thread or not sort_thread.is_started():
|
||||
sort_thread = Thread.new()
|
||||
should_stop_thread = false
|
||||
sort_thread.start(_thread_process)
|
||||
|
||||
func _thread_process() -> void:
|
||||
while not should_stop_thread:
|
||||
data_mutex.lock()
|
||||
var has_changes = has_pending_changes
|
||||
var local_data_update = pending_data_update.duplicate(true)
|
||||
var local_remove_keys = pending_remove_keys.duplicate()
|
||||
var local_data_cache = data_cache.duplicate(true)
|
||||
var local_existing_keys = existing_labels.keys()
|
||||
var local_sort_key = current_sort_key
|
||||
var local_sort_reversed = sort_reversed
|
||||
|
||||
if has_changes:
|
||||
pending_data_update.clear()
|
||||
pending_remove_keys.clear()
|
||||
has_pending_changes = false
|
||||
data_mutex.unlock()
|
||||
|
||||
if has_changes:
|
||||
var new_data_cache = local_data_cache.duplicate(true)
|
||||
|
||||
for key in local_data_update.keys():
|
||||
new_data_cache[key] = {
|
||||
"type": local_data_update[key].type,
|
||||
"object": local_data_update[key].object,
|
||||
"target": local_data_update[key].target,
|
||||
"count": local_data_update[key].count,
|
||||
"total_bytes": local_data_update[key].total_bytes,
|
||||
"percent": local_data_update[key].percent
|
||||
}
|
||||
|
||||
for key in local_remove_keys:
|
||||
new_data_cache.erase(key)
|
||||
|
||||
var new_sorted_keys = local_existing_keys.duplicate()
|
||||
|
||||
if not local_sort_key.is_empty():
|
||||
new_sorted_keys.sort_custom(func(a, b):
|
||||
var va = _get_raw_sort_value_thread(a, new_data_cache, local_sort_key)
|
||||
var vb = _get_raw_sort_value_thread(b, new_data_cache, local_sort_key)
|
||||
|
||||
if va == vb:
|
||||
return a < b
|
||||
|
||||
if local_sort_reversed:
|
||||
return va > vb
|
||||
else:
|
||||
return va < vb
|
||||
)
|
||||
else:
|
||||
new_sorted_keys.sort()
|
||||
|
||||
call_deferred("_apply_thread_results", new_sorted_keys, new_data_cache)
|
||||
|
||||
OS.delay_msec(16)
|
||||
|
||||
func _get_raw_sort_value_thread(key : String, cache : Dictionary, sort_key : String) -> Variant:
|
||||
if not cache.has(key):
|
||||
return key
|
||||
var e = cache[key]
|
||||
match sort_key:
|
||||
"type": return e.type
|
||||
"object": return e.object
|
||||
"target": return e.target
|
||||
"count": return e.count
|
||||
"total_bytes": return e.total_bytes
|
||||
"percent": return e.percent
|
||||
_: return key
|
||||
|
||||
func _apply_thread_results(new_sorted_keys : Array, new_data_cache : Dictionary) -> void:
|
||||
data_mutex.lock()
|
||||
data_cache = new_data_cache
|
||||
sorted_keys = new_sorted_keys
|
||||
data_mutex.unlock()
|
||||
|
||||
_reorder_labels_ui()
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Signal handling
|
||||
# -------------------------------------------------------------------------
|
||||
func _connect_signals() -> void:
|
||||
if profiler.has_signal("message_details_updated") and not profiler.message_details_updated.is_connected(_on_message_details):
|
||||
profiler.message_details_updated.connect(_on_message_details)
|
||||
if profiler.has_signal("profiler_cleared") and not profiler.profiler_cleared.is_connected(_on_clear):
|
||||
profiler.profiler_cleared.connect(_on_clear)
|
||||
|
||||
func _disconnect_signals() -> void:
|
||||
if profiler and profiler.message_details_updated.is_connected(_on_message_details):
|
||||
profiler.message_details_updated.disconnect(_on_message_details)
|
||||
if profiler and profiler.profiler_cleared.is_connected(_on_clear):
|
||||
profiler.profiler_cleared.disconnect(_on_clear)
|
||||
|
||||
func _on_clear() -> void:
|
||||
data_mutex.lock()
|
||||
for l in existing_labels.values():
|
||||
l.queue_free()
|
||||
existing_labels.clear()
|
||||
data_cache.clear()
|
||||
sorted_keys.clear()
|
||||
pending_data_update.clear()
|
||||
pending_remove_keys.clear()
|
||||
has_pending_changes = false
|
||||
data_mutex.unlock()
|
||||
|
||||
current_sort_key = "total_bytes"
|
||||
sort_reversed = false
|
||||
_update_button_states()
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Sort-button handling
|
||||
# -------------------------------------------------------------------------
|
||||
func _connect_sort_buttons() -> void:
|
||||
var map = {
|
||||
"type": type_sort_button,
|
||||
"object": object_sort_button,
|
||||
"target": target_sort_button,
|
||||
"count": count_sort_button,
|
||||
"total_bytes": usage_sort_button,
|
||||
"percent": percent_sort_button
|
||||
}
|
||||
for k in map.keys():
|
||||
var btn = map[k]
|
||||
if btn and btn.pressed.get_connections().size() == 0:
|
||||
btn.pressed.connect(func(): _sort_by(k))
|
||||
|
||||
func _sort_by(key : String) -> void:
|
||||
if current_sort_key == key:
|
||||
sort_reversed = !sort_reversed # toggle direction
|
||||
else:
|
||||
current_sort_key = key
|
||||
sort_reversed = false # default = descending (biggest on top)
|
||||
_update_button_states()
|
||||
_schedule_rebuild()
|
||||
|
||||
func _update_button_states() -> void:
|
||||
var map = {
|
||||
"type": type_sort_button,
|
||||
"object": object_sort_button,
|
||||
"target": target_sort_button,
|
||||
"count": count_sort_button,
|
||||
"total_bytes": usage_sort_button,
|
||||
"percent": percent_sort_button
|
||||
}
|
||||
for k in map.keys():
|
||||
var btn = map[k]
|
||||
if btn:
|
||||
btn.text = _get_button_text(k)
|
||||
|
||||
func _get_button_text(key : String) -> String:
|
||||
var base = key.capitalize()
|
||||
if current_sort_key == key:
|
||||
return base + (" (descending)" if !sort_reversed else " (ascending)")
|
||||
return base
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Data → UI
|
||||
# -------------------------------------------------------------------------
|
||||
func _on_message_details(details : Dictionary) -> void:
|
||||
if !details.has(listen_key): return
|
||||
var data : Dictionary = details[listen_key]
|
||||
|
||||
data_mutex.lock()
|
||||
|
||||
var changed = false
|
||||
for k in data.keys():
|
||||
if not existing_labels.has(k):
|
||||
changed = true
|
||||
# Create label immediately on main thread
|
||||
var label = label_template.duplicate()
|
||||
add_child(label)
|
||||
label.visible = true
|
||||
existing_labels[k] = label
|
||||
|
||||
# Update UI immediately
|
||||
_populate_label(k, data[k])
|
||||
|
||||
# Queue data for thread processing
|
||||
pending_data_update[k] = {
|
||||
"type": data[k].type,
|
||||
"object": data[k].object,
|
||||
"target": data[k].target,
|
||||
"count": data[k].count,
|
||||
"total_bytes": data[k].total_bytes,
|
||||
"percent": data[k].percent
|
||||
}
|
||||
|
||||
# Find keys to remove
|
||||
var current_keys = data.keys()
|
||||
var to_remove = []
|
||||
for k in existing_labels.keys():
|
||||
if !current_keys.has(k):
|
||||
to_remove.append(k)
|
||||
changed = true
|
||||
|
||||
# Remove labels immediately from UI but keep in cache for thread
|
||||
for k in to_remove:
|
||||
existing_labels[k].queue_free()
|
||||
existing_labels.erase(k)
|
||||
pending_remove_keys.append(k)
|
||||
|
||||
if changed:
|
||||
has_pending_changes = true
|
||||
_start_thread_if_needed()
|
||||
|
||||
data_mutex.unlock()
|
||||
|
||||
func _populate_label(key : String, data : Dictionary) -> void:
|
||||
var label = existing_labels.get(key)
|
||||
if not label:
|
||||
return
|
||||
|
||||
label.get_node("Data/Object").text = get_final_segment(data["object"])
|
||||
label.get_node("Data/Object").tooltip_text = data["object"]
|
||||
label.get_node("Data/Target").text = data["target"]
|
||||
label.get_node("Data/Count").text = _format_number(data["count"])
|
||||
label.get_node("Data/Count").tooltip_text = "This message was sent %s times." % [_format_number(data["count"])]
|
||||
label.get_node("Data/Usage").text = _format_bytes(data["total_bytes"])
|
||||
label.get_node("Data/Usage").tooltip_text = "These messages have used %s of transfer." % [_format_bytes(data["total_bytes"])]
|
||||
|
||||
var percent : float = data["percent"]
|
||||
var color_value_yellow : float = percent / 100.0
|
||||
var color_value_red : float = color_value_yellow*2.0-1.0
|
||||
color_value_yellow = min(color_value_yellow*2.0, 1.0)
|
||||
color_value_red = max(color_value_red, 0.0)
|
||||
|
||||
var color = Color.CHARTREUSE.lerp(Color.GOLD, color_value_yellow).lerp(Color.TOMATO, color_value_red)
|
||||
var color_hex = color.to_html(false)
|
||||
|
||||
var percent_text = "[color=%s]%.*f%%[/color]" % [color_hex, 2, percent]
|
||||
label.get_node("Data/Percentage").text = percent_text
|
||||
label.get_node("Data/Percentage").tooltip_text = "These messages contributed %.*f%% of the total %s transfer." % [2, percent, "incoming" if listen_key == "down" else "outgoing"]
|
||||
|
||||
var type_tooltip : String = data["type"]
|
||||
var type_color : String = Color.WHITE.to_html(false)
|
||||
match(data["type"]):
|
||||
"internal":
|
||||
type_tooltip = "An internal message of GD-Sync which may provide extra functionality or optimizations."
|
||||
type_color = "#f5c2e7"
|
||||
"call_func":
|
||||
type_tooltip = "A script used call_func, call_func_on or call_func_all to remotely call a function on a Node or Resource."
|
||||
type_color = "#a6e3a1"
|
||||
"call_func optimized":
|
||||
type_tooltip = "A script used call_func, call_func_on or call_func_all to remotely call a function on a Node or Resource. \nThis is an optimized version which caches caches the NodePath and function name and replaces them with integers to save transfer."
|
||||
type_color = "#a6e3a1"
|
||||
"sync_var":
|
||||
type_tooltip = "A script used sync_var or sync_var_on to synchronize the value of a property on all clients."
|
||||
type_color = "#89b4fa"
|
||||
"sync_var optimized":
|
||||
type_tooltip = "A script used sync_var or sync_var_on to synchronize the value of a property on all clients. \nThis is an optimized version which caches caches the NodePath and property name and replaces them with integers to save transfer."
|
||||
type_color = "#89b4fa"
|
||||
label.get_node("Data/Type").text = "[color=%s]%s[/color]" % [type_color, data["type"]]
|
||||
label.get_node("Data/Type").tooltip_text = type_tooltip
|
||||
|
||||
var target_node = label.get_node("Data/Target")
|
||||
if data.has("last_details") and data["last_details"] is Array and not data["last_details"].is_empty():
|
||||
var details_list = data["last_details"]
|
||||
var tooltip_text = data["target"]
|
||||
tooltip_text += "\n\nLast messages:\n" + "─".repeat(20) + "\n"
|
||||
|
||||
for i in range(details_list.size() - 1, -1, -1):
|
||||
tooltip_text += details_list[i] + "\n"
|
||||
if i > 0:
|
||||
tooltip_text += "─".repeat(20) + "\n"
|
||||
|
||||
target_node.tooltip_text = tooltip_text
|
||||
else:
|
||||
target_node.tooltip_text = data["target"]
|
||||
|
||||
func get_final_segment(path: String) -> String:
|
||||
var parts = path.strip_edges().split("/")
|
||||
return parts[-1] if parts.size() > 0 else path
|
||||
|
||||
func _format_number(n : int) -> String:
|
||||
var s = str(abs(n))
|
||||
var result = ""
|
||||
for i in range(s.length() - 1, -1, -1):
|
||||
if (s.length() - 1 - i) % 3 == 0 and i < s.length() - 1:
|
||||
result = "." + result
|
||||
result = s[i] + result
|
||||
return ("-" if n < 0 else "") + result
|
||||
|
||||
func _format_bytes(b : int) -> String:
|
||||
if b <= 0: return "0 B"
|
||||
var u = ["B","KB","MB","GB"]
|
||||
var i = 0
|
||||
var v = float(b)
|
||||
while v >= 1000.0 and i < 3:
|
||||
v /= 1000.0
|
||||
i += 1
|
||||
return "%.*f %s" % [1 if i > 0 else 0, v, u[i]]
|
||||
|
||||
func _schedule_rebuild() -> void:
|
||||
data_mutex.lock()
|
||||
has_pending_changes = true
|
||||
data_mutex.unlock()
|
||||
_start_thread_if_needed()
|
||||
|
||||
func _reorder_labels_ui() -> void:
|
||||
data_mutex.lock()
|
||||
var local_sorted_keys = sorted_keys.duplicate()
|
||||
data_mutex.unlock()
|
||||
|
||||
var idx = get_child_count() - 1
|
||||
for k in local_sorted_keys:
|
||||
var label = existing_labels.get(k)
|
||||
if label and label.get_index() != idx:
|
||||
move_child(label, idx)
|
||||
idx -= 1
|
||||
1
addons/GD-Sync/UI/Profiler/ProfilerDetailsDisplay.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://4b1i1ihfsqdf
|
||||
184
addons/GD-Sync/UI/Profiler/ProfilerGraph.gd
Normal file
|
|
@ -0,0 +1,184 @@
|
|||
@tool
|
||||
extends Control
|
||||
|
||||
#Copyright (c) 2023-present GD-Sync.
|
||||
#All rights reserved.
|
||||
#
|
||||
#Redistribution and use in source form, with or without modification,
|
||||
#are permitted provided that the following conditions are met:
|
||||
#
|
||||
#1. Redistributions of source code must retain the above copyright notice,
|
||||
# this list of conditions and the following disclaimer.
|
||||
#
|
||||
#2. Neither the name of GD-Sync nor the names of its contributors may be used
|
||||
# to endorse or promote products derived from this software without specific
|
||||
# prior written permission.
|
||||
#
|
||||
#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
#EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
#OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
#SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
#INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
||||
#TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
#BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
#CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
#ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
#SUCH DAMAGE.
|
||||
|
||||
@export var profiler : Node = null : set = _set_profiler
|
||||
@export var client_id : int = -1
|
||||
@export var series : Array[Dictionary] = [
|
||||
{"key": "up_sec", "color": Color("#4ade80"), "label": "Upload"},
|
||||
{"key": "down_sec", "color": Color("#60a5fa"), "label": "Download"}
|
||||
]
|
||||
@export var history_seconds : int = 60
|
||||
@export var padding := Vector2(40, 30)
|
||||
@export var grid_color := Color(0.3, 0.3, 0.3, 0.5)
|
||||
@export var text_color := Color.WHITE
|
||||
@export var bg_color := Color(0.1, 0.1, 0.1, 0.8)
|
||||
@export var font_size := 12
|
||||
@export_enum("Bytes", "Milliseconds") var display_mode : int = 0:
|
||||
set = _set_display_mode
|
||||
|
||||
var data_series : Array = []
|
||||
|
||||
func _ready():
|
||||
_setup_series()
|
||||
if profiler:
|
||||
_connect_signal()
|
||||
|
||||
func _set_display_mode(mode):
|
||||
display_mode = mode
|
||||
queue_redraw()
|
||||
|
||||
func _set_profiler(v):
|
||||
if profiler == v: return
|
||||
if profiler:
|
||||
_disconnect_signal()
|
||||
profiler = v
|
||||
if profiler:
|
||||
_connect_signal()
|
||||
|
||||
func _setup_series():
|
||||
data_series.clear()
|
||||
for s in series:
|
||||
var ds = {
|
||||
"values": [],
|
||||
"color": s.color,
|
||||
"label": s.label
|
||||
}
|
||||
ds.values.resize(history_seconds)
|
||||
ds.values.fill(0.0)
|
||||
data_series.append(ds)
|
||||
|
||||
func _connect_signal():
|
||||
if not profiler: return
|
||||
if profiler.has_signal("stats_updated") and not profiler.stats_updated.is_connected(_on_stats_updated):
|
||||
profiler.stats_updated.connect(_on_stats_updated)
|
||||
if profiler.has_signal("profiler_cleared") and not profiler.profiler_cleared.is_connected(_on_clear):
|
||||
profiler.profiler_cleared.connect(_on_clear)
|
||||
|
||||
func _disconnect_signal():
|
||||
if not profiler: return
|
||||
if profiler.has_signal("stats_updated") and profiler.stats_updated.is_connected(_on_stats_updated):
|
||||
profiler.stats_updated.disconnect(_on_stats_updated)
|
||||
if profiler.has_signal("profiler_cleared") and profiler.profiler_cleared.is_connected(_on_clear):
|
||||
profiler.profiler_cleared.disconnect(_on_clear)
|
||||
|
||||
func _on_stats_updated(cid : int, stats : Dictionary):
|
||||
if client_id != -1 and cid != client_id: return
|
||||
if client_id == -1 and cid != -1: return
|
||||
for i in data_series.size():
|
||||
var key = series[i].key
|
||||
var val = stats.get(key, 0.0)
|
||||
var ds = data_series[i]
|
||||
ds.values.pop_back()
|
||||
ds.values.push_front(val)
|
||||
queue_redraw()
|
||||
|
||||
func _on_clear():
|
||||
_setup_series()
|
||||
queue_redraw()
|
||||
|
||||
func _nice_number(value : float, round_up : bool) -> float:
|
||||
var exponent = floor(log(value) / log(10.0))
|
||||
var fraction = value / pow(10.0, exponent)
|
||||
var nice_fraction = 10.0 if round_up else 1.0
|
||||
if fraction <= 1.0: nice_fraction = 1.0
|
||||
elif fraction <= 2.0: nice_fraction = 2.0
|
||||
elif fraction <= 5.0: nice_fraction = 5.0
|
||||
else: nice_fraction = 10.0
|
||||
return nice_fraction * pow(10.0, exponent)
|
||||
|
||||
func _draw():
|
||||
var rect = get_rect()
|
||||
draw_rect(rect, bg_color)
|
||||
|
||||
if data_series.is_empty(): return
|
||||
|
||||
var graph_rect = rect.grow_individual(-padding.x, -padding.y, -padding.x, -padding.y)
|
||||
var w = graph_rect.size.x
|
||||
var h = graph_rect.size.y
|
||||
var x0 = graph_rect.position.x
|
||||
var y0 = graph_rect.position.y
|
||||
|
||||
var all_vals : Array = []
|
||||
for ds in data_series:
|
||||
for v in ds.values:
|
||||
if v > 0: all_vals.append(v)
|
||||
var raw_max = all_vals.max() if not all_vals.is_empty() else 1000.0
|
||||
var max_val = _nice_number(raw_max * 1.05, true)
|
||||
max_val = max(max_val, 1.0)
|
||||
|
||||
var grid_levels = 5
|
||||
for i in range(grid_levels + 1):
|
||||
var y = y0 + h * i / float(grid_levels)
|
||||
draw_line(Vector2(x0, y), Vector2(x0 + w, y), grid_color, 1.0)
|
||||
var label_val = max_val * (1.0 - i / float(grid_levels))
|
||||
var label = _format_value(label_val, 1)
|
||||
draw_string(ThemeDB.fallback_font, Vector2(x0 - 5, y + 5), label, HORIZONTAL_ALIGNMENT_RIGHT, -1, font_size, text_color)
|
||||
|
||||
for idx in data_series.size():
|
||||
var ds = data_series[idx]
|
||||
var points : Array = []
|
||||
for i in history_seconds:
|
||||
var v = ds.values[i]
|
||||
var x = x0 + w * (1.0 - i / float(history_seconds - 1))
|
||||
var y = y0 + h * (1.0 - v / max_val)
|
||||
points.append(Vector2(x, y))
|
||||
if points.size() > 1:
|
||||
draw_polyline(points, ds.color, 2.0)
|
||||
|
||||
var total_width := 0.0
|
||||
var label_widths : Array = []
|
||||
for ds in data_series:
|
||||
var size = ThemeDB.fallback_font.get_string_size(ds.label, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size)
|
||||
label_widths.append(size.x)
|
||||
total_width += size.x
|
||||
total_width += (data_series.size() - 1) * 10
|
||||
var start_x = x0 + (w - total_width) / 2.0
|
||||
var legend_y = y0 + h + 14
|
||||
var current_x = start_x
|
||||
for i in data_series.size():
|
||||
var ds = data_series[i]
|
||||
draw_string(ThemeDB.fallback_font, Vector2(current_x, legend_y), ds.label, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, ds.color)
|
||||
current_x += label_widths[i] + 10
|
||||
|
||||
func _format_value(value : float, d := 1) -> String:
|
||||
match display_mode:
|
||||
0:
|
||||
return _format_bytes(value, d) + "/s"
|
||||
1:
|
||||
return "%.*f ms" % [d, value]
|
||||
_:
|
||||
return "%.*f" % [d, value]
|
||||
|
||||
func _format_bytes(b : float, d := 1) -> String:
|
||||
if b <= 0: return "0 B"
|
||||
var u = ["B","KB","MB","GB"]
|
||||
var i = 0
|
||||
var v = abs(b)
|
||||
while v >= 1000.0 and i < 3:
|
||||
v /= 1000.0
|
||||
i += 1
|
||||
return "%.*f %s" % [d, v, u[i]]
|
||||
1
addons/GD-Sync/UI/Profiler/ProfilerGraph.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://8618gttywoy6
|
||||
256
addons/GD-Sync/UI/Profiler/ProfilerLabel.gd
Normal file
|
|
@ -0,0 +1,256 @@
|
|||
@tool
|
||||
extends RichTextLabel
|
||||
|
||||
#Copyright (c) 2023-present GD-Sync.
|
||||
#All rights reserved.
|
||||
#
|
||||
#Redistribution and use in source form, with or without modification,
|
||||
#are permitted provided that the following conditions are met:
|
||||
#
|
||||
#1. Redistributions of source code must retain the above copyright notice,
|
||||
# this list of conditions and the following disclaimer.
|
||||
#
|
||||
#2. Neither the name of GD-Sync nor the names of its contributors may be used
|
||||
# to endorse or promote products derived from this software without specific
|
||||
# prior written permission.
|
||||
#
|
||||
#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
#EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
#OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
#SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
#INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
||||
#TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
#BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
#CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
#ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
#SUCH DAMAGE.
|
||||
|
||||
@export var profiler : Node = null : set = _set_profiler
|
||||
@export var client_id : int = -1
|
||||
@export var stat_key : String = "up_sec"
|
||||
@export var is_bytes : bool = true
|
||||
@export var decimal_places : int = 1
|
||||
@export var suffix : String = "/s"
|
||||
@export var color_hex : String = "#ffffff"
|
||||
@export var label_text : String = "Upload" : set = _set_label_text
|
||||
@export var show_label_text : bool = true
|
||||
@export_group("Custom Data")
|
||||
@export var use_custom_data : bool = false
|
||||
@export var show_missing : bool = true
|
||||
@export var missing_text : String = "N/A"
|
||||
|
||||
func _ready():
|
||||
bbcode_enabled = true
|
||||
_update_display()
|
||||
if profiler:
|
||||
_connect_signal()
|
||||
|
||||
func _set_profiler(v):
|
||||
if profiler == v: return
|
||||
if profiler:
|
||||
_disconnect_signal()
|
||||
profiler = v
|
||||
if profiler:
|
||||
_connect_signal()
|
||||
_update_display()
|
||||
|
||||
func _set_label_text(v):
|
||||
label_text = v
|
||||
_update_display()
|
||||
|
||||
func _connect_signal():
|
||||
if not profiler: return
|
||||
if profiler.has_signal("stats_updated") and not profiler.stats_updated.is_connected(_on_stats_updated):
|
||||
profiler.stats_updated.connect(_on_stats_updated)
|
||||
if profiler.has_signal("custom_data_updated") and not profiler.custom_data_updated.is_connected(_on_custom_data):
|
||||
profiler.custom_data_updated.connect(_on_custom_data)
|
||||
if profiler.has_signal("profiler_cleared") and not profiler.profiler_cleared.is_connected(_on_clear):
|
||||
profiler.profiler_cleared.connect(_on_clear)
|
||||
|
||||
func _disconnect_signal():
|
||||
if not profiler: return
|
||||
if profiler.has_signal("stats_updated") and profiler.stats_updated.is_connected(_on_stats_updated):
|
||||
profiler.stats_updated.disconnect(_on_stats_updated)
|
||||
if profiler.has_signal("custom_data_updated") and profiler.custom_data_updated.is_connected(_on_custom_data):
|
||||
profiler.custom_data_updated.disconnect(_on_custom_data)
|
||||
if profiler.has_signal("profiler_cleared") and profiler.profiler_cleared.is_connected(_on_clear):
|
||||
profiler.profiler_cleared.disconnect(_on_clear)
|
||||
|
||||
func _on_stats_updated(cid : int, stats : Dictionary):
|
||||
if use_custom_data: return
|
||||
if client_id != -1 and cid != client_id: return
|
||||
if client_id == -1 and cid != -1: return
|
||||
var val = stats.get(stat_key, 0.0)
|
||||
var value_str = _format_value(val)
|
||||
_set_text(value_str)
|
||||
|
||||
func _on_custom_data(data : Dictionary):
|
||||
if not use_custom_data: return
|
||||
_update_from_custom_data(data)
|
||||
|
||||
func _on_clear():
|
||||
if use_custom_data:
|
||||
_update_from_custom_data({})
|
||||
else:
|
||||
_update_display()
|
||||
|
||||
func _update_from_custom_data(data : Dictionary):
|
||||
var val = data.get(stat_key, null)
|
||||
if val == null:
|
||||
if show_missing:
|
||||
_set_text(missing_text)
|
||||
else:
|
||||
text = ""
|
||||
else:
|
||||
var formatted = _format_custom_value(val)
|
||||
_set_text(formatted)
|
||||
|
||||
func _update_display():
|
||||
if use_custom_data:
|
||||
_update_from_custom_data({})
|
||||
else:
|
||||
_set_text("...")
|
||||
|
||||
func _set_text(value_str : String):
|
||||
var prefix = label_text + ": " if show_label_text else ""
|
||||
text = "[color=%s]%s%s[/color]" % [color_hex, prefix, value_str]
|
||||
|
||||
func _format_value(b) -> String:
|
||||
if is_nan(b) or is_inf(b):
|
||||
return "0 B" + suffix
|
||||
if not is_bytes:
|
||||
return _format_number(int(b)) + suffix
|
||||
if b == 0:
|
||||
return "0 B" + suffix
|
||||
var u = ["B","KB","MB","GB"]
|
||||
var i = 0
|
||||
var v = abs(b)
|
||||
while v >= 1000.0 and i < 3:
|
||||
v /= 1000.0
|
||||
i += 1
|
||||
var formatted = "%.*f" % [decimal_places, v]
|
||||
var parts = formatted.split(".")
|
||||
var int_part = _format_number(int(parts[0]))
|
||||
var frac_part = ("." + parts[1]) if parts.size() > 1 else ""
|
||||
return ("-" if b < 0 else "") + int_part + frac_part + " " + u[i] + suffix
|
||||
|
||||
func _format_custom_value(val) -> String:
|
||||
match typeof(val):
|
||||
TYPE_FLOAT, TYPE_INT:
|
||||
if abs(val) >= 1000.0 and is_bytes:
|
||||
return _format_bytes(float(val), decimal_places)
|
||||
else:
|
||||
return "%.*f" % [decimal_places, val] if typeof(val) == TYPE_FLOAT else str(val)
|
||||
TYPE_BOOL:
|
||||
return "True" if val else "False"
|
||||
TYPE_STRING:
|
||||
return val
|
||||
TYPE_ARRAY, TYPE_PACKED_BYTE_ARRAY, TYPE_PACKED_INT32_ARRAY, TYPE_PACKED_INT64_ARRAY, \
|
||||
TYPE_PACKED_FLOAT32_ARRAY, TYPE_PACKED_FLOAT64_ARRAY, TYPE_PACKED_STRING_ARRAY, \
|
||||
TYPE_PACKED_VECTOR2_ARRAY, TYPE_PACKED_VECTOR3_ARRAY, TYPE_PACKED_VECTOR4_ARRAY, \
|
||||
TYPE_PACKED_COLOR_ARRAY:
|
||||
return _pretty_print_array(val)
|
||||
TYPE_DICTIONARY:
|
||||
return _pretty_print_dict(val)
|
||||
TYPE_COLOR:
|
||||
return _format_color(val)
|
||||
_:
|
||||
return str(val)
|
||||
|
||||
func _pretty_print_array(arr, indent_level := 0) -> String:
|
||||
if arr.is_empty():
|
||||
return "[]"
|
||||
var indent := " "
|
||||
var result := "[\n"
|
||||
for i in arr.size():
|
||||
var item = arr[i]
|
||||
var formatted = _pretty_print_value(item, indent_level + 1)
|
||||
result += indent.repeat(indent_level + 1) + formatted
|
||||
if i < arr.size() - 1:
|
||||
result += ","
|
||||
result += "\n"
|
||||
result += indent.repeat(indent_level) + "]"
|
||||
return result
|
||||
|
||||
func _pretty_print_dict(dict : Dictionary, indent_level := 0) -> String:
|
||||
if dict.is_empty():
|
||||
return "{}"
|
||||
var indent := " "
|
||||
var result := "{\n"
|
||||
var keys = dict.keys()
|
||||
keys.sort()
|
||||
for i in keys.size():
|
||||
var key = keys[i]
|
||||
var value = dict[key]
|
||||
var key_type = typeof(key)
|
||||
var key_str = _escape_string(str(key))
|
||||
var key_color = _get_type_color(key_type)
|
||||
var formatted = _pretty_print_value(value, indent_level + 1)
|
||||
result += indent.repeat(indent_level + 1) + "[color=%s]%s[/color]: %s" % [key_color, key_str, formatted]
|
||||
if i < keys.size() - 1:
|
||||
result += ","
|
||||
result += "\n"
|
||||
result += indent.repeat(indent_level) + "}"
|
||||
return result
|
||||
|
||||
func _pretty_print_value(val, indent_level := 0) -> String:
|
||||
match typeof(val):
|
||||
TYPE_ARRAY, TYPE_PACKED_BYTE_ARRAY, TYPE_PACKED_INT32_ARRAY, TYPE_PACKED_INT64_ARRAY, \
|
||||
TYPE_PACKED_FLOAT32_ARRAY, TYPE_PACKED_FLOAT64_ARRAY, TYPE_PACKED_STRING_ARRAY, \
|
||||
TYPE_PACKED_VECTOR2_ARRAY, TYPE_PACKED_VECTOR3_ARRAY, TYPE_PACKED_VECTOR4_ARRAY, \
|
||||
TYPE_PACKED_COLOR_ARRAY:
|
||||
return _pretty_print_array(val, indent_level)
|
||||
TYPE_DICTIONARY:
|
||||
return _pretty_print_dict(val, indent_level)
|
||||
TYPE_COLOR:
|
||||
return _format_color(val)
|
||||
TYPE_STRING:
|
||||
if val.is_valid_int() or val.is_valid_float():
|
||||
return "[color=#f5c2e7]%s[/color]" % _escape_string(val)
|
||||
else:
|
||||
return "[color=#a6e3a1]%s[/color]" % _escape_string(val)
|
||||
TYPE_INT, TYPE_FLOAT:
|
||||
return "[color=#89b4fa]%s[/color]" % _format_custom_value(val)
|
||||
TYPE_BOOL:
|
||||
return "[color=#f38ba8]Yes[/color]" if val else "[color=#f38ba8]No[/color]"
|
||||
_:
|
||||
return "[color=#cdd6f4]%s[/color]" % str(val)
|
||||
|
||||
func _format_color(col : Color) -> String:
|
||||
var hex = col.to_html(false)
|
||||
return "[color=#%s]██[/color] %s" % [hex, col]
|
||||
|
||||
func _escape_string(s : String) -> String:
|
||||
return "\"" + s.replace("\"", "\\\"") + "\""
|
||||
|
||||
func _get_type_color(t : int) -> String:
|
||||
match t:
|
||||
TYPE_STRING: return "#f5c2e7"
|
||||
TYPE_INT, TYPE_FLOAT: return "#89b4fa"
|
||||
TYPE_BOOL: return "#f38ba8"
|
||||
TYPE_ARRAY, TYPE_PACKED_BYTE_ARRAY, TYPE_PACKED_INT32_ARRAY, TYPE_PACKED_INT64_ARRAY, \
|
||||
TYPE_PACKED_FLOAT32_ARRAY, TYPE_PACKED_FLOAT64_ARRAY, TYPE_PACKED_STRING_ARRAY, \
|
||||
TYPE_PACKED_VECTOR2_ARRAY, TYPE_PACKED_VECTOR3_ARRAY, TYPE_PACKED_VECTOR4_ARRAY, \
|
||||
TYPE_PACKED_COLOR_ARRAY: return "#cba6f7"
|
||||
TYPE_DICTIONARY: return "#f9e2af"
|
||||
TYPE_COLOR: return "#94e2d5"
|
||||
_: return "#cdd6f4"
|
||||
|
||||
func _format_bytes(b : float, d := 1) -> String:
|
||||
if b <= 0: return "0 B"
|
||||
var u = ["B","KB","MB","GB"]
|
||||
var i = 0
|
||||
var v = abs(b)
|
||||
while v >= 1000.0 and i < 3:
|
||||
v /= 1000.0
|
||||
i += 1
|
||||
return "%.*f %s" % [d, v, u[i]]
|
||||
|
||||
func _format_number(n : float) -> String:
|
||||
var s = str(int(abs(n)))
|
||||
var result = ""
|
||||
for i in range(s.length() - 1, -1, -1):
|
||||
if (s.length() - 1 - i) % 3 == 0 and i < s.length() - 1:
|
||||
result = "." + result
|
||||
result = s[i] + result
|
||||
return ("-" if n < 0 else "") + result
|
||||
1
addons/GD-Sync/UI/Profiler/ProfilerLabel.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://b3p26nyamgl8j
|
||||