From 35f9cd4c7d93faf6559bead294fa1e21d352b637 Mon Sep 17 00:00:00 2001 From: baxlek <115663151+baxlek@users.noreply.github.com> Date: Tue, 25 Aug 2026 18:09:34 -0500 Subject: [PATCH] Update settings.cpp --- src/dusk/ui/settings.cpp | 49 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/src/dusk/ui/settings.cpp b/src/dusk/ui/settings.cpp index 05173f79f4..fe2b9fea94 100644 --- a/src/dusk/ui/settings.cpp +++ b/src/dusk/ui/settings.cpp @@ -1214,6 +1214,55 @@ SettingsWindow::SettingsWindow(bool prelaunch) : mPrelaunch(prelaunch) { "Skips the delay when writing to the Memory Card."); addOption("Hold B for Instant Text", getSettings().game.instantText, "Makes text scroll immediately by holding B."); + leftPane.register_control( + leftPane.add_select_button({ + .key = "Hold-to-Mash", + .getValue = [] { + int count = 0; + int total = 0; + auto check = [&](bool enabled) { total++; if (enabled) count++; }; + check(getSettings().game.holdToMash.sumo); + check(getSettings().game.holdToMash.surface); + check(getSettings().game.holdToMash.zoraSwim); + check(getSettings().game.holdToMash.twilitBloat); + check(getSettings().game.holdToMash.ganondorf); + static thread_local char buf[12]; + std::snprintf(buf, sizeof(buf), "%d / %d", count, total); + return Rml::String{buf}; + }, + .isModified = [] { + return getSettings().game.holdToMash.sumo != + getSettings().game.holdToMash.sumo.getDefaultValue() + || getSettings().game.holdToMash.surface != + getSettings().game.holdToMash.surface.getDefaultValue() + || getSettings().game.holdToMash.zoraSwim != + getSettings().game.holdToMash.zoraSwim.getDefaultValue() + || getSettings().game.holdToMash.twilitBloat != + getSettings().game.holdToMash.twilitBloat.getDefaultValue() + || getSettings().game.holdToMash.ganondorf != + getSettings().game.holdToMash.ganondorf.getDefaultValue(); + }, + }), + rightPane, [](Pane& pane) { + pane.clear(); + pane.add_rml( + "Hold the indicated button to mash automatically."); + auto addSubToggle = [&pane](const Rml::String& text, ConfigVar& var) { + pane.add_button({ + .text = text, + .isSelected = [&var] { return var.getValue(); }, + }).on_pressed([&var] { + mDoAud_seStartMenu(kSoundItemChange); + var.setValue(!var.getValue()); + config::save(); + }); + }; + addSubToggle("Sumo Wrestling", getSettings().game.holdToMash.sumo); + addSubToggle("Surface in Water", getSettings().game.holdToMash.surface); + addSubToggle("Zora Swimming", getSettings().game.holdToMash.zoraSwim); + addSubToggle("Stunned by Twilit Bloat", getSettings().game.holdToMash.twilitBloat); + addSubToggle("Ganondorf Chance", getSettings().game.holdToMash.ganondorf); + }); addOption("No Climbing Miss Animation", getSettings().game.noMissClimbing, "Prevents Link from playing a struggle animation when grabbing ledges or " "climbing on vines.");