Merge branch 'accessibility-tts' into accessibility

This commit is contained in:
Ryan Conrad 2022-04-13 21:35:11 -05:00
commit 9adacdb90e
8 changed files with 155 additions and 307 deletions

View file

@ -293,6 +293,9 @@ namespace Ship {
void Window::ReadText(const char textToRead[]) void Window::ReadText(const char textToRead[])
{ {
if (textToRead == nullptr) {
return;
}
std::string textCopy(textToRead); std::string textCopy(textToRead);
std::thread t1(task1, textCopy); std::thread t1(task1, textCopy);
t1.detach(); t1.detach();

View file

@ -6,11 +6,47 @@
#include "global.h" #include "global.h"
#include "vt.h" #include "vt.h"
#include <Text.h> #include <Text.h>
#include <unordered_map>
extern "C" MessageTableEntry* sNesMessageEntryTablePtr; extern "C" MessageTableEntry* sNesMessageEntryTablePtr;
extern "C" MessageTableEntry* sStaffMessageEntryTablePtr; extern "C" MessageTableEntry* sStaffMessageEntryTablePtr;
//extern "C" MessageTableEntry* _message_0xFFFC_nes; //extern "C" MessageTableEntry* _message_0xFFFC_nes;
static std::unordered_map<u16, std::string> sAccessibilityText;
static std::string sTextInterpolated;
extern "C" void OTRMessage_InitAccessibilityText()
{
auto file = std::static_pointer_cast<Ship::Text>(
OTRGlobals::Instance->context->GetResourceManager()->LoadResource("text/accessibility_text/accessibility_text_eng"));
for (int i = 0; i < file->messages.size(); i++)
{
sAccessibilityText[file->messages[i].id] = file->messages[i].msg;
}
}
extern "C" const char * OTRMessage_GetAccessibilityText(const char * textResourcePath, u16 textId, const char * arg)
{
auto it = sAccessibilityText.find(textId);
if (it == sAccessibilityText.end())
{
return nullptr;
}
if (arg != nullptr)
{
sTextInterpolated = it->second;
std::string searchString = "$0";
size_t index = sTextInterpolated.find(searchString);
if (index != std::string::npos)
{
sTextInterpolated.replace(index, searchString.size(), std::string(arg));
return sTextInterpolated.c_str();
}
}
return it->second.c_str();
}
extern "C" void OTRMessage_Init() extern "C" void OTRMessage_Init()
{ {
auto file = std::static_pointer_cast<Ship::Text>(OTRGlobals::Instance->context->GetResourceManager()->LoadResource("text/nes_message_data_static/nes_message_data_static")); auto file = std::static_pointer_cast<Ship::Text>(OTRGlobals::Instance->context->GetResourceManager()->LoadResource("text/nes_message_data_static/nes_message_data_static"));
@ -41,4 +77,6 @@ extern "C" void OTRMessage_Init()
sStaffMessageEntryTablePtr[i].segment = file2->messages[i].msg.c_str(); sStaffMessageEntryTablePtr[i].segment = file2->messages[i].msg.c_str();
sStaffMessageEntryTablePtr[i].msgSize = file2->messages[i].msg.size(); sStaffMessageEntryTablePtr[i].msgSize = file2->messages[i].msg.size();
} }
OTRMessage_InitAccessibilityText();
} }

View file

@ -765,9 +765,46 @@ void func_8002CDE4(GlobalContext* globalCtx, TitleCardContext* titleCtx) {
titleCtx->durationTimer = titleCtx->delayTimer = titleCtx->intensity = titleCtx->alpha = 0; titleCtx->durationTimer = titleCtx->delayTimer = titleCtx->intensity = titleCtx->alpha = 0;
} }
static u8* sTitleCardText;
void TitleCard_InitBossName(GlobalContext* globalCtx, TitleCardContext* titleCtx, void* texture, s16 x, s16 y, u8 width, void TitleCard_InitBossName(GlobalContext* globalCtx, TitleCardContext* titleCtx, void* texture, s16 x, s16 y, u8 width,
u8 height) { u8 height) {
//TODO: improve
char* texturePath = (char*)texture;
s16 bossActorId = 0;
if (!strcmp(texturePath, "__OTR__objects/object_kingdodongo/gKingDodongoTitleCardTex")) {
// gKingDodongoTitleCardTex
bossActorId = ACTOR_EN_DODONGO;
} else if (!strcmp(texturePath, "__OTR__objects/object_fd/gVolvagiaBossTitleCardTex")) {
// gVolvagiaTitleCardTex
bossActorId = ACTOR_BOSS_FD;
} else if (!strcmp(texturePath, "__OTR__objects/object_ganon/gDorfTitleCardTex")) {
// gDorfTitleCardTex
bossActorId = ACTOR_BOSS_GANON;
} else if (!strcmp(texturePath, "__OTR__objects/object_ganon2/object_ganon2_Tex_021A90")) {
// object_ganon2_Tex_021A90
bossActorId = ACTOR_BOSS_GANON2;
} else if (!strcmp(texturePath, "__OTR__objects/object_goma/gGohmaTitleCardTex")) {
// gGohmaTitleCardTex
bossActorId = ACTOR_BOSS_GOMA;
} else if (!strcmp(texturePath, "__OTR__objects/object_mo/gMorphaTitleCardTex")) {
// gMorphaTitleCardTex
bossActorId = ACTOR_BOSS_MO;
} else if (!strcmp(texturePath, "__OTR__objects/object_sst/gBongoTitleCardTex")) {
// gBongoTitleCardTex
bossActorId = ACTOR_BOSS_SST;
} else if (!strcmp(texturePath, "__OTR__objects/object_tw/gTwinrovaTitleCardTex")) {
// gTwinrovaTitleCardTex
bossActorId = ACTOR_BOSS_TW;
} else if (!strcmp(texturePath, "__OTR__objects/object_bv/gBarinadeTitleCardTex")) {
// gBarinadeTitleCardTex
bossActorId = ACTOR_BOSS_VA;
} else if (!strcmp(texturePath, "__OTR__objects/object_fhg/gPhantomGanonTitleCardTex")) {
// gPhantomGanonTitleCardTex
bossActorId = ACTOR_EN_FHG;
}
if (ResourceMgr_OTRSigCheck(texture)) if (ResourceMgr_OTRSigCheck(texture))
texture = ResourceMgr_LoadTexByName(texture); texture = ResourceMgr_LoadTexByName(texture);
@ -778,6 +815,11 @@ void TitleCard_InitBossName(GlobalContext* globalCtx, TitleCardContext* titleCtx
titleCtx->height = height; titleCtx->height = height;
titleCtx->durationTimer = 80; titleCtx->durationTimer = 80;
titleCtx->delayTimer = 0; titleCtx->delayTimer = 0;
if (bossActorId != 0 && CVar_GetS32("gMessageTTS", 0)) {
sTitleCardText = OTRMessage_GetAccessibilityText("text/accessibility_text/accessibility_text_eng",
0x1000 + bossActorId, NULL);
}
} }
void TitleCard_InitPlaceName(GlobalContext* globalCtx, TitleCardContext* titleCtx, char* texture, s32 x, s32 y, void TitleCard_InitPlaceName(GlobalContext* globalCtx, TitleCardContext* titleCtx, char* texture, s32 x, s32 y,
@ -995,10 +1037,19 @@ void TitleCard_InitPlaceName(GlobalContext* globalCtx, TitleCardContext* titleCt
titleCtx->height = height; titleCtx->height = height;
titleCtx->durationTimer = 80; titleCtx->durationTimer = 80;
titleCtx->delayTimer = delay; titleCtx->delayTimer = delay;
if (CVar_GetS32("gMessageTTS", 0)) {
sTitleCardText =
OTRMessage_GetAccessibilityText("text/accessibility_text/accessibility_text_eng", 0x0300 + globalCtx->sceneNum, NULL);
}
} }
void TitleCard_Update(GlobalContext* globalCtx, TitleCardContext* titleCtx) { void TitleCard_Update(GlobalContext* globalCtx, TitleCardContext* titleCtx) {
if (DECR(titleCtx->delayTimer) == 0) { if (DECR(titleCtx->delayTimer) == 0) {
if (titleCtx->durationTimer == 80 && CVar_GetS32("gMessageTTS", 0)) {
OTRTextToSpeechCallback(sTitleCardText);
}
if (DECR(titleCtx->durationTimer) == 0) { if (DECR(titleCtx->durationTimer) == 0) {
Math_StepToS(&titleCtx->alpha, 0, 30); Math_StepToS(&titleCtx->alpha, 0, 30);
Math_StepToS(&titleCtx->intensity, 0, 70); Math_StepToS(&titleCtx->intensity, 0, 70);

View file

@ -3011,6 +3011,7 @@ void Message_Draw(GlobalContext* globalCtx) {
void Message_TTS_Decode(u8* srcBuf, u8* dstBuf, u32 srcOffset, u32 size) { void Message_TTS_Decode(u8* srcBuf, u8* dstBuf, u32 srcOffset, u32 size) {
u32 dstIdx = 0; u32 dstIdx = 0;
bool isListingChoices = false;
for (u32 i = 0; i < size; i++) { for (u32 i = 0; i < size; i++) {
u8 currChar = srcBuf[i + srcOffset]; u8 currChar = srcBuf[i + srcOffset];
@ -3018,7 +3019,12 @@ void Message_TTS_Decode(u8* srcBuf, u8* dstBuf, u32 srcOffset, u32 size) {
if (currChar < ' ') { if (currChar < ' ') {
switch (currChar) { switch (currChar) {
case MESSAGE_NEWLINE: case MESSAGE_NEWLINE:
dstBuf[dstIdx++] = ' '; dstBuf[dstIdx++] = (isListingChoices) ? '\n' : ' ';
break;
case MESSAGE_THREE_CHOICE:
case MESSAGE_TWO_CHOICE:
dstBuf[dstIdx++] = '\n';
isListingChoices = true;
break; break;
case MESSAGE_COLOR: case MESSAGE_COLOR:
case MESSAGE_SHIFT: case MESSAGE_SHIFT:
@ -3053,7 +3059,11 @@ void Message_TTS_Update(GlobalContext* globalCtx) {
} else if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING || msgCtx->msgMode == MSGMODE_OCARINA_STARTING || } else if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING || msgCtx->msgMode == MSGMODE_OCARINA_STARTING ||
msgCtx->msgMode == MSGMODE_OCARINA_PLAYING || msgCtx->msgMode == MSGMODE_TEXT_AWAIT_NEXT || msgCtx->msgMode == MSGMODE_OCARINA_PLAYING || msgCtx->msgMode == MSGMODE_TEXT_AWAIT_NEXT ||
msgCtx->msgMode == MSGMODE_TEXT_DONE || msgCtx->msgMode == MSGMODE_DISPLAY_SONG_PLAYED_TEXT || msgCtx->msgMode == MSGMODE_TEXT_DONE || msgCtx->msgMode == MSGMODE_DISPLAY_SONG_PLAYED_TEXT ||
msgCtx->msgMode == MSGMODE_TEXT_DELAYED_BREAK) { msgCtx->msgMode == MSGMODE_TEXT_DELAYED_BREAK || msgCtx->msgMode == MSGMODE_SONG_PLAYED_ACT_BEGIN ||
msgCtx->msgMode == MSGMODE_SONG_PLAYED_ACT || msgCtx->msgMode == MSGMODE_SONG_PLAYBACK_STARTING ||
msgCtx->msgMode == MSGMODE_SONG_PLAYBACK || msgCtx->msgMode == MSGMODE_SONG_DEMONSTRATION_STARTING ||
msgCtx->msgMode == MSGMODE_SONG_DEMONSTRATION_SELECT_INSTRUMENT ||
msgCtx->msgMode == MSGMODE_SONG_DEMONSTRATION) {
if (sTtsHasNewMessage == 1) { if (sTtsHasNewMessage == 1) {
sTtsHasNewMessage = 0; sTtsHasNewMessage = 0;
sTtsHasMessage = 1; sTtsHasMessage = 1;

View file

@ -172,51 +172,21 @@ void KaleidoScope_DrawQuestStatus(GlobalContext* globalCtx, GraphicsContext* gfx
pauseCtx->cursorItem[pauseCtx->pageIndex] = phi_s0_2; pauseCtx->cursorItem[pauseCtx->pageIndex] = phi_s0_2;
pauseCtx->cursorSlot[pauseCtx->pageIndex] = sp216; pauseCtx->cursorSlot[pauseCtx->pageIndex] = sp216;
if (CVar_GetS32("gMessageTTS", 0)) {
u8 arg[8]; // at least big enough where no s8 string will overflow
switch (pauseCtx->cursorItem[PAUSE_QUEST]) { switch (pauseCtx->cursorItem[PAUSE_QUEST]) {
case ITEM_KOKIRI_EMERALD: case ITEM_SKULL_TOKEN:
OTRTextToSpeechCallback("Kokiri Emerald"); sprintf(arg, "%d", gSaveContext.inventory.gsTokens);
break; break;
case ITEM_GORON_RUBY: case ITEM_HEART_CONTAINER:
OTRTextToSpeechCallback("Goron Ruby"); sprintf(arg, "%d of 4", (((gSaveContext.inventory.questItems & 0xF0000000) & 0xF0000000) >> 0x1C));
break; break;
case ITEM_ZORA_SAPPHIRE:
OTRTextToSpeechCallback("Zora Sapphire");
break;
case ITEM_MEDALLION_LIGHT:
OTRTextToSpeechCallback("Light Medallion");
break;
case ITEM_MEDALLION_FOREST:
OTRTextToSpeechCallback("Forest Medallion");
break;
case ITEM_MEDALLION_FIRE:
OTRTextToSpeechCallback("Fire Medallion");
break;
case ITEM_MEDALLION_WATER:
OTRTextToSpeechCallback("Water Medallion");
break;
case ITEM_MEDALLION_SHADOW:
OTRTextToSpeechCallback("Shadow Medallion");
break;
case ITEM_MEDALLION_SPIRIT:
OTRTextToSpeechCallback("Spirit Medallion");
break;
case ITEM_GERUDO_CARD:
OTRTextToSpeechCallback("Gerudo Card");
break;
case ITEM_STONE_OF_AGONY:
OTRTextToSpeechCallback("Stone of Agony");
break;
case ITEM_HEART_PIECE:
OTRTextToSpeechCallback("Heart Pieces");
break;
case ITEM_SKULL_TOKEN: {
int tokens = gSaveContext.inventory.gsTokens;
OTRTextToSpeechCallback("Skulltula Tokens");
break;
}
default: default:
OTRTextToSpeechCallback("Unknown Item"); arg[0] = '\0';
break; }
OTRTextToSpeechCallback(OTRMessage_GetAccessibilityText("text/accessibility_text/accessibility_text_eng",
pauseCtx->cursorItem[PAUSE_QUEST]),
arg);
} }
} }

View file

@ -509,100 +509,9 @@ void KaleidoScope_DrawEquipment(GlobalContext* globalCtx) {
if (oldCursorPoint != pauseCtx->cursorPoint[PAUSE_EQUIP]) { if (oldCursorPoint != pauseCtx->cursorPoint[PAUSE_EQUIP]) {
Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
switch (pauseCtx->cursorItem[PAUSE_EQUIP]) { if (CVar_GetS32("gMessageTTS", 0)) {
case ITEM_SWORD_KOKIRI: OTRTextToSpeechCallback(OTRMessage_GetAccessibilityText("text/accessibility_text/accessibility_text_eng",
OTRTextToSpeechCallback("Kokiri Sword"); pauseCtx->cursorItem[PAUSE_EQUIP], NULL));
break;
case ITEM_SWORD_MASTER:
OTRTextToSpeechCallback("Master Sword");
break;
case ITEM_HEART_PIECE_2:
OTRTextToSpeechCallback("Biggoron's Sword");
break;
case ITEM_SWORD_BGS:
OTRTextToSpeechCallback("Giant's Knife");
break;
case ITEM_SWORD_KNIFE:
OTRTextToSpeechCallback("Broken Giant's Knife");
break;
case ITEM_SHIELD_DEKU:
OTRTextToSpeechCallback("Deku Shield");
break;
case ITEM_SHIELD_HYLIAN:
OTRTextToSpeechCallback("Hylian Shield");
break;
case ITEM_SHIELD_MIRROR:
OTRTextToSpeechCallback("Mirror Shield");
break;
case ITEM_TUNIC_KOKIRI:
OTRTextToSpeechCallback("Kokiri Tunic");
break;
case ITEM_TUNIC_GORON:
OTRTextToSpeechCallback("Goron Tunic");
break;
case ITEM_TUNIC_ZORA:
OTRTextToSpeechCallback("Zora Tunic");
break;
case ITEM_BOOTS_KOKIRI:
OTRTextToSpeechCallback("Kokiri Boots");
break;
case ITEM_BOOTS_IRON:
OTRTextToSpeechCallback("Iron Boots");
break;
case ITEM_BOOTS_HOVER:
OTRTextToSpeechCallback("Hover Boots");
break;
case ITEM_BULLET_BAG_30:
OTRTextToSpeechCallback("Bullet Bag");
break;
case ITEM_BULLET_BAG_40:
OTRTextToSpeechCallback("Bigger Bullet Bag");
break;
case ITEM_BULLET_BAG_50:
OTRTextToSpeechCallback("Biggest Bullet Bag");
break;
case ITEM_QUIVER_30:
OTRTextToSpeechCallback("Quiver");
break;
case ITEM_QUIVER_40:
OTRTextToSpeechCallback("Big Quiver");
break;
case ITEM_QUIVER_50:
OTRTextToSpeechCallback("Biggest Quiver");
break;
case ITEM_BOMB_BAG_20:
OTRTextToSpeechCallback("Bomb Bag");
break;
case ITEM_BOMB_BAG_30:
OTRTextToSpeechCallback("Big Bomb Bag");
break;
case ITEM_BOMB_BAG_40:
OTRTextToSpeechCallback("Biggest Bomb Bag");
break;
case ITEM_WALLET_ADULT:
OTRTextToSpeechCallback("Adult Wallet");
break;
case ITEM_WALLET_GIANT:
OTRTextToSpeechCallback("Giant Wallet");
break;
case ITEM_SCALE_SILVER:
OTRTextToSpeechCallback("Silver Scale");
break;
case ITEM_SCALE_GOLDEN:
OTRTextToSpeechCallback("Golden Scale");
break;
case ITEM_BRACELET:
OTRTextToSpeechCallback("Goron Bracelet");
break;
case ITEM_GAUNTLETS_SILVER:
OTRTextToSpeechCallback("Silver Gauntlets");
break;
case ITEM_GAUNTLETS_GOLD:
OTRTextToSpeechCallback("Golden Gauntlets");
break;
default:
OTRTextToSpeechCallback("Unknown Item");
break;
} }
} }
} else if ((pauseCtx->unk_1E4 == 7) && (pauseCtx->pageIndex == PAUSE_EQUIP)) { } else if ((pauseCtx->unk_1E4 == 7) && (pauseCtx->pageIndex == PAUSE_EQUIP)) {

View file

@ -409,172 +409,25 @@ void KaleidoScope_DrawItemSelect(GlobalContext* globalCtx) {
if (oldCursorPoint != pauseCtx->cursorPoint[PAUSE_ITEM]) { if (oldCursorPoint != pauseCtx->cursorPoint[PAUSE_ITEM]) {
Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
if (CVar_GetS32("gMessageTTS", 0)) {
u8 arg[8]; // at least big enough where no s8 string will overflow
switch (pauseCtx->cursorItem[PAUSE_ITEM]) { switch (pauseCtx->cursorItem[PAUSE_ITEM]) {
case ITEM_STICK: case ITEM_STICK:
OTRTextToSpeechCallback("Deku Stick");
break;
case ITEM_NUT: case ITEM_NUT:
OTRTextToSpeechCallback("Deku Nut");
break;
case ITEM_BOMB: case ITEM_BOMB:
OTRTextToSpeechCallback("Bomb");
break;
case ITEM_BOW:
OTRTextToSpeechCallback("Fairy Bow");
break;
case ITEM_ARROW_FIRE:
OTRTextToSpeechCallback("Fire Arrow");
break;
case ITEM_DINS_FIRE:
OTRTextToSpeechCallback("Din's Fire");
break;
case ITEM_SLINGSHOT:
OTRTextToSpeechCallback("Slingshot");
break;
case ITEM_OCARINA_FAIRY:
OTRTextToSpeechCallback("Fairy Ocarina");
break;
case ITEM_OCARINA_TIME:
OTRTextToSpeechCallback("Ocarina of Time");
break;
case ITEM_BOMBCHU: case ITEM_BOMBCHU:
OTRTextToSpeechCallback("Bombchu"); case ITEM_SLINGSHOT:
break; case ITEM_BOW:
case ITEM_HOOKSHOT: sprintf(arg, "%d", AMMO(pauseCtx->cursorItem[PAUSE_ITEM]));
OTRTextToSpeechCallback("Hookshot");
break;
case ITEM_LONGSHOT:
OTRTextToSpeechCallback("Longshot");
break;
case ITEM_ARROW_ICE:
OTRTextToSpeechCallback("Ice Arrow");
break;
case ITEM_FARORES_WIND:
OTRTextToSpeechCallback("Farore's Wind");
break;
case ITEM_BOOMERANG:
OTRTextToSpeechCallback("Boomerang");
break;
case ITEM_LENS:
OTRTextToSpeechCallback("Lens of Truth");
break; break;
case ITEM_BEAN: case ITEM_BEAN:
OTRTextToSpeechCallback("Magic Bean"); sprintf(arg, "%d", BEANS_BOUGHT);
break;
case ITEM_HAMMER:
OTRTextToSpeechCallback("Megaton Hammer");
break;
case ITEM_ARROW_LIGHT:
OTRTextToSpeechCallback("Light Arrow");
break;
case ITEM_NAYRUS_LOVE:
OTRTextToSpeechCallback("Nayru's Love");
break;
case ITEM_POTION_GREEN:
OTRTextToSpeechCallback("Bottled Green Potion");
break;
case ITEM_POTION_RED:
OTRTextToSpeechCallback("Bottled Red Potion");
break;
case ITEM_POTION_BLUE:
OTRTextToSpeechCallback("Bottled Blue Potion");
break;
case ITEM_MILK:
OTRTextToSpeechCallback("Bottled Lon Lon Milk");
break;
case ITEM_MILK_HALF:
OTRTextToSpeechCallback("Bottled Lon Lon Milk (Half)");
break;
case ITEM_FAIRY:
OTRTextToSpeechCallback("Bottled Fairy");
break;
case ITEM_BUG:
OTRTextToSpeechCallback("Bottled Bugs");
break;
case ITEM_FISH:
OTRTextToSpeechCallback("Bottled Fish");
break;
case ITEM_POE:
OTRTextToSpeechCallback("Bottled Poe");
break;
case ITEM_BIG_POE:
OTRTextToSpeechCallback("Bottled Big Poe");
break;
case ITEM_BLUE_FIRE:
OTRTextToSpeechCallback("Bottled Blue Fire");
break;
case ITEM_LETTER_RUTO:
OTRTextToSpeechCallback("Bottled Ruto's Letter");
break;
case ITEM_WEIRD_EGG:
OTRTextToSpeechCallback("Weird Egg");
break;
case ITEM_CHICKEN:
OTRTextToSpeechCallback("Cucco");
break;
case ITEM_LETTER_ZELDA:
OTRTextToSpeechCallback("Zelda's Letter");
break;
case ITEM_MASK_KEATON:
OTRTextToSpeechCallback("Keaton Mask");
break;
case ITEM_MASK_SKULL:
OTRTextToSpeechCallback("Skull Mask");
break;
case ITEM_MASK_SPOOKY:
OTRTextToSpeechCallback("Spooky Mask");
break;
case ITEM_MASK_BUNNY:
OTRTextToSpeechCallback("Bunny Hood");
break;
case ITEM_MASK_TRUTH:
OTRTextToSpeechCallback("Mask of Truth");
break;
case ITEM_MASK_GORON:
OTRTextToSpeechCallback("Goron Mask");
break;
case ITEM_MASK_ZORA:
OTRTextToSpeechCallback("Zora Mask");
break;
case ITEM_MASK_GERUDO:
OTRTextToSpeechCallback("Gerudo Mask");
break;
case ITEM_POCKET_EGG:
OTRTextToSpeechCallback("Pocket Egg");
break;
case ITEM_POCKET_CUCCO:
OTRTextToSpeechCallback("Pocket Cucco");
break;
case ITEM_COJIRO:
OTRTextToSpeechCallback("Cojiro");
break;
case ITEM_ODD_MUSHROOM:
OTRTextToSpeechCallback("Odd Mushroom");
break;
case ITEM_ODD_POTION:
OTRTextToSpeechCallback("Odd Potion");
break;
case ITEM_SAW:
OTRTextToSpeechCallback("Poacher's Saw");
break;
case ITEM_PRESCRIPTION:
OTRTextToSpeechCallback("Prescription");
break;
case ITEM_FROG:
OTRTextToSpeechCallback("Eyeball Frog");
break;
case ITEM_EYEDROPS:
OTRTextToSpeechCallback("World's Finest Eye Drops");
break;
case ITEM_CLAIM_CHECK:
OTRTextToSpeechCallback("Claim Check");
break;
case ITEM_BOTTLE:
OTRTextToSpeechCallback("Empty Bottle");
break; break;
default: default:
OTRTextToSpeechCallback("Unknown Item"); arg[0] = '\0';
break; }
OTRTextToSpeechCallback(OTRMessage_GetAccessibilityText("text/accessibility_text/accessibility_text_eng",
pauseCtx->cursorItem[PAUSE_ITEM]), arg);
} }
} }
} else if ((pauseCtx->unk_1E4 == 3) && (pauseCtx->pageIndex == PAUSE_ITEM)) { } else if ((pauseCtx->unk_1E4 == 3) && (pauseCtx->pageIndex == PAUSE_ITEM)) {

View file

@ -208,6 +208,15 @@ void KaleidoScope_DrawDungeonMap(GlobalContext* globalCtx, GraphicsContext* gfxC
} }
} }
if (oldCursorPoint != pauseCtx->cursorPoint[PAUSE_MAP]) {
if (CVar_GetS32("gMessageTTS", 0)) {
if (pauseCtx->cursorItem[PAUSE_MAP] != PAUSE_ITEM_NONE) {
OTRTextToSpeechCallback(OTRMessage_GetAccessibilityText(
"text/accessibility_text/accessibility_text_eng", pauseCtx->cursorItem[PAUSE_MAP], NULL));
}
}
}
gDPPipeSync(POLY_KAL_DISP++); gDPPipeSync(POLY_KAL_DISP++);
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 255, 255, 255, pauseCtx->alpha); gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 255, 255, 255, pauseCtx->alpha);
gDPSetCombineMode(POLY_KAL_DISP++, G_CC_MODULATEIA, G_CC_MODULATEIA); gDPSetCombineMode(POLY_KAL_DISP++, G_CC_MODULATEIA, G_CC_MODULATEIA);
@ -482,6 +491,11 @@ void KaleidoScope_DrawWorldMap(GlobalContext* globalCtx, GraphicsContext* gfxCtx
if (oldCursorPoint != pauseCtx->cursorPoint[PAUSE_WORLD_MAP]) { if (oldCursorPoint != pauseCtx->cursorPoint[PAUSE_WORLD_MAP]) {
Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
if (CVar_GetS32("gMessageTTS", 0)) {
OTRTextToSpeechCallback(OTRMessage_GetAccessibilityText(
"text/accessibility_text/accessibility_text_eng", 0x0100 + pauseCtx->cursorPoint[PAUSE_WORLD_MAP], NULL));
}
} }
} }