1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-05 23:44:53 +00:00

Introduce extracted/VERSION, with text extracted there (#1730)

* Introduce assets/_extracted/VERSION, with text extracted there

* move to `extracted/text/`

* Update gitignore s

* rework args for msgenc.py

* put mkdir with others, until theyre all moved at once

* move 0xFFFC back to being extracted, making it use specific macro `DEFINE_MESSAGE_NES` to handle its special behavior

* prettier gitignore

* Move messages 0xFFFC, 0xFFFD to committed message_data.h
This commit is contained in:
Dragorn421 2024-03-02 04:09:57 +01:00 committed by GitHub
parent ca45c543f6
commit a6f646dc65
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 88 additions and 34 deletions

View file

@ -376,20 +376,26 @@ def extract_all_text(text_out, staff_text_out):
if text_out is not None:
out = ""
for message in dump_all_text():
if message[0] == 0xFFFF:
# Skip 0xFFFC and 0xFFFD because they are committed
# Skip 0xFFFF, the last entry
if message[0] in {0xFFFC, 0xFFFD, 0xFFFF}:
continue
if message[0] == 0xFFFC:
out += "#ifdef DEFINE_MESSAGE_FFFC\n"
out += f"DEFINE_MESSAGE(0x{message[0]:04X}, {textbox_type[message[1]]}, {textbox_ypos[message[2]]},"
is_nes_message = message[0] == 0xFFFC
if not is_nes_message:
out += "DEFINE_MESSAGE"
else:
out += "DEFINE_MESSAGE_NES"
out += f"(0x{message[0]:04X}, {textbox_type[message[1]]}, {textbox_ypos[message[2]]},"
out += "\n"
out += f"{message[3]}" + ("\n" if message[3] != "" else "") + ","
out += "\n" if message[3] != "" else ""
out += f"{message[4]}" + ("\n" if message[4] != "" else "") + ","
out += "\n" if message[4] != "" else ""
out += f"{message[5]}\n)"
if message[0] == 0xFFFC:
out += "\n#endif"
out += f"{message[3]}"
if not is_nes_message:
out += ("\n" if message[3] != "" else "") + ","
out += "\n" if message[3] != "" else ""
out += f"{message[4]}" + ("\n" if message[4] != "" else "") + ","
out += "\n" if message[4] != "" else ""
out += f"{message[5]}"
out += "\n)"
out += "\n\n"
with open(text_out, "w", encoding="utf8") as outfile: