From b2adc5b365415a0c47dc8c542a0a4957ce64ddbf Mon Sep 17 00:00:00 2001 From: redphx <96280+redphx@users.noreply.github.com> Date: Sat, 16 Mar 2024 17:17:45 +0700 Subject: [PATCH] Add link to Android app --- better-xcloud.user.js | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/better-xcloud.user.js b/better-xcloud.user.js index b70319f..f03d2ff 100644 --- a/better-xcloud.user.js +++ b/better-xcloud.user.js @@ -1142,10 +1142,10 @@ const Translations = { "Emuluj kontroler za pomocą myszy i klawiatury", "Emular controlador com mouse e teclado", "Эмулировать контроллер с помощью мыши и клавиатуры", - "Klavye ve fare desteğini aktive et", + "Klavye ve fareyle oyun kumandasını taklit et", "Емуляція контролера за допомогою миші та клавіатури", "Giả lập tay cầm bằng Chuột và Bàn phím", - "启用鼠标和键盘支持", + "使用键鼠模拟手柄输入", ], "enable-quick-glance-mode": [ "\"Kurzer Blick\"-Modus aktivieren", @@ -1385,6 +1385,23 @@ const Translations = { "Nhập", "导入", ], + "install-android": [ + "\"Better xCloud\" App für Android installieren", + , + "Install Better xCloud app for Android", + , + , + , + "Android用のBetter xCloudをインストール", + , + , + "Instalar o aplicativo Better xCloud para Android", + "Установите приложение Better xCloud для Android", + , + "Встановити додаток Better xCloud для Android", + "Cài đặt ứng dụng Better xCloud cho Android", + "安装Better xCloud安卓客户端", + ], "keyboard-shortcuts": [ "Tastatur-Shortcuts", "Pintasan keyboard", @@ -8410,6 +8427,10 @@ a.bx-button { white-space: nowrap; } +a.bx-button.bx-full-width { + text-align: center; +} + .bx-remote-play-button { height: auto; margin-right: 8px !important; @@ -10229,6 +10250,20 @@ function injectSettingsButton($parent) { $updateAvailable.classList.remove('bx-gone'); } + // Show link to Android app + if (!window.AppInterface) { + const userAgent = UserAgent.getDefault().toLowerCase(); + if (userAgent.includes('android')) { + const $btn = createButton({ + label: '🔥 ' + t('install-android'), + style: ButtonStyle.FULL_WIDTH | ButtonStyle.FOCUSABLE, + url: 'https://better-xcloud.github.io/android', + }); + + $wrapper.appendChild($btn); + } + } + // Render settings const SETTINGS_UI = { 'Better xCloud': {