diff --git a/soh/soh/z_message_OTR.cpp b/soh/soh/z_message_OTR.cpp index b8e323283..8c1d26a75 100644 --- a/soh/soh/z_message_OTR.cpp +++ b/soh/soh/z_message_OTR.cpp @@ -19,13 +19,17 @@ MessageTableEntry* OTRMessage_LoadTable(const char* filePath, bool isNES) { if (file == nullptr) return nullptr; + // Allocate room for an additional message MessageTableEntry* table = (MessageTableEntry*)malloc(sizeof(MessageTableEntry) * (file->messages.size() + 1)); for (int i = 0; i < file->messages.size(); i++) { + // Look for Owl Text if (file->messages[i].id == 0x2066) { + // Create a new message based on the Owl Text char* kaeporaPatch = (char*)malloc(sizeof(char) * file->messages[i].msg.size()); file->messages[i].msg.copy(kaeporaPatch, file->messages[i].msg.size(), 0); + // Swap the order of yes and no in this new message if (filePath == "text/nes_message_data_static/nes_message_data_static") { kaeporaPatch[26] = 'Y'; kaeporaPatch[27] = 'e'; @@ -52,6 +56,7 @@ MessageTableEntry* OTRMessage_LoadTable(const char* filePath, bool isNES) { kaeporaPatch[32] = 'n'; } + // load data into message table[file->messages.size()].textId = 0x71B3; table[file->messages.size()].typePos = (file->messages[i].textboxType << 4) | file->messages[i].textboxYPos; table[file->messages.size()].segment = kaeporaPatch; diff --git a/soh/src/code/z_message_PAL.c b/soh/src/code/z_message_PAL.c index 7ffd0abf8..485176367 100644 --- a/soh/src/code/z_message_PAL.c +++ b/soh/src/code/z_message_PAL.c @@ -273,6 +273,7 @@ void Message_FindMessage(GlobalContext* globalCtx, u16 textId) { Font* font; const char* seg; u16 bufferId = textId; + // Use the better owl message if better owl is enabled if (CVar_GetS32("gBetterOwl", 0) != 0 && (bufferId == 0x2066 || bufferId == 0x607B || bufferId == 0x10C2 || bufferId == 0x10C6 || bufferId == 0x206A)) { diff --git a/soh/src/overlays/actors/ovl_En_Owl/z_en_owl.c b/soh/src/overlays/actors/ovl_En_Owl/z_en_owl.c index aaa4ac601..aef838499 100644 --- a/soh/src/overlays/actors/ovl_En_Owl/z_en_owl.c +++ b/soh/src/overlays/actors/ovl_En_Owl/z_en_owl.c @@ -366,6 +366,7 @@ void func_80ACA7E0(EnOwl* this, GlobalContext* globalCtx) { void EnOwl_ConfirmKokiriMessage(EnOwl* this, GlobalContext* globalCtx) { if (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_CHOICE && Message_ShouldAdvance(globalCtx)) { + // swap the order of the responses if better owl is enabled uint8_t index = CVar_GetS32("gBetterOwl", 0) == 0 ? globalCtx->msgCtx.choiceIndex : (1 - globalCtx->msgCtx.choiceIndex); switch (index) { case OWL_REPEAT: @@ -394,6 +395,7 @@ void EnOwl_WaitOutsideKokiri(EnOwl* this, GlobalContext* globalCtx) { void func_80ACA998(EnOwl* this, GlobalContext* globalCtx) { if (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_CHOICE && Message_ShouldAdvance(globalCtx)) { + // swap the order of the responses if better owl is enabled uint8_t index = CVar_GetS32("gBetterOwl", 0) == 0 ? globalCtx->msgCtx.choiceIndex : (1 - globalCtx->msgCtx.choiceIndex); switch (index) { case OWL_REPEAT: @@ -439,6 +441,7 @@ void EnOwl_WaitHyruleCastle(EnOwl* this, GlobalContext* globalCtx) { void func_80ACAB88(EnOwl* this, GlobalContext* globalCtx) { if (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_CHOICE && Message_ShouldAdvance(globalCtx)) { + // swap the order of the responses if better owl is enabled uint8_t index = CVar_GetS32("gBetterOwl", 0) == 0 ? globalCtx->msgCtx.choiceIndex : (1 - globalCtx->msgCtx.choiceIndex); switch (index) { case OWL_REPEAT: @@ -481,6 +484,7 @@ void EnOwl_WaitKakariko(EnOwl* this, GlobalContext* globalCtx) { void func_80ACAD34(EnOwl* this, GlobalContext* globalCtx) { if (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_CHOICE && Message_ShouldAdvance(globalCtx)) { + // swap the order of the responses if better owl is enabled uint8_t index = CVar_GetS32("gBetterOwl", 0) == 0 ? globalCtx->msgCtx.choiceIndex : (1 - globalCtx->msgCtx.choiceIndex); switch (index) { case OWL_REPEAT: @@ -518,6 +522,7 @@ void EnOwl_WaitGerudo(EnOwl* this, GlobalContext* globalCtx) { void func_80ACAEB8(EnOwl* this, GlobalContext* globalCtx) { if (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_CHOICE && Message_ShouldAdvance(globalCtx)) { + // swap the order of the responses if better owl is enabled uint8_t index = CVar_GetS32("gBetterOwl", 0) == 0 ? globalCtx->msgCtx.choiceIndex : (1 - globalCtx->msgCtx.choiceIndex); switch (index) { case OWL_REPEAT: @@ -639,6 +644,7 @@ void EnOwl_WaitDeathMountainShortcut(EnOwl* this, GlobalContext* globalCtx) { void func_80ACB344(EnOwl* this, GlobalContext* globalCtx) { if (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_CHOICE && Message_ShouldAdvance(globalCtx)) { + // swap the order of the responses if better owl is enabled uint8_t index = CVar_GetS32("gBetterOwl", 0) == 0 ? globalCtx->msgCtx.choiceIndex : (1 - globalCtx->msgCtx.choiceIndex); switch (index) { case OWL_REPEAT: @@ -663,6 +669,7 @@ void func_80ACB3E0(EnOwl* this, GlobalContext* globalCtx) { void func_80ACB440(EnOwl* this, GlobalContext* globalCtx) { if (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_CHOICE && Message_ShouldAdvance(globalCtx)) { + // swap the order of the responses if better owl is enabled uint8_t index = CVar_GetS32("gBetterOwl", 0) == 0 ? globalCtx->msgCtx.choiceIndex : (1 - globalCtx->msgCtx.choiceIndex); switch (index) { case OWL_REPEAT: @@ -699,6 +706,7 @@ void EnOwl_WaitLWPreSaria(EnOwl* this, GlobalContext* globalCtx) { void func_80ACB5C4(EnOwl* this, GlobalContext* globalCtx) { if (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_CHOICE && Message_ShouldAdvance(globalCtx)) { + // swap the order of the responses if better owl is enabled uint8_t index = CVar_GetS32("gBetterOwl", 0) == 0 ? globalCtx->msgCtx.choiceIndex : (1 - globalCtx->msgCtx.choiceIndex); switch (index) { case OWL_REPEAT: