mirror of
https://github.com/HarbourMasters/Shipwright
synced 2026-06-01 09:57:19 -04:00
Test switch to new message system
Testing setting up the table and calling the messages
This commit is contained in:
@@ -27,6 +27,7 @@ u8 generated;
|
||||
const std::string Randomizer::getItemMessageTableID = "Randomizer";
|
||||
const std::string Randomizer::hintMessageTableID = "RandomizerHints";
|
||||
const std::string Randomizer::scrubMessageTableID = "RandomizerScrubs";
|
||||
const std::string Randomizer::NaviRandoMessageTableID = "RandomizerNavi";
|
||||
|
||||
Randomizer::Randomizer() {
|
||||
Sprite bowSprite = { dgFairyBowIconTex, 32, 32, G_IM_FMT_RGBA, G_IM_SIZ_32b, 0 };
|
||||
@@ -4418,6 +4419,15 @@ void CreateScrubMessages() {
|
||||
}
|
||||
}
|
||||
|
||||
void CreateNaviRandoMessages() {
|
||||
CustomMessageManager* customMessageManager = CustomMessageManager::Instance;
|
||||
customMessageManager->AddCustomMessageTable(Randomizer::NaviRandoMessageTableID);
|
||||
customMessageManager->CreateMessage(Randomizer::NaviRandoMessageTableID, 0x00,
|
||||
{ TEXTBOX_TYPE_BLACK, TEXTBOX_POS_BOTTOM, "Test Eng0", "Test Ger", "Test Fre" });
|
||||
customMessageManager->CreateMessage(Randomizer::NaviRandoMessageTableID, 0x01,
|
||||
{ TEXTBOX_TYPE_BLACK, TEXTBOX_POS_BOTTOM, "Test Eng1", "Test Ger", "Test Fre" });
|
||||
}
|
||||
|
||||
void Randomizer::CreateCustomMessages() {
|
||||
// RANDTODO: Translate into french and german and replace GIMESSAGE_UNTRANSLATED
|
||||
// with GIMESSAGE(getItemID, itemID, english, german, french).
|
||||
@@ -4446,6 +4456,7 @@ void Randomizer::CreateCustomMessages() {
|
||||
};
|
||||
CreateGetItemMessages(getItemMessages);
|
||||
CreateScrubMessages();
|
||||
CreateNaviRandoMessages();
|
||||
}
|
||||
|
||||
void InitRando() {
|
||||
|
||||
@@ -29,6 +29,7 @@ class Randomizer {
|
||||
static const std::string getItemMessageTableID;
|
||||
static const std::string hintMessageTableID;
|
||||
static const std::string scrubMessageTableID;
|
||||
static const std::string NaviRandoMessageTableID;
|
||||
|
||||
static Sprite* GetSeedTexture(uint8_t index);
|
||||
s16 GetItemModelFromId(s16 itemId);
|
||||
|
||||
@@ -1449,6 +1449,11 @@ extern "C" CustomMessageEntry Randomizer_GetScrubMessage(u16 scrubTextId) {
|
||||
return CustomMessageManager::Instance->RetrieveMessage(Randomizer::scrubMessageTableID, price);
|
||||
}
|
||||
|
||||
extern "C" CustomMessageEntry Randomizer_GetNaviMessage() {
|
||||
u16 naviTextId = rand() % 2;
|
||||
return CustomMessageManager::Instance->RetrieveMessage(Randomizer::NaviRandoMessageTableID, naviTextId);
|
||||
}
|
||||
|
||||
extern "C" CustomMessageEntry Randomizer_GetAltarMessage() {
|
||||
return (LINK_IS_ADULT)
|
||||
? CustomMessageManager::Instance->RetrieveMessage(Randomizer::hintMessageTableID, TEXT_ALTAR_ADULT)
|
||||
@@ -1542,7 +1547,10 @@ extern "C" int CustomMessage_RetrieveIfExists(GlobalContext* globalCtx) {
|
||||
}
|
||||
} else if (textId == TEXT_SCRUB_POH || textId == TEXT_SCRUB_STICK_UPGRADE || textId == TEXT_SCRUB_NUT_UPGRADE) {
|
||||
messageEntry = Randomizer_GetScrubMessage(textId);
|
||||
} else if (textId >= 0x0140 && textId <= 0x015F) {
|
||||
messageEntry = Randomizer_GetNaviMessage();
|
||||
}
|
||||
|
||||
}
|
||||
if (textId == TEXT_GS_NO_FREEZE || textId == TEXT_GS_FREEZE) {
|
||||
if (CVar_GetS32("gInjectSkulltulaCount", 0) != 0) {
|
||||
|
||||
@@ -1682,11 +1682,12 @@ void Message_OpenText(GlobalContext* globalCtx, u16 textId) {
|
||||
memcpy(font->msgBuf, src, font->msgLength);
|
||||
}
|
||||
|
||||
/*
|
||||
// (From z_player.c) In rando, Navi gives rando-related advice
|
||||
if (textId == 0x0140 && gSaveContext.n64ddFlag) {
|
||||
RandoNaviTip(globalCtx);
|
||||
msgCtx->msgLength = font->msgLength = strlen(font->msgBuf);
|
||||
}
|
||||
}*/
|
||||
|
||||
msgCtx->textBoxProperties = font->charTexBuf[0];
|
||||
msgCtx->textBoxType = msgCtx->textBoxProperties >> 4;
|
||||
|
||||
@@ -15293,8 +15293,8 @@ void func_80853148(GlobalContext* globalCtx, Actor* actor) {
|
||||
this->naviActor->flags |= ACTOR_FLAG_8;
|
||||
func_80835EA4(globalCtx, 0xB);
|
||||
// If rando'd and Navi wants to give you a general quest tip, give a rando tip instead
|
||||
if (actor->textId >= 0x0140 && actor->textId <= 0x015F && gSaveContext.n64ddFlag) {
|
||||
Message_StartTextbox(globalCtx, 0x0140, NULL);
|
||||
}
|
||||
// if (actor->textId >= 0x0140 && actor->textId <= 0x015F && gSaveContext.n64ddFlag) {
|
||||
// Message_StartTextbox(globalCtx, 0x0140, NULL);
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user