From e19538ebd6e3dc9ccb8ceddbeac4edd31e711ef7 Mon Sep 17 00:00:00 2001 From: Enterly <36875936+anthony5301@users.noreply.github.com> Date: Mon, 27 Nov 2023 01:00:53 +0800 Subject: [PATCH 1/2] Fix champ name and prevent comp_editor changing line terminators --- comp_editor.py | 7 +++++-- game_assets.py | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/comp_editor.py b/comp_editor.py index 5a598fa2..a2eff571 100644 --- a/comp_editor.py +++ b/comp_editor.py @@ -556,7 +556,7 @@ def save_changes(self): current_file_path = os.path.abspath(__file__) comps_file_path = os.path.join(os.path.dirname(current_file_path), "comps.py") - with open(comps_file_path, "r", encoding="utf-8") as file: + with open(comps_file_path, "r", encoding="utf-8", newline='') as file: file_content = file.read() comp_line_start = file_content.find("COMP = {") @@ -592,11 +592,14 @@ def save_changes(self): .replace(" ", " ") .replace("\n ", "") .replace("\n ]", "]") + .replace("\r ", "") + .replace("\r ]", "]") .replace("[ ", "[") + .replace("\r\n",'\n') + file_content[comp_line_end:] ) - with open(comps_file_path, "w", encoding="utf-8") as file: + with open(comps_file_path, "w", encoding="utf-8", newline='') as file: file.write(updated_file_content) diff --git a/game_assets.py b/game_assets.py index 7f6793f7..6be360df 100644 --- a/game_assets.py +++ b/game_assets.py @@ -55,13 +55,13 @@ "Jax":{"Gold":2,"Board Size":1,"Trait1":"Mosher","Trait2":"EDM","Trait3":""}, "Jhin":{"Gold":5,"Board Size":1,"Trait1":"BigShot","Trait2":"Maestro","Trait3":""}, "Jinx":{"Gold":1,"Board Size":1,"Trait1":"Rapidfire","Trait2":"Punk","Trait3":""}, - "Kai'Sa":{"Gold":2,"Board Size":1,"Trait1":"BigShot","Trait2":"K/DA","Trait3":""}, + "KaiSa":{"Gold":2,"Board Size":1,"Trait1":"BigShot","Trait2":"K/DA","Trait3":""}, "Karthus":{"Gold":4,"Board Size":1,"Trait1":"Executioner","Trait2":"Pentakill","Trait3":""}, "Katarina":{"Gold":2,"Board Size":1,"Trait1":"CrowdDiver","Trait2":"Country","Trait3":""}, "Kayle":{"Gold":2,"Board Size":1,"Trait1":"Edgelord","Trait2":"Pentakill","Trait3":""}, "Kayn":{"Gold":5,"Board Size":1,"Trait1":"Edgelord","Trait2":"Wildcard","Trait3":"HEARTSTEEL"}, "Kennen":{"Gold":1,"Board Size":1,"Trait1":"Guardian","Trait2":"Superfan","Trait3":"TrueDamage"}, - "K'Sante":{"Gold":1,"Board Size":1,"Trait1":"Sentinel","Trait2":"HEARTSTEEL","Trait3":""}, + "KSante":{"Gold":1,"Board Size":1,"Trait1":"Sentinel","Trait2":"HEARTSTEEL","Trait3":""}, "Lillia":{"Gold":1,"Board Size":1,"Trait1":"Sentinel","Trait2":"Superfan","Trait3":"K/DA"}, "Lucian":{"Gold":5,"Board Size":1,"Trait1":"Rapidfire","Trait2":"Jazz","Trait3":""}, "Lulu":{"Gold":3,"Board Size":1,"Trait1":"Spellweaver","Trait2":"Hyperpop","Trait3":""}, From 31b32a023bc67fc83a01560ba1ea7829bee931ec Mon Sep 17 00:00:00 2001 From: Enterly <36875936+anthony5301@users.noreply.github.com> Date: Mon, 27 Nov 2023 01:02:00 +0800 Subject: [PATCH 2/2] Fix champ name and prevent comp_editor changing line terminators --- comp_editor.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/comp_editor.py b/comp_editor.py index a2eff571..7fbfd962 100644 --- a/comp_editor.py +++ b/comp_editor.py @@ -592,10 +592,7 @@ def save_changes(self): .replace(" ", " ") .replace("\n ", "") .replace("\n ]", "]") - .replace("\r ", "") - .replace("\r ]", "]") .replace("[ ", "[") - .replace("\r\n",'\n') + file_content[comp_line_end:] )