Added "OnRandomizerGeneration" Hook.

* It is executed on Randomizer Generation.
This commit is contained in:
Glought 2025-04-13 11:51:02 -07:00
commit 1ec4ca4344
4 changed files with 9 additions and 6 deletions

View file

@ -62,6 +62,7 @@ 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(OnUpdateFileNameSelection, (int16_t charCode)); DEFINE_HOOK(OnUpdateFileNameSelection, (int16_t charCode));
DEFINE_HOOK(OnRandomizerGeneration, ());
DEFINE_HOOK(OnSetGameLanguage, ()); DEFINE_HOOK(OnSetGameLanguage, ());
DEFINE_HOOK(OnFileDropped, (std::string filePath)); DEFINE_HOOK(OnFileDropped, (std::string filePath));

View file

@ -274,6 +274,10 @@ void GameInteractor_ExecuteOnUpdateFileNameSelection(int16_t charCode) {
GameInteractor::Instance->ExecuteHooks<GameInteractor::OnUpdateFileNameSelection>(charCode); GameInteractor::Instance->ExecuteHooks<GameInteractor::OnUpdateFileNameSelection>(charCode);
} }
void GameInteractor_ExecuteOnRandomizerGeneration() {
GameInteractor::Instance->ExecuteHooks<GameInteractor::OnRandomizerGeneration>();
}
// MARK: - Game // MARK: - Game
void GameInteractor_ExecuteOnSetGameLanguage() { void GameInteractor_ExecuteOnSetGameLanguage() {

View file

@ -69,6 +69,7 @@ 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_ExecuteOnUpdateFileNameSelection(int16_t charCode); void GameInteractor_ExecuteOnUpdateFileNameSelection(int16_t charCode);
void GameInteractor_ExecuteOnRandomizerGeneration();
// MARK: - Game // MARK: - Game
void GameInteractor_ExecuteOnSetGameLanguage(); void GameInteractor_ExecuteOnSetGameLanguage();

View file

@ -3611,12 +3611,9 @@ bool GenerateRandomizer(std::string seed /*= ""*/) {
} }
if (CVarGetInteger(CVAR_GENERAL("RandoGenerating"), 0) == 0) { if (CVarGetInteger(CVAR_GENERAL("RandoGenerating"), 0) == 0) {
randoThread = std::thread(&GenerateRandomizerImgui, seed); randoThread = std::thread(&GenerateRandomizerImgui, seed);
if (CVarGetInteger(CVAR_AUDIO("RandomizeAllOnNewRandoGen"), 0) == 1) {
AudioEditor_RandomizeAll(); GameInteractor_ExecuteOnRandomizerGeneration();
}
if (CVarGetInteger(CVAR_COSMETIC("RandomizeAllOnNewRandoGen"), 0) == 1) {
CosmeticsEditor_RandomizeAll();
}
return true; return true;
} }
return false; return false;