diff --git a/mm/2s2h/BenGui/HudEditor.cpp b/mm/2s2h/BenGui/HudEditor.cpp index a4adbe36e..caeb4afc2 100644 --- a/mm/2s2h/BenGui/HudEditor.cpp +++ b/mm/2s2h/BenGui/HudEditor.cpp @@ -18,6 +18,7 @@ HudEditorElement hudEditorElements[HUD_EDITOR_ELEMENT_MAX] = { HUD_EDITOR_ELEMENT(HUD_EDITOR_ELEMENT_START, "Start Button", "Start", 136, 17, 255, 130, 60, 255), HUD_EDITOR_ELEMENT(HUD_EDITOR_ELEMENT_MAGIC_METER, "Magic", "Magic", 18, 34, 0, 200, 0, 255), HUD_EDITOR_ELEMENT(HUD_EDITOR_ELEMENT_HEARTS, "Hearts", "Hearts", 30, 26, 255, 70, 50, 255), + HUD_EDITOR_ELEMENT(HUD_EDITOR_ELEMENT_MINIGAME_COUNTER, "Minigames", "Minigames", 20, 67, 255, 255, 255, 255), HUD_EDITOR_ELEMENT(HUD_EDITOR_ELEMENT_RUPEE_COUNTER, "Rupees", "Rupees", 26, 206, 200, 255, 100, 255), HUD_EDITOR_ELEMENT(HUD_EDITOR_ELEMENT_KEY_COUNTER, "Keys", "Keys", 26, 190, 255, 255, 255, 255), HUD_EDITOR_ELEMENT(HUD_EDITOR_ELEMENT_SKULLTULA_COUNTER, "Skulltulas", "Skulltulas", 26, 190, 255, 255, 255, 255), @@ -142,6 +143,7 @@ void HudEditorWindow::DrawElement() { CVarSetInteger(hudEditorElements[HUD_EDITOR_ELEMENT_START].modeCvar, HUD_EDITOR_ELEMENT_MODE_MOVABLE_RIGHT); CVarSetInteger(hudEditorElements[HUD_EDITOR_ELEMENT_MAGIC_METER].modeCvar, HUD_EDITOR_ELEMENT_MODE_MOVABLE_LEFT); CVarSetInteger(hudEditorElements[HUD_EDITOR_ELEMENT_HEARTS].modeCvar, HUD_EDITOR_ELEMENT_MODE_MOVABLE_LEFT); + CVarSetInteger(hudEditorElements[HUD_EDITOR_ELEMENT_MINIGAME_COUNTER].modeCvar, HUD_EDITOR_ELEMENT_MODE_MOVABLE_LEFT); CVarSetInteger(hudEditorElements[HUD_EDITOR_ELEMENT_RUPEE_COUNTER].modeCvar, HUD_EDITOR_ELEMENT_MODE_MOVABLE_LEFT); CVarSetInteger(hudEditorElements[HUD_EDITOR_ELEMENT_KEY_COUNTER].modeCvar, HUD_EDITOR_ELEMENT_MODE_MOVABLE_LEFT); CVarSetInteger(hudEditorElements[HUD_EDITOR_ELEMENT_SKULLTULA_COUNTER].modeCvar, HUD_EDITOR_ELEMENT_MODE_MOVABLE_LEFT); diff --git a/mm/2s2h/BenGui/HudEditor.h b/mm/2s2h/BenGui/HudEditor.h index d5c54de32..df0539a2f 100644 --- a/mm/2s2h/BenGui/HudEditor.h +++ b/mm/2s2h/BenGui/HudEditor.h @@ -33,6 +33,7 @@ typedef enum { HUD_EDITOR_ELEMENT_START, HUD_EDITOR_ELEMENT_MAGIC_METER, HUD_EDITOR_ELEMENT_HEARTS, + HUD_EDITOR_ELEMENT_MINIGAME_COUNTER, HUD_EDITOR_ELEMENT_RUPEE_COUNTER, HUD_EDITOR_ELEMENT_KEY_COUNTER, HUD_EDITOR_ELEMENT_SKULLTULA_COUNTER, diff --git a/mm/src/code/z_parameter.c b/mm/src/code/z_parameter.c index 0bfb1e465..8cbbc2979 100644 --- a/mm/src/code/z_parameter.c +++ b/mm/src/code/z_parameter.c @@ -7662,8 +7662,33 @@ void Interface_DrawMinigameIcons(PlayState* play) { G_TX_NOLOD, G_TX_NOLOD); } - gSPTextureRectangle(OVERLAY_DISP++, (rectX << 2), (rectY << 2), ((rectX + width) << 2), - ((rectY + height) << 2), G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); + // #region 2S2H [Cosmetic] Hud Editor + HudEditor_SetActiveElement(HUD_EDITOR_ELEMENT_MINIGAME_COUNTER); + if (HudEditor_ShouldOverrideDraw()) { + if (CVarGetInteger(hudEditorElements[hudEditorActiveElement].modeCvar, HUD_EDITOR_ELEMENT_MODE_VANILLA) == HUD_EDITOR_ELEMENT_MODE_HIDDEN) { + hudEditorActiveElement = HUD_EDITOR_ELEMENT_NONE; + } else { + s16 newRectX = rectX; + s16 newRectY = rectY; + s16 newWidth = width; + s16 newHeight = height; + u16 dsdx = 512; + u16 dtdy = 512; + + HudEditor_ModifyDrawValues(&newRectX, &newRectY, &newWidth, &newHeight, &dsdx, &dtdy); + + hudEditorActiveElement = HUD_EDITOR_ELEMENT_NONE; + + gSPWideTextureRectangle(OVERLAY_DISP++, (newRectX << 2), (newRectY << 2), + ((newRectX + newWidth) << 2), ((newRectY + newHeight) << 2), + G_TX_RENDERTILE, 0, 0, dsdx << 1, dtdy << 1); + } + } else { + // #endregion + gSPTextureRectangle(OVERLAY_DISP++, (rectX << 2), (rectY << 2), ((rectX + width) << 2), + ((rectY + height) << 2), G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); + } + gDPPipeSync(OVERLAY_DISP++); gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->bAlpha); gDPSetCombineLERP(OVERLAY_DISP++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE, TEXEL0, @@ -7682,6 +7707,8 @@ void Interface_DrawMinigameIcons(PlayState* play) { for (i = 0, numDigitsDrawn = 0; i < 4; i++) { if ((sMinigameScoreDigits[i] != 0) || (numDigitsDrawn != 0) || (i >= 3)) { + // 2S2H [Cosmetic] Hud Editor + HudEditor_SetActiveElement(HUD_EDITOR_ELEMENT_MINIGAME_COUNTER); OVERLAY_DISP = Gfx_DrawTexRectI8(OVERLAY_DISP, sCounterTextures[sMinigameScoreDigits[i]], 8, 0x10, rectX, rectY - 2, 9, 0xFA, 0x370, 0x370); rectX += 9;