Add a toggle for muting the low HP alarm (#310)

* Removes the code that plays the low health alarm sound effect, by removing that instead of making HealthMeter_IsCritical always return false, Link will still play the tired animation when low on health.

* Made the low health alarm an enhancement toggle
This commit is contained in:
earthcrafterman 2022-05-15 15:04:04 -04:00 committed by GitHub
parent f217b9bb97
commit 3e01b25573
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -667,6 +667,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");
Tooltip("Holding down B skips text");
EnhancementCheckbox("Minimal UI", "gMinimalUI");

View File

@ -498,7 +498,7 @@ void HealthMeter_HandleCriticalAlarm(GlobalContext* globalCtx) {
if (interfaceCtx->unk_22A <= 0) {
interfaceCtx->unk_22A = 0;
interfaceCtx->unk_22C = 0;
if (!Player_InCsMode(globalCtx) && (globalCtx->pauseCtx.state == 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);
}