mirror of
https://github.com/ndeadly/MissionControl
synced 2025-02-16 21:28:25 +00:00
bluetooth-mitm: enable/disable controller rumble based on global settings defined in ini file
This commit is contained in:
parent
c227688485
commit
14146e3d30
2 changed files with 9 additions and 0 deletions
|
@ -14,6 +14,7 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "emulated_switch_controller.hpp"
|
||||
#include "../mcmitm_config.hpp"
|
||||
#include <memory>
|
||||
|
||||
namespace ams::controller {
|
||||
|
@ -135,6 +136,10 @@ namespace ams::controller {
|
|||
m_colours.buttons = {0xe6, 0xe6, 0xe6};
|
||||
m_colours.left_grip = {0x46, 0x46, 0x46};
|
||||
m_colours.right_grip = {0x46, 0x46, 0x46};
|
||||
|
||||
auto config = mitm::GetGlobalConfig();
|
||||
|
||||
m_enable_rumble = config->general.enable_rumble;
|
||||
};
|
||||
|
||||
void EmulatedSwitchController::ClearControllerState(void) {
|
||||
|
@ -231,6 +236,8 @@ namespace ams::controller {
|
|||
}
|
||||
|
||||
Result EmulatedSwitchController::HandleRumbleReport(const bluetooth::HidReport *report) {
|
||||
R_SUCCEED_IF(!m_enable_rumble);
|
||||
|
||||
auto report_data = reinterpret_cast<const SwitchReportData *>(report->data);
|
||||
|
||||
SwitchRumbleData left_motor;
|
||||
|
|
|
@ -75,6 +75,8 @@ namespace ams::controller {
|
|||
Switch6AxisData m_motion_data[3];
|
||||
|
||||
ProControllerColours m_colours;
|
||||
bool m_enable_rumble;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue