diff --git a/Z3DR b/Z3DR index 84ab8cb..c08d2cf 160000 --- a/Z3DR +++ b/Z3DR @@ -1 +1 @@ -Subproject commit 84ab8cb35f17366d8ef4501d592b203314bd5556 +Subproject commit c08d2cf3121e33be9d3510e0ef419b693b79eef8 diff --git a/source/custom_messages.cpp b/source/custom_messages.cpp index d7884b7..977716b 100644 --- a/source/custom_messages.cpp +++ b/source/custom_messages.cpp @@ -51,15 +51,19 @@ void CreateMessage(u16 textId, u16 field_2, u32 field_4, u32 flags, const Langua newEntry.flags = flags; newEntry.sfxAndFlags = ((instant) ? 0x8000 : 0x0000) | ((repeatSfx) ? 0x4000 : 0x0000) | sfx; - u32 offsetEn = 0, offsetFr = 0, offsetEs = 0, offsetDe = 0, offsetIt = 0, offsetNl = 0; + u32 offsetNaEn = 0, offsetNaFr = 0, offsetNaEs = 0, offsetEuEn = 0, offsetEuFr = 0, offsetEuEs = 0, offsetEuDe = 0, offsetEuIt = 0, offsetJpJp = 0; u32 offsetCol = 0, offsetIcon = 0, offsetDelay = 0; - if (text.English) offsetEn = pushText(text.English); - if (text.French) offsetFr = pushText(text.French); - if (text.Spanish) offsetEs = pushText(text.Spanish); - if (text.German) offsetDe = pushText(text.German); - if (text.Italian) offsetIt = pushText(text.Italian); - if (text.Dutch) offsetNl = pushText(text.Dutch); + //If text exists and doesn't seem redundant, write it to patch and store its offset + if (text.NaEnglish) offsetNaEn = offsetEuEn = pushText(text.NaEnglish); + if (text.NaFrench && (text.NaFrench != text.NaEnglish)) offsetNaFr = offsetEuFr = pushText(text.NaFrench); + if (text.NaSpanish && (text.NaSpanish != text.NaEnglish)) offsetNaEs = offsetEuEs = pushText(text.NaSpanish); + if (text.EuGerman && (text.EuGerman != text.EuEnglish)) offsetEuDe = pushText(text.EuGerman); + if (text.EuItalian && (text.EuItalian != text.EuEnglish)) offsetEuIt = pushText(text.EuItalian); + //if (text.Japanese && (text.Japanese != text.NaEnglish)) offsetJpJp = pushText(text.Japanese); + if (text.EuEnglish && (text.EuEnglish != text.NaEnglish)) offsetEuEn = pushText(text.EuEnglish); + if (text.EuFrench && (text.EuFrench != text.NaFrench )) offsetEuFr = pushText(text.EuFrench); + if (text.EuSpanish && (text.EuSpanish != text.NaSpanish)) offsetEuEs = pushText(text.EuSpanish); if (cols.size()) { offsetCol = colData.size() * 2 - colParity; @@ -160,11 +164,12 @@ void CreateMessage(u16 textId, u16 field_2, u32 field_4, u32 flags, const Langua delayParity = (delayParity + 1) % 4; } - newEntry.offsets[0] = offsetEn | (offsetFr << 18); - newEntry.offsets[1] = (offsetFr >> 14) | (offsetEs << 4) | (offsetDe << 22); - newEntry.offsets[2] = (offsetDe >> 10) | (offsetIt << 8) | (offsetNl << 26); - newEntry.offsets[3] = (offsetNl >> 6) | (offsetCol << 12) | (offsetIcon << 22); - newEntry.delayOffset= (u16)offsetDelay; + newEntry.offsets[0] = offsetNaEn | (offsetNaFr << 18); + newEntry.offsets[1] = (offsetNaFr >> 14) | (offsetNaEs << 4) | (offsetEuEn << 22); + newEntry.offsets[2] = (offsetEuEn >> 10) | (offsetEuFr << 8) | (offsetEuEs << 26); + newEntry.offsets[3] = (offsetEuEs >> 6) | (offsetEuDe << 12) | (offsetEuIt << 30); + newEntry.offsets[4] = (offsetEuIt >> 2) | (offsetJpJp << 16); + newEntry.offsets[5] = (offsetJpJp >> 16) | (offsetCol << 2) | (offsetIcon << 12) | (offsetDelay << 22); messageEntries.insert(newEntry); // Duplicate moon trial hints to their alternate version diff --git a/source/include/custom_messages.hpp b/source/include/custom_messages.hpp index 1c96360..d50870d 100644 --- a/source/include/custom_messages.hpp +++ b/source/include/custom_messages.hpp @@ -7,12 +7,15 @@ namespace CustomMessages { typedef struct { - const char* English; - const char* French; - const char* Spanish; - const char* German; - const char* Italian; - const char* Dutch; + const char* NaEnglish; + const char* NaFrench; + const char* NaSpanish; + const char* EuGerman; + const char* EuItalian; + //const char* Japanese; + const char* EuEnglish; + const char* EuFrench; + const char* EuSpanish; } Language; void CreateMessage(u16 textId, u16 field_2, u32 field_4, u32 flags, const Language& text, const std::vector& cols, const std::vector& icons, const std::vector& delays,