From e9669a59c89898e0eefb0f6c397c6e5fd7895325 Mon Sep 17 00:00:00 2001 From: CaitSith2 Date: Sat, 28 Mar 2020 10:43:02 -0700 Subject: [PATCH] Move sprite warning to place where it can identify which file the warning applies to. (#54) --- Mystery.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Mystery.py b/Mystery.py index ebca4f6e..e165f8f9 100644 --- a/Mystery.py +++ b/Mystery.py @@ -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)