Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

Commit

Permalink
Rework of English text duplication to fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
NiceneNerd committed Aug 31, 2019
1 parent f33e736 commit 185aa73
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion bcml/data/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version='2.2.1'
version='2.2.2'
52 changes: 26 additions & 26 deletions bcml/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ def generate_logs(tmp_dir: Path, verbose: bool = False, leave_rstb: bool = False
str(tmp_dir / 'logs' / f'newtexts_USen.sarc'),
str(tmp_dir / 'logs' / f'newtexts_EUen.sarc')
)
text_mods['EUen'] = text_mods['USen']
elif 'EUen' in text_mods and 'USen' not in text_mods:
if (tmp_dir / 'logs' / f'texts_EUen.yml').exists():
shutil.copy(
Expand All @@ -397,6 +398,7 @@ def generate_logs(tmp_dir: Path, verbose: bool = False, leave_rstb: bool = False
str(tmp_dir / 'logs' / f'newtexts_EUen.sarc'),
str(tmp_dir / 'logs' / f'newtexts_USen.sarc')
)
text_mods['USen'] = text_mods['USen']
dumper = yaml.CDumper
yaml_util.add_representers(dumper)
aamp.yaml_util.register_representers(dumper)
Expand Down Expand Up @@ -561,6 +563,30 @@ def install_mod(mod: Path, verbose: bool = False, no_packs: bool = False, no_tex
deep_merge = (logs / 'deepmerge.yml').exists()
if not no_texts:
text_mods = texts.get_modded_languages(tmp_dir)
if 'USen' in text_mods and 'EUen' not in text_mods:
if (logs / f'texts_USen.yml').exists():
shutil.copy(
str(logs / 'texts_USen.yml'),
str(logs / 'texts_EUen.yml')
)
if (logs / f'newtexts_USen.sarc').exists():
shutil.copy(
str(logs / 'newtexts_USen.sarc'),
str(logs / 'newtexts_EUen.sarc')
)
text_mods.append('EUen')
elif 'EUen' in text_mods and 'USen' not in text_mods:
if (logs / f'texts_EUen.yml').exists():
shutil.copy(
str(logs / 'texts_EUen.yml'),
str(logs / 'texts_USen.yml')
)
if (logs / f'newtexts_EUen.sarc').exists():
shutil.copy(
str(logs / 'newtexts_EUen.sarc'),
str(logs / 'newtexts_USen.sarc')
)
text_mods.append('USen')
is_text_mod = len(text_mods) > 0 # pylint: disable=len-as-condition
else:
is_text_mod = False
Expand All @@ -582,32 +608,6 @@ def install_mod(mod: Path, verbose: bool = False, no_packs: bool = False, no_tex
deep_merge=deep_merge
)

if is_text_mod:
if 'USen' in text_mods and 'EUen' not in text_mods:
if (tmp_dir / 'logs' / f'texts_USen.yml').exists():
shutil.copy(
str(tmp_dir / 'logs' / f'texts_USen.yml'),
str(tmp_dir / 'logs' / f'texts_EUen.yml')
)
if (tmp_dir / 'logs' / f'newtexts_USen.sarc').exists():
shutil.copy(
str(tmp_dir / 'logs' / f'newtexts_USen.sarc'),
str(tmp_dir / 'logs' / f'newtexts_EUen.sarc')
)
text_mods['EUen'] = None
elif 'EUen' in text_mods and 'USen' not in text_mods:
if (tmp_dir / 'logs' / f'texts_EUen.yml').exists():
shutil.copy(
str(tmp_dir / 'logs' / f'texts_EUen.yml'),
str(tmp_dir / 'logs' / f'texts_USen.yml')
)
if (tmp_dir / 'logs' / f'newtexts_EUen.sarc').exists():
shutil.copy(
str(tmp_dir / 'logs' / f'newtexts_EUen.sarc'),
str(tmp_dir / 'logs' / f'newtexts_USen.sarc')
)
text_mods['USen'] = None

priority = insert_priority
print(f'Assigned mod priority of {priority}')
mod_id = util.get_mod_id(mod_name, priority)
Expand Down
2 changes: 1 addition & 1 deletion installer.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[Application]
name=BCML
version=2.2.1
version=2.2.2
entry_point=bcml.__init__:main
icon=bcml/data/bcml.ico

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name='bcml',
version='2.2.1',
version='2.2.2',
author='NiceneNerd',
author_email='[email protected]',
description='A mod manager for The Legend of Zelda: Breath of the Wild on Cemu',
Expand Down

0 comments on commit 185aa73

Please sign in to comment.