Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visual Small Key display #7

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions soh/soh/Enhancements/presets.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,9 @@ const std::vector<const char*> enhancementsCvars = {
"gFPSGauntlets",
"gSceneSpecificDirtPathFix",
"gZFightingMode",
"gVisualKeys",
"gSmallKeySpacing",
"gRightAlignKeys",
"gAuthenticLogo",
"gPauseLiveLinkRotationSpeed",
"gBowReticle",
Expand Down
5 changes: 5 additions & 0 deletions soh/soh/SohMenuBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
15 changes: 15 additions & 0 deletions soh/src/code/z_parameter.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Loading