You've already forked PythonLib
mirror of
https://github.com/lifebottle/PythonLib.git
synced 2026-02-13 15:25:50 -08:00
Adding new functions in ToolsTales_Exectuable
- extract Menu files - extract Story files
This commit is contained in:
@@ -808,7 +808,7 @@ class ToolsTales:
|
||||
|
||||
if file_path == '':
|
||||
file_path = self.elfOriginal
|
||||
print("Elf changed")
|
||||
|
||||
|
||||
f = open(file_path , "rb")
|
||||
|
||||
@@ -835,9 +835,8 @@ class ToolsTales:
|
||||
pointers_offset.append(block_pointers_offset[i])
|
||||
pointers_value.append(block_pointers_value[i])
|
||||
is_bad_count = 0
|
||||
if( section == "Battle Tutorial 3"):
|
||||
|
||||
print(block_pointers_offset[i])
|
||||
|
||||
|
||||
else:
|
||||
is_bad_count = is_bad_count = 1
|
||||
f.read(step)
|
||||
@@ -883,7 +882,6 @@ class ToolsTales:
|
||||
pointers_offset_list.extend( pointers_offset)
|
||||
texts_list.extend( texts )
|
||||
|
||||
print(set(section_list))
|
||||
#Remove duplicates
|
||||
list_informations = self.remove_duplicates(section_list, pointers_offset_list, texts_list)
|
||||
|
||||
@@ -903,7 +901,7 @@ class ToolsTales:
|
||||
texts_list = []
|
||||
for file_definition in self.menu_files_json:
|
||||
|
||||
print("Extracting...{}".format(file_definition['File_Extract']))
|
||||
print("...{}".format(file_definition['File_Extract']))
|
||||
self.extract_Menu_File(file_definition)
|
||||
|
||||
|
||||
|
||||
@@ -83,47 +83,18 @@ def get_arguments(argv=None):
|
||||
)
|
||||
sp_unpack.add_argument(
|
||||
"file",
|
||||
choices=["all", "dat", "mfh", "theirsce", "scpk"],
|
||||
choices=["All", "Main", "Menu", "Story", "Skits"],
|
||||
metavar="FILE",
|
||||
help="Options: all, dat, mfh, theirsce, scpk",
|
||||
)
|
||||
|
||||
sp_unpack.add_argument(
|
||||
"--input",
|
||||
metavar="input_path",
|
||||
required=True,
|
||||
help="Specify input file path.",
|
||||
type=os.path.abspath,
|
||||
)
|
||||
|
||||
sp_unpack.add_argument(
|
||||
"--output",
|
||||
metavar="output_path",
|
||||
help="Specify output path.",
|
||||
type=os.path.abspath,
|
||||
)
|
||||
|
||||
sp_unpack.add_argument(
|
||||
"--elf",
|
||||
metavar="elf_path",
|
||||
dest="elf_path",
|
||||
help="Specify custom SLPS_254.50 (a.k.a ELF) file path.",
|
||||
type=os.path.abspath,
|
||||
)
|
||||
|
||||
sp_unpack.add_argument(
|
||||
"--no-decompress",
|
||||
action="store_true",
|
||||
help="Don't decompress compto files.",
|
||||
)
|
||||
|
||||
# PAK commands
|
||||
sp_pack = sp.add_parser("pack", help="Packs some file types into the originals.")
|
||||
|
||||
|
||||
sp_pack.add_argument(
|
||||
"file",
|
||||
choices=["All", "Menu", "Story", "Skits"],
|
||||
choices=["All", "Main", "Menu", "Story", "Skits"],
|
||||
metavar="FILE",
|
||||
help="Inserts files back into their containers.",
|
||||
)
|
||||
@@ -184,9 +155,9 @@ def hex2bytes(tales_instance, hex_value):
|
||||
|
||||
def getTalesInstance(game_name):
|
||||
|
||||
talesInstance = ToolsTOR.ToolsTOR("tbl")
|
||||
if game_name == "TOR":
|
||||
talesInstance = ToolsTOR.ToolsTOR("tbl")
|
||||
talesInstance = ToolsTOR.ToolsTOR("TBL_All.json")
|
||||
#if game_name == "TOR":
|
||||
# talesInstance = ToolsTOR.ToolsTOR("tbl")
|
||||
|
||||
return talesInstance
|
||||
|
||||
@@ -215,8 +186,23 @@ if __name__ == "__main__":
|
||||
if args.file == "Menu":
|
||||
|
||||
#SLPS
|
||||
tales_instance.insert_Menu_File("../Data/TOR/Disc/Original/SLPS_254.50")
|
||||
#tales_instance.insert_Menu_File("../Data/TOR/Disc/Original/SLPS_254.50")
|
||||
print("new SLPS is found inside Data/{}/Disc/New".format(game_name))
|
||||
#Other files for menu stuff
|
||||
|
||||
|
||||
if args.action == "unpack":
|
||||
|
||||
if args.file == "Main":
|
||||
tales_instance.extract_Main_Archive()
|
||||
|
||||
if args.file == "Menu":
|
||||
print("Extracting Menu Files")
|
||||
tales_instance.extract_All_Menu()
|
||||
|
||||
if args.file == "Story":
|
||||
tales_instance.extract_All_Story_Files()
|
||||
|
||||
if args.file == "Skits":
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user