Fix Save Prompt Cursor on Quest/Misc Item Tracker Windows (#4694)

* Fix quest menu cursor "moving" in the background in the save game prompt.
Fix misc item tracker also being able to select R and L/Z in save prompt.
Include MigrationAction entry removal from item count fix PR.

* Fix formatting.
This commit is contained in:
Malkierian 2024-12-18 15:03:51 -07:00 committed by GitHub
parent 03e9331d7e
commit 3419928f5d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 119 additions and 112 deletions

View File

@ -191,37 +191,41 @@ namespace Rando {
// it would be a much larger Kaleido change. // it would be a much larger Kaleido change.
bool shouldScroll = false; bool shouldScroll = false;
bool dpad = CVarGetInteger(CVAR_SETTING("DPadOnPause"), 0); bool dpad = CVarGetInteger(CVAR_SETTING("DPadOnPause"), 0);
if ((!pauseCtx->unk_1E4 || (pauseCtx->unk_1E4 == 5) || (pauseCtx->unk_1E4 == 8)) && if (((pauseCtx->unk_1E4 == 0) || (pauseCtx->unk_1E4 == 5) || (pauseCtx->unk_1E4 == 8)) &&
(pauseCtx->pageIndex == PAUSE_QUEST)) { (pauseCtx->pageIndex == PAUSE_QUEST)) {
if (pauseCtx->cursorSpecialPos == 0) { if (!((pauseCtx->state != 6) || ((pauseCtx->stickRelX == 0) && (pauseCtx->stickRelY == 0)))) {
if ((pauseCtx->stickRelY > 30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DUP))) { if (pauseCtx->cursorSpecialPos == 0) {
if (mTopIndex > 0) { if ((pauseCtx->stickRelY > 30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DUP))) {
mTopIndex--; if (mTopIndex > 0) {
shouldScroll = true; mTopIndex--;
shouldScroll = true;
}
} else if ((pauseCtx->stickRelY < -30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DDOWN))) {
if (mTopIndex + mNumVisible < mEntries.size()) {
mTopIndex++;
shouldScroll = true;
}
} }
} else if ((pauseCtx->stickRelY < -30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DDOWN))) { if ((pauseCtx->stickRelX < -30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DLEFT))) {
if (mTopIndex + mNumVisible < mEntries.size()) { KaleidoScope_MoveCursorToSpecialPos(play, PAUSE_CURSOR_PAGE_LEFT);
mTopIndex++; pauseCtx->unk_1E4 = 0;
shouldScroll = true; } else if ((pauseCtx->stickRelX > 30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DRIGHT))) {
KaleidoScope_MoveCursorToSpecialPos(play, PAUSE_CURSOR_PAGE_RIGHT);
pauseCtx->unk_1E4 = 0;
}
} else if (pauseCtx->cursorSpecialPos == PAUSE_CURSOR_PAGE_LEFT) {
if ((pauseCtx->stickRelX > 30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DRIGHT))) {
pauseCtx->cursorSpecialPos = 0;
Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
}
} else if (pauseCtx->cursorSpecialPos == PAUSE_CURSOR_PAGE_RIGHT) {
if ((pauseCtx->stickRelX < -30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DLEFT))) {
pauseCtx->cursorSpecialPos = 0;
Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} }
} }
if ((pauseCtx->stickRelX < -30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DLEFT))) { } else if (pauseCtx->cursorSpecialPos != 0 && pauseCtx->state == 7) {
KaleidoScope_MoveCursorToSpecialPos(play, PAUSE_CURSOR_PAGE_LEFT); pauseCtx->cursorSpecialPos = 0;
pauseCtx->unk_1E4 = 0;
} else if ((pauseCtx->stickRelX > 30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DRIGHT))) {
KaleidoScope_MoveCursorToSpecialPos(play, PAUSE_CURSOR_PAGE_RIGHT);
pauseCtx->unk_1E4 = 0;
}
} else if (pauseCtx->cursorSpecialPos == PAUSE_CURSOR_PAGE_LEFT) {
if ((pauseCtx->stickRelX > 30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DRIGHT))) {
pauseCtx->cursorSpecialPos = 0;
Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
}
} else if (pauseCtx->cursorSpecialPos == PAUSE_CURSOR_PAGE_RIGHT) {
if ((pauseCtx->stickRelX < -30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DLEFT))) {
pauseCtx->cursorSpecialPos = 0;
Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
}
} }
} }
int yOffset = 2; int yOffset = 2;

View File

@ -260,7 +260,6 @@ namespace SOH {
{ MigrationAction::Rename, "gHurtContainer", "gEnhancements.HurtContainer" }, { MigrationAction::Rename, "gHurtContainer", "gEnhancements.HurtContainer" },
{ MigrationAction::Rename, "gHyperBosses", "gEnhancements.HyperBosses" }, { MigrationAction::Rename, "gHyperBosses", "gEnhancements.HyperBosses" },
{ MigrationAction::Rename, "gHyperEnemies", "gEnhancements.HyperEnemies" }, { MigrationAction::Rename, "gHyperEnemies", "gEnhancements.HyperEnemies" },
{ MigrationAction::Rename, "gInjectItemCounts", "gEnhancements.InjectItemCounts" },
{ MigrationAction::Rename, "gInstantFishing", "gEnhancements.InstantFishing" }, { MigrationAction::Rename, "gInstantFishing", "gEnhancements.InstantFishing" },
{ MigrationAction::Rename, "gInstantOcarinaGameWin", "gEnhancements.InstantOcarinaGameWin" }, { MigrationAction::Rename, "gInstantOcarinaGameWin", "gEnhancements.InstantOcarinaGameWin" },
{ MigrationAction::Rename, "gInstantPutaway", "gEnhancements.InstantPutaway" }, { MigrationAction::Rename, "gInstantPutaway", "gEnhancements.InstantPutaway" },

View File

@ -127,97 +127,101 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) {
OPEN_DISPS(gfxCtx); OPEN_DISPS(gfxCtx);
if ((!pauseCtx->unk_1E4 || (pauseCtx->unk_1E4 == 5) || (pauseCtx->unk_1E4 == 8)) && if (((pauseCtx->unk_1E4 == 0) || (pauseCtx->unk_1E4 == 5) || (pauseCtx->unk_1E4 == 8)) &&
(pauseCtx->pageIndex == PAUSE_QUEST)) { (pauseCtx->pageIndex == PAUSE_QUEST)) {
pauseCtx->cursorColorSet = 0; pauseCtx->cursorColorSet = 0;
if (pauseCtx->cursorSpecialPos == 0) { if (pauseCtx->cursorSpecialPos == 0) {
pauseCtx->nameColorSet = 0; pauseCtx->nameColorSet = 0;
sp216 = pauseCtx->cursorSlot[PAUSE_QUEST]; if ((pauseCtx->state != 6) || ((pauseCtx->stickRelX == 0) && (pauseCtx->stickRelY == 0))) {
phi_s3 = pauseCtx->cursorPoint[PAUSE_QUEST]; // No cursor movement
sp216 = pauseCtx->cursorSlot[PAUSE_QUEST];
if ((pauseCtx->stickRelX < -30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DLEFT))) {
phi_s0 = D_8082A1AC[phi_s3][2];
if (phi_s0 == -3) {
KaleidoScope_MoveCursorToSpecialPos(play, PAUSE_CURSOR_PAGE_LEFT);
pauseCtx->unk_1E4 = 0;
} else {
while (phi_s0 >= 0) {
if ((s16)KaleidoScope_UpdateQuestStatusPoint(pauseCtx, phi_s0) != 0) {
break;
}
phi_s0 = D_8082A1AC[phi_s0][2];
}
}
} else if ((pauseCtx->stickRelX > 30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DRIGHT))) {
phi_s0 = D_8082A1AC[phi_s3][3];
if (phi_s0 == -2) {
KaleidoScope_MoveCursorToSpecialPos(play, PAUSE_CURSOR_PAGE_RIGHT);
pauseCtx->unk_1E4 = 0;
} else {
while (phi_s0 >= 0) {
if ((s16)KaleidoScope_UpdateQuestStatusPoint(pauseCtx, phi_s0) != 0) {
break;
}
phi_s0 = D_8082A1AC[phi_s0][3];
}
}
}
if ((pauseCtx->stickRelY < -30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DDOWN))) {
phi_s0 = D_8082A1AC[phi_s3][1];
while (phi_s0 >= 0) {
if ((s16)KaleidoScope_UpdateQuestStatusPoint(pauseCtx, phi_s0) != 0) {
break;
}
phi_s0 = D_8082A1AC[phi_s0][1];
}
} else if ((pauseCtx->stickRelY > 30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DUP))) {
phi_s0 = D_8082A1AC[phi_s3][0];
while (phi_s0 >= 0) {
if ((s16)KaleidoScope_UpdateQuestStatusPoint(pauseCtx, phi_s0) != 0) {
break;
}
phi_s0 = D_8082A1AC[phi_s0][0];
}
}
if (phi_s3 != pauseCtx->cursorPoint[PAUSE_QUEST]) {
pauseCtx->unk_1E4 = 0;
Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
}
if (pauseCtx->cursorPoint[PAUSE_QUEST] != 0x18) {
if (CHECK_QUEST_ITEM(pauseCtx->cursorPoint[PAUSE_QUEST])) {
if (pauseCtx->cursorPoint[PAUSE_QUEST] < 6) {
phi_s0_2 = pauseCtx->cursorPoint[PAUSE_QUEST] + 0x66;
osSyncPrintf("000 ccc=%d\n", phi_s0_2);
} else if (pauseCtx->cursorPoint[PAUSE_QUEST] < 0x12) {
phi_s0_2 = pauseCtx->cursorPoint[PAUSE_QUEST] + 0x54;
osSyncPrintf("111 ccc=%d\n", phi_s0_2);
} else {
phi_s0_2 = pauseCtx->cursorPoint[PAUSE_QUEST] + 0x5A;
osSyncPrintf("222 ccc=%d (%d, %d, %d)\n", phi_s0_2, pauseCtx->cursorPoint[PAUSE_QUEST],
0x12, 0x6C);
}
} else {
phi_s0_2 = PAUSE_ITEM_NONE;
osSyncPrintf("999 ccc=%d (%d, %d)\n", PAUSE_ITEM_NONE, pauseCtx->cursorPoint[PAUSE_QUEST],
0x18);
}
} else { } else {
if ((gSaveContext.inventory.questItems & 0xF0000000) != 0) { phi_s3 = pauseCtx->cursorPoint[PAUSE_QUEST];
phi_s0_2 = 0x72;
} else {
phi_s0_2 = PAUSE_ITEM_NONE;
}
osSyncPrintf("888 ccc=%d (%d, %d, %x)\n", phi_s0_2, pauseCtx->cursorPoint[PAUSE_QUEST], 0x72,
gSaveContext.inventory.questItems & 0xF0000000);
}
sp216 = pauseCtx->cursorPoint[PAUSE_QUEST]; if ((pauseCtx->stickRelX < -30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DLEFT))) {
pauseCtx->cursorItem[pauseCtx->pageIndex] = phi_s0_2; phi_s0 = D_8082A1AC[phi_s3][2];
pauseCtx->cursorSlot[pauseCtx->pageIndex] = sp216; if (phi_s0 == -3) {
KaleidoScope_MoveCursorToSpecialPos(play, PAUSE_CURSOR_PAGE_LEFT);
pauseCtx->unk_1E4 = 0;
} else {
while (phi_s0 >= 0) {
if ((s16)KaleidoScope_UpdateQuestStatusPoint(pauseCtx, phi_s0) != 0) {
break;
}
phi_s0 = D_8082A1AC[phi_s0][2];
}
}
} else if ((pauseCtx->stickRelX > 30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DRIGHT))) {
phi_s0 = D_8082A1AC[phi_s3][3];
if (phi_s0 == -2) {
KaleidoScope_MoveCursorToSpecialPos(play, PAUSE_CURSOR_PAGE_RIGHT);
pauseCtx->unk_1E4 = 0;
} else {
while (phi_s0 >= 0) {
if ((s16)KaleidoScope_UpdateQuestStatusPoint(pauseCtx, phi_s0) != 0) {
break;
}
phi_s0 = D_8082A1AC[phi_s0][3];
}
}
}
if ((pauseCtx->stickRelY < -30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DDOWN))) {
phi_s0 = D_8082A1AC[phi_s3][1];
while (phi_s0 >= 0) {
if ((s16)KaleidoScope_UpdateQuestStatusPoint(pauseCtx, phi_s0) != 0) {
break;
}
phi_s0 = D_8082A1AC[phi_s0][1];
}
} else if ((pauseCtx->stickRelY > 30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DUP))) {
phi_s0 = D_8082A1AC[phi_s3][0];
while (phi_s0 >= 0) {
if ((s16)KaleidoScope_UpdateQuestStatusPoint(pauseCtx, phi_s0) != 0) {
break;
}
phi_s0 = D_8082A1AC[phi_s0][0];
}
}
if (phi_s3 != pauseCtx->cursorPoint[PAUSE_QUEST]) {
pauseCtx->unk_1E4 = 0;
Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
}
if (pauseCtx->cursorPoint[PAUSE_QUEST] != 0x18) {
if (CHECK_QUEST_ITEM(pauseCtx->cursorPoint[PAUSE_QUEST])) {
if (pauseCtx->cursorPoint[PAUSE_QUEST] < 6) {
phi_s0_2 = pauseCtx->cursorPoint[PAUSE_QUEST] + 0x66;
osSyncPrintf("000 ccc=%d\n", phi_s0_2);
} else if (pauseCtx->cursorPoint[PAUSE_QUEST] < 0x12) {
phi_s0_2 = pauseCtx->cursorPoint[PAUSE_QUEST] + 0x54;
osSyncPrintf("111 ccc=%d\n", phi_s0_2);
} else {
phi_s0_2 = pauseCtx->cursorPoint[PAUSE_QUEST] + 0x5A;
osSyncPrintf("222 ccc=%d (%d, %d, %d)\n", phi_s0_2, pauseCtx->cursorPoint[PAUSE_QUEST],
0x12, 0x6C);
}
} else {
phi_s0_2 = PAUSE_ITEM_NONE;
osSyncPrintf("999 ccc=%d (%d, %d)\n", PAUSE_ITEM_NONE, pauseCtx->cursorPoint[PAUSE_QUEST],
0x18);
}
} else {
if ((gSaveContext.inventory.questItems & 0xF0000000) != 0) {
phi_s0_2 = 0x72;
} else {
phi_s0_2 = PAUSE_ITEM_NONE;
}
osSyncPrintf("888 ccc=%d (%d, %d, %x)\n", phi_s0_2, pauseCtx->cursorPoint[PAUSE_QUEST], 0x72,
gSaveContext.inventory.questItems & 0xF0000000);
}
sp216 = pauseCtx->cursorPoint[PAUSE_QUEST];
pauseCtx->cursorItem[pauseCtx->pageIndex] = phi_s0_2;
pauseCtx->cursorSlot[pauseCtx->pageIndex] = sp216;
}
KaleidoScope_SetCursorVtx(pauseCtx, sp216 * 4, pauseCtx->questVtx); KaleidoScope_SetCursorVtx(pauseCtx, sp216 * 4, pauseCtx->questVtx);