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 0000000..e124b30 Binary files /dev/null and b/Textures/Warn.png differ 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