From c5940905e76b73a28e832257772ffb74fef785db Mon Sep 17 00:00:00 2001 From: Garrett Cox Date: Wed, 2 Nov 2022 21:07:10 -0500 Subject: [PATCH] Add glitch line-up tick option (#1875) --- soh/soh/GameMenuBar.cpp | 2 ++ soh/src/code/z_parameter.c | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/soh/soh/GameMenuBar.cpp b/soh/soh/GameMenuBar.cpp index caffb04d2..4d9f29e8d 100644 --- a/soh/soh/GameMenuBar.cpp +++ b/soh/soh/GameMenuBar.cpp @@ -1076,6 +1076,8 @@ namespace GameMenuBar { } UIWidgets::PaddedEnhancementCheckbox("N64 Mode", "gN64Mode", true, false); UIWidgets::Tooltip("Sets aspect ratio to 4:3 and lowers resolution to 240p, the N64's native resolution"); + UIWidgets::PaddedEnhancementCheckbox("Glitch line-up tick", "gDrawLineupTick", true, false); + UIWidgets::Tooltip("Displays a tick in the top center of the screen to help with glitch line-ups in SoH, as traditional UI based line-ups do not work outside of 4:3"); UIWidgets::PaddedEnhancementCheckbox("Enable 3D Dropped items/projectiles", "gNewDrops", true, false); UIWidgets::Tooltip("Change most 2D items and projectiles on the overworld to their 3D versions"); UIWidgets::PaddedEnhancementCheckbox("Disable Black Bar Letterboxes", "gDisableBlackBars", true, false); diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c index c37586cce..8f4497c8b 100644 --- a/soh/src/code/z_parameter.c +++ b/soh/src/code/z_parameter.c @@ -3433,6 +3433,28 @@ void Interface_UpdateMagicBar(GlobalContext* globalCtx) { } } +void Interface_DrawLineupTick(GlobalContext* globalCtx) { + InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx; + + OPEN_DISPS(globalCtx->state.gfxCtx); + + func_80094520(globalCtx->state.gfxCtx); + + gDPSetEnvColor(OVERLAY_DISP++, 255, 255, 255, 255); + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, 255); + + s16 width = 32; + s16 height = 32; + s16 x = -8 + (SCREEN_WIDTH / 2); + s16 y = CVar_GetS32("gOpenMenuBar", 0) ? -4 : -6; + + OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, gEmptyCDownArrowTex, width, height, x, y, width, height, 2 << 10, 2 << 10); + + gDPPipeSync(OVERLAY_DISP++); + + CLOSE_DISPS(globalCtx->state.gfxCtx); +} + void Interface_DrawMagicBar(GlobalContext* globalCtx) { InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx; s16 magicDrop = R_MAGIC_BAR_LARGE_Y-R_MAGIC_BAR_SMALL_Y+2; @@ -5049,6 +5071,10 @@ void Interface_Draw(GlobalContext* globalCtx) { gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 0); } + if (CVar_GetS32("gDrawLineupTick", 1)) { + Interface_DrawLineupTick(globalCtx); + } + if (fullUi || gSaveContext.unk_13F0 > 0) { Interface_DrawMagicBar(globalCtx); }