diff --git a/TOR_Test.py b/TOR_Test.py index e625a1e..7840844 100644 --- a/TOR_Test.py +++ b/TOR_Test.py @@ -12,7 +12,7 @@ import lxml.etree as etree tool = ToolsTOR.ToolsTOR("TBL_All.json") -tool.extract_All_Menu() +tool.insert_Menu_File("../Data/TOR/Disc/Original/SLPS_254.50") diff --git a/ToolsTales.py b/ToolsTales.py index 0abde64..a364333 100644 --- a/ToolsTales.py +++ b/ToolsTales.py @@ -638,7 +638,7 @@ class ToolsTales: new_text_offsets = dict() file_node = [ele for ele in self.menu_files_json if ele['File_Extract'] == menu_file_path][0] - xml_file_name = "../Data/{}/Menu/XML/".format(self.gameName) + self.get_file_name(menu_file_path)+'.xml' + xml_file_name = "../{}/Data/{}/Menu/XML/".format(self.repo_name, self.gameName) + self.get_file_name(menu_file_path)+'.xml' tree = etree.parse(xml_file_name) root = tree.getroot() @@ -646,9 +646,9 @@ class ToolsTales: sections_end = [ section['Text_End'] for section in file_node['Sections'] if section['Text_Start'] > 0 ] base_offset = file_node['Base_Offset'] - print(sections_start) + #Copy the original file - new_file_path = file_node['File_New'] + new_file_path = "../Data/TOR/Menu/New/{}".format(os.path.basename(file_node['File_Original'])) shutil.copy( file_node['File_Extract'], new_file_path) #Open the new file with r+b @@ -660,7 +660,7 @@ class ToolsTales: section_max = max( sections_end ) ele = [ele for ele in root.findall("Strings") if ele.find('Section').text == "Armor"][0] - print(ele) + for entry_node in root.iter("Entry"): if menu_file.tell() < section_max: diff --git a/__pycache__/ToolsTales.cpython-38.pyc b/__pycache__/ToolsTales.cpython-38.pyc index e778a04..95ebd8d 100644 Binary files a/__pycache__/ToolsTales.cpython-38.pyc and b/__pycache__/ToolsTales.cpython-38.pyc differ