Skip to content

Commit

Permalink
Fix champ name and prevent comp_editor changing line terminators
Browse files Browse the repository at this point in the history
  • Loading branch information
anthony5301 authored Nov 26, 2023
1 parent fce32d1 commit e19538e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions comp_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {")
Expand Down Expand Up @@ -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)


Expand Down
4 changes: 2 additions & 2 deletions game_assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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":""},
Expand Down

0 comments on commit e19538e

Please sign in to comment.