diff --git a/extern/aurora b/extern/aurora index 135e976867..8af9057689 160000 --- a/extern/aurora +++ b/extern/aurora @@ -1 +1 @@ -Subproject commit 135e976867490380356878c8bb8d1956932489c5 +Subproject commit 8af9057689b9b85a55bbbd6218bc95304558fabd diff --git a/src/dusk/imgui/ImGuiMenuGame.cpp b/src/dusk/imgui/ImGuiMenuGame.cpp index 0a687233aa..dcfcc55657 100644 --- a/src/dusk/imgui/ImGuiMenuGame.cpp +++ b/src/dusk/imgui/ImGuiMenuGame.cpp @@ -965,7 +965,7 @@ namespace dusk { ImGui::SameLine(); // Options panel - ImGuiBeginGroupPanel("Options", ImVec2(150 * scale, 20 * scale)); + ImGuiBeginGroupPanel("Options", ImVec2(150 * scale, -1)); if (deadZones != nullptr) { if (ImGui::Checkbox("Enable Dead Zones", &deadZones->useDeadzones)) { @@ -975,7 +975,28 @@ namespace dusk { PADSerializeMappings(); } } - + + if (PADSupportsRumbleIntensity(m_controllerConfig.m_selectedPort)) { + ImGuiBeginGroupPanel("Rumble Intensity", ImVec2(150 * scale, -1)); + u16 low; + u16 high; + (void)PADGetRumbleIntensity(m_controllerConfig.m_selectedPort, &low, &high); + float fLow = (static_cast(low) / 32767.f) * 100.f; + bool changed = ImGui::SliderFloat("Low", &fLow, 0.f, 100.f, "%.0f%%"); + float fHigh = (static_cast(high) / 32767.f) * 100.f; + changed |= ImGui::SliderFloat("High", &fHigh, 0.f, 100.f, "%.0f%%"); + if (changed) { + PADSetRumbleIntensity(m_controllerConfig.m_selectedPort, + static_cast((fLow / 100) * 32767), + static_cast((fHigh / 100) * 32767)); + PADSerializeMappings(); + } + if (ImGui::Button(fmt::format("{0}...##rumbleTest", m_controllerConfig.m_isRumbling ? "Stop": "Test").c_str(), {-1, 0})) { + PADControlMotor(m_controllerConfig.m_selectedPort, !m_controllerConfig.m_isRumbling ? PAD_MOTOR_RUMBLE : PAD_MOTOR_STOP_HARD); + m_controllerConfig.m_isRumbling ^= 1; + } + ImGuiEndGroupPanel(); + } ImGuiEndGroupPanel(); ImGui::End(); diff --git a/src/dusk/imgui/ImGuiMenuGame.hpp b/src/dusk/imgui/ImGuiMenuGame.hpp index e21374c8f4..fb3f3f10ca 100644 --- a/src/dusk/imgui/ImGuiMenuGame.hpp +++ b/src/dusk/imgui/ImGuiMenuGame.hpp @@ -32,6 +32,7 @@ namespace dusk { PADButtonMapping* m_pendingButtonMapping = nullptr; PADAxisMapping* m_pendingAxisMapping = nullptr; int m_pendingPort = -1; + bool m_isRumbling = false; } m_controllerConfig; bool m_showControllerConfig = false;