mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-10-01 14:59:13 +00:00
[hid_core] Quick fix for PR 2747 (#2753)
Ensures that only the controllers enabled in the settings remain active when the game is running. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2753 Reviewed-by: Lizzie <[email protected]> Co-authored-by: MaranBr <[email protected]> Co-committed-by: MaranBr <[email protected]>
This commit is contained in:
1 parent
bfc10723bc
commit
b7021afff6
1 file changed
+9
-4
@@ -765,9 +765,13 @@ void EmulatedController::StartMotionCalibration() {
|
||||
|
||||
void EmulatedController::SetButton(const Common::Input::CallbackStatus& callback, std::size_t index,
|
||||
Common::UUID uuid) {
|
||||
if (index >= controller.button_values.size()) {
|
||||
const auto player_index = Service::HID::NpadIdTypeToIndex(npad_id_type);
|
||||
const auto& player = Settings::values.players.GetValue()[player_index];
|
||||
|
||||
if (index >= controller.button_values.size()) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::unique_lock lock{mutex};
|
||||
bool value_changed = false;
|
||||
const auto new_status = TransformToButton(callback);
|
||||
@@ -920,10 +924,11 @@ void EmulatedController::SetButton(const Common::Input::CallbackStatus& callback
|
||||
|
||||
lock.unlock();
|
||||
|
||||
const auto player_index = Service::HID::NpadIdTypeToIndex(npad_id_type);
|
||||
if (!is_connected && !controller_connected[player_index]) {
|
||||
Connect();
|
||||
controller_connected[player_index] = true;
|
||||
if (player.connected) {
|
||||
Connect();
|
||||
controller_connected[player_index] = true;
|
||||
}
|
||||
}
|
||||
|
||||
TriggerOnChange(ControllerTriggerType::Button, true);
|
||||
|
||||
Reference in new issue
Block a user