mirror of
https://github.com/izzy2lost/2ship2harkinian-Android.git
synced 2026-06-19 01:20:08 -07:00
Add HUD Editor support for horse carrots (#704)
This commit is contained in:
@@ -17,6 +17,7 @@ HudEditorElement hudEditorElements[HUD_EDITOR_ELEMENT_MAX] = {
|
||||
HUD_EDITOR_ELEMENT(HUD_EDITOR_ELEMENT_D_PAD, "D-Pad", "DPad", 271, 55, 255, 255, 255, 255),
|
||||
HUD_EDITOR_ELEMENT(HUD_EDITOR_ELEMENT_MINIMAP, "Minimap", "Minimap", 295, 220, 0, 255, 255, 160),
|
||||
HUD_EDITOR_ELEMENT(HUD_EDITOR_ELEMENT_START, "Start Button", "Start", 136, 17, 255, 130, 60, 255),
|
||||
HUD_EDITOR_ELEMENT(HUD_EDITOR_ELEMENT_CARROT, "Horse Carrots", "Carrots", 160, 64, 236, 92, 41, 255),
|
||||
HUD_EDITOR_ELEMENT(HUD_EDITOR_ELEMENT_CLOCK, "Three Day Clock", "Clock", 160, 206, 255, 255, 255, 255),
|
||||
HUD_EDITOR_ELEMENT(HUD_EDITOR_ELEMENT_HEARTS, "Hearts", "Hearts", 30, 26, 255, 70, 50, 255),
|
||||
HUD_EDITOR_ELEMENT(HUD_EDITOR_ELEMENT_MAGIC_METER, "Magic", "Magic", 18, 34, 0, 200, 0, 255),
|
||||
@@ -206,6 +207,8 @@ void HudEditorWindow::DrawElement() {
|
||||
HUD_EDITOR_ELEMENT_MODE_MOVABLE_RIGHT);
|
||||
CVarSetInteger(hudEditorElements[HUD_EDITOR_ELEMENT_START].modeCvar,
|
||||
HUD_EDITOR_ELEMENT_MODE_MOVABLE_RIGHT);
|
||||
CVarSetInteger(hudEditorElements[HUD_EDITOR_ELEMENT_CARROT].modeCvar,
|
||||
HUD_EDITOR_ELEMENT_MODE_MOVABLE_43);
|
||||
CVarSetInteger(hudEditorElements[HUD_EDITOR_ELEMENT_CLOCK].modeCvar,
|
||||
HUD_EDITOR_ELEMENT_MODE_MOVABLE_43);
|
||||
CVarSetInteger(hudEditorElements[HUD_EDITOR_ELEMENT_HEARTS].modeCvar,
|
||||
|
||||
@@ -32,6 +32,7 @@ typedef enum {
|
||||
HUD_EDITOR_ELEMENT_D_PAD,
|
||||
HUD_EDITOR_ELEMENT_MINIMAP,
|
||||
HUD_EDITOR_ELEMENT_START,
|
||||
HUD_EDITOR_ELEMENT_CARROT,
|
||||
HUD_EDITOR_ELEMENT_CLOCK,
|
||||
HUD_EDITOR_ELEMENT_HEARTS,
|
||||
HUD_EDITOR_ELEMENT_MAGIC_METER,
|
||||
|
||||
@@ -8025,9 +8025,34 @@ void Interface_DrawMinigameIcons(PlayState* play) {
|
||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->aAlpha);
|
||||
}
|
||||
|
||||
gSPTextureRectangle(OVERLAY_DISP++, rectX << 2, rectY << 2, (rectX + 16) << 2, (rectY + 16) << 2,
|
||||
G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
|
||||
// #region 2S2H [Cosmetic] Hud Editor Carrots
|
||||
HudEditor_SetActiveElement(HUD_EDITOR_ELEMENT_CARROT);
|
||||
if (HudEditor_ShouldOverrideDraw()) {
|
||||
// Derived from the original call to gSPTextureRectangle below
|
||||
// Y pos set to 56 in override mode to ignore minigame state differences
|
||||
s16 newX = rectX;
|
||||
s16 newY = 56;
|
||||
s16 newWidth = 16;
|
||||
s16 newHeight = 16;
|
||||
s16 dsdx = 512;
|
||||
s16 dtdy = 512;
|
||||
|
||||
if (HudEditor_IsActiveElementHidden()) {
|
||||
break;
|
||||
}
|
||||
|
||||
HudEditor_ModifyDrawValues(&newX, &newY, &newWidth, &newHeight, &dsdx, &dtdy);
|
||||
|
||||
gSPWideTextureRectangle(OVERLAY_DISP++, newX << 2, newY << 2, (newX + newWidth) << 2,
|
||||
(newY + newHeight) << 2, G_TX_RENDERTILE, 0, 0, dsdx << 1, dtdy << 1);
|
||||
} else {
|
||||
// #endregion
|
||||
gSPTextureRectangle(OVERLAY_DISP++, rectX << 2, rectY << 2, (rectX + 16) << 2, (rectY + 16) << 2,
|
||||
G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
|
||||
}
|
||||
}
|
||||
|
||||
hudEditorActiveElement = HUD_EDITOR_ELEMENT_NONE;
|
||||
}
|
||||
|
||||
if (gSaveContext.minigameStatus == MINIGAME_STATUS_ACTIVE) {
|
||||
|
||||
Reference in New Issue
Block a user