mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-06-06 23:57:19 +02:00
Minor fix in showGamepadToast()
This commit is contained in:
parent
b27f84b980
commit
ec6c3fc8a3
@ -12099,6 +12099,11 @@ MkbHandler.setupEvents();
|
|||||||
|
|
||||||
// Show a toast when connecting/disconecting controller
|
// Show a toast when connecting/disconecting controller
|
||||||
function showGamepadToast(gamepad) {
|
function showGamepadToast(gamepad) {
|
||||||
|
// Don't show Toast for virtual controller
|
||||||
|
if (gamepad.id === MkbHandler.VIRTUAL_GAMEPAD_ID) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
console.log(gamepad);
|
console.log(gamepad);
|
||||||
let text = '🎮';
|
let text = '🎮';
|
||||||
|
|
||||||
@ -12108,12 +12113,6 @@ function showGamepadToast(gamepad) {
|
|||||||
|
|
||||||
// Remove "(STANDARD GAMEPAD Vendor: xxx Product: xxx)" from ID
|
// Remove "(STANDARD GAMEPAD Vendor: xxx Product: xxx)" from ID
|
||||||
const gamepadId = gamepad.id.replace(/ \(.*?Vendor: \w+ Product: \w+\)$/, '');
|
const gamepadId = gamepad.id.replace(/ \(.*?Vendor: \w+ Product: \w+\)$/, '');
|
||||||
|
|
||||||
// Don't show Toast for virtual controller
|
|
||||||
if (gamepadId === MkbHandler.VIRTUAL_GAMEPAD_ID) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
text += ` - ${gamepadId}`;
|
text += ` - ${gamepadId}`;
|
||||||
|
|
||||||
let status;
|
let status;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user