Add "Show controller connection status" setting

This commit is contained in:
redphx
2024-07-02 17:08:40 +07:00
parent 385fd71e86
commit 277c777121
5 changed files with 13 additions and 4 deletions

View File

@@ -303,8 +303,10 @@ function main() {
disablePwa();
// Show a toast when connecting/disconecting controller
window.addEventListener('gamepadconnected', e => showGamepadToast(e.gamepad));
window.addEventListener('gamepaddisconnected', e => showGamepadToast(e.gamepad));
if (getPref(PrefKey.CONTROLLER_SHOW_CONNECTION_STATUS)) {
window.addEventListener('gamepadconnected', e => showGamepadToast(e.gamepad));
window.addEventListener('gamepaddisconnected', e => showGamepadToast(e.gamepad));
}
// Preload Remote Play
if (getPref(PrefKey.REMOTE_PLAY_ENABLED)) {