This commit is contained in:
Philip Dubé 2025-04-22 06:00:47 +00:00 committed by GitHub
commit 8dc675b694
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 19 additions and 0 deletions

View file

@ -62,6 +62,7 @@ DEFINE_HOOK(OnUpdateFileTargetSelection, (uint8_t optionIndex));
DEFINE_HOOK(OnUpdateFileLanguageSelection, (uint8_t optionIndex)); DEFINE_HOOK(OnUpdateFileLanguageSelection, (uint8_t optionIndex));
DEFINE_HOOK(OnUpdateFileQuestSelection, (uint8_t questIndex)); DEFINE_HOOK(OnUpdateFileQuestSelection, (uint8_t questIndex));
DEFINE_HOOK(OnUpdateFileBossRushOptionSelection, (uint8_t optionIndex, uint8_t optionValue)); DEFINE_HOOK(OnUpdateFileBossRushOptionSelection, (uint8_t optionIndex, uint8_t optionValue));
DEFINE_HOOK(OnUpdateFileRandomizerOptionSelection, (uint8_t optionIndex));
DEFINE_HOOK(OnUpdateFileNameSelection, (int16_t charCode)); DEFINE_HOOK(OnUpdateFileNameSelection, (int16_t charCode));
DEFINE_HOOK(OnSetGameLanguage, ()); DEFINE_HOOK(OnSetGameLanguage, ());

View file

@ -276,6 +276,10 @@ void GameInteractor_ExecuteOnUpdateFileBossRushOptionSelection(uint8_t optionInd
optionValue); optionValue);
} }
void GameInteractor_ExecuteOnUpdateFileRandomizerOptionSelection(uint8_t optionIndex) {
GameInteractor::Instance->ExecuteHooks<GameInteractor::OnUpdateFileRandomizerOptionSelection>(optionIndex);
}
void GameInteractor_ExecuteOnUpdateFileNameSelection(int16_t charCode) { void GameInteractor_ExecuteOnUpdateFileNameSelection(int16_t charCode) {
GameInteractor::Instance->ExecuteHooks<GameInteractor::OnUpdateFileNameSelection>(charCode); GameInteractor::Instance->ExecuteHooks<GameInteractor::OnUpdateFileNameSelection>(charCode);
} }

View file

@ -69,6 +69,7 @@ void GameInteractor_ExecuteOnUpdateFileTargetSelection(uint8_t optionIndex);
void GameInteractor_ExecuteOnUpdateFileLanguageSelection(uint8_t optionIndex); void GameInteractor_ExecuteOnUpdateFileLanguageSelection(uint8_t optionIndex);
void GameInteractor_ExecuteOnUpdateFileQuestSelection(uint8_t questIndex); void GameInteractor_ExecuteOnUpdateFileQuestSelection(uint8_t questIndex);
void GameInteractor_ExecuteOnUpdateFileBossRushOptionSelection(uint8_t optionIndex, uint8_t optionValue); void GameInteractor_ExecuteOnUpdateFileBossRushOptionSelection(uint8_t optionIndex, uint8_t optionValue);
void GameInteractor_ExecuteOnUpdateFileRandomizerOptionSelection(uint8_t optionIndex);
void GameInteractor_ExecuteOnUpdateFileNameSelection(int16_t charCode); void GameInteractor_ExecuteOnUpdateFileNameSelection(int16_t charCode);
// MARK: - Game // MARK: - Game

View file

@ -12,6 +12,7 @@
#include "message_data_static.h" #include "message_data_static.h"
#include "overlays/gamestates/ovl_file_choose/file_choose.h" #include "overlays/gamestates/ovl_file_choose/file_choose.h"
#include "soh/Enhancements/boss-rush/BossRush.h" #include "soh/Enhancements/boss-rush/BossRush.h"
#include "soh/Enhancements/FileSelectEnhancements.h"
#include "soh/resource/type/SohResourceType.h" #include "soh/resource/type/SohResourceType.h"
extern "C" { extern "C" {
@ -844,6 +845,16 @@ void RegisterOnUpdateMainMenuSelection() {
SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode());
}); });
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnUpdateFileRandomizerOptionSelection>(
[](uint8_t optionIndex) {
if (!CVarGetInteger(CVAR_SETTING("A11yTTS"), 0))
return;
uint8_t language = (gSaveContext.language == LANGUAGE_JPN) ? LANGUAGE_ENG : gSaveContext.language;
auto optionName = SohFileSelect_GetSettingText(optionIndex, language);
SpeechSynthesizer::Instance->Speak(optionName, GetLanguageCode());
});
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnUpdateFileNameSelection>([](int16_t charCode) { GameInteractor::Instance->RegisterGameHook<GameInteractor::OnUpdateFileNameSelection>([](int16_t charCode) {
if (!CVarGetInteger(CVAR_SETTING("A11yTTS"), 0)) if (!CVarGetInteger(CVAR_SETTING("A11yTTS"), 0))
return; return;

View file

@ -1526,6 +1526,8 @@ void FileChoose_UpdateRandomizerMenu(GameState* thisx) {
} }
} }
GameInteractor_ExecuteOnUpdateFileRandomizerOptionSelection(this->randomizerIndex);
Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} }