Skip to content

Commit

Permalink
Settings: Interpret "compress_rom" setting when initializing settings.
Browse files Browse the repository at this point in the history
If "compress_rom" is in the source dictionary when initializing Settings, it will set "create_patch_file", "create_compressed_rom", and "create_uncompressed_rom" based off of its value. This allows CLI users to continue using the old setting to get a singular output.
  • Loading branch information
Cuphat committed Mar 5, 2022
1 parent 58477a7 commit 9076069
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions Settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,12 @@ def resolve_random_settings(self, cosmetic, randomize_key=None):

# add the settings as fields, and calculate information based on them
def __init__(self, settings_dict, strict=False):
if settings_dict.get('compress_rom', None):
# Old compress_rom setting is set, so set the individual output settings using it.
settings_dict['create_patch_file'] = settings_dict['compress_rom'] == 'Patch' or settings_dict.get('create_patch_file', False)
settings_dict['create_compressed_rom'] = settings_dict['compress_rom'] == 'True' or settings_dict.get('create_compressed_rom', False)
settings_dict['create_uncompressed_rom'] = settings_dict['compress_rom'] == 'False' or settings_dict.get('create_uncompressed_rom', False)
del settings_dict['compress_rom']
if strict:
validate_settings(settings_dict)
self.__dict__.update(settings_dict)
Expand Down
2 changes: 1 addition & 1 deletion version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '6.2.42 f.LUM'
__version__ = '6.2.43 f.LUM'

0 comments on commit 9076069

Please sign in to comment.