mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-01-31 15:30:17 -05:00
Early version of custom messages.
This commit is contained in:
parent
248f49b3bf
commit
e9ba8f734f
@ -2419,6 +2419,17 @@ GetItemID Randomizer::GetRandomizedItemIdFromKnownCheck(RandomizerCheck randomiz
|
|||||||
return GetItemFromGet(this->itemLocations[randomizerCheck], ogId);
|
return GetItemFromGet(this->itemLocations[randomizerCheck], ogId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string Randomizer::GetCustomGetItemMessage(GetItemID giid) {
|
||||||
|
if (!gSaveContext.n64ddFlag) {
|
||||||
|
return "Not Randomized.";
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (giid) {
|
||||||
|
default:
|
||||||
|
"There is no custom message for this item.";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
RandomizerCheck Randomizer::GetCheckFromActor(s16 sceneNum, s16 actorId, s16 actorParams) {
|
RandomizerCheck Randomizer::GetCheckFromActor(s16 sceneNum, s16 actorId, s16 actorParams) {
|
||||||
if (!gSaveContext.n64ddFlag) {
|
if (!gSaveContext.n64ddFlag) {
|
||||||
return RC_UNKNOWN_CHECK;
|
return RC_UNKNOWN_CHECK;
|
||||||
|
@ -42,6 +42,7 @@ class Randomizer {
|
|||||||
std::string GetHintFromCheck(RandomizerCheck check);
|
std::string GetHintFromCheck(RandomizerCheck check);
|
||||||
GetItemID GetRandomizedItemIdFromKnownCheck(RandomizerCheck randomizerCheck, GetItemID ogId);
|
GetItemID GetRandomizedItemIdFromKnownCheck(RandomizerCheck randomizerCheck, GetItemID ogId);
|
||||||
GetItemID GetRandomizedItemId(GetItemID ogId, s16 actorId, s16 actorParams, s16 sceneNum);
|
GetItemID GetRandomizedItemId(GetItemID ogId, s16 actorId, s16 actorParams, s16 sceneNum);
|
||||||
|
std::string GetCustomGetItemMessage(GetItemID giid);
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@ -1528,3 +1528,8 @@ extern "C" s32 GetRandomizedItemId(GetItemID ogId, s16 actorId, s16 actorParams,
|
|||||||
extern "C" s32 GetRandomizedItemIdFromKnownCheck(RandomizerCheck randomizerCheck, GetItemID ogId) {
|
extern "C" s32 GetRandomizedItemIdFromKnownCheck(RandomizerCheck randomizerCheck, GetItemID ogId) {
|
||||||
return OTRGlobals::Instance->gRandomizer->GetRandomizedItemIdFromKnownCheck(randomizerCheck, ogId);
|
return OTRGlobals::Instance->gRandomizer->GetRandomizedItemIdFromKnownCheck(randomizerCheck, ogId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern "C" int Randomizer_GetCustomGetItemMessage(GetItemID giid, char* buffer, const int maxBufferSize) {
|
||||||
|
const std::string& getItemText = OTRGlobals::Instance->gRandomizer->GetCustomGetItemMessage(giid);
|
||||||
|
return CopyStringToCharBuffer(getItemText, buffer, maxBufferSize);
|
||||||
|
}
|
||||||
|
@ -99,6 +99,7 @@ s16 GetItemModelFromId(s16 itemId);
|
|||||||
s32 GetItemIDFromGetItemID(s32 getItemId);
|
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);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1735,6 +1735,9 @@ void Message_OpenText(GlobalContext* globalCtx, u16 textId) {
|
|||||||
} else {
|
} else {
|
||||||
msgCtx->msgLength = font->msgLength = CopyGanonHintText(font->msgBuf, sizeof(font->msgBuf));
|
msgCtx->msgLength = font->msgLength = CopyGanonHintText(font->msgBuf, sizeof(font->msgBuf));
|
||||||
}
|
}
|
||||||
|
} else if (gSaveContext.n64ddFlag && textId == 0xF8) {
|
||||||
|
msgCtx->msgLength = font->msgLength = Randomizer_GetCustomGetItemMessage(
|
||||||
|
GET_PLAYER(globalCtx)->getItemId, font->msgBuf, sizeof(font->msgBuf));
|
||||||
} else {
|
} else {
|
||||||
msgCtx->msgLength = font->msgLength;
|
msgCtx->msgLength = font->msgLength;
|
||||||
char* src = (uintptr_t)font->msgOffset;
|
char* src = (uintptr_t)font->msgOffset;
|
||||||
|
Loading…
Reference in New Issue
Block a user