From 6a39dbad224eff524fdc586c553fb061821f8e39 Mon Sep 17 00:00:00 2001 From: earthcrafterman Date: Fri, 13 May 2022 08:58:23 -0400 Subject: [PATCH] Made the low health alarm an enhancement toggle --- libultraship/libultraship/SohImGuiImpl.cpp | 1 + soh/src/code/z_lifemeter.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/libultraship/libultraship/SohImGuiImpl.cpp b/libultraship/libultraship/SohImGuiImpl.cpp index 72d9cee1a..0adb744a8 100644 --- a/libultraship/libultraship/SohImGuiImpl.cpp +++ b/libultraship/libultraship/SohImGuiImpl.cpp @@ -658,6 +658,7 @@ namespace SohImGui { EnhancementSliderInt("Text Speed: %dx", "##TEXTSPEED", "gTextSpeed", 1, 5, ""); EnhancementSliderInt("King Zora Speed: %dx", "##WEEPSPEED", "gMweepSpeed", 1, 5, ""); + EnhancementCheckbox("Mute Low HP Alarm", "gLowHpAlarm"); EnhancementCheckbox("Skip Text", "gSkipText"); EnhancementCheckbox("Minimal UI", "gMinimalUI"); EnhancementCheckbox("MM Bunny Hood", "gMMBunnyHood"); diff --git a/soh/src/code/z_lifemeter.c b/soh/src/code/z_lifemeter.c index db00ebeaf..5f1863440 100644 --- a/soh/src/code/z_lifemeter.c +++ b/soh/src/code/z_lifemeter.c @@ -498,6 +498,10 @@ void HealthMeter_HandleCriticalAlarm(GlobalContext* globalCtx) { if (interfaceCtx->unk_22A <= 0) { interfaceCtx->unk_22A = 0; interfaceCtx->unk_22C = 0; + if (CVar_GetS32("gLowHpAlarm", 0) == 0 && !Player_InCsMode(globalCtx) && (globalCtx->pauseCtx.state == 0) && + (globalCtx->pauseCtx.debugState == 0) && HealthMeter_IsCritical() && !Gameplay_InCsMode(globalCtx)) { + func_80078884(NA_SE_SY_HITPOINT_ALARM); + } } } else { interfaceCtx->unk_22A++;