Adding TODDC_Test file + Comments to debug

This commit is contained in:
Stewie
2022-03-27 18:02:37 -04:00
parent 4efdda1d86
commit b5b30bfd4d
5 changed files with 22 additions and 2 deletions

18
TODDC_Test.py Normal file
View File

@@ -0,0 +1,18 @@
import ToolsTODDC
import json
import struct
import comptolib
import io
import re
import string
import pandas as pd
import json
import os
import lxml.etree as etree
tool = ToolsTODDC.ToolsTODDC("toddc.tbl")
ele = tool.menu_files_json[0]
tool.extract_Menu_File(ele)

View File

@@ -42,7 +42,7 @@ class ToolsTODDC(ToolsTales):
#self.icolors = dict([[i, j] for j, i in self.jsonTblTags['COLORS'].items()])
with open("../{}/Data/{}/Menu/MenuFiles.json".format(self.repo_name, self.gameName)) as f:
with open("../{}/Data/Menu/MenuFiles.json".format(self.repo_name, self.gameName)) as f:
self.menu_files_json = json.load(f)

View File

@@ -891,12 +891,14 @@ class ToolsTales:
text_end = section['Text_End']
#Extract Pointers of the file
print("Extract Pointers")
pointers_offset, pointers_value = self.get_special_pointers( text_start, text_end, base_offset, section['Pointer_Offset_Start'], section['Nb_Per_Block'], section['Step'], section['Section'], file_path)
#Extract Text from the pointers
print("Extract Text")
texts = [ self.bytes_to_text(f, ele + base_offset)[0] for ele in pointers_value]
print(texts)
#Make a list
section_list.extend( [section['Section']] * len(texts))

Binary file not shown.