diff --git a/soh/soh/Enhancements/DisableHeatHaze.cpp b/soh/soh/Enhancements/DisableHeatHaze.cpp new file mode 100644 index 0000000000..0f49725cb3 --- /dev/null +++ b/soh/soh/Enhancements/DisableHeatHaze.cpp @@ -0,0 +1,8 @@ +#include "soh/Enhancements/game-interactor/GameInteractor.h" +#include "soh/ShipInit.hpp" + +void RegisterDisableHeatHaze() { + COND_VB_SHOULD(VB_HOT_ROOM_DISTORTION, CVarGetInteger(CVAR_SETTING("A11yNoHeatHaze"), 0), { *should = false; }); +} + +static RegisterShipInitFunc initFunc(RegisterDisableHeatHaze, { CVAR_SETTING("A11yNoHeatHaze") }); diff --git a/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h b/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h index d1ed453410..d19a698584 100644 --- a/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h +++ b/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h @@ -1365,6 +1365,14 @@ typedef enum { // - None VB_JABU_WOBBLE, + // #### `result` + // ```c + // true + // ``` + // #### `args` + // - None + VB_HOT_ROOM_DISTORTION, + // #### `result` // ```c // true diff --git a/soh/soh/SohGui/SohMenuSettings.cpp b/soh/soh/SohGui/SohMenuSettings.cpp index b806da560c..f37463d121 100644 --- a/soh/soh/SohGui/SohMenuSettings.cpp +++ b/soh/soh/SohGui/SohMenuSettings.cpp @@ -251,6 +251,10 @@ void SohMenu::AddMenuSettings() { .CVar(CVAR_SETTING("A11yNoJabuWobble")) .RaceDisable(false) .Options(CheckboxOptions().Tooltip("Disable the geometry wobble and camera distortion inside Jabu.")); + AddWidget(path, "Disable Heat Haze", WIDGET_CVAR_CHECKBOX) + .CVar(CVAR_SETTING("A11yNoHeatHaze")) + .RaceDisable(false) + .Options(CheckboxOptions().Tooltip("Disable the heat haze distortion effect in Death Mountain / Fire Temple.")); AddWidget(path, "EXPERIMENTAL", WIDGET_SEPARATOR_TEXT).Options(TextOptions().Color(Colors::Orange)); AddWidget(path, "ImGui Menu Scaling", WIDGET_CVAR_COMBOBOX) .CVar(CVAR_SETTING("ImGuiScale")) diff --git a/soh/src/code/z_camera.c b/soh/src/code/z_camera.c index 0d30dcb2e6..ff26cb436b 100644 --- a/soh/src/code/z_camera.c +++ b/soh/src/code/z_camera.c @@ -8,6 +8,7 @@ #include "soh/frame_interpolation.h" #include "soh/Enhancements/controls/Mouse.h" +#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" s16 Camera_ChangeSettingFlags(Camera* camera, s16 setting, s16 flags); s32 Camera_ChangeModeFlags(Camera* camera, s16 mode, u8 flags); @@ -7363,7 +7364,8 @@ s32 Camera_UpdateWater(Camera* camera) { s32 Camera_UpdateHotRoom(Camera* camera) { camera->distortionFlags &= ~DISTORTION_HOT_ROOM; - if (camera->play->roomCtx.curRoom.behaviorType2 == ROOM_BEHAVIOR_TYPE2_3) { + if (GameInteractor_Should(VB_HOT_ROOM_DISTORTION, + camera->play->roomCtx.curRoom.behaviorType2 == ROOM_BEHAVIOR_TYPE2_3)) { camera->distortionFlags |= DISTORTION_HOT_ROOM; }