now stuff

This commit is contained in:
bucket
2026-04-30 15:17:41 +02:00
parent 056f24340b
commit 672341b654
19 changed files with 701 additions and 21 deletions
+426 -15
View File
@@ -17,7 +17,12 @@
[ext_resource type="Script" uid="uid://dv74d87a31oyx" path="res://Scripts/Csharp/GitIntegration.cs" id="13_qmy6f"]
[ext_resource type="Script" uid="uid://byl0odlgqrjri" path="res://scenes/loadout_overrides.gd" id="14_bb450"]
[ext_resource type="Script" uid="uid://cg2feh2v1snlb" path="res://Scripts/Gdscript/LoadoutOverrides/override_parser.gd" id="14_cvmbd"]
[ext_resource type="Script" uid="uid://d4kekhtba3d0u" path="res://scenes/ServerStatGetter.cs" id="16_nfivy"]
[ext_resource type="Script" uid="uid://b05psfj22ka2f" path="res://Scripts/Gdscript/ServerStats/server_stat_parser.gd" id="17_1nqs0"]
[ext_resource type="PackedScene" uid="uid://ct2d3yftjk212" path="res://scenes/stats/PlayerDisplay.tscn" id="17_ebg2g"]
[ext_resource type="Script" uid="uid://chmb3e61opk14" path="res://Scripts/Gdscript/UsersAndGroups/PeopleParser.gd" id="17_ft6cd"]
[ext_resource type="Script" uid="uid://badgostgh6rpx" path="res://scenes/stats/maps.gd" id="17_yxlcp"]
[ext_resource type="PackedScene" uid="uid://b2e21u6c0mjxy" path="res://scenes/stats/NameDisplay.tscn" id="18_ebg2g"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_3p2gp"]
content_margin_left = 0.0
@@ -98,6 +103,172 @@ corner_radius_bottom_right = 3
corner_radius_bottom_left = 3
corner_detail = 5
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_1nqs0"]
content_margin_left = 0.0
content_margin_top = 0.0
content_margin_right = 0.0
content_margin_bottom = 0.0
bg_color = Color(0.19708219, 0.2543668, 0.21419287, 0.6)
border_width_left = 2
border_width_top = 2
border_width_right = 2
border_width_bottom = 2
border_color = Color(0.65549743, 0.90003556, 0.5985833, 0.45882353)
corner_radius_top_left = 3
corner_radius_top_right = 3
corner_radius_bottom_right = 3
corner_radius_bottom_left = 3
corner_detail = 5
[sub_resource type="Theme" id="Theme_1iba3"]
Panel/styles/panel = SubResource("StyleBoxFlat_1nqs0")
[sub_resource type="LabelSettings" id="LabelSettings_1iba3"]
font_size = 30
shadow_size = 3
shadow_color = Color(0, 0, 0, 0.7176471)
shadow_offset = Vector2(2.55, 2.675)
[sub_resource type="LabelSettings" id="LabelSettings_nfivy"]
font_size = 28
font_color = Color(0.89, 0.89, 0.89, 1)
[sub_resource type="LabelSettings" id="LabelSettings_1nqs0"]
font_size = 30
[sub_resource type="GDScript" id="GDScript_1nqs0"]
script/source = "extends Label
@export var server_stat_parser: ServerStatParser
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
text = str(server_stat_parser.users_month)
"
[sub_resource type="GDScript" id="GDScript_1iba3"]
script/source = "extends Label
@export var server_stat_parser: ServerStatParser
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
server_stat_parser.just_parsed.connect(update)
func update():
var maps:Dictionary = server_stat_parser.maps_month.duplicate()
var highest:int = -1
var current_map:String
for key in maps.keys():
if maps[key] > highest:
current_map = key
highest = maps[key]
text = current_map
"
[sub_resource type="GDScript" id="GDScript_yxlcp"]
script/source = "extends Label
@export var server_stat_parser: ServerStatParser
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
server_stat_parser.just_parsed.connect(update)
func update():
var gamemodes:Dictionary = server_stat_parser.gamemodes_month.duplicate()
var highest:int = -1
var current_gamemode:String
for key in gamemodes.keys():
if gamemodes[key] > highest:
current_gamemode = key
highest = gamemodes[key]
text = current_gamemode
"
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_1iba3"]
content_margin_left = 0.0
content_margin_top = 0.0
content_margin_right = 0.0
content_margin_bottom = 0.0
bg_color = Color(0.26416862, 0.30574214, 0.21699286, 0.5411765)
corner_radius_top_left = 7
corner_radius_top_right = 7
corner_radius_bottom_right = 7
corner_radius_bottom_left = 7
corner_detail = 5
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_yxlcp"]
bg_color = Color(0.1, 0.1, 0.1, 0.22745098)
[sub_resource type="GDScript" id="GDScript_ebg2g"]
script/source = "@tool
extends HBoxContainer
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
var children:Array = get_children()
for child:int in range(get_children().size()):
children[child].size.x = get_parent().size.x / get_children().size()
children[child].position.x = (get_parent().size.x / get_children().size() ) * child
"
[sub_resource type="GDScript" id="GDScript_xa025"]
script/source = "extends LineEdit
@export var player_c_ontainer: VBoxContainer
func _ready() -> void:
text_changed.connect(hoho)
func hoho(_txt:String):
print(\"hho \")
if text == \"\":
for child:Control in player_c_ontainer.get_children():
child.show()
else:
for child:PlayerStatDisplay in player_c_ontainer.get_children():
child.hide()
for child:PlayerStatDisplay in player_c_ontainer.get_children():
if child.name_lbl.text.to_lower().contains(text.to_lower()):
child.show()
if child.uid.text.to_lower().contains(text.to_lower()):
child.show()
"
[sub_resource type="GDScript" id="GDScript_2ofn6"]
script/source = "extends VBoxContainer
@export var server_stat_parser: ServerStatParser
@export var player_display: PackedScene
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
server_stat_parser.just_parsed.connect(parse)
func parse():
var sorted_players:Array[PlayerInfo] = server_stat_parser.players_total.duplicate()
sorted_players.sort_custom(sort_ascending)
var root_display:PlayerStatDisplay = player_display.instantiate()
add_child(root_display)
for player:PlayerInfo in sorted_players:
var display:PlayerStatDisplay = player_display.instantiate()
add_child(display)
display.kd.text = str(roundf((float(player.total_kills) / float(player.total_deaths))*100)/100)
display.name_lbl.text = player.username
display.plays.text = str(player.times_played)
display.uid.text = player.uid
func sort_ascending(a:PlayerInfo, b:PlayerInfo):
if a.times_played > b.times_played:
return true
return false
"
[node name="Control" type="Control" unique_id=2276929 node_paths=PackedStringArray("edit_window", "punish_list_parser", "PunishContainer", "new_punish_btn", "new_btn", "exporter", "save_file_parser", "quit_confirmation", "ban_counter", "plus", "minus", "more_btn", "options_window", "git", "commit", "save_label")]
layout_mode = 3
anchors_preset = 15
@@ -125,6 +296,20 @@ git = NodePath("Git")
commit = NodePath("Tabs/Banlist/MarginContainer/VBoxContainer/HBoxContainer2/Commit")
save_label = NodePath("Tabs/Banlist/MarginContainer/VBoxContainer/HBoxContainer2/Label")
[node name="TextureRect" type="TextureRect" parent="." unique_id=1516457942]
modulate = Color(0.74558026, 0.7455802, 0.7455802, 1)
z_index = -1
layout_mode = 1
anchors_preset = -1
offset_left = -119.0
offset_top = -214.0
offset_right = 405.0
offset_bottom = 526.0
mouse_filter = 2
texture = ExtResource("3_mwfav")
expand_mode = 5
stretch_mode = 5
[node name="Tabs" type="TabContainer" parent="." unique_id=1219388433]
layout_mode = 1
anchors_preset = 15
@@ -137,9 +322,10 @@ theme_override_styles/tabbar_background = SubResource("StyleBoxFlat_cvmbd")
theme_override_styles/tab_unselected = SubResource("StyleBoxFlat_bb450")
theme_override_styles/tab_hovered = SubResource("StyleBoxFlat_nfivy")
theme_override_styles/tab_selected = SubResource("StyleBoxFlat_ft6cd")
current_tab = 0
current_tab = 2
[node name="Banlist" type="Control" parent="Tabs" unique_id=990971830]
visible = false
layout_mode = 2
metadata/_tab_index = 0
@@ -167,20 +353,6 @@ name_check = NodePath("../MarginContainer/VBoxContainer/HBoxContainer3/NameCheck
uid_check = NodePath("../MarginContainer/VBoxContainer/HBoxContainer3/UIDCheck")
description_check = NodePath("../MarginContainer/VBoxContainer/HBoxContainer3/DescriptionCheck")
[node name="TextureRect" type="TextureRect" parent="Tabs/Banlist" unique_id=1516457942]
modulate = Color(0.74558026, 0.7455802, 0.7455802, 1)
z_index = -1
layout_mode = 1
anchors_preset = -1
offset_left = -119.0
offset_top = -245.0
offset_right = 405.0
offset_bottom = 495.0
mouse_filter = 2
texture = ExtResource("3_mwfav")
expand_mode = 5
stretch_mode = 5
[node name="ColorRect" type="ColorRect" parent="Tabs/Banlist" unique_id=1789999219]
z_index = -2
layout_mode = 1
@@ -400,6 +572,245 @@ color = Color(0.2958, 0.32674, 0.34, 1)
[node name="OverrideParser" type="Node" parent="Tabs/Loadout overrides" unique_id=48398298]
script = ExtResource("14_cvmbd")
[node name="Server Statistics" type="Control" parent="Tabs" unique_id=1942261180]
layout_mode = 2
theme = SubResource("Theme_1iba3")
metadata/_tab_index = 2
[node name="ServerStatGetter" type="Node" parent="Tabs/Server Statistics" unique_id=1152887726]
script = ExtResource("16_nfivy")
[node name="ColorRect" type="ColorRect" parent="Tabs/Server Statistics" unique_id=1355809081]
z_index = -2
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
size_flags_vertical = 3
color = Color(0.1719254, 0.2944815, 0.30498523, 0.37254903)
[node name="VBoxContainer" type="VBoxContainer" parent="Tabs/Server Statistics" unique_id=257261483]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="HeadlinerStats" type="VBoxContainer" parent="Tabs/Server Statistics/VBoxContainer" unique_id=1019416167]
z_as_relative = false
layout_mode = 2
[node name="Label" type="Label" parent="Tabs/Server Statistics/VBoxContainer/HeadlinerStats" unique_id=2078760808]
layout_mode = 2
text = "In the last 30 days..."
label_settings = SubResource("LabelSettings_1iba3")
[node name="TopBar" type="HBoxContainer" parent="Tabs/Server Statistics/VBoxContainer/HeadlinerStats" unique_id=1694414121]
custom_minimum_size = Vector2(0, 120)
layout_mode = 2
[node name="MonthlyPlayers" type="Panel" parent="Tabs/Server Statistics/VBoxContainer/HeadlinerStats/TopBar" unique_id=881796597]
layout_mode = 2
size_flags_horizontal = 3
[node name="VBoxContainer" type="VBoxContainer" parent="Tabs/Server Statistics/VBoxContainer/HeadlinerStats/TopBar/MonthlyPlayers" unique_id=1282225763]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="Label" type="Label" parent="Tabs/Server Statistics/VBoxContainer/HeadlinerStats/TopBar/MonthlyPlayers/VBoxContainer" unique_id=758988801]
custom_maximum_size = Vector2(500, -1)
layout_mode = 2
size_flags_horizontal = 0
size_flags_vertical = 3
text = "Players:"
label_settings = SubResource("LabelSettings_nfivy")
autowrap_mode = 1
clip_text = true
text_overrun_behavior = 1
[node name="Label2" type="Label" parent="Tabs/Server Statistics/VBoxContainer/HeadlinerStats/TopBar/MonthlyPlayers/VBoxContainer" unique_id=1646811151 node_paths=PackedStringArray("server_stat_parser")]
custom_maximum_size = Vector2(500, -1)
layout_mode = 2
size_flags_horizontal = 8
size_flags_vertical = 3
text = "353"
label_settings = SubResource("LabelSettings_1nqs0")
horizontal_alignment = 2
vertical_alignment = 2
autowrap_mode = 1
clip_text = true
text_overrun_behavior = 1
script = SubResource("GDScript_1nqs0")
server_stat_parser = NodePath("../../../../../../ServerStatParser")
[node name="MonthlyMap" type="Panel" parent="Tabs/Server Statistics/VBoxContainer/HeadlinerStats/TopBar" unique_id=489519187]
layout_mode = 2
size_flags_horizontal = 3
[node name="VBoxContainer" type="VBoxContainer" parent="Tabs/Server Statistics/VBoxContainer/HeadlinerStats/TopBar/MonthlyMap" unique_id=267062023]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="Label" type="Label" parent="Tabs/Server Statistics/VBoxContainer/HeadlinerStats/TopBar/MonthlyMap/VBoxContainer" unique_id=1076988465]
custom_minimum_size = Vector2(0, 38.415)
custom_maximum_size = Vector2(500, -1)
layout_mode = 2
size_flags_horizontal = 0
size_flags_vertical = 1
text = "Most Played Map:"
label_settings = SubResource("LabelSettings_nfivy")
autowrap_mode = 1
clip_text = true
text_overrun_behavior = 1
[node name="Label2" type="Label" parent="Tabs/Server Statistics/VBoxContainer/HeadlinerStats/TopBar/MonthlyMap/VBoxContainer" unique_id=360141428 node_paths=PackedStringArray("server_stat_parser")]
layout_mode = 2
size_flags_vertical = 3
text = "placeholder"
label_settings = SubResource("LabelSettings_1nqs0")
horizontal_alignment = 2
vertical_alignment = 2
autowrap_mode = 1
clip_text = true
text_overrun_behavior = 3
script = SubResource("GDScript_1iba3")
server_stat_parser = NodePath("../../../../../../ServerStatParser")
[node name="PopGamemode" type="Panel" parent="Tabs/Server Statistics/VBoxContainer/HeadlinerStats/TopBar" unique_id=1033509599]
layout_mode = 2
size_flags_horizontal = 3
[node name="VBoxContainer" type="VBoxContainer" parent="Tabs/Server Statistics/VBoxContainer/HeadlinerStats/TopBar/PopGamemode" unique_id=142037385]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="Label" type="Label" parent="Tabs/Server Statistics/VBoxContainer/HeadlinerStats/TopBar/PopGamemode/VBoxContainer" unique_id=123988698]
custom_maximum_size = Vector2(500, -1)
layout_mode = 2
size_flags_horizontal = 0
size_flags_vertical = 3
text = "Most Popular Gamemode:"
label_settings = SubResource("LabelSettings_nfivy")
autowrap_mode = 1
clip_text = true
text_overrun_behavior = 1
[node name="Label2" type="Label" parent="Tabs/Server Statistics/VBoxContainer/HeadlinerStats/TopBar/PopGamemode/VBoxContainer" unique_id=689478046 node_paths=PackedStringArray("server_stat_parser")]
custom_maximum_size = Vector2(500, -1)
layout_mode = 2
size_flags_horizontal = 8
size_flags_vertical = 3
text = "koth of the hill"
label_settings = SubResource("LabelSettings_1nqs0")
horizontal_alignment = 2
vertical_alignment = 2
autowrap_mode = 1
clip_text = true
text_overrun_behavior = 1
script = SubResource("GDScript_yxlcp")
server_stat_parser = NodePath("../../../../../../ServerStatParser")
[node name="TabContainer" type="TabContainer" parent="Tabs/Server Statistics/VBoxContainer" unique_id=578447304]
layout_mode = 2
size_flags_vertical = 3
theme_override_styles/panel = SubResource("StyleBoxFlat_1iba3")
theme_override_styles/tabbar_background = SubResource("StyleBoxFlat_yxlcp")
current_tab = 1
[node name="Weapons" type="VBoxContainer" parent="Tabs/Server Statistics/VBoxContainer/TabContainer" unique_id=1628442051]
visible = false
layout_mode = 2
metadata/_tab_index = 0
[node name="HBoxContainer" type="HBoxContainer" parent="Tabs/Server Statistics/VBoxContainer/TabContainer/Weapons" unique_id=2092838805]
custom_minimum_size = Vector2(0, 40)
layout_mode = 2
script = SubResource("GDScript_ebg2g")
[node name="Label" type="Label" parent="Tabs/Server Statistics/VBoxContainer/TabContainer/Weapons/HBoxContainer" unique_id=1363333016]
custom_minimum_size = Vector2(1, 0)
layout_mode = 2
text = "Weapon name"
horizontal_alignment = 1
clip_text = true
text_overrun_behavior = 1
[node name="Label2" type="Label" parent="Tabs/Server Statistics/VBoxContainer/TabContainer/Weapons/HBoxContainer" unique_id=1324679732]
custom_minimum_size = Vector2(1, 0)
layout_mode = 2
text = "Average K/D"
horizontal_alignment = 1
clip_text = true
text_overrun_behavior = 1
[node name="Label3" type="Label" parent="Tabs/Server Statistics/VBoxContainer/TabContainer/Weapons/HBoxContainer" unique_id=920702989]
custom_minimum_size = Vector2(1, 0)
layout_mode = 2
text = "Total usage time"
horizontal_alignment = 1
clip_text = true
text_overrun_behavior = 1
[node name="Players" type="ScrollContainer" parent="Tabs/Server Statistics/VBoxContainer/TabContainer" unique_id=1039046594]
layout_mode = 2
metadata/_tab_index = 1
[node name="VBoxContainer2" type="VBoxContainer" parent="Tabs/Server Statistics/VBoxContainer/TabContainer/Players" unique_id=1320520304]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="LineEdit" type="LineEdit" parent="Tabs/Server Statistics/VBoxContainer/TabContainer/Players/VBoxContainer2" unique_id=652935929 node_paths=PackedStringArray("player_c_ontainer")]
layout_mode = 2
placeholder_text = "Search..."
script = SubResource("GDScript_xa025")
player_c_ontainer = NodePath("../PlayerCOntainer")
[node name="PlayerCOntainer" type="VBoxContainer" parent="Tabs/Server Statistics/VBoxContainer/TabContainer/Players/VBoxContainer2" unique_id=1079726598 node_paths=PackedStringArray("server_stat_parser")]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
script = SubResource("GDScript_2ofn6")
server_stat_parser = NodePath("../../../../../ServerStatParser")
player_display = ExtResource("17_ebg2g")
[node name="Maps" type="ScrollContainer" parent="Tabs/Server Statistics/VBoxContainer/TabContainer" unique_id=915666381]
visible = false
layout_mode = 2
metadata/_tab_index = 2
[node name="Maps" type="VBoxContainer" parent="Tabs/Server Statistics/VBoxContainer/TabContainer/Maps" unique_id=2010905860 node_paths=PackedStringArray("server_stat_parser")]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
script = ExtResource("17_yxlcp")
name_display = ExtResource("18_ebg2g")
server_stat_parser = NodePath("../../../../ServerStatParser")
[node name="Gamemodes" type="VBoxContainer" parent="Tabs/Server Statistics/VBoxContainer/TabContainer" unique_id=97195990]
visible = false
layout_mode = 2
metadata/_tab_index = 3
[node name="ServerStatParser" type="Node" parent="Tabs/Server Statistics" unique_id=1363475987 node_paths=PackedStringArray("server_stat_getter")]
script = ExtResource("17_1nqs0")
server_stat_getter = NodePath("../ServerStatGetter")
[node name="SaveFileParser" type="Node" parent="." unique_id=930223611 node_paths=PackedStringArray("options_window")]
script = ExtResource("12_ebg2g")
options_window = NodePath("../Tabs/Banlist/OptionsWindow")
+22
View File
@@ -0,0 +1,22 @@
using Godot;
using System;
using System.Net.Http;
public partial class ServerStatGetter : Node
{
[Export] String resulting_txt = "";
public override void _Ready()
{
using(var client = new System.Net.Http.HttpClient()){
var endp = new Uri("https://tfvr-server.fly.dev/sessions");
var result = client.GetAsync(endp).Result;
var json = result.Content.ReadAsStringAsync();
GD.Print("BULL SHIT:",json.Result);
resulting_txt = json.Result;
}
}
// Called every frame. 'delta' is the elapsed time since the previous frame.
public override void _Process(double delta)
{
}
}
+1
View File
@@ -0,0 +1 @@
uid://d4kekhtba3d0u
+48
View File
@@ -0,0 +1,48 @@
[gd_scene format=3 uid="uid://b2e21u6c0mjxy"]
[ext_resource type="Script" uid="uid://bc304ooheeb2g" path="res://scenes/stats/name_display.gd" id="1_mdapc"]
[node name="NameDisplay" type="Control" unique_id=128991058 node_paths=PackedStringArray("label", "label_2")]
custom_minimum_size = Vector2(0, 32)
layout_mode = 3
anchor_right = 1.0
anchor_bottom = 0.051000003
offset_top = -2.0
offset_bottom = -0.048000336
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_mdapc")
label = NodePath("VBoxContainer/HBoxContainer/Label")
label_2 = NodePath("VBoxContainer/HBoxContainer/Label2")
[node name="VBoxContainer" type="VBoxContainer" parent="." unique_id=1534297411]
custom_minimum_size = Vector2(0, 32)
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" unique_id=1179614072]
layout_mode = 2
size_flags_vertical = 3
[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer" unique_id=393776271]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 1
text = "name"
autowrap_mode = 1
text_overrun_behavior = 3
[node name="Label2" type="Label" parent="VBoxContainer/HBoxContainer" unique_id=1000028594]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 1
text = "other thing"
autowrap_mode = 1
clip_text = true
[node name="HSeparator" type="HSeparator" parent="VBoxContainer" unique_id=1975662519]
layout_mode = 2
+55
View File
@@ -0,0 +1,55 @@
[gd_scene format=3 uid="uid://ct2d3yftjk212"]
[ext_resource type="Script" uid="uid://biop38aeju75a" path="res://scenes/stats/player_display.gd" id="1_m3u0m"]
[node name="PlayerDisplay" type="Control" unique_id=1208441133 node_paths=PackedStringArray("name_lbl", "uid", "plays", "kd")]
custom_minimum_size = Vector2(0, 30)
layout_mode = 3
anchor_right = 1.0
anchor_bottom = 0.046000004
offset_bottom = 0.19199753
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_m3u0m")
name_lbl = NodePath("HBoxContainer/name")
uid = NodePath("HBoxContainer/uid")
plays = NodePath("HBoxContainer/plays")
kd = NodePath("HBoxContainer/kd")
[node name="HBoxContainer" type="HBoxContainer" parent="." unique_id=504288121]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="name" type="Label" parent="HBoxContainer" unique_id=423224328]
layout_mode = 2
size_flags_horizontal = 3
text = "Username"
[node name="uid" type="Label" parent="HBoxContainer" unique_id=1540161212]
layout_mode = 2
size_flags_horizontal = 3
text = "UID"
[node name="plays" type="Label" parent="HBoxContainer" unique_id=1169444218]
layout_mode = 2
size_flags_horizontal = 3
text = "Plays"
[node name="kd" type="Label" parent="HBoxContainer" unique_id=2027485224]
layout_mode = 2
size_flags_horizontal = 3
text = "average K/D"
[node name="HSeparator" type="HSeparator" parent="." unique_id=1539410405]
layout_mode = 1
anchors_preset = 12
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_top = -4.0
grow_horizontal = 2
grow_vertical = 0
+7
View File
@@ -0,0 +1,7 @@
class_name PlayerInfo extends Resource
@export var username:String
@export var uid:String
@export var times_played:int
@export var total_deaths:int
@export var total_kills:int
+1
View File
@@ -0,0 +1 @@
uid://di6bv5218vdix
+43
View File
@@ -0,0 +1,43 @@
extends VBoxContainer
@export var name_display: PackedScene
@export var server_stat_parser: ServerStatParser
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
server_stat_parser.just_parsed.connect(reparse)
func reparse():
for child in get_children():
child.queue_free()
var root_display:NameDisplaye = name_display.instantiate()
root_display.label.text = "Map"
root_display.label_2.text = "Times Played"
add_child(root_display)
var maps:Dictionary = {}
for key in server_stat_parser.maps_month.keys():
if maps.has(server_stat_parser.maps_month[key]):
if maps[server_stat_parser.maps_month[key]] is Array:
#var new_arr
maps[server_stat_parser.maps_month[key]].append(key)
else:
maps[server_stat_parser.maps_month[key]] = [maps[server_stat_parser.maps_month[key]],key]
else:
maps[server_stat_parser.maps_month[key]] = key
maps.sort()
print(maps," gi")
var keys = maps.keys()
keys.reverse()
for amount in keys:
var display:NameDisplaye = name_display.instantiate()
display.label_2.text = str(amount)
var gotten = maps[amount]
var new_string:String = ""
if gotten is Array:
for piece in gotten.size():
if gotten[piece]:
new_string += gotten[piece] + (", " if piece != gotten.size()-1 else "")
else:
new_string = gotten
display.label.text = str(new_string)
add_child(display)
+1
View File
@@ -0,0 +1 @@
uid://badgostgh6rpx
+4
View File
@@ -0,0 +1,4 @@
class_name NameDisplaye extends Control
@export var label: Label
@export var label_2: Label
+1
View File
@@ -0,0 +1 @@
uid://bc304ooheeb2g
+6
View File
@@ -0,0 +1,6 @@
class_name PlayerStatDisplay extends Control
@export var name_lbl: Label
@export var uid: Label
@export var plays: Label
@export var kd: Label
+1
View File
@@ -0,0 +1 @@
uid://biop38aeju75a
+6 -3
View File
@@ -57,9 +57,12 @@ func update(set_time:bool = false):
"HARASSMENT":
reason_option.select(2)
_:
reason_custom.show()
reason_option.select(3)
reason_edit.text = punishment.punish_reason
if punishment.punish_reason:
reason_custom.show()
reason_option.select(3)
reason_edit.text = punishment.punish_reason
else:
reason_option.select(0)
var from_time:int = punishment.punish_end
var from_unix:Dictionary = Time.get_date_dict_from_unix_time(from_time)
@warning_ignore("integer_division")