Fix Skulltula Counter Hud Editor (#308)

This commit is contained in:
inspectredc
2024-05-22 09:05:03 -05:00
committed by Garrett Cox
parent 5a8989bdbe
commit 5fe3e350fa
+51 -25
View File
@@ -6942,12 +6942,38 @@ void Interface_Draw(PlayState* play) {
gDPPipeSync(OVERLAY_DISP++);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 0, 0, 0, interfaceCtx->magicAlpha);
HudEditor_SetActiveElement(HUD_EDITOR_ELEMENT_SKULLTULA_COUNTER);
OVERLAY_DISP = Gfx_DrawTexRectI8(OVERLAY_DISP, sCounterTextures[counterDigits[2]], 8, 16, 43, 191, 8,
16, 1 << 10, 1 << 10);
gDPPipeSync(OVERLAY_DISP++);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->magicAlpha);
gSPTextureRectangle(OVERLAY_DISP++, 168, 760, 200, 824, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
// #region 2S2H [Cosmetic] Hud Editor
HudEditor_SetActiveElement(HUD_EDITOR_ELEMENT_SKULLTULA_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 {
// All of this information was derived from the original call to gSPTextureRectangle below
s16 rectLeft = 168 / 4;
s16 rectTop = 760 / 4;
s16 rectWidth = (200 / 4) - rectLeft;
s16 rectHeight = (824 / 4) - rectTop;
s16 dsdx = 512;
s16 dtdy = 512;
HudEditor_ModifyDrawValues(&rectLeft, &rectTop, &rectWidth, &rectHeight, &dsdx, &dtdy);
hudEditorActiveElement = HUD_EDITOR_ELEMENT_NONE;
gSPWideTextureRectangle(OVERLAY_DISP++, rectLeft << 2, rectTop << 2,
(rectLeft + rectWidth) << 2, (rectTop + rectHeight) << 2,
G_TX_RENDERTILE, 0, 0, dsdx << 1, dtdy << 1);
}
// #endregion
} else {
gSPTextureRectangle(OVERLAY_DISP++, 168, 760, 200, 824, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
}
sp2CA += 8;
}
@@ -6963,32 +6989,32 @@ void Interface_Draw(PlayState* play) {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->magicAlpha);
// #region 2S2H [Cosmetic] Hud Editor
HudEditor_SetActiveElement(HUD_EDITOR_ELEMENT_SKULLTULA_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 {
// All of this information was derived from the original call to gSPTextureRectangle below
s16 rectLeft = sp2CA;
s16 rectTop = 760 / 4;
s16 rectWidth = 0x20 / 4;
s16 rectHeight = (824 / 4) - rectTop;
s16 dsdx = 512;
s16 dtdy = 512;
HudEditor_ModifyDrawValues(&rectLeft, &rectTop, &rectWidth, &rectHeight, &dsdx, &dtdy);
hudEditorActiveElement = HUD_EDITOR_ELEMENT_NONE;
gSPWideTextureRectangle(OVERLAY_DISP++, rectLeft << 2, rectTop << 2,
(rectLeft + rectWidth) << 2, (rectTop + rectHeight) << 2,
G_TX_RENDERTILE, 0, 0, dsdx << 1, dtdy << 1);
}
// #endregion
HudEditor_SetActiveElement(HUD_EDITOR_ELEMENT_SKULLTULA_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 {
gSPTextureRectangle(OVERLAY_DISP++, sp2CA * 4, 760, (sp2CA * 4) + 0x20, 824, G_TX_RENDERTILE, 0,
0, 1 << 10, 1 << 10);
// All of this information was derived from the original call to gSPTextureRectangle below
s16 rectLeft = sp2CA;
s16 rectTop = 760 / 4;
s16 rectWidth = 0x20 / 4;
s16 rectHeight = (824 / 4) - rectTop;
s16 dsdx = 512;
s16 dtdy = 512;
HudEditor_ModifyDrawValues(&rectLeft, &rectTop, &rectWidth, &rectHeight, &dsdx, &dtdy);
hudEditorActiveElement = HUD_EDITOR_ELEMENT_NONE;
gSPWideTextureRectangle(OVERLAY_DISP++, rectLeft << 2, rectTop << 2,
(rectLeft + rectWidth) << 2, (rectTop + rectHeight) << 2,
G_TX_RENDERTILE, 0, 0, dsdx << 1, dtdy << 1);
}
// #endregion
} else {
gSPTextureRectangle(OVERLAY_DISP++, sp2CA * 4, 760, (sp2CA * 4) + 0x20, 824, G_TX_RENDERTILE, 0,
0, 1 << 10, 1 << 10);
}
break;
default: