From 222d9b940d3d60cd00f6458f979d33313f23b26e Mon Sep 17 00:00:00 2001 From: bucket Date: Sun, 8 Mar 2026 15:17:20 +0100 Subject: [PATCH] fixed list markers not being added i forgor --- README.md | 2 +- ban_list_exporter.gd | 4 ++++ main.gd | 7 +++++-- scenes/Main.tscn | 2 ++ 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9116e6c..585bd68 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ # TFVR Ban List Editor Requirements: -- [Godot 4.7 Indev2](https://godotengine.org/download/archive/4.7-dev2/) +- [Godot 4.7 dev2](https://godotengine.org/download/archive/4.7-dev2/) diff --git a/ban_list_exporter.gd b/ban_list_exporter.gd index 235e80f..aaee84c 100644 --- a/ban_list_exporter.gd +++ b/ban_list_exporter.gd @@ -6,6 +6,7 @@ func Export(Punishments:Array[Punishment],file:String) -> void: push_error("!fileaccess is true") return var content:String = "" + content += "L!ListBegin\n" for punishment in Punishments: if !punishment.username: continue @@ -15,6 +16,7 @@ func Export(Punishments:Array[Punishment],file:String) -> void: punishment.punishment_types.MUTE else "BAN") + "\n" content += "REASON: " + punishment.punish_reason + "\n" content += "END_DATE: " + str(punishment.punish_end) + "\n" + content += "L!ListEnd\n" fileaccess.store_string(content) @@ -24,9 +26,11 @@ func Exportv1(Punishments:Array[Punishment],file:String) -> void: push_error("!fileaccess is true") return var content:String = "" + content += "L!ListBegin\n" for punishment in Punishments: if !punishment.username: continue content += "NAME: " + punishment.username + "\n" content += "UID: " + punishment.uid + "\n" + content += "L!ListEnd\n" fileaccess.store_string(content) diff --git a/main.gd b/main.gd index 230ccb2..ff8bef3 100644 --- a/main.gd +++ b/main.gd @@ -152,8 +152,9 @@ func add_punishments(file:String): func clear_children(): save_label.hide() for child in PunishContainer.get_children(): + print("kill ",child) child.queue_free() - update_ban_counter() + update_ban_counter.call_deferred() func edit_called(on:PunishShowcase,set_time:bool = false): save_label.show() @@ -166,10 +167,12 @@ func edit_called(on:PunishShowcase,set_time:bool = false): update_ban_counter() func set_file(path:String): + clear_children() + print("buh") current_path = path file_label.text = path - clear_children() add_punishments(path) + update_ban_counter.call_deferred() func close_request(): if !unsaved: diff --git a/scenes/Main.tscn b/scenes/Main.tscn index 4e99d21..8984f11 100644 --- a/scenes/Main.tscn +++ b/scenes/Main.tscn @@ -136,6 +136,8 @@ spread = 180.0 initial_velocity_min = 0.8 initial_velocity_max = 74.87 +[node name="ignore that up there" type="Node" parent="MarginContainer/VBoxContainer/HBoxContainer/BanCounter" unique_id=661846832] + [node name="Punish" type="Button" parent="MarginContainer/VBoxContainer/HBoxContainer" unique_id=100050923] layout_mode = 2 size_flags_horizontal = 8