You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-17 14:11:06 +00:00
@@ -103,9 +103,10 @@ void JoystickWinrt::OnGamepadAdded(Platform::Object ^ sender, Windows::Gaming::I
|
||||
|
||||
controllers[idx].connected = true;
|
||||
controllers[idx].controller_reference = value;
|
||||
controllers[idx].id = idx;
|
||||
controllers[idx].type = ControllerType::GAMEPAD_CONTROLLER;
|
||||
|
||||
input->joy_connection_changed(idx, true, "Xbox Controller", "__WINRT_GAMEPAD__");
|
||||
input->joy_connection_changed(controllers[idx].id, true, "Xbox Controller", "__WINRT_GAMEPAD__");
|
||||
}
|
||||
|
||||
void JoystickWinrt::OnGamepadRemoved(Platform::Object ^ sender, Windows::Gaming::Input::Gamepad ^ value) {
|
||||
@@ -122,15 +123,8 @@ void JoystickWinrt::OnGamepadRemoved(Platform::Object ^ sender, Windows::Gaming:
|
||||
|
||||
ERR_FAIL_COND(idx == -1);
|
||||
|
||||
for (int i = idx + 1; i < MAX_CONTROLLERS - 1; i++) {
|
||||
|
||||
if (!controllers[i].connected) {
|
||||
break;
|
||||
}
|
||||
|
||||
controllers[i - 1] = controllers[i];
|
||||
}
|
||||
controllers[MAX_CONTROLLERS - 1] = ControllerDevice();
|
||||
controllers[idx].connected = false;
|
||||
controllers[idx].controller_reference = nullptr;
|
||||
|
||||
input->joy_connection_changed(idx, false, "Xbox Controller");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user