mc.mitm: add config option to disable dualsense player indicator leds

This commit is contained in:
ndeadly 2022-07-19 18:47:56 +02:00
parent d38ca828dd
commit 10a60690e9
4 changed files with 9 additions and 2 deletions

View file

@ -13,3 +13,5 @@
[misc]
; Disable the LED lightbar on Sony Dualshock 4 and Dualsense controllers [default false]
;disable_sony_leds=false
; Disable the white player indicator LEDs at the bottom of the Dualsense touchpad
;disable_dualsense_player_leds=false

View file

@ -78,9 +78,10 @@ namespace ams::controller {
}
Result DualsenseController::SetPlayerLed(uint8_t led_mask) {
auto config = mitm::GetGlobalConfig();
uint8_t player_number;
R_TRY(LedsMaskToPlayerNumber(led_mask, &player_number));
m_led_flags = player_led_flags[player_number];
m_led_flags = config->misc.disable_dualsense_player_leds ? 0x00 : player_led_flags[player_number];
RGBColour colour = player_led_colours[player_number];
return this->SetLightbarColour(colour);
}

View file

@ -30,7 +30,8 @@ namespace ams::mitm {
.enable_motion = true
},
.misc = {
.disable_sony_leds = false
.disable_sony_leds = false,
.disable_dualsense_player_leds = false
}
};
@ -79,6 +80,8 @@ namespace ams::mitm {
else if (strcasecmp(section, "misc") == 0) {
if (strcasecmp(name, "disable_sony_leds") == 0)
ParseBoolean(value, &config->misc.disable_sony_leds);
else if (strcasecmp(name, "disable_dualsense_player_leds") == 0)
ParseBoolean(value, &config->misc.disable_dualsense_player_leds);
}
else {
return 0;

View file

@ -30,6 +30,7 @@ namespace ams::mitm {
struct {
bool disable_sony_leds;
bool disable_dualsense_player_leds;
} misc;
};