Move sprite warning to place where it can identify which file the warning applies to. (#54)

This commit is contained in:
CaitSith2 2020-03-28 10:43:02 -07:00 committed by GitHub
parent 470b764ac8
commit e9669a59c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -120,6 +120,8 @@ def main():
if path:
try:
settings = settings_cache[path] if settings_cache[path] else roll_settings(weights_cache[path])
if settings.sprite is not None and not os.path.isfile(settings.sprite) and not get_sprite_from_name(settings.sprite):
logging.warning(f"Warning: The chosen sprite, \"{settings.sprite}\", for yaml \"{path}\", does not exist.")
for k, v in vars(settings).items():
if v is not None:
getattr(erargs, k)[player] = v
@ -283,8 +285,6 @@ def roll_settings(weights):
if 'rom' in weights:
romweights = weights['rom']
ret.sprite = get_choice('sprite', romweights)
if ret.sprite is not None and not os.path.isfile(ret.sprite) and not get_sprite_from_name(ret.sprite):
logging.Logger('').warning(f"Warning: The chosen sprite, \"{ret.sprite}\" does not exist.")
ret.disablemusic = get_choice('disablemusic', romweights)
ret.extendedmsu = get_choice('extendedmsu', romweights)
ret.quickswap = get_choice('quickswap', romweights)