diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md index 2a4723c..2b0412e 100644 --- a/CHANGELOG.en-US.md +++ b/CHANGELOG.en-US.md @@ -8,7 +8,7 @@ English (US) release notes, mirroring CHANGELOG.md (Brazilian Portuguese). Befor - **Wake the PC with the controller**: in Settings (and in the Console System tab → Controller), Console Mode shows whether the Xbox Wireless Adapter, Bluetooth or a wired controller can wake the PC from sleep, and **Turn on** enables it for them (Windows asks for administrator permission). Together with **Enter when a controller connects**, pressing the controller's center button wakes the PC straight into console mode. It doesn't work when the PC is shut down or hibernating. (#168) - Console interface: the Home tiles show the official Steam, Playnite and Xbox logos, read from the installed apps, and Custom app shows its `.exe` icon. When an app isn't installed, its tile keeps the generic icon. (#169) - **Per-game profiles**: each Steam game can have its own resolution, HDR, FPS limit and audio output. With the game running, open the session menu and pick **Game profile → Save the current settings**; next time it starts in console mode, the profile is applied by itself and undone when the game closes. Also works for Steam games opened from Playnite or the Xbox app. Profiles are listed in Settings → **Per-game profiles**, where you can delete them. (#170) -- **JoyChromium** as a launcher: with [JoyChromium](https://github.com/lippdev/joychromium) installed (the TV browser you drive with the controller), it shows up in the Home row and under When entering console mode. Its tile shows JoyChromium's own icon. Console Mode opens it full screen on the game screen and restores the desk when you close it. Going back to the PC while it's still open takes it out of full screen and leaves it as a window, tabs and all. (#175) +- **Browser (JoyChromium)** in the session menu, pinned right under ControlFS and working the same way: [JoyChromium](https://github.com/lippdev/joychromium) (the TV browser you drive with the controller) opens full screen over the game and, if it isn't installed, the first press downloads its newest release, checks its SHA-256 and installs it. Going back to the PC while it's open takes it out of full screen and leaves it as a window, tabs and all. (#175, #181) - **Move the mouse pointer out of the way** (issue #172): when the launcher shows up on the TV, the pointer goes to the bottom-right corner of the game screen (twice, since Steam recenters it while opening) and goes back where it was when you return to the PC. On by default; turn it off in Settings or under System → When entering console mode. Based on @JarJarShinks' version in #173. (#177) ### Fixes diff --git a/CHANGELOG.md b/CHANGELOG.md index d9efeae..9d5b7ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ Notas em português do Brasil; a versão em inglês (Estados Unidos) fica em `CH - **Acordar o PC pelo controle**: em Ajustes (e na aba Sistema → Controle do modo Console), o Console Mode mostra se o adaptador sem fio Xbox, o Bluetooth ou o controle no cabo podem acordar o PC da suspensão e, em **Ativar**, liga isso para eles (o Windows pede permissão de administrador). Junto com **Entrar ao conectar um controle**, apertar o botão central do controle acorda o PC direto no modo console. Não funciona com o PC desligado ou em hibernação. (#168) - Interface Console: os blocos do Início mostram os logos oficiais da Steam, do Playnite e do Xbox, lidos dos apps instalados, e o Aplicativo personalizado mostra o ícone do seu `.exe`. Sem o app instalado, o bloco mantém o ícone genérico. (#169) - **Perfis por jogo**: cada jogo da Steam pode ter sua própria resolução, HDR, limite de FPS e saída de áudio. Com o jogo rodando, abra o menu da sessão e escolha **Perfil do jogo → Salvar os ajustes atuais**; da próxima vez que ele abrir no modo console, o perfil é aplicado sozinho e desfeito quando o jogo fecha. Vale também para jogos da Steam abertos pelo Playnite ou pelo app Xbox. Os perfis ficam em Ajustes → **Perfis por jogo**, onde dá para apagá-los. (#170) -- **JoyChromium** como iniciador: com o [JoyChromium](https://github.com/lippdev/joychromium) instalado (o navegador para a TV que se usa com o controle), ele aparece na fileira da Início e em Ao entrar no modo console. O tile mostra o ícone do próprio JoyChromium. O Console Mode o abre em tela cheia na tela de jogo e devolve a mesa quando você o fecha. Voltar ao PC com ele ainda aberto o tira da tela cheia e o deixa como janela, sem perder as abas. (#175) +- **Navegador (JoyChromium)** no menu da sessão, fixo logo abaixo do ControlFS e funcionando do mesmo jeito: o [JoyChromium](https://github.com/lippdev/joychromium) (o navegador para a TV que se usa com o controle) abre em tela cheia por cima do jogo e, se não estiver instalado, o primeiro clique baixa a versão mais recente, confere o SHA-256 e instala. Voltar ao PC com ele aberto o tira da tela cheia e o deixa como janela, sem perder as abas. (#175, #181) - **Tirar o ponteiro do mouse do caminho** (issue #172): quando o iniciador aparece na TV, o ponteiro vai para o canto inferior direito da tela de jogo (duas vezes, porque a Steam o recentraliza ao abrir) e, ao voltar ao PC, volta para onde estava. Ligado por padrão; desligue em Ajustes ou em Sistema → Ao entrar no modo console. Baseado na versão de @JarJarShinks no #173. (#177) ### Correções diff --git a/README.de-DE.md b/README.de-DE.md index cb8a0e3..252767a 100644 --- a/README.de-DE.md +++ b/README.de-DE.md @@ -45,8 +45,8 @@ Die Controller-Tastenkombinationen wählst du selbst: Anfangs ist keine aktiv, d - **FPS-Anzeige** über dem Spiel (RTSS) als Kachel in drei Größen: Nur FPS, Kompakt (CPU-, GPU- und RAM-Auslastung), Detailliert (Taktraten, GPU-Temperatur und Speicher) oder dein eigenes Layout - Der Ton geht an den Fernseher (oder einen beliebigen Ausgang) und kommt danach zurück - [Schaltet den Fernseher ein und wechselt auf den Eingang des PCs](docs/GUIDE.de-DE.md#fernsehersteuerung) (Google TV / Android TV über das Netzwerk) und kann ihn danach in den Standby versetzen -- Startet **Steam Big Picture**, **Playnite im Vollbild**, den **Xbox-Modus** oder [JoyChromium](https://github.com/lippdev/joychromium) (das Web mit dem Controller) und minimiert Steam in den Infobereich, wenn du zum PC zurückkehrst -- **Sitzungsmenü** über dem Spiel: geöffnete Fenster wechseln oder schließen, Lautstärke, Auflösung, Audio, FPS und HDR ändern, den Mauszeiger ausblenden oder mit dem Controller steuern und deine Dateien mit [ControlFS](https://github.com/nextestudios/ControlFS) durchsuchen +- Startet **Steam Big Picture**, **Playnite im Vollbild** oder den **Xbox-Modus** und minimiert Steam in den Infobereich, wenn du zum PC zurückkehrst +- **Sitzungsmenü** über dem Spiel: geöffnete Fenster wechseln oder schließen, Lautstärke, Auflösung, Audio, FPS und HDR ändern, den Mauszeiger ausblenden oder mit dem Controller steuern und deine Dateien mit [ControlFS](https://github.com/nextestudios/ControlFS) und das Web mit [JoyChromium](https://github.com/lippdev/joychromium) durchsuchen - Zwei Oberflächen: **Desktop** (Maus) und **Konsole** (Vollbild, Xbox- und PlayStation-Controller, Registerkarten mit LB/RB, ein eigenes Hintergrundbild oder deine Steam-Cover als Hintergrund) - Automatisierung mit den Links `consolemode://start` / `stop` / `menu` (Stream Deck, Skripte) und einer [lokalen Steuerungs-API](docs/GUIDE.de-DE.md#lokale-steuerungs-api) - Englisch, Portugiesisch, Spanisch, Deutsch, Französisch und Russisch diff --git a/README.es-ES.md b/README.es-ES.md index 5a35d65..16aec50 100644 --- a/README.es-ES.md +++ b/README.es-ES.md @@ -45,8 +45,8 @@ Los atajos del mando los eliges tú: al principio no hay ninguno activado, la ap - **Contador de FPS** sobre el juego (RTSS) en una tarjeta de tres tamaños: solo FPS, compacto (uso de CPU, GPU y RAM), detallado (relojes, temperatura y memoria de la GPU) o tu propia disposición - El audio va a la TV (o a cualquier salida) y vuelve después - [Enciende la TV y la cambia a la entrada del PC](docs/GUIDE.es-ES.md#control-de-la-tv) (Google TV / Android TV por la red), y puede ponerla en reposo después -- Abre **Steam Big Picture**, **Playnite a pantalla completa**, el **modo Xbox** o [JoyChromium](https://github.com/lippdev/joychromium) (la web con el mando), y envía Steam a la bandeja al volver al PC -- **Menú de la sesión** sobre el juego: cambia o cierra las ventanas abiertas, ajusta volumen, resolución, audio, FPS y HDR, oculta el puntero del ratón o muévelo con el mando, y explora tus archivos con [ControlFS](https://github.com/nextestudios/ControlFS) +- Abre **Steam Big Picture**, **Playnite a pantalla completa** o el **modo Xbox**, y envía Steam a la bandeja al volver al PC +- **Menú de la sesión** sobre el juego: cambia o cierra las ventanas abiertas, ajusta volumen, resolución, audio, FPS y HDR, oculta el puntero del ratón o muévelo con el mando, y explora tus archivos con [ControlFS](https://github.com/nextestudios/ControlFS) y la web con [JoyChromium](https://github.com/lippdev/joychromium) - Dos interfaces: **Escritorio** (ratón) y **Consola** (pantalla completa, mandos de Xbox y PlayStation, pestañas con LB/RB, un fondo de pantalla propio o tus portadas de Steam de fondo) - Automatización con los enlaces `consolemode://start` / `stop` / `menu` (Stream Deck, scripts) y una [API de control local](docs/GUIDE.es-ES.md#api-de-control-local) - Inglés, portugués, español, alemán, francés y ruso diff --git a/README.fr-FR.md b/README.fr-FR.md index 3813148..eee0b87 100644 --- a/README.fr-FR.md +++ b/README.fr-FR.md @@ -45,8 +45,8 @@ C'est vous qui choisissez les raccourcis manette : aucun n'est actif au départ, - **Compteur de FPS** par-dessus le jeu (RTSS) sur une carte en trois tailles : FPS seulement, compact (utilisation CPU, GPU et RAM), détaillé (fréquences, température et mémoire du GPU) ou votre propre disposition - Le son passe sur la TV (ou n'importe quelle sortie) et revient ensuite - [Allume la TV et la bascule sur l'entrée du PC](docs/GUIDE.fr-FR.md#contrôle-de-la-tv) (Google TV / Android TV par le réseau), et peut la mettre en veille ensuite -- Lance **Steam Big Picture**, **Playnite en plein écran**, le mode **Xbox** ou [JoyChromium](https://github.com/lippdev/joychromium) (le Web à la manette), et réduit Steam dans la zone de notification quand vous revenez au PC -- **Menu de session** par-dessus le jeu : changer de fenêtre ou fermer les fenêtres ouvertes, régler le volume, la résolution, le son, les FPS et le HDR, masquer le pointeur de la souris ou le piloter à la manette, et parcourir vos fichiers avec [ControlFS](https://github.com/nextestudios/ControlFS) +- Lance **Steam Big Picture**, **Playnite en plein écran** ou le mode **Xbox**, et réduit Steam dans la zone de notification quand vous revenez au PC +- **Menu de session** par-dessus le jeu : changer de fenêtre ou fermer les fenêtres ouvertes, régler le volume, la résolution, le son, les FPS et le HDR, masquer le pointeur de la souris ou le piloter à la manette, et parcourir vos fichiers avec [ControlFS](https://github.com/nextestudios/ControlFS) et le Web avec [JoyChromium](https://github.com/lippdev/joychromium) - Deux interfaces : **Bureau** (souris) et **Console** (plein écran, manettes Xbox et PlayStation, onglets sur LB/RB, un fond d’écran maison ou vos jaquettes Steam en fond) - Automatisation avec les liens `consolemode://start` / `stop` / `menu` (Stream Deck, scripts) et une [API de contrôle local](docs/GUIDE.fr-FR.md#api-de-contrôle-local) - Anglais, portugais, espagnol, allemand, français et russe diff --git a/README.md b/README.md index 1c3f444..1bbbdd7 100644 --- a/README.md +++ b/README.md @@ -47,8 +47,8 @@ You pick the controller shortcuts yourself: none is on at first, the app asks th - **FPS counter** over the game (RTSS) on a card in three sizes: FPS only, compact (CPU, GPU and RAM usage), detailed (clocks, GPU temperature and memory) or your own layout - Audio goes to the TV (or any output) and comes back afterwards - [Turns the TV on and switches it to the PC's input](docs/GUIDE.md#tv-control) (Google TV / Android TV over the network), and can put it in standby afterwards -- Launches **Steam Big Picture**, **Playnite fullscreen**, **Xbox** mode or [JoyChromium](https://github.com/lippdev/joychromium) (the web with a controller), and sends Steam to the tray when you go back to the PC -- **Session menu** over the game: switch or close the open windows, change volume, resolution, audio, FPS and HDR, hide the mouse pointer or drive it with the controller, and browse your files with [ControlFS](https://github.com/nextestudios/ControlFS) +- Launches **Steam Big Picture**, **Playnite fullscreen** or **Xbox** mode, and sends Steam to the tray when you go back to the PC +- **Session menu** over the game: switch or close the open windows, change volume, resolution, audio, FPS and HDR, hide the mouse pointer or drive it with the controller, and browse your files with [ControlFS](https://github.com/nextestudios/ControlFS) and the web with [JoyChromium](https://github.com/lippdev/joychromium) - Two interfaces: **Desktop** (mouse) and **Console** (full screen, Xbox and PlayStation pads, LB/RB tabs, its own wallpaper or your Steam covers as the background) - Automation with `consolemode://start` / `stop` / `menu` links (Stream Deck, scripts) and a [local control API](docs/GUIDE.md#local-control-api) - English, Portuguese, Spanish, German, French and Russian diff --git a/README.pt-BR.md b/README.pt-BR.md index f5a8ea6..fb1213b 100644 --- a/README.pt-BR.md +++ b/README.pt-BR.md @@ -47,8 +47,8 @@ Os atalhos do controle são você quem escolhe: nenhum vem ligado, o app pergunt - **Contador de FPS** sobre o jogo (RTSS) num card em três tamanhos: apenas FPS, compacto (uso de CPU, GPU e RAM), detalhado (clocks, temperatura da GPU e memória) ou do seu jeito - O áudio vai para a TV (ou qualquer saída) e volta depois - [Liga a TV e troca para a entrada do PC](docs/GUIDE.pt-BR.md#controle-da-tv) (Google TV / Android TV pela rede), e pode colocá-la em espera no fim -- Abre **Steam Big Picture**, **Playnite em tela cheia**, o **Modo Xbox** ou o [JoyChromium](https://github.com/lippdev/joychromium) (a web pelo controle), e manda a Steam para a bandeja ao voltar ao PC -- **Menu da sessão** sobre o jogo: troque ou feche as janelas abertas, mude volume, resolução, áudio, FPS e HDR, esconda o cursor do mouse ou mova-o com o controle e navegue pelos seus arquivos com o [ControlFS](https://github.com/nextestudios/ControlFS) +- Abre **Steam Big Picture**, **Playnite em tela cheia** ou o **Modo Xbox**, e manda a Steam para a bandeja ao voltar ao PC +- **Menu da sessão** sobre o jogo: troque ou feche as janelas abertas, mude volume, resolução, áudio, FPS e HDR, esconda o cursor do mouse ou mova-o com o controle e navegue pelos seus arquivos com o [ControlFS](https://github.com/nextestudios/ControlFS) e pela web com o [JoyChromium](https://github.com/lippdev/joychromium) - Duas interfaces: **Desktop** (mouse) e **Console** (tela cheia, controles Xbox e PlayStation, abas no LB/RB, um papel de parede próprio ou as capas da sua Steam como plano de fundo) - Automação com os links `consolemode://start` / `stop` / `menu` (Stream Deck, scripts) e uma [API de controle local](docs/GUIDE.pt-BR.md#api-de-controle-local) - Português, inglês, espanhol, alemão, francês e russo diff --git a/README.ru-RU.md b/README.ru-RU.md index c7d46d6..a80e6c5 100644 --- a/README.ru-RU.md +++ b/README.ru-RU.md @@ -45,8 +45,8 @@ Windows 10 или 11, а также [Steam](https://store.steampowered.com/) (Bi - **Счётчик FPS** поверх игры (RTSS) на карточке трёх размеров: только FPS, компактный (загрузка ЦП, ГП и ОЗУ), подробный (частоты, температура ГП и память) или ваш собственный вариант - Звук переходит на телевизор (или любой другой выход) и потом возвращается - [Включает телевизор и переключает его на вход ПК](docs/GUIDE.ru-RU.md#управление-телевизором) (Google TV / Android TV по сети), а после может перевести его в режим ожидания -- Запускает **Steam Big Picture**, **Playnite в полноэкранном режиме**, **режим Xbox** или [JoyChromium](https://github.com/lippdev/joychromium) (веб с геймпадом) и сворачивает Steam в область уведомлений при возврате к ПК -- **Меню сеанса** поверх игры: переключайтесь между открытыми окнами или закрывайте их, меняйте громкость, разрешение, звук, FPS и HDR, скрывайте указатель мыши или управляйте им с геймпада, просматривайте файлы через [ControlFS](https://github.com/nextestudios/ControlFS) +- Запускает **Steam Big Picture**, **Playnite в полноэкранном режиме** или **режим Xbox** и сворачивает Steam в область уведомлений при возврате к ПК +- **Меню сеанса** поверх игры: переключайтесь между открытыми окнами или закрывайте их, меняйте громкость, разрешение, звук, FPS и HDR, скрывайте указатель мыши или управляйте им с геймпада, просматривайте файлы через [ControlFS](https://github.com/nextestudios/ControlFS) и сайты через [JoyChromium](https://github.com/lippdev/joychromium) - Два интерфейса: **«Рабочий стол»** (мышь) и **«Консоль»** (полный экран, геймпады Xbox и PlayStation, вкладки на LB/RB, собственный фоновый рисунок или обложки из Steam на фоне) - Автоматизация через ссылки `consolemode://start` / `stop` / `menu` (Stream Deck, скрипты) и [локальный API управления](docs/GUIDE.ru-RU.md#локальный-api-управления) - Английский, португальский, испанский, немецкий, французский и русский diff --git a/docs/GUIDE.de-DE.md b/docs/GUIDE.de-DE.md index d0dd4a3..a4571dc 100644 --- a/docs/GUIDE.de-DE.md +++ b/docs/GUIDE.de-DE.md @@ -12,7 +12,6 @@ Details, die nicht ins [README](../README.de-DE.md) passen. | **Playnite (Vollbild)** | Automatische Wiederherstellung (die App bleibt im Infobereich) | | **Xbox-Modus** | Manuell: Verwende *Jetzt wiederherstellen*, das Menü im Infobereich oder öffne das Fenster erneut | | **Eigene App** | Automatische Wiederherstellung, wenn die App (oder der gewählte überwachte Prozess) geschlossen wird | -| **JoyChromium** | Automatische Wiederherstellung, wenn du JoyChromium schließt; gehst du vorher zum PC zurück, bleibt es als Fenster offen | Wird die App mitten in einer Sitzung geschlossen oder geht der PC aus, stellt Console Mode beim nächsten Öffnen (auch bei der Windows-Anmeldung, wenn es mit Windows startet) alles wieder her, was die Sitzung geändert hat: Bildschirme, Ton, RTSS, Desktopsymbole und Zeiger, und sagt Bescheid. diff --git a/docs/GUIDE.es-ES.md b/docs/GUIDE.es-ES.md index 8d015a1..319bfa0 100644 --- a/docs/GUIDE.es-ES.md +++ b/docs/GUIDE.es-ES.md @@ -12,7 +12,6 @@ Detalles que no caben en el [README](../README.es-ES.md). | **Playnite a pantalla completa** | Restauración automática (la aplicación sigue en la bandeja) | | **Modo Xbox** | Manual: usa *Restaurar ahora*, el menú de la bandeja o vuelve a abrir la ventana | | **Aplicación personalizada** | Restauración automática cuando se cierra la aplicación (o el proceso que elegiste vigilar) | -| **JoyChromium** | Restauración automática al cerrar JoyChromium; si vuelves al PC antes, queda abierto como ventana | Si la aplicación se cierra o el PC se apaga en medio de una sesión, la próxima vez que Console Mode se abra (también al iniciar sesión en Windows, si arranca con Windows) restaura todo lo que la sesión cambió: pantallas, audio, RTSS, iconos del escritorio y el puntero, y lo avisa. diff --git a/docs/GUIDE.fr-FR.md b/docs/GUIDE.fr-FR.md index fd60653..1c910d8 100644 --- a/docs/GUIDE.fr-FR.md +++ b/docs/GUIDE.fr-FR.md @@ -12,7 +12,6 @@ Les détails qui ne tiennent pas dans le [README](../README.fr-FR.md). | **Playnite en plein écran** | Restauration automatique (l'application reste dans la zone de notification) | | **Mode Xbox** | Manuelle : utilisez *Restaurer maintenant*, le menu de la zone de notification, ou rouvrez la fenêtre | | **Application personnalisée** | Restauration automatique quand l'application (ou le processus choisi à surveiller) se ferme | -| **JoyChromium** | Restauration automatique à la fermeture de JoyChromium ; si vous revenez au PC avant, il reste ouvert en fenêtre | Si l'application se ferme ou si le PC s'éteint en pleine session, Console Mode restaure à sa prochaine ouverture (aussi à l'ouverture de session Windows, s'il démarre avec Windows) tout ce que la session a changé : écrans, son, RTSS, icônes du bureau et pointeur, et vous le signale. diff --git a/docs/GUIDE.md b/docs/GUIDE.md index 304a623..f339cc9 100644 --- a/docs/GUIDE.md +++ b/docs/GUIDE.md @@ -12,13 +12,12 @@ English · [Português (Brasil)](GUIDE.pt-BR.md) · [Español](GUIDE.es-ES.md) | **Playnite fullscreen** | Automatic restore (app stays in the tray) | | **Xbox mode** | Manual — use *Restore now*, the tray menu, or reopen the window | | **Custom app** | Automatic restore when the app (or the process you chose to watch) closes | -| **JoyChromium** | Automatic restore when you close JoyChromium; going back to the PC first leaves it open as a window | If the app closes or the PC shuts down in the middle of a session, the next time Console Mode opens (also at Windows sign-in, if it starts with Windows) it restores everything the session changed: displays, audio, RTSS, desktop icons and the pointer, and says so. **Custom app** opens any `.exe` you pick (RetroArch, another launcher…) from its own folder, with optional arguments, and moves its window to the game screen. The session ends a few seconds after that process closes. If the exe only starts another program and exits (a launcher stub), type the real program's process name in **Process to watch**. If the watched process never shows up, the session stays until you end it (hold Start + Select, the session menu or the tray). -**JoyChromium** shows up as a launcher when [JoyChromium](https://github.com/lippdev/joychromium), the team's TV browser driven with a controller, is installed (found in its per-user install folder or through its uninstaller entry). It opens full screen on the game screen with `--tv`, which doesn't change its own saved preference, and the session ends a few seconds after you close it (Start → *Close JoyChromium*). Going back to the PC while it's still open takes it out of full screen and leaves it as a window, tabs and all. +**Browser (JoyChromium)** is pinned in the session menu, right under the ControlFS file explorer: [JoyChromium](https://github.com/lippdev/joychromium), the team's TV browser driven with a controller, opens full screen over the game on the session screen. If it isn't installed, the first press downloads its newest release (checked against GitHub's SHA-256) and installs it, and the next press opens it. Going back to the PC while it's still open takes it out of full screen and leaves it as a window, tabs and all. You can also restore anytime from the tray (*Restore setup* / *Show window*). With black overlays, **ESC** dismisses the curtains. diff --git a/docs/GUIDE.pt-BR.md b/docs/GUIDE.pt-BR.md index 2fc4401..360c283 100644 --- a/docs/GUIDE.pt-BR.md +++ b/docs/GUIDE.pt-BR.md @@ -12,13 +12,12 @@ Detalhes que não cabem no [README](../README.pt-BR.md). | **Playnite tela cheia** | Restauração automática (app na bandeja) | | **Modo Xbox** | Manual — *Restaurar agora*, menu da bandeja ou reabrir a janela | | **Aplicativo personalizado** | Restauração automática quando o app (ou o processo escolhido para acompanhar) fecha | -| **JoyChromium** | Restauração automática quando você fecha o JoyChromium; voltando ao PC antes, ele fica aberto como janela | Se o app fechar ou o PC desligar no meio de uma sessão, na próxima vez que o Console Mode abrir (também ao entrar no Windows, se ele inicia com o Windows) ele restaura tudo o que a sessão mudou: telas, áudio, RTSS, ícones da área de trabalho e o ponteiro, e avisa. **Aplicativo personalizado** abre qualquer `.exe` que você escolher (RetroArch, outro launcher…) a partir da própria pasta, com argumentos opcionais, e move a janela dele para a tela de jogo. A sessão termina alguns segundos depois que esse processo fecha. Se o exe só abre outro programa e fecha (um launcher intermediário), digite o nome do processo do programa de verdade em **Processo a acompanhar**. Se o processo acompanhado nunca aparecer, a sessão continua até você encerrá-la (segurar Start + Select, o menu da sessão ou a bandeja). -**JoyChromium** aparece como iniciador quando o [JoyChromium](https://github.com/lippdev/joychromium), o navegador para a TV que se usa com o controle, está instalado (encontrado na pasta de instalação do usuário ou pela entrada do desinstalador). Ele abre em tela cheia na tela de jogo com `--tv`, sem mudar a preferência salva dele, e a sessão termina alguns segundos depois que você o fecha (Start → *Fechar o JoyChromium*). Voltar ao PC com ele ainda aberto o tira da tela cheia e o deixa como janela, com as abas. +**Navegador (JoyChromium)** fica fixo no menu da sessão, logo abaixo do explorador de arquivos ControlFS: o [JoyChromium](https://github.com/lippdev/joychromium), o navegador para a TV que se usa com o controle, abre em tela cheia por cima do jogo, na tela da sessão. Se ele não estiver instalado, o primeiro clique baixa a versão mais recente (conferida pelo SHA-256 do GitHub) e instala, e o próximo abre. Voltar ao PC com ele ainda aberto o tira da tela cheia e o deixa como janela, com as abas. Também dá para restaurar a qualquer momento pela bandeja (*Restaurar setup* / *Mostrar janela*). Com cortinas pretas, **ESC** remove o overlay. diff --git a/docs/GUIDE.ru-RU.md b/docs/GUIDE.ru-RU.md index a7e400b..af33822 100644 --- a/docs/GUIDE.ru-RU.md +++ b/docs/GUIDE.ru-RU.md @@ -12,7 +12,6 @@ | **Playnite в полноэкранном режиме** | Автоматическое восстановление (приложение остаётся в области уведомлений) | | **Режим Xbox** | Вручную: нажмите *«Восстановить сейчас»*, используйте меню в области уведомлений или снова откройте окно | | **Своё приложение** | Автоматическое восстановление, когда приложение (или выбранный отслеживаемый процесс) закрывается | -| **JoyChromium** | Автоматическое восстановление, когда вы закрываете JoyChromium; если вернуться к ПК раньше, он останется открытым в окне | Если приложение закроется или ПК выключится посреди сеанса, при следующем запуске Console Mode (в том числе при входе в Windows, если он запускается вместе с Windows) восстановит всё, что изменил сеанс: экраны, звук, RTSS, значки рабочего стола и указатель, и сообщит об этом. diff --git a/docs/PRD.md b/docs/PRD.md index c72ae5a..b24411c 100644 --- a/docs/PRD.md +++ b/docs/PRD.md @@ -355,7 +355,7 @@ Legenda: **P0** = necessário para a 1.7.0; **P1** = próxima versão; **P2** = - [x] **LAUNCH-006 —** Aplicativo personalizado: qualquer `.exe` com argumentos e processo a vigiar. (#161, 1.7.0-alpha.1; issue #111) - [ ] **LAUNCH-007 (P0) —** Logos oficiais dos lançadores nos tiles da Início, lidos dos apps instalados. (#169) - [ ] **LAUNCH-010 (P1) — Tako Launcher.** Tile na Início com logo, abrir o Tako em tela cheia na tela de jogo (`tako --console-session`), restaurar quando o Tako avisar o fim pela API (API-002), detectar a instalação. Aceite: entrar, jogar e voltar ao PC sem mouse, com o Tako. Depende de CMI-004 do Tako. -- [x] **LAUNCH-011 — JoyChromium.** Tile na Início quando instalado, abre em tela cheia (`--tv`) na tela de jogo, restaura ao fechar e, ao voltar ao PC com ele aberto, o deixa em janela (`--window`). Segue o `docs/INTEGRATIONS.md` do JoyChromium. (#175, 1.7.0) +- [x] **LAUNCH-011 — JoyChromium.** Auxiliar do menu da sessão, como o ControlFS (decisão do mantenedor em 29/10: não é iniciador nem aparece na Início): linha fixa abaixo do ControlFS, abre em tela cheia (`--tv`) na tela da sessão, instala pelo próprio menu se faltar (SHA-256 do GitHub, NSIS `/S` por usuário) e, ao voltar ao PC, o deixa em janela (`--window`). (#175, #181, 1.7.0) - [ ] **LAUNCH-012 (P2) —** Scripts próprios ao entrar e ao voltar (comando, `.bat` ou PowerShell), com tempo-limite e o comando de fim gravado em disco (CORE-012). Vem do #173, em PR próprio. - [ ] **LAUNCH-013 (P2) — Hydra Launcher.** Detectar a instalação, abrir em tela cheia na tela de jogo, restaurar ao fechar, logo oficial (D-19). _A definir: caminho, processo real e modo tela cheia._ - [ ] **LAUNCH-014 (P2) — AnyFSE.** Ferramenta que põe qualquer app como tela inicial da experiência de tela cheia do modo Xbox. Níveis: (a) detectar e conviver, sem briga com o modo Xbox do Console Mode; (b) mostrar o estado e abrir a configuração; (c) configurar o app de destino (Tako, Hydra, Playnite). Aceite mínimo: com o AnyFSE ativo, entrar e sair restaura a mesa. O Tako já tem o lado dele (PLAT-007 do Tako). diff --git a/docs/TESTING.md b/docs/TESTING.md index 4d7db8a..7e99db2 100644 --- a/docs/TESTING.md +++ b/docs/TESTING.md @@ -583,16 +583,16 @@ Pré-requisito: RivaTuner Statistics Server instalado, com "Show On-Screen Displ - [ ] **Copiar relatório** mostra o aviso de copiado e o texto colado no Bloco de Notas é igual ao da tela. - [ ] Com uma seção falhando (ex.: sem permissão de leitura do log), ela mostra "unavailable" e o resto do relatório continua aparecendo. -## JoyChromium como iniciador (1.7.0, #175) +## JoyChromium no menu da sessão (1.7.0, #175, #181) -Pré-condições: [JoyChromium](https://github.com/lippdev/joychromium) instalado pelo instalador oficial; um controle conectado; a tela de jogo configurada. +Pré-condições: um controle conectado; uma sessão em andamento (o menu também abre fora de sessão, como prévia). -- [ ] Com o JoyChromium instalado, a fileira da Início mostra o tile **JoyChromium** (azul, globo) entre Modo Xbox e Aplicativo personalizado, e Ajustes → Ao entrar no modo console → Abrir lista **JoyChromium**. Desinstalado (ou renomeando a pasta), a opção some e quem estava nela volta para a primeira opção. Resultado: ______ -- [ ] **Jogar agora** com o JoyChromium: as telas mudam, o JoyChromium abre em tela cheia **na tela de jogo** (não no monitor da mesa), sem barra de título, e o controle já navega nele. Resultado: ______ -- [ ] Fechar pelo controle (Start → *Fechar o JoyChromium*): a mesa volta sozinha em até ~10 s. Resultado: ______ -- [ ] Com o JoyChromium aberto, voltar ao PC (atalho de volta ou menu da sessão → Voltar ao PC): a mesa volta e o JoyChromium continua aberto **em janela**, com as mesmas abas. Resultado: ______ -- [ ] Com o JoyChromium já aberto em janela antes de começar: **Jogar agora** leva a janela aberta para a tela de jogo em tela cheia (não abre um segundo navegador). Resultado: ______ -- [ ] Passar o mouse sobre um link no JoyChromium durante a sessão (aparece a dica do endereço): a dica não é esticada nem levada para a TV. Resultado: ______ +- [ ] A Início e Ajustes → Ao entrar no modo console **não** mostram o JoyChromium como iniciador. Resultado: ______ +- [ ] Menu da sessão: a linha **Navegador (JoyChromium)** fica fixa logo abaixo do ControlFS, com o ícone do JoyChromium (ou um globo, se ele não estiver instalado). O tour do menu destaca as duas linhas juntas. Resultado: ______ +- [ ] Com o JoyChromium instalado, A na linha: o menu fecha e o JoyChromium abre em tela cheia **na tela de jogo** (não no monitor da mesa), e o controle navega nele. Resultado: ______ +- [ ] Com o JoyChromium já aberto: A na linha traz o mesmo para a frente em tela cheia, sem abrir outro. Resultado: ______ +- [ ] Com o JoyChromium aberto pelo menu, voltar ao PC: a mesa volta e o JoyChromium continua aberto **em janela**, com as mesmas abas. Um JoyChromium que você abriu sozinho na mesa, fora do menu, não é mexido. Resultado: ______ +- [ ] Sem o JoyChromium instalado (desinstale antes): A na linha mostra "Baixando… N%", depois "Instalando…" e "Instalado · aperte para abrir"; o próximo A o abre. Sem internet: a linha diz que não deu para instalar e o próximo A abre a página de releases. Resultado: ______ - [ ] Menu da sessão (Select + Y) por cima do JoyChromium: abre, e **Voltar ao jogo** devolve o foco ao navegador. Resultado: ______ ## Tirar o ponteiro do mouse do caminho (issue #172, #177) @@ -600,7 +600,7 @@ Pré-condições: [JoyChromium](https://github.com/lippdev/joychromium) instalad Pré-condições: a opção **Tirar o ponteiro do mouse do caminho** ligada (é o padrão); mouse conectado. - [ ] Deixar o ponteiro no meio do monitor da mesa e **Jogar agora** com o Steam Big Picture: quando o Big Picture aparece na TV, o ponteiro vai para o canto inferior direito da TV e continua lá depois que o Big Picture termina de abrir (o log mostra `Ponteiro: estacionado` duas vezes). Resultado: ______ -- [ ] O mesmo com Playnite, JoyChromium e Aplicativo personalizado. Com o modo Xbox, o ponteiro vai para o canto uns 4 s depois de abrir. Resultado: ______ +- [ ] O mesmo com Playnite e Aplicativo personalizado. Com o modo Xbox, o ponteiro vai para o canto uns 4 s depois de abrir. Resultado: ______ - [ ] Voltar ao PC: o ponteiro volta exatamente para onde estava no monitor da mesa (log: `Ponteiro: de volta a`). Resultado: ______ - [ ] Desligar a opção (Ajustes ou Sistema → Ao entrar no modo console): o ponteiro não é movido nem ao começar nem ao voltar. Resultado: ______ - [ ] Com **Esconder o ponteiro do mouse** ligado no menu da sessão, nada muda: o ponteiro some e reaparece no canto quando a opção é desligada. Resultado: ______ diff --git a/src/ConsoleMode/Models/Models.cs b/src/ConsoleMode/Models/Models.cs index 3b59afe..e03006f 100644 --- a/src/ConsoleMode/Models/Models.cs +++ b/src/ConsoleMode/Models/Models.cs @@ -399,6 +399,8 @@ public sealed class ConsoleRuntimeState public string? BackupAudioId { get; set; } /// The desktop icons read before the session; null when they aren't restored. public List? DesktopIcons { get; set; } + /// JoyChromium was opened from the session menu this session (it goes back to a window with the desk). + public bool JoyChromiumOpened { get; set; } /// Park the pointer this session; how many times it was parked, when, and where it was before. public bool ParkPointer { get; set; } public int PointerParks { get; set; } diff --git a/src/ConsoleMode/Resources/Strings.de-DE.json b/src/ConsoleMode/Resources/Strings.de-DE.json index dbf6aa1..0636352 100644 --- a/src/ConsoleMode/Resources/Strings.de-DE.json +++ b/src/ConsoleMode/Resources/Strings.de-DE.json @@ -93,6 +93,8 @@ "ControlFsInstalling": "Wird installiert…", "ControlFsInstallFailed": "Installation fehlgeschlagen · drücken, um die Downloadseite zu öffnen", "ControlFsInstalled": "Installiert · zum Öffnen drücken", + "JoyChromiumCard": "Browser (JoyChromium)", + "JoyChromiumOpen": "Surfe mit dem Controller im Web", "ControlFsMissingNote": "ControlFS ist nicht installiert. Die Downloadseite wird im Browser geöffnet.", "SessionWindowsCard": "Fenster", "SessionWindowsCount": "{0} geöffnet", @@ -269,8 +271,6 @@ "LaunchXbox": "Xbox-Modus (experimentell)", "LaunchCustomApp": "Eigene App", "LaunchCustomAppDescription": "Öffnet das Programm deiner Wahl (einen Emulator, einen anderen Launcher…). Deine Bildschirme werden automatisch wiederhergestellt, wenn du es schließt.", - "LaunchJoyChromium": "JoyChromium", - "LaunchJoyChromiumDescription": "Öffnet JoyChromium, den Browser für den Fernseher, den du mit dem Controller bedienst, im Vollbild. Beim Schließen kehren deine Bildschirme von selbst zurück; gehst du vorher zurück zum PC, verlässt er das Vollbild und bleibt als Fenster offen.", "CustomAppPathCard": "Zu öffnende App", "CustomAppBrowse": "Durchsuchen…", "CustomAppArgumentsCard": "Argumente", @@ -280,7 +280,6 @@ "CustomAppMissing": "Wähle die App, die geöffnet werden soll (eine .exe-Datei).", "CustomAppNotExe": "{0} ist keine .exe-Datei. Wähle die App, die geöffnet werden soll.", "CustomAppNotFound": "{0} wurde nicht gefunden. Wähle die App erneut.", - "JoyChromiumNotFound": "JoyChromium wurde nicht gefunden. Installiere es erneut oder wähle einen anderen Modus.", "FpsOverlayCard": "FPS-Anzeige", "FpsOverlayExternal": "Afterburner (unverändert lassen)", "FpsOverlayOff": "Aus (alles ausblenden)", @@ -387,7 +386,6 @@ "ActiveXbox": "Im Xbox-Modus erfolgt die Wiederherstellung manuell: Verwende „Jetzt wiederherstellen“ oder das Menü im Infobereich.", "ActiveSteam": "Schließe Big Picture, um deine Bildschirme automatisch wiederherzustellen.", "ActiveCustomApp": "Schließe {0}, um deine Bildschirme automatisch wiederherzustellen.", - "ActiveJoyChromium": "Schließe JoyChromium, und deine Bildschirme kehren von selbst zurück.", "InstallKindInstalled": "Version {0} · installiert", "InstallKindPortable": "Version {0} · portabel", "Download": "Herunterladen", @@ -418,7 +416,7 @@ "SessionTourProgress": "{0} von {1}", "SessionTourHint": "Führung", "SessionTourBackToGameBody": "Schließt dieses Menü und gibt die Steuerung unverändert an das Spiel zurück. {0} bewirkt dasselbe von überall im Menü.", - "SessionTourControlFsBody": "Öffnet ControlFS, einen für Controller entwickelten Dateimanager, im Vollbildmodus. Wenn er noch nicht installiert ist, wird er beim ersten Drücken heruntergeladen und installiert.", + "SessionTourControlFsBody": "Öffnet ControlFS, einen für Controller entwickelten Dateimanager, im Vollbildmodus. Wenn er noch nicht installiert ist, wird er beim ersten Drücken heruntergeladen und installiert. Direkt darunter macht JoyChromium dasselbe mit einem Browser für den Fernseher: Er öffnet sich über dem Spiel und bleibt beim Zurückkehren zum PC als Fenster offen.", "SessionTourVolumeBody": "Drücke {0}, um die Lautstärke der Audioausgabe anzupassen: ◀ ▶ ändern sie in 5er-Schritten, {1} schaltet stumm, und mit {0} oder {2} bist du fertig.", "SessionTourDisplayTitle": "Bildschirm und Ton", "SessionTourDisplayBody": "Auflösung, Bildwiederholrate, Audioausgabe und HDR des Gaming-Bildschirms. Änderungen gelten nur für diese Sitzung: Wenn du zum PC zurückkehrst, wird alles auf den vorherigen Zustand zurückgesetzt.", diff --git a/src/ConsoleMode/Resources/Strings.en-US.json b/src/ConsoleMode/Resources/Strings.en-US.json index bd17d84..5cb0d51 100644 --- a/src/ConsoleMode/Resources/Strings.en-US.json +++ b/src/ConsoleMode/Resources/Strings.en-US.json @@ -93,6 +93,8 @@ "ControlFsInstalling": "Installing…", "ControlFsInstallFailed": "Couldn't install · press to open the download page", "ControlFsInstalled": "Installed · press to open", + "JoyChromiumCard": "Browser (JoyChromium)", + "JoyChromiumOpen": "Browse the web with the controller", "ControlFsMissingNote": "ControlFS is not installed. Opening its download page in the browser.", "SessionWindowsCard": "Windows", "SessionWindowsCount": "{0} open", @@ -269,8 +271,6 @@ "LaunchXbox": "Xbox mode (experimental)", "LaunchCustomApp": "Custom app", "LaunchCustomAppDescription": "Opens the program you choose (an emulator, another launcher…). Your displays are restored automatically when you close it.", - "LaunchJoyChromium": "JoyChromium", - "LaunchJoyChromiumDescription": "Opens JoyChromium, the TV browser you drive with the controller, full screen. Your displays are restored when you close it; going back to the PC first takes it out of full screen and leaves it open as a window.", "CustomAppPathCard": "App to open", "CustomAppBrowse": "Browse…", "CustomAppArgumentsCard": "Arguments", @@ -280,7 +280,6 @@ "CustomAppMissing": "Choose the app to open (an .exe file).", "CustomAppNotExe": "{0} is not an .exe file. Choose the app to open.", "CustomAppNotFound": "Could not find {0}. Choose the app again.", - "JoyChromiumNotFound": "Couldn't find JoyChromium. Install it again or pick another mode.", "FpsOverlayCard": "FPS counter", "FpsOverlayExternal": "Afterburner (leave as is)", "FpsOverlayOff": "Off (hide everything)", @@ -387,7 +386,6 @@ "ActiveXbox": "In Xbox mode, restoration is manual: use Restore now or the system tray menu.", "ActiveSteam": "Close Big Picture to restore your displays automatically.", "ActiveCustomApp": "Close {0} to restore your displays automatically.", - "ActiveJoyChromium": "Close JoyChromium to restore your displays automatically.", "InstallKindInstalled": "Version {0} · installed", "InstallKindPortable": "Version {0} · portable", "Download": "Download", @@ -418,7 +416,7 @@ "SessionTourProgress": "{0} of {1}", "SessionTourHint": "Tour", "SessionTourBackToGameBody": "Closes this menu and hands the controller back to the game, just as it was. {0} does the same from anywhere in the menu.", - "SessionTourControlFsBody": "Opens ControlFS, a file explorer made for the controller, in full screen. If it isn't installed yet, the first press downloads and installs it.", + "SessionTourControlFsBody": "Opens ControlFS, a file explorer made for the controller, in full screen. If it isn't installed yet, the first press downloads and installs it. Right below, JoyChromium does the same with a browser for the TV: it opens over the game and, when you go back to the PC, stays open as a window.", "SessionTourVolumeBody": "Press {0} to adjust the volume of the audio output: ◀ ▶ change it in steps of 5, {1} mutes it, and {0} or {2} finish.", "SessionTourDisplayTitle": "Screen and sound", "SessionTourDisplayBody": "Resolution, refresh rate, audio output and HDR of the game screen. Whatever you change here lasts for this session only: back at the PC, everything goes back to how it was.", diff --git a/src/ConsoleMode/Resources/Strings.es-ES.json b/src/ConsoleMode/Resources/Strings.es-ES.json index 9144e77..0fb9c53 100644 --- a/src/ConsoleMode/Resources/Strings.es-ES.json +++ b/src/ConsoleMode/Resources/Strings.es-ES.json @@ -93,6 +93,8 @@ "ControlFsInstalling": "Instalando…", "ControlFsInstallFailed": "No se pudo instalar · pulsa para abrir la página de descarga", "ControlFsInstalled": "Instalado · pulsa para abrir", + "JoyChromiumCard": "Navegador (JoyChromium)", + "JoyChromiumOpen": "Navega por la web con el mando", "ControlFsMissingNote": "ControlFS no está instalado. Abriendo su página de descarga en el navegador.", "SessionWindowsCard": "Ventanas", "SessionWindowsCount": "{0} abiertas", @@ -269,8 +271,6 @@ "LaunchXbox": "Modo Xbox (experimental)", "LaunchCustomApp": "Aplicación personalizada", "LaunchCustomAppDescription": "Abre el programa que elijas (un emulador, otro launcher…). Al cerrarlo, tus pantallas vuelven solas.", - "LaunchJoyChromium": "JoyChromium", - "LaunchJoyChromiumDescription": "Abre JoyChromium, el navegador para la TV que se maneja con el mando, a pantalla completa. Al cerrarlo, tus pantallas vuelven solas; si vuelves al PC antes, sale de pantalla completa y queda abierto como ventana.", "CustomAppPathCard": "Aplicación que abrir", "CustomAppBrowse": "Examinar…", "CustomAppArgumentsCard": "Argumentos", @@ -280,7 +280,6 @@ "CustomAppMissing": "Elige la aplicación que abrir (un archivo .exe).", "CustomAppNotExe": "{0} no es un archivo .exe. Elige la aplicación que abrir.", "CustomAppNotFound": "No se encontró {0}. Vuelve a elegir la aplicación.", - "JoyChromiumNotFound": "No se encontró JoyChromium. Vuelve a instalarlo o elige otro modo.", "FpsOverlayCard": "Contador de FPS", "FpsOverlayExternal": "Afterburner (no tocar)", "FpsOverlayOff": "Desactivado (oculta todo)", @@ -387,7 +386,6 @@ "ActiveXbox": "En modo Xbox la restauración es manual: usa Restaurar ahora o el menú de la bandeja.", "ActiveSteam": "Cierra Big Picture para que tus pantallas vuelvan solas.", "ActiveCustomApp": "Cierra {0} para que tus pantallas vuelvan solas.", - "ActiveJoyChromium": "Cierra JoyChromium y tus pantallas vuelven solas.", "InstallKindInstalled": "Versión {0} · instalada", "InstallKindPortable": "Versión {0} · portátil", "Download": "Descargar", @@ -418,7 +416,7 @@ "SessionTourProgress": "{0} de {1}", "SessionTourHint": "Recorrido", "SessionTourBackToGameBody": "Cierra este menú y devuelve el mando al juego, tal como estaba. {0} hace lo mismo desde cualquier punto del menú.", - "SessionTourControlFsBody": "Abre ControlFS, un explorador de archivos hecho para el mando, a pantalla completa. Si todavía no está instalado, la primera pulsación lo descarga e instala.", + "SessionTourControlFsBody": "Abre ControlFS, un explorador de archivos hecho para el mando, a pantalla completa. Si todavía no está instalado, la primera pulsación lo descarga e instala. Justo debajo, JoyChromium hace lo mismo con un navegador para la TV: se abre sobre el juego y, al volver al PC, queda abierto en una ventana.", "SessionTourVolumeBody": "Pulsa {0} para ajustar el volumen de la salida de audio: ◀ ▶ lo cambian de 5 en 5, {1} lo silencia y {0} o {2} terminan el ajuste.", "SessionTourDisplayTitle": "Pantalla y sonido", "SessionTourDisplayBody": "Resolución, frecuencia de actualización, salida de audio y HDR de la pantalla de juego. Lo que cambies aquí vale solo para esta sesión: al volver al PC, todo vuelve a ser como era.", diff --git a/src/ConsoleMode/Resources/Strings.fr-FR.json b/src/ConsoleMode/Resources/Strings.fr-FR.json index a006757..db83e50 100644 --- a/src/ConsoleMode/Resources/Strings.fr-FR.json +++ b/src/ConsoleMode/Resources/Strings.fr-FR.json @@ -93,6 +93,8 @@ "ControlFsInstalling": "Installation…", "ControlFsInstallFailed": "Échec de l'installation · appuyez pour ouvrir la page de téléchargement", "ControlFsInstalled": "Installé · appuyez pour ouvrir", + "JoyChromiumCard": "Navigateur (JoyChromium)", + "JoyChromiumOpen": "Naviguez sur le Web à la manette", "ControlFsMissingNote": "ControlFS n'est pas installé. Ouverture de sa page de téléchargement dans le navigateur.", "SessionWindowsCard": "Fenêtres", "SessionWindowsCount": "{0} ouvertes", @@ -269,8 +271,6 @@ "LaunchXbox": "Mode Xbox (expérimental)", "LaunchCustomApp": "Application personnalisée", "LaunchCustomAppDescription": "Ouvre le programme de votre choix (un émulateur, un autre launcher…). Vos écrans sont restaurés automatiquement quand vous le fermez.", - "LaunchJoyChromium": "JoyChromium", - "LaunchJoyChromiumDescription": "Ouvre JoyChromium, le navigateur pour la TV qui se pilote à la manette, en plein écran. À sa fermeture, vos écrans reviennent tout seuls ; si vous revenez au PC avant, il quitte le plein écran et reste ouvert en fenêtre.", "CustomAppPathCard": "Application à ouvrir", "CustomAppBrowse": "Parcourir…", "CustomAppArgumentsCard": "Arguments de lancement", @@ -280,7 +280,6 @@ "CustomAppMissing": "Choisissez l'application à ouvrir (un fichier .exe).", "CustomAppNotExe": "{0} n'est pas un fichier .exe. Choisissez l'application à ouvrir.", "CustomAppNotFound": "{0} est introuvable. Choisissez à nouveau l'application.", - "JoyChromiumNotFound": "JoyChromium est introuvable. Réinstallez-le ou choisissez un autre mode.", "FpsOverlayCard": "Compteur de FPS", "FpsOverlayExternal": "Afterburner (ne pas toucher)", "FpsOverlayOff": "Désactivé (tout masquer)", @@ -387,7 +386,6 @@ "ActiveXbox": "En mode Xbox, la restauration est manuelle : utilisez Restaurer maintenant ou le menu de la zone de notification.", "ActiveSteam": "Fermez Big Picture pour restaurer automatiquement vos écrans.", "ActiveCustomApp": "Fermez {0} pour restaurer automatiquement vos écrans.", - "ActiveJoyChromium": "Fermez JoyChromium et vos écrans reviennent tout seuls.", "InstallKindInstalled": "Version {0} · installée", "InstallKindPortable": "Version {0} · portable", "Download": "Télécharger", @@ -418,7 +416,7 @@ "SessionTourProgress": "{0} sur {1}", "SessionTourHint": "Visite", "SessionTourBackToGameBody": "Ferme ce menu et rend la manette au jeu, comme avant. {0} fait de même depuis n'importe où dans le menu.", - "SessionTourControlFsBody": "Ouvre ControlFS, un explorateur de fichiers conçu pour la manette, en plein écran. S'il n'est pas encore installé, le premier appui le télécharge et l'installe.", + "SessionTourControlFsBody": "Ouvre ControlFS, un explorateur de fichiers conçu pour la manette, en plein écran. S'il n'est pas encore installé, le premier appui le télécharge et l'installe. Juste en dessous, JoyChromium fait de même avec un navigateur pour la TV : il s'ouvre par-dessus le jeu et, au retour sur le PC, reste ouvert en fenêtre.", "SessionTourVolumeBody": "Appuyez sur {0} pour régler le volume de la sortie audio : ◀ ▶ le modifient par paliers de 5, {1} le coupe, et {0} ou {2} terminent.", "SessionTourDisplayTitle": "Image et son", "SessionTourDisplayBody": "Résolution, fréquence d'actualisation, sortie audio et HDR de l'écran de jeu. Ce que vous modifiez ici ne vaut que pour cette session : de retour au PC, tout redevient comme avant.", diff --git a/src/ConsoleMode/Resources/Strings.pt-BR.json b/src/ConsoleMode/Resources/Strings.pt-BR.json index 98dcc25..10ad32e 100644 --- a/src/ConsoleMode/Resources/Strings.pt-BR.json +++ b/src/ConsoleMode/Resources/Strings.pt-BR.json @@ -93,6 +93,8 @@ "ControlFsInstalling": "Instalando…", "ControlFsInstallFailed": "Não deu para instalar · aperte para abrir a página de download", "ControlFsInstalled": "Instalado · aperte para abrir", + "JoyChromiumCard": "Navegador (JoyChromium)", + "JoyChromiumOpen": "Navegue pela web com o controle", "ControlFsMissingNote": "O ControlFS não está instalado. Abrindo a página de download no navegador.", "SessionWindowsCard": "Janelas", "SessionWindowsCount": "{0} abertas", @@ -269,8 +271,6 @@ "LaunchXbox": "Modo Xbox (experimental)", "LaunchCustomApp": "Aplicativo personalizado", "LaunchCustomAppDescription": "Abre o programa que você escolher (um emulador, outro launcher…). Ao fechar, suas telas voltam sozinhas.", - "LaunchJoyChromium": "JoyChromium", - "LaunchJoyChromiumDescription": "Abre o JoyChromium, o navegador para a TV que se usa com o controle, em tela cheia. Ao fechar, suas telas voltam sozinhas; ao voltar ao PC antes disso, ele sai da tela cheia e fica aberto como janela.", "CustomAppPathCard": "Aplicativo a abrir", "CustomAppBrowse": "Procurar…", "CustomAppArgumentsCard": "Argumentos", @@ -280,7 +280,6 @@ "CustomAppMissing": "Escolha o aplicativo a abrir (um arquivo .exe).", "CustomAppNotExe": "{0} não é um arquivo .exe. Escolha o aplicativo a abrir.", "CustomAppNotFound": "{0} não foi encontrado. Escolha o aplicativo de novo.", - "JoyChromiumNotFound": "O JoyChromium não foi encontrado. Instale-o de novo ou escolha outro modo.", "FpsOverlayCard": "Contador de FPS", "FpsOverlayExternal": "Afterburner (não mexer)", "FpsOverlayOff": "Desligado (esconde tudo)", @@ -387,7 +386,6 @@ "ActiveXbox": "No Modo Xbox a volta é manual: use Restaurar agora ou o menu da bandeja.", "ActiveSteam": "Feche o Big Picture e suas telas voltam sozinhas.", "ActiveCustomApp": "Feche o {0} e suas telas voltam sozinhas.", - "ActiveJoyChromium": "Feche o JoyChromium e suas telas voltam sozinhas.", "InstallKindInstalled": "Versão {0} · instalada", "InstallKindPortable": "Versão {0} · portátil", "Download": "Baixar", @@ -418,7 +416,7 @@ "SessionTourProgress": "{0} de {1}", "SessionTourHint": "Tour", "SessionTourBackToGameBody": "Fecha este menu e devolve o controle ao jogo, do jeito que estava. O {0} faz o mesmo de qualquer ponto do menu.", - "SessionTourControlFsBody": "Abre o ControlFS, um explorador de arquivos feito para o controle, em tela cheia. Se ele ainda não estiver instalado, o primeiro clique baixa e instala.", + "SessionTourControlFsBody": "Abre o ControlFS, um explorador de arquivos feito para o controle, em tela cheia. Se ele ainda não estiver instalado, o primeiro clique baixa e instala. Logo abaixo, o JoyChromium faz o mesmo com um navegador para a TV: abre por cima do jogo e, ao voltar ao PC, fica aberto em janela.", "SessionTourVolumeBody": "Aperte {0} para ajustar o volume da saída de áudio: ◀ ▶ mudam de 5 em 5, {1} deixa no mudo e {0} ou {2} terminam o ajuste.", "SessionTourDisplayTitle": "Tela e som", "SessionTourDisplayBody": "Resolução, taxa de atualização, saída de áudio e HDR da tela de jogo. O que você mudar aqui vale só para esta sessão: ao voltar ao PC, tudo volta a ser como era.", diff --git a/src/ConsoleMode/Resources/Strings.ru-RU.json b/src/ConsoleMode/Resources/Strings.ru-RU.json index e9cc3cb..0ca4cf4 100644 --- a/src/ConsoleMode/Resources/Strings.ru-RU.json +++ b/src/ConsoleMode/Resources/Strings.ru-RU.json @@ -93,6 +93,8 @@ "ControlFsInstalling": "Установка…", "ControlFsInstallFailed": "Не удалось установить · нажмите, чтобы открыть страницу загрузки", "ControlFsInstalled": "Установлен · нажмите, чтобы открыть", + "JoyChromiumCard": "Браузер (JoyChromium)", + "JoyChromiumOpen": "Сёрфинг в интернете с геймпадом", "ControlFsMissingNote": "ControlFS не установлен. Открываем страницу загрузки в браузере.", "SessionWindowsCard": "Окна", "SessionWindowsCount": "Открыто: {0}", @@ -269,8 +271,6 @@ "LaunchXbox": "Режим Xbox (экспериментально)", "LaunchCustomApp": "Своё приложение", "LaunchCustomAppDescription": "Открывает выбранную вами программу (эмулятор, другой лаунчер…). Экраны восстанавливаются автоматически, когда вы её закроете.", - "LaunchJoyChromium": "JoyChromium", - "LaunchJoyChromiumDescription": "Открывает JoyChromium — браузер для телевизора с управлением геймпадом — на весь экран. Когда вы его закроете, экраны вернутся сами; если вернуться к ПК раньше, он выйдет из полноэкранного режима и останется открытым в окне.", "CustomAppPathCard": "Открываемое приложение", "CustomAppBrowse": "Обзор…", "CustomAppArgumentsCard": "Аргументы", @@ -280,7 +280,6 @@ "CustomAppMissing": "Выберите приложение для запуска (файл .exe).", "CustomAppNotExe": "{0} — не файл .exe. Выберите приложение для запуска.", "CustomAppNotFound": "Не удалось найти {0}. Выберите приложение снова.", - "JoyChromiumNotFound": "JoyChromium не найден. Установите его снова или выберите другой режим.", "FpsOverlayCard": "Счётчик FPS", "FpsOverlayExternal": "Afterburner (не менять)", "FpsOverlayOff": "Выкл. (скрыть всё)", @@ -387,7 +386,6 @@ "ActiveXbox": "В режиме Xbox восстановление выполняется вручную: нажмите «Восстановить сейчас» или используйте меню в области уведомлений.", "ActiveSteam": "Закройте Big Picture, чтобы экраны восстановились автоматически.", "ActiveCustomApp": "Закройте {0}, чтобы экраны восстановились автоматически.", - "ActiveJoyChromium": "Закройте JoyChromium, и экраны вернутся сами.", "InstallKindInstalled": "Версия {0} · установленная", "InstallKindPortable": "Версия {0} · портативная", "Download": "Скачать", @@ -418,7 +416,7 @@ "SessionTourProgress": "{0} из {1}", "SessionTourHint": "Обзор", "SessionTourBackToGameBody": "Закрывает это меню и возвращает геймпад игре в том же состоянии. {0} делает то же самое из любого места меню.", - "SessionTourControlFsBody": "Открывает ControlFS — проводник для управления геймпадом — во весь экран. Если он ещё не установлен, первое нажатие скачает и установит его.", + "SessionTourControlFsBody": "Открывает ControlFS — проводник для управления геймпадом — во весь экран. Если он ещё не установлен, первое нажатие скачает и установит его. Сразу под ним JoyChromium делает то же самое с браузером для телевизора: открывается поверх игры и при возврате к ПК остаётся открытым в окне.", "SessionTourVolumeBody": "Нажмите {0}, чтобы настроить громкость аудиовыхода: ◀ ▶ меняют её с шагом 5, {1} выключает звук, а {0} или {2} завершают настройку.", "SessionTourDisplayTitle": "Экран и звук", "SessionTourDisplayBody": "Разрешение, частота обновления, аудиовыход и HDR игрового экрана. Изменения действуют только в этом сеансе: при возврате к ПК всё станет как было.", diff --git a/src/ConsoleMode/Services/ConsoleEngine.cs b/src/ConsoleMode/Services/ConsoleEngine.cs index 039aa7b..4ed0cc6 100644 --- a/src/ConsoleMode/Services/ConsoleEngine.cs +++ b/src/ConsoleMode/Services/ConsoleEngine.cs @@ -39,9 +39,6 @@ public void Start(AppConfig config, MonitorInfo? focusInfo, FuncGoing back to the PC with JoyChromium still open: it leaves full screen and stays as a window, tabs and all. + /// Going back to the PC with JoyChromium (opened from the session menu) still open: it leaves full screen and stays as a window, tabs and all. private void ReturnJoyChromiumToWindow() { - if (!JoyChromium.ShouldReturnToWindow(State.FullscreenMode, LaunchService.IsProcessRunning(JoyChromium.ProcessName))) return; + if (!JoyChromium.ShouldReturnToWindow(State.JoyChromiumOpened, LaunchService.IsProcessRunning(JoyChromium.ProcessName))) return; try { Launch.ReturnJoyChromiumToWindow(); diff --git a/src/ConsoleMode/Services/JoyChromium.cs b/src/ConsoleMode/Services/JoyChromium.cs index 06a6d08..33b187c 100644 --- a/src/ConsoleMode/Services/JoyChromium.cs +++ b/src/ConsoleMode/Services/JoyChromium.cs @@ -1,16 +1,20 @@ +using System.Text.Json; + namespace ConsoleMode.Services; +/// The JoyChromium installer of one release: what to download and the SHA-256 it must have. +public sealed record JoyChromiumSetup(string Version, string Url, string Name, string Digest, long Size); + /// -/// The "joyChromium" launch mode: JoyChromium, the team's controller-first browser for the TV, as the console -/// launcher. Follows its integration guide (docs/INTEGRATIONS.md in lippdev/joychromium): per-user install found by -/// its uninstall key, --tv to open full screen for this run only, a single instance that takes the arguments -/// of a second run, and several JoyChromium.exe processes of which only the main one has a window. Pure, so it's tested. +/// JoyChromium, the team's controller-first browser for the TV, as a helper of the session menu (like ControlFS): not +/// a launcher, but something to open over the game when the user wants the web with the controller. Follows its +/// integration guide (docs/INTEGRATIONS.md in lippdev/joychromium): per-user install found by its uninstall key, +/// --tv to open full screen for this run only, a single instance that takes the arguments of a second run, and +/// several JoyChromium.exe processes of which only the main one has a window. Pure, so it's tested. /// public static class JoyChromium { - public const string Mode = "joyChromium"; - - /// The process to watch, as Process.GetProcessesByName wants it. + /// The process to look for, as Process.GetProcessesByName wants it. public const string ProcessName = "JoyChromium"; /// Full screen, TV mode, for this run only: the user's saved preference doesn't change. @@ -22,6 +26,13 @@ public static class JoyChromium /// The installer's uninstall key (HKCU), a UUID derived from the appId; it doesn't change between versions. public const string UninstallKey = @"Software\Microsoft\Windows\CurrentVersion\Uninstall\1fc20e06-e3c1-52c5-9ba1-fcb355e6851d"; + public const string Repository = "lippdev/joychromium"; + public const string ReleasesUrl = "https://github.com/" + Repository + "/releases"; + public const string DownloadPrefix = "https://github.com/" + Repository + "/releases/download/"; + + /// NSIS one-click, per user: /S installs silently, without an admin prompt. + public const string SilentArgument = "/S"; + /// Where the per-user installer puts it: %LOCALAPPDATA%\Programs\joychromium\JoyChromium.exe. public static string DefaultPath(string localAppData) => Path.Combine(localAppData, "Programs", "joychromium", "JoyChromium.exe"); @@ -54,8 +65,48 @@ public static string DefaultPath(string localAppData) => } /// - /// Going back to the PC while it's still open: ask it to leave full screen (the open instance takes - /// --window) instead of closing it, so the tabs stay. Nothing to do once it has closed by itself. + /// Going back to the PC while the JoyChromium opened from the session menu is still open: ask it to leave full screen + /// (the open instance takes --window) instead of closing it, so the tabs stay. A JoyChromium the user had open + /// on the desk on their own is left alone. + /// + public static bool ShouldReturnToWindow(bool openedFromMenu, bool running) => openedFromMenu && running; + + /// "JoyChromium-0.1.3-alpha-win-x64.exe": the installer for this PC's processor (not the both-in-one "-win.exe"). + public static string SetupSuffix(bool arm64) => arm64 ? "-win-arm64.exe" : "-win-x64.exe"; + + /// + /// The installer of the newest release (GitHub lists them newest first). Its releases are pre-releases (alpha), so + /// those count; drafts don't. Only from this repository's downloads and only with GitHub's SHA-256 digest: the + /// newest release decides, and without both nothing is run (the release page opens instead). /// - public static bool ShouldReturnToWindow(string? mode, bool running) => mode == Mode && running; + public static JoyChromiumSetup? PickSetup(JsonElement releases, bool arm64) + { + if (releases.ValueKind != JsonValueKind.Array) return null; + var suffix = SetupSuffix(arm64); + foreach (var release in releases.EnumerateArray()) + { + if (release.ValueKind != JsonValueKind.Object) continue; + if (release.TryGetProperty("draft", out var draft) && draft.ValueKind == JsonValueKind.True) continue; + if (!release.TryGetProperty("assets", out var assets) || assets.ValueKind != JsonValueKind.Array) continue; + foreach (var asset in assets.EnumerateArray()) + { + var name = Text(asset, "name"); + if (!name.StartsWith("JoyChromium-", StringComparison.OrdinalIgnoreCase) + || !name.EndsWith(suffix, StringComparison.OrdinalIgnoreCase)) continue; + var url = Text(asset, "browser_download_url"); + var digest = Text(asset, "digest"); + if (!IsTrustedUrl(url) || !UpdateIntegrity.IsValidSha256Digest(digest)) return null; + var size = asset.TryGetProperty("size", out var s) && s.TryGetInt64(out var bytes) ? bytes : 0; + return new JoyChromiumSetup(Text(release, "tag_name").TrimStart('v', 'V'), url, name, digest, size); + } + } + return null; + } + + public static bool IsTrustedUrl(string? url) => + url is not null && url.StartsWith(DownloadPrefix, StringComparison.Ordinal); + + private static string Text(JsonElement element, string name) => + element.ValueKind == JsonValueKind.Object && element.TryGetProperty(name, out var value) && value.ValueKind == JsonValueKind.String + ? value.GetString() ?? "" : ""; } diff --git a/src/ConsoleMode/Services/JoyChromiumService.cs b/src/ConsoleMode/Services/JoyChromiumService.cs new file mode 100644 index 0000000..038d41d --- /dev/null +++ b/src/ConsoleMode/Services/JoyChromiumService.cs @@ -0,0 +1,141 @@ +using System.Diagnostics; +using System.Runtime.InteropServices; +using ConsoleMode.Models; +using ConsoleMode.Native; + +namespace ConsoleMode.Services; + +/// +/// Opens JoyChromium from the session menu, and installs it from there when it's missing (like ControlFS). It is a +/// separate app, never closed from here: going back to the PC only takes it out of full screen. +/// +public static class JoyChromiumService +{ + private static readonly TimeSpan SetupTimeout = TimeSpan.FromMinutes(5); + + public static string? FindExe() => LaunchService.GetJoyChromiumPath(); + + /// + /// Starts it full screen (--tv), or hands --tv to the open one, which comes to the front and goes full + /// screen: a second run passes its arguments on and exits. False when it isn't installed or didn't start. + /// + public static bool Open() + { + var exe = FindExe(); + if (exe is null) return false; + try + { + var psi = new ProcessStartInfo { FileName = exe, UseShellExecute = false, WorkingDirectory = Path.GetDirectoryName(exe)! }; + psi.ArgumentList.Add(JoyChromium.TvArgument); + Process.Start(psi)?.Dispose(); + AppLog.Write("JoyChromium: aberto pelo menu da sessão"); + return true; + } + catch (Exception ex) + { + AppLog.Write($"JoyChromium: abrir: {ex.Message}"); + return false; + } + } + + /// + /// --tv opens it full screen wherever Windows puts it, which may be a screen other than the session's: once its + /// window is up, it is moved over the session screen. Runs off the UI thread; never throws. + /// + public static void EnsureOnScreen(ScreenRect? screen) + { + if (screen is null || screen.Width <= 0 || screen.Height <= 0) return; + try + { + var deadline = Environment.TickCount64 + 15000; + nint hwnd = 0; + while (Environment.TickCount64 < deadline) + { + // The largest of its windows: Windows can report a tooltip as the "main" one. + hwnd = LaunchService.GetProcessWindows(JoyChromium.ProcessName).FirstOrDefault(); + if (hwnd != 0 && NativeWindows.GetWindowArea(hwnd) > 200000) break; + hwnd = 0; + Thread.Sleep(300); + } + if (hwnd == 0) { AppLog.Write("JoyChromium: janela não apareceu para levar à tela da sessão"); return; } + Thread.Sleep(500); + if (NativeWindows.TryGetWindowRect(hwnd, out var l, out var t, out var w, out var h) + && ControlFsLocator.IsFullScreen(l, t, w, h, screen.X, screen.Y, screen.Width, screen.Height)) return; + + NativeWindows.MoveWindowToRect(hwnd, screen.X, screen.Y, screen.Width, screen.Height); + if (NativeWindows.GetForegroundWindow() != hwnd) NativeWindows.ForceForeground(hwnd); + AppLog.Write("JoyChromium: levado para a tela da sessão"); + } + catch (Exception ex) { AppLog.Write($"JoyChromium: tela da sessão: {ex.Message}"); } + } + + /// Not installed and the install didn't work: the release page opens in the browser. + public static void OpenDownloadPage() + { + try { Process.Start(new ProcessStartInfo(JoyChromium.ReleasesUrl) { UseShellExecute = true })?.Dispose(); } + catch (Exception ex) { AppLog.Write($"JoyChromium: página de download: {ex.Message}"); } + } + + /// + /// Downloads the installer of its newest release for this processor, checks it against GitHub's SHA-256 and runs it + /// silently (per user, no admin prompt). Returns the installed exe; throws with the reason otherwise. + /// gets the download from 0 to 1, then once the setup runs. + /// + public static async Task InstallAsync(IProgress? progress, CancellationToken ct = default) + { + if (IsSetupRunning()) throw new InvalidOperationException("outro instalador do JoyChromium ainda está rodando"); + + var arm64 = RuntimeInformation.OSArchitecture == Architecture.Arm64; + var setup = await UpdateService.FindJoyChromiumSetupAsync(arm64, ct) + ?? throw new InvalidOperationException("nenhuma release com instalador verificável"); + var dir = Path.Combine(Path.GetTempPath(), "ConsoleModeUpdate"); + Directory.CreateDirectory(dir); + var file = Path.Combine(dir, setup.Name); + try + { + await UpdateService.DownloadAsync(setup.Url, file, progress, ct); + if (!await UpdateIntegrity.VerifyFileAsync(file, setup.Digest, ct)) + throw new InvalidDataException("o SHA-256 do instalador não confere"); + AppLog.Write($"JoyChromium: instalador {setup.Version} baixado e verificado"); + + progress?.Report(double.PositiveInfinity); + using var process = Process.Start(new ProcessStartInfo + { + FileName = file, + Arguments = JoyChromium.SilentArgument, + UseShellExecute = false + }) ?? throw new InvalidOperationException("o instalador não iniciou"); + using var timeout = CancellationTokenSource.CreateLinkedTokenSource(ct); + timeout.CancelAfter(SetupTimeout); + try { await process.WaitForExitAsync(timeout.Token); } + catch (OperationCanceledException) + { + try { process.Kill(entireProcessTree: true); } catch { /* already gone */ } + await process.WaitForExitAsync(CancellationToken.None); + throw new TimeoutException($"o instalador não terminou em {SetupTimeout.TotalMinutes:0} min e foi encerrado"); + } + if (process.ExitCode != 0) throw new InvalidOperationException($"o instalador saiu com o código {process.ExitCode}"); + } + finally + { + try { File.Delete(file); } catch { /* the temp folder is cleaned by Windows */ } + } + + return FindExe() ?? throw new InvalidOperationException("instalado, mas o JoyChromium.exe não foi encontrado"); + } + + /// The setup is "JoyChromium-0.1.3-alpha-win-x64"; the browser itself is "JoyChromium" (no dash). + private static bool IsSetupRunning() + { + var running = false; + foreach (var process in Process.GetProcesses()) + { + using (process) + { + try { running |= process.ProcessName.StartsWith("JoyChromium-", StringComparison.OrdinalIgnoreCase); } + catch { /* exited while listing */ } + } + } + return running; + } +} diff --git a/src/ConsoleMode/Services/LaunchArt.cs b/src/ConsoleMode/Services/LaunchArt.cs index 53b5630..8cbec13 100644 --- a/src/ConsoleMode/Services/LaunchArt.cs +++ b/src/ConsoleMode/Services/LaunchArt.cs @@ -18,7 +18,6 @@ public static class LaunchArt "bigPicture" => new("", 0xFF2A475E, 0xFF15202C), "playnite" => new("", 0xFF4A3470, 0xFF1D1530), "xboxMode" => new("", 0xFF178A17, 0xFF0A440A), - "joyChromium" => new("", 0xFF1E6FD0, 0xFF0B2A52), "customApp" => new("", 0xFF3A4250, 0xFF1A1E25), _ => Neutral }; diff --git a/src/ConsoleMode/Services/LaunchService.cs b/src/ConsoleMode/Services/LaunchService.cs index 693f180..7699721 100644 --- a/src/ConsoleMode/Services/LaunchService.cs +++ b/src/ConsoleMode/Services/LaunchService.cs @@ -35,9 +35,6 @@ public void StartCustomApp(string exePath, string? arguments) })?.Dispose(); } - /// "joyChromium": full screen on the TV for this run (). - public void StartJoyChromium(string exePath) => StartCustomApp(exePath, JoyChromium.TvArgument); - /// /// Asks the open JoyChromium to leave full screen: a second run hands its arguments to the open /// instance and exits at once, so this doesn't open another browser. @@ -48,8 +45,6 @@ public void ReturnJoyChromiumToWindow() StartCustomApp(exe, JoyChromium.WindowArgument); } - public bool IsJoyChromiumAvailable() => GetJoyChromiumPath() is not null; - /// The installed JoyChromium.exe: the per-user install folder, else the uninstall key's icon path. public static string? GetJoyChromiumPath() { diff --git a/src/ConsoleMode/Services/LocalizationService.cs b/src/ConsoleMode/Services/LocalizationService.cs index dc9e5e0..bfebe5b 100644 --- a/src/ConsoleMode/Services/LocalizationService.cs +++ b/src/ConsoleMode/Services/LocalizationService.cs @@ -235,6 +235,8 @@ internal void NotifyAll() public string ControlFsInstalling => LocalizationService.Get(nameof(ControlFsInstalling)); public string ControlFsInstallFailed => LocalizationService.Get(nameof(ControlFsInstallFailed)); public string ControlFsInstalled => LocalizationService.Get(nameof(ControlFsInstalled)); + public string JoyChromiumCard => LocalizationService.Get(nameof(JoyChromiumCard)); + public string JoyChromiumOpen => LocalizationService.Get(nameof(JoyChromiumOpen)); public string SessionWindowsCard => LocalizationService.Get(nameof(SessionWindowsCard)); public string SwitcherEmpty => LocalizationService.Get(nameof(SwitcherEmpty)); public string SwitcherOpen => LocalizationService.Get(nameof(SwitcherOpen)); diff --git a/src/ConsoleMode/Services/UpdateService.cs b/src/ConsoleMode/Services/UpdateService.cs index 4f09409..85ade8a 100644 --- a/src/ConsoleMode/Services/UpdateService.cs +++ b/src/ConsoleMode/Services/UpdateService.cs @@ -171,6 +171,19 @@ public static async Task ApplyAsync(UpdateInfo update, IProgress? progre return ControlFsRelease.Pick(doc.RootElement); } + internal static async Task FindJoyChromiumSetupAsync(bool arm64, CancellationToken ct = default) + { + using var timeout = CancellationTokenSource.CreateLinkedTokenSource(ct); + timeout.CancelAfter(CheckTimeout); + using var request = new HttpRequestMessage(HttpMethod.Get, $"https://api.github.com/repos/{JoyChromium.Repository}/releases?per_page=10"); + request.Headers.Accept.ParseAdd("application/vnd.github+json"); + using var response = await Http.SendAsync(request, timeout.Token); + response.EnsureSuccessStatusCode(); + await using var stream = await response.Content.ReadAsStreamAsync(timeout.Token); + using var doc = await JsonDocument.ParseAsync(stream, cancellationToken: timeout.Token); + return JoyChromium.PickSetup(doc.RootElement, arm64); + } + internal static async Task DownloadAsync(string url, string file, IProgress? progress, CancellationToken ct) { // Cancelled only when no bytes arrive for StallTimeout, not after a fixed total time. diff --git a/src/ConsoleMode/SessionMenuWindow.xaml b/src/ConsoleMode/SessionMenuWindow.xaml index 01f9b0e..42ab87d 100644 --- a/src/ConsoleMode/SessionMenuWindow.xaml +++ b/src/ConsoleMode/SessionMenuWindow.xaml @@ -159,6 +159,7 @@ + + + + diff --git a/src/ConsoleMode/SessionMenuWindow.xaml.cs b/src/ConsoleMode/SessionMenuWindow.xaml.cs index df5c4ac..7d807c7 100644 --- a/src/ConsoleMode/SessionMenuWindow.xaml.cs +++ b/src/ConsoleMode/SessionMenuWindow.xaml.cs @@ -479,7 +479,7 @@ private void OnPointerPressed(object sender, PointerRoutedEventArgs e) private FrameworkElement[] TourTargets(SessionTourStop stop) => stop switch { SessionTourStop.BackToGame => [FirstRow], - SessionTourStop.ControlFs => [ControlFsRow], + SessionTourStop.ControlFs => [ControlFsRow, JoyChromiumRow], SessionTourStop.Volume => [VolumeRow], SessionTourStop.Display => [ModeRow, AudioRow, HdrRow], SessionTourStop.Fps => [FpsRow, FpsOverlayRow], diff --git a/src/ConsoleMode/ViewModels/MainViewModel.JoyChromium.cs b/src/ConsoleMode/ViewModels/MainViewModel.JoyChromium.cs new file mode 100644 index 0000000..ad9980c --- /dev/null +++ b/src/ConsoleMode/ViewModels/MainViewModel.JoyChromium.cs @@ -0,0 +1,130 @@ +using System.Runtime.InteropServices.WindowsRuntime; +using CommunityToolkit.Mvvm.ComponentModel; +using CommunityToolkit.Mvvm.Input; +using ConsoleMode.Native; +using ConsoleMode.Services; +using Microsoft.UI.Xaml.Media; +using Microsoft.UI.Xaml.Media.Imaging; + +namespace ConsoleMode.ViewModels; + +// The pinned "Browser (JoyChromium)" row of the session menu, right under ControlFS and working the same way: +// installed, A opens it full screen over the game; missing, A downloads and installs it (the row shows the progress). +public partial class MainViewModel +{ + /// Whether JoyChromium is installed; decides what the row says. Read each time the menu opens. + [ObservableProperty, NotifyPropertyChangedFor(nameof(JoyChromiumRowText))] private bool _joyChromiumInstalled; + /// The install asked from the row is running (it goes on if the menu is closed meanwhile). + [ObservableProperty, NotifyPropertyChangedFor(nameof(JoyChromiumRowText))] private bool _joyChromiumInstalling; + [ObservableProperty, NotifyPropertyChangedFor(nameof(JoyChromiumRowText))] private double _joyChromiumProgress; + [ObservableProperty, NotifyPropertyChangedFor(nameof(JoyChromiumRowText))] private bool _joyChromiumSetupRunning; + /// The install failed: the next press opens the release page instead. + [ObservableProperty, NotifyPropertyChangedFor(nameof(JoyChromiumRowText))] private bool _joyChromiumInstallFailed; + [ObservableProperty, NotifyPropertyChangedFor(nameof(JoyChromiumRowText))] private bool _joyChromiumJustInstalled; + + // Downloading, installing and their outcomes read the same as ControlFS's row. + public string JoyChromiumRowText => + JoyChromiumSetupRunning ? Texts.ControlFsInstalling + : JoyChromiumInstalling ? LocalizationService.Get("ControlFsDownloading", (int)JoyChromiumProgress) + : JoyChromiumJustInstalled ? Texts.ControlFsInstalled + : JoyChromiumInstalled ? Texts.JoyChromiumOpen + : JoyChromiumInstallFailed ? Texts.ControlFsInstallFailed + : Texts.ControlFsMissing; + + /// The icon of the installed JoyChromium.exe, like the ControlFS logo beside it; a globe while it is missing. + [ObservableProperty, NotifyPropertyChangedFor(nameof(ShowJoyChromiumGlobe))] private ImageSource? _joyChromiumLogo; + public bool ShowJoyChromiumGlobe => JoyChromiumLogo is null; + private string? _joyChromiumLogoExe; + + /// When the session menu opens: installed or not, and a failed install is offered again. + private void RefreshJoyChromiumRow() + { + JoyChromiumInstalled = JoyChromiumService.FindExe() is not null; + _ = LoadJoyChromiumLogoAsync(); + if (!JoyChromiumInstalling) JoyChromiumInstallFailed = false; + JoyChromiumJustInstalled = false; + } + + private async Task LoadJoyChromiumLogoAsync() + { + var exe = JoyChromiumService.FindExe(); + if (exe is null) + { + // Uninstalled since: back to the globe. + _joyChromiumLogoExe = null; + JoyChromiumLogo = null; + return; + } + if (string.Equals(exe, _joyChromiumLogoExe, StringComparison.OrdinalIgnoreCase)) return; + _joyChromiumLogoExe = exe; + var bitmap = await Task.Run(() => WindowIcons.ForApp(exe, null, 128)); + if (bitmap is null || !string.Equals(exe, _joyChromiumLogoExe, StringComparison.OrdinalIgnoreCase)) return; + try + { + var image = new WriteableBitmap(bitmap.Width, bitmap.Height); + using (var stream = image.PixelBuffer.AsStream()) stream.Write(bitmap.Pixels); + JoyChromiumLogo = image; + } + catch (Exception ex) { AppLog.Write($"JoyChromium: ícone: {ex.Message}"); } + } + + /// + /// The menu closes and JoyChromium opens full screen on the session screen (or the open one comes to the front). + /// Missing, the same press installs it, and the next one opens it; if the install failed, the release page opens. + /// + [RelayCommand] + private void OpenJoyChromium() + { + if (JoyChromiumInstalling) return; + var installed = JoyChromiumService.FindExe() is not null; + JoyChromiumInstalled = installed; + if (!installed && !JoyChromiumInstallFailed) + { + _ = InstallJoyChromiumAsync(); + return; + } + var screen = IsConsoleActive ? Engine.State.FocusMonitorRect : Engine.Monitors.GetMonitorRect(SessionMonitorName, Engine.State); + CloseSessionMenu(); + if (installed && JoyChromiumService.Open()) + { + // Going back to the PC takes it out of full screen (see ConsoleEngine.ReturnJoyChromiumToWindow). + if (IsConsoleActive) Engine.State.JoyChromiumOpened = true; + _ = Task.Run(() => JoyChromiumService.EnsureOnScreen(screen)); + return; + } + AppLog.Write("JoyChromium: não instalado, abrindo a página de download"); + JoyChromiumService.OpenDownloadPage(); + } + + private async Task InstallJoyChromiumAsync() + { + JoyChromiumProgress = 0; + JoyChromiumInstalling = true; + AppLog.Write("JoyChromium: não instalado, baixando e instalando a pedido do menu"); + try + { + var progress = new Progress(p => + { + if (!JoyChromiumInstalling) return; // a late report, after it ended + if (double.IsPositiveInfinity(p)) JoyChromiumSetupRunning = true; + else JoyChromiumProgress = p * 100; + }); + await Task.Run(() => JoyChromiumService.InstallAsync(progress)); + AppLog.Write("JoyChromium: instalado"); + JoyChromiumInstalled = true; + JoyChromiumJustInstalled = true; + _ = LoadJoyChromiumLogoAsync(); + } + catch (Exception ex) + { + AppLog.Write($"JoyChromium: instalar: {ex.Message}"); + JoyChromiumInstallFailed = true; + } + finally + { + JoyChromiumSetupRunning = false; + JoyChromiumInstalling = false; + } + // Not opened from here, like ControlFS: the menu may have lost the foreground by now. The next A opens it. + } +} diff --git a/src/ConsoleMode/ViewModels/MainViewModel.LaunchTiles.cs b/src/ConsoleMode/ViewModels/MainViewModel.LaunchTiles.cs index d07d9e4..8ffbffb 100644 --- a/src/ConsoleMode/ViewModels/MainViewModel.LaunchTiles.cs +++ b/src/ConsoleMode/ViewModels/MainViewModel.LaunchTiles.cs @@ -78,7 +78,6 @@ private async Task LoadLaunchLogoAsync(LaunchTile tile) "bigPicture" => (SteamSession.FindSteamExe(), (string?)null), "playnite" => (Engine.Launch.GetPlaynitePath(), null), "xboxMode" => (null, LaunchArt.XboxAppId), - JoyChromium.Mode => (LaunchService.GetJoyChromiumPath(), null), CustomApp.Mode => (CustomApp.CleanPath(CustomAppPath), null), _ => (null, null) }; diff --git a/src/ConsoleMode/ViewModels/MainViewModel.SessionMenu.cs b/src/ConsoleMode/ViewModels/MainViewModel.SessionMenu.cs index 84cb359..8e6f4fc 100644 --- a/src/ConsoleMode/ViewModels/MainViewModel.SessionMenu.cs +++ b/src/ConsoleMode/ViewModels/MainViewModel.SessionMenu.cs @@ -96,6 +96,7 @@ public void ToggleSessionMenu() // A failed install is offered again each time the menu opens (the connection may be back). if (!ControlFsInstalling) ControlFsInstallFailed = false; ControlFsJustInstalled = false; + RefreshJoyChromiumRow(); RefreshSessionHeader(); StartSessionClock(); _ = RefreshBatteryAsync(); diff --git a/src/ConsoleMode/ViewModels/MainViewModel.cs b/src/ConsoleMode/ViewModels/MainViewModel.cs index e3e3ade..ca8d1cc 100644 --- a/src/ConsoleMode/ViewModels/MainViewModel.cs +++ b/src/ConsoleMode/ViewModels/MainViewModel.cs @@ -55,8 +55,6 @@ public partial class MainViewModel : ObservableObject [ObservableProperty] private string _summaryTitle = ""; [ObservableProperty] private string _activeDescText = ""; [ObservableProperty] private bool _isPlayniteAvailable = true; - /// JoyChromium is only offered as a launcher when it's installed. - private bool _isJoyChromiumAvailable; [ObservableProperty] private string _fpsStatusText = ""; [ObservableProperty] private string _audioHintText = LocalizationService.Get("AudioHint"); [ObservableProperty] private ComboOption? _selectedHideStrategy; @@ -85,7 +83,6 @@ public partial class MainViewModel : ObservableObject { "playnite" => LocalizationService.Get("LaunchPlayniteDescription"), "xboxMode" => LocalizationService.Get("LaunchXboxDescription"), - JoyChromium.Mode => LocalizationService.Get("LaunchJoyChromiumDescription"), CustomApp.Mode => LocalizationService.Get("LaunchCustomAppDescription"), _ => LocalizationService.Get("LaunchSteamDescription") }; @@ -125,7 +122,6 @@ public async Task InitializeAsync(bool interactive = true) Engine.UiInvoker = RunOnUi; IsPlayniteAvailable = Engine.Launch.IsPlayniteAvailable(); - _isJoyChromiumAvailable = Engine.Launch.IsJoyChromiumAvailable(); IsFpsAvailable = Engine.Rtss.IsReady; BuildLocalizedOptions(); @@ -192,8 +188,6 @@ private void BuildLocalizedOptions() if (IsPlayniteAvailable) LaunchOptions.Add(new ComboOption { Text = LocalizationService.Get("LaunchPlaynite"), Value = "playnite" }); LaunchOptions.Add(new ComboOption { Text = LocalizationService.Get("LaunchXbox"), Value = "xboxMode" }); - if (_isJoyChromiumAvailable) - LaunchOptions.Add(new ComboOption { Text = LocalizationService.Get("LaunchJoyChromium"), Value = JoyChromium.Mode }); LaunchOptions.Add(new ComboOption { Text = LocalizationService.Get("LaunchCustomApp"), Value = CustomApp.Mode }); SelectedLaunch = LaunchOptions.FirstOrDefault(x => x.Value == launchValue) ?? LaunchOptions[0]; RebuildLaunchTiles(); @@ -324,7 +318,6 @@ private void Apply(LoadResult data) CustomAppArguments = config.CustomAppArguments ?? ""; CustomAppWatchProcess = config.CustomAppWatchProcess ?? ""; IsPlayniteAvailable = Engine.Launch.IsPlayniteAvailable(); - _isJoyChromiumAvailable = Engine.Launch.IsJoyChromiumAvailable(); BuildLocalizedOptions(); SelectedLaunch = LaunchOptions.FirstOrDefault(o => o.Value == config.FullscreenMode) ?? LaunchOptions[0]; ApplyTv(config.Tv); @@ -1064,7 +1057,6 @@ private static string JoinLocalized(IReadOnlyList values) { "playnite" => LocalizationService.Get("ActivePlaynite"), "xboxMode" => LocalizationService.Get("ActiveXbox"), - JoyChromium.Mode => LocalizationService.Get("ActiveJoyChromium"), CustomApp.Mode => LocalizationService.Get("ActiveCustomApp", LaunchService.GetCustomAppName(config.CustomAppPath)), _ => LocalizationService.Get("ActiveSteam") }; diff --git a/tests/ConsoleMode.Tests/JoyChromiumTests.cs b/tests/ConsoleMode.Tests/JoyChromiumTests.cs index 873c366..557ef2c 100644 --- a/tests/ConsoleMode.Tests/JoyChromiumTests.cs +++ b/tests/ConsoleMode.Tests/JoyChromiumTests.cs @@ -33,12 +33,50 @@ public void The_default_folder_wins_then_the_uninstall_key() } [Theory] - [InlineData("joyChromium", true, true)] - [InlineData("joyChromium", false, false)] // it closed itself: that's what ended the session - [InlineData("bigPicture", true, false)] // open on its own, outside our session: left alone - [InlineData(null, true, false)] - public void Going_back_to_the_pc_only_unfullscreens_our_open_session(string? mode, bool running, bool expected) => - Assert.Equal(expected, JoyChromium.ShouldReturnToWindow(mode, running)); + [InlineData(true, true, true)] + [InlineData(true, false, false)] // it was closed: nothing to take out of full screen + [InlineData(false, true, false)] // open on the desk on its own, not from the menu: left alone + public void Going_back_to_the_pc_only_unfullscreens_the_one_opened_from_the_menu(bool openedFromMenu, bool running, bool expected) => + Assert.Equal(expected, JoyChromium.ShouldReturnToWindow(openedFromMenu, running)); + + private const string Releases = """ + [ + { "tag_name": "v0.1.4-alpha", "draft": true, "prerelease": true, "assets": [] }, + { "tag_name": "v0.1.3-alpha", "draft": false, "prerelease": true, "assets": [ + { "name": "JoyChromium-0.1.3-alpha-win-arm64.exe", "size": 116896155, + "browser_download_url": "https://github.com/lippdev/joychromium/releases/download/v0.1.3-alpha/JoyChromium-0.1.3-alpha-win-arm64.exe", + "digest": "sha256:8f6c97c71438f6aaefeadbcbf62070da968cac1f2370934b88e5e42f153884f1" }, + { "name": "JoyChromium-0.1.3-alpha-win-x64.exe", "size": 122413381, + "browser_download_url": "https://github.com/lippdev/joychromium/releases/download/v0.1.3-alpha/JoyChromium-0.1.3-alpha-win-x64.exe", + "digest": "sha256:c29c5663fa8fbf75528dfe6fa1a43e6fd602c872762f5026b749f3dcd139a148" }, + { "name": "JoyChromium-0.1.3-alpha-win.exe", "size": 238365764, + "browser_download_url": "https://github.com/lippdev/joychromium/releases/download/v0.1.3-alpha/JoyChromium-0.1.3-alpha-win.exe", + "digest": "sha256:8ad9395bbcf7dffeaa6bc365525d4b500f0e7a77885383e68ef8838bcf32018f" } + ] } + ] + """; + + [Fact] + public void The_newest_published_release_gives_the_installer_for_this_processor() + { + using var doc = System.Text.Json.JsonDocument.Parse(Releases); + var x64 = JoyChromium.PickSetup(doc.RootElement, arm64: false)!; + Assert.Equal("0.1.3-alpha", x64.Version); // the draft above it is skipped, the pre-release counts + Assert.Equal("JoyChromium-0.1.3-alpha-win-x64.exe", x64.Name); + Assert.Equal("sha256:c29c5663fa8fbf75528dfe6fa1a43e6fd602c872762f5026b749f3dcd139a148", x64.Digest); + Assert.Equal("JoyChromium-0.1.3-alpha-win-arm64.exe", JoyChromium.PickSetup(doc.RootElement, arm64: true)!.Name); + } + + [Theory] + [InlineData("https://example.com/JoyChromium-0.1.3-alpha-win-x64.exe", "sha256:c29c5663fa8fbf75528dfe6fa1a43e6fd602c872762f5026b749f3dcd139a148")] + [InlineData("https://github.com/someone/fork/releases/download/v1/JoyChromium-0.1.3-alpha-win-x64.exe", "sha256:c29c5663fa8fbf75528dfe6fa1a43e6fd602c872762f5026b749f3dcd139a148")] + [InlineData("https://github.com/lippdev/joychromium/releases/download/v0.1.3-alpha/JoyChromium-0.1.3-alpha-win-x64.exe", "")] + public void Nothing_is_installed_from_elsewhere_or_without_a_digest(string url, string digest) + { + var json = $$"""[{ "tag_name": "v0.1.3-alpha", "assets": [{ "name": "JoyChromium-0.1.3-alpha-win-x64.exe", "browser_download_url": "{{url}}", "digest": "{{digest}}" }] }]"""; + using var doc = System.Text.Json.JsonDocument.Parse(json); + Assert.Null(JoyChromium.PickSetup(doc.RootElement, arm64: false)); + } [Fact] public void The_watched_process_is_what_the_launcher_guide_names() => diff --git a/tests/ConsoleMode.Tests/LaunchArtTests.cs b/tests/ConsoleMode.Tests/LaunchArtTests.cs index afe5674..8f532be 100644 --- a/tests/ConsoleMode.Tests/LaunchArtTests.cs +++ b/tests/ConsoleMode.Tests/LaunchArtTests.cs @@ -8,7 +8,6 @@ public sealed class LaunchArtTests [InlineData("bigPicture")] [InlineData("playnite")] [InlineData("xboxMode")] - [InlineData("joyChromium")] [InlineData("customApp")] public void Every_launcher_has_its_own_tile(string mode) { @@ -22,7 +21,7 @@ public void Every_launcher_has_its_own_tile(string mode) [Fact] public void Launchers_look_different_from_each_other() { - var tiles = new[] { "bigPicture", "playnite", "xboxMode", "joyChromium", "customApp" }.Select(LaunchArt.For).ToList(); + var tiles = new[] { "bigPicture", "playnite", "xboxMode", "customApp" }.Select(LaunchArt.For).ToList(); Assert.Equal(tiles.Count, tiles.Select(t => t.From).Distinct().Count()); }