Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Z3DR
29 changes: 17 additions & 12 deletions source/custom_messages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down
15 changes: 9 additions & 6 deletions source/include/custom_messages.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<colType>& cols, const std::vector<iconType>& icons, const std::vector<u8>& delays,
Expand Down