Initial commit

This commit is contained in:
bucket
2026-03-06 23:35:19 +01:00
commit 719d1628e0
46 changed files with 1581 additions and 0 deletions
+66
View File
@@ -0,0 +1,66 @@
[gd_scene format=3 uid="uid://burukk5374yyu"]
[ext_resource type="Script" uid="uid://cgr5yq35l0u65" path="res://scenes/windwos/more_options_window.gd" id="1_5xt3b"]
[sub_resource type="LabelSettings" id="LabelSettings_5xt3b"]
font_size = 30
[node name="OptionsWindow" type="Window" unique_id=1485451151 node_paths=PackedStringArray("dupe_clear_button", "save_v_1_button")]
oversampling_override = 1.0
position = Vector2i(0, 36)
size = Vector2i(300, 200)
visible = false
force_native = true
min_size = Vector2i(262, 199)
script = ExtResource("1_5xt3b")
dupe_clear_button = NodePath("MarginContainer/ScrollContainer/BoxContainer/DupeClearButton")
save_v_1_button = NodePath("MarginContainer/ScrollContainer/BoxContainer/SaveV1Button")
[node name="ColorRect" type="ColorRect" parent="." unique_id=1724009282]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3
size_flags_vertical = 3
color = Color(0.32941177, 0.25490198, 0.1764706, 1)
[node name="MarginContainer" type="MarginContainer" parent="." unique_id=782458598]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3
size_flags_vertical = 3
theme_override_constants/margin_left = 5
theme_override_constants/margin_top = 5
theme_override_constants/margin_right = 5
theme_override_constants/margin_bottom = 5
[node name="ScrollContainer" type="ScrollContainer" parent="MarginContainer" unique_id=1444604018]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
horizontal_scroll_mode = 0
[node name="BoxContainer" type="BoxContainer" parent="MarginContainer/ScrollContainer" unique_id=1819150398]
layout_mode = 2
size_flags_horizontal = 3
vertical = true
[node name="RichTextLabel" type="Label" parent="MarginContainer/ScrollContainer/BoxContainer" unique_id=66906023]
layout_mode = 2
text = "Utility"
label_settings = SubResource("LabelSettings_5xt3b")
[node name="DupeClearButton" type="Button" parent="MarginContainer/ScrollContainer/BoxContainer" unique_id=25275652]
layout_mode = 2
tooltip_text = "Removes duplicate entires(same uid and name)"
text = "Clear Dupes"
[node name="SaveV1Button" type="Button" parent="MarginContainer/ScrollContainer/BoxContainer" unique_id=1718864258]
layout_mode = 2
tooltip_text = "Save a version of the banlist in the legacy format"
text = "save duplicate v1 file"
+89
View File
@@ -0,0 +1,89 @@
extends Window
@export var root:mainNode
@export var PunishContainer:Control
@export var search_bar:LineEdit
@export var total: Label
@export var alts: Label
@export var unique: Label
@export var best: Label
@export var altshowcse: PackedScene
@export var altshowcse_container: Control
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
visibility_changed.connect(update_stats)
update_stats()
close_requested.connect(hide)
root.edit_window.changed.connect(update_stats)
func update_stats():
for child in altshowcse_container.get_children():
child.queue_free()
var punishments:Array[Punishment]
for child in PunishContainer.get_children():
if child is PunishShowcase:
punishments.append(child.punishment)
var count:int = 0
var keys:Array[String]
for punishment in punishments:
if punishment.uid != "":
if !keys.has(punishment.uid):
keys.append(punishment.uid)
count += 1
else:
if !keys.has(punishment.username):
keys.append(punishment.username)
count += 1
var entires_stats:Dictionary[Punishment,int]
for punishment in punishments:
if punishment.uid:
for punishment2 in punishments:
if punishment2 != punishment:
if punishment2.uid == punishment.uid:
if entires_stats.has(punishment):
entires_stats[punishment] += 1
else:
entires_stats[punishment] = 1
var most_evader:Punishment
var most_alts:int = -1
var used_uids:Array[String] = []
sort_dict(entires_stats)
for entry in entires_stats.keys():
if entires_stats[entry] > most_alts:
print("new best: ",entires_stats[entry] )
most_evader = entry
most_alts = entires_stats[entry]
if entry is Punishment:
if entry.uid not in used_uids:
used_uids.append(entry.uid)
var child:altshowcase = altshowcse.instantiate()
altshowcse_container.add_child(child)
child.count_label.text = "%s alts" % entires_stats[entry]
child.name_label.text = entry.username
child.uid_label.text = entry.uid
child.search_alts_button.pressed.connect(root_search.bind(child.uid_label.text))
total.text = "Total punishments %s" % str(punishments.size())
unique.text = "Unique people: %s" % str(count)
alts.text = "Alts total: %s" % str(punishments.size()-count)
if most_evader:
best.text = "Most alt accounts: %s (%s)" % [most_evader.username, most_evader.uid]
func root_search(what:String):
search_bar.text = what
search_bar.text_changed.emit(what)
func sort_dict(dict: Dictionary) -> void:
var pairs = dict.keys().map(func (key): return [key, dict[key]])
pairs.sort()
pairs.reverse()
dict.clear()
for p in pairs:
dict[p[0]] = p[1]
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
+1
View File
@@ -0,0 +1 @@
uid://dwc8m0l6he4uo
+62
View File
@@ -0,0 +1,62 @@
[gd_scene format=3 uid="uid://bv4mvou68l2sk"]
[ext_resource type="Script" uid="uid://2f384phq5272" path="res://AltShowcase.gd" id="1_7tuyd"]
[sub_resource type="LabelSettings" id="LabelSettings_7tuyd"]
font_size = 20
[sub_resource type="LabelSettings" id="LabelSettings_45q1g"]
font_size = 15
font_color = Color(0.74558026, 0.7455802, 0.7455802, 1)
[sub_resource type="LabelSettings" id="LabelSettings_y1bem"]
font_size = 27
[node name="Altshowcase" type="Control" unique_id=96967418 node_paths=PackedStringArray("name_label", "uid_label", "count_label", "search_alts_button")]
custom_minimum_size = Vector2(0, 58.235)
layout_mode = 3
anchors_preset = 10
anchor_right = 1.0
grow_horizontal = 2
size_flags_horizontal = 3
script = ExtResource("1_7tuyd")
name_label = NodePath("HBoxContainer/VBoxContainer/Name")
uid_label = NodePath("HBoxContainer/VBoxContainer/Uid")
count_label = NodePath("HBoxContainer/Count")
search_alts_button = NodePath("HBoxContainer/SearchAltsButton")
[node name="ColorRect" type="ColorRect" parent="." unique_id=2074909687]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
color = Color(0, 0, 0, 0.13333334)
[node name="HBoxContainer" type="HBoxContainer" parent="." unique_id=809192798]
layout_mode = 0
offset_right = 40.0
offset_bottom = 40.0
[node name="VBoxContainer" type="VBoxContainer" parent="HBoxContainer" unique_id=166743843]
layout_mode = 2
[node name="Name" type="Label" parent="HBoxContainer/VBoxContainer" unique_id=1070838197]
layout_mode = 2
text = "name"
label_settings = SubResource("LabelSettings_7tuyd")
[node name="Uid" type="Label" parent="HBoxContainer/VBoxContainer" unique_id=718203878]
layout_mode = 2
text = "UID"
label_settings = SubResource("LabelSettings_45q1g")
[node name="Count" type="Label" parent="HBoxContainer" unique_id=899914138]
layout_mode = 2
text = "67 alts"
label_settings = SubResource("LabelSettings_y1bem")
[node name="SearchAltsButton" type="Button" parent="HBoxContainer" unique_id=957758160]
layout_mode = 2
text = "Show"
+86
View File
@@ -0,0 +1,86 @@
class_name EditWindow extends Window
@onready var days_edit: SpinBox = $margin/VBoxContainer/ScrollContainer/Container/Ends/DaysEdit
@onready var years_edit: SpinBox = $margin/VBoxContainer/ScrollContainer/Container/Ends/YearsEdit
@onready var reason_edit: LineEdit = $"margin/VBoxContainer/ScrollContainer/Container/Reason/Reason Edit"
@onready var uid_edit: LineEdit = $"margin/VBoxContainer/ScrollContainer/Container/UID/UID Edit"
@onready var name_edit: LineEdit = $"margin/VBoxContainer/ScrollContainer/Container/Name/Name Edit"
@onready var donebutton: Button = $margin/VBoxContainer/Done
@onready var delete_check: CheckBox = $margin/VBoxContainer/ScrollContainer/Container/DeleteCheck
@onready var delete_button: Button = $margin/VBoxContainer/ScrollContainer/Container/DeleteButton
@onready var type_button: OptionButton = $margin/VBoxContainer/ScrollContainer/Container/Type/TypeButton
@export var opened_from:PunishShowcase
@export var punishment:Punishment
const id_to_name:Dictionary = {Punishment.punishment_types.BAN:"BAN",
Punishment.punishment_types.MUTE:"MUTE"}
signal changed
func _ready() -> void:
close_requested.connect(close)
donebutton.pressed.connect(done)
delete_button.pressed.connect(delete_this)
for type in Punishment.punishment_types:
type_button.add_item(type)
func delete_this():
if opened_from:
opened_from.queue_free()
punishment = null
hide()
delete_check.button_pressed = false
changed.emit()
func _process(delta: float) -> void:
delete_button.disabled = !delete_check.button_pressed
func update(set_time:bool = false):
if !punishment:
printerr("!punishment is true")
return
name_edit.text = punishment.username
uid_edit.text = punishment.uid
reason_edit.text = punishment.punish_reason
var from_time:int = punishment.punish_end
var from_unix:Dictionary = Time.get_date_dict_from_unix_time(from_time)
@warning_ignore("integer_division")
var years:int = from_unix["year"]
@warning_ignore("integer_division")
var days:int = from_unix["day"]
years_edit.value = years
days_edit.value = days
type_button.select(punishment.what_punishment)
changed.emit()
func close():
punishment = null
opened_from = null
delete_check.button_pressed = false
hide()
changed.emit()
func done():
if opened_from:
opened_from.punishment = get_punish()
opened_from.update()
hide()
else:
hide()
delete_check.button_pressed = false
changed.emit()
func get_punish() -> Punishment:
var new_punishment:Punishment = Punishment.new()
new_punishment.username = name_edit.text
new_punishment.uid = uid_edit.text
new_punishment.punish_reason = reason_edit.text
var time:int = 0
time += years_edit.value * 31536000
time += days_edit.value *86400
var unixtime:float = Time.get_unix_time_from_datetime_dict({"year":years_edit.value,
"day":days_edit.value,})
new_punishment.punish_end = unixtime
new_punishment.what_punishment = type_button.selected
changed.emit()
return new_punishment
+1
View File
@@ -0,0 +1 @@
uid://n41mlonj47n3
+143
View File
@@ -0,0 +1,143 @@
[gd_scene format=3 uid="uid://dy18m2uq557to"]
[ext_resource type="Script" uid="uid://n41mlonj47n3" path="res://scenes/windwos/edit_window.gd" id="1_827p1"]
[sub_resource type="LabelSettings" id="LabelSettings_827p1"]
font_size = 14
font_color = Color(0.7581918, 0.7581918, 0.7581917, 1)
[node name="EditWindow" type="Window" unique_id=1215629639]
oversampling_override = 1.0
initial_position = 4
size = Vector2i(680, 395)
visible = false
force_native = true
script = ExtResource("1_827p1")
[node name="ColorRect" type="ColorRect" parent="." unique_id=207830370]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
color = Color(0.32941177, 0.25490198, 0.1764706, 1)
[node name="margin" type="MarginContainer" parent="." unique_id=81777967]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3
size_flags_vertical = 3
theme_override_constants/margin_left = 5
theme_override_constants/margin_top = 5
theme_override_constants/margin_right = 5
theme_override_constants/margin_bottom = 5
[node name="VBoxContainer" type="VBoxContainer" parent="margin" unique_id=565613909]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="Label" type="Label" parent="margin/VBoxContainer" unique_id=725988158]
layout_mode = 2
size_flags_horizontal = 3
text = "Edit Punishment"
[node name="HSeparator" type="HSeparator" parent="margin/VBoxContainer" unique_id=155976402]
layout_mode = 2
[node name="ScrollContainer" type="ScrollContainer" parent="margin/VBoxContainer" unique_id=7819980]
layout_mode = 2
size_flags_vertical = 3
[node name="Container" type="VBoxContainer" parent="margin/VBoxContainer/ScrollContainer" unique_id=505332829]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="Name" type="HBoxContainer" parent="margin/VBoxContainer/ScrollContainer/Container" unique_id=2031494707]
layout_mode = 2
[node name="Name Label" type="Label" parent="margin/VBoxContainer/ScrollContainer/Container/Name" unique_id=579407327]
layout_mode = 2
text = "Name:"
[node name="Name Edit" type="LineEdit" parent="margin/VBoxContainer/ScrollContainer/Container/Name" unique_id=716298584]
layout_mode = 2
size_flags_horizontal = 3
[node name="UID" type="HBoxContainer" parent="margin/VBoxContainer/ScrollContainer/Container" unique_id=211366043]
layout_mode = 2
[node name="UID Label" type="Label" parent="margin/VBoxContainer/ScrollContainer/Container/UID" unique_id=1644730935]
layout_mode = 2
text = "UID:"
[node name="UID Edit" type="LineEdit" parent="margin/VBoxContainer/ScrollContainer/Container/UID" unique_id=946656979]
layout_mode = 2
size_flags_horizontal = 3
draw_control_chars = true
[node name="Type" type="HBoxContainer" parent="margin/VBoxContainer/ScrollContainer/Container" unique_id=301450437]
layout_mode = 2
[node name="Type" type="Label" parent="margin/VBoxContainer/ScrollContainer/Container/Type" unique_id=10941001]
layout_mode = 2
text = "Type:"
[node name="TypeButton" type="OptionButton" parent="margin/VBoxContainer/ScrollContainer/Container/Type" unique_id=2091379963]
layout_mode = 2
[node name="Reason" type="HBoxContainer" parent="margin/VBoxContainer/ScrollContainer/Container" unique_id=420802158]
layout_mode = 2
[node name="Reason Label" type="Label" parent="margin/VBoxContainer/ScrollContainer/Container/Reason" unique_id=675845905]
layout_mode = 2
text = "Reason:"
[node name="Reason Edit" type="LineEdit" parent="margin/VBoxContainer/ScrollContainer/Container/Reason" unique_id=194738986]
layout_mode = 2
size_flags_horizontal = 3
[node name="Ends" type="HBoxContainer" parent="margin/VBoxContainer/ScrollContainer/Container" unique_id=594016585]
layout_mode = 2
[node name="Ends Label" type="Label" parent="margin/VBoxContainer/ScrollContainer/Container/Ends" unique_id=1648518427]
layout_mode = 2
text = "Ends on:"
[node name="DaysEdit" type="SpinBox" parent="margin/VBoxContainer/ScrollContainer/Container/Ends" unique_id=1346908939]
layout_mode = 2
size_flags_horizontal = 3
max_value = 364.0
prefix = "day "
[node name="YearsEdit" type="SpinBox" parent="margin/VBoxContainer/ScrollContainer/Container/Ends" unique_id=467960707]
layout_mode = 2
size_flags_horizontal = 3
min_value = 1970.0
max_value = 1000000.0
value = 1970.0
allow_greater = true
prefix = "year"
[node name="Label2" type="Label" parent="margin/VBoxContainer/ScrollContainer/Container" unique_id=9299148]
layout_mode = 2
text = "keep all at 0 for an infinite ban."
label_settings = SubResource("LabelSettings_827p1")
[node name="DeleteCheck" type="CheckBox" parent="margin/VBoxContainer/ScrollContainer/Container" unique_id=1640369628]
layout_mode = 2
text = "Do you want to delete this punishment?"
[node name="DeleteButton" type="Button" parent="margin/VBoxContainer/ScrollContainer/Container" unique_id=150626956]
layout_mode = 2
size_flags_horizontal = 0
text = "Delete"
alignment = 0
[node name="Done" type="Button" parent="margin/VBoxContainer" unique_id=1829409858]
layout_mode = 2
text = "Done"
+18
View File
@@ -0,0 +1,18 @@
class_name MoreOptionsWindow extends Window
@export var dupe_clear_button: Button
@export var save_v_1_button: Button
signal remove_dupes
signal save_v_one
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
save_v_1_button.pressed.connect(save_v_one.emit)
dupe_clear_button.pressed.connect(remove_dupes.emit)
close_requested.connect(close)
func close():
hide()
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
@@ -0,0 +1 @@
uid://cgr5yq35l0u65
+91
View File
@@ -0,0 +1,91 @@
[gd_scene format=3 uid="uid://gah2g6nabyf4"]
[ext_resource type="Script" uid="uid://dwc8m0l6he4uo" path="res://scenes/windwos/StatisticsWindow.gd" id="1_nsh46"]
[ext_resource type="PackedScene" uid="uid://bv4mvou68l2sk" path="res://scenes/windwos/altshowcse.tscn" id="2_5eyo7"]
[node name="Statistics" type="Window" unique_id=1932979201 node_paths=PackedStringArray("total", "alts", "unique", "best", "altshowcse_container")]
oversampling_override = 1.0
initial_position = 4
size = Vector2i(536, 390)
visible = false
force_native = true
script = ExtResource("1_nsh46")
total = NodePath("MarginContainer/TabContainer/Stats/VBoxContainer/Total")
alts = NodePath("MarginContainer/TabContainer/Stats/VBoxContainer/alts")
unique = NodePath("MarginContainer/TabContainer/Stats/VBoxContainer/Unique")
best = NodePath("MarginContainer/TabContainer/Stats/VBoxContainer/best")
altshowcse = ExtResource("2_5eyo7")
altshowcse_container = NodePath("MarginContainer/TabContainer/Leaderboard/ScrollContainer/Container")
[node name="ColorRect" type="ColorRect" parent="." unique_id=121481691]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3
size_flags_vertical = 3
color = Color(0.28358635, 0.30315065, 0.06554975, 1)
[node name="MarginContainer" type="MarginContainer" parent="." unique_id=21771767]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3
size_flags_vertical = 3
theme_override_constants/margin_left = 5
theme_override_constants/margin_top = 5
theme_override_constants/margin_right = 5
theme_override_constants/margin_bottom = 5
[node name="TabContainer" type="TabContainer" parent="MarginContainer" unique_id=870918671]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
current_tab = 1
[node name="Stats" type="Control" parent="MarginContainer/TabContainer" unique_id=1161969781]
visible = false
layout_mode = 2
metadata/_tab_index = 0
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/TabContainer/Stats" unique_id=1730227224]
layout_mode = 0
offset_right = 40.0
offset_bottom = 40.0
[node name="Total" type="Label" parent="MarginContainer/TabContainer/Stats/VBoxContainer" unique_id=1786141427]
layout_mode = 2
text = "Total punishments:"
[node name="alts" type="Label" parent="MarginContainer/TabContainer/Stats/VBoxContainer" unique_id=874615516]
layout_mode = 2
text = "thereof alts:"
[node name="Unique" type="Label" parent="MarginContainer/TabContainer/Stats/VBoxContainer" unique_id=44141892]
layout_mode = 2
text = "unique entires:"
[node name="best" type="Label" parent="MarginContainer/TabContainer/Stats/VBoxContainer" unique_id=1010711371]
layout_mode = 2
text = "Best evader(most alts):"
[node name="Leaderboard" type="Control" parent="MarginContainer/TabContainer" unique_id=166474110]
layout_mode = 2
metadata/_tab_index = 1
[node name="ScrollContainer" type="ScrollContainer" parent="MarginContainer/TabContainer/Leaderboard" unique_id=1207491017]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="Container" type="VBoxContainer" parent="MarginContainer/TabContainer/Leaderboard/ScrollContainer" unique_id=1822273302]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
alignment = 2