diff --git a/Tales_Exe.py b/Tales_Exe.py index 40135ca..33c7f31 100644 --- a/Tales_Exe.py +++ b/Tales_Exe.py @@ -158,6 +158,33 @@ def get_arguments(argv=None): help="(Optional) - Only for extract Iso command", ) + sp_insert.add_argument( + "--with-proofreading", + required=False, + action="store_const", + const="Proofreading", + default="", + help="(Optional) - Insert lines in 'Proofreading' status", + ) + + sp_insert.add_argument( + "--with-editing", + required=False, + action="store_const", + const="Editing", + default="", + help="(Optional) - Insert lines in 'Editing' status", + ) + + sp_insert.add_argument( + "--with-problematic", + required=False, + action="store_const", + const="Problematic", + default="", + help="(Optional) - Insert lines in 'Problematic' status", + ) + # Debug commands sp_debug = sp.add_parser( "debug", @@ -228,7 +255,11 @@ def hex2bytes(tales_instance, hex_value): def getTalesInstance(args, game_name): if game_name == "TOR": - talesInstance = ToolsTOR.ToolsTOR(args.project.resolve()) + if args.action == "insert": + insert_mask = [args.with_proofreading, args.with_editing, args.with_problematic] + else: + insert_mask = [""] + talesInstance = ToolsTOR.ToolsTOR(args.project.resolve(), insert_mask) elif game_name == "NDX": talesInstance = ToolsNDX.ToolsNDX("TBL_All.json") else: diff --git a/pythonlib/games/ToolsTOR.py b/pythonlib/games/ToolsTOR.py index 736fef3..3980635 100644 --- a/pythonlib/games/ToolsTOR.py +++ b/pythonlib/games/ToolsTOR.py @@ -46,7 +46,7 @@ class ToolsTOR(ToolsTales): LOW_BITS = 0x3F - def __init__(self, project_file: Path) -> None: + def __init__(self, project_file: Path, insert_mask: list[str]) -> None: base_path = project_file.parent self.jsonTblTags = {} self.ijsonTblTags = {} @@ -71,7 +71,8 @@ class ToolsTOR(ToolsTales): # byteCode self.story_byte_code = b"\xF8" self.string_opcode = InstructionType.STRING - self.list_status_insertion: list[str] = ['Done', 'Proofreading', 'Editing'] + self.list_status_insertion: list[str] = ['Done'] + self.list_status_insertion.append(*insert_mask) # Extract the story files