From 1b76b2650c26aac684c809e0d68dafc090838509 Mon Sep 17 00:00:00 2001 From: qwertyquerty Date: Tue, 12 May 2026 18:18:00 -0700 Subject: [PATCH] input viewer options in rmlui and reset key option (#1136) * input viewer options in rmlui * reset key --- extern/aurora | 2 +- include/dusk/settings.h | 3 +++ src/dusk/imgui/ImGuiConsole.cpp | 6 ++++++ src/dusk/imgui/ImGuiControllerOverlay.cpp | 9 +++++---- src/dusk/imgui/ImGuiMenuTools.cpp | 3 --- src/dusk/imgui/ImGuiMenuTools.hpp | 2 -- src/dusk/settings.cpp | 8 +++++++- src/dusk/ui/settings.cpp | 16 +++++++++++++++- 8 files changed, 37 insertions(+), 12 deletions(-) diff --git a/extern/aurora b/extern/aurora index ff9ca7170c..974d11dfe7 160000 --- a/extern/aurora +++ b/extern/aurora @@ -1 +1 @@ -Subproject commit ff9ca7170cc840b1fbb5c7015b2fa1966055a04d +Subproject commit 974d11dfe727f213e34243f7c61fbcf0ef437968 diff --git a/include/dusk/settings.h b/include/dusk/settings.h index 12fe11d089..d57b15b9c1 100644 --- a/include/dusk/settings.h +++ b/include/dusk/settings.h @@ -175,12 +175,15 @@ struct UserSettings { // Controls ConfigVar enableTurboKeybind; + ConfigVar enableResetKeybind; // Tools ConfigVar speedrunMode; ConfigVar liveSplitEnabled; ConfigVar showSpeedrunRTATimer; ConfigVar recordingMode; + ConfigVar showInputViewer; + ConfigVar showInputViewerGyro; } game; struct { diff --git a/src/dusk/imgui/ImGuiConsole.cpp b/src/dusk/imgui/ImGuiConsole.cpp index 4ac21d81df..7d1cb98524 100644 --- a/src/dusk/imgui/ImGuiConsole.cpp +++ b/src/dusk/imgui/ImGuiConsole.cpp @@ -260,6 +260,12 @@ namespace dusk { config::Save(); } + if (getSettings().game.enableResetKeybind && ImGui::GetIO().KeyCtrl && + ImGui::IsKeyPressed(ImGuiKey_R) && !fpcM_SearchByName(fpcNm_LOGO_SCENE_e)) + { + JUTGamePad::C3ButtonReset::sResetSwitchPushing = true; + } + if (ImGui::GetIO().KeyShift && ImGui::IsKeyPressed(ImGuiKey_F1)) { if (getSettings().backend.enableAdvancedSettings) { m_isHidden = !m_isHidden; diff --git a/src/dusk/imgui/ImGuiControllerOverlay.cpp b/src/dusk/imgui/ImGuiControllerOverlay.cpp index 75637e5e61..ad07978a8b 100644 --- a/src/dusk/imgui/ImGuiControllerOverlay.cpp +++ b/src/dusk/imgui/ImGuiControllerOverlay.cpp @@ -3,12 +3,13 @@ #include "imgui.h" #include #include "ImGuiConsole.hpp" +#include "dusk/settings.h" #include namespace dusk { void ImGuiMenuTools::ShowInputViewer() { - if (!m_showInputViewer) { + if (!getSettings().game.showInputViewer) { return; } @@ -259,10 +260,10 @@ namespace dusk { size.y = 130 * scale; ImGui::Dummy(size); - if (PADHasSensor(PAD_1, PAD_SENSOR_GYRO) == TRUE) { + if (getSettings().game.showInputViewerGyro) + { ImGui::Separator(); - ImGui::Checkbox("Gyro Values", &m_showInputViewerGyro); - if (m_showInputViewerGyro) { + { ImGui::TextUnformatted("Gyro"); constexpr float kBarScale = 4.0f; diff --git a/src/dusk/imgui/ImGuiMenuTools.cpp b/src/dusk/imgui/ImGuiMenuTools.cpp index 2206e0e3c6..c7afea3202 100644 --- a/src/dusk/imgui/ImGuiMenuTools.cpp +++ b/src/dusk/imgui/ImGuiMenuTools.cpp @@ -49,9 +49,6 @@ namespace dusk { ImGui::EndDisabled(); } - ImGui::Separator(); - ImGui::Checkbox("Show Input Viewer", &m_showInputViewer); - #if DUSK_CAN_OPEN_DATA_FOLDER ImGui::Separator(); if (ImGui::MenuItem("Open Data Folder")) { diff --git a/src/dusk/imgui/ImGuiMenuTools.hpp b/src/dusk/imgui/ImGuiMenuTools.hpp index 1c17ddbbe9..50cc697d09 100644 --- a/src/dusk/imgui/ImGuiMenuTools.hpp +++ b/src/dusk/imgui/ImGuiMenuTools.hpp @@ -69,8 +69,6 @@ namespace dusk { bool m_showStateShare = false; ImGuiStateShare m_stateShare; - bool m_showInputViewer = false; - bool m_showInputViewerGyro = false; bool m_showActorSpawner = false; int m_inputOverlayCorner = 3; std::string m_controllerName; diff --git a/src/dusk/settings.cpp b/src/dusk/settings.cpp index 4379587b38..7475e5d48a 100644 --- a/src/dusk/settings.cpp +++ b/src/dusk/settings.cpp @@ -112,12 +112,15 @@ UserSettings g_userSettings = { // Controls .enableTurboKeybind {"game.enableTurboKeybind", false}, + .enableResetKeybind {"game.enableResetKeybind", false}, // Tools .speedrunMode {"game.speedrunMode", false}, .liveSplitEnabled {"game.liveSplitEnabled", false}, .showSpeedrunRTATimer {"game.showSpeedrunRTATimer", true}, - .recordingMode {"game.recordingMode", false} + .recordingMode {"game.recordingMode", false}, + .showInputViewer {"game.showInputViewer", false}, + .showInputViewerGyro {"game.showInputViewerGyro", false} }, .backend = { @@ -202,10 +205,13 @@ void registerSettings() { Register(g_userSettings.game.noLowHpSound); Register(g_userSettings.game.midnasLamentNonStop); Register(g_userSettings.game.enableTurboKeybind); + Register(g_userSettings.game.enableResetKeybind); Register(g_userSettings.game.speedrunMode); Register(g_userSettings.game.liveSplitEnabled); Register(g_userSettings.game.showSpeedrunRTATimer); Register(g_userSettings.game.recordingMode); + Register(g_userSettings.game.showInputViewer); + Register(g_userSettings.game.showInputViewerGyro); Register(g_userSettings.game.fastSpinner); Register(g_userSettings.game.infiniteHearts); Register(g_userSettings.game.infiniteArrows); diff --git a/src/dusk/ui/settings.cpp b/src/dusk/ui/settings.cpp index 5bbe75bde0..b1769a7431 100644 --- a/src/dusk/ui/settings.cpp +++ b/src/dusk/ui/settings.cpp @@ -6,6 +6,7 @@ #include "dusk/audio/DuskAudioSystem.h" #include "dusk/audio/DuskDsp.hpp" #include "dusk/config.hpp" +#include "dusk/hotkeys.h" #include "dusk/data.hpp" #include "dusk/file_select.hpp" #include "dusk/imgui/ImGuiEngine.hpp" @@ -711,7 +712,6 @@ SettingsWindow::SettingsWindow(bool prelaunch) : mPrelaunch(prelaunch) { pane.add_rml( "
Display the current framerate in a corner of the screen while playing."); }); - leftPane.add_section("Resolution"); graphics_tuner_control(*this, leftPane, rightPane, getSettings().game.internalResolutionScale, @@ -893,6 +893,9 @@ SettingsWindow::SettingsWindow(bool prelaunch) : mPrelaunch(prelaunch) { addOption("Turbo Key", getSettings().game.enableTurboKeybind, "Hold Tab to increase game speed by up to 4x.", [] { return getSettings().game.speedrunMode; }); + addOption("Reset Key (" + Rml::String{hotkeys::DO_RESET} + ")", + getSettings().game.enableResetKeybind, + "Press " + Rml::String{hotkeys::DO_RESET} + " to reset the game."); }); add_tab("Audio", [this](Rml::Element* content) { @@ -1282,6 +1285,17 @@ SettingsWindow::SettingsWindow(bool prelaunch) : mPrelaunch(prelaunch) { }, .isDisabled = [] { return getSettings().game.speedrunMode; }, }); + config_bool_select(leftPane, rightPane, getSettings().game.showInputViewer, + { + .key = "Show Input Viewer", + .helpText = "Display a controller input overlay while playing.", + }); + config_bool_select(leftPane, rightPane, getSettings().game.showInputViewerGyro, + { + .key = "Show Gyro Input Viewer", + .helpText = "Show gyro sensor values in the input viewer.", + .isDisabled = [] { return !getSettings().game.showInputViewer; }, + }); leftPane.add_section("Game"); config_bool_select(leftPane, rightPane, getSettings().game.hideTvSettingsScreen,