diff --git a/libultraship/libultraship/SohImGuiImpl.cpp b/libultraship/libultraship/SohImGuiImpl.cpp index 1bdd2b875..d710ffb92 100644 --- a/libultraship/libultraship/SohImGuiImpl.cpp +++ b/libultraship/libultraship/SohImGuiImpl.cpp @@ -915,6 +915,8 @@ namespace SohImGui { Tooltip("Allows the Lon Lon Ranch obstacle course reward to be shared across time periods"); EnhancementCheckbox("Enable visible guard vision", "gGuardVision"); EnhancementCheckbox("Enable passage of time on file select", "gTimeFlowFileSelect"); + EnhancementCheckbox("Allow the cursor to be on any slot", "gPauseAnyCursor"); + Tooltip("Allows the cursor on the pause menu to be over any slot. Similar to Rando and Spaceworld 97"); ImGui::EndMenu(); } diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c index f70569c73..a2271da35 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c @@ -163,7 +163,7 @@ void KaleidoScope_DrawEquipment(GlobalContext* globalCtx) { s16 cursorPoint; s16 cursorX; s16 cursorY; - volatile s16 oldCursorPoint; + s16 oldCursorPoint; bool dpad = CVar_GetS32("gDpadPauseName", 0); OPEN_DISPS(globalCtx->state.gfxCtx, "../z_kaleido_equipment.c", 219); @@ -214,10 +214,8 @@ void KaleidoScope_DrawEquipment(GlobalContext* globalCtx) { cursorMoveResult = 1; } } - } else { - if (gBitFlags[pauseCtx->cursorPoint[PAUSE_EQUIP] - 1] & gSaveContext.inventory.equipment) { - cursorMoveResult = 2; - } + } else if ((gBitFlags[pauseCtx->cursorPoint[PAUSE_EQUIP] - 1] & gSaveContext.inventory.equipment) || CVar_GetS32("gPauseAnyCursor", 0)) { + cursorMoveResult = 2; } } else { pauseCtx->cursorX[PAUSE_EQUIP] = cursorX; @@ -250,10 +248,8 @@ void KaleidoScope_DrawEquipment(GlobalContext* globalCtx) { if (CUR_UPG_VALUE(pauseCtx->cursorY[PAUSE_EQUIP]) != 0) { cursorMoveResult = 1; } - } else { - if (gBitFlags[pauseCtx->cursorPoint[PAUSE_EQUIP] - 1] & gSaveContext.inventory.equipment) { + } else if ((gBitFlags[pauseCtx->cursorPoint[PAUSE_EQUIP] - 1] & gSaveContext.inventory.equipment) || CVar_GetS32("gPauseAnyCursor", 0)) { cursorMoveResult = 2; - } } } else { pauseCtx->cursorX[PAUSE_EQUIP] = cursorX; @@ -302,8 +298,8 @@ void KaleidoScope_DrawEquipment(GlobalContext* globalCtx) { } else if (CUR_UPG_VALUE(pauseCtx->cursorY[PAUSE_EQUIP]) != 0) { cursorMoveResult = 1; } - } else if (gBitFlags[pauseCtx->cursorPoint[PAUSE_EQUIP] - 1] & - gSaveContext.inventory.equipment) { + } else if ((gBitFlags[pauseCtx->cursorPoint[PAUSE_EQUIP] - 1] & + gSaveContext.inventory.equipment) || CVar_GetS32("gPauseAnyCursor", 0)) { cursorMoveResult = 2; } } else { @@ -320,8 +316,8 @@ void KaleidoScope_DrawEquipment(GlobalContext* globalCtx) { if (CUR_UPG_VALUE(pauseCtx->cursorY[PAUSE_EQUIP]) != 0) { cursorMoveResult = 1; } - } else if (gBitFlags[pauseCtx->cursorPoint[PAUSE_EQUIP] - 1] & - gSaveContext.inventory.equipment) { + } else if ((gBitFlags[pauseCtx->cursorPoint[PAUSE_EQUIP] - 1] & + gSaveContext.inventory.equipment) || CVar_GetS32("gPauseAnyCursor", 0)) { cursorMoveResult = 2; } } else { @@ -503,7 +499,11 @@ void KaleidoScope_DrawEquipment(GlobalContext* globalCtx) { (gEquipAgeReqs[pauseCtx->cursorY[PAUSE_EQUIP]][pauseCtx->cursorX[PAUSE_EQUIP]] == ((void)0, gSaveContext.linkAge))) { if (CHECK_BTN_ALL(input->press.button, BTN_A)) { - Inventory_ChangeEquipment(pauseCtx->cursorY[PAUSE_EQUIP], pauseCtx->cursorX[PAUSE_EQUIP]); + if (CHECK_OWNED_EQUIP(pauseCtx->cursorY[PAUSE_EQUIP], pauseCtx->cursorX[PAUSE_EQUIP] - 1)) { + Inventory_ChangeEquipment(pauseCtx->cursorY[PAUSE_EQUIP], pauseCtx->cursorX[PAUSE_EQUIP]); + } else { + goto EQUIP_FAIL; + } if (pauseCtx->cursorY[PAUSE_EQUIP] == 0) { gSaveContext.infTable[29] = 0; @@ -560,6 +560,7 @@ void KaleidoScope_DrawEquipment(GlobalContext* globalCtx) { } } } else { + EQUIP_FAIL: if (CHECK_BTN_ALL(input->press.button, BTN_A)) { Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); } else if ((CVar_GetS32("gAssignableTunicsAndBoots", 0) != 0) && (pauseCtx->cursorY[PAUSE_EQUIP] > 1)) { diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c index 705d1461e..a317c6fc3 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c @@ -137,8 +137,8 @@ void KaleidoScope_DrawItemSelect(GlobalContext* globalCtx) { if (pauseCtx->cursorX[PAUSE_ITEM] != 0) { pauseCtx->cursorX[PAUSE_ITEM] -= 1; pauseCtx->cursorPoint[PAUSE_ITEM] -= 1; - - if (gSaveContext.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]] != ITEM_NONE) { + if ((gSaveContext.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]] != ITEM_NONE) || + CVar_GetS32("gPauseAnyCursor", 0)) { moveCursorResult = 1; } } else { @@ -169,8 +169,8 @@ void KaleidoScope_DrawItemSelect(GlobalContext* globalCtx) { if (pauseCtx->cursorX[PAUSE_ITEM] < 5) { pauseCtx->cursorX[PAUSE_ITEM] += 1; pauseCtx->cursorPoint[PAUSE_ITEM] += 1; - - if (gSaveContext.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]] != ITEM_NONE) { + if ((gSaveContext.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]] != ITEM_NONE) || + CVar_GetS32("gPauseAnyCursor", 0)) { moveCursorResult = 1; } } else { @@ -291,8 +291,8 @@ void KaleidoScope_DrawItemSelect(GlobalContext* globalCtx) { if (pauseCtx->cursorY[PAUSE_ITEM] != 0) { pauseCtx->cursorY[PAUSE_ITEM] -= 1; pauseCtx->cursorPoint[PAUSE_ITEM] -= 6; - - if (gSaveContext.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]] != ITEM_NONE) { + if ((gSaveContext.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]] != ITEM_NONE) || + CVar_GetS32("gPauseAnyCursor", 0)) { moveCursorResult = 1; } } else { @@ -305,8 +305,8 @@ void KaleidoScope_DrawItemSelect(GlobalContext* globalCtx) { if (pauseCtx->cursorY[PAUSE_ITEM] < 3) { pauseCtx->cursorY[PAUSE_ITEM] += 1; pauseCtx->cursorPoint[PAUSE_ITEM] += 6; - - if (gSaveContext.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]] != ITEM_NONE) { + if ((gSaveContext.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]] != ITEM_NONE) || + CVar_GetS32("gPauseAnyCursor", 0)) { moveCursorResult = 1; } } else { @@ -350,7 +350,7 @@ void KaleidoScope_DrawItemSelect(GlobalContext* globalCtx) { if (CHECK_BTN_ANY(input->press.button, BTN_CLEFT | BTN_CDOWN | BTN_CRIGHT)) { if (((gSlotAgeReqs[cursorSlot] == 9) || (gSlotAgeReqs[cursorSlot] == ((void)0, gSaveContext.linkAge))) && - (cursorItem != ITEM_SOLD_OUT)) { + (cursorItem != ITEM_SOLD_OUT) && (cursorItem != ITEM_NONE)) { KaleidoScope_SetupItemEquip(globalCtx, cursorItem, cursorSlot, pauseCtx->itemVtx[index].v.ob[0] * 10, pauseCtx->itemVtx[index].v.ob[1] * 10); diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c index 31f076c70..6156bd47d 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c @@ -1559,22 +1559,22 @@ void KaleidoScope_DrawInfoPanel(GlobalContext* globalCtx) { { 0, 255, 100, 255 },//Gamecube { 0, 100, 255, 255 },//Original N64 }; - static void* D_8082AD54[3] = { + static const void* sToEquipTextures[3] = { gPauseToEquipENGTex, gPauseToEquipGERTex, gPauseToEquipFRATex, }; - static void* D_8082AD60[3] = { + static const void* sToDecideTextures[3] = { gPauseToDecideENGTex, gPauseToDecideGERTex, gPauseToDecideFRATex, }; - static void* D_8082AD6C[3] = { + static const void* sPlayMelodyTextures[3] = { gPauseToPlayMelodyENGTex, gPauseToPlayMelodyGERTex, gPauseToPlayMelodyFRATex, }; - static void* D_8082AD78[][3] = { + static const void* D_8082AD78[][3] = { { gPauseToEquipmentENGTex, gPauseToEquipmentGERTex, gPauseToEquipmentFRATex }, { gPauseToSelectItemENGTex, gPauseToSelectItemGERTex, gPauseToSelectItemFRATex }, { gPauseToMapENGTex, gPauseToMapGERTex, gPauseToMapFRATex }, @@ -1814,8 +1814,13 @@ void KaleidoScope_DrawInfoPanel(GlobalContext* globalCtx) { } else { gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 255, 255, 255, 255); } + //TOOD CVAR + if (((CHECK_OWNED_EQUIP(pauseCtx->cursorY[PAUSE_EQUIP], pauseCtx->cursorX[PAUSE_EQUIP] - 1)) || + (pauseCtx->pageIndex != PAUSE_EQUIP) && (pauseCtx->cursorX[PAUSE_EQUIP] != 0)) && (pauseCtx->pageIndex != PAUSE_ITEM || + (gSaveContext.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]] != ITEM_NONE))) { + POLY_KAL_DISP = KaleidoScope_QuadTextureIA4(POLY_KAL_DISP, pauseCtx->nameSegment, 128, 16, 0); + } - POLY_KAL_DISP = KaleidoScope_QuadTextureIA4(POLY_KAL_DISP, pauseCtx->nameSegment, 128, 16, 0); } if (pauseCtx->pageIndex == PAUSE_MAP && CVar_GetS32("gDebugEnabled", 0) != 0) { @@ -1898,7 +1903,7 @@ void KaleidoScope_DrawInfoPanel(GlobalContext* globalCtx) { gDPPipeSync(POLY_KAL_DISP++); gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 255, 255, 255, 255); - POLY_KAL_DISP = KaleidoScope_QuadTextureIA8(POLY_KAL_DISP, D_8082AD60[gSaveContext.language], + POLY_KAL_DISP = KaleidoScope_QuadTextureIA8(POLY_KAL_DISP, sToDecideTextures[gSaveContext.language], D_8082ADE0[gSaveContext.language], 16, 4); } else if (pauseCtx->cursorSpecialPos != 0) { if ((pauseCtx->state == 6) && (pauseCtx->unk_1E4 == 0)) { @@ -1946,15 +1951,16 @@ void KaleidoScope_DrawInfoPanel(GlobalContext* globalCtx) { } else if (CVar_GetS32("gHudColors", 1) == 2) { gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCCBtnPrimR", R_C_BTN_COLOR(0)), CVar_GetS32("gCCCBtnPrimG", R_C_BTN_COLOR(1)), CVar_GetS32("gCCCBtnPrimB", R_C_BTN_COLOR(2)), 255); } - //gSPDisplayList(POLY_KAL_DISP++, gCButtonIconsDL); //Same reason for every A button, to be able to recolor them. - gDPLoadTextureBlock(POLY_KAL_DISP++, gCBtnSymbolsTex, G_IM_FMT_IA, G_IM_SIZ_8b, 48, 16, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, 4, 4, G_TX_NOLOD, G_TX_NOLOD); - gSP1Quadrangle(POLY_KAL_DISP++, 0, 2, 3, 1, 0); + if (gSaveContext.inventory.items[pauseCtx->cursorSlot[PAUSE_ITEM]] != ITEM_NONE) { + //gSPDisplayList(POLY_KAL_DISP++, gCButtonIconsDL); //Same reason for every A button, to be able to recolor them. + gDPLoadTextureBlock(POLY_KAL_DISP++, gCBtnSymbolsTex, G_IM_FMT_IA, G_IM_SIZ_8b, 48, 16, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, 4, 4, G_TX_NOLOD, G_TX_NOLOD); + gSP1Quadrangle(POLY_KAL_DISP++, 0, 2, 3, 1, 0); - gDPPipeSync(POLY_KAL_DISP++); - gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 255, 255, 255, 255); - - POLY_KAL_DISP = KaleidoScope_QuadTextureIA8(POLY_KAL_DISP, D_8082AD54[gSaveContext.language], - D_8082ADD8[gSaveContext.language], 16, 4); + gDPPipeSync(POLY_KAL_DISP++); + gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 255, 255, 255, 255); + POLY_KAL_DISP = KaleidoScope_QuadTextureIA8(POLY_KAL_DISP, sToEquipTextures[gSaveContext.language], + D_8082ADD8[gSaveContext.language], 16, 4); + } } else if ((pauseCtx->pageIndex == PAUSE_MAP) && sInDungeonScene) { } else if ((pauseCtx->pageIndex == PAUSE_QUEST) && (pauseCtx->cursorSlot[PAUSE_QUEST] >= 6) && @@ -1996,7 +2002,7 @@ void KaleidoScope_DrawInfoPanel(GlobalContext* globalCtx) { gDPPipeSync(POLY_KAL_DISP++); gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 255, 255, 255, 255); - POLY_KAL_DISP = KaleidoScope_QuadTextureIA8(POLY_KAL_DISP, D_8082AD6C[gSaveContext.language], + POLY_KAL_DISP = KaleidoScope_QuadTextureIA8(POLY_KAL_DISP, sPlayMelodyTextures[gSaveContext.language], D_8082ADE8[gSaveContext.language], 16, 4); } } else if (pauseCtx->pageIndex == PAUSE_EQUIP) { @@ -2017,6 +2023,10 @@ void KaleidoScope_DrawInfoPanel(GlobalContext* globalCtx) { pauseCtx->infoPanelVtx[21].v.tc[0] = pauseCtx->infoPanelVtx[23].v.tc[0] = D_8082ADD8[gSaveContext.language] << 5; + if (!(CHECK_OWNED_EQUIP(pauseCtx->cursorY[PAUSE_EQUIP], pauseCtx->cursorX[PAUSE_EQUIP] - 1)) && (pauseCtx->pageIndex == PAUSE_EQUIP) && (pauseCtx->cursorX[PAUSE_EQUIP] != 0)) { + return; + } + //gSPDisplayList(POLY_KAL_DISP++, gAButtonIconDL); if (CVar_GetS32("gHudColors", 1) == 0) {//To equip A button gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, gABtnTexColour[1][0], gABtnTexColour[1][1], gABtnTexColour[1][2], gABtnTexColour[1][3]); @@ -2031,7 +2041,7 @@ void KaleidoScope_DrawInfoPanel(GlobalContext* globalCtx) { gDPPipeSync(POLY_KAL_DISP++); gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 255, 255, 255, 255); - POLY_KAL_DISP = KaleidoScope_QuadTextureIA8(POLY_KAL_DISP, D_8082AD54[gSaveContext.language], + POLY_KAL_DISP = KaleidoScope_QuadTextureIA8(POLY_KAL_DISP, sToEquipTextures[gSaveContext.language], D_8082ADD8[gSaveContext.language], 16, 4); } }