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
+244
View File
@@ -0,0 +1,244 @@
[gd_scene format=3 uid="uid://cxf3yenlgvupj"]
[ext_resource type="Script" uid="uid://c57yqopmolu8o" path="res://main.gd" id="1_bjd11"]
[ext_resource type="PackedScene" uid="uid://bxpr2nb1hydpi" path="res://scenes/punish_showcase.tscn" id="2_qmy6f"]
[ext_resource type="Texture2D" uid="uid://o2sjogt3b0ht" path="res://tf2logo.png" id="3_mwfav"]
[ext_resource type="Texture2D" uid="uid://dppihj7ptidog" path="res://Plus.png" id="4_3p2gp"]
[ext_resource type="Texture2D" uid="uid://c7r26dxgqkklc" path="res://Minus.png" id="5_cvmbd"]
[ext_resource type="Script" uid="uid://c5ihhdkosauvw" path="res://punish_list_parser.gd" id="6_ft6cd"]
[ext_resource type="Script" uid="uid://caaljvxo8tja5" path="res://ban_list_exporter.gd" id="7_bb450"]
[ext_resource type="PackedScene" uid="uid://dy18m2uq557to" path="res://scenes/windwos/edit_window.tscn" id="8_nfivy"]
[ext_resource type="PackedScene" uid="uid://burukk5374yyu" path="res://scenes/windwos/MoreOptionsWindow.tscn" id="9_1nqs0"]
[ext_resource type="PackedScene" uid="uid://gah2g6nabyf4" path="res://scenes/windwos/statistics.tscn" id="10_1iba3"]
[ext_resource type="Script" uid="uid://bt5wd8qjaevk0" path="res://search.gd" id="11_yxlcp"]
[ext_resource type="Script" uid="uid://3gmapu83dglo" path="res://save_file_parser.gd" id="12_ebg2g"]
[sub_resource type="LabelSettings" id="LabelSettings_lgr22"]
font_size = 26
outline_size = 11
outline_color = Color(0, 0, 0, 1)
shadow_size = 11
shadow_color = Color(0, 0, 0, 0.3254902)
shadow_offset = Vector2(12.105, 8.315)
stacked_outline_count = 3
stacked_outline_0/size = 4
stacked_outline_0/color = Color(1, 0, 0, 1)
stacked_outline_1/size = 4
stacked_outline_1/color = Color(0.8099345, 0.9946762, 7.70092e-07, 1)
stacked_outline_2/size = 4
stacked_outline_2/color = Color(0.32855865, 0.41260794, 1, 1)
[node name="Control" type="Control" unique_id=2276929 node_paths=PackedStringArray("edit_window", "punish_list_parser", "PunishContainer", "new_punish_btn", "file_opener", "open_btn", "new_btn", "save_btn", "exporter", "file_label", "save_file_parser", "quit_confirmation", "ban_counter", "save_label", "plus", "minus", "more_btn", "options_window")]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_bjd11")
edit_window = NodePath("EditWindow")
punish_list_parser = NodePath("BanListParser")
PunishContainer = NodePath("MarginContainer/VBoxContainer/ScrollContainer/Tree")
punish_scene = ExtResource("2_qmy6f")
new_punish_btn = NodePath("MarginContainer/VBoxContainer/HBoxContainer/Punish")
file_opener = NodePath("OpenFile")
open_btn = NodePath("MarginContainer/VBoxContainer/HBoxContainer2/OpenFileBtn")
new_btn = NodePath("MarginContainer/VBoxContainer/HBoxContainer/Punish")
save_btn = NodePath("MarginContainer/VBoxContainer/HBoxContainer2/SaveBtn")
exporter = NodePath("BanListExporter")
file_label = NodePath("MarginContainer/VBoxContainer/HBoxContainer2/CurrentFile")
save_file_parser = NodePath("SaveFileParser")
quit_confirmation = NodePath("ConfirmationDialog")
ban_counter = NodePath("MarginContainer/VBoxContainer/HBoxContainer/BanCounter")
save_label = NodePath("MarginContainer/VBoxContainer/HBoxContainer2/SaveLabel")
plus = NodePath("MarginContainer/VBoxContainer/HBoxContainer/BanCounter/Plus")
minus = NodePath("MarginContainer/VBoxContainer/HBoxContainer/BanCounter/Minus")
more_btn = NodePath("MarginContainer/VBoxContainer/HBoxContainer/More")
options_window = NodePath("OptionsWindow")
[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
texture = ExtResource("3_mwfav")
expand_mode = 5
stretch_mode = 5
[node name="ColorRect" type="ColorRect" parent="." unique_id=1789999219]
z_index = -2
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
color = Color(0.32993424, 0.25434008, 0.17645565, 1)
[node name="MarginContainer" type="MarginContainer" parent="." unique_id=1863119132]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
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="MarginContainer" unique_id=1186401858]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="HBoxContainer" type="FlowContainer" parent="MarginContainer/VBoxContainer" unique_id=550324332]
layout_mode = 2
[node name="Label" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer" unique_id=388690639]
layout_mode = 2
size_flags_horizontal = 3
text = "TFVR punishlist maker 2000™"
label_settings = SubResource("LabelSettings_lgr22")
[node name="BanCounter" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer" unique_id=589605427]
layout_mode = 2
text = "Unique Bans: "
[node name="Plus" type="CPUParticles2D" parent="MarginContainer/VBoxContainer/HBoxContainer/BanCounter" unique_id=93983186]
position = Vector2(76, 8)
emitting = false
texture = ExtResource("4_3p2gp")
lifetime = 3.9
one_shot = true
explosiveness = 1.0
emission_shape = 1
emission_sphere_radius = 7.85
spread = 180.0
initial_velocity_min = 0.8
initial_velocity_max = 74.87
[node name="Minus" type="CPUParticles2D" parent="MarginContainer/VBoxContainer/HBoxContainer/BanCounter" unique_id=2092945034]
position = Vector2(76, 8)
emitting = false
amount = 3
texture = ExtResource("5_cvmbd")
lifetime = 3.9
one_shot = true
explosiveness = 1.0
emission_shape = 1
emission_sphere_radius = 7.85
spread = 180.0
initial_velocity_min = 0.8
initial_velocity_max = 74.87
[node name="Punish" type="Button" parent="MarginContainer/VBoxContainer/HBoxContainer" unique_id=100050923]
layout_mode = 2
size_flags_horizontal = 8
text = "new punishment"
[node name="Stats" type="Button" parent="MarginContainer/VBoxContainer/HBoxContainer" unique_id=1256562107]
layout_mode = 2
size_flags_horizontal = 8
text = "Stats"
[node name="More" type="Button" parent="MarginContainer/VBoxContainer/HBoxContainer" unique_id=804757173]
layout_mode = 2
size_flags_horizontal = 8
text = "More"
[node name="SearchBar" type="LineEdit" parent="MarginContainer/VBoxContainer" unique_id=2022677611]
layout_mode = 2
placeholder_text = "Search..."
[node name="HSeparator" type="HSeparator" parent="MarginContainer/VBoxContainer" unique_id=1970903622]
layout_mode = 2
[node name="ScrollContainer" type="ScrollContainer" parent="MarginContainer/VBoxContainer" unique_id=1423908622]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="Tree" type="VBoxContainer" parent="MarginContainer/VBoxContainer/ScrollContainer" unique_id=200799914]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="HSeparator2" type="HSeparator" parent="MarginContainer/VBoxContainer" unique_id=1677426181]
layout_mode = 2
[node name="HBoxContainer2" type="FlowContainer" parent="MarginContainer/VBoxContainer" unique_id=1760266968]
layout_mode = 2
alignment = 2
last_wrap_alignment = 2
[node name="OpenFileBtn" type="Button" parent="MarginContainer/VBoxContainer/HBoxContainer2" unique_id=1707347790]
layout_mode = 2
text = "Open file"
[node name="CurrentFile" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer2" unique_id=1158273656]
layout_mode = 2
size_flags_horizontal = 3
text = "no file selected"
clip_text = true
text_overrun_behavior = 1
[node name="SaveLabel" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer2" unique_id=1042352785]
visible = false
layout_mode = 2
text = "*"
[node name="SaveBtn" type="Button" parent="MarginContainer/VBoxContainer/HBoxContainer2" unique_id=1041770707]
layout_mode = 2
text = "Save changes"
[node name="BanListParser" type="Node" parent="." unique_id=951623750]
script = ExtResource("6_ft6cd")
[node name="BanListExporter" type="Node" parent="." unique_id=1531169139]
script = ExtResource("7_bb450")
[node name="EditWindow" parent="." unique_id=211137631 instance=ExtResource("8_nfivy")]
[node name="OptionsWindow" parent="." unique_id=1485451151 instance=ExtResource("9_1nqs0")]
initial_position = 4
[node name="Statistics" parent="." unique_id=1932979201 node_paths=PackedStringArray("root", "PunishContainer", "search_bar") instance=ExtResource("10_1iba3")]
root = NodePath("..")
PunishContainer = NodePath("../MarginContainer/VBoxContainer/ScrollContainer/Tree")
search_bar = NodePath("../MarginContainer/VBoxContainer/SearchBar")
[node name="Search" type="Node" parent="." unique_id=170590161 node_paths=PackedStringArray("search_bar", "punish_container")]
script = ExtResource("11_yxlcp")
search_bar = NodePath("../MarginContainer/VBoxContainer/SearchBar")
punish_container = NodePath("../MarginContainer/VBoxContainer/ScrollContainer/Tree")
[node name="OpenFile" type="FileDialog" parent="." unique_id=1378168421]
oversampling_override = 1.0
title = "Open a File"
size = Vector2i(807, 360)
file_mode = 0
access = 2
filters = PackedStringArray("*.txt", "*.dat")
use_native_dialog = true
[node name="SaveFileParser" type="Node" parent="." unique_id=930223611]
script = ExtResource("12_ebg2g")
[node name="ConfirmationDialog" type="ConfirmationDialog" parent="." unique_id=416398003]
oversampling_override = 1.0
initial_position = 4
size = Vector2i(305, 100)
always_on_top = true
force_native = true
ok_button_text = "Save and quit"
dialog_text = "You have unsaved changes!"
cancel_button_text = "Quit without saving"
[connection signal="pressed" from="MarginContainer/VBoxContainer/HBoxContainer/Stats" to="Statistics" method="grab_focus"]
[connection signal="pressed" from="MarginContainer/VBoxContainer/HBoxContainer/Stats" to="Statistics" method="show"]
[connection signal="pressed" from="MarginContainer/VBoxContainer/HBoxContainer/More" to="OptionsWindow" method="grab_focus"]
+26
View File
@@ -0,0 +1,26 @@
class_name PunishShowcase extends Control
@onready var name_label: Label = $Container/VBoxContainer/Name
@onready var uid_label: Label = $Container/VBoxContainer/UID
@onready var edit_button: Button = $Container/Edit
@onready var punishment_type_display: TextureRect = $Container/PunishmentTypeDisplay
@onready var container: FlowContainer = $Container
@export var punishment:Punishment
signal Edit(showcase:PunishShowcase)
func _ready() -> void:
edit_button.pressed.connect(edit)
if !punishment:
punishment = Punishment.new()
func update() -> void:
name_label.text = punishment.username
uid_label.text = punishment.uid
punishment_type_display.texture = load("res://door.png") if \
punishment.what_punishment == punishment.punishment_types.BAN else load("res://speaker.png")
func edit():
Edit.emit(self)
func _process(delta: float) -> void:
custom_minimum_size.y = container.size.y
+1
View File
@@ -0,0 +1 @@
uid://dxlkscqs0wpo6
+71
View File
@@ -0,0 +1,71 @@
[gd_scene format=3 uid="uid://bxpr2nb1hydpi"]
[ext_resource type="Script" uid="uid://dxlkscqs0wpo6" path="res://scenes/punish_showcase.gd" id="1_3wpqj"]
[ext_resource type="Script" uid="uid://cafyno407e2uq" path="res://Punishment.gd" id="2_j4kex"]
[ext_resource type="Texture2D" uid="uid://cinbmowbp2btd" path="res://door.png" id="3_lw8i6"]
[sub_resource type="Resource" id="Resource_j4kex"]
script = ExtResource("2_j4kex")
metadata/_custom_type_script = "uid://cafyno407e2uq"
[sub_resource type="LabelSettings" id="LabelSettings_lw8i6"]
font_size = 20
outline_color = Color(0, 0, 0, 1)
shadow_size = 8
shadow_color = Color(0, 0, 0, 0.54509807)
shadow_offset = Vector2(1.31, 1.925)
[sub_resource type="LabelSettings" id="LabelSettings_j4kex"]
font_color = Color(0.68307734, 0.6830774, 0.68307734, 1)
[node name="PunishShowcase" type="Control" unique_id=1878310580]
custom_minimum_size = Vector2(0, 59)
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_right = -717.0
offset_bottom = -589.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_3wpqj")
punishment = SubResource("Resource_j4kex")
[node name="ColorRect" type="ColorRect" parent="." unique_id=1592063175]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
color = Color(0.2509804, 0.2509804, 0.2509804, 0.4862745)
[node name="Container" type="FlowContainer" parent="." unique_id=818336029]
layout_mode = 1
anchors_preset = -1
anchor_right = 1.0
offset_bottom = 55.0
grow_horizontal = 2
[node name="VBoxContainer" type="VBoxContainer" parent="Container" unique_id=2062889465]
layout_mode = 2
size_flags_horizontal = 3
[node name="Name" type="Label" parent="Container/VBoxContainer" unique_id=1768649764]
layout_mode = 2
text = "NAME"
label_settings = SubResource("LabelSettings_lw8i6")
[node name="UID" type="Label" parent="Container/VBoxContainer" unique_id=323779410]
layout_mode = 2
text = "UID"
label_settings = SubResource("LabelSettings_j4kex")
[node name="PunishmentTypeDisplay" type="TextureRect" parent="Container" unique_id=1037680772]
layout_mode = 2
texture = ExtResource("3_lw8i6")
expand_mode = 2
[node name="Edit" type="Button" parent="Container" unique_id=31447788]
layout_mode = 2
text = "More / Edit"
+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