mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-12-23 08:38:52 -05:00
Simplifies the function signature of CustomMessage_RetrieveIfExists
.
This commit is contained in:
parent
69d2b5b3a3
commit
98c771cf2c
@ -1513,13 +1513,15 @@ extern "C" int Randomizer_GetCustomGetItemMessage(GetItemID giid, char* buffer,
|
|||||||
return CopyStringToCharBuffer(getItemText, buffer, maxBufferSize);
|
return CopyStringToCharBuffer(getItemText, buffer, maxBufferSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" int CustomMessage_RetrieveIfExists(GlobalContext* globalCtx, char* buffer, const int maxBufferSize) {
|
extern "C" int CustomMessage_RetrieveIfExists(GlobalContext* globalCtx) {
|
||||||
MessageContext* msgCtx = &globalCtx->msgCtx;
|
MessageContext* msgCtx = &globalCtx->msgCtx;
|
||||||
Font* font = &msgCtx->font;
|
Font* font = &msgCtx->font;
|
||||||
|
char* buffer = font->msgBuf;
|
||||||
|
const int maxBufferSize = sizeof(font->msgBuf);
|
||||||
if (gSaveContext.n64ddFlag) {
|
if (gSaveContext.n64ddFlag) {
|
||||||
if (msgCtx->textId == 0xF8) {
|
if (msgCtx->textId == 0xF8) {
|
||||||
if (msgCtx->msgLength = font->msgLength = Randomizer_GetCustomGetItemMessage(
|
if (msgCtx->msgLength = font->msgLength = Randomizer_GetCustomGetItemMessage(
|
||||||
(GetItemID)GET_PLAYER(globalCtx)->getItemId, font->msgBuf, sizeof(font->msgBuf))) {
|
(GetItemID)GET_PLAYER(globalCtx)->getItemId, buffer, maxBufferSize)) {
|
||||||
font->charTexBuf[0] = 0x23;
|
font->charTexBuf[0] = 0x23;
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
@ -97,7 +97,7 @@ s32 GetItemIDFromGetItemID(s32 getItemId);
|
|||||||
s32 GetRandomizedItemId(GetItemID ogId, s16 actorId, s16 actorParams, s16 sceneNum);
|
s32 GetRandomizedItemId(GetItemID ogId, s16 actorId, s16 actorParams, s16 sceneNum);
|
||||||
s32 GetRandomizedItemIdFromKnownCheck(RandomizerCheck randomizerCheck, GetItemID ogId);
|
s32 GetRandomizedItemIdFromKnownCheck(RandomizerCheck randomizerCheck, GetItemID ogId);
|
||||||
int Randomizer_GetCustomGetItemMessage(GetItemID giid, char* buffer, const int maxBufferSize);
|
int Randomizer_GetCustomGetItemMessage(GetItemID giid, char* buffer, const int maxBufferSize);
|
||||||
int CustomMessage_RetrieveIfExists(GlobalContext* globalCtx, char* buffer, const int maxBufferSize);
|
int CustomMessage_RetrieveIfExists(GlobalContext* globalCtx);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1662,7 +1662,7 @@ void Message_OpenText(GlobalContext* globalCtx, u16 textId) {
|
|||||||
gSaveContext.eventInf[0] = gSaveContext.eventInf[1] = gSaveContext.eventInf[2] = gSaveContext.eventInf[3] = 0;
|
gSaveContext.eventInf[0] = gSaveContext.eventInf[1] = gSaveContext.eventInf[2] = gSaveContext.eventInf[3] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CustomMessage_RetrieveIfExists(globalCtx, font->msgBuf, sizeof(font->msgBuf))) {
|
if (CustomMessage_RetrieveIfExists(globalCtx)) {
|
||||||
osSyncPrintf("Found custom message");
|
osSyncPrintf("Found custom message");
|
||||||
} else if (sTextIsCredits) {
|
} else if (sTextIsCredits) {
|
||||||
Message_FindCreditsMessage(globalCtx, textId);
|
Message_FindCreditsMessage(globalCtx, textId);
|
||||||
|
Loading…
Reference in New Issue
Block a user