Skip to content

Commit

Permalink
Takes Ganondor's text & hint from CustomMessageTable
Browse files Browse the repository at this point in the history
  • Loading branch information
leggettc18 committed Jul 24, 2022
1 parent c1155bb commit 9f2eb46
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
16 changes: 10 additions & 6 deletions soh/soh/OTRGlobals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1478,14 +1478,12 @@ extern "C" CustomMessageEntry Randomizer_CopyAltarMessage() {
: CustomMessage::Instance->RetrieveMessage(Randomizer::hintMessageTableID, 0x7040);
}

extern "C" int Randomizer_CopyGanonText(char* buffer, const int maxBufferSize) {
const std::string& ganonText = OTRGlobals::Instance->gRandomizer->GetGanonText();
return CopyStringToCharBuffer(ganonText, buffer, maxBufferSize);
extern "C" CustomMessageEntry Randomizer_CopyGanonText() {
return CustomMessage::Instance->RetrieveMessage(Randomizer::hintMessageTableID, 0x70CD);
}

extern "C" int Randomizer_CopyGanonHintText(char* buffer, const int maxBufferSize) {
const std::string& ganonText = OTRGlobals::Instance->gRandomizer->GetGanonHintText();
return CopyStringToCharBuffer(ganonText, buffer, maxBufferSize);
extern "C" CustomMessageEntry Randomizer_CopyGanonHintText() {
return CustomMessage::Instance->RetrieveMessage(Randomizer::hintMessageTableID, 0x70CC);
}

extern "C" CustomMessageEntry Randomizer_CopyHintFromCheck(RandomizerCheck check) {
Expand Down Expand Up @@ -1550,6 +1548,12 @@ extern "C" int CustomMessage_RetrieveIfExists(GlobalContext* globalCtx) {
} else if (textId == 0x7040 || textId == 0x7088) {
// rando hints at altar
messageEntry = Randomizer_CopyAltarMessage();
} else if (gSaveContext.n64ddFlag && textId == 0x70CC) {
if (INV_CONTENT(ITEM_ARROW_LIGHT) == ITEM_ARROW_LIGHT) {
messageEntry = Randomizer_CopyGanonText();
} else {
messageEntry = Randomizer_CopyGanonHintText();
}
}
}
if (textId == 0x00B4 || textId == 0x00B5) {
Expand Down
6 changes: 0 additions & 6 deletions soh/src/code/z_message_PAL.c
Original file line number Diff line number Diff line change
Expand Up @@ -1677,12 +1677,6 @@ void Message_OpenText(GlobalContext* globalCtx, u16 textId) {
Message_FindMessage(globalCtx, textId);
if (gSaveContext.n64ddFlag && (textId == 0x10A2 || textId == 0x10DC || textId == 0x10DD)) {
msgCtx->msgLength = font->msgLength = CopyScrubMessage(textId, font->msgBuf, sizeof(font->msgBuf));
} else if (gSaveContext.n64ddFlag && textId == 0x70CC) {
if (INV_CONTENT(ITEM_ARROW_LIGHT) == ITEM_ARROW_LIGHT) {
msgCtx->msgLength = font->msgLength = Randomizer_CopyGanonText(font->msgBuf, sizeof(font->msgBuf));
} else {
msgCtx->msgLength = font->msgLength = Randomizer_CopyGanonHintText(font->msgBuf, sizeof(font->msgBuf));
}
} else {
msgCtx->msgLength = font->msgLength;
char* src = (uintptr_t)font->msgOffset;
Expand Down

0 comments on commit 9f2eb46

Please sign in to comment.