diff --git a/soh/soh/Enhancements/presets.h b/soh/soh/Enhancements/presets.h index eb7c34e2a54..fd23d8ae6c9 100644 --- a/soh/soh/Enhancements/presets.h +++ b/soh/soh/Enhancements/presets.h @@ -219,6 +219,9 @@ const std::vector enhancementsCvars = { "gFPSGauntlets", "gSceneSpecificDirtPathFix", "gZFightingMode", + "gVisualKeys", + "gSmallKeySpacing", + "gRightAlignKeys", "gAuthenticLogo", "gPauseLiveLinkRotationSpeed", "gBowReticle", diff --git a/soh/soh/SohMenuBar.cpp b/soh/soh/SohMenuBar.cpp index ade4f752380..87acec342ab 100644 --- a/soh/soh/SohMenuBar.cpp +++ b/soh/soh/SohMenuBar.cpp @@ -1027,6 +1027,11 @@ void DrawEnhancementsMenu() { "Consistent: Certain paths vanish the same way in all resolutions\n" "No Vanish: Paths do not vanish, Link seems to sink in to some paths\n" "This might affect other decal effects\n"); + UIWidgets::PaddedEnhancementCheckbox("Visual Small Key display", "gVisualKeys", true, false); + UIWidgets::Tooltip("Displays Small Key count using multiple icons rather than a numeric counter"); + const bool disableKeySpacing = !CVarGetInteger("gVisualKeys", 0); + static const char* disableKeySpacingTooltip = "This option is disabled because \"Visual Small Key display\" is turned off"; + UIWidgets::EnhancementSliderInt("Small Key icon spacing: %d", "##SmallKeySpacing", "gSmallKeySpacing", 1, 16, "", 8, true, disableKeySpacing, disableKeySpacingTooltip); UIWidgets::PaddedEnhancementSliderInt("Text Spacing: %d", "##TEXTSPACING", "gTextSpacing", 4, 6, "", 6, true, true, true); UIWidgets::Tooltip("Space between text characters (useful for HD font textures)"); UIWidgets::PaddedEnhancementCheckbox("More info in file select", "gFileSelectMoreInfo", true, false); diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c index 449ee285424..4c93feac036 100644 --- a/soh/src/code/z_parameter.c +++ b/soh/src/code/z_parameter.c @@ -5332,6 +5332,21 @@ void Interface_Draw(PlayState* play) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, keyCountColor.r,keyCountColor.g,keyCountColor.b, interfaceCtx->magicAlpha); gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 20, 255); //We reset this here so it match user color :) + + if (CVarGetInteger("gVisualKeys", 0)) { + s8 keyCount = gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex]; + s16 rectLeft = PosX_SKC; + s16 keyOffset = CVarGetInteger("gSmallKeySpacing", 8); + if (CVarGetInteger("gRightAlignKeys", 0)) { + keyOffset = -keyOffset; + } + for (int i = 0; i < keyCount; i++, rectLeft += keyOffset) { + OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, gSmallKeyCounterIconTex, 16, 16, rectLeft, PosY_SKC, 16, 16, + 1 << 10, 1 << 10); + } + break; + } + OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, gSmallKeyCounterIconTex, 16, 16, PosX_SKC, PosY_SKC, 16, 16, 1 << 10, 1 << 10);