From 3e2d6dd24dc6c49d0d74d11090a6c825bc42f55d Mon Sep 17 00:00:00 2001 From: bucket Date: Tue, 14 Apr 2026 20:34:25 +0200 Subject: [PATCH] Remove legacy bansystem and add WARN punish type --- BanListEditor.csproj | 2 +- Scripts/Gdscript/Punishment.gd | 2 +- Scripts/Gdscript/ban_list_exporter.gd | 13 ++++++-- Scripts/Gdscript/main.gd | 7 +---- Scripts/Gdscript/punish_list_parser.gd | 2 ++ Scripts/Gdscript/save_file_parser.gd | 1 - Textures/Warn.png | Bin 0 -> 4862 bytes Textures/Warn.png.import | 40 +++++++++++++++++++++++++ scenes/punish_showcase.gd | 5 ++-- scenes/windwos/MoreOptionsWindow.tscn | 13 +------- scenes/windwos/more_options_window.gd | 1 - 11 files changed, 60 insertions(+), 26 deletions(-) create mode 100644 Textures/Warn.png create mode 100644 Textures/Warn.png.import diff --git a/BanListEditor.csproj b/BanListEditor.csproj index 7713d28..12a11d3 100644 --- a/BanListEditor.csproj +++ b/BanListEditor.csproj @@ -1,4 +1,4 @@ - + net8.0 net9.0 diff --git a/Scripts/Gdscript/Punishment.gd b/Scripts/Gdscript/Punishment.gd index 504db74..740ebe9 100644 --- a/Scripts/Gdscript/Punishment.gd +++ b/Scripts/Gdscript/Punishment.gd @@ -7,4 +7,4 @@ class_name Punishment extends Resource ## in unix time, zero means forever @export var punish_end:int -enum punishment_types{BAN,MUTE} +enum punishment_types{BAN,MUTE,WARN} diff --git a/Scripts/Gdscript/ban_list_exporter.gd b/Scripts/Gdscript/ban_list_exporter.gd index aaee84c..27115fd 100644 --- a/Scripts/Gdscript/ban_list_exporter.gd +++ b/Scripts/Gdscript/ban_list_exporter.gd @@ -12,14 +12,23 @@ func Export(Punishments:Array[Punishment],file:String) -> void: continue content += "NAME: " + punishment.username + "\n" content += "UID: " + punishment.uid + "\n" - content += "PUNISHMENT: " + ("MUTE" if punishment.what_punishment == - punishment.punishment_types.MUTE else "BAN") + "\n" + content += "PUNISHMENT: " + (get_punish_type(punishment)) + "\n" content += "REASON: " + punishment.punish_reason + "\n" content += "END_DATE: " + str(punishment.punish_end) + "\n" content += "L!ListEnd\n" fileaccess.store_string(content) +func get_punish_type(punishment:Punishment): + match punishment.what_punishment: + Punishment.punishment_types.BAN: + return "BAN" + Punishment.punishment_types.MUTE: + return "MUTE" + Punishment.punishment_types.WARN: + return "WARN" + +# DEPRECATED func Exportv1(Punishments:Array[Punishment],file:String) -> void: var fileaccess:FileAccess = FileAccess.open(file,FileAccess.WRITE) if !fileaccess: diff --git a/Scripts/Gdscript/main.gd b/Scripts/Gdscript/main.gd index 1a2e430..7cf09d2 100644 --- a/Scripts/Gdscript/main.gd +++ b/Scripts/Gdscript/main.gd @@ -39,13 +39,11 @@ func _ready() -> void: options_window.email_edit.text = save_file.get("EMAIL","") options_window.name_edit.text = save_file.get("NAME","") options_window.key_edit.text = save_file.get("KEY","") - options_window.use_old.button_pressed = save_file.get("USE_OLD",false) options_window.repo_edit.text_changed.connect(unsave.unbind(1)) options_window.email_edit.text_changed.connect(unsave.unbind(1)) options_window.name_edit.text_changed.connect(unsave.unbind(1)) options_window.key_edit.text_changed.connect(unsave.unbind(1)) - options_window.use_old.pressed.connect(unsave) if options_window.repo_edit.text: if git.has_method("Clone"): git.Clone() @@ -136,10 +134,7 @@ func save(): Punishments.append(child.punishment) update_ban_counter() save_file_parser.save() - if options_window.use_old.button_pressed: - exporter.Exportv1(Punishments,current_path) - else: - exporter.Export(Punishments,current_path) + exporter.Export(Punishments,current_path) unsaved = false git.Commit_changes() diff --git a/Scripts/Gdscript/punish_list_parser.gd b/Scripts/Gdscript/punish_list_parser.gd index 300ea8b..f6c4d85 100644 --- a/Scripts/Gdscript/punish_list_parser.gd +++ b/Scripts/Gdscript/punish_list_parser.gd @@ -46,4 +46,6 @@ func punish_text_to_enum(text) -> Punishment.punishment_types: punish = Punishment.punishment_types.BAN "MUTE": punish = Punishment.punishment_types.MUTE + "WARN": + punish = Punishment.punishment_types.WARN return punish diff --git a/Scripts/Gdscript/save_file_parser.gd b/Scripts/Gdscript/save_file_parser.gd index 18ac991..e21a4c1 100644 --- a/Scripts/Gdscript/save_file_parser.gd +++ b/Scripts/Gdscript/save_file_parser.gd @@ -21,6 +21,5 @@ func save() -> void: "EMAIL":options_window.email_edit.text, "NAME":options_window.name_edit.text, "KEY":options_window.key_edit.text, - "USE_OLD":options_window.use_old.button_pressed, } file.store_var(Dict) diff --git a/Textures/Warn.png b/Textures/Warn.png new file mode 100644 index 0000000000000000000000000000000000000000..e124b30dc9d72e4355c5806f1a5a7e3026f44d81 GIT binary patch literal 4862 zcmb_gc{tQ<+y0Hg$TICx*&fCoDN&XfDj5}pAK60jD1)(#otS!<_h~%!HWFn|rN&we z4OvR*p<+tLzC{@{$TB1AcTak@_j~{Oj^lG2bC};f_gwdKo#%O-*Zg|Y>ZpY14p9h# zBybjoZ6F9S%YTUogOS&){wv@gBG~4r8KSdsS1foC^fomv38FX2YDIVmGazV_9qzEHU3eF#x7y#OJ3@GXrz5Sj!RAT8Pocu%f>)mH^NgGp z_@b<49cZvO>{-s_rQ;!2Yz^WG^0{L28b5iA?%TdKVPjo_yQ-b0 zGEp7OlW7LzrTLi&I(LC<2^RnR-+;Z^vsQdzwZ&t@_vp+Q4>@9v1ig5U+WmSqM-4!GHuKz0>P?3IIDZU zkmL2#b|S58zKcS_c*FFQW)Mk>xyY@;#MTV;5U5M9uf#5v(~MPrl4ovY#~2=)o+xs> zOf#@mz-B9gc_SXPS;gCzowq?EL{js<^r8d%i)oBa2m#k@9lzD&;n;}-JThjr@?-y) zDr9`ePeN}*MWcCnUt_<~$2-$J4Xf2CYAo1l^h-v(KT_LlzZrRS@dUL>OZj3}Td#Rcw;_;YTLaa;RL<^&;a1U-pr_r^L5?eVk(&i*m>E0wGMUm?bUQxL=Pgwnu zIaB*|81j?$rQ zWMa#+0HYgNZ^h$`zs-b5Xh=XNPR^$=CQnp^7`MVvM+nG38`%6X{15*#^p7zx;m2|T zL$54L=*>y#G1FnI{~pc@d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zAhv``ky2lJyb`P0mnMDSCA(Oc(O z+*;`sZ}_7agR1_cgPD7zFJ}A5BB*kfYf3%jg(#1I>zH~M*!{*|EsdHkz;ACL7XC|I z?I3SPU&*J>2W&UFH_hhg;9&aiA%sZkT{_nap15~Hf-eJWZ4EdBmbdH5Ip}Q z9cd`ZJy^2*{Y^q2D7~M9W8L83ei@+5vxC2J_od1LfKUI zt!w0BJMN+}^%|#^Jk)@4)B1a7`~UIYUR@~;l$3f5S)=dM`O9*BS=6Pk&2pbaw`DaJZjvlZ_|48=Dh!XMKcD{S#>ExYx2pmS9 zTot3nTdYpzA1!4ZUh?H0_3za$YiaISGGYUJ)=Q-^b1xLV{SU+ay{{a&4RqQL&uKkc z*>!Fws5d`pbRjb1zI%;-z^fq0ThR%x0|VI2P99zdWnTTyIsC+|wXJ+u{@J$j#{izR zt;(&1YCfDD1rN-JGql@k$VAG23o(@AClUTH0@X#LcrFV#I)f0H&;22<{|(?e&kWXj z$3gTzRwX{mb@Pa-ZsE*yrbO5SP-iPT!1Q8qZHe!FLcN3GZx3C8>*%NXC^LalK_xHl z9OytV%Jz%$ZONbgyZg=?o3teh=@d+q`d3xSTGGbvZ9V^B(FfPxB(1zjdde6|e>Hju z?D6Z*;gZI2SnnG(C#FB@#ID9r+nbO;qOfrFa!-E+t1lm~o8*)Ya2l j+3-Dr^#2{s?)gh{4_C0{e1H35{QtPU5MxnKGp(Wg=r literal 0 HcmV?d00001 diff --git a/Textures/Warn.png.import b/Textures/Warn.png.import new file mode 100644 index 0000000..51c657e --- /dev/null +++ b/Textures/Warn.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://w0utose3h2f0" +path="res://.godot/imported/Warn.png-629b03348efcc9976444b6856186645d.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Textures/Warn.png" +dest_files=["res://.godot/imported/Warn.png-629b03348efcc9976444b6856186645d.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 diff --git a/scenes/punish_showcase.gd b/scenes/punish_showcase.gd index a0fd1c4..81f1e70 100644 --- a/scenes/punish_showcase.gd +++ b/scenes/punish_showcase.gd @@ -16,8 +16,9 @@ func _ready() -> void: func update() -> void: name_label.text = punishment.username uid_label.text = punishment.uid - punishment_type_display.texture = load("res://Textures/door.png") if \ - punishment.what_punishment == punishment.punishment_types.BAN else load("res://Textures/speaker.png") + punishment_type_display.texture = (load("res://Textures/door.png") if \ + punishment.what_punishment == punishment.punishment_types.BAN else load("res://Textures/speaker.png")) if \ + punishment.what_punishment != punishment.punishment_types.WARN else load("res://Textures/Warn.png") func edit(): Edit.emit(self) diff --git a/scenes/windwos/MoreOptionsWindow.tscn b/scenes/windwos/MoreOptionsWindow.tscn index 340dc86..bdee50c 100644 --- a/scenes/windwos/MoreOptionsWindow.tscn +++ b/scenes/windwos/MoreOptionsWindow.tscn @@ -8,7 +8,7 @@ font_size = 30 [sub_resource type="LabelSettings" id="LabelSettings_gec7h"] outline_color = Color(1, 0.7764706, 0.7764706, 1) -[node name="OptionsWindow" type="Window" unique_id=1485451151 node_paths=PackedStringArray("use_old", "dupe_clear_button", "save_v_1_button", "repo_edit", "email_edit", "name_edit", "key_edit", "clone_repo_button", "clone_log", "reset_repo_button")] +[node name="OptionsWindow" type="Window" unique_id=1485451151 node_paths=PackedStringArray("dupe_clear_button", "save_v_1_button", "repo_edit", "email_edit", "name_edit", "key_edit", "clone_repo_button", "clone_log", "reset_repo_button")] oversampling_override = 1.0 position = Vector2i(0, 36) size = Vector2i(557, 397) @@ -16,7 +16,6 @@ visible = false force_native = true min_size = Vector2i(262, 199) script = ExtResource("1_5xt3b") -use_old = NodePath("MarginContainer/ScrollContainer/BoxContainer/UseOld") dupe_clear_button = NodePath("MarginContainer/ScrollContainer/BoxContainer/DupeClearButton") save_v_1_button = NodePath("MarginContainer/ScrollContainer/BoxContainer/SaveV1Button") repo_edit = NodePath("MarginContainer/ScrollContainer/BoxContainer/Repo/RepoEdit") @@ -61,16 +60,6 @@ layout_mode = 2 size_flags_horizontal = 3 vertical = true -[node name="RichTextLabel3" type="Label" parent="MarginContainer/ScrollContainer/BoxContainer" unique_id=418846341] -layout_mode = 2 -text = "General" -label_settings = SubResource("LabelSettings_5xt3b") - -[node name="UseOld" type="CheckBox" parent="MarginContainer/ScrollContainer/BoxContainer" unique_id=1245550112] -layout_mode = 2 -text = "Save file with OLD ban file structure(NEEDED before TFVR 4.0)" -autowrap_mode = 2 - [node name="RichTextLabel" type="Label" parent="MarginContainer/ScrollContainer/BoxContainer" unique_id=66906023] layout_mode = 2 text = "Utility" diff --git a/scenes/windwos/more_options_window.gd b/scenes/windwos/more_options_window.gd index a5de783..2933fa7 100644 --- a/scenes/windwos/more_options_window.gd +++ b/scenes/windwos/more_options_window.gd @@ -1,6 +1,5 @@ class_name MoreOptionsWindow extends Window -@export var use_old: CheckBox @export var dupe_clear_button: Button @export var save_v_1_button: Button @export var repo_edit: LineEdit