diff --git a/source/Game.py b/source/Game.py index 07bfa0d..1eee1f8 100644 --- a/source/Game.py +++ b/source/Game.py @@ -234,10 +234,7 @@ class Game: :param auto_add_dir: autoadd directory """ if os.path.exists(auto_add_dir): shutil.rmtree(auto_add_dir) - if not os.path.exists(self.path + "/tmp/"): os.makedirs(self.path + "/tmp/") - wszst.szs.autoadd(self.path, get_nodir(self.path) + "/tmp/auto-add/") - shutil.move(self.path + "/tmp/auto-add/", auto_add_dir) - shutil.rmtree(self.path + "/tmp/") + wszst.szs.autoadd(self.path, auto_add_dir) def patch_bmg(self, gamefile: str) -> None: """ @@ -303,16 +300,12 @@ class Game: f.write(f" {track_id}\t= {prefix}{track_name}\n") - if not os.path.exists("./file/tmp/"): os.makedirs("./file/tmp/") - - shutil.copyfile(gamefile + ".d/message/Common.bmg", "./file/tmp/Common.bmg") bmgcommon = wszst.ctc.patch_bmg(ctfile="./file/CTFILE.txt", - bmgs=["./file/tmp/Common.bmg", "./file/ExtraCommon.txt"]) + bmgs=[gamefile + ".d/message/Common.bmg", "./file/ExtraCommon.txt"]) rbmgcommon = wszst.ctc.patch_bmg(ctfile="./file/RCTFILE.txt", - bmgs=["./file/tmp/Common.bmg", "./file/ExtraCommon.txt"]) + bmgs=[gamefile + ".d/message/Common.bmg", "./file/ExtraCommon.txt"]) shutil.rmtree(gamefile + ".d") - os.remove("./file/tmp/Common.bmg") os.remove("./file/ExtraCommon.txt") def finalise(file, bmgtext, replacement_list=None): diff --git a/source/wszst/szs.py b/source/wszst/szs.py index e209aa2..15ebcf6 100644 --- a/source/wszst/szs.py +++ b/source/wszst/szs.py @@ -1,7 +1,7 @@ from . import * -def szs_extract(file: str, dest_dir: str) -> None: +def extract(file: str, dest_dir: str) -> None: """ Extract an szs in a directory :param file: .szs file