From 3bef25f9b6ff5deb6d98878b7e017e0d2522b52d Mon Sep 17 00:00:00 2001 From: Kiloku Date: Sun, 12 Jan 2025 23:53:56 -0300 Subject: [PATCH] Allow players to disable the Gorgon's screen flashes --- src/engine/fox_effect.c | 4 +++- src/overlays/ovl_i3/fox_a6.c | 6 ++++-- src/port/ui/ImguiUI.cpp | 8 ++++++++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/engine/fox_effect.c b/src/engine/fox_effect.c index 16493335..a57d0466 100644 --- a/src/engine/fox_effect.c +++ b/src/engine/fox_effect.c @@ -3786,7 +3786,9 @@ void Effect_Effect395_Update(Effect395* this) { D_ctx_801779A8[0] = 50.0f; if (this->unk_46 == 10) { gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 255; - gFillScreenAlpha = gFillScreenAlphaTarget = 255; + if (CVarGetInteger("gDisableGorgonFlash", 0) == 0){ + gFillScreenAlpha = gFillScreenAlphaTarget = 255; + } gFillScreenAlphaTarget = 0; gFillScreenAlphaStep = 25; gCameraShake = 50; diff --git a/src/overlays/ovl_i3/fox_a6.c b/src/overlays/ovl_i3/fox_a6.c index 3647d921..f2426fa8 100644 --- a/src/overlays/ovl_i3/fox_a6.c +++ b/src/overlays/ovl_i3/fox_a6.c @@ -830,8 +830,10 @@ void Area6_A6Gorgon_Update(A6Gorgon* this) { case 2: Math_SmoothStepToF(D_ctx_801779A8, 10.0f, 1.0f, 5.0f, 0.0f); if (this->timer_050 == 10) { - gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 255; - gFillScreenAlpha = gFillScreenAlphaTarget = 255; + if (CVarGetInteger("gDisableGorgonFlash", 0) == 0) { + gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 255; + gFillScreenAlpha = gFillScreenAlphaTarget = 255; + } gFillScreenAlphaTarget = 0; gFillScreenAlphaStep = 25; gCameraShake = 50; diff --git a/src/port/ui/ImguiUI.cpp b/src/port/ui/ImguiUI.cpp index f2b1dd0e..c2000e90 100644 --- a/src/port/ui/ImguiUI.cpp +++ b/src/port/ui/ImguiUI.cpp @@ -542,6 +542,14 @@ void DrawEnhancementsMenu() { ImGui::EndMenu(); } + if (UIWidgets::BeginMenu("Accessibility")) { + UIWidgets::CVarCheckbox("Disable Gorgon (Area 6 boss) screen flashes", "gDisableGorgonFlash", { + .tooltip = "Gorgon flashes the screen repeatedly when firing its beam or when teleporting, which causes eye pain for some players and may be harmful to those with photosensitivity.", + .defaultValue = false + }); + ImGui::EndMenu(); + } + ImGui::EndMenu(); } }