def work(progress_update: ProgressUpdateCallable): num_updaters = 2 if input_file is not None: num_updaters += 1 updaters = status_update_lib.split_progress_update(progress_update, num_updaters) if input_file is not None: simplified_patcher.unpack_iso(input_iso=input_file, options=options, progress_update=updaters[0]) # Apply Layout simplified_patcher.apply_layout(layout=layout, players_config=PlayersConfiguration( player_index=player_index, player_names=player_names, ), options=options, progress_update=updaters[-2]) # Pack ISO simplified_patcher.pack_iso(output_iso=output_file, options=options, progress_update=updaters[-1]) if has_spoiler and auto_save_spoiler: layout.save_to_file(output_file.with_suffix(f".{LayoutDescription.file_extension()}")) progress_update(f"Finished!", 1)
def patch_game_with_existing_layout( progress_update: ProgressUpdateCallable, layout: LayoutDescription, options: Options, ): """ Patches the game with the given layout and exports an ISO :param progress_update: :param layout: :param options: :return: """ _internal_patch_iso( updaters=status_update_lib.split_progress_update(progress_update, 2), layout=layout, options=options, )
def create_layout_then_export_iso( progress_update: ProgressUpdateCallable, options: Options, ) -> LayoutDescription: """ Creates a new layout with the given seed and configured layout, then patches and exports an ISO :param progress_update: :param options: :return: """ updaters = status_update_lib.split_progress_update(progress_update, 3) # Create a LayoutDescription resulting_layout = generate_layout(options=options, progress_update=updaters[0]) _internal_patch_iso( updaters=updaters[1:], layout=resulting_layout, options=options, ) return resulting_layout
def work(progress_update: ProgressUpdateCallable): num_updaters = 2 if input_file is not None: num_updaters += 1 updaters = status_update_lib.split_progress_update( progress_update, num_updaters) if input_file is not None: simplified_patcher.unpack_iso(input_iso=input_file, options=options, progress_update=updaters[0]) # Apply Layout simplified_patcher.apply_layout(layout=layout, options=options, progress_update=updaters[-2]) # Pack ISO simplified_patcher.pack_iso(output_iso=output_file, options=options, progress_update=updaters[-1]) progress_update(f"Finished!", 1)