diff --git a/src/split_parser.py b/src/split_parser.py index a3404694..3f3a740b 100644 --- a/src/split_parser.py +++ b/src/split_parser.py @@ -183,15 +183,15 @@ def parse_and_validate_images(autosplit: AutoSplit): ] # Find non-split images and then remove them from the list - autosplit.start_image = __pop_image_type(all_images, ImageType.START) - autosplit.reset_image = __pop_image_type(all_images, ImageType.RESET) - autosplit.split_images = all_images + start_image = __pop_image_type(all_images, ImageType.START) + reset_image = __pop_image_type(all_images, ImageType.RESET) + split_images = all_images error_message: Callable[[], object] | None = None # If there is no start hotkey set but a start image is present, and is not auto controlled, throw an error. if ( - autosplit.start_image + start_image and not autosplit.settings_dict["split_hotkey"] and not autosplit.is_auto_controlled ): @@ -199,7 +199,7 @@ def parse_and_validate_images(autosplit: AutoSplit): # If there is no reset hotkey set but a reset image is present, and is not auto controlled, throw an error. elif ( - autosplit.reset_image + reset_image and not autosplit.settings_dict["reset_hotkey"] and not autosplit.is_auto_controlled ): @@ -208,7 +208,7 @@ def parse_and_validate_images(autosplit: AutoSplit): # Make sure that each of the images follows the guidelines for correct format # according to all of the settings selected by the user. else: - for image in autosplit.split_images: + for image in split_images: # Test for image without transparency if not is_valid_image(image.byte_array): def image_validity(filename: str): @@ -236,8 +236,14 @@ def image_validity(filename: str): break if error_message: + autosplit.start_image = None + autosplit.reset_image = None + autosplit.split_images = [] autosplit.gui_changes_on_reset() error_message() return False + autosplit.start_image = start_image + autosplit.reset_image = reset_image + autosplit.split_images = split_images return True