def bnp_to_gfx(self, params=None): try: bnp = Path(self.file_pick({"multiple": False})[0]) except IndexError: return with util.TempModContext(): install.install_mod( bnp, merge_now=True, options={ "options": { "texts": { "all_langs": True } }, "disable": [] }, ) out = self.window.create_file_dialog( webviewb.SAVE_DIALOG, file_types=( f"{('Graphic Pack' if util.get_settings('wiiu') else 'Atmosphere')} (*.zip)", "BOTW Nano Patch (*.bnp)", ), save_filename=f"{bnp.stem}.zip", ) if out: output = Path(out if isinstance(out, str) else out[0]) install.export(output)
def gen_rstb(self, params=None): try: mod = Path(self.get_folder()) assert mod.exists() except (FileNotFoundError, IndexError, AssertionError): return with util.TempModContext(): if not ((mod / "info.json").exists() or (mod / "rules.txt").exists()): (mod / "info.json").write_text( json.dumps( { "name": "Temp", "desc": "Temp pack", "url": "", "id": "VGVtcD0wLjA=", "image": "", "version": "1.0.0", "depends": [], "options": {}, "platform": "wiiu" if util.get_settings("wiiu") else "switch", } ) ) install.install_mod( mod, merge_now=True, options={ "options": {}, "disable": [ m.NAME for m in mergers.get_mergers() if m.NAME != "rstb" ], }, ) (mod / util.get_content_path() / "System" / "Resource").mkdir( parents=True, exist_ok=True ) copyfile( util.get_master_modpack_dir() / util.get_content_path() / "System" / "Resource" / "ResourceSizeTable.product.srsizetable", mod / util.get_content_path() / "System" / "Resource" / "ResourceSizeTable.product.srsizetable", )