diff --git a/soh/soh/Enhancements/DisableJabuWobble.cpp b/soh/soh/Enhancements/DisableJabuWobble.cpp new file mode 100644 index 000000000..083e80c71 --- /dev/null +++ b/soh/soh/Enhancements/DisableJabuWobble.cpp @@ -0,0 +1,8 @@ +#include "soh/Enhancements/game-interactor/GameInteractor.h" +#include "soh/ShipInit.hpp" + +void RegisterDisableJabuWobble() { + COND_VB_SHOULD(VB_JABU_WOBBLE, CVarGetInteger(CVAR_SETTING("A11yNoJabuWobble"), 0), { *should = false; }); +} + +static RegisterShipInitFunc initFunc(RegisterDisableJabuWobble, { CVAR_SETTING("A11yNoJabuWobble") }); diff --git a/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h b/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h index 06e3ab6fe..91f18ff15 100644 --- a/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h +++ b/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h @@ -1251,6 +1251,14 @@ typedef enum { // - `*EnItem00` VB_ITEM00_DESPAWN, + // #### `result` + // ```c + // true + // ``` + // #### `args` + // - None + VB_JABU_WOBBLE, + // #### `result` // ```c // true diff --git a/soh/soh/SohGui/SohMenuSettings.cpp b/soh/soh/SohGui/SohMenuSettings.cpp index 63587f2da..14add6cb0 100644 --- a/soh/soh/SohGui/SohMenuSettings.cpp +++ b/soh/soh/SohGui/SohMenuSettings.cpp @@ -236,6 +236,10 @@ void SohMenu::AddMenuSettings() { .CVar(CVAR_SETTING("A11yNoScreenFlashForFinishingBlow")) .RaceDisable(false) .Options(CheckboxOptions().Tooltip("Disables the white screen flash on enemy kill.")); + AddWidget(path, "Disable Jabu Wobble", WIDGET_CVAR_CHECKBOX) + .CVar(CVAR_SETTING("A11yNoJabuWobble")) + .RaceDisable(false) + .Options(CheckboxOptions().Tooltip("Disable the geometry wobble and camera distortion inside Jabu.")); 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_scene_table.c b/soh/src/code/z_scene_table.c index aad6a1b69..090d52fa6 100644 --- a/soh/src/code/z_scene_table.c +++ b/soh/src/code/z_scene_table.c @@ -26,6 +26,7 @@ #include "soh/mq_asset_hacks.h" #include "soh/OTRGlobals.h" #include "soh/ResourceManagerHelpers.h" +#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" // Entrance Table definition #define DEFINE_ENTRANCE(_0, sceneId, spawn, continueBgm, displayTitleCard, endTransType, startTransType) \ @@ -1572,8 +1573,10 @@ void func_8009FE58(PlayState* play) { if (FrameAdvance_IsEnabled(play) != true) { - D_8012A39C += 1820; - D_8012A3A0 += 1820; + if (GameInteractor_Should(VB_JABU_WOBBLE, true)) { + D_8012A39C += 1820; + D_8012A3A0 += 1820; + } temp = 0.020000001f; @@ -1608,7 +1611,7 @@ void func_8009FE58(PlayState* play) { break; } - if (play->pauseCtx.state == 0) { + if (GameInteractor_Should(VB_JABU_WOBBLE, play->pauseCtx.state == 0)) { D_8012A398 += 0.15f + (play->roomCtx.unk_74[1] * 0.001f); } }