From 01bf17816806d694b742ee7106df5320fe470812 Mon Sep 17 00:00:00 2001 From: Mc-muffin Date: Sat, 2 Jul 2022 15:54:41 -0500 Subject: [PATCH] Added the unk tags to the inserter, and fixed capitalization --- ToolsTales.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ToolsTales.py b/ToolsTales.py index 90ed281..9e79f41 100644 --- a/ToolsTales.py +++ b/ToolsTales.py @@ -489,15 +489,11 @@ class ToolsTales: if tag_param != None: finalText += tag_param else: - - #Pad the tag to be even number of characters hex_value = self.hex2(b2) if len(hex_value) < 4 and tag_name not in ['icon','speed']: hex_value = "0"*(4-len(hex_value)) + hex_value - - finalText += '<{}:{}>'.format(tag_name, hex_value) #finalText += ("<%s:%08X>" % (tag_name, b2)) else: @@ -507,7 +503,7 @@ class ToolsTales: elif b >= 0xA1 and b < 0xE0: finalText += struct.pack("B", b).decode("cp932") elif b in (0x13, 0x17, 0x1A): - tag_name = f"unk{b:02X}" + tag_name = f"Unk{b:02X}" hex_value = "" while fileRead.read(1) != b"\x80": @@ -520,10 +516,9 @@ class ToolsTales: finalText += '<{}:{}>'.format(tag_name, hex_value) elif b in (0x18, 0x19): - tag_name = f"unk{b:02X}" + tag_name = f"Unk{b:02X}" hex_value = "" - - + while fileRead.read(1) != b"\x80": fileRead.seek(fileRead.tell()-1) hex_value += fileRead.read(1).hex() @@ -578,6 +573,11 @@ class ToolsTales: if split[0][1:] in self.itags.keys(): bytesFinal += struct.pack("B", self.itags[split[0][1:]]) bytesFinal += struct.pack("