Fixes bug with generating seed on the choose-quest screen. (#1892)

This commit is contained in:
Christopher Leggett 2022-11-02 17:30:44 -04:00 committed by GitHub
parent 3b7b4913eb
commit d49a1cd6b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -419,20 +419,7 @@ void DrawSeedHashSprites(FileChooseContext* this) {
u8 generating;
/**
* Update the cursor and wait for the player to select a button to change menus accordingly.
* If an empty file is selected, enter the name entry config mode.
* If an occupied file is selected, enter the `Select` menu mode.
* If copy, erase, or options is selected, set config mode accordingly.
* Lastly, set any warning labels if appropriate.
* Update function for `CM_MAIN_MENU`
*/
void FileChoose_UpdateMainMenu(GameState* thisx) {
static u8 emptyName[] = { 0x3E, 0x3E, 0x3E, 0x3E, 0x3E, 0x3E, 0x3E, 0x3E };
FileChooseContext* this = (FileChooseContext*)thisx;
Input* input = &this->state.input[0];
bool dpad = CVar_GetS32("gDpadText", 0);
void FileChoose_UpdateRandomizer() {
if (CVar_GetS32("gRandoGenerating", 0) != 0 && generating == 0) {
generating = 1;
func_800F5E18(SEQ_PLAYER_BGM_MAIN, NA_BGM_HORSE, 0, 7, 1);
@ -451,15 +438,13 @@ void FileChoose_UpdateMainMenu(GameState* thisx) {
fileSelectSpoilerFileLoaded = false;
}
if ((CVar_GetS32("gNewFileDropped", 0) != 0) ||
(CVar_GetS32("gNewSeedGenerated", 0) != 0) ||
if ((CVar_GetS32("gNewFileDropped", 0) != 0) || (CVar_GetS32("gNewSeedGenerated", 0) != 0) ||
(!fileSelectSpoilerFileLoaded && SpoilerFileExists(CVar_GetString("gSpoilerLog", "")))) {
if (CVar_GetS32("gNewFileDropped", 0) != 0) {
CVar_SetString("gSpoilerLog", CVar_GetString("gDroppedFile", "None"));
}
bool silent = true;
if ((CVar_GetS32("gNewFileDropped", 0) != 0) ||
(CVar_GetS32("gNewSeedGenerated", 0) != 0)) {
if ((CVar_GetS32("gNewFileDropped", 0) != 0) || (CVar_GetS32("gNewSeedGenerated", 0) != 0)) {
silent = false;
}
CVar_SetS32("gNewSeedGenerated", 0);
@ -475,6 +460,23 @@ void FileChoose_UpdateMainMenu(GameState* thisx) {
Randomizer_LoadMasterQuestDungeons(fileLoc);
fileSelectSpoilerFileLoaded = true;
}
}
/**
* Update the cursor and wait for the player to select a button to change menus accordingly.
* If an empty file is selected, enter the name entry config mode.
* If an occupied file is selected, enter the `Select` menu mode.
* If copy, erase, or options is selected, set config mode accordingly.
* Lastly, set any warning labels if appropriate.
* Update function for `CM_MAIN_MENU`
*/
void FileChoose_UpdateMainMenu(GameState* thisx) {
static u8 emptyName[] = { 0x3E, 0x3E, 0x3E, 0x3E, 0x3E, 0x3E, 0x3E, 0x3E };
FileChooseContext* this = (FileChooseContext*)thisx;
Input* input = &this->state.input[0];
bool dpad = CVar_GetS32("gDpadText", 0);
FileChoose_UpdateRandomizer();
if (CHECK_BTN_ALL(input->press.button, BTN_START) || CHECK_BTN_ALL(input->press.button, BTN_A)) {
if (this->buttonIndex <= FS_BTN_MAIN_FILE_3) {
@ -656,6 +658,8 @@ void FileChoose_UpdateQuestMenu(GameState* thisx) {
s8 i = 0;
bool dpad = CVar_GetS32("gDpadText", 0);(dpad && CHECK_BTN_ANY(input->press.button, BTN_DDOWN | BTN_DUP));
FileChoose_UpdateRandomizer();
if (ABS(this->stickRelX) > 30 || (dpad && CHECK_BTN_ANY(input->press.button, BTN_DLEFT | BTN_DRIGHT))) {
if (this->stickRelX > 30 || (dpad && CHECK_BTN_ANY(input->press.button, BTN_DRIGHT))) {
this->questType[this->buttonIndex] += 1;