From 03ea465251f4bf78599457fb475a0fa71f3f1be0 Mon Sep 17 00:00:00 2001 From: inspectredc Date: Wed, 18 Oct 2023 21:21:50 +0100 Subject: [PATCH 1/6] Toggle Strength --- soh/soh/SohMenuBar.cpp | 6 +++ soh/src/code/z_player_lib.c | 4 ++ .../ovl_kaleido_scope/z_kaleido_equipment.c | 45 ++++++++++++++++--- 3 files changed, 50 insertions(+), 5 deletions(-) diff --git a/soh/soh/SohMenuBar.cpp b/soh/soh/SohMenuBar.cpp index 04f25d2e8..c7233aef4 100644 --- a/soh/soh/SohMenuBar.cpp +++ b/soh/soh/SohMenuBar.cpp @@ -604,6 +604,12 @@ void DrawEnhancementsMenu() { UIWidgets::Tooltip("Prevent bombchus from forcing the camera into first-person mode when released."); UIWidgets::PaddedEnhancementCheckbox("Aiming reticle for the bow/slingshot", "gBowReticle", true, false); UIWidgets::Tooltip("Aiming with a bow or slingshot will display a reticle as with the hookshot when the projectile is ready to fire."); + if (UIWidgets::PaddedEnhancementCheckbox("Allow strength equipment to be toggled", "gToggleStrength", true, false)) { + if (!CVarGetInteger("gToggleStrength", 0)) { + CVarSetInteger("gStrengthDisabled", 0); + } + } + UIWidgets::Tooltip("Allows strength to be toggled on and off by pressing A on the strength upgrade in the equipment subscreen of the pause menu"); ImGui::EndMenu(); } diff --git a/soh/src/code/z_player_lib.c b/soh/src/code/z_player_lib.c index 32a3e6e48..0153cdbd5 100644 --- a/soh/src/code/z_player_lib.c +++ b/soh/src/code/z_player_lib.c @@ -509,6 +509,10 @@ s32 Player_IsBurningStickInRange(PlayState* play, Vec3f* pos, f32 xzRange, f32 y s32 Player_GetStrength(void) { s32 strengthUpgrade = CUR_UPG_VALUE(UPG_STRENGTH); + if (CVarGetInteger("gToggleStrength", 0) && CVarGetInteger("gStrengthDisabled", 0)) { + return PLAYER_STR_NONE; + } + if (CVarGetInteger("gTimelessEquipment", 0) || LINK_IS_ADULT) { return strengthUpgrade; } else if (strengthUpgrade != 0) { 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 dd6ea6a16..ec16564eb 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 @@ -488,6 +488,12 @@ void KaleidoScope_DrawEquipment(PlayState* play) { } } + // Grey Out Strength Upgrade Name when Disabled + if ((pauseCtx->cursorX[PAUSE_EQUIP] == 0) && (pauseCtx->cursorY[PAUSE_EQUIP] == 2) && + CVarGetInteger("gToggleStrength", 0) && CVarGetInteger("gStrengthDisabled", 0)) { + pauseCtx->nameColorSet = 1; + } + if ((pauseCtx->cursorX[PAUSE_EQUIP] == 0) && (pauseCtx->cursorY[PAUSE_EQUIP] == 0)) { if (LINK_AGE_IN_YEARS != YEARS_CHILD) { if ((cursorItem >= ITEM_BULLET_BAG_30) && (cursorItem <= ITEM_BULLET_BAG_50)) { @@ -507,6 +513,13 @@ void KaleidoScope_DrawEquipment(PlayState* play) { buttonsToCheck |= BTN_DUP | BTN_DDOWN | BTN_DLEFT | BTN_DRIGHT; } + // Allow Toggling of Strength when Pressing A on Strength Upgrade Slot + if ((pauseCtx->cursorSpecialPos == 0) && (pauseCtx->state == 6) && + (pauseCtx->unk_1E4 == 0) && CHECK_BTN_ALL(input->press.button, BTN_A) && + (pauseCtx->cursorX[PAUSE_EQUIP] == 0) && (pauseCtx->cursorY[PAUSE_EQUIP] == 2) && CVarGetInteger("gToggleStrength", 0)) { + CVarSetInteger("gStrengthDisabled", !CVarGetInteger("gStrengthDisabled", 0)); + } + if ((pauseCtx->cursorSpecialPos == 0) && (cursorItem != PAUSE_ITEM_NONE) && (pauseCtx->state == 6) && (pauseCtx->unk_1E4 == 0) && CHECK_BTN_ANY(input->press.button, buttonsToCheck) && (pauseCtx->cursorX[PAUSE_EQUIP] != 0)) { @@ -659,6 +672,22 @@ void KaleidoScope_DrawEquipment(PlayState* play) { } } + // Add zoom effect to strength item if cursor is hovering over it and strength is not disabled when the toggle is on + if ((pauseCtx->cursorX[PAUSE_EQUIP] == 0) && (pauseCtx->cursorY[PAUSE_EQUIP] == 2) && + CVarGetInteger("gToggleStrength", 0) && !CVarGetInteger("gStrengthDisabled", 0)) { + i = 2; // row + k = 0; // column + j = 16 * i + 4 * k; // vtx index + pauseCtx->equipVtx[j].v.ob[0] = pauseCtx->equipVtx[j + 2].v.ob[0] = + pauseCtx->equipVtx[j].v.ob[0] - 2; + pauseCtx->equipVtx[j + 1].v.ob[0] = pauseCtx->equipVtx[j + 3].v.ob[0] = + pauseCtx->equipVtx[j + 1].v.ob[0] + 4; + pauseCtx->equipVtx[j].v.ob[1] = pauseCtx->equipVtx[j + 1].v.ob[1] = + pauseCtx->equipVtx[j].v.ob[1] + 2; + pauseCtx->equipVtx[j + 2].v.ob[1] = pauseCtx->equipVtx[j + 3].v.ob[1] = + pauseCtx->equipVtx[j + 2].v.ob[1] - 4; + } + Gfx_SetupDL_42Opa(play->state.gfxCtx); gDPSetCombineMode(POLY_KAL_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); @@ -670,9 +699,12 @@ void KaleidoScope_DrawEquipment(PlayState* play) { if (LINK_AGE_IN_YEARS == YEARS_CHILD) { point = CUR_UPG_VALUE(sChildUpgrades[i]); if ((point != 0) && (CUR_UPG_VALUE(sChildUpgrades[i]) != 0)) { - if (drawGreyItems && + // Grey Out the Gauntlets as Child + // Grey Out Strength Upgrades when Disabled and the Toggle Option is on + if ((drawGreyItems && ((sChildUpgradeItemBases[i] + CUR_UPG_VALUE(sChildUpgrades[i]) - 1) == ITEM_GAUNTLETS_SILVER || - (sChildUpgradeItemBases[i] + CUR_UPG_VALUE(sChildUpgrades[i]) - 1) == ITEM_GAUNTLETS_GOLD)) { // Grey Out the Gauntlets + (sChildUpgradeItemBases[i] + CUR_UPG_VALUE(sChildUpgrades[i]) - 1) == ITEM_GAUNTLETS_GOLD)) || + (CVarGetInteger("gToggleStrength", 0) && CVarGetInteger("gStrengthDisabled", 0) && sChildUpgrades[i] == UPG_STRENGTH)) { gDPSetGrayscaleColor(POLY_KAL_DISP++, 109, 109, 109, 255); gSPGrayscale(POLY_KAL_DISP++, true); } @@ -688,9 +720,12 @@ void KaleidoScope_DrawEquipment(PlayState* play) { KaleidoScope_DrawQuadTextureRGBA32(play->state.gfxCtx, gItemIcons[sChildUpgradeItemBases[i] + CUR_UPG_VALUE(sChildUpgrades[i]) - 1], 32, 32, 0); gSPGrayscale(POLY_KAL_DISP++, false); } else if (CUR_UPG_VALUE(sAdultUpgrades[i]) != 0) { - if (drawGreyItems && - ((sAdultUpgradeItemBases[i] + CUR_UPG_VALUE(sAdultUpgrades[i]) - 1) == ITEM_BRACELET && - !(IS_RANDO))) { // Grey Out the Goron Bracelet when Not Randomized + // Grey Out the Goron Bracelet when Not Randomized + // Grey Out Strength Upgrades when Disabled and the Toggle Option is on + if ((drawGreyItems && + (((sAdultUpgradeItemBases[i] + CUR_UPG_VALUE(sAdultUpgrades[i]) - 1) == ITEM_BRACELET && + !(IS_RANDO)))) || + (CVarGetInteger("gToggleStrength", 0) && CVarGetInteger("gStrengthDisabled", 0) && sAdultUpgrades[i] == UPG_STRENGTH)) { gDPSetGrayscaleColor(POLY_KAL_DISP++, 109, 109, 109, 255); gSPGrayscale(POLY_KAL_DISP++, true); } From c22d1e724db4717df2ebf39580b042c6399c1d51 Mon Sep 17 00:00:00 2001 From: inspectredc Date: Wed, 18 Oct 2023 21:29:00 +0100 Subject: [PATCH 2/6] No longer grey out bracelet as adult when toggle option is on and strength enabled --- .../overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 ec16564eb..2c1779c55 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 @@ -700,7 +700,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) { point = CUR_UPG_VALUE(sChildUpgrades[i]); if ((point != 0) && (CUR_UPG_VALUE(sChildUpgrades[i]) != 0)) { // Grey Out the Gauntlets as Child - // Grey Out Strength Upgrades when Disabled and the Toggle Option is on + // Grey Out Strength Upgrades when Disabled and the Toggle Strength Option is on if ((drawGreyItems && ((sChildUpgradeItemBases[i] + CUR_UPG_VALUE(sChildUpgrades[i]) - 1) == ITEM_GAUNTLETS_SILVER || (sChildUpgradeItemBases[i] + CUR_UPG_VALUE(sChildUpgrades[i]) - 1) == ITEM_GAUNTLETS_GOLD)) || @@ -720,11 +720,11 @@ void KaleidoScope_DrawEquipment(PlayState* play) { KaleidoScope_DrawQuadTextureRGBA32(play->state.gfxCtx, gItemIcons[sChildUpgradeItemBases[i] + CUR_UPG_VALUE(sChildUpgrades[i]) - 1], 32, 32, 0); gSPGrayscale(POLY_KAL_DISP++, false); } else if (CUR_UPG_VALUE(sAdultUpgrades[i]) != 0) { - // Grey Out the Goron Bracelet when Not Randomized - // Grey Out Strength Upgrades when Disabled and the Toggle Option is on + // Grey Out the Goron Bracelet when Not Randomized and Toggle Strength Option is off + // Grey Out Strength Upgrades when Disabled and the Toggle Strength Option is on if ((drawGreyItems && (((sAdultUpgradeItemBases[i] + CUR_UPG_VALUE(sAdultUpgrades[i]) - 1) == ITEM_BRACELET && - !(IS_RANDO)))) || + !(IS_RANDO) && !CVarGetInteger("gToggleStrength", 0)))) || (CVarGetInteger("gToggleStrength", 0) && CVarGetInteger("gStrengthDisabled", 0) && sAdultUpgrades[i] == UPG_STRENGTH)) { gDPSetGrayscaleColor(POLY_KAL_DISP++, 109, 109, 109, 255); gSPGrayscale(POLY_KAL_DISP++, true); From 9950c02fb281f5f137f058d0c1c02a8937b3d2f2 Mon Sep 17 00:00:00 2001 From: inspectredc Date: Wed, 18 Oct 2023 21:39:04 +0100 Subject: [PATCH 3/6] Strength name un-greyed out and apply zoom regardless of strength disabled --- .../misc/ovl_kaleido_scope/z_kaleido_equipment.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) 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 2c1779c55..406c2ba67 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 @@ -489,11 +489,17 @@ void KaleidoScope_DrawEquipment(PlayState* play) { } // Grey Out Strength Upgrade Name when Disabled + // Do not Grey Out Strength Upgrade Name when Enabled if ((pauseCtx->cursorX[PAUSE_EQUIP] == 0) && (pauseCtx->cursorY[PAUSE_EQUIP] == 2) && - CVarGetInteger("gToggleStrength", 0) && CVarGetInteger("gStrengthDisabled", 0)) { - pauseCtx->nameColorSet = 1; + CVarGetInteger("gToggleStrength", 0)) { + if (CVarGetInteger("gStrengthDisabled", 0)) { + pauseCtx->nameColorSet = 1; + } else { + pauseCtx->nameColorSet = 0; + } } + if ((pauseCtx->cursorX[PAUSE_EQUIP] == 0) && (pauseCtx->cursorY[PAUSE_EQUIP] == 0)) { if (LINK_AGE_IN_YEARS != YEARS_CHILD) { if ((cursorItem >= ITEM_BULLET_BAG_30) && (cursorItem <= ITEM_BULLET_BAG_50)) { @@ -672,9 +678,9 @@ void KaleidoScope_DrawEquipment(PlayState* play) { } } - // Add zoom effect to strength item if cursor is hovering over it and strength is not disabled when the toggle is on + // Add zoom effect to strength item if cursor is hovering over it when toggle option is on if ((pauseCtx->cursorX[PAUSE_EQUIP] == 0) && (pauseCtx->cursorY[PAUSE_EQUIP] == 2) && - CVarGetInteger("gToggleStrength", 0) && !CVarGetInteger("gStrengthDisabled", 0)) { + CVarGetInteger("gToggleStrength", 0)) { i = 2; // row k = 0; // column j = 16 * i + 4 * k; // vtx index From 1b2a31e34b38aa5babf45a2f678cd7b7d4e1db1f Mon Sep 17 00:00:00 2001 From: inspectredc Date: Wed, 18 Oct 2023 22:11:04 +0100 Subject: [PATCH 4/6] Add success sound for toggle and equipping delay --- .../ovl_kaleido_scope/z_kaleido_equipment.c | 40 +++++++++++-------- 1 file changed, 23 insertions(+), 17 deletions(-) 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 406c2ba67..51e092017 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 @@ -488,18 +488,6 @@ void KaleidoScope_DrawEquipment(PlayState* play) { } } - // Grey Out Strength Upgrade Name when Disabled - // Do not Grey Out Strength Upgrade Name when Enabled - if ((pauseCtx->cursorX[PAUSE_EQUIP] == 0) && (pauseCtx->cursorY[PAUSE_EQUIP] == 2) && - CVarGetInteger("gToggleStrength", 0)) { - if (CVarGetInteger("gStrengthDisabled", 0)) { - pauseCtx->nameColorSet = 1; - } else { - pauseCtx->nameColorSet = 0; - } - } - - if ((pauseCtx->cursorX[PAUSE_EQUIP] == 0) && (pauseCtx->cursorY[PAUSE_EQUIP] == 0)) { if (LINK_AGE_IN_YEARS != YEARS_CHILD) { if ((cursorItem >= ITEM_BULLET_BAG_30) && (cursorItem <= ITEM_BULLET_BAG_50)) { @@ -514,16 +502,21 @@ void KaleidoScope_DrawEquipment(PlayState* play) { KaleidoScope_SetCursorVtx(pauseCtx, cursorSlot * 4, pauseCtx->equipVtx); - u16 buttonsToCheck = BTN_A | BTN_CLEFT | BTN_CDOWN | BTN_CRIGHT; - if (CVarGetInteger("gDpadEquips", 0) && (!CVarGetInteger("gDpadPause", 0) || CHECK_BTN_ALL(input->cur.button, BTN_CUP))) { - buttonsToCheck |= BTN_DUP | BTN_DDOWN | BTN_DLEFT | BTN_DRIGHT; - } - // Allow Toggling of Strength when Pressing A on Strength Upgrade Slot if ((pauseCtx->cursorSpecialPos == 0) && (pauseCtx->state == 6) && (pauseCtx->unk_1E4 == 0) && CHECK_BTN_ALL(input->press.button, BTN_A) && (pauseCtx->cursorX[PAUSE_EQUIP] == 0) && (pauseCtx->cursorY[PAUSE_EQUIP] == 2) && CVarGetInteger("gToggleStrength", 0)) { CVarSetInteger("gStrengthDisabled", !CVarGetInteger("gStrengthDisabled", 0)); + // Equip success sound + Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + // Wait 10 frames before accepting input again + pauseCtx->unk_1E4 = 7; + sEquipTimer = 10; + } + + u16 buttonsToCheck = BTN_A | BTN_CLEFT | BTN_CDOWN | BTN_CRIGHT; + if (CVarGetInteger("gDpadEquips", 0) && (!CVarGetInteger("gDpadPause", 0) || CHECK_BTN_ALL(input->cur.button, BTN_CUP))) { + buttonsToCheck |= BTN_DUP | BTN_DDOWN | BTN_DLEFT | BTN_DRIGHT; } if ((pauseCtx->cursorSpecialPos == 0) && (cursorItem != PAUSE_ITEM_NONE) && (pauseCtx->state == 6) && @@ -657,6 +650,19 @@ void KaleidoScope_DrawEquipment(PlayState* play) { } } + + // Grey Out Strength Upgrade Name when Disabled + // Do not Grey Out Strength Upgrade Name when Enabled + // This needs to be outside the previous block since otherwise the nameColorSet is cleared to 0 by other menu pages when toggling + if ((pauseCtx->pageIndex == PAUSE_EQUIP) && (pauseCtx->cursorX[PAUSE_EQUIP] == 0) && + (pauseCtx->cursorY[PAUSE_EQUIP] == 2) && CVarGetInteger("gToggleStrength", 0)) { + if (CVarGetInteger("gStrengthDisabled", 0)) { + pauseCtx->nameColorSet = 1; + } else { + pauseCtx->nameColorSet = 0; + } + } + for (rowStart = 0, i = 0, point = 4; i < 4; i++, rowStart += 4, point += 16) { for (k = 0, temp = rowStart + 1, bit = rowStart, j = point; k < 3; k++, bit++, j += 4, temp++) { From 38d70dd12fbd50a1bb1d90715edf8e84def0ad73 Mon Sep 17 00:00:00 2001 From: inspectredc Date: Wed, 18 Oct 2023 23:04:55 +0100 Subject: [PATCH 5/6] update tooltip to mention glitch use --- soh/soh/SohMenuBar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soh/soh/SohMenuBar.cpp b/soh/soh/SohMenuBar.cpp index c7233aef4..c27037cc3 100644 --- a/soh/soh/SohMenuBar.cpp +++ b/soh/soh/SohMenuBar.cpp @@ -609,7 +609,7 @@ void DrawEnhancementsMenu() { CVarSetInteger("gStrengthDisabled", 0); } } - UIWidgets::Tooltip("Allows strength to be toggled on and off by pressing A on the strength upgrade in the equipment subscreen of the pause menu"); + UIWidgets::Tooltip("Allows strength to be toggled on and off by pressing A on the strength upgrade in the equipment subscreen of the pause menu (This allows performing some glitches that require the player to not have strength)."); ImGui::EndMenu(); } From 2cbbaba9cc4e7be0418840410a4699d86c439e24 Mon Sep 17 00:00:00 2001 From: inspectredc Date: Thu, 26 Oct 2023 18:41:45 +0100 Subject: [PATCH 6/6] draw a button --- .../ovl_kaleido_scope/z_kaleido_equipment.c | 72 +++++++++++++++---- 1 file changed, 60 insertions(+), 12 deletions(-) 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 51e092017..5e2843f06 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 @@ -1,6 +1,7 @@ #include "z_kaleido_scope.h" #include "textures/icon_item_static/icon_item_static.h" #include "textures/parameter_static/parameter_static.h" +#include "soh/Enhancements/cosmetics/cosmeticsTypes.h" static u8 sChildUpgrades[] = { UPG_BULLET_BAG, UPG_BOMB_BAG, UPG_STRENGTH, UPG_SCALE }; static u8 sAdultUpgrades[] = { UPG_QUIVER, UPG_BOMB_BAG, UPG_STRENGTH, UPG_SCALE }; @@ -14,6 +15,15 @@ static u8 sEquipmentItemOffsets[] = { 0x00, 0x00, 0x01, 0x02, 0x00, 0x03, 0x04, 0x05, 0x00, 0x06, 0x07, 0x08, 0x00, 0x09, 0x0A, 0x0B, }; +// Vertices for A button indicator (coordinates 0.75x the texture size) +// pt (-97, -36) +static Vtx sStrengthAButtonVtx[] = { + VTX(-9, 6, 0, 0 << 5, 0 << 5, 0xFF, 0xFF, 0xFF, 0xFF), + VTX( 9, 6, 0, 24 << 5, 0 << 5, 0xFF, 0xFF, 0xFF, 0xFF), + VTX(-9, -6, 0, 0 << 5, 16 << 5, 0xFF, 0xFF, 0xFF, 0xFF), + VTX( 9, -6, 0, 24 << 5, 16 << 5, 0xFF, 0xFF, 0xFF, 0xFF), +}; + static s16 sEquipTimer = 0; void KaleidoScope_DrawEquipmentImage(PlayState* play, void* source, u32 width, u32 height) { @@ -89,6 +99,30 @@ void KaleidoScope_DrawEquipmentImage(PlayState* play, void* source, u32 width, u CLOSE_DISPS(play->state.gfxCtx); } +void KaleidoScope_DrawAButton(PlayState* play, Vtx* vtx, int16_t xTranslate, int16_t yTranslate) { + PauseContext* pauseCtx = &play->pauseCtx; + OPEN_DISPS(play->state.gfxCtx); + Matrix_Push(); + + Matrix_Translate(xTranslate, yTranslate, 0, MTXMODE_APPLY); + gSPMatrix(POLY_KAL_DISP++, MATRIX_NEWMTX(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + Color_RGB8 aButtonColor = { 0, 100, 255 }; + if (CVarGetInteger("gCosmetics.Hud_AButton.Changed", 0)) { + aButtonColor = CVarGetColor24("gCosmetics.Hud_AButton.Value", aButtonColor); + } else if (CVarGetInteger("gCosmetics.DefaultColorScheme", COLORSCHEME_N64) == COLORSCHEME_GAMECUBE) { + aButtonColor = (Color_RGB8){ 0, 255, 100 }; + } + + gSPVertex(POLY_KAL_DISP++, vtx, 4, 0); + gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, aButtonColor.r, aButtonColor.g, aButtonColor.b, pauseCtx->alpha); + gDPLoadTextureBlock(POLY_KAL_DISP++, gABtnSymbolTex, G_IM_FMT_IA, G_IM_SIZ_8b, 24, 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); + Matrix_Pop(); + gSPMatrix(POLY_KAL_DISP++, MATRIX_NEWMTX(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + CLOSE_DISPS(play->state.gfxCtx); +} + Vec3s link_kaleido_rot = { 0, 32300, 0 }; // Default rotation link face us. void KaleidoScope_DrawPlayerWork(PlayState* play) { @@ -686,18 +720,18 @@ void KaleidoScope_DrawEquipment(PlayState* play) { // Add zoom effect to strength item if cursor is hovering over it when toggle option is on if ((pauseCtx->cursorX[PAUSE_EQUIP] == 0) && (pauseCtx->cursorY[PAUSE_EQUIP] == 2) && - CVarGetInteger("gToggleStrength", 0)) { - i = 2; // row - k = 0; // column - j = 16 * i + 4 * k; // vtx index - pauseCtx->equipVtx[j].v.ob[0] = pauseCtx->equipVtx[j + 2].v.ob[0] = - pauseCtx->equipVtx[j].v.ob[0] - 2; - pauseCtx->equipVtx[j + 1].v.ob[0] = pauseCtx->equipVtx[j + 3].v.ob[0] = - pauseCtx->equipVtx[j + 1].v.ob[0] + 4; - pauseCtx->equipVtx[j].v.ob[1] = pauseCtx->equipVtx[j + 1].v.ob[1] = - pauseCtx->equipVtx[j].v.ob[1] + 2; - pauseCtx->equipVtx[j + 2].v.ob[1] = pauseCtx->equipVtx[j + 3].v.ob[1] = - pauseCtx->equipVtx[j + 2].v.ob[1] - 4; + CVarGetInteger("gToggleStrength", 0) && pauseCtx->cursorSpecialPos == 0) { + u8 row = 2; + u8 column = 0; + u8 equipVtxIndex = 16 * row + 4 * column; + pauseCtx->equipVtx[equipVtxIndex].v.ob[0] = pauseCtx->equipVtx[equipVtxIndex + 2].v.ob[0] = + pauseCtx->equipVtx[equipVtxIndex].v.ob[0] - 2; + pauseCtx->equipVtx[equipVtxIndex + 1].v.ob[0] = pauseCtx->equipVtx[equipVtxIndex + 3].v.ob[0] = + pauseCtx->equipVtx[equipVtxIndex + 1].v.ob[0] + 4; + pauseCtx->equipVtx[equipVtxIndex].v.ob[1] = pauseCtx->equipVtx[equipVtxIndex + 1].v.ob[1] = + pauseCtx->equipVtx[equipVtxIndex].v.ob[1] + 2; + pauseCtx->equipVtx[equipVtxIndex + 2].v.ob[1] = pauseCtx->equipVtx[equipVtxIndex + 3].v.ob[1] = + pauseCtx->equipVtx[equipVtxIndex + 2].v.ob[1] - 4; } Gfx_SetupDL_42Opa(play->state.gfxCtx); @@ -765,6 +799,20 @@ void KaleidoScope_DrawEquipment(PlayState* play) { } } + // Render A button indicator when hovered over strength + if ((pauseCtx->cursorX[PAUSE_EQUIP] == 0) && (pauseCtx->cursorY[PAUSE_EQUIP] == 2) && + CVarGetInteger("gToggleStrength", 0) && pauseCtx->cursorSpecialPos == 0 + && pauseCtx->unk_1E4 == 0 && pauseCtx->state == 6) { + u8 row = 2; + u8 column = 0; + u8 equipVtxIndex = 16 * row + 4 * column; + // Get Bottom Bisector of the Quad + s16 translateX = (pauseCtx->equipVtx[equipVtxIndex].v.ob[0] + pauseCtx->equipVtx[equipVtxIndex + 1].v.ob[0]) / 2; + // Add 4 since the icon will be zoomed in on + s16 translateY = pauseCtx->equipVtx[equipVtxIndex + 2].v.ob[1] + 4; + KaleidoScope_DrawAButton(play, sStrengthAButtonVtx, translateX, translateY); + } + KaleidoScope_DrawPlayerWork(play); //if ((pauseCtx->unk_1E4 == 7) && (sEquipTimer == 10)) {