From 077ed0ad7361e64fdf71a8d6be4cefdde29bef63 Mon Sep 17 00:00:00 2001 From: JustAnotherWebDev <128695107+JustAnotherWebDev@users.noreply.github.com> Date: Sun, 21 Jun 2026 01:30:55 +0200 Subject: [PATCH 1/4] Added new cheat "Easy ESS" --- soh/soh/Enhancements/Cheats/EasyESS.cpp | 43 +++++++++++++++++++++++++ soh/soh/SohGui/SohMenuEnhancements.cpp | 3 ++ soh/soh/config/ConfigUpdaters.cpp | 1 + 3 files changed, 47 insertions(+) create mode 100644 soh/soh/Enhancements/Cheats/EasyESS.cpp diff --git a/soh/soh/Enhancements/Cheats/EasyESS.cpp b/soh/soh/Enhancements/Cheats/EasyESS.cpp new file mode 100644 index 00000000000..01e253bc6e7 --- /dev/null +++ b/soh/soh/Enhancements/Cheats/EasyESS.cpp @@ -0,0 +1,43 @@ +#include +#include +#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ShipInit.hpp" +#include + +extern "C" { + extern PlayState* gPlayState; + #include "macros.h" +} + +#define CVAR_EASY_ESS_NAME CVAR_CHEAT("EasyESS") +#define CVAR_EASY_ESS_DEFAULT 0 +#define CVAR_EASY_ESS_VALUE CVarGetInteger(CVAR_EASY_ESS_NAME, CVAR_EASY_ESS_DEFAULT) + +void OnGameStateMainStartEasyESS() { + if (!GameInteractor::IsSaveLoaded(true)) { + return; + } + + Player* player = GET_PLAYER(gPlayState); + Input* input = &gPlayState->state.input[0]; + + if (player != nullptr && CHECK_BTN_ANY(input->cur.button, BTN_CUSTOM_MODIFIER1)) { + const int essValue = 18; + int x = input->cur.stick_x; + int y = input->cur.stick_y; + int magSq = x * x + y * y; + if (magSq > essValue * essValue) { + float mag = sqrtf(static_cast(magSq)); + input->cur.stick_x = static_cast((x / mag) * essValue); + input->cur.stick_y = static_cast((y / mag) * essValue); + input->rel.stick_x = input->cur.stick_x; + input->rel.stick_y = input->cur.stick_y; + } + } +} + +void RegisterEasyESS() { + COND_HOOK(OnGameStateMainStart, CVAR_EASY_ESS_VALUE, OnGameStateMainStartEasyESS); +} + +static RegisterShipInitFunc initFunc(RegisterEasyESS, { CVAR_EASY_ESS_NAME }); \ No newline at end of file diff --git a/soh/soh/SohGui/SohMenuEnhancements.cpp b/soh/soh/SohGui/SohMenuEnhancements.cpp index c8c52897cc7..5fdf2b88877 100644 --- a/soh/soh/SohGui/SohMenuEnhancements.cpp +++ b/soh/soh/SohGui/SohMenuEnhancements.cpp @@ -1816,6 +1816,9 @@ void SohMenu::AddMenuEnhancements() { AddWidget(path, "Easy QPA", WIDGET_CVAR_CHECKBOX) .CVar(CVAR_CHEAT("EasyQPA")) .Options(CheckboxOptions().Tooltip("Gives you the glitched damage value of the quick put away glitch.")); + AddWidget(path, "Easy ESS", WIDGET_CVAR_CHECKBOX) + .CVar(CVAR_CHEAT("EasyESS")) + .Options(CheckboxOptions().Tooltip("Force ESS position while holding M1.")); AddWidget(path, "Clear Cutscene Pointer", WIDGET_BUTTON) .Callback([](WidgetInfo& info) { GameInteractor::RawAction::ClearCutscenePointer(); }) .Options(ButtonOptions() diff --git a/soh/soh/config/ConfigUpdaters.cpp b/soh/soh/config/ConfigUpdaters.cpp index 8249bb48d31..a043df2c1ec 100644 --- a/soh/soh/config/ConfigUpdaters.cpp +++ b/soh/soh/config/ConfigUpdaters.cpp @@ -305,6 +305,7 @@ static const Migration version3Migrations[] = { { "gEnableBetaQuest", "gCheats.EnableBetaQuest" }, { "gEzISG", "gCheats.EasyISG" }, { "gEzQPA", "gCheats.EasyQPA" }, + { "gEzESS", "gCheats.EasyESS" }, { "gFireproofDekuShield", "gCheats.FireproofDekuShield" }, { "gFreezeTime", "gCheats.FreezeTime" }, { "gHookshotEverything", "gCheats.HookshotEverything" }, From 7f07359490299d2831235d4a68a7b09bbc71616a Mon Sep 17 00:00:00 2001 From: JustAnotherWebDev <128695107+JustAnotherWebDev@users.noreply.github.com> Date: Sun, 21 Jun 2026 01:32:27 +0200 Subject: [PATCH 2/4] Added "Easy ESS" logic to Input Viewer --- soh/soh/Enhancements/controls/InputViewer.cpp | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/soh/soh/Enhancements/controls/InputViewer.cpp b/soh/soh/Enhancements/controls/InputViewer.cpp index c5855884131..19624620c2a 100644 --- a/soh/soh/Enhancements/controls/InputViewer.cpp +++ b/soh/soh/Enhancements/controls/InputViewer.cpp @@ -350,6 +350,18 @@ void InputViewer::DrawElement() { const bool analogStickIsInDeadzone = !pads[0].stick_x && !pads[0].stick_y; const bool rightStickIsInDeadzone = !pads[0].right_stick_x && !pads[0].right_stick_y; + const int essValue = 18; + int stickX = pads[0].stick_x; + int stickY = pads[0].stick_y; + if ((pads[0].button & BTN_CUSTOM_MODIFIER1) && CVarGetInteger(CVAR_CHEAT("EasyESS"), 0)) { + int magSq = stickX * stickX + stickY * stickY; + if (magSq > essValue * essValue) { + float mag = sqrtf(static_cast(magSq)); + stickX = static_cast((stickX / mag) * essValue); + stickY = static_cast((stickY / mag) * essValue); + } + } + // Analog Stick const int analogOutlineMode = CVarGetInteger(CVAR_INPUT_VIEWER("AnalogStick.OutlineMode"), STICK_MODE_ALWAYS_SHOWN); @@ -369,8 +381,8 @@ void InputViewer::DrawElement() { (analogStickMode == STICK_MODE_HIDDEN_IN_DEADZONE && !analogStickIsInDeadzone)) { ImGui::SetNextItemAllowOverlap(); ImGui::SetCursorPos( - ImVec2(aPos.x + maxStickDistance * ((float)(pads[0].stick_x) / MAX_AXIS_RANGE) * scale, - aPos.y - maxStickDistance * ((float)(pads[0].stick_y) / MAX_AXIS_RANGE) * scale)); + ImVec2(aPos.x + maxStickDistance * ((float)(stickX) / MAX_AXIS_RANGE) * scale, + aPos.y - maxStickDistance * ((float)(stickY) / MAX_AXIS_RANGE) * scale)); ImGui::Image( std::dynamic_pointer_cast(Ship::Context::GetRawInstance()->GetWindow()->GetGui()) ->GetTextureByName("Analog-Stick"), @@ -415,7 +427,7 @@ void InputViewer::DrawElement() { ImGui::PushFont(ImGui::GetFont()); // Calculate polar R coordinate from X and Y angles, squared to avoid sqrt - const int32_t rSquared = pads[0].stick_x * pads[0].stick_x + pads[0].stick_y * pads[0].stick_y; + const int32_t rSquared = stickX * stickX + stickY * stickY; // ESS range const int range1Min = CVarGetInteger(CVAR_INPUT_VIEWER("AnalogAngles.Range1.Min"), 8); @@ -442,7 +454,7 @@ void InputViewer::DrawElement() { } // Render text - ImGui::Text("X: %-3d Y: %-3d", pads[0].stick_x, pads[0].stick_y); + ImGui::Text("X: %-3d Y: %-3d", stickX, stickY); // Restore original color ImGui::PopStyleColor(); // Restore original font scale From 3998018270b95bdc208135d99613211fa623b46d Mon Sep 17 00:00:00 2001 From: JustAnotherWebDev <128695107+JustAnotherWebDev@users.noreply.github.com> Date: Sun, 21 Jun 2026 01:51:31 +0200 Subject: [PATCH 3/4] Added nl eof --- soh/soh/Enhancements/Cheats/EasyESS.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soh/soh/Enhancements/Cheats/EasyESS.cpp b/soh/soh/Enhancements/Cheats/EasyESS.cpp index 01e253bc6e7..9f338b9336c 100644 --- a/soh/soh/Enhancements/Cheats/EasyESS.cpp +++ b/soh/soh/Enhancements/Cheats/EasyESS.cpp @@ -40,4 +40,4 @@ void RegisterEasyESS() { COND_HOOK(OnGameStateMainStart, CVAR_EASY_ESS_VALUE, OnGameStateMainStartEasyESS); } -static RegisterShipInitFunc initFunc(RegisterEasyESS, { CVAR_EASY_ESS_NAME }); \ No newline at end of file +static RegisterShipInitFunc initFunc(RegisterEasyESS, { CVAR_EASY_ESS_NAME }); From 80b17b3ec80a79b2f9fb5ed826de55e58526f90e Mon Sep 17 00:00:00 2001 From: JustAnotherWebDev <128695107+JustAnotherWebDev@users.noreply.github.com> Date: Sun, 21 Jun 2026 21:25:43 +0200 Subject: [PATCH 4/4] Update soh/soh/config/ConfigUpdaters.cpp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Philip Dubé <159546+serprex@users.noreply.github.com> --- soh/soh/config/ConfigUpdaters.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/soh/soh/config/ConfigUpdaters.cpp b/soh/soh/config/ConfigUpdaters.cpp index a043df2c1ec..8249bb48d31 100644 --- a/soh/soh/config/ConfigUpdaters.cpp +++ b/soh/soh/config/ConfigUpdaters.cpp @@ -305,7 +305,6 @@ static const Migration version3Migrations[] = { { "gEnableBetaQuest", "gCheats.EnableBetaQuest" }, { "gEzISG", "gCheats.EasyISG" }, { "gEzQPA", "gCheats.EasyQPA" }, - { "gEzESS", "gCheats.EasyESS" }, { "gFireproofDekuShield", "gCheats.FireproofDekuShield" }, { "gFreezeTime", "gCheats.FreezeTime" }, { "gHookshotEverything", "gCheats.HookshotEverything" },